123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234 |
- /*!
- Stencil Compiler v2.15.1 | MIT Licensed | https://stenciljs.com
- */
- (function(exports) {
- 'use strict';
- if (typeof globalThis === 'undefined') {
- if (typeof self !== 'undefined') {
- self.globalThis = self;
- } else if (typeof window !== 'undefined') {
- window.globalThis = window;
- } else if (typeof global !== 'undefined') {
- global.globalThis = global;
- }
- }
- const Buffer = globalThis.Buffer || {};
- const process = globalThis.process || {};
- if (!process.argv) {
- process.argv = [''];
- }
- let __cwd = '/';
- if (!process.cwd) {
- process.cwd = () => __cwd;
- }
- if (!process.chdir) {
- process.chdir = (v) => __cwd = v;
- }
- if (!process.nextTick) {
- const resolved = Promise.resolve();
- process.nextTick = (cb) => resolved.then(cb);
- }
- if (!process.platform) {
- process.platform = 'stencil';
- }
- if (!process.version) {
- process.version = 'v12.0.0';
- }
- process.browser = !!globalThis.location;
- // 'path' module extracted from Node.js v8.11.1 (only the posix part)
- function assertPath(path) {
- if (typeof path !== 'string') {
- throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
- }
- }
- // Resolves . and .. elements in a path with directory names
- function normalizeStringPosix(path, allowAboveRoot) {
- var res = '';
- var lastSegmentLength = 0;
- var lastSlash = -1;
- var dots = 0;
- var code;
- for (var i = 0; i <= path.length; ++i) {
- if (i < path.length)
- code = path.charCodeAt(i);
- else if (code === 47 /*/*/)
- break;
- else
- code = 47 /*/*/;
- if (code === 47 /*/*/) {
- if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
- if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {
- if (res.length > 2) {
- var lastSlashIndex = res.lastIndexOf('/');
- if (lastSlashIndex !== res.length - 1) {
- if (lastSlashIndex === -1) {
- res = '';
- lastSegmentLength = 0;
- } else {
- res = res.slice(0, lastSlashIndex);
- lastSegmentLength = res.length - 1 - res.lastIndexOf('/');
- }
- lastSlash = i;
- dots = 0;
- continue;
- }
- } else if (res.length === 2 || res.length === 1) {
- res = '';
- lastSegmentLength = 0;
- lastSlash = i;
- dots = 0;
- continue;
- }
- }
- if (allowAboveRoot) {
- if (res.length > 0)
- res += '/..';
- else
- res = '..';
- lastSegmentLength = 2;
- }
- } else {
- if (res.length > 0)
- res += '/' + path.slice(lastSlash + 1, i);
- else
- res = path.slice(lastSlash + 1, i);
- lastSegmentLength = i - lastSlash - 1;
- }
- lastSlash = i;
- dots = 0;
- } else if (code === 46 /*.*/ && dots !== -1) {
- ++dots;
- } else {
- dots = -1;
- }
- }
- return res;
- }
- function _format(sep, pathObject) {
- var dir = pathObject.dir || pathObject.root;
- var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');
- if (!dir) {
- return base;
- }
- if (dir === pathObject.root) {
- return dir + base;
- }
- return dir + sep + base;
- }
- var posix$2 = {
- // path.resolve([from ...], to)
- resolve: function resolve() {
- var resolvedPath = '';
- var resolvedAbsolute = false;
- var cwd;
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path;
- if (i >= 0)
- path = arguments[i];
- else {
- if (cwd === undefined)
- cwd = process.cwd();
- path = cwd;
- }
- assertPath(path);
- // Skip empty entries
- if (path.length === 0) {
- continue;
- }
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
- }
- // At this point the path should be resolved to a full absolute path, but
- // handle relative paths to be safe (might happen when process.cwd() fails)
- // Normalize the path
- resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
- if (resolvedAbsolute) {
- if (resolvedPath.length > 0)
- return '/' + resolvedPath;
- else
- return '/';
- } else if (resolvedPath.length > 0) {
- return resolvedPath;
- } else {
- return '.';
- }
- },
- normalize: function normalize(path) {
- assertPath(path);
- if (path.length === 0) return '.';
- var isAbsolute = path.charCodeAt(0) === 47 /*/*/;
- var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;
- // Normalize the path
- path = normalizeStringPosix(path, !isAbsolute);
- if (path.length === 0 && !isAbsolute) path = '.';
- if (path.length > 0 && trailingSeparator) path += '/';
- if (isAbsolute) return '/' + path;
- return path;
- },
- isAbsolute: function isAbsolute(path) {
- assertPath(path);
- return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
- },
- join: function join() {
- if (arguments.length === 0)
- return '.';
- var joined;
- for (var i = 0; i < arguments.length; ++i) {
- var arg = arguments[i];
- assertPath(arg);
- if (arg.length > 0) {
- if (joined === undefined)
- joined = arg;
- else
- joined += '/' + arg;
- }
- }
- if (joined === undefined)
- return '.';
- return posix$2.normalize(joined);
- },
- relative: function relative(from, to) {
- assertPath(from);
- assertPath(to);
- if (from === to) return '';
- from = posix$2.resolve(from);
- to = posix$2.resolve(to);
- if (from === to) return '';
- // Trim any leading backslashes
- var fromStart = 1;
- for (; fromStart < from.length; ++fromStart) {
- if (from.charCodeAt(fromStart) !== 47 /*/*/)
- break;
- }
- var fromEnd = from.length;
- var fromLen = fromEnd - fromStart;
- // Trim any leading backslashes
- var toStart = 1;
- for (; toStart < to.length; ++toStart) {
- if (to.charCodeAt(toStart) !== 47 /*/*/)
- break;
- }
- var toEnd = to.length;
- var toLen = toEnd - toStart;
- // Compare paths to find the longest common path from root
- var length = fromLen < toLen ? fromLen : toLen;
- var lastCommonSep = -1;
- var i = 0;
- for (; i <= length; ++i) {
- if (i === length) {
- if (toLen > length) {
- if (to.charCodeAt(toStart + i) === 47 /*/*/) {
- // We get here if `from` is the exact base path for `to`.
- // For example: from='/foo/bar'; to='/foo/bar/baz'
- return to.slice(toStart + i + 1);
- } else if (i === 0) {
- // We get here if `from` is the root
- // For example: from='/'; to='/foo'
- return to.slice(toStart + i);
- }
- } else if (fromLen > length) {
- if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
- // We get here if `to` is the exact base path for `from`.
- // For example: from='/foo/bar/baz'; to='/foo/bar'
- lastCommonSep = i;
- } else if (i === 0) {
- // We get here if `to` is the root.
- // For example: from='/foo'; to='/'
- lastCommonSep = 0;
- }
- }
- break;
- }
- var fromCode = from.charCodeAt(fromStart + i);
- var toCode = to.charCodeAt(toStart + i);
- if (fromCode !== toCode)
- break;
- else if (fromCode === 47 /*/*/)
- lastCommonSep = i;
- }
- var out = '';
- // Generate the relative path based on the path difference between `to`
- // and `from`
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
- if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
- if (out.length === 0)
- out += '..';
- else
- out += '/..';
- }
- }
- // Lastly, append the rest of the destination (`to`) path that comes after
- // the common path parts
- if (out.length > 0)
- return out + to.slice(toStart + lastCommonSep);
- else {
- toStart += lastCommonSep;
- if (to.charCodeAt(toStart) === 47 /*/*/)
- ++toStart;
- return to.slice(toStart);
- }
- },
- _makeLong: function _makeLong(path) {
- return path;
- },
- dirname: function dirname(path) {
- assertPath(path);
- if (path.length === 0) return '.';
- var code = path.charCodeAt(0);
- var hasRoot = code === 47 /*/*/;
- var end = -1;
- var matchedSlash = true;
- for (var i = path.length - 1; i >= 1; --i) {
- code = path.charCodeAt(i);
- if (code === 47 /*/*/) {
- if (!matchedSlash) {
- end = i;
- break;
- }
- } else {
- // We saw the first non-path separator
- matchedSlash = false;
- }
- }
- if (end === -1) return hasRoot ? '/' : '.';
- if (hasRoot && end === 1) return '//';
- return path.slice(0, end);
- },
- basename: function basename(path, ext) {
- if (ext !== undefined && typeof ext !== 'string') throw new TypeError('"ext" argument must be a string');
- assertPath(path);
- var start = 0;
- var end = -1;
- var matchedSlash = true;
- var i;
- if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
- if (ext.length === path.length && ext === path) return '';
- var extIdx = ext.length - 1;
- var firstNonSlashEnd = -1;
- for (i = path.length - 1; i >= 0; --i) {
- var code = path.charCodeAt(i);
- if (code === 47 /*/*/) {
- // If we reached a path separator that was not part of a set of path
- // separators at the end of the string, stop now
- if (!matchedSlash) {
- start = i + 1;
- break;
- }
- } else {
- if (firstNonSlashEnd === -1) {
- // We saw the first non-path separator, remember this index in case
- // we need it if the extension ends up not matching
- matchedSlash = false;
- firstNonSlashEnd = i + 1;
- }
- if (extIdx >= 0) {
- // Try to match the explicit extension
- if (code === ext.charCodeAt(extIdx)) {
- if (--extIdx === -1) {
- // We matched the extension, so mark this as the end of our path
- // component
- end = i;
- }
- } else {
- // Extension does not match, so our result is the entire path
- // component
- extIdx = -1;
- end = firstNonSlashEnd;
- }
- }
- }
- }
- if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;
- return path.slice(start, end);
- } else {
- for (i = path.length - 1; i >= 0; --i) {
- if (path.charCodeAt(i) === 47 /*/*/) {
- // If we reached a path separator that was not part of a set of path
- // separators at the end of the string, stop now
- if (!matchedSlash) {
- start = i + 1;
- break;
- }
- } else if (end === -1) {
- // We saw the first non-path separator, mark this as the end of our
- // path component
- matchedSlash = false;
- end = i + 1;
- }
- }
- if (end === -1) return '';
- return path.slice(start, end);
- }
- },
- extname: function extname(path) {
- assertPath(path);
- var startDot = -1;
- var startPart = 0;
- var end = -1;
- var matchedSlash = true;
- // Track the state of characters (if any) we see before our first dot and
- // after any path separator we find
- var preDotState = 0;
- for (var i = path.length - 1; i >= 0; --i) {
- var code = path.charCodeAt(i);
- if (code === 47 /*/*/) {
- // If we reached a path separator that was not part of a set of path
- // separators at the end of the string, stop now
- if (!matchedSlash) {
- startPart = i + 1;
- break;
- }
- continue;
- }
- if (end === -1) {
- // We saw the first non-path separator, mark this as the end of our
- // extension
- matchedSlash = false;
- end = i + 1;
- }
- if (code === 46 /*.*/) {
- // If this is our first dot, mark it as the start of our extension
- if (startDot === -1)
- startDot = i;
- else if (preDotState !== 1)
- preDotState = 1;
- } else if (startDot !== -1) {
- // We saw a non-dot and non-path separator before our dot, so we should
- // have a good chance at having a non-empty extension
- preDotState = -1;
- }
- }
- if (startDot === -1 || end === -1 ||
- // We saw a non-dot character immediately before the dot
- preDotState === 0 ||
- // The (right-most) trimmed path component is exactly '..'
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
- return '';
- }
- return path.slice(startDot, end);
- },
- format: function format(pathObject) {
- if (pathObject === null || typeof pathObject !== 'object') {
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
- }
- return _format('/', pathObject);
- },
- parse: function parse(path) {
- assertPath(path);
- var ret = { root: '', dir: '', base: '', ext: '', name: '' };
- if (path.length === 0) return ret;
- var code = path.charCodeAt(0);
- var isAbsolute = code === 47 /*/*/;
- var start;
- if (isAbsolute) {
- ret.root = '/';
- start = 1;
- } else {
- start = 0;
- }
- var startDot = -1;
- var startPart = 0;
- var end = -1;
- var matchedSlash = true;
- var i = path.length - 1;
- // Track the state of characters (if any) we see before our first dot and
- // after any path separator we find
- var preDotState = 0;
- // Get non-dir info
- for (; i >= start; --i) {
- code = path.charCodeAt(i);
- if (code === 47 /*/*/) {
- // If we reached a path separator that was not part of a set of path
- // separators at the end of the string, stop now
- if (!matchedSlash) {
- startPart = i + 1;
- break;
- }
- continue;
- }
- if (end === -1) {
- // We saw the first non-path separator, mark this as the end of our
- // extension
- matchedSlash = false;
- end = i + 1;
- }
- if (code === 46 /*.*/) {
- // If this is our first dot, mark it as the start of our extension
- if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;
- } else if (startDot !== -1) {
- // We saw a non-dot and non-path separator before our dot, so we should
- // have a good chance at having a non-empty extension
- preDotState = -1;
- }
- }
- if (startDot === -1 || end === -1 ||
- // We saw a non-dot character immediately before the dot
- preDotState === 0 ||
- // The (right-most) trimmed path component is exactly '..'
- preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
- if (end !== -1) {
- if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);
- }
- } else {
- if (startPart === 0 && isAbsolute) {
- ret.name = path.slice(1, startDot);
- ret.base = path.slice(1, end);
- } else {
- ret.name = path.slice(startPart, startDot);
- ret.base = path.slice(startPart, end);
- }
- ret.ext = path.slice(startDot, end);
- }
- if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';
- return ret;
- },
- sep: '/',
- delimiter: ':',
- win32: null,
- posix: null
- };
- posix$2.posix = posix$2;
- var pathBrowserify = posix$2;
- const IS_NODE_ENV = typeof global !== 'undefined' &&
- typeof require === 'function' &&
- !!global.process &&
- typeof __filename === 'string' &&
- (!global.origin || typeof global.origin !== 'string');
- const OS_PLATFORM = IS_NODE_ENV ? process.platform : '';
- const IS_WINDOWS_ENV = OS_PLATFORM === 'win32';
- const IS_CASE_SENSITIVE_FILE_NAMES = !IS_WINDOWS_ENV;
- const IS_BROWSER_ENV = typeof location !== 'undefined' && typeof navigator !== 'undefined' && typeof XMLHttpRequest !== 'undefined';
- const IS_WEB_WORKER_ENV = IS_BROWSER_ENV && typeof self !== 'undefined' && typeof self.importScripts === 'function';
- const HAS_WEB_WORKER = IS_BROWSER_ENV && typeof Worker === 'function';
- const IS_FETCH_ENV = typeof fetch === 'function';
- const requireFunc = IS_NODE_ENV ? require : () => { };
- const getCurrentDirectory = IS_NODE_ENV ? process.cwd : () => '/';
- /**
- * Default style mode id
- */
- const DEFAULT_STYLE_MODE = '$';
- /**
- * File names and value
- */
- const COLLECTION_MANIFEST_FILE_NAME = 'collection-manifest.json';
- const formatComponentRuntimeMeta = (compilerMeta, includeMethods) => {
- let flags = 0;
- if (compilerMeta.encapsulation === 'shadow') {
- flags |= 1 /* shadowDomEncapsulation */;
- if (compilerMeta.shadowDelegatesFocus) {
- flags |= 16 /* shadowDelegatesFocus */;
- }
- }
- else if (compilerMeta.encapsulation === 'scoped') {
- flags |= 2 /* scopedCssEncapsulation */;
- }
- if (compilerMeta.encapsulation !== 'shadow' && compilerMeta.htmlTagNames.includes('slot')) {
- flags |= 4 /* hasSlotRelocation */;
- }
- if (compilerMeta.hasMode) {
- flags |= 32 /* hasMode */;
- }
- const members = formatComponentRuntimeMembers(compilerMeta, includeMethods);
- const hostListeners = formatHostListeners(compilerMeta);
- return trimFalsy([
- flags,
- compilerMeta.tagName,
- Object.keys(members).length > 0 ? members : undefined,
- hostListeners.length > 0 ? hostListeners : undefined,
- ]);
- };
- const stringifyRuntimeData = (data) => {
- const json = JSON.stringify(data);
- if (json.length > 10000) {
- // JSON metadata is big, JSON.parse() is faster
- // https://twitter.com/mathias/status/1143551692732030979
- return `JSON.parse(${JSON.stringify(json)})`;
- }
- return json;
- };
- const formatComponentRuntimeMembers = (compilerMeta, includeMethods = true) => {
- return {
- ...formatPropertiesRuntimeMember(compilerMeta.properties),
- ...formatStatesRuntimeMember(compilerMeta.states),
- ...(includeMethods ? formatMethodsRuntimeMember(compilerMeta.methods) : {}),
- };
- };
- const formatPropertiesRuntimeMember = (properties) => {
- const runtimeMembers = {};
- properties.forEach((member) => {
- runtimeMembers[member.name] = trimFalsy([
- /**
- * [0] member type
- */
- formatFlags(member),
- formatAttrName(member),
- ]);
- });
- return runtimeMembers;
- };
- const formatFlags = (compilerProperty) => {
- let type = formatPropType(compilerProperty.type);
- if (compilerProperty.mutable) {
- type |= 1024 /* Mutable */;
- }
- if (compilerProperty.reflect) {
- type |= 512 /* ReflectAttr */;
- }
- return type;
- };
- const formatAttrName = (compilerProperty) => {
- if (typeof compilerProperty.attribute === 'string') {
- // string attr name means we should observe this attribute
- if (compilerProperty.name === compilerProperty.attribute) {
- // property name and attribute name are the exact same
- // true value means to use the property name for the attribute name
- return undefined;
- }
- // property name and attribute name are not the same
- // so we need to return the actual string value
- // example: "multiWord" !== "multi-word"
- return compilerProperty.attribute;
- }
- // we shouldn't even observe an attribute for this property
- return undefined;
- };
- const formatPropType = (type) => {
- if (type === 'string') {
- return 1 /* String */;
- }
- if (type === 'number') {
- return 2 /* Number */;
- }
- if (type === 'boolean') {
- return 4 /* Boolean */;
- }
- if (type === 'any') {
- return 8 /* Any */;
- }
- return 16 /* Unknown */;
- };
- const formatStatesRuntimeMember = (states) => {
- const runtimeMembers = {};
- states.forEach((member) => {
- runtimeMembers[member.name] = [
- 32 /* State */,
- ];
- });
- return runtimeMembers;
- };
- const formatMethodsRuntimeMember = (methods) => {
- const runtimeMembers = {};
- methods.forEach((member) => {
- runtimeMembers[member.name] = [
- 64 /* Method */,
- ];
- });
- return runtimeMembers;
- };
- const formatHostListeners = (compilerMeta) => {
- return compilerMeta.listeners.map((compilerListener) => {
- const hostListener = [
- computeListenerFlags(compilerListener),
- compilerListener.name,
- compilerListener.method,
- ];
- return hostListener;
- });
- };
- const computeListenerFlags = (listener) => {
- let flags = 0;
- if (listener.capture) {
- flags |= 2 /* Capture */;
- }
- if (listener.passive) {
- flags |= 1 /* Passive */;
- }
- switch (listener.target) {
- case 'document':
- flags |= 4 /* TargetDocument */;
- break;
- case 'window':
- flags |= 8 /* TargetWindow */;
- break;
- case 'body':
- flags |= 16 /* TargetBody */;
- break;
- case 'parent':
- flags |= 32 /* TargetParent */;
- break;
- }
- return flags;
- };
- const trimFalsy = (data) => {
- const arr = data;
- for (var i = arr.length - 1; i >= 0; i--) {
- if (arr[i]) {
- break;
- }
- // if falsy, safe to pop()
- arr.pop();
- }
- return arr;
- };
- const toLowerCase = (str) => str.toLowerCase();
- const toDashCase = (str) => toLowerCase(str
- .replace(/([A-Z0-9])/g, (g) => ' ' + g[0])
- .trim()
- .replace(/ /g, '-'));
- const dashToPascalCase$1 = (str) => toLowerCase(str)
- .split('-')
- .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
- .join('');
- const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
- const noop$1 = () => {
- /* noop*/
- };
- const sortBy = (array, prop) => {
- return array.slice().sort((a, b) => {
- const nameA = prop(a);
- const nameB = prop(b);
- if (nameA < nameB)
- return -1;
- if (nameA > nameB)
- return 1;
- return 0;
- });
- };
- const flatOne = (array) => {
- if (array.flat) {
- return array.flat(1);
- }
- return array.reduce((result, item) => {
- result.push(...item);
- return result;
- }, []);
- };
- const unique = (array, predicate = (i) => i) => {
- const set = new Set();
- return array.filter((item) => {
- const key = predicate(item);
- if (key == null) {
- return true;
- }
- if (set.has(key)) {
- return false;
- }
- set.add(key);
- return true;
- });
- };
- const fromEntries = (entries) => {
- const object = {};
- for (const [key, value] of entries) {
- object[key] = value;
- }
- return object;
- };
- const pluck = (obj, keys) => {
- return keys.reduce((final, key) => {
- if (obj[key]) {
- final[key] = obj[key];
- }
- return final;
- }, {});
- };
- const isBoolean$1 = (v) => typeof v === 'boolean';
- const isDefined = (v) => v !== null && v !== undefined;
- const isFunction = (v) => typeof v === 'function';
- const isNumber$1 = (v) => typeof v === 'number';
- const isObject$4 = (val) => val != null && typeof val === 'object' && Array.isArray(val) === false;
- const isString$1 = (v) => typeof v === 'string';
- const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
- const isPromise = (v) => !!v && (typeof v === 'object' || typeof v === 'function') && typeof v.then === 'function';
- const isGlob = (str) => {
- const chars = { '{': '}', '(': ')', '[': ']' };
- /* eslint-disable-next-line max-len */
- const regex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
- if (str === '') {
- return false;
- }
- let match;
- while ((match = regex.exec(str))) {
- if (match[2])
- return true;
- let idx = match.index + match[0].length;
- // if an open bracket/brace/paren is escaped,
- // set the index to the next closing character
- const open = match[1];
- const close = open ? chars[open] : null;
- if (open && close) {
- const n = str.indexOf(close, idx);
- if (n !== -1) {
- idx = n + 1;
- }
- }
- str = str.slice(idx);
- }
- return false;
- };
- /**
- * Checks if the path is the OS root path, such as "/" or "C:\"
- */
- const isRootPath = (p) => p === '/' || windowsPathRegex.test(p);
- // https://github.com/nodejs/node/blob/5883a59b21a97e8b7339f435c977155a2c29ba8d/lib/path.js#L43
- const windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/;
- /**
- * Iterate through a series of diagnostics to provide minor fix-ups for various edge cases, deduplicate messages, etc.
- * @param compilerCtx the current compiler context
- * @param diagnostics the diagnostics to normalize
- * @returns the normalize documents
- */
- const normalizeDiagnostics = (compilerCtx, diagnostics) => {
- const normalizedErrors = [];
- const normalizedOthers = [];
- const dups = new Set();
- for (let i = 0; i < diagnostics.length; i++) {
- const d = normalizeDiagnostic(compilerCtx, diagnostics[i]);
- const key = d.absFilePath + d.code + d.messageText + d.type;
- if (dups.has(key)) {
- continue;
- }
- dups.add(key);
- const total = normalizedErrors.length + normalizedOthers.length;
- if (d.level === 'error') {
- normalizedErrors.push(d);
- }
- else if (total < MAX_ERRORS) {
- normalizedOthers.push(d);
- }
- }
- return [...normalizedErrors, ...normalizedOthers];
- };
- /**
- * Perform post-processing on a `Diagnostic` to handle a few message edge cases, massaging error message text and
- * updating build failure contexts
- * @param compilerCtx the current compiler
- * @param diagnostic the diagnostic to normalize
- * @returns the altered diagnostic
- */
- const normalizeDiagnostic = (compilerCtx, diagnostic) => {
- if (diagnostic.messageText) {
- if (typeof diagnostic.messageText.message === 'string') {
- diagnostic.messageText = diagnostic.messageText.message;
- }
- else if (typeof diagnostic.messageText === 'string' && diagnostic.messageText.indexOf('Error: ') === 0) {
- diagnostic.messageText = diagnostic.messageText.slice(7);
- }
- }
- if (diagnostic.messageText) {
- if (diagnostic.messageText.includes(`Cannot find name 'h'`)) {
- diagnostic.header = `Missing "h" import for JSX types`;
- diagnostic.messageText = `In order to load accurate JSX types for components, the "h" function must be imported from "@stencil/core" by each component using JSX. For example: import { Component, h } from '@stencil/core';`;
- try {
- const sourceText = compilerCtx.fs.readFileSync(diagnostic.absFilePath);
- const srcLines = splitLineBreaks(sourceText);
- for (let i = 0; i < srcLines.length; i++) {
- const srcLine = srcLines[i];
- if (srcLine.includes('@stencil/core')) {
- const msgLines = [];
- const beforeLineIndex = i - 1;
- if (beforeLineIndex > -1) {
- const beforeLine = {
- lineIndex: beforeLineIndex,
- lineNumber: beforeLineIndex + 1,
- text: srcLines[beforeLineIndex],
- errorCharStart: -1,
- errorLength: -1,
- };
- msgLines.push(beforeLine);
- }
- const errorLine = {
- lineIndex: i,
- lineNumber: i + 1,
- text: srcLine,
- errorCharStart: 0,
- errorLength: -1,
- };
- msgLines.push(errorLine);
- diagnostic.lineNumber = errorLine.lineNumber;
- diagnostic.columnNumber = srcLine.indexOf('}');
- const afterLineIndex = i + 1;
- if (afterLineIndex < srcLines.length) {
- const afterLine = {
- lineIndex: afterLineIndex,
- lineNumber: afterLineIndex + 1,
- text: srcLines[afterLineIndex],
- errorCharStart: -1,
- errorLength: -1,
- };
- msgLines.push(afterLine);
- }
- diagnostic.lines = msgLines;
- break;
- }
- }
- }
- catch (e) { }
- }
- }
- return diagnostic;
- };
- /**
- * Split a corpus by newlines. Carriage returns are treated a newlines.
- * @param sourceText the corpus to split
- * @returns the split text
- */
- const splitLineBreaks = (sourceText) => {
- if (typeof sourceText !== 'string')
- return [];
- sourceText = sourceText.replace(/\\r/g, '\n');
- return sourceText.split('\n');
- };
- const escapeHtml = (unsafe) => {
- if (unsafe === undefined)
- return 'undefined';
- if (unsafe === null)
- return 'null';
- if (typeof unsafe !== 'string') {
- unsafe = unsafe.toString();
- }
- return unsafe
- .replace(/&/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
- };
- const MAX_ERRORS = 25;
- /**
- * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
- * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
- * to attach the specifics of the error message.
- *
- * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
- *
- * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
- * @returns the created `Diagnostic`
- */
- const buildError = (diagnostics) => {
- const diagnostic = {
- level: 'error',
- type: 'build',
- header: 'Build Error',
- messageText: 'build error',
- relFilePath: null,
- absFilePath: null,
- lines: [],
- };
- if (diagnostics) {
- diagnostics.push(diagnostic);
- }
- return diagnostic;
- };
- /**
- * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little
- * detail attached to it regarding the specifics of the warning - it is the responsibility of the caller of this method
- * to attach the specifics of the warning message.
- *
- * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
- *
- * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
- * @returns the created `Diagnostic`
- */
- const buildWarn = (diagnostics) => {
- const diagnostic = {
- level: 'warn',
- type: 'build',
- header: 'Build Warn',
- messageText: 'build warn',
- relFilePath: null,
- absFilePath: null,
- lines: [],
- };
- diagnostics.push(diagnostic);
- return diagnostic;
- };
- const buildJsonFileError = (compilerCtx, diagnostics, jsonFilePath, msg, pkgKey) => {
- const err = buildError(diagnostics);
- err.messageText = msg;
- err.absFilePath = jsonFilePath;
- if (typeof pkgKey === 'string') {
- try {
- const jsonStr = compilerCtx.fs.readFileSync(jsonFilePath);
- const lines = jsonStr.replace(/\r/g, '\n').split('\n');
- for (let i = 0; i < lines.length; i++) {
- const txtLine = lines[i];
- const txtIndex = txtLine.indexOf(pkgKey);
- if (txtIndex > -1) {
- const warnLine = {
- lineIndex: i,
- lineNumber: i + 1,
- text: txtLine,
- errorCharStart: txtIndex,
- errorLength: pkgKey.length,
- };
- err.lineNumber = warnLine.lineNumber;
- err.columnNumber = txtIndex + 1;
- err.lines.push(warnLine);
- if (i >= 0) {
- const beforeWarnLine = {
- lineIndex: warnLine.lineIndex - 1,
- lineNumber: warnLine.lineNumber - 1,
- text: lines[i - 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- err.lines.unshift(beforeWarnLine);
- }
- if (i < lines.length) {
- const afterWarnLine = {
- lineIndex: warnLine.lineIndex + 1,
- lineNumber: warnLine.lineNumber + 1,
- text: lines[i + 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- err.lines.push(afterWarnLine);
- }
- break;
- }
- }
- }
- catch (e) { }
- }
- return err;
- };
- /**
- * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
- * @param diagnostics the series of diagnostics the newly created diagnostics should be added to
- * @param err the error to derive information from in generating the diagnostic
- * @param msg an optional message to use in place of `err` to generate the diagnostic
- * @returns the generated diagnostic
- */
- const catchError = (diagnostics, err, msg) => {
- const diagnostic = {
- level: 'error',
- type: 'build',
- header: 'Build Error',
- messageText: 'build error',
- relFilePath: null,
- absFilePath: null,
- lines: [],
- };
- if (isString$1(msg)) {
- diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
- }
- else if (err != null) {
- if (err.stack != null) {
- diagnostic.messageText = err.stack.toString();
- }
- else {
- if (err.message != null) {
- diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
- }
- else {
- diagnostic.messageText = err.toString();
- }
- }
- }
- if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) {
- diagnostics.push(diagnostic);
- }
- return diagnostic;
- };
- /**
- * Determine if the provided diagnostics have any build errors
- * @param diagnostics the diagnostics to inspect
- * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
- * otherwise.
- */
- const hasError = (diagnostics) => {
- if (diagnostics == null || diagnostics.length === 0) {
- return false;
- }
- return diagnostics.some((d) => d.level === 'error' && d.type !== 'runtime');
- };
- /**
- * Determine if the provided diagnostics have any warnings
- * @param diagnostics the diagnostics to inspect
- * @returns true if any of the diagnostics in the list provided are warnings. false otherwise.
- */
- const hasWarning = (diagnostics) => {
- if (diagnostics == null || diagnostics.length === 0) {
- return false;
- }
- return diagnostics.some((d) => d.level === 'warn');
- };
- const shouldIgnoreError = (msg) => {
- return msg === TASK_CANCELED_MSG;
- };
- const TASK_CANCELED_MSG = `task canceled`;
- const loadRollupDiagnostics = (config, compilerCtx, buildCtx, rollupError) => {
- const formattedCode = formatErrorCode(rollupError.code);
- const diagnostic = {
- level: 'error',
- type: 'bundling',
- language: 'javascript',
- code: rollupError.code,
- header: `Rollup${formattedCode.length > 0 ? ': ' + formattedCode : ''}`,
- messageText: formattedCode,
- relFilePath: null,
- absFilePath: null,
- lines: [],
- };
- if (config.logLevel === 'debug' && rollupError.stack) {
- diagnostic.messageText = rollupError.stack;
- }
- else if (rollupError.message) {
- diagnostic.messageText = rollupError.message;
- }
- if (rollupError.plugin) {
- diagnostic.messageText += ` (plugin: ${rollupError.plugin}${rollupError.hook ? `, ${rollupError.hook}` : ''})`;
- }
- const loc = rollupError.loc;
- if (loc != null) {
- const srcFile = loc.file || rollupError.id;
- if (isString$1(srcFile)) {
- try {
- const sourceText = compilerCtx.fs.readFileSync(srcFile);
- if (sourceText) {
- diagnostic.absFilePath = srcFile;
- try {
- const srcLines = splitLineBreaks(sourceText);
- const errorLine = {
- lineIndex: loc.line - 1,
- lineNumber: loc.line,
- text: srcLines[loc.line - 1],
- errorCharStart: loc.column,
- errorLength: 0,
- };
- diagnostic.lineNumber = errorLine.lineNumber;
- diagnostic.columnNumber = errorLine.errorCharStart;
- const highlightLine = errorLine.text.slice(loc.column);
- for (let i = 0; i < highlightLine.length; i++) {
- if (charBreak.has(highlightLine.charAt(i))) {
- break;
- }
- errorLine.errorLength++;
- }
- diagnostic.lines.push(errorLine);
- if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
- errorLine.errorLength = 1;
- errorLine.errorCharStart--;
- }
- if (errorLine.lineIndex > 0) {
- const previousLine = {
- lineIndex: errorLine.lineIndex - 1,
- lineNumber: errorLine.lineNumber - 1,
- text: srcLines[errorLine.lineIndex - 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- diagnostic.lines.unshift(previousLine);
- }
- if (errorLine.lineIndex + 1 < srcLines.length) {
- const nextLine = {
- lineIndex: errorLine.lineIndex + 1,
- lineNumber: errorLine.lineNumber + 1,
- text: srcLines[errorLine.lineIndex + 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- diagnostic.lines.push(nextLine);
- }
- }
- catch (e) {
- diagnostic.messageText += `\nError parsing: ${diagnostic.absFilePath}, line: ${loc.line}, column: ${loc.column}`;
- diagnostic.debugText = sourceText;
- }
- }
- else if (typeof rollupError.frame === 'string') {
- diagnostic.messageText += '\n' + rollupError.frame;
- }
- }
- catch (e) { }
- }
- }
- buildCtx.diagnostics.push(diagnostic);
- };
- const createOnWarnFn = (diagnostics, bundleModulesFiles) => {
- const previousWarns = new Set();
- return function onWarningMessage(warning) {
- if (warning == null || ignoreWarnCodes.has(warning.code) || previousWarns.has(warning.message)) {
- return;
- }
- previousWarns.add(warning.message);
- let label = '';
- if (bundleModulesFiles) {
- label = bundleModulesFiles
- .reduce((cmps, m) => {
- cmps.push(...m.cmps);
- return cmps;
- }, [])
- .join(', ')
- .trim();
- if (label.length) {
- label += ': ';
- }
- }
- const diagnostic = buildWarn(diagnostics);
- diagnostic.header = `Bundling Warning ${warning.code}`;
- diagnostic.messageText = label + (warning.message || warning);
- };
- };
- const ignoreWarnCodes = new Set([
- 'THIS_IS_UNDEFINED',
- 'NON_EXISTENT_EXPORT',
- 'CIRCULAR_DEPENDENCY',
- 'EMPTY_BUNDLE',
- 'UNUSED_EXTERNAL_IMPORT',
- ]);
- const charBreak = new Set([' ', '=', '.', ',', '?', ':', ';', '(', ')', '{', '}', '[', ']', '|', `'`, `"`, '`']);
- const formatErrorCode = (errorCode) => {
- if (typeof errorCode === 'string') {
- return errorCode
- .split('_')
- .map((c) => {
- return toTitleCase(c.toLowerCase());
- })
- .join(' ');
- }
- return (errorCode || '').trim();
- };
- /**
- * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
- * Forward-slash paths can be used in Windows as long as they're not
- * extended-length paths and don't contain any non-ascii characters.
- * This was created since the path methods in Node.js outputs \\ paths on Windows.
- */
- const normalizePath$1 = (path) => {
- if (typeof path !== 'string') {
- throw new Error(`invalid path to normalize`);
- }
- path = normalizeSlashes(path.trim());
- const components = pathComponents(path, getRootLength(path));
- const reducedComponents = reducePathComponents(components);
- const rootPart = reducedComponents[0];
- const secondPart = reducedComponents[1];
- const normalized = rootPart + reducedComponents.slice(1).join('/');
- if (normalized === '') {
- return '.';
- }
- if (rootPart === '' &&
- secondPart &&
- path.includes('/') &&
- !secondPart.startsWith('.') &&
- !secondPart.startsWith('@')) {
- return './' + normalized;
- }
- return normalized;
- };
- const normalizeSlashes = (path) => path.replace(backslashRegExp, '/');
- const altDirectorySeparator = '\\';
- const urlSchemeSeparator = '://';
- const backslashRegExp = /\\/g;
- const reducePathComponents = (components) => {
- if (!Array.isArray(components) || components.length === 0) {
- return [];
- }
- const reduced = [components[0]];
- for (let i = 1; i < components.length; i++) {
- const component = components[i];
- if (!component)
- continue;
- if (component === '.')
- continue;
- if (component === '..') {
- if (reduced.length > 1) {
- if (reduced[reduced.length - 1] !== '..') {
- reduced.pop();
- continue;
- }
- }
- else if (reduced[0])
- continue;
- }
- reduced.push(component);
- }
- return reduced;
- };
- const getRootLength = (path) => {
- const rootLength = getEncodedRootLength(path);
- return rootLength < 0 ? ~rootLength : rootLength;
- };
- const getEncodedRootLength = (path) => {
- if (!path)
- return 0;
- const ch0 = path.charCodeAt(0);
- // POSIX or UNC
- if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {
- if (path.charCodeAt(1) !== ch0)
- return 1; // POSIX: "/" (or non-normalized "\")
- const p1 = path.indexOf(ch0 === 47 /* slash */ ? '/' : altDirectorySeparator, 2);
- if (p1 < 0)
- return path.length; // UNC: "//server" or "\\server"
- return p1 + 1; // UNC: "//server/" or "\\server\"
- }
- // DOS
- if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {
- const ch2 = path.charCodeAt(2);
- if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */)
- return 3; // DOS: "c:/" or "c:\"
- if (path.length === 2)
- return 2; // DOS: "c:" (but not "c:d")
- }
- // URL
- const schemeEnd = path.indexOf(urlSchemeSeparator);
- if (schemeEnd !== -1) {
- const authorityStart = schemeEnd + urlSchemeSeparator.length;
- const authorityEnd = path.indexOf('/', authorityStart);
- if (authorityEnd !== -1) {
- // URL: "file:///", "file://server/", "file://server/path"
- // For local "file" URLs, include the leading DOS volume (if present).
- // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a
- // special case interpreted as "the machine from which the URL is being interpreted".
- const scheme = path.slice(0, schemeEnd);
- const authority = path.slice(authorityStart, authorityEnd);
- if (scheme === 'file' &&
- (authority === '' || authority === 'localhost') &&
- isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
- const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
- if (volumeSeparatorEnd !== -1) {
- if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
- // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/"
- return ~(volumeSeparatorEnd + 1);
- }
- if (volumeSeparatorEnd === path.length) {
- // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a"
- // but not "file:///c:d" or "file:///c%3ad"
- return ~volumeSeparatorEnd;
- }
- }
- }
- return ~(authorityEnd + 1); // URL: "file://server/", "http://server/"
- }
- return ~path.length; // URL: "file://server", "http://server"
- }
- // relative
- return 0;
- };
- const isVolumeCharacter = (charCode) => (charCode >= 97 /* a */ && charCode <= 122 /* z */) ||
- (charCode >= 65 /* A */ && charCode <= 90 /* Z */);
- const getFileUrlVolumeSeparatorEnd = (url, start) => {
- const ch0 = url.charCodeAt(start);
- if (ch0 === 58 /* colon */)
- return start + 1;
- if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) {
- const ch2 = url.charCodeAt(start + 2);
- if (ch2 === 97 /* a */ || ch2 === 65 /* A */)
- return start + 3;
- }
- return -1;
- };
- const pathComponents = (path, rootLength) => {
- const root = path.substring(0, rootLength);
- const rest = path.substring(rootLength).split('/');
- const restLen = rest.length;
- if (restLen > 0 && !rest[restLen - 1]) {
- rest.pop();
- }
- return [root, ...rest];
- };
- /**
- * Same as normalizePath(), expect it'll also strip any querystrings
- * from the path name. So /dir/file.css?tag=cmp-a becomes /dir/file.css
- */
- const normalizeFsPath = (p) => normalizePath$1(p.split('?')[0].replace(/\0/g, ''));
- const normalizeFsPathQuery = (importPath) => {
- const pathParts = importPath.split('?');
- const filePath = normalizePath$1(pathParts[0]);
- const ext = filePath.split('.').pop().toLowerCase();
- const params = pathParts.length > 1 ? new URLSearchParams(pathParts[1]) : null;
- const format = params ? params.get('format') : null;
- return {
- filePath,
- ext,
- params,
- format,
- };
- };
- /**
- * Augment a `Diagnostic` with information from a `Node` in the AST to provide richer error information
- * @param d the diagnostic to augment
- * @param node the node to augment with additional information
- * @returns the augmented diagnostic
- */
- const augmentDiagnosticWithNode = (d, node) => {
- if (!node) {
- return d;
- }
- const sourceFile = node.getSourceFile();
- if (!sourceFile) {
- return d;
- }
- d.absFilePath = normalizePath$1(sourceFile.fileName);
- const sourceText = sourceFile.text;
- const srcLines = splitLineBreaks(sourceText);
- const start = node.getStart();
- const end = node.getEnd();
- const posStart = sourceFile.getLineAndCharacterOfPosition(start);
- const errorLine = {
- lineIndex: posStart.line,
- lineNumber: posStart.line + 1,
- text: srcLines[posStart.line],
- errorCharStart: posStart.character,
- errorLength: Math.max(end - start, 1),
- };
- // store metadata for line number and character index where the error occurred
- d.lineNumber = errorLine.lineNumber;
- d.columnNumber = errorLine.errorCharStart + 1;
- d.lines.push(errorLine);
- if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
- errorLine.errorLength = 1;
- errorLine.errorCharStart--;
- }
- // if the error did not occur on the first line of the file, add metadata for the line of code preceding the line
- // where the error was detected to provide the user with additional context
- if (errorLine.lineIndex > 0) {
- const previousLine = {
- lineIndex: errorLine.lineIndex - 1,
- lineNumber: errorLine.lineNumber - 1,
- text: srcLines[errorLine.lineIndex - 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.unshift(previousLine);
- }
- // if the error did not occur on the last line of the file, add metadata for the line of code following the line
- // where the error was detected to provide the user with additional context
- if (errorLine.lineIndex + 1 < srcLines.length) {
- const nextLine = {
- lineIndex: errorLine.lineIndex + 1,
- lineNumber: errorLine.lineNumber + 1,
- text: srcLines[errorLine.lineIndex + 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.push(nextLine);
- }
- return d;
- };
- /**
- * Ok, so formatting overkill, we know. But whatever, it makes for great
- * error reporting within a terminal. So, yeah, let's code it up, shall we?
- */
- const loadTypeScriptDiagnostics = (tsDiagnostics) => {
- const diagnostics = [];
- const maxErrors = Math.min(tsDiagnostics.length, 50);
- for (let i = 0; i < maxErrors; i++) {
- diagnostics.push(loadTypeScriptDiagnostic(tsDiagnostics[i]));
- }
- return diagnostics;
- };
- const loadTypeScriptDiagnostic = (tsDiagnostic) => {
- const d = {
- level: 'warn',
- type: 'typescript',
- language: 'typescript',
- header: 'TypeScript',
- code: tsDiagnostic.code.toString(),
- messageText: flattenDiagnosticMessageText(tsDiagnostic, tsDiagnostic.messageText),
- relFilePath: null,
- absFilePath: null,
- lines: [],
- };
- if (tsDiagnostic.category === 1) {
- d.level = 'error';
- }
- if (tsDiagnostic.file) {
- d.absFilePath = tsDiagnostic.file.fileName;
- const sourceText = tsDiagnostic.file.text;
- const srcLines = splitLineBreaks(sourceText);
- const posData = tsDiagnostic.file.getLineAndCharacterOfPosition(tsDiagnostic.start);
- const errorLine = {
- lineIndex: posData.line,
- lineNumber: posData.line + 1,
- text: srcLines[posData.line],
- errorCharStart: posData.character,
- errorLength: Math.max(tsDiagnostic.length, 1),
- };
- d.lineNumber = errorLine.lineNumber;
- d.columnNumber = errorLine.errorCharStart + 1;
- d.lines.push(errorLine);
- if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
- errorLine.errorLength = 1;
- errorLine.errorCharStart--;
- }
- if (errorLine.lineIndex > 0) {
- const previousLine = {
- lineIndex: errorLine.lineIndex - 1,
- lineNumber: errorLine.lineNumber - 1,
- text: srcLines[errorLine.lineIndex - 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.unshift(previousLine);
- }
- if (errorLine.lineIndex + 1 < srcLines.length) {
- const nextLine = {
- lineIndex: errorLine.lineIndex + 1,
- lineNumber: errorLine.lineNumber + 1,
- text: srcLines[errorLine.lineIndex + 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.push(nextLine);
- }
- }
- return d;
- };
- const flattenDiagnosticMessageText = (tsDiagnostic, diag) => {
- if (typeof diag === 'string') {
- return diag;
- }
- else if (diag === undefined) {
- return '';
- }
- const ignoreCodes = [];
- const isStencilConfig = tsDiagnostic.file.fileName.includes('stencil.config');
- if (isStencilConfig) {
- ignoreCodes.push(2322);
- }
- let result = '';
- if (!ignoreCodes.includes(diag.code)) {
- result = diag.messageText;
- if (isIterable(diag.next)) {
- for (const kid of diag.next) {
- result += flattenDiagnosticMessageText(tsDiagnostic, kid);
- }
- }
- }
- if (isStencilConfig) {
- result = result.replace(`type 'StencilConfig'`, `Stencil Config`);
- result = result.replace(`Object literal may only specify known properties, but `, ``);
- result = result.replace(`Object literal may only specify known properties, and `, ``);
- }
- return result.trim();
- };
- const isRemoteUrl = (p) => {
- if (isString$1(p)) {
- p = p.toLowerCase();
- return p.startsWith('https://') || p.startsWith('http://');
- }
- return false;
- };
- const createJsVarName = (fileName) => {
- if (isString$1(fileName)) {
- fileName = fileName.split('?')[0];
- fileName = fileName.split('#')[0];
- fileName = fileName.split('&')[0];
- fileName = fileName.split('=')[0];
- fileName = toDashCase(fileName);
- fileName = fileName.replace(/[|;$%@"<>()+,.{}_\!\/\\]/g, '-');
- fileName = dashToPascalCase$1(fileName);
- if (fileName.length > 1) {
- fileName = fileName[0].toLowerCase() + fileName.slice(1);
- }
- else {
- fileName = fileName.toLowerCase();
- }
- if (fileName.length > 0 && !isNaN(fileName[0])) {
- fileName = '_' + fileName;
- }
- }
- return fileName;
- };
- /**
- * Determines if a given file path points to a type declaration file (ending in .d.ts) or not. This function is
- * case-insensitive in its heuristics.
- * @param filePath the path to check
- * @returns `true` if the given `filePath` points to a type declaration file, `false` otherwise
- */
- const isDtsFile$1 = (filePath) => {
- const parts = filePath.toLowerCase().split('.');
- if (parts.length > 2) {
- return parts[parts.length - 2] === 'd' && parts[parts.length - 1] === 'ts';
- }
- return false;
- };
- /**
- * Generate the preamble to be placed atop the main file of the build
- * @param config the Stencil configuration file
- * @return the generated preamble
- */
- const generatePreamble = (config) => {
- const { preamble } = config;
- if (!preamble) {
- return '';
- }
- // generate the body of the JSDoc-style comment
- const preambleComment = preamble.split('\n').map((l) => ` * ${l}`);
- preambleComment.unshift(`/*!`);
- preambleComment.push(` */`);
- return preambleComment.join('\n');
- };
- const lineBreakRegex = /\r?\n|\r/g;
- function getTextDocs(docs) {
- if (docs == null) {
- return '';
- }
- return `${docs.text.replace(lineBreakRegex, ' ')}
- ${docs.tags
- .filter((tag) => tag.name !== 'internal')
- .map((tag) => `@${tag.name} ${(tag.text || '').replace(lineBreakRegex, ' ')}`)
- .join('\n')}`.trim();
- }
- const getDependencies = (buildCtx) => {
- if (buildCtx.packageJson != null && buildCtx.packageJson.dependencies != null) {
- return Object.keys(buildCtx.packageJson.dependencies).filter((pkgName) => !SKIP_DEPS.includes(pkgName));
- }
- return [];
- };
- const hasDependency = (buildCtx, depName) => {
- return getDependencies(buildCtx).includes(depName);
- };
- const getDynamicImportFunction$1 = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
- const readPackageJson = async (config, compilerCtx, buildCtx) => {
- try {
- const pkgJson = await compilerCtx.fs.readFile(config.packageJsonFilePath);
- if (pkgJson) {
- const parseResults = parsePackageJson(pkgJson, config.packageJsonFilePath);
- if (parseResults.diagnostic) {
- buildCtx.diagnostics.push(parseResults.diagnostic);
- }
- else {
- buildCtx.packageJson = parseResults.data;
- }
- }
- }
- catch (e) {
- if (!config.outputTargets.some((o) => o.type.includes('dist'))) {
- const diagnostic = buildError(buildCtx.diagnostics);
- diagnostic.header = `Missing "package.json"`;
- diagnostic.messageText = `Valid "package.json" file is required for distribution: ${config.packageJsonFilePath}`;
- }
- }
- };
- const parsePackageJson = (pkgJsonStr, pkgJsonFilePath) => {
- if (isString$1(pkgJsonFilePath)) {
- return parseJson(pkgJsonStr, pkgJsonFilePath);
- }
- return null;
- };
- const parseJson = (jsonStr, filePath) => {
- const rtn = {
- diagnostic: null,
- data: null,
- filePath,
- };
- if (isString$1(jsonStr)) {
- try {
- rtn.data = JSON.parse(jsonStr);
- }
- catch (e) {
- rtn.diagnostic = buildError();
- rtn.diagnostic.absFilePath = filePath;
- rtn.diagnostic.header = `Error Parsing JSON`;
- if (e instanceof Error) {
- rtn.diagnostic.messageText = e.message;
- }
- }
- }
- else {
- rtn.diagnostic = buildError();
- rtn.diagnostic.absFilePath = filePath;
- rtn.diagnostic.header = `Error Parsing JSON`;
- rtn.diagnostic.messageText = `Invalid JSON input to parse`;
- }
- return rtn;
- };
- const SKIP_DEPS = ['@stencil/core'];
- /**
- * Validates that a component tag meets required naming conventions to be used for a web component
- * @param tag the tag to validate
- * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
- */
- const validateComponentTag = (tag) => {
- // we want to check this first since we call some String.prototype methods below
- if (typeof tag !== 'string') {
- return `Tag "${tag}" must be a string type`;
- }
- if (tag !== tag.trim()) {
- return `Tag can not contain white spaces`;
- }
- if (tag !== tag.toLowerCase()) {
- return `Tag can not contain upper case characters`;
- }
- if (tag.length === 0) {
- return `Received empty tag value`;
- }
- if (tag.indexOf(' ') > -1) {
- return `"${tag}" tag cannot contain a space`;
- }
- if (tag.indexOf(',') > -1) {
- return `"${tag}" tag cannot be used for multiple tags`;
- }
- const invalidChars = tag.replace(/\w|-/g, '');
- if (invalidChars !== '') {
- return `"${tag}" tag contains invalid characters: ${invalidChars}`;
- }
- if (tag.indexOf('-') === -1) {
- return `"${tag}" tag must contain a dash (-) to work as a valid web component`;
- }
- if (tag.indexOf('--') > -1) {
- return `"${tag}" tag cannot contain multiple dashes (--) next to each other`;
- }
- if (tag.indexOf('-') === 0) {
- return `"${tag}" tag cannot start with a dash (-)`;
- }
- if (tag.lastIndexOf('-') === tag.length - 1) {
- return `"${tag}" tag cannot end with a dash (-)`;
- }
- return undefined;
- };
- /**
- * Used to learn the size of a string in bytes.
- *
- * @param str The string to measure
- * @returns number
- */
- const byteSize = (str) => Buffer.byteLength(str, 'utf8');
- /**
- * Converts a rollup provided source map to one that Stencil can easily understand
- * @param rollupSourceMap the sourcemap to transform
- * @returns the transformed sourcemap
- */
- const rollupToStencilSourceMap = (rollupSourceMap) => {
- if (!rollupSourceMap) {
- return null;
- }
- return {
- file: rollupSourceMap.file,
- mappings: rollupSourceMap.mappings,
- names: rollupSourceMap.names,
- sources: rollupSourceMap.sources,
- sourcesContent: rollupSourceMap.sourcesContent,
- version: rollupSourceMap.version,
- };
- };
- /**
- * A JavaScript formatted string used to link generated code back to the original. This string follows the guidelines
- * found in the [Linking generated code to source maps](https://sourcemaps.info/spec.html#h.lmz475t4mvbx) section of
- * the Sourcemaps V3 specification proposal.
- */
- const JS_SOURCE_MAPPING_URL_LINKER = '//# sourceMappingURL=';
- /**
- * Generates an RFC-3986 compliant string for the given input.
- * More information about RFC-3986 can be found [here](https://datatracker.ietf.org/doc/html/rfc3986)
- * This function's original source is derived from
- * [MDN's encodeURIComponent documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#description)
- * @param filename the filename to encode
- * @returns the encoded URI
- */
- const encodeToRfc3986 = (filename) => {
- const encodedUri = encodeURIComponent(filename);
- // replace all '!', single quotes, '(', ')', and '*' with their hexadecimal values (UTF-16)
- return encodedUri.replace(/[!'()*]/g, (matchedCharacter) => {
- return '%' + matchedCharacter.charCodeAt(0).toString(16);
- });
- };
- /**
- * Generates a string used to link generated code with the original source, to be placed at the end of the generated
- * code.
- * @param url the url of the source map
- * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>
- */
- const getSourceMappingUrlLinker = (url) => {
- return `${JS_SOURCE_MAPPING_URL_LINKER}${encodeToRfc3986(url)}`;
- };
- /**
- * Generates a string used to link generated code with the original source, to be placed at the end of the generated
- * code as an inline source map.
- * @param sourceMapContents the sourceMapContents of the source map
- * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}<dataUriPrefixAndMime><sourceMapContents>
- */
- const getInlineSourceMappingUrlLinker = (sourceMapContents) => {
- const mapBase64 = Buffer.from(sourceMapContents, 'utf8').toString('base64');
- // do not RFC-3986 encode an already valid base64 string. the sourcemaps will not resolve correctly when there is an
- // allowed base64 character is encoded (because it is a disallowed RFC-3986 character)
- return `${JS_SOURCE_MAPPING_URL_LINKER}data:application/json;charset=utf-8;base64,${mapBase64}`;
- };
- /**
- * Generates a string used to link generated code with the original source, to be placed at the end of the generated
- * code. This function prepends a newline to the string.
- * @param url the url of the source map
- * @returns a linker string, of the format {@link JS_SOURCE_MAPPING_URL_LINKER}=<url>.map, prepended with a newline
- */
- const getSourceMappingUrlForEndOfFile = (url) => {
- return `\n${getSourceMappingUrlLinker(url)}.map`;
- };
- let basename;
- let dirname;
- let extname$1;
- let isAbsolute$1;
- let join;
- let normalize$1;
- let parse$7;
- let relative$1;
- let resolve$1;
- let sep;
- let delimiter;
- let posix$1;
- let win32$1;
- const path$5 = {};
- const setPlatformPath = (platformPath) => {
- if (!platformPath) {
- platformPath = pathBrowserify;
- }
- Object.assign(path$5, platformPath);
- const normalizeOrg = path$5.normalize;
- const joinOrg = path$5.join;
- const relativeOrg = path$5.relative;
- const resolveOrg = path$5.resolve;
- normalize$1 = path$5.normalize = (...args) => normalizePath$1(normalizeOrg.apply(path$5, args));
- join = path$5.join = (...args) => normalizePath$1(joinOrg.apply(path$5, args));
- relative$1 = path$5.relative = (...args) => normalizePath$1(relativeOrg.apply(path$5, args));
- resolve$1 = path$5.resolve = (...args) => normalizePath$1(resolveOrg.apply(path$5, args));
- basename = path$5.basename;
- dirname = path$5.dirname;
- extname$1 = path$5.extname;
- isAbsolute$1 = path$5.isAbsolute;
- parse$7 = path$5.parse;
- sep = path$5.sep;
- delimiter = path$5.delimiter;
- posix$1 = path$5.posix;
- if (path$5.win32) {
- win32$1 = path$5.win32;
- }
- else {
- win32$1 = { ...posix$1 };
- win32$1.sep = '\\';
- }
- };
- setPlatformPath(IS_NODE_ENV ? requireFunc('path') : pathBrowserify);
- const path$6 = {
- __proto__: null,
- get basename () { return basename; },
- get dirname () { return dirname; },
- get extname () { return extname$1; },
- get isAbsolute () { return isAbsolute$1; },
- get join () { return join; },
- get normalize () { return normalize$1; },
- get parse () { return parse$7; },
- get relative () { return relative$1; },
- get resolve () { return resolve$1; },
- get sep () { return sep; },
- get delimiter () { return delimiter; },
- get posix () { return posix$1; },
- get win32 () { return win32$1; },
- path: path$5,
- setPlatformPath: setPlatformPath,
- 'default': path$5
- };
- var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- function createCommonjsModule$1(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire$1();
- }
- }, fn(module, module.exports), module.exports;
- }
- function getAugmentedNamespace$1(n) {
- if (n.__esModule) return n;
- var a = Object.defineProperty({}, '__esModule', {value: true});
- Object.keys(n).forEach(function (k) {
- var d = Object.getOwnPropertyDescriptor(n, k);
- Object.defineProperty(a, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return n[k];
- }
- });
- });
- return a;
- }
- function commonjsRequire$1 () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
- }
- // for now just expose the builtin process global from node.js
- var process_1 = commonjsGlobal$1.process;
- const process$3 = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), process_1, {
- 'default': process_1
- });
- const EOL = '\n';
- const platform = () => OS_PLATFORM;
- const os$2 = {
- EOL,
- platform,
- };
- const os$3 = {
- __proto__: null,
- EOL: EOL,
- platform: platform,
- 'default': os$2
- };
- const buildEvents = () => {
- const evCallbacks = [];
- const off = (callback) => {
- const index = evCallbacks.findIndex((ev) => ev.callback === callback);
- if (index > -1) {
- evCallbacks.splice(index, 1);
- return true;
- }
- return false;
- };
- const on = (arg0, arg1) => {
- if (typeof arg0 === 'function') {
- const eventName = null;
- const callback = arg0;
- evCallbacks.push({
- eventName,
- callback,
- });
- return () => off(callback);
- }
- else if (typeof arg0 === 'string' && typeof arg1 === 'function') {
- const eventName = arg0.toLowerCase().trim();
- const callback = arg1;
- evCallbacks.push({
- eventName,
- callback,
- });
- return () => off(callback);
- }
- return () => false;
- };
- const emit = (eventName, data) => {
- const normalizedEventName = eventName.toLowerCase().trim();
- const callbacks = evCallbacks.slice();
- for (const ev of callbacks) {
- if (ev.eventName == null) {
- try {
- ev.callback(eventName, data);
- }
- catch (e) {
- console.error(e);
- }
- }
- else if (ev.eventName === normalizedEventName) {
- try {
- ev.callback(data);
- }
- catch (e) {
- console.error(e);
- }
- }
- }
- };
- const unsubscribeAll = () => {
- evCallbacks.length = 0;
- };
- return {
- emit,
- on,
- unsubscribeAll,
- };
- };
- const createLogger = () => {
- let useColors = IS_BROWSER_ENV;
- let level = 'info';
- const logger = {
- enableColors: (uc) => (useColors = uc),
- getLevel: () => level,
- setLevel: (l) => (level = l),
- emoji: (e) => e,
- info: console.log.bind(console),
- warn: console.warn.bind(console),
- error: console.error.bind(console),
- debug: console.debug.bind(console),
- red: (msg) => msg,
- green: (msg) => msg,
- yellow: (msg) => msg,
- blue: (msg) => msg,
- magenta: (msg) => msg,
- cyan: (msg) => msg,
- gray: (msg) => msg,
- bold: (msg) => msg,
- dim: (msg) => msg,
- bgRed: (msg) => msg,
- createTimeSpan: (_startMsg, _debug = false) => ({
- duration: () => 0,
- finish: () => 0,
- }),
- printDiagnostics(diagnostics) {
- diagnostics.forEach((diagnostic) => logDiagnostic(diagnostic, useColors));
- },
- };
- return logger;
- };
- const logDiagnostic = (diagnostic, useColors) => {
- let color = BLUE;
- let prefix = 'Build';
- let msg = '';
- if (diagnostic.level === 'error') {
- color = RED;
- prefix = 'Error';
- }
- else if (diagnostic.level === 'warn') {
- color = YELLOW;
- prefix = 'Warning';
- }
- if (diagnostic.header) {
- prefix = diagnostic.header;
- }
- const filePath = diagnostic.relFilePath || diagnostic.absFilePath;
- if (filePath) {
- msg += filePath;
- if (typeof diagnostic.lineNumber === 'number' && diagnostic.lineNumber > 0) {
- msg += ', line ' + diagnostic.lineNumber;
- if (typeof diagnostic.columnNumber === 'number' && diagnostic.columnNumber > 0) {
- msg += ', column ' + diagnostic.columnNumber;
- }
- }
- msg += '\n';
- }
- msg += diagnostic.messageText;
- if (diagnostic.lines && diagnostic.lines.length > 0) {
- diagnostic.lines.forEach((l) => {
- msg += '\n' + l.lineNumber + ': ' + l.text;
- });
- msg += '\n';
- }
- if (useColors) {
- const styledPrefix = [
- '%c' + prefix,
- `background: ${color}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`,
- ];
- console.log(...styledPrefix, msg);
- }
- else if (diagnostic.level === 'error') {
- console.error(msg);
- }
- else if (diagnostic.level === 'warn') {
- console.warn(msg);
- }
- else {
- console.log(msg);
- }
- };
- const YELLOW = `#f39c12`;
- const RED = `#c0392b`;
- const BLUE = `#3498db`;
- const createWebWorkerMainController = (sys, maxConcurrentWorkers) => {
- let msgIds = 0;
- let isDestroyed = false;
- let isQueued = false;
- let workerIds = 0;
- let workerBlob;
- const tasks = new Map();
- const queuedSendMsgs = [];
- const workers = [];
- const maxWorkers = Math.max(Math.min(maxConcurrentWorkers, sys.hardwareConcurrency), 2) - 1;
- const tick = Promise.resolve();
- const onMsgsFromWorker = (worker, ev) => {
- if (!isDestroyed) {
- const msgsFromWorker = ev.data;
- if (Array.isArray(msgsFromWorker)) {
- for (const msgFromWorker of msgsFromWorker) {
- if (msgFromWorker) {
- const task = tasks.get(msgFromWorker.stencilId);
- if (task) {
- tasks.delete(msgFromWorker.stencilId);
- if (msgFromWorker.stencilRtnError) {
- task.reject(msgFromWorker.stencilRtnError);
- }
- else {
- task.resolve(msgFromWorker.stencilRtnValue);
- }
- worker.activeTasks--;
- if (worker.activeTasks < 0 || worker.activeTasks > 50) {
- worker.activeTasks = 0;
- }
- }
- else if (msgFromWorker.stencilRtnError) {
- console.error(msgFromWorker.stencilRtnError);
- }
- }
- }
- }
- }
- };
- const onWorkerError = (e) => console.error(e);
- const createWorkerMain = () => {
- let worker = null;
- const workerUrl = sys.getCompilerExecutingPath();
- const workerOpts = {
- name: `stencil.worker.${workerIds++}`,
- };
- try {
- // first try directly starting the worker with the URL
- worker = new Worker(workerUrl, workerOpts);
- }
- catch (e) {
- // probably a cross-origin issue, try using a Blob instead
- if (workerBlob == null) {
- workerBlob = new Blob([`importScripts('${workerUrl}');`], { type: 'application/javascript' });
- }
- worker = new Worker(URL.createObjectURL(workerBlob), workerOpts);
- }
- const workerChild = {
- worker,
- activeTasks: 0,
- sendQueue: [],
- };
- worker.onerror = onWorkerError;
- worker.onmessage = (ev) => onMsgsFromWorker(workerChild, ev);
- return workerChild;
- };
- const sendMsgsToWorkers = (w) => {
- if (w.sendQueue.length > 0) {
- w.worker.postMessage(w.sendQueue);
- w.sendQueue.length = 0;
- }
- };
- const queueMsgToWorker = (msg) => {
- let theChosenOne;
- if (workers.length > 0) {
- theChosenOne = workers[0];
- if (maxWorkers > 1) {
- for (const worker of workers) {
- if (worker.activeTasks < theChosenOne.activeTasks) {
- theChosenOne = worker;
- }
- }
- if (theChosenOne.activeTasks > 0 && workers.length < maxWorkers) {
- theChosenOne = createWorkerMain();
- workers.push(theChosenOne);
- }
- }
- }
- else {
- theChosenOne = createWorkerMain();
- workers.push(theChosenOne);
- }
- theChosenOne.activeTasks++;
- theChosenOne.sendQueue.push(msg);
- };
- const flushSendQueue = () => {
- isQueued = false;
- queuedSendMsgs.forEach(queueMsgToWorker);
- queuedSendMsgs.length = 0;
- workers.forEach(sendMsgsToWorkers);
- };
- const send = (...args) => new Promise((resolve, reject) => {
- if (isDestroyed) {
- reject(TASK_CANCELED_MSG);
- }
- else {
- const msg = {
- stencilId: msgIds++,
- args,
- };
- queuedSendMsgs.push(msg);
- tasks.set(msg.stencilId, {
- resolve,
- reject,
- });
- if (!isQueued) {
- isQueued = true;
- tick.then(flushSendQueue);
- }
- }
- });
- const destroy = () => {
- isDestroyed = true;
- tasks.forEach((t) => t.reject(TASK_CANCELED_MSG));
- tasks.clear();
- workers.forEach((w) => w.worker.terminate());
- workers.length = 0;
- };
- const handler = (name) => {
- return function (...args) {
- return send(name, ...args);
- };
- };
- return {
- send,
- destroy,
- handler,
- maxWorkers,
- };
- };
- const COMMON_DIR_MODULE_EXTS = ['.tsx', '.ts', '.mjs', '.js', '.jsx', '.json', '.md'];
- const COMMON_DIR_FILENAMES = ['package.json', 'index.js', 'index.mjs'];
- const isDtsFile = (p) => p.endsWith('.d.ts');
- const isTsFile = (p) => !isDtsFile(p) && p.endsWith('.ts');
- const isTsxFile = (p) => p.endsWith('.tsx');
- const isJsxFile = (p) => p.endsWith('.jsx');
- const isJsFile = (p) => p.endsWith('.js');
- const isJsonFile = (p) => p.endsWith('.json');
- const getCommonDirName = (dirPath, fileName) => dirPath + '/' + fileName;
- const isCommonDirModuleFile = (p) => COMMON_DIR_MODULE_EXTS.some((ext) => p.endsWith(ext));
- const setPackageVersion = (pkgVersions, pkgName, pkgVersion) => {
- pkgVersions.set(pkgName, pkgVersion);
- };
- const setPackageVersionByContent = (pkgVersions, pkgContent) => {
- try {
- const pkg = JSON.parse(pkgContent);
- if (pkg.name && pkg.version) {
- setPackageVersion(pkgVersions, pkg.name, pkg.version);
- }
- }
- catch (e) { }
- };
- const isLocalModule = (p) => p.startsWith('.') || p.startsWith('/');
- const isStencilCoreImport = (p) => p.startsWith('@stencil/core');
- const shouldFetchModule = (p) => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(p);
- const isNodeModulePath = (p) => normalizePath$1(p).split('/').includes('node_modules');
- const getModuleId = (orgImport) => {
- if (orgImport.startsWith('~')) {
- orgImport = orgImport.substring(1);
- }
- const splt = orgImport.split('/');
- const m = {
- moduleId: null,
- filePath: null,
- scope: null,
- scopeSubModuleId: null,
- };
- if (orgImport.startsWith('@') && splt.length > 1) {
- m.moduleId = splt.slice(0, 2).join('/');
- m.filePath = splt.slice(2).join('/');
- m.scope = splt[0];
- m.scopeSubModuleId = splt[1];
- }
- else {
- m.moduleId = splt[0];
- m.filePath = splt.slice(1).join('/');
- }
- return m;
- };
- const getPackageDirPath = (p, moduleId) => {
- const parts = normalizePath$1(p).split('/');
- const m = getModuleId(moduleId);
- for (let i = parts.length - 1; i >= 1; i--) {
- if (parts[i - 1] === 'node_modules') {
- if (m.scope) {
- if (parts[i] === m.scope && parts[i + 1] === m.scopeSubModuleId) {
- return parts.slice(0, i + 2).join('/');
- }
- }
- else if (parts[i] === m.moduleId) {
- return parts.slice(0, i + 1).join('/');
- }
- }
- }
- return null;
- };
- const httpFetch = (sys, input, init) => {
- console.trace(input);
- if (sys && isFunction(sys.fetch)) {
- return sys.fetch(input, init);
- }
- return fetch(input, init);
- };
- const packageVersions = new Map();
- const known404Urls = new Set();
- const getStencilRootUrl = (compilerExe) => new URL('../', compilerExe).href;
- const getStencilModuleUrl = (compilerExe, p) => {
- p = normalizePath$1(p);
- let parts = p.split('/');
- const nmIndex = parts.lastIndexOf('node_modules');
- if (nmIndex > -1 && nmIndex < parts.length - 1) {
- parts = parts.slice(nmIndex + 1);
- if (parts[0].startsWith('@')) {
- parts = parts.slice(2);
- }
- else {
- parts = parts.slice(1);
- }
- p = parts.join('/');
- }
- return new URL('./' + p, getStencilRootUrl(compilerExe)).href;
- };
- const getCommonDirUrl = (sys, pkgVersions, dirPath, fileName) => getNodeModuleFetchUrl(sys, pkgVersions, dirPath) + '/' + fileName;
- const getNodeModuleFetchUrl = (sys, pkgVersions, filePath) => {
- // /node_modules/lodash/package.json
- filePath = normalizePath$1(filePath);
- // ["node_modules", "lodash", "package.json"]
- let pathParts = filePath.split('/').filter((p) => p.length);
- const nmIndex = pathParts.lastIndexOf('node_modules');
- if (nmIndex > -1 && nmIndex < pathParts.length - 1) {
- pathParts = pathParts.slice(nmIndex + 1);
- }
- let moduleId = pathParts.shift();
- if (moduleId.startsWith('@')) {
- moduleId += '/' + pathParts.shift();
- }
- const path = pathParts.join('/');
- if (moduleId === '@stencil/core') {
- const compilerExe = sys.getCompilerExecutingPath();
- return getStencilModuleUrl(compilerExe, path);
- }
- return sys.getRemoteModuleUrl({
- moduleId,
- version: pkgVersions.get(moduleId),
- path,
- });
- };
- const skipFilePathFetch = (filePath) => {
- if (isTsFile(filePath) || isTsxFile(filePath)) {
- // don't bother trying to resolve node_module packages w/ typescript files
- // they should already be .js files
- return true;
- }
- const pathParts = filePath.split('/');
- const secondToLast = pathParts[pathParts.length - 2];
- const lastPart = pathParts[pathParts.length - 1];
- if (secondToLast === 'node_modules' && isCommonDirModuleFile(lastPart)) {
- // /node_modules/index.js
- // /node_modules/lodash.js
- // we just already know this is bogus, so don't bother
- return true;
- }
- return false;
- };
- const skipUrlFetch = (url) =>
- // files we just already know not to try to resolve request
- knownUrlSkips.some((knownSkip) => url.endsWith(knownSkip));
- const knownUrlSkips = [
- '/@stencil/core/internal.js',
- '/@stencil/core/internal.json',
- '/@stencil/core/internal.mjs',
- '/@stencil/core/internal/stencil-core.js/index.json',
- '/@stencil/core/internal/stencil-core.js.json',
- '/@stencil/core/internal/stencil-core.js/package.json',
- '/@stencil/core.js',
- '/@stencil/core.json',
- '/@stencil/core.mjs',
- '/@stencil/core.css',
- '/@stencil/core/index.js',
- '/@stencil/core/index.json',
- '/@stencil/core/index.mjs',
- '/@stencil/core/index.css',
- '/@stencil/package.json',
- ];
- const writeFetchSuccessSync = (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
- if (url.endsWith('package.json')) {
- setPackageVersionByContent(pkgVersions, content);
- }
- let dir = dirname(filePath);
- while (dir !== '/' && dir !== '') {
- if (inMemoryFs) {
- inMemoryFs.clearFileCache(dir);
- inMemoryFs.sys.createDirSync(dir);
- }
- else {
- sys.createDirSync(dir);
- }
- dir = dirname(dir);
- }
- if (inMemoryFs) {
- inMemoryFs.clearFileCache(filePath);
- inMemoryFs.sys.writeFileSync(filePath, content);
- }
- else {
- sys.writeFileSync(filePath, content);
- }
- };
- const writeFetchSuccessAsync = async (sys, inMemoryFs, url, filePath, content, pkgVersions) => {
- if (url.endsWith('package.json')) {
- setPackageVersionByContent(pkgVersions, content);
- }
- let dir = dirname(filePath);
- while (dir !== '/' && dir !== '') {
- if (inMemoryFs) {
- inMemoryFs.clearFileCache(dir);
- await inMemoryFs.sys.createDir(dir);
- }
- else {
- await sys.createDir(dir);
- }
- dir = dirname(dir);
- }
- if (inMemoryFs) {
- inMemoryFs.clearFileCache(filePath);
- await inMemoryFs.sys.writeFile(filePath, content);
- }
- else {
- await sys.writeFile(filePath, content);
- }
- };
- const fetchModuleAsync = async (sys, inMemoryFs, pkgVersions, url, filePath) => {
- if (skipFilePathFetch(filePath) || known404Urls.has(url) || skipUrlFetch(url)) {
- return undefined;
- }
- try {
- const rsp = await httpFetch(sys, url);
- if (rsp) {
- if (rsp.ok) {
- const content = await rsp.clone().text();
- await writeFetchSuccessAsync(sys, inMemoryFs, url, filePath, content, pkgVersions);
- return content;
- }
- if (rsp.status === 404) {
- known404Urls.add(url);
- }
- }
- }
- catch (e) {
- console.error(e);
- }
- return undefined;
- };
- const inherits$3 = (ctor, superCtor) => {
- if (superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true,
- },
- });
- }
- };
- const inspect = (...args) => args.forEach((arg) => console.log(arg));
- const promisify = (fn) => {
- if (typeof fn[promisify.custom] === 'function') {
- // https://nodejs.org/api/util.html#util_custom_promisified_functions
- return function (...args) {
- return fn[promisify.custom].apply(this, args);
- };
- }
- return function (...args) {
- return new Promise((resolve, reject) => {
- args.push((err, result) => {
- if (err != null) {
- reject(err);
- }
- else {
- resolve(result);
- }
- });
- fn.apply(this, args);
- });
- };
- };
- promisify.custom = Symbol('promisify.custom');
- const require$$0$1 = {
- inherits: inherits$3,
- inspect,
- promisify,
- };
- const util$4 = {
- __proto__: null,
- inherits: inherits$3,
- inspect: inspect,
- promisify: promisify,
- 'default': require$$0$1
- };
- class FsError extends Error {
- constructor(syscall, path, code = 'ENOENT', errno = -2) {
- super(`ENOENT: no such file or directory, ${syscall} '${path}'`);
- this.syscall = syscall;
- this.path = path;
- this.code = code;
- this.errno = errno;
- }
- }
- const fs$3 = {
- __sys: {},
- };
- const exists$1 = (fs$3.exists = (p, cb) => {
- fs$3.__sys
- .access(p)
- .then(cb)
- .catch(() => cb(false));
- });
- // https://nodejs.org/api/util.html#util_custom_promisified_functions
- exists$1[promisify.custom] = (p) => fs$3.__sys.access(p);
- const existsSync = (fs$3.existsSync = (p) => {
- // https://nodejs.org/api/fs.html#fs_fs_existssync_path
- return fs$3.__sys.accessSync(p);
- });
- const mkdir = (fs$3.mkdir = (p, opts, cb) => {
- cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
- opts = typeof opts === 'function' ? undefined : opts;
- fs$3.__sys
- .createDir(p, opts)
- .then((results) => {
- if (cb) {
- if (results.error) {
- cb(new FsError('mkdir', p));
- }
- else {
- cb(null);
- }
- }
- })
- .catch((e) => {
- cb && cb(e);
- });
- });
- const mkdirSync = (fs$3.mkdirSync = (p, opts) => {
- const results = fs$3.__sys.createDirSync(p, opts);
- if (results.error) {
- throw new FsError('mkdir', p);
- }
- });
- const readdirSync = (fs$3.readdirSync = (p) => {
- // sys.readdirSync includes full paths
- // but if fs.readdirSync was called, the expected
- // nodejs results are of just the basename for each dir item
- const dirItems = fs$3.__sys.readDirSync(p);
- return dirItems.map((dirItem) => basename(dirItem));
- });
- const readFile$2 = (fs$3.readFile = async (p, opts, cb) => {
- const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
- cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
- fs$3.__sys
- .readFile(p, encoding)
- .then((data) => {
- if (cb) {
- if (typeof data === 'string') {
- cb(null, data);
- }
- else {
- cb(new FsError('open', p), data);
- }
- }
- })
- .catch((e) => {
- cb && cb(e);
- });
- });
- const readFileSync = (fs$3.readFileSync = (p, opts) => {
- const encoding = typeof opts === 'object' ? opts.encoding : typeof opts === 'string' ? opts : 'utf-8';
- const data = fs$3.__sys.readFileSync(p, encoding);
- if (typeof data !== 'string') {
- throw new FsError('open', p);
- }
- return data;
- });
- const realpath$3 = (fs$3.realpath = (p, opts, cb) => {
- cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
- fs$3.__sys
- .realpath(p)
- .then((results) => {
- cb && cb(results.error, results.path);
- })
- .catch((e) => {
- cb && cb(e);
- });
- });
- const realpathSync$2 = (fs$3.realpathSync = (p) => {
- const results = fs$3.__sys.realpathSync(p);
- if (results.error) {
- throw results.error;
- }
- return normalizePath$1(results.path);
- });
- const statSync = (fs$3.statSync = (p) => {
- const fsStats = fs$3.__sys.statSync(p);
- if (fsStats.error) {
- throw new FsError('statSync', p);
- }
- return {
- isDirectory: () => fsStats.isDirectory,
- isFile: () => fsStats.isFile,
- isSymbolicLink: () => fsStats.isSymbolicLink,
- size: fsStats.size,
- mtimeMs: fsStats.mtimeMs,
- };
- });
- const lstatSync = (fs$3.lstatSync = statSync);
- const stat$1 = (fs$3.stat = (p, opts, cb) => {
- cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
- fs$3.__sys
- .stat(p)
- .then((fsStats) => {
- if (cb) {
- if (fsStats.error) {
- cb(new FsError('stat', p));
- }
- else {
- cb({
- isDirectory: () => fsStats.isDirectory,
- isFile: () => fsStats.isFile,
- isSymbolicLink: () => fsStats.isSymbolicLink,
- size: fsStats.size,
- mtimeMs: fsStats.mtimeMs,
- });
- }
- }
- })
- .catch((e) => {
- cb && cb(e);
- });
- });
- const watch = (fs$3.watch = () => {
- throw new Error(`fs.watch() not implemented`);
- });
- const writeFile$1 = (fs$3.writeFile = (p, data, opts, cb) => {
- cb = typeof cb === 'function' ? cb : typeof opts === 'function' ? opts : null;
- fs$3.__sys
- .writeFile(p, data)
- .then((writeResults) => {
- if (cb) {
- if (writeResults.error) {
- cb(new FsError('writeFile', p));
- }
- else {
- cb(null);
- }
- }
- })
- .catch((e) => {
- cb && cb(e);
- });
- });
- const fs$4 = {
- __proto__: null,
- exists: exists$1,
- existsSync: existsSync,
- mkdir: mkdir,
- mkdirSync: mkdirSync,
- readdirSync: readdirSync,
- readFile: readFile$2,
- readFileSync: readFileSync,
- realpath: realpath$3,
- realpathSync: realpathSync$2,
- statSync: statSync,
- lstatSync: lstatSync,
- stat: stat$1,
- watch: watch,
- writeFile: writeFile$1,
- 'default': fs$3
- };
- var caller = function () {
- // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
- var origPrepareStackTrace = Error.prepareStackTrace;
- Error.prepareStackTrace = function (_, stack) { return stack; };
- var stack = (new Error()).stack;
- Error.prepareStackTrace = origPrepareStackTrace;
- return stack[2].getFileName();
- };
- var pathParse = createCommonjsModule$1(function (module) {
- var isWindows = process.platform === 'win32';
- // Regex to split a windows path into into [dir, root, basename, name, ext]
- var splitWindowsRe =
- /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
- var win32 = {};
- function win32SplitPath(filename) {
- return splitWindowsRe.exec(filename).slice(1);
- }
- win32.parse = function(pathString) {
- if (typeof pathString !== 'string') {
- throw new TypeError(
- "Parameter 'pathString' must be a string, not " + typeof pathString
- );
- }
- var allParts = win32SplitPath(pathString);
- if (!allParts || allParts.length !== 5) {
- throw new TypeError("Invalid path '" + pathString + "'");
- }
- return {
- root: allParts[1],
- dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
- base: allParts[2],
- ext: allParts[4],
- name: allParts[3]
- };
- };
- // Split a filename into [dir, root, basename, name, ext], unix version
- // 'root' is just a slash, or nothing.
- var splitPathRe =
- /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
- var posix = {};
- function posixSplitPath(filename) {
- return splitPathRe.exec(filename).slice(1);
- }
- posix.parse = function(pathString) {
- if (typeof pathString !== 'string') {
- throw new TypeError(
- "Parameter 'pathString' must be a string, not " + typeof pathString
- );
- }
- var allParts = posixSplitPath(pathString);
- if (!allParts || allParts.length !== 5) {
- throw new TypeError("Invalid path '" + pathString + "'");
- }
-
- return {
- root: allParts[1],
- dir: allParts[0].slice(0, -1),
- base: allParts[2],
- ext: allParts[4],
- name: allParts[3],
- };
- };
- if (isWindows)
- module.exports = win32.parse;
- else /* posix */
- module.exports = posix.parse;
- module.exports.posix = posix.parse;
- module.exports.win32 = win32.parse;
- });
- const path$4 = /*@__PURE__*/getAugmentedNamespace$1(path$6);
- var parse$6 = path$4.parse || pathParse;
- var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
- var prefix = '/';
- if ((/^([A-Za-z]:)/).test(absoluteStart)) {
- prefix = '';
- } else if ((/^\\\\/).test(absoluteStart)) {
- prefix = '\\\\';
- }
- var paths = [absoluteStart];
- var parsed = parse$6(absoluteStart);
- while (parsed.dir !== paths[paths.length - 1]) {
- paths.push(parsed.dir);
- parsed = parse$6(parsed.dir);
- }
- return paths.reduce(function (dirs, aPath) {
- return dirs.concat(modules.map(function (moduleDir) {
- return path$4.resolve(prefix, aPath, moduleDir);
- }));
- }, []);
- };
- var nodeModulesPaths = function nodeModulesPaths(start, opts, request) {
- var modules = opts && opts.moduleDirectory
- ? [].concat(opts.moduleDirectory)
- : ['node_modules'];
- if (opts && typeof opts.paths === 'function') {
- return opts.paths(
- request,
- start,
- function () { return getNodeModulesDirs(start, modules); },
- opts
- );
- }
- var dirs = getNodeModulesDirs(start, modules);
- return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
- };
- var normalizeOptions = function (x, opts) {
- /**
- * This file is purposefully a passthrough. It's expected that third-party
- * environments will override it at runtime in order to inject special logic
- * into `resolve` (by manipulating the options). One such example is the PnP
- * code path in Yarn.
- */
- return opts || {};
- };
- /* eslint no-invalid-this: 1 */
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
- var slice$1 = Array.prototype.slice;
- var toStr = Object.prototype.toString;
- var funcType = '[object Function]';
- var implementation = function bind(that) {
- var target = this;
- if (typeof target !== 'function' || toStr.call(target) !== funcType) {
- throw new TypeError(ERROR_MESSAGE + target);
- }
- var args = slice$1.call(arguments, 1);
- var bound;
- var binder = function () {
- if (this instanceof bound) {
- var result = target.apply(
- this,
- args.concat(slice$1.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
- return target.apply(
- that,
- args.concat(slice$1.call(arguments))
- );
- }
- };
- var boundLength = Math.max(0, target.length - args.length);
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push('$' + i);
- }
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
- if (target.prototype) {
- var Empty = function Empty() {};
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
- Empty.prototype = null;
- }
- return bound;
- };
- var functionBind = Function.prototype.bind || implementation;
- var src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
- const assert$2 = true;
- const async_hooks$1 = ">= 8";
- const buffer_ieee754$1 = "< 0.9.7";
- const buffer$1 = true;
- const child_process$1 = true;
- const cluster$1 = true;
- const console$2 = true;
- const constants$2 = true;
- const crypto$2 = true;
- const _debug_agent$1 = ">= 1 && < 8";
- const _debugger$1 = "< 8";
- const dgram$1 = true;
- const diagnostics_channel$1 = ">= 15.1";
- const dns$1 = true;
- const domain$1 = ">= 0.7.12";
- const events$2 = true;
- const freelist$1 = "< 6";
- const fs$2 = true;
- const _http_agent$1 = ">= 0.11.1";
- const _http_client$1 = ">= 0.11.1";
- const _http_common$1 = ">= 0.11.1";
- const _http_incoming$1 = ">= 0.11.1";
- const _http_outgoing$1 = ">= 0.11.1";
- const _http_server$1 = ">= 0.11.1";
- const http$1 = true;
- const http2$1 = ">= 8.8";
- const https$1 = true;
- const inspector$1 = ">= 8.0.0";
- const _linklist$1 = "< 8";
- const module$2 = true;
- const net$1 = true;
- const os$1 = true;
- const path$3 = true;
- const perf_hooks$1 = ">= 8.5";
- const process$2 = ">= 1";
- const punycode$1 = true;
- const querystring$1 = true;
- const readline$1 = true;
- const repl$1 = true;
- const smalloc$1 = ">= 0.11.5 && < 3";
- const _stream_duplex$1 = ">= 0.9.4";
- const _stream_transform$1 = ">= 0.9.4";
- const _stream_wrap$1 = ">= 1.4.1";
- const _stream_passthrough$1 = ">= 0.9.4";
- const _stream_readable$1 = ">= 0.9.4";
- const _stream_writable$1 = ">= 0.9.4";
- const stream$1 = true;
- const string_decoder$1 = true;
- const sys$1 = [
- ">= 0.6 && < 0.7",
- ">= 0.8"
- ];
- const timers$2 = true;
- const _tls_common$1 = ">= 0.11.13";
- const _tls_legacy$1 = ">= 0.11.3 && < 10";
- const _tls_wrap$1 = ">= 0.11.3";
- const tls$1 = true;
- const trace_events$1 = ">= 10";
- const tty$1 = true;
- const url$1 = true;
- const util$3 = true;
- const v8$1 = ">= 1";
- const vm$1 = true;
- const wasi$1 = ">= 13.4 && < 13.5";
- const worker_threads$1 = ">= 11.7";
- const zlib$1 = true;
- const data$2 = {
- assert: assert$2,
- "assert/strict": ">= 15",
- async_hooks: async_hooks$1,
- buffer_ieee754: buffer_ieee754$1,
- buffer: buffer$1,
- child_process: child_process$1,
- cluster: cluster$1,
- console: console$2,
- constants: constants$2,
- crypto: crypto$2,
- _debug_agent: _debug_agent$1,
- _debugger: _debugger$1,
- dgram: dgram$1,
- diagnostics_channel: diagnostics_channel$1,
- dns: dns$1,
- "dns/promises": ">= 15",
- domain: domain$1,
- events: events$2,
- freelist: freelist$1,
- fs: fs$2,
- "fs/promises": [
- ">= 10 && < 10.1",
- ">= 14"
- ],
- _http_agent: _http_agent$1,
- _http_client: _http_client$1,
- _http_common: _http_common$1,
- _http_incoming: _http_incoming$1,
- _http_outgoing: _http_outgoing$1,
- _http_server: _http_server$1,
- http: http$1,
- http2: http2$1,
- https: https$1,
- inspector: inspector$1,
- _linklist: _linklist$1,
- module: module$2,
- net: net$1,
- "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
- "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
- "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
- os: os$1,
- path: path$3,
- "path/posix": ">= 15.3",
- "path/win32": ">= 15.3",
- perf_hooks: perf_hooks$1,
- process: process$2,
- punycode: punycode$1,
- querystring: querystring$1,
- readline: readline$1,
- repl: repl$1,
- smalloc: smalloc$1,
- _stream_duplex: _stream_duplex$1,
- _stream_transform: _stream_transform$1,
- _stream_wrap: _stream_wrap$1,
- _stream_passthrough: _stream_passthrough$1,
- _stream_readable: _stream_readable$1,
- _stream_writable: _stream_writable$1,
- stream: stream$1,
- "stream/promises": ">= 15",
- string_decoder: string_decoder$1,
- sys: sys$1,
- timers: timers$2,
- "timers/promises": ">= 15",
- _tls_common: _tls_common$1,
- _tls_legacy: _tls_legacy$1,
- _tls_wrap: _tls_wrap$1,
- tls: tls$1,
- trace_events: trace_events$1,
- tty: tty$1,
- url: url$1,
- util: util$3,
- "util/types": ">= 15.3",
- "v8/tools/arguments": ">= 10 && < 12",
- "v8/tools/codemap": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/consarray": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/csvparser": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/logreader": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/profile_view": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/splaytree": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- v8: v8$1,
- vm: vm$1,
- wasi: wasi$1,
- worker_threads: worker_threads$1,
- zlib: zlib$1
- };
- function specifierIncluded$1(current, specifier) {
- var nodeParts = current.split('.');
- var parts = specifier.split(' ');
- var op = parts.length > 1 ? parts[0] : '=';
- var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
- for (var i = 0; i < 3; ++i) {
- var cur = parseInt(nodeParts[i] || 0, 10);
- var ver = parseInt(versionParts[i] || 0, 10);
- if (cur === ver) {
- continue; // eslint-disable-line no-restricted-syntax, no-continue
- }
- if (op === '<') {
- return cur < ver;
- }
- if (op === '>=') {
- return cur >= ver;
- }
- return false;
- }
- return op === '>=';
- }
- function matchesRange$1(current, range) {
- var specifiers = range.split(/ ?&& ?/);
- if (specifiers.length === 0) {
- return false;
- }
- for (var i = 0; i < specifiers.length; ++i) {
- if (!specifierIncluded$1(current, specifiers[i])) {
- return false;
- }
- }
- return true;
- }
- function versionIncluded$1(nodeVersion, specifierValue) {
- if (typeof specifierValue === 'boolean') {
- return specifierValue;
- }
- var current = typeof nodeVersion === 'undefined'
- ? process.versions && process.versions.node && process.versions.node
- : nodeVersion;
- if (typeof current !== 'string') {
- throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
- }
- if (specifierValue && typeof specifierValue === 'object') {
- for (var i = 0; i < specifierValue.length; ++i) {
- if (matchesRange$1(current, specifierValue[i])) {
- return true;
- }
- }
- return false;
- }
- return matchesRange$1(current, specifierValue);
- }
- var isCoreModule = function isCore(x, nodeVersion) {
- return src(data$2, x) && versionIncluded$1(nodeVersion, data$2[x]);
- };
- const fs$1 = /*@__PURE__*/getAugmentedNamespace$1(fs$4);
- var realpathFS$1 = fs$1.realpath && typeof fs$1.realpath.native === 'function' ? fs$1.realpath.native : fs$1.realpath;
- var defaultIsFile$1 = function isFile(file, cb) {
- fs$1.stat(file, function (err, stat) {
- if (!err) {
- return cb(null, stat.isFile() || stat.isFIFO());
- }
- if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
- return cb(err);
- });
- };
- var defaultIsDir$1 = function isDirectory(dir, cb) {
- fs$1.stat(dir, function (err, stat) {
- if (!err) {
- return cb(null, stat.isDirectory());
- }
- if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
- return cb(err);
- });
- };
- var defaultRealpath = function realpath(x, cb) {
- realpathFS$1(x, function (realpathErr, realPath) {
- if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);
- else cb(null, realpathErr ? x : realPath);
- });
- };
- var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
- if (opts && opts.preserveSymlinks === false) {
- realpath(x, cb);
- } else {
- cb(null, x);
- }
- };
- var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
- readFile(pkgfile, function (readFileErr, body) {
- if (readFileErr) cb(readFileErr);
- else {
- try {
- var pkg = JSON.parse(body);
- cb(null, pkg);
- } catch (jsonErr) {
- cb(null);
- }
- }
- });
- };
- var getPackageCandidates$1 = function getPackageCandidates(x, start, opts) {
- var dirs = nodeModulesPaths(start, opts, x);
- for (var i = 0; i < dirs.length; i++) {
- dirs[i] = path$4.join(dirs[i], x);
- }
- return dirs;
- };
- var async = function resolve(x, options, callback) {
- var cb = callback;
- var opts = options;
- if (typeof options === 'function') {
- cb = opts;
- opts = {};
- }
- if (typeof x !== 'string') {
- var err = new TypeError('Path must be a string.');
- return process.nextTick(function () {
- cb(err);
- });
- }
- opts = normalizeOptions(x, opts);
- var isFile = opts.isFile || defaultIsFile$1;
- var isDirectory = opts.isDirectory || defaultIsDir$1;
- var readFile = opts.readFile || fs$1.readFile;
- var realpath = opts.realpath || defaultRealpath;
- var readPackage = opts.readPackage || defaultReadPackage;
- if (opts.readFile && opts.readPackage) {
- var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.');
- return process.nextTick(function () {
- cb(conflictErr);
- });
- }
- var packageIterator = opts.packageIterator;
- var extensions = opts.extensions || ['.js'];
- var includeCoreModules = opts.includeCoreModules !== false;
- var basedir = opts.basedir || path$4.dirname(caller());
- var parent = opts.filename || basedir;
- opts.paths = opts.paths || [];
- // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
- var absoluteStart = path$4.resolve(basedir);
- maybeRealpath(
- realpath,
- absoluteStart,
- opts,
- function (err, realStart) {
- if (err) cb(err);
- else init(realStart);
- }
- );
- var res;
- function init(basedir) {
- if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
- res = path$4.resolve(basedir, x);
- if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
- if ((/\/$/).test(x) && res === basedir) {
- loadAsDirectory(res, opts.package, onfile);
- } else loadAsFile(res, opts.package, onfile);
- } else if (includeCoreModules && isCoreModule(x)) {
- return cb(null, x);
- } else loadNodeModules(x, basedir, function (err, n, pkg) {
- if (err) cb(err);
- else if (n) {
- return maybeRealpath(realpath, n, opts, function (err, realN) {
- if (err) {
- cb(err);
- } else {
- cb(null, realN, pkg);
- }
- });
- } else {
- var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
- moduleError.code = 'MODULE_NOT_FOUND';
- cb(moduleError);
- }
- });
- }
- function onfile(err, m, pkg) {
- if (err) cb(err);
- else if (m) cb(null, m, pkg);
- else loadAsDirectory(res, function (err, d, pkg) {
- if (err) cb(err);
- else if (d) {
- maybeRealpath(realpath, d, opts, function (err, realD) {
- if (err) {
- cb(err);
- } else {
- cb(null, realD, pkg);
- }
- });
- } else {
- var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
- moduleError.code = 'MODULE_NOT_FOUND';
- cb(moduleError);
- }
- });
- }
- function loadAsFile(x, thePackage, callback) {
- var loadAsFilePackage = thePackage;
- var cb = callback;
- if (typeof loadAsFilePackage === 'function') {
- cb = loadAsFilePackage;
- loadAsFilePackage = undefined;
- }
- var exts = [''].concat(extensions);
- load(exts, x, loadAsFilePackage);
- function load(exts, x, loadPackage) {
- if (exts.length === 0) return cb(null, undefined, loadPackage);
- var file = x + exts[0];
- var pkg = loadPackage;
- if (pkg) onpkg(null, pkg);
- else loadpkg(path$4.dirname(file), onpkg);
- function onpkg(err, pkg_, dir) {
- pkg = pkg_;
- if (err) return cb(err);
- if (dir && pkg && opts.pathFilter) {
- var rfile = path$4.relative(dir, file);
- var rel = rfile.slice(0, rfile.length - exts[0].length);
- var r = opts.pathFilter(pkg, x, rel);
- if (r) return load(
- [''].concat(extensions.slice()),
- path$4.resolve(dir, r),
- pkg
- );
- }
- isFile(file, onex);
- }
- function onex(err, ex) {
- if (err) return cb(err);
- if (ex) return cb(null, file, pkg);
- load(exts.slice(1), x, pkg);
- }
- }
- }
- function loadpkg(dir, cb) {
- if (dir === '' || dir === '/') return cb(null);
- if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
- return cb(null);
- }
- if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null);
- maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
- if (unwrapErr) return loadpkg(path$4.dirname(dir), cb);
- var pkgfile = path$4.join(pkgdir, 'package.json');
- isFile(pkgfile, function (err, ex) {
- // on err, ex is false
- if (!ex) return loadpkg(path$4.dirname(dir), cb);
- readPackage(readFile, pkgfile, function (err, pkgParam) {
- if (err) cb(err);
- var pkg = pkgParam;
- if (pkg && opts.packageFilter) {
- pkg = opts.packageFilter(pkg, pkgfile);
- }
- cb(null, pkg, dir);
- });
- });
- });
- }
- function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
- var cb = callback;
- var fpkg = loadAsDirectoryPackage;
- if (typeof fpkg === 'function') {
- cb = fpkg;
- fpkg = opts.package;
- }
- maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) {
- if (unwrapErr) return cb(unwrapErr);
- var pkgfile = path$4.join(pkgdir, 'package.json');
- isFile(pkgfile, function (err, ex) {
- if (err) return cb(err);
- if (!ex) return loadAsFile(path$4.join(x, 'index'), fpkg, cb);
- readPackage(readFile, pkgfile, function (err, pkgParam) {
- if (err) return cb(err);
- var pkg = pkgParam;
- if (pkg && opts.packageFilter) {
- pkg = opts.packageFilter(pkg, pkgfile);
- }
- if (pkg && pkg.main) {
- if (typeof pkg.main !== 'string') {
- var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
- mainError.code = 'INVALID_PACKAGE_MAIN';
- return cb(mainError);
- }
- if (pkg.main === '.' || pkg.main === './') {
- pkg.main = 'index';
- }
- loadAsFile(path$4.resolve(x, pkg.main), pkg, function (err, m, pkg) {
- if (err) return cb(err);
- if (m) return cb(null, m, pkg);
- if (!pkg) return loadAsFile(path$4.join(x, 'index'), pkg, cb);
- var dir = path$4.resolve(x, pkg.main);
- loadAsDirectory(dir, pkg, function (err, n, pkg) {
- if (err) return cb(err);
- if (n) return cb(null, n, pkg);
- loadAsFile(path$4.join(x, 'index'), pkg, cb);
- });
- });
- return;
- }
- loadAsFile(path$4.join(x, '/index'), pkg, cb);
- });
- });
- });
- }
- function processDirs(cb, dirs) {
- if (dirs.length === 0) return cb(null, undefined);
- var dir = dirs[0];
- isDirectory(path$4.dirname(dir), isdir);
- function isdir(err, isdir) {
- if (err) return cb(err);
- if (!isdir) return processDirs(cb, dirs.slice(1));
- loadAsFile(dir, opts.package, onfile);
- }
- function onfile(err, m, pkg) {
- if (err) return cb(err);
- if (m) return cb(null, m, pkg);
- loadAsDirectory(dir, opts.package, ondir);
- }
- function ondir(err, n, pkg) {
- if (err) return cb(err);
- if (n) return cb(null, n, pkg);
- processDirs(cb, dirs.slice(1));
- }
- }
- function loadNodeModules(x, start, cb) {
- var thunk = function () { return getPackageCandidates$1(x, start, opts); };
- processDirs(
- cb,
- packageIterator ? packageIterator(x, start, thunk, opts) : thunk()
- );
- }
- };
- const assert$1 = true;
- const async_hooks = ">= 8";
- const buffer_ieee754 = "< 0.9.7";
- const buffer = true;
- const child_process = true;
- const cluster = true;
- const console$1 = true;
- const constants$1 = true;
- const crypto$1 = true;
- const _debug_agent = ">= 1 && < 8";
- const _debugger = "< 8";
- const dgram = true;
- const diagnostics_channel = ">= 15.1";
- const dns = true;
- const domain = ">= 0.7.12";
- const events$1 = true;
- const freelist = "< 6";
- const fs = true;
- const _http_agent = ">= 0.11.1";
- const _http_client = ">= 0.11.1";
- const _http_common = ">= 0.11.1";
- const _http_incoming = ">= 0.11.1";
- const _http_outgoing = ">= 0.11.1";
- const _http_server = ">= 0.11.1";
- const http = true;
- const http2 = ">= 8.8";
- const https = true;
- const inspector = ">= 8.0.0";
- const _linklist = "< 8";
- const module$1 = true;
- const net = true;
- const os = true;
- const path$2 = true;
- const perf_hooks = ">= 8.5";
- const process$1 = ">= 1";
- const punycode = true;
- const querystring = true;
- const readline = true;
- const repl = true;
- const smalloc = ">= 0.11.5 && < 3";
- const _stream_duplex = ">= 0.9.4";
- const _stream_transform = ">= 0.9.4";
- const _stream_wrap = ">= 1.4.1";
- const _stream_passthrough = ">= 0.9.4";
- const _stream_readable = ">= 0.9.4";
- const _stream_writable = ">= 0.9.4";
- const stream = true;
- const string_decoder = true;
- const sys = [
- ">= 0.6 && < 0.7",
- ">= 0.8"
- ];
- const timers$1 = true;
- const _tls_common = ">= 0.11.13";
- const _tls_legacy = ">= 0.11.3 && < 10";
- const _tls_wrap = ">= 0.11.3";
- const tls = true;
- const trace_events = ">= 10";
- const tty = true;
- const url = true;
- const util$2 = true;
- const v8 = ">= 1";
- const vm = true;
- const wasi = ">= 13.4 && < 13.5";
- const worker_threads = ">= 11.7";
- const zlib = true;
- const data$1 = {
- assert: assert$1,
- "assert/strict": ">= 15",
- async_hooks: async_hooks,
- buffer_ieee754: buffer_ieee754,
- buffer: buffer,
- child_process: child_process,
- cluster: cluster,
- console: console$1,
- constants: constants$1,
- crypto: crypto$1,
- _debug_agent: _debug_agent,
- _debugger: _debugger,
- dgram: dgram,
- diagnostics_channel: diagnostics_channel,
- dns: dns,
- "dns/promises": ">= 15",
- domain: domain,
- events: events$1,
- freelist: freelist,
- fs: fs,
- "fs/promises": [
- ">= 10 && < 10.1",
- ">= 14"
- ],
- _http_agent: _http_agent,
- _http_client: _http_client,
- _http_common: _http_common,
- _http_incoming: _http_incoming,
- _http_outgoing: _http_outgoing,
- _http_server: _http_server,
- http: http,
- http2: http2,
- https: https,
- inspector: inspector,
- _linklist: _linklist,
- module: module$1,
- net: net,
- "node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
- "node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
- "node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
- os: os,
- path: path$2,
- "path/posix": ">= 15.3",
- "path/win32": ">= 15.3",
- perf_hooks: perf_hooks,
- process: process$1,
- punycode: punycode,
- querystring: querystring,
- readline: readline,
- repl: repl,
- smalloc: smalloc,
- _stream_duplex: _stream_duplex,
- _stream_transform: _stream_transform,
- _stream_wrap: _stream_wrap,
- _stream_passthrough: _stream_passthrough,
- _stream_readable: _stream_readable,
- _stream_writable: _stream_writable,
- stream: stream,
- "stream/promises": ">= 15",
- string_decoder: string_decoder,
- sys: sys,
- timers: timers$1,
- "timers/promises": ">= 15",
- _tls_common: _tls_common,
- _tls_legacy: _tls_legacy,
- _tls_wrap: _tls_wrap,
- tls: tls,
- trace_events: trace_events,
- tty: tty,
- url: url,
- util: util$2,
- "util/types": ">= 15.3",
- "v8/tools/arguments": ">= 10 && < 12",
- "v8/tools/codemap": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/consarray": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/csvparser": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/logreader": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/profile_view": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- "v8/tools/splaytree": [
- ">= 4.4.0 && < 5",
- ">= 5.2.0 && < 12"
- ],
- v8: v8,
- vm: vm,
- wasi: wasi,
- worker_threads: worker_threads,
- zlib: zlib
- };
- var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
- function specifierIncluded(specifier) {
- var parts = specifier.split(' ');
- var op = parts.length > 1 ? parts[0] : '=';
- var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
- for (var i = 0; i < 3; ++i) {
- var cur = parseInt(current[i] || 0, 10);
- var ver = parseInt(versionParts[i] || 0, 10);
- if (cur === ver) {
- continue; // eslint-disable-line no-restricted-syntax, no-continue
- }
- if (op === '<') {
- return cur < ver;
- } else if (op === '>=') {
- return cur >= ver;
- } else {
- return false;
- }
- }
- return op === '>=';
- }
- function matchesRange(range) {
- var specifiers = range.split(/ ?&& ?/);
- if (specifiers.length === 0) { return false; }
- for (var i = 0; i < specifiers.length; ++i) {
- if (!specifierIncluded(specifiers[i])) { return false; }
- }
- return true;
- }
- function versionIncluded(specifierValue) {
- if (typeof specifierValue === 'boolean') { return specifierValue; }
- if (specifierValue && typeof specifierValue === 'object') {
- for (var i = 0; i < specifierValue.length; ++i) {
- if (matchesRange(specifierValue[i])) { return true; }
- }
- return false;
- }
- return matchesRange(specifierValue);
- }
- var core = {};
- for (var mod in data$1) { // eslint-disable-line no-restricted-syntax
- if (Object.prototype.hasOwnProperty.call(data$1, mod)) {
- core[mod] = versionIncluded(data$1[mod]);
- }
- }
- var core_1 = core;
- var isCore = function isCore(x) {
- return isCoreModule(x);
- };
- var realpathFS = fs$1.realpathSync && typeof fs$1.realpathSync.native === 'function' ? fs$1.realpathSync.native : fs$1.realpathSync;
- var defaultIsFile = function isFile(file) {
- try {
- var stat = fs$1.statSync(file);
- } catch (e) {
- if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
- throw e;
- }
- return stat.isFile() || stat.isFIFO();
- };
- var defaultIsDir = function isDirectory(dir) {
- try {
- var stat = fs$1.statSync(dir);
- } catch (e) {
- if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
- throw e;
- }
- return stat.isDirectory();
- };
- var defaultRealpathSync = function realpathSync(x) {
- try {
- return realpathFS(x);
- } catch (realpathErr) {
- if (realpathErr.code !== 'ENOENT') {
- throw realpathErr;
- }
- }
- return x;
- };
- var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
- if (opts && opts.preserveSymlinks === false) {
- return realpathSync(x);
- }
- return x;
- };
- var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
- var body = readFileSync(pkgfile);
- try {
- var pkg = JSON.parse(body);
- return pkg;
- } catch (jsonErr) {}
- };
- var getPackageCandidates = function getPackageCandidates(x, start, opts) {
- var dirs = nodeModulesPaths(start, opts, x);
- for (var i = 0; i < dirs.length; i++) {
- dirs[i] = path$4.join(dirs[i], x);
- }
- return dirs;
- };
- var sync$1 = function resolveSync(x, options) {
- if (typeof x !== 'string') {
- throw new TypeError('Path must be a string.');
- }
- var opts = normalizeOptions(x, options);
- var isFile = opts.isFile || defaultIsFile;
- var readFileSync = opts.readFileSync || fs$1.readFileSync;
- var isDirectory = opts.isDirectory || defaultIsDir;
- var realpathSync = opts.realpathSync || defaultRealpathSync;
- var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
- if (opts.readFileSync && opts.readPackageSync) {
- throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.');
- }
- var packageIterator = opts.packageIterator;
- var extensions = opts.extensions || ['.js'];
- var includeCoreModules = opts.includeCoreModules !== false;
- var basedir = opts.basedir || path$4.dirname(caller());
- var parent = opts.filename || basedir;
- opts.paths = opts.paths || [];
- // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory
- var absoluteStart = maybeRealpathSync(realpathSync, path$4.resolve(basedir), opts);
- if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) {
- var res = path$4.resolve(absoluteStart, x);
- if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
- var m = loadAsFileSync(res) || loadAsDirectorySync(res);
- if (m) return maybeRealpathSync(realpathSync, m, opts);
- } else if (includeCoreModules && isCoreModule(x)) {
- return x;
- } else {
- var n = loadNodeModulesSync(x, absoluteStart);
- if (n) return maybeRealpathSync(realpathSync, n, opts);
- }
- var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
- err.code = 'MODULE_NOT_FOUND';
- throw err;
- function loadAsFileSync(x) {
- var pkg = loadpkg(path$4.dirname(x));
- if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
- var rfile = path$4.relative(pkg.dir, x);
- var r = opts.pathFilter(pkg.pkg, x, rfile);
- if (r) {
- x = path$4.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
- }
- }
- if (isFile(x)) {
- return x;
- }
- for (var i = 0; i < extensions.length; i++) {
- var file = x + extensions[i];
- if (isFile(file)) {
- return file;
- }
- }
- }
- function loadpkg(dir) {
- if (dir === '' || dir === '/') return;
- if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
- return;
- }
- if ((/[/\\]node_modules[/\\]*$/).test(dir)) return;
- var pkgfile = path$4.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
- if (!isFile(pkgfile)) {
- return loadpkg(path$4.dirname(dir));
- }
- var pkg = readPackageSync(readFileSync, pkgfile);
- if (pkg && opts.packageFilter) {
- // v2 will pass pkgfile
- pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment
- }
- return { pkg: pkg, dir: dir };
- }
- function loadAsDirectorySync(x) {
- var pkgfile = path$4.join(maybeRealpathSync(realpathSync, x, opts), '/package.json');
- if (isFile(pkgfile)) {
- try {
- var pkg = readPackageSync(readFileSync, pkgfile);
- } catch (e) {}
- if (pkg && opts.packageFilter) {
- // v2 will pass pkgfile
- pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment
- }
- if (pkg && pkg.main) {
- if (typeof pkg.main !== 'string') {
- var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');
- mainError.code = 'INVALID_PACKAGE_MAIN';
- throw mainError;
- }
- if (pkg.main === '.' || pkg.main === './') {
- pkg.main = 'index';
- }
- try {
- var m = loadAsFileSync(path$4.resolve(x, pkg.main));
- if (m) return m;
- var n = loadAsDirectorySync(path$4.resolve(x, pkg.main));
- if (n) return n;
- } catch (e) {}
- }
- }
- return loadAsFileSync(path$4.join(x, '/index'));
- }
- function loadNodeModulesSync(x, start) {
- var thunk = function () { return getPackageCandidates(x, start, opts); };
- var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
- for (var i = 0; i < dirs.length; i++) {
- var dir = dirs[i];
- if (isDirectory(path$4.dirname(dir))) {
- var m = loadAsFileSync(dir);
- if (m) return m;
- var n = loadAsDirectorySync(dir);
- if (n) return n;
- }
- }
- }
- };
- async.core = core_1;
- async.isCore = isCore;
- async.sync = sync$1;
- var resolve = async;
- const resolveModuleIdAsync = (sys, inMemoryFs, opts) => {
- const resolverOpts = createCustomResolverAsync(sys, inMemoryFs, opts.exts);
- resolverOpts.basedir = dirname(normalizeFsPath(opts.containingFile));
- if (opts.packageFilter) {
- resolverOpts.packageFilter = opts.packageFilter;
- }
- else if (opts.packageFilter !== null) {
- resolverOpts.packageFilter = (pkg) => {
- if (!isString$1(pkg.main) || pkg.main === '') {
- pkg.main = 'package.json';
- }
- return pkg;
- };
- }
- return new Promise((resolvePromise, rejectPromise) => {
- resolve(opts.moduleId, resolverOpts, (err, resolveId, pkgData) => {
- if (err) {
- rejectPromise(err);
- }
- else {
- resolveId = normalizePath$1(resolveId);
- const results = {
- moduleId: opts.moduleId,
- resolveId,
- pkgData,
- pkgDirPath: getPackageDirPath(resolveId, opts.moduleId),
- };
- resolvePromise(results);
- }
- });
- });
- };
- const createCustomResolverAsync = (sys, inMemoryFs, exts) => {
- return {
- async isFile(filePath, cb) {
- const fsFilePath = normalizeFsPath(filePath);
- const stat = await inMemoryFs.stat(fsFilePath);
- if (stat.isFile) {
- cb(null, true);
- return;
- }
- if (shouldFetchModule(fsFilePath)) {
- const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
- if (endsWithExt) {
- const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
- const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, fsFilePath);
- const checkFileExists = typeof content === 'string';
- cb(null, checkFileExists);
- return;
- }
- }
- cb(null, false);
- },
- async isDirectory(dirPath, cb) {
- const fsDirPath = normalizeFsPath(dirPath);
- const stat = await inMemoryFs.stat(fsDirPath);
- if (stat.isDirectory) {
- cb(null, true);
- return;
- }
- if (shouldFetchModule(fsDirPath)) {
- if (basename(fsDirPath) === 'node_modules') {
- // just the /node_modules directory
- inMemoryFs.sys.createDirSync(fsDirPath);
- inMemoryFs.clearFileCache(fsDirPath);
- cb(null, true);
- return;
- }
- if (isCommonDirModuleFile(fsDirPath)) {
- // don't bother seeing if it's a directory if it has a common file extension
- cb(null, false);
- return;
- }
- for (const fileName of COMMON_DIR_FILENAMES) {
- const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
- const filePath = getCommonDirName(fsDirPath, fileName);
- const content = await fetchModuleAsync(sys, inMemoryFs, packageVersions, url, filePath);
- if (isString$1(content)) {
- cb(null, true);
- return;
- }
- }
- }
- cb(null, false);
- },
- async readFile(p, cb) {
- const fsFilePath = normalizeFsPath(p);
- const data = await inMemoryFs.readFile(fsFilePath);
- if (isString$1(data)) {
- return cb(null, data);
- }
- return cb(`readFile not found: ${p}`);
- },
- async realpath(p, cb) {
- const fsFilePath = normalizeFsPath(p);
- const results = await sys.realpath(fsFilePath);
- if (results.error && results.error.code !== 'ENOENT') {
- cb(results.error);
- }
- else {
- cb(null, results.error ? fsFilePath : results.path);
- }
- },
- extensions: exts,
- };
- };
- const buildId = '20220418164701';
- const minfyJsId = 'terser5.6.1_7';
- const optimizeCssId = 'autoprefixer10.2.5_postcss8.2.8_7';
- const parse5Version = '6.0.1';
- const rollupVersion = '2.42.3';
- const sizzleVersion = '2.42.3';
- const terserVersion = '5.6.1';
- const typescriptVersion = '4.5.4';
- const vermoji = '🐼';
- const version$3 = '2.15.1';
- const versions = {
- stencil: version$3,
- parse5: parse5Version,
- rollup: rollupVersion,
- sizzle: sizzleVersion,
- terser: terserVersion,
- typescript: typescriptVersion,
- };
- const createSystem = (c) => {
- const logger = c && c.logger ? c.logger : createLogger();
- const items = new Map();
- const destroys = new Set();
- const addDestory = (cb) => destroys.add(cb);
- const removeDestory = (cb) => destroys.delete(cb);
- const events = buildEvents();
- const hardwareConcurrency = (IS_BROWSER_ENV && navigator.hardwareConcurrency) || 1;
- const destroy = async () => {
- const waits = [];
- destroys.forEach((cb) => {
- try {
- const rtn = cb();
- if (rtn && rtn.then) {
- waits.push(rtn);
- }
- }
- catch (e) {
- logger.error(`stencil sys destroy: ${e}`);
- }
- });
- await Promise.all(waits);
- destroys.clear();
- };
- const normalize = (p) => {
- if (p === '/' || p === '') {
- return '/';
- }
- const dir = dirname(p);
- const base = basename(p);
- if (dir.endsWith('/')) {
- return normalizePath$1(`${dir}${base}`);
- }
- return normalizePath$1(`${dir}/${base}`);
- };
- const accessSync = (p) => {
- const item = items.get(normalize(p));
- return !!(item && (item.isDirectory || (item.isFile && typeof item.data === 'string')));
- };
- const access = async (p) => accessSync(p);
- const copyFile = async (src, dest) => {
- writeFileSync(dest, readFileSync(src));
- return true;
- };
- const isTTY = () => {
- var _a;
- return !!((_a = process$3 === null || process$3 === void 0 ? void 0 : process_1.stdout) === null || _a === void 0 ? void 0 : _a.isTTY);
- };
- const homeDir = () => {
- return undefined();
- };
- const createDirSync = (p, opts) => {
- p = normalize(p);
- const results = {
- basename: basename(p),
- dirname: dirname(p),
- path: p,
- newDirs: [],
- error: null,
- };
- createDirRecursiveSync(p, opts, results);
- return results;
- };
- const createDirRecursiveSync = (p, opts, results) => {
- const parentDir = dirname(p);
- if (opts && opts.recursive && !isRootPath(parentDir)) {
- createDirRecursiveSync(parentDir, opts, results);
- }
- const item = items.get(p);
- if (!item) {
- items.set(p, {
- basename: basename(p),
- dirname: parentDir,
- isDirectory: true,
- isFile: false,
- watcherCallbacks: null,
- data: undefined,
- });
- results.newDirs.push(p);
- emitDirectoryWatch(p, new Set());
- }
- else {
- item.isDirectory = true;
- item.isFile = false;
- }
- };
- const createDir = async (p, opts) => createDirSync(p, opts);
- const encodeToBase64 = (str) => btoa(unescape(encodeURIComponent(str)));
- const getCurrentDirectory = () => '/';
- const getCompilerExecutingPath = () => {
- if (IS_WEB_WORKER_ENV) {
- return location.href;
- }
- return sys.getRemoteModuleUrl({ moduleId: '@stencil/core', path: 'compiler/stencil.min.js' });
- };
- const isSymbolicLink = async (_p) => false;
- const readDirSync = (p) => {
- p = normalize(p);
- const dirItems = [];
- const dir = items.get(p);
- if (dir && dir.isDirectory) {
- items.forEach((item, itemPath) => {
- if (itemPath !== '/' && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
- if (p.endsWith('/') && `${p}${item.basename}` === itemPath) {
- dirItems.push(itemPath);
- }
- else if (`${p}/${item.basename}` === itemPath) {
- dirItems.push(itemPath);
- }
- }
- });
- }
- return dirItems.sort();
- };
- const readDir = async (p) => readDirSync(p);
- const readFileSync = (p) => {
- p = normalize(p);
- const item = items.get(p);
- if (item && item.isFile) {
- return item.data;
- }
- return undefined;
- };
- const readFile = async (p) => readFileSync(p);
- const realpathSync = (p) => {
- const results = {
- path: normalize(p),
- error: null,
- };
- return results;
- };
- const realpath = async (p) => realpathSync(p);
- const rename = async (oldPath, newPath) => {
- oldPath = normalizePath$1(oldPath);
- newPath = normalizePath$1(newPath);
- const results = {
- oldPath,
- newPath,
- renamed: [],
- oldDirs: [],
- oldFiles: [],
- newDirs: [],
- newFiles: [],
- isFile: false,
- isDirectory: false,
- error: null,
- };
- const stats = statSync(oldPath);
- if (!stats.error) {
- if (stats.isFile) {
- results.isFile = true;
- }
- else if (stats.isDirectory) {
- results.isDirectory = true;
- }
- renameNewRecursiveSync(oldPath, newPath, results);
- if (!results.error) {
- if (results.isDirectory) {
- const rmdirResults = removeDirSync(oldPath, { recursive: true });
- if (rmdirResults.error) {
- results.error = rmdirResults.error;
- }
- else {
- results.oldDirs.push(...rmdirResults.removedDirs);
- results.oldFiles.push(...rmdirResults.removedFiles);
- }
- }
- else if (results.isFile) {
- const removeFileResults = removeFileSync(oldPath);
- if (removeFileResults.error) {
- results.error = removeFileResults.error;
- }
- else {
- results.oldFiles.push(oldPath);
- }
- }
- }
- }
- else {
- results.error = `${oldPath} does not exist`;
- }
- return results;
- };
- const renameNewRecursiveSync = (oldPath, newPath, results) => {
- const itemStat = statSync(oldPath);
- if (!itemStat.error && !results.error) {
- if (itemStat.isFile) {
- const newFileParentDir = dirname(newPath);
- const createDirResults = createDirSync(newFileParentDir, { recursive: true });
- const fileContent = items.get(oldPath).data;
- const writeResults = writeFileSync(newPath, fileContent);
- results.newDirs.push(...createDirResults.newDirs);
- results.renamed.push({
- oldPath,
- newPath,
- isDirectory: false,
- isFile: true,
- });
- if (writeResults.error) {
- results.error = writeResults.error;
- }
- else {
- results.newFiles.push(newPath);
- }
- }
- else if (itemStat.isDirectory) {
- const oldDirItemChildPaths = readDirSync(oldPath);
- const createDirResults = createDirSync(newPath, { recursive: true });
- results.newDirs.push(...createDirResults.newDirs);
- results.renamed.push({
- oldPath,
- newPath,
- isDirectory: true,
- isFile: false,
- });
- for (const oldDirItemChildPath of oldDirItemChildPaths) {
- const newDirItemChildPath = oldDirItemChildPath.replace(oldPath, newPath);
- renameNewRecursiveSync(oldDirItemChildPath, newDirItemChildPath, results);
- }
- }
- }
- };
- const resolvePath = (p) => normalize(p);
- const removeDirSync = (p, opts = {}) => {
- const results = {
- basename: basename(p),
- dirname: dirname(p),
- path: p,
- removedDirs: [],
- removedFiles: [],
- error: null,
- };
- remoreDirSyncRecursive(p, opts, results);
- return results;
- };
- const remoreDirSyncRecursive = (p, opts, results) => {
- if (!results.error) {
- p = normalize(p);
- const dirItemPaths = readDirSync(p);
- if (opts && opts.recursive) {
- for (const dirItemPath of dirItemPaths) {
- const item = items.get(dirItemPath);
- if (item) {
- if (item.isDirectory) {
- remoreDirSyncRecursive(dirItemPath, opts, results);
- }
- else if (item.isFile) {
- const removeFileResults = removeFileSync(dirItemPath);
- if (removeFileResults.error) {
- results.error = removeFileResults.error;
- }
- else {
- results.removedFiles.push(dirItemPath);
- }
- }
- }
- }
- }
- else {
- if (dirItemPaths.length > 0) {
- results.error = `cannot delete directory that contains files/subdirectories`;
- return;
- }
- }
- items.delete(p);
- emitDirectoryWatch(p, new Set());
- results.removedDirs.push(p);
- }
- };
- const removeDir = async (p, opts = {}) => removeDirSync(p, opts);
- const statSync = (p) => {
- p = normalize(p);
- const item = items.get(p);
- if (item && (item.isDirectory || (item.isFile && typeof item.data === 'string'))) {
- return {
- isDirectory: item.isDirectory,
- isFile: item.isFile,
- isSymbolicLink: false,
- size: item.isFile && item.data ? item.data.length : 0,
- error: null,
- };
- }
- return {
- isDirectory: false,
- isFile: false,
- isSymbolicLink: false,
- size: 0,
- error: `ENOENT: no such file or directory, statSync '${p}'`,
- };
- };
- const stat = async (p) => statSync(p);
- const removeFileSync = (p) => {
- p = normalize(p);
- const results = {
- basename: basename(p),
- dirname: dirname(p),
- path: p,
- error: null,
- };
- const item = items.get(p);
- if (item) {
- if (item.watcherCallbacks) {
- for (const watcherCallback of item.watcherCallbacks) {
- watcherCallback(p, 'fileDelete');
- }
- }
- items.delete(p);
- emitDirectoryWatch(p, new Set());
- }
- return results;
- };
- const removeFile = async (p) => removeFileSync(p);
- const watchDirectory = (p, dirWatcherCallback) => {
- p = normalize(p);
- const item = items.get(p);
- const close = () => {
- const closeItem = items.get(p);
- if (closeItem && closeItem.watcherCallbacks) {
- const index = closeItem.watcherCallbacks.indexOf(dirWatcherCallback);
- if (index > -1) {
- closeItem.watcherCallbacks.splice(index, 1);
- }
- }
- };
- addDestory(close);
- if (item) {
- item.isDirectory = true;
- item.isFile = false;
- item.watcherCallbacks = item.watcherCallbacks || [];
- item.watcherCallbacks.push(dirWatcherCallback);
- }
- else {
- items.set(p, {
- basename: basename(p),
- dirname: dirname(p),
- isDirectory: true,
- isFile: false,
- watcherCallbacks: [dirWatcherCallback],
- data: undefined,
- });
- }
- return {
- close() {
- removeDestory(close);
- close();
- },
- };
- };
- const watchFile = (p, fileWatcherCallback) => {
- p = normalize(p);
- const item = items.get(p);
- const close = () => {
- const closeItem = items.get(p);
- if (closeItem && closeItem.watcherCallbacks) {
- const index = closeItem.watcherCallbacks.indexOf(fileWatcherCallback);
- if (index > -1) {
- closeItem.watcherCallbacks.splice(index, 1);
- }
- }
- };
- addDestory(close);
- if (item) {
- item.isDirectory = false;
- item.isFile = true;
- item.watcherCallbacks = item.watcherCallbacks || [];
- item.watcherCallbacks.push(fileWatcherCallback);
- }
- else {
- items.set(p, {
- basename: basename(p),
- dirname: dirname(p),
- isDirectory: false,
- isFile: true,
- watcherCallbacks: [fileWatcherCallback],
- data: undefined,
- });
- }
- return {
- close() {
- removeDestory(close);
- close();
- },
- };
- };
- const emitDirectoryWatch = (p, emitted) => {
- const parentDir = normalize(dirname(p));
- const dirItem = items.get(parentDir);
- if (dirItem && dirItem.isDirectory && dirItem.watcherCallbacks) {
- for (const watcherCallback of dirItem.watcherCallbacks) {
- watcherCallback(p, null);
- }
- }
- if (!emitted.has(parentDir)) {
- emitted.add(parentDir);
- emitDirectoryWatch(parentDir, emitted);
- }
- };
- const writeFileSync = (p, data) => {
- p = normalize(p);
- const results = {
- path: p,
- error: null,
- };
- const item = items.get(p);
- if (item) {
- const hasChanged = item.data !== data;
- item.data = data;
- if (hasChanged && item.watcherCallbacks) {
- for (const watcherCallback of item.watcherCallbacks) {
- watcherCallback(p, 'fileUpdate');
- }
- }
- }
- else {
- items.set(p, {
- basename: basename(p),
- dirname: dirname(p),
- isDirectory: false,
- isFile: true,
- watcherCallbacks: null,
- data,
- });
- emitDirectoryWatch(p, new Set());
- }
- return results;
- };
- /**
- * `self` is the global namespace object used within a web worker.
- * `window` is the browser's global namespace object (I reorganized this to check the reference on that second)
- * `global` is Node's global namespace object. https://nodejs.org/api/globals.html#globals_global
- *
- * loading in this order should allow workers, which are most common, then browser,
- * then Node to grab the reference to fetch correctly.
- */
- const fetch = typeof self !== 'undefined'
- ? self === null || self === void 0 ? void 0 : self.fetch
- : typeof window !== 'undefined'
- ? window === null || window === void 0 ? void 0 : window.fetch
- : typeof global !== 'undefined'
- ? global === null || global === void 0 ? void 0 : global.fetch
- : undefined;
- const writeFile = async (p, data) => writeFileSync(p, data);
- const tmpDirSync = () => '/.tmp';
- const tick = Promise.resolve();
- const nextTick = (cb) => tick.then(cb);
- const generateContentHash = async (content, hashLength) => {
- const arrayBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(content));
- const hashArray = Array.from(new Uint8Array(arrayBuffer)); // convert buffer to byte array
- let hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join(''); // convert bytes to hex string
- if (typeof hashLength === 'number') {
- hashHex = hashHex.slice(0, hashLength);
- }
- return hashHex;
- };
- const copy = async (copyTasks, srcDir) => {
- const results = {
- diagnostics: [],
- dirPaths: [],
- filePaths: [],
- };
- logger.info('todo, copy task', copyTasks.length, srcDir);
- return results;
- };
- const getEnvironmentVar = (key) => {
- return process$3 === null || process$3 === void 0 ? void 0 : process_1.env[key];
- };
- const getLocalModulePath = (opts) => join(opts.rootDir, 'node_modules', opts.moduleId, opts.path);
- const getRemoteModuleUrl = (opts) => {
- const npmBaseUrl = 'https://cdn.jsdelivr.net/npm/';
- const path = `${opts.moduleId}${opts.version ? '@' + opts.version : ''}/${opts.path}`;
- return new URL(path, npmBaseUrl).href;
- };
- const fileWatchTimeout = 32;
- createDirSync('/');
- const sys = {
- name: 'in-memory',
- version: version$3,
- events,
- access,
- accessSync,
- addDestory,
- copyFile,
- createDir,
- createDirSync,
- homeDir,
- isTTY,
- getEnvironmentVar,
- destroy,
- encodeToBase64,
- exit: async (exitCode) => logger.warn(`exit ${exitCode}`),
- getCurrentDirectory,
- getCompilerExecutingPath,
- getLocalModulePath,
- getRemoteModuleUrl,
- hardwareConcurrency,
- isSymbolicLink,
- nextTick,
- normalizePath: normalize,
- platformPath: pathBrowserify,
- readDir,
- readDirSync,
- readFile,
- readFileSync,
- realpath,
- realpathSync,
- removeDestory,
- rename,
- fetch,
- resolvePath,
- removeDir,
- removeDirSync,
- stat,
- statSync,
- tmpDirSync,
- removeFile,
- removeFileSync,
- watchDirectory,
- watchFile,
- watchTimeout: fileWatchTimeout,
- writeFile,
- writeFileSync,
- generateContentHash,
- createWorkerController: HAS_WEB_WORKER
- ? (maxConcurrentWorkers) => createWebWorkerMainController(sys, maxConcurrentWorkers)
- : null,
- details: {
- cpuModel: '',
- freemem: () => 0,
- platform: '',
- release: '',
- totalmem: 0,
- },
- copy,
- };
- sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, null, opts);
- return sys;
- };
- let cssProcessor;
- const autoprefixCss = async (cssText, opts) => {
- const output = {
- output: cssText,
- diagnostics: [],
- };
- if (!IS_NODE_ENV) {
- return output;
- }
- try {
- const autoprefixerOpts = opts != null && typeof opts === 'object' ? opts : DEFAULT_AUTOPREFIX_LEGACY;
- const processor = getProcessor(autoprefixerOpts);
- const result = await processor.process(cssText, { map: null });
- result.warnings().forEach((warning) => {
- output.diagnostics.push({
- header: `Autoprefix CSS: ${warning.plugin}`,
- messageText: warning.text,
- level: 'warn',
- type: 'css',
- });
- });
- output.output = result.css;
- }
- catch (e) {
- const diagnostic = {
- header: `Autoprefix CSS`,
- messageText: `CSS Error` + e,
- level: `error`,
- type: `css`,
- };
- if (typeof e.name === 'string') {
- diagnostic.header = e.name;
- }
- if (typeof e.reason === 'string') {
- diagnostic.messageText = e.reason;
- }
- if (typeof e.source === 'string' && typeof e.line === 'number') {
- const lines = e.source.replace(/\r/g, '\n').split('\n');
- if (lines.length > 0) {
- const addLine = (lineNumber) => {
- const line = lines[lineNumber];
- if (typeof line === 'string') {
- const printLine = {
- lineIndex: -1,
- lineNumber: -1,
- text: line,
- errorCharStart: -1,
- errorLength: -1,
- };
- diagnostic.lines = diagnostic.lines || [];
- diagnostic.lines.push(printLine);
- }
- };
- addLine(e.line - 3);
- addLine(e.line - 2);
- addLine(e.line - 1);
- addLine(e.line);
- addLine(e.line + 1);
- addLine(e.line + 2);
- addLine(e.line + 3);
- }
- }
- output.diagnostics.push(diagnostic);
- }
- return output;
- };
- const getProcessor = (autoprefixerOpts) => {
- const { postcss, autoprefixer } = requireFunc('../sys/node/autoprefixer.js');
- if (!cssProcessor) {
- cssProcessor = postcss([autoprefixer(autoprefixerOpts)]);
- }
- return cssProcessor;
- };
- const DEFAULT_AUTOPREFIX_LEGACY = {
- overrideBrowserslist: ['last 2 versions', 'iOS >= 9', 'Android >= 4.4', 'Explorer >= 11', 'ExplorerMobile >= 11'],
- cascade: false,
- remove: false,
- flexbox: 'no-2009',
- };
- const parseCss = (css, filePath) => {
- let lineno = 1;
- let column = 1;
- const diagnostics = [];
- const updatePosition = (str) => {
- const lines = str.match(/\n/g);
- if (lines)
- lineno += lines.length;
- const i = str.lastIndexOf('\n');
- column = ~i ? str.length - i : column + str.length;
- };
- const position = () => {
- const start = { line: lineno, column: column };
- return (node) => {
- node.position = new ParsePosition(start);
- whitespace();
- return node;
- };
- };
- const error = (msg) => {
- const srcLines = css.split('\n');
- const d = {
- level: 'error',
- type: 'css',
- language: 'css',
- header: 'CSS Parse',
- messageText: msg,
- absFilePath: filePath,
- lines: [
- {
- lineIndex: lineno - 1,
- lineNumber: lineno,
- errorCharStart: column,
- text: css[lineno - 1],
- },
- ],
- };
- if (lineno > 1) {
- const previousLine = {
- lineIndex: lineno - 1,
- lineNumber: lineno - 1,
- text: css[lineno - 2],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.unshift(previousLine);
- }
- if (lineno + 2 < srcLines.length) {
- const nextLine = {
- lineIndex: lineno,
- lineNumber: lineno + 1,
- text: srcLines[lineno],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.push(nextLine);
- }
- diagnostics.push(d);
- return null;
- };
- const stylesheet = () => {
- const rulesList = rules();
- return {
- type: 14 /* StyleSheet */,
- stylesheet: {
- source: filePath,
- rules: rulesList,
- },
- };
- };
- const open = () => match(/^{\s*/);
- const close = () => match(/^}/);
- const match = (re) => {
- const m = re.exec(css);
- if (!m)
- return;
- const str = m[0];
- updatePosition(str);
- css = css.slice(str.length);
- return m;
- };
- const rules = () => {
- let node;
- const rules = [];
- whitespace();
- comments(rules);
- while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {
- if (node !== false) {
- rules.push(node);
- comments(rules);
- }
- }
- return rules;
- };
- /**
- * Parse whitespace.
- */
- const whitespace = () => match(/^\s*/);
- const comments = (rules) => {
- let c;
- rules = rules || [];
- while ((c = comment())) {
- if (c !== false) {
- rules.push(c);
- }
- }
- return rules;
- };
- const comment = () => {
- const pos = position();
- if ('/' !== css.charAt(0) || '*' !== css.charAt(1))
- return null;
- let i = 2;
- while ('' !== css.charAt(i) && ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1)))
- ++i;
- i += 2;
- if ('' === css.charAt(i - 1)) {
- return error('End of comment missing');
- }
- const comment = css.slice(2, i - 2);
- column += 2;
- updatePosition(comment);
- css = css.slice(i);
- column += 2;
- return pos({
- type: 1 /* Comment */,
- comment,
- });
- };
- const selector = () => {
- const m = match(/^([^{]+)/);
- if (!m)
- return null;
- return trim(m[0])
- .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
- .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
- return m.replace(/,/g, '\u200C');
- })
- .split(/\s*(?![^(]*\)),\s*/)
- .map(function (s) {
- return s.replace(/\u200C/g, ',');
- });
- };
- const declaration = () => {
- const pos = position();
- // prop
- let prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
- if (!prop)
- return null;
- prop = trim(prop[0]);
- // :
- if (!match(/^:\s*/))
- return error(`property missing ':'`);
- // val
- const val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
- const ret = pos({
- type: 4 /* Declaration */,
- property: prop.replace(commentre, ''),
- value: val ? trim(val[0]).replace(commentre, '') : '',
- });
- match(/^[;\s]*/);
- return ret;
- };
- const declarations = () => {
- const decls = [];
- if (!open())
- return error(`missing '{'`);
- comments(decls);
- // declarations
- let decl;
- while ((decl = declaration())) {
- if (decl !== false) {
- decls.push(decl);
- comments(decls);
- }
- }
- if (!close())
- return error(`missing '}'`);
- return decls;
- };
- const keyframe = () => {
- let m;
- const values = [];
- const pos = position();
- while ((m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/))) {
- values.push(m[1]);
- match(/^,\s*/);
- }
- if (!values.length)
- return null;
- return pos({
- type: 9 /* KeyFrame */,
- values,
- declarations: declarations(),
- });
- };
- const atkeyframes = () => {
- const pos = position();
- let m = match(/^@([-\w]+)?keyframes\s*/);
- if (!m)
- return null;
- const vendor = m[1];
- // identifier
- m = match(/^([-\w]+)\s*/);
- if (!m)
- return error(`@keyframes missing name`);
- const name = m[1];
- if (!open())
- return error(`@keyframes missing '{'`);
- let frame;
- let frames = comments();
- while ((frame = keyframe())) {
- frames.push(frame);
- frames = frames.concat(comments());
- }
- if (!close())
- return error(`@keyframes missing '}'`);
- return pos({
- type: 8 /* KeyFrames */,
- name: name,
- vendor: vendor,
- keyframes: frames,
- });
- };
- const atsupports = () => {
- const pos = position();
- const m = match(/^@supports *([^{]+)/);
- if (!m)
- return null;
- const supports = trim(m[1]);
- if (!open())
- return error(`@supports missing '{'`);
- const style = comments().concat(rules());
- if (!close())
- return error(`@supports missing '}'`);
- return pos({
- type: 15 /* Supports */,
- supports: supports,
- rules: style,
- });
- };
- const athost = () => {
- const pos = position();
- const m = match(/^@host\s*/);
- if (!m)
- return null;
- if (!open())
- return error(`@host missing '{'`);
- const style = comments().concat(rules());
- if (!close())
- return error(`@host missing '}'`);
- return pos({
- type: 6 /* Host */,
- rules: style,
- });
- };
- const atmedia = () => {
- const pos = position();
- const m = match(/^@media *([^{]+)/);
- if (!m)
- return null;
- const media = trim(m[1]);
- if (!open())
- return error(`@media missing '{'`);
- const style = comments().concat(rules());
- if (!close())
- return error(`@media missing '}'`);
- return pos({
- type: 10 /* Media */,
- media: media,
- rules: style,
- });
- };
- const atcustommedia = () => {
- const pos = position();
- const m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
- if (!m)
- return null;
- return pos({
- type: 2 /* CustomMedia */,
- name: trim(m[1]),
- media: trim(m[2]),
- });
- };
- const atpage = () => {
- const pos = position();
- const m = match(/^@page */);
- if (!m)
- return null;
- const sel = selector() || [];
- if (!open())
- return error(`@page missing '{'`);
- let decls = comments();
- let decl;
- while ((decl = declaration())) {
- decls.push(decl);
- decls = decls.concat(comments());
- }
- if (!close())
- return error(`@page missing '}'`);
- return pos({
- type: 12 /* Page */,
- selectors: sel,
- declarations: decls,
- });
- };
- const atdocument = () => {
- const pos = position();
- const m = match(/^@([-\w]+)?document *([^{]+)/);
- if (!m)
- return null;
- const vendor = trim(m[1]);
- const doc = trim(m[2]);
- if (!open())
- return error(`@document missing '{'`);
- const style = comments().concat(rules());
- if (!close())
- return error(`@document missing '}'`);
- return pos({
- type: 3 /* Document */,
- document: doc,
- vendor: vendor,
- rules: style,
- });
- };
- const atfontface = () => {
- const pos = position();
- const m = match(/^@font-face\s*/);
- if (!m)
- return null;
- if (!open())
- return error(`@font-face missing '{'`);
- let decls = comments();
- let decl;
- while ((decl = declaration())) {
- decls.push(decl);
- decls = decls.concat(comments());
- }
- if (!close())
- return error(`@font-face missing '}'`);
- return pos({
- type: 5 /* FontFace */,
- declarations: decls,
- });
- };
- const compileAtrule = (nodeName, nodeType) => {
- const re = new RegExp('^@' + nodeName + '\\s*([^;]+);');
- return () => {
- const pos = position();
- const m = match(re);
- if (!m)
- return null;
- const node = {
- type: nodeType,
- };
- node[nodeName] = m[1].trim();
- return pos(node);
- };
- };
- const atimport = compileAtrule('import', 7 /* Import */);
- const atcharset = compileAtrule('charset', 0 /* Charset */);
- const atnamespace = compileAtrule('namespace', 11 /* Namespace */);
- const atrule = () => {
- if (css[0] !== '@')
- return null;
- return (atkeyframes() ||
- atmedia() ||
- atcustommedia() ||
- atsupports() ||
- atimport() ||
- atcharset() ||
- atnamespace() ||
- atdocument() ||
- atpage() ||
- athost() ||
- atfontface());
- };
- const rule = () => {
- const pos = position();
- const sel = selector();
- if (!sel)
- return error('selector missing');
- comments();
- return pos({
- type: 13 /* Rule */,
- selectors: sel,
- declarations: declarations(),
- });
- };
- class ParsePosition {
- constructor(start) {
- this.start = start;
- this.end = { line: lineno, column: column };
- this.source = filePath;
- }
- }
- ParsePosition.prototype.content = css;
- return {
- diagnostics,
- ...addParent(stylesheet()),
- };
- };
- const trim = (str) => (str ? str.trim() : '');
- /**
- * Adds non-enumerable parent node reference to each node.
- */
- const addParent = (obj, parent) => {
- const isNode = obj && typeof obj.type === 'string';
- const childParent = isNode ? obj : parent;
- for (const k in obj) {
- const value = obj[k];
- if (Array.isArray(value)) {
- value.forEach(function (v) {
- addParent(v, childParent);
- });
- }
- else if (value && typeof value === 'object') {
- addParent(value, childParent);
- }
- }
- if (isNode) {
- Object.defineProperty(obj, 'parent', {
- configurable: true,
- writable: true,
- enumerable: false,
- value: parent || null,
- });
- }
- return obj;
- };
- // http://www.w3.org/TR/CSS21/grammar.html
- // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
- const commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
- const getCssSelectors = (sel) => {
- // reusing global SELECTORS since this is a synchronous operation
- SELECTORS.all.length =
- SELECTORS.tags.length =
- SELECTORS.classNames.length =
- SELECTORS.ids.length =
- SELECTORS.attrs.length =
- 0;
- sel = sel
- .replace(/\./g, ' .')
- .replace(/\#/g, ' #')
- .replace(/\[/g, ' [')
- .replace(/\>/g, ' > ')
- .replace(/\+/g, ' + ')
- .replace(/\~/g, ' ~ ')
- .replace(/\*/g, ' * ')
- .replace(/\:not\((.*?)\)/g, ' ');
- const items = sel.split(' ');
- for (let i = 0, l = items.length; i < l; i++) {
- items[i] = items[i].split(':')[0];
- if (items[i].length === 0)
- continue;
- if (items[i].charAt(0) === '.') {
- SELECTORS.classNames.push(items[i].slice(1));
- }
- else if (items[i].charAt(0) === '#') {
- SELECTORS.ids.push(items[i].slice(1));
- }
- else if (items[i].charAt(0) === '[') {
- items[i] = items[i].slice(1).split('=')[0].split(']')[0].trim();
- SELECTORS.attrs.push(items[i].toLowerCase());
- }
- else if (/[a-z]/g.test(items[i].charAt(0))) {
- SELECTORS.tags.push(items[i].toLowerCase());
- }
- }
- SELECTORS.classNames = SELECTORS.classNames.sort((a, b) => {
- if (a.length < b.length)
- return -1;
- if (a.length > b.length)
- return 1;
- return 0;
- });
- return SELECTORS;
- };
- const SELECTORS = {
- all: [],
- tags: [],
- classNames: [],
- ids: [],
- attrs: [],
- };
- const serializeCss = (stylesheet, serializeOpts) => {
- const usedSelectors = serializeOpts.usedSelectors || null;
- const opts = {
- usedSelectors: usedSelectors || null,
- hasUsedAttrs: !!usedSelectors && usedSelectors.attrs.size > 0,
- hasUsedClassNames: !!usedSelectors && usedSelectors.classNames.size > 0,
- hasUsedIds: !!usedSelectors && usedSelectors.ids.size > 0,
- hasUsedTags: !!usedSelectors && usedSelectors.tags.size > 0,
- };
- const rules = stylesheet.rules;
- if (!rules) {
- return '';
- }
- const rulesLen = rules.length;
- const out = [];
- for (let i = 0; i < rulesLen; i++) {
- out.push(serializeCssVisitNode(opts, rules[i], i, rulesLen));
- }
- return out.join('');
- };
- const serializeCssVisitNode = (opts, node, index, len) => {
- const nodeType = node.type;
- if (nodeType === 4 /* Declaration */) {
- return serializeCssDeclaration(node, index, len);
- }
- if (nodeType === 13 /* Rule */) {
- return serializeCssRule(opts, node);
- }
- if (nodeType === 1 /* Comment */) {
- if (node.comment[0] === '!') {
- return `/*${node.comment}*/`;
- }
- else {
- return '';
- }
- }
- if (nodeType === 10 /* Media */) {
- return serializeCssMedia(opts, node);
- }
- if (nodeType === 8 /* KeyFrames */) {
- return serializeCssKeyframes(opts, node);
- }
- if (nodeType === 9 /* KeyFrame */) {
- return serializeCssKeyframe(opts, node);
- }
- if (nodeType === 5 /* FontFace */) {
- return serializeCssFontFace(opts, node);
- }
- if (nodeType === 15 /* Supports */) {
- return serializeCssSupports(opts, node);
- }
- if (nodeType === 7 /* Import */) {
- return '@import ' + node.import + ';';
- }
- if (nodeType === 0 /* Charset */) {
- return '@charset ' + node.charset + ';';
- }
- if (nodeType === 12 /* Page */) {
- return serializeCssPage(opts, node);
- }
- if (nodeType === 6 /* Host */) {
- return '@host{' + serializeCssMapVisit(opts, node.rules) + '}';
- }
- if (nodeType === 2 /* CustomMedia */) {
- return '@custom-media ' + node.name + ' ' + node.media + ';';
- }
- if (nodeType === 3 /* Document */) {
- return serializeCssDocument(opts, node);
- }
- if (nodeType === 11 /* Namespace */) {
- return '@namespace ' + node.namespace + ';';
- }
- return '';
- };
- const serializeCssRule = (opts, node) => {
- const decls = node.declarations;
- const usedSelectors = opts.usedSelectors;
- const selectors = node.selectors.slice();
- if (decls == null || decls.length === 0) {
- return '';
- }
- if (usedSelectors) {
- let i;
- let j;
- let include = true;
- for (i = selectors.length - 1; i >= 0; i--) {
- const sel = getCssSelectors(selectors[i]);
- include = true;
- // classes
- let jlen = sel.classNames.length;
- if (jlen > 0 && opts.hasUsedClassNames) {
- for (j = 0; j < jlen; j++) {
- if (!usedSelectors.classNames.has(sel.classNames[j])) {
- include = false;
- break;
- }
- }
- }
- // tags
- if (include && opts.hasUsedTags) {
- jlen = sel.tags.length;
- if (jlen > 0) {
- for (j = 0; j < jlen; j++) {
- if (!usedSelectors.tags.has(sel.tags[j])) {
- include = false;
- break;
- }
- }
- }
- }
- // attrs
- if (include && opts.hasUsedAttrs) {
- jlen = sel.attrs.length;
- if (jlen > 0) {
- for (j = 0; j < jlen; j++) {
- if (!usedSelectors.attrs.has(sel.attrs[j])) {
- include = false;
- break;
- }
- }
- }
- }
- // ids
- if (include && opts.hasUsedIds) {
- jlen = sel.ids.length;
- if (jlen > 0) {
- for (j = 0; j < jlen; j++) {
- if (!usedSelectors.ids.has(sel.ids[j])) {
- include = false;
- break;
- }
- }
- }
- }
- if (!include) {
- selectors.splice(i, 1);
- }
- }
- }
- if (selectors.length === 0) {
- return '';
- }
- const cleanedSelectors = [];
- let cleanedSelector = '';
- for (const selector of node.selectors) {
- cleanedSelector = removeSelectorWhitespace(selector);
- if (!cleanedSelectors.includes(cleanedSelector)) {
- cleanedSelectors.push(cleanedSelector);
- }
- }
- return `${cleanedSelectors}{${serializeCssMapVisit(opts, decls)}}`;
- };
- const serializeCssDeclaration = (node, index, len) => {
- if (node.value === '') {
- return '';
- }
- if (len - 1 === index) {
- return node.property + ':' + node.value;
- }
- return node.property + ':' + node.value + ';';
- };
- const serializeCssMedia = (opts, node) => {
- const mediaCss = serializeCssMapVisit(opts, node.rules);
- if (mediaCss === '') {
- return '';
- }
- return '@media ' + removeMediaWhitespace(node.media) + '{' + mediaCss + '}';
- };
- const serializeCssKeyframes = (opts, node) => {
- const keyframesCss = serializeCssMapVisit(opts, node.keyframes);
- if (keyframesCss === '') {
- return '';
- }
- return '@' + (node.vendor || '') + 'keyframes ' + node.name + '{' + keyframesCss + '}';
- };
- const serializeCssKeyframe = (opts, node) => {
- return node.values.join(',') + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
- };
- const serializeCssFontFace = (opts, node) => {
- const fontCss = serializeCssMapVisit(opts, node.declarations);
- if (fontCss === '') {
- return '';
- }
- return '@font-face{' + fontCss + '}';
- };
- const serializeCssSupports = (opts, node) => {
- const supportsCss = serializeCssMapVisit(opts, node.rules);
- if (supportsCss === '') {
- return '';
- }
- return '@supports ' + node.supports + '{' + supportsCss + '}';
- };
- const serializeCssPage = (opts, node) => {
- const sel = node.selectors.join(', ');
- return '@page ' + sel + '{' + serializeCssMapVisit(opts, node.declarations) + '}';
- };
- const serializeCssDocument = (opts, node) => {
- const documentCss = serializeCssMapVisit(opts, node.rules);
- const doc = '@' + (node.vendor || '') + 'document ' + node.document;
- if (documentCss === '') {
- return '';
- }
- return doc + '{' + documentCss + '}';
- };
- const serializeCssMapVisit = (opts, nodes) => {
- let rtn = '';
- if (nodes) {
- for (let i = 0, len = nodes.length; i < len; i++) {
- rtn += serializeCssVisitNode(opts, nodes[i], i, len);
- }
- }
- return rtn;
- };
- const removeSelectorWhitespace = (selector) => {
- let rtn = '';
- let char = '';
- let inAttr = false;
- selector = selector.trim();
- for (let i = 0, l = selector.length; i < l; i++) {
- char = selector[i];
- if (char === '[' && rtn[rtn.length - 1] !== '\\') {
- inAttr = true;
- }
- else if (char === ']' && rtn[rtn.length - 1] !== '\\') {
- inAttr = false;
- }
- if (!inAttr && CSS_WS_REG.test(char)) {
- if (CSS_NEXT_CHAR_REG.test(selector[i + 1])) {
- continue;
- }
- if (CSS_PREV_CHAR_REG.test(rtn[rtn.length - 1])) {
- continue;
- }
- rtn += ' ';
- }
- else {
- rtn += char;
- }
- }
- return rtn;
- };
- const removeMediaWhitespace = (media) => {
- let rtn = '';
- let char = '';
- media = media.trim();
- for (let i = 0, l = media.length; i < l; i++) {
- char = media[i];
- if (CSS_WS_REG.test(char)) {
- if (CSS_WS_REG.test(rtn[rtn.length - 1])) {
- continue;
- }
- rtn += ' ';
- }
- else {
- rtn += char;
- }
- }
- return rtn;
- };
- const CSS_WS_REG = /\s/;
- const CSS_NEXT_CHAR_REG = /[>\(\)\~\,\+\s]/;
- const CSS_PREV_CHAR_REG = /[>\(\~\,\+]/;
- const minifyCss = async (input) => {
- const parseResults = parseCss(input.css);
- if (hasError(parseResults.diagnostics)) {
- return input.css;
- }
- if (isFunction(input.resolveUrl) && parseResults.stylesheet && Array.isArray(parseResults.stylesheet.rules)) {
- await resolveStylesheetUrl(parseResults.stylesheet.rules, input.resolveUrl);
- }
- return serializeCss(parseResults.stylesheet, {});
- };
- const resolveStylesheetUrl = async (nodes, resolveUrl, resolved) => {
- for (const node of nodes) {
- if (node.type === 4 /* Declaration */ && isString$1(node.value) && node.value.includes('url(')) {
- const urlSplt = node.value.split(',').map((n) => n.trim());
- for (let i = 0; i < urlSplt.length; i++) {
- const r = /url\((.*?)\)/.exec(urlSplt[i]);
- if (r) {
- try {
- const orgUrl = r[1].replace(/(\'|\")/g, '');
- const newUrl = await resolveUrl(orgUrl);
- urlSplt[i] = urlSplt[i].replace(orgUrl, newUrl);
- }
- catch (e) { }
- }
- }
- node.value = urlSplt.join(',');
- }
- if (Array.isArray(node.declarations)) {
- await resolveStylesheetUrl(node.declarations, resolveUrl);
- }
- if (Array.isArray(node.rules)) {
- await resolveStylesheetUrl(node.rules, resolveUrl);
- }
- if (Array.isArray(node.keyframes)) {
- await resolveStylesheetUrl(node.keyframes, resolveUrl);
- }
- }
- };
- const optimizeCss$1 = async (inputOpts) => {
- let result = {
- output: inputOpts.input,
- diagnostics: [],
- };
- if (inputOpts.autoprefixer !== false && inputOpts.autoprefixer !== null) {
- result = await autoprefixCss(inputOpts.input, inputOpts.autoprefixer);
- if (hasError(result.diagnostics)) {
- return result;
- }
- }
- if (inputOpts.minify !== false) {
- result.output = await minifyCss({
- css: result.output,
- resolveUrl: inputOpts.resolveUrl,
- });
- }
- return result;
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
- /**
- * Encode an integer in the range of 0 to 63 to a single base 64 digit.
- */
- var encode$4 = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
- };
- /**
- * Decode a single base 64 character code digit to an integer. Returns -1 on
- * failure.
- */
- var decode$2 = function (charCode) {
- var bigA = 65; // 'A'
- var bigZ = 90; // 'Z'
- var littleA = 97; // 'a'
- var littleZ = 122; // 'z'
- var zero = 48; // '0'
- var nine = 57; // '9'
- var plus = 43; // '+'
- var slash = 47; // '/'
- var littleOffset = 26;
- var numberOffset = 52;
- // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
- if (bigA <= charCode && charCode <= bigZ) {
- return (charCode - bigA);
- }
- // 26 - 51: abcdefghijklmnopqrstuvwxyz
- if (littleA <= charCode && charCode <= littleZ) {
- return (charCode - littleA + littleOffset);
- }
- // 52 - 61: 0123456789
- if (zero <= charCode && charCode <= nine) {
- return (charCode - zero + numberOffset);
- }
- // 62: +
- if (charCode == plus) {
- return 62;
- }
- // 63: /
- if (charCode == slash) {
- return 63;
- }
- // Invalid base64 digit.
- return -1;
- };
- var base64 = {
- encode: encode$4,
- decode: decode$2
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- *
- * Based on the Base 64 VLQ implementation in Closure Compiler:
- * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
- *
- * Copyright 2011 The Closure Compiler Authors. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- // A single base 64 digit can contain 6 bits of data. For the base 64 variable
- // length quantities we use in the source map spec, the first bit is the sign,
- // the next four bits are the actual value, and the 6th bit is the
- // continuation bit. The continuation bit tells us whether there are more
- // digits in this value following this digit.
- //
- // Continuation
- // | Sign
- // | |
- // V V
- // 101011
- var VLQ_BASE_SHIFT = 5;
- // binary: 100000
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
- // binary: 011111
- var VLQ_BASE_MASK = VLQ_BASE - 1;
- // binary: 100000
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
- /**
- * Converts from a two-complement value to a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
- * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
- */
- function toVLQSigned(aValue) {
- return aValue < 0
- ? ((-aValue) << 1) + 1
- : (aValue << 1) + 0;
- }
- /**
- * Converts to a two-complement value from a value where the sign bit is
- * placed in the least significant bit. For example, as decimals:
- * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
- * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
- */
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative
- ? -shifted
- : shifted;
- }
- /**
- * Returns the base 64 VLQ encoded value.
- */
- var encode$3 = function base64VLQ_encode(aValue) {
- var encoded = "";
- var digit;
- var vlq = toVLQSigned(aValue);
- do {
- digit = vlq & VLQ_BASE_MASK;
- vlq >>>= VLQ_BASE_SHIFT;
- if (vlq > 0) {
- // There are still more digits in this value, so we must make sure the
- // continuation bit is marked.
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
- return encoded;
- };
- /**
- * Decodes the next base 64 VLQ value from the given string and returns the
- * value and the rest of the string via the out parameter.
- */
- var decode$1 = function base64VLQ_decode(aStr, aIndex, aOutParam) {
- var strLen = aStr.length;
- var result = 0;
- var shift = 0;
- var continuation, digit;
- do {
- if (aIndex >= strLen) {
- throw new Error("Expected more digits in base 64 VLQ value.");
- }
- digit = base64.decode(aStr.charCodeAt(aIndex++));
- if (digit === -1) {
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
- }
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
- digit &= VLQ_BASE_MASK;
- result = result + (digit << shift);
- shift += VLQ_BASE_SHIFT;
- } while (continuation);
- aOutParam.value = fromVLQSigned(result);
- aOutParam.rest = aIndex;
- };
- var base64Vlq = {
- encode: encode$3,
- decode: decode$1
- };
- var util$1 = createCommonjsModule$1(function (module, exports) {
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- /**
- * This is a helper function for getting values from parameter/options
- * objects.
- *
- * @param args The object we are extracting values from
- * @param name The name of the property we are getting.
- * @param defaultValue An optional value to return if the property is missing
- * from the object. If this is not specified and the property is missing, an
- * error will be thrown.
- */
- function getArg(aArgs, aName, aDefaultValue) {
- if (aName in aArgs) {
- return aArgs[aName];
- } else if (arguments.length === 3) {
- return aDefaultValue;
- } else {
- throw new Error('"' + aName + '" is a required argument.');
- }
- }
- exports.getArg = getArg;
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
- var dataUrlRegexp = /^data:.+\,.+$/;
- function urlParse(aUrl) {
- var match = aUrl.match(urlRegexp);
- if (!match) {
- return null;
- }
- return {
- scheme: match[1],
- auth: match[2],
- host: match[3],
- port: match[4],
- path: match[5]
- };
- }
- exports.urlParse = urlParse;
- function urlGenerate(aParsedUrl) {
- var url = '';
- if (aParsedUrl.scheme) {
- url += aParsedUrl.scheme + ':';
- }
- url += '//';
- if (aParsedUrl.auth) {
- url += aParsedUrl.auth + '@';
- }
- if (aParsedUrl.host) {
- url += aParsedUrl.host;
- }
- if (aParsedUrl.port) {
- url += ":" + aParsedUrl.port;
- }
- if (aParsedUrl.path) {
- url += aParsedUrl.path;
- }
- return url;
- }
- exports.urlGenerate = urlGenerate;
- /**
- * Normalizes a path, or the path portion of a URL:
- *
- * - Replaces consecutive slashes with one slash.
- * - Removes unnecessary '.' parts.
- * - Removes unnecessary '<dir>/..' parts.
- *
- * Based on code in the Node.js 'path' core module.
- *
- * @param aPath The path or url to normalize.
- */
- function normalize(aPath) {
- var path = aPath;
- var url = urlParse(aPath);
- if (url) {
- if (!url.path) {
- return aPath;
- }
- path = url.path;
- }
- var isAbsolute = exports.isAbsolute(path);
- var parts = path.split(/\/+/);
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
- part = parts[i];
- if (part === '.') {
- parts.splice(i, 1);
- } else if (part === '..') {
- up++;
- } else if (up > 0) {
- if (part === '') {
- // The first part is blank if the path is absolute. Trying to go
- // above the root is a no-op. Therefore we can remove all '..' parts
- // directly after the root.
- parts.splice(i + 1, up);
- up = 0;
- } else {
- parts.splice(i, 2);
- up--;
- }
- }
- }
- path = parts.join('/');
- if (path === '') {
- path = isAbsolute ? '/' : '.';
- }
- if (url) {
- url.path = path;
- return urlGenerate(url);
- }
- return path;
- }
- exports.normalize = normalize;
- /**
- * Joins two paths/URLs.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be joined with the root.
- *
- * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
- * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
- * first.
- * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
- * is updated with the result and aRoot is returned. Otherwise the result
- * is returned.
- * - If aPath is absolute, the result is aPath.
- * - Otherwise the two paths are joined with a slash.
- * - Joining for example 'http://' and 'www.example.com' is also supported.
- */
- function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
- // `join(foo, '//www.example.org')`
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
- // `join('http://', 'www.example.com')`
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
- aRootUrl.host = aPath;
- return urlGenerate(aRootUrl);
- }
- var joined = aPath.charAt(0) === '/'
- ? aPath
- : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
- if (aRootUrl) {
- aRootUrl.path = joined;
- return urlGenerate(aRootUrl);
- }
- return joined;
- }
- exports.join = join;
- exports.isAbsolute = function (aPath) {
- return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
- };
- /**
- * Make a path relative to a URL or another path.
- *
- * @param aRoot The root path or URL.
- * @param aPath The path or URL to be made relative to aRoot.
- */
- function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- aRoot = aRoot.replace(/\/$/, '');
- // It is possible for the path to be above the root. In this case, simply
- // checking whether the root is a prefix of the path won't work. Instead, we
- // need to remove components from the root one by one, until either we find
- // a prefix that fits, or we run out of components to remove.
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
- // If the only part of the root that is left is the scheme (i.e. http://,
- // file:///, etc.), one or more slashes (/), or simply nothing at all, we
- // have exhausted all components, so the path is not relative to the root.
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
- ++level;
- }
- // Make sure we add a "../" for each component we removed from the root.
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
- }
- exports.relative = relative;
- var supportsNullProto = (function () {
- var obj = Object.create(null);
- return !('__proto__' in obj);
- }());
- function identity (s) {
- return s;
- }
- /**
- * Because behavior goes wacky when you set `__proto__` on objects, we
- * have to prefix all the strings in our set with an arbitrary character.
- *
- * See https://github.com/mozilla/source-map/pull/31 and
- * https://github.com/mozilla/source-map/issues/30
- *
- * @param String aStr
- */
- function toSetString(aStr) {
- if (isProtoString(aStr)) {
- return '$' + aStr;
- }
- return aStr;
- }
- exports.toSetString = supportsNullProto ? identity : toSetString;
- function fromSetString(aStr) {
- if (isProtoString(aStr)) {
- return aStr.slice(1);
- }
- return aStr;
- }
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
- function isProtoString(s) {
- if (!s) {
- return false;
- }
- var length = s.length;
- if (length < 9 /* "__proto__".length */) {
- return false;
- }
- if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
- s.charCodeAt(length - 2) !== 95 /* '_' */ ||
- s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 4) !== 116 /* 't' */ ||
- s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
- s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
- s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
- s.charCodeAt(length - 8) !== 95 /* '_' */ ||
- s.charCodeAt(length - 9) !== 95 /* '_' */) {
- return false;
- }
- for (var i = length - 10; i >= 0; i--) {
- if (s.charCodeAt(i) !== 36 /* '$' */) {
- return false;
- }
- }
- return true;
- }
- /**
- * Comparator between two mappings where the original positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same original source/line/column, but different generated
- * line and column the same. Useful when searching for a mapping with a
- * stubbed out mapping.
- */
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
- var cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0 || onlyCompareOriginal) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByOriginalPositions = compareByOriginalPositions;
- /**
- * Comparator between two mappings with deflated source and name indices where
- * the generated positions are compared.
- *
- * Optionally pass in `true` as `onlyCompareGenerated` to consider two
- * mappings with the same generated line and column, but different
- * source/name/original line and column the same. Useful when searching for a
- * mapping with a stubbed out mapping.
- */
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0 || onlyCompareGenerated) {
- return cmp;
- }
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
- function strcmp(aStr1, aStr2) {
- if (aStr1 === aStr2) {
- return 0;
- }
- if (aStr1 === null) {
- return 1; // aStr2 !== null
- }
- if (aStr2 === null) {
- return -1; // aStr1 !== null
- }
- if (aStr1 > aStr2) {
- return 1;
- }
- return -1;
- }
- /**
- * Comparator between two mappings with inflated source and name strings where
- * the generated positions are compared.
- */
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = strcmp(mappingA.source, mappingB.source);
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalLine - mappingB.originalLine;
- if (cmp !== 0) {
- return cmp;
- }
- cmp = mappingA.originalColumn - mappingB.originalColumn;
- if (cmp !== 0) {
- return cmp;
- }
- return strcmp(mappingA.name, mappingB.name);
- }
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
- /**
- * Strip any JSON XSSI avoidance prefix from the string (as documented
- * in the source maps specification), and then parse the string as
- * JSON.
- */
- function parseSourceMapInput(str) {
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
- }
- exports.parseSourceMapInput = parseSourceMapInput;
- /**
- * Compute the URL of a source given the the source root, the source's
- * URL, and the source map's URL.
- */
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
- sourceURL = sourceURL || '';
- if (sourceRoot) {
- // This follows what Chrome does.
- if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
- sourceRoot += '/';
- }
- // The spec says:
- // Line 4: An optional source root, useful for relocating source
- // files on a server or removing repeated values in the
- // “sources” entry. This value is prepended to the individual
- // entries in the “source” field.
- sourceURL = sourceRoot + sourceURL;
- }
- // Historically, SourceMapConsumer did not take the sourceMapURL as
- // a parameter. This mode is still somewhat supported, which is why
- // this code block is conditional. However, it's preferable to pass
- // the source map URL to SourceMapConsumer, so that this function
- // can implement the source URL resolution algorithm as outlined in
- // the spec. This block is basically the equivalent of:
- // new URL(sourceURL, sourceMapURL).toString()
- // ... except it avoids using URL, which wasn't available in the
- // older releases of node still supported by this library.
- //
- // The spec says:
- // If the sources are not absolute URLs after prepending of the
- // “sourceRoot”, the sources are resolved relative to the
- // SourceMap (like resolving script src in a html document).
- if (sourceMapURL) {
- var parsed = urlParse(sourceMapURL);
- if (!parsed) {
- throw new Error("sourceMapURL could not be parsed");
- }
- if (parsed.path) {
- // Strip the last path component, but keep the "/".
- var index = parsed.path.lastIndexOf('/');
- if (index >= 0) {
- parsed.path = parsed.path.substring(0, index + 1);
- }
- }
- sourceURL = join(urlGenerate(parsed), sourceURL);
- }
- return normalize(sourceURL);
- }
- exports.computeSourceURL = computeSourceURL;
- });
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var has$1 = Object.prototype.hasOwnProperty;
- var hasNativeMap = typeof Map !== "undefined";
- /**
- * A data structure which is a combination of an array and a set. Adding a new
- * member is O(1), testing for membership is O(1), and finding the index of an
- * element is O(1). Removing elements from the set is not supported. Only
- * strings are supported for membership.
- */
- function ArraySet$2() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
- }
- /**
- * Static method for creating ArraySet instances from an existing array.
- */
- ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet$2();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
- /**
- * Return how many unique items are in this ArraySet. If duplicates have been
- * added, than those do not count towards the size.
- *
- * @returns Number
- */
- ArraySet$2.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
- };
- /**
- * Add the given string to this set.
- *
- * @param String aStr
- */
- ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util$1.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
- var idx = this._array.length;
- if (!isDuplicate || aAllowDuplicates) {
- this._array.push(aStr);
- }
- if (!isDuplicate) {
- if (hasNativeMap) {
- this._set.set(aStr, idx);
- } else {
- this._set[sStr] = idx;
- }
- }
- };
- /**
- * Is the given string a member of this set?
- *
- * @param String aStr
- */
- ArraySet$2.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util$1.toSetString(aStr);
- return has$1.call(this._set, sStr);
- }
- };
- /**
- * What is the index of the given string in the array?
- *
- * @param String aStr
- */
- ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util$1.toSetString(aStr);
- if (has$1.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
- throw new Error('"' + aStr + '" is not in the set.');
- };
- /**
- * What is the element at the given index?
- *
- * @param Number aIdx
- */
- ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
- if (aIdx >= 0 && aIdx < this._array.length) {
- return this._array[aIdx];
- }
- throw new Error('No element indexed by ' + aIdx);
- };
- /**
- * Returns the array representation of this set (which has the proper indices
- * indicated by indexOf). Note that this is a copy of the internal array used
- * for storing the members so that no one can mess with internal state.
- */
- ArraySet$2.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
- var ArraySet_1 = ArraySet$2;
- var arraySet = {
- ArraySet: ArraySet_1
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2014 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- /**
- * Determine whether mappingB is after mappingA with respect to generated
- * position.
- */
- function generatedPositionAfter(mappingA, mappingB) {
- // Optimized for most common case
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
- }
- /**
- * A data structure to provide a sorted view of accumulated mappings in a
- * performance conscious manner. It trades a neglibable overhead in general
- * case for a large speedup in case of mappings being added in order.
- */
- function MappingList$1() {
- this._array = [];
- this._sorted = true;
- // Serves as infimum
- this._last = {generatedLine: -1, generatedColumn: 0};
- }
- /**
- * Iterate through internal items. This method takes the same arguments that
- * `Array.prototype.forEach` takes.
- *
- * NOTE: The order of the mappings is NOT guaranteed.
- */
- MappingList$1.prototype.unsortedForEach =
- function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
- /**
- * Add the given source mapping.
- *
- * @param Object aMapping
- */
- MappingList$1.prototype.add = function MappingList_add(aMapping) {
- if (generatedPositionAfter(this._last, aMapping)) {
- this._last = aMapping;
- this._array.push(aMapping);
- } else {
- this._sorted = false;
- this._array.push(aMapping);
- }
- };
- /**
- * Returns the flat, sorted array of mappings. The mappings are sorted by
- * generated position.
- *
- * WARNING: This method returns internal data without copying, for
- * performance. The return value must NOT be mutated, and should be treated as
- * an immutable borrow. If you want to take ownership, you must make your own
- * copy.
- */
- MappingList$1.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util$1.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
- };
- var MappingList_1 = MappingList$1;
- var mappingList = {
- MappingList: MappingList_1
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var ArraySet$1 = arraySet.ArraySet;
- var MappingList = mappingList.MappingList;
- /**
- * An instance of the SourceMapGenerator represents a source map which is
- * being built incrementally. You may pass an object with the following
- * properties:
- *
- * - file: The filename of the generated source.
- * - sourceRoot: A root for all relative URLs in this source map.
- */
- function SourceMapGenerator$3(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util$1.getArg(aArgs, 'file', null);
- this._sourceRoot = util$1.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util$1.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet$1();
- this._names = new ArraySet$1();
- this._mappings = new MappingList();
- this._sourcesContents = null;
- }
- SourceMapGenerator$3.prototype._version = 3;
- /**
- * Creates a new SourceMapGenerator based on a SourceMapConsumer
- *
- * @param aSourceMapConsumer The SourceMap.
- */
- SourceMapGenerator$3.fromSourceMap =
- function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator$3({
- file: aSourceMapConsumer.file,
- sourceRoot: sourceRoot
- });
- aSourceMapConsumer.eachMapping(function (mapping) {
- var newMapping = {
- generated: {
- line: mapping.generatedLine,
- column: mapping.generatedColumn
- }
- };
- if (mapping.source != null) {
- newMapping.source = mapping.source;
- if (sourceRoot != null) {
- newMapping.source = util$1.relative(sourceRoot, newMapping.source);
- }
- newMapping.original = {
- line: mapping.originalLine,
- column: mapping.originalColumn
- };
- if (mapping.name != null) {
- newMapping.name = mapping.name;
- }
- }
- generator.addMapping(newMapping);
- });
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var sourceRelative = sourceFile;
- if (sourceRoot !== null) {
- sourceRelative = util$1.relative(sourceRoot, sourceFile);
- }
- if (!generator._sources.has(sourceRelative)) {
- generator._sources.add(sourceRelative);
- }
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- generator.setSourceContent(sourceFile, content);
- }
- });
- return generator;
- };
- /**
- * Add a single mapping from original source line and column to the generated
- * source's line and column for this source map being created. The mapping
- * object should have the following properties:
- *
- * - generated: An object with the generated line and column positions.
- * - original: An object with the original line and column positions.
- * - source: The original source file (relative to the sourceRoot).
- * - name: An optional original token name for this mapping.
- */
- SourceMapGenerator$3.prototype.addMapping =
- function SourceMapGenerator_addMapping(aArgs) {
- var generated = util$1.getArg(aArgs, 'generated');
- var original = util$1.getArg(aArgs, 'original', null);
- var source = util$1.getArg(aArgs, 'source', null);
- var name = util$1.getArg(aArgs, 'name', null);
- if (!this._skipValidation) {
- this._validateMapping(generated, original, source, name);
- }
- if (source != null) {
- source = String(source);
- if (!this._sources.has(source)) {
- this._sources.add(source);
- }
- }
- if (name != null) {
- name = String(name);
- if (!this._names.has(name)) {
- this._names.add(name);
- }
- }
- this._mappings.add({
- generatedLine: generated.line,
- generatedColumn: generated.column,
- originalLine: original != null && original.line,
- originalColumn: original != null && original.column,
- source: source,
- name: name
- });
- };
- /**
- * Set the source content for a source file.
- */
- SourceMapGenerator$3.prototype.setSourceContent =
- function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util$1.relative(this._sourceRoot, source);
- }
- if (aSourceContent != null) {
- // Add the source content to the _sourcesContents map.
- // Create a new _sourcesContents map if the property is null.
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util$1.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
- // Remove the source file from the _sourcesContents map.
- // If the _sourcesContents map is empty, set the property to null.
- delete this._sourcesContents[util$1.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
- /**
- * Applies the mappings of a sub-source-map for a specific source file to the
- * source map being generated. Each mapping to the supplied source file is
- * rewritten using the supplied source map. Note: The resolution for the
- * resulting mappings is the minimium of this map and the supplied map.
- *
- * @param aSourceMapConsumer The source map to be applied.
- * @param aSourceFile Optional. The filename of the source file.
- * If omitted, SourceMapConsumer's file property will be used.
- * @param aSourceMapPath Optional. The dirname of the path to the source map
- * to be applied. If relative, it is relative to the SourceMapConsumer.
- * This parameter is needed when the two source maps aren't in the same
- * directory, and the source map to be applied contains relative source
- * paths. If so, those relative source paths need to be rewritten
- * relative to the SourceMapGenerator.
- */
- SourceMapGenerator$3.prototype.applySourceMap =
- function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
- // If aSourceFile is omitted, we will use the file property of the SourceMap
- if (aSourceFile == null) {
- if (aSourceMapConsumer.file == null) {
- throw new Error(
- 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
- 'or the source map\'s "file" property. Both were omitted.'
- );
- }
- sourceFile = aSourceMapConsumer.file;
- }
- var sourceRoot = this._sourceRoot;
- // Make "sourceFile" relative if an absolute Url is passed.
- if (sourceRoot != null) {
- sourceFile = util$1.relative(sourceRoot, sourceFile);
- }
- // Applying the SourceMap can add and remove items from the sources and
- // the names array.
- var newSources = new ArraySet$1();
- var newNames = new ArraySet$1();
- // Find mappings for the "sourceFile"
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
- // Check if it can be mapped by the source map, then update the mapping.
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
- // Copy mapping
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util$1.join(aSourceMapPath, mapping.source);
- }
- if (sourceRoot != null) {
- mapping.source = util$1.relative(sourceRoot, mapping.source);
- }
- mapping.originalLine = original.line;
- mapping.originalColumn = original.column;
- if (original.name != null) {
- mapping.name = original.name;
- }
- }
- }
- var source = mapping.source;
- if (source != null && !newSources.has(source)) {
- newSources.add(source);
- }
- var name = mapping.name;
- if (name != null && !newNames.has(name)) {
- newNames.add(name);
- }
- }, this);
- this._sources = newSources;
- this._names = newNames;
- // Copy sourcesContents of applied map.
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util$1.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util$1.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
- /**
- * A mapping can have one of the three levels of data:
- *
- * 1. Just the generated position.
- * 2. The Generated position, original position, and original source.
- * 3. Generated and original position, original source, as well as a name
- * token.
- *
- * To maintain consistency, we validate that any new mapping being added falls
- * in to one of these categories.
- */
- SourceMapGenerator$3.prototype._validateMapping =
- function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
- aName) {
- // When aOriginal is truthy but has empty values for .line and .column,
- // it is most likely a programmer error. In this case we throw a very
- // specific error message to try to guide them the right way.
- // For example: https://github.com/Polymer/polymer-bundler/pull/519
- if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
- throw new Error(
- 'original.line and original.column are not numbers -- you probably meant to omit ' +
- 'the original mapping entirely and only map the generated position. If so, pass ' +
- 'null for the original mapping instead of an object with empty or null values.'
- );
- }
- if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aGenerated.line > 0 && aGenerated.column >= 0
- && !aOriginal && !aSource && !aName) {
- // Case 1.
- return;
- }
- else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
- && aOriginal && 'line' in aOriginal && 'column' in aOriginal
- && aGenerated.line > 0 && aGenerated.column >= 0
- && aOriginal.line > 0 && aOriginal.column >= 0
- && aSource) {
- // Cases 2 and 3.
- return;
- }
- else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
- /**
- * Serialize the accumulated mappings in to the stream of base 64 VLQs
- * specified by the source map format.
- */
- SourceMapGenerator$3.prototype._serializeMappings =
- function SourceMapGenerator_serializeMappings() {
- var previousGeneratedColumn = 0;
- var previousGeneratedLine = 1;
- var previousOriginalColumn = 0;
- var previousOriginalLine = 0;
- var previousName = 0;
- var previousSource = 0;
- var result = '';
- var next;
- var mapping;
- var nameIdx;
- var sourceIdx;
- var mappings = this._mappings.toArray();
- for (var i = 0, len = mappings.length; i < len; i++) {
- mapping = mappings[i];
- next = '';
- if (mapping.generatedLine !== previousGeneratedLine) {
- previousGeneratedColumn = 0;
- while (mapping.generatedLine !== previousGeneratedLine) {
- next += ';';
- previousGeneratedLine++;
- }
- }
- else {
- if (i > 0) {
- if (!util$1.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
- continue;
- }
- next += ',';
- }
- }
- next += base64Vlq.encode(mapping.generatedColumn
- - previousGeneratedColumn);
- previousGeneratedColumn = mapping.generatedColumn;
- if (mapping.source != null) {
- sourceIdx = this._sources.indexOf(mapping.source);
- next += base64Vlq.encode(sourceIdx - previousSource);
- previousSource = sourceIdx;
- // lines are stored 0-based in SourceMap spec version 3
- next += base64Vlq.encode(mapping.originalLine - 1
- - previousOriginalLine);
- previousOriginalLine = mapping.originalLine - 1;
- next += base64Vlq.encode(mapping.originalColumn
- - previousOriginalColumn);
- previousOriginalColumn = mapping.originalColumn;
- if (mapping.name != null) {
- nameIdx = this._names.indexOf(mapping.name);
- next += base64Vlq.encode(nameIdx - previousName);
- previousName = nameIdx;
- }
- }
- result += next;
- }
- return result;
- };
- SourceMapGenerator$3.prototype._generateSourcesContent =
- function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util$1.relative(aSourceRoot, source);
- }
- var key = util$1.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
- ? this._sourcesContents[key]
- : null;
- }, this);
- };
- /**
- * Externalize the source map.
- */
- SourceMapGenerator$3.prototype.toJSON =
- function SourceMapGenerator_toJSON() {
- var map = {
- version: this._version,
- sources: this._sources.toArray(),
- names: this._names.toArray(),
- mappings: this._serializeMappings()
- };
- if (this._file != null) {
- map.file = this._file;
- }
- if (this._sourceRoot != null) {
- map.sourceRoot = this._sourceRoot;
- }
- if (this._sourcesContents) {
- map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
- }
- return map;
- };
- /**
- * Render the source map being generated to a string.
- */
- SourceMapGenerator$3.prototype.toString =
- function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
- var SourceMapGenerator_1 = SourceMapGenerator$3;
- var sourceMapGenerator = {
- SourceMapGenerator: SourceMapGenerator_1
- };
- var binarySearch = createCommonjsModule$1(function (module, exports) {
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- exports.GREATEST_LOWER_BOUND = 1;
- exports.LEAST_UPPER_BOUND = 2;
- /**
- * Recursive implementation of binary search.
- *
- * @param aLow Indices here and lower do not contain the needle.
- * @param aHigh Indices here and higher do not contain the needle.
- * @param aNeedle The element being searched for.
- * @param aHaystack The non-empty array being searched.
- * @param aCompare Function which takes two elements and returns -1, 0, or 1.
- * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
- * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- */
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
- // This function terminates when one of the following is true:
- //
- // 1. We find the exact element we are looking for.
- //
- // 2. We did not find the exact element, but we can return the index of
- // the next-closest element.
- //
- // 3. We did not find the exact element, and there is no next-closest
- // element than the one we are searching for, so we return -1.
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
- // Found the element we are looking for.
- return mid;
- }
- else if (cmp > 0) {
- // Our needle is greater than aHaystack[mid].
- if (aHigh - mid > 1) {
- // The element is in the upper half.
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
- }
- // The exact needle element was not found in this haystack. Determine if
- // we are in termination case (3) or (2) and return the appropriate thing.
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return aHigh < aHaystack.length ? aHigh : -1;
- } else {
- return mid;
- }
- }
- else {
- // Our needle is less than aHaystack[mid].
- if (mid - aLow > 1) {
- // The element is in the lower half.
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
- }
- // we are in termination case (3) or (2) and return the appropriate thing.
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return mid;
- } else {
- return aLow < 0 ? -1 : aLow;
- }
- }
- }
- /**
- * This is an implementation of binary search which will always try and return
- * the index of the closest element if there is no exact hit. This is because
- * mappings between original and generated line/col pairs are single points,
- * and there is an implicit region between each of them, so a miss just means
- * that you aren't on the very start of a region.
- *
- * @param aNeedle The element you are looking for.
- * @param aHaystack The array that is being searched.
- * @param aCompare A function which takes the needle and an element in the
- * array and returns -1, 0, or 1 depending on whether the needle is less
- * than, equal to, or greater than the element, respectively.
- * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
- * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
- */
- exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
- if (aHaystack.length === 0) {
- return -1;
- }
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
- aCompare, aBias || exports.GREATEST_LOWER_BOUND);
- if (index < 0) {
- return -1;
- }
- // We have found either the exact element, or the next-closest element than
- // the one we are searching for. However, there may be more than one such
- // element. Make sure we always return the smallest of these.
- while (index - 1 >= 0) {
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
- break;
- }
- --index;
- }
- return index;
- };
- });
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- // It turns out that some (most?) JavaScript engines don't self-host
- // `Array.prototype.sort`. This makes sense because C++ will likely remain
- // faster than JS when doing raw CPU-intensive sorting. However, when using a
- // custom comparator function, calling back and forth between the VM's C++ and
- // JIT'd JS is rather slow *and* loses JIT type information, resulting in
- // worse generated code for the comparator function than would be optimal. In
- // fact, when sorting with a comparator, these costs outweigh the benefits of
- // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
- // a ~3500ms mean speed-up in `bench/bench.html`.
- /**
- * Swap the elements indexed by `x` and `y` in the array `ary`.
- *
- * @param {Array} ary
- * The array.
- * @param {Number} x
- * The index of the first item.
- * @param {Number} y
- * The index of the second item.
- */
- function swap(ary, x, y) {
- var temp = ary[x];
- ary[x] = ary[y];
- ary[y] = temp;
- }
- /**
- * Returns a random integer within the range `low .. high` inclusive.
- *
- * @param {Number} low
- * The lower bound on the range.
- * @param {Number} high
- * The upper bound on the range.
- */
- function randomIntInRange(low, high) {
- return Math.round(low + (Math.random() * (high - low)));
- }
- /**
- * The Quick Sort algorithm.
- *
- * @param {Array} ary
- * An array to sort.
- * @param {function} comparator
- * Function to use to compare two items.
- * @param {Number} p
- * Start index of the array
- * @param {Number} r
- * End index of the array
- */
- function doQuickSort(ary, comparator, p, r) {
- // If our lower bound is less than our upper bound, we (1) partition the
- // array into two pieces and (2) recurse on each half. If it is not, this is
- // the empty array and our base case.
- if (p < r) {
- // (1) Partitioning.
- //
- // The partitioning chooses a pivot between `p` and `r` and moves all
- // elements that are less than or equal to the pivot to the before it, and
- // all the elements that are greater than it after it. The effect is that
- // once partition is done, the pivot is in the exact place it will be when
- // the array is put in sorted order, and it will not need to be moved
- // again. This runs in O(n) time.
- // Always choose a random pivot so that an input array which is reverse
- // sorted does not cause O(n^2) running time.
- var pivotIndex = randomIntInRange(p, r);
- var i = p - 1;
- swap(ary, pivotIndex, r);
- var pivot = ary[r];
- // Immediately after `j` is incremented in this loop, the following hold
- // true:
- //
- // * Every element in `ary[p .. i]` is less than or equal to the pivot.
- //
- // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
- for (var j = p; j < r; j++) {
- if (comparator(ary[j], pivot) <= 0) {
- i += 1;
- swap(ary, i, j);
- }
- }
- swap(ary, i + 1, j);
- var q = i + 1;
- // (2) Recurse on each half.
- doQuickSort(ary, comparator, p, q - 1);
- doQuickSort(ary, comparator, q + 1, r);
- }
- }
- /**
- * Sort the given array in-place with the given comparator function.
- *
- * @param {Array} ary
- * An array to sort.
- * @param {function} comparator
- * Function to use to compare two items.
- */
- var quickSort_1 = function (ary, comparator) {
- doQuickSort(ary, comparator, 0, ary.length - 1);
- };
- var quickSort$1 = {
- quickSort: quickSort_1
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var ArraySet = arraySet.ArraySet;
- var quickSort = quickSort$1.quickSort;
- function SourceMapConsumer$2(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util$1.parseSourceMapInput(aSourceMap);
- }
- return sourceMap.sections != null
- ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
- : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
- }
- SourceMapConsumer$2.fromSourceMap = function(aSourceMap, aSourceMapURL) {
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
- };
- /**
- * The version of the source mapping spec that we are consuming.
- */
- SourceMapConsumer$2.prototype._version = 3;
- // `__generatedMappings` and `__originalMappings` are arrays that hold the
- // parsed mapping coordinates from the source map's "mappings" attribute. They
- // are lazily instantiated, accessed via the `_generatedMappings` and
- // `_originalMappings` getters respectively, and we only parse the mappings
- // and create these arrays once queried for a source location. We jump through
- // these hoops because there can be many thousands of mappings, and parsing
- // them is expensive, so we only want to do it if we must.
- //
- // Each object in the arrays is of the form:
- //
- // {
- // generatedLine: The line number in the generated code,
- // generatedColumn: The column number in the generated code,
- // source: The path to the original source file that generated this
- // chunk of code,
- // originalLine: The line number in the original source that
- // corresponds to this chunk of generated code,
- // originalColumn: The column number in the original source that
- // corresponds to this chunk of generated code,
- // name: The name of the original symbol which generated this chunk of
- // code.
- // }
- //
- // All properties except for `generatedLine` and `generatedColumn` can be
- // `null`.
- //
- // `_generatedMappings` is ordered by the generated positions.
- //
- // `_originalMappings` is ordered by the original positions.
- SourceMapConsumer$2.prototype.__generatedMappings = null;
- Object.defineProperty(SourceMapConsumer$2.prototype, '_generatedMappings', {
- configurable: true,
- enumerable: true,
- get: function () {
- if (!this.__generatedMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__generatedMappings;
- }
- });
- SourceMapConsumer$2.prototype.__originalMappings = null;
- Object.defineProperty(SourceMapConsumer$2.prototype, '_originalMappings', {
- configurable: true,
- enumerable: true,
- get: function () {
- if (!this.__originalMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__originalMappings;
- }
- });
- SourceMapConsumer$2.prototype._charIsMappingSeparator =
- function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
- var c = aStr.charAt(index);
- return c === ";" || c === ",";
- };
- /**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
- SourceMapConsumer$2.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- throw new Error("Subclasses must implement _parseMappings");
- };
- SourceMapConsumer$2.GENERATED_ORDER = 1;
- SourceMapConsumer$2.ORIGINAL_ORDER = 2;
- SourceMapConsumer$2.GREATEST_LOWER_BOUND = 1;
- SourceMapConsumer$2.LEAST_UPPER_BOUND = 2;
- /**
- * Iterate over each mapping between an original source/line/column and a
- * generated line/column in this source map.
- *
- * @param Function aCallback
- * The function that is called with each mapping.
- * @param Object aContext
- * Optional. If specified, this object will be the value of `this` every
- * time that `aCallback` is called.
- * @param aOrder
- * Either `SourceMapConsumer.GENERATED_ORDER` or
- * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
- * iterate over the mappings sorted by the generated file's line/column
- * order or the original's source/line/column order, respectively. Defaults to
- * `SourceMapConsumer.GENERATED_ORDER`.
- */
- SourceMapConsumer$2.prototype.eachMapping =
- function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer$2.GENERATED_ORDER;
- var mappings;
- switch (order) {
- case SourceMapConsumer$2.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer$2.ORIGINAL_ORDER:
- mappings = this._originalMappings;
- break;
- default:
- throw new Error("Unknown order of iteration.");
- }
- var sourceRoot = this.sourceRoot;
- mappings.map(function (mapping) {
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
- source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
- return {
- source: source,
- generatedLine: mapping.generatedLine,
- generatedColumn: mapping.generatedColumn,
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: mapping.name === null ? null : this._names.at(mapping.name)
- };
- }, this).forEach(aCallback, context);
- };
- /**
- * Returns all generated line and column information for the original source,
- * line, and column provided. If no column is provided, returns all mappings
- * corresponding to a either the line we are searching for or the next
- * closest line that has any mappings. Otherwise, returns all mappings
- * corresponding to the given line and either the column we are searching for
- * or the next closest column that has any offsets.
- *
- * The only argument is an object with the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source. The line number is 1-based.
- * - column: Optional. the column number in the original source.
- * The column number is 0-based.
- *
- * and an array of objects is returned, each with the following properties:
- *
- * - line: The line number in the generated source, or null. The
- * line number is 1-based.
- * - column: The column number in the generated source, or null.
- * The column number is 0-based.
- */
- SourceMapConsumer$2.prototype.allGeneratedPositionsFor =
- function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
- var line = util$1.getArg(aArgs, 'line');
- // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
- // returns the index of the closest mapping less than the needle. By
- // setting needle.originalColumn to 0, we thus find the last mapping for
- // the given line, provided such a mapping exists.
- var needle = {
- source: util$1.getArg(aArgs, 'source'),
- originalLine: line,
- originalColumn: util$1.getArg(aArgs, 'column', 0)
- };
- needle.source = this._findSourceIndex(needle.source);
- if (needle.source < 0) {
- return [];
- }
- var mappings = [];
- var index = this._findMapping(needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util$1.compareByOriginalPositions,
- binarySearch.LEAST_UPPER_BOUND);
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (aArgs.column === undefined) {
- var originalLine = mapping.originalLine;
- // Iterate until either we run out of mappings, or we run into
- // a mapping for a different line than the one we found. Since
- // mappings are sorted, this is guaranteed to find all mappings for
- // the line we found.
- while (mapping && mapping.originalLine === originalLine) {
- mappings.push({
- line: util$1.getArg(mapping, 'generatedLine', null),
- column: util$1.getArg(mapping, 'generatedColumn', null),
- lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- } else {
- var originalColumn = mapping.originalColumn;
- // Iterate until either we run out of mappings, or we run into
- // a mapping for a different line than the one we were searching for.
- // Since mappings are sorted, this is guaranteed to find all mappings for
- // the line we are searching for.
- while (mapping &&
- mapping.originalLine === line &&
- mapping.originalColumn == originalColumn) {
- mappings.push({
- line: util$1.getArg(mapping, 'generatedLine', null),
- column: util$1.getArg(mapping, 'generatedColumn', null),
- lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- }
- }
- return mappings;
- };
- var SourceMapConsumer_1 = SourceMapConsumer$2;
- /**
- * A BasicSourceMapConsumer instance represents a parsed source map which we can
- * query for information about the original file positions by giving it a file
- * position in the generated source.
- *
- * The first parameter is the raw source map (either as a JSON string, or
- * already parsed to an object). According to the spec, source maps have the
- * following attributes:
- *
- * - version: Which version of the source map spec this map is following.
- * - sources: An array of URLs to the original source files.
- * - names: An array of identifiers which can be referrenced by individual mappings.
- * - sourceRoot: Optional. The URL root from which all sources are relative.
- * - sourcesContent: Optional. An array of contents of the original source files.
- * - mappings: A string of base64 VLQs which contain the actual mappings.
- * - file: Optional. The generated file this source map is associated with.
- *
- * Here is an example source map, taken from the source map spec[0]:
- *
- * {
- * version : 3,
- * file: "out.js",
- * sourceRoot : "",
- * sources: ["foo.js", "bar.js"],
- * names: ["src", "maps", "are", "fun"],
- * mappings: "AA,AB;;ABCDE;"
- * }
- *
- * The second parameter, if given, is a string whose value is the URL
- * at which the source map was found. This URL is used to compute the
- * sources array.
- *
- * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
- */
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util$1.parseSourceMapInput(aSourceMap);
- }
- var version = util$1.getArg(sourceMap, 'version');
- var sources = util$1.getArg(sourceMap, 'sources');
- // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
- // requires the array) to play nice here.
- var names = util$1.getArg(sourceMap, 'names', []);
- var sourceRoot = util$1.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util$1.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util$1.getArg(sourceMap, 'mappings');
- var file = util$1.getArg(sourceMap, 'file', null);
- // Once again, Sass deviates from the spec and supplies the version as a
- // string rather than a number, so we use loose equality checking here.
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- if (sourceRoot) {
- sourceRoot = util$1.normalize(sourceRoot);
- }
- sources = sources
- .map(String)
- // Some source maps produce relative source paths like "./foo.js" instead of
- // "foo.js". Normalize these first so that future comparisons will succeed.
- // See bugzil.la/1090768.
- .map(util$1.normalize)
- // Always ensure that absolute sources are internally stored relative to
- // the source root, if the source root is absolute. Not doing this would
- // be particularly problematic when the source root is a prefix of the
- // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
- .map(function (source) {
- return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source)
- ? util$1.relative(sourceRoot, source)
- : source;
- });
- // Pass `true` below to allow duplicate names and sources. While source maps
- // are intended to be compressed and deduplicated, the TypeScript compiler
- // sometimes generates source maps with duplicates in them. See Github issue
- // #72 and bugzil.la/889492.
- this._names = ArraySet.fromArray(names.map(String), true);
- this._sources = ArraySet.fromArray(sources, true);
- this._absoluteSources = this._sources.toArray().map(function (s) {
- return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
- });
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this._sourceMapURL = aSourceMapURL;
- this.file = file;
- }
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$2.prototype);
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$2;
- /**
- * Utility function to find the index of a source. Returns -1 if not
- * found.
- */
- BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
- var relativeSource = aSource;
- if (this.sourceRoot != null) {
- relativeSource = util$1.relative(this.sourceRoot, relativeSource);
- }
- if (this._sources.has(relativeSource)) {
- return this._sources.indexOf(relativeSource);
- }
- // Maybe aSource is an absolute URL as returned by |sources|. In
- // this case we can't simply undo the transform.
- var i;
- for (i = 0; i < this._absoluteSources.length; ++i) {
- if (this._absoluteSources[i] == aSource) {
- return i;
- }
- }
- return -1;
- };
- /**
- * Create a BasicSourceMapConsumer from a SourceMapGenerator.
- *
- * @param SourceMapGenerator aSourceMap
- * The source map that will be consumed.
- * @param String aSourceMapURL
- * The URL at which the source map can be found (optional)
- * @returns BasicSourceMapConsumer
- */
- BasicSourceMapConsumer.fromSourceMap =
- function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
- var smc = Object.create(BasicSourceMapConsumer.prototype);
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
- smc.sourceRoot = aSourceMap._sourceRoot;
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
- smc.sourceRoot);
- smc.file = aSourceMap._file;
- smc._sourceMapURL = aSourceMapURL;
- smc._absoluteSources = smc._sources.toArray().map(function (s) {
- return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
- });
- // Because we are modifying the entries (by converting string sources and
- // names to indices into the sources and names ArraySets), we have to make
- // a copy of the entry or else bad things happen. Shared mutable state
- // strikes again! See github issue #191.
- var generatedMappings = aSourceMap._mappings.toArray().slice();
- var destGeneratedMappings = smc.__generatedMappings = [];
- var destOriginalMappings = smc.__originalMappings = [];
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
- var srcMapping = generatedMappings[i];
- var destMapping = new Mapping;
- destMapping.generatedLine = srcMapping.generatedLine;
- destMapping.generatedColumn = srcMapping.generatedColumn;
- if (srcMapping.source) {
- destMapping.source = sources.indexOf(srcMapping.source);
- destMapping.originalLine = srcMapping.originalLine;
- destMapping.originalColumn = srcMapping.originalColumn;
- if (srcMapping.name) {
- destMapping.name = names.indexOf(srcMapping.name);
- }
- destOriginalMappings.push(destMapping);
- }
- destGeneratedMappings.push(destMapping);
- }
- quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);
- return smc;
- };
- /**
- * The version of the source mapping spec that we are consuming.
- */
- BasicSourceMapConsumer.prototype._version = 3;
- /**
- * The list of original sources.
- */
- Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
- get: function () {
- return this._absoluteSources.slice();
- }
- });
- /**
- * Provide the JIT with a nice shape / hidden class.
- */
- function Mapping() {
- this.generatedLine = 0;
- this.generatedColumn = 0;
- this.source = null;
- this.originalLine = null;
- this.originalColumn = null;
- this.name = null;
- }
- /**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
- BasicSourceMapConsumer.prototype._parseMappings =
- function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- var generatedLine = 1;
- var previousGeneratedColumn = 0;
- var previousOriginalLine = 0;
- var previousOriginalColumn = 0;
- var previousSource = 0;
- var previousName = 0;
- var length = aStr.length;
- var index = 0;
- var cachedSegments = {};
- var temp = {};
- var originalMappings = [];
- var generatedMappings = [];
- var mapping, str, segment, end, value;
- while (index < length) {
- if (aStr.charAt(index) === ';') {
- generatedLine++;
- index++;
- previousGeneratedColumn = 0;
- }
- else if (aStr.charAt(index) === ',') {
- index++;
- }
- else {
- mapping = new Mapping();
- mapping.generatedLine = generatedLine;
- // Because each offset is encoded relative to the previous one,
- // many segments often have the same encoding. We can exploit this
- // fact by caching the parsed variable length fields of each segment,
- // allowing us to avoid a second parse if we encounter the same
- // segment again.
- for (end = index; end < length; end++) {
- if (this._charIsMappingSeparator(aStr, end)) {
- break;
- }
- }
- str = aStr.slice(index, end);
- segment = cachedSegments[str];
- if (segment) {
- index += str.length;
- } else {
- segment = [];
- while (index < end) {
- base64Vlq.decode(aStr, index, temp);
- value = temp.value;
- index = temp.rest;
- segment.push(value);
- }
- if (segment.length === 2) {
- throw new Error('Found a source, but no line and column');
- }
- if (segment.length === 3) {
- throw new Error('Found a source and line, but no column');
- }
- cachedSegments[str] = segment;
- }
- // Generated column.
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
- previousGeneratedColumn = mapping.generatedColumn;
- if (segment.length > 1) {
- // Original source.
- mapping.source = previousSource + segment[1];
- previousSource += segment[1];
- // Original line.
- mapping.originalLine = previousOriginalLine + segment[2];
- previousOriginalLine = mapping.originalLine;
- // Lines are stored 0-based
- mapping.originalLine += 1;
- // Original column.
- mapping.originalColumn = previousOriginalColumn + segment[3];
- previousOriginalColumn = mapping.originalColumn;
- if (segment.length > 4) {
- // Original name.
- mapping.name = previousName + segment[4];
- previousName += segment[4];
- }
- }
- generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- originalMappings.push(mapping);
- }
- }
- }
- quickSort(generatedMappings, util$1.compareByGeneratedPositionsDeflated);
- this.__generatedMappings = generatedMappings;
- quickSort(originalMappings, util$1.compareByOriginalPositions);
- this.__originalMappings = originalMappings;
- };
- /**
- * Find the mapping that best matches the hypothetical "needle" mapping that
- * we are searching for in the given "haystack" of mappings.
- */
- BasicSourceMapConsumer.prototype._findMapping =
- function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
- aColumnName, aComparator, aBias) {
- // To return the position we are searching for, we must first find the
- // mapping for the given position and then return the opposite position it
- // points to. Because the mappings are sorted, we can use binary search to
- // find the best mapping.
- if (aNeedle[aLineName] <= 0) {
- throw new TypeError('Line must be greater than or equal to 1, got '
- + aNeedle[aLineName]);
- }
- if (aNeedle[aColumnName] < 0) {
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
- }
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
- };
- /**
- * Compute the last column for each generated mapping. The last column is
- * inclusive.
- */
- BasicSourceMapConsumer.prototype.computeColumnSpans =
- function SourceMapConsumer_computeColumnSpans() {
- for (var index = 0; index < this._generatedMappings.length; ++index) {
- var mapping = this._generatedMappings[index];
- // Mappings do not contain a field for the last generated columnt. We
- // can come up with an optimistic estimate, however, by assuming that
- // mappings are contiguous (i.e. given two consecutive mappings, the
- // first mapping ends where the second one starts).
- if (index + 1 < this._generatedMappings.length) {
- var nextMapping = this._generatedMappings[index + 1];
- if (mapping.generatedLine === nextMapping.generatedLine) {
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
- continue;
- }
- }
- // The last mapping for each line spans the entire line.
- mapping.lastGeneratedColumn = Infinity;
- }
- };
- /**
- * Returns the original source, line, and column information for the generated
- * source's line and column positions provided. The only argument is an object
- * with the following properties:
- *
- * - line: The line number in the generated source. The line number
- * is 1-based.
- * - column: The column number in the generated source. The column
- * number is 0-based.
- * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
- * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
- *
- * and an object is returned with the following properties:
- *
- * - source: The original source file, or null.
- * - line: The line number in the original source, or null. The
- * line number is 1-based.
- * - column: The column number in the original source, or null. The
- * column number is 0-based.
- * - name: The original identifier, or null.
- */
- BasicSourceMapConsumer.prototype.originalPositionFor =
- function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util$1.getArg(aArgs, 'line'),
- generatedColumn: util$1.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._generatedMappings,
- "generatedLine",
- "generatedColumn",
- util$1.compareByGeneratedPositionsDeflated,
- util$1.getArg(aArgs, 'bias', SourceMapConsumer$2.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._generatedMappings[index];
- if (mapping.generatedLine === needle.generatedLine) {
- var source = util$1.getArg(mapping, 'source', null);
- if (source !== null) {
- source = this._sources.at(source);
- source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
- }
- var name = util$1.getArg(mapping, 'name', null);
- if (name !== null) {
- name = this._names.at(name);
- }
- return {
- source: source,
- line: util$1.getArg(mapping, 'originalLine', null),
- column: util$1.getArg(mapping, 'originalColumn', null),
- name: name
- };
- }
- }
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
- /**
- * Return true if we have the source content for every source in the source
- * map, false otherwise.
- */
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
- function BasicSourceMapConsumer_hasContentsOfAllSources() {
- if (!this.sourcesContent) {
- return false;
- }
- return this.sourcesContent.length >= this._sources.size() &&
- !this.sourcesContent.some(function (sc) { return sc == null; });
- };
- /**
- * Returns the original source content. The only argument is the url of the
- * original source file. Returns null if no original source content is
- * available.
- */
- BasicSourceMapConsumer.prototype.sourceContentFor =
- function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- if (!this.sourcesContent) {
- return null;
- }
- var index = this._findSourceIndex(aSource);
- if (index >= 0) {
- return this.sourcesContent[index];
- }
- var relativeSource = aSource;
- if (this.sourceRoot != null) {
- relativeSource = util$1.relative(this.sourceRoot, relativeSource);
- }
- var url;
- if (this.sourceRoot != null
- && (url = util$1.urlParse(this.sourceRoot))) {
- // XXX: file:// URIs and absolute paths lead to unexpected behavior for
- // many users. We can help them out when they expect file:// URIs to
- // behave like it would if they were running a local HTTP server. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
- var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
- if (url.scheme == "file"
- && this._sources.has(fileUriAbsPath)) {
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
- }
- if ((!url.path || url.path == "/")
- && this._sources.has("/" + relativeSource)) {
- return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
- }
- }
- // This function is used recursively from
- // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
- // don't want to throw if we can't find the source - we just want to
- // return null, so we provide a flag to exit gracefully.
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + relativeSource + '" is not in the SourceMap.');
- }
- };
- /**
- * Returns the generated line and column information for the original source,
- * line, and column positions provided. The only argument is an object with
- * the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source. The line number
- * is 1-based.
- * - column: The column number in the original source. The column
- * number is 0-based.
- * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
- * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
- * closest element that is smaller than or greater than the one we are
- * searching for, respectively, if the exact element cannot be found.
- * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
- *
- * and an object is returned with the following properties:
- *
- * - line: The line number in the generated source, or null. The
- * line number is 1-based.
- * - column: The column number in the generated source, or null.
- * The column number is 0-based.
- */
- BasicSourceMapConsumer.prototype.generatedPositionFor =
- function SourceMapConsumer_generatedPositionFor(aArgs) {
- var source = util$1.getArg(aArgs, 'source');
- source = this._findSourceIndex(source);
- if (source < 0) {
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- }
- var needle = {
- source: source,
- originalLine: util$1.getArg(aArgs, 'line'),
- originalColumn: util$1.getArg(aArgs, 'column')
- };
- var index = this._findMapping(
- needle,
- this._originalMappings,
- "originalLine",
- "originalColumn",
- util$1.compareByOriginalPositions,
- util$1.getArg(aArgs, 'bias', SourceMapConsumer$2.GREATEST_LOWER_BOUND)
- );
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (mapping.source === needle.source) {
- return {
- line: util$1.getArg(mapping, 'generatedLine', null),
- column: util$1.getArg(mapping, 'generatedColumn', null),
- lastColumn: util$1.getArg(mapping, 'lastGeneratedColumn', null)
- };
- }
- }
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- };
- var BasicSourceMapConsumer_1 = BasicSourceMapConsumer;
- /**
- * An IndexedSourceMapConsumer instance represents a parsed source map which
- * we can query for information. It differs from BasicSourceMapConsumer in
- * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
- * input.
- *
- * The first parameter is a raw source map (either as a JSON string, or already
- * parsed to an object). According to the spec for indexed source maps, they
- * have the following attributes:
- *
- * - version: Which version of the source map spec this map is following.
- * - file: Optional. The generated file this source map is associated with.
- * - sections: A list of section definitions.
- *
- * Each value under the "sections" field has two fields:
- * - offset: The offset into the original specified at which this section
- * begins to apply, defined as an object with a "line" and "column"
- * field.
- * - map: A source map definition. This source map could also be indexed,
- * but doesn't have to be.
- *
- * Instead of the "map" field, it's also possible to have a "url" field
- * specifying a URL to retrieve a source map from, but that's currently
- * unsupported.
- *
- * Here's an example source map, taken from the source map spec[0], but
- * modified to omit a section which uses the "url" field.
- *
- * {
- * version : 3,
- * file: "app.js",
- * sections: [{
- * offset: {line:100, column:10},
- * map: {
- * version : 3,
- * file: "section.js",
- * sources: ["foo.js", "bar.js"],
- * names: ["src", "maps", "are", "fun"],
- * mappings: "AAAA,E;;ABCDE;"
- * }
- * }],
- * }
- *
- * The second parameter, if given, is a string whose value is the URL
- * at which the source map was found. This URL is used to compute the
- * sources array.
- *
- * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
- */
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util$1.parseSourceMapInput(aSourceMap);
- }
- var version = util$1.getArg(sourceMap, 'version');
- var sections = util$1.getArg(sourceMap, 'sections');
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- this._sources = new ArraySet();
- this._names = new ArraySet();
- var lastOffset = {
- line: -1,
- column: 0
- };
- this._sections = sections.map(function (s) {
- if (s.url) {
- // The url field will require support for asynchronicity.
- // See https://github.com/mozilla/source-map/issues/16
- throw new Error('Support for url field in sections not implemented.');
- }
- var offset = util$1.getArg(s, 'offset');
- var offsetLine = util$1.getArg(offset, 'line');
- var offsetColumn = util$1.getArg(offset, 'column');
- if (offsetLine < lastOffset.line ||
- (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
- throw new Error('Section offsets must be ordered and non-overlapping.');
- }
- lastOffset = offset;
- return {
- generatedOffset: {
- // The offset fields are 0-based, but we use 1-based indices when
- // encoding/decoding from VLQ.
- generatedLine: offsetLine + 1,
- generatedColumn: offsetColumn + 1
- },
- consumer: new SourceMapConsumer$2(util$1.getArg(s, 'map'), aSourceMapURL)
- }
- });
- }
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$2.prototype);
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$2;
- /**
- * The version of the source mapping spec that we are consuming.
- */
- IndexedSourceMapConsumer.prototype._version = 3;
- /**
- * The list of original sources.
- */
- Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
- get: function () {
- var sources = [];
- for (var i = 0; i < this._sections.length; i++) {
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
- sources.push(this._sections[i].consumer.sources[j]);
- }
- }
- return sources;
- }
- });
- /**
- * Returns the original source, line, and column information for the generated
- * source's line and column positions provided. The only argument is an object
- * with the following properties:
- *
- * - line: The line number in the generated source. The line number
- * is 1-based.
- * - column: The column number in the generated source. The column
- * number is 0-based.
- *
- * and an object is returned with the following properties:
- *
- * - source: The original source file, or null.
- * - line: The line number in the original source, or null. The
- * line number is 1-based.
- * - column: The column number in the original source, or null. The
- * column number is 0-based.
- * - name: The original identifier, or null.
- */
- IndexedSourceMapConsumer.prototype.originalPositionFor =
- function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util$1.getArg(aArgs, 'line'),
- generatedColumn: util$1.getArg(aArgs, 'column')
- };
- // Find the section containing the generated position we're trying to map
- // to an original position.
- var sectionIndex = binarySearch.search(needle, this._sections,
- function(needle, section) {
- var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
- if (cmp) {
- return cmp;
- }
- return (needle.generatedColumn -
- section.generatedOffset.generatedColumn);
- });
- var section = this._sections[sectionIndex];
- if (!section) {
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- }
- return section.consumer.originalPositionFor({
- line: needle.generatedLine -
- (section.generatedOffset.generatedLine - 1),
- column: needle.generatedColumn -
- (section.generatedOffset.generatedLine === needle.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- bias: aArgs.bias
- });
- };
- /**
- * Return true if we have the source content for every source in the source
- * map, false otherwise.
- */
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
- function IndexedSourceMapConsumer_hasContentsOfAllSources() {
- return this._sections.every(function (s) {
- return s.consumer.hasContentsOfAllSources();
- });
- };
- /**
- * Returns the original source content. The only argument is the url of the
- * original source file. Returns null if no original source content is
- * available.
- */
- IndexedSourceMapConsumer.prototype.sourceContentFor =
- function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var content = section.consumer.sourceContentFor(aSource, true);
- if (content) {
- return content;
- }
- }
- if (nullOnMissing) {
- return null;
- }
- else {
- throw new Error('"' + aSource + '" is not in the SourceMap.');
- }
- };
- /**
- * Returns the generated line and column information for the original source,
- * line, and column positions provided. The only argument is an object with
- * the following properties:
- *
- * - source: The filename of the original source.
- * - line: The line number in the original source. The line number
- * is 1-based.
- * - column: The column number in the original source. The column
- * number is 0-based.
- *
- * and an object is returned with the following properties:
- *
- * - line: The line number in the generated source, or null. The
- * line number is 1-based.
- * - column: The column number in the generated source, or null.
- * The column number is 0-based.
- */
- IndexedSourceMapConsumer.prototype.generatedPositionFor =
- function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- // Only consider this section if the requested source is in the list of
- // sources of the consumer.
- if (section.consumer._findSourceIndex(util$1.getArg(aArgs, 'source')) === -1) {
- continue;
- }
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
- if (generatedPosition) {
- var ret = {
- line: generatedPosition.line +
- (section.generatedOffset.generatedLine - 1),
- column: generatedPosition.column +
- (section.generatedOffset.generatedLine === generatedPosition.line
- ? section.generatedOffset.generatedColumn - 1
- : 0)
- };
- return ret;
- }
- }
- return {
- line: null,
- column: null
- };
- };
- /**
- * Parse the mappings in a string in to a data structure which we can easily
- * query (the ordered arrays in the `this.__generatedMappings` and
- * `this.__originalMappings` properties).
- */
- IndexedSourceMapConsumer.prototype._parseMappings =
- function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- this.__generatedMappings = [];
- this.__originalMappings = [];
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- var sectionMappings = section.consumer._generatedMappings;
- for (var j = 0; j < sectionMappings.length; j++) {
- var mapping = sectionMappings[j];
- var source = section.consumer._sources.at(mapping.source);
- source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
- this._sources.add(source);
- source = this._sources.indexOf(source);
- var name = null;
- if (mapping.name) {
- name = section.consumer._names.at(mapping.name);
- this._names.add(name);
- name = this._names.indexOf(name);
- }
- // The mappings coming from the consumer for the section have
- // generated positions relative to the start of the section, so we
- // need to offset them to be relative to the start of the concatenated
- // generated file.
- var adjustedMapping = {
- source: source,
- generatedLine: mapping.generatedLine +
- (section.generatedOffset.generatedLine - 1),
- generatedColumn: mapping.generatedColumn +
- (section.generatedOffset.generatedLine === mapping.generatedLine
- ? section.generatedOffset.generatedColumn - 1
- : 0),
- originalLine: mapping.originalLine,
- originalColumn: mapping.originalColumn,
- name: name
- };
- this.__generatedMappings.push(adjustedMapping);
- if (typeof adjustedMapping.originalLine === 'number') {
- this.__originalMappings.push(adjustedMapping);
- }
- }
- }
- quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
- quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
- };
- var IndexedSourceMapConsumer_1 = IndexedSourceMapConsumer;
- var sourceMapConsumer = {
- SourceMapConsumer: SourceMapConsumer_1,
- BasicSourceMapConsumer: BasicSourceMapConsumer_1,
- IndexedSourceMapConsumer: IndexedSourceMapConsumer_1
- };
- /* -*- Mode: js; js-indent-level: 2; -*- */
- /*
- * Copyright 2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var SourceMapGenerator$2 = sourceMapGenerator.SourceMapGenerator;
- // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
- // operating systems these days (capturing the result).
- var REGEX_NEWLINE = /(\r?\n)/;
- // Newline character code for charCodeAt() comparisons
- var NEWLINE_CODE = 10;
- // Private symbol for identifying `SourceNode`s when multiple versions of
- // the source-map library are loaded. This MUST NOT CHANGE across
- // versions!
- var isSourceNode = "$$$isSourceNode$$$";
- /**
- * SourceNodes provide a way to abstract over interpolating/concatenating
- * snippets of generated JavaScript source code while maintaining the line and
- * column information associated with the original source code.
- *
- * @param aLine The original line number.
- * @param aColumn The original column number.
- * @param aSource The original source's filename.
- * @param aChunks Optional. An array of strings which are snippets of
- * generated JS, or other SourceNodes.
- * @param aName The original identifier.
- */
- function SourceNode$1(aLine, aColumn, aSource, aChunks, aName) {
- this.children = [];
- this.sourceContents = {};
- this.line = aLine == null ? null : aLine;
- this.column = aColumn == null ? null : aColumn;
- this.source = aSource == null ? null : aSource;
- this.name = aName == null ? null : aName;
- this[isSourceNode] = true;
- if (aChunks != null) this.add(aChunks);
- }
- /**
- * Creates a SourceNode from generated code and a SourceMapConsumer.
- *
- * @param aGeneratedCode The generated code
- * @param aSourceMapConsumer The SourceMap for the generated code
- * @param aRelativePath Optional. The path that relative sources in the
- * SourceMapConsumer should be relative to.
- */
- SourceNode$1.fromStringWithSourceMap =
- function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
- // The SourceNode we want to fill with the generated code
- // and the SourceMap
- var node = new SourceNode$1();
- // All even indices of this array are one line of the generated code,
- // while all odd indices are the newlines between two adjacent lines
- // (since `REGEX_NEWLINE` captures its match).
- // Processed fragments are accessed by calling `shiftNextLine`.
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
- var remainingLinesIndex = 0;
- var shiftNextLine = function() {
- var lineContents = getNextLine();
- // The last line of a file might not have a newline.
- var newLine = getNextLine() || "";
- return lineContents + newLine;
- function getNextLine() {
- return remainingLinesIndex < remainingLines.length ?
- remainingLines[remainingLinesIndex++] : undefined;
- }
- };
- // We need to remember the position of "remainingLines"
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
- // The generate SourceNodes we need a code range.
- // To extract it current and last mapping is used.
- // Here we store the last mapping.
- var lastMapping = null;
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
- // We add the code from "lastMapping" to "mapping":
- // First check if there is a new line in between.
- if (lastGeneratedLine < mapping.generatedLine) {
- // Associate first line with "lastMapping"
- addMappingWithCode(lastMapping, shiftNextLine());
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
- // The remaining code is added without mapping
- } else {
- // There is no new line in between.
- // Associate the code between "lastGeneratedColumn" and
- // "mapping.generatedColumn" with "lastMapping"
- var nextLine = remainingLines[remainingLinesIndex] || '';
- var code = nextLine.substr(0, mapping.generatedColumn -
- lastGeneratedColumn);
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
- lastGeneratedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- addMappingWithCode(lastMapping, code);
- // No more remaining code, continue
- lastMapping = mapping;
- return;
- }
- }
- // We add the generated code until the first mapping
- // to the SourceNode without any mapping.
- // Each line is added as separate string.
- while (lastGeneratedLine < mapping.generatedLine) {
- node.add(shiftNextLine());
- lastGeneratedLine++;
- }
- if (lastGeneratedColumn < mapping.generatedColumn) {
- var nextLine = remainingLines[remainingLinesIndex] || '';
- node.add(nextLine.substr(0, mapping.generatedColumn));
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
- lastGeneratedColumn = mapping.generatedColumn;
- }
- lastMapping = mapping;
- }, this);
- // We have processed all mappings.
- if (remainingLinesIndex < remainingLines.length) {
- if (lastMapping) {
- // Associate the remaining code in the current line with "lastMapping"
- addMappingWithCode(lastMapping, shiftNextLine());
- }
- // and add the remaining lines without any mapping
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
- }
- // Copy sourcesContent into SourceNode
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aRelativePath != null) {
- sourceFile = util$1.join(aRelativePath, sourceFile);
- }
- node.setSourceContent(sourceFile, content);
- }
- });
- return node;
- function addMappingWithCode(mapping, code) {
- if (mapping === null || mapping.source === undefined) {
- node.add(code);
- } else {
- var source = aRelativePath
- ? util$1.join(aRelativePath, mapping.source)
- : mapping.source;
- node.add(new SourceNode$1(mapping.originalLine,
- mapping.originalColumn,
- source,
- code,
- mapping.name));
- }
- }
- };
- /**
- * Add a chunk of generated JS to this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
- SourceNode$1.prototype.add = function SourceNode_add(aChunk) {
- if (Array.isArray(aChunk)) {
- aChunk.forEach(function (chunk) {
- this.add(chunk);
- }, this);
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- if (aChunk) {
- this.children.push(aChunk);
- }
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- /**
- * Add a chunk of generated JS to the beginning of this source node.
- *
- * @param aChunk A string snippet of generated JS code, another instance of
- * SourceNode, or an array where each member is one of those things.
- */
- SourceNode$1.prototype.prepend = function SourceNode_prepend(aChunk) {
- if (Array.isArray(aChunk)) {
- for (var i = aChunk.length-1; i >= 0; i--) {
- this.prepend(aChunk[i]);
- }
- }
- else if (aChunk[isSourceNode] || typeof aChunk === "string") {
- this.children.unshift(aChunk);
- }
- else {
- throw new TypeError(
- "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
- );
- }
- return this;
- };
- /**
- * Walk over the tree of JS snippets in this node and its children. The
- * walking function is called once for each snippet of JS and is passed that
- * snippet and the its original associated source's line/column location.
- *
- * @param aFn The traversal function.
- */
- SourceNode$1.prototype.walk = function SourceNode_walk(aFn) {
- var chunk;
- for (var i = 0, len = this.children.length; i < len; i++) {
- chunk = this.children[i];
- if (chunk[isSourceNode]) {
- chunk.walk(aFn);
- }
- else {
- if (chunk !== '') {
- aFn(chunk, { source: this.source,
- line: this.line,
- column: this.column,
- name: this.name });
- }
- }
- }
- };
- /**
- * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
- * each of `this.children`.
- *
- * @param aSep The separator.
- */
- SourceNode$1.prototype.join = function SourceNode_join(aSep) {
- var newChildren;
- var i;
- var len = this.children.length;
- if (len > 0) {
- newChildren = [];
- for (i = 0; i < len-1; i++) {
- newChildren.push(this.children[i]);
- newChildren.push(aSep);
- }
- newChildren.push(this.children[i]);
- this.children = newChildren;
- }
- return this;
- };
- /**
- * Call String.prototype.replace on the very right-most source snippet. Useful
- * for trimming whitespace from the end of a source node, etc.
- *
- * @param aPattern The pattern to replace.
- * @param aReplacement The thing to replace the pattern with.
- */
- SourceNode$1.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
- var lastChild = this.children[this.children.length - 1];
- if (lastChild[isSourceNode]) {
- lastChild.replaceRight(aPattern, aReplacement);
- }
- else if (typeof lastChild === 'string') {
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
- }
- else {
- this.children.push(''.replace(aPattern, aReplacement));
- }
- return this;
- };
- /**
- * Set the source content for a source file. This will be added to the SourceMapGenerator
- * in the sourcesContent field.
- *
- * @param aSourceFile The filename of the source file
- * @param aSourceContent The content of the source file
- */
- SourceNode$1.prototype.setSourceContent =
- function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util$1.toSetString(aSourceFile)] = aSourceContent;
- };
- /**
- * Walk over the tree of SourceNodes. The walking function is called for each
- * source file content and is passed the filename and source content.
- *
- * @param aFn The traversal function.
- */
- SourceNode$1.prototype.walkSourceContents =
- function SourceNode_walkSourceContents(aFn) {
- for (var i = 0, len = this.children.length; i < len; i++) {
- if (this.children[i][isSourceNode]) {
- this.children[i].walkSourceContents(aFn);
- }
- }
- var sources = Object.keys(this.sourceContents);
- for (var i = 0, len = sources.length; i < len; i++) {
- aFn(util$1.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
- /**
- * Return the string representation of this source node. Walks over the tree
- * and concatenates all the various snippets together to one string.
- */
- SourceNode$1.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
- };
- /**
- * Returns the string representation of this source node along with a source
- * map.
- */
- SourceNode$1.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator$2(aArgs);
- var sourceMappingActive = false;
- var lastOriginalSource = null;
- var lastOriginalLine = null;
- var lastOriginalColumn = null;
- var lastOriginalName = null;
- this.walk(function (chunk, original) {
- generated.code += chunk;
- if (original.source !== null
- && original.line !== null
- && original.column !== null) {
- if(lastOriginalSource !== original.source
- || lastOriginalLine !== original.line
- || lastOriginalColumn !== original.column
- || lastOriginalName !== original.name) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- lastOriginalSource = original.source;
- lastOriginalLine = original.line;
- lastOriginalColumn = original.column;
- lastOriginalName = original.name;
- sourceMappingActive = true;
- } else if (sourceMappingActive) {
- map.addMapping({
- generated: {
- line: generated.line,
- column: generated.column
- }
- });
- lastOriginalSource = null;
- sourceMappingActive = false;
- }
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
- generated.line++;
- generated.column = 0;
- // Mappings end at eol
- if (idx + 1 === length) {
- lastOriginalSource = null;
- sourceMappingActive = false;
- } else if (sourceMappingActive) {
- map.addMapping({
- source: original.source,
- original: {
- line: original.line,
- column: original.column
- },
- generated: {
- line: generated.line,
- column: generated.column
- },
- name: original.name
- });
- }
- } else {
- generated.column++;
- }
- }
- });
- this.walkSourceContents(function (sourceFile, sourceContent) {
- map.setSourceContent(sourceFile, sourceContent);
- });
- return { code: generated.code, map: map };
- };
- var SourceNode_1 = SourceNode$1;
- var sourceNode = {
- SourceNode: SourceNode_1
- };
- /*
- * Copyright 2009-2011 Mozilla Foundation and contributors
- * Licensed under the New BSD license. See LICENSE.txt or:
- * http://opensource.org/licenses/BSD-3-Clause
- */
- var SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
- var SourceMapConsumer$1 = sourceMapConsumer.SourceMapConsumer;
- var SourceNode = sourceNode.SourceNode;
- var sourceMap = {
- SourceMapGenerator: SourceMapGenerator$1,
- SourceMapConsumer: SourceMapConsumer$1,
- SourceNode: SourceNode
- };
- // Terser 5.6.1
- function characters(e){return e.split("")}function member(e,t){return t.includes(e)}class DefaultsError extends Error{constructor(e,t){super(),this.name="DefaultsError",this.message=e,this.defs=t;}}function defaults$1(e,t,n){!0===e&&(e={}),null!=e&&"object"==typeof e&&(e=Object.assign({},e));const o=e||{};if(n)for(const e in o)if(HOP(o,e)&&!HOP(t,e))throw new DefaultsError("`"+e+"` is not a supported option",t);for(const n in t)if(HOP(t,n))if(e&&HOP(e,n))if("ecma"===n){let t=0|e[n];t>5&&t<2015&&(t+=2009),o[n]=t;}else o[n]=e&&HOP(e,n)?e[n]:t[n];else o[n]=t[n];return o}function noop(){}function return_false(){return !1}function return_true(){return !0}function return_this(){return this}function return_null(){return null}var MAP=function(){function e(e,r,a){var s,u=[],l=[];function _(){var _=r(e[s],s),c=_ instanceof i;return c&&(_=_.v),_ instanceof n?(_=_.v)instanceof o?l.push.apply(l,a?_.v.slice().reverse():_.v):l.push(_):_!==t&&(_ instanceof o?u.push.apply(u,a?_.v.slice().reverse():_.v):u.push(_)),c}if(Array.isArray(e))if(a){for(s=e.length;--s>=0&&!_(););u.reverse(),l.reverse();}else for(s=0;s<e.length&&!_();++s);else for(s in e)if(HOP(e,s)&&_())break;return l.concat(u)}e.at_top=function(e){return new n(e)},e.splice=function(e){return new o(e)},e.last=function(e){return new i(e)};var t=e.skip={};function n(e){this.v=e;}function o(e){this.v=e;}function i(e){this.v=e;}return e}();function make_node(e,t,n){return n||(n={}),t&&(n.start||(n.start=t.start),n.end||(n.end=t.end)),new e(n)}function push_uniq(e,t){e.includes(t)||e.push(t);}function string_template(e,t){return e.replace(/{(.+?)}/g,(function(e,n){return t&&t[n]}))}function remove$1(e,t){for(var n=e.length;--n>=0;)e[n]===t&&e.splice(n,1);}function mergeSort(e,t){return e.length<2?e.slice():function e(n){if(n.length<=1)return n;var o=Math.floor(n.length/2),i=n.slice(0,o),r=n.slice(o);return function(e,n){for(var o=[],i=0,r=0,a=0;i<e.length&&r<n.length;)t(e[i],n[r])<=0?o[a++]=e[i++]:o[a++]=n[r++];return i<e.length&&o.push.apply(o,e.slice(i)),r<n.length&&o.push.apply(o,n.slice(r)),o}(i=e(i),r=e(r))}(e)}function makePredicate(e){return Array.isArray(e)||(e=e.split(" ")),new Set(e)}function map_add(e,t,n){e.has(t)?e.get(t).push(n):e.set(t,[n]);}function map_from_object(e){var t=new Map;for(var n in e)HOP(e,n)&&"$"===n.charAt(0)&&t.set(n.substr(1),e[n]);return t}function map_to_object(e){var t=Object.create(null);return e.forEach((function(e,n){t["$"+n]=e;})),t}function HOP(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function keep_name(e,t){return !0===e||e instanceof RegExp&&e.test(t)}var lineTerminatorEscape={"\0":"0","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function regexp_source_fix(e){return e.replace(/[\0\n\r\u2028\u2029]/g,(function(t,n){return ("\\"!=e[n-1]||"\\"==e[n-2]&&!/(?:^|[^\\])(?:\\{2})*$/.test(e.slice(0,n-1))?"\\":"")+lineTerminatorEscape[t]}))}function sort_regexp_flags(e){const t=new Set(e.split(""));let n="";for(const e of "gimuy")t.has(e)&&(n+=e,t.delete(e));return t.size&&t.forEach((e=>{n+=e;})),n}function has_annotation(e,t){return e._annotations&t}function set_annotation(e,t){e._annotations|=t;}var LATEST_RAW="",LATEST_TEMPLATE_END=!0,KEYWORDS="break case catch class const continue debugger default delete do else export extends finally for function if in instanceof let new return switch throw try typeof var void while with",KEYWORDS_ATOM="false null true",RESERVED_WORDS="enum implements import interface package private protected public static super this "+KEYWORDS_ATOM+" "+KEYWORDS,KEYWORDS_BEFORE_EXPRESSION="return new delete throw else case yield await";KEYWORDS=makePredicate(KEYWORDS),RESERVED_WORDS=makePredicate(RESERVED_WORDS),KEYWORDS_BEFORE_EXPRESSION=makePredicate(KEYWORDS_BEFORE_EXPRESSION),KEYWORDS_ATOM=makePredicate(KEYWORDS_ATOM);var OPERATOR_CHARS=makePredicate(characters("+-*&%=<>!?|~^")),RE_NUM_LITERAL=/[0-9a-f]/i,RE_HEX_NUMBER=/^0x[0-9a-f]+$/i,RE_OCT_NUMBER=/^0[0-7]+$/,RE_ES6_OCT_NUMBER=/^0o[0-7]+$/i,RE_BIN_NUMBER=/^0b[01]+$/i,RE_DEC_NUMBER=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,RE_BIG_INT=/^(0[xob])?[0-9a-f]+n$/i,OPERATORS=makePredicate(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","**","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","||=","&&=","??=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","??","||"]),WHITESPACE_CHARS=makePredicate(characters(" \n\r\t\f\v \u2028\u2029 \ufeff")),NEWLINE_CHARS=makePredicate(characters("\n\r\u2028\u2029")),PUNC_AFTER_EXPRESSION=makePredicate(characters(";]),:")),PUNC_BEFORE_EXPRESSION=makePredicate(characters("[{(,;:")),PUNC_CHARS=makePredicate(characters("[]{}(),;:")),UNICODE={ID_Start:/[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/(?:[$0-9A-Z_a-z\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF])+/};function get_full_char(e,t){if(is_surrogate_pair_head(e.charCodeAt(t))){if(is_surrogate_pair_tail(e.charCodeAt(t+1)))return e.charAt(t)+e.charAt(t+1)}else if(is_surrogate_pair_tail(e.charCodeAt(t))&&is_surrogate_pair_head(e.charCodeAt(t-1)))return e.charAt(t-1)+e.charAt(t);return e.charAt(t)}function get_full_char_code(e,t){return is_surrogate_pair_head(e.charCodeAt(t))?65536+(e.charCodeAt(t)-55296<<10)+e.charCodeAt(t+1)-56320:e.charCodeAt(t)}function get_full_char_length(e){for(var t=0,n=0;n<e.length;n++)is_surrogate_pair_head(e.charCodeAt(n))&&is_surrogate_pair_tail(e.charCodeAt(n+1))&&(t++,n++);return e.length-t}function from_char_code(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function is_surrogate_pair_head(e){return e>=55296&&e<=56319}function is_surrogate_pair_tail(e){return e>=56320&&e<=57343}function is_digit(e){return e>=48&&e<=57}function is_identifier_start(e){return UNICODE.ID_Start.test(e)}function is_identifier_char(e){return UNICODE.ID_Continue.test(e)}const BASIC_IDENT=/^[a-z_$][a-z0-9_$]*$/i;function is_basic_identifier_string(e){return BASIC_IDENT.test(e)}function is_identifier_string(e,t){if(BASIC_IDENT.test(e))return !0;if(!t&&/[\ud800-\udfff]/.test(e))return !1;var n=UNICODE.ID_Start.exec(e);return !(!n||0!==n.index||(e=e.slice(n[0].length))&&(!(n=UNICODE.ID_Continue.exec(e))||n[0].length!==e.length))}function parse_js_number(e,t=!0){if(!t&&e.includes("e"))return NaN;if(RE_HEX_NUMBER.test(e))return parseInt(e.substr(2),16);if(RE_OCT_NUMBER.test(e))return parseInt(e.substr(1),8);if(RE_ES6_OCT_NUMBER.test(e))return parseInt(e.substr(2),8);if(RE_BIN_NUMBER.test(e))return parseInt(e.substr(2),2);if(RE_DEC_NUMBER.test(e))return parseFloat(e);var n=parseFloat(e);return n==e?n:void 0}class JS_Parse_Error extends Error{constructor(e,t,n,o,i){super(),this.name="SyntaxError",this.message=e,this.filename=t,this.line=n,this.col=o,this.pos=i;}}function js_error(e,t,n,o,i){throw new JS_Parse_Error(e,t,n,o,i)}function is_token(e,t,n){return e.type==t&&(null==n||e.value==n)}var EX_EOF={};function tokenizer$1(e,t,n,o){var i={text:e,filename:t,pos:0,tokpos:0,line:1,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,brace_counter:0,template_braces:[],comments_before:[],directives:{},directive_stack:[]};function r(){return get_full_char(i.text,i.pos)}function a(){if(46!==i.text.charCodeAt(i.pos+1))return !1;const e=i.text.charCodeAt(i.pos+2);return e<48||e>57}function s(e,t){var n=get_full_char(i.text,i.pos++);if(e&&!n)throw EX_EOF;return NEWLINE_CHARS.has(n)?(i.newline_before=i.newline_before||!t,++i.line,i.col=0,"\r"==n&&"\n"==r()&&(++i.pos,n="\n")):(n.length>1&&(++i.pos,++i.col),++i.col),n}function u(e){for(;e--;)s();}function l(e){return i.text.substr(i.pos,e.length)==e}function _(e,t){var n=i.text.indexOf(e,i.pos);if(t&&-1==n)throw EX_EOF;return n}function c(){i.tokline=i.line,i.tokcol=i.col,i.tokpos=i.pos;}var f=!1,p=null;function d(e,n,o){i.regex_allowed="operator"==e&&!UNARY_POSTFIX.has(n)||"keyword"==e&&KEYWORDS_BEFORE_EXPRESSION.has(n)||"punc"==e&&PUNC_BEFORE_EXPRESSION.has(n)||"arrow"==e,"punc"!=e||"."!=n&&"?."!=n?o||(f=!1):f=!0;const r=i.tokline,a=i.tokcol,s=i.tokpos,u=i.newline_before,l=t;let _=[],c=[];o||(_=i.comments_before,c=i.comments_before=[]),i.newline_before=!1;const d=new AST_Token(e,n,r,a,s,u,_,c,l);return o||(p=d),d}function S(){for(;WHITESPACE_CHARS.has(r());)s();}function m(e){js_error(e,t,i.tokline,i.tokcol,i.tokpos);}function A(e){var t=!1,n=!1,o=!1,i="."==e,a=!1,u=!1,l=function(e){for(var t,n="",o=0;(t=r())&&e(t,o++);)n+=s();return n}((function(r,s){if(a)return !1;switch(r.charCodeAt(0)){case 95:return u=!0;case 98:case 66:return o=!0;case 111:case 79:case 120:case 88:return !o&&(o=!0);case 101:case 69:return !!o||!t&&(t=n=!0);case 45:return n||0==s&&!e;case 43:return n;case n=!1,46:return !(i||o||t)&&(i=!0)}return "n"===r?(a=!0,!0):RE_NUM_LITERAL.test(r)}));if(e&&(l=e+l),LATEST_RAW=l,RE_OCT_NUMBER.test(l)&&F.has_directive("use strict")&&m("Legacy octal literals are not allowed in strict mode"),u&&(l.endsWith("_")?m("Numeric separators are not allowed at the end of numeric literals"):l.includes("__")&&m("Only one underscore is allowed as numeric separator"),l=l.replace(/_/g,"")),l.endsWith("n")){const e=l.slice(0,-1),t=parse_js_number(e,RE_HEX_NUMBER.test(e));if(!i&&RE_BIG_INT.test(l)&&!isNaN(t))return d("big_int",e);m("Invalid or unexpected token");}var _=parse_js_number(l);if(!isNaN(_))return d("num",_);m("Invalid syntax: "+l);}function T(e){return e>="0"&&e<="7"}function h(e,t,n){var o=s(!0,e);switch(o.charCodeAt(0)){case 110:return "\n";case 114:return "\r";case 116:return "\t";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 120:return String.fromCharCode(E(2,t));case 117:if("{"==r()){for(s(!0),"}"===r()&&m("Expecting hex-character between {}");"0"==r();)s(!0);var a,u=_("}",!0)-i.pos;return (u>6||(a=E(u,t))>1114111)&&m("Unicode reference out of bounds"),s(!0),from_char_code(a)}return String.fromCharCode(E(4,t));case 10:return "";case 13:if("\n"==r())return s(!0,e),""}return T(o)?(n&&t&&("0"===o&&!T(r())||m("Octal escape sequences are not allowed in template strings")),function(e,t){var n=r();return n>="0"&&n<="7"&&(e+=s(!0))[0]<="3"&&(n=r())>="0"&&n<="7"&&(e+=s(!0)),"0"===e?"\0":(e.length>0&&F.has_directive("use strict")&&t&&m("Legacy octal escape sequences are not allowed in strict mode"),String.fromCharCode(parseInt(e,8)))}(o,t)):o}function E(e,t){for(var n=0;e>0;--e){if(!t&&isNaN(parseInt(r(),16)))return parseInt(n,16)||"";var o=s(!0);isNaN(parseInt(o,16))&&m("Invalid hex-character pattern in string"),n+=o;}return parseInt(n,16)}var g=O("Unterminated string constant",(function(){const e=i.pos;for(var t=s(),n=[];;){var o=s(!0,!0);if("\\"==o)o=h(!0,!0);else if("\r"==o||"\n"==o)m("Unterminated string constant");else if(o==t)break;n.push(o);}var r=d("string",n.join(""));return LATEST_RAW=i.text.slice(e,i.pos),r.quote=t,r})),D=O("Unterminated template",(function(e){e&&i.template_braces.push(i.brace_counter);var t,n,o="",a="";for(s(!0,!0);"`"!=(t=s(!0,!0));){if("\r"==t)"\n"==r()&&++i.pos,t="\n";else if("$"==t&&"{"==r())return s(!0,!0),i.brace_counter++,n=d(e?"template_head":"template_substitution",o),LATEST_RAW=a,LATEST_TEMPLATE_END=!1,n;if(a+=t,"\\"==t){var u=i.pos;t=h(!0,!(p&&("name"===p.type||"punc"===p.type&&(")"===p.value||"]"===p.value))),!0),a+=i.text.substr(u,i.pos-u);}o+=t;}return i.template_braces.pop(),n=d(e?"template_head":"template_substitution",o),LATEST_RAW=a,LATEST_TEMPLATE_END=!0,n}));function b(e){var t,n=i.regex_allowed,o=function(){for(var e=i.text,t=i.pos,n=i.text.length;t<n;++t){var o=e[t];if(NEWLINE_CHARS.has(o))return t}return -1}();return -1==o?(t=i.text.substr(i.pos),i.pos=i.text.length):(t=i.text.substring(i.pos,o),i.pos=o),i.col=i.tokcol+(i.pos-i.tokpos),i.comments_before.push(d(e,t,!0)),i.regex_allowed=n,F}var y=O("Unterminated multiline comment",(function(){var e=i.regex_allowed,t=_("*/",!0),n=i.text.substring(i.pos,t).replace(/\r\n|\r|\u2028|\u2029/g,"\n");return u(get_full_char_length(n)+2),i.comments_before.push(d("comment2",n,!0)),i.newline_before=i.newline_before||n.includes("\n"),i.regex_allowed=e,F})),v=O("Unterminated identifier name",(function(){var e,t=[],n=!1,o=function(){return n=!0,s(),"u"!==r()&&m("Expecting UnicodeEscapeSequence -- uXXXX or u{XXXX}"),h(!1,!0)};if("\\"===(e=r()))is_identifier_start(e=o())||m("First identifier char is an invalid identifier char");else {if(!is_identifier_start(e))return "";s();}for(t.push(e);null!=(e=r());){if("\\"===(e=r()))is_identifier_char(e=o())||m("Invalid escaped identifier char");else {if(!is_identifier_char(e))break;s();}t.push(e);}const i=t.join("");return RESERVED_WORDS.has(i)&&n&&m("Escaped characters are not allowed in keywords"),i})),C=O("Unterminated regular expression",(function(e){for(var t,n=!1,o=!1;t=s(!0);)if(NEWLINE_CHARS.has(t))m("Unexpected line terminator");else if(n)e+="\\"+t,n=!1;else if("["==t)o=!0,e+=t;else if("]"==t&&o)o=!1,e+=t;else {if("/"==t&&!o)break;"\\"==t?n=!0:e+=t;}return d("regexp","/"+e+"/"+v())}));function R(e){return d("operator",function e(t){if(!r())return t;var n=t+r();return OPERATORS.has(n)?(s(),e(n)):t}(e||s()))}function k(){switch(s(),r()){case"/":return s(),b("comment1");case"*":return s(),y()}return i.regex_allowed?C(""):R("/")}function O(e,t){return function(n){try{return t(n)}catch(t){if(t!==EX_EOF)throw t;m(e);}}}function F(e){if(null!=e)return C(e);for(o&&0==i.pos&&l("#!")&&(c(),u(2),b("comment5"));;){if(S(),c(),n){if(l("\x3c!--")){u(4),b("comment3");continue}if(l("--\x3e")&&i.newline_before){u(3),b("comment4");continue}}var t=r();if(!t)return d("eof");var _=t.charCodeAt(0);switch(_){case 34:case 39:return g();case 46:return s(),is_digit(r().charCodeAt(0))?A("."):"."===r()?(s(),s(),d("expand","...")):d("punc",".");case 47:var p=k();if(p===F)continue;return p;case 61:return s(),">"===r()?(s(),d("arrow","=>")):R("=");case 63:if(!a())break;return s(),s(),d("punc","?.");case 96:return D(!0);case 123:i.brace_counter++;break;case 125:if(i.brace_counter--,i.template_braces.length>0&&i.template_braces[i.template_braces.length-1]===i.brace_counter)return D(!1)}if(is_digit(_))return A();if(PUNC_CHARS.has(t))return d("punc",s());if(OPERATOR_CHARS.has(t))return R();if(92==_||is_identifier_start(t))return T=v(),f?d("name",T):KEYWORDS_ATOM.has(T)?d("atom",T):KEYWORDS.has(T)?OPERATORS.has(T)?d("operator",T):d("keyword",T):d("name",T);if(35==_)return s(),d("privatename",v());break}var T;m("Unexpected character '"+t+"'");}return F.next=s,F.peek=r,F.context=function(e){return e&&(i=e),i},F.add_directive=function(e){i.directive_stack[i.directive_stack.length-1].push(e),void 0===i.directives[e]?i.directives[e]=1:i.directives[e]++;},F.push_directives_stack=function(){i.directive_stack.push([]);},F.pop_directives_stack=function(){for(var e=i.directive_stack[i.directive_stack.length-1],t=0;t<e.length;t++)i.directives[e[t]]--;i.directive_stack.pop();},F.has_directive=function(e){return i.directives[e]>0},F}var UNARY_PREFIX=makePredicate(["typeof","void","delete","--","++","!","~","-","+"]),UNARY_POSTFIX=makePredicate(["--","++"]),ASSIGNMENT=makePredicate(["=","+=","-=","??=","&&=","||=","/=","*=","**=","%=",">>=","<<=",">>>=","|=","^=","&="]),LOGICAL_ASSIGNMENT=makePredicate(["??=","&&=","||="]),PRECEDENCE=function(e,t){for(var n=0;n<e.length;++n)for(var o=e[n],i=0;i<o.length;++i)t[o[i]]=n+1;return t}([["||"],["??"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],{}),ATOMIC_START_TOKEN=makePredicate(["atom","num","big_int","string","regexp","name"]);function parse$5(e,t){const n=new WeakMap;t=defaults$1(t,{bare_returns:!1,ecma:null,expression:!1,filename:null,html5_comments:!0,module:!1,shebang:!0,strict:!1,toplevel:null},!0);var o={input:"string"==typeof e?tokenizer$1(e,t.filename,t.html5_comments,t.shebang):e,token:null,prev:null,peeked:null,in_function:0,in_async:-1,in_generator:-1,in_directives:!0,in_loop:0,labels:[]};function i(e,t){return is_token(o.token,e,t)}function r(){return o.peeked||(o.peeked=o.input())}function a(){return o.prev=o.token,o.peeked||r(),o.token=o.peeked,o.peeked=null,o.in_directives=o.in_directives&&("string"==o.token.type||i("punc",";")),o.token}function s(){return o.prev}function u(e,t,n,i){var r=o.input.context();js_error(e,r.filename,null!=t?t:r.tokline,null!=n?n:r.tokcol,null!=i?i:r.tokpos);}function l(e,t){u(t,e.line,e.col);}function _(e){null==e&&(e=o.token),l(e,"Unexpected token: "+e.type+" ("+e.value+")");}function c(e,t){if(i(e,t))return a();l(o.token,"Unexpected token "+o.token.type+" «"+o.token.value+"», expected "+e+" «"+t+"»");}function f(e){return c("punc",e)}function p(e){return e.nlb||!e.comments_before.every((e=>!e.nlb))}function d(){return !t.strict&&(i("eof")||i("punc","}")||p(o.token))}function S(){return o.in_generator===o.in_function}function m(){return o.in_async===o.in_function||0===o.in_function&&o.input.has_directive("use strict")}function A(e){i("punc",";")?a():e||d()||_();}function T(){f("(");var e=Se(!0);return f(")"),e}function h(e){return function(...t){const n=o.token,i=e(...t);return i.start=n,i.end=s(),i}}function E(){(i("operator","/")||i("operator","/="))&&(o.peeked=null,o.token=o.input(o.token.value.substr(1)));}o.token=a();var g=h((function e(n,S,h){switch(E(),o.token.type){case"string":if(o.in_directives){var g=r();!LATEST_RAW.includes("\\")&&(is_token(g,"punc",";")||is_token(g,"punc","}")||p(g)||is_token(g,"eof"))?o.input.add_directive(o.token.value):o.in_directives=!1;}var k=o.in_directives,F=b();return k&&F.body instanceof AST_String?new AST_Directive(F.body):F;case"template_head":case"num":case"big_int":case"regexp":case"operator":case"atom":return b();case"name":if("async"==o.token.value&&is_token(r(),"keyword","function"))return a(),a(),S&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!0,n);if("import"==o.token.value&&!is_token(r(),"punc","(")&&!is_token(r(),"punc",".")){a();var M=function(){var e,t,n=s();i("name")&&(e=re(AST_SymbolImport)),i("punc",",")&&a(),((t=J(!0))||e)&&c("name","from");var r=o.token;return "string"!==r.type&&_(),a(),new AST_Import({start:n,imported_name:e,imported_names:t,module_name:new AST_String({start:r,value:r.value,quote:r.quote,end:r}),end:o.token})}();return A(),M}return is_token(r(),"punc",":")?D():b();case"punc":switch(o.token.value){case"{":return new AST_BlockStatement({start:o.token,body:w(),end:s()});case"[":case"(":return b();case";":return o.in_directives=!1,a(),new AST_EmptyStatement;default:_();}case"keyword":switch(o.token.value){case"break":return a(),y(AST_Break);case"continue":return a(),y(AST_Continue);case"debugger":return a(),A(),new AST_Debugger;case"do":a();var I=me(e);c("keyword","while");var B=T();return A(!0),new AST_Do({body:I,condition:B});case"while":return a(),new AST_While({condition:T(),body:me((function(){return e(!1,!0)}))});case"for":return a(),function(){var e="`for await` invalid in this context",t=o.token;"name"==t.type&&"await"==t.value?(m()||l(t,e),a()):t=!1,f("(");var n=null;if(i("punc",";"))t&&l(t,e);else {n=i("keyword","var")?(a(),L(!0)):i("keyword","let")?(a(),V(!0)):i("keyword","const")?(a(),U(!0)):Se(!0,!0);var r=i("operator","in"),s=i("name","of");if(t&&!s&&l(t,e),r||s)return n instanceof AST_Definitions?n.definitions.length>1&&l(n.start,"Only one variable declaration allowed in for..in loop"):fe(n)||(n=pe(n))instanceof AST_Destructuring||l(n.start,"Invalid left-hand side in for..in loop"),a(),r?R(n):C(n,!!t)}return v(n)}();case"class":return a(),S&&u("classes are not allowed as the body of a loop"),h&&u("classes are not allowed as the body of an if"),j(AST_DefClass);case"function":return a(),S&&u("functions are not allowed as the body of a loop"),O(AST_Defun,!1,!1,n);case"if":return a(),x();case"return":0!=o.in_function||t.bare_returns||u("'return' outside of function"),a();var K=null;return i("punc",";")?a():d()||(K=Se(!0),A()),new AST_Return({value:K});case"switch":return a(),new AST_Switch({expression:T(),body:me(P)});case"throw":return a(),p(o.token)&&u("Illegal newline after 'throw'"),K=Se(!0),A(),new AST_Throw({value:K});case"try":return a(),function(){var e=w(),t=null,n=null;if(i("keyword","catch")){var r=o.token;if(a(),i("punc","{"))var l=null;else f("("),l=N(void 0,AST_SymbolCatch),f(")");t=new AST_Catch({start:r,argname:l,body:w(),end:s()});}return i("keyword","finally")&&(r=o.token,a(),n=new AST_Finally({start:r,body:w(),end:s()})),t||n||u("Missing catch/finally blocks"),new AST_Try({body:e,bcatch:t,bfinally:n})}();case"var":return a(),M=L(),A(),M;case"let":return a(),M=V(),A(),M;case"const":return a(),M=U(),A(),M;case"with":return o.input.has_directive("use strict")&&u("Strict mode may not include a with statement"),a(),new AST_With({expression:T(),body:e()});case"export":if(!is_token(r(),"punc","("))return a(),M=ee(),i("punc",";")&&A(),M}}_();}));function D(){var e=re(AST_Label);"await"===e.name&&o.in_async===o.in_function&&l(o.prev,"await cannot be used as label inside async function"),o.labels.some((t=>t.name===e.name))&&u("Label "+e.name+" defined twice"),f(":"),o.labels.push(e);var t=g();return o.labels.pop(),t instanceof AST_IterationStatement||e.references.forEach((function(t){t instanceof AST_Continue&&(t=t.label.start,u("Continue label `"+e.name+"` refers to non-IterationStatement.",t.line,t.col,t.pos));})),new AST_LabeledStatement({body:t,label:e})}function b(e){return new AST_SimpleStatement({body:(e=Se(!0),A(),e)})}function y(e){var t,n=null;d()||(n=re(AST_LabelRef,!0)),null!=n?((t=o.labels.find((e=>e.name===n.name)))||u("Undefined label "+n.name),n.thedef=t):0==o.in_loop&&u(e.TYPE+" not inside a loop or switch"),A();var i=new e({label:n});return t&&t.references.push(i),i}function v(e){f(";");var t=i("punc",";")?null:Se(!0);f(";");var n=i("punc",")")?null:Se(!0);return f(")"),new AST_For({init:e,condition:t,step:n,body:me((function(){return g(!1,!0)}))})}function C(e,t){var n=e instanceof AST_Definitions?e.definitions[0].name:null,o=Se(!0);return f(")"),new AST_ForOf({await:t,init:e,name:n,object:o,body:me((function(){return g(!1,!0)}))})}function R(e){var t=Se(!0);return f(")"),new AST_ForIn({init:e,object:t,body:me((function(){return g(!1,!0)}))})}var k=function(e,t,n){p(o.token)&&u("Unexpected newline before arrow (=>)"),c("arrow","=>");var r=I(i("punc","{"),!1,n),a=r instanceof Array&&r.length?r[r.length-1].end:r instanceof Array?e:r.end;return new AST_Arrow({start:e,end:a,async:n,argnames:t,body:r})},O=function(e,t,n,o){var r=e===AST_Defun,u=i("operator","*");u&&a();var l=i("name")?re(r?AST_SymbolDefun:AST_SymbolLambda):null;r&&!l&&(o?e=AST_Function:_()),!l||e===AST_Accessor||l instanceof AST_SymbolDeclaration||_(s());var c=[],f=I(!0,u||t,n,l,c);return new e({start:c.start,end:f.end,is_generator:u,async:n,name:l,argnames:c,body:f})};function F(e,t){var n=new Set,o=!1,i=!1,r=!1,a=!!t,s={add_parameter:function(t){if(n.has(t.value))!1===o&&(o=t),s.check_strict();else if(n.add(t.value),e)switch(t.value){case"arguments":case"eval":case"yield":a&&l(t,"Unexpected "+t.value+" identifier as parameter inside strict mode");break;default:RESERVED_WORDS.has(t.value)&&_();}},mark_default_assignment:function(e){!1===i&&(i=e);},mark_spread:function(e){!1===r&&(r=e);},mark_strict_mode:function(){a=!0;},is_strict:function(){return !1!==i||!1!==r||a},check_strict:function(){s.is_strict()&&!1!==o&&l(o,"Parameter "+o.value+" was used already");}};return s}function N(e,t){var n,r=!1;return void 0===e&&(e=F(!0,o.input.has_directive("use strict"))),i("expand","...")&&(r=o.token,e.mark_spread(o.token),a()),n=M(e,t),i("operator","=")&&!1===r&&(e.mark_default_assignment(o.token),a(),n=new AST_DefaultAssign({start:n.start,left:n,operator:"=",right:Se(!1),end:o.token})),!1!==r&&(i("punc",")")||_(),n=new AST_Expansion({start:r,expression:n,end:r})),e.check_strict(),n}function M(e,t){var n,l=[],c=!0,p=!1,d=o.token;if(void 0===e&&(e=F(!1,o.input.has_directive("use strict"))),t=void 0===t?AST_SymbolFunarg:t,i("punc","[")){for(a();!i("punc","]");){if(c?c=!1:f(","),i("expand","...")&&(p=!0,n=o.token,e.mark_spread(o.token),a()),i("punc"))switch(o.token.value){case",":l.push(new AST_Hole({start:o.token,end:o.token}));continue;case"]":break;case"[":case"{":l.push(M(e,t));break;default:_();}else i("name")?(e.add_parameter(o.token),l.push(re(t))):u("Invalid function parameter");i("operator","=")&&!1===p&&(e.mark_default_assignment(o.token),a(),l[l.length-1]=new AST_DefaultAssign({start:l[l.length-1].start,left:l[l.length-1],operator:"=",right:Se(!1),end:o.token})),p&&(i("punc","]")||u("Rest element must be last element"),l[l.length-1]=new AST_Expansion({start:n,expression:l[l.length-1],end:n}));}return f("]"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!0,end:s()})}if(i("punc","{")){for(a();!i("punc","}");){if(c?c=!1:f(","),i("expand","...")&&(p=!0,n=o.token,e.mark_spread(o.token),a()),i("name")&&(is_token(r(),"punc")||is_token(r(),"operator"))&&[",","}","="].includes(r().value)){e.add_parameter(o.token);var S=s(),m=re(t);p?l.push(new AST_Expansion({start:n,expression:m,end:m.end})):l.push(new AST_ObjectKeyVal({start:S,key:m.name,value:m,end:m.end}));}else {if(i("punc","}"))continue;var A=o.token,T=te();null===T?_(s()):"name"!==s().type||i("punc",":")?(f(":"),l.push(new AST_ObjectKeyVal({start:A,quote:A.quote,key:T,value:M(e,t),end:s()}))):l.push(new AST_ObjectKeyVal({start:s(),key:T,value:new t({start:s(),name:T,end:s()}),end:s()}));}p?i("punc","}")||u("Rest element must be last element"):i("operator","=")&&(e.mark_default_assignment(o.token),a(),l[l.length-1].value=new AST_DefaultAssign({start:l[l.length-1].value.start,left:l[l.length-1].value,operator:"=",right:Se(!1),end:o.token}));}return f("}"),e.check_strict(),new AST_Destructuring({start:d,names:l,is_array:!1,end:s()})}if(i("name"))return e.add_parameter(o.token),re(t);u("Invalid function parameter");}function I(e,t,n,r,s){var u=o.in_loop,l=o.labels,_=o.in_generator,c=o.in_async;if(++o.in_function,t&&(o.in_generator=o.in_function),n&&(o.in_async=o.in_function),s&&function(e){var t=F(!0,o.input.has_directive("use strict"));for(f("(");!i("punc",")");){var n=N(t);if(e.push(n),i("punc",")")||f(","),n instanceof AST_Expansion)break}a();}(s),e&&(o.in_directives=!0),o.in_loop=0,o.labels=[],e){o.input.push_directives_stack();var p=w();r&&ie(r),s&&s.forEach(ie),o.input.pop_directives_stack();}else p=[new AST_Return({start:o.token,value:Se(!1),end:o.token})];return --o.in_function,o.in_loop=u,o.labels=l,o.in_generator=_,o.in_async=c,p}function x(){var e=T(),t=g(!1,!1,!0),n=null;return i("keyword","else")&&(a(),n=g(!1,!1,!0)),new AST_If({condition:e,body:t,alternative:n})}function w(){f("{");for(var e=[];!i("punc","}");)i("eof")&&_(),e.push(g());return a(),e}function P(){f("{");for(var e,t=[],n=null,r=null;!i("punc","}");)i("eof")&&_(),i("keyword","case")?(r&&(r.end=s()),n=[],r=new AST_Case({start:(e=o.token,a(),e),expression:Se(!0),body:n}),t.push(r),f(":")):i("keyword","default")?(r&&(r.end=s()),n=[],r=new AST_Default({start:(e=o.token,a(),f(":"),e),body:n}),t.push(r)):(n||_(),n.push(g()));return r&&(r.end=s()),a(),t}function B(e,t){for(var n,r=[];;){var l="var"===t?AST_SymbolVar:"const"===t?AST_SymbolConst:"let"===t?AST_SymbolLet:null;if(i("punc","{")||i("punc","[")?n=new AST_VarDef({start:o.token,name:M(void 0,l),value:i("operator","=")?(c("operator","="),Se(!1,e)):null,end:s()}):"import"==(n=new AST_VarDef({start:o.token,name:re(l),value:i("operator","=")?(a(),Se(!1,e)):e||"const"!==t?null:u("Missing initializer in const declaration"),end:s()})).name.name&&u("Unexpected token: import"),r.push(n),!i("punc",","))break;a();}return r}var L=function(e){return new AST_Var({start:s(),definitions:B(e,"var"),end:s()})},V=function(e){return new AST_Let({start:s(),definitions:B(e,"let"),end:s()})},U=function(e){return new AST_Const({start:s(),definitions:B(e,"const"),end:s()})};function K(){var e,t=o.token;switch(t.type){case"name":e=oe(AST_SymbolRef);break;case"num":e=new AST_Number({start:t,end:t,value:t.value,raw:LATEST_RAW});break;case"big_int":e=new AST_BigInt({start:t,end:t,value:t.value});break;case"string":e=new AST_String({start:t,end:t,value:t.value,quote:t.quote});break;case"regexp":const[n,o,i]=t.value.match(/^\/(.*)\/(\w*)$/);e=new AST_RegExp({start:t,end:t,value:{source:o,flags:i}});break;case"atom":switch(t.value){case"false":e=new AST_False({start:t,end:t});break;case"true":e=new AST_True({start:t,end:t});break;case"null":e=new AST_Null({start:t,end:t});}}return a(),e}function G(e,t){var n=function(e,t){return t?new AST_DefaultAssign({start:e.start,left:e,operator:"=",right:t,end:t.end}):e};return e instanceof AST_Object?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!1,names:e.properties.map((e=>G(e)))}),t):e instanceof AST_ObjectKeyVal?(e.value=G(e.value),n(e,t)):e instanceof AST_Hole?e:e instanceof AST_Destructuring?(e.names=e.names.map((e=>G(e))),n(e,t)):e instanceof AST_SymbolRef?n(new AST_SymbolFunarg({name:e.name,start:e.start,end:e.end}),t):e instanceof AST_Expansion?(e.expression=G(e.expression),n(e,t)):e instanceof AST_Array?n(new AST_Destructuring({start:e.start,end:e.end,is_array:!0,names:e.elements.map((e=>G(e)))}),t):e instanceof AST_Assign?n(G(e.left,e.right),t):e instanceof AST_DefaultAssign?(e.left=G(e.left),e):void u("Invalid function parameter",e.start.line,e.start.col)}var H=function(e,t){if(i("operator","new"))return function(e){var t=o.token;if(c("operator","new"),i("punc","."))return a(),c("name","target"),se(new AST_NewTarget({start:t,end:s()}),e);var n,r=H(!1);i("punc","(")?(a(),n=z(")",!0)):n=[];var u=new AST_New({start:t,expression:r,args:n,end:s()});return ae(u),se(u,e)}(e);if(i("operator","import"))return function(){var e=o.token;return c("operator","import"),c("punc","."),c("name","meta"),se(new AST_ImportMeta({start:e,end:s()}),!1)}();var u,l=o.token,p=i("name","async")&&"["!=(u=r()).value&&"arrow"!=u.type&&K();if(i("punc")){switch(o.token.value){case"(":if(p&&!e)break;var d=function(e,t){var n,r,u,l=[];for(f("(");!i("punc",")");)n&&_(n),i("expand","...")?(n=o.token,t&&(r=o.token),a(),l.push(new AST_Expansion({start:s(),expression:Se(),end:o.token}))):l.push(Se()),i("punc",")")||(f(","),i("punc",")")&&(u=s(),t&&(r=u)));return f(")"),e&&i("arrow","=>")?n&&u&&_(u):r&&_(r),l}(t,!p);if(t&&i("arrow","=>"))return k(l,d.map((e=>G(e))),!!p);var S=p?new AST_Call({expression:p,args:d}):1==d.length?d[0]:new AST_Sequence({expressions:d});if(S.start){const e=l.comments_before.length;if(n.set(l,e),S.start.comments_before.unshift(...l.comments_before),l.comments_before=S.start.comments_before,0==e&&l.comments_before.length>0){var m=l.comments_before[0];m.nlb||(m.nlb=l.nlb,l.nlb=!1);}l.comments_after=S.start.comments_after;}S.start=l;var A=s();return S.end&&(A.comments_before=S.end.comments_before,S.end.comments_after.push(...A.comments_after),A.comments_after=S.end.comments_after),S.end=A,S instanceof AST_Call&&ae(S),se(S,e);case"[":return se(W(),e);case"{":return se(Y(),e)}p||_();}if(t&&i("name")&&is_token(r(),"arrow")){var T=new AST_SymbolFunarg({name:o.token.value,start:l,end:l});return a(),k(l,[T],!!p)}if(i("keyword","function")){a();var h=O(AST_Function,!1,!!p);return h.start=l,h.end=s(),se(h,e)}if(p)return se(p,e);if(i("keyword","class")){a();var E=j(AST_ClassExpression);return E.start=l,E.end=s(),se(E,e)}return i("template_head")?se(X(),e):ATOMIC_START_TOKEN.has(o.token.type)?se(K(),e):void _()};function X(){var e=[],t=o.token;for(e.push(new AST_TemplateSegment({start:o.token,raw:LATEST_RAW,value:o.token.value,end:o.token}));!LATEST_TEMPLATE_END;)a(),E(),e.push(Se(!0)),e.push(new AST_TemplateSegment({start:o.token,raw:LATEST_RAW,value:o.token.value,end:o.token}));return a(),new AST_TemplateString({start:t,segments:e,end:o.token})}function z(e,t,n){for(var r=!0,u=[];!i("punc",e)&&(r?r=!1:f(","),!t||!i("punc",e));)i("punc",",")&&n?u.push(new AST_Hole({start:o.token,end:o.token})):i("expand","...")?(a(),u.push(new AST_Expansion({start:s(),expression:Se(),end:o.token}))):u.push(Se(!1));return a(),u}var W=h((function(){return f("["),new AST_Array({elements:z("]",!t.strict,!0)})})),q=h(((e,t)=>O(AST_Accessor,e,t))),Y=h((function(){var e=o.token,n=!0,r=[];for(f("{");!i("punc","}")&&(n?n=!1:f(","),t.strict||!i("punc","}"));)if("expand"!=(e=o.token).type){var u,l=te();if(i("punc",":"))null===l?_(s()):(a(),u=Se(!1));else {var c=$(l,e);if(c){r.push(c);continue}u=new AST_SymbolRef({start:s(),name:l,end:s()});}i("operator","=")&&(a(),u=new AST_Assign({start:e,left:u,operator:"=",right:Se(!1),logical:!1,end:s()})),r.push(new AST_ObjectKeyVal({start:e,quote:e.quote,key:l instanceof AST_Node?l:""+l,value:u,end:s()}));}else a(),r.push(new AST_Expansion({start:e,expression:Se(!1),end:s()}));return a(),new AST_Object({properties:r})}));function j(e){var t,n,r,u,l=[];for(o.input.push_directives_stack(),o.input.add_directive("use strict"),"name"==o.token.type&&"extends"!=o.token.value&&(r=re(e===AST_DefClass?AST_SymbolDefClass:AST_SymbolClass)),e!==AST_DefClass||r||_(),"extends"==o.token.value&&(a(),u=Se(!0)),f("{");i("punc",";");)a();for(;!i("punc","}");)for(t=o.token,(n=$(te(),t,!0))||_(),l.push(n);i("punc",";");)a();return o.input.pop_directives_stack(),a(),new e({start:t,name:r,extends:u,properties:l,end:s()})}function $(e,t,n){var r=function(e,t){return "string"==typeof e||"number"==typeof e?new AST_SymbolMethod({start:t,name:""+e,end:s()}):(null===e&&_(),e)},u="privatename"==t.type,l=!1,c=!1,f=!1,p=t;if(n&&"static"===e&&!i("punc","(")&&(c=!0,u="privatename"==(p=o.token).type,e=te()),"async"!==e||i("punc","(")||i("punc",",")||i("punc","}")||i("operator","=")||(l=!0,u="privatename"==(p=o.token).type,e=te()),null===e&&(f=!0,u="privatename"==(p=o.token).type,null===(e=te())&&_()),i("punc","("))return e=r(e,t),new(u?AST_PrivateMethod:AST_ConciseMethod)({start:t,static:c,is_generator:f,async:l,key:e,quote:e instanceof AST_SymbolMethod?p.quote:void 0,value:q(f,l),end:s()});const d=o.token;if(("get"===e||"set"===e)&&"privatename"===d.type)return a(),new("get"===e?AST_PrivateGetter:AST_PrivateSetter)({start:t,static:c,key:r(d.value,t),value:q(),end:s()});if("get"==e){if(!i("punc")||i("punc","["))return e=r(te(),t),new AST_ObjectGetter({start:t,static:c,key:e,quote:e instanceof AST_SymbolMethod?d.quote:void 0,value:q(),end:s()})}else if("set"==e&&(!i("punc")||i("punc","[")))return e=r(te(),t),new AST_ObjectSetter({start:t,static:c,key:e,quote:e instanceof AST_SymbolMethod?d.quote:void 0,value:q(),end:s()});if(n){const n=(e=>"string"==typeof e||"number"==typeof e?new AST_SymbolClassProperty({start:p,end:p,name:""+e}):(null===e&&_(),e))(e),o=n instanceof AST_SymbolClassProperty?p.quote:void 0,r=u?AST_ClassPrivateProperty:AST_ClassProperty;if(i("operator","="))return a(),new r({start:t,static:c,quote:o,key:n,value:Se(!1),end:s()});if(i("name")||i("privatename")||i("operator","*")||i("punc",";")||i("punc","}"))return new r({start:t,static:c,quote:o,key:n,end:s()})}}function Z(e){function t(e){return new e({name:te(),start:s(),end:s()})}var n,r,u=e?AST_SymbolImportForeign:AST_SymbolExportForeign,l=e?AST_SymbolImport:AST_SymbolExport,_=o.token;return e?n=t(u):r=t(l),i("name","as")?(a(),e?r=t(l):n=t(u)):e?r=new l(n):n=new u(r),new AST_NameMapping({start:_,foreign_name:n,name:r,end:s()})}function Q(e,t){var n,i=e?AST_SymbolImportForeign:AST_SymbolExportForeign,r=e?AST_SymbolImport:AST_SymbolExport,a=o.token,u=s();return t=t||new r({name:"*",start:a,end:u}),n=new i({name:"*",start:a,end:u}),new AST_NameMapping({start:a,foreign_name:n,name:t,end:u})}function J(e){var t;if(i("punc","{")){for(a(),t=[];!i("punc","}");)t.push(Z(e)),i("punc",",")&&a();a();}else if(i("operator","*")){var n;a(),e&&i("name","as")&&(a(),n=re(e?AST_SymbolImport:AST_SymbolExportForeign)),t=[Q(e,n)];}return t}function ee(){var e,t,n,u,l,c=o.token;if(i("keyword","default"))e=!0,a();else if(t=J(!1)){if(i("name","from")){a();var f=o.token;return "string"!==f.type&&_(),a(),new AST_Export({start:c,is_default:e,exported_names:t,module_name:new AST_String({start:f,value:f.value,quote:f.quote,end:f}),end:s()})}return new AST_Export({start:c,is_default:e,exported_names:t,end:s()})}return i("punc","{")||e&&(i("keyword","class")||i("keyword","function"))&&is_token(r(),"punc")?(u=Se(!1),A()):(n=g(e))instanceof AST_Definitions&&e?_(n.start):n instanceof AST_Definitions||n instanceof AST_Lambda||n instanceof AST_DefClass?l=n:n instanceof AST_SimpleStatement?u=n.body:_(n.start),new AST_Export({start:c,is_default:e,exported_value:u,exported_definition:l,end:s()})}function te(){var e=o.token;switch(e.type){case"punc":if("["===e.value){a();var t=Se(!1);return f("]"),t}_(e);case"operator":if("*"===e.value)return a(),null;["delete","in","instanceof","new","typeof","void"].includes(e.value)||_(e);case"name":case"privatename":case"string":case"num":case"big_int":case"keyword":case"atom":return a(),e.value;default:_(e);}}function ne(){var e=o.token;return "name"!=e.type&&"privatename"!=e.type&&_(),a(),e.value}function oe(e){var t=o.token.value;return new("this"==t?AST_This:"super"==t?AST_Super:e)({name:String(t),start:o.token,end:o.token})}function ie(e){var t=e.name;S()&&"yield"==t&&l(e.start,"Yield cannot be used as identifier inside generators"),o.input.has_directive("use strict")&&("yield"==t&&l(e.start,"Unexpected yield identifier inside strict mode"),e instanceof AST_SymbolDeclaration&&("arguments"==t||"eval"==t)&&l(e.start,"Unexpected "+t+" in strict mode"));}function re(e,t){if(!i("name"))return t||u("Name expected"),null;var n=oe(e);return ie(n),a(),n}function ae(e){var t=e.start,o=t.comments_before;const i=n.get(t);for(var r=null!=i?i:o.length;--r>=0;){var a=o[r];if(/[@#]__/.test(a.value)){if(/[@#]__PURE__/.test(a.value)){set_annotation(e,_PURE);break}if(/[@#]__INLINE__/.test(a.value)){set_annotation(e,_INLINE);break}if(/[@#]__NOINLINE__/.test(a.value)){set_annotation(e,_NOINLINE);break}}}}var se=function(e,t,n){var o=e.start;if(i("punc",".")){a();const r=i("privatename")?AST_DotHash:AST_Dot;return se(new r({start:o,expression:e,optional:!1,property:ne(),end:s()}),t,n)}if(i("punc","[")){a();var r=Se(!0);return f("]"),se(new AST_Sub({start:o,expression:e,optional:!1,property:r,end:s()}),t,n)}if(t&&i("punc","(")){a();var u=new AST_Call({start:o,expression:e,optional:!1,args:ue(),end:s()});return ae(u),se(u,!0,n)}if(i("punc","?.")){let n;if(a(),t&&i("punc","(")){a();const t=new AST_Call({start:o,optional:!0,expression:e,args:ue(),end:s()});ae(t),n=se(t,!0,!0);}else if(i("name")||i("privatename")){const r=i("privatename")?AST_DotHash:AST_Dot;n=se(new r({start:o,expression:e,optional:!0,property:ne(),end:s()}),t,!0);}else if(i("punc","[")){a();const i=Se(!0);f("]"),n=se(new AST_Sub({start:o,expression:e,optional:!0,property:i,end:s()}),t,!0);}return n||_(),n instanceof AST_Chain?n:new AST_Chain({start:o,expression:n,end:s()})}return i("template_head")?(n&&_(),se(new AST_PrefixedTemplateString({start:o,prefix:e,template_string:X(),end:s()}),t)):e};function ue(){for(var e=[];!i("punc",")");)i("expand","...")?(a(),e.push(new AST_Expansion({start:s(),expression:Se(!1),end:s()}))):e.push(Se(!1)),i("punc",")")||f(",");return a(),e}var le=function(e,t){var n=o.token;if("name"==n.type&&"await"==n.value&&m())return a(),m()||u("Unexpected await expression outside async function",o.prev.line,o.prev.col,o.prev.pos),new AST_Await({start:s(),end:o.token,expression:le(!0)});if(i("operator")&&UNARY_PREFIX.has(n.value)){a(),E();var r=_e(AST_UnaryPrefix,n,le(e));return r.start=n,r.end=s(),r}for(var l=H(e,t);i("operator")&&UNARY_POSTFIX.has(o.token.value)&&!p(o.token);)l instanceof AST_Arrow&&_(),(l=_e(AST_UnaryPostfix,o.token,l)).start=n,l.end=o.token,a();return l};function _e(e,t,n){var i=t.value;switch(i){case"++":case"--":fe(n)||u("Invalid use of "+i+" operator",t.line,t.col,t.pos);break;case"delete":n instanceof AST_SymbolRef&&o.input.has_directive("use strict")&&u("Calling delete on expression not allowed in strict mode",n.start.line,n.start.col,n.start.pos);}return new e({operator:i,expression:n})}var ce=function(e,t,n){var r=i("operator")?o.token.value:null;"in"==r&&n&&(r=null),"**"==r&&e instanceof AST_UnaryPrefix&&!is_token(e.start,"punc","(")&&"--"!==e.operator&&"++"!==e.operator&&_(e.start);var s=null!=r?PRECEDENCE[r]:null;if(null!=s&&(s>t||"**"===r&&t===s)){a();var u=ce(le(!0),s,n);return ce(new AST_Binary({start:e.start,left:e,operator:r,right:u,end:u.end}),t,n)}return e};function fe(e){return e instanceof AST_PropAccess||e instanceof AST_SymbolRef}function pe(e){if(e instanceof AST_Object)e=new AST_Destructuring({start:e.start,names:e.properties.map(pe),is_array:!1,end:e.end});else if(e instanceof AST_Array){for(var t=[],n=0;n<e.elements.length;n++)e.elements[n]instanceof AST_Expansion&&(n+1!==e.elements.length&&l(e.elements[n].start,"Spread must the be last element in destructuring array"),e.elements[n].expression=pe(e.elements[n].expression)),t.push(pe(e.elements[n]));e=new AST_Destructuring({start:e.start,names:t,is_array:!0,end:e.end});}else e instanceof AST_ObjectProperty?e.value=pe(e.value):e instanceof AST_Assign&&(e=new AST_DefaultAssign({start:e.start,left:e.left,operator:"=",right:e.right,end:e.end}));return e}var de=function(e){E();var t=o.token;if("name"==t.type&&"yield"==t.value){if(S())return a(),function(){S()||u("Unexpected yield expression outside generator function",o.prev.line,o.prev.col,o.prev.pos);var e=o.token,t=!1,n=!0;return d()||i("punc")&&PUNC_AFTER_EXPRESSION.has(o.token.value)?n=!1:i("operator","*")&&(t=!0,a()),new AST_Yield({start:e,is_star:t,expression:n?Se():null,end:s()})}();o.input.has_directive("use strict")&&l(o.token,"Unexpected yield identifier inside strict mode");}var n=function(e){var t=o.token,n=function(e){return ce(le(!0,!0),0,e)}(e);if(i("operator","?")){a();var r=Se(!1);return f(":"),new AST_Conditional({start:t,condition:n,consequent:r,alternative:Se(!1,e),end:s()})}return n}(e),r=o.token.value;if(i("operator")&&ASSIGNMENT.has(r)){if(fe(n)||(n=pe(n))instanceof AST_Destructuring)return a(),new AST_Assign({start:t,left:n,operator:r,right:de(e),logical:LOGICAL_ASSIGNMENT.has(r),end:s()});u("Invalid assignment");}return n},Se=function(e,t){for(var n=o.token,s=[];s.push(de(t)),e&&i("punc",",");)a(),e=!0;return 1==s.length?s[0]:new AST_Sequence({start:n,expressions:s,end:r()})};function me(e){++o.in_loop;var t=e();return --o.in_loop,t}return t.expression?Se(!0):function(){var e=o.token,n=[];for(o.input.push_directives_stack(),t.module&&o.input.add_directive("use strict");!i("eof");)n.push(g());o.input.pop_directives_stack();var r=s(),a=t.toplevel;return a?(a.body=a.body.concat(n),a.end=r):a=new AST_Toplevel({start:e,body:n,end:r}),a}()}function DEFNODE(e,t,n,o=AST_Node){var i=t=t?t.split(/\s+/):[];o&&o.PROPS&&(t=t.concat(o.PROPS));for(var r="return function AST_"+e+"(props){ if (props) { ",a=t.length;--a>=0;)r+="this."+t[a]+" = props."+t[a]+";";const s=o&&Object.create(o.prototype);(s&&s.initialize||n&&n.initialize)&&(r+="this.initialize();"),r+="}",r+="this.flags = 0;",r+="}";var u=new Function(r)();if(s&&(u.prototype=s,u.BASE=o),o&&o.SUBCLASSES.push(u),u.prototype.CTOR=u,u.prototype.constructor=u,u.PROPS=t||null,u.SELF_PROPS=i,u.SUBCLASSES=[],e&&(u.prototype.TYPE=u.TYPE=e),n)for(a in n)HOP(n,a)&&("$"===a[0]?u[a.substr(1)]=n[a]:u.prototype[a]=n[a]);return u.DEFMETHOD=function(e,t){this.prototype[e]=t;},u}const has_tok_flag=(e,t)=>Boolean(e.flags&t),set_tok_flag=(e,t,n)=>{n?e.flags|=t:e.flags&=~t;};class AST_Token{constructor(e,t,n,o,i,r,a,s,u){this.flags=r?1:0,this.type=e,this.value=t,this.line=n,this.col=o,this.pos=i,this.comments_before=a,this.comments_after=s,this.file=u,Object.seal(this);}get nlb(){return has_tok_flag(this,1)}set nlb(e){set_tok_flag(this,1,e);}get quote(){return has_tok_flag(this,4)?has_tok_flag(this,2)?"'":'"':""}set quote(e){set_tok_flag(this,2,"'"===e),set_tok_flag(this,4,!!e);}}var AST_Node=DEFNODE("Node","start end",{_clone:function(e){if(e){var t=this.clone();return t.transform(new TreeTransformer((function(e){if(e!==t)return e.clone(!0)})))}return new this.CTOR(this)},clone:function(e){return this._clone(e)},$documentation:"Base class of all AST nodes",$propdoc:{start:"[AST_Token] The first token of this node",end:"[AST_Token] The last token of this node"},_walk:function(e){return e._visit(this)},walk:function(e){return this._walk(e)},_children_backwards:()=>{}},null),AST_Statement=DEFNODE("Statement",null,{$documentation:"Base class of all statements"}),AST_Debugger=DEFNODE("Debugger",null,{$documentation:"Represents a debugger statement"},AST_Statement),AST_Directive=DEFNODE("Directive","value quote",{$documentation:'Represents a directive, like "use strict";',$propdoc:{value:"[string] The value of this directive as a plain string (it's not an AST_String!)",quote:"[string] the original quote character"}},AST_Statement),AST_SimpleStatement=DEFNODE("SimpleStatement","body",{$documentation:"A statement consisting of an expression, i.e. a = 1 + 2",$propdoc:{body:"[AST_Node] an expression node (should not be instanceof AST_Statement)"},_walk:function(e){return e._visit(this,(function(){this.body._walk(e);}))},_children_backwards(e){e(this.body);}},AST_Statement);function walk_body(e,t){const n=e.body;for(var o=0,i=n.length;o<i;o++)n[o]._walk(t);}function clone_block_scope(e){var t=this._clone(e);return this.block_scope&&(t.block_scope=this.block_scope.clone()),t}var AST_Block=DEFNODE("Block","body block_scope",{$documentation:"A body of statements (usually braced)",$propdoc:{body:"[AST_Statement*] an array of statements",block_scope:"[AST_Scope] the block scope"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);},clone:clone_block_scope},AST_Statement),AST_BlockStatement=DEFNODE("BlockStatement",null,{$documentation:"A block statement"},AST_Block),AST_EmptyStatement=DEFNODE("EmptyStatement",null,{$documentation:"The empty statement (empty block or simply a semicolon)"},AST_Statement),AST_StatementWithBody=DEFNODE("StatementWithBody","body",{$documentation:"Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`",$propdoc:{body:"[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement"}},AST_Statement),AST_LabeledStatement=DEFNODE("LabeledStatement","label",{$documentation:"Statement with a label",$propdoc:{label:"[AST_Label] a label definition"},_walk:function(e){return e._visit(this,(function(){this.label._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.label);},clone:function(e){var t=this._clone(e);if(e){var n=t.label,o=this.label;t.walk(new TreeWalker((function(e){e instanceof AST_LoopControl&&e.label&&e.label.thedef===o&&(e.label.thedef=n,n.references.push(e));})));}return t}},AST_StatementWithBody),AST_IterationStatement=DEFNODE("IterationStatement","block_scope",{$documentation:"Internal class. All loops inherit from it.",$propdoc:{block_scope:"[AST_Scope] the block scope for this iteration statement."},clone:clone_block_scope},AST_StatementWithBody),AST_DWLoop=DEFNODE("DWLoop","condition",{$documentation:"Base class for do/while statements",$propdoc:{condition:"[AST_Node] the loop condition. Should not be instanceof AST_Statement"}},AST_IterationStatement),AST_Do=DEFNODE("Do",null,{$documentation:"A `do` statement",_walk:function(e){return e._visit(this,(function(){this.body._walk(e),this.condition._walk(e);}))},_children_backwards(e){e(this.condition),e(this.body);}},AST_DWLoop),AST_While=DEFNODE("While",null,{$documentation:"A `while` statement",_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.condition);}},AST_DWLoop),AST_For=DEFNODE("For","init condition step",{$documentation:"A `for` statement",$propdoc:{init:"[AST_Node?] the `for` initialization code, or null if empty",condition:"[AST_Node?] the `for` termination clause, or null if empty",step:"[AST_Node?] the `for` update clause, or null if empty"},_walk:function(e){return e._visit(this,(function(){this.init&&this.init._walk(e),this.condition&&this.condition._walk(e),this.step&&this.step._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.step&&e(this.step),this.condition&&e(this.condition),this.init&&e(this.init);}},AST_IterationStatement),AST_ForIn=DEFNODE("ForIn","init object",{$documentation:"A `for ... in` statement",$propdoc:{init:"[AST_Node] the `for/in` initialization code",object:"[AST_Node] the object that we're looping through"},_walk:function(e){return e._visit(this,(function(){this.init._walk(e),this.object._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),this.object&&e(this.object),this.init&&e(this.init);}},AST_IterationStatement),AST_ForOf=DEFNODE("ForOf","await",{$documentation:"A `for ... of` statement"},AST_ForIn),AST_With=DEFNODE("With","expression",{$documentation:"A `with` statement",$propdoc:{expression:"[AST_Node] the `with` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.body._walk(e);}))},_children_backwards(e){e(this.body),e(this.expression);}},AST_StatementWithBody),AST_Scope=DEFNODE("Scope","variables functions uses_with uses_eval parent_scope enclosed cname",{$documentation:"Base class for all statements introducing a lexical scope",$propdoc:{variables:"[Map/S] a map of name -> SymbolDef for all variables/functions defined in this scope",functions:"[Map/S] like `variables`, but only lists function declarations",uses_with:"[boolean/S] tells whether this scope uses the `with` statement",uses_eval:"[boolean/S] tells whether this scope contains a direct call to the global `eval`",parent_scope:"[AST_Scope?/S] link to the parent scope",enclosed:"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes",cname:"[integer/S] current index for mangling variables (used internally by the mangler)"},get_defun_scope:function(){for(var e=this;e.is_block_scope();)e=e.parent_scope;return e},clone:function(e,t){var n=this._clone(e);return e&&this.variables&&t&&!this._block_scope?n.figure_out_scope({},{toplevel:t,parent_scope:this.parent_scope}):(this.variables&&(n.variables=new Map(this.variables)),this.functions&&(n.functions=new Map(this.functions)),this.enclosed&&(n.enclosed=this.enclosed.slice()),this._block_scope&&(n._block_scope=this._block_scope)),n},pinned:function(){return this.uses_eval||this.uses_with}},AST_Block),AST_Toplevel=DEFNODE("Toplevel","globals",{$documentation:"The toplevel scope",$propdoc:{globals:"[Map/S] a map of name -> SymbolDef for all undeclared names"},wrap_commonjs:function(e){var t=this.body,n="(function(exports){'$ORIG';})(typeof "+e+"=='undefined'?("+e+"={}):"+e+");";return (n=parse$5(n)).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(t)})))},wrap_enclose:function(e){"string"!=typeof e&&(e="");var t=e.indexOf(":");t<0&&(t=e.length);var n=this.body;return parse$5(["(function(",e.slice(0,t),'){"$ORIG"})(',e.slice(t+1),")"].join("")).transform(new TreeTransformer((function(e){if(e instanceof AST_Directive&&"$ORIG"==e.value)return MAP.splice(n)})))}},AST_Scope),AST_Expansion=DEFNODE("Expansion","expression",{$documentation:"An expandible argument, such as ...rest, a splat, such as [1,2,...all], or an expansion in a variable declaration, such as var [first, ...rest] = list",$propdoc:{expression:"[AST_Node] the thing to be expanded"},_walk:function(e){return e._visit(this,(function(){this.expression.walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Lambda=DEFNODE("Lambda","name argnames uses_arguments is_generator async",{$documentation:"Base class for functions",$propdoc:{name:"[AST_SymbolDeclaration?] the name of this function",argnames:"[AST_SymbolFunarg|AST_Destructuring|AST_Expansion|AST_DefaultAssign*] array of function arguments, destructurings, or expanding arguments",uses_arguments:"[boolean/S] tells whether this function accesses the arguments array",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},args_as_names:function(){for(var e=[],t=0;t<this.argnames.length;t++)this.argnames[t]instanceof AST_Destructuring?e.push(...this.argnames[t].all_symbols()):e.push(this.argnames[t]);return e},_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e);for(var t=this.argnames,n=0,o=t.length;n<o;n++)t[n]._walk(e);walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);for(t=this.argnames.length;t--;)e(this.argnames[t]);this.name&&e(this.name);},is_braceless(){return this.body[0]instanceof AST_Return&&this.body[0].value}},AST_Scope),AST_Accessor=DEFNODE("Accessor",null,{$documentation:"A setter/getter function. The `name` property is always null."},AST_Lambda),AST_Function=DEFNODE("Function",null,{$documentation:"A function expression"},AST_Lambda),AST_Arrow=DEFNODE("Arrow",null,{$documentation:"An ES6 Arrow function ((a) => b)"},AST_Lambda),AST_Defun=DEFNODE("Defun",null,{$documentation:"A function definition"},AST_Lambda),AST_Destructuring=DEFNODE("Destructuring","names is_array",{$documentation:"A destructuring of several names. Used in destructuring assignment and with destructuring function argument names",$propdoc:{names:"[AST_Node*] Array of properties or elements",is_array:"[Boolean] Whether the destructuring represents an object or array"},_walk:function(e){return e._visit(this,(function(){this.names.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.names.length;for(;t--;)e(this.names[t]);},all_symbols:function(){var e=[];return this.walk(new TreeWalker((function(t){t instanceof AST_Symbol&&e.push(t);}))),e}}),AST_PrefixedTemplateString=DEFNODE("PrefixedTemplateString","template_string prefix",{$documentation:"A templatestring with a prefix, such as String.raw`foobarbaz`",$propdoc:{template_string:"[AST_TemplateString] The template string",prefix:"[AST_Node] The prefix, which will get called."},_walk:function(e){return e._visit(this,(function(){this.prefix._walk(e),this.template_string._walk(e);}))},_children_backwards(e){e(this.template_string),e(this.prefix);}}),AST_TemplateString=DEFNODE("TemplateString","segments",{$documentation:"A template string literal",$propdoc:{segments:"[AST_Node*] One or more segments, starting with AST_TemplateSegment. AST_Node may follow AST_TemplateSegment, but each AST_Node must be followed by AST_TemplateSegment."},_walk:function(e){return e._visit(this,(function(){this.segments.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.segments.length;for(;t--;)e(this.segments[t]);}}),AST_TemplateSegment=DEFNODE("TemplateSegment","value raw",{$documentation:"A segment of a template string literal",$propdoc:{value:"Content of the segment",raw:"Raw source of the segment"}}),AST_Jump=DEFNODE("Jump",null,{$documentation:"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)"},AST_Statement),AST_Exit=DEFNODE("Exit","value",{$documentation:"Base class for “exits” (`return` and `throw`)",$propdoc:{value:"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return"},_walk:function(e){return e._visit(this,this.value&&function(){this.value._walk(e);})},_children_backwards(e){this.value&&e(this.value);}},AST_Jump),AST_Return=DEFNODE("Return",null,{$documentation:"A `return` statement"},AST_Exit),AST_Throw=DEFNODE("Throw",null,{$documentation:"A `throw` statement"},AST_Exit),AST_LoopControl=DEFNODE("LoopControl","label",{$documentation:"Base class for loop control statements (`break` and `continue`)",$propdoc:{label:"[AST_LabelRef?] the label, or null if none"},_walk:function(e){return e._visit(this,this.label&&function(){this.label._walk(e);})},_children_backwards(e){this.label&&e(this.label);}},AST_Jump),AST_Break=DEFNODE("Break",null,{$documentation:"A `break` statement"},AST_LoopControl),AST_Continue=DEFNODE("Continue",null,{$documentation:"A `continue` statement"},AST_LoopControl),AST_Await=DEFNODE("Await","expression",{$documentation:"An `await` statement",$propdoc:{expression:"[AST_Node] the mandatory expression being awaited"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Yield=DEFNODE("Yield","expression is_star",{$documentation:"A `yield` statement",$propdoc:{expression:"[AST_Node?] the value returned or thrown by this statement; could be null (representing undefined) but only when is_star is set to false",is_star:"[Boolean] Whether this is a yield or yield* statement"},_walk:function(e){return e._visit(this,this.expression&&function(){this.expression._walk(e);})},_children_backwards(e){this.expression&&e(this.expression);}}),AST_If=DEFNODE("If","condition alternative",{$documentation:"A `if` statement",$propdoc:{condition:"[AST_Node] the `if` condition",alternative:"[AST_Statement?] the `else` part, or null if not present"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.body._walk(e),this.alternative&&this.alternative._walk(e);}))},_children_backwards(e){this.alternative&&e(this.alternative),e(this.body),e(this.condition);}},AST_StatementWithBody),AST_Switch=DEFNODE("Switch","expression",{$documentation:"A `switch` statement",$propdoc:{expression:"[AST_Node] the `switch` “discriminant”"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_Block),AST_SwitchBranch=DEFNODE("SwitchBranch",null,{$documentation:"Base class for `switch` branches"},AST_Block),AST_Default=DEFNODE("Default",null,{$documentation:"A `default` switch branch"},AST_SwitchBranch),AST_Case=DEFNODE("Case","expression",{$documentation:"A `case` switch branch",$propdoc:{expression:"[AST_Node] the `case` expression"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);e(this.expression);}},AST_SwitchBranch),AST_Try=DEFNODE("Try","bcatch bfinally",{$documentation:"A `try` statement",$propdoc:{bcatch:"[AST_Catch?] the catch block, or null if not present",bfinally:"[AST_Finally?] the finally block, or null if not present"},_walk:function(e){return e._visit(this,(function(){walk_body(this,e),this.bcatch&&this.bcatch._walk(e),this.bfinally&&this.bfinally._walk(e);}))},_children_backwards(e){this.bfinally&&e(this.bfinally),this.bcatch&&e(this.bcatch);let t=this.body.length;for(;t--;)e(this.body[t]);}},AST_Block),AST_Catch=DEFNODE("Catch","argname",{$documentation:"A `catch` node; only makes sense as part of a `try` statement",$propdoc:{argname:"[AST_SymbolCatch|AST_Destructuring|AST_Expansion|AST_DefaultAssign] symbol for the exception"},_walk:function(e){return e._visit(this,(function(){this.argname&&this.argname._walk(e),walk_body(this,e);}))},_children_backwards(e){let t=this.body.length;for(;t--;)e(this.body[t]);this.argname&&e(this.argname);}},AST_Block),AST_Finally=DEFNODE("Finally",null,{$documentation:"A `finally` node; only makes sense as part of a `try` statement"},AST_Block),AST_Definitions=DEFNODE("Definitions","definitions",{$documentation:"Base class for `var` or `const` nodes (variable declarations/initializations)",$propdoc:{definitions:"[AST_VarDef*] array of variable definitions"},_walk:function(e){return e._visit(this,(function(){for(var t=this.definitions,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.definitions.length;for(;t--;)e(this.definitions[t]);}},AST_Statement),AST_Var=DEFNODE("Var",null,{$documentation:"A `var` statement"},AST_Definitions),AST_Let=DEFNODE("Let",null,{$documentation:"A `let` statement"},AST_Definitions),AST_Const=DEFNODE("Const",null,{$documentation:"A `const` statement"},AST_Definitions),AST_VarDef=DEFNODE("VarDef","name value",{$documentation:"A variable declaration; only appears in a AST_Definitions node",$propdoc:{name:"[AST_Destructuring|AST_SymbolConst|AST_SymbolLet|AST_SymbolVar] name of the variable",value:"[AST_Node?] initializer, or null of there's no initializer"},_walk:function(e){return e._visit(this,(function(){this.name._walk(e),this.value&&this.value._walk(e);}))},_children_backwards(e){this.value&&e(this.value),e(this.name);}}),AST_NameMapping=DEFNODE("NameMapping","foreign_name name",{$documentation:"The part of the export/import statement that declare names from a module.",$propdoc:{foreign_name:"[AST_SymbolExportForeign|AST_SymbolImportForeign] The name being exported/imported (as specified in the module)",name:"[AST_SymbolExport|AST_SymbolImport] The name as it is visible to this module."},_walk:function(e){return e._visit(this,(function(){this.foreign_name._walk(e),this.name._walk(e);}))},_children_backwards(e){e(this.name),e(this.foreign_name);}}),AST_Import=DEFNODE("Import","imported_name imported_names module_name",{$documentation:"An `import` statement",$propdoc:{imported_name:"[AST_SymbolImport] The name of the variable holding the module's default export.",imported_names:"[AST_NameMapping*] The names of non-default imported variables",module_name:"[AST_String] String literal describing where this module came from"},_walk:function(e){return e._visit(this,(function(){this.imported_name&&this.imported_name._walk(e),this.imported_names&&this.imported_names.forEach((function(t){t._walk(e);})),this.module_name._walk(e);}))},_children_backwards(e){if(e(this.module_name),this.imported_names){let t=this.imported_names.length;for(;t--;)e(this.imported_names[t]);}this.imported_name&&e(this.imported_name);}}),AST_ImportMeta=DEFNODE("ImportMeta",null,{$documentation:"A reference to import.meta"}),AST_Export=DEFNODE("Export","exported_definition exported_value is_default exported_names module_name",{$documentation:"An `export` statement",$propdoc:{exported_definition:"[AST_Defun|AST_Definitions|AST_DefClass?] An exported definition",exported_value:"[AST_Node?] An exported value",exported_names:"[AST_NameMapping*?] List of exported names",module_name:"[AST_String?] Name of the file to load exports from",is_default:"[Boolean] Whether this is the default exported value of this module"},_walk:function(e){return e._visit(this,(function(){this.exported_definition&&this.exported_definition._walk(e),this.exported_value&&this.exported_value._walk(e),this.exported_names&&this.exported_names.forEach((function(t){t._walk(e);})),this.module_name&&this.module_name._walk(e);}))},_children_backwards(e){if(this.module_name&&e(this.module_name),this.exported_names){let t=this.exported_names.length;for(;t--;)e(this.exported_names[t]);}this.exported_value&&e(this.exported_value),this.exported_definition&&e(this.exported_definition);}},AST_Statement),AST_Call=DEFNODE("Call","expression args optional _annotations",{$documentation:"A function call expression",$propdoc:{expression:"[AST_Node] expression to invoke as function",args:"[AST_Node*] array of arguments",optional:"[boolean] whether this is an optional call (IE ?.() )",_annotations:"[number] bitfield containing information about the call"},initialize(){null==this._annotations&&(this._annotations=0);},_walk(e){return e._visit(this,(function(){for(var t=this.args,n=0,o=t.length;n<o;n++)t[n]._walk(e);this.expression._walk(e);}))},_children_backwards(e){let t=this.args.length;for(;t--;)e(this.args[t]);e(this.expression);}}),AST_New=DEFNODE("New",null,{$documentation:"An object instantiation. Derives from a function call since it has exactly the same properties"},AST_Call),AST_Sequence=DEFNODE("Sequence","expressions",{$documentation:"A sequence expression (comma-separated expressions)",$propdoc:{expressions:"[AST_Node*] array of expressions (at least two)"},_walk:function(e){return e._visit(this,(function(){this.expressions.forEach((function(t){t._walk(e);}));}))},_children_backwards(e){let t=this.expressions.length;for(;t--;)e(this.expressions[t]);}}),AST_PropAccess=DEFNODE("PropAccess","expression property optional",{$documentation:'Base class for property access expressions, i.e. `a.foo` or `a["foo"]`',$propdoc:{expression:"[AST_Node] the “container” expression",property:"[AST_Node|string] the property to access. For AST_Dot & AST_DotHash this is always a plain string, while for AST_Sub it's an arbitrary AST_Node",optional:"[boolean] whether this is an optional property access (IE ?.)"}}),AST_Dot=DEFNODE("Dot","quote",{$documentation:"A dotted property access expression",$propdoc:{quote:"[string] the original quote character when transformed from AST_Sub"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_DotHash=DEFNODE("DotHash","",{$documentation:"A dotted property access to a private property",_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}},AST_PropAccess),AST_Sub=DEFNODE("Sub",null,{$documentation:'Index-style property access, i.e. `a["foo"]`',_walk:function(e){return e._visit(this,(function(){this.expression._walk(e),this.property._walk(e);}))},_children_backwards(e){e(this.property),e(this.expression);}},AST_PropAccess),AST_Chain=DEFNODE("Chain","expression",{$documentation:"A chain expression like a?.b?.(c)?.[d]",$propdoc:{expression:"[AST_Call|AST_Dot|AST_DotHash|AST_Sub] chain element."},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_Unary=DEFNODE("Unary","operator expression",{$documentation:"Base class for unary expressions",$propdoc:{operator:"[string] the operator",expression:"[AST_Node] expression that this unary operator applies to"},_walk:function(e){return e._visit(this,(function(){this.expression._walk(e);}))},_children_backwards(e){e(this.expression);}}),AST_UnaryPrefix=DEFNODE("UnaryPrefix",null,{$documentation:"Unary prefix expression, i.e. `typeof i` or `++i`"},AST_Unary),AST_UnaryPostfix=DEFNODE("UnaryPostfix",null,{$documentation:"Unary postfix expression, i.e. `i++`"},AST_Unary),AST_Binary=DEFNODE("Binary","operator left right",{$documentation:"Binary expression, i.e. `a + b`",$propdoc:{left:"[AST_Node] left-hand side expression",operator:"[string] the operator",right:"[AST_Node] right-hand side expression"},_walk:function(e){return e._visit(this,(function(){this.left._walk(e),this.right._walk(e);}))},_children_backwards(e){e(this.right),e(this.left);}}),AST_Conditional=DEFNODE("Conditional","condition consequent alternative",{$documentation:"Conditional expression using the ternary operator, i.e. `a ? b : c`",$propdoc:{condition:"[AST_Node]",consequent:"[AST_Node]",alternative:"[AST_Node]"},_walk:function(e){return e._visit(this,(function(){this.condition._walk(e),this.consequent._walk(e),this.alternative._walk(e);}))},_children_backwards(e){e(this.alternative),e(this.consequent),e(this.condition);}}),AST_Assign=DEFNODE("Assign","logical",{$documentation:"An assignment expression — `a = b + 5`",$propdoc:{logical:"Whether it's a logical assignment"}},AST_Binary),AST_DefaultAssign=DEFNODE("DefaultAssign",null,{$documentation:"A default assignment expression like in `(a = 3) => a`"},AST_Binary),AST_Array=DEFNODE("Array","elements",{$documentation:"An array literal",$propdoc:{elements:"[AST_Node*] array of elements"},_walk:function(e){return e._visit(this,(function(){for(var t=this.elements,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.elements.length;for(;t--;)e(this.elements[t]);}}),AST_Object=DEFNODE("Object","properties",{$documentation:"An object literal",$propdoc:{properties:"[AST_ObjectProperty*] array of properties"},_walk:function(e){return e._visit(this,(function(){for(var t=this.properties,n=0,o=t.length;n<o;n++)t[n]._walk(e);}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);}}),AST_ObjectProperty=DEFNODE("ObjectProperty","key value",{$documentation:"Base class for literal object properties",$propdoc:{key:"[string|AST_Node] property name. For ObjectKeyVal this is a string. For getters, setters and computed property this is an AST_Node.",value:"[AST_Node] property value. For getters and setters this is an AST_Accessor."},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value._walk(e);}))},_children_backwards(e){e(this.value),this.key instanceof AST_Node&&e(this.key);}}),AST_ObjectKeyVal=DEFNODE("ObjectKeyVal","quote",{$documentation:"A key: value object property",$propdoc:{quote:"[string] the original quote character"},computed_key(){return this.key instanceof AST_Node}},AST_ObjectProperty),AST_PrivateSetter=DEFNODE("PrivateSetter","static",{$propdoc:{static:"[boolean] whether this is a static private setter"},$documentation:"A private setter property",computed_key:()=>!1},AST_ObjectProperty),AST_PrivateGetter=DEFNODE("PrivateGetter","static",{$propdoc:{static:"[boolean] whether this is a static private getter"},$documentation:"A private getter property",computed_key:()=>!1},AST_ObjectProperty),AST_ObjectSetter=DEFNODE("ObjectSetter","quote static",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static setter (classes only)"},$documentation:"An object setter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ObjectGetter=DEFNODE("ObjectGetter","quote static",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] whether this is a static getter (classes only)"},$documentation:"An object getter property",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_ConciseMethod=DEFNODE("ConciseMethod","quote static is_generator async",{$propdoc:{quote:"[string|undefined] the original quote character, if any",static:"[boolean] is this method static (classes only)",is_generator:"[boolean] is this a generator method",async:"[boolean] is this method async"},$documentation:"An ES6 concise method inside an object or class",computed_key(){return !(this.key instanceof AST_SymbolMethod)}},AST_ObjectProperty),AST_PrivateMethod=DEFNODE("PrivateMethod","",{$documentation:"A private class method inside a class"},AST_ConciseMethod),AST_Class=DEFNODE("Class","name extends properties",{$propdoc:{name:"[AST_SymbolClass|AST_SymbolDefClass?] optional class name.",extends:"[AST_Node]? optional parent class",properties:"[AST_ObjectProperty*] array of properties"},$documentation:"An ES6 class",_walk:function(e){return e._visit(this,(function(){this.name&&this.name._walk(e),this.extends&&this.extends._walk(e),this.properties.forEach((t=>t._walk(e)));}))},_children_backwards(e){let t=this.properties.length;for(;t--;)e(this.properties[t]);this.extends&&e(this.extends),this.name&&e(this.name);}},AST_Scope),AST_ClassProperty=DEFNODE("ClassProperty","static quote",{$documentation:"A class property",$propdoc:{static:"[boolean] whether this is a static key",quote:"[string] which quote is being used"},_walk:function(e){return e._visit(this,(function(){this.key instanceof AST_Node&&this.key._walk(e),this.value instanceof AST_Node&&this.value._walk(e);}))},_children_backwards(e){this.value instanceof AST_Node&&e(this.value),this.key instanceof AST_Node&&e(this.key);},computed_key(){return !(this.key instanceof AST_SymbolClassProperty)}},AST_ObjectProperty),AST_ClassPrivateProperty=DEFNODE("ClassProperty","",{$documentation:"A class property for a private property"},AST_ClassProperty),AST_DefClass=DEFNODE("DefClass",null,{$documentation:"A class definition"},AST_Class),AST_ClassExpression=DEFNODE("ClassExpression",null,{$documentation:"A class expression."},AST_Class),AST_Symbol=DEFNODE("Symbol","scope name thedef",{$propdoc:{name:"[string] name of this symbol",scope:"[AST_Scope/S] the current scope (not necessarily the definition scope)",thedef:"[SymbolDef/S] the definition of this symbol"},$documentation:"Base class for all symbols"}),AST_NewTarget=DEFNODE("NewTarget",null,{$documentation:"A reference to new.target"}),AST_SymbolDeclaration=DEFNODE("SymbolDeclaration","init",{$documentation:"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)"},AST_Symbol),AST_SymbolVar=DEFNODE("SymbolVar",null,{$documentation:"Symbol defining a variable"},AST_SymbolDeclaration),AST_SymbolBlockDeclaration=DEFNODE("SymbolBlockDeclaration",null,{$documentation:"Base class for block-scoped declaration symbols"},AST_SymbolDeclaration),AST_SymbolConst=DEFNODE("SymbolConst",null,{$documentation:"A constant declaration"},AST_SymbolBlockDeclaration),AST_SymbolLet=DEFNODE("SymbolLet",null,{$documentation:"A block-scoped `let` declaration"},AST_SymbolBlockDeclaration),AST_SymbolFunarg=DEFNODE("SymbolFunarg",null,{$documentation:"Symbol naming a function argument"},AST_SymbolVar),AST_SymbolDefun=DEFNODE("SymbolDefun",null,{$documentation:"Symbol defining a function"},AST_SymbolDeclaration),AST_SymbolMethod=DEFNODE("SymbolMethod",null,{$documentation:"Symbol in an object defining a method"},AST_Symbol),AST_SymbolClassProperty=DEFNODE("SymbolClassProperty",null,{$documentation:"Symbol for a class property"},AST_Symbol),AST_SymbolLambda=DEFNODE("SymbolLambda",null,{$documentation:"Symbol naming a function expression"},AST_SymbolDeclaration),AST_SymbolDefClass=DEFNODE("SymbolDefClass",null,{$documentation:"Symbol naming a class's name in a class declaration. Lexically scoped to its containing scope, and accessible within the class."},AST_SymbolBlockDeclaration),AST_SymbolClass=DEFNODE("SymbolClass",null,{$documentation:"Symbol naming a class's name. Lexically scoped to the class."},AST_SymbolDeclaration),AST_SymbolCatch=DEFNODE("SymbolCatch",null,{$documentation:"Symbol naming the exception in catch"},AST_SymbolBlockDeclaration),AST_SymbolImport=DEFNODE("SymbolImport",null,{$documentation:"Symbol referring to an imported name"},AST_SymbolBlockDeclaration),AST_SymbolImportForeign=DEFNODE("SymbolImportForeign",null,{$documentation:"A symbol imported from a module, but it is defined in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_Label=DEFNODE("Label","references",{$documentation:"Symbol naming a label (declaration)",$propdoc:{references:"[AST_LoopControl*] a list of nodes referring to this label"},initialize:function(){this.references=[],this.thedef=this;}},AST_Symbol),AST_SymbolRef=DEFNODE("SymbolRef",null,{$documentation:"Reference to some symbol (not definition/declaration)"},AST_Symbol),AST_SymbolExport=DEFNODE("SymbolExport",null,{$documentation:"Symbol referring to a name to export"},AST_SymbolRef),AST_SymbolExportForeign=DEFNODE("SymbolExportForeign",null,{$documentation:"A symbol exported from this module, but it is used in the other module, and its real name is irrelevant for this module's purposes"},AST_Symbol),AST_LabelRef=DEFNODE("LabelRef",null,{$documentation:"Reference to a label symbol"},AST_Symbol),AST_This=DEFNODE("This",null,{$documentation:"The `this` symbol"},AST_Symbol),AST_Super=DEFNODE("Super",null,{$documentation:"The `super` symbol"},AST_This),AST_Constant=DEFNODE("Constant",null,{$documentation:"Base class for all constants",getValue:function(){return this.value}}),AST_String=DEFNODE("String","value quote",{$documentation:"A string literal",$propdoc:{value:"[string] the contents of this string",quote:"[string] the original quote character"}},AST_Constant),AST_Number=DEFNODE("Number","value raw",{$documentation:"A number literal",$propdoc:{value:"[number] the numeric value",raw:"[string] numeric value as string"}},AST_Constant),AST_BigInt=DEFNODE("BigInt","value",{$documentation:"A big int literal",$propdoc:{value:"[string] big int value"}},AST_Constant),AST_RegExp=DEFNODE("RegExp","value",{$documentation:"A regexp literal",$propdoc:{value:"[RegExp] the actual regexp"}},AST_Constant),AST_Atom=DEFNODE("Atom",null,{$documentation:"Base class for atoms"},AST_Constant),AST_Null=DEFNODE("Null",null,{$documentation:"The `null` atom",value:null},AST_Atom),AST_NaN=DEFNODE("NaN",null,{$documentation:"The impossible value",value:NaN},AST_Atom),AST_Undefined=DEFNODE("Undefined",null,{$documentation:"The `undefined` value",value:void 0},AST_Atom),AST_Hole=DEFNODE("Hole",null,{$documentation:"A hole in an array",value:void 0},AST_Atom),AST_Infinity=DEFNODE("Infinity",null,{$documentation:"The `Infinity` value",value:1/0},AST_Atom),AST_Boolean=DEFNODE("Boolean",null,{$documentation:"Base class for booleans"},AST_Atom),AST_False=DEFNODE("False",null,{$documentation:"The `false` atom",value:!1},AST_Boolean),AST_True=DEFNODE("True",null,{$documentation:"The `true` atom",value:!0},AST_Boolean);function walk$3(e,t,n=[e]){const o=n.push.bind(n);for(;n.length;){const e=n.pop(),i=t(e,n);if(i){if(i===walk_abort)return !0}else e._children_backwards(o);}return !1}function walk_parent(e,t,n){const o=[e],i=o.push.bind(o),r=n?n.slice():[],a=[];let s;const u={parent:(e=0)=>-1===e?s:n&&e>=r.length?(e-=r.length,n[n.length-(e+1)]):r[r.length-(1+e)]};for(;o.length;){for(s=o.pop();a.length&&o.length==a[a.length-1];)r.pop(),a.pop();const e=t(s,u);if(e){if(e===walk_abort)return !0;continue}const n=o.length;s._children_backwards(i),o.length>n&&(r.push(s),a.push(n-1));}return !1}const walk_abort=Symbol("abort walk");class TreeWalker{constructor(e){this.visit=e,this.stack=[],this.directives=Object.create(null);}_visit(e,t){this.push(e);var n=this.visit(e,t?function(){t.call(e);}:noop);return !n&&t&&t.call(e),this.pop(),n}parent(e){return this.stack[this.stack.length-2-(e||0)]}push(e){e instanceof AST_Lambda?this.directives=Object.create(this.directives):e instanceof AST_Directive&&!this.directives[e.value]?this.directives[e.value]=e:e instanceof AST_Class&&(this.directives=Object.create(this.directives),this.directives["use strict"]||(this.directives["use strict"]=e)),this.stack.push(e);}pop(){var e=this.stack.pop();(e instanceof AST_Lambda||e instanceof AST_Class)&&(this.directives=Object.getPrototypeOf(this.directives));}self(){return this.stack[this.stack.length-1]}find_parent(e){for(var t=this.stack,n=t.length;--n>=0;){var o=t[n];if(o instanceof e)return o}}has_directive(e){var t=this.directives[e];if(t)return t;var n=this.stack[this.stack.length-1];if(n instanceof AST_Scope&&n.body)for(var o=0;o<n.body.length;++o){var i=n.body[o];if(!(i instanceof AST_Directive))break;if(i.value==e)return i}}loopcontrol_target(e){var t=this.stack;if(e.label){for(var n=t.length;--n>=0;)if((o=t[n])instanceof AST_LabeledStatement&&o.label.name==e.label.name)return o.body}else for(n=t.length;--n>=0;){var o;if((o=t[n])instanceof AST_IterationStatement||e instanceof AST_Break&&o instanceof AST_Switch)return o}}}class TreeTransformer extends TreeWalker{constructor(e,t){super(),this.before=e,this.after=t;}}const _PURE=1,_INLINE=2,_NOINLINE=4,ast=Object.freeze({__proto__:null,AST_Accessor,AST_Array,AST_Arrow,AST_Assign,AST_Atom,AST_Await,AST_BigInt,AST_Binary,AST_Block,AST_BlockStatement,AST_Boolean,AST_Break,AST_Call,AST_Case,AST_Catch,AST_Chain,AST_Class,AST_ClassExpression,AST_ClassPrivateProperty,AST_ClassProperty,AST_ConciseMethod,AST_Conditional,AST_Const,AST_Constant,AST_Continue,AST_Debugger,AST_Default,AST_DefaultAssign,AST_DefClass,AST_Definitions,AST_Defun,AST_Destructuring,AST_Directive,AST_Do,AST_Dot,AST_DotHash,AST_DWLoop,AST_EmptyStatement,AST_Exit,AST_Expansion,AST_Export,AST_False,AST_Finally,AST_For,AST_ForIn,AST_ForOf,AST_Function,AST_Hole,AST_If,AST_Import,AST_ImportMeta,AST_Infinity,AST_IterationStatement,AST_Jump,AST_Label,AST_LabeledStatement,AST_LabelRef,AST_Lambda,AST_Let,AST_LoopControl,AST_NameMapping,AST_NaN,AST_New,AST_NewTarget,AST_Node,AST_Null,AST_Number,AST_Object,AST_ObjectGetter,AST_ObjectKeyVal,AST_ObjectProperty,AST_ObjectSetter,AST_PrefixedTemplateString,AST_PrivateGetter,AST_PrivateMethod,AST_PrivateSetter,AST_PropAccess,AST_RegExp,AST_Return,AST_Scope,AST_Sequence,AST_SimpleStatement,AST_Statement,AST_StatementWithBody,AST_String,AST_Sub,AST_Super,AST_Switch,AST_SwitchBranch,AST_Symbol,AST_SymbolBlockDeclaration,AST_SymbolCatch,AST_SymbolClass,AST_SymbolClassProperty,AST_SymbolConst,AST_SymbolDeclaration,AST_SymbolDefClass,AST_SymbolDefun,AST_SymbolExport,AST_SymbolExportForeign,AST_SymbolFunarg,AST_SymbolImport,AST_SymbolImportForeign,AST_SymbolLambda,AST_SymbolLet,AST_SymbolMethod,AST_SymbolRef,AST_SymbolVar,AST_TemplateSegment,AST_TemplateString,AST_This,AST_Throw,AST_Token,AST_Toplevel,AST_True,AST_Try,AST_Unary,AST_UnaryPostfix,AST_UnaryPrefix,AST_Undefined,AST_Var,AST_VarDef,AST_While,AST_With,AST_Yield,TreeTransformer,TreeWalker,walk: walk$3,walk_abort,walk_body,walk_parent,_INLINE,_NOINLINE,_PURE});function def_transform(e,t){e.DEFMETHOD("transform",(function(e,n){let o;if(e.push(this),e.before&&(o=e.before(this,t,n)),void 0===o&&(o=this,t(o,e),e.after)){const t=e.after(o,n);void 0!==t&&(o=t);}return e.pop(),o}));}function do_list(e,t){return MAP(e,(function(e){return e.transform(t,!0)}))}function first_in_statement(e){let t=e.parent(-1);for(let n,o=0;n=e.parent(o);o++){if(n instanceof AST_Statement&&n.body===t)return !0;if(!(n instanceof AST_Sequence&&n.expressions[0]===t||"Call"===n.TYPE&&n.expression===t||n instanceof AST_PrefixedTemplateString&&n.prefix===t||n instanceof AST_Dot&&n.expression===t||n instanceof AST_Sub&&n.expression===t||n instanceof AST_Conditional&&n.condition===t||n instanceof AST_Binary&&n.left===t||n instanceof AST_UnaryPostfix&&n.expression===t))return !1;t=n;}}function left_is_object(e){return e instanceof AST_Object||(e instanceof AST_Sequence?left_is_object(e.expressions[0]):"Call"===e.TYPE?left_is_object(e.expression):e instanceof AST_PrefixedTemplateString?left_is_object(e.prefix):e instanceof AST_Dot||e instanceof AST_Sub?left_is_object(e.expression):e instanceof AST_Conditional?left_is_object(e.condition):e instanceof AST_Binary?left_is_object(e.left):e instanceof AST_UnaryPostfix&&left_is_object(e.expression))}def_transform(AST_Node,noop),def_transform(AST_LabeledStatement,(function(e,t){e.label=e.label.transform(t),e.body=e.body.transform(t);})),def_transform(AST_SimpleStatement,(function(e,t){e.body=e.body.transform(t);})),def_transform(AST_Block,(function(e,t){e.body=do_list(e.body,t);})),def_transform(AST_Do,(function(e,t){e.body=e.body.transform(t),e.condition=e.condition.transform(t);})),def_transform(AST_While,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t);})),def_transform(AST_For,(function(e,t){e.init&&(e.init=e.init.transform(t)),e.condition&&(e.condition=e.condition.transform(t)),e.step&&(e.step=e.step.transform(t)),e.body=e.body.transform(t);})),def_transform(AST_ForIn,(function(e,t){e.init=e.init.transform(t),e.object=e.object.transform(t),e.body=e.body.transform(t);})),def_transform(AST_With,(function(e,t){e.expression=e.expression.transform(t),e.body=e.body.transform(t);})),def_transform(AST_Exit,(function(e,t){e.value&&(e.value=e.value.transform(t));})),def_transform(AST_LoopControl,(function(e,t){e.label&&(e.label=e.label.transform(t));})),def_transform(AST_If,(function(e,t){e.condition=e.condition.transform(t),e.body=e.body.transform(t),e.alternative&&(e.alternative=e.alternative.transform(t));})),def_transform(AST_Switch,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Case,(function(e,t){e.expression=e.expression.transform(t),e.body=do_list(e.body,t);})),def_transform(AST_Try,(function(e,t){e.body=do_list(e.body,t),e.bcatch&&(e.bcatch=e.bcatch.transform(t)),e.bfinally&&(e.bfinally=e.bfinally.transform(t));})),def_transform(AST_Catch,(function(e,t){e.argname&&(e.argname=e.argname.transform(t)),e.body=do_list(e.body,t);})),def_transform(AST_Definitions,(function(e,t){e.definitions=do_list(e.definitions,t);})),def_transform(AST_VarDef,(function(e,t){e.name=e.name.transform(t),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Destructuring,(function(e,t){e.names=do_list(e.names,t);})),def_transform(AST_Lambda,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.argnames=do_list(e.argnames,t),e.body instanceof AST_Node?e.body=e.body.transform(t):e.body=do_list(e.body,t);})),def_transform(AST_Call,(function(e,t){e.expression=e.expression.transform(t),e.args=do_list(e.args,t);})),def_transform(AST_Sequence,(function(e,t){const n=do_list(e.expressions,t);e.expressions=n.length?n:[new AST_Number({value:0})];})),def_transform(AST_Dot,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Sub,(function(e,t){e.expression=e.expression.transform(t),e.property=e.property.transform(t);})),def_transform(AST_Chain,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Yield,(function(e,t){e.expression&&(e.expression=e.expression.transform(t));})),def_transform(AST_Await,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Unary,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_Binary,(function(e,t){e.left=e.left.transform(t),e.right=e.right.transform(t);})),def_transform(AST_Conditional,(function(e,t){e.condition=e.condition.transform(t),e.consequent=e.consequent.transform(t),e.alternative=e.alternative.transform(t);})),def_transform(AST_Array,(function(e,t){e.elements=do_list(e.elements,t);})),def_transform(AST_Object,(function(e,t){e.properties=do_list(e.properties,t);})),def_transform(AST_ObjectProperty,(function(e,t){e.key instanceof AST_Node&&(e.key=e.key.transform(t)),e.value&&(e.value=e.value.transform(t));})),def_transform(AST_Class,(function(e,t){e.name&&(e.name=e.name.transform(t)),e.extends&&(e.extends=e.extends.transform(t)),e.properties=do_list(e.properties,t);})),def_transform(AST_Expansion,(function(e,t){e.expression=e.expression.transform(t);})),def_transform(AST_NameMapping,(function(e,t){e.foreign_name=e.foreign_name.transform(t),e.name=e.name.transform(t);})),def_transform(AST_Import,(function(e,t){e.imported_name&&(e.imported_name=e.imported_name.transform(t)),e.imported_names&&do_list(e.imported_names,t),e.module_name=e.module_name.transform(t);})),def_transform(AST_Export,(function(e,t){e.exported_definition&&(e.exported_definition=e.exported_definition.transform(t)),e.exported_value&&(e.exported_value=e.exported_value.transform(t)),e.exported_names&&do_list(e.exported_names,t),e.module_name&&(e.module_name=e.module_name.transform(t));})),def_transform(AST_TemplateString,(function(e,t){e.segments=do_list(e.segments,t);})),def_transform(AST_PrefixedTemplateString,(function(e,t){e.prefix=e.prefix.transform(t),e.template_string=e.template_string.transform(t);})),function(){var e=function(e){for(var t=!0,n=0;n<e.length;n++)t&&e[n]instanceof AST_Statement&&e[n].body instanceof AST_String?e[n]=new AST_Directive({start:e[n].start,end:e[n].end,value:e[n].body.value}):!t||e[n]instanceof AST_Statement&&e[n].body instanceof AST_String||(t=!1);return e},t={Program:function(t){return new AST_Toplevel({start:n(t),end:o(t),body:e(t.body.map(a))})},ArrayPattern:function(e){return new AST_Destructuring({start:n(e),end:o(e),names:e.elements.map((function(e){return null===e?new AST_Hole:a(e)})),is_array:!0})},ObjectPattern:function(e){return new AST_Destructuring({start:n(e),end:o(e),names:e.properties.map(a),is_array:!1})},AssignmentPattern:function(e){return new AST_DefaultAssign({start:n(e),end:o(e),left:a(e.left),operator:"=",right:a(e.right)})},SpreadElement:function(e){return new AST_Expansion({start:n(e),end:o(e),expression:a(e.argument)})},RestElement:function(e){return new AST_Expansion({start:n(e),end:o(e),expression:a(e.argument)})},TemplateElement:function(e){return new AST_TemplateSegment({start:n(e),end:o(e),value:e.value.cooked,raw:e.value.raw})},TemplateLiteral:function(e){for(var t=[],i=0;i<e.quasis.length;i++)t.push(a(e.quasis[i])),e.expressions[i]&&t.push(a(e.expressions[i]));return new AST_TemplateString({start:n(e),end:o(e),segments:t})},TaggedTemplateExpression:function(e){return new AST_PrefixedTemplateString({start:n(e),end:o(e),template_string:a(e.quasi),prefix:a(e.tag)})},FunctionDeclaration:function(t){return new AST_Defun({start:n(t),end:o(t),name:a(t.id),argnames:t.params.map(a),is_generator:t.generator,async:t.async,body:e(a(t.body).body)})},FunctionExpression:function(t){return new AST_Function({start:n(t),end:o(t),name:a(t.id),argnames:t.params.map(a),is_generator:t.generator,async:t.async,body:e(a(t.body).body)})},ArrowFunctionExpression:function(e){const t="BlockStatement"===e.body.type?a(e.body).body:[make_node(AST_Return,{},{value:a(e.body)})];return new AST_Arrow({start:n(e),end:o(e),argnames:e.params.map(a),body:t,async:e.async})},ExpressionStatement:function(e){return new AST_SimpleStatement({start:n(e),end:o(e),body:a(e.expression)})},TryStatement:function(e){var t=e.handlers||[e.handler];if(t.length>1||e.guardedHandlers&&e.guardedHandlers.length)throw new Error("Multiple catch clauses are not supported.");return new AST_Try({start:n(e),end:o(e),body:a(e.block).body,bcatch:a(t[0]),bfinally:e.finalizer?new AST_Finally(a(e.finalizer)):null})},Property:function(e){var t=e.key,i={start:n(t||e.value),end:o(e.value),key:"Identifier"==t.type?t.name:t.value,value:a(e.value)};return e.computed&&(i.key=a(e.key)),e.method?(i.is_generator=e.value.generator,i.async=e.value.async,e.computed?i.key=a(e.key):i.key=new AST_SymbolMethod({name:i.key}),new AST_ConciseMethod(i)):"init"==e.kind?("Identifier"!=t.type&&"Literal"!=t.type&&(i.key=a(t)),new AST_ObjectKeyVal(i)):("string"!=typeof i.key&&"number"!=typeof i.key||(i.key=new AST_SymbolMethod({name:i.key})),i.value=new AST_Accessor(i.value),"get"==e.kind?new AST_ObjectGetter(i):"set"==e.kind?new AST_ObjectSetter(i):"method"==e.kind?(i.async=e.value.async,i.is_generator=e.value.generator,i.quote=e.computed?'"':null,new AST_ConciseMethod(i)):void 0)},MethodDefinition:function(e){var t={start:n(e),end:o(e),key:e.computed?a(e.key):new AST_SymbolMethod({name:e.key.name||e.key.value}),value:a(e.value),static:e.static};return "get"==e.kind?new AST_ObjectGetter(t):"set"==e.kind?new AST_ObjectSetter(t):(t.is_generator=e.value.generator,t.async=e.value.async,new AST_ConciseMethod(t))},FieldDefinition:function(e){let t;if(e.computed)t=a(e.key);else {if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in FieldDefinition");t=a(e.key);}return new AST_ClassProperty({start:n(e),end:o(e),key:t,value:a(e.value),static:e.static})},PropertyDefinition:function(e){let t;if(e.computed)t=a(e.key);else {if("Identifier"!==e.key.type)throw new Error("Non-Identifier key in PropertyDefinition");t=a(e.key);}return new AST_ClassProperty({start:n(e),end:o(e),key:t,value:a(e.value),static:e.static})},ArrayExpression:function(e){return new AST_Array({start:n(e),end:o(e),elements:e.elements.map((function(e){return null===e?new AST_Hole:a(e)}))})},ObjectExpression:function(e){return new AST_Object({start:n(e),end:o(e),properties:e.properties.map((function(e){return "SpreadElement"===e.type||(e.type="Property"),a(e)}))})},SequenceExpression:function(e){return new AST_Sequence({start:n(e),end:o(e),expressions:e.expressions.map(a)})},MemberExpression:function(e){return new(e.computed?AST_Sub:AST_Dot)({start:n(e),end:o(e),property:e.computed?a(e.property):e.property.name,expression:a(e.object),optional:e.optional||!1})},ChainExpression:function(e){return new AST_Chain({start:n(e),end:o(e),expression:a(e.expression)})},SwitchCase:function(e){return new(e.test?AST_Case:AST_Default)({start:n(e),end:o(e),expression:a(e.test),body:e.consequent.map(a)})},VariableDeclaration:function(e){return new("const"===e.kind?AST_Const:"let"===e.kind?AST_Let:AST_Var)({start:n(e),end:o(e),definitions:e.declarations.map(a)})},ImportDeclaration:function(e){var t=null,i=null;return e.specifiers.forEach((function(e){"ImportSpecifier"===e.type?(i||(i=[]),i.push(new AST_NameMapping({start:n(e),end:o(e),foreign_name:a(e.imported),name:a(e.local)}))):"ImportDefaultSpecifier"===e.type?t=a(e.local):"ImportNamespaceSpecifier"===e.type&&(i||(i=[]),i.push(new AST_NameMapping({start:n(e),end:o(e),foreign_name:new AST_SymbolImportForeign({name:"*"}),name:a(e.local)})));})),new AST_Import({start:n(e),end:o(e),imported_name:t,imported_names:i,module_name:a(e.source)})},ExportAllDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_names:[new AST_NameMapping({name:new AST_SymbolExportForeign({name:"*"}),foreign_name:new AST_SymbolExportForeign({name:"*"})})],module_name:a(e.source)})},ExportNamedDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_definition:a(e.declaration),exported_names:e.specifiers&&e.specifiers.length?e.specifiers.map((function(e){return new AST_NameMapping({foreign_name:a(e.exported),name:a(e.local)})})):null,module_name:a(e.source)})},ExportDefaultDeclaration:function(e){return new AST_Export({start:n(e),end:o(e),exported_value:a(e.declaration),is_default:!0})},Literal:function(e){var t=e.value,i={start:n(e),end:o(e)},r=e.regex;if(r&&r.pattern)return i.value={source:r.pattern,flags:r.flags},new AST_RegExp(i);if(r){const n=e.raw||t,o=n.match(/^\/(.*)\/(\w*)$/);if(!o)throw new Error("Invalid regex source "+n);const[r,a,s]=o;return i.value={source:a,flags:s},new AST_RegExp(i)}if(null===t)return new AST_Null(i);switch(typeof t){case"string":return i.value=t,new AST_String(i);case"number":return i.value=t,i.raw=e.raw||t.toString(),new AST_Number(i);case"boolean":return new(t?AST_True:AST_False)(i)}},MetaProperty:function(e){return "new"===e.meta.name&&"target"===e.property.name?new AST_NewTarget({start:n(e),end:o(e)}):"import"===e.meta.name&&"meta"===e.property.name?new AST_ImportMeta({start:n(e),end:o(e)}):void 0},Identifier:function(e){var t=r[r.length-2];return new("LabeledStatement"==t.type?AST_Label:"VariableDeclarator"==t.type&&t.id===e?"const"==t.kind?AST_SymbolConst:"let"==t.kind?AST_SymbolLet:AST_SymbolVar:/Import.*Specifier/.test(t.type)?t.local===e?AST_SymbolImport:AST_SymbolImportForeign:"ExportSpecifier"==t.type?t.local===e?AST_SymbolExport:AST_SymbolExportForeign:"FunctionExpression"==t.type?t.id===e?AST_SymbolLambda:AST_SymbolFunarg:"FunctionDeclaration"==t.type?t.id===e?AST_SymbolDefun:AST_SymbolFunarg:"ArrowFunctionExpression"==t.type?t.params.includes(e)?AST_SymbolFunarg:AST_SymbolRef:"ClassExpression"==t.type?t.id===e?AST_SymbolClass:AST_SymbolRef:"Property"==t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolMethod:"PropertyDefinition"==t.type||"FieldDefinition"===t.type?t.key===e&&t.computed||t.value===e?AST_SymbolRef:AST_SymbolClassProperty:"ClassDeclaration"==t.type?t.id===e?AST_SymbolDefClass:AST_SymbolRef:"MethodDefinition"==t.type?t.computed?AST_SymbolRef:AST_SymbolMethod:"CatchClause"==t.type?AST_SymbolCatch:"BreakStatement"==t.type||"ContinueStatement"==t.type?AST_LabelRef:AST_SymbolRef)({start:n(e),end:o(e),name:e.name})},BigIntLiteral:e=>new AST_BigInt({start:n(e),end:o(e),value:e.value})};function n(e){var t=e.loc,n=t&&t.start,o=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,o?o[0]:e.start,!1,[],[],t&&t.source)}function o(e){var t=e.loc,n=t&&t.end,o=e.range;return new AST_Token("","",n&&n.line||0,n&&n.column||0,o?o[0]:e.end,!1,[],[],t&&t.source)}function i(e,i,r){var u="function From_Moz_"+e+"(M){\n";u+="return new U2."+i.name+"({\nstart: my_start_token(M),\nend: my_end_token(M)";var _="function To_Moz_"+e+"(M){\n";_+="return {\ntype: "+JSON.stringify(e),r&&r.split(/\s*,\s*/).forEach((function(e){var t=/([a-z0-9$_]+)([=@>%])([a-z0-9$_]+)/i.exec(e);if(!t)throw new Error("Can't understand property map: "+e);var n=t[1],o=t[2],i=t[3];switch(u+=",\n"+i+": ",_+=",\n"+n+": ",o){case"@":u+="M."+n+".map(from_moz)",_+="M."+i+".map(to_moz)";break;case">":u+="from_moz(M."+n+")",_+="to_moz(M."+i+")";break;case"=":u+="M."+n,_+="M."+i;break;case"%":u+="from_moz(M."+n+").body",_+="to_moz_block(M)";break;default:throw new Error("Can't understand operator in propmap: "+e)}})),u+="\n})\n}",_+="\n}\n}",u=new Function("U2","my_start_token","my_end_token","from_moz","return("+u+")")(ast,n,o,a),_=new Function("to_moz","to_moz_block","to_moz_scope","return("+_+")")(l,c,f),t[e]=u,s(i,_);}t.UpdateExpression=t.UnaryExpression=function(e){return new(("prefix"in e?e.prefix:"UnaryExpression"==e.type)?AST_UnaryPrefix:AST_UnaryPostfix)({start:n(e),end:o(e),operator:e.operator,expression:a(e.argument)})},t.ClassDeclaration=t.ClassExpression=function(e){return new("ClassDeclaration"===e.type?AST_DefClass:AST_ClassExpression)({start:n(e),end:o(e),name:a(e.id),extends:a(e.superClass),properties:e.body.body.map(a)})},i("EmptyStatement",AST_EmptyStatement),i("BlockStatement",AST_BlockStatement,"body@body"),i("IfStatement",AST_If,"test>condition, consequent>body, alternate>alternative"),i("LabeledStatement",AST_LabeledStatement,"label>label, body>body"),i("BreakStatement",AST_Break,"label>label"),i("ContinueStatement",AST_Continue,"label>label"),i("WithStatement",AST_With,"object>expression, body>body"),i("SwitchStatement",AST_Switch,"discriminant>expression, cases@body"),i("ReturnStatement",AST_Return,"argument>value"),i("ThrowStatement",AST_Throw,"argument>value"),i("WhileStatement",AST_While,"test>condition, body>body"),i("DoWhileStatement",AST_Do,"test>condition, body>body"),i("ForStatement",AST_For,"init>init, test>condition, update>step, body>body"),i("ForInStatement",AST_ForIn,"left>init, right>object, body>body"),i("ForOfStatement",AST_ForOf,"left>init, right>object, body>body, await=await"),i("AwaitExpression",AST_Await,"argument>expression"),i("YieldExpression",AST_Yield,"argument>expression, delegate=is_star"),i("DebuggerStatement",AST_Debugger),i("VariableDeclarator",AST_VarDef,"id>name, init>value"),i("CatchClause",AST_Catch,"param>argname, body%body"),i("ThisExpression",AST_This),i("Super",AST_Super),i("BinaryExpression",AST_Binary,"operator=operator, left>left, right>right"),i("LogicalExpression",AST_Binary,"operator=operator, left>left, right>right"),i("AssignmentExpression",AST_Assign,"operator=operator, left>left, right>right"),i("ConditionalExpression",AST_Conditional,"test>condition, consequent>consequent, alternate>alternative"),i("NewExpression",AST_New,"callee>expression, arguments@args"),i("CallExpression",AST_Call,"callee>expression, optional=optional, arguments@args"),s(AST_Toplevel,(function(e){return f("Program",e)})),s(AST_Expansion,(function(e){return {type:_()?"RestElement":"SpreadElement",argument:l(e.expression)}})),s(AST_PrefixedTemplateString,(function(e){return {type:"TaggedTemplateExpression",tag:l(e.prefix),quasi:l(e.template_string)}})),s(AST_TemplateString,(function(e){for(var t=[],n=[],o=0;o<e.segments.length;o++)o%2!=0?n.push(l(e.segments[o])):t.push({type:"TemplateElement",value:{raw:e.segments[o].raw,cooked:e.segments[o].value},tail:o===e.segments.length-1});return {type:"TemplateLiteral",quasis:t,expressions:n}})),s(AST_Defun,(function(e){return {type:"FunctionDeclaration",id:l(e.name),params:e.argnames.map(l),generator:e.is_generator,async:e.async,body:f("BlockStatement",e)}})),s(AST_Function,(function(e,t){var n=void 0!==t.is_generator?t.is_generator:e.is_generator;return {type:"FunctionExpression",id:l(e.name),params:e.argnames.map(l),generator:n,async:e.async,body:f("BlockStatement",e)}})),s(AST_Arrow,(function(e){var t={type:"BlockStatement",body:e.body.map(l)};return {type:"ArrowFunctionExpression",params:e.argnames.map(l),async:e.async,body:t}})),s(AST_Destructuring,(function(e){return e.is_array?{type:"ArrayPattern",elements:e.names.map(l)}:{type:"ObjectPattern",properties:e.names.map(l)}})),s(AST_Directive,(function(e){return {type:"ExpressionStatement",expression:{type:"Literal",value:e.value,raw:e.print_to_string()},directive:e.value}})),s(AST_SimpleStatement,(function(e){return {type:"ExpressionStatement",expression:l(e.body)}})),s(AST_SwitchBranch,(function(e){return {type:"SwitchCase",test:l(e.expression),consequent:e.body.map(l)}})),s(AST_Try,(function(e){return {type:"TryStatement",block:c(e),handler:l(e.bcatch),guardedHandlers:[],finalizer:l(e.bfinally)}})),s(AST_Catch,(function(e){return {type:"CatchClause",param:l(e.argname),guard:null,body:c(e)}})),s(AST_Definitions,(function(e){return {type:"VariableDeclaration",kind:e instanceof AST_Const?"const":e instanceof AST_Let?"let":"var",declarations:e.definitions.map(l)}})),s(AST_Export,(function(e){return e.exported_names?"*"===e.exported_names[0].name.name?{type:"ExportAllDeclaration",source:l(e.module_name)}:{type:"ExportNamedDeclaration",specifiers:e.exported_names.map((function(e){return {type:"ExportSpecifier",exported:l(e.foreign_name),local:l(e.name)}})),declaration:l(e.exported_definition),source:l(e.module_name)}:{type:e.is_default?"ExportDefaultDeclaration":"ExportNamedDeclaration",declaration:l(e.exported_value||e.exported_definition)}})),s(AST_Import,(function(e){var t=[];return e.imported_name&&t.push({type:"ImportDefaultSpecifier",local:l(e.imported_name)}),e.imported_names&&"*"===e.imported_names[0].foreign_name.name?t.push({type:"ImportNamespaceSpecifier",local:l(e.imported_names[0].name)}):e.imported_names&&e.imported_names.forEach((function(e){t.push({type:"ImportSpecifier",local:l(e.name),imported:l(e.foreign_name)});})),{type:"ImportDeclaration",specifiers:t,source:l(e.module_name)}})),s(AST_ImportMeta,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"import"},property:{type:"Identifier",name:"meta"}}})),s(AST_Sequence,(function(e){return {type:"SequenceExpression",expressions:e.expressions.map(l)}})),s(AST_DotHash,(function(e){return {type:"MemberExpression",object:l(e.expression),computed:!1,property:{type:"PrivateIdentifier",name:e.property},optional:e.optional}})),s(AST_PropAccess,(function(e){var t=e instanceof AST_Sub;return {type:"MemberExpression",object:l(e.expression),computed:t,property:t?l(e.property):{type:"Identifier",name:e.property},optional:e.optional}})),s(AST_Chain,(function(e){return {type:"ChainExpression",expression:l(e.expression)}})),s(AST_Unary,(function(e){return {type:"++"==e.operator||"--"==e.operator?"UpdateExpression":"UnaryExpression",operator:e.operator,prefix:e instanceof AST_UnaryPrefix,argument:l(e.expression)}})),s(AST_Binary,(function(e){return "="==e.operator&&_()?{type:"AssignmentPattern",left:l(e.left),right:l(e.right)}:{type:"&&"==e.operator||"||"==e.operator||"??"===e.operator?"LogicalExpression":"BinaryExpression",left:l(e.left),operator:e.operator,right:l(e.right)}})),s(AST_Array,(function(e){return {type:"ArrayExpression",elements:e.elements.map(l)}})),s(AST_Object,(function(e){return {type:"ObjectExpression",properties:e.properties.map(l)}})),s(AST_ObjectProperty,(function(e,t){var n,o=e.key instanceof AST_Node?l(e.key):{type:"Identifier",value:e.key};"number"==typeof e.key&&(o={type:"Literal",value:Number(e.key)}),"string"==typeof e.key&&(o={type:"Identifier",name:e.key});var i="string"==typeof e.key||"number"==typeof e.key,r=!i&&(!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef);return e instanceof AST_ObjectKeyVal?(n="init",r=!i):e instanceof AST_ObjectGetter?n="get":e instanceof AST_ObjectSetter&&(n="set"),e instanceof AST_PrivateGetter||e instanceof AST_PrivateSetter?{type:"MethodDefinition",computed:!1,kind:e instanceof AST_PrivateGetter?"get":"set",static:e.static,key:{type:"PrivateIdentifier",name:e.key.name},value:l(e.value)}:e instanceof AST_ClassPrivateProperty?{type:"PropertyDefinition",key:{type:"PrivateIdentifier",name:e.key.name},value:l(e.value),computed:!1,static:e.static}:e instanceof AST_ClassProperty?{type:"PropertyDefinition",key:o,value:l(e.value),computed:r,static:e.static}:t instanceof AST_Class?{type:"MethodDefinition",computed:r,kind:n,static:e.static,key:l(e.key),value:l(e.value)}:{type:"Property",computed:r,kind:n,key:o,value:l(e.value)}})),s(AST_ConciseMethod,(function(e,t){if(t instanceof AST_Object)return {type:"Property",computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,kind:"init",method:!0,shorthand:!1,key:l(e.key),value:l(e.value)};const n=e instanceof AST_PrivateMethod?{type:"PrivateIdentifier",name:e.key.name}:l(e.key);return {type:"MethodDefinition",kind:"constructor"===e.key?"constructor":"method",key:n,value:l(e.value),computed:!(e.key instanceof AST_Symbol)||e.key instanceof AST_SymbolRef,static:e.static}})),s(AST_Class,(function(e){return {type:e instanceof AST_ClassExpression?"ClassExpression":"ClassDeclaration",superClass:l(e.extends),id:e.name?l(e.name):null,body:{type:"ClassBody",body:e.properties.map(l)}}})),s(AST_NewTarget,(function(){return {type:"MetaProperty",meta:{type:"Identifier",name:"new"},property:{type:"Identifier",name:"target"}}})),s(AST_Symbol,(function(e,t){if(e instanceof AST_SymbolMethod&&t.quote)return {type:"Literal",value:e.name};var n=e.definition();return {type:"Identifier",name:n?n.mangled_name||n.name:e.name}})),s(AST_RegExp,(function(e){const t=e.value.source,n=e.value.flags;return {type:"Literal",value:null,raw:e.print_to_string(),regex:{pattern:t,flags:n}}})),s(AST_Constant,(function(e){return {type:"Literal",value:e.value,raw:e.raw||e.print_to_string()}})),s(AST_Atom,(function(e){return {type:"Identifier",name:String(e.value)}})),s(AST_BigInt,(e=>({type:"BigIntLiteral",value:e.value}))),AST_Boolean.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Null.DEFMETHOD("to_mozilla_ast",AST_Constant.prototype.to_mozilla_ast),AST_Hole.DEFMETHOD("to_mozilla_ast",(function(){return null})),AST_Block.DEFMETHOD("to_mozilla_ast",AST_BlockStatement.prototype.to_mozilla_ast),AST_Lambda.DEFMETHOD("to_mozilla_ast",AST_Function.prototype.to_mozilla_ast);var r=null;function a(e){r.push(e);var n=null!=e?t[e.type](e):null;return r.pop(),n}function s(e,t){e.DEFMETHOD("to_mozilla_ast",(function(e){return n=t(this,e),o=this.start,i=this.end,o&&i?(null!=o.pos&&null!=i.endpos&&(n.range=[o.pos,i.endpos]),o.line&&(n.loc={start:{line:o.line,column:o.col},end:i.endline?{line:i.endline,column:i.endcol}:null},o.file&&(n.loc.source=o.file)),n):n;var n,o,i;}));}AST_Node.from_mozilla_ast=function(e){var t=r;r=[];var n=a(e);return r=t,n};var u=null;function l(e){null===u&&(u=[]),u.push(e);var t=null!=e?e.to_mozilla_ast(u[u.length-2]):null;return u.pop(),0===u.length&&(u=null),t}function _(){for(var e=u.length;e--;)if(u[e]instanceof AST_Destructuring)return !0;return !1}function c(e){return {type:"BlockStatement",body:e.body.map(l)}}function f(e,t){var n=t.body.map(l);return t.body[0]instanceof AST_SimpleStatement&&t.body[0].body instanceof AST_String&&n.unshift(l(new AST_EmptyStatement(t.body[0]))),{type:e,body:n}}}();const EXPECT_DIRECTIVE=/^$|[;{][\s\n]*$/,r_annotation=/[@#]__(PURE|INLINE|NOINLINE)__/g;function is_some_comments(e){return ("comment2"===e.type||"comment1"===e.type)&&/@preserve|@lic|@cc_on|^\**!/i.test(e.value)}function OutputStream(e){var t=!e;void 0===(e=defaults$1(e,{ascii_only:!1,beautify:!1,braces:!1,comments:"some",ecma:5,ie8:!1,indent_level:4,indent_start:0,inline_script:!0,keep_numbers:!1,keep_quoted_props:!1,max_line_len:!1,preamble:null,preserve_annotations:!1,quote_keys:!1,quote_style:0,safari10:!1,semicolons:!0,shebang:!0,shorthand:void 0,source_map:null,webkit:!1,width:80,wrap_iife:!1,wrap_func_args:!0},!0)).shorthand&&(e.shorthand=e.ecma>5);var n=return_false;if(e.comments){let t=e.comments;if("string"==typeof e.comments&&/^\/.*\/[a-zA-Z]*$/.test(e.comments)){var o=e.comments.lastIndexOf("/");t=new RegExp(e.comments.substr(1,o-1),e.comments.substr(o+1));}n=t instanceof RegExp?function(e){return "comment5"!=e.type&&t.test(e.value)}:"function"==typeof t?function(e){return "comment5"!=e.type&&t(this,e)}:"some"===t?is_some_comments:return_true;}var i=0,r=0,a=1,s=0,u="";let l=new Set;var _=e.ascii_only?function(t,n){return e.ecma>=2015&&!e.safari10&&(t=t.replace(/[\ud800-\udbff][\udc00-\udfff]/g,(function(e){return "\\u{"+get_full_char_code(e,0).toString(16)+"}"}))),t.replace(/[\u0000-\u001f\u007f-\uffff]/g,(function(e){var t=e.charCodeAt(0).toString(16);if(t.length<=2&&!n){for(;t.length<2;)t="0"+t;return "\\x"+t}for(;t.length<4;)t="0"+t;return "\\u"+t}))}:function(e){return e.replace(/[\ud800-\udbff][\udc00-\udfff]|([\ud800-\udbff]|[\udc00-\udfff])/g,(function(e,t){return t?"\\u"+t.charCodeAt(0).toString(16):e}))};function c(t,n){var o=function(t,n){var o=0,i=0;function r(){return "'"+t.replace(/\x27/g,"\\'")+"'"}function a(){return '"'+t.replace(/\x22/g,'\\"')+'"'}if(t=t.replace(/[\\\b\f\n\r\v\t\x22\x27\u2028\u2029\0\ufeff]/g,(function(n,r){switch(n){case'"':return ++o,'"';case"'":return ++i,"'";case"\\":return "\\\\";case"\n":return "\\n";case"\r":return "\\r";case"\t":return "\\t";case"\b":return "\\b";case"\f":return "\\f";case"\v":return e.ie8?"\\x0B":"\\v";case"\u2028":return "\\u2028";case"\u2029":return "\\u2029";case"\ufeff":return "\\ufeff";case"\0":return /[0-9]/.test(get_full_char(t,r+1))?"\\x00":"\\0"}return n})),t=_(t),"`"===n)return "`"+t.replace(/`/g,"\\`")+"`";switch(e.quote_style){case 1:return r();case 2:return a();case 3:return "'"==n?r():a();default:return o>i?r():a()}}(t,n);return e.inline_script&&(o=(o=(o=o.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi,"<\\/$1$2")).replace(/\x3c!--/g,"\\x3c!--")).replace(/--\x3e/g,"--\\x3e")),o}var f,p,d=!1,S=!1,m=!1,A=0,T=!1,h=!1,E=-1,g="",D=e.source_map&&[],b=D?function(){D.forEach((function(t){try{e.source_map.add(t.token.file,t.line,t.col,t.token.line,t.token.col,t.name||"name"!=t.token.type?t.name:t.token.value);}catch(e){}})),D=[];}:noop,y=e.max_line_len?function(){if(r>e.max_line_len&&A){var t=u.slice(0,A),n=u.slice(A);if(D){var o=n.length-r;D.forEach((function(e){e.line++,e.col+=o;}));}u=t+"\n"+n,a++,s++,r=n.length;}A&&(A=0,b());}:noop,v=makePredicate("( [ + * / - , . `");function C(t){var n=get_full_char(t=String(t),0);T&&n&&(T=!1,"\n"!==n&&(C("\n"),k())),h&&n&&(h=!1,/[\s;})]/.test(n)||R()),E=-1;var o=g.charAt(g.length-1);m&&(m=!1,(":"!==o||"}"!==n)&&(n&&";}".includes(n)||";"===o)||(e.semicolons||v.has(n)?(u+=";",r++,s++):(y(),r>0&&(u+="\n",s++,a++,r=0),/^\s+$/.test(t)&&(m=!0)),e.beautify||(S=!1))),S&&((is_identifier_char(o)&&(is_identifier_char(n)||"\\"==n)||"/"==n&&n==o||("+"==n||"-"==n)&&n==g)&&(u+=" ",r++,s++),S=!1),f&&(D.push({token:f,name:p,line:a,col:r}),f=!1,A||b()),u+=t,d="("==t[t.length-1],s+=t.length;var i=t.split(/\r?\n/),l=i.length-1;a+=l,r+=i[0].length,l>0&&(y(),r=i[l].length),g=t;}var R=e.beautify?function(){C(" ");}:function(){S=!0;},k=e.beautify?function(t){var n;e.beautify&&C((n=t?.5:0," ".repeat(e.indent_start+i-n*e.indent_level)));}:noop,O=e.beautify?function(e,t){!0===e&&(e=I());var n=i;i=e;var o=t();return i=n,o}:function(e,t){return t()},F=e.beautify?function(){if(E<0)return C("\n");"\n"!=u[E]&&(u=u.slice(0,E)+"\n"+u.slice(E),s++,a++),E++;}:e.max_line_len?function(){y(),A=u.length;}:noop,N=e.beautify?function(){C(";");}:function(){m=!0;};function M(){m=!1,C(";");}function I(){return i+e.indent_level}function x(){return A&&y(),u}function w(){let e=u.length-1;for(;e>=0;){const t=u.charCodeAt(e);if(10===t)return !0;if(32!==t)return !1;e--;}return !0}function P(t){return e.preserve_annotations||(t=t.replace(r_annotation," ")),/^\s*$/.test(t)?"":t.replace(/(<\s*\/\s*)(script)/i,"<\\/$2")}var B=[];return {get:x,toString:x,indent:k,in_directive:!1,use_asm:null,active_scope:null,indentation:function(){return i},current_width:function(){return r-i},should_break:function(){return e.width&&this.current_width()>=e.width},has_parens:function(){return d},newline:F,print:C,star:function(){C("*");},space:R,comma:function(){C(","),R();},colon:function(){C(":"),R();},last:function(){return g},semicolon:N,force_semicolon:M,to_utf8:_,print_name:function(e){C(function(e){return e=e.toString(),_(e,!0)}(e));},print_string:function(e,t,n){var o=c(e,t);!0!==n||o.includes("\\")||(EXPECT_DIRECTIVE.test(u)||M(),M()),C(o);},print_template_string_chars:function(e){var t=c(e,"`").replace(/\${/g,"\\${");return C(t.substr(1,t.length-2))},encode_string:c,next_indent:I,with_indent:O,with_block:function(e){var t;return C("{"),F(),O(I(),(function(){t=e();})),k(),C("}"),t},with_parens:function(e){C("(");var t=e();return C(")"),t},with_square:function(e){C("[");var t=e();return C("]"),t},add_mapping:D?function(e,t){f=e,p=t;}:noop,option:function(t){return e[t]},printed_comments:l,prepend_comments:t?noop:function(t){var o=t.start;if(!o)return;var i=this.printed_comments;const r=t instanceof AST_Exit&&t.value;if(o.comments_before&&i.has(o.comments_before)){if(!r)return;o.comments_before=[];}var a=o.comments_before;if(a||(a=o.comments_before=[]),i.add(a),r){var u=new TreeWalker((function(e){var t=u.parent();if(!(t instanceof AST_Exit||t instanceof AST_Binary&&t.left===e||"Call"==t.TYPE&&t.expression===e||t instanceof AST_Conditional&&t.condition===e||t instanceof AST_Dot&&t.expression===e||t instanceof AST_Sequence&&t.expressions[0]===e||t instanceof AST_Sub&&t.expression===e||t instanceof AST_UnaryPostfix))return !0;if(e.start){var n=e.start.comments_before;n&&!i.has(n)&&(i.add(n),a=a.concat(n));}}));u.push(t),t.value.walk(u);}if(0==s){a.length>0&&e.shebang&&"comment5"===a[0].type&&!i.has(a[0])&&(C("#!"+a.shift().value+"\n"),k());var l=e.preamble;l&&C(l.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g,"\n"));}if(0!=(a=a.filter(n,t).filter((e=>!i.has(e)))).length){var _=w();a.forEach((function(e,t){if(i.add(e),_||(e.nlb?(C("\n"),k(),_=!0):t>0&&R()),/comment[134]/.test(e.type))(n=P(e.value))&&(C("//"+n+"\n"),k()),_=!0;else if("comment2"==e.type){var n;(n=P(e.value))&&C("/*"+n+"*/"),_=!1;}})),_||(o.nlb?(C("\n"),k()):R());}},append_comments:t||n===return_false?noop:function(e,t){var o=e.end;if(o){var i=this.printed_comments,r=o[t?"comments_before":"comments_after"];if(r&&!i.has(r)&&(e instanceof AST_Statement||r.every((e=>!/comment[134]/.test(e.type))))){i.add(r);var a=u.length;r.filter(n,e).forEach((function(e,n){if(!i.has(e))if(i.add(e),h=!1,T?(C("\n"),k(),T=!1):e.nlb&&(n>0||!w())?(C("\n"),k()):(n>0||!t)&&R(),/comment[134]/.test(e.type)){const t=P(e.value);t&&C("//"+t),T=!0;}else if("comment2"==e.type){const t=P(e.value);t&&C("/*"+t+"*/"),h=!0;}})),u.length>a&&(E=a);}}},line:function(){return a},col:function(){return r},pos:function(){return s},push_node:function(e){B.push(e);},pop_node:function(){return B.pop()},parent:function(e){return B[B.length-2-(e||0)]}}}!function(){function e(e,t){e.DEFMETHOD("_codegen",t);}function t(e,n){Array.isArray(e)?e.forEach((function(e){t(e,n);})):e.DEFMETHOD("needs_parens",n);}function n(e,t,n,o){var i=e.length-1;n.in_directive=o,e.forEach((function(e,o){!0!==n.in_directive||e instanceof AST_Directive||e instanceof AST_EmptyStatement||e instanceof AST_SimpleStatement&&e.body instanceof AST_String||(n.in_directive=!1),e instanceof AST_EmptyStatement||(n.indent(),e.print(n),o==i&&t||(n.newline(),t&&n.newline())),!0===n.in_directive&&e instanceof AST_SimpleStatement&&e.body instanceof AST_String&&(n.in_directive=!1);})),n.in_directive=!1;}function o(e,t){t.print("{"),t.with_indent(t.next_indent(),(function(){t.append_comments(e,!0);})),t.print("}");}function i(e,t,i){e.body.length>0?t.with_block((function(){n(e.body,!1,t,i);})):o(e,t);}function r(e,t,n){var o=!1;n&&(o=walk$3(e,(e=>e instanceof AST_Scope||(e instanceof AST_Binary&&"in"==e.operator?walk_abort:void 0)))),e.print(t,o);}function a(e,t,n){return n.option("quote_keys")?n.print_string(e):""+ +e==e&&e>=0?n.option("keep_numbers")?n.print(e):n.print(_(e)):(RESERVED_WORDS.has(e)?n.option("ie8"):n.option("ecma")<2015||n.option("safari10")?!is_basic_identifier_string(e):!is_identifier_string(e,!0))||t&&n.option("keep_quoted_props")?n.print_string(e,t):n.print_name(e)}AST_Node.DEFMETHOD("print",(function(e,t){var n=this,o=n._codegen;function i(){e.prepend_comments(n),n.add_source_map(e),o(n,e),e.append_comments(n);}n instanceof AST_Scope?e.active_scope=n:!e.use_asm&&n instanceof AST_Directive&&"use asm"==n.value&&(e.use_asm=e.active_scope),e.push_node(n),t||n.needs_parens(e)?e.with_parens(i):i(),e.pop_node(),n===e.use_asm&&(e.use_asm=null);})),AST_Node.DEFMETHOD("_print",AST_Node.prototype.print),AST_Node.DEFMETHOD("print_to_string",(function(e){var t=OutputStream(e);return this.print(t),t.get()})),t(AST_Node,return_false),t(AST_Function,(function(e){return !(e.has_parens()||!first_in_statement(e))||(!!(e.option("webkit")&&(t=e.parent())instanceof AST_PropAccess&&t.expression===this)||(!!(e.option("wrap_iife")&&(t=e.parent())instanceof AST_Call&&t.expression===this)||!!(e.option("wrap_func_args")&&(t=e.parent())instanceof AST_Call&&t.args.includes(this))));var t;})),t(AST_Arrow,(function(e){var t=e.parent();return !!(e.option("wrap_func_args")&&t instanceof AST_Call&&t.args.includes(this))||t instanceof AST_PropAccess&&t.expression===this})),t(AST_Object,(function(e){return !e.has_parens()&&first_in_statement(e)})),t(AST_ClassExpression,first_in_statement),t(AST_Unary,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&this instanceof AST_UnaryPrefix&&t.left===this&&"++"!==this.operator&&"--"!==this.operator})),t(AST_Await,(function(e){var t=e.parent();return t instanceof AST_PropAccess&&t.expression===this||t instanceof AST_Call&&t.expression===this||t instanceof AST_Binary&&"**"===t.operator&&t.left===this||e.option("safari10")&&t instanceof AST_UnaryPrefix})),t(AST_Sequence,(function(e){var t=e.parent();return t instanceof AST_Call||t instanceof AST_Unary||t instanceof AST_Binary||t instanceof AST_VarDef||t instanceof AST_PropAccess||t instanceof AST_Array||t instanceof AST_ObjectProperty||t instanceof AST_Conditional||t instanceof AST_Arrow||t instanceof AST_DefaultAssign||t instanceof AST_Expansion||t instanceof AST_ForOf&&this===t.object||t instanceof AST_Yield||t instanceof AST_Export})),t(AST_Binary,(function(e){var t=e.parent();if(t instanceof AST_Call&&t.expression===this)return !0;if(t instanceof AST_Unary)return !0;if(t instanceof AST_PropAccess&&t.expression===this)return !0;if(t instanceof AST_Binary){const e=t.operator,n=this.operator;if("??"===n&&("||"===e||"&&"===e))return !0;if("??"===e&&("||"===n||"&&"===n))return !0;const o=PRECEDENCE[e],i=PRECEDENCE[n];if(o>i||o==i&&(this===t.right||"**"==e))return !0}})),t(AST_Yield,(function(e){var t=e.parent();return t instanceof AST_Binary&&"="!==t.operator||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_Unary||t instanceof AST_PropAccess&&t.expression===this||void 0})),t(AST_PropAccess,(function(e){var t=e.parent();if(t instanceof AST_New&&t.expression===this)return walk$3(this,(e=>e instanceof AST_Scope||(e instanceof AST_Call?walk_abort:void 0)))})),t(AST_Call,(function(e){var t,n=e.parent();return !!(n instanceof AST_New&&n.expression===this||n instanceof AST_Export&&n.is_default&&this.expression instanceof AST_Function)||this.expression instanceof AST_Function&&n instanceof AST_PropAccess&&n.expression===this&&(t=e.parent(1))instanceof AST_Assign&&t.left===n})),t(AST_New,(function(e){var t=e.parent();if(0===this.args.length&&(t instanceof AST_PropAccess||t instanceof AST_Call&&t.expression===this))return !0})),t(AST_Number,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this){var n=this.getValue();if(n<0||/^0/.test(_(n)))return !0}})),t(AST_BigInt,(function(e){var t=e.parent();if(t instanceof AST_PropAccess&&t.expression===this&&this.getValue().startsWith("-"))return !0})),t([AST_Assign,AST_Conditional],(function(e){var t=e.parent();return t instanceof AST_Unary||t instanceof AST_Binary&&!(t instanceof AST_Assign)||t instanceof AST_Call&&t.expression===this||t instanceof AST_Conditional&&t.condition===this||t instanceof AST_PropAccess&&t.expression===this||this instanceof AST_Assign&&this.left instanceof AST_Destructuring&&!1===this.left.is_array||void 0})),e(AST_Directive,(function(e,t){t.print_string(e.value,e.quote),t.semicolon();})),e(AST_Expansion,(function(e,t){t.print("..."),e.expression.print(t);})),e(AST_Destructuring,(function(e,t){t.print(e.is_array?"[":"{");var n=e.names.length;e.names.forEach((function(e,o){o>0&&t.comma(),e.print(t),o==n-1&&e instanceof AST_Hole&&t.comma();})),t.print(e.is_array?"]":"}");})),e(AST_Debugger,(function(e,t){t.print("debugger"),t.semicolon();})),AST_StatementWithBody.DEFMETHOD("_do_print_body",(function(e){l(this.body,e);})),e(AST_Statement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_Toplevel,(function(e,t){n(e.body,!0,t,!0),t.print("");})),e(AST_LabeledStatement,(function(e,t){e.label.print(t),t.colon(),e.body.print(t);})),e(AST_SimpleStatement,(function(e,t){e.body.print(t),t.semicolon();})),e(AST_BlockStatement,(function(e,t){i(e,t);})),e(AST_EmptyStatement,(function(e,t){t.semicolon();})),e(AST_Do,(function(e,t){t.print("do"),t.space(),c(e.body,t),t.space(),t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.semicolon();})),e(AST_While,(function(e,t){t.print("while"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e._do_print_body(t);})),e(AST_For,(function(e,t){t.print("for"),t.space(),t.with_parens((function(){e.init?(e.init instanceof AST_Definitions?e.init.print(t):r(e.init,t,!0),t.print(";"),t.space()):t.print(";"),e.condition?(e.condition.print(t),t.print(";"),t.space()):t.print(";"),e.step&&e.step.print(t);})),t.space(),e._do_print_body(t);})),e(AST_ForIn,(function(e,t){t.print("for"),e.await&&(t.space(),t.print("await")),t.space(),t.with_parens((function(){e.init.print(t),t.space(),t.print(e instanceof AST_ForOf?"of":"in"),t.space(),e.object.print(t);})),t.space(),e._do_print_body(t);})),e(AST_With,(function(e,t){t.print("with"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space(),e._do_print_body(t);})),AST_Lambda.DEFMETHOD("_do_print",(function(e,t){var n=this;t||(n.async&&(e.print("async"),e.space()),e.print("function"),n.is_generator&&e.star(),n.name&&e.space()),n.name instanceof AST_Symbol?n.name.print(e):t&&n.name instanceof AST_Node&&e.with_square((function(){n.name.print(e);})),e.with_parens((function(){n.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),i(n,e,!0);})),e(AST_Lambda,(function(e,t){e._do_print(t);})),e(AST_PrefixedTemplateString,(function(e,t){var n=e.prefix,o=n instanceof AST_Lambda||n instanceof AST_Binary||n instanceof AST_Conditional||n instanceof AST_Sequence||n instanceof AST_Unary||n instanceof AST_Dot&&n.expression instanceof AST_Object;o&&t.print("("),e.prefix.print(t),o&&t.print(")"),e.template_string.print(t);})),e(AST_TemplateString,(function(e,t){var n=t.parent()instanceof AST_PrefixedTemplateString;t.print("`");for(var o=0;o<e.segments.length;o++)e.segments[o]instanceof AST_TemplateSegment?n?t.print(e.segments[o].raw):t.print_template_string_chars(e.segments[o].value):(t.print("${"),e.segments[o].print(t),t.print("}"));t.print("`");})),e(AST_TemplateSegment,(function(e,t){t.print_template_string_chars(e.value);})),AST_Arrow.DEFMETHOD("_do_print",(function(e){var t=this,n=e.parent(),o=n instanceof AST_Binary&&!(n instanceof AST_Assign)||n instanceof AST_Unary||n instanceof AST_Call&&t===n.expression;o&&e.print("("),t.async&&(e.print("async"),e.space()),1===t.argnames.length&&t.argnames[0]instanceof AST_Symbol?t.argnames[0].print(e):e.with_parens((function(){t.argnames.forEach((function(t,n){n&&e.comma(),t.print(e);}));})),e.space(),e.print("=>"),e.space();const r=t.body[0];if(1===t.body.length&&r instanceof AST_Return){const t=r.value;t?left_is_object(t)?(e.print("("),t.print(e),e.print(")")):t.print(e):e.print("{}");}else i(t,e);o&&e.print(")");})),AST_Exit.DEFMETHOD("_do_print",(function(e,t){if(e.print(t),this.value){e.space();const t=this.value.start.comments_before;t&&t.length&&!e.printed_comments.has(t)?(e.print("("),this.value.print(e),e.print(")")):this.value.print(e);}e.semicolon();})),e(AST_Return,(function(e,t){e._do_print(t,"return");})),e(AST_Throw,(function(e,t){e._do_print(t,"throw");})),e(AST_Yield,(function(e,t){var n=e.is_star?"*":"";t.print("yield"+n),e.expression&&(t.space(),e.expression.print(t));})),e(AST_Await,(function(e,t){t.print("await"),t.space();var n=e.expression,o=!(n instanceof AST_Call||n instanceof AST_SymbolRef||n instanceof AST_PropAccess||n instanceof AST_Unary||n instanceof AST_Constant||n instanceof AST_Await||n instanceof AST_Object);o&&t.print("("),e.expression.print(t),o&&t.print(")");})),AST_LoopControl.DEFMETHOD("_do_print",(function(e,t){e.print(t),this.label&&(e.space(),this.label.print(e)),e.semicolon();})),e(AST_Break,(function(e,t){e._do_print(t,"break");})),e(AST_Continue,(function(e,t){e._do_print(t,"continue");})),e(AST_If,(function(e,t){t.print("if"),t.space(),t.with_parens((function(){e.condition.print(t);})),t.space(),e.alternative?(function(e,t){var n=e.body;if(t.option("braces")||t.option("ie8")&&n instanceof AST_Do)return c(n,t);if(!n)return t.force_semicolon();for(;;)if(n instanceof AST_If){if(!n.alternative)return void c(e.body,t);n=n.alternative;}else {if(!(n instanceof AST_StatementWithBody))break;n=n.body;}l(e.body,t);}(e,t),t.space(),t.print("else"),t.space(),e.alternative instanceof AST_If?e.alternative.print(t):l(e.alternative,t)):e._do_print_body(t);})),e(AST_Switch,(function(e,t){t.print("switch"),t.space(),t.with_parens((function(){e.expression.print(t);})),t.space();var n=e.body.length-1;n<0?o(e,t):t.with_block((function(){e.body.forEach((function(e,o){t.indent(!0),e.print(t),o<n&&e.body.length>0&&t.newline();}));}));})),AST_SwitchBranch.DEFMETHOD("_do_print_body",(function(e){e.newline(),this.body.forEach((function(t){e.indent(),t.print(e),e.newline();}));})),e(AST_Default,(function(e,t){t.print("default:"),e._do_print_body(t);})),e(AST_Case,(function(e,t){t.print("case"),t.space(),e.expression.print(t),t.print(":"),e._do_print_body(t);})),e(AST_Try,(function(e,t){t.print("try"),t.space(),i(e,t),e.bcatch&&(t.space(),e.bcatch.print(t)),e.bfinally&&(t.space(),e.bfinally.print(t));})),e(AST_Catch,(function(e,t){t.print("catch"),e.argname&&(t.space(),t.with_parens((function(){e.argname.print(t);}))),t.space(),i(e,t);})),e(AST_Finally,(function(e,t){t.print("finally"),t.space(),i(e,t);})),AST_Definitions.DEFMETHOD("_do_print",(function(e,t){e.print(t),e.space(),this.definitions.forEach((function(t,n){n&&e.comma(),t.print(e);}));var n=e.parent();(!(n instanceof AST_For||n instanceof AST_ForIn)||n&&n.init!==this)&&e.semicolon();})),e(AST_Let,(function(e,t){e._do_print(t,"let");})),e(AST_Var,(function(e,t){e._do_print(t,"var");})),e(AST_Const,(function(e,t){e._do_print(t,"const");})),e(AST_Import,(function(e,t){t.print("import"),t.space(),e.imported_name&&e.imported_name.print(t),e.imported_name&&e.imported_names&&(t.print(","),t.space()),e.imported_names&&(1===e.imported_names.length&&"*"===e.imported_names[0].foreign_name.name?e.imported_names[0].print(t):(t.print("{"),e.imported_names.forEach((function(n,o){t.space(),n.print(t),o<e.imported_names.length-1&&t.print(",");})),t.space(),t.print("}"))),(e.imported_name||e.imported_names)&&(t.space(),t.print("from"),t.space()),e.module_name.print(t),t.semicolon();})),e(AST_ImportMeta,(function(e,t){t.print("import.meta");})),e(AST_NameMapping,(function(e,t){var n=t.parent()instanceof AST_Import,o=e.name.definition();(o&&o.mangled_name||e.name.name)!==e.foreign_name.name?(n?t.print(e.foreign_name.name):e.name.print(t),t.space(),t.print("as"),t.space(),n?e.name.print(t):t.print(e.foreign_name.name)):e.name.print(t);})),e(AST_Export,(function(e,t){if(t.print("export"),t.space(),e.is_default&&(t.print("default"),t.space()),e.exported_names)1===e.exported_names.length&&"*"===e.exported_names[0].name.name?e.exported_names[0].print(t):(t.print("{"),e.exported_names.forEach((function(n,o){t.space(),n.print(t),o<e.exported_names.length-1&&t.print(",");})),t.space(),t.print("}"));else if(e.exported_value)e.exported_value.print(t);else if(e.exported_definition&&(e.exported_definition.print(t),e.exported_definition instanceof AST_Definitions))return;e.module_name&&(t.space(),t.print("from"),t.space(),e.module_name.print(t)),(e.exported_value&&!(e.exported_value instanceof AST_Defun||e.exported_value instanceof AST_Function||e.exported_value instanceof AST_Class)||e.module_name||e.exported_names)&&t.semicolon();})),e(AST_VarDef,(function(e,t){if(e.name.print(t),e.value){t.space(),t.print("="),t.space();var n=t.parent(1),o=n instanceof AST_For||n instanceof AST_ForIn;r(e.value,t,o);}})),e(AST_Call,(function(e,t){e.expression.print(t),e instanceof AST_New&&0===e.args.length||((e.expression instanceof AST_Call||e.expression instanceof AST_Lambda)&&t.add_mapping(e.start),e.optional&&t.print("?."),t.with_parens((function(){e.args.forEach((function(e,n){n&&t.comma(),e.print(t);}));})));})),e(AST_New,(function(e,t){t.print("new"),t.space(),AST_Call.prototype._codegen(e,t);})),AST_Sequence.DEFMETHOD("_do_print",(function(e){this.expressions.forEach((function(t,n){n>0&&(e.comma(),e.should_break()&&(e.newline(),e.indent())),t.print(e);}));})),e(AST_Sequence,(function(e,t){e._do_print(t);})),e(AST_Dot,(function(e,t){var n=e.expression;n.print(t);var o=e.property,i=RESERVED_WORDS.has(o)?t.option("ie8"):!is_identifier_string(o,t.option("ecma")>=2015||t.option("safari10"));e.optional&&t.print("?."),i?(t.print("["),t.add_mapping(e.end),t.print_string(o),t.print("]")):(n instanceof AST_Number&&n.getValue()>=0&&(/[xa-f.)]/i.test(t.last())||t.print(".")),e.optional||t.print("."),t.add_mapping(e.end),t.print_name(o));})),e(AST_DotHash,(function(e,t){e.expression.print(t);var n=e.property;e.optional&&t.print("?"),t.print(".#"),t.print_name(n);})),e(AST_Sub,(function(e,t){e.expression.print(t),e.optional&&t.print("?."),t.print("["),e.property.print(t),t.print("]");})),e(AST_Chain,(function(e,t){e.expression.print(t);})),e(AST_UnaryPrefix,(function(e,t){var n=e.operator;t.print(n),(/^[a-z]/i.test(n)||/[+-]$/.test(n)&&e.expression instanceof AST_UnaryPrefix&&/^[+-]/.test(e.expression.operator))&&t.space(),e.expression.print(t);})),e(AST_UnaryPostfix,(function(e,t){e.expression.print(t),t.print(e.operator);})),e(AST_Binary,(function(e,t){var n=e.operator;e.left.print(t),">"==n[0]&&e.left instanceof AST_UnaryPostfix&&"--"==e.left.operator?t.print(" "):t.space(),t.print(n),("<"==n||"<<"==n)&&e.right instanceof AST_UnaryPrefix&&"!"==e.right.operator&&e.right.expression instanceof AST_UnaryPrefix&&"--"==e.right.expression.operator?t.print(" "):t.space(),e.right.print(t);})),e(AST_Conditional,(function(e,t){e.condition.print(t),t.space(),t.print("?"),t.space(),e.consequent.print(t),t.space(),t.colon(),e.alternative.print(t);})),e(AST_Array,(function(e,t){t.with_square((function(){var n=e.elements,o=n.length;o>0&&t.space(),n.forEach((function(e,n){n&&t.comma(),e.print(t),n===o-1&&e instanceof AST_Hole&&t.comma();})),o>0&&t.space();}));})),e(AST_Object,(function(e,t){e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&(t.print(","),t.newline()),t.indent(),e.print(t);})),t.newline();})):o(e,t);})),e(AST_Class,(function(e,t){if(t.print("class"),t.space(),e.name&&(e.name.print(t),t.space()),e.extends){var n=!(e.extends instanceof AST_SymbolRef||e.extends instanceof AST_PropAccess||e.extends instanceof AST_ClassExpression||e.extends instanceof AST_Function);t.print("extends"),n?t.print("("):t.space(),e.extends.print(t),n?t.print(")"):t.space();}e.properties.length>0?t.with_block((function(){e.properties.forEach((function(e,n){n&&t.newline(),t.indent(),e.print(t);})),t.newline();})):t.print("{}");})),e(AST_NewTarget,(function(e,t){t.print("new.target");})),e(AST_ObjectKeyVal,(function(e,t){function n(e){var t=e.definition();return t?t.mangled_name||t.name:e.name}var o=t.option("shorthand");o&&e.value instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value)===e.key&&!RESERVED_WORDS.has(e.key)?a(e.key,e.quote,t):o&&e.value instanceof AST_DefaultAssign&&e.value.left instanceof AST_Symbol&&is_identifier_string(e.key,t.option("ecma")>=2015||t.option("safari10"))&&n(e.value.left)===e.key?(a(e.key,e.quote,t),t.space(),t.print("="),t.space(),e.value.right.print(t)):(e.key instanceof AST_Node?t.with_square((function(){e.key.print(t);})):a(e.key,e.quote,t),t.colon(),e.value.print(t));})),e(AST_ClassPrivateProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),t.print("#"),a(e.key.name,e.quote,t),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),e(AST_ClassProperty,((e,t)=>{e.static&&(t.print("static"),t.space()),e.key instanceof AST_SymbolClassProperty?a(e.key.name,e.quote,t):(t.print("["),e.key.print(t),t.print("]")),e.value&&(t.print("="),e.value.print(t)),t.semicolon();})),AST_ObjectProperty.DEFMETHOD("_print_getter_setter",(function(e,t,n){var o=this;o.static&&(n.print("static"),n.space()),e&&(n.print(e),n.space()),o.key instanceof AST_SymbolMethod?(t&&n.print("#"),a(o.key.name,o.quote,n)):n.with_square((function(){o.key.print(n);})),o.value._do_print(n,!0);})),e(AST_ObjectSetter,(function(e,t){e._print_getter_setter("set",!1,t);})),e(AST_ObjectGetter,(function(e,t){e._print_getter_setter("get",!1,t);})),e(AST_PrivateSetter,(function(e,t){e._print_getter_setter("set",!0,t);})),e(AST_PrivateGetter,(function(e,t){e._print_getter_setter("get",!0,t);})),e(AST_PrivateMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!0,t);})),e(AST_ConciseMethod,(function(e,t){var n;e.is_generator&&e.async?n="async*":e.is_generator?n="*":e.async&&(n="async"),e._print_getter_setter(n,!1,t);})),AST_Symbol.DEFMETHOD("_do_print",(function(e){var t=this.definition();e.print_name(t?t.mangled_name||t.name:this.name);})),e(AST_Symbol,(function(e,t){e._do_print(t);})),e(AST_Hole,noop),e(AST_This,(function(e,t){t.print("this");})),e(AST_Super,(function(e,t){t.print("super");})),e(AST_Constant,(function(e,t){t.print(e.getValue());})),e(AST_String,(function(e,t){t.print_string(e.getValue(),e.quote,t.in_directive);})),e(AST_Number,(function(e,t){(t.option("keep_numbers")||t.use_asm)&&e.raw?t.print(e.raw):t.print(_(e.getValue()));})),e(AST_BigInt,(function(e,t){t.print(e.getValue()+"n");}));const s=/(<\s*\/\s*script)/i,u=(e,t)=>t.replace("/","\\/");function l(e,t){t.option("braces")?c(e,t):!e||e instanceof AST_EmptyStatement?t.force_semicolon():e.print(t);}function _(e){var t,n,o,i=e.toString(10).replace(/^0\./,".").replace("e+","e"),r=[i];return Math.floor(e)===e&&(e<0?r.push("-0x"+(-e).toString(16).toLowerCase()):r.push("0x"+e.toString(16).toLowerCase())),(t=/^\.0+/.exec(i))?(n=t[0].length,o=i.slice(n),r.push(o+"e-"+(o.length+n-1))):(t=/0+$/.exec(i))?(n=t[0].length,r.push(i.slice(0,-n)+"e"+n)):(t=/^(\d)\.(\d+)e(-?\d+)$/.exec(i))&&r.push(t[1]+t[2]+"e"+(t[3]-t[2].length)),function(e){for(var t=e[0],n=t.length,o=1;o<e.length;++o)e[o].length<n&&(n=(t=e[o]).length);return t}(r)}function c(e,t){!e||e instanceof AST_EmptyStatement?t.print("{}"):e instanceof AST_BlockStatement?e.print(t):t.with_block((function(){t.indent(),e.print(t),t.newline();}));}function f(e,t){e.forEach((function(e){e.DEFMETHOD("add_source_map",t);}));}e(AST_RegExp,(function(e,t){let{source:n,flags:o}=e.getValue();n=regexp_source_fix(n),o=o?sort_regexp_flags(o):"",n=n.replace(s,u),t.print(t.to_utf8(`/${n}/${o}`));const i=t.parent();i instanceof AST_Binary&&/^\w/.test(i.operator)&&i.left===e&&t.print(" ");})),f([AST_Node,AST_LabeledStatement,AST_Toplevel],noop),f([AST_Array,AST_BlockStatement,AST_Catch,AST_Class,AST_Constant,AST_Debugger,AST_Definitions,AST_Directive,AST_Finally,AST_Jump,AST_Lambda,AST_New,AST_Object,AST_StatementWithBody,AST_Symbol,AST_Switch,AST_SwitchBranch,AST_TemplateString,AST_TemplateSegment,AST_Try],(function(e){e.add_mapping(this.start);})),f([AST_ObjectGetter,AST_ObjectSetter],(function(e){e.add_mapping(this.start,this.key.name);})),f([AST_ObjectProperty],(function(e){e.add_mapping(this.start,this.key);}));}();const shallow_cmp=(e,t)=>null===e&&null===t||e.TYPE===t.TYPE&&e.shallow_cmp(t),equivalent_to=(e,t)=>{if(!shallow_cmp(e,t))return !1;const n=[e],o=[t],i=n.push.bind(n),r=o.push.bind(o);for(;n.length&&o.length;){const e=n.pop(),t=o.pop();if(!shallow_cmp(e,t))return !1;if(e._children_backwards(i),t._children_backwards(r),n.length!==o.length)return !1}return 0==n.length&&0==o.length},mkshallow=e=>{const t=Object.keys(e).map((t=>{if("eq"===e[t])return `this.${t} === other.${t}`;if("exist"===e[t])return `(this.${t} == null ? other.${t} == null : this.${t} === other.${t})`;throw new Error(`mkshallow: Unexpected instruction: ${e[t]}`)})).join(" && ");return new Function("other","return "+t)},pass_through=()=>!0;AST_Node.prototype.shallow_cmp=function(){throw new Error("did not find a shallow_cmp function for "+this.constructor.name)},AST_Debugger.prototype.shallow_cmp=pass_through,AST_Directive.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_SimpleStatement.prototype.shallow_cmp=pass_through,AST_Block.prototype.shallow_cmp=pass_through,AST_EmptyStatement.prototype.shallow_cmp=pass_through,AST_LabeledStatement.prototype.shallow_cmp=mkshallow({"label.name":"eq"}),AST_Do.prototype.shallow_cmp=pass_through,AST_While.prototype.shallow_cmp=pass_through,AST_For.prototype.shallow_cmp=mkshallow({init:"exist",condition:"exist",step:"exist"}),AST_ForIn.prototype.shallow_cmp=pass_through,AST_ForOf.prototype.shallow_cmp=pass_through,AST_With.prototype.shallow_cmp=pass_through,AST_Toplevel.prototype.shallow_cmp=pass_through,AST_Expansion.prototype.shallow_cmp=pass_through,AST_Lambda.prototype.shallow_cmp=mkshallow({is_generator:"eq",async:"eq"}),AST_Destructuring.prototype.shallow_cmp=mkshallow({is_array:"eq"}),AST_PrefixedTemplateString.prototype.shallow_cmp=pass_through,AST_TemplateString.prototype.shallow_cmp=pass_through,AST_TemplateSegment.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_Jump.prototype.shallow_cmp=pass_through,AST_LoopControl.prototype.shallow_cmp=pass_through,AST_Await.prototype.shallow_cmp=pass_through,AST_Yield.prototype.shallow_cmp=mkshallow({is_star:"eq"}),AST_If.prototype.shallow_cmp=mkshallow({alternative:"exist"}),AST_Switch.prototype.shallow_cmp=pass_through,AST_SwitchBranch.prototype.shallow_cmp=pass_through,AST_Try.prototype.shallow_cmp=mkshallow({bcatch:"exist",bfinally:"exist"}),AST_Catch.prototype.shallow_cmp=mkshallow({argname:"exist"}),AST_Finally.prototype.shallow_cmp=pass_through,AST_Definitions.prototype.shallow_cmp=pass_through,AST_VarDef.prototype.shallow_cmp=mkshallow({value:"exist"}),AST_NameMapping.prototype.shallow_cmp=pass_through,AST_Import.prototype.shallow_cmp=mkshallow({imported_name:"exist",imported_names:"exist"}),AST_ImportMeta.prototype.shallow_cmp=pass_through,AST_Export.prototype.shallow_cmp=mkshallow({exported_definition:"exist",exported_value:"exist",exported_names:"exist",module_name:"eq",is_default:"eq"}),AST_Call.prototype.shallow_cmp=pass_through,AST_Sequence.prototype.shallow_cmp=pass_through,AST_PropAccess.prototype.shallow_cmp=pass_through,AST_Chain.prototype.shallow_cmp=pass_through,AST_Dot.prototype.shallow_cmp=mkshallow({property:"eq"}),AST_Unary.prototype.shallow_cmp=mkshallow({operator:"eq"}),AST_Binary.prototype.shallow_cmp=mkshallow({operator:"eq"}),AST_Conditional.prototype.shallow_cmp=pass_through,AST_Array.prototype.shallow_cmp=pass_through,AST_Object.prototype.shallow_cmp=pass_through,AST_ObjectProperty.prototype.shallow_cmp=pass_through,AST_ObjectKeyVal.prototype.shallow_cmp=mkshallow({key:"eq"}),AST_ObjectSetter.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_ObjectGetter.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_ConciseMethod.prototype.shallow_cmp=mkshallow({static:"eq",is_generator:"eq",async:"eq"}),AST_Class.prototype.shallow_cmp=mkshallow({name:"exist",extends:"exist"}),AST_ClassProperty.prototype.shallow_cmp=mkshallow({static:"eq"}),AST_Symbol.prototype.shallow_cmp=mkshallow({name:"eq"}),AST_NewTarget.prototype.shallow_cmp=pass_through,AST_This.prototype.shallow_cmp=pass_through,AST_Super.prototype.shallow_cmp=pass_through,AST_String.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_Number.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_BigInt.prototype.shallow_cmp=mkshallow({value:"eq"}),AST_RegExp.prototype.shallow_cmp=function(e){return this.value.flags===e.value.flags&&this.value.source===e.value.source},AST_Atom.prototype.shallow_cmp=pass_through;let function_defs=null,unmangleable_names=null;class SymbolDef{constructor(e,t,n){this.name=t.name,this.orig=[t],this.init=n,this.eliminated=0,this.assignments=0,this.scope=e,this.replaced=0,this.global=!1,this.export=0,this.mangled_name=null,this.undeclared=!1,this.id=SymbolDef.next_id++,this.chained=!1,this.direct_access=!1,this.escaped=0,this.recursive_refs=0,this.references=[],this.should_replace=void 0,this.single_use=!1,this.fixed=!1,Object.seal(this);}fixed_value(){return !this.fixed||this.fixed instanceof AST_Node?this.fixed:this.fixed()}unmangleable(e){return e||(e={}),!!(function_defs&&function_defs.has(this.id)&&keep_name(e.keep_fnames,this.orig[0].name))||this.global&&!e.toplevel||1&this.export||this.undeclared||!e.eval&&this.scope.pinned()||(this.orig[0]instanceof AST_SymbolLambda||this.orig[0]instanceof AST_SymbolDefun)&&keep_name(e.keep_fnames,this.orig[0].name)||this.orig[0]instanceof AST_SymbolMethod||(this.orig[0]instanceof AST_SymbolClass||this.orig[0]instanceof AST_SymbolDefClass)&&keep_name(e.keep_classnames,this.orig[0].name)}mangle(e){const t=e.cache&&e.cache.props;if(this.global&&t&&t.has(this.name))this.mangled_name=t.get(this.name);else if(!this.mangled_name&&!this.unmangleable(e)){var n=this.scope,o=this.orig[0];e.ie8&&o instanceof AST_SymbolLambda&&(n=n.parent_scope);const i=redefined_catch_def(this);this.mangled_name=i?i.mangled_name||i.name:n.next_mangled(e,this),this.global&&t&&t.set(this.name,this.mangled_name);}}}function redefined_catch_def(e){if(e.orig[0]instanceof AST_SymbolCatch&&e.scope.is_block_scope())return e.scope.get_defun_scope().variables.get(e.name)}function find_scopes_visible_from(e){const t=new Set;for(const n of new Set(e))!function e(n){null==n||t.has(n)||(t.add(n),e(n.parent_scope));}(n);return [...t]}function next_mangled(e,t){var n=e.enclosed;e:for(;;){var o=base54(++e.cname);if(!RESERVED_WORDS.has(o)&&!(t.reserved.has(o)||unmangleable_names&&unmangleable_names.has(o))){for(let e=n.length;--e>=0;){const i=n[e];if(o==(i.mangled_name||i.unmangleable(t)&&i.name))continue e}return o}}}SymbolDef.next_id=1,AST_Scope.DEFMETHOD("figure_out_scope",(function(e,{parent_scope:t=null,toplevel:n=this}={}){if(e=defaults$1(e,{cache:null,ie8:!1,safari10:!1}),!(n instanceof AST_Toplevel))throw new Error("Invalid toplevel scope");var o=this.parent_scope=t,i=new Map,r=null,a=null,s=[],u=new TreeWalker(((t,n)=>{if(t.is_block_scope()){const i=o;t.block_scope=o=new AST_Scope(t),o._block_scope=!0;const r=t instanceof AST_Catch?i.parent_scope:i;if(o.init_scope_vars(r),o.uses_with=i.uses_with,o.uses_eval=i.uses_eval,e.safari10&&(t instanceof AST_For||t instanceof AST_ForIn)&&s.push(o),t instanceof AST_Switch){const e=o;o=i,t.expression.walk(u),o=e;for(let e=0;e<t.body.length;e++)t.body[e].walk(u);}else n();return o=i,!0}if(t instanceof AST_Destructuring){const e=a;return a=t,n(),a=e,!0}if(t instanceof AST_Scope){t.init_scope_vars(o);var _=o,c=r,f=i;return r=o=t,i=new Map,n(),o=_,r=c,i=f,!0}if(t instanceof AST_LabeledStatement){var p=t.label;if(i.has(p.name))throw new Error(string_template("Label {name} defined twice",p));return i.set(p.name,p),n(),i.delete(p.name),!0}if(t instanceof AST_With)for(var d=o;d;d=d.parent_scope)d.uses_with=!0;else {if(t instanceof AST_Symbol&&(t.scope=o),t instanceof AST_Label&&(t.thedef=t,t.references=[]),t instanceof AST_SymbolLambda)r.def_function(t,"arguments"==t.name?void 0:r);else if(t instanceof AST_SymbolDefun)l((t.scope=r.parent_scope.get_defun_scope()).def_function(t,r),1);else if(t instanceof AST_SymbolClass)l(r.def_variable(t,r),1);else if(t instanceof AST_SymbolImport)o.def_variable(t);else if(t instanceof AST_SymbolDefClass)l((t.scope=r.parent_scope).def_function(t,r),1);else if(t instanceof AST_SymbolVar||t instanceof AST_SymbolLet||t instanceof AST_SymbolConst||t instanceof AST_SymbolCatch){if((S=t instanceof AST_SymbolBlockDeclaration?o.def_variable(t,null):r.def_variable(t,"SymbolVar"==t.TYPE?null:void 0)).orig.every((e=>e===t||(t instanceof AST_SymbolBlockDeclaration?e instanceof AST_SymbolLambda:!(e instanceof AST_SymbolLet||e instanceof AST_SymbolConst))))||js_error(`"${t.name}" is redeclared`,t.start.file,t.start.line,t.start.col,t.start.pos),t instanceof AST_SymbolFunarg||l(S,2),r!==o){t.mark_enclosed();var S=o.find_variable(t);t.thedef!==S&&(t.thedef=S,t.reference());}}else if(t instanceof AST_LabelRef){var m=i.get(t.name);if(!m)throw new Error(string_template("Undefined label {name} [{line},{col}]",{name:t.name,line:t.start.line,col:t.start.col}));t.thedef=m;}o instanceof AST_Toplevel||!(t instanceof AST_Export||t instanceof AST_Import)||js_error(`"${t.TYPE}" statement may only appear at the top level`,t.start.file,t.start.line,t.start.col,t.start.pos);}}));function l(e,t){if(a){var n=0;do{t++;}while(u.parent(n++)!==a)}var o=u.parent(t);if(e.export=o instanceof AST_Export?1:0){var i=o.exported_definition;(i instanceof AST_Defun||i instanceof AST_DefClass)&&o.is_default&&(e.export=2);}}if(this.walk(u),this instanceof AST_Toplevel&&(this.globals=new Map),u=new TreeWalker((e=>{if(e instanceof AST_LoopControl&&e.label)return e.label.thedef.references.push(e),!0;if(e instanceof AST_SymbolRef){var t,o=e.name;if("eval"==o&&u.parent()instanceof AST_Call)for(var i=e.scope;i&&!i.uses_eval;i=i.parent_scope)i.uses_eval=!0;return u.parent()instanceof AST_NameMapping&&u.parent(1).module_name||!(t=e.scope.find_variable(o))?(t=n.def_global(e),e instanceof AST_SymbolExport&&(t.export=1)):t.scope instanceof AST_Lambda&&"arguments"==o&&(t.scope.uses_arguments=!0),e.thedef=t,e.reference(),!e.scope.is_block_scope()||t.orig[0]instanceof AST_SymbolBlockDeclaration||(e.scope=e.scope.get_defun_scope()),!0}var r;if(e instanceof AST_SymbolCatch&&(r=redefined_catch_def(e.definition())))for(i=e.scope;i&&(push_uniq(i.enclosed,r),i!==r.scope);)i=i.parent_scope;})),this.walk(u),(e.ie8||e.safari10)&&walk$3(this,(e=>{if(e instanceof AST_SymbolCatch){var t=e.name,o=e.thedef.references,i=e.scope.get_defun_scope(),r=i.find_variable(t)||n.globals.get(t)||i.def_variable(e);return o.forEach((function(e){e.thedef=r,e.reference();})),e.thedef=r,e.reference(),!0}})),e.safari10)for(const e of s)e.parent_scope.variables.forEach((function(t){push_uniq(e.enclosed,t);}));})),AST_Toplevel.DEFMETHOD("def_global",(function(e){var t=this.globals,n=e.name;if(t.has(n))return t.get(n);var o=new SymbolDef(this,e);return o.undeclared=!0,o.global=!0,t.set(n,o),o})),AST_Scope.DEFMETHOD("init_scope_vars",(function(e){this.variables=new Map,this.functions=new Map,this.uses_with=!1,this.uses_eval=!1,this.parent_scope=e,this.enclosed=[],this.cname=-1;})),AST_Scope.DEFMETHOD("conflicting_def",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)||this.parent_scope&&this.parent_scope.conflicting_def(e)})),AST_Scope.DEFMETHOD("conflicting_def_shallow",(function(e){return this.enclosed.find((t=>t.name===e))||this.variables.has(e)})),AST_Scope.DEFMETHOD("add_child_scope",(function(e){if(e.parent_scope===this)return;e.parent_scope=this;const t=(()=>{const e=[];let t=this;do{e.push(t);}while(t=t.parent_scope);return e.reverse(),e})(),n=new Set(e.enclosed),o=[];for(const e of t){o.forEach((t=>push_uniq(e.enclosed,t)));for(const t of e.variables.values())n.has(t)&&(push_uniq(o,t),push_uniq(e.enclosed,t));}})),AST_Scope.DEFMETHOD("create_symbol",(function(e,{source:t,tentative_name:n,scope:o,conflict_scopes:i=[o],init:r=null}={}){let a;if(i=find_scopes_visible_from(i),n){n=a=n.replace(/(?:^[^a-z_$]|[^a-z0-9_$])/gi,"_");let e=0;for(;i.find((e=>e.conflicting_def_shallow(a)));)a=n+"$"+e++;}if(!a)throw new Error("No symbol name could be generated in create_symbol()");const s=make_node(e,t,{name:a,scope:o});return this.def_variable(s,r||null),s.mark_enclosed(),s})),AST_Node.DEFMETHOD("is_block_scope",return_false),AST_Class.DEFMETHOD("is_block_scope",return_false),AST_Lambda.DEFMETHOD("is_block_scope",return_false),AST_Toplevel.DEFMETHOD("is_block_scope",return_false),AST_SwitchBranch.DEFMETHOD("is_block_scope",return_false),AST_Block.DEFMETHOD("is_block_scope",return_true),AST_Scope.DEFMETHOD("is_block_scope",(function(){return this._block_scope||!1})),AST_IterationStatement.DEFMETHOD("is_block_scope",return_true),AST_Lambda.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1,this.def_variable(new AST_SymbolFunarg({name:"arguments",start:this.start,end:this.end}));})),AST_Arrow.DEFMETHOD("init_scope_vars",(function(){AST_Scope.prototype.init_scope_vars.apply(this,arguments),this.uses_arguments=!1;})),AST_Symbol.DEFMETHOD("mark_enclosed",(function(){for(var e=this.definition(),t=this.scope;t&&(push_uniq(t.enclosed,e),t!==e.scope);)t=t.parent_scope;})),AST_Symbol.DEFMETHOD("reference",(function(){this.definition().references.push(this),this.mark_enclosed();})),AST_Scope.DEFMETHOD("find_variable",(function(e){return e instanceof AST_Symbol&&(e=e.name),this.variables.get(e)||this.parent_scope&&this.parent_scope.find_variable(e)})),AST_Scope.DEFMETHOD("def_function",(function(e,t){var n=this.def_variable(e,t);return (!n.init||n.init instanceof AST_Defun)&&(n.init=t),this.functions.set(e.name,n),n})),AST_Scope.DEFMETHOD("def_variable",(function(e,t){var n=this.variables.get(e.name);return n?(n.orig.push(e),n.init&&(n.scope!==e.scope||n.init instanceof AST_Function)&&(n.init=t)):(n=new SymbolDef(this,e,t),this.variables.set(e.name,n),n.global=!this.parent_scope),e.thedef=n})),AST_Scope.DEFMETHOD("next_mangled",(function(e){return next_mangled(this,e)})),AST_Toplevel.DEFMETHOD("next_mangled",(function(e){let t;const n=this.mangled_names;do{t=next_mangled(this,e);}while(n.has(t));return t})),AST_Function.DEFMETHOD("next_mangled",(function(e,t){for(var n=t.orig[0]instanceof AST_SymbolFunarg&&this.name&&this.name.definition(),o=n?n.mangled_name||n.name:null;;){var i=next_mangled(this,e);if(!o||o!=i)return i}})),AST_Symbol.DEFMETHOD("unmangleable",(function(e){var t=this.definition();return !t||t.unmangleable(e)})),AST_Label.DEFMETHOD("unmangleable",return_false),AST_Symbol.DEFMETHOD("unreferenced",(function(){return !this.definition().references.length&&!this.scope.pinned()})),AST_Symbol.DEFMETHOD("definition",(function(){return this.thedef})),AST_Symbol.DEFMETHOD("global",(function(){return this.thedef.global})),AST_Toplevel.DEFMETHOD("_default_mangler_options",(function(e){return (e=defaults$1(e,{eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,reserved:[],toplevel:!1})).module&&(e.toplevel=!0),Array.isArray(e.reserved)||e.reserved instanceof Set||(e.reserved=[]),e.reserved=new Set(e.reserved),e.reserved.add("arguments"),e})),AST_Toplevel.DEFMETHOD("mangle_names",(function(e){e=this._default_mangler_options(e);var t=-1,n=[];e.keep_fnames&&(function_defs=new Set);const o=this.mangled_names=new Set;e.cache&&(this.globals.forEach(r),e.cache.props&&e.cache.props.forEach((function(e){o.add(e);})));var i=new TreeWalker((function(o,i){if(o instanceof AST_LabeledStatement){var a=t;return i(),t=a,!0}if(o instanceof AST_Scope)o.variables.forEach(r);else if(o.is_block_scope())o.block_scope.variables.forEach(r);else if(function_defs&&o instanceof AST_VarDef&&o.value instanceof AST_Lambda&&!o.value.name&&keep_name(e.keep_fnames,o.name.name))function_defs.add(o.name.definition().id);else {if(o instanceof AST_Label){let e;do{e=base54(++t);}while(RESERVED_WORDS.has(e));return o.mangled_name=e,!0}!e.ie8&&!e.safari10&&o instanceof AST_SymbolCatch&&n.push(o.definition());}}));function r(t){!(e.reserved.has(t.name)||1&t.export)&&n.push(t);}this.walk(i),(e.keep_fnames||e.keep_classnames)&&(unmangleable_names=new Set,n.forEach((t=>{t.name.length<6&&t.unmangleable(e)&&unmangleable_names.add(t.name);}))),n.forEach((t=>{t.mangle(e);})),function_defs=null,unmangleable_names=null;})),AST_Toplevel.DEFMETHOD("find_colliding_names",(function(e){const t=e.cache&&e.cache.props,n=new Set;return e.reserved.forEach(o),this.globals.forEach(i),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(i),e instanceof AST_SymbolCatch&&i(e.definition());}))),n;function o(e){n.add(e);}function i(n){var i=n.name;if(n.global&&t&&t.has(i))i=t.get(i);else if(!n.unmangleable(e))return;o(i);}})),AST_Toplevel.DEFMETHOD("expand_names",(function(e){base54.reset(),base54.sort(),e=this._default_mangler_options(e);var t=this.find_colliding_names(e),n=0;function o(o){if(o.global&&e.cache)return;if(o.unmangleable(e))return;if(e.reserved.has(o.name))return;const i=redefined_catch_def(o),r=o.name=i?i.name:function(){var e;do{e=base54(n++);}while(t.has(e)||RESERVED_WORDS.has(e));return e}();o.orig.forEach((function(e){e.name=r;})),o.references.forEach((function(e){e.name=r;}));}this.globals.forEach(o),this.walk(new TreeWalker((function(e){e instanceof AST_Scope&&e.variables.forEach(o),e instanceof AST_SymbolCatch&&o(e.definition());})));})),AST_Node.DEFMETHOD("tail_node",return_this),AST_Sequence.DEFMETHOD("tail_node",(function(){return this.expressions[this.expressions.length-1]})),AST_Toplevel.DEFMETHOD("compute_char_frequency",(function(e){e=this._default_mangler_options(e);try{AST_Node.prototype.print=function(n,o){this._print(n,o),this instanceof AST_Symbol&&!this.unmangleable(e)?base54.consider(this.name,-1):e.properties&&(this instanceof AST_DotHash?base54.consider("#"+this.property,-1):this instanceof AST_Dot?base54.consider(this.property,-1):this instanceof AST_Sub&&t(this.property));},base54.consider(this.print_to_string(),1);}finally{AST_Node.prototype.print=AST_Node.prototype._print;}function t(e){e instanceof AST_String?base54.consider(e.value,-1):e instanceof AST_Conditional?(t(e.consequent),t(e.alternative)):e instanceof AST_Sequence&&t(e.tail_node());}base54.sort();}));const base54=(()=>{const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_".split(""),t="0123456789".split("");let n,o;function i(){o=new Map,e.forEach((function(e){o.set(e,0);})),t.forEach((function(e){o.set(e,0);}));}function r(e,t){return o.get(t)-o.get(e)}function a(e){var t="",o=54;e++;do{e--,t+=n[e%o],e=Math.floor(e/o),o=64;}while(e>0);return t}return a.consider=function(e,t){for(var n=e.length;--n>=0;)o.set(e[n],o.get(e[n])+t);},a.sort=function(){n=mergeSort(e,r).concat(mergeSort(t,r));},a.reset=i,i(),a})();let mangle_options;AST_Node.prototype.size=function(e,t){mangle_options=e&&e.mangle_options;let n=0;return walk_parent(this,((e,t)=>{if(n+=e._size(t),e instanceof AST_Arrow&&e.is_braceless())return n+=e.body[0].value._size(t),!0}),t||e&&e.stack),mangle_options=void 0,n},AST_Node.prototype._size=()=>0,AST_Debugger.prototype._size=()=>8,AST_Directive.prototype._size=function(){return 2+this.value.length};const list_overhead=e=>e.length&&e.length-1;AST_Block.prototype._size=function(){return 2+list_overhead(this.body)},AST_Toplevel.prototype._size=function(){return list_overhead(this.body)},AST_EmptyStatement.prototype._size=()=>1,AST_LabeledStatement.prototype._size=()=>2,AST_Do.prototype._size=()=>9,AST_While.prototype._size=()=>7,AST_For.prototype._size=()=>8,AST_ForIn.prototype._size=()=>8,AST_With.prototype._size=()=>6,AST_Expansion.prototype._size=()=>3;const lambda_modifiers=e=>(e.is_generator?1:0)+(e.async?6:0);AST_Accessor.prototype._size=function(){return lambda_modifiers(this)+4+list_overhead(this.argnames)+list_overhead(this.body)},AST_Function.prototype._size=function(e){return 2*!!first_in_statement(e)+lambda_modifiers(this)+12+list_overhead(this.argnames)+list_overhead(this.body)},AST_Defun.prototype._size=function(){return lambda_modifiers(this)+13+list_overhead(this.argnames)+list_overhead(this.body)},AST_Arrow.prototype._size=function(){let e=2+list_overhead(this.argnames);1===this.argnames.length&&this.argnames[0]instanceof AST_Symbol||(e+=2);const t=this.is_braceless()?0:list_overhead(this.body)+2;return lambda_modifiers(this)+e+t},AST_Destructuring.prototype._size=()=>2,AST_TemplateString.prototype._size=function(){return 2+3*Math.floor(this.segments.length/2)},AST_TemplateSegment.prototype._size=function(){return this.value.length},AST_Return.prototype._size=function(){return this.value?7:6},AST_Throw.prototype._size=()=>6,AST_Break.prototype._size=function(){return this.label?6:5},AST_Continue.prototype._size=function(){return this.label?9:8},AST_If.prototype._size=()=>4,AST_Switch.prototype._size=function(){return 8+list_overhead(this.body)},AST_Case.prototype._size=function(){return 5+list_overhead(this.body)},AST_Default.prototype._size=function(){return 8+list_overhead(this.body)},AST_Try.prototype._size=function(){return 3+list_overhead(this.body)},AST_Catch.prototype._size=function(){let e=7+list_overhead(this.body);return this.argname&&(e+=2),e},AST_Finally.prototype._size=function(){return 7+list_overhead(this.body)};const def_size=(e,t)=>e+list_overhead(t.definitions);AST_Var.prototype._size=function(){return def_size(4,this)},AST_Let.prototype._size=function(){return def_size(4,this)},AST_Const.prototype._size=function(){return def_size(6,this)},AST_VarDef.prototype._size=function(){return this.value?1:0},AST_NameMapping.prototype._size=function(){return this.name?4:0},AST_Import.prototype._size=function(){let e=6;return this.imported_name&&(e+=1),(this.imported_name||this.imported_names)&&(e+=5),this.imported_names&&(e+=2+list_overhead(this.imported_names)),e},AST_ImportMeta.prototype._size=()=>11,AST_Export.prototype._size=function(){let e=7+(this.is_default?8:0);return this.exported_value&&(e+=this.exported_value._size()),this.exported_names&&(e+=2+list_overhead(this.exported_names)),this.module_name&&(e+=5),e},AST_Call.prototype._size=function(){return this.optional?4+list_overhead(this.args):2+list_overhead(this.args)},AST_New.prototype._size=function(){return 6+list_overhead(this.args)},AST_Sequence.prototype._size=function(){return list_overhead(this.expressions)},AST_Dot.prototype._size=function(){return this.optional?this.property.length+2:this.property.length+1},AST_DotHash.prototype._size=function(){return this.optional?this.property.length+3:this.property.length+2},AST_Sub.prototype._size=function(){return this.optional?4:2},AST_Unary.prototype._size=function(){return "typeof"===this.operator?7:"void"===this.operator?5:this.operator.length},AST_Binary.prototype._size=function(e){if("in"===this.operator)return 4;let t=this.operator.length;return ("+"===this.operator||"-"===this.operator)&&this.right instanceof AST_Unary&&this.right.operator===this.operator&&(t+=1),this.needs_parens(e)&&(t+=2),t},AST_Conditional.prototype._size=()=>3,AST_Array.prototype._size=function(){return 2+list_overhead(this.elements)},AST_Object.prototype._size=function(e){let t=2;return first_in_statement(e)&&(t+=2),t+list_overhead(this.properties)};const key_size=e=>"string"==typeof e?e.length:0;AST_ObjectKeyVal.prototype._size=function(){return key_size(this.key)+1};const static_size=e=>e?7:0;AST_ObjectGetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ObjectSetter.prototype._size=function(){return 5+static_size(this.static)+key_size(this.key)},AST_ConciseMethod.prototype._size=function(){return static_size(this.static)+key_size(this.key)+lambda_modifiers(this)},AST_PrivateMethod.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+1},AST_PrivateGetter.prototype._size=AST_PrivateSetter.prototype._size=function(){return AST_ConciseMethod.prototype._size.call(this)+4},AST_Class.prototype._size=function(){return (this.name?8:7)+(this.extends?8:0)},AST_ClassProperty.prototype._size=function(){return static_size(this.static)+("string"==typeof this.key?this.key.length+2:0)+(this.value?1:0)},AST_ClassPrivateProperty.prototype._size=function(){return AST_ClassProperty.prototype._size.call(this)+1},AST_Symbol.prototype._size=function(){return !mangle_options||this.definition().unmangleable(mangle_options)?this.name.length:1},AST_SymbolClassProperty.prototype._size=function(){return this.name.length},AST_SymbolRef.prototype._size=AST_SymbolDeclaration.prototype._size=function(){const{name:e,thedef:t}=this;return t&&t.global?e.length:"arguments"===e?9:AST_Symbol.prototype._size.call(this)},AST_NewTarget.prototype._size=()=>10,AST_SymbolImportForeign.prototype._size=function(){return this.name.length},AST_SymbolExportForeign.prototype._size=function(){return this.name.length},AST_This.prototype._size=()=>4,AST_Super.prototype._size=()=>5,AST_String.prototype._size=function(){return this.value.length+2},AST_Number.prototype._size=function(){const{value:e}=this;return 0===e?1:e>0&&Math.floor(e)===e?Math.floor(Math.log10(e)+1):e.toString().length},AST_BigInt.prototype._size=function(){return this.value.length},AST_RegExp.prototype._size=function(){return this.value.toString().length},AST_Null.prototype._size=()=>4,AST_NaN.prototype._size=()=>3,AST_Undefined.prototype._size=()=>6,AST_Hole.prototype._size=()=>0,AST_Infinity.prototype._size=()=>8,AST_True.prototype._size=()=>4,AST_False.prototype._size=()=>5,AST_Await.prototype._size=()=>6,AST_Yield.prototype._size=()=>6;const TOP=1024,has_flag=(e,t)=>e.flags&t,set_flag=(e,t)=>{e.flags|=t;},clear_flag=(e,t)=>{e.flags&=~t;};class Compressor extends TreeWalker{constructor(e,{false_by_default:t=!1,mangle_options:n=!1}){super(),void 0===e.defaults||e.defaults||(t=!0),this.options=defaults$1(e,{arguments:!1,arrows:!t,booleans:!t,booleans_as_integers:!1,collapse_vars:!t,comparisons:!t,computed_props:!t,conditionals:!t,dead_code:!t,defaults:!0,directives:!t,drop_console:!1,drop_debugger:!t,ecma:5,evaluate:!t,expression:!1,global_defs:!1,hoist_funs:!1,hoist_props:!t,hoist_vars:!1,ie8:!1,if_return:!t,inline:!t,join_vars:!t,keep_classnames:!1,keep_fargs:!0,keep_fnames:!1,keep_infinity:!1,loops:!t,module:!1,negate_iife:!t,passes:1,properties:!t,pure_getters:!t&&"strict",pure_funcs:null,reduce_funcs:null,reduce_vars:!t,sequences:!t,side_effects:!t,switches:!t,top_retain:null,toplevel:!(!e||!e.top_retain),typeofs:!t,unsafe:!1,unsafe_arrows:!1,unsafe_comps:!1,unsafe_Function:!1,unsafe_math:!1,unsafe_symbols:!1,unsafe_methods:!1,unsafe_proto:!1,unsafe_regexp:!1,unsafe_undefined:!1,unused:!t,warnings:!1},!0);var o=this.options.global_defs;if("object"==typeof o)for(var i in o)"@"===i[0]&&HOP(o,i)&&(o[i.slice(1)]=parse$5(o[i],{expression:!0}));!0===this.options.inline&&(this.options.inline=3);var r=this.options.pure_funcs;this.pure_funcs="function"==typeof r?r:r?function(e){return !r.includes(e.expression.print_to_string())}:return_true;var a=this.options.top_retain;a instanceof RegExp?this.top_retain=function(e){return a.test(e.name)}:"function"==typeof a?this.top_retain=a:a&&("string"==typeof a&&(a=a.split(/,/)),this.top_retain=function(e){return a.includes(e.name)}),this.options.module&&(this.directives["use strict"]=!0,this.options.toplevel=!0);var s=this.options.toplevel;this.toplevel="string"==typeof s?{funcs:/funcs/.test(s),vars:/vars/.test(s)}:{funcs:s,vars:s};var u=this.options.sequences;this.sequences_limit=1==u?800:0|u,this.evaluated_regexps=new Map,this._toplevel=void 0,this.mangle_options=n;}option(e){return this.options[e]}exposed(e){if(e.export)return !0;if(e.global)for(var t=0,n=e.orig.length;t<n;t++)if(!this.toplevel[e.orig[t]instanceof AST_SymbolDefun?"funcs":"vars"])return !0;return !1}in_boolean_context(){if(!this.option("booleans"))return !1;for(var e,t=this.self(),n=0;e=this.parent(n);n++){if(e instanceof AST_SimpleStatement||e instanceof AST_Conditional&&e.condition===t||e instanceof AST_DWLoop&&e.condition===t||e instanceof AST_For&&e.condition===t||e instanceof AST_If&&e.condition===t||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression===t)return !0;if(!(e instanceof AST_Binary&&("&&"==e.operator||"||"==e.operator||"??"==e.operator)||e instanceof AST_Conditional||e.tail_node()===t))return !1;t=e;}}get_toplevel(){return this._toplevel}compress(e){e=e.resolve_defines(this),this._toplevel=e,this.option("expression")&&this._toplevel.process_expression(!0);for(var t=+this.options.passes||1,n=1/0,o=!1,i={ie8:this.option("ie8")},r=0;r<t;r++)if(this._toplevel.figure_out_scope(i),0===r&&this.option("drop_console")&&(this._toplevel=this._toplevel.drop_console()),(r>0||this.option("reduce_vars"))&&this._toplevel.reset_opt_flags(this),this._toplevel=this._toplevel.transform(this),t>1){let e=0;if(walk$3(this._toplevel,(()=>{e++;})),e<n)n=e,o=!1;else {if(o)break;o=!0;}}return this.option("expression")&&this._toplevel.process_expression(!1),e=this._toplevel,this._toplevel=void 0,e}before(e,t){if(has_flag(e,256))return e;var n=!1;e instanceof AST_Scope&&(e=(e=e.hoist_properties(this)).hoist_declarations(this),n=!0),t(e,this),t(e,this);var o=e.optimize(this);return n&&o instanceof AST_Scope&&(o.drop_unused(this),t(o,this)),o===e&&set_flag(o,256),o}}function def_optimize(e,t){e.DEFMETHOD("optimize",(function(e){var n=this;if(has_flag(n,512))return n;if(e.has_directive("use asm"))return n;var o=t(n,e);return set_flag(o,512),o}));}function read_property(e,t){if(!((t=get_value(t))instanceof AST_Node)){var n;if(e instanceof AST_Array){var o=e.elements;if("length"==t)return make_node_from_constant(o.length,e);"number"==typeof t&&t in o&&(n=o[t]);}else if(e instanceof AST_Object){t=""+t;for(var i=e.properties,r=i.length;--r>=0;){if(!(i[r]instanceof AST_ObjectKeyVal))return;n||i[r].key!==t||(n=i[r].value);}}return n instanceof AST_SymbolRef&&n.fixed_value()||n}}function is_modified(e,t,n,o,i,r){var a=t.parent(i),s=is_lhs(n,a);if(s)return s;if(!r&&a instanceof AST_Call&&a.expression===n&&!(o instanceof AST_Arrow)&&!(o instanceof AST_Class)&&!a.is_expr_pure(e)&&(!(o instanceof AST_Function)||!(a instanceof AST_New)&&o.contains_this()))return !0;if(a instanceof AST_Array)return is_modified(e,t,a,a,i+1);if(a instanceof AST_ObjectKeyVal&&n===a.value){var u=t.parent(i+1);return is_modified(e,t,u,u,i+2)}if(a instanceof AST_PropAccess&&a.expression===n){var l=read_property(o,a.property);return !r&&is_modified(e,t,a,l,i+1)}}function is_func_expr(e){return e instanceof AST_Arrow||e instanceof AST_Function}function is_lhs_read_only(e){if(e instanceof AST_This)return !0;if(e instanceof AST_SymbolRef)return e.definition().orig[0]instanceof AST_SymbolLambda;if(e instanceof AST_PropAccess){if((e=e.expression)instanceof AST_SymbolRef){if(e.is_immutable())return !1;e=e.fixed_value();}return !e||!(e instanceof AST_RegExp)&&(e instanceof AST_Constant||is_lhs_read_only(e))}return !1}function is_ref_of(e,t){if(!(e instanceof AST_SymbolRef))return !1;for(var n=e.definition().orig,o=n.length;--o>=0;)if(n[o]instanceof t)return !0}function find_scope(e){for(let t=0;;t++){const n=e.parent(t);if(n instanceof AST_Toplevel)return n;if(n instanceof AST_Lambda)return n;if(n.block_scope)return n.block_scope}}function find_variable(e,t){for(var n,o=0;(n=e.parent(o++))&&!(n instanceof AST_Scope);)if(n instanceof AST_Catch&&n.argname){n=n.argname.definition().scope;break}return n.find_variable(t)}function make_sequence(e,t){if(1==t.length)return t[0];if(0==t.length)throw new Error("trying to create a sequence with length zero!");return make_node(AST_Sequence,e,{expressions:t.reduce(merge_sequence,[])})}function make_node_from_constant(e,t){switch(typeof e){case"string":return make_node(AST_String,t,{value:e});case"number":return isNaN(e)?make_node(AST_NaN,t):isFinite(e)?1/e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Number,t,{value:-e})}):make_node(AST_Number,t,{value:e}):e<0?make_node(AST_UnaryPrefix,t,{operator:"-",expression:make_node(AST_Infinity,t)}):make_node(AST_Infinity,t);case"boolean":return make_node(e?AST_True:AST_False,t);case"undefined":return make_node(AST_Undefined,t);default:if(null===e)return make_node(AST_Null,t,{value:null});if(e instanceof RegExp)return make_node(AST_RegExp,t,{value:{source:regexp_source_fix(e.source),flags:e.flags}});throw new Error(string_template("Can't handle constant of type: {type}",{type:typeof e}))}}function maintain_this_binding(e,t,n){return e instanceof AST_UnaryPrefix&&"delete"==e.operator||e instanceof AST_Call&&e.expression===t&&(n instanceof AST_PropAccess||n instanceof AST_SymbolRef&&"eval"==n.name)?make_sequence(t,[make_node(AST_Number,t,{value:0}),n]):n}function merge_sequence(e,t){return t instanceof AST_Sequence?e.push(...t.expressions):e.push(t),e}function as_statement_array(e){if(null===e)return [];if(e instanceof AST_BlockStatement)return e.body;if(e instanceof AST_EmptyStatement)return [];if(e instanceof AST_Statement)return [e];throw new Error("Can't convert thing to statement array")}function is_empty(e){return null===e||e instanceof AST_EmptyStatement||e instanceof AST_BlockStatement&&0==e.body.length}function can_be_evicted_from_block(e){return !(e instanceof AST_DefClass||e instanceof AST_Defun||e instanceof AST_Let||e instanceof AST_Const||e instanceof AST_Export||e instanceof AST_Import)}function loop_body(e){return e instanceof AST_IterationStatement&&e.body instanceof AST_BlockStatement?e.body:e}function is_iife_call(e){return "Call"==e.TYPE&&(e.expression instanceof AST_Function||is_iife_call(e.expression))}function is_undeclared_ref(e){return e instanceof AST_SymbolRef&&e.definition().undeclared}def_optimize(AST_Node,(function(e){return e})),AST_Toplevel.DEFMETHOD("drop_console",(function(){return this.transform(new TreeTransformer((function(e){if("Call"==e.TYPE){var t=e.expression;if(t instanceof AST_PropAccess){for(var n=t.expression;n.expression;)n=n.expression;if(is_undeclared_ref(n)&&"console"==n.name)return make_node(AST_Undefined,e)}}})))})),AST_Node.DEFMETHOD("equivalent_to",(function(e){return equivalent_to(this,e)})),AST_Scope.DEFMETHOD("process_expression",(function(e,t){var n=this,o=new TreeTransformer((function(i){if(e&&i instanceof AST_SimpleStatement)return make_node(AST_Return,i,{value:i.body});if(!e&&i instanceof AST_Return){if(t){var r=i.value&&i.value.drop_side_effect_free(t,!0);return r?make_node(AST_SimpleStatement,i,{body:r}):make_node(AST_EmptyStatement,i)}return make_node(AST_SimpleStatement,i,{body:i.value||make_node(AST_UnaryPrefix,i,{operator:"void",expression:make_node(AST_Number,i,{value:0})})})}if(i instanceof AST_Class||i instanceof AST_Lambda&&i!==n)return i;if(i instanceof AST_Block){var a=i.body.length-1;a>=0&&(i.body[a]=i.body[a].transform(o));}else i instanceof AST_If?(i.body=i.body.transform(o),i.alternative&&(i.alternative=i.alternative.transform(o))):i instanceof AST_With&&(i.body=i.body.transform(o));return i}));n.transform(o);})),function(e){function t(e,t){t.assignments=0,t.chained=!1,t.direct_access=!1,t.escaped=0,t.recursive_refs=0,t.references=[],t.single_use=void 0,t.scope.pinned()?t.fixed=!1:t.orig[0]instanceof AST_SymbolConst||!e.exposed(t)?t.fixed=t.init:t.fixed=!1;}function n(e,n,o){o.variables.forEach((function(o){t(n,o),null===o.fixed?(e.defs_to_safe_ids.set(o.id,e.safe_ids),a(e,o,!0)):o.fixed&&(e.loop_ids.set(o.id,e.in_loop),a(e,o,!0));}));}function o(e,n){n.block_scope&&n.block_scope.variables.forEach((n=>{t(e,n);}));}function i(e){e.safe_ids=Object.create(e.safe_ids);}function r(e){e.safe_ids=Object.getPrototypeOf(e.safe_ids);}function a(e,t,n){e.safe_ids[t.id]=n;}function s(e,t){if("m"==t.single_use)return !1;if(e.safe_ids[t.id]){if(null==t.fixed){var n=t.orig[0];if(n instanceof AST_SymbolFunarg||"arguments"==n.name)return !1;t.fixed=make_node(AST_Undefined,n);}return !0}return t.fixed instanceof AST_Defun}function u(e,t,n,o){if(void 0===t.fixed)return !0;let i;return null===t.fixed&&(i=e.defs_to_safe_ids.get(t.id))?(i[t.id]=!1,e.defs_to_safe_ids.delete(t.id),!0):!!HOP(e.safe_ids,t.id)&&!!s(e,t)&&!1!==t.fixed&&!(null!=t.fixed&&(!o||t.references.length>t.assignments))&&(t.fixed instanceof AST_Defun?o instanceof AST_Node&&t.fixed.parent_scope===n:t.orig.every((e=>!(e instanceof AST_SymbolConst||e instanceof AST_SymbolDefun||e instanceof AST_SymbolLambda))))}function l(e,t,n,o,i,r=0,a=1){var s=e.parent(r);if(i){if(i.is_constant())return;if(i instanceof AST_ClassExpression)return}if(s instanceof AST_Assign&&("="===s.operator||s.logical)&&o===s.right||s instanceof AST_Call&&(o!==s.expression||s instanceof AST_New)||s instanceof AST_Exit&&o===s.value&&o.scope!==t.scope||s instanceof AST_VarDef&&o===s.value||s instanceof AST_Yield&&o===s.value&&o.scope!==t.scope)return !(a>1)||i&&i.is_constant_expression(n)||(a=1),void((!t.escaped||t.escaped>a)&&(t.escaped=a));if(s instanceof AST_Array||s instanceof AST_Await||s instanceof AST_Binary&&lazy_op.has(s.operator)||s instanceof AST_Conditional&&o!==s.condition||s instanceof AST_Expansion||s instanceof AST_Sequence&&o===s.tail_node())l(e,t,n,s,s,r+1,a);else if(s instanceof AST_ObjectKeyVal&&o===s.value){var u=e.parent(r+1);l(e,t,n,u,u,r+2,a);}else if(s instanceof AST_PropAccess&&o===s.expression&&(l(e,t,n,s,i=read_property(i,s.property),r+1,a+1),i))return;r>0||s instanceof AST_Sequence&&o!==s.tail_node()||s instanceof AST_SimpleStatement||(t.direct_access=!0);}e(AST_Node,noop);const _=e=>walk$3(e,(e=>{if(e instanceof AST_Symbol){var t=e.definition();t&&(e instanceof AST_SymbolRef&&t.references.push(e),t.fixed=!1);}}));e(AST_Accessor,(function(e,t,o){return i(e),n(e,o,this),t(),r(e),!0})),e(AST_Assign,(function(e,t,n){var o=this;if(o.left instanceof AST_Destructuring)return void _(o.left);const s=()=>{if(o.logical)return o.left.walk(e),i(e),o.right.walk(e),r(e),!0};var c=o.left;if(!(c instanceof AST_SymbolRef))return s();var f=c.definition(),p=u(e,f,c.scope,o.right);if(f.assignments++,!p)return s();var d=f.fixed;if(!d&&"="!=o.operator&&!o.logical)return s();var S="="==o.operator,m=S?o.right:o;return is_modified(n,e,o,m,0)?s():(f.references.push(c),o.logical||(S||(f.chained=!0),f.fixed=S?function(){return o.right}:function(){return make_node(AST_Binary,o,{operator:o.operator.slice(0,-1),left:d instanceof AST_Node?d:d(),right:o.right})}),o.logical?(a(e,f,!1),i(e),o.right.walk(e),r(e),!0):(a(e,f,!1),o.right.walk(e),a(e,f,!0),l(e,f,c.scope,o,m,0,1),!0))})),e(AST_Binary,(function(e){if(lazy_op.has(this.operator))return this.left.walk(e),i(e),this.right.walk(e),r(e),!0})),e(AST_Block,(function(e,t,n){o(n,this);})),e(AST_Case,(function(e){return i(e),this.expression.walk(e),r(e),i(e),walk_body(this,e),r(e),!0})),e(AST_Class,(function(e,t){return clear_flag(this,16),i(e),t(),r(e),!0})),e(AST_Conditional,(function(e){return this.condition.walk(e),i(e),this.consequent.walk(e),r(e),i(e),this.alternative.walk(e),r(e),!0})),e(AST_Chain,(function(e,t){const n=e.safe_ids;return t(),e.safe_ids=n,!0})),e(AST_Call,(function(e){this.expression.walk(e),this.optional&&i(e);for(const t of this.args)t.walk(e);return !0})),e(AST_PropAccess,(function(e){if(this.optional)return this.expression.walk(e),i(e),this.property instanceof AST_Node&&this.property.walk(e),!0})),e(AST_Default,(function(e,t){return i(e),t(),r(e),!0})),e(AST_Lambda,(function(e,t,o){return clear_flag(this,16),i(e),n(e,o,this),this.uses_arguments?(t(),void r(e)):(!this.name&&(s=e.parent())instanceof AST_Call&&s.expression===this&&!s.args.some((e=>e instanceof AST_Expansion))&&this.argnames.every((e=>e instanceof AST_Symbol))&&this.argnames.forEach(((t,n)=>{if(t.definition){var o=t.definition();o.orig.length>1||(void 0!==o.fixed||this.uses_arguments&&!e.has_directive("use strict")?o.fixed=!1:(o.fixed=function(){return s.args[n]||make_node(AST_Undefined,s)},e.loop_ids.set(o.id,e.in_loop),a(e,o,!0)));}})),t(),r(e),!0);var s;})),e(AST_Do,(function(e,t,n){o(n,this);const a=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),has_break_or_continue(this)&&(r(e),i(e)),this.condition.walk(e),r(e),e.in_loop=a,!0})),e(AST_For,(function(e,t,n){o(n,this),this.init&&this.init.walk(e);const a=e.in_loop;return e.in_loop=this,i(e),this.condition&&this.condition.walk(e),this.body.walk(e),this.step&&(has_break_or_continue(this)&&(r(e),i(e)),this.step.walk(e)),r(e),e.in_loop=a,!0})),e(AST_ForIn,(function(e,t,n){o(n,this),_(this.init),this.object.walk(e);const a=e.in_loop;return e.in_loop=this,i(e),this.body.walk(e),r(e),e.in_loop=a,!0})),e(AST_If,(function(e){return this.condition.walk(e),i(e),this.body.walk(e),r(e),this.alternative&&(i(e),this.alternative.walk(e),r(e)),!0})),e(AST_LabeledStatement,(function(e){return i(e),this.body.walk(e),r(e),!0})),e(AST_SymbolCatch,(function(){this.definition().fixed=!1;})),e(AST_SymbolRef,(function(e,t,n){var o,i,r=this.definition();r.references.push(this),1==r.references.length&&!r.fixed&&r.orig[0]instanceof AST_SymbolDefun&&e.loop_ids.set(r.id,e.in_loop),void 0!==r.fixed&&s(e,r)?r.fixed&&((o=this.fixed_value())instanceof AST_Lambda&&recursive_ref(e,r)?r.recursive_refs++:o&&!n.exposed(r)&&function(e,t,n){return t.option("unused")&&!n.scope.pinned()&&n.references.length-n.recursive_refs==1&&e.loop_ids.get(n.id)===e.in_loop}(e,n,r)?r.single_use=o instanceof AST_Lambda&&!o.pinned()||o instanceof AST_Class||r.scope===this.scope&&o.is_constant_expression():r.single_use=!1,is_modified(n,e,this,o,0,!!(i=o)&&(i.is_constant()||i instanceof AST_Lambda||i instanceof AST_This))&&(r.single_use?r.single_use="m":r.fixed=!1)):r.fixed=!1,l(e,r,this.scope,this,o,0,1);})),e(AST_Toplevel,(function(e,o,i){this.globals.forEach((function(e){t(i,e);})),n(e,i,this);})),e(AST_Try,(function(e,t,n){return o(n,this),i(e),walk_body(this,e),r(e),this.bcatch&&(i(e),this.bcatch.walk(e),r(e)),this.bfinally&&this.bfinally.walk(e),!0})),e(AST_Unary,(function(e){var t=this;if("++"===t.operator||"--"===t.operator){var n=t.expression;if(n instanceof AST_SymbolRef){var o=n.definition(),i=u(e,o,n.scope,!0);if(o.assignments++,i){var r=o.fixed;if(r)return o.references.push(n),o.chained=!0,o.fixed=function(){return make_node(AST_Binary,t,{operator:t.operator.slice(0,-1),left:make_node(AST_UnaryPrefix,t,{operator:"+",expression:r instanceof AST_Node?r:r()}),right:make_node(AST_Number,t,{value:1})})},a(e,o,!0),!0}}}})),e(AST_VarDef,(function(e,t){var n=this;if(n.name instanceof AST_Destructuring)_(n.name);else {var o=n.name.definition();if(n.value){if(u(e,o,n.name.scope,n.value))return o.fixed=function(){return n.value},e.loop_ids.set(o.id,e.in_loop),a(e,o,!1),t(),a(e,o,!0),!0;o.fixed=!1;}}})),e(AST_While,(function(e,t,n){o(n,this);const a=e.in_loop;return e.in_loop=this,i(e),t(),r(e),e.in_loop=a,!0}));}((function(e,t){e.DEFMETHOD("reduce_vars",t);})),AST_Toplevel.DEFMETHOD("reset_opt_flags",(function(e){const t=this,n=e.option("reduce_vars"),o=new TreeWalker((function(i,r){if(clear_flag(i,1792),n)return e.top_retain&&i instanceof AST_Defun&&o.parent()===t&&set_flag(i,TOP),i.reduce_vars(o,r,e)}));o.safe_ids=Object.create(null),o.in_loop=null,o.loop_ids=new Map,o.defs_to_safe_ids=new Map,t.walk(o);})),AST_Symbol.DEFMETHOD("fixed_value",(function(){var e=this.thedef.fixed;return !e||e instanceof AST_Node?e:e()})),AST_SymbolRef.DEFMETHOD("is_immutable",(function(){var e=this.definition().orig;return 1==e.length&&e[0]instanceof AST_SymbolLambda}));var global_names=makePredicate("Array Boolean clearInterval clearTimeout console Date decodeURI decodeURIComponent encodeURI encodeURIComponent Error escape eval EvalError Function isFinite isNaN JSON Math Number parseFloat parseInt RangeError ReferenceError RegExp Object setInterval setTimeout String SyntaxError TypeError unescape URIError");AST_SymbolRef.DEFMETHOD("is_declared",(function(e){return !this.definition().undeclared||e.option("unsafe")&&global_names.has(this.name)}));var identifier_atom=makePredicate("Infinity NaN undefined");function is_identifier_atom(e){return e instanceof AST_Infinity||e instanceof AST_NaN||e instanceof AST_Undefined}function tighten_body(e,t){var n,o,i=t.find_parent(AST_Scope).get_defun_scope();!function(){var e=t.self(),r=0;do{if(e instanceof AST_Catch||e instanceof AST_Finally)r++;else if(e instanceof AST_IterationStatement)n=!0;else {if(e instanceof AST_Scope){i=e;break}e instanceof AST_Try&&(o=!0);}}while(e=t.parent(r++))}();var r,a=10;do{r=!1,u(e),t.option("dead_code")&&_(e,t),t.option("if_return")&&l(e,t),t.sequences_limit>0&&(f(e,t),d(e,t)),t.option("join_vars")&&m(e),t.option("collapse_vars")&&s(e,t);}while(r&&a-- >0);function s(e,t){if(i.pinned())return e;for(var a,s=[],u=e.length,l=new TreeTransformer((function(e){if(v)return e;if(!y)return e!==c[f]?e:++f<c.length?M(e):(y=!0,(S=P(e,0))===e&&(v=!0),e);var n,i=l.parent();if(e instanceof AST_Assign&&(e.logical||"="!=e.operator&&A.equivalent_to(e.left))||e instanceof AST_Await||e instanceof AST_Call&&A instanceof AST_PropAccess&&A.equivalent_to(e.expression)||e instanceof AST_Debugger||e instanceof AST_Destructuring||e instanceof AST_Expansion&&e.expression instanceof AST_Symbol&&(e.expression instanceof AST_This||e.expression.definition().references.length>1)||e instanceof AST_IterationStatement&&!(e instanceof AST_For)||e instanceof AST_LoopControl||e instanceof AST_Try||e instanceof AST_With||e instanceof AST_Yield||e instanceof AST_Export||e instanceof AST_Class||i instanceof AST_For&&e!==i.init||!g&&e instanceof AST_SymbolRef&&!e.is_declared(t)&&!pure_prop_access_globals.has(e)||e instanceof AST_SymbolRef&&i instanceof AST_Call&&has_annotation(i,_NOINLINE))return v=!0,e;if(m||h&&g||!(i instanceof AST_Binary&&lazy_op.has(i.operator)&&i.left!==e||i instanceof AST_Conditional&&i.condition!==e||i instanceof AST_If&&i.condition!==e)||(m=i),R&&!(e instanceof AST_SymbolDeclaration)&&A.equivalent_to(e)){if(m)return v=!0,e;if(is_lhs(e,i))return d&&C++,e;if(C++,d&&p instanceof AST_VarDef)return e;if(r=v=!0,p instanceof AST_UnaryPostfix)return make_node(AST_UnaryPrefix,p,p);if(p instanceof AST_VarDef){var a=p.name.definition(),s=p.value;return a.references.length-a.replaced!=1||t.exposed(a)?make_node(AST_Assign,p,{operator:"=",logical:!1,left:make_node(AST_SymbolRef,p.name,p.name),right:s}):(a.replaced++,b&&is_identifier_atom(s)?s.transform(t):maintain_this_binding(i,e,s))}return clear_flag(p,32),p}return (e instanceof AST_Call||e instanceof AST_Exit&&(E||A instanceof AST_PropAccess||H(A))||e instanceof AST_PropAccess&&(E||e.expression.may_throw_on_access(t))||e instanceof AST_SymbolRef&&(T.get(e.name)||E&&H(e))||e instanceof AST_VarDef&&e.value&&(T.has(e.name.name)||E&&H(e.name))||(n=is_lhs(e.left,e))&&(n instanceof AST_PropAccess||T.has(n.name))||D&&(o?e.has_side_effects(t):X(e)))&&(S=e,e instanceof AST_Scope&&(v=!0)),M(e)}),(function(e){v||(S===e&&(v=!0),m===e&&(m=null));})),_=new TreeTransformer((function(e){if(v)return e;if(!y){if(e!==c[f])return e;if(++f<c.length)return;return y=!0,e}return e instanceof AST_SymbolRef&&e.name==F.name?(--C||(v=!0),is_lhs(e,_.parent())?e:(F.replaced++,d.replaced--,p.value)):e instanceof AST_Default||e instanceof AST_Scope?e:void 0}));--u>=0;){0==u&&t.option("unused")&&x();var c=[];for(w(e[u]);s.length>0;){c=s.pop();var f=0,p=c[c.length-1],d=null,S=null,m=null,A=B(p);if(A&&!is_lhs_read_only(A)&&!A.has_side_effects(t)){var T=V(p),h=K(A);A instanceof AST_SymbolRef&&T.set(A.name,!1);var E=(N=p)instanceof AST_Unary?unary_side_effects.has(N.operator):L(N).has_side_effects(t),g=G(),D=p.may_throw(t),b=p.name instanceof AST_SymbolFunarg,y=b,v=!1,C=0,R=!a||!y;if(!R){for(var k=t.self().argnames.lastIndexOf(p.name)+1;!v&&k<a.length;k++)a[k].transform(l);R=!0;}for(var O=u;!v&&O<e.length;O++)e[O].transform(l);if(d){var F=p.name.definition();if(v&&F.references.length-F.replaced>C)C=!1;else {for(v=!1,f=0,y=b,O=u;!v&&O<e.length;O++)e[O].transform(_);d.single_use=!1;}}C&&!U(p)&&e.splice(u,1);}}}var N;function M(e){if(e instanceof AST_Scope)return e;if(e instanceof AST_Switch){e.expression=e.expression.transform(l);for(var t=0,n=e.body.length;!v&&t<n;t++){var o=e.body[t];if(o instanceof AST_Case){if(!y){if(o!==c[f])continue;f++;}if(o.expression=o.expression.transform(l),!g)break}}return v=!0,e}}function I(e,t,n){var o=!1,r=!(e instanceof AST_Arrow);return t.walk(new TreeWalker((function(t,a){if(o)return !0;if(t instanceof AST_SymbolRef&&(e.variables.has(t.name)||function(e,t){if(e.global)return !1;let n=e.scope;for(;n&&n!==t;){if(n.variables.has(e.name))return !0;n=n.parent_scope;}return !1}(t.definition(),e))){var s=t.definition().scope;if(s!==i)for(;s=s.parent_scope;)if(s===i)return !0;return o=!0}if((n||r)&&t instanceof AST_This)return o=!0;if(t instanceof AST_Scope&&!(t instanceof AST_Arrow)){var u=r;return r=!1,a(),r=u,!0}}))),o}function x(){var e,n=t.self();if(is_func_expr(n)&&!n.name&&!n.uses_arguments&&!n.pinned()&&(e=t.parent())instanceof AST_Call&&e.expression===n&&e.args.every((e=>!(e instanceof AST_Expansion)))){var o=t.has_directive("use strict");o&&!member(o,n.body)&&(o=!1);var i=n.argnames.length;a=e.args.slice(i);for(var r=new Set,u=i;--u>=0;){var l=n.argnames[u],_=e.args[u];const i=l.definition&&l.definition();if(!(i&&i.orig.length>1||(a.unshift(make_node(AST_VarDef,l,{name:l,value:_})),r.has(l.name))))if(r.add(l.name),l instanceof AST_Expansion){var c=e.args.slice(u);c.every((e=>!I(n,e,o)))&&s.unshift([make_node(AST_VarDef,l,{name:l.expression,value:make_node(AST_Array,e,{elements:c})})]);}else _?(_ instanceof AST_Lambda&&_.pinned()||I(n,_,o))&&(_=null):_=make_node(AST_Undefined,l).transform(t),_&&s.unshift([make_node(AST_VarDef,l,{name:l,value:_})]);}}}function w(e){if(c.push(e),e instanceof AST_Assign)e.left.has_side_effects(t)||s.push(c.slice()),w(e.right);else if(e instanceof AST_Binary)w(e.left),w(e.right);else if(e instanceof AST_Call&&!has_annotation(e,_NOINLINE))w(e.expression),e.args.forEach(w);else if(e instanceof AST_Case)w(e.expression);else if(e instanceof AST_Conditional)w(e.condition),w(e.consequent),w(e.alternative);else if(e instanceof AST_Definitions){var n=e.definitions.length,o=n-200;for(o<0&&(o=0);o<n;o++)w(e.definitions[o]);}else e instanceof AST_DWLoop?(w(e.condition),e.body instanceof AST_Block||w(e.body)):e instanceof AST_Exit?e.value&&w(e.value):e instanceof AST_For?(e.init&&w(e.init),e.condition&&w(e.condition),e.step&&w(e.step),e.body instanceof AST_Block||w(e.body)):e instanceof AST_ForIn?(w(e.object),e.body instanceof AST_Block||w(e.body)):e instanceof AST_If?(w(e.condition),e.body instanceof AST_Block||w(e.body),!e.alternative||e.alternative instanceof AST_Block||w(e.alternative)):e instanceof AST_Sequence?e.expressions.forEach(w):e instanceof AST_SimpleStatement?w(e.body):e instanceof AST_Switch?(w(e.expression),e.body.forEach(w)):e instanceof AST_Unary?"++"!=e.operator&&"--"!=e.operator||s.push(c.slice()):e instanceof AST_VarDef&&e.value&&(s.push(c.slice()),w(e.value));c.pop();}function P(e,t,n){var o=l.parent(t);return o instanceof AST_Assign?!n||o.logical||o.left instanceof AST_PropAccess||T.has(o.left.name)?e:P(o,t+1,n):o instanceof AST_Binary?!n||lazy_op.has(o.operator)&&o.left!==e?e:P(o,t+1,n):o instanceof AST_Call||o instanceof AST_Case?e:o instanceof AST_Conditional?n&&o.condition===e?P(o,t+1,n):e:o instanceof AST_Definitions?P(o,t+1,!0):o instanceof AST_Exit?n?P(o,t+1,n):e:o instanceof AST_If?n&&o.condition===e?P(o,t+1,n):e:o instanceof AST_IterationStatement?e:o instanceof AST_Sequence?P(o,t+1,o.tail_node()!==e):o instanceof AST_SimpleStatement?P(o,t+1,!0):o instanceof AST_Switch||o instanceof AST_VarDef?e:null}function B(e){if(e instanceof AST_Assign&&e.logical)return !1;if(!(e instanceof AST_VarDef&&e.name instanceof AST_SymbolDeclaration)){const t=e instanceof AST_Assign?e.left:e.expression;return !is_ref_of(t,AST_SymbolConst)&&!is_ref_of(t,AST_SymbolLet)&&t}var n=e.name.definition();if(member(e.name,n.orig)){var o=n.references.length-n.replaced;if(o)return n.orig.length-n.eliminated>1&&!(e.name instanceof AST_SymbolFunarg)||(o>1?function(e){var t=e.value;if(t instanceof AST_SymbolRef&&"arguments"!=t.name){var n=t.definition();if(!n.undeclared)return d=n}}(e):!t.exposed(n))?make_node(AST_SymbolRef,e.name,e.name):void 0}}function L(e){return e instanceof AST_Assign?e.right:e.value}function V(e){var n=new Map;if(e instanceof AST_Unary)return n;var o=new TreeWalker((function(e){for(var i=e;i instanceof AST_PropAccess;)i=i.expression;(i instanceof AST_SymbolRef||i instanceof AST_This)&&n.set(i.name,n.get(i.name)||is_modified(t,o,e,e,0));}));return L(e).walk(o),n}function U(n){if(n.name instanceof AST_SymbolFunarg){var o=t.parent(),i=t.self().argnames,r=i.indexOf(n.name);if(r<0)o.args.length=Math.min(o.args.length,i.length-1);else {var a=o.args;a[r]&&(a[r]=make_node(AST_Number,a[r],{value:0}));}return !0}var s=!1;return e[u].transform(new TreeTransformer((function(e,t,o){return s?e:e===n||e.body===n?(s=!0,e instanceof AST_VarDef?(e.value=e.name instanceof AST_SymbolConst?make_node(AST_Undefined,e.value):null,e):o?MAP.skip:null):void 0}),(function(e){if(e instanceof AST_Sequence)switch(e.expressions.length){case 0:return null;case 1:return e.expressions[0]}})))}function K(e){for(;e instanceof AST_PropAccess;)e=e.expression;return e instanceof AST_SymbolRef&&e.definition().scope===i&&!(n&&(T.has(e.name)||p instanceof AST_Unary||p instanceof AST_Assign&&!p.logical&&"="!=p.operator))}function G(){if(E)return !1;if(d)return !0;if(A instanceof AST_SymbolRef){var e=A.definition();if(e.references.length-e.replaced==(p instanceof AST_VarDef?1:2))return !0}return !1}function H(e){if(!e.definition)return !0;var t=e.definition();return !(1==t.orig.length&&t.orig[0]instanceof AST_SymbolDefun||t.scope.get_defun_scope()===i&&t.references.every((e=>{var t=e.scope.get_defun_scope();return "Scope"==t.TYPE&&(t=t.parent_scope),t===i})))}function X(e,t){if(e instanceof AST_Assign)return X(e.left,!0);if(e instanceof AST_Unary)return X(e.expression,!0);if(e instanceof AST_VarDef)return e.value&&X(e.value);if(t){if(e instanceof AST_Dot)return X(e.expression,!0);if(e instanceof AST_Sub)return X(e.expression,!0);if(e instanceof AST_SymbolRef)return e.definition().scope!==i}return !1}}function u(e){for(var t=[],n=0;n<e.length;){var o=e[n];o instanceof AST_BlockStatement&&o.body.every(can_be_evicted_from_block)?(r=!0,u(o.body),e.splice(n,1,...o.body),n+=o.body.length):o instanceof AST_EmptyStatement?(r=!0,e.splice(n,1)):o instanceof AST_Directive?t.indexOf(o.value)<0?(n++,t.push(o.value)):(r=!0,e.splice(n,1)):n++;}}function l(e,t){for(var n=t.self(),o=function(e){for(var t=0,n=e.length;--n>=0;){var o=e[n];if(o instanceof AST_If&&o.body instanceof AST_Return&&++t>1)return !0}return !1}(e),i=n instanceof AST_Lambda,a=e.length;--a>=0;){var s=e[a],u=T(a),l=e[u];if(i&&!l&&s instanceof AST_Return){if(!s.value){r=!0,e.splice(a,1);continue}if(s.value instanceof AST_UnaryPrefix&&"void"==s.value.operator){r=!0,e[a]=make_node(AST_SimpleStatement,s,{body:s.value.expression});continue}}if(s instanceof AST_If){var _;if(S(_=aborts(s.body))){_.label&&remove$1(_.label.thedef.references,_),r=!0,(s=s.clone()).condition=s.condition.negate(t);var f=A(s.body,_);s.body=make_node(AST_BlockStatement,s,{body:as_statement_array(s.alternative).concat(m())}),s.alternative=make_node(AST_BlockStatement,s,{body:f}),e[a]=s.transform(t);continue}if(S(_=aborts(s.alternative))){_.label&&remove$1(_.label.thedef.references,_),r=!0,(s=s.clone()).body=make_node(AST_BlockStatement,s.body,{body:as_statement_array(s.body).concat(m())}),f=A(s.alternative,_),s.alternative=make_node(AST_BlockStatement,s.alternative,{body:f}),e[a]=s.transform(t);continue}}if(s instanceof AST_If&&s.body instanceof AST_Return){var p=s.body.value;if(!p&&!s.alternative&&(i&&!l||l instanceof AST_Return&&!l.value)){r=!0,e[a]=make_node(AST_SimpleStatement,s.condition,{body:s.condition});continue}if(p&&!s.alternative&&l instanceof AST_Return&&l.value){r=!0,(s=s.clone()).alternative=l,e[a]=s.transform(t),e.splice(u,1);continue}if(p&&!s.alternative&&(!l&&i&&o||l instanceof AST_Return)){r=!0,(s=s.clone()).alternative=l||make_node(AST_Return,s,{value:null}),e[a]=s.transform(t),l&&e.splice(u,1);continue}var d=e[h(a)];if(t.option("sequences")&&i&&!s.alternative&&d instanceof AST_If&&d.body instanceof AST_Return&&T(u)==e.length&&l instanceof AST_SimpleStatement){r=!0,(s=s.clone()).alternative=make_node(AST_BlockStatement,l,{body:[l,make_node(AST_Return,l,{value:null})]}),e[a]=s.transform(t),e.splice(u,1);continue}}}function S(o){if(!o)return !1;for(var r=a+1,s=e.length;r<s;r++){var u=e[r];if(u instanceof AST_Const||u instanceof AST_Let)return !1}var l=o instanceof AST_LoopControl?t.loopcontrol_target(o):null;return o instanceof AST_Return&&i&&function(e){return !e||e instanceof AST_UnaryPrefix&&"void"==e.operator}(o.value)||o instanceof AST_Continue&&n===loop_body(l)||o instanceof AST_Break&&l instanceof AST_BlockStatement&&n===l}function m(){var t=e.slice(a+1);return e.length=a+1,t.filter((function(t){return !(t instanceof AST_Defun&&(e.push(t),1))}))}function A(e,t){var n=as_statement_array(e).slice(0,-1);return t.value&&n.push(make_node(AST_SimpleStatement,t.value,{body:t.value.expression})),n}function T(t){for(var n=t+1,o=e.length;n<o;n++){var i=e[n];if(!(i instanceof AST_Var&&c(i)))break}return n}function h(t){for(var n=t;--n>=0;){var o=e[n];if(!(o instanceof AST_Var&&c(o)))break}return n}}function _(e,t){for(var n,o=t.self(),i=0,a=0,s=e.length;i<s;i++){var u=e[i];if(u instanceof AST_LoopControl){var l=t.loopcontrol_target(u);u instanceof AST_Break&&!(l instanceof AST_IterationStatement)&&loop_body(l)===o||u instanceof AST_Continue&&loop_body(l)===o?u.label&&remove$1(u.label.thedef.references,u):e[a++]=u;}else e[a++]=u;if(aborts(u)){n=e.slice(i+1);break}}e.length=a,r=a!=s,n&&n.forEach((function(n){trim_unreachable_code(t,n,e);}));}function c(e){return e.definitions.every((e=>!e.value))}function f(e,t){if(!(e.length<2)){for(var n=[],o=0,i=0,a=e.length;i<a;i++){var s=e[i];if(s instanceof AST_SimpleStatement){n.length>=t.sequences_limit&&l();var u=s.body;n.length>0&&(u=u.drop_side_effect_free(t)),u&&merge_sequence(n,u);}else s instanceof AST_Definitions&&c(s)||s instanceof AST_Defun||l(),e[o++]=s;}l(),e.length=o,o!=a&&(r=!0);}function l(){if(n.length){var t=make_sequence(n[0],n);e[o++]=make_node(AST_SimpleStatement,t,{body:t}),n=[];}}}function p(e,t){if(!(e instanceof AST_BlockStatement))return e;for(var n=null,o=0,i=e.body.length;o<i;o++){var r=e.body[o];if(r instanceof AST_Var&&c(r))t.push(r);else {if(n)return !1;n=r;}}return n}function d(e,t){function n(e){i--,r=!0;var n=o.body;return make_sequence(n,[n,e]).transform(t)}for(var o,i=0,a=0;a<e.length;a++){var s=e[a];if(o&&(s instanceof AST_Exit?s.value=n(s.value||make_node(AST_Undefined,s).transform(t)):s instanceof AST_For?s.init instanceof AST_Definitions||walk$3(o.body,(e=>e instanceof AST_Scope||(e instanceof AST_Binary&&"in"===e.operator?walk_abort:void 0)))||(s.init?s.init=n(s.init):(s.init=o.body,i--,r=!0)):s instanceof AST_ForIn?s.init instanceof AST_Const||s.init instanceof AST_Let||(s.object=n(s.object)):s instanceof AST_If?s.condition=n(s.condition):(s instanceof AST_Switch||s instanceof AST_With)&&(s.expression=n(s.expression))),t.option("conditionals")&&s instanceof AST_If){var u=[],l=p(s.body,u),_=p(s.alternative,u);if(!1!==l&&!1!==_&&u.length>0){var c=u.length;u.push(make_node(AST_If,s,{condition:s.condition,body:l||make_node(AST_EmptyStatement,s.body),alternative:_})),u.unshift(i,1),[].splice.apply(e,u),a+=c,i+=c+1,o=null,r=!0;continue}}e[i++]=s,o=s instanceof AST_SimpleStatement?s:null;}e.length=i;}function S(e,n){if(e instanceof AST_Definitions){var o,r=e.definitions[e.definitions.length-1];if(r.value instanceof AST_Object&&(n instanceof AST_Assign&&!n.logical?o=[n]:n instanceof AST_Sequence&&(o=n.expressions.slice()),o)){var a=!1;do{var s=o[0];if(!(s instanceof AST_Assign))break;if("="!=s.operator)break;if(!(s.left instanceof AST_PropAccess))break;var u=s.left.expression;if(!(u instanceof AST_SymbolRef))break;if(r.name.name!=u.name)break;if(!s.right.is_constant_expression(i))break;var l=s.left.property;if(l instanceof AST_Node&&(l=l.evaluate(t)),l instanceof AST_Node)break;l=""+l;var _=t.option("ecma")<2015&&t.has_directive("use strict")?function(e){return e.key!=l&&e.key&&e.key.name!=l}:function(e){return e.key&&e.key.name!=l};if(!r.value.properties.every(_))break;var c=r.value.properties.filter((function(e){return e.key===l}))[0];c?c.value=new AST_Sequence({start:c.start,expressions:[c.value.clone(),s.right.clone()],end:c.end}):r.value.properties.push(make_node(AST_ObjectKeyVal,s,{key:l,value:s.right})),o.shift(),a=!0;}while(o.length);return a&&o}}}function m(e){for(var t,n=0,o=-1,i=e.length;n<i;n++){var a=e[n],s=e[o];if(a instanceof AST_Definitions)s&&s.TYPE==a.TYPE?(s.definitions=s.definitions.concat(a.definitions),r=!0):t&&t.TYPE==a.TYPE&&c(a)?(t.definitions=t.definitions.concat(a.definitions),r=!0):(e[++o]=a,t=a);else if(a instanceof AST_Exit)a.value=l(a.value);else if(a instanceof AST_For)(u=S(s,a.init))?(r=!0,a.init=u.length?make_sequence(a.init,u):null,e[++o]=a):s instanceof AST_Var&&(!a.init||a.init.TYPE==s.TYPE)?(a.init&&(s.definitions=s.definitions.concat(a.init.definitions)),a.init=s,e[o]=a,r=!0):t&&a.init&&t.TYPE==a.init.TYPE&&c(a.init)?(t.definitions=t.definitions.concat(a.init.definitions),a.init=null,e[++o]=a,r=!0):e[++o]=a;else if(a instanceof AST_ForIn)a.object=l(a.object);else if(a instanceof AST_If)a.condition=l(a.condition);else if(a instanceof AST_SimpleStatement){var u;if(u=S(s,a.body)){if(r=!0,!u.length)continue;a.body=make_sequence(a.body,u);}e[++o]=a;}else a instanceof AST_Switch||a instanceof AST_With?a.expression=l(a.expression):e[++o]=a;}function l(t){e[++o]=a;var n=S(s,t);return n?(r=!0,n.length?make_sequence(t,n):t instanceof AST_Sequence?t.tail_node().left:t.left):t}e.length=o+1;}}function trim_unreachable_code(e,t,n){walk$3(t,(o=>o instanceof AST_Var?(o.remove_initializers(),n.push(o),!0):o instanceof AST_Defun&&(o===t||!e.has_directive("use strict"))?(n.push(o===t?o:make_node(AST_Var,o,{definitions:[make_node(AST_VarDef,o,{name:make_node(AST_SymbolVar,o.name,o.name),value:null})]})),!0):o instanceof AST_Export||o instanceof AST_Import?(n.push(o),!0):o instanceof AST_Scope||void 0));}function get_value(e){return e instanceof AST_Constant?e.getValue():e instanceof AST_UnaryPrefix&&"void"==e.operator&&e.expression instanceof AST_Constant?void 0:e}function is_undefined(e,t){return has_flag(e,8)||e instanceof AST_Undefined||e instanceof AST_UnaryPrefix&&"void"==e.operator&&!e.expression.has_side_effects(t)}!function(e){function t(e){return /strict/.test(e.option("pure_getters"))}AST_Node.DEFMETHOD("may_throw_on_access",(function(e){return !e.option("pure_getters")||this._dot_throw(e)})),e(AST_Node,t),e(AST_Null,return_true),e(AST_Undefined,return_true),e(AST_Constant,return_false),e(AST_Array,return_false),e(AST_Object,(function(e){if(!t(e))return !1;for(var n=this.properties.length;--n>=0;)if(this.properties[n]._dot_throw(e))return !0;return !1})),e(AST_Class,return_false),e(AST_ObjectProperty,return_false),e(AST_ObjectGetter,return_true),e(AST_Expansion,(function(e){return this.expression._dot_throw(e)})),e(AST_Function,return_false),e(AST_Arrow,return_false),e(AST_UnaryPostfix,return_false),e(AST_UnaryPrefix,(function(){return "void"==this.operator})),e(AST_Binary,(function(e){return ("&&"==this.operator||"||"==this.operator||"??"==this.operator)&&(this.left._dot_throw(e)||this.right._dot_throw(e))})),e(AST_Assign,(function(e){return !!this.logical||"="==this.operator&&this.right._dot_throw(e)})),e(AST_Conditional,(function(e){return this.consequent._dot_throw(e)||this.alternative._dot_throw(e)})),e(AST_Dot,(function(e){return !(!t(e)||"prototype"==this.property&&(this.expression instanceof AST_Function||this.expression instanceof AST_Class))})),e(AST_Chain,(function(e){return this.expression._dot_throw(e)})),e(AST_Sequence,(function(e){return this.tail_node()._dot_throw(e)})),e(AST_SymbolRef,(function(e){if("arguments"===this.name)return !1;if(has_flag(this,8))return !0;if(!t(e))return !1;if(is_undeclared_ref(this)&&this.is_declared(e))return !1;if(this.is_immutable())return !1;var n=this.fixed_value();return !n||n._dot_throw(e)}));}((function(e,t){e.DEFMETHOD("_dot_throw",t);})),function(e){const t=makePredicate("! delete"),n=makePredicate("in instanceof == != === !== < <= >= >");e(AST_Node,return_false),e(AST_UnaryPrefix,(function(){return t.has(this.operator)})),e(AST_Binary,(function(){return n.has(this.operator)||lazy_op.has(this.operator)&&this.left.is_boolean()&&this.right.is_boolean()})),e(AST_Conditional,(function(){return this.consequent.is_boolean()&&this.alternative.is_boolean()})),e(AST_Assign,(function(){return "="==this.operator&&this.right.is_boolean()})),e(AST_Sequence,(function(){return this.tail_node().is_boolean()})),e(AST_True,return_true),e(AST_False,return_true);}((function(e,t){e.DEFMETHOD("is_boolean",t);})),function(e){e(AST_Node,return_false),e(AST_Number,return_true);var t=makePredicate("+ - ~ ++ --");e(AST_Unary,(function(){return t.has(this.operator)}));var n=makePredicate("- * / % & | ^ << >> >>>");e(AST_Binary,(function(e){return n.has(this.operator)||"+"==this.operator&&this.left.is_number(e)&&this.right.is_number(e)})),e(AST_Assign,(function(e){return n.has(this.operator.slice(0,-1))||"="==this.operator&&this.right.is_number(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_number(e)})),e(AST_Conditional,(function(e){return this.consequent.is_number(e)&&this.alternative.is_number(e)}));}((function(e,t){e.DEFMETHOD("is_number",t);})),function(e){e(AST_Node,return_false),e(AST_String,return_true),e(AST_TemplateString,return_true),e(AST_UnaryPrefix,(function(){return "typeof"==this.operator})),e(AST_Binary,(function(e){return "+"==this.operator&&(this.left.is_string(e)||this.right.is_string(e))})),e(AST_Assign,(function(e){return ("="==this.operator||"+="==this.operator)&&this.right.is_string(e)})),e(AST_Sequence,(function(e){return this.tail_node().is_string(e)})),e(AST_Conditional,(function(e){return this.consequent.is_string(e)&&this.alternative.is_string(e)}));}((function(e,t){e.DEFMETHOD("is_string",t);}));var lazy_op=makePredicate("&& || ??"),unary_side_effects=makePredicate("delete ++ --");function is_lhs(e,t){return t instanceof AST_Unary&&unary_side_effects.has(t.operator)?t.expression:t instanceof AST_Assign&&t.left===e?e:void 0}function best_of_expression(e,t){return e.size()>t.size()?t:e}function best_of_statement(e,t){return best_of_expression(make_node(AST_SimpleStatement,e,{body:e}),make_node(AST_SimpleStatement,t,{body:t})).body}function best_of(e,t,n){return (first_in_statement(e)?best_of_statement:best_of_expression)(t,n)}function convert_to_predicate(e){const t=new Map;for(var n of Object.keys(e))t.set(n,makePredicate(e[n]));return t}!function(e){function t(e,n){if(e instanceof AST_Node)return make_node(e.CTOR,n,e);if(Array.isArray(e))return make_node(AST_Array,n,{elements:e.map((function(e){return t(e,n)}))});if(e&&"object"==typeof e){var o=[];for(var i in e)HOP(e,i)&&o.push(make_node(AST_ObjectKeyVal,n,{key:i,value:t(e[i],n)}));return make_node(AST_Object,n,{properties:o})}return make_node_from_constant(e,n)}AST_Toplevel.DEFMETHOD("resolve_defines",(function(e){return e.option("global_defs")?(this.figure_out_scope({ie8:e.option("ie8")}),this.transform(new TreeTransformer((function(t){var n=t._find_defs(e,"");if(n){for(var o,i=0,r=t;(o=this.parent(i++))&&o instanceof AST_PropAccess&&o.expression===r;)r=o;if(!is_lhs(r,o))return n}})))):this})),e(AST_Node,noop),e(AST_Chain,(function(e,t){return this.expression._find_defs(e,t)})),e(AST_Dot,(function(e,t){return this.expression._find_defs(e,"."+this.property+t)})),e(AST_SymbolDeclaration,(function(){this.global();})),e(AST_SymbolRef,(function(e,n){if(this.global()){var o=e.option("global_defs"),i=this.name+n;return HOP(o,i)?t(o[i],this):void 0}}));}((function(e,t){e.DEFMETHOD("_find_defs",t);}));var object_fns=["constructor","toString","valueOf"],native_fns=convert_to_predicate({Array:["indexOf","join","lastIndexOf","slice"].concat(object_fns),Boolean:object_fns,Function:object_fns,Number:["toExponential","toFixed","toPrecision"].concat(object_fns),Object:object_fns,RegExp:["test"].concat(object_fns),String:["charAt","charCodeAt","concat","indexOf","italics","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","trim"].concat(object_fns)}),static_fns=convert_to_predicate({Array:["isArray"],Math:["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","atan2","pow","max","min"],Number:["isFinite","isNaN"],Object:["create","getOwnPropertyDescriptor","getOwnPropertyNames","getPrototypeOf","isExtensible","isFrozen","isSealed","keys"],String:["fromCharCode"]});!function(e){AST_Node.DEFMETHOD("evaluate",(function(e){if(!e.option("evaluate"))return this;var t=this._eval(e,1);return !t||t instanceof RegExp?t:"function"==typeof t||"object"==typeof t?this:t}));var t=makePredicate("! ~ - + void");AST_Node.DEFMETHOD("is_constant",(function(){return this instanceof AST_Constant?!(this instanceof AST_RegExp):this instanceof AST_UnaryPrefix&&this.expression instanceof AST_Constant&&t.has(this.operator)})),e(AST_Statement,(function(){throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]",this.start))})),e(AST_Lambda,return_this),e(AST_Class,return_this),e(AST_Node,return_this),e(AST_Constant,(function(){return this.getValue()})),e(AST_BigInt,return_this),e(AST_RegExp,(function(e){let t=e.evaluated_regexps.get(this);if(void 0===t){try{t=(0,eval)(this.print_to_string());}catch(e){t=null;}e.evaluated_regexps.set(this,t);}return t||this})),e(AST_TemplateString,(function(){return 1!==this.segments.length?this:this.segments[0].value})),e(AST_Function,(function(e){if(e.option("unsafe")){var t=function(){};return t.node=this,t.toString=function(){return this.node.print_to_string()},t}return this})),e(AST_Array,(function(e,t){if(e.option("unsafe")){for(var n=[],o=0,i=this.elements.length;o<i;o++){var r=this.elements[o],a=r._eval(e,t);if(r===a)return this;n.push(a);}return n}return this})),e(AST_Object,(function(e,t){if(e.option("unsafe")){for(var n={},o=0,i=this.properties.length;o<i;o++){var r=this.properties[o];if(r instanceof AST_Expansion)return this;var a=r.key;if(a instanceof AST_Symbol)a=a.name;else if(a instanceof AST_Node&&(a=a._eval(e,t))===r.key)return this;if("function"==typeof Object.prototype[a])return this;if(!(r.value instanceof AST_Function)&&(n[a]=r.value._eval(e,t),n[a]===r.value))return this}return n}return this}));var n=makePredicate("! typeof void");e(AST_UnaryPrefix,(function(e,t){var o=this.expression;if(e.option("typeofs")&&"typeof"==this.operator&&(o instanceof AST_Lambda||o instanceof AST_SymbolRef&&o.fixed_value()instanceof AST_Lambda))return "function";if(n.has(this.operator)||t++,(o=o._eval(e,t))===this.expression)return this;switch(this.operator){case"!":return !o;case"typeof":return o instanceof RegExp?this:typeof o;case"void":return;case"~":return ~o;case"-":return -o;case"+":return +o}return this}));var o=makePredicate("&& || ?? === !==");const i=makePredicate("== != === !=="),r=e=>"object"==typeof e||"function"==typeof e||"symbol"==typeof e;e(AST_Binary,(function(e,t){o.has(this.operator)||t++;var n=this.left._eval(e,t);if(n===this.left)return this;var a,s=this.right._eval(e,t);if(s===this.right)return this;if(null!=n&&null!=s&&i.has(this.operator)&&r(n)&&r(s)&&typeof n==typeof s)return this;switch(this.operator){case"&&":a=n&&s;break;case"||":a=n||s;break;case"??":a=null!=n?n:s;break;case"|":a=n|s;break;case"&":a=n&s;break;case"^":a=n^s;break;case"+":a=n+s;break;case"*":a=n*s;break;case"**":a=Math.pow(n,s);break;case"/":a=n/s;break;case"%":a=n%s;break;case"-":a=n-s;break;case"<<":a=n<<s;break;case">>":a=n>>s;break;case">>>":a=n>>>s;break;case"==":a=n==s;break;case"===":a=n===s;break;case"!=":a=n!=s;break;case"!==":a=n!==s;break;case"<":a=n<s;break;case"<=":a=n<=s;break;case">":a=n>s;break;case">=":a=n>=s;break;default:return this}return isNaN(a)&&e.find_parent(AST_With)?this:a})),e(AST_Conditional,(function(e,t){var n=this.condition._eval(e,t);if(n===this.condition)return this;var o=n?this.consequent:this.alternative,i=o._eval(e,t);return i===o?this:i}));const a=new Set;e(AST_SymbolRef,(function(e,t){if(a.has(this))return this;var n=this.fixed_value();if(!n)return this;a.add(this);const o=n._eval(e,t);if(a.delete(this),o===n)return this;if(o&&"object"==typeof o){var i=this.definition().escaped;if(i&&t>i)return this}return o}));var s={Array,Math,Number,Object,String},u=convert_to_predicate({Math:["E","LN10","LN2","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"],Number:["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"]});e(AST_PropAccess,(function(e,t){if(!this.optional||null!=this.expression._eval(e,t)){if(e.option("unsafe")){var n=this.property;if(n instanceof AST_Node&&(n=n._eval(e,t))===this.property)return this;var o,i=this.expression;if(is_undeclared_ref(i)){var r,a="hasOwnProperty"===i.name&&"call"===n&&(r=e.parent()&&e.parent().args)&&r&&r[0]&&r[0].evaluate(e);if(null==(a=a instanceof AST_Dot?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();var l=u.get(i.name);if(!l||!l.has(n))return this;o=s[i.name];}else {if(!(o=i._eval(e,t+1))||o===i||!HOP(o,n))return this;if("function"==typeof o)switch(n){case"name":return o.node.name?o.node.name.name:"";case"length":return o.node.argnames.length;default:return this}}return o[n]}return this}})),e(AST_Chain,(function(e,t){const n=this.expression._eval(e,t);return n===this.expression?this:n})),e(AST_Call,(function(e,t){var n=this.expression;if(!this.optional||null!=this.expression._eval(e,t)){if(e.option("unsafe")&&n instanceof AST_PropAccess){var o,i=n.property;if(i instanceof AST_Node&&(i=i._eval(e,t))===n.property)return this;var r=n.expression;if(is_undeclared_ref(r)){var a="hasOwnProperty"===r.name&&"call"===i&&this.args[0]&&this.args[0].evaluate(e);if(null==(a=a instanceof AST_Dot?a.expression:a)||a.thedef&&a.thedef.undeclared)return this.clone();var u=static_fns.get(r.name);if(!u||!u.has(i))return this;o=s[r.name];}else {if((o=r._eval(e,t+1))===r||!o)return this;var l=native_fns.get(o.constructor.name);if(!l||!l.has(i))return this}for(var _=[],c=0,f=this.args.length;c<f;c++){var p=this.args[c],d=p._eval(e,t);if(p===d)return this;_.push(d);}try{return o[i].apply(o,_)}catch(e){}}return this}})),e(AST_New,return_this);}((function(e,t){e.DEFMETHOD("_eval",t);})),function(e){function t(e){return make_node(AST_UnaryPrefix,e,{operator:"!",expression:e})}function n(e,n,o){var i=t(e);if(o){var r=make_node(AST_SimpleStatement,n,{body:n});return best_of_expression(i,r)===r?n:i}return best_of_expression(i,n)}e(AST_Node,(function(){return t(this)})),e(AST_Statement,(function(){throw new Error("Cannot negate a statement")})),e(AST_Function,(function(){return t(this)})),e(AST_Arrow,(function(){return t(this)})),e(AST_UnaryPrefix,(function(){return "!"==this.operator?this.expression:t(this)})),e(AST_Sequence,(function(e){var t=this.expressions.slice();return t.push(t.pop().negate(e)),make_sequence(this,t)})),e(AST_Conditional,(function(e,t){var o=this.clone();return o.consequent=o.consequent.negate(e),o.alternative=o.alternative.negate(e),n(this,o,t)})),e(AST_Binary,(function(e,o){var i=this.clone(),r=this.operator;if(e.option("unsafe_comps"))switch(r){case"<=":return i.operator=">",i;case"<":return i.operator=">=",i;case">=":return i.operator="<",i;case">":return i.operator="<=",i}switch(r){case"==":return i.operator="!=",i;case"!=":return i.operator="==",i;case"===":return i.operator="!==",i;case"!==":return i.operator="===",i;case"&&":return i.operator="||",i.left=i.left.negate(e,o),i.right=i.right.negate(e),n(this,i,o);case"||":return i.operator="&&",i.left=i.left.negate(e,o),i.right=i.right.negate(e),n(this,i,o);case"??":return i.right=i.right.negate(e),n(this,i,o)}return t(this)}));}((function(e,t){e.DEFMETHOD("negate",(function(e,n){return t.call(this,e,n)}));}));var global_pure_fns=makePredicate("Boolean decodeURI decodeURIComponent Date encodeURI encodeURIComponent Error escape EvalError isFinite isNaN Number Object parseFloat parseInt RangeError ReferenceError String SyntaxError TypeError unescape URIError");AST_Call.DEFMETHOD("is_expr_pure",(function(e){if(e.option("unsafe")){var t=this.expression,n=this.args&&this.args[0]&&this.args[0].evaluate(e);if(t.expression&&"hasOwnProperty"===t.expression.name&&(null==n||n.thedef&&n.thedef.undeclared))return !1;if(is_undeclared_ref(t)&&global_pure_fns.has(t.name))return !0;let o;if(t instanceof AST_Dot&&is_undeclared_ref(t.expression)&&(o=static_fns.get(t.expression.name))&&o.has(t.property))return !0}return !!has_annotation(this,_PURE)||!e.pure_funcs(this)})),AST_Node.DEFMETHOD("is_call_pure",return_false),AST_Dot.DEFMETHOD("is_call_pure",(function(e){if(!e.option("unsafe"))return;const t=this.expression;let n;return t instanceof AST_Array?n=native_fns.get("Array"):t.is_boolean()?n=native_fns.get("Boolean"):t.is_number(e)?n=native_fns.get("Number"):t instanceof AST_RegExp?n=native_fns.get("RegExp"):t.is_string(e)?n=native_fns.get("String"):this.may_throw_on_access(e)||(n=native_fns.get("Object")),n&&n.has(this.property)}));const pure_prop_access_globals=new Set(["Number","String","Array","Object","Function","Promise"]);function aborts(e){return e&&e.aborts()}!function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].has_side_effects(t))return !0;return !1}e(AST_Node,return_true),e(AST_EmptyStatement,return_false),e(AST_Constant,return_false),e(AST_This,return_false),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return !(this.is_expr_pure(e)||this.expression.is_call_pure(e)&&!this.expression.has_side_effects(e))||t(this.args,e)})),e(AST_Switch,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Case,(function(e){return this.expression.has_side_effects(e)||t(this.body,e)})),e(AST_Try,(function(e){return t(this.body,e)||this.bcatch&&this.bcatch.has_side_effects(e)||this.bfinally&&this.bfinally.has_side_effects(e)})),e(AST_If,(function(e){return this.condition.has_side_effects(e)||this.body&&this.body.has_side_effects(e)||this.alternative&&this.alternative.has_side_effects(e)})),e(AST_LabeledStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_SimpleStatement,(function(e){return this.body.has_side_effects(e)})),e(AST_Lambda,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.has_side_effects(e))||t(this.properties,e)})),e(AST_Binary,(function(e){return this.left.has_side_effects(e)||this.right.has_side_effects(e)})),e(AST_Assign,return_true),e(AST_Conditional,(function(e){return this.condition.has_side_effects(e)||this.consequent.has_side_effects(e)||this.alternative.has_side_effects(e)})),e(AST_Unary,(function(e){return unary_side_effects.has(this.operator)||this.expression.has_side_effects(e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_SymbolDeclaration,return_false),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.value&&this.value.has_side_effects(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.has_side_effects(e)||this.static&&this.value&&this.value.has_side_effects(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.has_side_effects(e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Dot,(function(e){return !this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)})),e(AST_Sub,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.has_side_effects(e)||this.property.has_side_effects(e))})),e(AST_Chain,(function(e){return this.expression.has_side_effects(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_VarDef,(function(){return this.value})),e(AST_TemplateSegment,return_false),e(AST_TemplateString,(function(e){return t(this.segments,e)}));}((function(e,t){e.DEFMETHOD("has_side_effects",t);})),function(e){function t(e,t){for(var n=e.length;--n>=0;)if(e[n].may_throw(t))return !0;return !1}e(AST_Node,return_true),e(AST_Constant,return_false),e(AST_EmptyStatement,return_false),e(AST_Lambda,return_false),e(AST_SymbolDeclaration,return_false),e(AST_This,return_false),e(AST_Class,(function(e){return !(!this.extends||!this.extends.may_throw(e))||t(this.properties,e)})),e(AST_Array,(function(e){return t(this.elements,e)})),e(AST_Assign,(function(e){return !!this.right.may_throw(e)||!(!e.has_directive("use strict")&&"="==this.operator&&this.left instanceof AST_SymbolRef)&&this.left.may_throw(e)})),e(AST_Binary,(function(e){return this.left.may_throw(e)||this.right.may_throw(e)})),e(AST_Block,(function(e){return t(this.body,e)})),e(AST_Call,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!!t(this.args,e)||!this.is_expr_pure(e)&&(!!this.expression.may_throw(e)||!(this.expression instanceof AST_Lambda)||t(this.expression.body,e)))})),e(AST_Case,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_Conditional,(function(e){return this.condition.may_throw(e)||this.consequent.may_throw(e)||this.alternative.may_throw(e)})),e(AST_Definitions,(function(e){return t(this.definitions,e)})),e(AST_If,(function(e){return this.condition.may_throw(e)||this.body&&this.body.may_throw(e)||this.alternative&&this.alternative.may_throw(e)})),e(AST_LabeledStatement,(function(e){return this.body.may_throw(e)})),e(AST_Object,(function(e){return t(this.properties,e)})),e(AST_ObjectProperty,(function(e){return !!this.value&&this.value.may_throw(e)})),e(AST_ClassProperty,(function(e){return this.computed_key()&&this.key.may_throw(e)||this.static&&this.value&&this.value.may_throw(e)})),e(AST_ConciseMethod,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectGetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_ObjectSetter,(function(e){return this.computed_key()&&this.key.may_throw(e)})),e(AST_Return,(function(e){return this.value&&this.value.may_throw(e)})),e(AST_Sequence,(function(e){return t(this.expressions,e)})),e(AST_SimpleStatement,(function(e){return this.body.may_throw(e)})),e(AST_Dot,(function(e){return !this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)})),e(AST_Sub,(function(e){return (!this.optional||!is_nullish(this.expression))&&(!this.optional&&this.expression.may_throw_on_access(e)||this.expression.may_throw(e)||this.property.may_throw(e))})),e(AST_Chain,(function(e){return this.expression.may_throw(e)})),e(AST_Switch,(function(e){return this.expression.may_throw(e)||t(this.body,e)})),e(AST_SymbolRef,(function(e){return !this.is_declared(e)&&!pure_prop_access_globals.has(this.name)})),e(AST_SymbolClassProperty,return_false),e(AST_Try,(function(e){return this.bcatch?this.bcatch.may_throw(e):t(this.body,e)||this.bfinally&&this.bfinally.may_throw(e)})),e(AST_Unary,(function(e){return !("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)&&this.expression.may_throw(e)})),e(AST_VarDef,(function(e){return !!this.value&&this.value.may_throw(e)}));}((function(e,t){e.DEFMETHOD("may_throw",t);})),function(e){function t(e){let t=!0;return walk$3(this,(n=>{if(n instanceof AST_SymbolRef){if(has_flag(this,16))return t=!1,walk_abort;var o=n.definition();if(member(o,this.enclosed)&&!this.variables.has(o.name)){if(e){var i=e.find_variable(n);if(o.undeclared?!i:i===o)return t="f",!0}return t=!1,walk_abort}return !0}if(n instanceof AST_This&&this instanceof AST_Arrow)return t=!1,walk_abort})),t}e(AST_Node,return_false),e(AST_Constant,return_true),e(AST_Class,(function(e){if(this.extends&&!this.extends.is_constant_expression(e))return !1;for(const t of this.properties){if(t.computed_key()&&!t.key.is_constant_expression(e))return !1;if(t.static&&t.value&&!t.value.is_constant_expression(e))return !1}return t.call(this,e)})),e(AST_Lambda,t),e(AST_Unary,(function(){return this.expression.is_constant_expression()})),e(AST_Binary,(function(){return this.left.is_constant_expression()&&this.right.is_constant_expression()})),e(AST_Array,(function(){return this.elements.every((e=>e.is_constant_expression()))})),e(AST_Object,(function(){return this.properties.every((e=>e.is_constant_expression()))})),e(AST_ObjectProperty,(function(){return !(this.key instanceof AST_Node||!this.value||!this.value.is_constant_expression())}));}((function(e,t){e.DEFMETHOD("is_constant_expression",t);})),function(e){function t(){for(var e=0;e<this.body.length;e++)if(aborts(this.body[e]))return this.body[e];return null}e(AST_Statement,return_null),e(AST_Jump,return_this),e(AST_Import,(function(){return null})),e(AST_BlockStatement,t),e(AST_SwitchBranch,t),e(AST_If,(function(){return this.alternative&&aborts(this.body)&&aborts(this.alternative)&&this}));}((function(e,t){e.DEFMETHOD("aborts",t);}));var directives=new Set(["use asm","use strict"]);function can_be_extracted_from_if_block(e){return !(e instanceof AST_Const||e instanceof AST_Let||e instanceof AST_Class)}function opt_AST_Lambda(e,t){return tighten_body(e.body,t),t.option("side_effects")&&1==e.body.length&&e.body[0]===t.has_directive("use strict")&&(e.body.length=0),e}def_optimize(AST_Directive,(function(e,t){return !t.option("directives")||directives.has(e.value)&&t.has_directive(e.value)===e?e:make_node(AST_EmptyStatement,e)})),def_optimize(AST_Debugger,(function(e,t){return t.option("drop_debugger")?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_LabeledStatement,(function(e,t){return e.body instanceof AST_Break&&t.loopcontrol_target(e.body)===e.body?make_node(AST_EmptyStatement,e):0==e.label.references.length?e.body:e})),def_optimize(AST_Block,(function(e,t){return tighten_body(e.body,t),e})),def_optimize(AST_BlockStatement,(function(e,t){switch(tighten_body(e.body,t),e.body.length){case 1:if(!t.has_directive("use strict")&&t.parent()instanceof AST_If&&can_be_extracted_from_if_block(e.body[0])||can_be_evicted_from_block(e.body[0]))return e.body[0];break;case 0:return make_node(AST_EmptyStatement,e)}return e})),def_optimize(AST_Lambda,opt_AST_Lambda);const r_keep_assign=/keep_assign/;function has_break_or_continue(e,t){var n=!1,o=new TreeWalker((function(t){return !!(n||t instanceof AST_Scope)||(t instanceof AST_LoopControl&&o.loopcontrol_target(t)===e?n=!0:void 0)}));return t instanceof AST_LabeledStatement&&o.push(t),o.push(e),e.body.walk(o),n}function if_break_in_loop(e,t){var n=e.body instanceof AST_BlockStatement?e.body.body[0]:e.body;if(t.option("dead_code")&&i(n)){var o=[];return e.init instanceof AST_Statement?o.push(e.init):e.init&&o.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),e.condition&&o.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),trim_unreachable_code(t,e.body,o),make_node(AST_BlockStatement,e,{body:o})}return n instanceof AST_If&&(i(n.body)?(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition.negate(t)}):e.condition=n.condition.negate(t),r(n.alternative)):i(n.alternative)&&(e.condition?e.condition=make_node(AST_Binary,e.condition,{left:e.condition,operator:"&&",right:n.condition}):e.condition=n.condition,r(n.body))),e;function i(e){return e instanceof AST_Break&&t.loopcontrol_target(e)===t.self()}function r(n){n=as_statement_array(n),e.body instanceof AST_BlockStatement?(e.body=e.body.clone(),e.body.body=n.concat(e.body.body.slice(1)),e.body=e.body.transform(t)):e.body=make_node(AST_BlockStatement,e.body,{body:n}).transform(t),e=if_break_in_loop(e,t);}}function retain_top_func(e,t){return t.top_retain&&e instanceof AST_Defun&&has_flag(e,TOP)&&e.name&&t.top_retain(e.name)}AST_Scope.DEFMETHOD("drop_unused",(function(e){if(!e.option("unused"))return;if(e.has_directive("use asm"))return;var t=this;if(t.pinned())return;var n=!(t instanceof AST_Toplevel)||e.toplevel.funcs,o=!(t instanceof AST_Toplevel)||e.toplevel.vars;const i=r_keep_assign.test(e.option("unused"))?return_false:function(e){return e instanceof AST_Assign&&!e.logical&&(has_flag(e,32)||"="==e.operator)?e.left:e instanceof AST_Unary&&has_flag(e,32)?e.expression:void 0};var r=new Map,a=new Map;t instanceof AST_Toplevel&&e.top_retain&&t.variables.forEach((function(t){e.top_retain(t)&&!r.has(t.id)&&r.set(t.id,t);}));var s=new Map,u=new Map,l=this,_=new TreeWalker((function(i,c){if(i instanceof AST_Lambda&&i.uses_arguments&&!_.has_directive("use strict")&&i.argnames.forEach((function(e){if(e instanceof AST_SymbolDeclaration){var t=e.definition();r.has(t.id)||r.set(t.id,t);}})),i!==t){if(i instanceof AST_Defun||i instanceof AST_DefClass){var p=i.name.definition();if((_.parent()instanceof AST_Export||!n&&l===t)&&p.global&&!r.has(p.id)&&r.set(p.id,p),i instanceof AST_DefClass){i.extends&&(i.extends.has_side_effects(e)||i.extends.may_throw(e))&&i.extends.walk(_);for(const t of i.properties)(t.has_side_effects(e)||t.may_throw(e))&&t.walk(_);}return map_add(u,p.id,i),!0}if(i instanceof AST_SymbolFunarg&&l===t&&map_add(s,i.definition().id,i),i instanceof AST_Definitions&&l===t){const t=_.parent()instanceof AST_Export;return i.definitions.forEach((function(n){if(n.name instanceof AST_SymbolVar&&map_add(s,n.name.definition().id,n),!t&&o||walk$3(n.name,(e=>{if(e instanceof AST_SymbolDeclaration){const n=e.definition();!t&&!n.global||r.has(n.id)||r.set(n.id,n);}})),n.value){if(n.name instanceof AST_Destructuring)n.walk(_);else {var i=n.name.definition();map_add(u,i.id,n.value),i.chained||n.name.fixed_value()!==n.value||a.set(i.id,n);}n.value.has_side_effects(e)&&n.value.walk(_);}})),!0}return f(i,c)}}));t.walk(_),_=new TreeWalker(f),r.forEach((function(e){var t=u.get(e.id);t&&t.forEach((function(e){e.walk(_);}));}));var c=new TreeTransformer((function(u,_,f){var p=c.parent();if(o){const e=i(u);if(e instanceof AST_SymbolRef){var d=e.definition(),S=r.has(d.id);if(u instanceof AST_Assign){if(!S||a.has(d.id)&&a.get(d.id)!==u)return maintain_this_binding(p,u,u.right.transform(c))}else if(!S)return f?MAP.skip:make_node(AST_Number,u,{value:0})}}if(l===t){if(u.name&&(u instanceof AST_ClassExpression&&!keep_name(e.option("keep_classnames"),(d=u.name.definition()).name)||u instanceof AST_Function&&!keep_name(e.option("keep_fnames"),(d=u.name.definition()).name))&&(!r.has(d.id)||d.orig.length>1)&&(u.name=null),u instanceof AST_Lambda&&!(u instanceof AST_Accessor))for(var m=!e.option("keep_fargs"),A=u.argnames,T=A.length;--T>=0;){var h=A[T];h instanceof AST_Expansion&&(h=h.expression),h instanceof AST_DefaultAssign&&(h=h.left),h instanceof AST_Destructuring||r.has(h.definition().id)?m=!1:(set_flag(h,1),m&&A.pop());}if((u instanceof AST_Defun||u instanceof AST_DefClass)&&u!==t){const t=u.name.definition();if(!(t.global&&!n||r.has(t.id))){if(t.eliminated++,u instanceof AST_DefClass){const t=u.drop_side_effect_free(e);if(t)return make_node(AST_SimpleStatement,u,{body:t})}return f?MAP.skip:make_node(AST_EmptyStatement,u)}}if(u instanceof AST_Definitions&&!(p instanceof AST_ForIn&&p.init===u)){var E=!(p instanceof AST_Toplevel||u instanceof AST_Var),g=[],D=[],b=[],y=[];switch(u.definitions.forEach((function(t){t.value&&(t.value=t.value.transform(c));var n=t.name instanceof AST_Destructuring,i=n?new SymbolDef(null,{name:"<destructure>"}):t.name.definition();if(E&&i.global)return b.push(t);if(!o&&!E||n&&(t.name.names.length||t.name.is_array||1!=e.option("pure_getters"))||r.has(i.id)){if(t.value&&a.has(i.id)&&a.get(i.id)!==t&&(t.value=t.value.drop_side_effect_free(e)),t.name instanceof AST_SymbolVar){var l=s.get(i.id);if(l.length>1&&(!t.value||i.orig.indexOf(t.name)>i.eliminated)){if(t.value){var _=make_node(AST_SymbolRef,t.name,t.name);i.references.push(_);var f=make_node(AST_Assign,t,{operator:"=",logical:!1,left:_,right:t.value});a.get(i.id)===t&&a.set(i.id,f),y.push(f.transform(c));}return remove$1(l,t),void i.eliminated++}}t.value?(y.length>0&&(b.length>0?(y.push(t.value),t.value=make_sequence(t.value,y)):g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),y=[]),b.push(t)):D.push(t);}else if(i.orig[0]instanceof AST_SymbolCatch)(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),t.value=null,D.push(t);else {var p;(p=t.value&&t.value.drop_side_effect_free(e))&&y.push(p),i.eliminated++;}})),(D.length>0||b.length>0)&&(u.definitions=D.concat(b),g.push(u)),y.length>0&&g.push(make_node(AST_SimpleStatement,u,{body:make_sequence(u,y)})),g.length){case 0:return f?MAP.skip:make_node(AST_EmptyStatement,u);case 1:return g[0];default:return f?MAP.splice(g):make_node(AST_BlockStatement,u,{body:g})}}if(u instanceof AST_For)return _(u,this),u.init instanceof AST_BlockStatement&&(v=u.init,u.init=v.body.pop(),v.body.push(u)),u.init instanceof AST_SimpleStatement?u.init=u.init.body:is_empty(u.init)&&(u.init=null),v?f?MAP.splice(v.body):v:u;if(u instanceof AST_LabeledStatement&&u.body instanceof AST_For){if(_(u,this),u.body instanceof AST_BlockStatement){var v=u.body;return u.body=v.body.pop(),v.body.push(u),f?MAP.splice(v.body):v}return u}if(u instanceof AST_BlockStatement)return _(u,this),f&&u.body.every(can_be_evicted_from_block)?MAP.splice(u.body):u;if(u instanceof AST_Scope){const e=l;return l=u,_(u,this),l=e,u}}}));function f(e,n){var o;const s=i(e);if(s instanceof AST_SymbolRef&&!is_ref_of(e.left,AST_SymbolBlockDeclaration)&&t.variables.get(s.name)===(o=s.definition()))return e instanceof AST_Assign&&(e.right.walk(_),o.chained||e.left.fixed_value()!==e.right||a.set(o.id,e)),!0;if(e instanceof AST_SymbolRef){if(o=e.definition(),!r.has(o.id)&&(r.set(o.id,o),o.orig[0]instanceof AST_SymbolCatch)){const e=o.scope.is_block_scope()&&o.scope.get_defun_scope().variables.get(o.name);e&&r.set(e.id,e);}return !0}if(e instanceof AST_Scope){var u=l;return l=e,n(),l=u,!0}}t.transform(c);})),AST_Scope.DEFMETHOD("hoist_declarations",(function(e){var t=this;if(e.has_directive("use asm"))return t;if(!Array.isArray(t.body))return t;var n=e.option("hoist_funs"),o=e.option("hoist_vars");if(n||o){var i=[],r=[],a=new Map,s=0,u=0;walk$3(t,(e=>e instanceof AST_Scope&&e!==t||(e instanceof AST_Var?(++u,!0):void 0))),o=o&&u>1;var l=new TreeTransformer((function(u){if(u!==t){if(u instanceof AST_Directive)return i.push(u),make_node(AST_EmptyStatement,u);if(n&&u instanceof AST_Defun&&!(l.parent()instanceof AST_Export)&&l.parent()===t)return r.push(u),make_node(AST_EmptyStatement,u);if(o&&u instanceof AST_Var&&!u.definitions.some((e=>e.name instanceof AST_Destructuring))){u.definitions.forEach((function(e){a.set(e.name.name,e),++s;}));var _=u.to_assignments(e),c=l.parent();if(c instanceof AST_ForIn&&c.init===u){if(null==_){var f=u.definitions[0].name;return make_node(AST_SymbolRef,f,f)}return _}return c instanceof AST_For&&c.init===u?_:_?make_node(AST_SimpleStatement,u,{body:_}):make_node(AST_EmptyStatement,u)}if(u instanceof AST_Scope)return u}}));if(t=t.transform(l),s>0){var _=[];const e=t instanceof AST_Lambda,n=e?t.args_as_names():null;if(a.forEach(((t,o)=>{e&&n.some((e=>e.name===t.name.name))?a.delete(o):((t=t.clone()).value=null,_.push(t),a.set(o,t));})),_.length>0){for(;0<t.body.length;){if(t.body[0]instanceof AST_SimpleStatement){var c,f,p=t.body[0].body;if(p instanceof AST_Assign&&"="==p.operator&&(c=p.left)instanceof AST_Symbol&&a.has(c.name)){if((d=a.get(c.name)).value)break;d.value=p.right,remove$1(_,d),_.push(d),t.body.splice(0,1);continue}if(p instanceof AST_Sequence&&(f=p.expressions[0])instanceof AST_Assign&&"="==f.operator&&(c=f.left)instanceof AST_Symbol&&a.has(c.name)){var d;if((d=a.get(c.name)).value)break;d.value=f.right,remove$1(_,d),_.push(d),t.body[0].body=make_sequence(p,p.expressions.slice(1));continue}}if(t.body[0]instanceof AST_EmptyStatement)t.body.splice(0,1);else {if(!(t.body[0]instanceof AST_BlockStatement))break;t.body.splice(0,1,...t.body[0].body);}}_=make_node(AST_Var,t,{definitions:_}),r.push(_);}}t.body=i.concat(r,t.body);}return t})),AST_Scope.DEFMETHOD("hoist_properties",(function(e){var t=this;if(!e.option("hoist_props")||e.has_directive("use asm"))return t;var n=t instanceof AST_Toplevel&&e.top_retain||return_false,o=new Map,i=new TreeTransformer((function(r,a){if(r instanceof AST_Definitions&&i.parent()instanceof AST_Export)return r;if(r instanceof AST_VarDef){const s=r.name;let u,l;if(s.scope===t&&1!=(u=s.definition()).escaped&&!u.assignments&&!u.direct_access&&!u.single_use&&!e.exposed(u)&&!n(u)&&(l=s.fixed_value())===r.value&&l instanceof AST_Object&&!l.properties.some((e=>e instanceof AST_Expansion||e.computed_key()))){a(r,this);const e=new Map,n=[];return l.properties.forEach((({key:o,value:a})=>{const u=find_scope(i),l=t.create_symbol(s.CTOR,{source:s,scope:u,conflict_scopes:new Set([u,...s.definition().references.map((e=>e.scope))]),tentative_name:s.name+"_"+o});e.set(String(o),l.definition()),n.push(make_node(AST_VarDef,r,{name:l,value:a}));})),o.set(u.id,e),MAP.splice(n)}}else if(r instanceof AST_PropAccess&&r.expression instanceof AST_SymbolRef){const e=o.get(r.expression.definition().id);if(e){const t=e.get(String(get_value(r.property))),n=make_node(AST_SymbolRef,r,{name:t.name,scope:r.expression.scope,thedef:t});return n.reference({}),n}}}));return t.transform(i)})),function(e){function t(e,t,n){var o=e.length;if(!o)return null;for(var i=[],r=!1,a=0;a<o;a++){var s=e[a].drop_side_effect_free(t,n);r|=s!==e[a],s&&(i.push(s),n=!1);}return r?i.length?i:null:e}e(AST_Node,return_this),e(AST_Constant,return_null),e(AST_This,return_null),e(AST_Call,(function(e,n){if(this.optional&&is_nullish(this.expression))return make_node(AST_Undefined,this);if(!this.is_expr_pure(e)){if(this.expression.is_call_pure(e)){var o=this.args.slice();return o.unshift(this.expression.expression),(o=t(o,e,n))&&make_sequence(this,o)}if(is_func_expr(this.expression)&&(!this.expression.name||!this.expression.name.definition().references.length)){var i=this.clone();return i.expression.process_expression(!1,e),i}return this}var r=t(this.args,e,n);return r&&make_sequence(this,r)})),e(AST_Accessor,return_null),e(AST_Function,return_null),e(AST_Arrow,return_null),e(AST_Class,(function(e){const t=[],n=this.extends&&this.extends.drop_side_effect_free(e);n&&t.push(n);for(const n of this.properties){const o=n.drop_side_effect_free(e);o&&t.push(o);}return t.length?make_sequence(this,t):null})),e(AST_Binary,(function(e,t){var n=this.right.drop_side_effect_free(e);if(!n)return this.left.drop_side_effect_free(e,t);if(lazy_op.has(this.operator)){if(n===this.right)return this;var o=this.clone();return o.right=n,o}var i=this.left.drop_side_effect_free(e,t);return i?make_sequence(this,[i,n]):this.right.drop_side_effect_free(e,t)})),e(AST_Assign,(function(e){if(this.logical)return this;var t=this.left;if(t.has_side_effects(e)||e.has_directive("use strict")&&t instanceof AST_PropAccess&&t.expression.is_constant())return this;for(set_flag(this,32);t instanceof AST_PropAccess;)t=t.expression;return t.is_constant_expression(e.find_parent(AST_Scope))?this.right.drop_side_effect_free(e):this})),e(AST_Conditional,(function(e){var t=this.consequent.drop_side_effect_free(e),n=this.alternative.drop_side_effect_free(e);if(t===this.consequent&&n===this.alternative)return this;if(!t)return n?make_node(AST_Binary,this,{operator:"||",left:this.condition,right:n}):this.condition.drop_side_effect_free(e);if(!n)return make_node(AST_Binary,this,{operator:"&&",left:this.condition,right:t});var o=this.clone();return o.consequent=t,o.alternative=n,o})),e(AST_Unary,(function(e,t){if(unary_side_effects.has(this.operator))return this.expression.has_side_effects(e)?clear_flag(this,32):set_flag(this,32),this;if("typeof"==this.operator&&this.expression instanceof AST_SymbolRef)return null;var n=this.expression.drop_side_effect_free(e,t);return t&&n&&is_iife_call(n)?n===this.expression&&"!"==this.operator?this:n.negate(e,t):n})),e(AST_SymbolRef,(function(e){return this.is_declared(e)||pure_prop_access_globals.has(this.name)?null:this})),e(AST_Object,(function(e,n){var o=t(this.properties,e,n);return o&&make_sequence(this,o)})),e(AST_ObjectProperty,(function(e,t){const n=this instanceof AST_ObjectKeyVal&&this.key instanceof AST_Node&&this.key.drop_side_effect_free(e,t),o=this.value&&this.value.drop_side_effect_free(e,t);return n&&o?make_sequence(this,[n,o]):n||o})),e(AST_ClassProperty,(function(e){const t=this.computed_key()&&this.key.drop_side_effect_free(e),n=this.static&&this.value&&this.value.drop_side_effect_free(e);return t&&n?make_sequence(this,[t,n]):t||n||null})),e(AST_ConciseMethod,(function(){return this.computed_key()?this.key:null})),e(AST_ObjectGetter,(function(){return this.computed_key()?this.key:null})),e(AST_ObjectSetter,(function(){return this.computed_key()?this.key:null})),e(AST_Array,(function(e,n){var o=t(this.elements,e,n);return o&&make_sequence(this,o)})),e(AST_Dot,(function(e,t){return this.optional?is_nullish(this.expression)?make_node(AST_Undefined,this):this:this.expression.may_throw_on_access(e)?this:this.expression.drop_side_effect_free(e,t)})),e(AST_Sub,(function(e,t){if(this.optional)return is_nullish(this.expression)?make_node(AST_Undefined,this):this;if(this.expression.may_throw_on_access(e))return this;var n=this.expression.drop_side_effect_free(e,t);if(!n)return this.property.drop_side_effect_free(e,t);var o=this.property.drop_side_effect_free(e);return o?make_sequence(this,[n,o]):n})),e(AST_Chain,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),e(AST_Sequence,(function(e){var t=this.tail_node(),n=t.drop_side_effect_free(e);if(n===t)return this;var o=this.expressions.slice(0,-1);return n&&o.push(n),o.length?make_sequence(this,o):make_node(AST_Number,this,{value:0})})),e(AST_Expansion,(function(e,t){return this.expression.drop_side_effect_free(e,t)})),e(AST_TemplateSegment,return_null),e(AST_TemplateString,(function(e){var n=t(this.segments,e,first_in_statement);return n&&make_sequence(this,n)}));}((function(e,t){e.DEFMETHOD("drop_side_effect_free",t);})),def_optimize(AST_SimpleStatement,(function(e,t){if(t.option("side_effects")){var n=e.body,o=n.drop_side_effect_free(t,!0);if(!o)return make_node(AST_EmptyStatement,e);if(o!==n)return make_node(AST_SimpleStatement,e,{body:o})}return e})),def_optimize(AST_While,(function(e,t){return t.option("loops")?make_node(AST_For,e,e).optimize(t):e})),def_optimize(AST_Do,(function(e,t){if(!t.option("loops"))return e;var n=e.condition.tail_node().evaluate(t);if(!(n instanceof AST_Node)){if(n)return make_node(AST_For,e,{body:make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]})}).optimize(t);if(!has_break_or_continue(e,t.parent()))return make_node(AST_BlockStatement,e.body,{body:[e.body,make_node(AST_SimpleStatement,e.condition,{body:e.condition})]}).optimize(t)}return e})),def_optimize(AST_For,(function(e,t){if(!t.option("loops"))return e;if(t.option("side_effects")&&e.init&&(e.init=e.init.drop_side_effect_free(t)),e.condition){var n=e.condition.evaluate(t);if(!(n instanceof AST_Node))if(n)e.condition=null;else if(!t.option("dead_code")){var o=e.condition;e.condition=make_node_from_constant(n,e.condition),e.condition=best_of_expression(e.condition.transform(t),o);}if(t.option("dead_code")&&(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n)){var i=[];return trim_unreachable_code(t,e.body,i),e.init instanceof AST_Statement?i.push(e.init):e.init&&i.push(make_node(AST_SimpleStatement,e.init,{body:e.init})),i.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}}return if_break_in_loop(e,t)})),def_optimize(AST_If,(function(e,t){if(is_empty(e.alternative)&&(e.alternative=null),!t.option("conditionals"))return e;var n=e.condition.evaluate(t);if(!(t.option("dead_code")||n instanceof AST_Node)){var o=e.condition;e.condition=make_node_from_constant(n,o),e.condition=best_of_expression(e.condition.transform(t),o);}if(t.option("dead_code")){if(n instanceof AST_Node&&(n=e.condition.tail_node().evaluate(t)),!n){var i=[];return trim_unreachable_code(t,e.body,i),i.push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),e.alternative&&i.push(e.alternative),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}if(!(n instanceof AST_Node))return (i=[]).push(make_node(AST_SimpleStatement,e.condition,{body:e.condition})),i.push(e.body),e.alternative&&trim_unreachable_code(t,e.alternative,i),make_node(AST_BlockStatement,e,{body:i}).optimize(t)}var r=e.condition.negate(t),a=e.condition.size(),s=r.size(),u=s<a;if(e.alternative&&u){u=!1,e.condition=r;var l=e.body;e.body=e.alternative||make_node(AST_EmptyStatement,e),e.alternative=l;}if(is_empty(e.body)&&is_empty(e.alternative))return make_node(AST_SimpleStatement,e.condition,{body:e.condition.clone()}).optimize(t);if(e.body instanceof AST_SimpleStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.body,alternative:e.alternative.body})}).optimize(t);if(is_empty(e.alternative)&&e.body instanceof AST_SimpleStatement)return a===s&&!u&&e.condition instanceof AST_Binary&&"||"==e.condition.operator&&(u=!0),u?make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:r,right:e.body.body})}).optimize(t):make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:e.body.body})}).optimize(t);if(e.body instanceof AST_EmptyStatement&&e.alternative instanceof AST_SimpleStatement)return make_node(AST_SimpleStatement,e,{body:make_node(AST_Binary,e,{operator:"||",left:e.condition,right:e.alternative.body})}).optimize(t);if(e.body instanceof AST_Exit&&e.alternative instanceof AST_Exit&&e.body.TYPE==e.alternative.TYPE)return make_node(e.body.CTOR,e,{value:make_node(AST_Conditional,e,{condition:e.condition,consequent:e.body.value||make_node(AST_Undefined,e.body),alternative:e.alternative.value||make_node(AST_Undefined,e.alternative)}).transform(t)}).optimize(t);if(e.body instanceof AST_If&&!e.body.alternative&&!e.alternative&&(e=make_node(AST_If,e,{condition:make_node(AST_Binary,e.condition,{operator:"&&",left:e.condition,right:e.body.condition}),body:e.body.body,alternative:null})),aborts(e.body)&&e.alternative){var _=e.alternative;return e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,_]}).optimize(t)}return aborts(e.alternative)?(i=e.body,e.body=e.alternative,e.condition=u?r:e.condition.negate(t),e.alternative=null,make_node(AST_BlockStatement,e,{body:[e,i]}).optimize(t)):e})),def_optimize(AST_Switch,(function(e,t){if(!t.option("switches"))return e;var n,o=e.expression.evaluate(t);if(!(o instanceof AST_Node)){var i=e.expression;e.expression=make_node_from_constant(o,i),e.expression=best_of_expression(e.expression.transform(t),i);}if(!t.option("dead_code"))return e;o instanceof AST_Node&&(o=e.expression.tail_node().evaluate(t));for(var r,a,s=[],u=[],l=0,_=e.body.length;l<_&&!a;l++){if((n=e.body[l])instanceof AST_Default)r?T(n,u[u.length-1]):r=n;else if(!(o instanceof AST_Node)){if(!((m=n.expression.evaluate(t))instanceof AST_Node)&&m!==o){T(n,u[u.length-1]);continue}if(m instanceof AST_Node&&(m=n.expression.tail_node().evaluate(t)),m===o&&(a=n,r)){var c=u.indexOf(r);u.splice(c,1),T(r,u[c-1]),r=null;}}if(aborts(n)){var f=u[u.length-1];aborts(f)&&f.body.length==n.body.length&&make_node(AST_BlockStatement,f,f).equivalent_to(make_node(AST_BlockStatement,n,n))&&(f.body=[]);}u.push(n);}for(;l<_;)T(e.body[l++],u[u.length-1]);for(u.length>0&&(u[0].body=s.concat(u[0].body)),e.body=u;n=u[u.length-1];){var p=n.body[n.body.length-1];if(p instanceof AST_Break&&t.loopcontrol_target(p)===e&&n.body.pop(),n.body.length||n instanceof AST_Case&&(r||n.expression.has_side_effects(t)))break;u.pop()===r&&(r=null);}if(0==u.length)return make_node(AST_BlockStatement,e,{body:s.concat(make_node(AST_SimpleStatement,e.expression,{body:e.expression}))}).optimize(t);if(1==u.length&&(u[0]===a||u[0]===r)){var d=!1,S=new TreeWalker((function(t){if(d||t instanceof AST_Lambda||t instanceof AST_SimpleStatement)return !0;t instanceof AST_Break&&S.loopcontrol_target(t)===e&&(d=!0);}));if(e.walk(S),!d){var m,A=u[0].body.slice();return (m=u[0].expression)&&A.unshift(make_node(AST_SimpleStatement,m,{body:m})),A.unshift(make_node(AST_SimpleStatement,e.expression,{body:e.expression})),make_node(AST_BlockStatement,e,{body:A}).optimize(t)}}return e;function T(e,n){n&&!aborts(n)?n.body=n.body.concat(e.body):trim_unreachable_code(t,e,s);}})),def_optimize(AST_Try,(function(e,t){if(tighten_body(e.body,t),e.bcatch&&e.bfinally&&e.bfinally.body.every(is_empty)&&(e.bfinally=null),t.option("dead_code")&&e.body.every(is_empty)){var n=[];return e.bcatch&&trim_unreachable_code(t,e.bcatch,n),e.bfinally&&n.push(...e.bfinally.body),make_node(AST_BlockStatement,e,{body:n}).optimize(t)}return e})),AST_Definitions.DEFMETHOD("remove_initializers",(function(){var e=[];this.definitions.forEach((function(t){t.name instanceof AST_SymbolDeclaration?(t.value=null,e.push(t)):walk$3(t.name,(n=>{n instanceof AST_SymbolDeclaration&&e.push(make_node(AST_VarDef,t,{name:n,value:null}));}));})),this.definitions=e;})),AST_Definitions.DEFMETHOD("to_assignments",(function(e){var t=e.option("reduce_vars"),n=[];for(const e of this.definitions){if(e.value){var o=make_node(AST_SymbolRef,e.name,e.name);n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:o,right:e.value})),t&&(o.definition().fixed=!1);}else if(e.value){var i=make_node(AST_VarDef,e,{name:e.name,value:e.value}),r=make_node(AST_Var,e,{definitions:[i]});n.push(r);}const a=e.name.definition();a.eliminated++,a.replaced--;}return 0==n.length?null:make_sequence(this,n)})),def_optimize(AST_Definitions,(function(e){return 0==e.definitions.length?make_node(AST_EmptyStatement,e):e})),def_optimize(AST_VarDef,(function(e){return e.name instanceof AST_SymbolLet&&null!=e.value&&is_undefined(e.value)&&(e.value=null),e})),def_optimize(AST_Import,(function(e){return e})),def_optimize(AST_Call,(function(e,t){var n=e.expression,o=n;inline_array_like_spread(e.args);var i=e.args.every((e=>!(e instanceof AST_Expansion)));if(t.option("reduce_vars")&&o instanceof AST_SymbolRef&&!has_annotation(e,_NOINLINE)){const e=o.fixed_value();retain_top_func(e,t)||(o=e);}if(e.optional&&is_nullish(o))return make_node(AST_Undefined,e);var r=o instanceof AST_Lambda;if(r&&o.pinned())return e;if(t.option("unused")&&i&&r&&!o.uses_arguments){for(var a=0,s=0,u=0,l=e.args.length;u<l;u++){if(o.argnames[u]instanceof AST_Expansion){if(has_flag(o.argnames[u].expression,1))for(;u<l;)(d=e.args[u++].drop_side_effect_free(t))&&(e.args[a++]=d);else for(;u<l;)e.args[a++]=e.args[u++];s=a;break}var _=u>=o.argnames.length;if(_||has_flag(o.argnames[u],1)){if(d=e.args[u].drop_side_effect_free(t))e.args[a++]=d;else if(!_){e.args[a++]=make_node(AST_Number,e.args[u],{value:0});continue}}else e.args[a++]=e.args[u];s=a;}e.args.length=s;}if(t.option("unsafe"))if(is_undeclared_ref(n))switch(n.name){case"Array":if(1!=e.args.length)return make_node(AST_Array,e,{elements:e.args}).optimize(t);if(e.args[0]instanceof AST_Number&&e.args[0].value<=11){const t=[];for(let n=0;n<e.args[0].value;n++)t.push(new AST_Hole);return new AST_Array({elements:t})}break;case"Object":if(0==e.args.length)return make_node(AST_Object,e,{properties:[]});break;case"String":if(0==e.args.length)return make_node(AST_String,e,{value:""});if(e.args.length<=1)return make_node(AST_Binary,e,{left:e.args[0],operator:"+",right:make_node(AST_String,e,{value:""})}).optimize(t);break;case"Number":if(0==e.args.length)return make_node(AST_Number,e,{value:0});if(1==e.args.length&&t.option("unsafe_math"))return make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"+"}).optimize(t);break;case"Symbol":1==e.args.length&&e.args[0]instanceof AST_String&&t.option("unsafe_symbols")&&(e.args.length=0);break;case"Boolean":if(0==e.args.length)return make_node(AST_False,e);if(1==e.args.length)return make_node(AST_UnaryPrefix,e,{expression:make_node(AST_UnaryPrefix,e,{expression:e.args[0],operator:"!"}),operator:"!"}).optimize(t);break;case"RegExp":var c=[];if(e.args.length>=1&&e.args.length<=2&&e.args.every((e=>{var n=e.evaluate(t);return c.push(n),e!==n}))){let[n,o]=c;n=regexp_source_fix(new RegExp(n).source);const i=make_node(AST_RegExp,e,{value:{source:n,flags:o}});if(i._eval(t)!==i)return i}}else if(n instanceof AST_Dot)switch(n.property){case"toString":if(0==e.args.length&&!n.expression.may_throw_on_access(t))return make_node(AST_Binary,e,{left:make_node(AST_String,e,{value:""}),operator:"+",right:n.expression}).optimize(t);break;case"join":if(n.expression instanceof AST_Array)e:{var f;if(!(e.args.length>0&&(f=e.args[0].evaluate(t))===e.args[0])){var p,d,S=[],m=[];for(u=0,l=n.expression.elements.length;u<l;u++){var A=n.expression.elements[u];if(A instanceof AST_Expansion)break e;var T=A.evaluate(t);T!==A?m.push(T):(m.length>0&&(S.push(make_node(AST_String,e,{value:m.join(f)})),m.length=0),S.push(A));}return m.length>0&&S.push(make_node(AST_String,e,{value:m.join(f)})),0==S.length?make_node(AST_String,e,{value:""}):1==S.length?S[0].is_string(t)?S[0]:make_node(AST_Binary,S[0],{operator:"+",left:make_node(AST_String,e,{value:""}),right:S[0]}):""==f?(p=S[0].is_string(t)||S[1].is_string(t)?S.shift():make_node(AST_String,e,{value:""}),S.reduce((function(e,t){return make_node(AST_Binary,t,{operator:"+",left:e,right:t})}),p).optimize(t)):((d=e.clone()).expression=d.expression.clone(),d.expression.expression=d.expression.expression.clone(),d.expression.expression.elements=S,best_of(t,e,d))}}break;case"charAt":if(n.expression.is_string(t)){var h=e.args[0],E=h?h.evaluate(t):0;if(E!==h)return make_node(AST_Sub,n,{expression:n.expression,property:make_node_from_constant(0|E,h||n)}).optimize(t)}break;case"apply":if(2==e.args.length&&e.args[1]instanceof AST_Array)return (I=e.args[1].elements.slice()).unshift(e.args[0]),make_node(AST_Call,e,{expression:make_node(AST_Dot,n,{expression:n.expression,optional:!1,property:"call"}),args:I}).optimize(t);break;case"call":var g=n.expression;if(g instanceof AST_SymbolRef&&(g=g.fixed_value()),g instanceof AST_Lambda&&!g.contains_this())return (e.args.length?make_sequence(this,[e.args[0],make_node(AST_Call,e,{expression:n.expression,args:e.args.slice(1)})]):make_node(AST_Call,e,{expression:n.expression,args:[]})).optimize(t)}if(t.option("unsafe_Function")&&is_undeclared_ref(n)&&"Function"==n.name){if(0==e.args.length)return make_node(AST_Function,e,{argnames:[],body:[]}).optimize(t);if(e.args.every((e=>e instanceof AST_String)))try{var D=parse$5(C="n(function("+e.args.slice(0,-1).map((function(e){return e.value})).join(",")+"){"+e.args[e.args.length-1].value+"})"),b={ie8:t.option("ie8")};D.figure_out_scope(b);var y,v=new Compressor(t.options,{mangle_options:t.mangle_options});(D=D.transform(v)).figure_out_scope(b),base54.reset(),D.compute_char_frequency(b),D.mangle_names(b),walk$3(D,(e=>{if(is_func_expr(e))return y=e,walk_abort}));var C=OutputStream();return AST_BlockStatement.prototype._codegen.call(y,y,C),e.args=[make_node(AST_String,e,{value:y.argnames.map((function(e){return e.print_to_string()})).join(",")}),make_node(AST_String,e.args[e.args.length-1],{value:C.get().replace(/^{|}$/g,"")})],e}catch(e){if(!(e instanceof JS_Parse_Error))throw e}}var R=r&&o.body[0],k=r&&!o.is_generator&&!o.async,O=k&&t.option("inline")&&!e.is_expr_pure(t);if(O&&R instanceof AST_Return){let n=R.value;if(!n||n.is_constant_expression()){n=n?n.clone(!0):make_node(AST_Undefined,e);const o=e.args.concat(n);return make_sequence(e,o).optimize(t)}if(1===o.argnames.length&&o.argnames[0]instanceof AST_SymbolFunarg&&e.args.length<2&&n instanceof AST_SymbolRef&&n.name===o.argnames[0].name){const n=(e.args[0]||make_node(AST_Undefined)).optimize(t);let o;return n instanceof AST_PropAccess&&(o=t.parent())instanceof AST_Call&&o.expression===e?make_sequence(e,[make_node(AST_Number,e,{value:0}),n]):n}}if(O){var F,N,M=-1;let r,a,s;if(i&&!o.uses_arguments&&!(t.parent()instanceof AST_Class)&&!(o.name&&o instanceof AST_Function)&&(a=function(e){var n=o.body,i=n.length;if(t.option("inline")<3)return 1==i&&w(e);e=null;for(var r=0;r<i;r++){var a=n[r];if(a instanceof AST_Var){if(e&&!a.definitions.every((e=>!e.value)))return !1}else {if(e)return !1;a instanceof AST_EmptyStatement||(e=a);}}return w(e)}(R))&&(n===o||has_annotation(e,_INLINE)||t.option("unused")&&1==(r=n.definition()).references.length&&!recursive_ref(t,r)&&o.is_constant_expression(n.scope))&&!has_annotation(e,_PURE|_NOINLINE)&&!o.contains_this()&&function(){var e=new Set;do{if((F=t.parent(++M)).is_block_scope()&&F.block_scope&&F.block_scope.variables.forEach((function(t){e.add(t.name);})),F instanceof AST_Catch)F.argname&&e.add(F.argname.name);else if(F instanceof AST_IterationStatement)N=[];else if(F instanceof AST_SymbolRef&&F.fixed_value()instanceof AST_Scope)return !1}while(!(F instanceof AST_Scope));var n=!(F instanceof AST_Toplevel)||t.toplevel.vars,i=t.option("inline");return !(!function(e,t){for(var n=o.body.length,i=0;i<n;i++){var r=o.body[i];if(r instanceof AST_Var){if(!t)return !1;for(var a=r.definitions.length;--a>=0;){var s=r.definitions[a].name;if(s instanceof AST_Destructuring||e.has(s.name)||identifier_atom.has(s.name)||F.conflicting_def(s.name))return !1;N&&N.push(s.definition());}}}return !0}(e,i>=3&&n)||!function(e,t){for(var n=0,i=o.argnames.length;n<i;n++){var r=o.argnames[n];if(r instanceof AST_DefaultAssign){if(has_flag(r.left,1))continue;return !1}if(r instanceof AST_Destructuring)return !1;if(r instanceof AST_Expansion){if(has_flag(r.expression,1))continue;return !1}if(!has_flag(r,1)){if(!t||e.has(r.name)||identifier_atom.has(r.name)||F.conflicting_def(r.name))return !1;N&&N.push(r.definition());}}return !0}(e,i>=2&&n)||N&&0!=N.length&&is_reachable(o,N))}()&&(s=find_scope(t))&&!scope_encloses_variables_in_this_scope(s,o)&&!function(){let e,n=0;for(;e=t.parent(n++);){if(e instanceof AST_DefaultAssign)return !0;if(e instanceof AST_Block)break}return !1}()&&!(F instanceof AST_Class))return set_flag(o,256),s.add_child_scope(o),make_sequence(e,function(n){var i=[],r=[];if(function(t,n){for(var i=o.argnames.length,r=e.args.length;--r>=i;)n.push(e.args[r]);for(r=i;--r>=0;){var a=o.argnames[r],s=e.args[r];if(has_flag(a,1)||!a.name||F.conflicting_def(a.name))s&&n.push(s);else {var u=make_node(AST_SymbolVar,a,a);a.definition().orig.push(u),!s&&N&&(s=make_node(AST_Undefined,e)),P(t,n,u,s);}}t.reverse(),n.reverse();}(i,r),function(e,t){for(var n=t.length,i=0,r=o.body.length;i<r;i++){var a=o.body[i];if(a instanceof AST_Var)for(var s=0,u=a.definitions.length;s<u;s++){var l=a.definitions[s],_=l.name;if(P(e,t,_,l.value),N&&o.argnames.every((e=>e.name!=_.name))){var c=o.variables.get(_.name),f=make_node(AST_SymbolRef,_,_);c.references.push(f),t.splice(n++,0,make_node(AST_Assign,l,{operator:"=",logical:!1,left:f,right:make_node(AST_Undefined,_)}));}}}}(i,r),r.push(n),i.length){const e=F.body.indexOf(t.parent(M-1))+1;F.body.splice(e,0,make_node(AST_Var,o,{definitions:i}));}return r.map((e=>e.clone(!0)))}(a)).optimize(t)}if(O&&has_annotation(e,_INLINE))return set_flag(o,256),(o=make_node(o.CTOR===AST_Defun?AST_Function:o.CTOR,o,o)).figure_out_scope({},{parent_scope:find_scope(t),toplevel:t.get_toplevel()}),make_node(AST_Call,e,{expression:o,args:e.args}).optimize(t);if(k&&t.option("side_effects")&&o.body.every(is_empty)){var I=e.args.concat(make_node(AST_Undefined,e));return make_sequence(e,I).optimize(t)}if(t.option("negate_iife")&&t.parent()instanceof AST_SimpleStatement&&is_iife_call(e))return e.negate(t,!0);var x=e.evaluate(t);return x!==e?(x=make_node_from_constant(x,e).optimize(t),best_of(t,x,e)):e;function w(t){return t?t instanceof AST_Return?t.value?t.value.clone(!0):make_node(AST_Undefined,e):t instanceof AST_SimpleStatement?make_node(AST_UnaryPrefix,t,{operator:"void",expression:t.body.clone(!0)}):void 0:make_node(AST_Undefined,e)}function P(t,n,o,i){var r=o.definition();F.variables.has(o.name)||(F.variables.set(o.name,r),F.enclosed.push(r),t.push(make_node(AST_VarDef,o,{name:o,value:null})));var a=make_node(AST_SymbolRef,o,o);r.references.push(a),i&&n.push(make_node(AST_Assign,e,{operator:"=",logical:!1,left:a,right:i.clone()}));}})),def_optimize(AST_New,(function(e,t){return t.option("unsafe")&&is_undeclared_ref(e.expression)&&["Object","RegExp","Function","Error","Array"].includes(e.expression.name)?make_node(AST_Call,e,e).transform(t):e})),def_optimize(AST_Sequence,(function(e,t){if(!t.option("side_effects"))return e;var n,o,i=[];n=first_in_statement(t),o=e.expressions.length-1,e.expressions.forEach((function(e,r){r<o&&(e=e.drop_side_effect_free(t,n)),e&&(merge_sequence(i,e),n=!1);}));var r=i.length-1;return function(){for(;r>0&&is_undefined(i[r],t);)r--;r<i.length-1&&(i[r]=make_node(AST_UnaryPrefix,e,{operator:"void",expression:i[r]}),i.length=r+1);}(),0==r?((e=maintain_this_binding(t.parent(),t.self(),i[0]))instanceof AST_Sequence||(e=e.optimize(t)),e):(e.expressions=i,e)})),AST_Unary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")&&this.expression instanceof AST_Sequence){var t=this.expression.expressions.slice(),n=this.clone();return n.expression=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}return this})),def_optimize(AST_UnaryPostfix,(function(e,t){return e.lift_sequences(t)})),def_optimize(AST_UnaryPrefix,(function(e,t){var n=e.expression;if("delete"==e.operator&&!(n instanceof AST_SymbolRef||n instanceof AST_PropAccess||is_identifier_atom(n))){if(n instanceof AST_Sequence){const o=n.expressions.slice();return o.push(make_node(AST_True,e)),make_sequence(e,o).optimize(t)}return make_sequence(e,[n,make_node(AST_True,e)]).optimize(t)}var o=e.lift_sequences(t);if(o!==e)return o;if(t.option("side_effects")&&"void"==e.operator)return (n=n.drop_side_effect_free(t))?(e.expression=n,e):make_node(AST_Undefined,e).optimize(t);if(t.in_boolean_context())switch(e.operator){case"!":if(n instanceof AST_UnaryPrefix&&"!"==n.operator)return n.expression;n instanceof AST_Binary&&(e=best_of(t,e,n.negate(t,first_in_statement(t))));break;case"typeof":return (n instanceof AST_SymbolRef?make_node(AST_True,e):make_sequence(e,[n,make_node(AST_True,e)])).optimize(t)}if("-"==e.operator&&n instanceof AST_Infinity&&(n=n.transform(t)),n instanceof AST_Binary&&("+"==e.operator||"-"==e.operator)&&("*"==n.operator||"/"==n.operator||"%"==n.operator))return make_node(AST_Binary,e,{operator:n.operator,left:make_node(AST_UnaryPrefix,n.left,{operator:e.operator,expression:n.left}),right:n.right});if("-"!=e.operator||!(n instanceof AST_Number||n instanceof AST_Infinity||n instanceof AST_BigInt)){var i=e.evaluate(t);if(i!==e)return best_of(t,i=make_node_from_constant(i,e).optimize(t),e)}return e})),AST_Binary.DEFMETHOD("lift_sequences",(function(e){if(e.option("sequences")){if(this.left instanceof AST_Sequence){var t=this.left.expressions.slice();return (n=this.clone()).left=t.pop(),t.push(n),make_sequence(this,t).optimize(e)}if(this.right instanceof AST_Sequence&&!this.left.has_side_effects(e)){for(var n,o="="==this.operator&&this.left instanceof AST_SymbolRef,i=(t=this.right.expressions).length-1,r=0;r<i&&(o||!t[r].has_side_effects(e));r++);if(r==i)return t=t.slice(),(n=this.clone()).right=t.pop(),t.push(n),make_sequence(this,t).optimize(e);if(r>0)return (n=this.clone()).right=make_sequence(this.right,t.slice(r)),(t=t.slice(0,r)).push(n),make_sequence(this,t).optimize(e)}}return this}));var commutativeOperators=makePredicate("== === != !== * & | ^");function is_object(e){return e instanceof AST_Array||e instanceof AST_Lambda||e instanceof AST_Object||e instanceof AST_Class}function recursive_ref(e,t){for(var n,o=0;n=e.parent(o);o++)if(n instanceof AST_Lambda||n instanceof AST_Class){var i=n.name;if(i&&i.definition()===t)break}return n}function within_array_or_object_literal(e){for(var t,n=0;t=e.parent(n++);){if(t instanceof AST_Statement)return !1;if(t instanceof AST_Array||t instanceof AST_ObjectKeyVal||t instanceof AST_Object)return !0}return !1}function scope_encloses_variables_in_this_scope(e,t){for(const n of t.enclosed){if(t.variables.has(n.name))continue;const o=e.find_variable(n.name);if(o){if(o===n)continue;return !0}}return !1}function is_atomic(e,t){return e instanceof AST_SymbolRef||e.TYPE===t.TYPE}function is_reachable(e,t){const n=e=>{if(e instanceof AST_SymbolRef&&member(e.definition(),t))return walk_abort};return walk_parent(e,((t,o)=>{if(t instanceof AST_Scope&&t!==e){var i=o.parent();if(i instanceof AST_Call&&i.expression===t)return;return !walk$3(t,n)||walk_abort}}))}def_optimize(AST_Binary,(function(e,t){function n(){return e.left.is_constant()||e.right.is_constant()||!e.left.has_side_effects(t)&&!e.right.has_side_effects(t)}function o(t){if(n()){t&&(e.operator=t);var o=e.left;e.left=e.right,e.right=o;}}if(commutativeOperators.has(e.operator)&&e.right.is_constant()&&!e.left.is_constant()&&(e.left instanceof AST_Binary&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator]||o()),e=e.lift_sequences(t),t.option("comparisons"))switch(e.operator){case"===":case"!==":var i=!0;(e.left.is_string(t)&&e.right.is_string(t)||e.left.is_number(t)&&e.right.is_number(t)||e.left.is_boolean()&&e.right.is_boolean()||e.left.equivalent_to(e.right))&&(e.operator=e.operator.substr(0,2));case"==":case"!=":if(!i&&is_undefined(e.left,t))e.left=make_node(AST_Null,e.left);else if(t.option("typeofs")&&e.left instanceof AST_String&&"undefined"==e.left.value&&e.right instanceof AST_UnaryPrefix&&"typeof"==e.right.operator){var r=e.right.expression;(r instanceof AST_SymbolRef?!r.is_declared(t):r instanceof AST_PropAccess&&t.option("ie8"))||(e.right=r,e.left=make_node(AST_Undefined,e.left).optimize(t),2==e.operator.length&&(e.operator+="="));}else if(e.left instanceof AST_SymbolRef&&e.right instanceof AST_SymbolRef&&e.left.definition()===e.right.definition()&&is_object(e.left.fixed_value()))return make_node("="==e.operator[0]?AST_True:AST_False,e);break;case"&&":case"||":var a=e.left;if(a.operator==e.operator&&(a=a.right),a instanceof AST_Binary&&a.operator==("&&"==e.operator?"!==":"===")&&e.right instanceof AST_Binary&&a.operator==e.right.operator&&(is_undefined(a.left,t)&&e.right.left instanceof AST_Null||a.left instanceof AST_Null&&is_undefined(e.right.left,t))&&!a.right.has_side_effects(t)&&a.right.equivalent_to(e.right.right)){var s=make_node(AST_Binary,e,{operator:a.operator.slice(0,-1),left:make_node(AST_Null,e),right:a.right});return a!==e.left&&(s=make_node(AST_Binary,e,{operator:e.operator,left:e.left.left,right:s})),s}}if("+"==e.operator&&t.in_boolean_context()){var u=e.left.evaluate(t),l=e.right.evaluate(t);if(u&&"string"==typeof u)return make_sequence(e,[e.right,make_node(AST_True,e)]).optimize(t);if(l&&"string"==typeof l)return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t)}if(t.option("comparisons")&&e.is_boolean()){if(!(t.parent()instanceof AST_Binary)||t.parent()instanceof AST_Assign){var _=make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t,first_in_statement(t))});e=best_of(t,e,_);}if(t.option("unsafe_comps"))switch(e.operator){case"<":o(">");break;case"<=":o(">=");}}if("+"==e.operator){if(e.right instanceof AST_String&&""==e.right.getValue()&&e.left.is_string(t))return e.left;if(e.left instanceof AST_String&&""==e.left.getValue()&&e.right.is_string(t))return e.right;if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.left instanceof AST_String&&""==e.left.left.getValue()&&e.right.is_string(t))return e.left=e.left.right,e}if(t.option("evaluate")){switch(e.operator){case"&&":if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(!(u instanceof AST_Node))return make_sequence(e,[e.left,e.right]).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)&&("&&"==(c=t.parent()).operator&&c.left===t.self()||t.in_boolean_context()))return e.left.optimize(t)}else {if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_False,e)]).optimize(t);set_flag(e,4);}if("||"==e.left.operator&&!(f=e.left.right.evaluate(t)))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.right,alternative:e.left.right}).optimize(t);break;case"||":var c,f;if(!(u=!!has_flag(e.left,2)||!has_flag(e.left,4)&&e.left.evaluate(t)))return make_sequence(e,[e.left,e.right]).optimize(t);if(!(u instanceof AST_Node))return maintain_this_binding(t.parent(),t.self(),e.left).optimize(t);if(l=e.right.evaluate(t)){if(!(l instanceof AST_Node)){if(t.in_boolean_context())return make_sequence(e,[e.left,make_node(AST_True,e)]).optimize(t);set_flag(e,2);}}else if("||"==(c=t.parent()).operator&&c.left===t.self()||t.in_boolean_context())return e.left.optimize(t);if("&&"==e.left.operator&&(f=e.left.right.evaluate(t))&&!(f instanceof AST_Node))return make_node(AST_Conditional,e,{condition:e.left.left,consequent:e.left.right,alternative:e.right}).optimize(t);break;case"??":if(is_nullish(e.left))return e.right;if(!((u=e.left.evaluate(t))instanceof AST_Node))return null==u?e.right:e.left;if(t.in_boolean_context()){const n=e.right.evaluate(t);if(!(n instanceof AST_Node||n))return e.left}}var p=!0;switch(e.operator){case"+":if(e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)){var d=(S=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right})).optimize(t);S!==d&&(e=make_node(AST_Binary,e,{operator:"+",left:e.left.left,right:d}));}if(e.left instanceof AST_Binary&&"+"==e.left.operator&&e.left.is_string(t)&&e.right instanceof AST_Binary&&"+"==e.right.operator&&e.right.is_string(t)){var S,m=(S=make_node(AST_Binary,e,{operator:"+",left:e.left.right,right:e.right.left})).optimize(t);S!==m&&(e=make_node(AST_Binary,e,{operator:"+",left:make_node(AST_Binary,e.left,{operator:"+",left:e.left.left,right:m}),right:e.right.right}));}if(e.right instanceof AST_UnaryPrefix&&"-"==e.right.operator&&e.left.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.left,right:e.right.expression});break}if(e.left instanceof AST_UnaryPrefix&&"-"==e.left.operator&&n()&&e.right.is_number(t)){e=make_node(AST_Binary,e,{operator:"-",left:e.right,right:e.left.expression});break}if(e.left instanceof AST_TemplateString){var A=e.left;if((d=e.right.evaluate(t))!=e.right)return A.segments[A.segments.length-1].value+=String(d),A}if(e.right instanceof AST_TemplateString&&(d=e.right,(A=e.left.evaluate(t))!=e.left))return d.segments[0].value=String(A)+d.segments[0].value,d;if(e.left instanceof AST_TemplateString&&e.right instanceof AST_TemplateString){var T=(A=e.left).segments;d=e.right,T[T.length-1].value+=d.segments[0].value;for(var h=1;h<d.segments.length;h++)T.push(d.segments[h]);return A}case"*":p=t.option("unsafe_math");case"&":case"|":case"^":if(e.left.is_number(t)&&e.right.is_number(t)&&n()&&!(e.left instanceof AST_Binary&&e.left.operator!=e.operator&&PRECEDENCE[e.left.operator]>=PRECEDENCE[e.operator])){var E=make_node(AST_Binary,e,{operator:e.operator,left:e.right,right:e.left});e=e.right instanceof AST_Constant&&!(e.left instanceof AST_Constant)?best_of(t,E,e):best_of(t,e,E);}p&&e.is_number(t)&&(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left,right:e.right.left,start:e.left.start,end:e.right.left.end}),right:e.right.right})),e.right instanceof AST_Constant&&e.left instanceof AST_Binary&&e.left.operator==e.operator&&(e.left.left instanceof AST_Constant?e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.left,right:e.right,start:e.left.left.start,end:e.right.end}),right:e.left.right}):e.left.right instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.right,right:e.right,start:e.left.right.start,end:e.right.end}),right:e.left.left}))),e.left instanceof AST_Binary&&e.left.operator==e.operator&&e.left.right instanceof AST_Constant&&e.right instanceof AST_Binary&&e.right.operator==e.operator&&e.right.left instanceof AST_Constant&&(e=make_node(AST_Binary,e,{operator:e.operator,left:make_node(AST_Binary,e.left,{operator:e.operator,left:make_node(AST_Binary,e.left.left,{operator:e.operator,left:e.left.right,right:e.right.left,start:e.left.right.start,end:e.right.left.end}),right:e.left.left}),right:e.right.right})));}}if(e.right instanceof AST_Binary&&e.right.operator==e.operator&&(lazy_op.has(e.operator)||"+"==e.operator&&(e.right.left.is_string(t)||e.left.is_string(t)&&e.right.right.is_string(t))))return e.left=make_node(AST_Binary,e.left,{operator:e.operator,left:e.left.transform(t),right:e.right.left.transform(t)}),e.right=e.right.right.transform(t),e.transform(t);var g=e.evaluate(t);return g!==e?(g=make_node_from_constant(g,e).optimize(t),best_of(t,g,e)):e})),def_optimize(AST_SymbolExport,(function(e){return e})),def_optimize(AST_SymbolRef,(function(e,t){if(!t.option("ie8")&&is_undeclared_ref(e)&&!t.find_parent(AST_With))switch(e.name){case"undefined":return make_node(AST_Undefined,e).optimize(t);case"NaN":return make_node(AST_NaN,e).optimize(t);case"Infinity":return make_node(AST_Infinity,e).optimize(t)}const n=t.parent();if(t.option("reduce_vars")&&is_lhs(e,n)!==e){const r=e.definition(),a=find_scope(t);if(t.top_retain&&r.global&&t.top_retain(r))return r.fixed=!1,r.single_use=!1,e;let s=e.fixed_value(),u=r.single_use&&!(n instanceof AST_Call&&n.is_expr_pure(t)||has_annotation(n,_NOINLINE))&&!(n instanceof AST_Export&&s instanceof AST_Lambda&&s.name);if(u&&(s instanceof AST_Lambda||s instanceof AST_Class))if(retain_top_func(s,t))u=!1;else if(r.scope!==e.scope&&(1==r.escaped||has_flag(s,16)||within_array_or_object_literal(t)))u=!1;else if(recursive_ref(t,r))u=!1;else if((r.scope!==e.scope||r.orig[0]instanceof AST_SymbolFunarg)&&(u=s.is_constant_expression(e.scope),"f"==u)){var o=e.scope;do{(o instanceof AST_Defun||is_func_expr(o))&&set_flag(o,16);}while(o=o.parent_scope)}if(u&&s instanceof AST_Lambda&&(u=r.scope===e.scope&&!scope_encloses_variables_in_this_scope(a,s)||n instanceof AST_Call&&n.expression===e&&!scope_encloses_variables_in_this_scope(a,s)&&!(s.name&&s.name.definition().recursive_refs>0)),u&&s instanceof AST_Class&&(u=!(s.extends&&(s.extends.may_throw(t)||s.extends.has_side_effects(t))||s.properties.some((e=>e.may_throw(t)||e.has_side_effects(t))))),u&&s){if(s instanceof AST_DefClass&&(set_flag(s,256),s=make_node(AST_ClassExpression,s,s)),s instanceof AST_Defun&&(set_flag(s,256),s=make_node(AST_Function,s,s)),r.recursive_refs>0&&s.name instanceof AST_SymbolDefun){const e=s.name.definition();let t=s.variables.get(s.name.name),n=t&&t.orig[0];n instanceof AST_SymbolLambda||(n=make_node(AST_SymbolLambda,s.name,s.name),n.scope=s,s.name=n,t=s.def_function(n)),walk$3(s,(n=>{n instanceof AST_SymbolRef&&n.definition()===e&&(n.thedef=t,t.references.push(n));}));}return (s instanceof AST_Lambda||s instanceof AST_Class)&&s.parent_scope!==a&&(s=s.clone(!0,t.get_toplevel()),a.add_child_scope(s)),s.optimize(t)}if(s){let n;if(s instanceof AST_This)r.orig[0]instanceof AST_SymbolFunarg||!r.references.every((e=>r.scope===e.scope))||(n=s);else {var i=s.evaluate(t);i===s||!t.option("unsafe_regexp")&&i instanceof RegExp||(n=make_node_from_constant(i,s));}if(n){const o=e.size(t),i=n.size(t);let a=0;if(t.option("unused")&&!t.exposed(r)&&(a=(o+2+i)/(r.references.length-r.assignments)),i<=o+a)return n}}}return e})),def_optimize(AST_Undefined,(function(e,t){if(t.option("unsafe_undefined")){var n=find_variable(t,"undefined");if(n){var o=make_node(AST_SymbolRef,e,{name:"undefined",scope:n.scope,thedef:n});return set_flag(o,8),o}}var i=is_lhs(t.self(),t.parent());return i&&is_atomic(i,e)?e:make_node(AST_UnaryPrefix,e,{operator:"void",expression:make_node(AST_Number,e,{value:0})})})),def_optimize(AST_Infinity,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&is_atomic(n,e)?e:!t.option("keep_infinity")||n&&!is_atomic(n,e)||find_variable(t,"Infinity")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:1}),right:make_node(AST_Number,e,{value:0})}):e})),def_optimize(AST_NaN,(function(e,t){var n=is_lhs(t.self(),t.parent());return n&&!is_atomic(n,e)||find_variable(t,"NaN")?make_node(AST_Binary,e,{operator:"/",left:make_node(AST_Number,e,{value:0}),right:make_node(AST_Number,e,{value:0})}):e}));const ASSIGN_OPS=makePredicate("+ - / * % >> << >>> | ^ &"),ASSIGN_OPS_COMMUTATIVE=makePredicate("* | ^ &");function is_nullish(e){let t;return e instanceof AST_Null||is_undefined(e)||e instanceof AST_SymbolRef&&(t=e.definition().fixed)instanceof AST_Node&&is_nullish(t)||e instanceof AST_PropAccess&&e.optional&&is_nullish(e.expression)||e instanceof AST_Call&&e.optional&&is_nullish(e.expression)||e instanceof AST_Chain&&is_nullish(e.expression)}function is_nullish_check(e,t,n){if(t.may_throw(n))return !1;let o;if(e instanceof AST_Binary&&"=="===e.operator&&((o=is_nullish(e.left)&&e.left)||(o=is_nullish(e.right)&&e.right))&&(o===e.left?e.right:e.left).equivalent_to(t))return !0;if(e instanceof AST_Binary&&"||"===e.operator){let n,o;const i=e=>{if(!(e instanceof AST_Binary)||"==="!==e.operator&&"=="!==e.operator)return !1;let i,r=0;return e.left instanceof AST_Null&&(r++,n=e,i=e.right),e.right instanceof AST_Null&&(r++,n=e,i=e.left),is_undefined(e.left)&&(r++,o=e,i=e.right),is_undefined(e.right)&&(r++,o=e,i=e.left),1===r&&!!i.equivalent_to(t)};if(!i(e.left))return !1;if(!i(e.right))return !1;if(n&&o&&n!==o)return !0}return !1}function safe_to_flatten(e,t){return e instanceof AST_SymbolRef&&(e=e.fixed_value()),!!e&&(!(e instanceof AST_Lambda||e instanceof AST_Class)||!(e instanceof AST_Lambda&&e.contains_this())||t.parent()instanceof AST_New)}function literals_in_boolean_context(e,t){return t.in_boolean_context()?best_of(t,e,make_sequence(e,[e,make_node(AST_True,e)]).optimize(t)):e}function inline_array_like_spread(e){for(var t=0;t<e.length;t++){var n=e[t];if(n instanceof AST_Expansion){var o=n.expression;o instanceof AST_Array&&!o.elements.some((e=>e instanceof AST_Hole))&&(e.splice(t,1,...o.elements),t--);}}}function inline_object_prop_spread(e){for(var t=0;t<e.length;t++){var n=e[t];if(n instanceof AST_Expansion){const o=n.expression;o instanceof AST_Object&&o.properties.every((e=>e instanceof AST_ObjectKeyVal))?(e.splice(t,1,...o.properties),t--):o instanceof AST_Constant&&!(o instanceof AST_String)&&e.splice(t,1);}}}function lift_key(e,t){if(!t.option("computed_props"))return e;if(!(e.key instanceof AST_Constant))return e;if(e.key instanceof AST_String||e.key instanceof AST_Number){if("__proto__"===e.key.value)return e;if("constructor"==e.key.value&&t.parent()instanceof AST_Class)return e;e.key=e instanceof AST_ObjectKeyVal?e.key.value:make_node(e instanceof AST_ClassProperty?AST_SymbolClassProperty:AST_SymbolMethod,e.key,{name:e.key.value});}return e}async function SourceMap$3(e){var t;e=defaults$1(e,{file:null,root:null,orig:null,orig_line_diff:0,dest_line_diff:0});var n=new sourceMap.SourceMapGenerator({file:e.file,sourceRoot:e.root});return e.orig&&(t=await new sourceMap.SourceMapConsumer(e.orig)).sources.forEach((function(e){var o=t.sourceContentFor(e,!0);o&&n.setSourceContent(e,o);})),{add:function(o,i,r,a,s,u){if(t){var l=t.originalPositionFor({line:a,column:s});if(null===l.source)return;o=l.source,a=l.line,s=l.column,u=l.name||u;}n.addMapping({generated:{line:i+e.dest_line_diff,column:r},original:{line:a+e.orig_line_diff,column:s},source:o,name:u});},get:function(){return n},toString:function(){return n.toString()},destroy:function(){t&&t.destroy&&t.destroy();}}}def_optimize(AST_Assign,(function(e,t){if(e.logical)return e.lift_sequences(t);var n;if(t.option("dead_code")&&e.left instanceof AST_SymbolRef&&(n=e.left.definition()).scope===t.find_parent(AST_Lambda)){var o,i=0,r=e;do{if(o=r,(r=t.parent(i++))instanceof AST_Exit){if(a(i,r))break;if(is_reachable(n.scope,[n]))break;return "="==e.operator?e.right:(n.fixed=!1,make_node(AST_Binary,e,{operator:e.operator.slice(0,-1),left:e.left,right:e.right}).optimize(t))}}while(r instanceof AST_Binary&&r.right===o||r instanceof AST_Sequence&&r.tail_node()===o)}return "="==(e=e.lift_sequences(t)).operator&&e.left instanceof AST_SymbolRef&&e.right instanceof AST_Binary&&(e.right.left instanceof AST_SymbolRef&&e.right.left.name==e.left.name&&ASSIGN_OPS.has(e.right.operator)?(e.operator=e.right.operator+"=",e.right=e.right.right):e.right.right instanceof AST_SymbolRef&&e.right.right.name==e.left.name&&ASSIGN_OPS_COMMUTATIVE.has(e.right.operator)&&!e.right.left.has_side_effects(t)&&(e.operator=e.right.operator+"=",e.right=e.right.left)),e;function a(n,o){var i=e.right;e.right=make_node(AST_Null,i);var r=o.may_throw(t);e.right=i;for(var a,s=e.left.definition().scope;(a=t.parent(n++))!==s;)if(a instanceof AST_Try){if(a.bfinally)return !0;if(r&&a.bcatch)return !0}}})),def_optimize(AST_DefaultAssign,(function(e,t){if(!t.option("evaluate"))return e;var n=e.right.evaluate(t);return void 0===n?e=e.left:n!==e.right&&(n=make_node_from_constant(n,e.right),e.right=best_of_expression(n,e.right)),e})),def_optimize(AST_Conditional,(function(e,t){if(!t.option("conditionals"))return e;if(e.condition instanceof AST_Sequence){var n=e.condition.expressions.slice();return e.condition=n.pop(),n.push(e),make_sequence(e,n)}var o=e.condition.evaluate(t);if(o!==e.condition)return maintain_this_binding(t.parent(),t.self(),o?e.consequent:e.alternative);var i=o.negate(t,first_in_statement(t));best_of(t,o,i)===i&&(e=make_node(AST_Conditional,e,{condition:i,consequent:e.alternative,alternative:e.consequent}));var r,a=e.condition,s=e.consequent,u=e.alternative;if(a instanceof AST_SymbolRef&&s instanceof AST_SymbolRef&&a.definition()===s.definition())return make_node(AST_Binary,e,{operator:"||",left:a,right:u});if(s instanceof AST_Assign&&u instanceof AST_Assign&&s.operator===u.operator&&s.logical===u.logical&&s.left.equivalent_to(u.left)&&(!e.condition.has_side_effects(t)||"="==s.operator&&!s.left.has_side_effects(t)))return make_node(AST_Assign,e,{operator:s.operator,left:s.left,logical:s.logical,right:make_node(AST_Conditional,e,{condition:e.condition,consequent:s.right,alternative:u.right})});if(s instanceof AST_Call&&u.TYPE===s.TYPE&&s.args.length>0&&s.args.length==u.args.length&&s.expression.equivalent_to(u.expression)&&!e.condition.has_side_effects(t)&&!s.expression.has_side_effects(t)&&"number"==typeof(r=function(){for(var e=s.args,t=u.args,n=0,o=e.length;n<o;n++){if(e[n]instanceof AST_Expansion)return;if(!e[n].equivalent_to(t[n])){if(t[n]instanceof AST_Expansion)return;for(var i=n+1;i<o;i++){if(e[i]instanceof AST_Expansion)return;if(!e[i].equivalent_to(t[i]))return}return n}}}())){var l=s.clone();return l.args[r]=make_node(AST_Conditional,e,{condition:e.condition,consequent:s.args[r],alternative:u.args[r]}),l}if(u instanceof AST_Conditional&&s.equivalent_to(u.consequent))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{operator:"||",left:a,right:u.condition}),consequent:s,alternative:u.alternative}).optimize(t);if(t.option("ecma")>=2020&&is_nullish_check(a,u,t))return make_node(AST_Binary,e,{operator:"??",left:u,right:s}).optimize(t);if(u instanceof AST_Sequence&&s.equivalent_to(u.expressions[u.expressions.length-1]))return make_sequence(e,[make_node(AST_Binary,e,{operator:"||",left:a,right:make_sequence(e,u.expressions.slice(0,-1))}),s]).optimize(t);if(u instanceof AST_Binary&&"&&"==u.operator&&s.equivalent_to(u.right))return make_node(AST_Binary,e,{operator:"&&",left:make_node(AST_Binary,e,{operator:"||",left:a,right:u.left}),right:s}).optimize(t);if(s instanceof AST_Conditional&&s.alternative.equivalent_to(u))return make_node(AST_Conditional,e,{condition:make_node(AST_Binary,e,{left:e.condition,operator:"&&",right:s.condition}),consequent:s.consequent,alternative:u});if(s.equivalent_to(u))return make_sequence(e,[e.condition,s]).optimize(t);if(s instanceof AST_Binary&&"||"==s.operator&&s.right.equivalent_to(u))return make_node(AST_Binary,e,{operator:"||",left:make_node(AST_Binary,e,{operator:"&&",left:e.condition,right:s.left}),right:u}).optimize(t);var _=t.in_boolean_context();return f(e.consequent)?p(e.alternative)?c(e.condition):make_node(AST_Binary,e,{operator:"||",left:c(e.condition),right:e.alternative}):p(e.consequent)?f(e.alternative)?c(e.condition.negate(t)):make_node(AST_Binary,e,{operator:"&&",left:c(e.condition.negate(t)),right:e.alternative}):f(e.alternative)?make_node(AST_Binary,e,{operator:"||",left:c(e.condition.negate(t)),right:e.consequent}):p(e.alternative)?make_node(AST_Binary,e,{operator:"&&",left:c(e.condition),right:e.consequent}):e;function c(e){return e.is_boolean()?e:make_node(AST_UnaryPrefix,e,{operator:"!",expression:e.negate(t)})}function f(e){return e instanceof AST_True||_&&e instanceof AST_Constant&&e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&!e.expression.getValue()}function p(e){return e instanceof AST_False||_&&e instanceof AST_Constant&&!e.getValue()||e instanceof AST_UnaryPrefix&&"!"==e.operator&&e.expression instanceof AST_Constant&&e.expression.getValue()}})),def_optimize(AST_Boolean,(function(e,t){if(t.in_boolean_context())return make_node(AST_Number,e,{value:+e.value});var n=t.parent();return t.option("booleans_as_integers")?(n instanceof AST_Binary&&("==="==n.operator||"!=="==n.operator)&&(n.operator=n.operator.replace(/=$/,"")),make_node(AST_Number,e,{value:+e.value})):t.option("booleans")?n instanceof AST_Binary&&("=="==n.operator||"!="==n.operator)?make_node(AST_Number,e,{value:+e.value}):make_node(AST_UnaryPrefix,e,{operator:"!",expression:make_node(AST_Number,e,{value:1-e.value})}):e})),AST_PropAccess.DEFMETHOD("flatten_object",(function(e,t){if(t.option("properties")){var n=t.option("unsafe_arrows")&&t.option("ecma")>=2015,o=this.expression;if(o instanceof AST_Object)for(var i=o.properties,r=i.length;--r>=0;){var a=i[r];if(""+(a instanceof AST_ConciseMethod?a.key.name:a.key)==e){if(!i.every((e=>e instanceof AST_ObjectKeyVal||n&&e instanceof AST_ConciseMethod&&!e.is_generator)))break;if(!safe_to_flatten(a.value,t))break;return make_node(AST_Sub,this,{expression:make_node(AST_Array,o,{elements:i.map((function(e){var t=e.value;t instanceof AST_Accessor&&(t=make_node(AST_Function,t,t));var n=e.key;return n instanceof AST_Node&&!(n instanceof AST_SymbolMethod)?make_sequence(e,[n,t]):t}))}),property:make_node(AST_Number,this,{value:r})})}}}})),def_optimize(AST_Sub,(function(e,t){var n,o=e.expression,i=e.property;if(t.option("properties")){var r=i.evaluate(t);if(r!==i){"string"==typeof r&&("undefined"==r?r=void 0:(g=parseFloat(r)).toString()==r&&(r=g)),i=e.property=best_of_expression(i,make_node_from_constant(r,i).transform(t));var a=""+r;if(is_basic_identifier_string(a)&&a.length<=i.size()+1)return make_node(AST_Dot,e,{expression:o,optional:e.optional,property:a,quote:i.quote}).optimize(t)}}e:if(t.option("arguments")&&o instanceof AST_SymbolRef&&"arguments"==o.name&&1==o.definition().orig.length&&(n=o.scope)instanceof AST_Lambda&&n.uses_arguments&&!(n instanceof AST_Arrow)&&i instanceof AST_Number){for(var s=i.getValue(),u=new Set,l=n.argnames,_=0;_<l.length;_++){if(!(l[_]instanceof AST_SymbolFunarg))break e;var c=l[_].name;if(u.has(c))break e;u.add(c);}var f=n.argnames[s];if(f&&t.has_directive("use strict")){var p=f.definition();(!t.option("reduce_vars")||p.assignments||p.orig.length>1)&&(f=null);}else if(!f&&!t.option("keep_fargs")&&s<n.argnames.length+5)for(;s>=n.argnames.length;)f=n.create_symbol(AST_SymbolFunarg,{source:n,scope:n,tentative_name:"argument_"+n.argnames.length}),n.argnames.push(f);if(f){var d=make_node(AST_SymbolRef,e,f);return d.reference({}),clear_flag(f,1),d}}if(is_lhs(e,t.parent()))return e;if(r!==i){var S=e.flatten_object(a,t);S&&(o=e.expression=S.expression,i=e.property=S.property);}if(t.option("properties")&&t.option("side_effects")&&i instanceof AST_Number&&o instanceof AST_Array){s=i.getValue();var m=o.elements,A=m[s];e:if(safe_to_flatten(A,t)){for(var T=!0,h=[],E=m.length;--E>s;)(g=m[E].drop_side_effect_free(t))&&(h.unshift(g),T&&g.has_side_effects(t)&&(T=!1));if(A instanceof AST_Expansion)break e;for(A=A instanceof AST_Hole?make_node(AST_Undefined,A):A,T||h.unshift(A);--E>=0;){var g;if((g=m[E])instanceof AST_Expansion)break e;(g=g.drop_side_effect_free(t))?h.unshift(g):s--;}return T?(h.push(A),make_sequence(e,h).optimize(t)):make_node(AST_Sub,e,{expression:make_node(AST_Array,o,{elements:h}),property:make_node(AST_Number,i,{value:s})})}}var D=e.evaluate(t);return D!==e?best_of(t,D=make_node_from_constant(D,e).optimize(t),e):e.optional&&is_nullish(e.expression)?make_node(AST_Undefined,e):e})),def_optimize(AST_Chain,(function(e,t){return e.expression=e.expression.optimize(t),e})),AST_Lambda.DEFMETHOD("contains_this",(function(){return walk$3(this,(e=>e instanceof AST_This?walk_abort:e!==this&&e instanceof AST_Scope&&!(e instanceof AST_Arrow)||void 0))})),def_optimize(AST_Dot,(function(e,t){const n=t.parent();if(is_lhs(e,n))return e;if(t.option("unsafe_proto")&&e.expression instanceof AST_Dot&&"prototype"==e.expression.property){var o=e.expression.expression;if(is_undeclared_ref(o))switch(o.name){case"Array":e.expression=make_node(AST_Array,e.expression,{elements:[]});break;case"Function":e.expression=make_node(AST_Function,e.expression,{argnames:[],body:[]});break;case"Number":e.expression=make_node(AST_Number,e.expression,{value:0});break;case"Object":e.expression=make_node(AST_Object,e.expression,{properties:[]});break;case"RegExp":e.expression=make_node(AST_RegExp,e.expression,{value:{source:"t",flags:""}});break;case"String":e.expression=make_node(AST_String,e.expression,{value:""});}}if(!(n instanceof AST_Call&&has_annotation(n,_NOINLINE))){const n=e.flatten_object(e.property,t);if(n)return n.optimize(t)}let i=e.evaluate(t);return i!==e?(i=make_node_from_constant(i,e).optimize(t),best_of(t,i,e)):e.optional&&is_nullish(e.expression)?make_node(AST_Undefined,e):e})),def_optimize(AST_Array,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_array_like_spread(e.elements),e)})),def_optimize(AST_Object,(function(e,t){var n=literals_in_boolean_context(e,t);return n!==e?n:(inline_object_prop_spread(e.properties),e)})),def_optimize(AST_RegExp,literals_in_boolean_context),def_optimize(AST_Return,(function(e,t){return e.value&&is_undefined(e.value,t)&&(e.value=null),e})),def_optimize(AST_Arrow,opt_AST_Lambda),def_optimize(AST_Function,(function(e,t){return e=opt_AST_Lambda(e,t),!(t.option("unsafe_arrows")&&t.option("ecma")>=2015)||e.name||e.is_generator||e.uses_arguments||e.pinned()||walk$3(e,(e=>{if(e instanceof AST_This)return walk_abort}))?e:make_node(AST_Arrow,e,e).optimize(t)})),def_optimize(AST_Class,(function(e){return e})),def_optimize(AST_Yield,(function(e,t){return e.expression&&!e.is_star&&is_undefined(e.expression,t)&&(e.expression=null),e})),def_optimize(AST_TemplateString,(function(e,t){if(!t.option("evaluate")||t.parent()instanceof AST_PrefixedTemplateString)return e;for(var n=[],o=0;o<e.segments.length;o++){var i=e.segments[o];if(i instanceof AST_Node){var r=i.evaluate(t);if(r!==i&&(r+"").length<=i.size()+"${}".length){n[n.length-1].value=n[n.length-1].value+r+e.segments[++o].value;continue}if(i instanceof AST_TemplateString){var a=i.segments;n[n.length-1].value+=a[0].value;for(var s=1;s<a.length;s++)i=a[s],n.push(i);continue}}n.push(i);}if(e.segments=n,1==n.length)return make_node(AST_String,e,n[0]);if(3===n.length&&n[1]instanceof AST_Node&&(n[1].is_string(t)||n[1].is_number(t)||is_nullish(n[1])||t.option("unsafe"))){if(""===n[2].value)return make_node(AST_Binary,e,{operator:"+",left:make_node(AST_String,e,{value:n[0].value}),right:n[1]});if(""===n[0].value)return make_node(AST_Binary,e,{operator:"+",left:n[1],right:make_node(AST_String,e,{value:n[2].value})})}return e})),def_optimize(AST_PrefixedTemplateString,(function(e){return e})),def_optimize(AST_ObjectProperty,lift_key),def_optimize(AST_ConciseMethod,(function(e,t){if(lift_key(e,t),t.option("arrows")&&t.parent()instanceof AST_Object&&!e.is_generator&&!e.value.uses_arguments&&!e.value.pinned()&&1==e.value.body.length&&e.value.body[0]instanceof AST_Return&&e.value.body[0].value&&!e.value.contains_this()){var n=make_node(AST_Arrow,e.value,e.value);return n.async=e.async,n.is_generator=e.is_generator,make_node(AST_ObjectKeyVal,e,{key:e.key instanceof AST_SymbolMethod?e.key.name:e.key,value:n,quote:e.quote})}return e})),def_optimize(AST_ObjectKeyVal,(function(e,t){lift_key(e,t);var n=t.option("unsafe_methods");if(n&&t.option("ecma")>=2015&&(!(n instanceof RegExp)||n.test(e.key+""))){var o=e.key,i=e.value;if((i instanceof AST_Arrow&&Array.isArray(i.body)&&!i.contains_this()||i instanceof AST_Function)&&!i.name)return make_node(AST_ConciseMethod,e,{async:i.async,is_generator:i.is_generator,key:o instanceof AST_Node?o:make_node(AST_SymbolMethod,e,{name:o}),value:make_node(AST_Accessor,i,i),quote:e.quote})}return e})),def_optimize(AST_Destructuring,(function(e,t){if(1==t.option("pure_getters")&&t.option("unused")&&!e.is_array&&Array.isArray(e.names)&&!function(e){for(var t=[/^VarDef$/,/^(Const|Let|Var)$/,/^Export$/],n=0,o=0,i=t.length;n<i;o++){var r=e.parent(o);if(!r)return !1;if(0!==n||"Destructuring"!=r.TYPE){if(!t[n].test(r.TYPE))return !1;n++;}}return !0}(t)&&!(e.names[e.names.length-1]instanceof AST_Expansion)){for(var n=[],o=0;o<e.names.length;o++){var i=e.names[o];i instanceof AST_ObjectKeyVal&&"string"==typeof i.key&&i.value instanceof AST_SymbolDeclaration&&!r(t,i.value.definition())||n.push(i);}n.length!=e.names.length&&(e.names=n);}return e;function r(e,t){return !!t.references.length||!!t.global&&(!e.toplevel.vars||!!e.top_retain&&e.top_retain(t))}}));var domprops=["$&","$'","$*","$+","$1","$2","$3","$4","$5","$6","$7","$8","$9","$_","$`","$input","-moz-animation","-moz-animation-delay","-moz-animation-direction","-moz-animation-duration","-moz-animation-fill-mode","-moz-animation-iteration-count","-moz-animation-name","-moz-animation-play-state","-moz-animation-timing-function","-moz-appearance","-moz-backface-visibility","-moz-border-end","-moz-border-end-color","-moz-border-end-style","-moz-border-end-width","-moz-border-image","-moz-border-start","-moz-border-start-color","-moz-border-start-style","-moz-border-start-width","-moz-box-align","-moz-box-direction","-moz-box-flex","-moz-box-ordinal-group","-moz-box-orient","-moz-box-pack","-moz-box-sizing","-moz-float-edge","-moz-font-feature-settings","-moz-font-language-override","-moz-force-broken-image-icon","-moz-hyphens","-moz-image-region","-moz-margin-end","-moz-margin-start","-moz-orient","-moz-osx-font-smoothing","-moz-outline-radius","-moz-outline-radius-bottomleft","-moz-outline-radius-bottomright","-moz-outline-radius-topleft","-moz-outline-radius-topright","-moz-padding-end","-moz-padding-start","-moz-perspective","-moz-perspective-origin","-moz-tab-size","-moz-text-size-adjust","-moz-transform","-moz-transform-origin","-moz-transform-style","-moz-transition","-moz-transition-delay","-moz-transition-duration","-moz-transition-property","-moz-transition-timing-function","-moz-user-focus","-moz-user-input","-moz-user-modify","-moz-user-select","-moz-window-dragging","-webkit-align-content","-webkit-align-items","-webkit-align-self","-webkit-animation","-webkit-animation-delay","-webkit-animation-direction","-webkit-animation-duration","-webkit-animation-fill-mode","-webkit-animation-iteration-count","-webkit-animation-name","-webkit-animation-play-state","-webkit-animation-timing-function","-webkit-appearance","-webkit-backface-visibility","-webkit-background-clip","-webkit-background-origin","-webkit-background-size","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius","-webkit-border-image","-webkit-border-radius","-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-box-align","-webkit-box-direction","-webkit-box-flex","-webkit-box-ordinal-group","-webkit-box-orient","-webkit-box-pack","-webkit-box-shadow","-webkit-box-sizing","-webkit-filter","-webkit-flex","-webkit-flex-basis","-webkit-flex-direction","-webkit-flex-flow","-webkit-flex-grow","-webkit-flex-shrink","-webkit-flex-wrap","-webkit-justify-content","-webkit-line-clamp","-webkit-mask","-webkit-mask-clip","-webkit-mask-composite","-webkit-mask-image","-webkit-mask-origin","-webkit-mask-position","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-repeat","-webkit-mask-size","-webkit-order","-webkit-perspective","-webkit-perspective-origin","-webkit-text-fill-color","-webkit-text-size-adjust","-webkit-text-stroke","-webkit-text-stroke-color","-webkit-text-stroke-width","-webkit-transform","-webkit-transform-origin","-webkit-transform-style","-webkit-transition","-webkit-transition-delay","-webkit-transition-duration","-webkit-transition-property","-webkit-transition-timing-function","-webkit-user-select","0","1","10","11","12","13","14","15","16","17","18","19","2","20","3","4","5","6","7","8","9","@@iterator","ABORT_ERR","ACTIVE","ACTIVE_ATTRIBUTES","ACTIVE_TEXTURE","ACTIVE_UNIFORMS","ACTIVE_UNIFORM_BLOCKS","ADDITION","ALIASED_LINE_WIDTH_RANGE","ALIASED_POINT_SIZE_RANGE","ALLOW_KEYBOARD_INPUT","ALLPASS","ALPHA","ALPHA_BITS","ALREADY_SIGNALED","ALT_MASK","ALWAYS","ANY_SAMPLES_PASSED","ANY_SAMPLES_PASSED_CONSERVATIVE","ANY_TYPE","ANY_UNORDERED_NODE_TYPE","ARRAY_BUFFER","ARRAY_BUFFER_BINDING","ATTACHED_SHADERS","ATTRIBUTE_NODE","AT_TARGET","AbortController","AbortSignal","AbsoluteOrientationSensor","AbstractRange","Accelerometer","AddSearchProvider","AggregateError","AnalyserNode","Animation","AnimationEffect","AnimationEvent","AnimationPlaybackEvent","AnimationTimeline","AnonXMLHttpRequest","Any","ApplicationCache","ApplicationCacheErrorEvent","Array","ArrayBuffer","ArrayType","Atomics","Attr","Audio","AudioBuffer","AudioBufferSourceNode","AudioContext","AudioDestinationNode","AudioListener","AudioNode","AudioParam","AudioParamMap","AudioProcessingEvent","AudioScheduledSourceNode","AudioStreamTrack","AudioWorklet","AudioWorkletNode","AuthenticatorAssertionResponse","AuthenticatorAttestationResponse","AuthenticatorResponse","AutocompleteErrorEvent","BACK","BAD_BOUNDARYPOINTS_ERR","BAD_REQUEST","BANDPASS","BLEND","BLEND_COLOR","BLEND_DST_ALPHA","BLEND_DST_RGB","BLEND_EQUATION","BLEND_EQUATION_ALPHA","BLEND_EQUATION_RGB","BLEND_SRC_ALPHA","BLEND_SRC_RGB","BLUE_BITS","BLUR","BOOL","BOOLEAN_TYPE","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","BOTH","BROWSER_DEFAULT_WEBGL","BUBBLING_PHASE","BUFFER_SIZE","BUFFER_USAGE","BYTE","BYTES_PER_ELEMENT","BackgroundFetchManager","BackgroundFetchRecord","BackgroundFetchRegistration","BarProp","BarcodeDetector","BaseAudioContext","BaseHref","BatteryManager","BeforeInstallPromptEvent","BeforeLoadEvent","BeforeUnloadEvent","BigInt","BigInt64Array","BigUint64Array","BiquadFilterNode","Blob","BlobEvent","Bluetooth","BluetoothCharacteristicProperties","BluetoothDevice","BluetoothRemoteGATTCharacteristic","BluetoothRemoteGATTDescriptor","BluetoothRemoteGATTServer","BluetoothRemoteGATTService","BluetoothUUID","Boolean","BroadcastChannel","ByteLengthQueuingStrategy","CAPTURING_PHASE","CCW","CDATASection","CDATA_SECTION_NODE","CHANGE","CHARSET_RULE","CHECKING","CLAMP_TO_EDGE","CLICK","CLOSED","CLOSING","COLOR","COLOR_ATTACHMENT0","COLOR_ATTACHMENT1","COLOR_ATTACHMENT10","COLOR_ATTACHMENT11","COLOR_ATTACHMENT12","COLOR_ATTACHMENT13","COLOR_ATTACHMENT14","COLOR_ATTACHMENT15","COLOR_ATTACHMENT2","COLOR_ATTACHMENT3","COLOR_ATTACHMENT4","COLOR_ATTACHMENT5","COLOR_ATTACHMENT6","COLOR_ATTACHMENT7","COLOR_ATTACHMENT8","COLOR_ATTACHMENT9","COLOR_BUFFER_BIT","COLOR_CLEAR_VALUE","COLOR_WRITEMASK","COMMENT_NODE","COMPARE_REF_TO_TEXTURE","COMPILE_STATUS","COMPRESSED_RGBA_S3TC_DXT1_EXT","COMPRESSED_RGBA_S3TC_DXT3_EXT","COMPRESSED_RGBA_S3TC_DXT5_EXT","COMPRESSED_RGB_S3TC_DXT1_EXT","COMPRESSED_TEXTURE_FORMATS","CONDITION_SATISFIED","CONFIGURATION_UNSUPPORTED","CONNECTING","CONSTANT_ALPHA","CONSTANT_COLOR","CONSTRAINT_ERR","CONTEXT_LOST_WEBGL","CONTROL_MASK","COPY_READ_BUFFER","COPY_READ_BUFFER_BINDING","COPY_WRITE_BUFFER","COPY_WRITE_BUFFER_BINDING","COUNTER_STYLE_RULE","CSS","CSS2Properties","CSSAnimation","CSSCharsetRule","CSSConditionRule","CSSCounterStyleRule","CSSFontFaceRule","CSSFontFeatureValuesRule","CSSGroupingRule","CSSImageValue","CSSImportRule","CSSKeyframeRule","CSSKeyframesRule","CSSKeywordValue","CSSMathInvert","CSSMathMax","CSSMathMin","CSSMathNegate","CSSMathProduct","CSSMathSum","CSSMathValue","CSSMatrixComponent","CSSMediaRule","CSSMozDocumentRule","CSSNameSpaceRule","CSSNamespaceRule","CSSNumericArray","CSSNumericValue","CSSPageRule","CSSPerspective","CSSPositionValue","CSSPrimitiveValue","CSSRotate","CSSRule","CSSRuleList","CSSScale","CSSSkew","CSSSkewX","CSSSkewY","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSStyleValue","CSSSupportsRule","CSSTransformComponent","CSSTransformValue","CSSTransition","CSSTranslate","CSSUnitValue","CSSUnknownRule","CSSUnparsedValue","CSSValue","CSSValueList","CSSVariableReferenceValue","CSSVariablesDeclaration","CSSVariablesRule","CSSViewportRule","CSS_ATTR","CSS_CM","CSS_COUNTER","CSS_CUSTOM","CSS_DEG","CSS_DIMENSION","CSS_EMS","CSS_EXS","CSS_FILTER_BLUR","CSS_FILTER_BRIGHTNESS","CSS_FILTER_CONTRAST","CSS_FILTER_CUSTOM","CSS_FILTER_DROP_SHADOW","CSS_FILTER_GRAYSCALE","CSS_FILTER_HUE_ROTATE","CSS_FILTER_INVERT","CSS_FILTER_OPACITY","CSS_FILTER_REFERENCE","CSS_FILTER_SATURATE","CSS_FILTER_SEPIA","CSS_GRAD","CSS_HZ","CSS_IDENT","CSS_IN","CSS_INHERIT","CSS_KHZ","CSS_MATRIX","CSS_MATRIX3D","CSS_MM","CSS_MS","CSS_NUMBER","CSS_PC","CSS_PERCENTAGE","CSS_PERSPECTIVE","CSS_PRIMITIVE_VALUE","CSS_PT","CSS_PX","CSS_RAD","CSS_RECT","CSS_RGBCOLOR","CSS_ROTATE","CSS_ROTATE3D","CSS_ROTATEX","CSS_ROTATEY","CSS_ROTATEZ","CSS_S","CSS_SCALE","CSS_SCALE3D","CSS_SCALEX","CSS_SCALEY","CSS_SCALEZ","CSS_SKEW","CSS_SKEWX","CSS_SKEWY","CSS_STRING","CSS_TRANSLATE","CSS_TRANSLATE3D","CSS_TRANSLATEX","CSS_TRANSLATEY","CSS_TRANSLATEZ","CSS_UNKNOWN","CSS_URI","CSS_VALUE_LIST","CSS_VH","CSS_VMAX","CSS_VMIN","CSS_VW","CULL_FACE","CULL_FACE_MODE","CURRENT_PROGRAM","CURRENT_QUERY","CURRENT_VERTEX_ATTRIB","CUSTOM","CW","Cache","CacheStorage","CanvasCaptureMediaStream","CanvasCaptureMediaStreamTrack","CanvasGradient","CanvasPattern","CanvasRenderingContext2D","CaretPosition","ChannelMergerNode","ChannelSplitterNode","CharacterData","ClientRect","ClientRectList","Clipboard","ClipboardEvent","ClipboardItem","CloseEvent","Collator","CommandEvent","Comment","CompileError","CompositionEvent","CompressionStream","Console","ConstantSourceNode","Controllers","ConvolverNode","CountQueuingStrategy","Counter","Credential","CredentialsContainer","Crypto","CryptoKey","CustomElementRegistry","CustomEvent","DATABASE_ERR","DATA_CLONE_ERR","DATA_ERR","DBLCLICK","DECR","DECR_WRAP","DELETE_STATUS","DEPTH","DEPTH24_STENCIL8","DEPTH32F_STENCIL8","DEPTH_ATTACHMENT","DEPTH_BITS","DEPTH_BUFFER_BIT","DEPTH_CLEAR_VALUE","DEPTH_COMPONENT","DEPTH_COMPONENT16","DEPTH_COMPONENT24","DEPTH_COMPONENT32F","DEPTH_FUNC","DEPTH_RANGE","DEPTH_STENCIL","DEPTH_STENCIL_ATTACHMENT","DEPTH_TEST","DEPTH_WRITEMASK","DEVICE_INELIGIBLE","DIRECTION_DOWN","DIRECTION_LEFT","DIRECTION_RIGHT","DIRECTION_UP","DISABLED","DISPATCH_REQUEST_ERR","DITHER","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","DOCUMENT_POSITION_PRECEDING","DOCUMENT_TYPE_NODE","DOMCursor","DOMError","DOMException","DOMImplementation","DOMImplementationLS","DOMMatrix","DOMMatrixReadOnly","DOMParser","DOMPoint","DOMPointReadOnly","DOMQuad","DOMRect","DOMRectList","DOMRectReadOnly","DOMRequest","DOMSTRING_SIZE_ERR","DOMSettableTokenList","DOMStringList","DOMStringMap","DOMTokenList","DOMTransactionEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","DOM_INPUT_METHOD_DROP","DOM_INPUT_METHOD_HANDWRITING","DOM_INPUT_METHOD_IME","DOM_INPUT_METHOD_KEYBOARD","DOM_INPUT_METHOD_MULTIMODAL","DOM_INPUT_METHOD_OPTION","DOM_INPUT_METHOD_PASTE","DOM_INPUT_METHOD_SCRIPT","DOM_INPUT_METHOD_UNKNOWN","DOM_INPUT_METHOD_VOICE","DOM_KEY_LOCATION_JOYSTICK","DOM_KEY_LOCATION_LEFT","DOM_KEY_LOCATION_MOBILE","DOM_KEY_LOCATION_NUMPAD","DOM_KEY_LOCATION_RIGHT","DOM_KEY_LOCATION_STANDARD","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5","DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_A","DOM_VK_ACCEPT","DOM_VK_ADD","DOM_VK_ALT","DOM_VK_ALTGR","DOM_VK_AMPERSAND","DOM_VK_ASTERISK","DOM_VK_AT","DOM_VK_ATTN","DOM_VK_B","DOM_VK_BACKSPACE","DOM_VK_BACK_QUOTE","DOM_VK_BACK_SLASH","DOM_VK_BACK_SPACE","DOM_VK_C","DOM_VK_CANCEL","DOM_VK_CAPS_LOCK","DOM_VK_CIRCUMFLEX","DOM_VK_CLEAR","DOM_VK_CLOSE_BRACKET","DOM_VK_CLOSE_CURLY_BRACKET","DOM_VK_CLOSE_PAREN","DOM_VK_COLON","DOM_VK_COMMA","DOM_VK_CONTEXT_MENU","DOM_VK_CONTROL","DOM_VK_CONVERT","DOM_VK_CRSEL","DOM_VK_CTRL","DOM_VK_D","DOM_VK_DECIMAL","DOM_VK_DELETE","DOM_VK_DIVIDE","DOM_VK_DOLLAR","DOM_VK_DOUBLE_QUOTE","DOM_VK_DOWN","DOM_VK_E","DOM_VK_EISU","DOM_VK_END","DOM_VK_ENTER","DOM_VK_EQUALS","DOM_VK_EREOF","DOM_VK_ESCAPE","DOM_VK_EXCLAMATION","DOM_VK_EXECUTE","DOM_VK_EXSEL","DOM_VK_F","DOM_VK_F1","DOM_VK_F10","DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19","DOM_VK_F2","DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_F25","DOM_VK_F26","DOM_VK_F27","DOM_VK_F28","DOM_VK_F29","DOM_VK_F3","DOM_VK_F30","DOM_VK_F31","DOM_VK_F32","DOM_VK_F33","DOM_VK_F34","DOM_VK_F35","DOM_VK_F36","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_FINAL","DOM_VK_FRONT","DOM_VK_G","DOM_VK_GREATER_THAN","DOM_VK_H","DOM_VK_HANGUL","DOM_VK_HANJA","DOM_VK_HASH","DOM_VK_HELP","DOM_VK_HK_TOGGLE","DOM_VK_HOME","DOM_VK_HYPHEN_MINUS","DOM_VK_I","DOM_VK_INSERT","DOM_VK_J","DOM_VK_JUNJA","DOM_VK_K","DOM_VK_KANA","DOM_VK_KANJI","DOM_VK_L","DOM_VK_LEFT","DOM_VK_LEFT_TAB","DOM_VK_LESS_THAN","DOM_VK_M","DOM_VK_META","DOM_VK_MODECHANGE","DOM_VK_MULTIPLY","DOM_VK_N","DOM_VK_NONCONVERT","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2","DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9","DOM_VK_NUM_LOCK","DOM_VK_O","DOM_VK_OEM_1","DOM_VK_OEM_102","DOM_VK_OEM_2","DOM_VK_OEM_3","DOM_VK_OEM_4","DOM_VK_OEM_5","DOM_VK_OEM_6","DOM_VK_OEM_7","DOM_VK_OEM_8","DOM_VK_OEM_COMMA","DOM_VK_OEM_MINUS","DOM_VK_OEM_PERIOD","DOM_VK_OEM_PLUS","DOM_VK_OPEN_BRACKET","DOM_VK_OPEN_CURLY_BRACKET","DOM_VK_OPEN_PAREN","DOM_VK_P","DOM_VK_PA1","DOM_VK_PAGEDOWN","DOM_VK_PAGEUP","DOM_VK_PAGE_DOWN","DOM_VK_PAGE_UP","DOM_VK_PAUSE","DOM_VK_PERCENT","DOM_VK_PERIOD","DOM_VK_PIPE","DOM_VK_PLAY","DOM_VK_PLUS","DOM_VK_PRINT","DOM_VK_PRINTSCREEN","DOM_VK_PROCESSKEY","DOM_VK_PROPERITES","DOM_VK_Q","DOM_VK_QUESTION_MARK","DOM_VK_QUOTE","DOM_VK_R","DOM_VK_REDO","DOM_VK_RETURN","DOM_VK_RIGHT","DOM_VK_S","DOM_VK_SCROLL_LOCK","DOM_VK_SELECT","DOM_VK_SEMICOLON","DOM_VK_SEPARATOR","DOM_VK_SHIFT","DOM_VK_SLASH","DOM_VK_SLEEP","DOM_VK_SPACE","DOM_VK_SUBTRACT","DOM_VK_T","DOM_VK_TAB","DOM_VK_TILDE","DOM_VK_U","DOM_VK_UNDERSCORE","DOM_VK_UNDO","DOM_VK_UNICODE","DOM_VK_UP","DOM_VK_V","DOM_VK_VOLUME_DOWN","DOM_VK_VOLUME_MUTE","DOM_VK_VOLUME_UP","DOM_VK_W","DOM_VK_WIN","DOM_VK_WINDOW","DOM_VK_WIN_ICO_00","DOM_VK_WIN_ICO_CLEAR","DOM_VK_WIN_ICO_HELP","DOM_VK_WIN_OEM_ATTN","DOM_VK_WIN_OEM_AUTO","DOM_VK_WIN_OEM_BACKTAB","DOM_VK_WIN_OEM_CLEAR","DOM_VK_WIN_OEM_COPY","DOM_VK_WIN_OEM_CUSEL","DOM_VK_WIN_OEM_ENLW","DOM_VK_WIN_OEM_FINISH","DOM_VK_WIN_OEM_FJ_JISHO","DOM_VK_WIN_OEM_FJ_LOYA","DOM_VK_WIN_OEM_FJ_MASSHOU","DOM_VK_WIN_OEM_FJ_ROYA","DOM_VK_WIN_OEM_FJ_TOUROKU","DOM_VK_WIN_OEM_JUMP","DOM_VK_WIN_OEM_PA1","DOM_VK_WIN_OEM_PA2","DOM_VK_WIN_OEM_PA3","DOM_VK_WIN_OEM_RESET","DOM_VK_WIN_OEM_WSCTRL","DOM_VK_X","DOM_VK_XF86XK_ADD_FAVORITE","DOM_VK_XF86XK_APPLICATION_LEFT","DOM_VK_XF86XK_APPLICATION_RIGHT","DOM_VK_XF86XK_AUDIO_CYCLE_TRACK","DOM_VK_XF86XK_AUDIO_FORWARD","DOM_VK_XF86XK_AUDIO_LOWER_VOLUME","DOM_VK_XF86XK_AUDIO_MEDIA","DOM_VK_XF86XK_AUDIO_MUTE","DOM_VK_XF86XK_AUDIO_NEXT","DOM_VK_XF86XK_AUDIO_PAUSE","DOM_VK_XF86XK_AUDIO_PLAY","DOM_VK_XF86XK_AUDIO_PREV","DOM_VK_XF86XK_AUDIO_RAISE_VOLUME","DOM_VK_XF86XK_AUDIO_RANDOM_PLAY","DOM_VK_XF86XK_AUDIO_RECORD","DOM_VK_XF86XK_AUDIO_REPEAT","DOM_VK_XF86XK_AUDIO_REWIND","DOM_VK_XF86XK_AUDIO_STOP","DOM_VK_XF86XK_AWAY","DOM_VK_XF86XK_BACK","DOM_VK_XF86XK_BACK_FORWARD","DOM_VK_XF86XK_BATTERY","DOM_VK_XF86XK_BLUE","DOM_VK_XF86XK_BLUETOOTH","DOM_VK_XF86XK_BOOK","DOM_VK_XF86XK_BRIGHTNESS_ADJUST","DOM_VK_XF86XK_CALCULATOR","DOM_VK_XF86XK_CALENDAR","DOM_VK_XF86XK_CD","DOM_VK_XF86XK_CLOSE","DOM_VK_XF86XK_COMMUNITY","DOM_VK_XF86XK_CONTRAST_ADJUST","DOM_VK_XF86XK_COPY","DOM_VK_XF86XK_CUT","DOM_VK_XF86XK_CYCLE_ANGLE","DOM_VK_XF86XK_DISPLAY","DOM_VK_XF86XK_DOCUMENTS","DOM_VK_XF86XK_DOS","DOM_VK_XF86XK_EJECT","DOM_VK_XF86XK_EXCEL","DOM_VK_XF86XK_EXPLORER","DOM_VK_XF86XK_FAVORITES","DOM_VK_XF86XK_FINANCE","DOM_VK_XF86XK_FORWARD","DOM_VK_XF86XK_FRAME_BACK","DOM_VK_XF86XK_FRAME_FORWARD","DOM_VK_XF86XK_GAME","DOM_VK_XF86XK_GO","DOM_VK_XF86XK_GREEN","DOM_VK_XF86XK_HIBERNATE","DOM_VK_XF86XK_HISTORY","DOM_VK_XF86XK_HOME_PAGE","DOM_VK_XF86XK_HOT_LINKS","DOM_VK_XF86XK_I_TOUCH","DOM_VK_XF86XK_KBD_BRIGHTNESS_DOWN","DOM_VK_XF86XK_KBD_BRIGHTNESS_UP","DOM_VK_XF86XK_KBD_LIGHT_ON_OFF","DOM_VK_XF86XK_LAUNCH0","DOM_VK_XF86XK_LAUNCH1","DOM_VK_XF86XK_LAUNCH2","DOM_VK_XF86XK_LAUNCH3","DOM_VK_XF86XK_LAUNCH4","DOM_VK_XF86XK_LAUNCH5","DOM_VK_XF86XK_LAUNCH6","DOM_VK_XF86XK_LAUNCH7","DOM_VK_XF86XK_LAUNCH8","DOM_VK_XF86XK_LAUNCH9","DOM_VK_XF86XK_LAUNCH_A","DOM_VK_XF86XK_LAUNCH_B","DOM_VK_XF86XK_LAUNCH_C","DOM_VK_XF86XK_LAUNCH_D","DOM_VK_XF86XK_LAUNCH_E","DOM_VK_XF86XK_LAUNCH_F","DOM_VK_XF86XK_LIGHT_BULB","DOM_VK_XF86XK_LOG_OFF","DOM_VK_XF86XK_MAIL","DOM_VK_XF86XK_MAIL_FORWARD","DOM_VK_XF86XK_MARKET","DOM_VK_XF86XK_MEETING","DOM_VK_XF86XK_MEMO","DOM_VK_XF86XK_MENU_KB","DOM_VK_XF86XK_MENU_PB","DOM_VK_XF86XK_MESSENGER","DOM_VK_XF86XK_MON_BRIGHTNESS_DOWN","DOM_VK_XF86XK_MON_BRIGHTNESS_UP","DOM_VK_XF86XK_MUSIC","DOM_VK_XF86XK_MY_COMPUTER","DOM_VK_XF86XK_MY_SITES","DOM_VK_XF86XK_NEW","DOM_VK_XF86XK_NEWS","DOM_VK_XF86XK_OFFICE_HOME","DOM_VK_XF86XK_OPEN","DOM_VK_XF86XK_OPEN_URL","DOM_VK_XF86XK_OPTION","DOM_VK_XF86XK_PASTE","DOM_VK_XF86XK_PHONE","DOM_VK_XF86XK_PICTURES","DOM_VK_XF86XK_POWER_DOWN","DOM_VK_XF86XK_POWER_OFF","DOM_VK_XF86XK_RED","DOM_VK_XF86XK_REFRESH","DOM_VK_XF86XK_RELOAD","DOM_VK_XF86XK_REPLY","DOM_VK_XF86XK_ROCKER_DOWN","DOM_VK_XF86XK_ROCKER_ENTER","DOM_VK_XF86XK_ROCKER_UP","DOM_VK_XF86XK_ROTATE_WINDOWS","DOM_VK_XF86XK_ROTATION_KB","DOM_VK_XF86XK_ROTATION_PB","DOM_VK_XF86XK_SAVE","DOM_VK_XF86XK_SCREEN_SAVER","DOM_VK_XF86XK_SCROLL_CLICK","DOM_VK_XF86XK_SCROLL_DOWN","DOM_VK_XF86XK_SCROLL_UP","DOM_VK_XF86XK_SEARCH","DOM_VK_XF86XK_SEND","DOM_VK_XF86XK_SHOP","DOM_VK_XF86XK_SPELL","DOM_VK_XF86XK_SPLIT_SCREEN","DOM_VK_XF86XK_STANDBY","DOM_VK_XF86XK_START","DOM_VK_XF86XK_STOP","DOM_VK_XF86XK_SUBTITLE","DOM_VK_XF86XK_SUPPORT","DOM_VK_XF86XK_SUSPEND","DOM_VK_XF86XK_TASK_PANE","DOM_VK_XF86XK_TERMINAL","DOM_VK_XF86XK_TIME","DOM_VK_XF86XK_TOOLS","DOM_VK_XF86XK_TOP_MENU","DOM_VK_XF86XK_TO_DO_LIST","DOM_VK_XF86XK_TRAVEL","DOM_VK_XF86XK_USER1KB","DOM_VK_XF86XK_USER2KB","DOM_VK_XF86XK_USER_PB","DOM_VK_XF86XK_UWB","DOM_VK_XF86XK_VENDOR_HOME","DOM_VK_XF86XK_VIDEO","DOM_VK_XF86XK_VIEW","DOM_VK_XF86XK_WAKE_UP","DOM_VK_XF86XK_WEB_CAM","DOM_VK_XF86XK_WHEEL_BUTTON","DOM_VK_XF86XK_WLAN","DOM_VK_XF86XK_WORD","DOM_VK_XF86XK_WWW","DOM_VK_XF86XK_XFER","DOM_VK_XF86XK_YELLOW","DOM_VK_XF86XK_ZOOM_IN","DOM_VK_XF86XK_ZOOM_OUT","DOM_VK_Y","DOM_VK_Z","DOM_VK_ZOOM","DONE","DONT_CARE","DOWNLOADING","DRAGDROP","DRAW_BUFFER0","DRAW_BUFFER1","DRAW_BUFFER10","DRAW_BUFFER11","DRAW_BUFFER12","DRAW_BUFFER13","DRAW_BUFFER14","DRAW_BUFFER15","DRAW_BUFFER2","DRAW_BUFFER3","DRAW_BUFFER4","DRAW_BUFFER5","DRAW_BUFFER6","DRAW_BUFFER7","DRAW_BUFFER8","DRAW_BUFFER9","DRAW_FRAMEBUFFER","DRAW_FRAMEBUFFER_BINDING","DST_ALPHA","DST_COLOR","DYNAMIC_COPY","DYNAMIC_DRAW","DYNAMIC_READ","DataChannel","DataTransfer","DataTransferItem","DataTransferItemList","DataView","Date","DateTimeFormat","DecompressionStream","DelayNode","DeprecationReportBody","DesktopNotification","DesktopNotificationCenter","DeviceLightEvent","DeviceMotionEvent","DeviceMotionEventAcceleration","DeviceMotionEventRotationRate","DeviceOrientationEvent","DeviceProximityEvent","DeviceStorage","DeviceStorageChangeEvent","Directory","DisplayNames","Document","DocumentFragment","DocumentTimeline","DocumentType","DragEvent","DynamicsCompressorNode","E","ELEMENT_ARRAY_BUFFER","ELEMENT_ARRAY_BUFFER_BINDING","ELEMENT_NODE","EMPTY","ENCODING_ERR","ENDED","END_TO_END","END_TO_START","ENTITY_NODE","ENTITY_REFERENCE_NODE","EPSILON","EQUAL","EQUALPOWER","ERROR","EXPONENTIAL_DISTANCE","Element","ElementInternals","ElementQuery","EnterPictureInPictureEvent","Entity","EntityReference","Error","ErrorEvent","EvalError","Event","EventException","EventSource","EventTarget","External","FASTEST","FIDOSDK","FILTER_ACCEPT","FILTER_INTERRUPT","FILTER_REJECT","FILTER_SKIP","FINISHED_STATE","FIRST_ORDERED_NODE_TYPE","FLOAT","FLOAT_32_UNSIGNED_INT_24_8_REV","FLOAT_MAT2","FLOAT_MAT2x3","FLOAT_MAT2x4","FLOAT_MAT3","FLOAT_MAT3x2","FLOAT_MAT3x4","FLOAT_MAT4","FLOAT_MAT4x2","FLOAT_MAT4x3","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","FOCUS","FONT_FACE_RULE","FONT_FEATURE_VALUES_RULE","FRAGMENT_SHADER","FRAGMENT_SHADER_DERIVATIVE_HINT","FRAGMENT_SHADER_DERIVATIVE_HINT_OES","FRAMEBUFFER","FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE","FRAMEBUFFER_ATTACHMENT_BLUE_SIZE","FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING","FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE","FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE","FRAMEBUFFER_ATTACHMENT_GREEN_SIZE","FRAMEBUFFER_ATTACHMENT_OBJECT_NAME","FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE","FRAMEBUFFER_ATTACHMENT_RED_SIZE","FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE","FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE","FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER","FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL","FRAMEBUFFER_BINDING","FRAMEBUFFER_COMPLETE","FRAMEBUFFER_DEFAULT","FRAMEBUFFER_INCOMPLETE_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_DIMENSIONS","FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT","FRAMEBUFFER_INCOMPLETE_MULTISAMPLE","FRAMEBUFFER_UNSUPPORTED","FRONT","FRONT_AND_BACK","FRONT_FACE","FUNC_ADD","FUNC_REVERSE_SUBTRACT","FUNC_SUBTRACT","FeaturePolicy","FeaturePolicyViolationReportBody","FederatedCredential","Feed","FeedEntry","File","FileError","FileList","FileReader","FileSystem","FileSystemDirectoryEntry","FileSystemDirectoryReader","FileSystemEntry","FileSystemFileEntry","FinalizationRegistry","FindInPage","Float32Array","Float64Array","FocusEvent","FontFace","FontFaceSet","FontFaceSetLoadEvent","FormData","FormDataEvent","FragmentDirective","Function","GENERATE_MIPMAP_HINT","GEQUAL","GREATER","GREEN_BITS","GainNode","Gamepad","GamepadAxisMoveEvent","GamepadButton","GamepadButtonEvent","GamepadEvent","GamepadHapticActuator","GamepadPose","Geolocation","GeolocationCoordinates","GeolocationPosition","GeolocationPositionError","GestureEvent","Global","Gyroscope","HALF_FLOAT","HAVE_CURRENT_DATA","HAVE_ENOUGH_DATA","HAVE_FUTURE_DATA","HAVE_METADATA","HAVE_NOTHING","HEADERS_RECEIVED","HIDDEN","HIERARCHY_REQUEST_ERR","HIGHPASS","HIGHSHELF","HIGH_FLOAT","HIGH_INT","HORIZONTAL","HORIZONTAL_AXIS","HRTF","HTMLAllCollection","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement","HTMLAudioElement","HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBlockquoteElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement","HTMLCollection","HTMLCommandElement","HTMLContentElement","HTMLDListElement","HTMLDataElement","HTMLDataListElement","HTMLDetailsElement","HTMLDialogElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormControlsCollection","HTMLFormElement","HTMLFrameElement","HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement","HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLKeygenElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement","HTMLLinkElement","HTMLMapElement","HTMLMarqueeElement","HTMLMediaElement","HTMLMenuElement","HTMLMenuItemElement","HTMLMetaElement","HTMLMeterElement","HTMLModElement","HTMLOListElement","HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLOutputElement","HTMLParagraphElement","HTMLParamElement","HTMLPictureElement","HTMLPreElement","HTMLProgressElement","HTMLPropertiesCollection","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLShadowElement","HTMLSlotElement","HTMLSourceElement","HTMLSpanElement","HTMLStyleElement","HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement","HTMLTableSectionElement","HTMLTemplateElement","HTMLTextAreaElement","HTMLTimeElement","HTMLTitleElement","HTMLTrackElement","HTMLUListElement","HTMLUnknownElement","HTMLVideoElement","HashChangeEvent","Headers","History","Hz","ICE_CHECKING","ICE_CLOSED","ICE_COMPLETED","ICE_CONNECTED","ICE_FAILED","ICE_GATHERING","ICE_WAITING","IDBCursor","IDBCursorWithValue","IDBDatabase","IDBDatabaseException","IDBFactory","IDBFileHandle","IDBFileRequest","IDBIndex","IDBKeyRange","IDBMutableFile","IDBObjectStore","IDBOpenDBRequest","IDBRequest","IDBTransaction","IDBVersionChangeEvent","IDLE","IIRFilterNode","IMPLEMENTATION_COLOR_READ_FORMAT","IMPLEMENTATION_COLOR_READ_TYPE","IMPORT_RULE","INCR","INCR_WRAP","INDEX_SIZE_ERR","INT","INTERLEAVED_ATTRIBS","INT_2_10_10_10_REV","INT_SAMPLER_2D","INT_SAMPLER_2D_ARRAY","INT_SAMPLER_3D","INT_SAMPLER_CUBE","INT_VEC2","INT_VEC3","INT_VEC4","INUSE_ATTRIBUTE_ERR","INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_ENUM","INVALID_EXPRESSION_ERR","INVALID_FRAMEBUFFER_OPERATION","INVALID_INDEX","INVALID_MODIFICATION_ERR","INVALID_NODE_TYPE_ERR","INVALID_OPERATION","INVALID_STATE_ERR","INVALID_VALUE","INVERSE_DISTANCE","INVERT","IceCandidate","IdleDeadline","Image","ImageBitmap","ImageBitmapRenderingContext","ImageCapture","ImageData","Infinity","InputDeviceCapabilities","InputDeviceInfo","InputEvent","InputMethodContext","InstallTrigger","InstallTriggerImpl","Instance","Int16Array","Int32Array","Int8Array","Intent","InternalError","IntersectionObserver","IntersectionObserverEntry","Intl","IsSearchProviderInstalled","Iterator","JSON","KEEP","KEYDOWN","KEYFRAMES_RULE","KEYFRAME_RULE","KEYPRESS","KEYUP","KeyEvent","Keyboard","KeyboardEvent","KeyboardLayoutMap","KeyframeEffect","LENGTHADJUST_SPACING","LENGTHADJUST_SPACINGANDGLYPHS","LENGTHADJUST_UNKNOWN","LEQUAL","LESS","LINEAR","LINEAR_DISTANCE","LINEAR_MIPMAP_LINEAR","LINEAR_MIPMAP_NEAREST","LINES","LINE_LOOP","LINE_STRIP","LINE_WIDTH","LINK_STATUS","LIVE","LN10","LN2","LOADED","LOADING","LOG10E","LOG2E","LOWPASS","LOWSHELF","LOW_FLOAT","LOW_INT","LSException","LSParserFilter","LUMINANCE","LUMINANCE_ALPHA","LargestContentfulPaint","LayoutShift","LayoutShiftAttribution","LinearAccelerationSensor","LinkError","ListFormat","LocalMediaStream","Locale","Location","Lock","LockManager","MAX","MAX_3D_TEXTURE_SIZE","MAX_ARRAY_TEXTURE_LAYERS","MAX_CLIENT_WAIT_TIMEOUT_WEBGL","MAX_COLOR_ATTACHMENTS","MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_COMBINED_UNIFORM_BLOCKS","MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_DRAW_BUFFERS","MAX_ELEMENTS_INDICES","MAX_ELEMENTS_VERTICES","MAX_ELEMENT_INDEX","MAX_FRAGMENT_INPUT_COMPONENTS","MAX_FRAGMENT_UNIFORM_BLOCKS","MAX_FRAGMENT_UNIFORM_COMPONENTS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_PROGRAM_TEXEL_OFFSET","MAX_RENDERBUFFER_SIZE","MAX_SAFE_INTEGER","MAX_SAMPLES","MAX_SERVER_WAIT_TIMEOUT","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_LOD_BIAS","MAX_TEXTURE_MAX_ANISOTROPY_EXT","MAX_TEXTURE_SIZE","MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS","MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS","MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS","MAX_UNIFORM_BLOCK_SIZE","MAX_UNIFORM_BUFFER_BINDINGS","MAX_VALUE","MAX_VARYING_COMPONENTS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_OUTPUT_COMPONENTS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_BLOCKS","MAX_VERTEX_UNIFORM_COMPONENTS","MAX_VERTEX_UNIFORM_VECTORS","MAX_VIEWPORT_DIMS","MEDIA_ERR_ABORTED","MEDIA_ERR_DECODE","MEDIA_ERR_ENCRYPTED","MEDIA_ERR_NETWORK","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_KEYERR_CLIENT","MEDIA_KEYERR_DOMAIN","MEDIA_KEYERR_HARDWARECHANGE","MEDIA_KEYERR_OUTPUT","MEDIA_KEYERR_SERVICE","MEDIA_KEYERR_UNKNOWN","MEDIA_RULE","MEDIUM_FLOAT","MEDIUM_INT","META_MASK","MIDIAccess","MIDIConnectionEvent","MIDIInput","MIDIInputMap","MIDIMessageEvent","MIDIOutput","MIDIOutputMap","MIDIPort","MIN","MIN_PROGRAM_TEXEL_OFFSET","MIN_SAFE_INTEGER","MIN_VALUE","MIRRORED_REPEAT","MODE_ASYNCHRONOUS","MODE_SYNCHRONOUS","MODIFICATION","MOUSEDOWN","MOUSEDRAG","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOZ_KEYFRAMES_RULE","MOZ_KEYFRAME_RULE","MOZ_SOURCE_CURSOR","MOZ_SOURCE_ERASER","MOZ_SOURCE_KEYBOARD","MOZ_SOURCE_MOUSE","MOZ_SOURCE_PEN","MOZ_SOURCE_TOUCH","MOZ_SOURCE_UNKNOWN","MSGESTURE_FLAG_BEGIN","MSGESTURE_FLAG_CANCEL","MSGESTURE_FLAG_END","MSGESTURE_FLAG_INERTIA","MSGESTURE_FLAG_NONE","MSPOINTER_TYPE_MOUSE","MSPOINTER_TYPE_PEN","MSPOINTER_TYPE_TOUCH","MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE","MS_ASYNC_CALLBACK_STATUS_CANCEL","MS_ASYNC_CALLBACK_STATUS_CHOOSEANY","MS_ASYNC_CALLBACK_STATUS_ERROR","MS_ASYNC_CALLBACK_STATUS_JOIN","MS_ASYNC_OP_STATUS_CANCELED","MS_ASYNC_OP_STATUS_ERROR","MS_ASYNC_OP_STATUS_SUCCESS","MS_MANIPULATION_STATE_ACTIVE","MS_MANIPULATION_STATE_CANCELLED","MS_MANIPULATION_STATE_COMMITTED","MS_MANIPULATION_STATE_DRAGGING","MS_MANIPULATION_STATE_INERTIA","MS_MANIPULATION_STATE_PRESELECT","MS_MANIPULATION_STATE_SELECTING","MS_MANIPULATION_STATE_STOPPED","MS_MEDIA_ERR_ENCRYPTED","MS_MEDIA_KEYERR_CLIENT","MS_MEDIA_KEYERR_DOMAIN","MS_MEDIA_KEYERR_HARDWARECHANGE","MS_MEDIA_KEYERR_OUTPUT","MS_MEDIA_KEYERR_SERVICE","MS_MEDIA_KEYERR_UNKNOWN","Map","Math","MathMLElement","MediaCapabilities","MediaCapabilitiesInfo","MediaController","MediaDeviceInfo","MediaDevices","MediaElementAudioSourceNode","MediaEncryptedEvent","MediaError","MediaKeyError","MediaKeyEvent","MediaKeyMessageEvent","MediaKeyNeededEvent","MediaKeySession","MediaKeyStatusMap","MediaKeySystemAccess","MediaKeys","MediaList","MediaMetadata","MediaQueryList","MediaQueryListEvent","MediaRecorder","MediaRecorderErrorEvent","MediaSession","MediaSettingsRange","MediaSource","MediaStream","MediaStreamAudioDestinationNode","MediaStreamAudioSourceNode","MediaStreamEvent","MediaStreamTrack","MediaStreamTrackAudioSourceNode","MediaStreamTrackEvent","Memory","MessageChannel","MessageEvent","MessagePort","Methods","MimeType","MimeTypeArray","Module","MouseEvent","MouseScrollEvent","MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBackfaceVisibility","MozBinding","MozBorderBottomColors","MozBorderEnd","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStart","MozBorderStartColor","MozBorderStartStyle","MozBorderStartWidth","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex","MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozCSSKeyframeRule","MozCSSKeyframesRule","MozColumnCount","MozColumnFill","MozColumnGap","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContactChangeEvent","MozFloatEdge","MozFontFeatureSettings","MozFontLanguageOverride","MozForceBrokenImageIcon","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozMmsEvent","MozMmsMessage","MozMobileMessageThread","MozOSXFontSmoothing","MozOrient","MozOsxFontSmoothing","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozPerspective","MozPerspectiveOrigin","MozPowerManager","MozSettingsEvent","MozSmsEvent","MozSmsMessage","MozStackSizing","MozTabSize","MozTextAlignLast","MozTextDecorationColor","MozTextDecorationLine","MozTextDecorationStyle","MozTextSizeAdjust","MozTransform","MozTransformOrigin","MozTransformStyle","MozTransition","MozTransitionDelay","MozTransitionDuration","MozTransitionProperty","MozTransitionTimingFunction","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","MutationEvent","MutationObserver","MutationRecord","NAMESPACE_ERR","NAMESPACE_RULE","NEAREST","NEAREST_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","NEGATIVE_INFINITY","NETWORK_EMPTY","NETWORK_ERR","NETWORK_IDLE","NETWORK_LOADED","NETWORK_LOADING","NETWORK_NO_SOURCE","NEVER","NEW","NEXT","NEXT_NO_DUPLICATE","NICEST","NODE_AFTER","NODE_BEFORE","NODE_BEFORE_AND_AFTER","NODE_INSIDE","NONE","NON_TRANSIENT_ERR","NOTATION_NODE","NOTCH","NOTEQUAL","NOT_ALLOWED_ERR","NOT_FOUND_ERR","NOT_READABLE_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_ERR","NO_ERROR","NO_MODIFICATION_ALLOWED_ERR","NUMBER_TYPE","NUM_COMPRESSED_TEXTURE_FORMATS","NaN","NamedNodeMap","NavigationPreloadManager","Navigator","NearbyLinks","NetworkInformation","Node","NodeFilter","NodeIterator","NodeList","Notation","Notification","NotifyPaintEvent","Number","NumberFormat","OBJECT_TYPE","OBSOLETE","OK","ONE","ONE_MINUS_CONSTANT_ALPHA","ONE_MINUS_CONSTANT_COLOR","ONE_MINUS_DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_SRC_ALPHA","ONE_MINUS_SRC_COLOR","OPEN","OPENED","OPENING","ORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","OTHER_ERROR","OUT_OF_MEMORY","Object","OfflineAudioCompletionEvent","OfflineAudioContext","OfflineResourceList","OffscreenCanvas","OffscreenCanvasRenderingContext2D","Option","OrientationSensor","OscillatorNode","OverconstrainedError","OverflowEvent","PACK_ALIGNMENT","PACK_ROW_LENGTH","PACK_SKIP_PIXELS","PACK_SKIP_ROWS","PAGE_RULE","PARSE_ERR","PATHSEG_ARC_ABS","PATHSEG_ARC_REL","PATHSEG_CLOSEPATH","PATHSEG_CURVETO_CUBIC_ABS","PATHSEG_CURVETO_CUBIC_REL","PATHSEG_CURVETO_CUBIC_SMOOTH_ABS","PATHSEG_CURVETO_CUBIC_SMOOTH_REL","PATHSEG_CURVETO_QUADRATIC_ABS","PATHSEG_CURVETO_QUADRATIC_REL","PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS","PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL","PATHSEG_LINETO_ABS","PATHSEG_LINETO_HORIZONTAL_ABS","PATHSEG_LINETO_HORIZONTAL_REL","PATHSEG_LINETO_REL","PATHSEG_LINETO_VERTICAL_ABS","PATHSEG_LINETO_VERTICAL_REL","PATHSEG_MOVETO_ABS","PATHSEG_MOVETO_REL","PATHSEG_UNKNOWN","PATH_EXISTS_ERR","PEAKING","PERMISSION_DENIED","PERSISTENT","PI","PIXEL_PACK_BUFFER","PIXEL_PACK_BUFFER_BINDING","PIXEL_UNPACK_BUFFER","PIXEL_UNPACK_BUFFER_BINDING","PLAYING_STATE","POINTS","POLYGON_OFFSET_FACTOR","POLYGON_OFFSET_FILL","POLYGON_OFFSET_UNITS","POSITION_UNAVAILABLE","POSITIVE_INFINITY","PREV","PREV_NO_DUPLICATE","PROCESSING_INSTRUCTION_NODE","PageChangeEvent","PageTransitionEvent","PaintRequest","PaintRequestList","PannerNode","PasswordCredential","Path2D","PaymentAddress","PaymentInstruments","PaymentManager","PaymentMethodChangeEvent","PaymentRequest","PaymentRequestUpdateEvent","PaymentResponse","Performance","PerformanceElementTiming","PerformanceEntry","PerformanceEventTiming","PerformanceLongTaskTiming","PerformanceMark","PerformanceMeasure","PerformanceNavigation","PerformanceNavigationTiming","PerformanceObserver","PerformanceObserverEntryList","PerformancePaintTiming","PerformanceResourceTiming","PerformanceServerTiming","PerformanceTiming","PeriodicSyncManager","PeriodicWave","PermissionStatus","Permissions","PhotoCapabilities","PictureInPictureWindow","Plugin","PluginArray","PluralRules","PointerEvent","PopStateEvent","PopupBlockedEvent","Presentation","PresentationAvailability","PresentationConnection","PresentationConnectionAvailableEvent","PresentationConnectionCloseEvent","PresentationConnectionList","PresentationReceiver","PresentationRequest","ProcessingInstruction","ProgressEvent","Promise","PromiseRejectionEvent","PropertyNodeList","Proxy","PublicKeyCredential","PushManager","PushSubscription","PushSubscriptionOptions","Q","QUERY_RESULT","QUERY_RESULT_AVAILABLE","QUOTA_ERR","QUOTA_EXCEEDED_ERR","QueryInterface","R11F_G11F_B10F","R16F","R16I","R16UI","R32F","R32I","R32UI","R8","R8I","R8UI","R8_SNORM","RASTERIZER_DISCARD","READ_BUFFER","READ_FRAMEBUFFER","READ_FRAMEBUFFER_BINDING","READ_ONLY","READ_ONLY_ERR","READ_WRITE","RED","RED_BITS","RED_INTEGER","REMOVAL","RENDERBUFFER","RENDERBUFFER_ALPHA_SIZE","RENDERBUFFER_BINDING","RENDERBUFFER_BLUE_SIZE","RENDERBUFFER_DEPTH_SIZE","RENDERBUFFER_GREEN_SIZE","RENDERBUFFER_HEIGHT","RENDERBUFFER_INTERNAL_FORMAT","RENDERBUFFER_RED_SIZE","RENDERBUFFER_SAMPLES","RENDERBUFFER_STENCIL_SIZE","RENDERBUFFER_WIDTH","RENDERER","RENDERING_INTENT_ABSOLUTE_COLORIMETRIC","RENDERING_INTENT_AUTO","RENDERING_INTENT_PERCEPTUAL","RENDERING_INTENT_RELATIVE_COLORIMETRIC","RENDERING_INTENT_SATURATION","RENDERING_INTENT_UNKNOWN","REPEAT","REPLACE","RG","RG16F","RG16I","RG16UI","RG32F","RG32I","RG32UI","RG8","RG8I","RG8UI","RG8_SNORM","RGB","RGB10_A2","RGB10_A2UI","RGB16F","RGB16I","RGB16UI","RGB32F","RGB32I","RGB32UI","RGB565","RGB5_A1","RGB8","RGB8I","RGB8UI","RGB8_SNORM","RGB9_E5","RGBA","RGBA16F","RGBA16I","RGBA16UI","RGBA32F","RGBA32I","RGBA32UI","RGBA4","RGBA8","RGBA8I","RGBA8UI","RGBA8_SNORM","RGBA_INTEGER","RGBColor","RGB_INTEGER","RG_INTEGER","ROTATION_CLOCKWISE","ROTATION_COUNTERCLOCKWISE","RTCCertificate","RTCDTMFSender","RTCDTMFToneChangeEvent","RTCDataChannel","RTCDataChannelEvent","RTCDtlsTransport","RTCError","RTCErrorEvent","RTCIceCandidate","RTCIceTransport","RTCPeerConnection","RTCPeerConnectionIceErrorEvent","RTCPeerConnectionIceEvent","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSctpTransport","RTCSessionDescription","RTCStatsReport","RTCTrackEvent","RadioNodeList","Range","RangeError","RangeException","ReadableStream","ReadableStreamDefaultReader","RecordErrorEvent","Rect","ReferenceError","Reflect","RegExp","RelativeOrientationSensor","RelativeTimeFormat","RemotePlayback","Report","ReportBody","ReportingObserver","Request","ResizeObserver","ResizeObserverEntry","ResizeObserverSize","Response","RuntimeError","SAMPLER_2D","SAMPLER_2D_ARRAY","SAMPLER_2D_ARRAY_SHADOW","SAMPLER_2D_SHADOW","SAMPLER_3D","SAMPLER_BINDING","SAMPLER_CUBE","SAMPLER_CUBE_SHADOW","SAMPLES","SAMPLE_ALPHA_TO_COVERAGE","SAMPLE_BUFFERS","SAMPLE_COVERAGE","SAMPLE_COVERAGE_INVERT","SAMPLE_COVERAGE_VALUE","SAWTOOTH","SCHEDULED_STATE","SCISSOR_BOX","SCISSOR_TEST","SCROLL_PAGE_DOWN","SCROLL_PAGE_UP","SDP_ANSWER","SDP_OFFER","SDP_PRANSWER","SECURITY_ERR","SELECT","SEPARATE_ATTRIBS","SERIALIZE_ERR","SEVERITY_ERROR","SEVERITY_FATAL_ERROR","SEVERITY_WARNING","SHADER_COMPILER","SHADER_TYPE","SHADING_LANGUAGE_VERSION","SHIFT_MASK","SHORT","SHOWING","SHOW_ALL","SHOW_ATTRIBUTE","SHOW_CDATA_SECTION","SHOW_COMMENT","SHOW_DOCUMENT","SHOW_DOCUMENT_FRAGMENT","SHOW_DOCUMENT_TYPE","SHOW_ELEMENT","SHOW_ENTITY","SHOW_ENTITY_REFERENCE","SHOW_NOTATION","SHOW_PROCESSING_INSTRUCTION","SHOW_TEXT","SIGNALED","SIGNED_NORMALIZED","SINE","SOUNDFIELD","SQLException","SQRT1_2","SQRT2","SQUARE","SRC_ALPHA","SRC_ALPHA_SATURATE","SRC_COLOR","SRGB","SRGB8","SRGB8_ALPHA8","START_TO_END","START_TO_START","STATIC_COPY","STATIC_DRAW","STATIC_READ","STENCIL","STENCIL_ATTACHMENT","STENCIL_BACK_FAIL","STENCIL_BACK_FUNC","STENCIL_BACK_PASS_DEPTH_FAIL","STENCIL_BACK_PASS_DEPTH_PASS","STENCIL_BACK_REF","STENCIL_BACK_VALUE_MASK","STENCIL_BACK_WRITEMASK","STENCIL_BITS","STENCIL_BUFFER_BIT","STENCIL_CLEAR_VALUE","STENCIL_FAIL","STENCIL_FUNC","STENCIL_INDEX","STENCIL_INDEX8","STENCIL_PASS_DEPTH_FAIL","STENCIL_PASS_DEPTH_PASS","STENCIL_REF","STENCIL_TEST","STENCIL_VALUE_MASK","STENCIL_WRITEMASK","STREAM_COPY","STREAM_DRAW","STREAM_READ","STRING_TYPE","STYLE_RULE","SUBPIXEL_BITS","SUPPORTS_RULE","SVGAElement","SVGAltGlyphDefElement","SVGAltGlyphElement","SVGAltGlyphItemElement","SVGAngle","SVGAnimateColorElement","SVGAnimateElement","SVGAnimateMotionElement","SVGAnimateTransformElement","SVGAnimatedAngle","SVGAnimatedBoolean","SVGAnimatedEnumeration","SVGAnimatedInteger","SVGAnimatedLength","SVGAnimatedLengthList","SVGAnimatedNumber","SVGAnimatedNumberList","SVGAnimatedPreserveAspectRatio","SVGAnimatedRect","SVGAnimatedString","SVGAnimatedTransformList","SVGAnimationElement","SVGCircleElement","SVGClipPathElement","SVGColor","SVGComponentTransferFunctionElement","SVGCursorElement","SVGDefsElement","SVGDescElement","SVGDiscardElement","SVGDocument","SVGElement","SVGElementInstance","SVGElementInstanceList","SVGEllipseElement","SVGException","SVGFEBlendElement","SVGFEColorMatrixElement","SVGFEComponentTransferElement","SVGFECompositeElement","SVGFEConvolveMatrixElement","SVGFEDiffuseLightingElement","SVGFEDisplacementMapElement","SVGFEDistantLightElement","SVGFEDropShadowElement","SVGFEFloodElement","SVGFEFuncAElement","SVGFEFuncBElement","SVGFEFuncGElement","SVGFEFuncRElement","SVGFEGaussianBlurElement","SVGFEImageElement","SVGFEMergeElement","SVGFEMergeNodeElement","SVGFEMorphologyElement","SVGFEOffsetElement","SVGFEPointLightElement","SVGFESpecularLightingElement","SVGFESpotLightElement","SVGFETileElement","SVGFETurbulenceElement","SVGFilterElement","SVGFontElement","SVGFontFaceElement","SVGFontFaceFormatElement","SVGFontFaceNameElement","SVGFontFaceSrcElement","SVGFontFaceUriElement","SVGForeignObjectElement","SVGGElement","SVGGeometryElement","SVGGlyphElement","SVGGlyphRefElement","SVGGradientElement","SVGGraphicsElement","SVGHKernElement","SVGImageElement","SVGLength","SVGLengthList","SVGLineElement","SVGLinearGradientElement","SVGMPathElement","SVGMarkerElement","SVGMaskElement","SVGMatrix","SVGMetadataElement","SVGMissingGlyphElement","SVGNumber","SVGNumberList","SVGPaint","SVGPathElement","SVGPathSeg","SVGPathSegArcAbs","SVGPathSegArcRel","SVGPathSegClosePath","SVGPathSegCurvetoCubicAbs","SVGPathSegCurvetoCubicRel","SVGPathSegCurvetoCubicSmoothAbs","SVGPathSegCurvetoCubicSmoothRel","SVGPathSegCurvetoQuadraticAbs","SVGPathSegCurvetoQuadraticRel","SVGPathSegCurvetoQuadraticSmoothAbs","SVGPathSegCurvetoQuadraticSmoothRel","SVGPathSegLinetoAbs","SVGPathSegLinetoHorizontalAbs","SVGPathSegLinetoHorizontalRel","SVGPathSegLinetoRel","SVGPathSegLinetoVerticalAbs","SVGPathSegLinetoVerticalRel","SVGPathSegList","SVGPathSegMovetoAbs","SVGPathSegMovetoRel","SVGPatternElement","SVGPoint","SVGPointList","SVGPolygonElement","SVGPolylineElement","SVGPreserveAspectRatio","SVGRadialGradientElement","SVGRect","SVGRectElement","SVGRenderingIntent","SVGSVGElement","SVGScriptElement","SVGSetElement","SVGStopElement","SVGStringList","SVGStyleElement","SVGSwitchElement","SVGSymbolElement","SVGTRefElement","SVGTSpanElement","SVGTextContentElement","SVGTextElement","SVGTextPathElement","SVGTextPositioningElement","SVGTitleElement","SVGTransform","SVGTransformList","SVGUnitTypes","SVGUseElement","SVGVKernElement","SVGViewElement","SVGViewSpec","SVGZoomAndPan","SVGZoomEvent","SVG_ANGLETYPE_DEG","SVG_ANGLETYPE_GRAD","SVG_ANGLETYPE_RAD","SVG_ANGLETYPE_UNKNOWN","SVG_ANGLETYPE_UNSPECIFIED","SVG_CHANNEL_A","SVG_CHANNEL_B","SVG_CHANNEL_G","SVG_CHANNEL_R","SVG_CHANNEL_UNKNOWN","SVG_COLORTYPE_CURRENTCOLOR","SVG_COLORTYPE_RGBCOLOR","SVG_COLORTYPE_RGBCOLOR_ICCCOLOR","SVG_COLORTYPE_UNKNOWN","SVG_EDGEMODE_DUPLICATE","SVG_EDGEMODE_NONE","SVG_EDGEMODE_UNKNOWN","SVG_EDGEMODE_WRAP","SVG_FEBLEND_MODE_COLOR","SVG_FEBLEND_MODE_COLOR_BURN","SVG_FEBLEND_MODE_COLOR_DODGE","SVG_FEBLEND_MODE_DARKEN","SVG_FEBLEND_MODE_DIFFERENCE","SVG_FEBLEND_MODE_EXCLUSION","SVG_FEBLEND_MODE_HARD_LIGHT","SVG_FEBLEND_MODE_HUE","SVG_FEBLEND_MODE_LIGHTEN","SVG_FEBLEND_MODE_LUMINOSITY","SVG_FEBLEND_MODE_MULTIPLY","SVG_FEBLEND_MODE_NORMAL","SVG_FEBLEND_MODE_OVERLAY","SVG_FEBLEND_MODE_SATURATION","SVG_FEBLEND_MODE_SCREEN","SVG_FEBLEND_MODE_SOFT_LIGHT","SVG_FEBLEND_MODE_UNKNOWN","SVG_FECOLORMATRIX_TYPE_HUEROTATE","SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA","SVG_FECOLORMATRIX_TYPE_MATRIX","SVG_FECOLORMATRIX_TYPE_SATURATE","SVG_FECOLORMATRIX_TYPE_UNKNOWN","SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE","SVG_FECOMPONENTTRANSFER_TYPE_GAMMA","SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY","SVG_FECOMPONENTTRANSFER_TYPE_LINEAR","SVG_FECOMPONENTTRANSFER_TYPE_TABLE","SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_ARITHMETIC","SVG_FECOMPOSITE_OPERATOR_ATOP","SVG_FECOMPOSITE_OPERATOR_IN","SVG_FECOMPOSITE_OPERATOR_OUT","SVG_FECOMPOSITE_OPERATOR_OVER","SVG_FECOMPOSITE_OPERATOR_UNKNOWN","SVG_FECOMPOSITE_OPERATOR_XOR","SVG_INVALID_VALUE_ERR","SVG_LENGTHTYPE_CM","SVG_LENGTHTYPE_EMS","SVG_LENGTHTYPE_EXS","SVG_LENGTHTYPE_IN","SVG_LENGTHTYPE_MM","SVG_LENGTHTYPE_NUMBER","SVG_LENGTHTYPE_PC","SVG_LENGTHTYPE_PERCENTAGE","SVG_LENGTHTYPE_PT","SVG_LENGTHTYPE_PX","SVG_LENGTHTYPE_UNKNOWN","SVG_MARKERUNITS_STROKEWIDTH","SVG_MARKERUNITS_UNKNOWN","SVG_MARKERUNITS_USERSPACEONUSE","SVG_MARKER_ORIENT_ANGLE","SVG_MARKER_ORIENT_AUTO","SVG_MARKER_ORIENT_UNKNOWN","SVG_MASKTYPE_ALPHA","SVG_MASKTYPE_LUMINANCE","SVG_MATRIX_NOT_INVERTABLE","SVG_MEETORSLICE_MEET","SVG_MEETORSLICE_SLICE","SVG_MEETORSLICE_UNKNOWN","SVG_MORPHOLOGY_OPERATOR_DILATE","SVG_MORPHOLOGY_OPERATOR_ERODE","SVG_MORPHOLOGY_OPERATOR_UNKNOWN","SVG_PAINTTYPE_CURRENTCOLOR","SVG_PAINTTYPE_NONE","SVG_PAINTTYPE_RGBCOLOR","SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR","SVG_PAINTTYPE_UNKNOWN","SVG_PAINTTYPE_URI","SVG_PAINTTYPE_URI_CURRENTCOLOR","SVG_PAINTTYPE_URI_NONE","SVG_PAINTTYPE_URI_RGBCOLOR","SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR","SVG_PRESERVEASPECTRATIO_NONE","SVG_PRESERVEASPECTRATIO_UNKNOWN","SVG_PRESERVEASPECTRATIO_XMAXYMAX","SVG_PRESERVEASPECTRATIO_XMAXYMID","SVG_PRESERVEASPECTRATIO_XMAXYMIN","SVG_PRESERVEASPECTRATIO_XMIDYMAX","SVG_PRESERVEASPECTRATIO_XMIDYMID","SVG_PRESERVEASPECTRATIO_XMIDYMIN","SVG_PRESERVEASPECTRATIO_XMINYMAX","SVG_PRESERVEASPECTRATIO_XMINYMID","SVG_PRESERVEASPECTRATIO_XMINYMIN","SVG_SPREADMETHOD_PAD","SVG_SPREADMETHOD_REFLECT","SVG_SPREADMETHOD_REPEAT","SVG_SPREADMETHOD_UNKNOWN","SVG_STITCHTYPE_NOSTITCH","SVG_STITCHTYPE_STITCH","SVG_STITCHTYPE_UNKNOWN","SVG_TRANSFORM_MATRIX","SVG_TRANSFORM_ROTATE","SVG_TRANSFORM_SCALE","SVG_TRANSFORM_SKEWX","SVG_TRANSFORM_SKEWY","SVG_TRANSFORM_TRANSLATE","SVG_TRANSFORM_UNKNOWN","SVG_TURBULENCE_TYPE_FRACTALNOISE","SVG_TURBULENCE_TYPE_TURBULENCE","SVG_TURBULENCE_TYPE_UNKNOWN","SVG_UNIT_TYPE_OBJECTBOUNDINGBOX","SVG_UNIT_TYPE_UNKNOWN","SVG_UNIT_TYPE_USERSPACEONUSE","SVG_WRONG_TYPE_ERR","SVG_ZOOMANDPAN_DISABLE","SVG_ZOOMANDPAN_MAGNIFY","SVG_ZOOMANDPAN_UNKNOWN","SYNC_CONDITION","SYNC_FENCE","SYNC_FLAGS","SYNC_FLUSH_COMMANDS_BIT","SYNC_GPU_COMMANDS_COMPLETE","SYNC_STATUS","SYNTAX_ERR","SavedPages","Screen","ScreenOrientation","Script","ScriptProcessorNode","ScrollAreaEvent","SecurityPolicyViolationEvent","Selection","Sensor","SensorErrorEvent","ServiceWorker","ServiceWorkerContainer","ServiceWorkerRegistration","SessionDescription","Set","ShadowRoot","SharedArrayBuffer","SharedWorker","SimpleGestureEvent","SourceBuffer","SourceBufferList","SpeechSynthesis","SpeechSynthesisErrorEvent","SpeechSynthesisEvent","SpeechSynthesisUtterance","SpeechSynthesisVoice","StaticRange","StereoPannerNode","StopIteration","Storage","StorageEvent","StorageManager","String","StructType","StylePropertyMap","StylePropertyMapReadOnly","StyleSheet","StyleSheetList","SubmitEvent","SubtleCrypto","Symbol","SyncManager","SyntaxError","TEMPORARY","TEXTPATH_METHODTYPE_ALIGN","TEXTPATH_METHODTYPE_STRETCH","TEXTPATH_METHODTYPE_UNKNOWN","TEXTPATH_SPACINGTYPE_AUTO","TEXTPATH_SPACINGTYPE_EXACT","TEXTPATH_SPACINGTYPE_UNKNOWN","TEXTURE","TEXTURE0","TEXTURE1","TEXTURE10","TEXTURE11","TEXTURE12","TEXTURE13","TEXTURE14","TEXTURE15","TEXTURE16","TEXTURE17","TEXTURE18","TEXTURE19","TEXTURE2","TEXTURE20","TEXTURE21","TEXTURE22","TEXTURE23","TEXTURE24","TEXTURE25","TEXTURE26","TEXTURE27","TEXTURE28","TEXTURE29","TEXTURE3","TEXTURE30","TEXTURE31","TEXTURE4","TEXTURE5","TEXTURE6","TEXTURE7","TEXTURE8","TEXTURE9","TEXTURE_2D","TEXTURE_2D_ARRAY","TEXTURE_3D","TEXTURE_BASE_LEVEL","TEXTURE_BINDING_2D","TEXTURE_BINDING_2D_ARRAY","TEXTURE_BINDING_3D","TEXTURE_BINDING_CUBE_MAP","TEXTURE_COMPARE_FUNC","TEXTURE_COMPARE_MODE","TEXTURE_CUBE_MAP","TEXTURE_CUBE_MAP_NEGATIVE_X","TEXTURE_CUBE_MAP_NEGATIVE_Y","TEXTURE_CUBE_MAP_NEGATIVE_Z","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP_POSITIVE_Y","TEXTURE_CUBE_MAP_POSITIVE_Z","TEXTURE_IMMUTABLE_FORMAT","TEXTURE_IMMUTABLE_LEVELS","TEXTURE_MAG_FILTER","TEXTURE_MAX_ANISOTROPY_EXT","TEXTURE_MAX_LEVEL","TEXTURE_MAX_LOD","TEXTURE_MIN_FILTER","TEXTURE_MIN_LOD","TEXTURE_WRAP_R","TEXTURE_WRAP_S","TEXTURE_WRAP_T","TEXT_NODE","TIMEOUT","TIMEOUT_ERR","TIMEOUT_EXPIRED","TIMEOUT_IGNORED","TOO_LARGE_ERR","TRANSACTION_INACTIVE_ERR","TRANSFORM_FEEDBACK","TRANSFORM_FEEDBACK_ACTIVE","TRANSFORM_FEEDBACK_BINDING","TRANSFORM_FEEDBACK_BUFFER","TRANSFORM_FEEDBACK_BUFFER_BINDING","TRANSFORM_FEEDBACK_BUFFER_MODE","TRANSFORM_FEEDBACK_BUFFER_SIZE","TRANSFORM_FEEDBACK_BUFFER_START","TRANSFORM_FEEDBACK_PAUSED","TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN","TRANSFORM_FEEDBACK_VARYINGS","TRIANGLE","TRIANGLES","TRIANGLE_FAN","TRIANGLE_STRIP","TYPE_BACK_FORWARD","TYPE_ERR","TYPE_MISMATCH_ERR","TYPE_NAVIGATE","TYPE_RELOAD","TYPE_RESERVED","Table","TaskAttributionTiming","Text","TextDecoder","TextDecoderStream","TextEncoder","TextEncoderStream","TextEvent","TextMetrics","TextTrack","TextTrackCue","TextTrackCueList","TextTrackList","TimeEvent","TimeRanges","Touch","TouchEvent","TouchList","TrackEvent","TransformStream","TransitionEvent","TreeWalker","TrustedHTML","TrustedScript","TrustedScriptURL","TrustedTypePolicy","TrustedTypePolicyFactory","TypeError","TypedObject","U2F","UIEvent","UNCACHED","UNIFORM_ARRAY_STRIDE","UNIFORM_BLOCK_ACTIVE_UNIFORMS","UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES","UNIFORM_BLOCK_BINDING","UNIFORM_BLOCK_DATA_SIZE","UNIFORM_BLOCK_INDEX","UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER","UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER","UNIFORM_BUFFER","UNIFORM_BUFFER_BINDING","UNIFORM_BUFFER_OFFSET_ALIGNMENT","UNIFORM_BUFFER_SIZE","UNIFORM_BUFFER_START","UNIFORM_IS_ROW_MAJOR","UNIFORM_MATRIX_STRIDE","UNIFORM_OFFSET","UNIFORM_SIZE","UNIFORM_TYPE","UNKNOWN_ERR","UNKNOWN_RULE","UNMASKED_RENDERER_WEBGL","UNMASKED_VENDOR_WEBGL","UNORDERED_NODE_ITERATOR_TYPE","UNORDERED_NODE_SNAPSHOT_TYPE","UNPACK_ALIGNMENT","UNPACK_COLORSPACE_CONVERSION_WEBGL","UNPACK_FLIP_Y_WEBGL","UNPACK_IMAGE_HEIGHT","UNPACK_PREMULTIPLY_ALPHA_WEBGL","UNPACK_ROW_LENGTH","UNPACK_SKIP_IMAGES","UNPACK_SKIP_PIXELS","UNPACK_SKIP_ROWS","UNSCHEDULED_STATE","UNSENT","UNSIGNALED","UNSIGNED_BYTE","UNSIGNED_INT","UNSIGNED_INT_10F_11F_11F_REV","UNSIGNED_INT_24_8","UNSIGNED_INT_2_10_10_10_REV","UNSIGNED_INT_5_9_9_9_REV","UNSIGNED_INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_3D","UNSIGNED_INT_SAMPLER_CUBE","UNSIGNED_INT_VEC2","UNSIGNED_INT_VEC3","UNSIGNED_INT_VEC4","UNSIGNED_NORMALIZED","UNSIGNED_SHORT","UNSIGNED_SHORT_4_4_4_4","UNSIGNED_SHORT_5_5_5_1","UNSIGNED_SHORT_5_6_5","UNSPECIFIED_EVENT_TYPE_ERR","UPDATEREADY","URIError","URL","URLSearchParams","URLUnencoded","URL_MISMATCH_ERR","USB","USBAlternateInterface","USBConfiguration","USBConnectionEvent","USBDevice","USBEndpoint","USBInTransferResult","USBInterface","USBIsochronousInTransferPacket","USBIsochronousInTransferResult","USBIsochronousOutTransferPacket","USBIsochronousOutTransferResult","USBOutTransferResult","UTC","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","UserActivation","UserMessageHandler","UserMessageHandlersNamespace","UserProximityEvent","VALIDATE_STATUS","VALIDATION_ERR","VARIABLES_RULE","VENDOR","VERSION","VERSION_CHANGE","VERSION_ERR","VERTEX_ARRAY_BINDING","VERTEX_ATTRIB_ARRAY_BUFFER_BINDING","VERTEX_ATTRIB_ARRAY_DIVISOR","VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE","VERTEX_ATTRIB_ARRAY_ENABLED","VERTEX_ATTRIB_ARRAY_INTEGER","VERTEX_ATTRIB_ARRAY_NORMALIZED","VERTEX_ATTRIB_ARRAY_POINTER","VERTEX_ATTRIB_ARRAY_SIZE","VERTEX_ATTRIB_ARRAY_STRIDE","VERTEX_ATTRIB_ARRAY_TYPE","VERTEX_SHADER","VERTICAL","VERTICAL_AXIS","VER_ERR","VIEWPORT","VIEWPORT_RULE","VRDisplay","VRDisplayCapabilities","VRDisplayEvent","VREyeParameters","VRFieldOfView","VRFrameData","VRPose","VRStageParameters","VTTCue","VTTRegion","ValidityState","VideoPlaybackQuality","VideoStreamTrack","VisualViewport","WAIT_FAILED","WEBKIT_FILTER_RULE","WEBKIT_KEYFRAMES_RULE","WEBKIT_KEYFRAME_RULE","WEBKIT_REGION_RULE","WRONG_DOCUMENT_ERR","WakeLock","WakeLockSentinel","WasmAnyRef","WaveShaperNode","WeakMap","WeakRef","WeakSet","WebAssembly","WebGL2RenderingContext","WebGLActiveInfo","WebGLBuffer","WebGLContextEvent","WebGLFramebuffer","WebGLProgram","WebGLQuery","WebGLRenderbuffer","WebGLRenderingContext","WebGLSampler","WebGLShader","WebGLShaderPrecisionFormat","WebGLSync","WebGLTexture","WebGLTransformFeedback","WebGLUniformLocation","WebGLVertexArray","WebGLVertexArrayObject","WebKitAnimationEvent","WebKitBlobBuilder","WebKitCSSFilterRule","WebKitCSSFilterValue","WebKitCSSKeyframeRule","WebKitCSSKeyframesRule","WebKitCSSMatrix","WebKitCSSRegionRule","WebKitCSSTransformValue","WebKitDataCue","WebKitGamepad","WebKitMediaKeyError","WebKitMediaKeyMessageEvent","WebKitMediaKeySession","WebKitMediaKeys","WebKitMediaSource","WebKitMutationObserver","WebKitNamespace","WebKitPlaybackTargetAvailabilityEvent","WebKitPoint","WebKitShadowRoot","WebKitSourceBuffer","WebKitSourceBufferList","WebKitTransitionEvent","WebSocket","WebkitAlignContent","WebkitAlignItems","WebkitAlignSelf","WebkitAnimation","WebkitAnimationDelay","WebkitAnimationDirection","WebkitAnimationDuration","WebkitAnimationFillMode","WebkitAnimationIterationCount","WebkitAnimationName","WebkitAnimationPlayState","WebkitAnimationTimingFunction","WebkitAppearance","WebkitBackfaceVisibility","WebkitBackgroundClip","WebkitBackgroundOrigin","WebkitBackgroundSize","WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius","WebkitBorderImage","WebkitBorderRadius","WebkitBorderTopLeftRadius","WebkitBorderTopRightRadius","WebkitBoxAlign","WebkitBoxDirection","WebkitBoxFlex","WebkitBoxOrdinalGroup","WebkitBoxOrient","WebkitBoxPack","WebkitBoxShadow","WebkitBoxSizing","WebkitFilter","WebkitFlex","WebkitFlexBasis","WebkitFlexDirection","WebkitFlexFlow","WebkitFlexGrow","WebkitFlexShrink","WebkitFlexWrap","WebkitJustifyContent","WebkitLineClamp","WebkitMask","WebkitMaskClip","WebkitMaskComposite","WebkitMaskImage","WebkitMaskOrigin","WebkitMaskPosition","WebkitMaskPositionX","WebkitMaskPositionY","WebkitMaskRepeat","WebkitMaskSize","WebkitOrder","WebkitPerspective","WebkitPerspectiveOrigin","WebkitTextFillColor","WebkitTextSizeAdjust","WebkitTextStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","WebkitTransform","WebkitTransformOrigin","WebkitTransformStyle","WebkitTransition","WebkitTransitionDelay","WebkitTransitionDuration","WebkitTransitionProperty","WebkitTransitionTimingFunction","WebkitUserSelect","WheelEvent","Window","Worker","Worklet","WritableStream","WritableStreamDefaultWriter","XMLDocument","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestException","XMLHttpRequestProgressEvent","XMLHttpRequestUpload","XMLSerializer","XMLStylesheetProcessingInstruction","XPathEvaluator","XPathException","XPathExpression","XPathNSResolver","XPathResult","XRBoundedReferenceSpace","XRDOMOverlayState","XRFrame","XRHitTestResult","XRHitTestSource","XRInputSource","XRInputSourceArray","XRInputSourceEvent","XRInputSourcesChangeEvent","XRLayer","XRPose","XRRay","XRReferenceSpace","XRReferenceSpaceEvent","XRRenderState","XRRigidTransform","XRSession","XRSessionEvent","XRSpace","XRSystem","XRTransientInputHitTestResult","XRTransientInputHitTestSource","XRView","XRViewerPose","XRViewport","XRWebGLLayer","XSLTProcessor","ZERO","_XD0M_","_YD0M_","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","__opera","__proto__","_browserjsran","a","aLink","abbr","abort","aborted","abs","absolute","acceleration","accelerationIncludingGravity","accelerator","accept","acceptCharset","acceptNode","accessKey","accessKeyLabel","accuracy","acos","acosh","action","actionURL","actions","activated","active","activeCues","activeElement","activeSourceBuffers","activeSourceCount","activeTexture","activeVRDisplays","actualBoundingBoxAscent","actualBoundingBoxDescent","actualBoundingBoxLeft","actualBoundingBoxRight","add","addAll","addBehavior","addCandidate","addColorStop","addCue","addElement","addEventListener","addFilter","addFromString","addFromUri","addIceCandidate","addImport","addListener","addModule","addNamed","addPageRule","addPath","addPointer","addRange","addRegion","addRule","addSearchEngine","addSourceBuffer","addStream","addTextTrack","addTrack","addTransceiver","addWakeLockListener","added","addedNodes","additionalName","additiveSymbols","addons","address","addressLine","adoptNode","adoptedStyleSheets","adr","advance","after","album","alert","algorithm","align","align-content","align-items","align-self","alignContent","alignItems","alignSelf","alignmentBaseline","alinkColor","all","allSettled","allow","allowFullscreen","allowPaymentRequest","allowedDirections","allowedFeatures","allowedToPlay","allowsFeature","alpha","alt","altGraphKey","altHtml","altKey","altLeft","alternate","alternateSetting","alternates","altitude","altitudeAccuracy","amplitude","ancestorOrigins","anchor","anchorNode","anchorOffset","anchors","and","angle","angularAcceleration","angularVelocity","animVal","animate","animatedInstanceRoot","animatedNormalizedPathSegList","animatedPathSegList","animatedPoints","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationStartTime","animationTimingFunction","animationsPaused","anniversary","antialias","anticipatedRemoval","any","app","appCodeName","appMinorVersion","appName","appNotifications","appVersion","appearance","append","appendBuffer","appendChild","appendData","appendItem","appendMedium","appendNamed","appendRule","appendStream","appendWindowEnd","appendWindowStart","applets","applicationCache","applicationServerKey","apply","applyConstraints","applyElement","arc","arcTo","archive","areas","arguments","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRelevant","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText","arrayBuffer","artist","artwork","as","asIntN","asUintN","asin","asinh","assert","assign","assignedElements","assignedNodes","assignedSlot","async","asyncIterator","atEnd","atan","atan2","atanh","atob","attachEvent","attachInternals","attachShader","attachShadow","attachments","attack","attestationObject","attrChange","attrName","attributeFilter","attributeName","attributeNamespace","attributeOldValue","attributeStyleMap","attributes","attribution","audioBitsPerSecond","audioTracks","audioWorklet","authenticatedSignedWrites","authenticatorData","autoIncrement","autobuffer","autocapitalize","autocomplete","autocorrect","autofocus","automationRate","autoplay","availHeight","availLeft","availTop","availWidth","availability","available","aversion","ax","axes","axis","ay","azimuth","b","back","backface-visibility","backfaceVisibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundFetch","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","badInput","badge","balance","baseFrequencyX","baseFrequencyY","baseLatency","baseLayer","baseNode","baseOffset","baseURI","baseVal","baselineShift","battery","bday","before","beginElement","beginElementAt","beginPath","beginQuery","beginTransformFeedback","behavior","behaviorCookie","behaviorPart","behaviorUrns","beta","bezierCurveTo","bgColor","bgProperties","bias","big","bigint64","biguint64","binaryType","bind","bindAttribLocation","bindBuffer","bindBufferBase","bindBufferRange","bindFramebuffer","bindRenderbuffer","bindSampler","bindTexture","bindTransformFeedback","bindVertexArray","blendColor","blendEquation","blendEquationSeparate","blendFunc","blendFuncSeparate","blink","blitFramebuffer","blob","block-size","blockDirection","blockSize","blockedURI","blue","bluetooth","blur","body","bodyUsed","bold","bookmarks","booleanValue","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderBoxSize","borderCollapse","borderColor","borderColorDark","borderColorLight","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","bottomMargin","bound","boundElements","boundingClientRect","boundingHeight","boundingLeft","boundingTop","boundingWidth","bounds","boundsGeometry","box-decoration-break","box-shadow","box-sizing","boxDecorationBreak","boxShadow","boxSizing","break-after","break-before","break-inside","breakAfter","breakBefore","breakInside","broadcast","browserLanguage","btoa","bubbles","buffer","bufferData","bufferDepth","bufferSize","bufferSubData","buffered","bufferedAmount","bufferedAmountLowThreshold","buildID","buildNumber","button","buttonID","buttons","byteLength","byteOffset","bytesWritten","c","cache","caches","call","caller","canBeFormatted","canBeMounted","canBeShared","canHaveChildren","canHaveHTML","canInsertDTMF","canMakePayment","canPlayType","canPresent","canTrickleIceCandidates","cancel","cancelAndHoldAtTime","cancelAnimationFrame","cancelBubble","cancelIdleCallback","cancelScheduledValues","cancelVideoFrameCallback","cancelWatchAvailability","cancelable","candidate","canonicalUUID","canvas","capabilities","caption","caption-side","captionSide","capture","captureEvents","captureStackTrace","captureStream","caret-color","caretBidiLevel","caretColor","caretPositionFromPoint","caretRangeFromPoint","cast","catch","category","cbrt","cd","ceil","cellIndex","cellPadding","cellSpacing","cells","ch","chOff","chain","challenge","changeType","changedTouches","channel","channelCount","channelCountMode","channelInterpretation","char","charAt","charCode","charCodeAt","charIndex","charLength","characterData","characterDataOldValue","characterSet","characteristic","charging","chargingTime","charset","check","checkEnclosure","checkFramebufferStatus","checkIntersection","checkValidity","checked","childElementCount","childList","childNodes","children","chrome","ciphertext","cite","city","claimInterface","claimed","classList","className","classid","clear","clearAppBadge","clearAttributes","clearBufferfi","clearBufferfv","clearBufferiv","clearBufferuiv","clearColor","clearData","clearDepth","clearHalt","clearImmediate","clearInterval","clearLiveSeekableRange","clearMarks","clearMaxGCPauseAccumulator","clearMeasures","clearParameters","clearRect","clearResourceTimings","clearShadow","clearStencil","clearTimeout","clearWatch","click","clickCount","clientDataJSON","clientHeight","clientInformation","clientLeft","clientRect","clientRects","clientTop","clientWaitSync","clientWidth","clientX","clientY","clip","clip-path","clip-rule","clipBottom","clipLeft","clipPath","clipPathUnits","clipRight","clipRule","clipTop","clipboard","clipboardData","clone","cloneContents","cloneNode","cloneRange","close","closePath","closed","closest","clz","clz32","cm","cmp","code","codeBase","codePointAt","codeType","colSpan","collapse","collapseToEnd","collapseToStart","collapsed","collect","colno","color","color-adjust","color-interpolation","color-interpolation-filters","colorAdjust","colorDepth","colorInterpolation","colorInterpolationFilters","colorMask","colorType","cols","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columnCount","columnFill","columnGap","columnNumber","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","command","commit","commitPreferences","commitStyles","commonAncestorContainer","compact","compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareExchange","compareNode","comparePoint","compatMode","compatible","compile","compileShader","compileStreaming","complete","component","componentFromPoint","composed","composedPath","composite","compositionEndOffset","compositionStartOffset","compressedTexImage2D","compressedTexImage3D","compressedTexSubImage2D","compressedTexSubImage3D","computedStyleMap","concat","conditionText","coneInnerAngle","coneOuterAngle","coneOuterGain","configuration","configurationName","configurationValue","configurations","confirm","confirmComposition","confirmSiteSpecificTrackingException","confirmWebWideTrackingException","connect","connectEnd","connectShark","connectStart","connected","connection","connectionList","connectionSpeed","connectionState","connections","console","consolidate","constraint","constrictionActive","construct","constructor","contactID","contain","containerId","containerName","containerSrc","containerType","contains","containsNode","content","contentBoxSize","contentDocument","contentEditable","contentHint","contentOverflow","contentRect","contentScriptType","contentStyleType","contentType","contentWindow","context","contextMenu","contextmenu","continue","continuePrimaryKey","continuous","control","controlTransferIn","controlTransferOut","controller","controls","controlsList","convertPointFromNode","convertQuadFromNode","convertRectFromNode","convertToBlob","convertToSpecifiedUnits","cookie","cookieEnabled","coords","copyBufferSubData","copyFromChannel","copyTexImage2D","copyTexSubImage2D","copyTexSubImage3D","copyToChannel","copyWithin","correspondingElement","correspondingUseElement","corruptedVideoFrames","cos","cosh","count","countReset","counter-increment","counter-reset","counter-set","counterIncrement","counterReset","counterSet","country","cpuClass","cpuSleepAllowed","create","createAnalyser","createAnswer","createAttribute","createAttributeNS","createBiquadFilter","createBuffer","createBufferSource","createCDATASection","createCSSStyleSheet","createCaption","createChannelMerger","createChannelSplitter","createComment","createConstantSource","createContextualFragment","createControlRange","createConvolver","createDTMFSender","createDataChannel","createDelay","createDelayNode","createDocument","createDocumentFragment","createDocumentType","createDynamicsCompressor","createElement","createElementNS","createEntityReference","createEvent","createEventObject","createExpression","createFramebuffer","createFunction","createGain","createGainNode","createHTML","createHTMLDocument","createIIRFilter","createImageBitmap","createImageData","createIndex","createJavaScriptNode","createLinearGradient","createMediaElementSource","createMediaKeys","createMediaStreamDestination","createMediaStreamSource","createMediaStreamTrackSource","createMutableFile","createNSResolver","createNodeIterator","createNotification","createObjectStore","createObjectURL","createOffer","createOscillator","createPanner","createPattern","createPeriodicWave","createPolicy","createPopup","createProcessingInstruction","createProgram","createQuery","createRadialGradient","createRange","createRangeCollection","createReader","createRenderbuffer","createSVGAngle","createSVGLength","createSVGMatrix","createSVGNumber","createSVGPathSegArcAbs","createSVGPathSegArcRel","createSVGPathSegClosePath","createSVGPathSegCurvetoCubicAbs","createSVGPathSegCurvetoCubicRel","createSVGPathSegCurvetoCubicSmoothAbs","createSVGPathSegCurvetoCubicSmoothRel","createSVGPathSegCurvetoQuadraticAbs","createSVGPathSegCurvetoQuadraticRel","createSVGPathSegCurvetoQuadraticSmoothAbs","createSVGPathSegCurvetoQuadraticSmoothRel","createSVGPathSegLinetoAbs","createSVGPathSegLinetoHorizontalAbs","createSVGPathSegLinetoHorizontalRel","createSVGPathSegLinetoRel","createSVGPathSegLinetoVerticalAbs","createSVGPathSegLinetoVerticalRel","createSVGPathSegMovetoAbs","createSVGPathSegMovetoRel","createSVGPoint","createSVGRect","createSVGTransform","createSVGTransformFromMatrix","createSampler","createScript","createScriptProcessor","createScriptURL","createSession","createShader","createShadowRoot","createStereoPanner","createStyleSheet","createTBody","createTFoot","createTHead","createTextNode","createTextRange","createTexture","createTouch","createTouchList","createTransformFeedback","createTreeWalker","createVertexArray","createWaveShaper","creationTime","credentials","crossOrigin","crossOriginIsolated","crypto","csi","csp","cssFloat","cssRules","cssText","cssValueType","ctrlKey","ctrlLeft","cues","cullFace","currentDirection","currentLocalDescription","currentNode","currentPage","currentRect","currentRemoteDescription","currentScale","currentScript","currentSrc","currentState","currentStyle","currentTarget","currentTime","currentTranslate","currentView","cursor","curve","customElements","customError","cx","cy","d","data","dataFld","dataFormatAs","dataLoss","dataLossMessage","dataPageSize","dataSrc","dataTransfer","database","databases","dataset","dateTime","db","debug","debuggerEnabled","declare","decode","decodeAudioData","decodeURI","decodeURIComponent","decodedBodySize","decoding","decodingInfo","decrypt","default","defaultCharset","defaultChecked","defaultMuted","defaultPlaybackRate","defaultPolicy","defaultPrevented","defaultRequest","defaultSelected","defaultStatus","defaultURL","defaultValue","defaultView","defaultstatus","defer","define","defineMagicFunction","defineMagicVariable","defineProperties","defineProperty","deg","delay","delayTime","delegatesFocus","delete","deleteBuffer","deleteCaption","deleteCell","deleteContents","deleteData","deleteDatabase","deleteFramebuffer","deleteFromDocument","deleteIndex","deleteMedium","deleteObjectStore","deleteProgram","deleteProperty","deleteQuery","deleteRenderbuffer","deleteRow","deleteRule","deleteSampler","deleteShader","deleteSync","deleteTFoot","deleteTHead","deleteTexture","deleteTransformFeedback","deleteVertexArray","deliverChangeRecords","delivery","deliveryInfo","deliveryStatus","deliveryTimestamp","delta","deltaMode","deltaX","deltaY","deltaZ","dependentLocality","depthFar","depthFunc","depthMask","depthNear","depthRange","deref","deriveBits","deriveKey","description","deselectAll","designMode","desiredSize","destination","destinationURL","detach","detachEvent","detachShader","detail","details","detect","detune","device","deviceClass","deviceId","deviceMemory","devicePixelContentBoxSize","devicePixelRatio","deviceProtocol","deviceSubclass","deviceVersionMajor","deviceVersionMinor","deviceVersionSubminor","deviceXDPI","deviceYDPI","didTimeout","diffuseConstant","digest","dimensions","dir","dirName","direction","dirxml","disable","disablePictureInPicture","disableRemotePlayback","disableVertexAttribArray","disabled","dischargingTime","disconnect","disconnectShark","dispatchEvent","display","displayId","displayName","disposition","distanceModel","div","divisor","djsapi","djsproxy","doImport","doNotTrack","doScroll","doctype","document","documentElement","documentMode","documentURI","dolphin","dolphinGameCenter","dolphininfo","dolphinmeta","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domOverlayState","domain","domainLookupEnd","domainLookupStart","dominant-baseline","dominantBaseline","done","dopplerFactor","dotAll","downDegrees","downlink","download","downloadTotal","downloaded","dpcm","dpi","dppx","dragDrop","draggable","drawArrays","drawArraysInstanced","drawArraysInstancedANGLE","drawBuffers","drawCustomFocusRing","drawElements","drawElementsInstanced","drawElementsInstancedANGLE","drawFocusIfNeeded","drawImage","drawImageFromRect","drawRangeElements","drawSystemFocusRing","drawingBufferHeight","drawingBufferWidth","dropEffect","droppedVideoFrames","dropzone","dtmf","dump","dumpProfile","duplicate","durability","duration","dvname","dvnum","dx","dy","dynsrc","e","edgeMode","effect","effectAllowed","effectiveDirective","effectiveType","elapsedTime","element","elementFromPoint","elementTiming","elements","elementsFromPoint","elevation","ellipse","em","email","embeds","emma","empty","empty-cells","emptyCells","emptyHTML","emptyScript","emulatedPosition","enable","enableBackground","enableDelegations","enableStyleSheetsForSet","enableVertexAttribArray","enabled","enabledPlugin","encode","encodeInto","encodeURI","encodeURIComponent","encodedBodySize","encoding","encodingInfo","encrypt","enctype","end","endContainer","endElement","endElementAt","endOfStream","endOffset","endQuery","endTime","endTransformFeedback","ended","endpoint","endpointNumber","endpoints","endsWith","enterKeyHint","entities","entries","entryType","enumerate","enumerateDevices","enumerateEditable","environmentBlendMode","equals","error","errorCode","errorDetail","errorText","escape","estimate","eval","evaluate","event","eventPhase","every","ex","exception","exchange","exec","execCommand","execCommandShowHelp","execScript","exitFullscreen","exitPictureInPicture","exitPointerLock","exitPresent","exp","expand","expandEntityReferences","expando","expansion","expiration","expirationTime","expires","expiryDate","explicitOriginalTarget","expm1","exponent","exponentialRampToValueAtTime","exportKey","exports","extend","extensions","extentNode","extentOffset","external","externalResourcesRequired","extractContents","extractable","eye","f","face","factoryReset","failureReason","fallback","family","familyName","farthestViewportElement","fastSeek","fatal","featureId","featurePolicy","featureSettings","features","fenceSync","fetch","fetchStart","fftSize","fgColor","fieldOfView","file","fileCreatedDate","fileHandle","fileModifiedDate","fileName","fileSize","fileUpdatedDate","filename","files","filesystem","fill","fill-opacity","fill-rule","fillLightMode","fillOpacity","fillRect","fillRule","fillStyle","fillText","filter","filterResX","filterResY","filterUnits","filters","finally","find","findIndex","findRule","findText","finish","finished","fireEvent","firesTouchEvents","firstChild","firstElementChild","firstPage","fixed","flags","flat","flatMap","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","flipX","flipY","float","float32","float64","flood-color","flood-opacity","floodColor","floodOpacity","floor","flush","focus","focusNode","focusOffset","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontOpticalSizing","fontSize","fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontSynthesis","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","fontcolor","fontfaces","fonts","fontsize","for","forEach","force","forceRedraw","form","formAction","formData","formEnctype","formMethod","formNoValidate","formTarget","format","formatToParts","forms","forward","forwardX","forwardY","forwardZ","foundation","fr","fragmentDirective","frame","frameBorder","frameElement","frameSpacing","framebuffer","framebufferHeight","framebufferRenderbuffer","framebufferTexture2D","framebufferTextureLayer","framebufferWidth","frames","freeSpace","freeze","frequency","frequencyBinCount","from","fromCharCode","fromCodePoint","fromElement","fromEntries","fromFloat32Array","fromFloat64Array","fromMatrix","fromPoint","fromQuad","fromRect","frontFace","fround","fullPath","fullScreen","fullscreen","fullscreenElement","fullscreenEnabled","fx","fy","gain","gamepad","gamma","gap","gatheringState","gatt","genderIdentity","generateCertificate","generateKey","generateMipmap","generateRequest","geolocation","gestureObject","get","getActiveAttrib","getActiveUniform","getActiveUniformBlockName","getActiveUniformBlockParameter","getActiveUniforms","getAdjacentText","getAll","getAllKeys","getAllResponseHeaders","getAllowlistForFeature","getAnimations","getAsFile","getAsString","getAttachedShaders","getAttribLocation","getAttribute","getAttributeNS","getAttributeNames","getAttributeNode","getAttributeNodeNS","getAttributeType","getAudioTracks","getAvailability","getBBox","getBattery","getBigInt64","getBigUint64","getBlob","getBookmark","getBoundingClientRect","getBounds","getBoxQuads","getBufferParameter","getBufferSubData","getByteFrequencyData","getByteTimeDomainData","getCSSCanvasContext","getCTM","getCandidateWindowClientRect","getCanonicalLocales","getCapabilities","getChannelData","getCharNumAtPosition","getCharacteristic","getCharacteristics","getClientExtensionResults","getClientRect","getClientRects","getCoalescedEvents","getCompositionAlternatives","getComputedStyle","getComputedTextLength","getComputedTiming","getConfiguration","getConstraints","getContext","getContextAttributes","getContributingSources","getCounterValue","getCueAsHTML","getCueById","getCurrentPosition","getCurrentTime","getData","getDatabaseNames","getDate","getDay","getDefaultComputedStyle","getDescriptor","getDescriptors","getDestinationInsertionPoints","getDevices","getDirectory","getDisplayMedia","getDistributedNodes","getEditable","getElementById","getElementsByClassName","getElementsByName","getElementsByTagName","getElementsByTagNameNS","getEnclosureList","getEndPositionOfChar","getEntries","getEntriesByName","getEntriesByType","getError","getExtension","getExtentOfChar","getEyeParameters","getFeature","getFile","getFiles","getFilesAndDirectories","getFingerprints","getFloat32","getFloat64","getFloatFrequencyData","getFloatTimeDomainData","getFloatValue","getFragDataLocation","getFrameData","getFramebufferAttachmentParameter","getFrequencyResponse","getFullYear","getGamepads","getHitTestResults","getHitTestResultsForTransientInput","getHours","getIdentityAssertion","getIds","getImageData","getIndexedParameter","getInstalledRelatedApps","getInt16","getInt32","getInt8","getInternalformatParameter","getIntersectionList","getItem","getItems","getKey","getKeyframes","getLayers","getLayoutMap","getLineDash","getLocalCandidates","getLocalParameters","getLocalStreams","getMarks","getMatchedCSSRules","getMaxGCPauseSinceClear","getMeasures","getMetadata","getMilliseconds","getMinutes","getModifierState","getMonth","getNamedItem","getNamedItemNS","getNativeFramebufferScaleFactor","getNotifications","getNotifier","getNumberOfChars","getOffsetReferenceSpace","getOutputTimestamp","getOverrideHistoryNavigationMode","getOverrideStyle","getOwnPropertyDescriptor","getOwnPropertyDescriptors","getOwnPropertyNames","getOwnPropertySymbols","getParameter","getParameters","getParent","getPathSegAtLength","getPhotoCapabilities","getPhotoSettings","getPointAtLength","getPose","getPredictedEvents","getPreference","getPreferenceDefault","getPresentationAttribute","getPreventDefault","getPrimaryService","getPrimaryServices","getProgramInfoLog","getProgramParameter","getPropertyCSSValue","getPropertyPriority","getPropertyShorthand","getPropertyType","getPropertyValue","getPrototypeOf","getQuery","getQueryParameter","getRGBColorValue","getRandomValues","getRangeAt","getReader","getReceivers","getRectValue","getRegistration","getRegistrations","getRemoteCandidates","getRemoteCertificates","getRemoteParameters","getRemoteStreams","getRenderbufferParameter","getResponseHeader","getRoot","getRootNode","getRotationOfChar","getSVGDocument","getSamplerParameter","getScreenCTM","getSeconds","getSelectedCandidatePair","getSelection","getSenders","getService","getSettings","getShaderInfoLog","getShaderParameter","getShaderPrecisionFormat","getShaderSource","getSimpleDuration","getSiteIcons","getSources","getSpeculativeParserUrls","getStartPositionOfChar","getStartTime","getState","getStats","getStatusForPolicy","getStorageUpdates","getStreamById","getStringValue","getSubStringLength","getSubscription","getSupportedConstraints","getSupportedExtensions","getSupportedFormats","getSyncParameter","getSynchronizationSources","getTags","getTargetRanges","getTexParameter","getTime","getTimezoneOffset","getTiming","getTotalLength","getTrackById","getTracks","getTransceivers","getTransform","getTransformFeedbackVarying","getTransformToElement","getTransports","getType","getTypeMapping","getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","getUint16","getUint32","getUint8","getUniform","getUniformBlockIndex","getUniformIndices","getUniformLocation","getUserMedia","getVRDisplays","getValues","getVarDate","getVariableValue","getVertexAttrib","getVertexAttribOffset","getVideoPlaybackQuality","getVideoTracks","getViewerPose","getViewport","getVoices","getWakeLockState","getWriter","getYear","givenName","global","globalAlpha","globalCompositeOperation","globalThis","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","go","grabFrame","grad","gradientTransform","gradientUnits","grammars","green","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","gripSpace","group","groupCollapsed","groupEnd","groupId","hadRecentInput","hand","handedness","hapticActuators","hardwareConcurrency","has","hasAttribute","hasAttributeNS","hasAttributes","hasBeenActive","hasChildNodes","hasComposition","hasEnrolledInstrument","hasExtension","hasExternalDisplay","hasFeature","hasFocus","hasInstance","hasLayout","hasOrientation","hasOwnProperty","hasPointerCapture","hasPosition","hasReading","hasStorageAccess","hash","head","headers","heading","height","hidden","hide","hideFocus","high","highWaterMark","hint","history","honorificPrefix","honorificSuffix","horizontalOverflow","host","hostCandidate","hostname","href","hrefTranslate","hreflang","hspace","html5TagCheckInerface","htmlFor","htmlText","httpEquiv","httpRequestStatusCode","hwTimestamp","hyphens","hypot","iccId","iceConnectionState","iceGatheringState","iceTransport","icon","iconURL","id","identifier","identity","idpLoginUrl","ignoreBOM","ignoreCase","ignoreDepthValues","image-orientation","image-rendering","imageHeight","imageOrientation","imageRendering","imageSizes","imageSmoothingEnabled","imageSmoothingQuality","imageSrcset","imageWidth","images","ime-mode","imeMode","implementation","importKey","importNode","importStylesheet","imports","impp","imul","in","in1","in2","inBandMetadataTrackDispatchType","inRange","includes","incremental","indeterminate","index","indexNames","indexOf","indexedDB","indicate","inertiaDestinationX","inertiaDestinationY","info","init","initAnimationEvent","initBeforeLoadEvent","initClipboardEvent","initCloseEvent","initCommandEvent","initCompositionEvent","initCustomEvent","initData","initDataType","initDeviceMotionEvent","initDeviceOrientationEvent","initDragEvent","initErrorEvent","initEvent","initFocusEvent","initGestureEvent","initHashChangeEvent","initKeyEvent","initKeyboardEvent","initMSManipulationEvent","initMessageEvent","initMouseEvent","initMouseScrollEvent","initMouseWheelEvent","initMutationEvent","initNSMouseEvent","initOverflowEvent","initPageEvent","initPageTransitionEvent","initPointerEvent","initPopStateEvent","initProgressEvent","initScrollAreaEvent","initSimpleGestureEvent","initStorageEvent","initTextEvent","initTimeEvent","initTouchEvent","initTransitionEvent","initUIEvent","initWebKitAnimationEvent","initWebKitTransitionEvent","initWebKitWheelEvent","initWheelEvent","initialTime","initialize","initiatorType","inline-size","inlineSize","inlineVerticalFieldOfView","inner","innerHTML","innerHeight","innerText","innerWidth","input","inputBuffer","inputEncoding","inputMethod","inputMode","inputSource","inputSources","inputType","inputs","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertDTMF","insertData","insertItemBefore","insertNode","insertRow","insertRule","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","installing","instanceRoot","instantiate","instantiateStreaming","instruments","int16","int32","int8","integrity","interactionMode","intercept","interfaceClass","interfaceName","interfaceNumber","interfaceProtocol","interfaceSubclass","interfaces","interimResults","internalSubset","interpretation","intersectionRatio","intersectionRect","intersectsNode","interval","invalidIteratorState","invalidateFramebuffer","invalidateSubFramebuffer","inverse","invertSelf","is","is2D","isActive","isAlternate","isArray","isBingCurrentSearchDefault","isBuffer","isCandidateWindowVisible","isChar","isCollapsed","isComposing","isConcatSpreadable","isConnected","isContentEditable","isContentHandlerRegistered","isContextLost","isDefaultNamespace","isDirectory","isDisabled","isEnabled","isEqual","isEqualNode","isExtensible","isExternalCTAP2SecurityKeySupported","isFile","isFinite","isFramebuffer","isFrozen","isGenerator","isHTML","isHistoryNavigation","isId","isIdentity","isInjected","isInteger","isIntersecting","isLockFree","isMap","isMultiLine","isNaN","isOpen","isPointInFill","isPointInPath","isPointInRange","isPointInStroke","isPrefAlternate","isPresenting","isPrimary","isProgram","isPropertyImplicit","isProtocolHandlerRegistered","isPrototypeOf","isQuery","isRenderbuffer","isSafeInteger","isSameNode","isSampler","isScript","isScriptURL","isSealed","isSecureContext","isSessionSupported","isShader","isSupported","isSync","isTextEdit","isTexture","isTransformFeedback","isTrusted","isTypeSupported","isUserVerifyingPlatformAuthenticatorAvailable","isVertexArray","isView","isVisible","isochronousTransferIn","isochronousTransferOut","isolation","italics","item","itemId","itemProp","itemRef","itemScope","itemType","itemValue","items","iterateNext","iterationComposite","iterator","javaEnabled","jobTitle","join","json","justify-content","justify-items","justify-self","justifyContent","justifyItems","justifySelf","k1","k2","k3","k4","kHz","keepalive","kernelMatrix","kernelUnitLengthX","kernelUnitLengthY","kerning","key","keyCode","keyFor","keyIdentifier","keyLightEnabled","keyLocation","keyPath","keyStatuses","keySystem","keyText","keyUsage","keyboard","keys","keytype","kind","knee","label","labels","lang","language","languages","largeArcFlag","lastChild","lastElementChild","lastEventId","lastIndex","lastIndexOf","lastInputTime","lastMatch","lastMessageSubject","lastMessageType","lastModified","lastModifiedDate","lastPage","lastParen","lastState","lastStyleSheetSet","latitude","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar","layoutGridLine","layoutGridMode","layoutGridType","lbound","left","leftContext","leftDegrees","leftMargin","leftProjectionMatrix","leftViewMatrix","length","lengthAdjust","lengthComputable","letter-spacing","letterSpacing","level","lighting-color","lightingColor","limitingConeAngle","line","line-break","line-height","lineAlign","lineBreak","lineCap","lineDashOffset","lineHeight","lineJoin","lineNumber","lineTo","lineWidth","linearAcceleration","linearRampToValueAtTime","linearVelocity","lineno","lines","link","linkColor","linkProgram","links","list","list-style","list-style-image","list-style-position","list-style-type","listStyle","listStyleImage","listStylePosition","listStyleType","listener","load","loadEventEnd","loadEventStart","loadTime","loadTimes","loaded","loading","localDescription","localName","localService","localStorage","locale","localeCompare","location","locationbar","lock","locked","lockedFile","locks","log","log10","log1p","log2","logicalXDPI","logicalYDPI","longDesc","longitude","lookupNamespaceURI","lookupPrefix","loop","loopEnd","loopStart","looping","low","lower","lowerBound","lowerOpen","lowsrc","m11","m12","m13","m14","m21","m22","m23","m24","m31","m32","m33","m34","m41","m42","m43","m44","makeXRCompatible","manifest","manufacturer","manufacturerName","map","mapping","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginHeight","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marginWidth","mark","marker","marker-end","marker-mid","marker-offset","marker-start","markerEnd","markerHeight","markerMid","markerOffset","markerStart","markerUnits","markerWidth","marks","mask","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-position-x","mask-position-y","mask-repeat","mask-size","mask-type","maskClip","maskComposite","maskContentUnits","maskImage","maskMode","maskOrigin","maskPosition","maskPositionX","maskPositionY","maskRepeat","maskSize","maskType","maskUnits","match","matchAll","matchMedia","matchMedium","matches","matrix","matrixTransform","max","max-block-size","max-height","max-inline-size","max-width","maxActions","maxAlternatives","maxBlockSize","maxChannelCount","maxChannels","maxConnectionsPerServer","maxDecibels","maxDistance","maxHeight","maxInlineSize","maxLayers","maxLength","maxMessageSize","maxPacketLifeTime","maxRetransmits","maxTouchPoints","maxValue","maxWidth","measure","measureText","media","mediaCapabilities","mediaDevices","mediaElement","mediaGroup","mediaKeys","mediaSession","mediaStream","mediaText","meetOrSlice","memory","menubar","mergeAttributes","message","messageClass","messageHandlers","messageType","metaKey","metadata","method","methodDetails","methodName","mid","mimeType","mimeTypes","min","min-block-size","min-height","min-inline-size","min-width","minBlockSize","minDecibels","minHeight","minInlineSize","minLength","minValue","minWidth","miterLimit","mix-blend-mode","mixBlendMode","mm","mode","modify","mount","move","moveBy","moveEnd","moveFirst","moveFocusDown","moveFocusLeft","moveFocusRight","moveFocusUp","moveNext","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint","movementX","movementY","mozAdd","mozAnimationStartTime","mozAnon","mozApps","mozAudioCaptured","mozAudioChannelType","mozAutoplayEnabled","mozCancelAnimationFrame","mozCancelFullScreen","mozCancelRequestAnimationFrame","mozCaptureStream","mozCaptureStreamUntilEnded","mozClearDataAt","mozContact","mozContacts","mozCreateFileHandle","mozCurrentTransform","mozCurrentTransformInverse","mozCursor","mozDash","mozDashOffset","mozDecodedFrames","mozExitPointerLock","mozFillRule","mozFragmentEnd","mozFrameDelay","mozFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozGetAll","mozGetAllKeys","mozGetAsFile","mozGetDataAt","mozGetMetadata","mozGetUserMedia","mozHasAudio","mozHasItem","mozHidden","mozImageSmoothingEnabled","mozIndexedDB","mozInnerScreenX","mozInnerScreenY","mozInputSource","mozIsTextField","mozItem","mozItemCount","mozItems","mozLength","mozLockOrientation","mozMatchesSelector","mozMovementX","mozMovementY","mozOpaque","mozOrientation","mozPaintCount","mozPaintedFrames","mozParsedFrames","mozPay","mozPointerLockElement","mozPresentedFrames","mozPreservesPitch","mozPressure","mozPrintCallback","mozRTCIceCandidate","mozRTCPeerConnection","mozRTCSessionDescription","mozRemove","mozRequestAnimationFrame","mozRequestFullScreen","mozRequestPointerLock","mozSetDataAt","mozSetImageElement","mozSourceNode","mozSrcObject","mozSystem","mozTCPSocket","mozTextStyle","mozTypesAt","mozUnlockOrientation","mozUserCancelled","mozVisibilityState","ms","msAnimation","msAnimationDelay","msAnimationDirection","msAnimationDuration","msAnimationFillMode","msAnimationIterationCount","msAnimationName","msAnimationPlayState","msAnimationStartTime","msAnimationTimingFunction","msBackfaceVisibility","msBlockProgression","msCSSOMElementFloatMetrics","msCaching","msCachingEnabled","msCancelRequestAnimationFrame","msCapsLockWarningOff","msClearImmediate","msClose","msContentZoomChaining","msContentZoomFactor","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msConvertURL","msCrypto","msDoNotTrack","msElementsFromPoint","msElementsFromRect","msExitFullscreen","msExtendedCode","msFillRule","msFirstPaint","msFlex","msFlexAlign","msFlexDirection","msFlexFlow","msFlexItemAlign","msFlexLinePack","msFlexNegative","msFlexOrder","msFlexPack","msFlexPositive","msFlexPreferredSize","msFlexWrap","msFlowFrom","msFlowInto","msFontFeatureSettings","msFullscreenElement","msFullscreenEnabled","msGetInputContext","msGetRegionContent","msGetUntransformedBounds","msGraphicsTrustStatus","msGridColumn","msGridColumnAlign","msGridColumnSpan","msGridColumns","msGridRow","msGridRowAlign","msGridRowSpan","msGridRows","msHidden","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImageSmoothingEnabled","msImeAlign","msIndexedDB","msInterpolationMode","msIsStaticHTML","msKeySystem","msKeys","msLaunchUri","msLockOrientation","msManipulationViewsEnabled","msMatchMedia","msMatchesSelector","msMaxTouchPoints","msOrientation","msOverflowStyle","msPerspective","msPerspectiveOrigin","msPlayToDisabled","msPlayToPreferredSourceUri","msPlayToPrimary","msPointerEnabled","msRegionOverflow","msReleasePointerCapture","msRequestAnimationFrame","msRequestFullscreen","msSaveBlob","msSaveOrOpenBlob","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msSetImmediate","msSetMediaKeys","msSetPointerCapture","msTextCombineHorizontal","msTextSizeAdjust","msToBlob","msTouchAction","msTouchSelect","msTraceAsyncCallbackCompleted","msTraceAsyncCallbackStarting","msTraceAsyncOperationCompleted","msTraceAsyncOperationStarting","msTransform","msTransformOrigin","msTransformStyle","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUnlockOrientation","msUpdateAsyncCallbackRelation","msUserSelect","msVisibilityState","msWrapFlow","msWrapMargin","msWrapThrough","msWriteProfilerMark","msZoom","msZoomTo","mt","mul","multiEntry","multiSelectionObj","multiline","multiple","multiply","multiplySelf","mutableFile","muted","n","name","nameProp","namedItem","namedRecordset","names","namespaceURI","namespaces","naturalHeight","naturalWidth","navigate","navigation","navigationMode","navigationPreload","navigationStart","navigator","near","nearestViewportElement","negative","negotiated","netscape","networkState","newScale","newTranslate","newURL","newValue","newValueSpecifiedUnits","newVersion","newhome","next","nextElementSibling","nextHopProtocol","nextNode","nextPage","nextSibling","nickname","noHref","noModule","noResize","noShade","noValidate","noWrap","node","nodeName","nodeType","nodeValue","nonce","normalize","normalizedPathSegList","notationName","notations","note","noteGrainOn","noteOff","noteOn","notify","now","numOctaves","number","numberOfChannels","numberOfInputs","numberOfItems","numberOfOutputs","numberValue","oMatchesSelector","object","object-fit","object-position","objectFit","objectPosition","objectStore","objectStoreNames","objectType","observe","of","offscreenBuffering","offset","offset-anchor","offset-distance","offset-path","offset-rotate","offsetAnchor","offsetDistance","offsetHeight","offsetLeft","offsetNode","offsetParent","offsetPath","offsetRotate","offsetTop","offsetWidth","offsetX","offsetY","ok","oldURL","oldValue","oldVersion","olderShadowRoot","onLine","onabort","onabsolutedeviceorientation","onactivate","onactive","onaddsourcebuffer","onaddstream","onaddtrack","onafterprint","onafterscriptexecute","onafterupdate","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onappinstalled","onaudioend","onaudioprocess","onaudiostart","onautocomplete","onautocompleteerror","onauxclick","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus","onbeforeinstallprompt","onbeforepaste","onbeforeprint","onbeforescriptexecute","onbeforeunload","onbeforeupdate","onbeforexrselect","onbegin","onblocked","onblur","onbounce","onboundary","onbufferedamountlow","oncached","oncancel","oncandidatewindowhide","oncandidatewindowshow","oncandidatewindowupdate","oncanplay","oncanplaythrough","once","oncellchange","onchange","oncharacteristicvaluechanged","onchargingchange","onchargingtimechange","onchecking","onclick","onclose","onclosing","oncompassneedscalibration","oncomplete","onconnect","onconnecting","onconnectionavailable","onconnectionstatechange","oncontextmenu","oncontrollerchange","oncontrolselect","oncopy","oncuechange","oncut","ondataavailable","ondatachannel","ondatasetchanged","ondatasetcomplete","ondblclick","ondeactivate","ondevicechange","ondevicelight","ondevicemotion","ondeviceorientation","ondeviceorientationabsolute","ondeviceproximity","ondischargingtimechange","ondisconnect","ondisplay","ondownloading","ondrag","ondragend","ondragenter","ondragexit","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onenter","onenterpictureinpicture","onerror","onerrorupdate","onexit","onfilterchange","onfinish","onfocus","onfocusin","onfocusout","onformdata","onfreeze","onfullscreenchange","onfullscreenerror","ongatheringstatechange","ongattserverdisconnected","ongesturechange","ongestureend","ongesturestart","ongotpointercapture","onhashchange","onhelp","onicecandidate","onicecandidateerror","oniceconnectionstatechange","onicegatheringstatechange","oninactive","oninput","oninputsourceschange","oninvalid","onkeydown","onkeypress","onkeystatuseschange","onkeyup","onlanguagechange","onlayoutcomplete","onleavepictureinpicture","onlevelchange","onload","onloadeddata","onloadedmetadata","onloadend","onloading","onloadingdone","onloadingerror","onloadstart","onlosecapture","onlostpointercapture","only","onmark","onmessage","onmessageerror","onmidimessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend","onmovestart","onmozfullscreenchange","onmozfullscreenerror","onmozorientationchange","onmozpointerlockchange","onmozpointerlockerror","onmscontentzoom","onmsfullscreenchange","onmsfullscreenerror","onmsgesturechange","onmsgesturedoubletap","onmsgestureend","onmsgesturehold","onmsgesturestart","onmsgesturetap","onmsgotpointercapture","onmsinertiastart","onmslostpointercapture","onmsmanipulationstatechanged","onmsneedkey","onmsorientationchange","onmspointercancel","onmspointerdown","onmspointerenter","onmspointerhover","onmspointerleave","onmspointermove","onmspointerout","onmspointerover","onmspointerup","onmssitemodejumplistitemremoved","onmsthumbnailclick","onmute","onnegotiationneeded","onnomatch","onnoupdate","onobsolete","onoffline","ononline","onopen","onorientationchange","onpagechange","onpagehide","onpageshow","onpaste","onpause","onpayerdetailchange","onpaymentmethodchange","onplay","onplaying","onpluginstreamstart","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerrawupdate","onpointerup","onpopstate","onprocessorerror","onprogress","onpropertychange","onratechange","onreading","onreadystatechange","onrejectionhandled","onrelease","onremove","onremovesourcebuffer","onremovestream","onremovetrack","onrepeat","onreset","onresize","onresizeend","onresizestart","onresourcetimingbufferfull","onresult","onresume","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onsearch","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectedcandidatepairchange","onselectend","onselectionchange","onselectstart","onshippingaddresschange","onshippingoptionchange","onshow","onsignalingstatechange","onsoundend","onsoundstart","onsourceclose","onsourceclosed","onsourceended","onsourceopen","onspeechend","onspeechstart","onsqueeze","onsqueezeend","onsqueezestart","onstalled","onstart","onstatechange","onstop","onstorage","onstoragecommit","onsubmit","onsuccess","onsuspend","onterminate","ontextinput","ontimeout","ontimeupdate","ontoggle","ontonechange","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontrack","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onunhandledrejection","onunload","onunmute","onupdate","onupdateend","onupdatefound","onupdateready","onupdatestart","onupgradeneeded","onuserproximity","onversionchange","onvisibilitychange","onvoiceschanged","onvolumechange","onvrdisplayactivate","onvrdisplayconnect","onvrdisplaydeactivate","onvrdisplaydisconnect","onvrdisplaypresentchange","onwaiting","onwaitingforkey","onwarning","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkitcurrentplaybacktargetiswirelesschanged","onwebkitfullscreenchange","onwebkitfullscreenerror","onwebkitkeyadded","onwebkitkeyerror","onwebkitkeymessage","onwebkitneedkey","onwebkitorientationchange","onwebkitplaybacktargetavailabilitychanged","onwebkitpointerlockchange","onwebkitpointerlockerror","onwebkitresourcetimingbufferfull","onwebkittransitionend","onwheel","onzoom","opacity","open","openCursor","openDatabase","openKeyCursor","opened","opener","opera","operationType","operator","opr","optimum","options","or","order","orderX","orderY","ordered","org","organization","orient","orientAngle","orientType","orientation","orientationX","orientationY","orientationZ","origin","originalPolicy","originalTarget","orphans","oscpu","outerHTML","outerHeight","outerText","outerWidth","outline","outline-color","outline-offset","outline-style","outline-width","outlineColor","outlineOffset","outlineStyle","outlineWidth","outputBuffer","outputLatency","outputs","overflow","overflow-anchor","overflow-block","overflow-inline","overflow-wrap","overflow-x","overflow-y","overflowAnchor","overflowBlock","overflowInline","overflowWrap","overflowX","overflowY","overrideMimeType","oversample","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","ownKeys","ownerDocument","ownerElement","ownerNode","ownerRule","ownerSVGElement","owningElement","p1","p2","p3","p4","packetSize","packets","pad","padEnd","padStart","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","page-break-after","page-break-before","page-break-inside","pageBreakAfter","pageBreakBefore","pageBreakInside","pageCount","pageLeft","pageTop","pageX","pageXOffset","pageY","pageYOffset","pages","paint-order","paintOrder","paintRequests","paintType","paintWorklet","palette","pan","panningModel","parameters","parent","parentElement","parentNode","parentRule","parentStyleSheet","parentTextEdit","parentWindow","parse","parseAll","parseFloat","parseFromString","parseInt","part","participants","passive","password","pasteHTML","path","pathLength","pathSegList","pathSegType","pathSegTypeAsLetter","pathname","pattern","patternContentUnits","patternMismatch","patternTransform","patternUnits","pause","pauseAnimations","pauseOnExit","pauseProfilers","pauseTransformFeedback","paused","payerEmail","payerName","payerPhone","paymentManager","pc","peerIdentity","pending","pendingLocalDescription","pendingRemoteDescription","percent","performance","periodicSync","permission","permissionState","permissions","persist","persisted","personalbar","perspective","perspective-origin","perspectiveOrigin","phone","phoneticFamilyName","phoneticGivenName","photo","pictureInPictureElement","pictureInPictureEnabled","pictureInPictureWindow","ping","pipeThrough","pipeTo","pitch","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelStorei","pixelTop","pixelUnitToMillimeterX","pixelUnitToMillimeterY","pixelWidth","place-content","place-items","place-self","placeContent","placeItems","placeSelf","placeholder","platform","platforms","play","playEffect","playState","playbackRate","playbackState","playbackTime","played","playoutDelayHint","playsInline","plugins","pluginspage","pname","pointer-events","pointerBeforeReferenceNode","pointerEnabled","pointerEvents","pointerId","pointerLockElement","pointerType","points","pointsAtX","pointsAtY","pointsAtZ","polygonOffset","pop","populateMatrix","popupWindowFeatures","popupWindowName","popupWindowURI","port","port1","port2","ports","posBottom","posHeight","posLeft","posRight","posTop","posWidth","pose","position","positionAlign","positionX","positionY","positionZ","postError","postMessage","postalCode","poster","pow","powerEfficient","powerOff","preMultiplySelf","precision","preferredStyleSheetSet","preferredStylesheetSet","prefix","preload","prepend","presentation","preserveAlpha","preserveAspectRatio","preserveAspectRatioString","pressed","pressure","prevValue","preventDefault","preventExtensions","preventSilentAccess","previousElementSibling","previousNode","previousPage","previousRect","previousScale","previousSibling","previousTranslate","primaryKey","primitiveType","primitiveUnits","principals","print","priority","privateKey","probablySupportsContext","process","processIceMessage","processingEnd","processingStart","product","productId","productName","productSub","profile","profileEnd","profiles","projectionMatrix","promise","prompt","properties","propertyIsEnumerable","propertyName","protocol","protocolLong","prototype","provider","pseudoClass","pseudoElement","pt","publicId","publicKey","published","pulse","push","pushManager","pushNotification","pushState","put","putImageData","px","quadraticCurveTo","qualifier","quaternion","query","queryCommandEnabled","queryCommandIndeterm","queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","querySelector","querySelectorAll","queueMicrotask","quote","quotes","r","r1","r2","race","rad","radiogroup","radiusX","radiusY","random","range","rangeCount","rangeMax","rangeMin","rangeOffset","rangeOverflow","rangeParent","rangeUnderflow","rate","ratio","raw","rawId","read","readAsArrayBuffer","readAsBinaryString","readAsBlob","readAsDataURL","readAsText","readBuffer","readEntries","readOnly","readPixels","readReportRequested","readText","readValue","readable","ready","readyState","reason","reboot","receivedAlert","receiver","receivers","recipient","reconnect","recordNumber","recordsAvailable","recordset","rect","red","redEyeReduction","redirect","redirectCount","redirectEnd","redirectStart","redirected","reduce","reduceRight","reduction","refDistance","refX","refY","referenceNode","referenceSpace","referrer","referrerPolicy","refresh","region","regionAnchorX","regionAnchorY","regionId","regions","register","registerContentHandler","registerElement","registerProperty","registerProtocolHandler","reject","rel","relList","relatedAddress","relatedNode","relatedPort","relatedTarget","release","releaseCapture","releaseEvents","releaseInterface","releaseLock","releasePointerCapture","releaseShaderCompiler","reliable","reliableWrite","reload","rem","remainingSpace","remote","remoteDescription","remove","removeAllRanges","removeAttribute","removeAttributeNS","removeAttributeNode","removeBehavior","removeChild","removeCue","removeEventListener","removeFilter","removeImport","removeItem","removeListener","removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRegion","removeRule","removeSiteSpecificTrackingException","removeSourceBuffer","removeStream","removeTrack","removeVariable","removeWakeLockListener","removeWebWideTrackingException","removed","removedNodes","renderHeight","renderState","renderTime","renderWidth","renderbufferStorage","renderbufferStorageMultisample","renderedBuffer","renderingMode","renotify","repeat","replace","replaceAdjacentText","replaceAll","replaceChild","replaceChildren","replaceData","replaceId","replaceItem","replaceNode","replaceState","replaceSync","replaceTrack","replaceWholeText","replaceWith","reportValidity","request","requestAnimationFrame","requestAutocomplete","requestData","requestDevice","requestFrame","requestFullscreen","requestHitTestSource","requestHitTestSourceForTransientInput","requestId","requestIdleCallback","requestMIDIAccess","requestMediaKeySystemAccess","requestPermission","requestPictureInPicture","requestPointerLock","requestPresent","requestReferenceSpace","requestSession","requestStart","requestStorageAccess","requestSubmit","requestVideoFrameCallback","requestingWindow","requireInteraction","required","requiredExtensions","requiredFeatures","reset","resetPose","resetTransform","resize","resizeBy","resizeTo","resolve","response","responseBody","responseEnd","responseReady","responseStart","responseText","responseType","responseURL","responseXML","restartIce","restore","result","resultIndex","resultType","results","resume","resumeProfilers","resumeTransformFeedback","retry","returnValue","rev","reverse","reversed","revocable","revokeObjectURL","rgbColor","right","rightContext","rightDegrees","rightMargin","rightProjectionMatrix","rightViewMatrix","role","rolloffFactor","root","rootBounds","rootElement","rootMargin","rotate","rotateAxisAngle","rotateAxisAngleSelf","rotateFromVector","rotateFromVectorSelf","rotateSelf","rotation","rotationAngle","rotationRate","round","row-gap","rowGap","rowIndex","rowSpan","rows","rtcpTransport","rtt","ruby-align","ruby-position","rubyAlign","rubyOverhang","rubyPosition","rules","runtime","runtimeStyle","rx","ry","s","safari","sample","sampleCoverage","sampleRate","samplerParameterf","samplerParameteri","sandbox","save","saveData","scale","scale3d","scale3dSelf","scaleNonUniform","scaleNonUniformSelf","scaleSelf","scheme","scissor","scope","scopeName","scoped","screen","screenBrightness","screenEnabled","screenLeft","screenPixelToMillimeterX","screenPixelToMillimeterY","screenTop","screenX","screenY","scriptURL","scripts","scroll","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","scrollAmount","scrollBehavior","scrollBy","scrollByLines","scrollByPages","scrollDelay","scrollHeight","scrollIntoView","scrollIntoViewIfNeeded","scrollLeft","scrollLeftMax","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollMaxX","scrollMaxY","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollRestoration","scrollSnapAlign","scrollSnapType","scrollTo","scrollTop","scrollTopMax","scrollWidth","scrollX","scrollY","scrollbar-color","scrollbar-width","scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarColor","scrollbarDarkShadowColor","scrollbarFaceColor","scrollbarHighlightColor","scrollbarShadowColor","scrollbarTrackColor","scrollbarWidth","scrollbars","scrolling","scrollingElement","sctp","sctpCauseCode","sdp","sdpLineNumber","sdpMLineIndex","sdpMid","seal","search","searchBox","searchBoxJavaBridge_","searchParams","sectionRowIndex","secureConnectionStart","security","seed","seekToNextFrame","seekable","seeking","select","selectAllChildren","selectAlternateInterface","selectConfiguration","selectNode","selectNodeContents","selectNodes","selectSingleNode","selectSubString","selected","selectedIndex","selectedOptions","selectedStyleSheetSet","selectedStylesheetSet","selection","selectionDirection","selectionEnd","selectionStart","selector","selectorText","self","send","sendAsBinary","sendBeacon","sender","sentAlert","sentTimestamp","separator","serialNumber","serializeToString","serverTiming","service","serviceWorker","session","sessionId","sessionStorage","set","setActionHandler","setActive","setAlpha","setAppBadge","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","setBaseAndExtent","setBigInt64","setBigUint64","setBingCurrentSearchDefault","setCapture","setCodecPreferences","setColor","setCompositeOperation","setConfiguration","setCurrentTime","setCustomValidity","setData","setDate","setDragImage","setEnd","setEndAfter","setEndBefore","setEndPoint","setFillColor","setFilterRes","setFloat32","setFloat64","setFloatValue","setFormValue","setFullYear","setHeaderValue","setHours","setIdentityProvider","setImmediate","setInt16","setInt32","setInt8","setInterval","setItem","setKeyframes","setLineCap","setLineDash","setLineJoin","setLineWidth","setLiveSeekableRange","setLocalDescription","setMatrix","setMatrixValue","setMediaKeys","setMilliseconds","setMinutes","setMiterLimit","setMonth","setNamedItem","setNamedItemNS","setNonUserCodeExceptions","setOrientToAngle","setOrientToAuto","setOrientation","setOverrideHistoryNavigationMode","setPaint","setParameter","setParameters","setPeriodicWave","setPointerCapture","setPosition","setPositionState","setPreference","setProperty","setPrototypeOf","setRGBColor","setRGBColorICCColor","setRadius","setRangeText","setRemoteDescription","setRequestHeader","setResizable","setResourceTimingBufferSize","setRotate","setScale","setSeconds","setSelectionRange","setServerCertificate","setShadow","setSinkId","setSkewX","setSkewY","setStart","setStartAfter","setStartBefore","setStdDeviation","setStreams","setStringValue","setStrokeColor","setSuggestResult","setTargetAtTime","setTargetValueAtTime","setTime","setTimeout","setTransform","setTranslate","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes","setUTCMonth","setUTCSeconds","setUint16","setUint32","setUint8","setUri","setValidity","setValueAtTime","setValueCurveAtTime","setVariable","setVelocity","setVersion","setYear","settingName","settingValue","sex","shaderSource","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","shadowRoot","shape","shape-image-threshold","shape-margin","shape-outside","shape-rendering","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","sheet","shift","shiftKey","shiftLeft","shippingAddress","shippingOption","shippingType","show","showHelp","showModal","showModalDialog","showModelessDialog","showNotification","sidebar","sign","signal","signalingState","signature","silent","sin","singleNodeValue","sinh","sinkId","sittingToStandingTransform","size","sizeToContent","sizeX","sizeZ","sizes","skewX","skewXSelf","skewY","skewYSelf","slice","slope","slot","small","smil","smooth","smoothingTimeConstant","snapToLines","snapshotItem","snapshotLength","some","sort","sortingCode","source","sourceBuffer","sourceBuffers","sourceCapabilities","sourceFile","sourceIndex","sources","spacing","span","speak","speakAs","speaking","species","specified","specularConstant","specularExponent","speechSynthesis","speed","speedOfSound","spellcheck","splice","split","splitText","spreadMethod","sqrt","src","srcElement","srcFilter","srcObject","srcUrn","srcdoc","srclang","srcset","stack","stackTraceLimit","stacktrace","stageParameters","standalone","standby","start","startContainer","startIce","startMessages","startNotifications","startOffset","startProfiling","startRendering","startShark","startTime","startsWith","state","status","statusCode","statusMessage","statusText","statusbar","stdDeviationX","stdDeviationY","stencilFunc","stencilFuncSeparate","stencilMask","stencilMaskSeparate","stencilOp","stencilOpSeparate","step","stepDown","stepMismatch","stepUp","sticky","stitchTiles","stop","stop-color","stop-opacity","stopColor","stopImmediatePropagation","stopNotifications","stopOpacity","stopProfiling","stopPropagation","stopShark","stopped","storage","storageArea","storageName","storageStatus","store","storeSiteSpecificTrackingException","storeWebWideTrackingException","stpVersion","stream","streams","stretch","strike","string","stringValue","stringify","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeRect","strokeStyle","strokeText","strokeWidth","style","styleFloat","styleMap","styleMedia","styleSheet","styleSheetSets","styleSheets","sub","subarray","subject","submit","submitFrame","submitter","subscribe","substr","substring","substringData","subtle","subtree","suffix","suffixes","summary","sup","supported","supportedContentEncodings","supportedEntryTypes","supports","supportsSession","surfaceScale","surroundContents","suspend","suspendRedraw","swapCache","swapNode","sweepFlag","symbols","sync","sysexEnabled","system","systemCode","systemId","systemLanguage","systemXDPI","systemYDPI","tBodies","tFoot","tHead","tabIndex","table","table-layout","tableLayout","tableValues","tag","tagName","tagUrn","tags","taintEnabled","takePhoto","takeRecords","tan","tangentialPressure","tanh","target","targetElement","targetRayMode","targetRaySpace","targetTouches","targetX","targetY","tcpType","tee","tel","terminate","test","texImage2D","texImage3D","texParameterf","texParameteri","texStorage2D","texStorage3D","texSubImage2D","texSubImage3D","text","text-align","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","textAlign","textAlignLast","textAnchor","textAutospace","textBaseline","textCombineUpright","textContent","textDecoration","textDecorationBlink","textDecorationColor","textDecorationLine","textDecorationLineThrough","textDecorationNone","textDecorationOverline","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textDecorationUnderline","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textJustify","textJustifyTrim","textKashida","textKashidaSpace","textLength","textOrientation","textOverflow","textRendering","textShadow","textTracks","textTransform","textUnderlineOffset","textUnderlinePosition","then","threadId","threshold","thresholds","tiltX","tiltY","time","timeEnd","timeLog","timeOrigin","timeRemaining","timeStamp","timecode","timeline","timelineTime","timeout","timestamp","timestampOffset","timing","title","to","toArray","toBlob","toDataURL","toDateString","toElement","toExponential","toFixed","toFloat32Array","toFloat64Array","toGMTString","toISOString","toJSON","toLocaleDateString","toLocaleFormat","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase","toMatrix","toMethod","toPrecision","toPrimitive","toSdp","toSource","toStaticHTML","toString","toStringTag","toSum","toTimeString","toUTCString","toUpperCase","toggle","toggleAttribute","toggleLongPressEnabled","tone","toneBuffer","tooLong","tooShort","toolbar","top","topMargin","total","totalFrameDelay","totalVideoFrames","touch-action","touchAction","touched","touches","trace","track","trackVisibility","transaction","transactions","transceiver","transferControlToOffscreen","transferFromImageBitmap","transferImageBitmap","transferIn","transferOut","transferSize","transferToImageBitmap","transform","transform-box","transform-origin","transform-style","transformBox","transformFeedbackVaryings","transformOrigin","transformPoint","transformString","transformStyle","transformToDocument","transformToFragment","transition","transition-delay","transition-duration","transition-property","transition-timing-function","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","translateSelf","translationX","translationY","transport","trim","trimEnd","trimLeft","trimRight","trimStart","trueSpeed","trunc","truncate","trustedTypes","turn","twist","type","typeDetail","typeMismatch","typeMustMatch","types","u2f","ubound","uint16","uint32","uint8","uint8Clamped","undefined","unescape","uneval","unicode","unicode-bidi","unicodeBidi","unicodeRange","uniform1f","uniform1fv","uniform1i","uniform1iv","uniform1ui","uniform1uiv","uniform2f","uniform2fv","uniform2i","uniform2iv","uniform2ui","uniform2uiv","uniform3f","uniform3fv","uniform3i","uniform3iv","uniform3ui","uniform3uiv","uniform4f","uniform4fv","uniform4i","uniform4iv","uniform4ui","uniform4uiv","uniformBlockBinding","uniformMatrix2fv","uniformMatrix2x3fv","uniformMatrix2x4fv","uniformMatrix3fv","uniformMatrix3x2fv","uniformMatrix3x4fv","uniformMatrix4fv","uniformMatrix4x2fv","uniformMatrix4x3fv","unique","uniqueID","uniqueNumber","unit","unitType","units","unloadEventEnd","unloadEventStart","unlock","unmount","unobserve","unpause","unpauseAnimations","unreadCount","unregister","unregisterContentHandler","unregisterProtocolHandler","unscopables","unselectable","unshift","unsubscribe","unsuspendRedraw","unsuspendRedrawAll","unwatch","unwrapKey","upDegrees","upX","upY","upZ","update","updateCommands","updateIce","updateInterval","updatePlaybackRate","updateRenderState","updateSettings","updateTiming","updateViaCache","updateWith","updated","updating","upgrade","upload","uploadTotal","uploaded","upper","upperBound","upperOpen","uri","url","urn","urns","usages","usb","usbVersionMajor","usbVersionMinor","usbVersionSubminor","useCurrentView","useMap","useProgram","usedSpace","user-select","userActivation","userAgent","userChoice","userHandle","userHint","userLanguage","userSelect","userVisibleOnly","username","usernameFragment","utterance","uuid","v8BreakIterator","vAlign","vLink","valid","validate","validateProgram","validationMessage","validity","value","valueAsDate","valueAsNumber","valueAsString","valueInSpecifiedUnits","valueMissing","valueOf","valueText","valueType","values","variable","variant","variationSettings","vector-effect","vectorEffect","velocityAngular","velocityExpansion","velocityX","velocityY","vendor","vendorId","vendorSub","verify","version","vertexAttrib1f","vertexAttrib1fv","vertexAttrib2f","vertexAttrib2fv","vertexAttrib3f","vertexAttrib3fv","vertexAttrib4f","vertexAttrib4fv","vertexAttribDivisor","vertexAttribDivisorANGLE","vertexAttribI4i","vertexAttribI4iv","vertexAttribI4ui","vertexAttribI4uiv","vertexAttribIPointer","vertexAttribPointer","vertical","vertical-align","verticalAlign","verticalOverflow","vh","vibrate","vibrationActuator","videoBitsPerSecond","videoHeight","videoTracks","videoWidth","view","viewBox","viewBoxString","viewTarget","viewTargetString","viewport","viewportAnchorX","viewportAnchorY","viewportElement","views","violatedDirective","visibility","visibilityState","visible","visualViewport","vlinkColor","vmax","vmin","voice","voiceURI","volume","vrml","vspace","vw","w","wait","waitSync","waiting","wake","wakeLock","wand","warn","wasClean","wasDiscarded","watch","watchAvailability","watchPosition","webdriver","webkitAddKey","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppearance","webkitAudioContext","webkitAudioDecodedByteCount","webkitAudioPannerNode","webkitBackfaceVisibility","webkitBackground","webkitBackgroundAttachment","webkitBackgroundClip","webkitBackgroundColor","webkitBackgroundImage","webkitBackgroundOrigin","webkitBackgroundPosition","webkitBackgroundPositionX","webkitBackgroundPositionY","webkitBackgroundRepeat","webkitBackgroundSize","webkitBackingStorePixelRatio","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderImage","webkitBorderImageOutset","webkitBorderImageRepeat","webkitBorderImageSlice","webkitBorderImageSource","webkitBorderImageWidth","webkitBorderRadius","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBoxAlign","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxShadow","webkitBoxSizing","webkitCancelAnimationFrame","webkitCancelFullScreen","webkitCancelKeyRequest","webkitCancelRequestAnimationFrame","webkitClearResourceTimings","webkitClosedCaptionsVisible","webkitConvertPointFromNodeToPage","webkitConvertPointFromPageToNode","webkitCreateShadowRoot","webkitCurrentFullScreenElement","webkitCurrentPlaybackTargetIsWireless","webkitDecodedFrameCount","webkitDirectionInvertedFromDevice","webkitDisplayingFullscreen","webkitDroppedFrameCount","webkitEnterFullScreen","webkitEnterFullscreen","webkitEntries","webkitExitFullScreen","webkitExitFullscreen","webkitExitPointerLock","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFullScreenKeyboardInputAllowed","webkitFullscreenElement","webkitFullscreenEnabled","webkitGenerateKeyRequest","webkitGetAsEntry","webkitGetDatabaseNames","webkitGetEntries","webkitGetEntriesByName","webkitGetEntriesByType","webkitGetFlowByName","webkitGetGamepads","webkitGetImageDataHD","webkitGetNamedFlows","webkitGetRegionFlowRanges","webkitGetUserMedia","webkitHasClosedCaptions","webkitHidden","webkitIDBCursor","webkitIDBDatabase","webkitIDBDatabaseError","webkitIDBDatabaseException","webkitIDBFactory","webkitIDBIndex","webkitIDBKeyRange","webkitIDBObjectStore","webkitIDBRequest","webkitIDBTransaction","webkitImageSmoothingEnabled","webkitIndexedDB","webkitInitMessageEvent","webkitIsFullScreen","webkitJustifyContent","webkitKeys","webkitLineClamp","webkitLineDashOffset","webkitLockOrientation","webkitMask","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMatchesSelector","webkitMediaStream","webkitNotifications","webkitOfflineAudioContext","webkitOrder","webkitOrientation","webkitPeerConnection00","webkitPersistentStorage","webkitPerspective","webkitPerspectiveOrigin","webkitPointerLockElement","webkitPostMessage","webkitPreservesPitch","webkitPutImageDataHD","webkitRTCPeerConnection","webkitRegionOverset","webkitRelativePath","webkitRequestAnimationFrame","webkitRequestFileSystem","webkitRequestFullScreen","webkitRequestFullscreen","webkitRequestPointerLock","webkitResolveLocalFileSystemURL","webkitSetMediaKeys","webkitSetResourceTimingBufferSize","webkitShadowRoot","webkitShowPlaybackTargetPicker","webkitSlice","webkitSpeechGrammar","webkitSpeechGrammarList","webkitSpeechRecognition","webkitSpeechRecognitionError","webkitSpeechRecognitionEvent","webkitStorageInfo","webkitSupportsFullscreen","webkitTemporaryStorage","webkitTextFillColor","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitURL","webkitUnlockOrientation","webkitUserSelect","webkitVideoDecodedByteCount","webkitVisibilityState","webkitWirelessVideoPlaybackDisabled","webkitdirectory","webkitdropzone","webstore","weight","whatToShow","wheelDelta","wheelDeltaX","wheelDeltaY","whenDefined","which","white-space","whiteSpace","wholeText","widows","width","will-change","willChange","willValidate","window","withCredentials","word-break","word-spacing","word-wrap","wordBreak","wordSpacing","wordWrap","workerStart","wrap","wrapKey","writable","writableAuxiliaries","write","writeText","writeValue","writeWithoutResponse","writeln","writing-mode","writingMode","x","x1","x2","xChannelSelector","xmlEncoding","xmlStandalone","xmlVersion","xmlbase","xmllang","xmlspace","xor","xr","y","y1","y2","yChannelSelector","yandex","z","z-index","zIndex","zoom","zoomAndPan","zoomRectScreen"];function find_builtins(e){domprops.forEach(o);var t={},n="object"==typeof global?global:self;function o(t){e.add(t);}["Symbol","Map","Promise","Proxy","Reflect","Set","WeakMap","WeakSet"].forEach((function(e){t[e]=n[e]||new Function;})),["null","true","false","NaN","Infinity","-Infinity","undefined"].forEach(o),[Object,Array,Function,Number,String,Boolean,Error,Math,Date,RegExp,t.Symbol,ArrayBuffer,DataView,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,eval,EvalError,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,isFinite,isNaN,JSON,t.Map,parseFloat,parseInt,t.Promise,t.Proxy,RangeError,ReferenceError,t.Reflect,t.Set,SyntaxError,TypeError,Uint8Array,Uint8ClampedArray,Uint16Array,Uint32Array,URIError,t.WeakMap,t.WeakSet].forEach((function(e){Object.getOwnPropertyNames(e).map(o),e.prototype&&Object.getOwnPropertyNames(e.prototype).map(o);}));}function reserve_quoted_keys(e,t){function n(e){push_uniq(t,e);}e.walk(new TreeWalker((function(e){e instanceof AST_ObjectKeyVal&&e.quote?n(e.key):e instanceof AST_ObjectProperty&&e.quote?n(e.key.name):e instanceof AST_Sub&&addStrings(e.property,n);})));}function addStrings(e,t){e.walk(new TreeWalker((function(e){return e instanceof AST_Sequence?addStrings(e.tail_node(),t):e instanceof AST_String?t(e.value):e instanceof AST_Conditional&&(addStrings(e.consequent,t),addStrings(e.alternative,t)),!0})));}function mangle_properties(e,t){var n=(t=defaults$1(t,{builtins:!1,cache:null,debug:!1,keep_quoted:!1,only_cache:!1,regex:null,reserved:null,undeclared:!1},!0)).reserved;Array.isArray(n)||(n=[n]);var o=new Set(n);t.builtins||find_builtins(o);var i,r=-1,a=-1,s=new Map;t.cache?(i=t.cache.props).forEach((function(e){o.add(e);})):i=new Map;var u,l=t.regex&&new RegExp(t.regex),_=!1!==t.debug;_&&(u=!0===t.debug?"":t.debug);var c=new Set,f=new Set,p=new Set,d="strict"===t.keep_quoted;return e.walk(new TreeWalker((function(e){if(e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod)p.add(e.key.name);else if(e instanceof AST_DotHash)p.add(e.property);else if(e instanceof AST_ObjectKeyVal)"string"!=typeof e.key||d&&e.quote||A(e.key);else if(e instanceof AST_ObjectProperty)d&&e.key.end.quote||A(e.key.name);else if(e instanceof AST_Dot){var n=!!t.undeclared;if(!n){for(var o=e;o.expression;)o=o.expression;n=!(o.thedef&&o.thedef.undeclared);}!n||d&&e.quote||A(e.property);}else e instanceof AST_Sub?d||addStrings(e.property,A):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?addStrings(e.args[1],A):e instanceof AST_Binary&&"in"===e.operator&&addStrings(e.left,A);}))),e.transform(new TreeTransformer((function(e){e instanceof AST_ClassPrivateProperty||e instanceof AST_PrivateMethod?e.key.name=h(e.key.name):e instanceof AST_DotHash?e.property=h(e.property):e instanceof AST_ObjectKeyVal?"string"!=typeof e.key||d&&e.quote||(e.key=T(e.key)):e instanceof AST_ObjectProperty?d&&e.key.end.quote||(e.key.name=T(e.key.name)):e instanceof AST_Dot?d&&e.quote||(e.property=T(e.property)):!t.keep_quoted&&e instanceof AST_Sub?e.property=E(e.property):e instanceof AST_Call&&"Object.defineProperty"==e.expression.print_to_string()?e.args[1]=E(e.args[1]):e instanceof AST_Binary&&"in"===e.operator&&(e.left=E(e.left));})));function S(e){return !f.has(e)&&!o.has(e)&&(t.only_cache?i.has(e):!/^-?[0-9]+(\.[0-9]+)?(e[+-][0-9]+)?$/.test(e))}function m(e){return !(l&&!l.test(e))&&!o.has(e)&&(i.has(e)||c.has(e))}function A(e){S(e)&&c.add(e),m(e)||f.add(e);}function T(e){if(!m(e))return e;var t=i.get(e);if(!t){if(_){var n="_$"+e+"$"+u+"_";S(n)&&(t=n);}if(!t)do{t=base54(++r);}while(!S(t));i.set(e,t);}return t}function h(e){let t=s.get(e);return t||(t=base54(++a),s.set(e,t)),t}function E(e){return e.transform(new TreeTransformer((function(e){if(e instanceof AST_Sequence){var t=e.expressions.length-1;e.expressions[t]=E(e.expressions[t]);}else e instanceof AST_String?e.value=T(e.value):e instanceof AST_Conditional&&(e.consequent=E(e.consequent),e.alternative=E(e.alternative));return e})))}}var to_ascii="undefined"==typeof atob?function(e){return Buffer.from(e,"base64").toString()}:atob,to_base64="undefined"==typeof btoa?function(e){return Buffer.from(e).toString("base64")}:btoa;function read_source_map(e){var t=/(?:^|[^.])\/\/# sourceMappingURL=data:application\/json(;[\w=-]*)?;base64,([+/0-9A-Za-z]*=*)\s*$/.exec(e);return t?to_ascii(t[2]):(console.warn("inline source map not found"),null)}function set_shorthand(e,t,n){t[e]&&n.forEach((function(n){t[n]&&("object"!=typeof t[n]&&(t[n]={}),e in t[n]||(t[n][e]=t[e]));}));}function init_cache(e){e&&("props"in e?e.props instanceof Map||(e.props=map_from_object(e.props)):e.props=new Map);}function cache_to_json(e){return {props:map_to_object(e.props)}}async function minify(e,t){var n,o,i=(t=defaults$1(t,{compress:{},ecma:void 0,enclose:!1,ie8:!1,keep_classnames:void 0,keep_fnames:!1,mangle:{},module:!1,nameCache:null,output:null,format:null,parse:{},rename:void 0,safari10:!1,sourceMap:!1,timings:!1,toplevel:!1,warnings:!1,wrap:!1},!0)).timings&&{start:Date.now()};if(void 0===t.keep_classnames&&(t.keep_classnames=t.keep_fnames),void 0===t.rename&&(t.rename=t.compress&&t.mangle),t.output&&t.format)throw new Error("Please only specify either output or format option, preferrably format.");if(t.format=t.format||t.output||{},set_shorthand("ecma",t,["parse","compress","format"]),set_shorthand("ie8",t,["compress","mangle","format"]),set_shorthand("keep_classnames",t,["compress","mangle"]),set_shorthand("keep_fnames",t,["compress","mangle"]),set_shorthand("module",t,["parse","compress","mangle"]),set_shorthand("safari10",t,["mangle","format"]),set_shorthand("toplevel",t,["compress","mangle"]),set_shorthand("warnings",t,["compress"]),t.mangle&&(t.mangle=defaults$1(t.mangle,{cache:t.nameCache&&(t.nameCache.vars||{}),eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,properties:!1,reserved:[],safari10:!1,toplevel:!1},!0),t.mangle.properties&&("object"!=typeof t.mangle.properties&&(t.mangle.properties={}),t.mangle.properties.keep_quoted&&(n=t.mangle.properties.reserved,Array.isArray(n)||(n=[]),t.mangle.properties.reserved=n),t.nameCache&&!("cache"in t.mangle.properties)&&(t.mangle.properties.cache=t.nameCache.props||{})),init_cache(t.mangle.cache),init_cache(t.mangle.properties.cache)),t.sourceMap&&(t.sourceMap=defaults$1(t.sourceMap,{asObject:!1,content:null,filename:null,includeSources:!1,root:null,url:null},!0)),i&&(i.parse=Date.now()),e instanceof AST_Toplevel)o=e;else {for(var r in "string"==typeof e&&(e=[e]),t.parse=t.parse||{},t.parse.toplevel=null,e)if(HOP(e,r)&&(t.parse.filename=r,t.parse.toplevel=parse$5(e[r],t.parse),t.sourceMap&&"inline"==t.sourceMap.content)){if(Object.keys(e).length>1)throw new Error("inline source map only works with singular input");t.sourceMap.content=read_source_map(e[r]);}o=t.parse.toplevel;}n&&"strict"!==t.mangle.properties.keep_quoted&&reserve_quoted_keys(o,n),t.wrap&&(o=o.wrap_commonjs(t.wrap)),t.enclose&&(o=o.wrap_enclose(t.enclose)),i&&(i.rename=Date.now()),i&&(i.compress=Date.now()),t.compress&&(o=new Compressor(t.compress,{mangle_options:t.mangle}).compress(o)),i&&(i.scope=Date.now()),t.mangle&&o.figure_out_scope(t.mangle),i&&(i.mangle=Date.now()),t.mangle&&(base54.reset(),o.compute_char_frequency(t.mangle),o.mangle_names(t.mangle)),i&&(i.properties=Date.now()),t.mangle&&t.mangle.properties&&(o=mangle_properties(o,t.mangle.properties)),i&&(i.format=Date.now());var a={};if(t.format.ast&&(a.ast=o),!HOP(t.format,"code")||t.format.code){if(t.sourceMap&&(t.format.source_map=await SourceMap$3({file:t.sourceMap.filename,orig:t.sourceMap.content,root:t.sourceMap.root}),t.sourceMap.includeSources)){if(e instanceof AST_Toplevel)throw new Error("original source content unavailable");for(var r in e)HOP(e,r)&&t.format.source_map.get().setSourceContent(r,e[r]);}delete t.format.ast,delete t.format.code;var s=OutputStream(t.format);if(o.print(s),a.code=s.get(),t.sourceMap)if(t.sourceMap.asObject?a.map=t.format.source_map.get().toJSON():a.map=t.format.source_map.toString(),"inline"==t.sourceMap.url){var u="object"==typeof a.map?JSON.stringify(a.map):a.map;a.code+="\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+to_base64(u);}else t.sourceMap.url&&(a.code+="\n//# sourceMappingURL="+t.sourceMap.url);}return t.nameCache&&t.mangle&&(t.mangle.cache&&(t.nameCache.vars=cache_to_json(t.mangle.cache)),t.mangle.properties&&t.mangle.properties.cache&&(t.nameCache.props=cache_to_json(t.mangle.properties.cache))),t.format&&t.format.source_map&&t.format.source_map.destroy(),i&&(i.end=Date.now(),a.timings={parse:.001*(i.rename-i.parse),rename:.001*(i.compress-i.rename),compress:.001*(i.scope-i.compress),scope:.001*(i.mangle-i.scope),mangle:.001*(i.properties-i.mangle),properties:.001*(i.format-i.properties),format:.001*(i.end-i.format),total:.001*(i.end-i.start)}),a}
- /**
- * Performs the minification of JavaScript source
- * @param input the JavaScript source to minify
- * @param opts the options used by the minifier
- * @returns the resulting minified JavaScript
- */
- const minifyJs = async (input, opts) => {
- const results = {
- output: input,
- sourceMap: null,
- diagnostics: [],
- };
- if (opts) {
- const mangle = opts.mangle;
- if (mangle) {
- const mangleProperties = mangle.properties;
- if (mangleProperties && mangleProperties.regex) {
- mangleProperties.regex = new RegExp(mangleProperties.regex);
- }
- }
- if (opts.sourceMap) {
- /**
- * sourceMap, when used in conjunction with compress, can lead to sourcemaps that don't in every browser. despite
- * there being a sourcemap spec, each browser has it's own tricks for trying to get sourcemaps to properly map
- * minified JS back to its original form. for the most consistent results across all browsers, explicitly disable
- * compress.
- */
- opts.compress = undefined;
- }
- }
- try {
- const minifyResults = await minify(input, opts);
- results.output = minifyResults.code;
- results.sourceMap = typeof minifyResults.map === 'string' ? JSON.parse(minifyResults.map) : minifyResults.map;
- const compress = opts.compress;
- if (compress && compress.module && results.output.endsWith('};')) {
- // stripping the semicolon here _shouldn't_ be of significant consequence for the already generated sourcemap
- results.output = results.output.substring(0, results.output.length - 1);
- }
- }
- catch (e) {
- if (e instanceof Error) {
- console.log(e.stack);
- }
- loadMinifyJsDiagnostics(input, results.diagnostics, e);
- }
- return results;
- };
- const loadMinifyJsDiagnostics = (sourceText, diagnostics, error) => {
- const d = {
- level: 'error',
- type: 'build',
- language: 'javascript',
- header: 'Minify JS',
- code: '',
- messageText: error.message,
- absFilePath: null,
- relFilePath: null,
- lines: [],
- };
- const err = error;
- if (typeof err.line === 'number' && err.line > -1) {
- const srcLines = splitLineBreaks(sourceText);
- const errorLine = {
- lineIndex: err.line - 1,
- lineNumber: err.line,
- text: srcLines[err.line - 1],
- errorCharStart: err.col,
- errorLength: 0,
- };
- d.lineNumber = errorLine.lineNumber;
- d.columnNumber = errorLine.errorCharStart;
- const highlightLine = errorLine.text.slice(d.columnNumber);
- for (let i = 0; i < highlightLine.length; i++) {
- if (MINIFY_CHAR_BREAK.has(highlightLine.charAt(i))) {
- break;
- }
- errorLine.errorLength++;
- }
- d.lines.push(errorLine);
- if (errorLine.errorLength === 0 && errorLine.errorCharStart > 0) {
- errorLine.errorLength = 1;
- errorLine.errorCharStart--;
- }
- if (errorLine.lineIndex > 0) {
- const previousLine = {
- lineIndex: errorLine.lineIndex - 1,
- lineNumber: errorLine.lineNumber - 1,
- text: srcLines[errorLine.lineIndex - 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.unshift(previousLine);
- }
- if (errorLine.lineIndex + 1 < srcLines.length) {
- const nextLine = {
- lineIndex: errorLine.lineIndex + 1,
- lineNumber: errorLine.lineNumber + 1,
- text: srcLines[errorLine.lineIndex + 1],
- errorCharStart: -1,
- errorLength: -1,
- };
- d.lines.push(nextLine);
- }
- }
- diagnostics.push(d);
- };
- const MINIFY_CHAR_BREAK = new Set([
- ' ',
- '=',
- '.',
- ',',
- '?',
- ':',
- ';',
- '(',
- ')',
- '{',
- '}',
- '[',
- ']',
- '|',
- `'`,
- `"`,
- '`',
- ]);
- var SourceMapConsumer = sourceMap.SourceMapConsumer;
- var SourceMapGenerator = sourceMap.SourceMapGenerator;
- var mergeSourceMap = merge;
- /**
- * Merge old source map and new source map and return merged.
- * If old or new source map value is falsy, return another one as it is.
- *
- * @param {object|string} [oldMap] old source map object
- * @param {object|string} [newmap] new source map object
- * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined
- */
- function merge(oldMap, newMap) {
- if (!oldMap) return newMap
- if (!newMap) return oldMap
- var oldMapConsumer = new SourceMapConsumer(oldMap);
- var newMapConsumer = new SourceMapConsumer(newMap);
- var mergedMapGenerator = new SourceMapGenerator();
- // iterate on new map and overwrite original position of new map with one of old map
- newMapConsumer.eachMapping(function(m) {
- // pass when `originalLine` is null.
- // It occurs in case that the node does not have origin in original code.
- if (m.originalLine == null) return
- var origPosInOldMap = oldMapConsumer.originalPositionFor({
- line: m.originalLine,
- column: m.originalColumn
- });
- if (origPosInOldMap.source == null) return
- mergedMapGenerator.addMapping({
- original: {
- line: origPosInOldMap.line,
- column: origPosInOldMap.column
- },
- generated: {
- line: m.generatedLine,
- column: m.generatedColumn
- },
- source: origPosInOldMap.source,
- name: origPosInOldMap.name
- });
- });
- var consumers = [oldMapConsumer, newMapConsumer];
- consumers.forEach(function(consumer) {
- consumer.sources.forEach(function(sourceFile) {
- mergedMapGenerator._sources.add(sourceFile);
- var sourceContent = consumer.sourceContentFor(sourceFile);
- if (sourceContent != null) {
- mergedMapGenerator.setSourceContent(sourceFile, sourceContent);
- }
- });
- });
- mergedMapGenerator._sourceRoot = oldMap.sourceRoot;
- mergedMapGenerator._file = oldMap.file;
- return JSON.parse(mergedMapGenerator.toString())
- }
- process.browser=!IS_NODE_ENV;const t={};var r,n$3=undefined&&undefined.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},i$1=undefined&&undefined.__assign||function(){return (i$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=undefined&&undefined.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},o=undefined&&undefined.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o);}catch(e){a=[6,e],n=0;}finally{r=i=0;}if(5&a[0])throw a[1];return {value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},s=undefined&&undefined.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);}return r},c=undefined&&undefined.__extends||(r=function(e,t){return (r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e;}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n);});!function(e){function t(){var e={};return e.prev=e,{head:e,tail:e,size:0}}function r(e,t){return e===t||e!=e&&t!=t}function n(e){var t=e.prev;if(!t||t===e)throw new Error("Illegal state");return t}function i(e){for(;e;){var t=!e.prev;if(e=e.next,!t)return e}}function a(e,t){for(var i=e.tail;i!==e.head;i=n(i))if(r(i.key,t))return i}function o(e,t,r){var n=a(e,t);if(!n){var i=function(e,t){return {key:e,value:t,next:void 0,prev:void 0}}(t,r);return i.prev=e.tail,e.tail.next=i,e.tail=i,e.size++,i}n.value=r;}function s(e,t){for(var i=e.tail;i!==e.head;i=n(i)){if(void 0===i.prev)throw new Error("Illegal state");if(r(i.key,t)){if(i.next)i.next.prev=i.prev;else {if(e.tail!==i)throw new Error("Illegal state");e.tail=i.prev;}return i.prev.next=i.next,i.next=i.prev,i.prev=void 0,e.size--,i}}}function c(e){for(var t=e.tail;t!==e.head;){var r=n(t);t.next=e.head,t.prev=void 0,t=r;}e.head.next=void 0,e.tail=e.head,e.size=0;}function l(e,t){for(var r=e.head;r;)(r=i(r))&&t(r.value,r.key);}function u(e,t){if(e)for(var r=e.next();!r.done;r=e.next())t(r.value);}function _(e,t){return {current:e.head,selector:t}}function d(e){return e.current=i(e.current),e.current?{value:e.selector(e.current.key,e.current.value),done:!1}:{value:void 0,done:!0}}var p;(p=e.ShimCollections||(e.ShimCollections={})).createMapShim=function(e){var r=function(){function e(e,t){this._data=_(e,t);}return e.prototype.next=function(){return d(this._data)},e}();return function(){function n(r){var n=this;this._mapData=t(),u(e(r),(function(e){var t=e[0],r=e[1];return n.set(t,r)}));}return Object.defineProperty(n.prototype,"size",{get:function(){return this._mapData.size},enumerable:!1,configurable:!0}),n.prototype.get=function(e){var t;return null===(t=a(this._mapData,e))||void 0===t?void 0:t.value},n.prototype.set=function(e,t){return o(this._mapData,e,t),this},n.prototype.has=function(e){return !!a(this._mapData,e)},n.prototype.delete=function(e){return !!s(this._mapData,e)},n.prototype.clear=function(){c(this._mapData);},n.prototype.keys=function(){return new r(this._mapData,(function(e,t){return e}))},n.prototype.values=function(){return new r(this._mapData,(function(e,t){return t}))},n.prototype.entries=function(){return new r(this._mapData,(function(e,t){return [e,t]}))},n.prototype.forEach=function(e){l(this._mapData,e);},n}()},p.createSetShim=function(e){var r=function(){function e(e,t){this._data=_(e,t);}return e.prototype.next=function(){return d(this._data)},e}();return function(){function n(r){var n=this;this._mapData=t(),u(e(r),(function(e){return n.add(e)}));}return Object.defineProperty(n.prototype,"size",{get:function(){return this._mapData.size},enumerable:!1,configurable:!0}),n.prototype.add=function(e){return o(this._mapData,e,e),this},n.prototype.has=function(e){return !!a(this._mapData,e)},n.prototype.delete=function(e){return !!s(this._mapData,e)},n.prototype.clear=function(){c(this._mapData);},n.prototype.keys=function(){return new r(this._mapData,(function(e,t){return e}))},n.prototype.values=function(){return new r(this._mapData,(function(e,t){return t}))},n.prototype.entries=function(){return new r(this._mapData,(function(e,t){return [e,t]}))},n.prototype.forEach=function(e){l(this._mapData,e);},n}()};}(t),function(e){var t,r;function n(r,n,i){var a,o=null!==(a=t[n]())&&void 0!==a?a:null===e.ShimCollections||void 0===e.ShimCollections?void 0:e.ShimCollections[i](e.getIterator);if(o)return o;throw new Error("TypeScript requires an environment that provides a compatible native ".concat(r," implementation."))}e.versionMajorMinor="4.5",e.version="4.5.4",(r=e.Comparison||(e.Comparison={}))[r.LessThan=-1]="LessThan",r[r.EqualTo=0]="EqualTo",r[r.GreaterThan=1]="GreaterThan",function(e){e.tryGetNativeMap=function(){return "undefined"!=typeof Map&&"entries"in Map.prototype&&1===new Map([[0,0]]).size?Map:void 0},e.tryGetNativeSet=function(){return "undefined"!=typeof Set&&"entries"in Set.prototype&&1===new Set([0]).size?Set:void 0};}(t||(t={})),e.Map=n("Map","tryGetNativeMap","createMapShim"),e.Set=n("Set","tryGetNativeSet","createSetShim");}(t),function(e){function t(e,t,r){if(void 0===r&&(r=I),e)for(var n=0,i=e;n<i.length;n++)if(r(i[n],t))return !0;return !1}function r(e,t){if(e){if(!t)return e.length>0;for(var r=0,n=e;r<n.length;r++)if(t(n[r]))return !0}return !1}function i(e,t){return r(t)?r(e)?n$3(n$3([],e,!0),t,!0):t:e}function a(e,t){return t}function o(e){return e.map(a)}function s(e,t){return void 0===t?e:void 0===e?[t]:(e.push(t),e)}function c(e,t){return t<0?e.length+t:t}function l(e,t,r,n){if(void 0===t||0===t.length)return e;if(void 0===e)return t.slice(r,n);r=void 0===r?0:c(t,r),n=void 0===n?t.length:c(t,n);for(var i=r;i<n&&i<t.length;i++)void 0!==t[i]&&e.push(t[i]);return e}function u(e,r,n){return !t(e,r,n)&&(e.push(r),!0)}function _(e,t,r){t.sort((function(t,n){return r(e[t],e[n])||M(t,n)}));}function d(e,t){return 0===e.length?e:e.slice().sort(t)}function p(e){var t=0;return {next:function(){return t===e.length?{value:void 0,done:!0}:(t++,{value:e[t-1],done:!1})}}}function f(e,t,r,n,i){return g(e,r(t),r,n,i)}function g(e,t,n,i,a){if(!r(e))return -1;for(var o=a||0,s=e.length-1;o<=s;){var c=o+(s-o>>1);switch(i(n(e[c],c),t)){case-1:o=c+1;break;case 0:return c;case 1:s=c-1;}}return ~o}function m(e,t,r,n,i){if(e&&e.length>0){var a=e.length;if(a>0){var o=void 0===n||n<0?0:n,s=void 0===i||o+i>a-1?a-1:o+i,c=void 0;for(arguments.length<=2?(c=e[o],o++):c=r;o<=s;)c=t(c,e[o],o),o++;return c}}return r}e.getIterator=function(t){if(t){if(E(t))return p(t);if(t instanceof e.Map)return t.entries();if(t instanceof e.Set)return t.values();throw new Error("Iteration not supported.")}},e.emptyArray=[],e.emptyMap=new e.Map,e.emptySet=new e.Set,e.createMap=function(){return new e.Map},e.createMapFromTemplate=function(t){var r=new e.Map;for(var n in t)y.call(t,n)&&r.set(n,t[n]);return r},e.length=function(e){return e?e.length:0},e.forEach=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(n)return n}},e.forEachRight=function(e,t){if(e)for(var r=e.length-1;r>=0;r--){var n=t(e[r],r);if(n)return n}},e.firstDefined=function(e,t){if(void 0!==e)for(var r=0;r<e.length;r++){var n=t(e[r],r);if(void 0!==n)return n}},e.firstDefinedIterator=function(e,t){for(;;){var r=e.next();if(r.done)return;var n=t(r.value);if(void 0!==n)return n}},e.reduceLeftIterator=function(e,t,r){var n=r;if(e)for(var i=e.next(),a=0;!i.done;i=e.next(),a++)n=t(n,i.value,a);return n},e.zipWith=function(t,r,n){var i=[];e.Debug.assertEqual(t.length,r.length);for(var a=0;a<t.length;a++)i.push(n(t[a],r[a],a));return i},e.zipToIterator=function(t,r){e.Debug.assertEqual(t.length,r.length);var n=0;return {next:function(){return n===t.length?{value:void 0,done:!0}:(n++,{value:[t[n-1],r[n-1]],done:!1})}}},e.zipToMap=function(t,r){e.Debug.assert(t.length===r.length);for(var n=new e.Map,i=0;i<t.length;++i)n.set(t[i],r[i]);return n},e.intersperse=function(e,t){if(e.length<=1)return e;for(var r=[],n=0,i=e.length;n<i;n++)n&&r.push(t),r.push(e[n]);return r},e.every=function(e,t){if(e)for(var r=0;r<e.length;r++)if(!t(e[r],r))return !1;return !0},e.find=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n,r))return n}},e.findLast=function(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if(t(n,r))return n}},e.findIndex=function(e,t,r){for(var n=r||0;n<e.length;n++)if(t(e[n],n))return n;return -1},e.findLastIndex=function(e,t,r){for(var n=void 0===r?e.length-1:r;n>=0;n--)if(t(e[n],n))return n;return -1},e.findMap=function(t,r){for(var n=0;n<t.length;n++){var i=r(t[n],n);if(i)return i}return e.Debug.fail()},e.contains=t,e.arraysEqual=function(e,t,r){return void 0===r&&(r=I),e.length===t.length&&e.every((function(e,n){return r(e,t[n])}))},e.indexOfAnyCharCode=function(e,r,n){for(var i=n||0;i<e.length;i++)if(t(r,e.charCodeAt(i)))return i;return -1},e.countWhere=function(e,t){var r=0;if(e)for(var n=0;n<e.length;n++)t(e[n],n)&&r++;return r},e.filter=function(e,t){if(e){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;if(n<r){var i=e.slice(0,n);for(n++;n<r;){var a=e[n];t(a)&&i.push(a),n++;}return i}}return e},e.filterMutate=function(e,t){for(var r=0,n=0;n<e.length;n++)t(e[n],n,e)&&(e[r]=e[n],r++);e.length=r;},e.clear=function(e){e.length=0;},e.map=function(e,t){var r;if(e){r=[];for(var n=0;n<e.length;n++)r.push(t(e[n],n));}return r},e.mapIterator=function(e,t){return {next:function(){var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}},e.sameMap=function(e,t){if(e)for(var r=0;r<e.length;r++){var n=e[r],i=t(n,r);if(n!==i){var a=e.slice(0,r);for(a.push(i),r++;r<e.length;r++)a.push(t(e[r],r));return a}}return e},e.flatten=function(e){for(var t=[],r=0,n=e;r<n.length;r++){var i=n[r];i&&(E(i)?l(t,i):t.push(i));}return t},e.flatMap=function(t,r){var n;if(t)for(var i=0;i<t.length;i++){var a=r(t[i],i);a&&(n=E(a)?l(n,a):s(n,a));}return n||e.emptyArray},e.flatMapToMutable=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);i&&(E(i)?l(r,i):r.push(i));}return r},e.flatMapIterator=function(t,r){var n=t.next();if(n.done)return e.emptyIterator;var i=a(n.value);return {next:function(){for(;;){var e=i.next();if(!e.done)return e;var r=t.next();if(r.done)return r;i=a(r.value);}}};function a(t){var n=r(t);return void 0===n?e.emptyIterator:E(n)?p(n):n}},e.sameFlatMap=function(e,t){var r;if(e)for(var n=0;n<e.length;n++){var i=e[n],a=t(i,n);(r||i!==a||E(a))&&(r||(r=e.slice(0,n)),E(a)?l(r,a):r.push(a));}return r||e},e.mapAllOrFail=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=t(e[n],n);if(void 0===i)return;r.push(i);}return r},e.mapDefined=function(e,t){var r=[];if(e)for(var n=0;n<e.length;n++){var i=t(e[n],n);void 0!==i&&r.push(i);}return r},e.mapDefinedIterator=function(e,t){return {next:function(){for(;;){var r=e.next();if(r.done)return r;var n=t(r.value);if(void 0!==n)return {value:n,done:!1}}}}},e.mapDefinedEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e);if(void 0!==i){var a=i[0],o=i[1];void 0!==a&&void 0!==o&&n.set(a,o);}})),n}},e.mapDefinedValues=function(t,r){if(t){var n=new e.Set;return t.forEach((function(e){var t=r(e);void 0!==t&&n.add(t);})),n}},e.getOrUpdate=function(e,t,r){if(e.has(t))return e.get(t);var n=r();return e.set(t,n),n},e.tryAddToSet=function(e,t){return !e.has(t)&&(e.add(t),!0)},e.emptyIterator={next:function(){return {value:void 0,done:!0}}},e.singleIterator=function(e){var t=!1;return {next:function(){var r=t;return t=!0,r?{value:void 0,done:!0}:{value:e,done:!1}}}},e.spanMap=function(e,t,r){var n;if(e){n=[];for(var i=e.length,a=void 0,o=void 0,s=0,c=0;s<i;){for(;c<i;){if(o=t(e[c],c),0===c)a=o;else if(o!==a)break;c++;}if(s<c){var l=r(e.slice(s,c),a,s,c);l&&n.push(l),s=c;}a=o,c++;}}return n},e.mapEntries=function(t,r){if(t){var n=new e.Map;return t.forEach((function(e,t){var i=r(t,e),a=i[0],o=i[1];n.set(a,o);})),n}},e.some=r,e.getRangesWhere=function(e,t,r){for(var n,i=0;i<e.length;i++)t(e[i])?n=void 0===n?i:n:void 0!==n&&(r(n,i),n=void 0);void 0!==n&&r(n,e.length);},e.concatenate=i,e.indicesOf=o,e.deduplicate=function(e,t,r){return 0===e.length?[]:1===e.length?e.slice():r?function(e,t,r){var n=o(e);_(e,n,r);for(var i=e[n[0]],a=[n[0]],s=1;s<n.length;s++){var c=n[s],l=e[c];t(i,l)||(a.push(c),i=l);}return a.sort(),a.map((function(t){return e[t]}))}(e,t,r):function(e,t){for(var r=[],n=0,i=e;n<i.length;n++)u(r,i[n],t);return r}(e,t)},e.insertSorted=function(e,t,r){if(0!==e.length){var n=f(e,t,N,r);n<0&&e.splice(~n,0,t);}else e.push(t);},e.sortAndDeduplicate=function(t,r,n){return function(t,r){if(0===t.length)return e.emptyArray;for(var n=t[0],i=[n],a=1;a<t.length;a++){var o=t[a];switch(r(o,n)){case!0:case 0:continue;case-1:return e.Debug.fail("Array is unsorted.")}i.push(n=o);}return i}(d(t,r),n||r||R)},e.arrayIsSorted=function(e,t){if(e.length<2)return !0;for(var r=e[0],n=0,i=e.slice(1);n<i.length;n++){var a=i[n];if(1===t(r,a))return !1;r=a;}return !0},e.arrayIsEqualTo=function(e,t,r){if(void 0===r&&(r=I),!e||!t)return e===t;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!r(e[n],t[n],n))return !1;return !0},e.compact=function(e){var t;if(e)for(var r=0;r<e.length;r++){var n=e[r];!t&&n||(t||(t=e.slice(0,r)),n&&t.push(n));}return t||e},e.relativeComplement=function(t,r,n){if(!r||!t||0===r.length||0===t.length)return r;var i=[];e:for(var a=0,o=0;o<r.length;o++){o>0&&e.Debug.assertGreaterThanOrEqual(n(r[o],r[o-1]),0);t:for(var s=a;a<t.length;a++)switch(a>s&&e.Debug.assertGreaterThanOrEqual(n(t[a],t[a-1]),0),n(r[o],t[a])){case-1:i.push(r[o]);continue e;case 0:continue e;case 1:continue t}}return i},e.sum=function(e,t){for(var r=0,n=0,i=e;n<i.length;n++)r+=i[n][t];return r},e.append=s,e.combine=function(e,t){return void 0===e?t:void 0===t?e:E(e)?E(t)?i(e,t):s(e,t):E(t)?s(t,e):[e,t]},e.addRange=l,e.pushIfUnique=u,e.appendIfUnique=function(e,t,r){return e?(u(e,t,r),e):[t]},e.sort=d,e.arrayIterator=p,e.arrayReverseIterator=function(e){var t=e.length;return {next:function(){return 0===t?{value:void 0,done:!0}:(t--,{value:e[t],done:!1})}}},e.stableSort=function(e,t){var r=o(e);return _(e,r,t),r.map((function(t){return e[t]}))},e.rangeEquals=function(e,t,r,n){for(;r<n;){if(e[r]!==t[r])return !1;r++;}return !0},e.elementAt=function(e,t){if(e&&(t=c(e,t))<e.length)return e[t]},e.firstOrUndefined=function(e){return 0===e.length?void 0:e[0]},e.first=function(t){return e.Debug.assert(0!==t.length),t[0]},e.lastOrUndefined=function(e){return 0===e.length?void 0:e[e.length-1]},e.last=function(t){return e.Debug.assert(0!==t.length),t[t.length-1]},e.singleOrUndefined=function(e){return e&&1===e.length?e[0]:void 0},e.singleOrMany=function(e){return e&&1===e.length?e[0]:e},e.replaceElement=function(e,t,r){var n=e.slice(0);return n[t]=r,n},e.binarySearch=f,e.binarySearchKey=g,e.reduceLeft=m;var y=Object.prototype.hasOwnProperty;function v(e,t){return y.call(e,t)}function h(e){var t=[];for(var r in e)y.call(e,r)&&t.push(r);return t}e.hasProperty=v,e.getProperty=function(e,t){return y.call(e,t)?e[t]:void 0},e.getOwnKeys=h,e.getAllKeys=function(e){var t=[];do{for(var r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++)u(t,n[r]);}while(e=Object.getPrototypeOf(e));return t},e.getOwnValues=function(e){var t=[];for(var r in e)y.call(e,r)&&t.push(e[r]);return t};var b=Object.entries||function(e){for(var t=h(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=[t[n],e[t[n]]];return r};function x(e,t){for(var r=[],n=e.next();!n.done;n=e.next())r.push(t?t(n.value):n.value);return r}function D(e,t,r){void 0===r&&(r=N);for(var n=S(),i=0,a=e;i<a.length;i++){var o=a[i];n.add(t(o),r(o));}return n}function S(){var t=new e.Map;return t.add=T,t.remove=C,t}function T(e,t){var r=this.get(e);return r?r.push(t):this.set(e,r=[t]),r}function C(e,t){var r=this.get(e);r&&(q(r,t),r.length||this.delete(e));}function E(e){return Array.isArray?Array.isArray(e):e instanceof Array}function k(e){}function N(e){return e}function F(e){return e.toLowerCase()}e.getEntries=function(e){return e?b(e):[]},e.arrayOf=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.arrayFrom=x,e.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0,i=t;n<i.length;n++){var a=i[n];if(void 0!==a)for(var o in a)v(a,o)&&(e[o]=a[o]);}return e},e.equalOwnProperties=function(e,t,r){if(void 0===r&&(r=I),e===t)return !0;if(!e||!t)return !1;for(var n in e)if(y.call(e,n)){if(!y.call(t,n))return !1;if(!r(e[n],t[n]))return !1}for(var n in t)if(y.call(t,n)&&!y.call(e,n))return !1;return !0},e.arrayToMap=function(t,r,n){void 0===n&&(n=N);for(var i=new e.Map,a=0,o=t;a<o.length;a++){var s=o[a],c=r(s);void 0!==c&&i.set(c,n(s));}return i},e.arrayToNumericMap=function(e,t,r){void 0===r&&(r=N);for(var n=[],i=0,a=e;i<a.length;i++){var o=a[i];n[t(o)]=r(o);}return n},e.arrayToMultiMap=D,e.group=function(e,t,r){return void 0===r&&(r=N),x(D(e,t).values(),r)},e.clone=function(e){var t={};for(var r in e)y.call(e,r)&&(t[r]=e[r]);return t},e.extend=function(e,t){var r={};for(var n in t)y.call(t,n)&&(r[n]=t[n]);for(var n in e)y.call(e,n)&&(r[n]=e[n]);return r},e.copyProperties=function(e,t){for(var r in t)y.call(t,r)&&(e[r]=t[r]);},e.maybeBind=function(e,t){return t?t.bind(e):void 0},e.createMultiMap=S,e.createUnderscoreEscapedMultiMap=function(){return S()},e.isArray=E,e.toArray=function(e){return E(e)?e:[e]},e.isString=function(e){return "string"==typeof e},e.isNumber=function(e){return "number"==typeof e},e.tryCast=function(e,t){return void 0!==e&&t(e)?e:void 0},e.cast=function(t,r){return void 0!==t&&r(t)?t:e.Debug.fail("Invalid cast. The supplied value ".concat(t," did not pass the test '").concat(e.Debug.getFunctionName(r),"'."))},e.noop=k,e.returnFalse=function(){return !1},e.returnTrue=function(){return !0},e.returnUndefined=function(){},e.identity=N,e.toLowerCase=F;var A,P=/[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g;function w(e){return P.test(e)?e.replace(P,F):e}function I(e,t){return e===t}function O(e,t){return e===t?0:void 0===e?-1:void 0===t?1:e<t?-1:1}function M(e,t){return O(e,t)}function L(e,t){return e===t?0:void 0===e?-1:void 0===t?1:(e=e.toUpperCase())<(t=t.toUpperCase())?-1:e>t?1:0}function R(e,t){return O(e,t)}e.toFileNameLowerCase=w,e.notImplemented=function(){throw new Error("Not implemented")},e.memoize=function(e){var t;return function(){return e&&(t=e(),e=void 0),t}},e.memoizeOne=function(t){var r=new e.Map;return function(e){var n="".concat(typeof e,":").concat(e),i=r.get(n);return void 0!==i||r.has(n)||(i=t(e),r.set(n,i)),i}},e.compose=function(e,t,r,n,i){if(i){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return function(e){return m(a,(function(e,t){return t(e)}),e)}}return n?function(i){return n(r(t(e(i))))}:r?function(n){return r(t(e(n)))}:t?function(r){return t(e(r))}:e?function(t){return e(t)}:function(e){return e}},(A=e.AssertionLevel||(e.AssertionLevel={}))[A.None=0]="None",A[A.Normal=1]="Normal",A[A.Aggressive=2]="Aggressive",A[A.VeryAggressive=3]="VeryAggressive",e.equateValues=I,e.equateStringsCaseInsensitive=function(e,t){return e===t||void 0!==e&&void 0!==t&&e.toUpperCase()===t.toUpperCase()},e.equateStringsCaseSensitive=function(e,t){return I(e,t)},e.compareValues=M,e.compareTextSpans=function(e,t){return M(null==e?void 0:e.start,null==t?void 0:t.start)||M(null==e?void 0:e.length,null==t?void 0:t.length)},e.min=function(e,t,r){return -1===r(e,t)?e:t},e.compareStringsCaseInsensitive=L,e.compareStringsCaseSensitive=R,e.getStringComparer=function(e){return e?L:R};var B,j,J=function(){var e,t,r="object"==typeof Intl&&"function"==typeof Intl.Collator?i:"function"==typeof String.prototype.localeCompare&&"function"==typeof String.prototype.toLocaleUpperCase&&"a".localeCompare("B")<0?a:o;return function(n){return void 0===n?e||(e=r(n)):"en-US"===n?t||(t=r(n)):r(n)};function n(e,t,r){if(e===t)return 0;if(void 0===e)return -1;if(void 0===t)return 1;var n=r(e,t);return n<0?-1:n>0?1:0}function i(e){var t=new Intl.Collator(e,{usage:"sort",sensitivity:"variant"}).compare;return function(e,r){return n(e,r,t)}}function a(e){return void 0!==e?o():function(e,r){return n(e,r,t)};function t(e,t){return e.localeCompare(t)}}function o(){return function(t,r){return n(t,r,e)};function e(e,r){return t(e.toUpperCase(),r.toUpperCase())||t(e,r)}function t(e,t){return e<t?-1:e>t?1:0}}}();function z(e,t,r){for(var n=new Array(t.length+1),i=new Array(t.length+1),a=r+.01,o=0;o<=t.length;o++)n[o]=o;for(o=1;o<=e.length;o++){var s=e.charCodeAt(o-1),c=Math.ceil(o>r?o-r:1),l=Math.floor(t.length>r+o?r+o:t.length);i[0]=o;for(var u=o,_=1;_<c;_++)i[_]=a;for(_=c;_<=l;_++){var d=e[o-1].toLowerCase()===t[_-1].toLowerCase()?n[_-1]+.1:n[_-1]+2,p=s===t.charCodeAt(_-1)?n[_-1]:Math.min(n[_]+1,i[_-1]+1,d);i[_]=p,u=Math.min(u,p);}for(_=l+1;_<=t.length;_++)i[_]=a;if(u>r)return;var f=n;n=i,i=f;}var g=n[t.length];return g>r?void 0:g}function U(e,t){var r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function K(e,t){for(var r=t;r<e.length-1;r++)e[r]=e[r+1];e.pop();}function V(e,t){e[t]=e[e.length-1],e.pop();}function q(e,t){return function(e,r){for(var n=0;n<e.length;n++)if(e[n]===t)return V(e,n),!0;return !1}(e)}function W(e,t){return 0===e.lastIndexOf(t,0)}function H(e,t){var r=e.prefix,n=e.suffix;return t.length>=r.length+n.length&&W(t,r)&&U(t,n)}function G(e,t,r,n){for(var i=0,a=e[n];i<a.length;i++){var o=a[i],s=void 0;r?(s=r.slice()).push(o):s=[o],n===e.length-1?t.push(s):G(e,t,s,n+1);}}e.getUILocale=function(){return j},e.setUILocale=function(e){j!==e&&(j=e,B=void 0);},e.compareStringsCaseSensitiveUI=function(e,t){return (B||(B=J(j)))(e,t)},e.compareProperties=function(e,t,r,n){return e===t?0:void 0===e?-1:void 0===t?1:n(e[r],t[r])},e.compareBooleans=function(e,t){return M(e?1:0,t?1:0)},e.getSpellingSuggestion=function(t,r,n){for(var i,a=Math.min(2,Math.floor(.34*t.length)),o=Math.floor(.4*t.length)+1,s=0,c=r;s<c.length;s++){var l=c[s],u=n(l);if(void 0!==u&&Math.abs(u.length-t.length)<=a){if(u===t)continue;if(u.length<3&&u.toLowerCase()!==t.toLowerCase())continue;var _=z(t,u,o-.1);if(void 0===_)continue;e.Debug.assert(_<o),o=_,i=l;}}return i},e.endsWith=U,e.removeSuffix=function(e,t){return U(e,t)?e.slice(0,e.length-t.length):e},e.tryRemoveSuffix=function(e,t){return U(e,t)?e.slice(0,e.length-t.length):void 0},e.stringContains=function(e,t){return -1!==e.indexOf(t)},e.removeMinAndVersionNumbers=function(e){for(var t=e.length,r=t-1;r>0;r--){var n=e.charCodeAt(r);if(n>=48&&n<=57)do{--r,n=e.charCodeAt(r);}while(r>0&&n>=48&&n<=57);else {if(!(r>4)||110!==n&&78!==n)break;if(--r,105!==(n=e.charCodeAt(r))&&73!==n)break;if(--r,109!==(n=e.charCodeAt(r))&&77!==n)break;--r,n=e.charCodeAt(r);}if(45!==n&&46!==n)break;t=r;}return t===e.length?e:e.slice(0,t)},e.orderedRemoveItem=function(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return K(e,r),!0;return !1},e.orderedRemoveItemAt=K,e.unorderedRemoveItemAt=V,e.unorderedRemoveItem=q,e.createGetCanonicalFileName=function(e){return e?N:w},e.patternText=function(e){var t=e.prefix,r=e.suffix;return "".concat(t,"*").concat(r)},e.matchedText=function(t,r){return e.Debug.assert(H(t,r)),r.substring(t.prefix.length,r.length-t.suffix.length)},e.findBestPatternMatch=function(e,t,r){for(var n,i=-1,a=0,o=e;a<o.length;a++){var s=o[a],c=t(s);H(c,r)&&c.prefix.length>i&&(i=c.prefix.length,n=s);}return n},e.startsWith=W,e.removePrefix=function(e,t){return W(e,t)?e.substr(t.length):e},e.tryRemovePrefix=function(e,t,r){return void 0===r&&(r=N),W(r(e),r(t))?e.substring(t.length):void 0},e.and=function(e,t){return function(r){return e(r)&&t(r)}},e.or=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];for(var n=0,i=e;n<i.length;n++){var a=i[n];if(a.apply(void 0,t))return !0}return !1}},e.not=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return !e.apply(void 0,t)}},e.assertType=function(e){},e.singleElementArray=function(e){return void 0===e?void 0:[e]},e.enumerateInsertsAndDeletes=function(e,t,r,n,i,a){a=a||k;for(var o=0,s=0,c=e.length,l=t.length,u=!1;o<c&&s<l;){var _=e[o],d=t[s],p=r(_,d);-1===p?(n(_),o++,u=!0):1===p?(i(d),s++,u=!0):(a(d,_),o++,s++);}for(;o<c;)n(e[o++]),u=!0;for(;s<l;)i(t[s++]),u=!0;return u},e.fill=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=t(n);return r},e.cartesianProduct=function(e){var t=[];return G(e,t,void 0,0),t},e.padLeft=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:r.repeat(t-e.length)+e},e.padRight=function(e,t,r){return void 0===r&&(r=" "),t<=e.length?e:e+r.repeat(t-e.length)},e.takeWhile=function(e,t){for(var r=e.length,n=0;n<r&&t(e[n]);)n++;return e.slice(0,n)},e.trimString=String.prototype.trim?function(e){return e.trim()}:function(t){return e.trimStringEnd(e.trimStringStart(t))},e.trimStringEnd=String.prototype.trimEnd?function(e){return e.trimEnd()}:function(t){for(var r=t.length-1;r>=0&&e.isWhiteSpaceLike(t.charCodeAt(r));)r--;return t.slice(0,r+1)},e.trimStringStart=String.prototype.trimStart?function(e){return e.trimStart()}:function(e){return e.replace(/^\s+/g,"")};}(t),function(e){var t;!function(e){e[e.Off=0]="Off",e[e.Error=1]="Error",e[e.Warning=2]="Warning",e[e.Info=3]="Info",e[e.Verbose=4]="Verbose";}(t=e.LogLevel||(e.LogLevel={})),function(r){var n,i,a=0;function o(){return null!=n?n:n=new e.Version(e.version)}function s(e){return r.currentLogLevel<=e}function c(e,t){r.loggingHost&&s(e)&&r.loggingHost.log(e,t);}function l(e){c(t.Info,e);}r.currentLogLevel=t.Warning,r.isDebugging=!1,r.getTypeScriptVersion=o,r.shouldLog=s,r.log=l,(i=l=r.log||(r.log={})).error=function(e){c(t.Error,e);},i.warn=function(e){c(t.Warning,e);},i.log=function(e){c(t.Info,e);},i.trace=function(e){c(t.Verbose,e);};var u={};function _(e){return a>=e}function d(t,n){return !!_(t)||(u[n]={level:t,assertion:r[n]},r[n]=e.noop,!1)}function p(e,t){var r=new Error(e?"Debug Failure. ".concat(e):"Debug Failure.");throw Error.captureStackTrace&&Error.captureStackTrace(r,t||p),r}function f(e,t,r,n){e||(t=t?"False expression: ".concat(t):"False expression.",r&&(t+="\r\nVerbose Debug Information: "+("string"==typeof r?r:r())),p(t,n||f));}function g(e,t,r){null==e&&p(t,r||g);}function m(e,t,r){return g(e,t,r||m),e}function y(e,t,r){for(var n=0,i=e;n<i.length;n++)g(i[n],t,r||y);}function v(e,t,r){return y(e,t,r||v),e}function h(e){if("function"!=typeof e)return "";if(e.hasOwnProperty("name"))return e.name;var t=Function.prototype.toString.call(e),r=/^function\s+([\w\$]+)\s*\(/.exec(t);return r?r[1]:""}function b(t,r,n){void 0===t&&(t=0);var i=function(t){var r=[];for(var n in t){var i=t[n];"number"==typeof i&&r.push([i,n]);}return e.stableSort(r,(function(t,r){return e.compareValues(t[0],r[0])}))}(r);if(0===t)return i.length>0&&0===i[0][0]?i[0][1]:"0";if(n){for(var a="",o=t,s=0,c=i;s<c.length;s++){var l=c[s],u=l[0],_=l[1];if(u>t)break;0!==u&&u&t&&(a="".concat(a).concat(a?"|":"").concat(_),o&=~u);}if(0===o)return a}else for(var d=0,p=i;d<p.length;d++){var f=p[d];if(u=f[0],_=f[1],u===t)return _}return t.toString()}function x(t){return b(t,e.SyntaxKind,!1)}function D(t){return b(t,e.NodeFlags,!0)}function S(t){return b(t,e.ModifierFlags,!0)}function T(t){return b(t,e.TransformFlags,!0)}function C(t){return b(t,e.EmitFlags,!0)}function E(t){return b(t,e.SymbolFlags,!0)}function k(t){return b(t,e.TypeFlags,!0)}function N(t){return b(t,e.SignatureFlags,!0)}function F(t){return b(t,e.ObjectFlags,!0)}function A(t){return b(t,e.FlowFlags,!0)}r.getAssertionLevel=function(){return a},r.setAssertionLevel=function(t){var n=a;if(a=t,t>n)for(var i=0,o=e.getOwnKeys(u);i<o.length;i++){var s=o[i],c=u[s];void 0!==c&&r[s]!==c.assertion&&t>=c.level&&(r[s]=c,u[s]=void 0);}},r.shouldAssert=_,r.fail=p,r.failBadSyntaxKind=function e(t,r,n){return p("".concat(r||"Unexpected node.","\r\nNode ").concat(x(t.kind)," was unexpected."),n||e)},r.assert=f,r.assertEqual=function e(t,r,n,i,a){if(t!==r){var o=n?i?"".concat(n," ").concat(i):n:"";p("Expected ".concat(t," === ").concat(r,". ").concat(o),a||e);}},r.assertLessThan=function e(t,r,n,i){t>=r&&p("Expected ".concat(t," < ").concat(r,". ").concat(n||""),i||e);},r.assertLessThanOrEqual=function e(t,r,n){t>r&&p("Expected ".concat(t," <= ").concat(r),n||e);},r.assertGreaterThanOrEqual=function e(t,r,n){t<r&&p("Expected ".concat(t," >= ").concat(r),n||e);},r.assertIsDefined=g,r.checkDefined=m,r.assertDefined=m,r.assertEachIsDefined=y,r.checkEachDefined=v,r.assertEachDefined=v,r.assertNever=function t(r,n,i){void 0===n&&(n="Illegal value:");var a="object"==typeof r&&e.hasProperty(r,"kind")&&e.hasProperty(r,"pos")&&x?"SyntaxKind: "+x(r.kind):JSON.stringify(r);return p("".concat(n," ").concat(a),i||t)},r.assertEachNode=function t(r,n,i,a){d(1,"assertEachNode")&&f(void 0===n||e.every(r,n),i||"Unexpected node.",(function(){return "Node array did not pass test '".concat(h(n),"'.")}),a||t);},r.assertNode=function e(t,r,n,i){d(1,"assertNode")&&f(void 0!==t&&(void 0===r||r(t)),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(h(r),"'.")}),i||e);},r.assertNotNode=function e(t,r,n,i){d(1,"assertNotNode")&&f(void 0===t||void 0===r||!r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," should not have passed test '").concat(h(r),"'.")}),i||e);},r.assertOptionalNode=function e(t,r,n,i){d(1,"assertOptionalNode")&&f(void 0===r||void 0===t||r(t),n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," did not pass test '").concat(h(r),"'.")}),i||e);},r.assertOptionalToken=function e(t,r,n,i){d(1,"assertOptionalToken")&&f(void 0===r||void 0===t||t.kind===r,n||"Unexpected node.",(function(){return "Node ".concat(x(null==t?void 0:t.kind)," was not a '").concat(x(r),"' token.")}),i||e);},r.assertMissingNode=function e(t,r,n){d(1,"assertMissingNode")&&f(void 0===t,r||"Unexpected node.",(function(){return "Node ".concat(x(t.kind)," was unexpected'.")}),n||e);},r.type=function(e){},r.getFunctionName=h,r.formatSymbol=function(t){return "{ name: ".concat(e.unescapeLeadingUnderscores(t.escapedName),"; flags: ").concat(E(t.flags),"; declarations: ").concat(e.map(t.declarations,(function(e){return x(e.kind)}))," }")},r.formatEnum=b,r.formatSyntaxKind=x,r.formatSnippetKind=function(t){return b(t,e.SnippetKind,!1)},r.formatNodeFlags=D,r.formatModifierFlags=S,r.formatTransformFlags=T,r.formatEmitFlags=C,r.formatSymbolFlags=E,r.formatTypeFlags=k,r.formatSignatureFlags=N,r.formatObjectFlags=F,r.formatFlowFlags=A;var P,w,I,O=!1;function M(e){return function(){if(B(),!P)throw new Error("Debugging helpers could not be loaded.");return P}().formatControlFlowGraph(e)}function L(t){"__debugFlowFlags"in t||Object.defineProperties(t,{__tsDebuggerDisplay:{value:function(){var e=2&this.flags?"FlowStart":4&this.flags?"FlowBranchLabel":8&this.flags?"FlowLoopLabel":16&this.flags?"FlowAssignment":32&this.flags?"FlowTrueCondition":64&this.flags?"FlowFalseCondition":128&this.flags?"FlowSwitchClause":256&this.flags?"FlowArrayMutation":512&this.flags?"FlowCall":1024&this.flags?"FlowReduceLabel":1&this.flags?"FlowUnreachable":"UnknownFlow",t=-2048&this.flags;return "".concat(e).concat(t?" (".concat(A(t),")"):"")}},__debugFlowFlags:{get:function(){return b(this.flags,e.FlowFlags,!0)}},__debugToString:{value:function(){return M(this)}}});}function R(e){"__tsDebuggerDisplay"in e||Object.defineProperties(e,{__tsDebuggerDisplay:{value:function(e){return e=String(e).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/,"]"),"NodeArray ".concat(e)}}});}function B(){if(!O){var t,r;Object.defineProperties(e.objectAllocator.getSymbolConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=33554432&this.flags?"TransientSymbol":"Symbol",r=-33554433&this.flags;return "".concat(t," '").concat(e.symbolName(this),"'").concat(r?" (".concat(E(r),")"):"")}},__debugFlags:{get:function(){return E(this.flags)}}}),Object.defineProperties(e.objectAllocator.getTypeConstructor().prototype,{__tsDebuggerDisplay:{value:function(){var t=98304&this.flags?"NullableType":384&this.flags?"LiteralType ".concat(JSON.stringify(this.value)):2048&this.flags?"LiteralType ".concat(this.value.negative?"-":"").concat(this.value.base10Value,"n"):8192&this.flags?"UniqueESSymbolType":32&this.flags?"EnumType":67359327&this.flags?"IntrinsicType ".concat(this.intrinsicName):1048576&this.flags?"UnionType":2097152&this.flags?"IntersectionType":4194304&this.flags?"IndexType":8388608&this.flags?"IndexedAccessType":16777216&this.flags?"ConditionalType":33554432&this.flags?"SubstitutionType":262144&this.flags?"TypeParameter":524288&this.flags?3&this.objectFlags?"InterfaceType":4&this.objectFlags?"TypeReference":8&this.objectFlags?"TupleType":16&this.objectFlags?"AnonymousType":32&this.objectFlags?"MappedType":1024&this.objectFlags?"ReverseMappedType":256&this.objectFlags?"EvolvingArrayType":"ObjectType":"Type",r=524288&this.flags?-1344&this.objectFlags:0;return "".concat(t).concat(this.symbol?" '".concat(e.symbolName(this.symbol),"'"):"").concat(r?" (".concat(F(r),")"):"")}},__debugFlags:{get:function(){return k(this.flags)}},__debugObjectFlags:{get:function(){return 524288&this.flags?F(this.objectFlags):""}},__debugTypeToString:{value:function(){var e=(void 0===t&&"function"==typeof WeakMap&&(t=new WeakMap),t),r=null==e?void 0:e.get(this);return void 0===r&&(r=this.checker.typeToString(this),null==e||e.set(this,r)),r}}}),Object.defineProperties(e.objectAllocator.getSignatureConstructor().prototype,{__debugFlags:{get:function(){return N(this.flags)}},__debugSignatureToString:{value:function(){var e;return null===(e=this.checker)||void 0===e?void 0:e.signatureToString(this)}}});for(var n=0,i=[e.objectAllocator.getNodeConstructor(),e.objectAllocator.getIdentifierConstructor(),e.objectAllocator.getTokenConstructor(),e.objectAllocator.getSourceFileConstructor()];n<i.length;n++){var a=i[n];a.prototype.hasOwnProperty("__debugKind")||Object.defineProperties(a.prototype,{__tsDebuggerDisplay:{value:function(){var t=e.isGeneratedIdentifier(this)?"GeneratedIdentifier":e.isIdentifier(this)?"Identifier '".concat(e.idText(this),"'"):e.isPrivateIdentifier(this)?"PrivateIdentifier '".concat(e.idText(this),"'"):e.isStringLiteral(this)?"StringLiteral ".concat(JSON.stringify(this.text.length<10?this.text:this.text.slice(10)+"...")):e.isNumericLiteral(this)?"NumericLiteral ".concat(this.text):e.isBigIntLiteral(this)?"BigIntLiteral ".concat(this.text,"n"):e.isTypeParameterDeclaration(this)?"TypeParameterDeclaration":e.isParameter(this)?"ParameterDeclaration":e.isConstructorDeclaration(this)?"ConstructorDeclaration":e.isGetAccessorDeclaration(this)?"GetAccessorDeclaration":e.isSetAccessorDeclaration(this)?"SetAccessorDeclaration":e.isCallSignatureDeclaration(this)?"CallSignatureDeclaration":e.isConstructSignatureDeclaration(this)?"ConstructSignatureDeclaration":e.isIndexSignatureDeclaration(this)?"IndexSignatureDeclaration":e.isTypePredicateNode(this)?"TypePredicateNode":e.isTypeReferenceNode(this)?"TypeReferenceNode":e.isFunctionTypeNode(this)?"FunctionTypeNode":e.isConstructorTypeNode(this)?"ConstructorTypeNode":e.isTypeQueryNode(this)?"TypeQueryNode":e.isTypeLiteralNode(this)?"TypeLiteralNode":e.isArrayTypeNode(this)?"ArrayTypeNode":e.isTupleTypeNode(this)?"TupleTypeNode":e.isOptionalTypeNode(this)?"OptionalTypeNode":e.isRestTypeNode(this)?"RestTypeNode":e.isUnionTypeNode(this)?"UnionTypeNode":e.isIntersectionTypeNode(this)?"IntersectionTypeNode":e.isConditionalTypeNode(this)?"ConditionalTypeNode":e.isInferTypeNode(this)?"InferTypeNode":e.isParenthesizedTypeNode(this)?"ParenthesizedTypeNode":e.isThisTypeNode(this)?"ThisTypeNode":e.isTypeOperatorNode(this)?"TypeOperatorNode":e.isIndexedAccessTypeNode(this)?"IndexedAccessTypeNode":e.isMappedTypeNode(this)?"MappedTypeNode":e.isLiteralTypeNode(this)?"LiteralTypeNode":e.isNamedTupleMember(this)?"NamedTupleMember":e.isImportTypeNode(this)?"ImportTypeNode":x(this.kind);return "".concat(t).concat(this.flags?" (".concat(D(this.flags),")"):"")}},__debugKind:{get:function(){return x(this.kind)}},__debugNodeFlags:{get:function(){return D(this.flags)}},__debugModifierFlags:{get:function(){return S(e.getEffectiveModifierFlagsNoCache(this))}},__debugTransformFlags:{get:function(){return T(this.transformFlags)}},__debugIsParseTreeNode:{get:function(){return e.isParseTreeNode(this)}},__debugEmitFlags:{get:function(){return C(e.getEmitFlags(this))}},__debugGetText:{value:function(t){if(e.nodeIsSynthesized(this))return "";var n=(void 0===r&&"function"==typeof WeakMap&&(r=new WeakMap),r),i=null==n?void 0:n.get(this);if(void 0===i){var a=e.getParseTreeNode(this),o=a&&e.getSourceFileOfNode(a);i=o?e.getSourceTextOfNodeFromSourceFile(o,a,t):"",null==n||n.set(this,i);}return i}}});}try{if(e.sys&&e.sys.require){var o=e.getDirectoryPath(e.resolvePath(e.sys.getExecutingFilePath())),s=e.sys.require(o,"./compiler-debug");s.error||(s.module.init(e),P=s.module);}}catch(e){}O=!0;}}function j(t,r,n,i,a){var o=r?"DeprecationError: ":"DeprecationWarning: ";return o+="'".concat(t,"' "),o+=i?"has been deprecated since v".concat(i):"is deprecated",(o+=r?" and can no longer be used.":n?" and will no longer be usable after v".concat(n,"."):".")+(a?" ".concat(e.formatStringFromArgs(a,[t],0)):"")}r.printControlFlowGraph=function(e){return console.log(M(e))},r.formatControlFlowGraph=M,r.attachFlowNodeDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(w||L(w=Object.create(Object.prototype)),Object.setPrototypeOf(e,w)):L(e));},r.attachNodeArrayDebugInfo=function(e){O&&("function"==typeof Object.setPrototypeOf?(I||R(I=Object.create(Array.prototype)),Object.setPrototypeOf(e,I)):R(e));},r.enableDebugInfo=B,r.deprecate=function(t,r){return function(e,t){return function(){return e(),t.apply(this,arguments)}}(function(t,r){var n,i;void 0===r&&(r={});var a="string"==typeof r.typeScriptVersion?new e.Version(r.typeScriptVersion):null!==(n=r.typeScriptVersion)&&void 0!==n?n:o(),s="string"==typeof r.errorAfter?new e.Version(r.errorAfter):r.errorAfter,c="string"==typeof r.warnAfter?new e.Version(r.warnAfter):r.warnAfter,u="string"==typeof r.since?new e.Version(r.since):null!==(i=r.since)&&void 0!==i?i:c,_=r.error||s&&a.compareTo(s)<=0,d=!c||a.compareTo(c)>=0;return _?function(e,t,r,n){var i=j(e,!0,t,r,n);return function(){throw new TypeError(i)}}(t,s,u,r.message):d?function(e,t,r,n){var i=!1;return function(){i||(l.warn(j(e,!1,t,r,n)),i=!0);}}(t,s,u,r.message):e.noop}(h(t),r),t)};}(e.Debug||(e.Debug={}));}(t),function(e){var t=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,r=/^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i,n=/^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i,i=/^(0|[1-9]\d*)$/,a=function(){function t(t,i,a,s,c){if(void 0===i&&(i=0),void 0===a&&(a=0),void 0===s&&(s=""),void 0===c&&(c=""),"string"==typeof t){var l=e.Debug.checkDefined(o(t),"Invalid version");t=l.major,i=l.minor,a=l.patch,s=l.prerelease,c=l.build;}e.Debug.assert(t>=0,"Invalid argument: major"),e.Debug.assert(i>=0,"Invalid argument: minor"),e.Debug.assert(a>=0,"Invalid argument: patch"),e.Debug.assert(!s||r.test(s),"Invalid argument: prerelease"),e.Debug.assert(!c||n.test(c),"Invalid argument: build"),this.major=t,this.minor=i,this.patch=a,this.prerelease=s?s.split("."):e.emptyArray,this.build=c?c.split("."):e.emptyArray;}return t.tryParse=function(e){var r=o(e);if(r)return new t(r.major,r.minor,r.patch,r.prerelease,r.build)},t.prototype.compareTo=function(t){return this===t?0:void 0===t?1:e.compareValues(this.major,t.major)||e.compareValues(this.minor,t.minor)||e.compareValues(this.patch,t.patch)||function(t,r){if(t===r)return 0;if(0===t.length)return 0===r.length?0:1;if(0===r.length)return -1;for(var n=Math.min(t.length,r.length),a=0;a<n;a++){var o=t[a],s=r[a];if(o!==s){var c=i.test(o),l=i.test(s);if(c||l){if(c!==l)return c?-1:1;if(u=e.compareValues(+o,+s))return u}else {var u;if(u=e.compareStringsCaseSensitive(o,s))return u}}}return e.compareValues(t.length,r.length)}(this.prerelease,t.prerelease)},t.prototype.increment=function(r){switch(r){case"major":return new t(this.major+1,0,0);case"minor":return new t(this.major,this.minor+1,0);case"patch":return new t(this.major,this.minor,this.patch+1);default:return e.Debug.assertNever(r)}},t.prototype.toString=function(){var t="".concat(this.major,".").concat(this.minor,".").concat(this.patch);return e.some(this.prerelease)&&(t+="-".concat(this.prerelease.join("."))),e.some(this.build)&&(t+="+".concat(this.build.join("."))),t},t.zero=new t(0,0,0),t}();function o(e){var i=t.exec(e);if(i){var a=i[1],o=i[2],s=void 0===o?"0":o,c=i[3],l=void 0===c?"0":c,u=i[4],_=void 0===u?"":u,d=i[5],p=void 0===d?"":d;if((!_||r.test(_))&&(!p||n.test(p)))return {major:parseInt(a,10),minor:parseInt(s,10),patch:parseInt(l,10),prerelease:_,build:p}}}e.Version=a;var s=function(){function t(t){this._alternatives=t?e.Debug.checkDefined(p(t),"Invalid range spec."):e.emptyArray;}return t.tryParse=function(e){var r=p(e);if(r){var n=new t("");return n._alternatives=r,n}},t.prototype.test=function(e){return "string"==typeof e&&(e=new a(e)),function(e,t){if(0===t.length)return !0;for(var r=0,n=t;r<n.length;r++)if(h(e,n[r]))return !0;return !1}(e,this._alternatives)},t.prototype.toString=function(){return t=this._alternatives,e.map(t,x).join(" || ")||"*";var t;},t}();e.VersionRange=s;var c=/\|\|/g,l=/\s+/g,u=/^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i,_=/^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i,d=/^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i;function p(t){for(var r=[],n=0,i=e.trimString(t).split(c);n<i.length;n++){var a=i[n];if(a){var o=[];a=e.trimString(a);var s=_.exec(a);if(s){if(!g(s[1],s[2],o))return}else for(var u=0,p=a.split(l);u<p.length;u++){var f=p[u],y=d.exec(e.trimString(f));if(!y||!m(y[1],y[2],o))return}r.push(o);}}return r}function f(e){var t=u.exec(e);if(t){var r=t[1],n=t[2],i=void 0===n?"*":n,o=t[3],s=void 0===o?"*":o,c=t[4],l=t[5];return {version:new a(y(r)?0:parseInt(r,10),y(r)||y(i)?0:parseInt(i,10),y(r)||y(i)||y(s)?0:parseInt(s,10),c,l),major:r,minor:i,patch:s}}}function g(e,t,r){var n=f(e);if(!n)return !1;var i=f(t);return !!i&&(y(n.major)||r.push(v(">=",n.version)),y(i.major)||r.push(y(i.minor)?v("<",i.version.increment("major")):y(i.patch)?v("<",i.version.increment("minor")):v("<=",i.version)),!0)}function m(e,t,r){var n=f(t);if(!n)return !1;var i=n.version,o=n.major,s=n.minor,c=n.patch;if(y(o))"<"!==e&&">"!==e||r.push(v("<",a.zero));else switch(e){case"~":r.push(v(">=",i)),r.push(v("<",i.increment(y(s)?"major":"minor")));break;case"^":r.push(v(">=",i)),r.push(v("<",i.increment(i.major>0||y(s)?"major":i.minor>0||y(c)?"minor":"patch")));break;case"<":case">=":r.push(v(e,i));break;case"<=":case">":r.push(y(s)?v("<="===e?"<":">=",i.increment("major")):y(c)?v("<="===e?"<":">=",i.increment("minor")):v(e,i));break;case"=":case void 0:y(s)||y(c)?(r.push(v(">=",i)),r.push(v("<",i.increment(y(s)?"major":"minor")))):r.push(v("=",i));break;default:return !1}return !0}function y(e){return "*"===e||"x"===e||"X"===e}function v(e,t){return {operator:e,operand:t}}function h(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!b(e,i.operator,i.operand))return !1}return !0}function b(t,r,n){var i=t.compareTo(n);switch(r){case"<":return i<0;case"<=":return i<=0;case">":return i>0;case">=":return i>=0;case"=":return 0===i;default:return e.Debug.assertNever(r)}}function x(t){return e.map(t,D).join(" ")}function D(e){return "".concat(e.operator).concat(e.operand)}}(t),function(e){function t(e,t){return "object"==typeof e&&"number"==typeof e.timeOrigin&&"function"==typeof e.mark&&"function"==typeof e.measure&&"function"==typeof e.now&&"function"==typeof t}var r=function(){if("object"==typeof performance&&"function"==typeof PerformanceObserver&&t(performance,PerformanceObserver))return {shouldWriteNativeEvents:!0,performance,PerformanceObserver}}()||function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser&&"object"==typeof module&&"function"==typeof require)try{var r,n=require("perf_hooks"),i=n.performance,a=n.PerformanceObserver;if(t(i,a)){r=i;var o=new e.Version(process.versions.node);return new e.VersionRange("<12.16.3 || 13 <13.13").test(o)&&(r={get timeOrigin(){return i.timeOrigin},now:function(){return i.now()},mark:function(e){return i.mark(e)},measure:function(e,t,r){void 0===t&&(t="nodeStart"),void 0===r&&(r="__performance.measure-fix__",i.mark(r)),i.measure(e,t,r),"__performance.measure-fix__"===r&&i.clearMarks("__performance.measure-fix__");}}),{shouldWriteNativeEvents:!1,performance:r,PerformanceObserver:a}}}catch(e){}}(),n=null==r?void 0:r.performance;e.tryGetNativePerformanceHooks=function(){return r},e.timestamp=n?function(){return n.now()}:Date.now?Date.now:function(){return +new Date};}(t),function(e){!function(t){var r,n;function i(t,r,n){var i=0;return {enter:function(){1==++i&&u(r);},exit:function(){0==--i?(u(n),_(t,r,n)):i<0&&e.Debug.fail("enter/exit count does not match.");}}}t.createTimerIf=function(e,r,n,a){return e?i(r,n,a):t.nullTimer},t.createTimer=i,t.nullTimer={enter:e.noop,exit:e.noop};var a=!1,o=e.timestamp(),s=new e.Map,c=new e.Map,l=new e.Map;function u(t){var r;if(a){var i=null!==(r=c.get(t))&&void 0!==r?r:0;c.set(t,i+1),s.set(t,e.timestamp()),null==n||n.mark(t);}}function _(t,r,i){var c,u;if(a){var _=null!==(c=void 0!==i?s.get(i):void 0)&&void 0!==c?c:e.timestamp(),d=null!==(u=void 0!==r?s.get(r):void 0)&&void 0!==u?u:o,p=l.get(t)||0;l.set(t,p+(_-d)),null==n||n.measure(t,r,i);}}t.mark=u,t.measure=_,t.getCount=function(e){return c.get(e)||0},t.getDuration=function(e){return l.get(e)||0},t.forEachMeasure=function(e){l.forEach((function(t,r){return e(r,t)}));},t.isEnabled=function(){return a},t.enable=function(t){var i;return void 0===t&&(t=e.sys),a||(a=!0,r||(r=e.tryGetNativePerformanceHooks()),r&&(o=r.performance.timeOrigin,(r.shouldWriteNativeEvents||(null===(i=null==t?void 0:t.cpuProfilingEnabled)||void 0===i?void 0:i.call(t))||(null==t?void 0:t.debugMode))&&(n=r.performance))),!0},t.disable=function(){a&&(s.clear(),c.clear(),l.clear(),n=void 0,a=!1);};}(e.performance||(e.performance={}));}(t),function(e){var t,r,n={logEvent:e.noop,logErrEvent:e.noop,logPerfEvent:e.noop,logInfoEvent:e.noop,logStartCommand:e.noop,logStopCommand:e.noop,logStartUpdateProgram:e.noop,logStopUpdateProgram:e.noop,logStartUpdateGraph:e.noop,logStopUpdateGraph:e.noop,logStartResolveModule:e.noop,logStopResolveModule:e.noop,logStartParseSourceFile:e.noop,logStopParseSourceFile:e.noop,logStartReadFile:e.noop,logStopReadFile:e.noop,logStartBindFile:e.noop,logStopBindFile:e.noop,logStartScheduledOperation:e.noop,logStopScheduledOperation:e.noop};try{var i=null!==(t=process.env.TS_ETW_MODULE_PATH)&&void 0!==t?t:"./node_modules/@microsoft/typescript-etw";r=require(i);}catch(e){r=void 0;}e.perfLogger=r&&r.logEvent?r:n;}(t),function(e){var t;!function(t){var r,n,a,o,s=0,c=0,l=[],u=[];t.startTracing=function(o,_,d){if(e.Debug.assert(!e.tracing,"Tracing already started"),void 0===r)try{r=require("fs");}catch(e){throw new Error("tracing requires having fs\n(original error: ".concat(e.message||e,")"))}n=o,l.length=0,void 0===a&&(a=e.combinePaths(_,"legend.json")),r.existsSync(_)||r.mkdirSync(_,{recursive:!0});var p="build"===n?".".concat(process.pid,"-").concat(++s):"server"===n?".".concat(process.pid):"",f=e.combinePaths(_,"trace".concat(p,".json")),g=e.combinePaths(_,"types".concat(p,".json"));u.push({configFilePath:d,tracePath:f,typesPath:g}),c=r.openSync(f,"w"),e.tracing=t;var m={cat:"__metadata",ph:"M",ts:1e3*e.timestamp(),pid:1,tid:1};r.writeSync(c,"[\n"+[i$1({name:"process_name",args:{name:"tsc"}},m),i$1({name:"thread_name",args:{name:"Main"}},m),i$1(i$1({name:"TracingStartedInBrowser"},m),{cat:"disabled-by-default-devtools.timeline"})].map((function(e){return JSON.stringify(e)})).join(",\n"));},t.stopTracing=function(){e.Debug.assert(e.tracing,"Tracing is not in progress"),e.Debug.assert(!!l.length==("server"!==n)),r.writeSync(c,"\n]\n"),r.closeSync(c),e.tracing=void 0,l.length?function(t){var n,a,o,s,c,l,_,d,p,g,m,y,v,h,b,x,D,S,T,C,E,k;e.performance.mark("beginDumpTypes");var N=u[u.length-1].typesPath,F=r.openSync(N,"w"),A=new e.Map;r.writeSync(F,"[");for(var P=t.length,w=0;w<P;w++){var I=t[w],O=I.objectFlags,M=null!==(n=I.aliasSymbol)&&void 0!==n?n:I.symbol,L=void 0;if(16&O|2944&I.flags)try{L=null===(a=I.checker)||void 0===a?void 0:a.typeToString(I);}catch(e){L=void 0;}var R={};if(8388608&I.flags){var B=I;R={indexedAccessObjectType:null===(o=B.objectType)||void 0===o?void 0:o.id,indexedAccessIndexType:null===(s=B.indexType)||void 0===s?void 0:s.id};}var j={};if(4&O){var J=I;j={instantiatedType:null===(c=J.target)||void 0===c?void 0:c.id,typeArguments:null===(l=J.resolvedTypeArguments)||void 0===l?void 0:l.map((function(e){return e.id})),referenceLocation:f(J.node)};}var z={};if(16777216&I.flags){var U=I;z={conditionalCheckType:null===(_=U.checkType)||void 0===_?void 0:_.id,conditionalExtendsType:null===(d=U.extendsType)||void 0===d?void 0:d.id,conditionalTrueType:null!==(g=null===(p=U.resolvedTrueType)||void 0===p?void 0:p.id)&&void 0!==g?g:-1,conditionalFalseType:null!==(y=null===(m=U.resolvedFalseType)||void 0===m?void 0:m.id)&&void 0!==y?y:-1};}var K={};if(33554432&I.flags){var V=I;K={substitutionBaseType:null===(v=V.baseType)||void 0===v?void 0:v.id,substituteType:null===(h=V.substitute)||void 0===h?void 0:h.id};}var q={};if(1024&O){var W=I;q={reverseMappedSourceType:null===(b=W.source)||void 0===b?void 0:b.id,reverseMappedMappedType:null===(x=W.mappedType)||void 0===x?void 0:x.id,reverseMappedConstraintType:null===(D=W.constraintType)||void 0===D?void 0:D.id};}var H={};if(256&O){var G=I;H={evolvingArrayElementType:G.elementType.id,evolvingArrayFinalType:null===(S=G.finalArrayType)||void 0===S?void 0:S.id};}var Q=void 0,X=I.checker.getRecursionIdentity(I);X&&((Q=A.get(X))||(Q=A.size,A.set(X,Q)));var Y=i$1(i$1(i$1(i$1(i$1(i$1(i$1({id:I.id,intrinsicName:I.intrinsicName,symbolName:(null==M?void 0:M.escapedName)&&e.unescapeLeadingUnderscores(M.escapedName),recursionId:Q,isTuple:!!(8&O)||void 0,unionTypes:1048576&I.flags?null===(T=I.types)||void 0===T?void 0:T.map((function(e){return e.id})):void 0,intersectionTypes:2097152&I.flags?I.types.map((function(e){return e.id})):void 0,aliasTypeArguments:null===(C=I.aliasTypeArguments)||void 0===C?void 0:C.map((function(e){return e.id})),keyofType:4194304&I.flags?null===(E=I.type)||void 0===E?void 0:E.id:void 0},R),j),z),K),q),H),{destructuringPattern:f(I.pattern),firstDeclaration:f(null===(k=null==M?void 0:M.declarations)||void 0===k?void 0:k[0]),flags:e.Debug.formatTypeFlags(I.flags).split("|"),display:L});r.writeSync(F,JSON.stringify(Y)),w<P-1&&r.writeSync(F,",\n");}r.writeSync(F,"]\n"),r.closeSync(F),e.performance.mark("endDumpTypes"),e.performance.measure("Dump types","beginDumpTypes","endDumpTypes");}(l):u[u.length-1].typesPath=void 0;},t.recordType=function(e){"server"!==n&&l.push(e);},(o=t.Phase||(t.Phase={})).Parse="parse",o.Program="program",o.Bind="bind",o.Check="check",o.CheckTypes="checkTypes",o.Emit="emit",o.Session="session",t.instant=function(e,t,r){p("I",e,t,r,'"s":"g"');};var _=[];function d(e,t){var r=_[e],n=r.phase,i=r.name,a=r.args,o=r.time;r.separateBeginAndEnd?p("E",n,i,a,void 0,t):1e4-o%1e4<=t-o&&p("X",n,i,a,'"dur":'.concat(t-o),o);}function p(t,i,a,o,s,l){void 0===l&&(l=1e3*e.timestamp()),"server"===n&&"checkTypes"===i||(e.performance.mark("beginTracing"),r.writeSync(c,',\n{"pid":1,"tid":1,"ph":"'.concat(t,'","cat":"').concat(i,'","ts":').concat(l,',"name":"').concat(a,'"')),s&&r.writeSync(c,",".concat(s)),o&&r.writeSync(c,',"args":'.concat(JSON.stringify(o))),r.writeSync(c,"}"),e.performance.mark("endTracing"),e.performance.measure("Tracing","beginTracing","endTracing"));}function f(t){var r=e.getSourceFileOfNode(t);return r?{path:r.path,start:n(e.getLineAndCharacterOfPosition(r,t.pos)),end:n(e.getLineAndCharacterOfPosition(r,t.end))}:void 0;function n(e){return {line:e.line+1,character:e.character+1}}}t.push=function(t,r,n,i){void 0===i&&(i=!1),i&&p("B",t,r,n),_.push({phase:t,name:r,args:n,time:1e3*e.timestamp(),separateBeginAndEnd:i});},t.pop=function(){e.Debug.assert(_.length>0),d(_.length-1,1e3*e.timestamp()),_.length--;},t.popAll=function(){for(var t=1e3*e.timestamp(),r=_.length-1;r>=0;r--)d(r,t);_.length=0;},t.dumpLegend=function(){a&&r.writeFileSync(a,JSON.stringify(u));};}(t||(t={})),e.startTracing=t.startTracing,e.dumpTracingLegend=t.dumpLegend;}(t),function(e){var t,r,n,i,a,o,s,c,l;(l=e.SyntaxKind||(e.SyntaxKind={}))[l.Unknown=0]="Unknown",l[l.EndOfFileToken=1]="EndOfFileToken",l[l.SingleLineCommentTrivia=2]="SingleLineCommentTrivia",l[l.MultiLineCommentTrivia=3]="MultiLineCommentTrivia",l[l.NewLineTrivia=4]="NewLineTrivia",l[l.WhitespaceTrivia=5]="WhitespaceTrivia",l[l.ShebangTrivia=6]="ShebangTrivia",l[l.ConflictMarkerTrivia=7]="ConflictMarkerTrivia",l[l.NumericLiteral=8]="NumericLiteral",l[l.BigIntLiteral=9]="BigIntLiteral",l[l.StringLiteral=10]="StringLiteral",l[l.JsxText=11]="JsxText",l[l.JsxTextAllWhiteSpaces=12]="JsxTextAllWhiteSpaces",l[l.RegularExpressionLiteral=13]="RegularExpressionLiteral",l[l.NoSubstitutionTemplateLiteral=14]="NoSubstitutionTemplateLiteral",l[l.TemplateHead=15]="TemplateHead",l[l.TemplateMiddle=16]="TemplateMiddle",l[l.TemplateTail=17]="TemplateTail",l[l.OpenBraceToken=18]="OpenBraceToken",l[l.CloseBraceToken=19]="CloseBraceToken",l[l.OpenParenToken=20]="OpenParenToken",l[l.CloseParenToken=21]="CloseParenToken",l[l.OpenBracketToken=22]="OpenBracketToken",l[l.CloseBracketToken=23]="CloseBracketToken",l[l.DotToken=24]="DotToken",l[l.DotDotDotToken=25]="DotDotDotToken",l[l.SemicolonToken=26]="SemicolonToken",l[l.CommaToken=27]="CommaToken",l[l.QuestionDotToken=28]="QuestionDotToken",l[l.LessThanToken=29]="LessThanToken",l[l.LessThanSlashToken=30]="LessThanSlashToken",l[l.GreaterThanToken=31]="GreaterThanToken",l[l.LessThanEqualsToken=32]="LessThanEqualsToken",l[l.GreaterThanEqualsToken=33]="GreaterThanEqualsToken",l[l.EqualsEqualsToken=34]="EqualsEqualsToken",l[l.ExclamationEqualsToken=35]="ExclamationEqualsToken",l[l.EqualsEqualsEqualsToken=36]="EqualsEqualsEqualsToken",l[l.ExclamationEqualsEqualsToken=37]="ExclamationEqualsEqualsToken",l[l.EqualsGreaterThanToken=38]="EqualsGreaterThanToken",l[l.PlusToken=39]="PlusToken",l[l.MinusToken=40]="MinusToken",l[l.AsteriskToken=41]="AsteriskToken",l[l.AsteriskAsteriskToken=42]="AsteriskAsteriskToken",l[l.SlashToken=43]="SlashToken",l[l.PercentToken=44]="PercentToken",l[l.PlusPlusToken=45]="PlusPlusToken",l[l.MinusMinusToken=46]="MinusMinusToken",l[l.LessThanLessThanToken=47]="LessThanLessThanToken",l[l.GreaterThanGreaterThanToken=48]="GreaterThanGreaterThanToken",l[l.GreaterThanGreaterThanGreaterThanToken=49]="GreaterThanGreaterThanGreaterThanToken",l[l.AmpersandToken=50]="AmpersandToken",l[l.BarToken=51]="BarToken",l[l.CaretToken=52]="CaretToken",l[l.ExclamationToken=53]="ExclamationToken",l[l.TildeToken=54]="TildeToken",l[l.AmpersandAmpersandToken=55]="AmpersandAmpersandToken",l[l.BarBarToken=56]="BarBarToken",l[l.QuestionToken=57]="QuestionToken",l[l.ColonToken=58]="ColonToken",l[l.AtToken=59]="AtToken",l[l.QuestionQuestionToken=60]="QuestionQuestionToken",l[l.BacktickToken=61]="BacktickToken",l[l.HashToken=62]="HashToken",l[l.EqualsToken=63]="EqualsToken",l[l.PlusEqualsToken=64]="PlusEqualsToken",l[l.MinusEqualsToken=65]="MinusEqualsToken",l[l.AsteriskEqualsToken=66]="AsteriskEqualsToken",l[l.AsteriskAsteriskEqualsToken=67]="AsteriskAsteriskEqualsToken",l[l.SlashEqualsToken=68]="SlashEqualsToken",l[l.PercentEqualsToken=69]="PercentEqualsToken",l[l.LessThanLessThanEqualsToken=70]="LessThanLessThanEqualsToken",l[l.GreaterThanGreaterThanEqualsToken=71]="GreaterThanGreaterThanEqualsToken",l[l.GreaterThanGreaterThanGreaterThanEqualsToken=72]="GreaterThanGreaterThanGreaterThanEqualsToken",l[l.AmpersandEqualsToken=73]="AmpersandEqualsToken",l[l.BarEqualsToken=74]="BarEqualsToken",l[l.BarBarEqualsToken=75]="BarBarEqualsToken",l[l.AmpersandAmpersandEqualsToken=76]="AmpersandAmpersandEqualsToken",l[l.QuestionQuestionEqualsToken=77]="QuestionQuestionEqualsToken",l[l.CaretEqualsToken=78]="CaretEqualsToken",l[l.Identifier=79]="Identifier",l[l.PrivateIdentifier=80]="PrivateIdentifier",l[l.BreakKeyword=81]="BreakKeyword",l[l.CaseKeyword=82]="CaseKeyword",l[l.CatchKeyword=83]="CatchKeyword",l[l.ClassKeyword=84]="ClassKeyword",l[l.ConstKeyword=85]="ConstKeyword",l[l.ContinueKeyword=86]="ContinueKeyword",l[l.DebuggerKeyword=87]="DebuggerKeyword",l[l.DefaultKeyword=88]="DefaultKeyword",l[l.DeleteKeyword=89]="DeleteKeyword",l[l.DoKeyword=90]="DoKeyword",l[l.ElseKeyword=91]="ElseKeyword",l[l.EnumKeyword=92]="EnumKeyword",l[l.ExportKeyword=93]="ExportKeyword",l[l.ExtendsKeyword=94]="ExtendsKeyword",l[l.FalseKeyword=95]="FalseKeyword",l[l.FinallyKeyword=96]="FinallyKeyword",l[l.ForKeyword=97]="ForKeyword",l[l.FunctionKeyword=98]="FunctionKeyword",l[l.IfKeyword=99]="IfKeyword",l[l.ImportKeyword=100]="ImportKeyword",l[l.InKeyword=101]="InKeyword",l[l.InstanceOfKeyword=102]="InstanceOfKeyword",l[l.NewKeyword=103]="NewKeyword",l[l.NullKeyword=104]="NullKeyword",l[l.ReturnKeyword=105]="ReturnKeyword",l[l.SuperKeyword=106]="SuperKeyword",l[l.SwitchKeyword=107]="SwitchKeyword",l[l.ThisKeyword=108]="ThisKeyword",l[l.ThrowKeyword=109]="ThrowKeyword",l[l.TrueKeyword=110]="TrueKeyword",l[l.TryKeyword=111]="TryKeyword",l[l.TypeOfKeyword=112]="TypeOfKeyword",l[l.VarKeyword=113]="VarKeyword",l[l.VoidKeyword=114]="VoidKeyword",l[l.WhileKeyword=115]="WhileKeyword",l[l.WithKeyword=116]="WithKeyword",l[l.ImplementsKeyword=117]="ImplementsKeyword",l[l.InterfaceKeyword=118]="InterfaceKeyword",l[l.LetKeyword=119]="LetKeyword",l[l.PackageKeyword=120]="PackageKeyword",l[l.PrivateKeyword=121]="PrivateKeyword",l[l.ProtectedKeyword=122]="ProtectedKeyword",l[l.PublicKeyword=123]="PublicKeyword",l[l.StaticKeyword=124]="StaticKeyword",l[l.YieldKeyword=125]="YieldKeyword",l[l.AbstractKeyword=126]="AbstractKeyword",l[l.AsKeyword=127]="AsKeyword",l[l.AssertsKeyword=128]="AssertsKeyword",l[l.AssertKeyword=129]="AssertKeyword",l[l.AnyKeyword=130]="AnyKeyword",l[l.AsyncKeyword=131]="AsyncKeyword",l[l.AwaitKeyword=132]="AwaitKeyword",l[l.BooleanKeyword=133]="BooleanKeyword",l[l.ConstructorKeyword=134]="ConstructorKeyword",l[l.DeclareKeyword=135]="DeclareKeyword",l[l.GetKeyword=136]="GetKeyword",l[l.InferKeyword=137]="InferKeyword",l[l.IntrinsicKeyword=138]="IntrinsicKeyword",l[l.IsKeyword=139]="IsKeyword",l[l.KeyOfKeyword=140]="KeyOfKeyword",l[l.ModuleKeyword=141]="ModuleKeyword",l[l.NamespaceKeyword=142]="NamespaceKeyword",l[l.NeverKeyword=143]="NeverKeyword",l[l.ReadonlyKeyword=144]="ReadonlyKeyword",l[l.RequireKeyword=145]="RequireKeyword",l[l.NumberKeyword=146]="NumberKeyword",l[l.ObjectKeyword=147]="ObjectKeyword",l[l.SetKeyword=148]="SetKeyword",l[l.StringKeyword=149]="StringKeyword",l[l.SymbolKeyword=150]="SymbolKeyword",l[l.TypeKeyword=151]="TypeKeyword",l[l.UndefinedKeyword=152]="UndefinedKeyword",l[l.UniqueKeyword=153]="UniqueKeyword",l[l.UnknownKeyword=154]="UnknownKeyword",l[l.FromKeyword=155]="FromKeyword",l[l.GlobalKeyword=156]="GlobalKeyword",l[l.BigIntKeyword=157]="BigIntKeyword",l[l.OverrideKeyword=158]="OverrideKeyword",l[l.OfKeyword=159]="OfKeyword",l[l.QualifiedName=160]="QualifiedName",l[l.ComputedPropertyName=161]="ComputedPropertyName",l[l.TypeParameter=162]="TypeParameter",l[l.Parameter=163]="Parameter",l[l.Decorator=164]="Decorator",l[l.PropertySignature=165]="PropertySignature",l[l.PropertyDeclaration=166]="PropertyDeclaration",l[l.MethodSignature=167]="MethodSignature",l[l.MethodDeclaration=168]="MethodDeclaration",l[l.ClassStaticBlockDeclaration=169]="ClassStaticBlockDeclaration",l[l.Constructor=170]="Constructor",l[l.GetAccessor=171]="GetAccessor",l[l.SetAccessor=172]="SetAccessor",l[l.CallSignature=173]="CallSignature",l[l.ConstructSignature=174]="ConstructSignature",l[l.IndexSignature=175]="IndexSignature",l[l.TypePredicate=176]="TypePredicate",l[l.TypeReference=177]="TypeReference",l[l.FunctionType=178]="FunctionType",l[l.ConstructorType=179]="ConstructorType",l[l.TypeQuery=180]="TypeQuery",l[l.TypeLiteral=181]="TypeLiteral",l[l.ArrayType=182]="ArrayType",l[l.TupleType=183]="TupleType",l[l.OptionalType=184]="OptionalType",l[l.RestType=185]="RestType",l[l.UnionType=186]="UnionType",l[l.IntersectionType=187]="IntersectionType",l[l.ConditionalType=188]="ConditionalType",l[l.InferType=189]="InferType",l[l.ParenthesizedType=190]="ParenthesizedType",l[l.ThisType=191]="ThisType",l[l.TypeOperator=192]="TypeOperator",l[l.IndexedAccessType=193]="IndexedAccessType",l[l.MappedType=194]="MappedType",l[l.LiteralType=195]="LiteralType",l[l.NamedTupleMember=196]="NamedTupleMember",l[l.TemplateLiteralType=197]="TemplateLiteralType",l[l.TemplateLiteralTypeSpan=198]="TemplateLiteralTypeSpan",l[l.ImportType=199]="ImportType",l[l.ObjectBindingPattern=200]="ObjectBindingPattern",l[l.ArrayBindingPattern=201]="ArrayBindingPattern",l[l.BindingElement=202]="BindingElement",l[l.ArrayLiteralExpression=203]="ArrayLiteralExpression",l[l.ObjectLiteralExpression=204]="ObjectLiteralExpression",l[l.PropertyAccessExpression=205]="PropertyAccessExpression",l[l.ElementAccessExpression=206]="ElementAccessExpression",l[l.CallExpression=207]="CallExpression",l[l.NewExpression=208]="NewExpression",l[l.TaggedTemplateExpression=209]="TaggedTemplateExpression",l[l.TypeAssertionExpression=210]="TypeAssertionExpression",l[l.ParenthesizedExpression=211]="ParenthesizedExpression",l[l.FunctionExpression=212]="FunctionExpression",l[l.ArrowFunction=213]="ArrowFunction",l[l.DeleteExpression=214]="DeleteExpression",l[l.TypeOfExpression=215]="TypeOfExpression",l[l.VoidExpression=216]="VoidExpression",l[l.AwaitExpression=217]="AwaitExpression",l[l.PrefixUnaryExpression=218]="PrefixUnaryExpression",l[l.PostfixUnaryExpression=219]="PostfixUnaryExpression",l[l.BinaryExpression=220]="BinaryExpression",l[l.ConditionalExpression=221]="ConditionalExpression",l[l.TemplateExpression=222]="TemplateExpression",l[l.YieldExpression=223]="YieldExpression",l[l.SpreadElement=224]="SpreadElement",l[l.ClassExpression=225]="ClassExpression",l[l.OmittedExpression=226]="OmittedExpression",l[l.ExpressionWithTypeArguments=227]="ExpressionWithTypeArguments",l[l.AsExpression=228]="AsExpression",l[l.NonNullExpression=229]="NonNullExpression",l[l.MetaProperty=230]="MetaProperty",l[l.SyntheticExpression=231]="SyntheticExpression",l[l.TemplateSpan=232]="TemplateSpan",l[l.SemicolonClassElement=233]="SemicolonClassElement",l[l.Block=234]="Block",l[l.EmptyStatement=235]="EmptyStatement",l[l.VariableStatement=236]="VariableStatement",l[l.ExpressionStatement=237]="ExpressionStatement",l[l.IfStatement=238]="IfStatement",l[l.DoStatement=239]="DoStatement",l[l.WhileStatement=240]="WhileStatement",l[l.ForStatement=241]="ForStatement",l[l.ForInStatement=242]="ForInStatement",l[l.ForOfStatement=243]="ForOfStatement",l[l.ContinueStatement=244]="ContinueStatement",l[l.BreakStatement=245]="BreakStatement",l[l.ReturnStatement=246]="ReturnStatement",l[l.WithStatement=247]="WithStatement",l[l.SwitchStatement=248]="SwitchStatement",l[l.LabeledStatement=249]="LabeledStatement",l[l.ThrowStatement=250]="ThrowStatement",l[l.TryStatement=251]="TryStatement",l[l.DebuggerStatement=252]="DebuggerStatement",l[l.VariableDeclaration=253]="VariableDeclaration",l[l.VariableDeclarationList=254]="VariableDeclarationList",l[l.FunctionDeclaration=255]="FunctionDeclaration",l[l.ClassDeclaration=256]="ClassDeclaration",l[l.InterfaceDeclaration=257]="InterfaceDeclaration",l[l.TypeAliasDeclaration=258]="TypeAliasDeclaration",l[l.EnumDeclaration=259]="EnumDeclaration",l[l.ModuleDeclaration=260]="ModuleDeclaration",l[l.ModuleBlock=261]="ModuleBlock",l[l.CaseBlock=262]="CaseBlock",l[l.NamespaceExportDeclaration=263]="NamespaceExportDeclaration",l[l.ImportEqualsDeclaration=264]="ImportEqualsDeclaration",l[l.ImportDeclaration=265]="ImportDeclaration",l[l.ImportClause=266]="ImportClause",l[l.NamespaceImport=267]="NamespaceImport",l[l.NamedImports=268]="NamedImports",l[l.ImportSpecifier=269]="ImportSpecifier",l[l.ExportAssignment=270]="ExportAssignment",l[l.ExportDeclaration=271]="ExportDeclaration",l[l.NamedExports=272]="NamedExports",l[l.NamespaceExport=273]="NamespaceExport",l[l.ExportSpecifier=274]="ExportSpecifier",l[l.MissingDeclaration=275]="MissingDeclaration",l[l.ExternalModuleReference=276]="ExternalModuleReference",l[l.JsxElement=277]="JsxElement",l[l.JsxSelfClosingElement=278]="JsxSelfClosingElement",l[l.JsxOpeningElement=279]="JsxOpeningElement",l[l.JsxClosingElement=280]="JsxClosingElement",l[l.JsxFragment=281]="JsxFragment",l[l.JsxOpeningFragment=282]="JsxOpeningFragment",l[l.JsxClosingFragment=283]="JsxClosingFragment",l[l.JsxAttribute=284]="JsxAttribute",l[l.JsxAttributes=285]="JsxAttributes",l[l.JsxSpreadAttribute=286]="JsxSpreadAttribute",l[l.JsxExpression=287]="JsxExpression",l[l.CaseClause=288]="CaseClause",l[l.DefaultClause=289]="DefaultClause",l[l.HeritageClause=290]="HeritageClause",l[l.CatchClause=291]="CatchClause",l[l.AssertClause=292]="AssertClause",l[l.AssertEntry=293]="AssertEntry",l[l.PropertyAssignment=294]="PropertyAssignment",l[l.ShorthandPropertyAssignment=295]="ShorthandPropertyAssignment",l[l.SpreadAssignment=296]="SpreadAssignment",l[l.EnumMember=297]="EnumMember",l[l.UnparsedPrologue=298]="UnparsedPrologue",l[l.UnparsedPrepend=299]="UnparsedPrepend",l[l.UnparsedText=300]="UnparsedText",l[l.UnparsedInternalText=301]="UnparsedInternalText",l[l.UnparsedSyntheticReference=302]="UnparsedSyntheticReference",l[l.SourceFile=303]="SourceFile",l[l.Bundle=304]="Bundle",l[l.UnparsedSource=305]="UnparsedSource",l[l.InputFiles=306]="InputFiles",l[l.JSDocTypeExpression=307]="JSDocTypeExpression",l[l.JSDocNameReference=308]="JSDocNameReference",l[l.JSDocMemberName=309]="JSDocMemberName",l[l.JSDocAllType=310]="JSDocAllType",l[l.JSDocUnknownType=311]="JSDocUnknownType",l[l.JSDocNullableType=312]="JSDocNullableType",l[l.JSDocNonNullableType=313]="JSDocNonNullableType",l[l.JSDocOptionalType=314]="JSDocOptionalType",l[l.JSDocFunctionType=315]="JSDocFunctionType",l[l.JSDocVariadicType=316]="JSDocVariadicType",l[l.JSDocNamepathType=317]="JSDocNamepathType",l[l.JSDocComment=318]="JSDocComment",l[l.JSDocText=319]="JSDocText",l[l.JSDocTypeLiteral=320]="JSDocTypeLiteral",l[l.JSDocSignature=321]="JSDocSignature",l[l.JSDocLink=322]="JSDocLink",l[l.JSDocLinkCode=323]="JSDocLinkCode",l[l.JSDocLinkPlain=324]="JSDocLinkPlain",l[l.JSDocTag=325]="JSDocTag",l[l.JSDocAugmentsTag=326]="JSDocAugmentsTag",l[l.JSDocImplementsTag=327]="JSDocImplementsTag",l[l.JSDocAuthorTag=328]="JSDocAuthorTag",l[l.JSDocDeprecatedTag=329]="JSDocDeprecatedTag",l[l.JSDocClassTag=330]="JSDocClassTag",l[l.JSDocPublicTag=331]="JSDocPublicTag",l[l.JSDocPrivateTag=332]="JSDocPrivateTag",l[l.JSDocProtectedTag=333]="JSDocProtectedTag",l[l.JSDocReadonlyTag=334]="JSDocReadonlyTag",l[l.JSDocOverrideTag=335]="JSDocOverrideTag",l[l.JSDocCallbackTag=336]="JSDocCallbackTag",l[l.JSDocEnumTag=337]="JSDocEnumTag",l[l.JSDocParameterTag=338]="JSDocParameterTag",l[l.JSDocReturnTag=339]="JSDocReturnTag",l[l.JSDocThisTag=340]="JSDocThisTag",l[l.JSDocTypeTag=341]="JSDocTypeTag",l[l.JSDocTemplateTag=342]="JSDocTemplateTag",l[l.JSDocTypedefTag=343]="JSDocTypedefTag",l[l.JSDocSeeTag=344]="JSDocSeeTag",l[l.JSDocPropertyTag=345]="JSDocPropertyTag",l[l.SyntaxList=346]="SyntaxList",l[l.NotEmittedStatement=347]="NotEmittedStatement",l[l.PartiallyEmittedExpression=348]="PartiallyEmittedExpression",l[l.CommaListExpression=349]="CommaListExpression",l[l.MergeDeclarationMarker=350]="MergeDeclarationMarker",l[l.EndOfDeclarationMarker=351]="EndOfDeclarationMarker",l[l.SyntheticReferenceExpression=352]="SyntheticReferenceExpression",l[l.Count=353]="Count",l[l.FirstAssignment=63]="FirstAssignment",l[l.LastAssignment=78]="LastAssignment",l[l.FirstCompoundAssignment=64]="FirstCompoundAssignment",l[l.LastCompoundAssignment=78]="LastCompoundAssignment",l[l.FirstReservedWord=81]="FirstReservedWord",l[l.LastReservedWord=116]="LastReservedWord",l[l.FirstKeyword=81]="FirstKeyword",l[l.LastKeyword=159]="LastKeyword",l[l.FirstFutureReservedWord=117]="FirstFutureReservedWord",l[l.LastFutureReservedWord=125]="LastFutureReservedWord",l[l.FirstTypeNode=176]="FirstTypeNode",l[l.LastTypeNode=199]="LastTypeNode",l[l.FirstPunctuation=18]="FirstPunctuation",l[l.LastPunctuation=78]="LastPunctuation",l[l.FirstToken=0]="FirstToken",l[l.LastToken=159]="LastToken",l[l.FirstTriviaToken=2]="FirstTriviaToken",l[l.LastTriviaToken=7]="LastTriviaToken",l[l.FirstLiteralToken=8]="FirstLiteralToken",l[l.LastLiteralToken=14]="LastLiteralToken",l[l.FirstTemplateToken=14]="FirstTemplateToken",l[l.LastTemplateToken=17]="LastTemplateToken",l[l.FirstBinaryOperator=29]="FirstBinaryOperator",l[l.LastBinaryOperator=78]="LastBinaryOperator",l[l.FirstStatement=236]="FirstStatement",l[l.LastStatement=252]="LastStatement",l[l.FirstNode=160]="FirstNode",l[l.FirstJSDocNode=307]="FirstJSDocNode",l[l.LastJSDocNode=345]="LastJSDocNode",l[l.FirstJSDocTagNode=325]="FirstJSDocTagNode",l[l.LastJSDocTagNode=345]="LastJSDocTagNode",l[l.FirstContextualKeyword=126]="FirstContextualKeyword",l[l.LastContextualKeyword=159]="LastContextualKeyword",(c=e.NodeFlags||(e.NodeFlags={}))[c.None=0]="None",c[c.Let=1]="Let",c[c.Const=2]="Const",c[c.NestedNamespace=4]="NestedNamespace",c[c.Synthesized=8]="Synthesized",c[c.Namespace=16]="Namespace",c[c.OptionalChain=32]="OptionalChain",c[c.ExportContext=64]="ExportContext",c[c.ContainsThis=128]="ContainsThis",c[c.HasImplicitReturn=256]="HasImplicitReturn",c[c.HasExplicitReturn=512]="HasExplicitReturn",c[c.GlobalAugmentation=1024]="GlobalAugmentation",c[c.HasAsyncFunctions=2048]="HasAsyncFunctions",c[c.DisallowInContext=4096]="DisallowInContext",c[c.YieldContext=8192]="YieldContext",c[c.DecoratorContext=16384]="DecoratorContext",c[c.AwaitContext=32768]="AwaitContext",c[c.ThisNodeHasError=65536]="ThisNodeHasError",c[c.JavaScriptFile=131072]="JavaScriptFile",c[c.ThisNodeOrAnySubNodesHasError=262144]="ThisNodeOrAnySubNodesHasError",c[c.HasAggregatedChildData=524288]="HasAggregatedChildData",c[c.PossiblyContainsDynamicImport=1048576]="PossiblyContainsDynamicImport",c[c.PossiblyContainsImportMeta=2097152]="PossiblyContainsImportMeta",c[c.JSDoc=4194304]="JSDoc",c[c.Ambient=8388608]="Ambient",c[c.InWithStatement=16777216]="InWithStatement",c[c.JsonFile=33554432]="JsonFile",c[c.TypeCached=67108864]="TypeCached",c[c.Deprecated=134217728]="Deprecated",c[c.BlockScoped=3]="BlockScoped",c[c.ReachabilityCheckFlags=768]="ReachabilityCheckFlags",c[c.ReachabilityAndEmitFlags=2816]="ReachabilityAndEmitFlags",c[c.ContextFlags=25358336]="ContextFlags",c[c.TypeExcludesFlags=40960]="TypeExcludesFlags",c[c.PermanentlySetIncrementalFlags=3145728]="PermanentlySetIncrementalFlags",(s=e.ModifierFlags||(e.ModifierFlags={}))[s.None=0]="None",s[s.Export=1]="Export",s[s.Ambient=2]="Ambient",s[s.Public=4]="Public",s[s.Private=8]="Private",s[s.Protected=16]="Protected",s[s.Static=32]="Static",s[s.Readonly=64]="Readonly",s[s.Abstract=128]="Abstract",s[s.Async=256]="Async",s[s.Default=512]="Default",s[s.Const=2048]="Const",s[s.HasComputedJSDocModifiers=4096]="HasComputedJSDocModifiers",s[s.Deprecated=8192]="Deprecated",s[s.Override=16384]="Override",s[s.HasComputedFlags=536870912]="HasComputedFlags",s[s.AccessibilityModifier=28]="AccessibilityModifier",s[s.ParameterPropertyModifier=16476]="ParameterPropertyModifier",s[s.NonPublicAccessibilityModifier=24]="NonPublicAccessibilityModifier",s[s.TypeScriptModifier=18654]="TypeScriptModifier",s[s.ExportDefault=513]="ExportDefault",s[s.All=27647]="All",(o=e.JsxFlags||(e.JsxFlags={}))[o.None=0]="None",o[o.IntrinsicNamedElement=1]="IntrinsicNamedElement",o[o.IntrinsicIndexedElement=2]="IntrinsicIndexedElement",o[o.IntrinsicElement=3]="IntrinsicElement",(a=e.RelationComparisonResult||(e.RelationComparisonResult={}))[a.Succeeded=1]="Succeeded",a[a.Failed=2]="Failed",a[a.Reported=4]="Reported",a[a.ReportsUnmeasurable=8]="ReportsUnmeasurable",a[a.ReportsUnreliable=16]="ReportsUnreliable",a[a.ReportsMask=24]="ReportsMask",(i=e.GeneratedIdentifierFlags||(e.GeneratedIdentifierFlags={}))[i.None=0]="None",i[i.Auto=1]="Auto",i[i.Loop=2]="Loop",i[i.Unique=3]="Unique",i[i.Node=4]="Node",i[i.KindMask=7]="KindMask",i[i.ReservedInNestedScopes=8]="ReservedInNestedScopes",i[i.Optimistic=16]="Optimistic",i[i.FileLevel=32]="FileLevel",i[i.AllowNameSubstitution=64]="AllowNameSubstitution",(n=e.TokenFlags||(e.TokenFlags={}))[n.None=0]="None",n[n.PrecedingLineBreak=1]="PrecedingLineBreak",n[n.PrecedingJSDocComment=2]="PrecedingJSDocComment",n[n.Unterminated=4]="Unterminated",n[n.ExtendedUnicodeEscape=8]="ExtendedUnicodeEscape",n[n.Scientific=16]="Scientific",n[n.Octal=32]="Octal",n[n.HexSpecifier=64]="HexSpecifier",n[n.BinarySpecifier=128]="BinarySpecifier",n[n.OctalSpecifier=256]="OctalSpecifier",n[n.ContainsSeparator=512]="ContainsSeparator",n[n.UnicodeEscape=1024]="UnicodeEscape",n[n.ContainsInvalidEscape=2048]="ContainsInvalidEscape",n[n.BinaryOrOctalSpecifier=384]="BinaryOrOctalSpecifier",n[n.NumericLiteralFlags=1008]="NumericLiteralFlags",n[n.TemplateLiteralLikeFlags=2048]="TemplateLiteralLikeFlags",(r=e.FlowFlags||(e.FlowFlags={}))[r.Unreachable=1]="Unreachable",r[r.Start=2]="Start",r[r.BranchLabel=4]="BranchLabel",r[r.LoopLabel=8]="LoopLabel",r[r.Assignment=16]="Assignment",r[r.TrueCondition=32]="TrueCondition",r[r.FalseCondition=64]="FalseCondition",r[r.SwitchClause=128]="SwitchClause",r[r.ArrayMutation=256]="ArrayMutation",r[r.Call=512]="Call",r[r.ReduceLabel=1024]="ReduceLabel",r[r.Referenced=2048]="Referenced",r[r.Shared=4096]="Shared",r[r.Label=12]="Label",r[r.Condition=96]="Condition",(t=e.CommentDirectiveType||(e.CommentDirectiveType={}))[t.ExpectError=0]="ExpectError",t[t.Ignore=1]="Ignore";var u,_,d,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,F,A,P,w,I,O,M,L,R,B,j,J,z,U,K,V,q,W,H,G,Q,X,Y,Z,$,ee,te,re,ne,ie,ae,oe,se,ce,le,ue,_e,de,pe;e.OperationCanceledException=function(){},(pe=e.FileIncludeKind||(e.FileIncludeKind={}))[pe.RootFile=0]="RootFile",pe[pe.SourceFromProjectReference=1]="SourceFromProjectReference",pe[pe.OutputFromProjectReference=2]="OutputFromProjectReference",pe[pe.Import=3]="Import",pe[pe.ReferenceFile=4]="ReferenceFile",pe[pe.TypeReferenceDirective=5]="TypeReferenceDirective",pe[pe.LibFile=6]="LibFile",pe[pe.LibReferenceDirective=7]="LibReferenceDirective",pe[pe.AutomaticTypeDirectiveFile=8]="AutomaticTypeDirectiveFile",(de=e.FilePreprocessingDiagnosticsKind||(e.FilePreprocessingDiagnosticsKind={}))[de.FilePreprocessingReferencedDiagnostic=0]="FilePreprocessingReferencedDiagnostic",de[de.FilePreprocessingFileExplainingDiagnostic=1]="FilePreprocessingFileExplainingDiagnostic",(_e=e.StructureIsReused||(e.StructureIsReused={}))[_e.Not=0]="Not",_e[_e.SafeModules=1]="SafeModules",_e[_e.Completely=2]="Completely",(ue=e.ExitStatus||(e.ExitStatus={}))[ue.Success=0]="Success",ue[ue.DiagnosticsPresent_OutputsSkipped=1]="DiagnosticsPresent_OutputsSkipped",ue[ue.DiagnosticsPresent_OutputsGenerated=2]="DiagnosticsPresent_OutputsGenerated",ue[ue.InvalidProject_OutputsSkipped=3]="InvalidProject_OutputsSkipped",ue[ue.ProjectReferenceCycle_OutputsSkipped=4]="ProjectReferenceCycle_OutputsSkipped",ue[ue.ProjectReferenceCycle_OutputsSkupped=4]="ProjectReferenceCycle_OutputsSkupped",(le=e.MemberOverrideStatus||(e.MemberOverrideStatus={}))[le.Ok=0]="Ok",le[le.NeedsOverride=1]="NeedsOverride",le[le.HasInvalidOverride=2]="HasInvalidOverride",(ce=e.UnionReduction||(e.UnionReduction={}))[ce.None=0]="None",ce[ce.Literal=1]="Literal",ce[ce.Subtype=2]="Subtype",(se=e.ContextFlags||(e.ContextFlags={}))[se.None=0]="None",se[se.Signature=1]="Signature",se[se.NoConstraints=2]="NoConstraints",se[se.Completions=4]="Completions",se[se.SkipBindingPatterns=8]="SkipBindingPatterns",(oe=e.NodeBuilderFlags||(e.NodeBuilderFlags={}))[oe.None=0]="None",oe[oe.NoTruncation=1]="NoTruncation",oe[oe.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",oe[oe.GenerateNamesForShadowedTypeParams=4]="GenerateNamesForShadowedTypeParams",oe[oe.UseStructuralFallback=8]="UseStructuralFallback",oe[oe.ForbidIndexedAccessSymbolReferences=16]="ForbidIndexedAccessSymbolReferences",oe[oe.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",oe[oe.UseFullyQualifiedType=64]="UseFullyQualifiedType",oe[oe.UseOnlyExternalAliasing=128]="UseOnlyExternalAliasing",oe[oe.SuppressAnyReturnType=256]="SuppressAnyReturnType",oe[oe.WriteTypeParametersInQualifiedName=512]="WriteTypeParametersInQualifiedName",oe[oe.MultilineObjectLiterals=1024]="MultilineObjectLiterals",oe[oe.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",oe[oe.UseTypeOfFunction=4096]="UseTypeOfFunction",oe[oe.OmitParameterModifiers=8192]="OmitParameterModifiers",oe[oe.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",oe[oe.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",oe[oe.NoTypeReduction=536870912]="NoTypeReduction",oe[oe.NoUndefinedOptionalParameterType=1073741824]="NoUndefinedOptionalParameterType",oe[oe.AllowThisInObjectLiteral=32768]="AllowThisInObjectLiteral",oe[oe.AllowQualifiedNameInPlaceOfIdentifier=65536]="AllowQualifiedNameInPlaceOfIdentifier",oe[oe.AllowQualifedNameInPlaceOfIdentifier=65536]="AllowQualifedNameInPlaceOfIdentifier",oe[oe.AllowAnonymousIdentifier=131072]="AllowAnonymousIdentifier",oe[oe.AllowEmptyUnionOrIntersection=262144]="AllowEmptyUnionOrIntersection",oe[oe.AllowEmptyTuple=524288]="AllowEmptyTuple",oe[oe.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",oe[oe.AllowEmptyIndexInfoType=2097152]="AllowEmptyIndexInfoType",oe[oe.AllowNodeModulesRelativePaths=67108864]="AllowNodeModulesRelativePaths",oe[oe.DoNotIncludeSymbolChain=134217728]="DoNotIncludeSymbolChain",oe[oe.IgnoreErrors=70221824]="IgnoreErrors",oe[oe.InObjectTypeLiteral=4194304]="InObjectTypeLiteral",oe[oe.InTypeAlias=8388608]="InTypeAlias",oe[oe.InInitialEntityName=16777216]="InInitialEntityName",(ae=e.TypeFormatFlags||(e.TypeFormatFlags={}))[ae.None=0]="None",ae[ae.NoTruncation=1]="NoTruncation",ae[ae.WriteArrayAsGenericType=2]="WriteArrayAsGenericType",ae[ae.UseStructuralFallback=8]="UseStructuralFallback",ae[ae.WriteTypeArgumentsOfSignature=32]="WriteTypeArgumentsOfSignature",ae[ae.UseFullyQualifiedType=64]="UseFullyQualifiedType",ae[ae.SuppressAnyReturnType=256]="SuppressAnyReturnType",ae[ae.MultilineObjectLiterals=1024]="MultilineObjectLiterals",ae[ae.WriteClassExpressionAsTypeLiteral=2048]="WriteClassExpressionAsTypeLiteral",ae[ae.UseTypeOfFunction=4096]="UseTypeOfFunction",ae[ae.OmitParameterModifiers=8192]="OmitParameterModifiers",ae[ae.UseAliasDefinedOutsideCurrentScope=16384]="UseAliasDefinedOutsideCurrentScope",ae[ae.UseSingleQuotesForStringLiteralType=268435456]="UseSingleQuotesForStringLiteralType",ae[ae.NoTypeReduction=536870912]="NoTypeReduction",ae[ae.AllowUniqueESSymbolType=1048576]="AllowUniqueESSymbolType",ae[ae.AddUndefined=131072]="AddUndefined",ae[ae.WriteArrowStyleSignature=262144]="WriteArrowStyleSignature",ae[ae.InArrayType=524288]="InArrayType",ae[ae.InElementType=2097152]="InElementType",ae[ae.InFirstTypeArgument=4194304]="InFirstTypeArgument",ae[ae.InTypeAlias=8388608]="InTypeAlias",ae[ae.WriteOwnNameForAnyLike=0]="WriteOwnNameForAnyLike",ae[ae.NodeBuilderFlagsMask=814775659]="NodeBuilderFlagsMask",(ie=e.SymbolFormatFlags||(e.SymbolFormatFlags={}))[ie.None=0]="None",ie[ie.WriteTypeParametersOrArguments=1]="WriteTypeParametersOrArguments",ie[ie.UseOnlyExternalAliasing=2]="UseOnlyExternalAliasing",ie[ie.AllowAnyNodeKind=4]="AllowAnyNodeKind",ie[ie.UseAliasDefinedOutsideCurrentScope=8]="UseAliasDefinedOutsideCurrentScope",ie[ie.DoNotIncludeSymbolChain=16]="DoNotIncludeSymbolChain",(ne=e.SymbolAccessibility||(e.SymbolAccessibility={}))[ne.Accessible=0]="Accessible",ne[ne.NotAccessible=1]="NotAccessible",ne[ne.CannotBeNamed=2]="CannotBeNamed",(re=e.SyntheticSymbolKind||(e.SyntheticSymbolKind={}))[re.UnionOrIntersection=0]="UnionOrIntersection",re[re.Spread=1]="Spread",(te=e.TypePredicateKind||(e.TypePredicateKind={}))[te.This=0]="This",te[te.Identifier=1]="Identifier",te[te.AssertsThis=2]="AssertsThis",te[te.AssertsIdentifier=3]="AssertsIdentifier",(ee=e.TypeReferenceSerializationKind||(e.TypeReferenceSerializationKind={}))[ee.Unknown=0]="Unknown",ee[ee.TypeWithConstructSignatureAndValue=1]="TypeWithConstructSignatureAndValue",ee[ee.VoidNullableOrNeverType=2]="VoidNullableOrNeverType",ee[ee.NumberLikeType=3]="NumberLikeType",ee[ee.BigIntLikeType=4]="BigIntLikeType",ee[ee.StringLikeType=5]="StringLikeType",ee[ee.BooleanType=6]="BooleanType",ee[ee.ArrayLikeType=7]="ArrayLikeType",ee[ee.ESSymbolType=8]="ESSymbolType",ee[ee.Promise=9]="Promise",ee[ee.TypeWithCallSignature=10]="TypeWithCallSignature",ee[ee.ObjectType=11]="ObjectType",($=e.SymbolFlags||(e.SymbolFlags={}))[$.None=0]="None",$[$.FunctionScopedVariable=1]="FunctionScopedVariable",$[$.BlockScopedVariable=2]="BlockScopedVariable",$[$.Property=4]="Property",$[$.EnumMember=8]="EnumMember",$[$.Function=16]="Function",$[$.Class=32]="Class",$[$.Interface=64]="Interface",$[$.ConstEnum=128]="ConstEnum",$[$.RegularEnum=256]="RegularEnum",$[$.ValueModule=512]="ValueModule",$[$.NamespaceModule=1024]="NamespaceModule",$[$.TypeLiteral=2048]="TypeLiteral",$[$.ObjectLiteral=4096]="ObjectLiteral",$[$.Method=8192]="Method",$[$.Constructor=16384]="Constructor",$[$.GetAccessor=32768]="GetAccessor",$[$.SetAccessor=65536]="SetAccessor",$[$.Signature=131072]="Signature",$[$.TypeParameter=262144]="TypeParameter",$[$.TypeAlias=524288]="TypeAlias",$[$.ExportValue=1048576]="ExportValue",$[$.Alias=2097152]="Alias",$[$.Prototype=4194304]="Prototype",$[$.ExportStar=8388608]="ExportStar",$[$.Optional=16777216]="Optional",$[$.Transient=33554432]="Transient",$[$.Assignment=67108864]="Assignment",$[$.ModuleExports=134217728]="ModuleExports",$[$.All=67108863]="All",$[$.Enum=384]="Enum",$[$.Variable=3]="Variable",$[$.Value=111551]="Value",$[$.Type=788968]="Type",$[$.Namespace=1920]="Namespace",$[$.Module=1536]="Module",$[$.Accessor=98304]="Accessor",$[$.FunctionScopedVariableExcludes=111550]="FunctionScopedVariableExcludes",$[$.BlockScopedVariableExcludes=111551]="BlockScopedVariableExcludes",$[$.ParameterExcludes=111551]="ParameterExcludes",$[$.PropertyExcludes=0]="PropertyExcludes",$[$.EnumMemberExcludes=900095]="EnumMemberExcludes",$[$.FunctionExcludes=110991]="FunctionExcludes",$[$.ClassExcludes=899503]="ClassExcludes",$[$.InterfaceExcludes=788872]="InterfaceExcludes",$[$.RegularEnumExcludes=899327]="RegularEnumExcludes",$[$.ConstEnumExcludes=899967]="ConstEnumExcludes",$[$.ValueModuleExcludes=110735]="ValueModuleExcludes",$[$.NamespaceModuleExcludes=0]="NamespaceModuleExcludes",$[$.MethodExcludes=103359]="MethodExcludes",$[$.GetAccessorExcludes=46015]="GetAccessorExcludes",$[$.SetAccessorExcludes=78783]="SetAccessorExcludes",$[$.TypeParameterExcludes=526824]="TypeParameterExcludes",$[$.TypeAliasExcludes=788968]="TypeAliasExcludes",$[$.AliasExcludes=2097152]="AliasExcludes",$[$.ModuleMember=2623475]="ModuleMember",$[$.ExportHasLocal=944]="ExportHasLocal",$[$.BlockScoped=418]="BlockScoped",$[$.PropertyOrAccessor=98308]="PropertyOrAccessor",$[$.ClassMember=106500]="ClassMember",$[$.ExportSupportsDefaultModifier=112]="ExportSupportsDefaultModifier",$[$.ExportDoesNotSupportDefaultModifier=-113]="ExportDoesNotSupportDefaultModifier",$[$.Classifiable=2885600]="Classifiable",$[$.LateBindingContainer=6256]="LateBindingContainer",(Z=e.EnumKind||(e.EnumKind={}))[Z.Numeric=0]="Numeric",Z[Z.Literal=1]="Literal",(Y=e.CheckFlags||(e.CheckFlags={}))[Y.Instantiated=1]="Instantiated",Y[Y.SyntheticProperty=2]="SyntheticProperty",Y[Y.SyntheticMethod=4]="SyntheticMethod",Y[Y.Readonly=8]="Readonly",Y[Y.ReadPartial=16]="ReadPartial",Y[Y.WritePartial=32]="WritePartial",Y[Y.HasNonUniformType=64]="HasNonUniformType",Y[Y.HasLiteralType=128]="HasLiteralType",Y[Y.ContainsPublic=256]="ContainsPublic",Y[Y.ContainsProtected=512]="ContainsProtected",Y[Y.ContainsPrivate=1024]="ContainsPrivate",Y[Y.ContainsStatic=2048]="ContainsStatic",Y[Y.Late=4096]="Late",Y[Y.ReverseMapped=8192]="ReverseMapped",Y[Y.OptionalParameter=16384]="OptionalParameter",Y[Y.RestParameter=32768]="RestParameter",Y[Y.DeferredType=65536]="DeferredType",Y[Y.HasNeverType=131072]="HasNeverType",Y[Y.Mapped=262144]="Mapped",Y[Y.StripOptional=524288]="StripOptional",Y[Y.Unresolved=1048576]="Unresolved",Y[Y.Synthetic=6]="Synthetic",Y[Y.Discriminant=192]="Discriminant",Y[Y.Partial=48]="Partial",(X=e.InternalSymbolName||(e.InternalSymbolName={})).Call="__call",X.Constructor="__constructor",X.New="__new",X.Index="__index",X.ExportStar="__export",X.Global="__global",X.Missing="__missing",X.Type="__type",X.Object="__object",X.JSXAttributes="__jsxAttributes",X.Class="__class",X.Function="__function",X.Computed="__computed",X.Resolving="__resolving__",X.ExportEquals="export=",X.Default="default",X.This="this",(Q=e.NodeCheckFlags||(e.NodeCheckFlags={}))[Q.TypeChecked=1]="TypeChecked",Q[Q.LexicalThis=2]="LexicalThis",Q[Q.CaptureThis=4]="CaptureThis",Q[Q.CaptureNewTarget=8]="CaptureNewTarget",Q[Q.SuperInstance=256]="SuperInstance",Q[Q.SuperStatic=512]="SuperStatic",Q[Q.ContextChecked=1024]="ContextChecked",Q[Q.AsyncMethodWithSuper=2048]="AsyncMethodWithSuper",Q[Q.AsyncMethodWithSuperBinding=4096]="AsyncMethodWithSuperBinding",Q[Q.CaptureArguments=8192]="CaptureArguments",Q[Q.EnumValuesComputed=16384]="EnumValuesComputed",Q[Q.LexicalModuleMergesWithClass=32768]="LexicalModuleMergesWithClass",Q[Q.LoopWithCapturedBlockScopedBinding=65536]="LoopWithCapturedBlockScopedBinding",Q[Q.ContainsCapturedBlockScopeBinding=131072]="ContainsCapturedBlockScopeBinding",Q[Q.CapturedBlockScopedBinding=262144]="CapturedBlockScopedBinding",Q[Q.BlockScopedBindingInLoop=524288]="BlockScopedBindingInLoop",Q[Q.ClassWithBodyScopedClassBinding=1048576]="ClassWithBodyScopedClassBinding",Q[Q.BodyScopedClassBinding=2097152]="BodyScopedClassBinding",Q[Q.NeedsLoopOutParameter=4194304]="NeedsLoopOutParameter",Q[Q.AssignmentsMarked=8388608]="AssignmentsMarked",Q[Q.ClassWithConstructorReference=16777216]="ClassWithConstructorReference",Q[Q.ConstructorReferenceInClass=33554432]="ConstructorReferenceInClass",Q[Q.ContainsClassWithPrivateIdentifiers=67108864]="ContainsClassWithPrivateIdentifiers",Q[Q.ContainsSuperPropertyInStaticInitializer=134217728]="ContainsSuperPropertyInStaticInitializer",(G=e.TypeFlags||(e.TypeFlags={}))[G.Any=1]="Any",G[G.Unknown=2]="Unknown",G[G.String=4]="String",G[G.Number=8]="Number",G[G.Boolean=16]="Boolean",G[G.Enum=32]="Enum",G[G.BigInt=64]="BigInt",G[G.StringLiteral=128]="StringLiteral",G[G.NumberLiteral=256]="NumberLiteral",G[G.BooleanLiteral=512]="BooleanLiteral",G[G.EnumLiteral=1024]="EnumLiteral",G[G.BigIntLiteral=2048]="BigIntLiteral",G[G.ESSymbol=4096]="ESSymbol",G[G.UniqueESSymbol=8192]="UniqueESSymbol",G[G.Void=16384]="Void",G[G.Undefined=32768]="Undefined",G[G.Null=65536]="Null",G[G.Never=131072]="Never",G[G.TypeParameter=262144]="TypeParameter",G[G.Object=524288]="Object",G[G.Union=1048576]="Union",G[G.Intersection=2097152]="Intersection",G[G.Index=4194304]="Index",G[G.IndexedAccess=8388608]="IndexedAccess",G[G.Conditional=16777216]="Conditional",G[G.Substitution=33554432]="Substitution",G[G.NonPrimitive=67108864]="NonPrimitive",G[G.TemplateLiteral=134217728]="TemplateLiteral",G[G.StringMapping=268435456]="StringMapping",G[G.AnyOrUnknown=3]="AnyOrUnknown",G[G.Nullable=98304]="Nullable",G[G.Literal=2944]="Literal",G[G.Unit=109440]="Unit",G[G.StringOrNumberLiteral=384]="StringOrNumberLiteral",G[G.StringOrNumberLiteralOrUnique=8576]="StringOrNumberLiteralOrUnique",G[G.DefinitelyFalsy=117632]="DefinitelyFalsy",G[G.PossiblyFalsy=117724]="PossiblyFalsy",G[G.Intrinsic=67359327]="Intrinsic",G[G.Primitive=131068]="Primitive",G[G.StringLike=402653316]="StringLike",G[G.NumberLike=296]="NumberLike",G[G.BigIntLike=2112]="BigIntLike",G[G.BooleanLike=528]="BooleanLike",G[G.EnumLike=1056]="EnumLike",G[G.ESSymbolLike=12288]="ESSymbolLike",G[G.VoidLike=49152]="VoidLike",G[G.DisjointDomains=469892092]="DisjointDomains",G[G.UnionOrIntersection=3145728]="UnionOrIntersection",G[G.StructuredType=3670016]="StructuredType",G[G.TypeVariable=8650752]="TypeVariable",G[G.InstantiableNonPrimitive=58982400]="InstantiableNonPrimitive",G[G.InstantiablePrimitive=406847488]="InstantiablePrimitive",G[G.Instantiable=465829888]="Instantiable",G[G.StructuredOrInstantiable=469499904]="StructuredOrInstantiable",G[G.ObjectFlagsType=3899393]="ObjectFlagsType",G[G.Simplifiable=25165824]="Simplifiable",G[G.Singleton=67358815]="Singleton",G[G.Narrowable=536624127]="Narrowable",G[G.IncludesMask=205258751]="IncludesMask",G[G.IncludesMissingType=262144]="IncludesMissingType",G[G.IncludesNonWideningType=4194304]="IncludesNonWideningType",G[G.IncludesWildcard=8388608]="IncludesWildcard",G[G.IncludesEmptyObject=16777216]="IncludesEmptyObject",G[G.IncludesInstantiable=33554432]="IncludesInstantiable",G[G.NotPrimitiveUnion=36323363]="NotPrimitiveUnion",(H=e.ObjectFlags||(e.ObjectFlags={}))[H.Class=1]="Class",H[H.Interface=2]="Interface",H[H.Reference=4]="Reference",H[H.Tuple=8]="Tuple",H[H.Anonymous=16]="Anonymous",H[H.Mapped=32]="Mapped",H[H.Instantiated=64]="Instantiated",H[H.ObjectLiteral=128]="ObjectLiteral",H[H.EvolvingArray=256]="EvolvingArray",H[H.ObjectLiteralPatternWithComputedProperties=512]="ObjectLiteralPatternWithComputedProperties",H[H.ReverseMapped=1024]="ReverseMapped",H[H.JsxAttributes=2048]="JsxAttributes",H[H.MarkerType=4096]="MarkerType",H[H.JSLiteral=8192]="JSLiteral",H[H.FreshLiteral=16384]="FreshLiteral",H[H.ArrayLiteral=32768]="ArrayLiteral",H[H.PrimitiveUnion=65536]="PrimitiveUnion",H[H.ContainsWideningType=131072]="ContainsWideningType",H[H.ContainsObjectOrArrayLiteral=262144]="ContainsObjectOrArrayLiteral",H[H.NonInferrableType=524288]="NonInferrableType",H[H.CouldContainTypeVariablesComputed=1048576]="CouldContainTypeVariablesComputed",H[H.CouldContainTypeVariables=2097152]="CouldContainTypeVariables",H[H.ClassOrInterface=3]="ClassOrInterface",H[H.RequiresWidening=393216]="RequiresWidening",H[H.PropagatingFlags=917504]="PropagatingFlags",H[H.ObjectTypeKindMask=1343]="ObjectTypeKindMask",H[H.ContainsSpread=4194304]="ContainsSpread",H[H.ObjectRestType=8388608]="ObjectRestType",H[H.IsClassInstanceClone=16777216]="IsClassInstanceClone",H[H.IdenticalBaseTypeCalculated=33554432]="IdenticalBaseTypeCalculated",H[H.IdenticalBaseTypeExists=67108864]="IdenticalBaseTypeExists",H[H.IsGenericTypeComputed=4194304]="IsGenericTypeComputed",H[H.IsGenericObjectType=8388608]="IsGenericObjectType",H[H.IsGenericIndexType=16777216]="IsGenericIndexType",H[H.IsGenericType=25165824]="IsGenericType",H[H.ContainsIntersections=33554432]="ContainsIntersections",H[H.IsNeverIntersectionComputed=33554432]="IsNeverIntersectionComputed",H[H.IsNeverIntersection=67108864]="IsNeverIntersection",(W=e.VarianceFlags||(e.VarianceFlags={}))[W.Invariant=0]="Invariant",W[W.Covariant=1]="Covariant",W[W.Contravariant=2]="Contravariant",W[W.Bivariant=3]="Bivariant",W[W.Independent=4]="Independent",W[W.VarianceMask=7]="VarianceMask",W[W.Unmeasurable=8]="Unmeasurable",W[W.Unreliable=16]="Unreliable",W[W.AllowsStructuralFallback=24]="AllowsStructuralFallback",(q=e.ElementFlags||(e.ElementFlags={}))[q.Required=1]="Required",q[q.Optional=2]="Optional",q[q.Rest=4]="Rest",q[q.Variadic=8]="Variadic",q[q.Fixed=3]="Fixed",q[q.Variable=12]="Variable",q[q.NonRequired=14]="NonRequired",q[q.NonRest=11]="NonRest",(V=e.AccessFlags||(e.AccessFlags={}))[V.None=0]="None",V[V.IncludeUndefined=1]="IncludeUndefined",V[V.NoIndexSignatures=2]="NoIndexSignatures",V[V.Writing=4]="Writing",V[V.CacheSymbol=8]="CacheSymbol",V[V.NoTupleBoundsCheck=16]="NoTupleBoundsCheck",V[V.ExpressionPosition=32]="ExpressionPosition",V[V.ReportDeprecated=64]="ReportDeprecated",V[V.SuppressNoImplicitAnyError=128]="SuppressNoImplicitAnyError",V[V.Contextual=256]="Contextual",V[V.Persistent=1]="Persistent",(K=e.JsxReferenceKind||(e.JsxReferenceKind={}))[K.Component=0]="Component",K[K.Function=1]="Function",K[K.Mixed=2]="Mixed",(U=e.SignatureKind||(e.SignatureKind={}))[U.Call=0]="Call",U[U.Construct=1]="Construct",(z=e.SignatureFlags||(e.SignatureFlags={}))[z.None=0]="None",z[z.HasRestParameter=1]="HasRestParameter",z[z.HasLiteralTypes=2]="HasLiteralTypes",z[z.Abstract=4]="Abstract",z[z.IsInnerCallChain=8]="IsInnerCallChain",z[z.IsOuterCallChain=16]="IsOuterCallChain",z[z.IsUntypedSignatureInJSFile=32]="IsUntypedSignatureInJSFile",z[z.PropagatingFlags=39]="PropagatingFlags",z[z.CallChainFlags=24]="CallChainFlags",(J=e.IndexKind||(e.IndexKind={}))[J.String=0]="String",J[J.Number=1]="Number",(j=e.TypeMapKind||(e.TypeMapKind={}))[j.Simple=0]="Simple",j[j.Array=1]="Array",j[j.Function=2]="Function",j[j.Composite=3]="Composite",j[j.Merged=4]="Merged",(B=e.InferencePriority||(e.InferencePriority={}))[B.NakedTypeVariable=1]="NakedTypeVariable",B[B.SpeculativeTuple=2]="SpeculativeTuple",B[B.SubstituteSource=4]="SubstituteSource",B[B.HomomorphicMappedType=8]="HomomorphicMappedType",B[B.PartialHomomorphicMappedType=16]="PartialHomomorphicMappedType",B[B.MappedTypeConstraint=32]="MappedTypeConstraint",B[B.ContravariantConditional=64]="ContravariantConditional",B[B.ReturnType=128]="ReturnType",B[B.LiteralKeyof=256]="LiteralKeyof",B[B.NoConstraints=512]="NoConstraints",B[B.AlwaysStrict=1024]="AlwaysStrict",B[B.MaxValue=2048]="MaxValue",B[B.PriorityImpliesCombination=416]="PriorityImpliesCombination",B[B.Circularity=-1]="Circularity",(R=e.InferenceFlags||(e.InferenceFlags={}))[R.None=0]="None",R[R.NoDefault=1]="NoDefault",R[R.AnyDefault=2]="AnyDefault",R[R.SkippedGenericFunction=4]="SkippedGenericFunction",(L=e.Ternary||(e.Ternary={}))[L.False=0]="False",L[L.Unknown=1]="Unknown",L[L.Maybe=3]="Maybe",L[L.True=-1]="True",(M=e.AssignmentDeclarationKind||(e.AssignmentDeclarationKind={}))[M.None=0]="None",M[M.ExportsProperty=1]="ExportsProperty",M[M.ModuleExports=2]="ModuleExports",M[M.PrototypeProperty=3]="PrototypeProperty",M[M.ThisProperty=4]="ThisProperty",M[M.Property=5]="Property",M[M.Prototype=6]="Prototype",M[M.ObjectDefinePropertyValue=7]="ObjectDefinePropertyValue",M[M.ObjectDefinePropertyExports=8]="ObjectDefinePropertyExports",M[M.ObjectDefinePrototypeProperty=9]="ObjectDefinePrototypeProperty",function(e){e[e.Warning=0]="Warning",e[e.Error=1]="Error",e[e.Suggestion=2]="Suggestion",e[e.Message=3]="Message";}(u=e.DiagnosticCategory||(e.DiagnosticCategory={})),e.diagnosticCategoryName=function(e,t){void 0===t&&(t=!0);var r=u[e.category];return t?r.toLowerCase():r},(O=e.ModuleResolutionKind||(e.ModuleResolutionKind={}))[O.Classic=1]="Classic",O[O.NodeJs=2]="NodeJs",O[O.Node12=3]="Node12",O[O.NodeNext=99]="NodeNext",(I=e.WatchFileKind||(e.WatchFileKind={}))[I.FixedPollingInterval=0]="FixedPollingInterval",I[I.PriorityPollingInterval=1]="PriorityPollingInterval",I[I.DynamicPriorityPolling=2]="DynamicPriorityPolling",I[I.FixedChunkSizePolling=3]="FixedChunkSizePolling",I[I.UseFsEvents=4]="UseFsEvents",I[I.UseFsEventsOnParentDirectory=5]="UseFsEventsOnParentDirectory",(w=e.WatchDirectoryKind||(e.WatchDirectoryKind={}))[w.UseFsEvents=0]="UseFsEvents",w[w.FixedPollingInterval=1]="FixedPollingInterval",w[w.DynamicPriorityPolling=2]="DynamicPriorityPolling",w[w.FixedChunkSizePolling=3]="FixedChunkSizePolling",(P=e.PollingWatchKind||(e.PollingWatchKind={}))[P.FixedInterval=0]="FixedInterval",P[P.PriorityInterval=1]="PriorityInterval",P[P.DynamicPriority=2]="DynamicPriority",P[P.FixedChunkSize=3]="FixedChunkSize",(A=e.ModuleKind||(e.ModuleKind={}))[A.None=0]="None",A[A.CommonJS=1]="CommonJS",A[A.AMD=2]="AMD",A[A.UMD=3]="UMD",A[A.System=4]="System",A[A.ES2015=5]="ES2015",A[A.ES2020=6]="ES2020",A[A.ES2022=7]="ES2022",A[A.ESNext=99]="ESNext",A[A.Node12=100]="Node12",A[A.NodeNext=199]="NodeNext",(F=e.JsxEmit||(e.JsxEmit={}))[F.None=0]="None",F[F.Preserve=1]="Preserve",F[F.React=2]="React",F[F.ReactNative=3]="ReactNative",F[F.ReactJSX=4]="ReactJSX",F[F.ReactJSXDev=5]="ReactJSXDev",(N=e.ImportsNotUsedAsValues||(e.ImportsNotUsedAsValues={}))[N.Remove=0]="Remove",N[N.Preserve=1]="Preserve",N[N.Error=2]="Error",(k=e.NewLineKind||(e.NewLineKind={}))[k.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",k[k.LineFeed=1]="LineFeed",(E=e.ScriptKind||(e.ScriptKind={}))[E.Unknown=0]="Unknown",E[E.JS=1]="JS",E[E.JSX=2]="JSX",E[E.TS=3]="TS",E[E.TSX=4]="TSX",E[E.External=5]="External",E[E.JSON=6]="JSON",E[E.Deferred=7]="Deferred",(C=e.ScriptTarget||(e.ScriptTarget={}))[C.ES3=0]="ES3",C[C.ES5=1]="ES5",C[C.ES2015=2]="ES2015",C[C.ES2016=3]="ES2016",C[C.ES2017=4]="ES2017",C[C.ES2018=5]="ES2018",C[C.ES2019=6]="ES2019",C[C.ES2020=7]="ES2020",C[C.ES2021=8]="ES2021",C[C.ESNext=99]="ESNext",C[C.JSON=100]="JSON",C[C.Latest=99]="Latest",(T=e.LanguageVariant||(e.LanguageVariant={}))[T.Standard=0]="Standard",T[T.JSX=1]="JSX",(S=e.WatchDirectoryFlags||(e.WatchDirectoryFlags={}))[S.None=0]="None",S[S.Recursive=1]="Recursive",(D=e.CharacterCodes||(e.CharacterCodes={}))[D.nullCharacter=0]="nullCharacter",D[D.maxAsciiCharacter=127]="maxAsciiCharacter",D[D.lineFeed=10]="lineFeed",D[D.carriageReturn=13]="carriageReturn",D[D.lineSeparator=8232]="lineSeparator",D[D.paragraphSeparator=8233]="paragraphSeparator",D[D.nextLine=133]="nextLine",D[D.space=32]="space",D[D.nonBreakingSpace=160]="nonBreakingSpace",D[D.enQuad=8192]="enQuad",D[D.emQuad=8193]="emQuad",D[D.enSpace=8194]="enSpace",D[D.emSpace=8195]="emSpace",D[D.threePerEmSpace=8196]="threePerEmSpace",D[D.fourPerEmSpace=8197]="fourPerEmSpace",D[D.sixPerEmSpace=8198]="sixPerEmSpace",D[D.figureSpace=8199]="figureSpace",D[D.punctuationSpace=8200]="punctuationSpace",D[D.thinSpace=8201]="thinSpace",D[D.hairSpace=8202]="hairSpace",D[D.zeroWidthSpace=8203]="zeroWidthSpace",D[D.narrowNoBreakSpace=8239]="narrowNoBreakSpace",D[D.ideographicSpace=12288]="ideographicSpace",D[D.mathematicalSpace=8287]="mathematicalSpace",D[D.ogham=5760]="ogham",D[D._=95]="_",D[D.$=36]="$",D[D._0=48]="_0",D[D._1=49]="_1",D[D._2=50]="_2",D[D._3=51]="_3",D[D._4=52]="_4",D[D._5=53]="_5",D[D._6=54]="_6",D[D._7=55]="_7",D[D._8=56]="_8",D[D._9=57]="_9",D[D.a=97]="a",D[D.b=98]="b",D[D.c=99]="c",D[D.d=100]="d",D[D.e=101]="e",D[D.f=102]="f",D[D.g=103]="g",D[D.h=104]="h",D[D.i=105]="i",D[D.j=106]="j",D[D.k=107]="k",D[D.l=108]="l",D[D.m=109]="m",D[D.n=110]="n",D[D.o=111]="o",D[D.p=112]="p",D[D.q=113]="q",D[D.r=114]="r",D[D.s=115]="s",D[D.t=116]="t",D[D.u=117]="u",D[D.v=118]="v",D[D.w=119]="w",D[D.x=120]="x",D[D.y=121]="y",D[D.z=122]="z",D[D.A=65]="A",D[D.B=66]="B",D[D.C=67]="C",D[D.D=68]="D",D[D.E=69]="E",D[D.F=70]="F",D[D.G=71]="G",D[D.H=72]="H",D[D.I=73]="I",D[D.J=74]="J",D[D.K=75]="K",D[D.L=76]="L",D[D.M=77]="M",D[D.N=78]="N",D[D.O=79]="O",D[D.P=80]="P",D[D.Q=81]="Q",D[D.R=82]="R",D[D.S=83]="S",D[D.T=84]="T",D[D.U=85]="U",D[D.V=86]="V",D[D.W=87]="W",D[D.X=88]="X",D[D.Y=89]="Y",D[D.Z=90]="Z",D[D.ampersand=38]="ampersand",D[D.asterisk=42]="asterisk",D[D.at=64]="at",D[D.backslash=92]="backslash",D[D.backtick=96]="backtick",D[D.bar=124]="bar",D[D.caret=94]="caret",D[D.closeBrace=125]="closeBrace",D[D.closeBracket=93]="closeBracket",D[D.closeParen=41]="closeParen",D[D.colon=58]="colon",D[D.comma=44]="comma",D[D.dot=46]="dot",D[D.doubleQuote=34]="doubleQuote",D[D.equals=61]="equals",D[D.exclamation=33]="exclamation",D[D.greaterThan=62]="greaterThan",D[D.hash=35]="hash",D[D.lessThan=60]="lessThan",D[D.minus=45]="minus",D[D.openBrace=123]="openBrace",D[D.openBracket=91]="openBracket",D[D.openParen=40]="openParen",D[D.percent=37]="percent",D[D.plus=43]="plus",D[D.question=63]="question",D[D.semicolon=59]="semicolon",D[D.singleQuote=39]="singleQuote",D[D.slash=47]="slash",D[D.tilde=126]="tilde",D[D.backspace=8]="backspace",D[D.formFeed=12]="formFeed",D[D.byteOrderMark=65279]="byteOrderMark",D[D.tab=9]="tab",D[D.verticalTab=11]="verticalTab",(x=e.Extension||(e.Extension={})).Ts=".ts",x.Tsx=".tsx",x.Dts=".d.ts",x.Js=".js",x.Jsx=".jsx",x.Json=".json",x.TsBuildInfo=".tsbuildinfo",x.Mjs=".mjs",x.Mts=".mts",x.Dmts=".d.mts",x.Cjs=".cjs",x.Cts=".cts",x.Dcts=".d.cts",(b=e.TransformFlags||(e.TransformFlags={}))[b.None=0]="None",b[b.ContainsTypeScript=1]="ContainsTypeScript",b[b.ContainsJsx=2]="ContainsJsx",b[b.ContainsESNext=4]="ContainsESNext",b[b.ContainsES2021=8]="ContainsES2021",b[b.ContainsES2020=16]="ContainsES2020",b[b.ContainsES2019=32]="ContainsES2019",b[b.ContainsES2018=64]="ContainsES2018",b[b.ContainsES2017=128]="ContainsES2017",b[b.ContainsES2016=256]="ContainsES2016",b[b.ContainsES2015=512]="ContainsES2015",b[b.ContainsGenerator=1024]="ContainsGenerator",b[b.ContainsDestructuringAssignment=2048]="ContainsDestructuringAssignment",b[b.ContainsTypeScriptClassSyntax=4096]="ContainsTypeScriptClassSyntax",b[b.ContainsLexicalThis=8192]="ContainsLexicalThis",b[b.ContainsRestOrSpread=16384]="ContainsRestOrSpread",b[b.ContainsObjectRestOrSpread=32768]="ContainsObjectRestOrSpread",b[b.ContainsComputedPropertyName=65536]="ContainsComputedPropertyName",b[b.ContainsBlockScopedBinding=131072]="ContainsBlockScopedBinding",b[b.ContainsBindingPattern=262144]="ContainsBindingPattern",b[b.ContainsYield=524288]="ContainsYield",b[b.ContainsAwait=1048576]="ContainsAwait",b[b.ContainsHoistedDeclarationOrCompletion=2097152]="ContainsHoistedDeclarationOrCompletion",b[b.ContainsDynamicImport=4194304]="ContainsDynamicImport",b[b.ContainsClassFields=8388608]="ContainsClassFields",b[b.ContainsPossibleTopLevelAwait=16777216]="ContainsPossibleTopLevelAwait",b[b.ContainsLexicalSuper=33554432]="ContainsLexicalSuper",b[b.ContainsUpdateExpressionForIdentifier=67108864]="ContainsUpdateExpressionForIdentifier",b[b.HasComputedFlags=536870912]="HasComputedFlags",b[b.AssertTypeScript=1]="AssertTypeScript",b[b.AssertJsx=2]="AssertJsx",b[b.AssertESNext=4]="AssertESNext",b[b.AssertES2021=8]="AssertES2021",b[b.AssertES2020=16]="AssertES2020",b[b.AssertES2019=32]="AssertES2019",b[b.AssertES2018=64]="AssertES2018",b[b.AssertES2017=128]="AssertES2017",b[b.AssertES2016=256]="AssertES2016",b[b.AssertES2015=512]="AssertES2015",b[b.AssertGenerator=1024]="AssertGenerator",b[b.AssertDestructuringAssignment=2048]="AssertDestructuringAssignment",b[b.OuterExpressionExcludes=536870912]="OuterExpressionExcludes",b[b.PropertyAccessExcludes=536870912]="PropertyAccessExcludes",b[b.NodeExcludes=536870912]="NodeExcludes",b[b.ArrowFunctionExcludes=557748224]="ArrowFunctionExcludes",b[b.FunctionExcludes=591310848]="FunctionExcludes",b[b.ConstructorExcludes=591306752]="ConstructorExcludes",b[b.MethodOrAccessorExcludes=574529536]="MethodOrAccessorExcludes",b[b.PropertyExcludes=570433536]="PropertyExcludes",b[b.ClassExcludes=536940544]="ClassExcludes",b[b.ModuleExcludes=589443072]="ModuleExcludes",b[b.TypeExcludes=-2]="TypeExcludes",b[b.ObjectLiteralExcludes=536973312]="ObjectLiteralExcludes",b[b.ArrayLiteralOrCallOrNewExcludes=536887296]="ArrayLiteralOrCallOrNewExcludes",b[b.VariableDeclarationListExcludes=537165824]="VariableDeclarationListExcludes",b[b.ParameterExcludes=536870912]="ParameterExcludes",b[b.CatchClauseExcludes=536903680]="CatchClauseExcludes",b[b.BindingPatternExcludes=536887296]="BindingPatternExcludes",b[b.ContainsLexicalThisOrSuper=33562624]="ContainsLexicalThisOrSuper",b[b.PropertyNamePropagatingFlags=33562624]="PropertyNamePropagatingFlags",(h=e.SnippetKind||(e.SnippetKind={}))[h.TabStop=0]="TabStop",h[h.Placeholder=1]="Placeholder",h[h.Choice=2]="Choice",h[h.Variable=3]="Variable",(v=e.EmitFlags||(e.EmitFlags={}))[v.None=0]="None",v[v.SingleLine=1]="SingleLine",v[v.AdviseOnEmitNode=2]="AdviseOnEmitNode",v[v.NoSubstitution=4]="NoSubstitution",v[v.CapturesThis=8]="CapturesThis",v[v.NoLeadingSourceMap=16]="NoLeadingSourceMap",v[v.NoTrailingSourceMap=32]="NoTrailingSourceMap",v[v.NoSourceMap=48]="NoSourceMap",v[v.NoNestedSourceMaps=64]="NoNestedSourceMaps",v[v.NoTokenLeadingSourceMaps=128]="NoTokenLeadingSourceMaps",v[v.NoTokenTrailingSourceMaps=256]="NoTokenTrailingSourceMaps",v[v.NoTokenSourceMaps=384]="NoTokenSourceMaps",v[v.NoLeadingComments=512]="NoLeadingComments",v[v.NoTrailingComments=1024]="NoTrailingComments",v[v.NoComments=1536]="NoComments",v[v.NoNestedComments=2048]="NoNestedComments",v[v.HelperName=4096]="HelperName",v[v.ExportName=8192]="ExportName",v[v.LocalName=16384]="LocalName",v[v.InternalName=32768]="InternalName",v[v.Indented=65536]="Indented",v[v.NoIndentation=131072]="NoIndentation",v[v.AsyncFunctionBody=262144]="AsyncFunctionBody",v[v.ReuseTempVariableScope=524288]="ReuseTempVariableScope",v[v.CustomPrologue=1048576]="CustomPrologue",v[v.NoHoisting=2097152]="NoHoisting",v[v.HasEndOfDeclarationMarker=4194304]="HasEndOfDeclarationMarker",v[v.Iterator=8388608]="Iterator",v[v.NoAsciiEscaping=16777216]="NoAsciiEscaping",v[v.TypeScriptClassWrapper=33554432]="TypeScriptClassWrapper",v[v.NeverApplyImportHelper=67108864]="NeverApplyImportHelper",v[v.IgnoreSourceNewlines=134217728]="IgnoreSourceNewlines",v[v.Immutable=268435456]="Immutable",v[v.IndirectCall=536870912]="IndirectCall",(y=e.ExternalEmitHelpers||(e.ExternalEmitHelpers={}))[y.Extends=1]="Extends",y[y.Assign=2]="Assign",y[y.Rest=4]="Rest",y[y.Decorate=8]="Decorate",y[y.Metadata=16]="Metadata",y[y.Param=32]="Param",y[y.Awaiter=64]="Awaiter",y[y.Generator=128]="Generator",y[y.Values=256]="Values",y[y.Read=512]="Read",y[y.SpreadArray=1024]="SpreadArray",y[y.Await=2048]="Await",y[y.AsyncGenerator=4096]="AsyncGenerator",y[y.AsyncDelegator=8192]="AsyncDelegator",y[y.AsyncValues=16384]="AsyncValues",y[y.ExportStar=32768]="ExportStar",y[y.ImportStar=65536]="ImportStar",y[y.ImportDefault=131072]="ImportDefault",y[y.MakeTemplateObject=262144]="MakeTemplateObject",y[y.ClassPrivateFieldGet=524288]="ClassPrivateFieldGet",y[y.ClassPrivateFieldSet=1048576]="ClassPrivateFieldSet",y[y.ClassPrivateFieldIn=2097152]="ClassPrivateFieldIn",y[y.CreateBinding=4194304]="CreateBinding",y[y.FirstEmitHelper=1]="FirstEmitHelper",y[y.LastEmitHelper=4194304]="LastEmitHelper",y[y.ForOfIncludes=256]="ForOfIncludes",y[y.ForAwaitOfIncludes=16384]="ForAwaitOfIncludes",y[y.AsyncGeneratorIncludes=6144]="AsyncGeneratorIncludes",y[y.AsyncDelegatorIncludes=26624]="AsyncDelegatorIncludes",y[y.SpreadIncludes=1536]="SpreadIncludes",(m=e.EmitHint||(e.EmitHint={}))[m.SourceFile=0]="SourceFile",m[m.Expression=1]="Expression",m[m.IdentifierName=2]="IdentifierName",m[m.MappedTypeParameter=3]="MappedTypeParameter",m[m.Unspecified=4]="Unspecified",m[m.EmbeddedStatement=5]="EmbeddedStatement",m[m.JsxAttributeValue=6]="JsxAttributeValue",(g=e.OuterExpressionKinds||(e.OuterExpressionKinds={}))[g.Parentheses=1]="Parentheses",g[g.TypeAssertions=2]="TypeAssertions",g[g.NonNullAssertions=4]="NonNullAssertions",g[g.PartiallyEmittedExpressions=8]="PartiallyEmittedExpressions",g[g.Assertions=6]="Assertions",g[g.All=15]="All",g[g.ExcludeJSDocTypeAssertion=16]="ExcludeJSDocTypeAssertion",(f=e.LexicalEnvironmentFlags||(e.LexicalEnvironmentFlags={}))[f.None=0]="None",f[f.InParameters=1]="InParameters",f[f.VariablesHoistedInParameters=2]="VariablesHoistedInParameters",(p=e.BundleFileSectionKind||(e.BundleFileSectionKind={})).Prologue="prologue",p.EmitHelpers="emitHelpers",p.NoDefaultLib="no-default-lib",p.Reference="reference",p.Type="type",p.Lib="lib",p.Prepend="prepend",p.Text="text",p.Internal="internal",(d=e.ListFormat||(e.ListFormat={}))[d.None=0]="None",d[d.SingleLine=0]="SingleLine",d[d.MultiLine=1]="MultiLine",d[d.PreserveLines=2]="PreserveLines",d[d.LinesMask=3]="LinesMask",d[d.NotDelimited=0]="NotDelimited",d[d.BarDelimited=4]="BarDelimited",d[d.AmpersandDelimited=8]="AmpersandDelimited",d[d.CommaDelimited=16]="CommaDelimited",d[d.AsteriskDelimited=32]="AsteriskDelimited",d[d.DelimitersMask=60]="DelimitersMask",d[d.AllowTrailingComma=64]="AllowTrailingComma",d[d.Indented=128]="Indented",d[d.SpaceBetweenBraces=256]="SpaceBetweenBraces",d[d.SpaceBetweenSiblings=512]="SpaceBetweenSiblings",d[d.Braces=1024]="Braces",d[d.Parenthesis=2048]="Parenthesis",d[d.AngleBrackets=4096]="AngleBrackets",d[d.SquareBrackets=8192]="SquareBrackets",d[d.BracketsMask=15360]="BracketsMask",d[d.OptionalIfUndefined=16384]="OptionalIfUndefined",d[d.OptionalIfEmpty=32768]="OptionalIfEmpty",d[d.Optional=49152]="Optional",d[d.PreferNewLine=65536]="PreferNewLine",d[d.NoTrailingNewLine=131072]="NoTrailingNewLine",d[d.NoInterveningComments=262144]="NoInterveningComments",d[d.NoSpaceIfEmpty=524288]="NoSpaceIfEmpty",d[d.SingleElement=1048576]="SingleElement",d[d.SpaceAfterList=2097152]="SpaceAfterList",d[d.Modifiers=262656]="Modifiers",d[d.HeritageClauses=512]="HeritageClauses",d[d.SingleLineTypeLiteralMembers=768]="SingleLineTypeLiteralMembers",d[d.MultiLineTypeLiteralMembers=32897]="MultiLineTypeLiteralMembers",d[d.SingleLineTupleTypeElements=528]="SingleLineTupleTypeElements",d[d.MultiLineTupleTypeElements=657]="MultiLineTupleTypeElements",d[d.UnionTypeConstituents=516]="UnionTypeConstituents",d[d.IntersectionTypeConstituents=520]="IntersectionTypeConstituents",d[d.ObjectBindingPatternElements=525136]="ObjectBindingPatternElements",d[d.ArrayBindingPatternElements=524880]="ArrayBindingPatternElements",d[d.ObjectLiteralExpressionProperties=526226]="ObjectLiteralExpressionProperties",d[d.ImportClauseEntries=526226]="ImportClauseEntries",d[d.ArrayLiteralExpressionElements=8914]="ArrayLiteralExpressionElements",d[d.CommaListElements=528]="CommaListElements",d[d.CallExpressionArguments=2576]="CallExpressionArguments",d[d.NewExpressionArguments=18960]="NewExpressionArguments",d[d.TemplateExpressionSpans=262144]="TemplateExpressionSpans",d[d.SingleLineBlockStatements=768]="SingleLineBlockStatements",d[d.MultiLineBlockStatements=129]="MultiLineBlockStatements",d[d.VariableDeclarationList=528]="VariableDeclarationList",d[d.SingleLineFunctionBodyStatements=768]="SingleLineFunctionBodyStatements",d[d.MultiLineFunctionBodyStatements=1]="MultiLineFunctionBodyStatements",d[d.ClassHeritageClauses=0]="ClassHeritageClauses",d[d.ClassMembers=129]="ClassMembers",d[d.InterfaceMembers=129]="InterfaceMembers",d[d.EnumMembers=145]="EnumMembers",d[d.CaseBlockClauses=129]="CaseBlockClauses",d[d.NamedImportsOrExportsElements=525136]="NamedImportsOrExportsElements",d[d.JsxElementOrFragmentChildren=262144]="JsxElementOrFragmentChildren",d[d.JsxElementAttributes=262656]="JsxElementAttributes",d[d.CaseOrDefaultClauseStatements=163969]="CaseOrDefaultClauseStatements",d[d.HeritageClauseTypes=528]="HeritageClauseTypes",d[d.SourceFileStatements=131073]="SourceFileStatements",d[d.Decorators=2146305]="Decorators",d[d.TypeArguments=53776]="TypeArguments",d[d.TypeParameters=53776]="TypeParameters",d[d.Parameters=2576]="Parameters",d[d.IndexSignatureParameters=8848]="IndexSignatureParameters",d[d.JSDocComment=33]="JSDocComment",(_=e.PragmaKindFlags||(e.PragmaKindFlags={}))[_.None=0]="None",_[_.TripleSlashXML=1]="TripleSlashXML",_[_.SingleLine=2]="SingleLine",_[_.MultiLine=4]="MultiLine",_[_.All=7]="All",_[_.Default=7]="Default",e.commentPragmas={reference:{args:[{name:"types",optional:!0,captureSpan:!0},{name:"lib",optional:!0,captureSpan:!0},{name:"path",optional:!0,captureSpan:!0},{name:"no-default-lib",optional:!0}],kind:1},"amd-dependency":{args:[{name:"path"},{name:"name",optional:!0}],kind:1},"amd-module":{args:[{name:"name"}],kind:1},"ts-check":{kind:2},"ts-nocheck":{kind:2},jsx:{args:[{name:"factory"}],kind:4},jsxfrag:{args:[{name:"factory"}],kind:4},jsximportsource:{args:[{name:"factory"}],kind:4},jsxruntime:{args:[{name:"factory"}],kind:4}};}(t),function(e){e.directorySeparator="/",e.altDirectorySeparator="\\";var t=/\\/g;function r(e){return 47===e||92===e}function i(e){return u(e)>0}function a(e){return 0!==u(e)}function o(e){return /^\.\.?($|[\\/])/.test(e)}function s(t,r){return t.length>r.length&&e.endsWith(t,r)}function c(e){return e.length>0&&r(e.charCodeAt(e.length-1))}function l(e){return e>=97&&e<=122||e>=65&&e<=90}function u(t){if(!t)return 0;var r=t.charCodeAt(0);if(47===r||92===r){if(t.charCodeAt(1)!==r)return 1;var n=t.indexOf(47===r?e.directorySeparator:e.altDirectorySeparator,2);return n<0?t.length:n+1}if(l(r)&&58===t.charCodeAt(1)){var i=t.charCodeAt(2);if(47===i||92===i)return 3;if(2===t.length)return 2}var a=t.indexOf("://");if(-1!==a){var o=a+"://".length,s=t.indexOf(e.directorySeparator,o);if(-1!==s){var c=t.slice(0,a),u=t.slice(o,s);if("file"===c&&(""===u||"localhost"===u)&&l(t.charCodeAt(s+1))){var _=function(e,t){var r=e.charCodeAt(t);if(58===r)return t+1;if(37===r&&51===e.charCodeAt(t+1)){var n=e.charCodeAt(t+2);if(97===n||65===n)return t+3}return -1}(t,s+2);if(-1!==_){if(47===t.charCodeAt(_))return ~(_+1);if(_===t.length)return ~_}}return ~(s+1)}return ~t.length}return 0}function _(e){var t=u(e);return t<0?~t:t}function d(t){var r=_(t=v(t));return r===t.length?t:(t=C(t)).slice(0,Math.max(r,t.lastIndexOf(e.directorySeparator)))}function p(t,r,n){if(_(t=v(t))===t.length)return "";var i=(t=C(t)).slice(Math.max(_(t),t.lastIndexOf(e.directorySeparator)+1)),a=void 0!==r&&void 0!==n?g(i,r,n):void 0;return a?i.slice(0,i.length-a.length):i}function f(t,r,n){if(e.startsWith(r,".")||(r="."+r),t.length>=r.length&&46===t.charCodeAt(t.length-r.length)){var i=t.slice(t.length-r.length);if(n(i,r))return i}}function g(t,r,n){if(r)return function(e,t,r){if("string"==typeof t)return f(e,t,r)||"";for(var n=0,i=t;n<i.length;n++){var a=f(e,i[n],r);if(a)return a}return ""}(C(t),r,n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive);var i=p(t),a=i.lastIndexOf(".");return a>=0?i.substring(a):""}function m(t,r){return void 0===r&&(r=""),function(t,r){var i=t.substring(0,r),a=t.substring(r).split(e.directorySeparator);return a.length&&!e.lastOrUndefined(a)&&a.pop(),n$3([i],a,!0)}(t=b(r,t),_(t))}function y(t){return 0===t.length?"":(t[0]&&E(t[0]))+t.slice(1).join(e.directorySeparator)}function v(r){var n=r.indexOf("\\");return -1===n?r:(t.lastIndex=n,r.replace(t,e.directorySeparator))}function h(t){if(!e.some(t))return [];for(var r=[t[0]],n=1;n<t.length;n++){var i=t[n];if(i&&"."!==i){if(".."===i)if(r.length>1){if(".."!==r[r.length-1]){r.pop();continue}}else if(r[0])continue;r.push(i);}}return r}function b(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];e&&(e=v(e));for(var n=0,i=t;n<i.length;n++){var a=i[n];a&&(a=v(a),e=e&&0===_(a)?E(e)+a:a);}return e}function x(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return T(e.some(r)?b.apply(void 0,n$3([t],r,!1)):v(t))}function D(e,t){return h(m(e,t))}function S(e,t){return y(D(e,t))}function T(e){if(e=v(e),!N.test(e))return e;var t=e.replace(/\/\.\//g,"/").replace(/^\.\//,"");if(t!==e&&(e=t,!N.test(e)))return e;var r=y(h(m(e)));return r&&c(e)?E(r):r}function C(e){return c(e)?e.substr(0,e.length-1):e}function E(t){return c(t)?t:t+e.directorySeparator}function k(e){return a(e)||o(e)?e:"./"+e}e.isAnyDirectorySeparator=r,e.isUrl=function(e){return u(e)<0},e.isRootedDiskPath=i,e.isDiskPathRoot=function(e){var t=u(e);return t>0&&t===e.length},e.pathIsAbsolute=a,e.pathIsRelative=o,e.pathIsBareSpecifier=function(e){return !a(e)&&!o(e)},e.hasExtension=function(t){return e.stringContains(p(t),".")},e.fileExtensionIs=s,e.fileExtensionIsOneOf=function(e,t){for(var r=0,n=t;r<n.length;r++)if(s(e,n[r]))return !0;return !1},e.hasTrailingDirectorySeparator=c,e.getRootLength=_,e.getDirectoryPath=d,e.getBaseFileName=p,e.getAnyExtensionFromPath=g,e.getPathComponents=m,e.getPathFromPathComponents=y,e.normalizeSlashes=v,e.reducePathComponents=h,e.combinePaths=b,e.resolvePath=x,e.getNormalizedPathComponents=D,e.getNormalizedAbsolutePath=S,e.normalizePath=T,e.getNormalizedAbsolutePathWithoutRoot=function(t,r){return 0===(n=D(t,r)).length?"":n.slice(1).join(e.directorySeparator);var n;},e.toPath=function(e,t,r){return r(i(e)?T(e):S(e,t))},e.normalizePathAndParts=function(t){var r=h(m(t=v(t))),n=r[0],i=r.slice(1);if(i.length){var a=n+i.join(e.directorySeparator);return {path:c(t)?E(a):a,parts:i}}return {path:n,parts:i}},e.removeTrailingDirectorySeparator=C,e.ensureTrailingDirectorySeparator=E,e.ensurePathIsNonModuleName=k,e.changeAnyExtension=function(t,r,n,i){var a=void 0!==n&&void 0!==i?g(t,n,i):g(t);return a?t.slice(0,t.length-a.length)+(e.startsWith(r,".")?r:"."+r):t};var N=/(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;function F(t,r,n){if(t===r)return 0;if(void 0===t)return -1;if(void 0===r)return 1;var i=t.substring(0,_(t)),a=r.substring(0,_(r)),o=e.compareStringsCaseInsensitive(i,a);if(0!==o)return o;var s=t.substring(i.length),c=r.substring(a.length);if(!N.test(s)&&!N.test(c))return n(s,c);for(var l=h(m(t)),u=h(m(r)),d=Math.min(l.length,u.length),p=1;p<d;p++){var f=n(l[p],u[p]);if(0!==f)return f}return e.compareValues(l.length,u.length)}function A(t,r,i,a){var o,s=h(m(t)),c=h(m(r));for(o=0;o<s.length&&o<c.length;o++){var l=a(s[o]),u=a(c[o]);if(!(0===o?e.equateStringsCaseInsensitive:i)(l,u))break}if(0===o)return c;for(var _=c.slice(o),d=[];o<s.length;o++)d.push("..");return n$3(n$3([""],d,!0),_,!0)}function P(t,r,n){e.Debug.assert(_(t)>0==_(r)>0,"Paths must either both be absolute or both be relative");var i="function"==typeof n?n:e.identity;return y(A(t,r,"boolean"==typeof n&&n?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,i))}function w(t,r,n,a,o){var s=A(x(n,t),x(n,r),e.equateStringsCaseSensitive,a),c=s[0];if(o&&i(c)){var l=c.charAt(0)===e.directorySeparator?"file://":"file:///";s[0]=l+c;}return y(s)}e.comparePathsCaseSensitive=function(t,r){return F(t,r,e.compareStringsCaseSensitive)},e.comparePathsCaseInsensitive=function(t,r){return F(t,r,e.compareStringsCaseInsensitive)},e.comparePaths=function(t,r,n,i){return "string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),F(t,r,e.getStringComparer(i))},e.containsPath=function(t,r,n,i){if("string"==typeof n?(t=b(n,t),r=b(n,r)):"boolean"==typeof n&&(i=n),void 0===t||void 0===r)return !1;if(t===r)return !0;var a=h(m(t)),o=h(m(r));if(o.length<a.length)return !1;for(var s=i?e.equateStringsCaseInsensitive:e.equateStringsCaseSensitive,c=0;c<a.length;c++)if(!(0===c?e.equateStringsCaseInsensitive:s)(a[c],o[c]))return !1;return !0},e.startsWithDirectory=function(t,r,n){var i=n(t),a=n(r);return e.startsWith(i,a+"/")||e.startsWith(i,a+"\\")},e.getPathComponentsRelativeTo=A,e.getRelativePathFromDirectory=P,e.convertToRelativePath=function(e,t,r){return i(e)?w(t,e,t,r,!1):e},e.getRelativePathFromFile=function(e,t,r){return k(P(d(e),t,r))},e.getRelativePathToDirectoryOrUrl=w,e.forEachAncestorDirectory=function(e,t){for(;;){var r=t(e);if(void 0!==r)return r;var n=d(e);if(n===e)return;e=n;}},e.isNodeModulesDirectory=function(t){return e.endsWith(t,"/node_modules")};}(t),function(e){function t(e){for(var t=5381,r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r);return t.toString()}var r,n;function a(t,r){return t.getModifiedTime(r)||e.missingFileModifiedTime}function o(e){var t;return (t={})[n.Low]=e.Low,t[n.Medium]=e.Medium,t[n.High]=e.High,t}e.generateDjb2Hash=t,e.setStackTraceLimit=function(){Error.stackTraceLimit<100&&(Error.stackTraceLimit=100);},function(e){e[e.Created=0]="Created",e[e.Changed=1]="Changed",e[e.Deleted=2]="Deleted";}(r=e.FileWatcherEventKind||(e.FileWatcherEventKind={})),function(e){e[e.High=2e3]="High",e[e.Medium=500]="Medium",e[e.Low=250]="Low";}(n=e.PollingInterval||(e.PollingInterval={})),e.missingFileModifiedTime=new Date(0),e.getModifiedTime=a;var s,c,l={Low:32,Medium:64,High:256},u=o(l);function _(t){if(t.getEnvironmentVariable){var r=function(e,t){var r=a("TSC_WATCH_POLLINGINTERVAL");return !!r&&(n("Low"),n("Medium"),n("High"),!0);function n(e){t[e]=r[e]||t[e];}}(0,n);u=s("TSC_WATCH_POLLINGCHUNKSIZE",l)||u,e.unchangedPollThresholds=s("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS",l)||e.unchangedPollThresholds;}function a(e){var r;return n("Low"),n("Medium"),n("High"),r;function n(n){var i=function(e,r){return t.getEnvironmentVariable("".concat(e,"_").concat(r.toUpperCase()))}(e,n);i&&((r||(r={}))[n]=Number(i));}}function s(e,t){var n=a(e);return (r||n)&&o(n?i$1(i$1({},t),n):t)}}function d(e,t,r,n,i){for(var o=r,s=t.length;n&&s;++r===t.length&&(o<r&&(t.length=o),r=0,o=0),s--){var c=t[r];if(c)if(c.isClosed)t[r]=void 0;else {n--;var l=m(c,a(e,c.fileName));c.isClosed?t[r]=void 0:(null==i||i(c,r,l),t[r]&&(o<r&&(t[o]=c,t[r]=void 0),o++));}}return r}function p(t){var r=[],i=[],o=l(n.Low),s=l(n.Medium),c=l(n.High);return function(n,i,o){var s={fileName:n,callback:i,unchangedPolls:0,mtime:a(t,n)};return r.push(s),m(s,o),{close:function(){s.isClosed=!0,e.unorderedRemoveItem(r,s);}}};function l(e){var t=[];return t.pollingInterval=e,t.pollIndex=0,t.pollScheduled=!1,t}function _(t){t.pollIndex=f(t,t.pollingInterval,t.pollIndex,u[t.pollingInterval]),t.length?v(t.pollingInterval):(e.Debug.assert(0===t.pollIndex),t.pollScheduled=!1);}function p(e){f(i,n.Low,0,i.length),_(e),!e.pollScheduled&&i.length&&v(n.Low);}function f(r,a,o,s){return d(t,r,o,s,(function(t,o,s){var c;s?(t.unchangedPolls=0,r!==i&&(r[o]=void 0,c=t,i.push(c),y(n.Low))):t.unchangedPolls!==e.unchangedPollThresholds[a]?t.unchangedPolls++:r===i?(t.unchangedPolls=1,r[o]=void 0,m(t,n.Low)):a!==n.High&&(t.unchangedPolls++,r[o]=void 0,m(t,a===n.Low?n.Medium:n.High));}))}function g(e){switch(e){case n.Low:return o;case n.Medium:return s;case n.High:return c}}function m(e,t){g(t).push(e),y(t);}function y(e){g(e).pollScheduled||v(e);}function v(e){g(e).pollScheduled=t.setTimeout(e===n.Low?p:_,e,g(e));}}function f(t){var r,i=[],o=0;return function(r,n){var o={fileName:r,callback:n,mtime:a(t,r)};return i.push(o),c(),{close:function(){o.isClosed=!0,e.unorderedRemoveItem(i,o);}}};function s(){r=void 0,o=d(t,i,o,u[n.Low]),c();}function c(){i.length&&!r&&(r=t.setTimeout(s,n.High));}}function g(t,r){var n=new e.Map,i=e.createMultiMap(),a=e.createGetCanonicalFileName(r);return function(r,o,s,c){var l=a(r),u=n.get(l);return u?u.refCount++:n.set(l,{watcher:t(r,(function(t,r){return e.forEach(i.get(l),(function(e){return e(t,r)}))}),s,c),refCount:1}),i.add(l,o),{close:function(){var t=e.Debug.checkDefined(n.get(l));i.remove(l,o),t.refCount--,t.refCount||(n.delete(l),e.closeFileWatcherOf(t));}}}}function m(e,t){var r=e.mtime.getTime(),n=t.getTime();return r!==n&&(e.mtime=t,e.callback(e.fileName,y(r,n)),!0)}function y(e,t){return 0===e?r.Created:0===t?r.Deleted:r.Changed}function v(t){var r,n=t.watchDirectory,i=t.useCaseSensitiveFileNames,a=t.getCurrentDirectory,o=t.getAccessibleSortedChildDirectories,s=t.directoryExists,c=t.realpath,l=t.setTimeout,u=t.clearTimeout,_=new e.Map,d=e.createMultiMap(),p=new e.Map,f=e.getStringComparer(!i),g=e.createGetCanonicalFileName(i);return function(e,t,r,i){return r?m(e,i,t):n(e,t,r,i)};function m(t,i,a){var o=g(t),c=_.get(o);c?c.refCount++:(c={watcher:n(t,(function(e){D(e,i)||((null==i?void 0:i.synchronousWatchDirectory)?(y(o,e),x(t,o,i)):function(e,t,n,i){var a=_.get(t);a&&s(e)?function(e,t,n,i){var a=p.get(t);a?a.fileNames.push(n):p.set(t,{dirName:e,options:i,fileNames:[n]}),r&&(u(r),r=void 0),r=l(v,1e3);}(e,t,n,i):(y(t,n),h(a));}(t,o,e,i));}),!1,i),refCount:1,childWatches:e.emptyArray},_.set(o,c),x(t,o,i));var f=a&&{dirName:t,callback:a};return f&&d.add(o,f),{dirName:t,close:function(){var t=e.Debug.checkDefined(_.get(o));f&&d.remove(o,f),t.refCount--,t.refCount||(_.delete(o),e.closeFileWatcherOf(t),t.childWatches.forEach(e.closeFileWatcher));}}}function y(t,r,n){var i,a;e.isString(r)?i=r:a=r,d.forEach((function(r,o){var s;if((!a||!0!==a.get(o))&&(o===t||e.startsWith(t,o)&&t[o.length]===e.directorySeparator))if(a)if(n){var c=a.get(o);c?(s=c).push.apply(s,n):a.set(o,n.slice());}else a.set(o,!0);else r.forEach((function(e){return (0, e.callback)(i)}));}));}function v(){r=void 0,e.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(p.size));for(var t=e.timestamp(),n=new e.Map;!r&&p.size;){var i=p.entries().next();e.Debug.assert(!i.done);var a=i.value,o=a[0],s=a[1],c=s.dirName,l=s.options,u=s.fileNames;p.delete(o);var _=x(c,o,l);y(o,n,_?void 0:u);}e.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(e.timestamp()-t,"ms:: ").concat(p.size)),d.forEach((function(t,r){var i=n.get(r);i&&t.forEach((function(t){var r=t.callback,n=t.dirName;e.isArray(i)?i.forEach(r):r(n);}));}));var f=e.timestamp()-t;e.sysLog("sysLog:: Elapsed:: ".concat(f,"ms:: onTimerToUpdateChildWatches:: ").concat(p.size," ").concat(r));}function h(t){if(t){var r=t.childWatches;t.childWatches=e.emptyArray;for(var n=0,i=r;n<i.length;n++){var a=i[n];a.close(),h(_.get(g(a.dirName)));}}}function x(t,r,n){var i,a=_.get(r);if(!a)return !1;var l=e.enumerateInsertsAndDeletes(s(t)?e.mapDefined(o(t),(function(r){var i=e.getNormalizedAbsolutePath(r,t);return D(i,n)||0!==f(i,e.normalizePath(c(i)))?void 0:i})):e.emptyArray,a.childWatches,(function(e,t){return f(e,t.dirName)}),(function(e){u(m(e,n));}),e.closeFileWatcher,u);return a.childWatches=i||e.emptyArray,l;function u(e){(i||(i=[])).push(e);}}function D(t,r){return e.some(e.ignoredPaths,(function(r){return function(t,r){return !!e.stringContains(t,r)||!i&&e.stringContains(g(t),r)}(t,r)}))||b(t,r,i,a)}}function h(e){return function(t,n){return e(n===r.Changed?"change":"rename","")}}function b(t,r,n,i){return ((null==r?void 0:r.excludeDirectories)||(null==r?void 0:r.excludeFiles))&&(e.matchesExclude(t,null==r?void 0:r.excludeFiles,n,i())||e.matchesExclude(t,null==r?void 0:r.excludeDirectories,n,i()))}function x(t,r,n,i,a){return function(o,s){if("rename"===o){var c=s?e.normalizePath(e.combinePaths(t,s)):t;s&&b(c,n,i,a)||r(c);}}}function D(t){var i,a,o,s,c=t.pollingWatchFile,l=t.getModifiedTime,u=t.setTimeout,_=t.clearTimeout,d=t.fsWatch,g=t.fileExists,m=t.useCaseSensitiveFileNames,y=t.getCurrentDirectory,h=t.fsSupportsRecursiveFsWatch,b=t.directoryExists,D=t.getAccessibleSortedChildDirectories,S=t.realpath,T=t.tscWatchFile,C=t.useNonPollingWatchers,E=t.tscWatchDirectory,k=t.defaultWatchFileKind;return {watchFile:function(t,i,a,s){s=function(t,r){if(t&&void 0!==t.watchFile)return t;switch(T){case"PriorityPollingInterval":return {watchFile:e.WatchFileKind.PriorityPollingInterval};case"DynamicPriorityPolling":return {watchFile:e.WatchFileKind.DynamicPriorityPolling};case"UseFsEvents":return A(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.PriorityInterval,t);case"UseFsEventsWithFallbackDynamicPolling":return A(e.WatchFileKind.UseFsEvents,e.PollingWatchKind.DynamicPriority,t);case"UseFsEventsOnParentDirectory":r=!0;default:return r?A(e.WatchFileKind.UseFsEventsOnParentDirectory,e.PollingWatchKind.PriorityInterval,t):{watchFile:(null==k?void 0:k())||e.WatchFileKind.FixedPollingInterval}}}(s,C);var l=e.Debug.checkDefined(s.watchFile);switch(l){case e.WatchFileKind.FixedPollingInterval:return c(t,i,n.Low,void 0);case e.WatchFileKind.PriorityPollingInterval:return c(t,i,a,void 0);case e.WatchFileKind.DynamicPriorityPolling:return N()(t,i,a,void 0);case e.WatchFileKind.FixedChunkSizePolling:return F()(t,i,void 0,void 0);case e.WatchFileKind.UseFsEvents:return d(t,0,function(e,t,n){return function(i){t(e,"rename"===i?n(e)?r.Created:r.Deleted:r.Changed);}}(t,i,g),!1,a,e.getFallbackOptions(s));case e.WatchFileKind.UseFsEventsOnParentDirectory:return o||(o=function(t,i){var a=e.createMultiMap(),o=new e.Map,s=e.createGetCanonicalFileName(i);return function(i,c,l,u){var _=s(i);a.add(_,c);var d=e.getDirectoryPath(_)||".",p=o.get(d)||function(i,c,l){var u=t(i,1,(function(t,n){if(e.isString(n)){var o=e.getNormalizedAbsolutePath(n,i),c=o&&a.get(s(o));if(c)for(var l=0,u=c;l<u.length;l++)(0, u[l])(o,r.Changed);}}),!1,n.Medium,l);return u.referenceCount=0,o.set(c,u),u}(e.getDirectoryPath(i)||".",d,u);return p.referenceCount++,{close:function(){1===p.referenceCount?(p.close(),o.delete(d)):p.referenceCount--,a.remove(_,c);}}}}(d,m)),o(t,i,a,e.getFallbackOptions(s));default:e.Debug.assertNever(l);}},watchDirectory:function(t,r,i,a){return h?d(t,1,x(t,r,a,m,y),i,n.Medium,e.getFallbackOptions(a)):(s||(s=v({useCaseSensitiveFileNames:m,getCurrentDirectory:y,directoryExists:b,getAccessibleSortedChildDirectories:D,watchDirectory:P,realpath:S,setTimeout:u,clearTimeout:_})),s(t,r,i,a))}};function N(){return i||(i=p({getModifiedTime:l,setTimeout:u}))}function F(){return a||(a=f({getModifiedTime:l,setTimeout:u}))}function A(e,t,r){var n=null==r?void 0:r.fallbackPolling;return {watchFile:e,fallbackPolling:void 0===n?t:n}}function P(t,r,i,a){e.Debug.assert(!i);var o=function(t){if(t&&void 0!==t.watchDirectory)return t;switch(E){case"RecursiveDirectoryUsingFsWatchFile":return {watchDirectory:e.WatchDirectoryKind.FixedPollingInterval};case"RecursiveDirectoryUsingDynamicPriorityPolling":return {watchDirectory:e.WatchDirectoryKind.DynamicPriorityPolling};default:var r=null==t?void 0:t.fallbackPolling;return {watchDirectory:e.WatchDirectoryKind.UseFsEvents,fallbackPolling:void 0!==r?r:void 0}}}(a),s=e.Debug.checkDefined(o.watchDirectory);switch(s){case e.WatchDirectoryKind.FixedPollingInterval:return c(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.DynamicPriorityPolling:return N()(t,(function(){return r(t)}),n.Medium,void 0);case e.WatchDirectoryKind.FixedChunkSizePolling:return F()(t,(function(){return r(t)}),void 0,void 0);case e.WatchDirectoryKind.UseFsEvents:return d(t,1,x(t,r,a,m,y),i,n.Medium,e.getFallbackOptions(o));default:e.Debug.assertNever(s);}}}function S(t){var r=t.writeFile;t.writeFile=function(n,i,a){return e.writeFileEnsuringDirectories(n,i,!!a,(function(e,n,i){return r.call(t,e,n,i)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)}))};}function T(){if("undefined"!=typeof process){var e=process.version;if(e){var t=e.indexOf(".");if(-1!==t)return parseInt(e.substring(1,t))}}}e.unchangedPollThresholds=o(l),e.setCustomPollingValues=_,e.createDynamicPriorityPollingWatchFile=p,e.createSingleFileWatcherPerName=g,e.onWatchedFileStat=m,e.getFileWatcherEventKind=y,e.ignoredPaths=["/node_modules/.","/.git","/.#"],e.sysLog=e.noop,e.setSysLog=function(t){e.sysLog=t;},e.createDirectoryWatcherSupportingRecursive=v,(c=e.FileSystemEntryKind||(e.FileSystemEntryKind={}))[c.File=0]="File",c[c.Directory=1]="Directory",e.createFileWatcherCallback=h,e.createSystemWatchFunctions=D,e.patchWriteFileEnsuringDirectory=S,e.getNodeMajorVersion=T,e.sys=("undefined"!=typeof process&&process.nextTick&&!process.browser&&"undefined"!=typeof require&&(s=function(){var n,i,c=require("fs"),l=require("path"),u=require("os");try{i=require("crypto");}catch(e){i=void 0;}var _,p=!1,f=require("buffer").Buffer,m=T()>=4,y="linux"===process.platform||"darwin"===process.platform,v=u.platform(),b="win32"!==v&&"win64"!==v&&!O((_=__filename,_.replace(/\w/g,(function(e){var t=e.toUpperCase();return e===t?e.toLowerCase():t})))),x=null!==(n=c.realpathSync.native)&&void 0!==n?n:c.realpathSync,S=m&&("win32"===process.platform||"darwin"===process.platform),C=e.memoize((function(){return process.cwd()})),E=D({pollingWatchFile:g((function(e,t,n){var i;return c.watchFile(e,{persistent:!0,interval:n},a),{close:function(){return c.unwatchFile(e,a)}};function a(n,a){var o=0==+a.mtime||i===r.Deleted;if(0==+n.mtime){if(o)return;i=r.Deleted;}else if(o)i=r.Created;else {if(+n.mtime==+a.mtime)return;i=r.Changed;}t(e,i);}}),b),getModifiedTime:R,setTimeout,clearTimeout,fsWatch:function(t,n,i,a,o,s){var l,u,_;y&&(u=t.substr(t.lastIndexOf(e.directorySeparator)),_=u.slice(e.directorySeparator.length));var d=I(t,n)?g():b();return {close:function(){d.close(),d=void 0;}};function f(r){e.sysLog("sysLog:: ".concat(t,":: Changing watcher to ").concat(r===g?"Present":"Missing","FileSystemEntryWatcher")),i("rename",""),d&&(d.close(),d=r());}function g(){if(void 0===l&&(l=S?{persistent:!0,recursive:!!a}:{persistent:!0}),p)return e.sysLog("sysLog:: ".concat(t,":: Defaulting to fsWatchFile")),v();try{var r=c.watch(t,l,y?m:i);return r.on("error",(function(){return f(b)})),r}catch(r){return p||(p="ENOSPC"===r.code),e.sysLog("sysLog:: ".concat(t,":: Changing to fsWatchFile")),v()}}function m(e,r){return "rename"!==e||r&&r!==_&&(-1===r.lastIndexOf(u)||r.lastIndexOf(u)!==r.length-u.length)||I(t,n)?i(e,r):f(b)}function v(){return k(t,h(i),o,s)}function b(){return k(t,(function(e,i){i===r.Created&&I(t,n)&&f(g);}),o,s)}},useCaseSensitiveFileNames:b,getCurrentDirectory:C,fileExists:O,fsSupportsRecursiveFsWatch:S,directoryExists:M,getAccessibleSortedChildDirectories:function(e){return w(e).directories},realpath:L,tscWatchFile:process.env.TSC_WATCHFILE,useNonPollingWatchers:process.env.TSC_NONPOLLING_WATCHER,tscWatchDirectory:process.env.TSC_WATCHDIRECTORY,defaultWatchFileKind:function(){var e,t;return null===(t=(e=s).defaultWatchFileKind)||void 0===t?void 0:t.call(e)}}),k=E.watchFile,N=E.watchDirectory,F={args:process.argv.slice(2),newLine:u.EOL,useCaseSensitiveFileNames:b,write:function(e){process.stdout.write(e);},getWidthOfTerminal:function(){return process.stdout.columns},writeOutputIsTTY:function(){return process.stdout.isTTY},readFile:function(t,r){e.perfLogger.logStartReadFile(t);var n=function(e,t){var r;try{r=c.readFileSync(e);}catch(e){return}var n=r.length;if(n>=2&&254===r[0]&&255===r[1]){n&=-2;for(var i=0;i<n;i+=2){var a=r[i];r[i]=r[i+1],r[i+1]=a;}return r.toString("utf16le",2)}return n>=2&&255===r[0]&&254===r[1]?r.toString("utf16le",2):n>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.toString("utf8",3):r.toString("utf8")}(t);return e.perfLogger.logStopReadFile(),n},writeFile:function(t,r,n){var i;e.perfLogger.logEvent("WriteFile: "+t),n&&(r="\ufeff"+r);try{i=c.openSync(t,"w"),c.writeSync(i,r,void 0,"utf8");}finally{void 0!==i&&c.closeSync(i);}},watchFile:k,watchDirectory:N,resolvePath:function(e){return l.resolve(e)},fileExists:O,directoryExists:M,createDirectory:function(e){if(!F.directoryExists(e))try{c.mkdirSync(e);}catch(e){if("EEXIST"!==e.code)throw e}},getExecutingFilePath:function(){return __filename},getCurrentDirectory:C,getDirectories:function(e){return w(e).directories.slice()},getEnvironmentVariable:function(e){return process.env[e]||""},readDirectory:function(t,r,n,i,a){return e.matchFiles(t,r,n,i,b,process.cwd(),a,w,L)},getModifiedTime:R,setModifiedTime:function(e,t){try{c.utimesSync(e,t,t);}catch(e){return}},deleteFile:function(e){try{return c.unlinkSync(e)}catch(e){return}},createHash:i?B:t,createSHA256Hash:i?B:void 0,getMemoryUsage:function(){return global.gc&&global.gc(),process.memoryUsage().heapUsed},getFileSize:function(e){try{var t=A(e);if(null==t?void 0:t.isFile())return t.size}catch(e){}return 0},exit:function(t){!function(t){t();}((function(){return process.exit(t)}));},cpuProfilingEnabled:function(){return e.contains(process.execArgv,"--cpu-prof")||e.contains(process.execArgv,"--prof")},realpath:L,debugMode:!!process.env.NODE_INSPECTOR_IPC||!!process.env.VSCODE_INSPECTOR_OPTIONS||e.some(process.execArgv,(function(e){return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(e)})),tryEnableSourceMapsForHost:function(){try{require("source-map-support").install();}catch(e){}},setTimeout,clearTimeout,clearScreen:function(){process.stdout.write("c");},setBlocking:function(){process.stdout&&process.stdout._handle&&process.stdout._handle.setBlocking&&process.stdout._handle.setBlocking(!0);},bufferFrom:P,base64decode:function(e){return P(e,"base64").toString("utf8")},base64encode:function(e){return P(e).toString("base64")},require:function(t,r){try{var n=e.resolveJSModule(r,t,F);return {module:require(n),modulePath:n,error:void 0}}catch(e){return {module:void 0,modulePath:void 0,error:e}}}};return F;function A(e){return c.statSync(e,{throwIfNoEntry:!1})}function P(e,t){return f.from&&f.from!==Int8Array.from?f.from(e,t):new f(e,t)}function w(t){e.perfLogger.logEvent("ReadDir: "+(t||"."));try{for(var r=c.readdirSync(t||".",{withFileTypes:!0}),n=[],i=[],a=0,o=r;a<o.length;a++){var s=o[a],l="string"==typeof s?s:s.name;if("."!==l&&".."!==l){var u=void 0;if("string"==typeof s||s.isSymbolicLink()){var _=e.combinePaths(t,l);try{if(!(u=A(_)))continue}catch(e){continue}}else u=s;u.isFile()?n.push(l):u.isDirectory()&&i.push(l);}}return n.sort(),i.sort(),{files:n,directories:i}}catch(t){return e.emptyFileSystemEntries}}function I(e,t){var r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{var n=A(e);if(!n)return !1;switch(t){case 0:return n.isFile();case 1:return n.isDirectory();default:return !1}}catch(e){return !1}finally{Error.stackTraceLimit=r;}}function O(e){return I(e,0)}function M(e){return I(e,1)}function L(e){try{return x(e)}catch(t){return e}}function R(e){var t;try{return null===(t=A(e))||void 0===t?void 0:t.mtime}catch(e){return}}function B(e){var t=i.createHash("sha256");return t.update(e),t.digest("hex")}}()),s&&S(s),s),e.setSys=function(t){e.sys=t;},e.sys&&e.sys.getEnvironmentVariable&&(_(e.sys),e.Debug.setAssertionLevel(/^development$/i.test(e.sys.getEnvironmentVariable("NODE_ENV"))?1:0)),e.sys&&e.sys.debugMode&&(e.Debug.isDebugging=!0);}(t),function(e){function t(e,t,r,n,i,a,o){return {code:e,category:t,key:r,message:n,reportsUnnecessary:i,elidedInCompatabilityPyramid:a,reportsDeprecated:o}}e.Diagnostics={Unterminated_string_literal:t(1002,e.DiagnosticCategory.Error,"Unterminated_string_literal_1002","Unterminated string literal."),Identifier_expected:t(1003,e.DiagnosticCategory.Error,"Identifier_expected_1003","Identifier expected."),_0_expected:t(1005,e.DiagnosticCategory.Error,"_0_expected_1005","'{0}' expected."),A_file_cannot_have_a_reference_to_itself:t(1006,e.DiagnosticCategory.Error,"A_file_cannot_have_a_reference_to_itself_1006","A file cannot have a reference to itself."),The_parser_expected_to_find_a_to_match_the_token_here:t(1007,e.DiagnosticCategory.Error,"The_parser_expected_to_find_a_to_match_the_token_here_1007","The parser expected to find a '}' to match the '{' token here."),Trailing_comma_not_allowed:t(1009,e.DiagnosticCategory.Error,"Trailing_comma_not_allowed_1009","Trailing comma not allowed."),Asterisk_Slash_expected:t(1010,e.DiagnosticCategory.Error,"Asterisk_Slash_expected_1010","'*/' expected."),An_element_access_expression_should_take_an_argument:t(1011,e.DiagnosticCategory.Error,"An_element_access_expression_should_take_an_argument_1011","An element access expression should take an argument."),Unexpected_token:t(1012,e.DiagnosticCategory.Error,"Unexpected_token_1012","Unexpected token."),A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma:t(1013,e.DiagnosticCategory.Error,"A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013","A rest parameter or binding pattern may not have a trailing comma."),A_rest_parameter_must_be_last_in_a_parameter_list:t(1014,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_last_in_a_parameter_list_1014","A rest parameter must be last in a parameter list."),Parameter_cannot_have_question_mark_and_initializer:t(1015,e.DiagnosticCategory.Error,"Parameter_cannot_have_question_mark_and_initializer_1015","Parameter cannot have question mark and initializer."),A_required_parameter_cannot_follow_an_optional_parameter:t(1016,e.DiagnosticCategory.Error,"A_required_parameter_cannot_follow_an_optional_parameter_1016","A required parameter cannot follow an optional parameter."),An_index_signature_cannot_have_a_rest_parameter:t(1017,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_rest_parameter_1017","An index signature cannot have a rest parameter."),An_index_signature_parameter_cannot_have_an_accessibility_modifier:t(1018,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018","An index signature parameter cannot have an accessibility modifier."),An_index_signature_parameter_cannot_have_a_question_mark:t(1019,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_a_question_mark_1019","An index signature parameter cannot have a question mark."),An_index_signature_parameter_cannot_have_an_initializer:t(1020,e.DiagnosticCategory.Error,"An_index_signature_parameter_cannot_have_an_initializer_1020","An index signature parameter cannot have an initializer."),An_index_signature_must_have_a_type_annotation:t(1021,e.DiagnosticCategory.Error,"An_index_signature_must_have_a_type_annotation_1021","An index signature must have a type annotation."),An_index_signature_parameter_must_have_a_type_annotation:t(1022,e.DiagnosticCategory.Error,"An_index_signature_parameter_must_have_a_type_annotation_1022","An index signature parameter must have a type annotation."),readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature:t(1024,e.DiagnosticCategory.Error,"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024","'readonly' modifier can only appear on a property declaration or index signature."),An_index_signature_cannot_have_a_trailing_comma:t(1025,e.DiagnosticCategory.Error,"An_index_signature_cannot_have_a_trailing_comma_1025","An index signature cannot have a trailing comma."),Accessibility_modifier_already_seen:t(1028,e.DiagnosticCategory.Error,"Accessibility_modifier_already_seen_1028","Accessibility modifier already seen."),_0_modifier_must_precede_1_modifier:t(1029,e.DiagnosticCategory.Error,"_0_modifier_must_precede_1_modifier_1029","'{0}' modifier must precede '{1}' modifier."),_0_modifier_already_seen:t(1030,e.DiagnosticCategory.Error,"_0_modifier_already_seen_1030","'{0}' modifier already seen."),_0_modifier_cannot_appear_on_class_elements_of_this_kind:t(1031,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031","'{0}' modifier cannot appear on class elements of this kind."),super_must_be_followed_by_an_argument_list_or_member_access:t(1034,e.DiagnosticCategory.Error,"super_must_be_followed_by_an_argument_list_or_member_access_1034","'super' must be followed by an argument list or member access."),Only_ambient_modules_can_use_quoted_names:t(1035,e.DiagnosticCategory.Error,"Only_ambient_modules_can_use_quoted_names_1035","Only ambient modules can use quoted names."),Statements_are_not_allowed_in_ambient_contexts:t(1036,e.DiagnosticCategory.Error,"Statements_are_not_allowed_in_ambient_contexts_1036","Statements are not allowed in ambient contexts."),A_declare_modifier_cannot_be_used_in_an_already_ambient_context:t(1038,e.DiagnosticCategory.Error,"A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038","A 'declare' modifier cannot be used in an already ambient context."),Initializers_are_not_allowed_in_ambient_contexts:t(1039,e.DiagnosticCategory.Error,"Initializers_are_not_allowed_in_ambient_contexts_1039","Initializers are not allowed in ambient contexts."),_0_modifier_cannot_be_used_in_an_ambient_context:t(1040,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_in_an_ambient_context_1040","'{0}' modifier cannot be used in an ambient context."),_0_modifier_cannot_be_used_here:t(1042,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_here_1042","'{0}' modifier cannot be used here."),_0_modifier_cannot_appear_on_a_module_or_namespace_element:t(1044,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044","'{0}' modifier cannot appear on a module or namespace element."),Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier:t(1046,e.DiagnosticCategory.Error,"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046","Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."),A_rest_parameter_cannot_be_optional:t(1047,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_be_optional_1047","A rest parameter cannot be optional."),A_rest_parameter_cannot_have_an_initializer:t(1048,e.DiagnosticCategory.Error,"A_rest_parameter_cannot_have_an_initializer_1048","A rest parameter cannot have an initializer."),A_set_accessor_must_have_exactly_one_parameter:t(1049,e.DiagnosticCategory.Error,"A_set_accessor_must_have_exactly_one_parameter_1049","A 'set' accessor must have exactly one parameter."),A_set_accessor_cannot_have_an_optional_parameter:t(1051,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_an_optional_parameter_1051","A 'set' accessor cannot have an optional parameter."),A_set_accessor_parameter_cannot_have_an_initializer:t(1052,e.DiagnosticCategory.Error,"A_set_accessor_parameter_cannot_have_an_initializer_1052","A 'set' accessor parameter cannot have an initializer."),A_set_accessor_cannot_have_rest_parameter:t(1053,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_rest_parameter_1053","A 'set' accessor cannot have rest parameter."),A_get_accessor_cannot_have_parameters:t(1054,e.DiagnosticCategory.Error,"A_get_accessor_cannot_have_parameters_1054","A 'get' accessor cannot have parameters."),Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value:t(1055,e.DiagnosticCategory.Error,"Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055","Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."),Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher:t(1056,e.DiagnosticCategory.Error,"Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056","Accessors are only available when targeting ECMAScript 5 and higher."),The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1058,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058","The return type of an async function must either be a valid promise or must not contain a callable 'then' member."),A_promise_must_have_a_then_method:t(1059,e.DiagnosticCategory.Error,"A_promise_must_have_a_then_method_1059","A promise must have a 'then' method."),The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback:t(1060,e.DiagnosticCategory.Error,"The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060","The first parameter of the 'then' method of a promise must be a callback."),Enum_member_must_have_initializer:t(1061,e.DiagnosticCategory.Error,"Enum_member_must_have_initializer_1061","Enum member must have initializer."),Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method:t(1062,e.DiagnosticCategory.Error,"Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062","Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."),An_export_assignment_cannot_be_used_in_a_namespace:t(1063,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_namespace_1063","An export assignment cannot be used in a namespace."),The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0:t(1064,e.DiagnosticCategory.Error,"The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064","The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?"),In_ambient_enum_declarations_member_initializer_must_be_constant_expression:t(1066,e.DiagnosticCategory.Error,"In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066","In ambient enum declarations member initializer must be constant expression."),Unexpected_token_A_constructor_method_accessor_or_property_was_expected:t(1068,e.DiagnosticCategory.Error,"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068","Unexpected token. A constructor, method, accessor, or property was expected."),Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces:t(1069,e.DiagnosticCategory.Error,"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069","Unexpected token. A type parameter name was expected without curly braces."),_0_modifier_cannot_appear_on_a_type_member:t(1070,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_type_member_1070","'{0}' modifier cannot appear on a type member."),_0_modifier_cannot_appear_on_an_index_signature:t(1071,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_an_index_signature_1071","'{0}' modifier cannot appear on an index signature."),A_0_modifier_cannot_be_used_with_an_import_declaration:t(1079,e.DiagnosticCategory.Error,"A_0_modifier_cannot_be_used_with_an_import_declaration_1079","A '{0}' modifier cannot be used with an import declaration."),Invalid_reference_directive_syntax:t(1084,e.DiagnosticCategory.Error,"Invalid_reference_directive_syntax_1084","Invalid 'reference' directive syntax."),Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:t(1085,e.DiagnosticCategory.Error,"Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085","Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."),_0_modifier_cannot_appear_on_a_constructor_declaration:t(1089,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_constructor_declaration_1089","'{0}' modifier cannot appear on a constructor declaration."),_0_modifier_cannot_appear_on_a_parameter:t(1090,e.DiagnosticCategory.Error,"_0_modifier_cannot_appear_on_a_parameter_1090","'{0}' modifier cannot appear on a parameter."),Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:t(1091,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091","Only a single variable declaration is allowed in a 'for...in' statement."),Type_parameters_cannot_appear_on_a_constructor_declaration:t(1092,e.DiagnosticCategory.Error,"Type_parameters_cannot_appear_on_a_constructor_declaration_1092","Type parameters cannot appear on a constructor declaration."),Type_annotation_cannot_appear_on_a_constructor_declaration:t(1093,e.DiagnosticCategory.Error,"Type_annotation_cannot_appear_on_a_constructor_declaration_1093","Type annotation cannot appear on a constructor declaration."),An_accessor_cannot_have_type_parameters:t(1094,e.DiagnosticCategory.Error,"An_accessor_cannot_have_type_parameters_1094","An accessor cannot have type parameters."),A_set_accessor_cannot_have_a_return_type_annotation:t(1095,e.DiagnosticCategory.Error,"A_set_accessor_cannot_have_a_return_type_annotation_1095","A 'set' accessor cannot have a return type annotation."),An_index_signature_must_have_exactly_one_parameter:t(1096,e.DiagnosticCategory.Error,"An_index_signature_must_have_exactly_one_parameter_1096","An index signature must have exactly one parameter."),_0_list_cannot_be_empty:t(1097,e.DiagnosticCategory.Error,"_0_list_cannot_be_empty_1097","'{0}' list cannot be empty."),Type_parameter_list_cannot_be_empty:t(1098,e.DiagnosticCategory.Error,"Type_parameter_list_cannot_be_empty_1098","Type parameter list cannot be empty."),Type_argument_list_cannot_be_empty:t(1099,e.DiagnosticCategory.Error,"Type_argument_list_cannot_be_empty_1099","Type argument list cannot be empty."),Invalid_use_of_0_in_strict_mode:t(1100,e.DiagnosticCategory.Error,"Invalid_use_of_0_in_strict_mode_1100","Invalid use of '{0}' in strict mode."),with_statements_are_not_allowed_in_strict_mode:t(1101,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_strict_mode_1101","'with' statements are not allowed in strict mode."),delete_cannot_be_called_on_an_identifier_in_strict_mode:t(1102,e.DiagnosticCategory.Error,"delete_cannot_be_called_on_an_identifier_in_strict_mode_1102","'delete' cannot be called on an identifier in strict mode."),for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1103,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103","'for await' loops are only allowed within async functions and at the top levels of modules."),A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement:t(1104,e.DiagnosticCategory.Error,"A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104","A 'continue' statement can only be used within an enclosing iteration statement."),A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:t(1105,e.DiagnosticCategory.Error,"A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105","A 'break' statement can only be used within an enclosing iteration or switch statement."),The_left_hand_side_of_a_for_of_statement_may_not_be_async:t(1106,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106","The left-hand side of a 'for...of' statement may not be 'async'."),Jump_target_cannot_cross_function_boundary:t(1107,e.DiagnosticCategory.Error,"Jump_target_cannot_cross_function_boundary_1107","Jump target cannot cross function boundary."),A_return_statement_can_only_be_used_within_a_function_body:t(1108,e.DiagnosticCategory.Error,"A_return_statement_can_only_be_used_within_a_function_body_1108","A 'return' statement can only be used within a function body."),Expression_expected:t(1109,e.DiagnosticCategory.Error,"Expression_expected_1109","Expression expected."),Type_expected:t(1110,e.DiagnosticCategory.Error,"Type_expected_1110","Type expected."),A_default_clause_cannot_appear_more_than_once_in_a_switch_statement:t(1113,e.DiagnosticCategory.Error,"A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113","A 'default' clause cannot appear more than once in a 'switch' statement."),Duplicate_label_0:t(1114,e.DiagnosticCategory.Error,"Duplicate_label_0_1114","Duplicate label '{0}'."),A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement:t(1115,e.DiagnosticCategory.Error,"A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115","A 'continue' statement can only jump to a label of an enclosing iteration statement."),A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:t(1116,e.DiagnosticCategory.Error,"A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116","A 'break' statement can only jump to a label of an enclosing statement."),An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode:t(1117,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117","An object literal cannot have multiple properties with the same name in strict mode."),An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name:t(1118,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118","An object literal cannot have multiple get/set accessors with the same name."),An_object_literal_cannot_have_property_and_accessor_with_the_same_name:t(1119,e.DiagnosticCategory.Error,"An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119","An object literal cannot have property and accessor with the same name."),An_export_assignment_cannot_have_modifiers:t(1120,e.DiagnosticCategory.Error,"An_export_assignment_cannot_have_modifiers_1120","An export assignment cannot have modifiers."),Octal_literals_are_not_allowed_in_strict_mode:t(1121,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_strict_mode_1121","Octal literals are not allowed in strict mode."),Variable_declaration_list_cannot_be_empty:t(1123,e.DiagnosticCategory.Error,"Variable_declaration_list_cannot_be_empty_1123","Variable declaration list cannot be empty."),Digit_expected:t(1124,e.DiagnosticCategory.Error,"Digit_expected_1124","Digit expected."),Hexadecimal_digit_expected:t(1125,e.DiagnosticCategory.Error,"Hexadecimal_digit_expected_1125","Hexadecimal digit expected."),Unexpected_end_of_text:t(1126,e.DiagnosticCategory.Error,"Unexpected_end_of_text_1126","Unexpected end of text."),Invalid_character:t(1127,e.DiagnosticCategory.Error,"Invalid_character_1127","Invalid character."),Declaration_or_statement_expected:t(1128,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_1128","Declaration or statement expected."),Statement_expected:t(1129,e.DiagnosticCategory.Error,"Statement_expected_1129","Statement expected."),case_or_default_expected:t(1130,e.DiagnosticCategory.Error,"case_or_default_expected_1130","'case' or 'default' expected."),Property_or_signature_expected:t(1131,e.DiagnosticCategory.Error,"Property_or_signature_expected_1131","Property or signature expected."),Enum_member_expected:t(1132,e.DiagnosticCategory.Error,"Enum_member_expected_1132","Enum member expected."),Variable_declaration_expected:t(1134,e.DiagnosticCategory.Error,"Variable_declaration_expected_1134","Variable declaration expected."),Argument_expression_expected:t(1135,e.DiagnosticCategory.Error,"Argument_expression_expected_1135","Argument expression expected."),Property_assignment_expected:t(1136,e.DiagnosticCategory.Error,"Property_assignment_expected_1136","Property assignment expected."),Expression_or_comma_expected:t(1137,e.DiagnosticCategory.Error,"Expression_or_comma_expected_1137","Expression or comma expected."),Parameter_declaration_expected:t(1138,e.DiagnosticCategory.Error,"Parameter_declaration_expected_1138","Parameter declaration expected."),Type_parameter_declaration_expected:t(1139,e.DiagnosticCategory.Error,"Type_parameter_declaration_expected_1139","Type parameter declaration expected."),Type_argument_expected:t(1140,e.DiagnosticCategory.Error,"Type_argument_expected_1140","Type argument expected."),String_literal_expected:t(1141,e.DiagnosticCategory.Error,"String_literal_expected_1141","String literal expected."),Line_break_not_permitted_here:t(1142,e.DiagnosticCategory.Error,"Line_break_not_permitted_here_1142","Line break not permitted here."),or_expected:t(1144,e.DiagnosticCategory.Error,"or_expected_1144","'{' or ';' expected."),Declaration_expected:t(1146,e.DiagnosticCategory.Error,"Declaration_expected_1146","Declaration expected."),Import_declarations_in_a_namespace_cannot_reference_a_module:t(1147,e.DiagnosticCategory.Error,"Import_declarations_in_a_namespace_cannot_reference_a_module_1147","Import declarations in a namespace cannot reference a module."),Cannot_use_imports_exports_or_module_augmentations_when_module_is_none:t(1148,e.DiagnosticCategory.Error,"Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148","Cannot use imports, exports, or module augmentations when '--module' is 'none'."),File_name_0_differs_from_already_included_file_name_1_only_in_casing:t(1149,e.DiagnosticCategory.Error,"File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149","File name '{0}' differs from already included file name '{1}' only in casing."),const_declarations_must_be_initialized:t(1155,e.DiagnosticCategory.Error,"const_declarations_must_be_initialized_1155","'const' declarations must be initialized."),const_declarations_can_only_be_declared_inside_a_block:t(1156,e.DiagnosticCategory.Error,"const_declarations_can_only_be_declared_inside_a_block_1156","'const' declarations can only be declared inside a block."),let_declarations_can_only_be_declared_inside_a_block:t(1157,e.DiagnosticCategory.Error,"let_declarations_can_only_be_declared_inside_a_block_1157","'let' declarations can only be declared inside a block."),Unterminated_template_literal:t(1160,e.DiagnosticCategory.Error,"Unterminated_template_literal_1160","Unterminated template literal."),Unterminated_regular_expression_literal:t(1161,e.DiagnosticCategory.Error,"Unterminated_regular_expression_literal_1161","Unterminated regular expression literal."),An_object_member_cannot_be_declared_optional:t(1162,e.DiagnosticCategory.Error,"An_object_member_cannot_be_declared_optional_1162","An object member cannot be declared optional."),A_yield_expression_is_only_allowed_in_a_generator_body:t(1163,e.DiagnosticCategory.Error,"A_yield_expression_is_only_allowed_in_a_generator_body_1163","A 'yield' expression is only allowed in a generator body."),Computed_property_names_are_not_allowed_in_enums:t(1164,e.DiagnosticCategory.Error,"Computed_property_names_are_not_allowed_in_enums_1164","Computed property names are not allowed in enums."),A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1165,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165","A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type:t(1166,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166","A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."),A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1168,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168","A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1169,e.DiagnosticCategory.Error,"A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169","A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type:t(1170,e.DiagnosticCategory.Error,"A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170","A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."),A_comma_expression_is_not_allowed_in_a_computed_property_name:t(1171,e.DiagnosticCategory.Error,"A_comma_expression_is_not_allowed_in_a_computed_property_name_1171","A comma expression is not allowed in a computed property name."),extends_clause_already_seen:t(1172,e.DiagnosticCategory.Error,"extends_clause_already_seen_1172","'extends' clause already seen."),extends_clause_must_precede_implements_clause:t(1173,e.DiagnosticCategory.Error,"extends_clause_must_precede_implements_clause_1173","'extends' clause must precede 'implements' clause."),Classes_can_only_extend_a_single_class:t(1174,e.DiagnosticCategory.Error,"Classes_can_only_extend_a_single_class_1174","Classes can only extend a single class."),implements_clause_already_seen:t(1175,e.DiagnosticCategory.Error,"implements_clause_already_seen_1175","'implements' clause already seen."),Interface_declaration_cannot_have_implements_clause:t(1176,e.DiagnosticCategory.Error,"Interface_declaration_cannot_have_implements_clause_1176","Interface declaration cannot have 'implements' clause."),Binary_digit_expected:t(1177,e.DiagnosticCategory.Error,"Binary_digit_expected_1177","Binary digit expected."),Octal_digit_expected:t(1178,e.DiagnosticCategory.Error,"Octal_digit_expected_1178","Octal digit expected."),Unexpected_token_expected:t(1179,e.DiagnosticCategory.Error,"Unexpected_token_expected_1179","Unexpected token. '{' expected."),Property_destructuring_pattern_expected:t(1180,e.DiagnosticCategory.Error,"Property_destructuring_pattern_expected_1180","Property destructuring pattern expected."),Array_element_destructuring_pattern_expected:t(1181,e.DiagnosticCategory.Error,"Array_element_destructuring_pattern_expected_1181","Array element destructuring pattern expected."),A_destructuring_declaration_must_have_an_initializer:t(1182,e.DiagnosticCategory.Error,"A_destructuring_declaration_must_have_an_initializer_1182","A destructuring declaration must have an initializer."),An_implementation_cannot_be_declared_in_ambient_contexts:t(1183,e.DiagnosticCategory.Error,"An_implementation_cannot_be_declared_in_ambient_contexts_1183","An implementation cannot be declared in ambient contexts."),Modifiers_cannot_appear_here:t(1184,e.DiagnosticCategory.Error,"Modifiers_cannot_appear_here_1184","Modifiers cannot appear here."),Merge_conflict_marker_encountered:t(1185,e.DiagnosticCategory.Error,"Merge_conflict_marker_encountered_1185","Merge conflict marker encountered."),A_rest_element_cannot_have_an_initializer:t(1186,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_an_initializer_1186","A rest element cannot have an initializer."),A_parameter_property_may_not_be_declared_using_a_binding_pattern:t(1187,e.DiagnosticCategory.Error,"A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187","A parameter property may not be declared using a binding pattern."),Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement:t(1188,e.DiagnosticCategory.Error,"Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188","Only a single variable declaration is allowed in a 'for...of' statement."),The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:t(1189,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189","The variable declaration of a 'for...in' statement cannot have an initializer."),The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer:t(1190,e.DiagnosticCategory.Error,"The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190","The variable declaration of a 'for...of' statement cannot have an initializer."),An_import_declaration_cannot_have_modifiers:t(1191,e.DiagnosticCategory.Error,"An_import_declaration_cannot_have_modifiers_1191","An import declaration cannot have modifiers."),Module_0_has_no_default_export:t(1192,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_1192","Module '{0}' has no default export."),An_export_declaration_cannot_have_modifiers:t(1193,e.DiagnosticCategory.Error,"An_export_declaration_cannot_have_modifiers_1193","An export declaration cannot have modifiers."),Export_declarations_are_not_permitted_in_a_namespace:t(1194,e.DiagnosticCategory.Error,"Export_declarations_are_not_permitted_in_a_namespace_1194","Export declarations are not permitted in a namespace."),export_Asterisk_does_not_re_export_a_default:t(1195,e.DiagnosticCategory.Error,"export_Asterisk_does_not_re_export_a_default_1195","'export *' does not re-export a default."),Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified:t(1196,e.DiagnosticCategory.Error,"Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196","Catch clause variable type annotation must be 'any' or 'unknown' if specified."),Catch_clause_variable_cannot_have_an_initializer:t(1197,e.DiagnosticCategory.Error,"Catch_clause_variable_cannot_have_an_initializer_1197","Catch clause variable cannot have an initializer."),An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive:t(1198,e.DiagnosticCategory.Error,"An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198","An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."),Unterminated_Unicode_escape_sequence:t(1199,e.DiagnosticCategory.Error,"Unterminated_Unicode_escape_sequence_1199","Unterminated Unicode escape sequence."),Line_terminator_not_permitted_before_arrow:t(1200,e.DiagnosticCategory.Error,"Line_terminator_not_permitted_before_arrow_1200","Line terminator not permitted before arrow."),Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead:t(1202,e.DiagnosticCategory.Error,"Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202","Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead."),Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead:t(1203,e.DiagnosticCategory.Error,"Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203","Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."),Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:t(1205,e.DiagnosticCategory.Error,"Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205","Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."),Decorators_are_not_valid_here:t(1206,e.DiagnosticCategory.Error,"Decorators_are_not_valid_here_1206","Decorators are not valid here."),Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name:t(1207,e.DiagnosticCategory.Error,"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207","Decorators cannot be applied to multiple get/set accessors of the same name."),_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module:t(1208,e.DiagnosticCategory.Error,"_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208","'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t(1210,e.DiagnosticCategory.Error,"Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210","Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),A_class_declaration_without_the_default_modifier_must_have_a_name:t(1211,e.DiagnosticCategory.Error,"A_class_declaration_without_the_default_modifier_must_have_a_name_1211","A class declaration without the 'default' modifier must have a name."),Identifier_expected_0_is_a_reserved_word_in_strict_mode:t(1212,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212","Identifier expected. '{0}' is a reserved word in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t(1213,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213","Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:t(1214,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214","Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."),Invalid_use_of_0_Modules_are_automatically_in_strict_mode:t(1215,e.DiagnosticCategory.Error,"Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215","Invalid use of '{0}'. Modules are automatically in strict mode."),Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules:t(1216,e.DiagnosticCategory.Error,"Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216","Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."),Export_assignment_is_not_supported_when_module_flag_is_system:t(1218,e.DiagnosticCategory.Error,"Export_assignment_is_not_supported_when_module_flag_is_system_1218","Export assignment is not supported when '--module' flag is 'system'."),Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning:t(1219,e.DiagnosticCategory.Error,"Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219","Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."),Generators_are_not_allowed_in_an_ambient_context:t(1221,e.DiagnosticCategory.Error,"Generators_are_not_allowed_in_an_ambient_context_1221","Generators are not allowed in an ambient context."),An_overload_signature_cannot_be_declared_as_a_generator:t(1222,e.DiagnosticCategory.Error,"An_overload_signature_cannot_be_declared_as_a_generator_1222","An overload signature cannot be declared as a generator."),_0_tag_already_specified:t(1223,e.DiagnosticCategory.Error,"_0_tag_already_specified_1223","'{0}' tag already specified."),Signature_0_must_be_a_type_predicate:t(1224,e.DiagnosticCategory.Error,"Signature_0_must_be_a_type_predicate_1224","Signature '{0}' must be a type predicate."),Cannot_find_parameter_0:t(1225,e.DiagnosticCategory.Error,"Cannot_find_parameter_0_1225","Cannot find parameter '{0}'."),Type_predicate_0_is_not_assignable_to_1:t(1226,e.DiagnosticCategory.Error,"Type_predicate_0_is_not_assignable_to_1_1226","Type predicate '{0}' is not assignable to '{1}'."),Parameter_0_is_not_in_the_same_position_as_parameter_1:t(1227,e.DiagnosticCategory.Error,"Parameter_0_is_not_in_the_same_position_as_parameter_1_1227","Parameter '{0}' is not in the same position as parameter '{1}'."),A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods:t(1228,e.DiagnosticCategory.Error,"A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228","A type predicate is only allowed in return type position for functions and methods."),A_type_predicate_cannot_reference_a_rest_parameter:t(1229,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_a_rest_parameter_1229","A type predicate cannot reference a rest parameter."),A_type_predicate_cannot_reference_element_0_in_a_binding_pattern:t(1230,e.DiagnosticCategory.Error,"A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230","A type predicate cannot reference element '{0}' in a binding pattern."),An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1231,e.DiagnosticCategory.Error,"An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231","An export assignment must be at the top level of a file or module declaration."),An_import_declaration_can_only_be_used_in_a_namespace_or_module:t(1232,e.DiagnosticCategory.Error,"An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232","An import declaration can only be used in a namespace or module."),An_export_declaration_can_only_be_used_in_a_module:t(1233,e.DiagnosticCategory.Error,"An_export_declaration_can_only_be_used_in_a_module_1233","An export declaration can only be used in a module."),An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:t(1234,e.DiagnosticCategory.Error,"An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234","An ambient module declaration is only allowed at the top level in a file."),A_namespace_declaration_is_only_allowed_in_a_namespace_or_module:t(1235,e.DiagnosticCategory.Error,"A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235","A namespace declaration is only allowed in a namespace or module."),The_return_type_of_a_property_decorator_function_must_be_either_void_or_any:t(1236,e.DiagnosticCategory.Error,"The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236","The return type of a property decorator function must be either 'void' or 'any'."),The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any:t(1237,e.DiagnosticCategory.Error,"The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237","The return type of a parameter decorator function must be either 'void' or 'any'."),Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression:t(1238,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238","Unable to resolve signature of class decorator when called as an expression."),Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression:t(1239,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239","Unable to resolve signature of parameter decorator when called as an expression."),Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression:t(1240,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240","Unable to resolve signature of property decorator when called as an expression."),Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression:t(1241,e.DiagnosticCategory.Error,"Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241","Unable to resolve signature of method decorator when called as an expression."),abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration:t(1242,e.DiagnosticCategory.Error,"abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242","'abstract' modifier can only appear on a class, method, or property declaration."),_0_modifier_cannot_be_used_with_1_modifier:t(1243,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_1_modifier_1243","'{0}' modifier cannot be used with '{1}' modifier."),Abstract_methods_can_only_appear_within_an_abstract_class:t(1244,e.DiagnosticCategory.Error,"Abstract_methods_can_only_appear_within_an_abstract_class_1244","Abstract methods can only appear within an abstract class."),Method_0_cannot_have_an_implementation_because_it_is_marked_abstract:t(1245,e.DiagnosticCategory.Error,"Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245","Method '{0}' cannot have an implementation because it is marked abstract."),An_interface_property_cannot_have_an_initializer:t(1246,e.DiagnosticCategory.Error,"An_interface_property_cannot_have_an_initializer_1246","An interface property cannot have an initializer."),A_type_literal_property_cannot_have_an_initializer:t(1247,e.DiagnosticCategory.Error,"A_type_literal_property_cannot_have_an_initializer_1247","A type literal property cannot have an initializer."),A_class_member_cannot_have_the_0_keyword:t(1248,e.DiagnosticCategory.Error,"A_class_member_cannot_have_the_0_keyword_1248","A class member cannot have the '{0}' keyword."),A_decorator_can_only_decorate_a_method_implementation_not_an_overload:t(1249,e.DiagnosticCategory.Error,"A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249","A decorator can only decorate a method implementation, not an overload."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5:t(1250,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t(1251,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:t(1252,e.DiagnosticCategory.Error,"Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252","Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference:t(1254,e.DiagnosticCategory.Error,"A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254","A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),A_definite_assignment_assertion_is_not_permitted_in_this_context:t(1255,e.DiagnosticCategory.Error,"A_definite_assignment_assertion_is_not_permitted_in_this_context_1255","A definite assignment assertion '!' is not permitted in this context."),A_required_element_cannot_follow_an_optional_element:t(1257,e.DiagnosticCategory.Error,"A_required_element_cannot_follow_an_optional_element_1257","A required element cannot follow an optional element."),A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration:t(1258,e.DiagnosticCategory.Error,"A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258","A default export must be at the top level of a file or module declaration."),Module_0_can_only_be_default_imported_using_the_1_flag:t(1259,e.DiagnosticCategory.Error,"Module_0_can_only_be_default_imported_using_the_1_flag_1259","Module '{0}' can only be default-imported using the '{1}' flag"),Keywords_cannot_contain_escape_characters:t(1260,e.DiagnosticCategory.Error,"Keywords_cannot_contain_escape_characters_1260","Keywords cannot contain escape characters."),Already_included_file_name_0_differs_from_file_name_1_only_in_casing:t(1261,e.DiagnosticCategory.Error,"Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261","Already included file name '{0}' differs from file name '{1}' only in casing."),Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module:t(1262,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262","Identifier expected. '{0}' is a reserved word at the top-level of a module."),Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t(1263,e.DiagnosticCategory.Error,"Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263","Declarations with initializers cannot also have definite assignment assertions."),Declarations_with_definite_assignment_assertions_must_also_have_type_annotations:t(1264,e.DiagnosticCategory.Error,"Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264","Declarations with definite assignment assertions must also have type annotations."),A_rest_element_cannot_follow_another_rest_element:t(1265,e.DiagnosticCategory.Error,"A_rest_element_cannot_follow_another_rest_element_1265","A rest element cannot follow another rest element."),An_optional_element_cannot_follow_a_rest_element:t(1266,e.DiagnosticCategory.Error,"An_optional_element_cannot_follow_a_rest_element_1266","An optional element cannot follow a rest element."),Property_0_cannot_have_an_initializer_because_it_is_marked_abstract:t(1267,e.DiagnosticCategory.Error,"Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267","Property '{0}' cannot have an initializer because it is marked abstract."),An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type:t(1268,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268","An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),with_statements_are_not_allowed_in_an_async_function_block:t(1300,e.DiagnosticCategory.Error,"with_statements_are_not_allowed_in_an_async_function_block_1300","'with' statements are not allowed in an async function block."),await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules:t(1308,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308","'await' expressions are only allowed within async functions and at the top levels of modules."),Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern:t(1312,e.DiagnosticCategory.Error,"Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312","Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),The_body_of_an_if_statement_cannot_be_the_empty_statement:t(1313,e.DiagnosticCategory.Error,"The_body_of_an_if_statement_cannot_be_the_empty_statement_1313","The body of an 'if' statement cannot be the empty statement."),Global_module_exports_may_only_appear_in_module_files:t(1314,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_module_files_1314","Global module exports may only appear in module files."),Global_module_exports_may_only_appear_in_declaration_files:t(1315,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_in_declaration_files_1315","Global module exports may only appear in declaration files."),Global_module_exports_may_only_appear_at_top_level:t(1316,e.DiagnosticCategory.Error,"Global_module_exports_may_only_appear_at_top_level_1316","Global module exports may only appear at top level."),A_parameter_property_cannot_be_declared_using_a_rest_parameter:t(1317,e.DiagnosticCategory.Error,"A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317","A parameter property cannot be declared using a rest parameter."),An_abstract_accessor_cannot_have_an_implementation:t(1318,e.DiagnosticCategory.Error,"An_abstract_accessor_cannot_have_an_implementation_1318","An abstract accessor cannot have an implementation."),A_default_export_can_only_be_used_in_an_ECMAScript_style_module:t(1319,e.DiagnosticCategory.Error,"A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319","A default export can only be used in an ECMAScript-style module."),Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1320,e.DiagnosticCategory.Error,"Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320","Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1321,e.DiagnosticCategory.Error,"Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321","Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:t(1322,e.DiagnosticCategory.Error,"Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322","Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext:t(1323,e.DiagnosticCategory.Error,"Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323","Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext:t(1324,e.DiagnosticCategory.Error,"Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324","Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),Argument_of_dynamic_import_cannot_be_spread_element:t(1325,e.DiagnosticCategory.Error,"Argument_of_dynamic_import_cannot_be_spread_element_1325","Argument of dynamic import cannot be spread element."),Dynamic_import_cannot_have_type_arguments:t(1326,e.DiagnosticCategory.Error,"Dynamic_import_cannot_have_type_arguments_1326","Dynamic import cannot have type arguments."),String_literal_with_double_quotes_expected:t(1327,e.DiagnosticCategory.Error,"String_literal_with_double_quotes_expected_1327","String literal with double quotes expected."),Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal:t(1328,e.DiagnosticCategory.Error,"Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328","Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0:t(1329,e.DiagnosticCategory.Error,"_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329","'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly:t(1330,e.DiagnosticCategory.Error,"A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330","A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."),A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly:t(1331,e.DiagnosticCategory.Error,"A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331","A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."),A_variable_whose_type_is_a_unique_symbol_type_must_be_const:t(1332,e.DiagnosticCategory.Error,"A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332","A variable whose type is a 'unique symbol' type must be 'const'."),unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name:t(1333,e.DiagnosticCategory.Error,"unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333","'unique symbol' types may not be used on a variable declaration with a binding name."),unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement:t(1334,e.DiagnosticCategory.Error,"unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334","'unique symbol' types are only allowed on variables in a variable statement."),unique_symbol_types_are_not_allowed_here:t(1335,e.DiagnosticCategory.Error,"unique_symbol_types_are_not_allowed_here_1335","'unique symbol' types are not allowed here."),An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead:t(1337,e.DiagnosticCategory.Error,"An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337","An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type:t(1338,e.DiagnosticCategory.Error,"infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338","'infer' declarations are only permitted in the 'extends' clause of a conditional type."),Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:t(1339,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339","Module '{0}' does not refer to a value, but is used as a value here."),Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0:t(1340,e.DiagnosticCategory.Error,"Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340","Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),Type_arguments_cannot_be_used_here:t(1342,e.DiagnosticCategory.Error,"Type_arguments_cannot_be_used_here_1342","Type arguments cannot be used here."),The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext:t(1343,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343","The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node12', or 'nodenext'."),A_label_is_not_allowed_here:t(1344,e.DiagnosticCategory.Error,"A_label_is_not_allowed_here_1344","'A label is not allowed here."),An_expression_of_type_void_cannot_be_tested_for_truthiness:t(1345,e.DiagnosticCategory.Error,"An_expression_of_type_void_cannot_be_tested_for_truthiness_1345","An expression of type 'void' cannot be tested for truthiness."),This_parameter_is_not_allowed_with_use_strict_directive:t(1346,e.DiagnosticCategory.Error,"This_parameter_is_not_allowed_with_use_strict_directive_1346","This parameter is not allowed with 'use strict' directive."),use_strict_directive_cannot_be_used_with_non_simple_parameter_list:t(1347,e.DiagnosticCategory.Error,"use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347","'use strict' directive cannot be used with non-simple parameter list."),Non_simple_parameter_declared_here:t(1348,e.DiagnosticCategory.Error,"Non_simple_parameter_declared_here_1348","Non-simple parameter declared here."),use_strict_directive_used_here:t(1349,e.DiagnosticCategory.Error,"use_strict_directive_used_here_1349","'use strict' directive used here."),Print_the_final_configuration_instead_of_building:t(1350,e.DiagnosticCategory.Message,"Print_the_final_configuration_instead_of_building_1350","Print the final configuration instead of building."),An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal:t(1351,e.DiagnosticCategory.Error,"An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351","An identifier or keyword cannot immediately follow a numeric literal."),A_bigint_literal_cannot_use_exponential_notation:t(1352,e.DiagnosticCategory.Error,"A_bigint_literal_cannot_use_exponential_notation_1352","A bigint literal cannot use exponential notation."),A_bigint_literal_must_be_an_integer:t(1353,e.DiagnosticCategory.Error,"A_bigint_literal_must_be_an_integer_1353","A bigint literal must be an integer."),readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types:t(1354,e.DiagnosticCategory.Error,"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354","'readonly' type modifier is only permitted on array and tuple literal types."),A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals:t(1355,e.DiagnosticCategory.Error,"A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355","A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."),Did_you_mean_to_mark_this_function_as_async:t(1356,e.DiagnosticCategory.Error,"Did_you_mean_to_mark_this_function_as_async_1356","Did you mean to mark this function as 'async'?"),An_enum_member_name_must_be_followed_by_a_or:t(1357,e.DiagnosticCategory.Error,"An_enum_member_name_must_be_followed_by_a_or_1357","An enum member name must be followed by a ',', '=', or '}'."),Tagged_template_expressions_are_not_permitted_in_an_optional_chain:t(1358,e.DiagnosticCategory.Error,"Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358","Tagged template expressions are not permitted in an optional chain."),Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:t(1359,e.DiagnosticCategory.Error,"Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359","Identifier expected. '{0}' is a reserved word that cannot be used here."),_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type:t(1361,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361","'{0}' cannot be used as a value because it was imported using 'import type'."),_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:t(1362,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362","'{0}' cannot be used as a value because it was exported using 'export type'."),A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both:t(1363,e.DiagnosticCategory.Error,"A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363","A type-only import can specify a default import or named bindings, but not both."),Convert_to_type_only_export:t(1364,e.DiagnosticCategory.Message,"Convert_to_type_only_export_1364","Convert to type-only export"),Convert_all_re_exported_types_to_type_only_exports:t(1365,e.DiagnosticCategory.Message,"Convert_all_re_exported_types_to_type_only_exports_1365","Convert all re-exported types to type-only exports"),Split_into_two_separate_import_declarations:t(1366,e.DiagnosticCategory.Message,"Split_into_two_separate_import_declarations_1366","Split into two separate import declarations"),Split_all_invalid_type_only_imports:t(1367,e.DiagnosticCategory.Message,"Split_all_invalid_type_only_imports_1367","Split all invalid type-only imports"),Did_you_mean_0:t(1369,e.DiagnosticCategory.Message,"Did_you_mean_0_1369","Did you mean '{0}'?"),This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error:t(1371,e.DiagnosticCategory.Error,"This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371","This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),Convert_to_type_only_import:t(1373,e.DiagnosticCategory.Message,"Convert_to_type_only_import_1373","Convert to type-only import"),Convert_all_imports_not_used_as_a_value_to_type_only_imports:t(1374,e.DiagnosticCategory.Message,"Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374","Convert all imports not used as a value to type-only imports"),await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1375,e.DiagnosticCategory.Error,"await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375","'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),_0_was_imported_here:t(1376,e.DiagnosticCategory.Message,"_0_was_imported_here_1376","'{0}' was imported here."),_0_was_exported_here:t(1377,e.DiagnosticCategory.Message,"_0_was_exported_here_1377","'{0}' was exported here."),Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1378,e.DiagnosticCategory.Error,"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378","Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:t(1379,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379","An import alias cannot reference a declaration that was exported using 'export type'."),An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type:t(1380,e.DiagnosticCategory.Error,"An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380","An import alias cannot reference a declaration that was imported using 'import type'."),Unexpected_token_Did_you_mean_or_rbrace:t(1381,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_rbrace_1381","Unexpected token. Did you mean `{'}'}` or `}`?"),Unexpected_token_Did_you_mean_or_gt:t(1382,e.DiagnosticCategory.Error,"Unexpected_token_Did_you_mean_or_gt_1382","Unexpected token. Did you mean `{'>'}` or `>`?"),Only_named_exports_may_use_export_type:t(1383,e.DiagnosticCategory.Error,"Only_named_exports_may_use_export_type_1383","Only named exports may use 'export type'."),A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list:t(1384,e.DiagnosticCategory.Error,"A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384","A 'new' expression with type arguments must always be followed by a parenthesized argument list."),Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1385,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385","Function type notation must be parenthesized when used in a union type."),Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:t(1386,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386","Constructor type notation must be parenthesized when used in a union type."),Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1387,e.DiagnosticCategory.Error,"Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387","Function type notation must be parenthesized when used in an intersection type."),Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t(1388,e.DiagnosticCategory.Error,"Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388","Constructor type notation must be parenthesized when used in an intersection type."),_0_is_not_allowed_as_a_variable_declaration_name:t(1389,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_variable_declaration_name_1389","'{0}' is not allowed as a variable declaration name."),_0_is_not_allowed_as_a_parameter_name:t(1390,e.DiagnosticCategory.Error,"_0_is_not_allowed_as_a_parameter_name_1390","'{0}' is not allowed as a parameter name."),An_import_alias_cannot_use_import_type:t(1392,e.DiagnosticCategory.Error,"An_import_alias_cannot_use_import_type_1392","An import alias cannot use 'import type'"),Imported_via_0_from_file_1:t(1393,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_1393","Imported via {0} from file '{1}'"),Imported_via_0_from_file_1_with_packageId_2:t(1394,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_1394","Imported via {0} from file '{1}' with packageId '{2}'"),Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:t(1395,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395","Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:t(1396,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396","Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions:t(1397,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397","Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:t(1398,e.DiagnosticCategory.Message,"Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398","Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),File_is_included_via_import_here:t(1399,e.DiagnosticCategory.Message,"File_is_included_via_import_here_1399","File is included via import here."),Referenced_via_0_from_file_1:t(1400,e.DiagnosticCategory.Message,"Referenced_via_0_from_file_1_1400","Referenced via '{0}' from file '{1}'"),File_is_included_via_reference_here:t(1401,e.DiagnosticCategory.Message,"File_is_included_via_reference_here_1401","File is included via reference here."),Type_library_referenced_via_0_from_file_1:t(1402,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_1402","Type library referenced via '{0}' from file '{1}'"),Type_library_referenced_via_0_from_file_1_with_packageId_2:t(1403,e.DiagnosticCategory.Message,"Type_library_referenced_via_0_from_file_1_with_packageId_2_1403","Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),File_is_included_via_type_library_reference_here:t(1404,e.DiagnosticCategory.Message,"File_is_included_via_type_library_reference_here_1404","File is included via type library reference here."),Library_referenced_via_0_from_file_1:t(1405,e.DiagnosticCategory.Message,"Library_referenced_via_0_from_file_1_1405","Library referenced via '{0}' from file '{1}'"),File_is_included_via_library_reference_here:t(1406,e.DiagnosticCategory.Message,"File_is_included_via_library_reference_here_1406","File is included via library reference here."),Matched_by_include_pattern_0_in_1:t(1407,e.DiagnosticCategory.Message,"Matched_by_include_pattern_0_in_1_1407","Matched by include pattern '{0}' in '{1}'"),File_is_matched_by_include_pattern_specified_here:t(1408,e.DiagnosticCategory.Message,"File_is_matched_by_include_pattern_specified_here_1408","File is matched by include pattern specified here."),Part_of_files_list_in_tsconfig_json:t(1409,e.DiagnosticCategory.Message,"Part_of_files_list_in_tsconfig_json_1409","Part of 'files' list in tsconfig.json"),File_is_matched_by_files_list_specified_here:t(1410,e.DiagnosticCategory.Message,"File_is_matched_by_files_list_specified_here_1410","File is matched by 'files' list specified here."),Output_from_referenced_project_0_included_because_1_specified:t(1411,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_1_specified_1411","Output from referenced project '{0}' included because '{1}' specified"),Output_from_referenced_project_0_included_because_module_is_specified_as_none:t(1412,e.DiagnosticCategory.Message,"Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412","Output from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_output_from_referenced_project_specified_here:t(1413,e.DiagnosticCategory.Message,"File_is_output_from_referenced_project_specified_here_1413","File is output from referenced project specified here."),Source_from_referenced_project_0_included_because_1_specified:t(1414,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_1_specified_1414","Source from referenced project '{0}' included because '{1}' specified"),Source_from_referenced_project_0_included_because_module_is_specified_as_none:t(1415,e.DiagnosticCategory.Message,"Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415","Source from referenced project '{0}' included because '--module' is specified as 'none'"),File_is_source_from_referenced_project_specified_here:t(1416,e.DiagnosticCategory.Message,"File_is_source_from_referenced_project_specified_here_1416","File is source from referenced project specified here."),Entry_point_of_type_library_0_specified_in_compilerOptions:t(1417,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_1417","Entry point of type library '{0}' specified in compilerOptions"),Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:t(1418,e.DiagnosticCategory.Message,"Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418","Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),File_is_entry_point_of_type_library_specified_here:t(1419,e.DiagnosticCategory.Message,"File_is_entry_point_of_type_library_specified_here_1419","File is entry point of type library specified here."),Entry_point_for_implicit_type_library_0:t(1420,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_1420","Entry point for implicit type library '{0}'"),Entry_point_for_implicit_type_library_0_with_packageId_1:t(1421,e.DiagnosticCategory.Message,"Entry_point_for_implicit_type_library_0_with_packageId_1_1421","Entry point for implicit type library '{0}' with packageId '{1}'"),Library_0_specified_in_compilerOptions:t(1422,e.DiagnosticCategory.Message,"Library_0_specified_in_compilerOptions_1422","Library '{0}' specified in compilerOptions"),File_is_library_specified_here:t(1423,e.DiagnosticCategory.Message,"File_is_library_specified_here_1423","File is library specified here."),Default_library:t(1424,e.DiagnosticCategory.Message,"Default_library_1424","Default library"),Default_library_for_target_0:t(1425,e.DiagnosticCategory.Message,"Default_library_for_target_0_1425","Default library for target '{0}'"),File_is_default_library_for_target_specified_here:t(1426,e.DiagnosticCategory.Message,"File_is_default_library_for_target_specified_here_1426","File is default library for target specified here."),Root_file_specified_for_compilation:t(1427,e.DiagnosticCategory.Message,"Root_file_specified_for_compilation_1427","Root file specified for compilation"),File_is_output_of_project_reference_source_0:t(1428,e.DiagnosticCategory.Message,"File_is_output_of_project_reference_source_0_1428","File is output of project reference source '{0}'"),File_redirects_to_file_0:t(1429,e.DiagnosticCategory.Message,"File_redirects_to_file_0_1429","File redirects to file '{0}'"),The_file_is_in_the_program_because_Colon:t(1430,e.DiagnosticCategory.Message,"The_file_is_in_the_program_because_Colon_1430","The file is in the program because:"),for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module:t(1431,e.DiagnosticCategory.Error,"for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431","'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher:t(1432,e.DiagnosticCategory.Error,"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432","Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),Decorators_may_not_be_applied_to_this_parameters:t(1433,e.DiagnosticCategory.Error,"Decorators_may_not_be_applied_to_this_parameters_1433","Decorators may not be applied to 'this' parameters."),Unexpected_keyword_or_identifier:t(1434,e.DiagnosticCategory.Error,"Unexpected_keyword_or_identifier_1434","Unexpected keyword or identifier."),Unknown_keyword_or_identifier_Did_you_mean_0:t(1435,e.DiagnosticCategory.Error,"Unknown_keyword_or_identifier_Did_you_mean_0_1435","Unknown keyword or identifier. Did you mean '{0}'?"),Decorators_must_precede_the_name_and_all_keywords_of_property_declarations:t(1436,e.DiagnosticCategory.Error,"Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436","Decorators must precede the name and all keywords of property declarations."),Namespace_must_be_given_a_name:t(1437,e.DiagnosticCategory.Error,"Namespace_must_be_given_a_name_1437","Namespace must be given a name."),Interface_must_be_given_a_name:t(1438,e.DiagnosticCategory.Error,"Interface_must_be_given_a_name_1438","Interface must be given a name."),Type_alias_must_be_given_a_name:t(1439,e.DiagnosticCategory.Error,"Type_alias_must_be_given_a_name_1439","Type alias must be given a name."),Variable_declaration_not_allowed_at_this_location:t(1440,e.DiagnosticCategory.Error,"Variable_declaration_not_allowed_at_this_location_1440","Variable declaration not allowed at this location."),Cannot_start_a_function_call_in_a_type_annotation:t(1441,e.DiagnosticCategory.Error,"Cannot_start_a_function_call_in_a_type_annotation_1441","Cannot start a function call in a type annotation."),Expected_for_property_initializer:t(1442,e.DiagnosticCategory.Error,"Expected_for_property_initializer_1442","Expected '=' for property initializer."),Module_declaration_names_may_only_use_or_quoted_strings:t(1443,e.DiagnosticCategory.Error,"Module_declaration_names_may_only_use_or_quoted_strings_1443","Module declaration names may only use ' or \" quoted strings."),_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1444,e.DiagnosticCategory.Error,"_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444","'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:t(1446,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446","'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled:t(1448,e.DiagnosticCategory.Error,"_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448","'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed:t(1449,e.DiagnosticCategory.Message,"Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449","Preserve unused imported values in the JavaScript output that would otherwise be removed."),Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments:t(1450,e.DiagnosticCategory.Message,"Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450","Dynamic imports can only accept a module specifier and an optional assertion as arguments"),Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression:t(1451,e.DiagnosticCategory.Error,"Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451","Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output:t(1470,e.DiagnosticCategory.Error,"The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470","The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead:t(1471,e.DiagnosticCategory.Error,"Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471","Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),The_types_of_0_are_incompatible_between_these_types:t(2200,e.DiagnosticCategory.Error,"The_types_of_0_are_incompatible_between_these_types_2200","The types of '{0}' are incompatible between these types."),The_types_returned_by_0_are_incompatible_between_these_types:t(2201,e.DiagnosticCategory.Error,"The_types_returned_by_0_are_incompatible_between_these_types_2201","The types returned by '{0}' are incompatible between these types."),Call_signature_return_types_0_and_1_are_incompatible:t(2202,e.DiagnosticCategory.Error,"Call_signature_return_types_0_and_1_are_incompatible_2202","Call signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Construct_signature_return_types_0_and_1_are_incompatible:t(2203,e.DiagnosticCategory.Error,"Construct_signature_return_types_0_and_1_are_incompatible_2203","Construct signature return types '{0}' and '{1}' are incompatible.",void 0,!0),Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2204,e.DiagnosticCategory.Error,"Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204","Call signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1:t(2205,e.DiagnosticCategory.Error,"Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205","Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.",void 0,!0),The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:t(2206,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206","The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement:t(2207,e.DiagnosticCategory.Error,"The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207","The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),Duplicate_identifier_0:t(2300,e.DiagnosticCategory.Error,"Duplicate_identifier_0_2300","Duplicate identifier '{0}'."),Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor:t(2301,e.DiagnosticCategory.Error,"Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301","Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),Static_members_cannot_reference_class_type_parameters:t(2302,e.DiagnosticCategory.Error,"Static_members_cannot_reference_class_type_parameters_2302","Static members cannot reference class type parameters."),Circular_definition_of_import_alias_0:t(2303,e.DiagnosticCategory.Error,"Circular_definition_of_import_alias_0_2303","Circular definition of import alias '{0}'."),Cannot_find_name_0:t(2304,e.DiagnosticCategory.Error,"Cannot_find_name_0_2304","Cannot find name '{0}'."),Module_0_has_no_exported_member_1:t(2305,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_2305","Module '{0}' has no exported member '{1}'."),File_0_is_not_a_module:t(2306,e.DiagnosticCategory.Error,"File_0_is_not_a_module_2306","File '{0}' is not a module."),Cannot_find_module_0_or_its_corresponding_type_declarations:t(2307,e.DiagnosticCategory.Error,"Cannot_find_module_0_or_its_corresponding_type_declarations_2307","Cannot find module '{0}' or its corresponding type declarations."),Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity:t(2308,e.DiagnosticCategory.Error,"Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308","Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."),An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements:t(2309,e.DiagnosticCategory.Error,"An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309","An export assignment cannot be used in a module with other exported elements."),Type_0_recursively_references_itself_as_a_base_type:t(2310,e.DiagnosticCategory.Error,"Type_0_recursively_references_itself_as_a_base_type_2310","Type '{0}' recursively references itself as a base type."),An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2312,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312","An interface can only extend an object type or intersection of object types with statically known members."),Type_parameter_0_has_a_circular_constraint:t(2313,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_constraint_2313","Type parameter '{0}' has a circular constraint."),Generic_type_0_requires_1_type_argument_s:t(2314,e.DiagnosticCategory.Error,"Generic_type_0_requires_1_type_argument_s_2314","Generic type '{0}' requires {1} type argument(s)."),Type_0_is_not_generic:t(2315,e.DiagnosticCategory.Error,"Type_0_is_not_generic_2315","Type '{0}' is not generic."),Global_type_0_must_be_a_class_or_interface_type:t(2316,e.DiagnosticCategory.Error,"Global_type_0_must_be_a_class_or_interface_type_2316","Global type '{0}' must be a class or interface type."),Global_type_0_must_have_1_type_parameter_s:t(2317,e.DiagnosticCategory.Error,"Global_type_0_must_have_1_type_parameter_s_2317","Global type '{0}' must have {1} type parameter(s)."),Cannot_find_global_type_0:t(2318,e.DiagnosticCategory.Error,"Cannot_find_global_type_0_2318","Cannot find global type '{0}'."),Named_property_0_of_types_1_and_2_are_not_identical:t(2319,e.DiagnosticCategory.Error,"Named_property_0_of_types_1_and_2_are_not_identical_2319","Named property '{0}' of types '{1}' and '{2}' are not identical."),Interface_0_cannot_simultaneously_extend_types_1_and_2:t(2320,e.DiagnosticCategory.Error,"Interface_0_cannot_simultaneously_extend_types_1_and_2_2320","Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."),Excessive_stack_depth_comparing_types_0_and_1:t(2321,e.DiagnosticCategory.Error,"Excessive_stack_depth_comparing_types_0_and_1_2321","Excessive stack depth comparing types '{0}' and '{1}'."),Type_0_is_not_assignable_to_type_1:t(2322,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_2322","Type '{0}' is not assignable to type '{1}'."),Cannot_redeclare_exported_variable_0:t(2323,e.DiagnosticCategory.Error,"Cannot_redeclare_exported_variable_0_2323","Cannot redeclare exported variable '{0}'."),Property_0_is_missing_in_type_1:t(2324,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_2324","Property '{0}' is missing in type '{1}'."),Property_0_is_private_in_type_1_but_not_in_type_2:t(2325,e.DiagnosticCategory.Error,"Property_0_is_private_in_type_1_but_not_in_type_2_2325","Property '{0}' is private in type '{1}' but not in type '{2}'."),Types_of_property_0_are_incompatible:t(2326,e.DiagnosticCategory.Error,"Types_of_property_0_are_incompatible_2326","Types of property '{0}' are incompatible."),Property_0_is_optional_in_type_1_but_required_in_type_2:t(2327,e.DiagnosticCategory.Error,"Property_0_is_optional_in_type_1_but_required_in_type_2_2327","Property '{0}' is optional in type '{1}' but required in type '{2}'."),Types_of_parameters_0_and_1_are_incompatible:t(2328,e.DiagnosticCategory.Error,"Types_of_parameters_0_and_1_are_incompatible_2328","Types of parameters '{0}' and '{1}' are incompatible."),Index_signature_for_type_0_is_missing_in_type_1:t(2329,e.DiagnosticCategory.Error,"Index_signature_for_type_0_is_missing_in_type_1_2329","Index signature for type '{0}' is missing in type '{1}'."),_0_and_1_index_signatures_are_incompatible:t(2330,e.DiagnosticCategory.Error,"_0_and_1_index_signatures_are_incompatible_2330","'{0}' and '{1}' index signatures are incompatible."),this_cannot_be_referenced_in_a_module_or_namespace_body:t(2331,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_module_or_namespace_body_2331","'this' cannot be referenced in a module or namespace body."),this_cannot_be_referenced_in_current_location:t(2332,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_current_location_2332","'this' cannot be referenced in current location."),this_cannot_be_referenced_in_constructor_arguments:t(2333,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_constructor_arguments_2333","'this' cannot be referenced in constructor arguments."),this_cannot_be_referenced_in_a_static_property_initializer:t(2334,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_static_property_initializer_2334","'this' cannot be referenced in a static property initializer."),super_can_only_be_referenced_in_a_derived_class:t(2335,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_a_derived_class_2335","'super' can only be referenced in a derived class."),super_cannot_be_referenced_in_constructor_arguments:t(2336,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_constructor_arguments_2336","'super' cannot be referenced in constructor arguments."),Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors:t(2337,e.DiagnosticCategory.Error,"Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337","Super calls are not permitted outside constructors or in nested functions inside constructors."),super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class:t(2338,e.DiagnosticCategory.Error,"super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338","'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."),Property_0_does_not_exist_on_type_1:t(2339,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_2339","Property '{0}' does not exist on type '{1}'."),Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword:t(2340,e.DiagnosticCategory.Error,"Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340","Only public and protected methods of the base class are accessible via the 'super' keyword."),Property_0_is_private_and_only_accessible_within_class_1:t(2341,e.DiagnosticCategory.Error,"Property_0_is_private_and_only_accessible_within_class_1_2341","Property '{0}' is private and only accessible within class '{1}'."),This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0:t(2343,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343","This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),Type_0_does_not_satisfy_the_constraint_1:t(2344,e.DiagnosticCategory.Error,"Type_0_does_not_satisfy_the_constraint_1_2344","Type '{0}' does not satisfy the constraint '{1}'."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1:t(2345,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345","Argument of type '{0}' is not assignable to parameter of type '{1}'."),Call_target_does_not_contain_any_signatures:t(2346,e.DiagnosticCategory.Error,"Call_target_does_not_contain_any_signatures_2346","Call target does not contain any signatures."),Untyped_function_calls_may_not_accept_type_arguments:t(2347,e.DiagnosticCategory.Error,"Untyped_function_calls_may_not_accept_type_arguments_2347","Untyped function calls may not accept type arguments."),Value_of_type_0_is_not_callable_Did_you_mean_to_include_new:t(2348,e.DiagnosticCategory.Error,"Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348","Value of type '{0}' is not callable. Did you mean to include 'new'?"),This_expression_is_not_callable:t(2349,e.DiagnosticCategory.Error,"This_expression_is_not_callable_2349","This expression is not callable."),Only_a_void_function_can_be_called_with_the_new_keyword:t(2350,e.DiagnosticCategory.Error,"Only_a_void_function_can_be_called_with_the_new_keyword_2350","Only a void function can be called with the 'new' keyword."),This_expression_is_not_constructable:t(2351,e.DiagnosticCategory.Error,"This_expression_is_not_constructable_2351","This expression is not constructable."),Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first:t(2352,e.DiagnosticCategory.Error,"Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352","Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."),Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1:t(2353,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353","Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."),This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found:t(2354,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354","This syntax requires an imported helper but module '{0}' cannot be found."),A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value:t(2355,e.DiagnosticCategory.Error,"A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355","A function whose declared type is neither 'void' nor 'any' must return a value."),An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type:t(2356,e.DiagnosticCategory.Error,"An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356","An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."),The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access:t(2357,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357","The operand of an increment or decrement operator must be a variable or a property access."),The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter:t(2358,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358","The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type:t(2359,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359","The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol:t(2360,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360","The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),The_right_hand_side_of_an_in_expression_must_not_be_a_primitive:t(2361,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361","The right-hand side of an 'in' expression must not be a primitive."),The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2362,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362","The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type:t(2363,e.DiagnosticCategory.Error,"The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363","The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access:t(2364,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364","The left-hand side of an assignment expression must be a variable or a property access."),Operator_0_cannot_be_applied_to_types_1_and_2:t(2365,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_types_1_and_2_2365","Operator '{0}' cannot be applied to types '{1}' and '{2}'."),Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined:t(2366,e.DiagnosticCategory.Error,"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366","Function lacks ending return statement and return type does not include 'undefined'."),This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap:t(2367,e.DiagnosticCategory.Error,"This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap_2367","This condition will always return '{0}' since the types '{1}' and '{2}' have no overlap."),Type_parameter_name_cannot_be_0:t(2368,e.DiagnosticCategory.Error,"Type_parameter_name_cannot_be_0_2368","Type parameter name cannot be '{0}'."),A_parameter_property_is_only_allowed_in_a_constructor_implementation:t(2369,e.DiagnosticCategory.Error,"A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369","A parameter property is only allowed in a constructor implementation."),A_rest_parameter_must_be_of_an_array_type:t(2370,e.DiagnosticCategory.Error,"A_rest_parameter_must_be_of_an_array_type_2370","A rest parameter must be of an array type."),A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation:t(2371,e.DiagnosticCategory.Error,"A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371","A parameter initializer is only allowed in a function or constructor implementation."),Parameter_0_cannot_reference_itself:t(2372,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_itself_2372","Parameter '{0}' cannot reference itself."),Parameter_0_cannot_reference_identifier_1_declared_after_it:t(2373,e.DiagnosticCategory.Error,"Parameter_0_cannot_reference_identifier_1_declared_after_it_2373","Parameter '{0}' cannot reference identifier '{1}' declared after it."),Duplicate_index_signature_for_type_0:t(2374,e.DiagnosticCategory.Error,"Duplicate_index_signature_for_type_0_2374","Duplicate index signature for type '{0}'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2375,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers:t(2376,e.DiagnosticCategory.Error,"A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376","A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers."),Constructors_for_derived_classes_must_contain_a_super_call:t(2377,e.DiagnosticCategory.Error,"Constructors_for_derived_classes_must_contain_a_super_call_2377","Constructors for derived classes must contain a 'super' call."),A_get_accessor_must_return_a_value:t(2378,e.DiagnosticCategory.Error,"A_get_accessor_must_return_a_value_2378","A 'get' accessor must return a value."),Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties:t(2379,e.DiagnosticCategory.Error,"Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379","Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type:t(2380,e.DiagnosticCategory.Error,"The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380","The return type of a 'get' accessor must be assignable to its 'set' accessor type"),Overload_signatures_must_all_be_exported_or_non_exported:t(2383,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_exported_or_non_exported_2383","Overload signatures must all be exported or non-exported."),Overload_signatures_must_all_be_ambient_or_non_ambient:t(2384,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_ambient_or_non_ambient_2384","Overload signatures must all be ambient or non-ambient."),Overload_signatures_must_all_be_public_private_or_protected:t(2385,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_public_private_or_protected_2385","Overload signatures must all be public, private or protected."),Overload_signatures_must_all_be_optional_or_required:t(2386,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_optional_or_required_2386","Overload signatures must all be optional or required."),Function_overload_must_be_static:t(2387,e.DiagnosticCategory.Error,"Function_overload_must_be_static_2387","Function overload must be static."),Function_overload_must_not_be_static:t(2388,e.DiagnosticCategory.Error,"Function_overload_must_not_be_static_2388","Function overload must not be static."),Function_implementation_name_must_be_0:t(2389,e.DiagnosticCategory.Error,"Function_implementation_name_must_be_0_2389","Function implementation name must be '{0}'."),Constructor_implementation_is_missing:t(2390,e.DiagnosticCategory.Error,"Constructor_implementation_is_missing_2390","Constructor implementation is missing."),Function_implementation_is_missing_or_not_immediately_following_the_declaration:t(2391,e.DiagnosticCategory.Error,"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391","Function implementation is missing or not immediately following the declaration."),Multiple_constructor_implementations_are_not_allowed:t(2392,e.DiagnosticCategory.Error,"Multiple_constructor_implementations_are_not_allowed_2392","Multiple constructor implementations are not allowed."),Duplicate_function_implementation:t(2393,e.DiagnosticCategory.Error,"Duplicate_function_implementation_2393","Duplicate function implementation."),This_overload_signature_is_not_compatible_with_its_implementation_signature:t(2394,e.DiagnosticCategory.Error,"This_overload_signature_is_not_compatible_with_its_implementation_signature_2394","This overload signature is not compatible with its implementation signature."),Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local:t(2395,e.DiagnosticCategory.Error,"Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395","Individual declarations in merged declaration '{0}' must be all exported or all local."),Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters:t(2396,e.DiagnosticCategory.Error,"Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396","Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."),Declaration_name_conflicts_with_built_in_global_identifier_0:t(2397,e.DiagnosticCategory.Error,"Declaration_name_conflicts_with_built_in_global_identifier_0_2397","Declaration name conflicts with built-in global identifier '{0}'."),constructor_cannot_be_used_as_a_parameter_property_name:t(2398,e.DiagnosticCategory.Error,"constructor_cannot_be_used_as_a_parameter_property_name_2398","'constructor' cannot be used as a parameter property name."),Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference:t(2399,e.DiagnosticCategory.Error,"Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399","Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference:t(2400,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400","Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference:t(2402,e.DiagnosticCategory.Error,"Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402","Expression resolves to '_super' that compiler uses to capture base class reference."),Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2:t(2403,e.DiagnosticCategory.Error,"Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403","Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:t(2404,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404","The left-hand side of a 'for...in' statement cannot use a type annotation."),The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any:t(2405,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405","The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."),The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access:t(2406,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406","The left-hand side of a 'for...in' statement must be a variable or a property access."),The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0:t(2407,e.DiagnosticCategory.Error,"The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407","The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."),Setters_cannot_return_a_value:t(2408,e.DiagnosticCategory.Error,"Setters_cannot_return_a_value_2408","Setters cannot return a value."),Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class:t(2409,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409","Return type of constructor signature must be assignable to the instance type of the class."),The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any:t(2410,e.DiagnosticCategory.Error,"The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410","The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."),Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target:t(2412,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412","Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."),Property_0_of_type_1_is_not_assignable_to_2_index_type_3:t(2411,e.DiagnosticCategory.Error,"Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411","Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."),_0_index_type_1_is_not_assignable_to_2_index_type_3:t(2413,e.DiagnosticCategory.Error,"_0_index_type_1_is_not_assignable_to_2_index_type_3_2413","'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."),Class_name_cannot_be_0:t(2414,e.DiagnosticCategory.Error,"Class_name_cannot_be_0_2414","Class name cannot be '{0}'."),Class_0_incorrectly_extends_base_class_1:t(2415,e.DiagnosticCategory.Error,"Class_0_incorrectly_extends_base_class_1_2415","Class '{0}' incorrectly extends base class '{1}'."),Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2:t(2416,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416","Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."),Class_static_side_0_incorrectly_extends_base_class_static_side_1:t(2417,e.DiagnosticCategory.Error,"Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417","Class static side '{0}' incorrectly extends base class static side '{1}'."),Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:t(2418,e.DiagnosticCategory.Error,"Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418","Type of computed property's value is '{0}', which is not assignable to type '{1}'."),Types_of_construct_signatures_are_incompatible:t(2419,e.DiagnosticCategory.Error,"Types_of_construct_signatures_are_incompatible_2419","Types of construct signatures are incompatible."),Class_0_incorrectly_implements_interface_1:t(2420,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_interface_1_2420","Class '{0}' incorrectly implements interface '{1}'."),A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2422,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422","A class can only implement an object type or intersection of object types with statically known members."),Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor:t(2423,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423","Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."),Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function:t(2425,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425","Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."),Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:t(2426,e.DiagnosticCategory.Error,"Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426","Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."),Interface_name_cannot_be_0:t(2427,e.DiagnosticCategory.Error,"Interface_name_cannot_be_0_2427","Interface name cannot be '{0}'."),All_declarations_of_0_must_have_identical_type_parameters:t(2428,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_type_parameters_2428","All declarations of '{0}' must have identical type parameters."),Interface_0_incorrectly_extends_interface_1:t(2430,e.DiagnosticCategory.Error,"Interface_0_incorrectly_extends_interface_1_2430","Interface '{0}' incorrectly extends interface '{1}'."),Enum_name_cannot_be_0:t(2431,e.DiagnosticCategory.Error,"Enum_name_cannot_be_0_2431","Enum name cannot be '{0}'."),In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element:t(2432,e.DiagnosticCategory.Error,"In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432","In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."),A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged:t(2433,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433","A namespace declaration cannot be in a different file from a class or function with which it is merged."),A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged:t(2434,e.DiagnosticCategory.Error,"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434","A namespace declaration cannot be located prior to a class or function with which it is merged."),Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces:t(2435,e.DiagnosticCategory.Error,"Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435","Ambient modules cannot be nested in other modules or namespaces."),Ambient_module_declaration_cannot_specify_relative_module_name:t(2436,e.DiagnosticCategory.Error,"Ambient_module_declaration_cannot_specify_relative_module_name_2436","Ambient module declaration cannot specify relative module name."),Module_0_is_hidden_by_a_local_declaration_with_the_same_name:t(2437,e.DiagnosticCategory.Error,"Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437","Module '{0}' is hidden by a local declaration with the same name."),Import_name_cannot_be_0:t(2438,e.DiagnosticCategory.Error,"Import_name_cannot_be_0_2438","Import name cannot be '{0}'."),Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name:t(2439,e.DiagnosticCategory.Error,"Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439","Import or export declaration in an ambient module declaration cannot reference module through relative module name."),Import_declaration_conflicts_with_local_declaration_of_0:t(2440,e.DiagnosticCategory.Error,"Import_declaration_conflicts_with_local_declaration_of_0_2440","Import declaration conflicts with local declaration of '{0}'."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module:t(2441,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."),Types_have_separate_declarations_of_a_private_property_0:t(2442,e.DiagnosticCategory.Error,"Types_have_separate_declarations_of_a_private_property_0_2442","Types have separate declarations of a private property '{0}'."),Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2:t(2443,e.DiagnosticCategory.Error,"Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443","Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."),Property_0_is_protected_in_type_1_but_public_in_type_2:t(2444,e.DiagnosticCategory.Error,"Property_0_is_protected_in_type_1_but_public_in_type_2_2444","Property '{0}' is protected in type '{1}' but public in type '{2}'."),Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses:t(2445,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445","Property '{0}' is protected and only accessible within class '{1}' and its subclasses."),Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2:t(2446,e.DiagnosticCategory.Error,"Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446","Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."),The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead:t(2447,e.DiagnosticCategory.Error,"The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447","The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."),Block_scoped_variable_0_used_before_its_declaration:t(2448,e.DiagnosticCategory.Error,"Block_scoped_variable_0_used_before_its_declaration_2448","Block-scoped variable '{0}' used before its declaration."),Class_0_used_before_its_declaration:t(2449,e.DiagnosticCategory.Error,"Class_0_used_before_its_declaration_2449","Class '{0}' used before its declaration."),Enum_0_used_before_its_declaration:t(2450,e.DiagnosticCategory.Error,"Enum_0_used_before_its_declaration_2450","Enum '{0}' used before its declaration."),Cannot_redeclare_block_scoped_variable_0:t(2451,e.DiagnosticCategory.Error,"Cannot_redeclare_block_scoped_variable_0_2451","Cannot redeclare block-scoped variable '{0}'."),An_enum_member_cannot_have_a_numeric_name:t(2452,e.DiagnosticCategory.Error,"An_enum_member_cannot_have_a_numeric_name_2452","An enum member cannot have a numeric name."),Variable_0_is_used_before_being_assigned:t(2454,e.DiagnosticCategory.Error,"Variable_0_is_used_before_being_assigned_2454","Variable '{0}' is used before being assigned."),Type_alias_0_circularly_references_itself:t(2456,e.DiagnosticCategory.Error,"Type_alias_0_circularly_references_itself_2456","Type alias '{0}' circularly references itself."),Type_alias_name_cannot_be_0:t(2457,e.DiagnosticCategory.Error,"Type_alias_name_cannot_be_0_2457","Type alias name cannot be '{0}'."),An_AMD_module_cannot_have_multiple_name_assignments:t(2458,e.DiagnosticCategory.Error,"An_AMD_module_cannot_have_multiple_name_assignments_2458","An AMD module cannot have multiple name assignments."),Module_0_declares_1_locally_but_it_is_not_exported:t(2459,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_not_exported_2459","Module '{0}' declares '{1}' locally, but it is not exported."),Module_0_declares_1_locally_but_it_is_exported_as_2:t(2460,e.DiagnosticCategory.Error,"Module_0_declares_1_locally_but_it_is_exported_as_2_2460","Module '{0}' declares '{1}' locally, but it is exported as '{2}'."),Type_0_is_not_an_array_type:t(2461,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_2461","Type '{0}' is not an array type."),A_rest_element_must_be_last_in_a_destructuring_pattern:t(2462,e.DiagnosticCategory.Error,"A_rest_element_must_be_last_in_a_destructuring_pattern_2462","A rest element must be last in a destructuring pattern."),A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature:t(2463,e.DiagnosticCategory.Error,"A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463","A binding pattern parameter cannot be optional in an implementation signature."),A_computed_property_name_must_be_of_type_string_number_symbol_or_any:t(2464,e.DiagnosticCategory.Error,"A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464","A computed property name must be of type 'string', 'number', 'symbol', or 'any'."),this_cannot_be_referenced_in_a_computed_property_name:t(2465,e.DiagnosticCategory.Error,"this_cannot_be_referenced_in_a_computed_property_name_2465","'this' cannot be referenced in a computed property name."),super_cannot_be_referenced_in_a_computed_property_name:t(2466,e.DiagnosticCategory.Error,"super_cannot_be_referenced_in_a_computed_property_name_2466","'super' cannot be referenced in a computed property name."),A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type:t(2467,e.DiagnosticCategory.Error,"A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467","A computed property name cannot reference a type parameter from its containing type."),Cannot_find_global_value_0:t(2468,e.DiagnosticCategory.Error,"Cannot_find_global_value_0_2468","Cannot find global value '{0}'."),The_0_operator_cannot_be_applied_to_type_symbol:t(2469,e.DiagnosticCategory.Error,"The_0_operator_cannot_be_applied_to_type_symbol_2469","The '{0}' operator cannot be applied to type 'symbol'."),Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher:t(2472,e.DiagnosticCategory.Error,"Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472","Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."),Enum_declarations_must_all_be_const_or_non_const:t(2473,e.DiagnosticCategory.Error,"Enum_declarations_must_all_be_const_or_non_const_2473","Enum declarations must all be const or non-const."),const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values:t(2474,e.DiagnosticCategory.Error,"const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474","const enum member initializers can only contain literal values and other computed enum values."),const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query:t(2475,e.DiagnosticCategory.Error,"const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475","'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."),A_const_enum_member_can_only_be_accessed_using_a_string_literal:t(2476,e.DiagnosticCategory.Error,"A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476","A const enum member can only be accessed using a string literal."),const_enum_member_initializer_was_evaluated_to_a_non_finite_value:t(2477,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477","'const' enum member initializer was evaluated to a non-finite value."),const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:t(2478,e.DiagnosticCategory.Error,"const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478","'const' enum member initializer was evaluated to disallowed value 'NaN'."),let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations:t(2480,e.DiagnosticCategory.Error,"let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480","'let' is not allowed to be used as a name in 'let' or 'const' declarations."),Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1:t(2481,e.DiagnosticCategory.Error,"Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481","Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."),The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation:t(2483,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483","The left-hand side of a 'for...of' statement cannot use a type annotation."),Export_declaration_conflicts_with_exported_declaration_of_0:t(2484,e.DiagnosticCategory.Error,"Export_declaration_conflicts_with_exported_declaration_of_0_2484","Export declaration conflicts with exported declaration of '{0}'."),The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access:t(2487,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487","The left-hand side of a 'for...of' statement must be a variable or a property access."),Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2488,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488","Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."),An_iterator_must_have_a_next_method:t(2489,e.DiagnosticCategory.Error,"An_iterator_must_have_a_next_method_2489","An iterator must have a 'next()' method."),The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property:t(2490,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490","The type returned by the '{0}()' method of an iterator must have a 'value' property."),The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern:t(2491,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491","The left-hand side of a 'for...in' statement cannot be a destructuring pattern."),Cannot_redeclare_identifier_0_in_catch_clause:t(2492,e.DiagnosticCategory.Error,"Cannot_redeclare_identifier_0_in_catch_clause_2492","Cannot redeclare identifier '{0}' in catch clause."),Tuple_type_0_of_length_1_has_no_element_at_index_2:t(2493,e.DiagnosticCategory.Error,"Tuple_type_0_of_length_1_has_no_element_at_index_2_2493","Tuple type '{0}' of length '{1}' has no element at index '{2}'."),Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher:t(2494,e.DiagnosticCategory.Error,"Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494","Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."),Type_0_is_not_an_array_type_or_a_string_type:t(2495,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_2495","Type '{0}' is not an array type or a string type."),The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression:t(2496,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496","The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."),This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export:t(2497,e.DiagnosticCategory.Error,"This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497","This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."),Module_0_uses_export_and_cannot_be_used_with_export_Asterisk:t(2498,e.DiagnosticCategory.Error,"Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498","Module '{0}' uses 'export =' and cannot be used with 'export *'."),An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2499,e.DiagnosticCategory.Error,"An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499","An interface can only extend an identifier/qualified-name with optional type arguments."),A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments:t(2500,e.DiagnosticCategory.Error,"A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500","A class can only implement an identifier/qualified-name with optional type arguments."),A_rest_element_cannot_contain_a_binding_pattern:t(2501,e.DiagnosticCategory.Error,"A_rest_element_cannot_contain_a_binding_pattern_2501","A rest element cannot contain a binding pattern."),_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation:t(2502,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502","'{0}' is referenced directly or indirectly in its own type annotation."),Cannot_find_namespace_0:t(2503,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_2503","Cannot find namespace '{0}'."),Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:t(2504,e.DiagnosticCategory.Error,"Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504","Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."),A_generator_cannot_have_a_void_type_annotation:t(2505,e.DiagnosticCategory.Error,"A_generator_cannot_have_a_void_type_annotation_2505","A generator cannot have a 'void' type annotation."),_0_is_referenced_directly_or_indirectly_in_its_own_base_expression:t(2506,e.DiagnosticCategory.Error,"_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506","'{0}' is referenced directly or indirectly in its own base expression."),Type_0_is_not_a_constructor_function_type:t(2507,e.DiagnosticCategory.Error,"Type_0_is_not_a_constructor_function_type_2507","Type '{0}' is not a constructor function type."),No_base_constructor_has_the_specified_number_of_type_arguments:t(2508,e.DiagnosticCategory.Error,"No_base_constructor_has_the_specified_number_of_type_arguments_2508","No base constructor has the specified number of type arguments."),Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members:t(2509,e.DiagnosticCategory.Error,"Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509","Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."),Base_constructors_must_all_have_the_same_return_type:t(2510,e.DiagnosticCategory.Error,"Base_constructors_must_all_have_the_same_return_type_2510","Base constructors must all have the same return type."),Cannot_create_an_instance_of_an_abstract_class:t(2511,e.DiagnosticCategory.Error,"Cannot_create_an_instance_of_an_abstract_class_2511","Cannot create an instance of an abstract class."),Overload_signatures_must_all_be_abstract_or_non_abstract:t(2512,e.DiagnosticCategory.Error,"Overload_signatures_must_all_be_abstract_or_non_abstract_2512","Overload signatures must all be abstract or non-abstract."),Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression:t(2513,e.DiagnosticCategory.Error,"Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513","Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2:t(2515,e.DiagnosticCategory.Error,"Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515","Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),All_declarations_of_an_abstract_method_must_be_consecutive:t(2516,e.DiagnosticCategory.Error,"All_declarations_of_an_abstract_method_must_be_consecutive_2516","All declarations of an abstract method must be consecutive."),Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type:t(2517,e.DiagnosticCategory.Error,"Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517","Cannot assign an abstract constructor type to a non-abstract constructor type."),A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard:t(2518,e.DiagnosticCategory.Error,"A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518","A 'this'-based type guard is not compatible with a parameter-based type guard."),An_async_iterator_must_have_a_next_method:t(2519,e.DiagnosticCategory.Error,"An_async_iterator_must_have_a_next_method_2519","An async iterator must have a 'next()' method."),Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions:t(2520,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520","Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."),The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method:t(2522,e.DiagnosticCategory.Error,"The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522","The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."),yield_expressions_cannot_be_used_in_a_parameter_initializer:t(2523,e.DiagnosticCategory.Error,"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523","'yield' expressions cannot be used in a parameter initializer."),await_expressions_cannot_be_used_in_a_parameter_initializer:t(2524,e.DiagnosticCategory.Error,"await_expressions_cannot_be_used_in_a_parameter_initializer_2524","'await' expressions cannot be used in a parameter initializer."),Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value:t(2525,e.DiagnosticCategory.Error,"Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525","Initializer provides no value for this binding element and the binding element has no default value."),A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface:t(2526,e.DiagnosticCategory.Error,"A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526","A 'this' type is available only in a non-static member of a class or interface."),The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary:t(2527,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527","The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."),A_module_cannot_have_multiple_default_exports:t(2528,e.DiagnosticCategory.Error,"A_module_cannot_have_multiple_default_exports_2528","A module cannot have multiple default exports."),Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions:t(2529,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529","Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."),Property_0_is_incompatible_with_index_signature:t(2530,e.DiagnosticCategory.Error,"Property_0_is_incompatible_with_index_signature_2530","Property '{0}' is incompatible with index signature."),Object_is_possibly_null:t(2531,e.DiagnosticCategory.Error,"Object_is_possibly_null_2531","Object is possibly 'null'."),Object_is_possibly_undefined:t(2532,e.DiagnosticCategory.Error,"Object_is_possibly_undefined_2532","Object is possibly 'undefined'."),Object_is_possibly_null_or_undefined:t(2533,e.DiagnosticCategory.Error,"Object_is_possibly_null_or_undefined_2533","Object is possibly 'null' or 'undefined'."),A_function_returning_never_cannot_have_a_reachable_end_point:t(2534,e.DiagnosticCategory.Error,"A_function_returning_never_cannot_have_a_reachable_end_point_2534","A function returning 'never' cannot have a reachable end point."),Enum_type_0_has_members_with_initializers_that_are_not_literals:t(2535,e.DiagnosticCategory.Error,"Enum_type_0_has_members_with_initializers_that_are_not_literals_2535","Enum type '{0}' has members with initializers that are not literals."),Type_0_cannot_be_used_to_index_type_1:t(2536,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_to_index_type_1_2536","Type '{0}' cannot be used to index type '{1}'."),Type_0_has_no_matching_index_signature_for_type_1:t(2537,e.DiagnosticCategory.Error,"Type_0_has_no_matching_index_signature_for_type_1_2537","Type '{0}' has no matching index signature for type '{1}'."),Type_0_cannot_be_used_as_an_index_type:t(2538,e.DiagnosticCategory.Error,"Type_0_cannot_be_used_as_an_index_type_2538","Type '{0}' cannot be used as an index type."),Cannot_assign_to_0_because_it_is_not_a_variable:t(2539,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_not_a_variable_2539","Cannot assign to '{0}' because it is not a variable."),Cannot_assign_to_0_because_it_is_a_read_only_property:t(2540,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_read_only_property_2540","Cannot assign to '{0}' because it is a read-only property."),Index_signature_in_type_0_only_permits_reading:t(2542,e.DiagnosticCategory.Error,"Index_signature_in_type_0_only_permits_reading_2542","Index signature in type '{0}' only permits reading."),Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference:t(2543,e.DiagnosticCategory.Error,"Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543","Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."),Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference:t(2544,e.DiagnosticCategory.Error,"Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544","Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."),A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any:t(2545,e.DiagnosticCategory.Error,"A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545","A mixin class must have a constructor with a single rest parameter of type 'any[]'."),The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property:t(2547,e.DiagnosticCategory.Error,"The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547","The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."),Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2548,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548","Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator:t(2549,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549","Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."),Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later:t(2550,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550","Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."),Property_0_does_not_exist_on_type_1_Did_you_mean_2:t(2551,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551","Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"),Cannot_find_name_0_Did_you_mean_1:t(2552,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_1_2552","Cannot find name '{0}'. Did you mean '{1}'?"),Computed_values_are_not_permitted_in_an_enum_with_string_valued_members:t(2553,e.DiagnosticCategory.Error,"Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553","Computed values are not permitted in an enum with string valued members."),Expected_0_arguments_but_got_1:t(2554,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_2554","Expected {0} arguments, but got {1}."),Expected_at_least_0_arguments_but_got_1:t(2555,e.DiagnosticCategory.Error,"Expected_at_least_0_arguments_but_got_1_2555","Expected at least {0} arguments, but got {1}."),A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter:t(2556,e.DiagnosticCategory.Error,"A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556","A spread argument must either have a tuple type or be passed to a rest parameter."),Expected_0_type_arguments_but_got_1:t(2558,e.DiagnosticCategory.Error,"Expected_0_type_arguments_but_got_1_2558","Expected {0} type arguments, but got {1}."),Type_0_has_no_properties_in_common_with_type_1:t(2559,e.DiagnosticCategory.Error,"Type_0_has_no_properties_in_common_with_type_1_2559","Type '{0}' has no properties in common with type '{1}'."),Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it:t(2560,e.DiagnosticCategory.Error,"Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560","Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"),Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2:t(2561,e.DiagnosticCategory.Error,"Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561","Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"),Base_class_expressions_cannot_reference_class_type_parameters:t(2562,e.DiagnosticCategory.Error,"Base_class_expressions_cannot_reference_class_type_parameters_2562","Base class expressions cannot reference class type parameters."),The_containing_function_or_module_body_is_too_large_for_control_flow_analysis:t(2563,e.DiagnosticCategory.Error,"The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563","The containing function or module body is too large for control flow analysis."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor:t(2564,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564","Property '{0}' has no initializer and is not definitely assigned in the constructor."),Property_0_is_used_before_being_assigned:t(2565,e.DiagnosticCategory.Error,"Property_0_is_used_before_being_assigned_2565","Property '{0}' is used before being assigned."),A_rest_element_cannot_have_a_property_name:t(2566,e.DiagnosticCategory.Error,"A_rest_element_cannot_have_a_property_name_2566","A rest element cannot have a property name."),Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:t(2567,e.DiagnosticCategory.Error,"Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567","Enum declarations can only merge with namespace or other enum declarations."),Property_0_may_not_exist_on_type_1_Did_you_mean_2:t(2568,e.DiagnosticCategory.Error,"Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568","Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators:t(2569,e.DiagnosticCategory.Error,"Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569","Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),Could_not_find_name_0_Did_you_mean_1:t(2570,e.DiagnosticCategory.Error,"Could_not_find_name_0_Did_you_mean_1_2570","Could not find name '{0}'. Did you mean '{1}'?"),Object_is_of_type_unknown:t(2571,e.DiagnosticCategory.Error,"Object_is_of_type_unknown_2571","Object is of type 'unknown'."),A_rest_element_type_must_be_an_array_type:t(2574,e.DiagnosticCategory.Error,"A_rest_element_type_must_be_an_array_type_2574","A rest element type must be an array type."),No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments:t(2575,e.DiagnosticCategory.Error,"No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575","No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."),Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead:t(2576,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576","Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"),Return_type_annotation_circularly_references_itself:t(2577,e.DiagnosticCategory.Error,"Return_type_annotation_circularly_references_itself_2577","Return type annotation circularly references itself."),Unused_ts_expect_error_directive:t(2578,e.DiagnosticCategory.Error,"Unused_ts_expect_error_directive_2578","Unused '@ts-expect-error' directive."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode:t(2580,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery:t(2581,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha:t(2582,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later:t(2583,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."),Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom:t(2584,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584","Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later:t(2585,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585","'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."),Cannot_assign_to_0_because_it_is_a_constant:t(2588,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_constant_2588","Cannot assign to '{0}' because it is a constant."),Type_instantiation_is_excessively_deep_and_possibly_infinite:t(2589,e.DiagnosticCategory.Error,"Type_instantiation_is_excessively_deep_and_possibly_infinite_2589","Type instantiation is excessively deep and possibly infinite."),Expression_produces_a_union_type_that_is_too_complex_to_represent:t(2590,e.DiagnosticCategory.Error,"Expression_produces_a_union_type_that_is_too_complex_to_represent_2590","Expression produces a union type that is too complex to represent."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:t(2591,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591","Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:t(2592,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592","Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."),Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:t(2593,e.DiagnosticCategory.Error,"Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593","Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."),This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag:t(2594,e.DiagnosticCategory.Error,"This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594","This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag."),_0_can_only_be_imported_by_using_a_default_import:t(2595,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_default_import_2595","'{0}' can only be imported by using a default import."),_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2596,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596","'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:t(2597,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597","'{0}' can only be imported by using a 'require' call or by using a default import."),_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2598,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598","'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."),JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist:t(2602,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602","JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."),Property_0_in_type_1_is_not_assignable_to_type_2:t(2603,e.DiagnosticCategory.Error,"Property_0_in_type_1_is_not_assignable_to_type_2_2603","Property '{0}' in type '{1}' is not assignable to type '{2}'."),JSX_element_type_0_does_not_have_any_construct_or_call_signatures:t(2604,e.DiagnosticCategory.Error,"JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604","JSX element type '{0}' does not have any construct or call signatures."),Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property:t(2606,e.DiagnosticCategory.Error,"Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606","Property '{0}' of JSX spread attribute is not assignable to target property."),JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property:t(2607,e.DiagnosticCategory.Error,"JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607","JSX element class does not support attributes because it does not have a '{0}' property."),The_global_type_JSX_0_may_not_have_more_than_one_property:t(2608,e.DiagnosticCategory.Error,"The_global_type_JSX_0_may_not_have_more_than_one_property_2608","The global type 'JSX.{0}' may not have more than one property."),JSX_spread_child_must_be_an_array_type:t(2609,e.DiagnosticCategory.Error,"JSX_spread_child_must_be_an_array_type_2609","JSX spread child must be an array type."),_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:t(2610,e.DiagnosticCategory.Error,"_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610","'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."),_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor:t(2611,e.DiagnosticCategory.Error,"_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611","'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."),Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration:t(2612,e.DiagnosticCategory.Error,"Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612","Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead:t(2613,e.DiagnosticCategory.Error,"Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613","Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead:t(2614,e.DiagnosticCategory.Error,"Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614","Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),Type_of_property_0_circularly_references_itself_in_mapped_type_1:t(2615,e.DiagnosticCategory.Error,"Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615","Type of property '{0}' circularly references itself in mapped type '{1}'."),_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:t(2616,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616","'{0}' can only be imported by using 'import {1} = require({2})' or a default import."),_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import:t(2617,e.DiagnosticCategory.Error,"_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617","'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."),Source_has_0_element_s_but_target_requires_1:t(2618,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_requires_1_2618","Source has {0} element(s) but target requires {1}."),Source_has_0_element_s_but_target_allows_only_1:t(2619,e.DiagnosticCategory.Error,"Source_has_0_element_s_but_target_allows_only_1_2619","Source has {0} element(s) but target allows only {1}."),Target_requires_0_element_s_but_source_may_have_fewer:t(2620,e.DiagnosticCategory.Error,"Target_requires_0_element_s_but_source_may_have_fewer_2620","Target requires {0} element(s) but source may have fewer."),Target_allows_only_0_element_s_but_source_may_have_more:t(2621,e.DiagnosticCategory.Error,"Target_allows_only_0_element_s_but_source_may_have_more_2621","Target allows only {0} element(s) but source may have more."),Source_provides_no_match_for_required_element_at_position_0_in_target:t(2623,e.DiagnosticCategory.Error,"Source_provides_no_match_for_required_element_at_position_0_in_target_2623","Source provides no match for required element at position {0} in target."),Source_provides_no_match_for_variadic_element_at_position_0_in_target:t(2624,e.DiagnosticCategory.Error,"Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624","Source provides no match for variadic element at position {0} in target."),Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target:t(2625,e.DiagnosticCategory.Error,"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625","Variadic element at position {0} in source does not match element at position {1} in target."),Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target:t(2626,e.DiagnosticCategory.Error,"Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626","Type at position {0} in source is not compatible with type at position {1} in target."),Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target:t(2627,e.DiagnosticCategory.Error,"Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627","Type at positions {0} through {1} in source is not compatible with type at position {2} in target."),Cannot_assign_to_0_because_it_is_an_enum:t(2628,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_enum_2628","Cannot assign to '{0}' because it is an enum."),Cannot_assign_to_0_because_it_is_a_class:t(2629,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_class_2629","Cannot assign to '{0}' because it is a class."),Cannot_assign_to_0_because_it_is_a_function:t(2630,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_function_2630","Cannot assign to '{0}' because it is a function."),Cannot_assign_to_0_because_it_is_a_namespace:t(2631,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_a_namespace_2631","Cannot assign to '{0}' because it is a namespace."),Cannot_assign_to_0_because_it_is_an_import:t(2632,e.DiagnosticCategory.Error,"Cannot_assign_to_0_because_it_is_an_import_2632","Cannot assign to '{0}' because it is an import."),JSX_property_access_expressions_cannot_include_JSX_namespace_names:t(2633,e.DiagnosticCategory.Error,"JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633","JSX property access expressions cannot include JSX namespace names"),_0_index_signatures_are_incompatible:t(2634,e.DiagnosticCategory.Error,"_0_index_signatures_are_incompatible_2634","'{0}' index signatures are incompatible."),Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity:t(2649,e.DiagnosticCategory.Error,"Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649","Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums:t(2651,e.DiagnosticCategory.Error,"A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651","A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead:t(2652,e.DiagnosticCategory.Error,"Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652","Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1:t(2653,e.DiagnosticCategory.Error,"Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653","Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),JSX_expressions_must_have_one_parent_element:t(2657,e.DiagnosticCategory.Error,"JSX_expressions_must_have_one_parent_element_2657","JSX expressions must have one parent element."),Type_0_provides_no_match_for_the_signature_1:t(2658,e.DiagnosticCategory.Error,"Type_0_provides_no_match_for_the_signature_1_2658","Type '{0}' provides no match for the signature '{1}'."),super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher:t(2659,e.DiagnosticCategory.Error,"super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659","'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions:t(2660,e.DiagnosticCategory.Error,"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660","'super' can only be referenced in members of derived classes or object literal expressions."),Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module:t(2661,e.DiagnosticCategory.Error,"Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661","Cannot export '{0}'. Only local declarations can be exported from a module."),Cannot_find_name_0_Did_you_mean_the_static_member_1_0:t(2662,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662","Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"),Cannot_find_name_0_Did_you_mean_the_instance_member_this_0:t(2663,e.DiagnosticCategory.Error,"Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663","Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"),Invalid_module_name_in_augmentation_module_0_cannot_be_found:t(2664,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664","Invalid module name in augmentation, module '{0}' cannot be found."),Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented:t(2665,e.DiagnosticCategory.Error,"Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665","Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."),Exports_and_export_assignments_are_not_permitted_in_module_augmentations:t(2666,e.DiagnosticCategory.Error,"Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666","Exports and export assignments are not permitted in module augmentations."),Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module:t(2667,e.DiagnosticCategory.Error,"Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667","Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."),export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible:t(2668,e.DiagnosticCategory.Error,"export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668","'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."),Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:t(2669,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669","Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."),Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context:t(2670,e.DiagnosticCategory.Error,"Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670","Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."),Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity:t(2671,e.DiagnosticCategory.Error,"Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671","Cannot augment module '{0}' because it resolves to a non-module entity."),Cannot_assign_a_0_constructor_type_to_a_1_constructor_type:t(2672,e.DiagnosticCategory.Error,"Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672","Cannot assign a '{0}' constructor type to a '{1}' constructor type."),Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration:t(2673,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673","Constructor of class '{0}' is private and only accessible within the class declaration."),Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration:t(2674,e.DiagnosticCategory.Error,"Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674","Constructor of class '{0}' is protected and only accessible within the class declaration."),Cannot_extend_a_class_0_Class_constructor_is_marked_as_private:t(2675,e.DiagnosticCategory.Error,"Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675","Cannot extend a class '{0}'. Class constructor is marked as private."),Accessors_must_both_be_abstract_or_non_abstract:t(2676,e.DiagnosticCategory.Error,"Accessors_must_both_be_abstract_or_non_abstract_2676","Accessors must both be abstract or non-abstract."),A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type:t(2677,e.DiagnosticCategory.Error,"A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677","A type predicate's type must be assignable to its parameter's type."),Type_0_is_not_comparable_to_type_1:t(2678,e.DiagnosticCategory.Error,"Type_0_is_not_comparable_to_type_1_2678","Type '{0}' is not comparable to type '{1}'."),A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void:t(2679,e.DiagnosticCategory.Error,"A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679","A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."),A_0_parameter_must_be_the_first_parameter:t(2680,e.DiagnosticCategory.Error,"A_0_parameter_must_be_the_first_parameter_2680","A '{0}' parameter must be the first parameter."),A_constructor_cannot_have_a_this_parameter:t(2681,e.DiagnosticCategory.Error,"A_constructor_cannot_have_a_this_parameter_2681","A constructor cannot have a 'this' parameter."),this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation:t(2683,e.DiagnosticCategory.Error,"this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683","'this' implicitly has type 'any' because it does not have a type annotation."),The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1:t(2684,e.DiagnosticCategory.Error,"The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684","The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."),The_this_types_of_each_signature_are_incompatible:t(2685,e.DiagnosticCategory.Error,"The_this_types_of_each_signature_are_incompatible_2685","The 'this' types of each signature are incompatible."),_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead:t(2686,e.DiagnosticCategory.Error,"_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686","'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."),All_declarations_of_0_must_have_identical_modifiers:t(2687,e.DiagnosticCategory.Error,"All_declarations_of_0_must_have_identical_modifiers_2687","All declarations of '{0}' must have identical modifiers."),Cannot_find_type_definition_file_for_0:t(2688,e.DiagnosticCategory.Error,"Cannot_find_type_definition_file_for_0_2688","Cannot find type definition file for '{0}'."),Cannot_extend_an_interface_0_Did_you_mean_implements:t(2689,e.DiagnosticCategory.Error,"Cannot_extend_an_interface_0_Did_you_mean_implements_2689","Cannot extend an interface '{0}'. Did you mean 'implements'?"),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0:t(2690,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690","'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead:t(2691,e.DiagnosticCategory.Error,"An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691","An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."),_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible:t(2692,e.DiagnosticCategory.Error,"_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692","'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),_0_only_refers_to_a_type_but_is_being_used_as_a_value_here:t(2693,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693","'{0}' only refers to a type, but is being used as a value here."),Namespace_0_has_no_exported_member_1:t(2694,e.DiagnosticCategory.Error,"Namespace_0_has_no_exported_member_1_2694","Namespace '{0}' has no exported member '{1}'."),Left_side_of_comma_operator_is_unused_and_has_no_side_effects:t(2695,e.DiagnosticCategory.Error,"Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695","Left side of comma operator is unused and has no side effects.",!0),The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead:t(2696,e.DiagnosticCategory.Error,"The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696","The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"),An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2697,e.DiagnosticCategory.Error,"An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697","An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),Spread_types_may_only_be_created_from_object_types:t(2698,e.DiagnosticCategory.Error,"Spread_types_may_only_be_created_from_object_types_2698","Spread types may only be created from object types."),Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1:t(2699,e.DiagnosticCategory.Error,"Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699","Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),Rest_types_may_only_be_created_from_object_types:t(2700,e.DiagnosticCategory.Error,"Rest_types_may_only_be_created_from_object_types_2700","Rest types may only be created from object types."),The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:t(2701,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701","The target of an object rest assignment must be a variable or a property access."),_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here:t(2702,e.DiagnosticCategory.Error,"_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702","'{0}' only refers to a type, but is being used as a namespace here."),The_operand_of_a_delete_operator_must_be_a_property_reference:t(2703,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_a_property_reference_2703","The operand of a 'delete' operator must be a property reference."),The_operand_of_a_delete_operator_cannot_be_a_read_only_property:t(2704,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704","The operand of a 'delete' operator cannot be a read-only property."),An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2705,e.DiagnosticCategory.Error,"An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705","An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Required_type_parameters_may_not_follow_optional_type_parameters:t(2706,e.DiagnosticCategory.Error,"Required_type_parameters_may_not_follow_optional_type_parameters_2706","Required type parameters may not follow optional type parameters."),Generic_type_0_requires_between_1_and_2_type_arguments:t(2707,e.DiagnosticCategory.Error,"Generic_type_0_requires_between_1_and_2_type_arguments_2707","Generic type '{0}' requires between {1} and {2} type arguments."),Cannot_use_namespace_0_as_a_value:t(2708,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_value_2708","Cannot use namespace '{0}' as a value."),Cannot_use_namespace_0_as_a_type:t(2709,e.DiagnosticCategory.Error,"Cannot_use_namespace_0_as_a_type_2709","Cannot use namespace '{0}' as a type."),_0_are_specified_twice_The_attribute_named_0_will_be_overwritten:t(2710,e.DiagnosticCategory.Error,"_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710","'{0}' are specified twice. The attribute named '{0}' will be overwritten."),A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:t(2711,e.DiagnosticCategory.Error,"A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711","A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."),A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:t(2712,e.DiagnosticCategory.Error,"A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712","A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1:t(2713,e.DiagnosticCategory.Error,"Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713","Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}[\"{1}\"]'?"),The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context:t(2714,e.DiagnosticCategory.Error,"The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714","The expression of an export assignment must be an identifier or qualified name in an ambient context."),Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor:t(2715,e.DiagnosticCategory.Error,"Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715","Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."),Type_parameter_0_has_a_circular_default:t(2716,e.DiagnosticCategory.Error,"Type_parameter_0_has_a_circular_default_2716","Type parameter '{0}' has a circular default."),Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:t(2717,e.DiagnosticCategory.Error,"Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717","Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."),Duplicate_property_0:t(2718,e.DiagnosticCategory.Error,"Duplicate_property_0_2718","Duplicate property '{0}'."),Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated:t(2719,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719","Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."),Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:t(2720,e.DiagnosticCategory.Error,"Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720","Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"),Cannot_invoke_an_object_which_is_possibly_null:t(2721,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_2721","Cannot invoke an object which is possibly 'null'."),Cannot_invoke_an_object_which_is_possibly_undefined:t(2722,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_undefined_2722","Cannot invoke an object which is possibly 'undefined'."),Cannot_invoke_an_object_which_is_possibly_null_or_undefined:t(2723,e.DiagnosticCategory.Error,"Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723","Cannot invoke an object which is possibly 'null' or 'undefined'."),_0_has_no_exported_member_named_1_Did_you_mean_2:t(2724,e.DiagnosticCategory.Error,"_0_has_no_exported_member_named_1_Did_you_mean_2_2724","'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),Class_name_cannot_be_Object_when_targeting_ES5_with_module_0:t(2725,e.DiagnosticCategory.Error,"Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725","Class name cannot be 'Object' when targeting ES5 with module {0}."),Cannot_find_lib_definition_for_0:t(2726,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_2726","Cannot find lib definition for '{0}'."),Cannot_find_lib_definition_for_0_Did_you_mean_1:t(2727,e.DiagnosticCategory.Error,"Cannot_find_lib_definition_for_0_Did_you_mean_1_2727","Cannot find lib definition for '{0}'. Did you mean '{1}'?"),_0_is_declared_here:t(2728,e.DiagnosticCategory.Message,"_0_is_declared_here_2728","'{0}' is declared here."),Property_0_is_used_before_its_initialization:t(2729,e.DiagnosticCategory.Error,"Property_0_is_used_before_its_initialization_2729","Property '{0}' is used before its initialization."),An_arrow_function_cannot_have_a_this_parameter:t(2730,e.DiagnosticCategory.Error,"An_arrow_function_cannot_have_a_this_parameter_2730","An arrow function cannot have a 'this' parameter."),Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String:t(2731,e.DiagnosticCategory.Error,"Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731","Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension:t(2732,e.DiagnosticCategory.Error,"Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732","Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),Property_0_was_also_declared_here:t(2733,e.DiagnosticCategory.Error,"Property_0_was_also_declared_here_2733","Property '{0}' was also declared here."),Are_you_missing_a_semicolon:t(2734,e.DiagnosticCategory.Error,"Are_you_missing_a_semicolon_2734","Are you missing a semicolon?"),Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1:t(2735,e.DiagnosticCategory.Error,"Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735","Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),Operator_0_cannot_be_applied_to_type_1:t(2736,e.DiagnosticCategory.Error,"Operator_0_cannot_be_applied_to_type_1_2736","Operator '{0}' cannot be applied to type '{1}'."),BigInt_literals_are_not_available_when_targeting_lower_than_ES2020:t(2737,e.DiagnosticCategory.Error,"BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737","BigInt literals are not available when targeting lower than ES2020."),An_outer_value_of_this_is_shadowed_by_this_container:t(2738,e.DiagnosticCategory.Message,"An_outer_value_of_this_is_shadowed_by_this_container_2738","An outer value of 'this' is shadowed by this container."),Type_0_is_missing_the_following_properties_from_type_1_Colon_2:t(2739,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739","Type '{0}' is missing the following properties from type '{1}': {2}"),Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more:t(2740,e.DiagnosticCategory.Error,"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740","Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."),Property_0_is_missing_in_type_1_but_required_in_type_2:t(2741,e.DiagnosticCategory.Error,"Property_0_is_missing_in_type_1_but_required_in_type_2_2741","Property '{0}' is missing in type '{1}' but required in type '{2}'."),The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary:t(2742,e.DiagnosticCategory.Error,"The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742","The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."),No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments:t(2743,e.DiagnosticCategory.Error,"No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743","No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."),Type_parameter_defaults_can_only_reference_previously_declared_type_parameters:t(2744,e.DiagnosticCategory.Error,"Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744","Type parameter defaults can only reference previously declared type parameters."),This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided:t(2745,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745","This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."),This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided:t(2746,e.DiagnosticCategory.Error,"This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746","This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."),_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2:t(2747,e.DiagnosticCategory.Error,"_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747","'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided:t(2748,e.DiagnosticCategory.Error,"Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748","Cannot access ambient const enums when the '--isolatedModules' flag is provided."),_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0:t(2749,e.DiagnosticCategory.Error,"_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749","'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),The_implementation_signature_is_declared_here:t(2750,e.DiagnosticCategory.Error,"The_implementation_signature_is_declared_here_2750","The implementation signature is declared here."),Circularity_originates_in_type_at_this_location:t(2751,e.DiagnosticCategory.Error,"Circularity_originates_in_type_at_this_location_2751","Circularity originates in type at this location."),The_first_export_default_is_here:t(2752,e.DiagnosticCategory.Error,"The_first_export_default_is_here_2752","The first export default is here."),Another_export_default_is_here:t(2753,e.DiagnosticCategory.Error,"Another_export_default_is_here_2753","Another export default is here."),super_may_not_use_type_arguments:t(2754,e.DiagnosticCategory.Error,"super_may_not_use_type_arguments_2754","'super' may not use type arguments."),No_constituent_of_type_0_is_callable:t(2755,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_callable_2755","No constituent of type '{0}' is callable."),Not_all_constituents_of_type_0_are_callable:t(2756,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_callable_2756","Not all constituents of type '{0}' are callable."),Type_0_has_no_call_signatures:t(2757,e.DiagnosticCategory.Error,"Type_0_has_no_call_signatures_2757","Type '{0}' has no call signatures."),Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2758,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758","Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."),No_constituent_of_type_0_is_constructable:t(2759,e.DiagnosticCategory.Error,"No_constituent_of_type_0_is_constructable_2759","No constituent of type '{0}' is constructable."),Not_all_constituents_of_type_0_are_constructable:t(2760,e.DiagnosticCategory.Error,"Not_all_constituents_of_type_0_are_constructable_2760","Not all constituents of type '{0}' are constructable."),Type_0_has_no_construct_signatures:t(2761,e.DiagnosticCategory.Error,"Type_0_has_no_construct_signatures_2761","Type '{0}' has no construct signatures."),Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other:t(2762,e.DiagnosticCategory.Error,"Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762","Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:t(2763,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:t(2764,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."),Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:t(2765,e.DiagnosticCategory.Error,"Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765","Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."),Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:t(2766,e.DiagnosticCategory.Error,"Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766","Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."),The_0_property_of_an_iterator_must_be_a_method:t(2767,e.DiagnosticCategory.Error,"The_0_property_of_an_iterator_must_be_a_method_2767","The '{0}' property of an iterator must be a method."),The_0_property_of_an_async_iterator_must_be_a_method:t(2768,e.DiagnosticCategory.Error,"The_0_property_of_an_async_iterator_must_be_a_method_2768","The '{0}' property of an async iterator must be a method."),No_overload_matches_this_call:t(2769,e.DiagnosticCategory.Error,"No_overload_matches_this_call_2769","No overload matches this call."),The_last_overload_gave_the_following_error:t(2770,e.DiagnosticCategory.Error,"The_last_overload_gave_the_following_error_2770","The last overload gave the following error."),The_last_overload_is_declared_here:t(2771,e.DiagnosticCategory.Error,"The_last_overload_is_declared_here_2771","The last overload is declared here."),Overload_0_of_1_2_gave_the_following_error:t(2772,e.DiagnosticCategory.Error,"Overload_0_of_1_2_gave_the_following_error_2772","Overload {0} of {1}, '{2}', gave the following error."),Did_you_forget_to_use_await:t(2773,e.DiagnosticCategory.Error,"Did_you_forget_to_use_await_2773","Did you forget to use 'await'?"),This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead:t(2774,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774","This condition will always return true since this function is always defined. Did you mean to call it instead?"),Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation:t(2775,e.DiagnosticCategory.Error,"Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775","Assertions require every name in the call target to be declared with an explicit type annotation."),Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name:t(2776,e.DiagnosticCategory.Error,"Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776","Assertions require the call target to be an identifier or qualified name."),The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access:t(2777,e.DiagnosticCategory.Error,"The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777","The operand of an increment or decrement operator may not be an optional property access."),The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:t(2778,e.DiagnosticCategory.Error,"The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778","The target of an object rest assignment may not be an optional property access."),The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access:t(2779,e.DiagnosticCategory.Error,"The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779","The left-hand side of an assignment expression may not be an optional property access."),The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access:t(2780,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780","The left-hand side of a 'for...in' statement may not be an optional property access."),The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access:t(2781,e.DiagnosticCategory.Error,"The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781","The left-hand side of a 'for...of' statement may not be an optional property access."),_0_needs_an_explicit_type_annotation:t(2782,e.DiagnosticCategory.Message,"_0_needs_an_explicit_type_annotation_2782","'{0}' needs an explicit type annotation."),_0_is_specified_more_than_once_so_this_usage_will_be_overwritten:t(2783,e.DiagnosticCategory.Error,"_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783","'{0}' is specified more than once, so this usage will be overwritten."),get_and_set_accessors_cannot_declare_this_parameters:t(2784,e.DiagnosticCategory.Error,"get_and_set_accessors_cannot_declare_this_parameters_2784","'get' and 'set' accessors cannot declare 'this' parameters."),This_spread_always_overwrites_this_property:t(2785,e.DiagnosticCategory.Error,"This_spread_always_overwrites_this_property_2785","This spread always overwrites this property."),_0_cannot_be_used_as_a_JSX_component:t(2786,e.DiagnosticCategory.Error,"_0_cannot_be_used_as_a_JSX_component_2786","'{0}' cannot be used as a JSX component."),Its_return_type_0_is_not_a_valid_JSX_element:t(2787,e.DiagnosticCategory.Error,"Its_return_type_0_is_not_a_valid_JSX_element_2787","Its return type '{0}' is not a valid JSX element."),Its_instance_type_0_is_not_a_valid_JSX_element:t(2788,e.DiagnosticCategory.Error,"Its_instance_type_0_is_not_a_valid_JSX_element_2788","Its instance type '{0}' is not a valid JSX element."),Its_element_type_0_is_not_a_valid_JSX_element:t(2789,e.DiagnosticCategory.Error,"Its_element_type_0_is_not_a_valid_JSX_element_2789","Its element type '{0}' is not a valid JSX element."),The_operand_of_a_delete_operator_must_be_optional:t(2790,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_must_be_optional_2790","The operand of a 'delete' operator must be optional."),Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later:t(2791,e.DiagnosticCategory.Error,"Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791","Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."),Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:t(2792,e.DiagnosticCategory.Error,"Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792","Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"),The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible:t(2793,e.DiagnosticCategory.Error,"The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793","The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."),Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:t(2794,e.DiagnosticCategory.Error,"Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794","Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"),The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types:t(2795,e.DiagnosticCategory.Error,"The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795","The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked:t(2796,e.DiagnosticCategory.Error,"It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796","It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract:t(2797,e.DiagnosticCategory.Error,"A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797","A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),The_declaration_was_marked_as_deprecated_here:t(2798,e.DiagnosticCategory.Error,"The_declaration_was_marked_as_deprecated_here_2798","The declaration was marked as deprecated here."),Type_produces_a_tuple_type_that_is_too_large_to_represent:t(2799,e.DiagnosticCategory.Error,"Type_produces_a_tuple_type_that_is_too_large_to_represent_2799","Type produces a tuple type that is too large to represent."),Expression_produces_a_tuple_type_that_is_too_large_to_represent:t(2800,e.DiagnosticCategory.Error,"Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800","Expression produces a tuple type that is too large to represent."),This_condition_will_always_return_true_since_this_0_is_always_defined:t(2801,e.DiagnosticCategory.Error,"This_condition_will_always_return_true_since_this_0_is_always_defined_2801","This condition will always return true since this '{0}' is always defined."),Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher:t(2802,e.DiagnosticCategory.Error,"Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802","Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),Cannot_assign_to_private_method_0_Private_methods_are_not_writable:t(2803,e.DiagnosticCategory.Error,"Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803","Cannot assign to private method '{0}'. Private methods are not writable."),Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name:t(2804,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804","Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag:t(2805,e.DiagnosticCategory.Error,"Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805","Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag."),Private_accessor_was_defined_without_a_getter:t(2806,e.DiagnosticCategory.Error,"Private_accessor_was_defined_without_a_getter_2806","Private accessor was defined without a getter."),This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0:t(2807,e.DiagnosticCategory.Error,"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807","This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),A_get_accessor_must_be_at_least_as_accessible_as_the_setter:t(2808,e.DiagnosticCategory.Error,"A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808","A get accessor must be at least as accessible as the setter"),Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses:t(2809,e.DiagnosticCategory.Error,"Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809","Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false:t(2810,e.DiagnosticCategory.Error,"Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810","Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'."),Initializer_for_property_0:t(2811,e.DiagnosticCategory.Error,"Initializer_for_property_0_2811","Initializer for property '{0}'"),Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:t(2812,e.DiagnosticCategory.Error,"Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812","Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),Class_declaration_cannot_implement_overload_list_for_0:t(2813,e.DiagnosticCategory.Error,"Class_declaration_cannot_implement_overload_list_for_0_2813","Class declaration cannot implement overload list for '{0}'."),Function_with_bodies_can_only_merge_with_classes_that_are_ambient:t(2814,e.DiagnosticCategory.Error,"Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814","Function with bodies can only merge with classes that are ambient."),arguments_cannot_be_referenced_in_property_initializers:t(2815,e.DiagnosticCategory.Error,"arguments_cannot_be_referenced_in_property_initializers_2815","'arguments' cannot be referenced in property initializers."),Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class:t(2816,e.DiagnosticCategory.Error,"Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816","Cannot use 'this' in a static property initializer of a decorated class."),Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block:t(2817,e.DiagnosticCategory.Error,"Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817","Property '{0}' has no initializer and is not definitely assigned in a class static block."),Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers:t(2818,e.DiagnosticCategory.Error,"Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818","Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),Namespace_name_cannot_be_0:t(2819,e.DiagnosticCategory.Error,"Namespace_name_cannot_be_0_2819","Namespace name cannot be '{0}'."),Type_0_is_not_assignable_to_type_1_Did_you_mean_2:t(2820,e.DiagnosticCategory.Error,"Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820","Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext:t(2821,e.DiagnosticCategory.Error,"Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821","Import assertions are only supported when the '--module' option is set to 'esnext'."),Import_assertions_cannot_be_used_with_type_only_imports_or_exports:t(2822,e.DiagnosticCategory.Error,"Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822","Import assertions cannot be used with type-only imports or exports."),Cannot_find_namespace_0_Did_you_mean_1:t(2833,e.DiagnosticCategory.Error,"Cannot_find_namespace_0_Did_you_mean_1_2833","Cannot find namespace '{0}'. Did you mean '{1}'?"),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path:t(2834,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0:t(2835,e.DiagnosticCategory.Error,"Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835","Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),Import_declaration_0_is_using_private_name_1:t(4e3,e.DiagnosticCategory.Error,"Import_declaration_0_is_using_private_name_1_4000","Import declaration '{0}' is using private name '{1}'."),Type_parameter_0_of_exported_class_has_or_is_using_private_name_1:t(4002,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002","Type parameter '{0}' of exported class has or is using private name '{1}'."),Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1:t(4004,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004","Type parameter '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4006,e.DiagnosticCategory.Error,"Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006","Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4008,e.DiagnosticCategory.Error,"Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008","Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4010,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010","Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4012,e.DiagnosticCategory.Error,"Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012","Type parameter '{0}' of public method from exported class has or is using private name '{1}'."),Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4014,e.DiagnosticCategory.Error,"Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014","Type parameter '{0}' of method from exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4016,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016","Type parameter '{0}' of exported function has or is using private name '{1}'."),Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4019,e.DiagnosticCategory.Error,"Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019","Implements clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_0_has_or_is_using_private_name_1:t(4020,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020","'extends' clause of exported class '{0}' has or is using private name '{1}'."),extends_clause_of_exported_class_has_or_is_using_private_name_0:t(4021,e.DiagnosticCategory.Error,"extends_clause_of_exported_class_has_or_is_using_private_name_0_4021","'extends' clause of exported class has or is using private name '{0}'."),extends_clause_of_exported_interface_0_has_or_is_using_private_name_1:t(4022,e.DiagnosticCategory.Error,"extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022","'extends' clause of exported interface '{0}' has or is using private name '{1}'."),Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4023,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023","Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."),Exported_variable_0_has_or_is_using_name_1_from_private_module_2:t(4024,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024","Exported variable '{0}' has or is using name '{1}' from private module '{2}'."),Exported_variable_0_has_or_is_using_private_name_1:t(4025,e.DiagnosticCategory.Error,"Exported_variable_0_has_or_is_using_private_name_1_4025","Exported variable '{0}' has or is using private name '{1}'."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4026,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026","Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4027,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027","Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:t(4028,e.DiagnosticCategory.Error,"Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028","Public static property '{0}' of exported class has or is using private name '{1}'."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4029,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029","Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4030,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030","Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_property_0_of_exported_class_has_or_is_using_private_name_1:t(4031,e.DiagnosticCategory.Error,"Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031","Public property '{0}' of exported class has or is using private name '{1}'."),Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4032,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032","Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Property_0_of_exported_interface_has_or_is_using_private_name_1:t(4033,e.DiagnosticCategory.Error,"Property_0_of_exported_interface_has_or_is_using_private_name_1_4033","Property '{0}' of exported interface has or is using private name '{1}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4034,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034","Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4035,e.DiagnosticCategory.Error,"Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035","Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4036,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036","Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:t(4037,e.DiagnosticCategory.Error,"Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037","Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4038,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038","Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4039,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039","Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4040,e.DiagnosticCategory.Error,"Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040","Return type of public static getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4041,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041","Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4042,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042","Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."),Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1:t(4043,e.DiagnosticCategory.Error,"Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043","Return type of public getter '{0}' from exported class has or is using private name '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4044,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044","Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0:t(4045,e.DiagnosticCategory.Error,"Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045","Return type of constructor signature from exported interface has or is using private name '{0}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4046,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046","Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0:t(4047,e.DiagnosticCategory.Error,"Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047","Return type of call signature from exported interface has or is using private name '{0}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4048,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048","Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0:t(4049,e.DiagnosticCategory.Error,"Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049","Return type of index signature from exported interface has or is using private name '{0}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4050,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050","Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4051,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051","Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:t(4052,e.DiagnosticCategory.Error,"Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052","Return type of public static method from exported class has or is using private name '{0}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4053,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053","Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:t(4054,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054","Return type of public method from exported class has or is using name '{0}' from private module '{1}'."),Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:t(4055,e.DiagnosticCategory.Error,"Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055","Return type of public method from exported class has or is using private name '{0}'."),Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:t(4056,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056","Return type of method from exported interface has or is using name '{0}' from private module '{1}'."),Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0:t(4057,e.DiagnosticCategory.Error,"Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057","Return type of method from exported interface has or is using private name '{0}'."),Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:t(4058,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058","Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."),Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:t(4059,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059","Return type of exported function has or is using name '{0}' from private module '{1}'."),Return_type_of_exported_function_has_or_is_using_private_name_0:t(4060,e.DiagnosticCategory.Error,"Return_type_of_exported_function_has_or_is_using_private_name_0_4060","Return type of exported function has or is using private name '{0}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4061,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061","Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4062,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062","Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1:t(4063,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063","Parameter '{0}' of constructor from exported class has or is using private name '{1}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4064,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064","Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1:t(4065,e.DiagnosticCategory.Error,"Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065","Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4066,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066","Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1:t(4067,e.DiagnosticCategory.Error,"Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067","Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4068,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068","Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4069,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069","Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:t(4070,e.DiagnosticCategory.Error,"Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070","Parameter '{0}' of public static method from exported class has or is using private name '{1}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4071,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071","Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:t(4072,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072","Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."),Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:t(4073,e.DiagnosticCategory.Error,"Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073","Parameter '{0}' of public method from exported class has or is using private name '{1}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4074,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074","Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1:t(4075,e.DiagnosticCategory.Error,"Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075","Parameter '{0}' of method from exported interface has or is using private name '{1}'."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4076,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076","Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."),Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:t(4077,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077","Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."),Parameter_0_of_exported_function_has_or_is_using_private_name_1:t(4078,e.DiagnosticCategory.Error,"Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078","Parameter '{0}' of exported function has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1:t(4081,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_4081","Exported type alias '{0}' has or is using private name '{1}'."),Default_export_of_the_module_has_or_is_using_private_name_0:t(4082,e.DiagnosticCategory.Error,"Default_export_of_the_module_has_or_is_using_private_name_0_4082","Default export of the module has or is using private name '{0}'."),Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1:t(4083,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083","Type parameter '{0}' of exported type alias has or is using private name '{1}'."),Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:t(4084,e.DiagnosticCategory.Error,"Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084","Exported type alias '{0}' has or is using private name '{1}' from module {2}."),Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict:t(4090,e.DiagnosticCategory.Error,"Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090","Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4091,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091","Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."),Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1:t(4092,e.DiagnosticCategory.Error,"Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092","Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."),Property_0_of_exported_class_expression_may_not_be_private_or_protected:t(4094,e.DiagnosticCategory.Error,"Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094","Property '{0}' of exported class expression may not be private or protected."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4095,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095","Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4096,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096","Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:t(4097,e.DiagnosticCategory.Error,"Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097","Public static method '{0}' of exported class has or is using private name '{1}'."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4098,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098","Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."),Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:t(4099,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099","Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."),Public_method_0_of_exported_class_has_or_is_using_private_name_1:t(4100,e.DiagnosticCategory.Error,"Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100","Public method '{0}' of exported class has or is using private name '{1}'."),Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:t(4101,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101","Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."),Method_0_of_exported_interface_has_or_is_using_private_name_1:t(4102,e.DiagnosticCategory.Error,"Method_0_of_exported_interface_has_or_is_using_private_name_1_4102","Method '{0}' of exported interface has or is using private name '{1}'."),Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1:t(4103,e.DiagnosticCategory.Error,"Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103","Type parameter '{0}' of exported mapped object type is using private name '{1}'."),The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1:t(4104,e.DiagnosticCategory.Error,"The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104","The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."),Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter:t(4105,e.DiagnosticCategory.Error,"Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105","Private or protected member '{0}' cannot be accessed on a type parameter."),Parameter_0_of_accessor_has_or_is_using_private_name_1:t(4106,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_private_name_1_4106","Parameter '{0}' of accessor has or is using private name '{1}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:t(4107,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107","Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."),Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:t(4108,e.DiagnosticCategory.Error,"Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108","Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."),Type_arguments_for_0_circularly_reference_themselves:t(4109,e.DiagnosticCategory.Error,"Type_arguments_for_0_circularly_reference_themselves_4109","Type arguments for '{0}' circularly reference themselves."),Tuple_type_arguments_circularly_reference_themselves:t(4110,e.DiagnosticCategory.Error,"Tuple_type_arguments_circularly_reference_themselves_4110","Tuple type arguments circularly reference themselves."),Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0:t(4111,e.DiagnosticCategory.Error,"Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111","Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."),This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class:t(4112,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112","This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0:t(4113,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0:t(4114,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114","This member must have an 'override' modifier because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:t(4115,e.DiagnosticCategory.Error,"This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115","This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."),This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0:t(4116,e.DiagnosticCategory.Error,"This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116","This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4117,e.DiagnosticCategory.Error,"This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117","This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized:t(4118,e.DiagnosticCategory.Error,"The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118","The type of this node cannot be serialized because its property '{0}' cannot be serialized."),This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4119,e.DiagnosticCategory.Error,"This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119","This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:t(4120,e.DiagnosticCategory.Error,"This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120","This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:t(4121,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121","This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:t(4122,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122","This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:t(4123,e.DiagnosticCategory.Error,"This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123","This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next:t(4124,e.DiagnosticCategory.Error,"Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124","Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),The_current_host_does_not_support_the_0_option:t(5001,e.DiagnosticCategory.Error,"The_current_host_does_not_support_the_0_option_5001","The current host does not support the '{0}' option."),Cannot_find_the_common_subdirectory_path_for_the_input_files:t(5009,e.DiagnosticCategory.Error,"Cannot_find_the_common_subdirectory_path_for_the_input_files_5009","Cannot find the common subdirectory path for the input files."),File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5010,e.DiagnosticCategory.Error,"File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010","File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),Cannot_read_file_0_Colon_1:t(5012,e.DiagnosticCategory.Error,"Cannot_read_file_0_Colon_1_5012","Cannot read file '{0}': {1}."),Failed_to_parse_file_0_Colon_1:t(5014,e.DiagnosticCategory.Error,"Failed_to_parse_file_0_Colon_1_5014","Failed to parse file '{0}': {1}."),Unknown_compiler_option_0:t(5023,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_5023","Unknown compiler option '{0}'."),Compiler_option_0_requires_a_value_of_type_1:t(5024,e.DiagnosticCategory.Error,"Compiler_option_0_requires_a_value_of_type_1_5024","Compiler option '{0}' requires a value of type {1}."),Unknown_compiler_option_0_Did_you_mean_1:t(5025,e.DiagnosticCategory.Error,"Unknown_compiler_option_0_Did_you_mean_1_5025","Unknown compiler option '{0}'. Did you mean '{1}'?"),Could_not_write_file_0_Colon_1:t(5033,e.DiagnosticCategory.Error,"Could_not_write_file_0_Colon_1_5033","Could not write file '{0}': {1}."),Option_project_cannot_be_mixed_with_source_files_on_a_command_line:t(5042,e.DiagnosticCategory.Error,"Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042","Option 'project' cannot be mixed with source files on a command line."),Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher:t(5047,e.DiagnosticCategory.Error,"Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047","Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."),Option_0_cannot_be_specified_when_option_target_is_ES3:t(5048,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_target_is_ES3_5048","Option '{0}' cannot be specified when option 'target' is 'ES3'."),Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided:t(5051,e.DiagnosticCategory.Error,"Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051","Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."),Option_0_cannot_be_specified_without_specifying_option_1:t(5052,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_5052","Option '{0}' cannot be specified without specifying option '{1}'."),Option_0_cannot_be_specified_with_option_1:t(5053,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_with_option_1_5053","Option '{0}' cannot be specified with option '{1}'."),A_tsconfig_json_file_is_already_defined_at_Colon_0:t(5054,e.DiagnosticCategory.Error,"A_tsconfig_json_file_is_already_defined_at_Colon_0_5054","A 'tsconfig.json' file is already defined at: '{0}'."),Cannot_write_file_0_because_it_would_overwrite_input_file:t(5055,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_overwrite_input_file_5055","Cannot write file '{0}' because it would overwrite input file."),Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files:t(5056,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056","Cannot write file '{0}' because it would be overwritten by multiple input files."),Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0:t(5057,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057","Cannot find a tsconfig.json file at the specified directory: '{0}'."),The_specified_path_does_not_exist_Colon_0:t(5058,e.DiagnosticCategory.Error,"The_specified_path_does_not_exist_Colon_0_5058","The specified path does not exist: '{0}'."),Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier:t(5059,e.DiagnosticCategory.Error,"Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059","Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."),Pattern_0_can_have_at_most_one_Asterisk_character:t(5061,e.DiagnosticCategory.Error,"Pattern_0_can_have_at_most_one_Asterisk_character_5061","Pattern '{0}' can have at most one '*' character."),Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character:t(5062,e.DiagnosticCategory.Error,"Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062","Substitution '{0}' in pattern '{1}' can have at most one '*' character."),Substitutions_for_pattern_0_should_be_an_array:t(5063,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_should_be_an_array_5063","Substitutions for pattern '{0}' should be an array."),Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2:t(5064,e.DiagnosticCategory.Error,"Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064","Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."),File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0:t(5065,e.DiagnosticCategory.Error,"File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065","File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."),Substitutions_for_pattern_0_shouldn_t_be_an_empty_array:t(5066,e.DiagnosticCategory.Error,"Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066","Substitutions for pattern '{0}' shouldn't be an empty array."),Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name:t(5067,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067","Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."),Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig:t(5068,e.DiagnosticCategory.Error,"Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068","Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."),Option_0_cannot_be_specified_without_specifying_option_1_or_option_2:t(5069,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069","Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."),Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy:t(5070,e.DiagnosticCategory.Error,"Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070","Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."),Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext:t(5071,e.DiagnosticCategory.Error,"Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071","Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."),Unknown_build_option_0:t(5072,e.DiagnosticCategory.Error,"Unknown_build_option_0_5072","Unknown build option '{0}'."),Build_option_0_requires_a_value_of_type_1:t(5073,e.DiagnosticCategory.Error,"Build_option_0_requires_a_value_of_type_1_5073","Build option '{0}' requires a value of type {1}."),Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified:t(5074,e.DiagnosticCategory.Error,"Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074","Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."),_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2:t(5075,e.DiagnosticCategory.Error,"_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075","'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."),_0_and_1_operations_cannot_be_mixed_without_parentheses:t(5076,e.DiagnosticCategory.Error,"_0_and_1_operations_cannot_be_mixed_without_parentheses_5076","'{0}' and '{1}' operations cannot be mixed without parentheses."),Unknown_build_option_0_Did_you_mean_1:t(5077,e.DiagnosticCategory.Error,"Unknown_build_option_0_Did_you_mean_1_5077","Unknown build option '{0}'. Did you mean '{1}'?"),Unknown_watch_option_0:t(5078,e.DiagnosticCategory.Error,"Unknown_watch_option_0_5078","Unknown watch option '{0}'."),Unknown_watch_option_0_Did_you_mean_1:t(5079,e.DiagnosticCategory.Error,"Unknown_watch_option_0_Did_you_mean_1_5079","Unknown watch option '{0}'. Did you mean '{1}'?"),Watch_option_0_requires_a_value_of_type_1:t(5080,e.DiagnosticCategory.Error,"Watch_option_0_requires_a_value_of_type_1_5080","Watch option '{0}' requires a value of type {1}."),Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0:t(5081,e.DiagnosticCategory.Error,"Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081","Cannot find a tsconfig.json file at the current directory: {0}."),_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1:t(5082,e.DiagnosticCategory.Error,"_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082","'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),Cannot_read_file_0:t(5083,e.DiagnosticCategory.Error,"Cannot_read_file_0_5083","Cannot read file '{0}'."),Tuple_members_must_all_have_names_or_all_not_have_names:t(5084,e.DiagnosticCategory.Error,"Tuple_members_must_all_have_names_or_all_not_have_names_5084","Tuple members must all have names or all not have names."),A_tuple_member_cannot_be_both_optional_and_rest:t(5085,e.DiagnosticCategory.Error,"A_tuple_member_cannot_be_both_optional_and_rest_5085","A tuple member cannot be both optional and rest."),A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type:t(5086,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086","A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type:t(5087,e.DiagnosticCategory.Error,"A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087","A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary:t(5088,e.DiagnosticCategory.Error,"The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088","The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."),Option_0_cannot_be_specified_when_option_jsx_is_1:t(5089,e.DiagnosticCategory.Error,"Option_0_cannot_be_specified_when_option_jsx_is_1_5089","Option '{0}' cannot be specified when option 'jsx' is '{1}'."),Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash:t(5090,e.DiagnosticCategory.Error,"Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090","Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"),Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled:t(5091,e.DiagnosticCategory.Error,"Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091","Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."),The_root_value_of_a_0_file_must_be_an_object:t(5092,e.DiagnosticCategory.Error,"The_root_value_of_a_0_file_must_be_an_object_5092","The root value of a '{0}' file must be an object."),Compiler_option_0_may_only_be_used_with_build:t(5093,e.DiagnosticCategory.Error,"Compiler_option_0_may_only_be_used_with_build_5093","Compiler option '--{0}' may only be used with '--build'."),Compiler_option_0_may_not_be_used_with_build:t(5094,e.DiagnosticCategory.Error,"Compiler_option_0_may_not_be_used_with_build_5094","Compiler option '--{0}' may not be used with '--build'."),Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later:t(5095,e.DiagnosticCategory.Error,"Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095","Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."),Generates_a_sourcemap_for_each_corresponding_d_ts_file:t(6e3,e.DiagnosticCategory.Message,"Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000","Generates a sourcemap for each corresponding '.d.ts' file."),Concatenate_and_emit_output_to_single_file:t(6001,e.DiagnosticCategory.Message,"Concatenate_and_emit_output_to_single_file_6001","Concatenate and emit output to single file."),Generates_corresponding_d_ts_file:t(6002,e.DiagnosticCategory.Message,"Generates_corresponding_d_ts_file_6002","Generates corresponding '.d.ts' file."),Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations:t(6004,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004","Specify the location where debugger should locate TypeScript files instead of source locations."),Watch_input_files:t(6005,e.DiagnosticCategory.Message,"Watch_input_files_6005","Watch input files."),Redirect_output_structure_to_the_directory:t(6006,e.DiagnosticCategory.Message,"Redirect_output_structure_to_the_directory_6006","Redirect output structure to the directory."),Do_not_erase_const_enum_declarations_in_generated_code:t(6007,e.DiagnosticCategory.Message,"Do_not_erase_const_enum_declarations_in_generated_code_6007","Do not erase const enum declarations in generated code."),Do_not_emit_outputs_if_any_errors_were_reported:t(6008,e.DiagnosticCategory.Message,"Do_not_emit_outputs_if_any_errors_were_reported_6008","Do not emit outputs if any errors were reported."),Do_not_emit_comments_to_output:t(6009,e.DiagnosticCategory.Message,"Do_not_emit_comments_to_output_6009","Do not emit comments to output."),Do_not_emit_outputs:t(6010,e.DiagnosticCategory.Message,"Do_not_emit_outputs_6010","Do not emit outputs."),Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking:t(6011,e.DiagnosticCategory.Message,"Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011","Allow default imports from modules with no default export. This does not affect code emit, just typechecking."),Skip_type_checking_of_declaration_files:t(6012,e.DiagnosticCategory.Message,"Skip_type_checking_of_declaration_files_6012","Skip type checking of declaration files."),Do_not_resolve_the_real_path_of_symlinks:t(6013,e.DiagnosticCategory.Message,"Do_not_resolve_the_real_path_of_symlinks_6013","Do not resolve the real path of symlinks."),Only_emit_d_ts_declaration_files:t(6014,e.DiagnosticCategory.Message,"Only_emit_d_ts_declaration_files_6014","Only emit '.d.ts' declaration files."),Specify_ECMAScript_target_version:t(6015,e.DiagnosticCategory.Message,"Specify_ECMAScript_target_version_6015","Specify ECMAScript target version."),Specify_module_code_generation:t(6016,e.DiagnosticCategory.Message,"Specify_module_code_generation_6016","Specify module code generation."),Print_this_message:t(6017,e.DiagnosticCategory.Message,"Print_this_message_6017","Print this message."),Print_the_compiler_s_version:t(6019,e.DiagnosticCategory.Message,"Print_the_compiler_s_version_6019","Print the compiler's version."),Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json:t(6020,e.DiagnosticCategory.Message,"Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020","Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),Syntax_Colon_0:t(6023,e.DiagnosticCategory.Message,"Syntax_Colon_0_6023","Syntax: {0}"),options:t(6024,e.DiagnosticCategory.Message,"options_6024","options"),file:t(6025,e.DiagnosticCategory.Message,"file_6025","file"),Examples_Colon_0:t(6026,e.DiagnosticCategory.Message,"Examples_Colon_0_6026","Examples: {0}"),Options_Colon:t(6027,e.DiagnosticCategory.Message,"Options_Colon_6027","Options:"),Version_0:t(6029,e.DiagnosticCategory.Message,"Version_0_6029","Version {0}"),Insert_command_line_options_and_files_from_a_file:t(6030,e.DiagnosticCategory.Message,"Insert_command_line_options_and_files_from_a_file_6030","Insert command line options and files from a file."),Starting_compilation_in_watch_mode:t(6031,e.DiagnosticCategory.Message,"Starting_compilation_in_watch_mode_6031","Starting compilation in watch mode..."),File_change_detected_Starting_incremental_compilation:t(6032,e.DiagnosticCategory.Message,"File_change_detected_Starting_incremental_compilation_6032","File change detected. Starting incremental compilation..."),KIND:t(6034,e.DiagnosticCategory.Message,"KIND_6034","KIND"),FILE:t(6035,e.DiagnosticCategory.Message,"FILE_6035","FILE"),VERSION:t(6036,e.DiagnosticCategory.Message,"VERSION_6036","VERSION"),LOCATION:t(6037,e.DiagnosticCategory.Message,"LOCATION_6037","LOCATION"),DIRECTORY:t(6038,e.DiagnosticCategory.Message,"DIRECTORY_6038","DIRECTORY"),STRATEGY:t(6039,e.DiagnosticCategory.Message,"STRATEGY_6039","STRATEGY"),FILE_OR_DIRECTORY:t(6040,e.DiagnosticCategory.Message,"FILE_OR_DIRECTORY_6040","FILE OR DIRECTORY"),Generates_corresponding_map_file:t(6043,e.DiagnosticCategory.Message,"Generates_corresponding_map_file_6043","Generates corresponding '.map' file."),Compiler_option_0_expects_an_argument:t(6044,e.DiagnosticCategory.Error,"Compiler_option_0_expects_an_argument_6044","Compiler option '{0}' expects an argument."),Unterminated_quoted_string_in_response_file_0:t(6045,e.DiagnosticCategory.Error,"Unterminated_quoted_string_in_response_file_0_6045","Unterminated quoted string in response file '{0}'."),Argument_for_0_option_must_be_Colon_1:t(6046,e.DiagnosticCategory.Error,"Argument_for_0_option_must_be_Colon_1_6046","Argument for '{0}' option must be: {1}."),Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1:t(6048,e.DiagnosticCategory.Error,"Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048","Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'."),Unable_to_open_file_0:t(6050,e.DiagnosticCategory.Error,"Unable_to_open_file_0_6050","Unable to open file '{0}'."),Corrupted_locale_file_0:t(6051,e.DiagnosticCategory.Error,"Corrupted_locale_file_0_6051","Corrupted locale file {0}."),Raise_error_on_expressions_and_declarations_with_an_implied_any_type:t(6052,e.DiagnosticCategory.Message,"Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052","Raise error on expressions and declarations with an implied 'any' type."),File_0_not_found:t(6053,e.DiagnosticCategory.Error,"File_0_not_found_6053","File '{0}' not found."),File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1:t(6054,e.DiagnosticCategory.Error,"File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054","File '{0}' has an unsupported extension. The only supported extensions are {1}."),Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures:t(6055,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055","Suppress noImplicitAny errors for indexing objects lacking index signatures."),Do_not_emit_declarations_for_code_that_has_an_internal_annotation:t(6056,e.DiagnosticCategory.Message,"Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056","Do not emit declarations for code that has an '@internal' annotation."),Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir:t(6058,e.DiagnosticCategory.Message,"Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058","Specify the root directory of input files. Use to control the output directory structure with --outDir."),File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files:t(6059,e.DiagnosticCategory.Error,"File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059","File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."),Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix:t(6060,e.DiagnosticCategory.Message,"Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060","Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."),NEWLINE:t(6061,e.DiagnosticCategory.Message,"NEWLINE_6061","NEWLINE"),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line:t(6064,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."),Enables_experimental_support_for_ES7_decorators:t(6065,e.DiagnosticCategory.Message,"Enables_experimental_support_for_ES7_decorators_6065","Enables experimental support for ES7 decorators."),Enables_experimental_support_for_emitting_type_metadata_for_decorators:t(6066,e.DiagnosticCategory.Message,"Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066","Enables experimental support for emitting type metadata for decorators."),Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6:t(6069,e.DiagnosticCategory.Message,"Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069","Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."),Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file:t(6070,e.DiagnosticCategory.Message,"Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070","Initializes a TypeScript project and creates a tsconfig.json file."),Successfully_created_a_tsconfig_json_file:t(6071,e.DiagnosticCategory.Message,"Successfully_created_a_tsconfig_json_file_6071","Successfully created a tsconfig.json file."),Suppress_excess_property_checks_for_object_literals:t(6072,e.DiagnosticCategory.Message,"Suppress_excess_property_checks_for_object_literals_6072","Suppress excess property checks for object literals."),Stylize_errors_and_messages_using_color_and_context_experimental:t(6073,e.DiagnosticCategory.Message,"Stylize_errors_and_messages_using_color_and_context_experimental_6073","Stylize errors and messages using color and context (experimental)."),Do_not_report_errors_on_unused_labels:t(6074,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unused_labels_6074","Do not report errors on unused labels."),Report_error_when_not_all_code_paths_in_function_return_a_value:t(6075,e.DiagnosticCategory.Message,"Report_error_when_not_all_code_paths_in_function_return_a_value_6075","Report error when not all code paths in function return a value."),Report_errors_for_fallthrough_cases_in_switch_statement:t(6076,e.DiagnosticCategory.Message,"Report_errors_for_fallthrough_cases_in_switch_statement_6076","Report errors for fallthrough cases in switch statement."),Do_not_report_errors_on_unreachable_code:t(6077,e.DiagnosticCategory.Message,"Do_not_report_errors_on_unreachable_code_6077","Do not report errors on unreachable code."),Disallow_inconsistently_cased_references_to_the_same_file:t(6078,e.DiagnosticCategory.Message,"Disallow_inconsistently_cased_references_to_the_same_file_6078","Disallow inconsistently-cased references to the same file."),Specify_library_files_to_be_included_in_the_compilation:t(6079,e.DiagnosticCategory.Message,"Specify_library_files_to_be_included_in_the_compilation_6079","Specify library files to be included in the compilation."),Specify_JSX_code_generation:t(6080,e.DiagnosticCategory.Message,"Specify_JSX_code_generation_6080","Specify JSX code generation."),File_0_has_an_unsupported_extension_so_skipping_it:t(6081,e.DiagnosticCategory.Message,"File_0_has_an_unsupported_extension_so_skipping_it_6081","File '{0}' has an unsupported extension, so skipping it."),Only_amd_and_system_modules_are_supported_alongside_0:t(6082,e.DiagnosticCategory.Error,"Only_amd_and_system_modules_are_supported_alongside_0_6082","Only 'amd' and 'system' modules are supported alongside --{0}."),Base_directory_to_resolve_non_absolute_module_names:t(6083,e.DiagnosticCategory.Message,"Base_directory_to_resolve_non_absolute_module_names_6083","Base directory to resolve non-absolute module names."),Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit:t(6084,e.DiagnosticCategory.Message,"Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084","[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),Enable_tracing_of_the_name_resolution_process:t(6085,e.DiagnosticCategory.Message,"Enable_tracing_of_the_name_resolution_process_6085","Enable tracing of the name resolution process."),Resolving_module_0_from_1:t(6086,e.DiagnosticCategory.Message,"Resolving_module_0_from_1_6086","======== Resolving module '{0}' from '{1}'. ========"),Explicitly_specified_module_resolution_kind_Colon_0:t(6087,e.DiagnosticCategory.Message,"Explicitly_specified_module_resolution_kind_Colon_0_6087","Explicitly specified module resolution kind: '{0}'."),Module_resolution_kind_is_not_specified_using_0:t(6088,e.DiagnosticCategory.Message,"Module_resolution_kind_is_not_specified_using_0_6088","Module resolution kind is not specified, using '{0}'."),Module_name_0_was_successfully_resolved_to_1:t(6089,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_6089","======== Module name '{0}' was successfully resolved to '{1}'. ========"),Module_name_0_was_not_resolved:t(6090,e.DiagnosticCategory.Message,"Module_name_0_was_not_resolved_6090","======== Module name '{0}' was not resolved. ========"),paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0:t(6091,e.DiagnosticCategory.Message,"paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091","'paths' option is specified, looking for a pattern to match module name '{0}'."),Module_name_0_matched_pattern_1:t(6092,e.DiagnosticCategory.Message,"Module_name_0_matched_pattern_1_6092","Module name '{0}', matched pattern '{1}'."),Trying_substitution_0_candidate_module_location_Colon_1:t(6093,e.DiagnosticCategory.Message,"Trying_substitution_0_candidate_module_location_Colon_1_6093","Trying substitution '{0}', candidate module location: '{1}'."),Resolving_module_name_0_relative_to_base_url_1_2:t(6094,e.DiagnosticCategory.Message,"Resolving_module_name_0_relative_to_base_url_1_2_6094","Resolving module name '{0}' relative to base url '{1}' - '{2}'."),Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1:t(6095,e.DiagnosticCategory.Message,"Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095","Loading module as file / folder, candidate module location '{0}', target file type '{1}'."),File_0_does_not_exist:t(6096,e.DiagnosticCategory.Message,"File_0_does_not_exist_6096","File '{0}' does not exist."),File_0_exist_use_it_as_a_name_resolution_result:t(6097,e.DiagnosticCategory.Message,"File_0_exist_use_it_as_a_name_resolution_result_6097","File '{0}' exist - use it as a name resolution result."),Loading_module_0_from_node_modules_folder_target_file_type_1:t(6098,e.DiagnosticCategory.Message,"Loading_module_0_from_node_modules_folder_target_file_type_1_6098","Loading module '{0}' from 'node_modules' folder, target file type '{1}'."),Found_package_json_at_0:t(6099,e.DiagnosticCategory.Message,"Found_package_json_at_0_6099","Found 'package.json' at '{0}'."),package_json_does_not_have_a_0_field:t(6100,e.DiagnosticCategory.Message,"package_json_does_not_have_a_0_field_6100","'package.json' does not have a '{0}' field."),package_json_has_0_field_1_that_references_2:t(6101,e.DiagnosticCategory.Message,"package_json_has_0_field_1_that_references_2_6101","'package.json' has '{0}' field '{1}' that references '{2}'."),Allow_javascript_files_to_be_compiled:t(6102,e.DiagnosticCategory.Message,"Allow_javascript_files_to_be_compiled_6102","Allow javascript files to be compiled."),Checking_if_0_is_the_longest_matching_prefix_for_1_2:t(6104,e.DiagnosticCategory.Message,"Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104","Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."),Expected_type_of_0_field_in_package_json_to_be_1_got_2:t(6105,e.DiagnosticCategory.Message,"Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105","Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."),baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1:t(6106,e.DiagnosticCategory.Message,"baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106","'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."),rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0:t(6107,e.DiagnosticCategory.Message,"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107","'rootDirs' option is set, using it to resolve relative module name '{0}'."),Longest_matching_prefix_for_0_is_1:t(6108,e.DiagnosticCategory.Message,"Longest_matching_prefix_for_0_is_1_6108","Longest matching prefix for '{0}' is '{1}'."),Loading_0_from_the_root_dir_1_candidate_location_2:t(6109,e.DiagnosticCategory.Message,"Loading_0_from_the_root_dir_1_candidate_location_2_6109","Loading '{0}' from the root dir '{1}', candidate location '{2}'."),Trying_other_entries_in_rootDirs:t(6110,e.DiagnosticCategory.Message,"Trying_other_entries_in_rootDirs_6110","Trying other entries in 'rootDirs'."),Module_resolution_using_rootDirs_has_failed:t(6111,e.DiagnosticCategory.Message,"Module_resolution_using_rootDirs_has_failed_6111","Module resolution using 'rootDirs' has failed."),Do_not_emit_use_strict_directives_in_module_output:t(6112,e.DiagnosticCategory.Message,"Do_not_emit_use_strict_directives_in_module_output_6112","Do not emit 'use strict' directives in module output."),Enable_strict_null_checks:t(6113,e.DiagnosticCategory.Message,"Enable_strict_null_checks_6113","Enable strict null checks."),Unknown_option_excludes_Did_you_mean_exclude:t(6114,e.DiagnosticCategory.Error,"Unknown_option_excludes_Did_you_mean_exclude_6114","Unknown option 'excludes'. Did you mean 'exclude'?"),Raise_error_on_this_expressions_with_an_implied_any_type:t(6115,e.DiagnosticCategory.Message,"Raise_error_on_this_expressions_with_an_implied_any_type_6115","Raise error on 'this' expressions with an implied 'any' type."),Resolving_type_reference_directive_0_containing_file_1_root_directory_2:t(6116,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116","======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2:t(6119,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119","======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"),Type_reference_directive_0_was_not_resolved:t(6120,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_not_resolved_6120","======== Type reference directive '{0}' was not resolved. ========"),Resolving_with_primary_search_path_0:t(6121,e.DiagnosticCategory.Message,"Resolving_with_primary_search_path_0_6121","Resolving with primary search path '{0}'."),Root_directory_cannot_be_determined_skipping_primary_search_paths:t(6122,e.DiagnosticCategory.Message,"Root_directory_cannot_be_determined_skipping_primary_search_paths_6122","Root directory cannot be determined, skipping primary search paths."),Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set:t(6123,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123","======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"),Type_declaration_files_to_be_included_in_compilation:t(6124,e.DiagnosticCategory.Message,"Type_declaration_files_to_be_included_in_compilation_6124","Type declaration files to be included in compilation."),Looking_up_in_node_modules_folder_initial_location_0:t(6125,e.DiagnosticCategory.Message,"Looking_up_in_node_modules_folder_initial_location_0_6125","Looking up in 'node_modules' folder, initial location '{0}'."),Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder:t(6126,e.DiagnosticCategory.Message,"Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126","Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1:t(6127,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127","======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"),Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set:t(6128,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128","======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"),Resolving_real_path_for_0_result_1:t(6130,e.DiagnosticCategory.Message,"Resolving_real_path_for_0_result_1_6130","Resolving real path for '{0}', result '{1}'."),Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system:t(6131,e.DiagnosticCategory.Error,"Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131","Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."),File_name_0_has_a_1_extension_stripping_it:t(6132,e.DiagnosticCategory.Message,"File_name_0_has_a_1_extension_stripping_it_6132","File name '{0}' has a '{1}' extension - stripping it."),_0_is_declared_but_its_value_is_never_read:t(6133,e.DiagnosticCategory.Error,"_0_is_declared_but_its_value_is_never_read_6133","'{0}' is declared but its value is never read.",!0),Report_errors_on_unused_locals:t(6134,e.DiagnosticCategory.Message,"Report_errors_on_unused_locals_6134","Report errors on unused locals."),Report_errors_on_unused_parameters:t(6135,e.DiagnosticCategory.Message,"Report_errors_on_unused_parameters_6135","Report errors on unused parameters."),The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files:t(6136,e.DiagnosticCategory.Message,"The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136","The maximum dependency depth to search under node_modules and load JavaScript files."),Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1:t(6137,e.DiagnosticCategory.Error,"Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137","Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."),Property_0_is_declared_but_its_value_is_never_read:t(6138,e.DiagnosticCategory.Error,"Property_0_is_declared_but_its_value_is_never_read_6138","Property '{0}' is declared but its value is never read.",!0),Import_emit_helpers_from_tslib:t(6139,e.DiagnosticCategory.Message,"Import_emit_helpers_from_tslib_6139","Import emit helpers from 'tslib'."),Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2:t(6140,e.DiagnosticCategory.Error,"Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140","Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."),Parse_in_strict_mode_and_emit_use_strict_for_each_source_file:t(6141,e.DiagnosticCategory.Message,"Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141",'Parse in strict mode and emit "use strict" for each source file.'),Module_0_was_resolved_to_1_but_jsx_is_not_set:t(6142,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_jsx_is_not_set_6142","Module '{0}' was resolved to '{1}', but '--jsx' is not set."),Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1:t(6144,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144","Module '{0}' was resolved as locally declared ambient module in file '{1}'."),Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified:t(6145,e.DiagnosticCategory.Message,"Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145","Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."),Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h:t(6146,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146","Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."),Resolution_for_module_0_was_found_in_cache_from_location_1:t(6147,e.DiagnosticCategory.Message,"Resolution_for_module_0_was_found_in_cache_from_location_1_6147","Resolution for module '{0}' was found in cache from location '{1}'."),Directory_0_does_not_exist_skipping_all_lookups_in_it:t(6148,e.DiagnosticCategory.Message,"Directory_0_does_not_exist_skipping_all_lookups_in_it_6148","Directory '{0}' does not exist, skipping all lookups in it."),Show_diagnostic_information:t(6149,e.DiagnosticCategory.Message,"Show_diagnostic_information_6149","Show diagnostic information."),Show_verbose_diagnostic_information:t(6150,e.DiagnosticCategory.Message,"Show_verbose_diagnostic_information_6150","Show verbose diagnostic information."),Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file:t(6151,e.DiagnosticCategory.Message,"Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151","Emit a single file with source maps instead of having a separate file."),Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set:t(6152,e.DiagnosticCategory.Message,"Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152","Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."),Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule:t(6153,e.DiagnosticCategory.Message,"Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153","Transpile each file as a separate module (similar to 'ts.transpileModule')."),Print_names_of_generated_files_part_of_the_compilation:t(6154,e.DiagnosticCategory.Message,"Print_names_of_generated_files_part_of_the_compilation_6154","Print names of generated files part of the compilation."),Print_names_of_files_part_of_the_compilation:t(6155,e.DiagnosticCategory.Message,"Print_names_of_files_part_of_the_compilation_6155","Print names of files part of the compilation."),The_locale_used_when_displaying_messages_to_the_user_e_g_en_us:t(6156,e.DiagnosticCategory.Message,"The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156","The locale used when displaying messages to the user (e.g. 'en-us')"),Do_not_generate_custom_helper_functions_like_extends_in_compiled_output:t(6157,e.DiagnosticCategory.Message,"Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157","Do not generate custom helper functions like '__extends' in compiled output."),Do_not_include_the_default_library_file_lib_d_ts:t(6158,e.DiagnosticCategory.Message,"Do_not_include_the_default_library_file_lib_d_ts_6158","Do not include the default library file (lib.d.ts)."),Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files:t(6159,e.DiagnosticCategory.Message,"Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159","Do not add triple-slash references or imported modules to the list of compiled files."),Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files:t(6160,e.DiagnosticCategory.Message,"Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160","[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."),List_of_folders_to_include_type_definitions_from:t(6161,e.DiagnosticCategory.Message,"List_of_folders_to_include_type_definitions_from_6161","List of folders to include type definitions from."),Disable_size_limitations_on_JavaScript_projects:t(6162,e.DiagnosticCategory.Message,"Disable_size_limitations_on_JavaScript_projects_6162","Disable size limitations on JavaScript projects."),The_character_set_of_the_input_files:t(6163,e.DiagnosticCategory.Message,"The_character_set_of_the_input_files_6163","The character set of the input files."),Do_not_truncate_error_messages:t(6165,e.DiagnosticCategory.Message,"Do_not_truncate_error_messages_6165","Do not truncate error messages."),Output_directory_for_generated_declaration_files:t(6166,e.DiagnosticCategory.Message,"Output_directory_for_generated_declaration_files_6166","Output directory for generated declaration files."),A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl:t(6167,e.DiagnosticCategory.Message,"A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167","A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."),List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime:t(6168,e.DiagnosticCategory.Message,"List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168","List of root folders whose combined content represents the structure of the project at runtime."),Show_all_compiler_options:t(6169,e.DiagnosticCategory.Message,"Show_all_compiler_options_6169","Show all compiler options."),Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file:t(6170,e.DiagnosticCategory.Message,"Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170","[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"),Command_line_Options:t(6171,e.DiagnosticCategory.Message,"Command_line_Options_6171","Command-line Options"),Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3:t(6179,e.DiagnosticCategory.Message,"Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179","Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),Enable_all_strict_type_checking_options:t(6180,e.DiagnosticCategory.Message,"Enable_all_strict_type_checking_options_6180","Enable all strict type-checking options."),List_of_language_service_plugins:t(6181,e.DiagnosticCategory.Message,"List_of_language_service_plugins_6181","List of language service plugins."),Scoped_package_detected_looking_in_0:t(6182,e.DiagnosticCategory.Message,"Scoped_package_detected_looking_in_0_6182","Scoped package detected, looking in '{0}'"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6183,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6184,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184","Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Enable_strict_checking_of_function_types:t(6186,e.DiagnosticCategory.Message,"Enable_strict_checking_of_function_types_6186","Enable strict checking of function types."),Enable_strict_checking_of_property_initialization_in_classes:t(6187,e.DiagnosticCategory.Message,"Enable_strict_checking_of_property_initialization_in_classes_6187","Enable strict checking of property initialization in classes."),Numeric_separators_are_not_allowed_here:t(6188,e.DiagnosticCategory.Error,"Numeric_separators_are_not_allowed_here_6188","Numeric separators are not allowed here."),Multiple_consecutive_numeric_separators_are_not_permitted:t(6189,e.DiagnosticCategory.Error,"Multiple_consecutive_numeric_separators_are_not_permitted_6189","Multiple consecutive numeric separators are not permitted."),Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen:t(6191,e.DiagnosticCategory.Message,"Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191","Whether to keep outdated console output in watch mode instead of clearing the screen."),All_imports_in_import_declaration_are_unused:t(6192,e.DiagnosticCategory.Error,"All_imports_in_import_declaration_are_unused_6192","All imports in import declaration are unused.",!0),Found_1_error_Watching_for_file_changes:t(6193,e.DiagnosticCategory.Message,"Found_1_error_Watching_for_file_changes_6193","Found 1 error. Watching for file changes."),Found_0_errors_Watching_for_file_changes:t(6194,e.DiagnosticCategory.Message,"Found_0_errors_Watching_for_file_changes_6194","Found {0} errors. Watching for file changes."),Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols:t(6195,e.DiagnosticCategory.Message,"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195","Resolve 'keyof' to string valued property names only (no numbers or symbols)."),_0_is_declared_but_never_used:t(6196,e.DiagnosticCategory.Error,"_0_is_declared_but_never_used_6196","'{0}' is declared but never used.",!0),Include_modules_imported_with_json_extension:t(6197,e.DiagnosticCategory.Message,"Include_modules_imported_with_json_extension_6197","Include modules imported with '.json' extension"),All_destructured_elements_are_unused:t(6198,e.DiagnosticCategory.Error,"All_destructured_elements_are_unused_6198","All destructured elements are unused.",!0),All_variables_are_unused:t(6199,e.DiagnosticCategory.Error,"All_variables_are_unused_6199","All variables are unused.",!0),Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0:t(6200,e.DiagnosticCategory.Error,"Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200","Definitions of the following identifiers conflict with those in another file: {0}"),Conflicts_are_in_this_file:t(6201,e.DiagnosticCategory.Message,"Conflicts_are_in_this_file_6201","Conflicts are in this file."),Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0:t(6202,e.DiagnosticCategory.Error,"Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202","Project references may not form a circular graph. Cycle detected: {0}"),_0_was_also_declared_here:t(6203,e.DiagnosticCategory.Message,"_0_was_also_declared_here_6203","'{0}' was also declared here."),and_here:t(6204,e.DiagnosticCategory.Message,"and_here_6204","and here."),All_type_parameters_are_unused:t(6205,e.DiagnosticCategory.Error,"All_type_parameters_are_unused_6205","All type parameters are unused."),package_json_has_a_typesVersions_field_with_version_specific_path_mappings:t(6206,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206","'package.json' has a 'typesVersions' field with version-specific path mappings."),package_json_does_not_have_a_typesVersions_entry_that_matches_version_0:t(6207,e.DiagnosticCategory.Message,"package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207","'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2:t(6208,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208","'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."),package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range:t(6209,e.DiagnosticCategory.Message,"package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209","'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."),An_argument_for_0_was_not_provided:t(6210,e.DiagnosticCategory.Message,"An_argument_for_0_was_not_provided_6210","An argument for '{0}' was not provided."),An_argument_matching_this_binding_pattern_was_not_provided:t(6211,e.DiagnosticCategory.Message,"An_argument_matching_this_binding_pattern_was_not_provided_6211","An argument matching this binding pattern was not provided."),Did_you_mean_to_call_this_expression:t(6212,e.DiagnosticCategory.Message,"Did_you_mean_to_call_this_expression_6212","Did you mean to call this expression?"),Did_you_mean_to_use_new_with_this_expression:t(6213,e.DiagnosticCategory.Message,"Did_you_mean_to_use_new_with_this_expression_6213","Did you mean to use 'new' with this expression?"),Enable_strict_bind_call_and_apply_methods_on_functions:t(6214,e.DiagnosticCategory.Message,"Enable_strict_bind_call_and_apply_methods_on_functions_6214","Enable strict 'bind', 'call', and 'apply' methods on functions."),Using_compiler_options_of_project_reference_redirect_0:t(6215,e.DiagnosticCategory.Message,"Using_compiler_options_of_project_reference_redirect_0_6215","Using compiler options of project reference redirect '{0}'."),Found_1_error:t(6216,e.DiagnosticCategory.Message,"Found_1_error_6216","Found 1 error."),Found_0_errors:t(6217,e.DiagnosticCategory.Message,"Found_0_errors_6217","Found {0} errors."),Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2:t(6218,e.DiagnosticCategory.Message,"Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218","======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"),Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3:t(6219,e.DiagnosticCategory.Message,"Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219","======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"),package_json_had_a_falsy_0_field:t(6220,e.DiagnosticCategory.Message,"package_json_had_a_falsy_0_field_6220","'package.json' had a falsy '{0}' field."),Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects:t(6221,e.DiagnosticCategory.Message,"Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221","Disable use of source files instead of declaration files from referenced projects."),Emit_class_fields_with_Define_instead_of_Set:t(6222,e.DiagnosticCategory.Message,"Emit_class_fields_with_Define_instead_of_Set_6222","Emit class fields with Define instead of Set."),Generates_a_CPU_profile:t(6223,e.DiagnosticCategory.Message,"Generates_a_CPU_profile_6223","Generates a CPU profile."),Disable_solution_searching_for_this_project:t(6224,e.DiagnosticCategory.Message,"Disable_solution_searching_for_this_project_6224","Disable solution searching for this project."),Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory:t(6225,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225","Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."),Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling:t(6226,e.DiagnosticCategory.Message,"Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226","Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."),Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize:t(6227,e.DiagnosticCategory.Message,"Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227","Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."),Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3:t(6229,e.DiagnosticCategory.Error,"Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229","Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."),Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line:t(6230,e.DiagnosticCategory.Error,"Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230","Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."),Could_not_resolve_the_path_0_with_the_extensions_Colon_1:t(6231,e.DiagnosticCategory.Error,"Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231","Could not resolve the path '{0}' with the extensions: {1}."),Declaration_augments_declaration_in_another_file_This_cannot_be_serialized:t(6232,e.DiagnosticCategory.Error,"Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232","Declaration augments declaration in another file. This cannot be serialized."),This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file:t(6233,e.DiagnosticCategory.Error,"This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233","This is the declaration being augmented. Consider moving the augmenting declaration into the same file."),This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without:t(6234,e.DiagnosticCategory.Error,"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234","This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"),Disable_loading_referenced_projects:t(6235,e.DiagnosticCategory.Message,"Disable_loading_referenced_projects_6235","Disable loading referenced projects."),Arguments_for_the_rest_parameter_0_were_not_provided:t(6236,e.DiagnosticCategory.Error,"Arguments_for_the_rest_parameter_0_were_not_provided_6236","Arguments for the rest parameter '{0}' were not provided."),Generates_an_event_trace_and_a_list_of_types:t(6237,e.DiagnosticCategory.Message,"Generates_an_event_trace_and_a_list_of_types_6237","Generates an event trace and a list of types."),Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react:t(6238,e.DiagnosticCategory.Error,"Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238","Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"),File_0_exists_according_to_earlier_cached_lookups:t(6239,e.DiagnosticCategory.Message,"File_0_exists_according_to_earlier_cached_lookups_6239","File '{0}' exists according to earlier cached lookups."),File_0_does_not_exist_according_to_earlier_cached_lookups:t(6240,e.DiagnosticCategory.Message,"File_0_does_not_exist_according_to_earlier_cached_lookups_6240","File '{0}' does not exist according to earlier cached lookups."),Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1:t(6241,e.DiagnosticCategory.Message,"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241","Resolution for type reference directive '{0}' was found in cache from location '{1}'."),Resolving_type_reference_directive_0_containing_file_1:t(6242,e.DiagnosticCategory.Message,"Resolving_type_reference_directive_0_containing_file_1_6242","======== Resolving type reference directive '{0}', containing file '{1}'. ========"),Interpret_optional_property_types_as_written_rather_than_adding_undefined:t(6243,e.DiagnosticCategory.Message,"Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243","Interpret optional property types as written, rather than adding 'undefined'."),Modules:t(6244,e.DiagnosticCategory.Message,"Modules_6244","Modules"),File_Management:t(6245,e.DiagnosticCategory.Message,"File_Management_6245","File Management"),Emit:t(6246,e.DiagnosticCategory.Message,"Emit_6246","Emit"),JavaScript_Support:t(6247,e.DiagnosticCategory.Message,"JavaScript_Support_6247","JavaScript Support"),Type_Checking:t(6248,e.DiagnosticCategory.Message,"Type_Checking_6248","Type Checking"),Editor_Support:t(6249,e.DiagnosticCategory.Message,"Editor_Support_6249","Editor Support"),Watch_and_Build_Modes:t(6250,e.DiagnosticCategory.Message,"Watch_and_Build_Modes_6250","Watch and Build Modes"),Compiler_Diagnostics:t(6251,e.DiagnosticCategory.Message,"Compiler_Diagnostics_6251","Compiler Diagnostics"),Interop_Constraints:t(6252,e.DiagnosticCategory.Message,"Interop_Constraints_6252","Interop Constraints"),Backwards_Compatibility:t(6253,e.DiagnosticCategory.Message,"Backwards_Compatibility_6253","Backwards Compatibility"),Language_and_Environment:t(6254,e.DiagnosticCategory.Message,"Language_and_Environment_6254","Language and Environment"),Projects:t(6255,e.DiagnosticCategory.Message,"Projects_6255","Projects"),Output_Formatting:t(6256,e.DiagnosticCategory.Message,"Output_Formatting_6256","Output Formatting"),Completeness:t(6257,e.DiagnosticCategory.Message,"Completeness_6257","Completeness"),_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file:t(6258,e.DiagnosticCategory.Error,"_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258","'{0}' should be set inside the 'compilerOptions' object of the config json file"),Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve:t(6270,e.DiagnosticCategory.Message,"Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270","Directory '{0}' has no containing package.json scope. Imports will not resolve."),Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6271,e.DiagnosticCategory.Message,"Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271","Import specifier '{0}' does not exist in package.json scope at path '{1}'."),Invalid_import_specifier_0_has_no_possible_resolutions:t(6272,e.DiagnosticCategory.Message,"Invalid_import_specifier_0_has_no_possible_resolutions_6272","Invalid import specifier '{0}' has no possible resolutions."),package_json_scope_0_has_no_imports_defined:t(6273,e.DiagnosticCategory.Message,"package_json_scope_0_has_no_imports_defined_6273","package.json scope '{0}' has no imports defined."),package_json_scope_0_explicitly_maps_specifier_1_to_null:t(6274,e.DiagnosticCategory.Message,"package_json_scope_0_explicitly_maps_specifier_1_to_null_6274","package.json scope '{0}' explicitly maps specifier '{1}' to null."),package_json_scope_0_has_invalid_type_for_target_of_specifier_1:t(6275,e.DiagnosticCategory.Message,"package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275","package.json scope '{0}' has invalid type for target of specifier '{1}'"),Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1:t(6276,e.DiagnosticCategory.Message,"Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276","Export specifier '{0}' does not exist in package.json scope at path '{1}'."),Enable_project_compilation:t(6302,e.DiagnosticCategory.Message,"Enable_project_compilation_6302","Enable project compilation"),Composite_projects_may_not_disable_declaration_emit:t(6304,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_declaration_emit_6304","Composite projects may not disable declaration emit."),Output_file_0_has_not_been_built_from_source_file_1:t(6305,e.DiagnosticCategory.Error,"Output_file_0_has_not_been_built_from_source_file_1_6305","Output file '{0}' has not been built from source file '{1}'."),Referenced_project_0_must_have_setting_composite_Colon_true:t(6306,e.DiagnosticCategory.Error,"Referenced_project_0_must_have_setting_composite_Colon_true_6306","Referenced project '{0}' must have setting \"composite\": true."),File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern:t(6307,e.DiagnosticCategory.Error,"File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307","File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."),Cannot_prepend_project_0_because_it_does_not_have_outFile_set:t(6308,e.DiagnosticCategory.Error,"Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308","Cannot prepend project '{0}' because it does not have 'outFile' set"),Output_file_0_from_project_1_does_not_exist:t(6309,e.DiagnosticCategory.Error,"Output_file_0_from_project_1_does_not_exist_6309","Output file '{0}' from project '{1}' does not exist"),Referenced_project_0_may_not_disable_emit:t(6310,e.DiagnosticCategory.Error,"Referenced_project_0_may_not_disable_emit_6310","Referenced project '{0}' may not disable emit."),Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2:t(6350,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350","Project '{0}' is out of date because oldest output '{1}' is older than newest input '{2}'"),Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2:t(6351,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351","Project '{0}' is up to date because newest input '{1}' is older than oldest output '{2}'"),Project_0_is_out_of_date_because_output_file_1_does_not_exist:t(6352,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352","Project '{0}' is out of date because output file '{1}' does not exist"),Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date:t(6353,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353","Project '{0}' is out of date because its dependency '{1}' is out of date"),Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies:t(6354,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354","Project '{0}' is up to date with .d.ts files from its dependencies"),Projects_in_this_build_Colon_0:t(6355,e.DiagnosticCategory.Message,"Projects_in_this_build_Colon_0_6355","Projects in this build: {0}"),A_non_dry_build_would_delete_the_following_files_Colon_0:t(6356,e.DiagnosticCategory.Message,"A_non_dry_build_would_delete_the_following_files_Colon_0_6356","A non-dry build would delete the following files: {0}"),A_non_dry_build_would_build_project_0:t(6357,e.DiagnosticCategory.Message,"A_non_dry_build_would_build_project_0_6357","A non-dry build would build project '{0}'"),Building_project_0:t(6358,e.DiagnosticCategory.Message,"Building_project_0_6358","Building project '{0}'..."),Updating_output_timestamps_of_project_0:t(6359,e.DiagnosticCategory.Message,"Updating_output_timestamps_of_project_0_6359","Updating output timestamps of project '{0}'..."),Project_0_is_up_to_date:t(6361,e.DiagnosticCategory.Message,"Project_0_is_up_to_date_6361","Project '{0}' is up to date"),Skipping_build_of_project_0_because_its_dependency_1_has_errors:t(6362,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362","Skipping build of project '{0}' because its dependency '{1}' has errors"),Project_0_can_t_be_built_because_its_dependency_1_has_errors:t(6363,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363","Project '{0}' can't be built because its dependency '{1}' has errors"),Build_one_or_more_projects_and_their_dependencies_if_out_of_date:t(6364,e.DiagnosticCategory.Message,"Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364","Build one or more projects and their dependencies, if out of date"),Delete_the_outputs_of_all_projects:t(6365,e.DiagnosticCategory.Message,"Delete_the_outputs_of_all_projects_6365","Delete the outputs of all projects"),Show_what_would_be_built_or_deleted_if_specified_with_clean:t(6367,e.DiagnosticCategory.Message,"Show_what_would_be_built_or_deleted_if_specified_with_clean_6367","Show what would be built (or deleted, if specified with '--clean')"),Option_build_must_be_the_first_command_line_argument:t(6369,e.DiagnosticCategory.Error,"Option_build_must_be_the_first_command_line_argument_6369","Option '--build' must be the first command line argument."),Options_0_and_1_cannot_be_combined:t(6370,e.DiagnosticCategory.Error,"Options_0_and_1_cannot_be_combined_6370","Options '{0}' and '{1}' cannot be combined."),Updating_unchanged_output_timestamps_of_project_0:t(6371,e.DiagnosticCategory.Message,"Updating_unchanged_output_timestamps_of_project_0_6371","Updating unchanged output timestamps of project '{0}'..."),Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed:t(6372,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372","Project '{0}' is out of date because output of its dependency '{1}' has changed"),Updating_output_of_project_0:t(6373,e.DiagnosticCategory.Message,"Updating_output_of_project_0_6373","Updating output of project '{0}'..."),A_non_dry_build_would_update_timestamps_for_output_of_project_0:t(6374,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374","A non-dry build would update timestamps for output of project '{0}'"),A_non_dry_build_would_update_output_of_project_0:t(6375,e.DiagnosticCategory.Message,"A_non_dry_build_would_update_output_of_project_0_6375","A non-dry build would update output of project '{0}'"),Cannot_update_output_of_project_0_because_there_was_error_reading_file_1:t(6376,e.DiagnosticCategory.Message,"Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376","Cannot update output of project '{0}' because there was error reading file '{1}'"),Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1:t(6377,e.DiagnosticCategory.Error,"Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377","Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),Enable_incremental_compilation:t(6378,e.DiagnosticCategory.Message,"Enable_incremental_compilation_6378","Enable incremental compilation"),Composite_projects_may_not_disable_incremental_compilation:t(6379,e.DiagnosticCategory.Error,"Composite_projects_may_not_disable_incremental_compilation_6379","Composite projects may not disable incremental compilation."),Specify_file_to_store_incremental_compilation_information:t(6380,e.DiagnosticCategory.Message,"Specify_file_to_store_incremental_compilation_information_6380","Specify file to store incremental compilation information"),Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2:t(6381,e.DiagnosticCategory.Message,"Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381","Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),Skipping_build_of_project_0_because_its_dependency_1_was_not_built:t(6382,e.DiagnosticCategory.Message,"Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382","Skipping build of project '{0}' because its dependency '{1}' was not built"),Project_0_can_t_be_built_because_its_dependency_1_was_not_built:t(6383,e.DiagnosticCategory.Message,"Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383","Project '{0}' can't be built because its dependency '{1}' was not built"),Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6384,e.DiagnosticCategory.Message,"Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384","Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."),_0_is_deprecated:t(6385,e.DiagnosticCategory.Suggestion,"_0_is_deprecated_6385","'{0}' is deprecated.",void 0,void 0,!0),Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found:t(6386,e.DiagnosticCategory.Message,"Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386","Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."),The_signature_0_of_1_is_deprecated:t(6387,e.DiagnosticCategory.Suggestion,"The_signature_0_of_1_is_deprecated_6387","The signature '{0}' of '{1}' is deprecated.",void 0,void 0,!0),Project_0_is_being_forcibly_rebuilt:t(6388,e.DiagnosticCategory.Message,"Project_0_is_being_forcibly_rebuilt_6388","Project '{0}' is being forcibly rebuilt"),Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:t(6389,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389","Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:t(6390,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:t(6391,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved:t(6392,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392","Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6393,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6394,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6395,e.DiagnosticCategory.Message,"Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395","Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:t(6396,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:t(6397,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."),Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:t(6398,e.DiagnosticCategory.Message,"Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398","Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1:t(6500,e.DiagnosticCategory.Message,"The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500","The expected type comes from property '{0}' which is declared here on type '{1}'"),The_expected_type_comes_from_this_index_signature:t(6501,e.DiagnosticCategory.Message,"The_expected_type_comes_from_this_index_signature_6501","The expected type comes from this index signature."),The_expected_type_comes_from_the_return_type_of_this_signature:t(6502,e.DiagnosticCategory.Message,"The_expected_type_comes_from_the_return_type_of_this_signature_6502","The expected type comes from the return type of this signature."),Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing:t(6503,e.DiagnosticCategory.Message,"Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503","Print names of files that are part of the compilation and then stop processing."),File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option:t(6504,e.DiagnosticCategory.Error,"File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504","File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),Print_names_of_files_and_the_reason_they_are_part_of_the_compilation:t(6505,e.DiagnosticCategory.Message,"Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505","Print names of files and the reason they are part of the compilation."),Consider_adding_a_declare_modifier_to_this_class:t(6506,e.DiagnosticCategory.Message,"Consider_adding_a_declare_modifier_to_this_class_6506","Consider adding a 'declare' modifier to this class."),Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files:t(6600,e.DiagnosticCategory.Message,"Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600","Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files."),Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export:t(6601,e.DiagnosticCategory.Message,"Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601","Allow 'import x from y' when a module doesn't have a default export."),Allow_accessing_UMD_globals_from_modules:t(6602,e.DiagnosticCategory.Message,"Allow_accessing_UMD_globals_from_modules_6602","Allow accessing UMD globals from modules."),Disable_error_reporting_for_unreachable_code:t(6603,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unreachable_code_6603","Disable error reporting for unreachable code."),Disable_error_reporting_for_unused_labels:t(6604,e.DiagnosticCategory.Message,"Disable_error_reporting_for_unused_labels_6604","Disable error reporting for unused labels."),Ensure_use_strict_is_always_emitted:t(6605,e.DiagnosticCategory.Message,"Ensure_use_strict_is_always_emitted_6605","Ensure 'use strict' is always emitted."),Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it:t(6606,e.DiagnosticCategory.Message,"Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606","Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it."),Specify_the_base_directory_to_resolve_non_relative_module_names:t(6607,e.DiagnosticCategory.Message,"Specify_the_base_directory_to_resolve_non_relative_module_names_6607","Specify the base directory to resolve non-relative module names."),No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files:t(6608,e.DiagnosticCategory.Message,"No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608","No longer supported. In early versions, manually set the text encoding for reading files."),Enable_error_reporting_in_type_checked_JavaScript_files:t(6609,e.DiagnosticCategory.Message,"Enable_error_reporting_in_type_checked_JavaScript_files_6609","Enable error reporting in type-checked JavaScript files."),Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references:t(6611,e.DiagnosticCategory.Message,"Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611","Enable constraints that allow a TypeScript project to be used with project references."),Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project:t(6612,e.DiagnosticCategory.Message,"Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612","Generate .d.ts files from TypeScript and JavaScript files in your project."),Specify_the_output_directory_for_generated_declaration_files:t(6613,e.DiagnosticCategory.Message,"Specify_the_output_directory_for_generated_declaration_files_6613","Specify the output directory for generated declaration files."),Create_sourcemaps_for_d_ts_files:t(6614,e.DiagnosticCategory.Message,"Create_sourcemaps_for_d_ts_files_6614","Create sourcemaps for d.ts files."),Output_compiler_performance_information_after_building:t(6615,e.DiagnosticCategory.Message,"Output_compiler_performance_information_after_building_6615","Output compiler performance information after building."),Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project:t(6616,e.DiagnosticCategory.Message,"Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616","Disables inference for type acquisition by looking at filenames in a project."),Reduce_the_number_of_projects_loaded_automatically_by_TypeScript:t(6617,e.DiagnosticCategory.Message,"Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617","Reduce the number of projects loaded automatically by TypeScript."),Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server:t(6618,e.DiagnosticCategory.Message,"Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618","Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),Opt_a_project_out_of_multi_project_reference_checking_when_editing:t(6619,e.DiagnosticCategory.Message,"Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619","Opt a project out of multi-project reference checking when editing."),Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects:t(6620,e.DiagnosticCategory.Message,"Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620","Disable preferring source files instead of declaration files when referencing composite projects"),Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration:t(6621,e.DiagnosticCategory.Message,"Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621","Emit more compliant, but verbose and less performant JavaScript for iteration."),Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files:t(6622,e.DiagnosticCategory.Message,"Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622","Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),Only_output_d_ts_files_and_not_JavaScript_files:t(6623,e.DiagnosticCategory.Message,"Only_output_d_ts_files_and_not_JavaScript_files_6623","Only output d.ts files and not JavaScript files."),Emit_design_type_metadata_for_decorated_declarations_in_source_files:t(6624,e.DiagnosticCategory.Message,"Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624","Emit design-type metadata for decorated declarations in source files."),Disable_the_type_acquisition_for_JavaScript_projects:t(6625,e.DiagnosticCategory.Message,"Disable_the_type_acquisition_for_JavaScript_projects_6625","Disable the type acquisition for JavaScript projects"),Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility:t(6626,e.DiagnosticCategory.Message,"Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626","Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility."),Filters_results_from_the_include_option:t(6627,e.DiagnosticCategory.Message,"Filters_results_from_the_include_option_6627","Filters results from the `include` option."),Remove_a_list_of_directories_from_the_watch_process:t(6628,e.DiagnosticCategory.Message,"Remove_a_list_of_directories_from_the_watch_process_6628","Remove a list of directories from the watch process."),Remove_a_list_of_files_from_the_watch_mode_s_processing:t(6629,e.DiagnosticCategory.Message,"Remove_a_list_of_files_from_the_watch_mode_s_processing_6629","Remove a list of files from the watch mode's processing."),Enable_experimental_support_for_TC39_stage_2_draft_decorators:t(6630,e.DiagnosticCategory.Message,"Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630","Enable experimental support for TC39 stage 2 draft decorators."),Print_files_read_during_the_compilation_including_why_it_was_included:t(6631,e.DiagnosticCategory.Message,"Print_files_read_during_the_compilation_including_why_it_was_included_6631","Print files read during the compilation including why it was included."),Output_more_detailed_compiler_performance_information_after_building:t(6632,e.DiagnosticCategory.Message,"Output_more_detailed_compiler_performance_information_after_building_6632","Output more detailed compiler performance information after building."),Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited:t(6633,e.DiagnosticCategory.Message,"Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633","Specify one or more path or node module references to base configuration files from which settings are inherited."),Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers:t(6634,e.DiagnosticCategory.Message,"Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634","Specify what approach the watcher should use if the system runs out of native file watchers."),Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include:t(6635,e.DiagnosticCategory.Message,"Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635","Include a list of files. This does not support glob patterns, as opposed to `include`."),Build_all_projects_including_those_that_appear_to_be_up_to_date:t(6636,e.DiagnosticCategory.Message,"Build_all_projects_including_those_that_appear_to_be_up_to_date_6636","Build all projects, including those that appear to be up to date"),Ensure_that_casing_is_correct_in_imports:t(6637,e.DiagnosticCategory.Message,"Ensure_that_casing_is_correct_in_imports_6637","Ensure that casing is correct in imports."),Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging:t(6638,e.DiagnosticCategory.Message,"Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638","Emit a v8 CPU profile of the compiler run for debugging."),Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file:t(6639,e.DiagnosticCategory.Message,"Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639","Allow importing helper functions from tslib once per project, instead of including them per-file."),Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation:t(6641,e.DiagnosticCategory.Message,"Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641","Specify a list of glob patterns that match files to be included in compilation."),Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects:t(6642,e.DiagnosticCategory.Message,"Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642","Save .tsbuildinfo files to allow for incremental compilation of projects."),Include_sourcemap_files_inside_the_emitted_JavaScript:t(6643,e.DiagnosticCategory.Message,"Include_sourcemap_files_inside_the_emitted_JavaScript_6643","Include sourcemap files inside the emitted JavaScript."),Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript:t(6644,e.DiagnosticCategory.Message,"Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644","Include source code in the sourcemaps inside the emitted JavaScript."),Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports:t(6645,e.DiagnosticCategory.Message,"Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645","Ensure that each file can be safely transpiled without relying on other imports."),Specify_what_JSX_code_is_generated:t(6646,e.DiagnosticCategory.Message,"Specify_what_JSX_code_is_generated_6646","Specify what JSX code is generated."),Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h:t(6647,e.DiagnosticCategory.Message,"Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647","Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'"),Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment:t(6648,e.DiagnosticCategory.Message,"Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648","Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk:t(6649,e.DiagnosticCategory.Message,"Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649","Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`"),Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option:t(6650,e.DiagnosticCategory.Message,"Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650","Make keyof only return strings instead of string, numbers or symbols. Legacy option."),Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment:t(6651,e.DiagnosticCategory.Message,"Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651","Specify a set of bundled library declaration files that describe the target runtime environment."),Print_the_names_of_emitted_files_after_a_compilation:t(6652,e.DiagnosticCategory.Message,"Print_the_names_of_emitted_files_after_a_compilation_6652","Print the names of emitted files after a compilation."),Print_all_of_the_files_read_during_the_compilation:t(6653,e.DiagnosticCategory.Message,"Print_all_of_the_files_read_during_the_compilation_6653","Print all of the files read during the compilation."),Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit:t(6654,e.DiagnosticCategory.Message,"Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654","Set the language of the messaging from TypeScript. This does not affect emit."),Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations:t(6655,e.DiagnosticCategory.Message,"Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655","Specify the location where debugger should locate map files instead of generated locations."),Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs:t(6656,e.DiagnosticCategory.Message,"Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656","Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`."),Specify_what_module_code_is_generated:t(6657,e.DiagnosticCategory.Message,"Specify_what_module_code_is_generated_6657","Specify what module code is generated."),Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier:t(6658,e.DiagnosticCategory.Message,"Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658","Specify how TypeScript looks up a file from a given module specifier."),Set_the_newline_character_for_emitting_files:t(6659,e.DiagnosticCategory.Message,"Set_the_newline_character_for_emitting_files_6659","Set the newline character for emitting files."),Disable_emitting_files_from_a_compilation:t(6660,e.DiagnosticCategory.Message,"Disable_emitting_files_from_a_compilation_6660","Disable emitting files from a compilation."),Disable_generating_custom_helper_functions_like_extends_in_compiled_output:t(6661,e.DiagnosticCategory.Message,"Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661","Disable generating custom helper functions like `__extends` in compiled output."),Disable_emitting_files_if_any_type_checking_errors_are_reported:t(6662,e.DiagnosticCategory.Message,"Disable_emitting_files_if_any_type_checking_errors_are_reported_6662","Disable emitting files if any type checking errors are reported."),Disable_truncating_types_in_error_messages:t(6663,e.DiagnosticCategory.Message,"Disable_truncating_types_in_error_messages_6663","Disable truncating types in error messages."),Enable_error_reporting_for_fallthrough_cases_in_switch_statements:t(6664,e.DiagnosticCategory.Message,"Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664","Enable error reporting for fallthrough cases in switch statements."),Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type:t(6665,e.DiagnosticCategory.Message,"Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665","Enable error reporting for expressions and declarations with an implied `any` type.."),Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier:t(6666,e.DiagnosticCategory.Message,"Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666","Ensure overriding members in derived classes are marked with an override modifier."),Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function:t(6667,e.DiagnosticCategory.Message,"Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667","Enable error reporting for codepaths that do not explicitly return in a function."),Enable_error_reporting_when_this_is_given_the_type_any:t(6668,e.DiagnosticCategory.Message,"Enable_error_reporting_when_this_is_given_the_type_any_6668","Enable error reporting when `this` is given the type `any`."),Disable_adding_use_strict_directives_in_emitted_JavaScript_files:t(6669,e.DiagnosticCategory.Message,"Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669","Disable adding 'use strict' directives in emitted JavaScript files."),Disable_including_any_library_files_including_the_default_lib_d_ts:t(6670,e.DiagnosticCategory.Message,"Disable_including_any_library_files_including_the_default_lib_d_ts_6670","Disable including any library files, including the default lib.d.ts."),Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type:t(6671,e.DiagnosticCategory.Message,"Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671","Enforces using indexed accessors for keys declared using an indexed type"),Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project:t(6672,e.DiagnosticCategory.Message,"Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672","Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project."),Disable_strict_checking_of_generic_signatures_in_function_types:t(6673,e.DiagnosticCategory.Message,"Disable_strict_checking_of_generic_signatures_in_function_types_6673","Disable strict checking of generic signatures in function types."),Add_undefined_to_a_type_when_accessed_using_an_index:t(6674,e.DiagnosticCategory.Message,"Add_undefined_to_a_type_when_accessed_using_an_index_6674","Add `undefined` to a type when accessed using an index."),Enable_error_reporting_when_a_local_variables_aren_t_read:t(6675,e.DiagnosticCategory.Message,"Enable_error_reporting_when_a_local_variables_aren_t_read_6675","Enable error reporting when a local variables aren't read."),Raise_an_error_when_a_function_parameter_isn_t_read:t(6676,e.DiagnosticCategory.Message,"Raise_an_error_when_a_function_parameter_isn_t_read_6676","Raise an error when a function parameter isn't read"),Deprecated_setting_Use_outFile_instead:t(6677,e.DiagnosticCategory.Message,"Deprecated_setting_Use_outFile_instead_6677","Deprecated setting. Use `outFile` instead."),Specify_an_output_folder_for_all_emitted_files:t(6678,e.DiagnosticCategory.Message,"Specify_an_output_folder_for_all_emitted_files_6678","Specify an output folder for all emitted files."),Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output:t(6679,e.DiagnosticCategory.Message,"Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679","Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output."),Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations:t(6680,e.DiagnosticCategory.Message,"Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680","Specify a set of entries that re-map imports to additional lookup locations."),Specify_a_list_of_language_service_plugins_to_include:t(6681,e.DiagnosticCategory.Message,"Specify_a_list_of_language_service_plugins_to_include_6681","Specify a list of language service plugins to include."),Disable_erasing_const_enum_declarations_in_generated_code:t(6682,e.DiagnosticCategory.Message,"Disable_erasing_const_enum_declarations_in_generated_code_6682","Disable erasing `const enum` declarations in generated code."),Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node:t(6683,e.DiagnosticCategory.Message,"Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683","Disable resolving symlinks to their realpath. This correlates to the same flag in node."),Disable_wiping_the_console_in_watch_mode:t(6684,e.DiagnosticCategory.Message,"Disable_wiping_the_console_in_watch_mode_6684","Disable wiping the console in watch mode"),Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read:t(6685,e.DiagnosticCategory.Message,"Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685","Enable color and formatting in TypeScript's output to make compiler errors easier to read"),Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit:t(6686,e.DiagnosticCategory.Message,"Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686","Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit."),Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references:t(6687,e.DiagnosticCategory.Message,"Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687","Specify an array of objects that specify paths for projects. Used in project references."),Disable_emitting_comments:t(6688,e.DiagnosticCategory.Message,"Disable_emitting_comments_6688","Disable emitting comments."),Enable_importing_json_files:t(6689,e.DiagnosticCategory.Message,"Enable_importing_json_files_6689","Enable importing .json files"),Specify_the_root_folder_within_your_source_files:t(6690,e.DiagnosticCategory.Message,"Specify_the_root_folder_within_your_source_files_6690","Specify the root folder within your source files."),Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules:t(6691,e.DiagnosticCategory.Message,"Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691","Allow multiple folders to be treated as one when resolving modules."),Skip_type_checking_d_ts_files_that_are_included_with_TypeScript:t(6692,e.DiagnosticCategory.Message,"Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692","Skip type checking .d.ts files that are included with TypeScript."),Skip_type_checking_all_d_ts_files:t(6693,e.DiagnosticCategory.Message,"Skip_type_checking_all_d_ts_files_6693","Skip type checking all .d.ts files."),Create_source_map_files_for_emitted_JavaScript_files:t(6694,e.DiagnosticCategory.Message,"Create_source_map_files_for_emitted_JavaScript_files_6694","Create source map files for emitted JavaScript files."),Specify_the_root_path_for_debuggers_to_find_the_reference_source_code:t(6695,e.DiagnosticCategory.Message,"Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695","Specify the root path for debuggers to find the reference source code."),Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function:t(6697,e.DiagnosticCategory.Message,"Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697","Check that the arguments for `bind`, `call`, and `apply` methods match the original function."),When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible:t(6698,e.DiagnosticCategory.Message,"When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698","When assigning functions, check to ensure parameters and the return values are subtype-compatible."),When_type_checking_take_into_account_null_and_undefined:t(6699,e.DiagnosticCategory.Message,"When_type_checking_take_into_account_null_and_undefined_6699","When type checking, take into account `null` and `undefined`."),Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor:t(6700,e.DiagnosticCategory.Message,"Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700","Check for class properties that are declared but not set in the constructor."),Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments:t(6701,e.DiagnosticCategory.Message,"Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701","Disable emitting declarations that have `@internal` in their JSDoc comments."),Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals:t(6702,e.DiagnosticCategory.Message,"Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702","Disable reporting of excess property errors during the creation of object literals."),Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures:t(6703,e.DiagnosticCategory.Message,"Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703","Suppress `noImplicitAny` errors when indexing objects that lack index signatures."),Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively:t(6704,e.DiagnosticCategory.Message,"Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704","Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations:t(6705,e.DiagnosticCategory.Message,"Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705","Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),Log_paths_used_during_the_moduleResolution_process:t(6706,e.DiagnosticCategory.Message,"Log_paths_used_during_the_moduleResolution_process_6706","Log paths used during the `moduleResolution` process."),Specify_the_folder_for_tsbuildinfo_incremental_compilation_files:t(6707,e.DiagnosticCategory.Message,"Specify_the_folder_for_tsbuildinfo_incremental_compilation_files_6707","Specify the folder for .tsbuildinfo incremental compilation files."),Specify_options_for_automatic_acquisition_of_declaration_files:t(6709,e.DiagnosticCategory.Message,"Specify_options_for_automatic_acquisition_of_declaration_files_6709","Specify options for automatic acquisition of declaration files."),Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types:t(6710,e.DiagnosticCategory.Message,"Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710","Specify multiple folders that act like `./node_modules/@types`."),Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file:t(6711,e.DiagnosticCategory.Message,"Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711","Specify type package names to be included without being referenced in a source file."),Emit_ECMAScript_standard_compliant_class_fields:t(6712,e.DiagnosticCategory.Message,"Emit_ECMAScript_standard_compliant_class_fields_6712","Emit ECMAScript-standard-compliant class fields."),Enable_verbose_logging:t(6713,e.DiagnosticCategory.Message,"Enable_verbose_logging_6713","Enable verbose logging"),Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality:t(6714,e.DiagnosticCategory.Message,"Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714","Specify how directories are watched on systems that lack recursive file-watching functionality."),Specify_how_the_TypeScript_watch_mode_works:t(6715,e.DiagnosticCategory.Message,"Specify_how_the_TypeScript_watch_mode_works_6715","Specify how the TypeScript watch mode works."),Include_undefined_in_index_signature_results:t(6716,e.DiagnosticCategory.Message,"Include_undefined_in_index_signature_results_6716","Include 'undefined' in index signature results"),Require_undeclared_properties_from_index_signatures_to_use_element_accesses:t(6717,e.DiagnosticCategory.Message,"Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717","Require undeclared properties from index signatures to use element accesses."),Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types:t(6718,e.DiagnosticCategory.Message,"Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718","Specify emit/checking behavior for imports that are only used for types"),Type_catch_clause_variables_as_unknown_instead_of_any:t(6803,e.DiagnosticCategory.Message,"Type_catch_clause_variables_as_unknown_instead_of_any_6803","Type catch clause variables as 'unknown' instead of 'any'."),one_of_Colon:t(6900,e.DiagnosticCategory.Message,"one_of_Colon_6900","one of:"),one_or_more_Colon:t(6901,e.DiagnosticCategory.Message,"one_or_more_Colon_6901","one or more:"),type_Colon:t(6902,e.DiagnosticCategory.Message,"type_Colon_6902","type:"),default_Colon:t(6903,e.DiagnosticCategory.Message,"default_Colon_6903","default:"),module_system_or_esModuleInterop:t(6904,e.DiagnosticCategory.Message,"module_system_or_esModuleInterop_6904",'module === "system" or esModuleInterop'),false_unless_strict_is_set:t(6905,e.DiagnosticCategory.Message,"false_unless_strict_is_set_6905","`false`, unless `strict` is set"),false_unless_composite_is_set:t(6906,e.DiagnosticCategory.Message,"false_unless_composite_is_set_6906","`false`, unless `composite` is set"),node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified:t(6907,e.DiagnosticCategory.Message,"node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907",'`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'),if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk:t(6908,e.DiagnosticCategory.Message,"if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908",'`[]` if `files` is specified, otherwise `["**/*"]`'),true_if_composite_false_otherwise:t(6909,e.DiagnosticCategory.Message,"true_if_composite_false_otherwise_6909","`true` if `composite`, `false` otherwise"),module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node:t(69010,e.DiagnosticCategory.Message,"module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010","module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"),Computed_from_the_list_of_input_files:t(6911,e.DiagnosticCategory.Message,"Computed_from_the_list_of_input_files_6911","Computed from the list of input files"),Platform_specific:t(6912,e.DiagnosticCategory.Message,"Platform_specific_6912","Platform specific"),You_can_learn_about_all_of_the_compiler_options_at_0:t(6913,e.DiagnosticCategory.Message,"You_can_learn_about_all_of_the_compiler_options_at_0_6913","You can learn about all of the compiler options at {0}"),Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon:t(6914,e.DiagnosticCategory.Message,"Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914","Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"),Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0:t(6915,e.DiagnosticCategory.Message,"Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915","Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"),COMMON_COMMANDS:t(6916,e.DiagnosticCategory.Message,"COMMON_COMMANDS_6916","COMMON COMMANDS"),ALL_COMPILER_OPTIONS:t(6917,e.DiagnosticCategory.Message,"ALL_COMPILER_OPTIONS_6917","ALL COMPILER OPTIONS"),WATCH_OPTIONS:t(6918,e.DiagnosticCategory.Message,"WATCH_OPTIONS_6918","WATCH OPTIONS"),BUILD_OPTIONS:t(6919,e.DiagnosticCategory.Message,"BUILD_OPTIONS_6919","BUILD OPTIONS"),COMMON_COMPILER_OPTIONS:t(6920,e.DiagnosticCategory.Message,"COMMON_COMPILER_OPTIONS_6920","COMMON COMPILER OPTIONS"),COMMAND_LINE_FLAGS:t(6921,e.DiagnosticCategory.Message,"COMMAND_LINE_FLAGS_6921","COMMAND LINE FLAGS"),tsc_Colon_The_TypeScript_Compiler:t(6922,e.DiagnosticCategory.Message,"tsc_Colon_The_TypeScript_Compiler_6922","tsc: The TypeScript Compiler"),Compiles_the_current_project_tsconfig_json_in_the_working_directory:t(6923,e.DiagnosticCategory.Message,"Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923","Compiles the current project (tsconfig.json in the working directory.)"),Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options:t(6924,e.DiagnosticCategory.Message,"Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924","Ignoring tsconfig.json, compiles the specified files with default compiler options."),Build_a_composite_project_in_the_working_directory:t(6925,e.DiagnosticCategory.Message,"Build_a_composite_project_in_the_working_directory_6925","Build a composite project in the working directory."),Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory:t(6926,e.DiagnosticCategory.Message,"Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926","Creates a tsconfig.json with the recommended settings in the working directory."),Compiles_the_TypeScript_project_located_at_the_specified_path:t(6927,e.DiagnosticCategory.Message,"Compiles_the_TypeScript_project_located_at_the_specified_path_6927","Compiles the TypeScript project located at the specified path."),An_expanded_version_of_this_information_showing_all_possible_compiler_options:t(6928,e.DiagnosticCategory.Message,"An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928","An expanded version of this information, showing all possible compiler options"),Compiles_the_current_project_with_additional_settings:t(6929,e.DiagnosticCategory.Message,"Compiles_the_current_project_with_additional_settings_6929","Compiles the current project, with additional settings."),true_for_ES2022_and_above_including_ESNext:t(6930,e.DiagnosticCategory.Message,"true_for_ES2022_and_above_including_ESNext_6930","`true` for ES2022 and above, including ESNext."),Variable_0_implicitly_has_an_1_type:t(7005,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_an_1_type_7005","Variable '{0}' implicitly has an '{1}' type."),Parameter_0_implicitly_has_an_1_type:t(7006,e.DiagnosticCategory.Error,"Parameter_0_implicitly_has_an_1_type_7006","Parameter '{0}' implicitly has an '{1}' type."),Member_0_implicitly_has_an_1_type:t(7008,e.DiagnosticCategory.Error,"Member_0_implicitly_has_an_1_type_7008","Member '{0}' implicitly has an '{1}' type."),new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type:t(7009,e.DiagnosticCategory.Error,"new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009","'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:t(7010,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010","'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."),Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7011,e.DiagnosticCategory.Error,"Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011","Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."),Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7013,e.DiagnosticCategory.Error,"Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013","Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."),Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type:t(7014,e.DiagnosticCategory.Error,"Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014","Function type, which lacks return-type annotation, implicitly has an '{0}' return type."),Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number:t(7015,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015","Element implicitly has an 'any' type because index expression is not of type 'number'."),Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type:t(7016,e.DiagnosticCategory.Error,"Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016","Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature:t(7017,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017","Element implicitly has an 'any' type because type '{0}' has no index signature."),Object_literal_s_property_0_implicitly_has_an_1_type:t(7018,e.DiagnosticCategory.Error,"Object_literal_s_property_0_implicitly_has_an_1_type_7018","Object literal's property '{0}' implicitly has an '{1}' type."),Rest_parameter_0_implicitly_has_an_any_type:t(7019,e.DiagnosticCategory.Error,"Rest_parameter_0_implicitly_has_an_any_type_7019","Rest parameter '{0}' implicitly has an 'any[]' type."),Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type:t(7020,e.DiagnosticCategory.Error,"Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020","Call signature, which lacks return-type annotation, implicitly has an 'any' return type."),_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer:t(7022,e.DiagnosticCategory.Error,"_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022","'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."),_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7023,e.DiagnosticCategory.Error,"_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023","'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions:t(7024,e.DiagnosticCategory.Error,"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024","Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."),Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:t(7025,e.DiagnosticCategory.Error,"Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025","Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."),JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists:t(7026,e.DiagnosticCategory.Error,"JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026","JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."),Unreachable_code_detected:t(7027,e.DiagnosticCategory.Error,"Unreachable_code_detected_7027","Unreachable code detected.",!0),Unused_label:t(7028,e.DiagnosticCategory.Error,"Unused_label_7028","Unused label.",!0),Fallthrough_case_in_switch:t(7029,e.DiagnosticCategory.Error,"Fallthrough_case_in_switch_7029","Fallthrough case in switch."),Not_all_code_paths_return_a_value:t(7030,e.DiagnosticCategory.Error,"Not_all_code_paths_return_a_value_7030","Not all code paths return a value."),Binding_element_0_implicitly_has_an_1_type:t(7031,e.DiagnosticCategory.Error,"Binding_element_0_implicitly_has_an_1_type_7031","Binding element '{0}' implicitly has an '{1}' type."),Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation:t(7032,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032","Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."),Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation:t(7033,e.DiagnosticCategory.Error,"Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033","Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."),Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined:t(7034,e.DiagnosticCategory.Error,"Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034","Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."),Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0:t(7035,e.DiagnosticCategory.Error,"Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035","Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"),Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0:t(7036,e.DiagnosticCategory.Error,"Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036","Dynamic import's specifier must be of type 'string', but here has type '{0}'."),Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports:t(7037,e.DiagnosticCategory.Message,"Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037","Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."),Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead:t(7038,e.DiagnosticCategory.Message,"Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038","Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."),Mapped_object_type_implicitly_has_an_any_template_type:t(7039,e.DiagnosticCategory.Error,"Mapped_object_type_implicitly_has_an_any_template_type_7039","Mapped object type implicitly has an 'any' template type."),If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1:t(7040,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040","If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"),The_containing_arrow_function_captures_the_global_value_of_this:t(7041,e.DiagnosticCategory.Error,"The_containing_arrow_function_captures_the_global_value_of_this_7041","The containing arrow function captures the global value of 'this'."),Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used:t(7042,e.DiagnosticCategory.Error,"Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042","Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."),Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7043,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043","Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7044,e.DiagnosticCategory.Suggestion,"Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044","Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage:t(7045,e.DiagnosticCategory.Suggestion,"Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045","Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."),Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage:t(7046,e.DiagnosticCategory.Suggestion,"Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046","Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."),Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:t(7047,e.DiagnosticCategory.Suggestion,"Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047","Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage:t(7048,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048","Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."),Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage:t(7049,e.DiagnosticCategory.Suggestion,"Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049","Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."),_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage:t(7050,e.DiagnosticCategory.Suggestion,"_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050","'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."),Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1:t(7051,e.DiagnosticCategory.Error,"Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051","Parameter has a name but no type. Did you mean '{0}: {1}'?"),Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1:t(7052,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052","Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"),Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1:t(7053,e.DiagnosticCategory.Error,"Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053","Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."),No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1:t(7054,e.DiagnosticCategory.Error,"No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054","No index signature with a parameter of type '{0}' was found on type '{1}'."),_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:t(7055,e.DiagnosticCategory.Error,"_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055","'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."),The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed:t(7056,e.DiagnosticCategory.Error,"The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056","The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."),yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation:t(7057,e.DiagnosticCategory.Error,"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057","'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."),If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1:t(7058,e.DiagnosticCategory.Error,"If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058","If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead:t(7059,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059","This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint:t(7060,e.DiagnosticCategory.Error,"This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060","This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),A_mapped_type_may_not_declare_properties_or_methods:t(7061,e.DiagnosticCategory.Error,"A_mapped_type_may_not_declare_properties_or_methods_7061","A mapped type may not declare properties or methods."),JSON_imports_are_experimental_in_ES_module_mode_imports:t(7062,e.DiagnosticCategory.Error,"JSON_imports_are_experimental_in_ES_module_mode_imports_7062","JSON imports are experimental in ES module mode imports."),You_cannot_rename_this_element:t(8e3,e.DiagnosticCategory.Error,"You_cannot_rename_this_element_8000","You cannot rename this element."),You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library:t(8001,e.DiagnosticCategory.Error,"You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001","You cannot rename elements that are defined in the standard TypeScript library."),import_can_only_be_used_in_TypeScript_files:t(8002,e.DiagnosticCategory.Error,"import_can_only_be_used_in_TypeScript_files_8002","'import ... =' can only be used in TypeScript files."),export_can_only_be_used_in_TypeScript_files:t(8003,e.DiagnosticCategory.Error,"export_can_only_be_used_in_TypeScript_files_8003","'export =' can only be used in TypeScript files."),Type_parameter_declarations_can_only_be_used_in_TypeScript_files:t(8004,e.DiagnosticCategory.Error,"Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004","Type parameter declarations can only be used in TypeScript files."),implements_clauses_can_only_be_used_in_TypeScript_files:t(8005,e.DiagnosticCategory.Error,"implements_clauses_can_only_be_used_in_TypeScript_files_8005","'implements' clauses can only be used in TypeScript files."),_0_declarations_can_only_be_used_in_TypeScript_files:t(8006,e.DiagnosticCategory.Error,"_0_declarations_can_only_be_used_in_TypeScript_files_8006","'{0}' declarations can only be used in TypeScript files."),Type_aliases_can_only_be_used_in_TypeScript_files:t(8008,e.DiagnosticCategory.Error,"Type_aliases_can_only_be_used_in_TypeScript_files_8008","Type aliases can only be used in TypeScript files."),The_0_modifier_can_only_be_used_in_TypeScript_files:t(8009,e.DiagnosticCategory.Error,"The_0_modifier_can_only_be_used_in_TypeScript_files_8009","The '{0}' modifier can only be used in TypeScript files."),Type_annotations_can_only_be_used_in_TypeScript_files:t(8010,e.DiagnosticCategory.Error,"Type_annotations_can_only_be_used_in_TypeScript_files_8010","Type annotations can only be used in TypeScript files."),Type_arguments_can_only_be_used_in_TypeScript_files:t(8011,e.DiagnosticCategory.Error,"Type_arguments_can_only_be_used_in_TypeScript_files_8011","Type arguments can only be used in TypeScript files."),Parameter_modifiers_can_only_be_used_in_TypeScript_files:t(8012,e.DiagnosticCategory.Error,"Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012","Parameter modifiers can only be used in TypeScript files."),Non_null_assertions_can_only_be_used_in_TypeScript_files:t(8013,e.DiagnosticCategory.Error,"Non_null_assertions_can_only_be_used_in_TypeScript_files_8013","Non-null assertions can only be used in TypeScript files."),Type_assertion_expressions_can_only_be_used_in_TypeScript_files:t(8016,e.DiagnosticCategory.Error,"Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016","Type assertion expressions can only be used in TypeScript files."),Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:t(8017,e.DiagnosticCategory.Error,"Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017","Octal literal types must use ES2015 syntax. Use the syntax '{0}'."),Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0:t(8018,e.DiagnosticCategory.Error,"Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018","Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."),Report_errors_in_js_files:t(8019,e.DiagnosticCategory.Message,"Report_errors_in_js_files_8019","Report errors in .js files."),JSDoc_types_can_only_be_used_inside_documentation_comments:t(8020,e.DiagnosticCategory.Error,"JSDoc_types_can_only_be_used_inside_documentation_comments_8020","JSDoc types can only be used inside documentation comments."),JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags:t(8021,e.DiagnosticCategory.Error,"JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021","JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),JSDoc_0_is_not_attached_to_a_class:t(8022,e.DiagnosticCategory.Error,"JSDoc_0_is_not_attached_to_a_class_8022","JSDoc '@{0}' is not attached to a class."),JSDoc_0_1_does_not_match_the_extends_2_clause:t(8023,e.DiagnosticCategory.Error,"JSDoc_0_1_does_not_match_the_extends_2_clause_8023","JSDoc '@{0} {1}' does not match the 'extends {2}' clause."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name:t(8024,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024","JSDoc '@param' tag has name '{0}', but there is no parameter with that name."),Class_declarations_cannot_have_more_than_one_augments_or_extends_tag:t(8025,e.DiagnosticCategory.Error,"Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025","Class declarations cannot have more than one '@augments' or '@extends' tag."),Expected_0_type_arguments_provide_these_with_an_extends_tag:t(8026,e.DiagnosticCategory.Error,"Expected_0_type_arguments_provide_these_with_an_extends_tag_8026","Expected {0} type arguments; provide these with an '@extends' tag."),Expected_0_1_type_arguments_provide_these_with_an_extends_tag:t(8027,e.DiagnosticCategory.Error,"Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027","Expected {0}-{1} type arguments; provide these with an '@extends' tag."),JSDoc_may_only_appear_in_the_last_parameter_of_a_signature:t(8028,e.DiagnosticCategory.Error,"JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028","JSDoc '...' may only appear in the last parameter of a signature."),JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type:t(8029,e.DiagnosticCategory.Error,"JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029","JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."),The_type_of_a_function_declaration_must_match_the_function_s_signature:t(8030,e.DiagnosticCategory.Error,"The_type_of_a_function_declaration_must_match_the_function_s_signature_8030","The type of a function declaration must match the function's signature."),You_cannot_rename_a_module_via_a_global_import:t(8031,e.DiagnosticCategory.Error,"You_cannot_rename_a_module_via_a_global_import_8031","You cannot rename a module via a global import."),Qualified_name_0_is_not_allowed_without_a_leading_param_object_1:t(8032,e.DiagnosticCategory.Error,"Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032","Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags:t(8033,e.DiagnosticCategory.Error,"A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033","A JSDoc '@typedef' comment may not contain multiple '@type' tags."),The_tag_was_first_specified_here:t(8034,e.DiagnosticCategory.Error,"The_tag_was_first_specified_here_8034","The tag was first specified here."),Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit:t(9005,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005","Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:t(9006,e.DiagnosticCategory.Error,"Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006","Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),JSX_attributes_must_only_be_assigned_a_non_empty_expression:t(17e3,e.DiagnosticCategory.Error,"JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000","JSX attributes must only be assigned a non-empty 'expression'."),JSX_elements_cannot_have_multiple_attributes_with_the_same_name:t(17001,e.DiagnosticCategory.Error,"JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001","JSX elements cannot have multiple attributes with the same name."),Expected_corresponding_JSX_closing_tag_for_0:t(17002,e.DiagnosticCategory.Error,"Expected_corresponding_JSX_closing_tag_for_0_17002","Expected corresponding JSX closing tag for '{0}'."),Cannot_use_JSX_unless_the_jsx_flag_is_provided:t(17004,e.DiagnosticCategory.Error,"Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004","Cannot use JSX unless the '--jsx' flag is provided."),A_constructor_cannot_contain_a_super_call_when_its_class_extends_null:t(17005,e.DiagnosticCategory.Error,"A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005","A constructor cannot contain a 'super' call when its class extends 'null'."),An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17006,e.DiagnosticCategory.Error,"An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006","An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses:t(17007,e.DiagnosticCategory.Error,"A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007","A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."),JSX_element_0_has_no_corresponding_closing_tag:t(17008,e.DiagnosticCategory.Error,"JSX_element_0_has_no_corresponding_closing_tag_17008","JSX element '{0}' has no corresponding closing tag."),super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class:t(17009,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009","'super' must be called before accessing 'this' in the constructor of a derived class."),Unknown_type_acquisition_option_0:t(17010,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_17010","Unknown type acquisition option '{0}'."),super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class:t(17011,e.DiagnosticCategory.Error,"super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011","'super' must be called before accessing a property of 'super' in the constructor of a derived class."),_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2:t(17012,e.DiagnosticCategory.Error,"_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012","'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"),Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor:t(17013,e.DiagnosticCategory.Error,"Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013","Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."),JSX_fragment_has_no_corresponding_closing_tag:t(17014,e.DiagnosticCategory.Error,"JSX_fragment_has_no_corresponding_closing_tag_17014","JSX fragment has no corresponding closing tag."),Expected_corresponding_closing_tag_for_JSX_fragment:t(17015,e.DiagnosticCategory.Error,"Expected_corresponding_closing_tag_for_JSX_fragment_17015","Expected corresponding closing tag for JSX fragment."),The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:t(17016,e.DiagnosticCategory.Error,"The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016","The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."),An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments:t(17017,e.DiagnosticCategory.Error,"An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017","An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."),Unknown_type_acquisition_option_0_Did_you_mean_1:t(17018,e.DiagnosticCategory.Error,"Unknown_type_acquisition_option_0_Did_you_mean_1_17018","Unknown type acquisition option '{0}'. Did you mean '{1}'?"),Circularity_detected_while_resolving_configuration_Colon_0:t(18e3,e.DiagnosticCategory.Error,"Circularity_detected_while_resolving_configuration_Colon_0_18000","Circularity detected while resolving configuration: {0}"),The_files_list_in_config_file_0_is_empty:t(18002,e.DiagnosticCategory.Error,"The_files_list_in_config_file_0_is_empty_18002","The 'files' list in config file '{0}' is empty."),No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2:t(18003,e.DiagnosticCategory.Error,"No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003","No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."),File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module:t(80001,e.DiagnosticCategory.Suggestion,"File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001","File is a CommonJS module; it may be converted to an ES module."),This_constructor_function_may_be_converted_to_a_class_declaration:t(80002,e.DiagnosticCategory.Suggestion,"This_constructor_function_may_be_converted_to_a_class_declaration_80002","This constructor function may be converted to a class declaration."),Import_may_be_converted_to_a_default_import:t(80003,e.DiagnosticCategory.Suggestion,"Import_may_be_converted_to_a_default_import_80003","Import may be converted to a default import."),JSDoc_types_may_be_moved_to_TypeScript_types:t(80004,e.DiagnosticCategory.Suggestion,"JSDoc_types_may_be_moved_to_TypeScript_types_80004","JSDoc types may be moved to TypeScript types."),require_call_may_be_converted_to_an_import:t(80005,e.DiagnosticCategory.Suggestion,"require_call_may_be_converted_to_an_import_80005","'require' call may be converted to an import."),This_may_be_converted_to_an_async_function:t(80006,e.DiagnosticCategory.Suggestion,"This_may_be_converted_to_an_async_function_80006","This may be converted to an async function."),await_has_no_effect_on_the_type_of_this_expression:t(80007,e.DiagnosticCategory.Suggestion,"await_has_no_effect_on_the_type_of_this_expression_80007","'await' has no effect on the type of this expression."),Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers:t(80008,e.DiagnosticCategory.Suggestion,"Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008","Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."),Add_missing_super_call:t(90001,e.DiagnosticCategory.Message,"Add_missing_super_call_90001","Add missing 'super()' call"),Make_super_call_the_first_statement_in_the_constructor:t(90002,e.DiagnosticCategory.Message,"Make_super_call_the_first_statement_in_the_constructor_90002","Make 'super()' call the first statement in the constructor"),Change_extends_to_implements:t(90003,e.DiagnosticCategory.Message,"Change_extends_to_implements_90003","Change 'extends' to 'implements'"),Remove_unused_declaration_for_Colon_0:t(90004,e.DiagnosticCategory.Message,"Remove_unused_declaration_for_Colon_0_90004","Remove unused declaration for: '{0}'"),Remove_import_from_0:t(90005,e.DiagnosticCategory.Message,"Remove_import_from_0_90005","Remove import from '{0}'"),Implement_interface_0:t(90006,e.DiagnosticCategory.Message,"Implement_interface_0_90006","Implement interface '{0}'"),Implement_inherited_abstract_class:t(90007,e.DiagnosticCategory.Message,"Implement_inherited_abstract_class_90007","Implement inherited abstract class"),Add_0_to_unresolved_variable:t(90008,e.DiagnosticCategory.Message,"Add_0_to_unresolved_variable_90008","Add '{0}.' to unresolved variable"),Remove_variable_statement:t(90010,e.DiagnosticCategory.Message,"Remove_variable_statement_90010","Remove variable statement"),Remove_template_tag:t(90011,e.DiagnosticCategory.Message,"Remove_template_tag_90011","Remove template tag"),Remove_type_parameters:t(90012,e.DiagnosticCategory.Message,"Remove_type_parameters_90012","Remove type parameters"),Import_0_from_module_1:t(90013,e.DiagnosticCategory.Message,"Import_0_from_module_1_90013","Import '{0}' from module \"{1}\""),Change_0_to_1:t(90014,e.DiagnosticCategory.Message,"Change_0_to_1_90014","Change '{0}' to '{1}'"),Add_0_to_existing_import_declaration_from_1:t(90015,e.DiagnosticCategory.Message,"Add_0_to_existing_import_declaration_from_1_90015","Add '{0}' to existing import declaration from \"{1}\""),Declare_property_0:t(90016,e.DiagnosticCategory.Message,"Declare_property_0_90016","Declare property '{0}'"),Add_index_signature_for_property_0:t(90017,e.DiagnosticCategory.Message,"Add_index_signature_for_property_0_90017","Add index signature for property '{0}'"),Disable_checking_for_this_file:t(90018,e.DiagnosticCategory.Message,"Disable_checking_for_this_file_90018","Disable checking for this file"),Ignore_this_error_message:t(90019,e.DiagnosticCategory.Message,"Ignore_this_error_message_90019","Ignore this error message"),Initialize_property_0_in_the_constructor:t(90020,e.DiagnosticCategory.Message,"Initialize_property_0_in_the_constructor_90020","Initialize property '{0}' in the constructor"),Initialize_static_property_0:t(90021,e.DiagnosticCategory.Message,"Initialize_static_property_0_90021","Initialize static property '{0}'"),Change_spelling_to_0:t(90022,e.DiagnosticCategory.Message,"Change_spelling_to_0_90022","Change spelling to '{0}'"),Declare_method_0:t(90023,e.DiagnosticCategory.Message,"Declare_method_0_90023","Declare method '{0}'"),Declare_static_method_0:t(90024,e.DiagnosticCategory.Message,"Declare_static_method_0_90024","Declare static method '{0}'"),Prefix_0_with_an_underscore:t(90025,e.DiagnosticCategory.Message,"Prefix_0_with_an_underscore_90025","Prefix '{0}' with an underscore"),Rewrite_as_the_indexed_access_type_0:t(90026,e.DiagnosticCategory.Message,"Rewrite_as_the_indexed_access_type_0_90026","Rewrite as the indexed access type '{0}'"),Declare_static_property_0:t(90027,e.DiagnosticCategory.Message,"Declare_static_property_0_90027","Declare static property '{0}'"),Call_decorator_expression:t(90028,e.DiagnosticCategory.Message,"Call_decorator_expression_90028","Call decorator expression"),Add_async_modifier_to_containing_function:t(90029,e.DiagnosticCategory.Message,"Add_async_modifier_to_containing_function_90029","Add async modifier to containing function"),Replace_infer_0_with_unknown:t(90030,e.DiagnosticCategory.Message,"Replace_infer_0_with_unknown_90030","Replace 'infer {0}' with 'unknown'"),Replace_all_unused_infer_with_unknown:t(90031,e.DiagnosticCategory.Message,"Replace_all_unused_infer_with_unknown_90031","Replace all unused 'infer' with 'unknown'"),Import_default_0_from_module_1:t(90032,e.DiagnosticCategory.Message,"Import_default_0_from_module_1_90032","Import default '{0}' from module \"{1}\""),Add_default_import_0_to_existing_import_declaration_from_1:t(90033,e.DiagnosticCategory.Message,"Add_default_import_0_to_existing_import_declaration_from_1_90033","Add default import '{0}' to existing import declaration from \"{1}\""),Add_parameter_name:t(90034,e.DiagnosticCategory.Message,"Add_parameter_name_90034","Add parameter name"),Declare_private_property_0:t(90035,e.DiagnosticCategory.Message,"Declare_private_property_0_90035","Declare private property '{0}'"),Replace_0_with_Promise_1:t(90036,e.DiagnosticCategory.Message,"Replace_0_with_Promise_1_90036","Replace '{0}' with 'Promise<{1}>'"),Fix_all_incorrect_return_type_of_an_async_functions:t(90037,e.DiagnosticCategory.Message,"Fix_all_incorrect_return_type_of_an_async_functions_90037","Fix all incorrect return type of an async functions"),Declare_private_method_0:t(90038,e.DiagnosticCategory.Message,"Declare_private_method_0_90038","Declare private method '{0}'"),Remove_unused_destructuring_declaration:t(90039,e.DiagnosticCategory.Message,"Remove_unused_destructuring_declaration_90039","Remove unused destructuring declaration"),Remove_unused_declarations_for_Colon_0:t(90041,e.DiagnosticCategory.Message,"Remove_unused_declarations_for_Colon_0_90041","Remove unused declarations for: '{0}'"),Declare_a_private_field_named_0:t(90053,e.DiagnosticCategory.Message,"Declare_a_private_field_named_0_90053","Declare a private field named '{0}'."),Includes_imports_of_types_referenced_by_0:t(90054,e.DiagnosticCategory.Message,"Includes_imports_of_types_referenced_by_0_90054","Includes imports of types referenced by '{0}'"),Convert_function_to_an_ES2015_class:t(95001,e.DiagnosticCategory.Message,"Convert_function_to_an_ES2015_class_95001","Convert function to an ES2015 class"),Convert_0_to_1_in_0:t(95003,e.DiagnosticCategory.Message,"Convert_0_to_1_in_0_95003","Convert '{0}' to '{1} in {0}'"),Extract_to_0_in_1:t(95004,e.DiagnosticCategory.Message,"Extract_to_0_in_1_95004","Extract to {0} in {1}"),Extract_function:t(95005,e.DiagnosticCategory.Message,"Extract_function_95005","Extract function"),Extract_constant:t(95006,e.DiagnosticCategory.Message,"Extract_constant_95006","Extract constant"),Extract_to_0_in_enclosing_scope:t(95007,e.DiagnosticCategory.Message,"Extract_to_0_in_enclosing_scope_95007","Extract to {0} in enclosing scope"),Extract_to_0_in_1_scope:t(95008,e.DiagnosticCategory.Message,"Extract_to_0_in_1_scope_95008","Extract to {0} in {1} scope"),Annotate_with_type_from_JSDoc:t(95009,e.DiagnosticCategory.Message,"Annotate_with_type_from_JSDoc_95009","Annotate with type from JSDoc"),Infer_type_of_0_from_usage:t(95011,e.DiagnosticCategory.Message,"Infer_type_of_0_from_usage_95011","Infer type of '{0}' from usage"),Infer_parameter_types_from_usage:t(95012,e.DiagnosticCategory.Message,"Infer_parameter_types_from_usage_95012","Infer parameter types from usage"),Convert_to_default_import:t(95013,e.DiagnosticCategory.Message,"Convert_to_default_import_95013","Convert to default import"),Install_0:t(95014,e.DiagnosticCategory.Message,"Install_0_95014","Install '{0}'"),Replace_import_with_0:t(95015,e.DiagnosticCategory.Message,"Replace_import_with_0_95015","Replace import with '{0}'."),Use_synthetic_default_member:t(95016,e.DiagnosticCategory.Message,"Use_synthetic_default_member_95016","Use synthetic 'default' member."),Convert_to_ES_module:t(95017,e.DiagnosticCategory.Message,"Convert_to_ES_module_95017","Convert to ES module"),Add_undefined_type_to_property_0:t(95018,e.DiagnosticCategory.Message,"Add_undefined_type_to_property_0_95018","Add 'undefined' type to property '{0}'"),Add_initializer_to_property_0:t(95019,e.DiagnosticCategory.Message,"Add_initializer_to_property_0_95019","Add initializer to property '{0}'"),Add_definite_assignment_assertion_to_property_0:t(95020,e.DiagnosticCategory.Message,"Add_definite_assignment_assertion_to_property_0_95020","Add definite assignment assertion to property '{0}'"),Convert_all_type_literals_to_mapped_type:t(95021,e.DiagnosticCategory.Message,"Convert_all_type_literals_to_mapped_type_95021","Convert all type literals to mapped type"),Add_all_missing_members:t(95022,e.DiagnosticCategory.Message,"Add_all_missing_members_95022","Add all missing members"),Infer_all_types_from_usage:t(95023,e.DiagnosticCategory.Message,"Infer_all_types_from_usage_95023","Infer all types from usage"),Delete_all_unused_declarations:t(95024,e.DiagnosticCategory.Message,"Delete_all_unused_declarations_95024","Delete all unused declarations"),Prefix_all_unused_declarations_with_where_possible:t(95025,e.DiagnosticCategory.Message,"Prefix_all_unused_declarations_with_where_possible_95025","Prefix all unused declarations with '_' where possible"),Fix_all_detected_spelling_errors:t(95026,e.DiagnosticCategory.Message,"Fix_all_detected_spelling_errors_95026","Fix all detected spelling errors"),Add_initializers_to_all_uninitialized_properties:t(95027,e.DiagnosticCategory.Message,"Add_initializers_to_all_uninitialized_properties_95027","Add initializers to all uninitialized properties"),Add_definite_assignment_assertions_to_all_uninitialized_properties:t(95028,e.DiagnosticCategory.Message,"Add_definite_assignment_assertions_to_all_uninitialized_properties_95028","Add definite assignment assertions to all uninitialized properties"),Add_undefined_type_to_all_uninitialized_properties:t(95029,e.DiagnosticCategory.Message,"Add_undefined_type_to_all_uninitialized_properties_95029","Add undefined type to all uninitialized properties"),Change_all_jsdoc_style_types_to_TypeScript:t(95030,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_95030","Change all jsdoc-style types to TypeScript"),Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types:t(95031,e.DiagnosticCategory.Message,"Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031","Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"),Implement_all_unimplemented_interfaces:t(95032,e.DiagnosticCategory.Message,"Implement_all_unimplemented_interfaces_95032","Implement all unimplemented interfaces"),Install_all_missing_types_packages:t(95033,e.DiagnosticCategory.Message,"Install_all_missing_types_packages_95033","Install all missing types packages"),Rewrite_all_as_indexed_access_types:t(95034,e.DiagnosticCategory.Message,"Rewrite_all_as_indexed_access_types_95034","Rewrite all as indexed access types"),Convert_all_to_default_imports:t(95035,e.DiagnosticCategory.Message,"Convert_all_to_default_imports_95035","Convert all to default imports"),Make_all_super_calls_the_first_statement_in_their_constructor:t(95036,e.DiagnosticCategory.Message,"Make_all_super_calls_the_first_statement_in_their_constructor_95036","Make all 'super()' calls the first statement in their constructor"),Add_qualifier_to_all_unresolved_variables_matching_a_member_name:t(95037,e.DiagnosticCategory.Message,"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037","Add qualifier to all unresolved variables matching a member name"),Change_all_extended_interfaces_to_implements:t(95038,e.DiagnosticCategory.Message,"Change_all_extended_interfaces_to_implements_95038","Change all extended interfaces to 'implements'"),Add_all_missing_super_calls:t(95039,e.DiagnosticCategory.Message,"Add_all_missing_super_calls_95039","Add all missing super calls"),Implement_all_inherited_abstract_classes:t(95040,e.DiagnosticCategory.Message,"Implement_all_inherited_abstract_classes_95040","Implement all inherited abstract classes"),Add_all_missing_async_modifiers:t(95041,e.DiagnosticCategory.Message,"Add_all_missing_async_modifiers_95041","Add all missing 'async' modifiers"),Add_ts_ignore_to_all_error_messages:t(95042,e.DiagnosticCategory.Message,"Add_ts_ignore_to_all_error_messages_95042","Add '@ts-ignore' to all error messages"),Annotate_everything_with_types_from_JSDoc:t(95043,e.DiagnosticCategory.Message,"Annotate_everything_with_types_from_JSDoc_95043","Annotate everything with types from JSDoc"),Add_to_all_uncalled_decorators:t(95044,e.DiagnosticCategory.Message,"Add_to_all_uncalled_decorators_95044","Add '()' to all uncalled decorators"),Convert_all_constructor_functions_to_classes:t(95045,e.DiagnosticCategory.Message,"Convert_all_constructor_functions_to_classes_95045","Convert all constructor functions to classes"),Generate_get_and_set_accessors:t(95046,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_95046","Generate 'get' and 'set' accessors"),Convert_require_to_import:t(95047,e.DiagnosticCategory.Message,"Convert_require_to_import_95047","Convert 'require' to 'import'"),Convert_all_require_to_import:t(95048,e.DiagnosticCategory.Message,"Convert_all_require_to_import_95048","Convert all 'require' to 'import'"),Move_to_a_new_file:t(95049,e.DiagnosticCategory.Message,"Move_to_a_new_file_95049","Move to a new file"),Remove_unreachable_code:t(95050,e.DiagnosticCategory.Message,"Remove_unreachable_code_95050","Remove unreachable code"),Remove_all_unreachable_code:t(95051,e.DiagnosticCategory.Message,"Remove_all_unreachable_code_95051","Remove all unreachable code"),Add_missing_typeof:t(95052,e.DiagnosticCategory.Message,"Add_missing_typeof_95052","Add missing 'typeof'"),Remove_unused_label:t(95053,e.DiagnosticCategory.Message,"Remove_unused_label_95053","Remove unused label"),Remove_all_unused_labels:t(95054,e.DiagnosticCategory.Message,"Remove_all_unused_labels_95054","Remove all unused labels"),Convert_0_to_mapped_object_type:t(95055,e.DiagnosticCategory.Message,"Convert_0_to_mapped_object_type_95055","Convert '{0}' to mapped object type"),Convert_namespace_import_to_named_imports:t(95056,e.DiagnosticCategory.Message,"Convert_namespace_import_to_named_imports_95056","Convert namespace import to named imports"),Convert_named_imports_to_namespace_import:t(95057,e.DiagnosticCategory.Message,"Convert_named_imports_to_namespace_import_95057","Convert named imports to namespace import"),Add_or_remove_braces_in_an_arrow_function:t(95058,e.DiagnosticCategory.Message,"Add_or_remove_braces_in_an_arrow_function_95058","Add or remove braces in an arrow function"),Add_braces_to_arrow_function:t(95059,e.DiagnosticCategory.Message,"Add_braces_to_arrow_function_95059","Add braces to arrow function"),Remove_braces_from_arrow_function:t(95060,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_95060","Remove braces from arrow function"),Convert_default_export_to_named_export:t(95061,e.DiagnosticCategory.Message,"Convert_default_export_to_named_export_95061","Convert default export to named export"),Convert_named_export_to_default_export:t(95062,e.DiagnosticCategory.Message,"Convert_named_export_to_default_export_95062","Convert named export to default export"),Add_missing_enum_member_0:t(95063,e.DiagnosticCategory.Message,"Add_missing_enum_member_0_95063","Add missing enum member '{0}'"),Add_all_missing_imports:t(95064,e.DiagnosticCategory.Message,"Add_all_missing_imports_95064","Add all missing imports"),Convert_to_async_function:t(95065,e.DiagnosticCategory.Message,"Convert_to_async_function_95065","Convert to async function"),Convert_all_to_async_functions:t(95066,e.DiagnosticCategory.Message,"Convert_all_to_async_functions_95066","Convert all to async functions"),Add_missing_call_parentheses:t(95067,e.DiagnosticCategory.Message,"Add_missing_call_parentheses_95067","Add missing call parentheses"),Add_all_missing_call_parentheses:t(95068,e.DiagnosticCategory.Message,"Add_all_missing_call_parentheses_95068","Add all missing call parentheses"),Add_unknown_conversion_for_non_overlapping_types:t(95069,e.DiagnosticCategory.Message,"Add_unknown_conversion_for_non_overlapping_types_95069","Add 'unknown' conversion for non-overlapping types"),Add_unknown_to_all_conversions_of_non_overlapping_types:t(95070,e.DiagnosticCategory.Message,"Add_unknown_to_all_conversions_of_non_overlapping_types_95070","Add 'unknown' to all conversions of non-overlapping types"),Add_missing_new_operator_to_call:t(95071,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_call_95071","Add missing 'new' operator to call"),Add_missing_new_operator_to_all_calls:t(95072,e.DiagnosticCategory.Message,"Add_missing_new_operator_to_all_calls_95072","Add missing 'new' operator to all calls"),Add_names_to_all_parameters_without_names:t(95073,e.DiagnosticCategory.Message,"Add_names_to_all_parameters_without_names_95073","Add names to all parameters without names"),Enable_the_experimentalDecorators_option_in_your_configuration_file:t(95074,e.DiagnosticCategory.Message,"Enable_the_experimentalDecorators_option_in_your_configuration_file_95074","Enable the 'experimentalDecorators' option in your configuration file"),Convert_parameters_to_destructured_object:t(95075,e.DiagnosticCategory.Message,"Convert_parameters_to_destructured_object_95075","Convert parameters to destructured object"),Extract_type:t(95077,e.DiagnosticCategory.Message,"Extract_type_95077","Extract type"),Extract_to_type_alias:t(95078,e.DiagnosticCategory.Message,"Extract_to_type_alias_95078","Extract to type alias"),Extract_to_typedef:t(95079,e.DiagnosticCategory.Message,"Extract_to_typedef_95079","Extract to typedef"),Infer_this_type_of_0_from_usage:t(95080,e.DiagnosticCategory.Message,"Infer_this_type_of_0_from_usage_95080","Infer 'this' type of '{0}' from usage"),Add_const_to_unresolved_variable:t(95081,e.DiagnosticCategory.Message,"Add_const_to_unresolved_variable_95081","Add 'const' to unresolved variable"),Add_const_to_all_unresolved_variables:t(95082,e.DiagnosticCategory.Message,"Add_const_to_all_unresolved_variables_95082","Add 'const' to all unresolved variables"),Add_await:t(95083,e.DiagnosticCategory.Message,"Add_await_95083","Add 'await'"),Add_await_to_initializer_for_0:t(95084,e.DiagnosticCategory.Message,"Add_await_to_initializer_for_0_95084","Add 'await' to initializer for '{0}'"),Fix_all_expressions_possibly_missing_await:t(95085,e.DiagnosticCategory.Message,"Fix_all_expressions_possibly_missing_await_95085","Fix all expressions possibly missing 'await'"),Remove_unnecessary_await:t(95086,e.DiagnosticCategory.Message,"Remove_unnecessary_await_95086","Remove unnecessary 'await'"),Remove_all_unnecessary_uses_of_await:t(95087,e.DiagnosticCategory.Message,"Remove_all_unnecessary_uses_of_await_95087","Remove all unnecessary uses of 'await'"),Enable_the_jsx_flag_in_your_configuration_file:t(95088,e.DiagnosticCategory.Message,"Enable_the_jsx_flag_in_your_configuration_file_95088","Enable the '--jsx' flag in your configuration file"),Add_await_to_initializers:t(95089,e.DiagnosticCategory.Message,"Add_await_to_initializers_95089","Add 'await' to initializers"),Extract_to_interface:t(95090,e.DiagnosticCategory.Message,"Extract_to_interface_95090","Extract to interface"),Convert_to_a_bigint_numeric_literal:t(95091,e.DiagnosticCategory.Message,"Convert_to_a_bigint_numeric_literal_95091","Convert to a bigint numeric literal"),Convert_all_to_bigint_numeric_literals:t(95092,e.DiagnosticCategory.Message,"Convert_all_to_bigint_numeric_literals_95092","Convert all to bigint numeric literals"),Convert_const_to_let:t(95093,e.DiagnosticCategory.Message,"Convert_const_to_let_95093","Convert 'const' to 'let'"),Prefix_with_declare:t(95094,e.DiagnosticCategory.Message,"Prefix_with_declare_95094","Prefix with 'declare'"),Prefix_all_incorrect_property_declarations_with_declare:t(95095,e.DiagnosticCategory.Message,"Prefix_all_incorrect_property_declarations_with_declare_95095","Prefix all incorrect property declarations with 'declare'"),Convert_to_template_string:t(95096,e.DiagnosticCategory.Message,"Convert_to_template_string_95096","Convert to template string"),Add_export_to_make_this_file_into_a_module:t(95097,e.DiagnosticCategory.Message,"Add_export_to_make_this_file_into_a_module_95097","Add 'export {}' to make this file into a module"),Set_the_target_option_in_your_configuration_file_to_0:t(95098,e.DiagnosticCategory.Message,"Set_the_target_option_in_your_configuration_file_to_0_95098","Set the 'target' option in your configuration file to '{0}'"),Set_the_module_option_in_your_configuration_file_to_0:t(95099,e.DiagnosticCategory.Message,"Set_the_module_option_in_your_configuration_file_to_0_95099","Set the 'module' option in your configuration file to '{0}'"),Convert_invalid_character_to_its_html_entity_code:t(95100,e.DiagnosticCategory.Message,"Convert_invalid_character_to_its_html_entity_code_95100","Convert invalid character to its html entity code"),Convert_all_invalid_characters_to_HTML_entity_code:t(95101,e.DiagnosticCategory.Message,"Convert_all_invalid_characters_to_HTML_entity_code_95101","Convert all invalid characters to HTML entity code"),Convert_function_expression_0_to_arrow_function:t(95105,e.DiagnosticCategory.Message,"Convert_function_expression_0_to_arrow_function_95105","Convert function expression '{0}' to arrow function"),Convert_function_declaration_0_to_arrow_function:t(95106,e.DiagnosticCategory.Message,"Convert_function_declaration_0_to_arrow_function_95106","Convert function declaration '{0}' to arrow function"),Fix_all_implicit_this_errors:t(95107,e.DiagnosticCategory.Message,"Fix_all_implicit_this_errors_95107","Fix all implicit-'this' errors"),Wrap_invalid_character_in_an_expression_container:t(95108,e.DiagnosticCategory.Message,"Wrap_invalid_character_in_an_expression_container_95108","Wrap invalid character in an expression container"),Wrap_all_invalid_characters_in_an_expression_container:t(95109,e.DiagnosticCategory.Message,"Wrap_all_invalid_characters_in_an_expression_container_95109","Wrap all invalid characters in an expression container"),Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file:t(95110,e.DiagnosticCategory.Message,"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110","Visit https://aka.ms/tsconfig.json to read more about this file"),Add_a_return_statement:t(95111,e.DiagnosticCategory.Message,"Add_a_return_statement_95111","Add a return statement"),Remove_braces_from_arrow_function_body:t(95112,e.DiagnosticCategory.Message,"Remove_braces_from_arrow_function_body_95112","Remove braces from arrow function body"),Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal:t(95113,e.DiagnosticCategory.Message,"Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113","Wrap the following body with parentheses which should be an object literal"),Add_all_missing_return_statement:t(95114,e.DiagnosticCategory.Message,"Add_all_missing_return_statement_95114","Add all missing return statement"),Remove_braces_from_all_arrow_function_bodies_with_relevant_issues:t(95115,e.DiagnosticCategory.Message,"Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115","Remove braces from all arrow function bodies with relevant issues"),Wrap_all_object_literal_with_parentheses:t(95116,e.DiagnosticCategory.Message,"Wrap_all_object_literal_with_parentheses_95116","Wrap all object literal with parentheses"),Move_labeled_tuple_element_modifiers_to_labels:t(95117,e.DiagnosticCategory.Message,"Move_labeled_tuple_element_modifiers_to_labels_95117","Move labeled tuple element modifiers to labels"),Convert_overload_list_to_single_signature:t(95118,e.DiagnosticCategory.Message,"Convert_overload_list_to_single_signature_95118","Convert overload list to single signature"),Generate_get_and_set_accessors_for_all_overriding_properties:t(95119,e.DiagnosticCategory.Message,"Generate_get_and_set_accessors_for_all_overriding_properties_95119","Generate 'get' and 'set' accessors for all overriding properties"),Wrap_in_JSX_fragment:t(95120,e.DiagnosticCategory.Message,"Wrap_in_JSX_fragment_95120","Wrap in JSX fragment"),Wrap_all_unparented_JSX_in_JSX_fragment:t(95121,e.DiagnosticCategory.Message,"Wrap_all_unparented_JSX_in_JSX_fragment_95121","Wrap all unparented JSX in JSX fragment"),Convert_arrow_function_or_function_expression:t(95122,e.DiagnosticCategory.Message,"Convert_arrow_function_or_function_expression_95122","Convert arrow function or function expression"),Convert_to_anonymous_function:t(95123,e.DiagnosticCategory.Message,"Convert_to_anonymous_function_95123","Convert to anonymous function"),Convert_to_named_function:t(95124,e.DiagnosticCategory.Message,"Convert_to_named_function_95124","Convert to named function"),Convert_to_arrow_function:t(95125,e.DiagnosticCategory.Message,"Convert_to_arrow_function_95125","Convert to arrow function"),Remove_parentheses:t(95126,e.DiagnosticCategory.Message,"Remove_parentheses_95126","Remove parentheses"),Could_not_find_a_containing_arrow_function:t(95127,e.DiagnosticCategory.Message,"Could_not_find_a_containing_arrow_function_95127","Could not find a containing arrow function"),Containing_function_is_not_an_arrow_function:t(95128,e.DiagnosticCategory.Message,"Containing_function_is_not_an_arrow_function_95128","Containing function is not an arrow function"),Could_not_find_export_statement:t(95129,e.DiagnosticCategory.Message,"Could_not_find_export_statement_95129","Could not find export statement"),This_file_already_has_a_default_export:t(95130,e.DiagnosticCategory.Message,"This_file_already_has_a_default_export_95130","This file already has a default export"),Could_not_find_import_clause:t(95131,e.DiagnosticCategory.Message,"Could_not_find_import_clause_95131","Could not find import clause"),Could_not_find_namespace_import_or_named_imports:t(95132,e.DiagnosticCategory.Message,"Could_not_find_namespace_import_or_named_imports_95132","Could not find namespace import or named imports"),Selection_is_not_a_valid_type_node:t(95133,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_type_node_95133","Selection is not a valid type node"),No_type_could_be_extracted_from_this_type_node:t(95134,e.DiagnosticCategory.Message,"No_type_could_be_extracted_from_this_type_node_95134","No type could be extracted from this type node"),Could_not_find_property_for_which_to_generate_accessor:t(95135,e.DiagnosticCategory.Message,"Could_not_find_property_for_which_to_generate_accessor_95135","Could not find property for which to generate accessor"),Name_is_not_valid:t(95136,e.DiagnosticCategory.Message,"Name_is_not_valid_95136","Name is not valid"),Can_only_convert_property_with_modifier:t(95137,e.DiagnosticCategory.Message,"Can_only_convert_property_with_modifier_95137","Can only convert property with modifier"),Switch_each_misused_0_to_1:t(95138,e.DiagnosticCategory.Message,"Switch_each_misused_0_to_1_95138","Switch each misused '{0}' to '{1}'"),Convert_to_optional_chain_expression:t(95139,e.DiagnosticCategory.Message,"Convert_to_optional_chain_expression_95139","Convert to optional chain expression"),Could_not_find_convertible_access_expression:t(95140,e.DiagnosticCategory.Message,"Could_not_find_convertible_access_expression_95140","Could not find convertible access expression"),Could_not_find_matching_access_expressions:t(95141,e.DiagnosticCategory.Message,"Could_not_find_matching_access_expressions_95141","Could not find matching access expressions"),Can_only_convert_logical_AND_access_chains:t(95142,e.DiagnosticCategory.Message,"Can_only_convert_logical_AND_access_chains_95142","Can only convert logical AND access chains"),Add_void_to_Promise_resolved_without_a_value:t(95143,e.DiagnosticCategory.Message,"Add_void_to_Promise_resolved_without_a_value_95143","Add 'void' to Promise resolved without a value"),Add_void_to_all_Promises_resolved_without_a_value:t(95144,e.DiagnosticCategory.Message,"Add_void_to_all_Promises_resolved_without_a_value_95144","Add 'void' to all Promises resolved without a value"),Use_element_access_for_0:t(95145,e.DiagnosticCategory.Message,"Use_element_access_for_0_95145","Use element access for '{0}'"),Use_element_access_for_all_undeclared_properties:t(95146,e.DiagnosticCategory.Message,"Use_element_access_for_all_undeclared_properties_95146","Use element access for all undeclared properties."),Delete_all_unused_imports:t(95147,e.DiagnosticCategory.Message,"Delete_all_unused_imports_95147","Delete all unused imports"),Infer_function_return_type:t(95148,e.DiagnosticCategory.Message,"Infer_function_return_type_95148","Infer function return type"),Return_type_must_be_inferred_from_a_function:t(95149,e.DiagnosticCategory.Message,"Return_type_must_be_inferred_from_a_function_95149","Return type must be inferred from a function"),Could_not_determine_function_return_type:t(95150,e.DiagnosticCategory.Message,"Could_not_determine_function_return_type_95150","Could not determine function return type"),Could_not_convert_to_arrow_function:t(95151,e.DiagnosticCategory.Message,"Could_not_convert_to_arrow_function_95151","Could not convert to arrow function"),Could_not_convert_to_named_function:t(95152,e.DiagnosticCategory.Message,"Could_not_convert_to_named_function_95152","Could not convert to named function"),Could_not_convert_to_anonymous_function:t(95153,e.DiagnosticCategory.Message,"Could_not_convert_to_anonymous_function_95153","Could not convert to anonymous function"),Can_only_convert_string_concatenation:t(95154,e.DiagnosticCategory.Message,"Can_only_convert_string_concatenation_95154","Can only convert string concatenation"),Selection_is_not_a_valid_statement_or_statements:t(95155,e.DiagnosticCategory.Message,"Selection_is_not_a_valid_statement_or_statements_95155","Selection is not a valid statement or statements"),Add_missing_function_declaration_0:t(95156,e.DiagnosticCategory.Message,"Add_missing_function_declaration_0_95156","Add missing function declaration '{0}'"),Add_all_missing_function_declarations:t(95157,e.DiagnosticCategory.Message,"Add_all_missing_function_declarations_95157","Add all missing function declarations"),Method_not_implemented:t(95158,e.DiagnosticCategory.Message,"Method_not_implemented_95158","Method not implemented."),Function_not_implemented:t(95159,e.DiagnosticCategory.Message,"Function_not_implemented_95159","Function not implemented."),Add_override_modifier:t(95160,e.DiagnosticCategory.Message,"Add_override_modifier_95160","Add 'override' modifier"),Remove_override_modifier:t(95161,e.DiagnosticCategory.Message,"Remove_override_modifier_95161","Remove 'override' modifier"),Add_all_missing_override_modifiers:t(95162,e.DiagnosticCategory.Message,"Add_all_missing_override_modifiers_95162","Add all missing 'override' modifiers"),Remove_all_unnecessary_override_modifiers:t(95163,e.DiagnosticCategory.Message,"Remove_all_unnecessary_override_modifiers_95163","Remove all unnecessary 'override' modifiers"),Can_only_convert_named_export:t(95164,e.DiagnosticCategory.Message,"Can_only_convert_named_export_95164","Can only convert named export"),Add_missing_properties:t(95165,e.DiagnosticCategory.Message,"Add_missing_properties_95165","Add missing properties"),Add_all_missing_properties:t(95166,e.DiagnosticCategory.Message,"Add_all_missing_properties_95166","Add all missing properties"),Add_missing_attributes:t(95167,e.DiagnosticCategory.Message,"Add_missing_attributes_95167","Add missing attributes"),Add_all_missing_attributes:t(95168,e.DiagnosticCategory.Message,"Add_all_missing_attributes_95168","Add all missing attributes"),Add_undefined_to_optional_property_type:t(95169,e.DiagnosticCategory.Message,"Add_undefined_to_optional_property_type_95169","Add 'undefined' to optional property type"),No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:t(18004,e.DiagnosticCategory.Error,"No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004","No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),Classes_may_not_have_a_field_named_constructor:t(18006,e.DiagnosticCategory.Error,"Classes_may_not_have_a_field_named_constructor_18006","Classes may not have a field named 'constructor'."),JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array:t(18007,e.DiagnosticCategory.Error,"JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007","JSX expressions may not use the comma operator. Did you mean to write an array?"),Private_identifiers_cannot_be_used_as_parameters:t(18009,e.DiagnosticCategory.Error,"Private_identifiers_cannot_be_used_as_parameters_18009","Private identifiers cannot be used as parameters."),An_accessibility_modifier_cannot_be_used_with_a_private_identifier:t(18010,e.DiagnosticCategory.Error,"An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010","An accessibility modifier cannot be used with a private identifier."),The_operand_of_a_delete_operator_cannot_be_a_private_identifier:t(18011,e.DiagnosticCategory.Error,"The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011","The operand of a 'delete' operator cannot be a private identifier."),constructor_is_a_reserved_word:t(18012,e.DiagnosticCategory.Error,"constructor_is_a_reserved_word_18012","'#constructor' is a reserved word."),Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier:t(18013,e.DiagnosticCategory.Error,"Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013","Property '{0}' is not accessible outside class '{1}' because it has a private identifier."),The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling:t(18014,e.DiagnosticCategory.Error,"The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014","The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."),Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2:t(18015,e.DiagnosticCategory.Error,"Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015","Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."),Private_identifiers_are_not_allowed_outside_class_bodies:t(18016,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_outside_class_bodies_18016","Private identifiers are not allowed outside class bodies."),The_shadowing_declaration_of_0_is_defined_here:t(18017,e.DiagnosticCategory.Error,"The_shadowing_declaration_of_0_is_defined_here_18017","The shadowing declaration of '{0}' is defined here"),The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here:t(18018,e.DiagnosticCategory.Error,"The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018","The declaration of '{0}' that you probably intended to use is defined here"),_0_modifier_cannot_be_used_with_a_private_identifier:t(18019,e.DiagnosticCategory.Error,"_0_modifier_cannot_be_used_with_a_private_identifier_18019","'{0}' modifier cannot be used with a private identifier."),An_enum_member_cannot_be_named_with_a_private_identifier:t(18024,e.DiagnosticCategory.Error,"An_enum_member_cannot_be_named_with_a_private_identifier_18024","An enum member cannot be named with a private identifier."),can_only_be_used_at_the_start_of_a_file:t(18026,e.DiagnosticCategory.Error,"can_only_be_used_at_the_start_of_a_file_18026","'#!' can only be used at the start of a file."),Compiler_reserves_name_0_when_emitting_private_identifier_downlevel:t(18027,e.DiagnosticCategory.Error,"Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027","Compiler reserves name '{0}' when emitting private identifier downlevel."),Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher:t(18028,e.DiagnosticCategory.Error,"Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028","Private identifiers are only available when targeting ECMAScript 2015 and higher."),Private_identifiers_are_not_allowed_in_variable_declarations:t(18029,e.DiagnosticCategory.Error,"Private_identifiers_are_not_allowed_in_variable_declarations_18029","Private identifiers are not allowed in variable declarations."),An_optional_chain_cannot_contain_private_identifiers:t(18030,e.DiagnosticCategory.Error,"An_optional_chain_cannot_contain_private_identifiers_18030","An optional chain cannot contain private identifiers."),The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents:t(18031,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031","The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."),The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some:t(18032,e.DiagnosticCategory.Error,"The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032","The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."),Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead:t(18033,e.DiagnosticCategory.Error,"Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033","Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."),Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment:t(18034,e.DiagnosticCategory.Message,"Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034","Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."),Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name:t(18035,e.DiagnosticCategory.Error,"Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035","Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."),Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator:t(18036,e.DiagnosticCategory.Error,"Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036","Class decorators can't be used with static private identifier. Consider removing the experimental decorator."),Await_expression_cannot_be_used_inside_a_class_static_block:t(18037,e.DiagnosticCategory.Error,"Await_expression_cannot_be_used_inside_a_class_static_block_18037","Await expression cannot be used inside a class static block."),For_await_loops_cannot_be_used_inside_a_class_static_block:t(18038,e.DiagnosticCategory.Error,"For_await_loops_cannot_be_used_inside_a_class_static_block_18038","'For await' loops cannot be used inside a class static block."),Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block:t(18039,e.DiagnosticCategory.Error,"Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039","Invalid use of '{0}'. It cannot be used inside a class static block."),A_return_statement_cannot_be_used_inside_a_class_static_block:t(18041,e.DiagnosticCategory.Error,"A_return_statement_cannot_be_used_inside_a_class_static_block_18041","A 'return' statement cannot be used inside a class static block.")};}(t),function(e){var t;function r(e){return e>=79}e.tokenIsIdentifierOrKeyword=r,e.tokenIsIdentifierOrKeywordOrGreaterThan=function(e){return 31===e||r(e)},e.textToKeywordObj=((t={abstract:126,any:130,as:127,asserts:128,assert:129,bigint:157,boolean:133,break:81,case:82,catch:83,class:84,continue:86,const:85}).constructor=134,t.debugger=87,t.declare=135,t.default=88,t.delete=89,t.do=90,t.else=91,t.enum=92,t.export=93,t.extends=94,t.false=95,t.finally=96,t.for=97,t.from=155,t.function=98,t.get=136,t.if=99,t.implements=117,t.import=100,t.in=101,t.infer=137,t.instanceof=102,t.interface=118,t.intrinsic=138,t.is=139,t.keyof=140,t.let=119,t.module=141,t.namespace=142,t.never=143,t.new=103,t.null=104,t.number=146,t.object=147,t.package=120,t.private=121,t.protected=122,t.public=123,t.override=158,t.readonly=144,t.require=145,t.global=156,t.return=105,t.set=148,t.static=124,t.string=149,t.super=106,t.switch=107,t.symbol=150,t.this=108,t.throw=109,t.true=110,t.try=111,t.type=151,t.typeof=112,t.undefined=152,t.unique=153,t.unknown=154,t.var=113,t.void=114,t.while=115,t.with=116,t.yield=125,t.async=131,t.await=132,t.of=159,t);var n=new e.Map(e.getEntries(e.textToKeywordObj)),a=new e.Map(e.getEntries(i$1(i$1({},e.textToKeywordObj),{"{":18,"}":19,"(":20,")":21,"[":22,"]":23,".":24,"...":25,";":26,",":27,"<":29,">":31,"<=":32,">=":33,"==":34,"!=":35,"===":36,"!==":37,"=>":38,"+":39,"-":40,"**":42,"*":41,"/":43,"%":44,"++":45,"--":46,"<<":47,"</":30,">>":48,">>>":49,"&":50,"|":51,"^":52,"!":53,"~":54,"&&":55,"||":56,"?":57,"??":60,"?.":28,":":58,"=":63,"+=":64,"-=":65,"*=":66,"**=":67,"/=":68,"%=":69,"<<=":70,">>=":71,">>>=":72,"&=":73,"|=":74,"^=":78,"||=":75,"&&=":76,"??=":77,"@":59,"#":62,"`":61}))),o=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1569,1594,1600,1610,1649,1747,1749,1749,1765,1766,1786,1788,1808,1808,1810,1836,1920,1957,2309,2361,2365,2365,2384,2384,2392,2401,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2784,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2877,2877,2908,2909,2911,2913,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3294,3294,3296,3297,3333,3340,3342,3344,3346,3368,3370,3385,3424,3425,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3946,3976,3979,4096,4129,4131,4135,4137,4138,4176,4181,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6067,6176,6263,6272,6312,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8319,8319,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12329,12337,12341,12344,12346,12353,12436,12445,12446,12449,12538,12540,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65138,65140,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],s=[170,170,181,181,186,186,192,214,216,246,248,543,546,563,592,685,688,696,699,705,720,721,736,740,750,750,768,846,864,866,890,890,902,902,904,906,908,908,910,929,931,974,976,983,986,1011,1024,1153,1155,1158,1164,1220,1223,1224,1227,1228,1232,1269,1272,1273,1329,1366,1369,1369,1377,1415,1425,1441,1443,1465,1467,1469,1471,1471,1473,1474,1476,1476,1488,1514,1520,1522,1569,1594,1600,1621,1632,1641,1648,1747,1749,1756,1759,1768,1770,1773,1776,1788,1808,1836,1840,1866,1920,1968,2305,2307,2309,2361,2364,2381,2384,2388,2392,2403,2406,2415,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2492,2494,2500,2503,2504,2507,2509,2519,2519,2524,2525,2527,2531,2534,2545,2562,2562,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2649,2652,2654,2654,2662,2676,2689,2691,2693,2699,2701,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2784,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2870,2873,2876,2883,2887,2888,2891,2893,2902,2903,2908,2909,2911,2913,2918,2927,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,2997,2999,3001,3006,3010,3014,3016,3018,3021,3031,3031,3047,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3134,3140,3142,3144,3146,3149,3157,3158,3168,3169,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3262,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3297,3302,3311,3330,3331,3333,3340,3342,3344,3346,3368,3370,3385,3390,3395,3398,3400,3402,3405,3415,3415,3424,3425,3430,3439,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3805,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3946,3953,3972,3974,3979,3984,3991,3993,4028,4038,4038,4096,4129,4131,4135,4137,4138,4140,4146,4150,4153,4160,4169,4176,4185,4256,4293,4304,4342,4352,4441,4447,4514,4520,4601,4608,4614,4616,4678,4680,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4742,4744,4744,4746,4749,4752,4782,4784,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4814,4816,4822,4824,4846,4848,4878,4880,4880,4882,4885,4888,4894,4896,4934,4936,4954,4969,4977,5024,5108,5121,5740,5743,5750,5761,5786,5792,5866,6016,6099,6112,6121,6160,6169,6176,6263,6272,6313,7680,7835,7840,7929,7936,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8319,8319,8400,8412,8417,8417,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8497,8499,8505,8544,8579,12293,12295,12321,12335,12337,12341,12344,12346,12353,12436,12441,12442,12445,12446,12449,12542,12549,12588,12593,12686,12704,12727,13312,19893,19968,40869,40960,42124,44032,55203,63744,64045,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65056,65059,65075,65076,65101,65103,65136,65138,65140,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500],c=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2208,2208,2210,2220,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7413,7414,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],l=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1319,1329,1366,1369,1369,1377,1415,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1520,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2048,2093,2112,2139,2208,2208,2210,2220,2276,2302,2304,2403,2406,2415,2417,2423,2425,2431,2433,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3073,3075,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3161,3168,3171,3174,3183,3202,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3330,3331,3333,3340,3342,3344,3346,3386,3389,3396,3398,3400,3402,3406,3415,3415,3424,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3769,3771,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6263,6272,6314,6320,6389,6400,6428,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6617,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7376,7378,7380,7414,7424,7654,7676,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,11823,11823,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12442,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,19893,19968,40908,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42647,42655,42737,42775,42783,42786,42888,42891,42894,42896,42899,42912,42922,43e3,43047,43072,43123,43136,43204,43216,43225,43232,43255,43259,43259,43264,43309,43312,43347,43360,43388,43392,43456,43471,43481,43520,43574,43584,43597,43600,43609,43616,43638,43642,43643,43648,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65062,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500],u=[65,90,97,122,170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2208,2228,2230,2237,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7304,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42943,42946,42950,42999,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,69376,69404,69415,69415,69424,69445,69600,69622,69635,69687,69763,69807,69840,69864,69891,69926,69956,69956,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70656,70708,70727,70730,70751,70751,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71680,71723,71840,71903,71935,71935,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72384,72440,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73440,73458,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93760,93823,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,123136,123180,123191,123197,123214,123214,123584,123627,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101],_=[48,57,65,90,95,95,97,122,170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2208,2228,2230,2237,2259,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2902,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3133,3140,3142,3144,3146,3149,3157,3158,3160,3162,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3294,3294,3296,3299,3302,3311,3313,3314,3328,3331,3333,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3458,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3789,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5900,5902,5908,5920,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6160,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6912,6987,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7304,7312,7354,7357,7359,7376,7378,7380,7418,7424,7673,7675,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12730,12784,12799,13312,19893,19968,40943,40960,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42943,42946,42950,42999,43047,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43879,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,67072,67382,67392,67413,67424,67431,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,69376,69404,69415,69415,69424,69456,69600,69622,69632,69702,69734,69743,69759,69818,69840,69864,69872,69881,69888,69940,69942,69951,69956,69958,69968,70003,70006,70006,70016,70084,70089,70092,70096,70106,70108,70108,70144,70161,70163,70199,70206,70206,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70656,70730,70736,70745,70750,70751,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71424,71450,71453,71467,71472,71481,71680,71738,71840,71913,71935,71935,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72384,72440,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73440,73462,73728,74649,74752,74862,74880,75075,77824,78894,82944,83526,92160,92728,92736,92766,92768,92777,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93760,93823,93952,94026,94031,94087,94095,94111,94176,94177,94179,94179,94208,100343,100352,101106,110592,110878,110928,110930,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,123136,123180,123184,123197,123200,123209,123214,123214,123584,123641,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173782,173824,177972,177984,178205,178208,183969,183984,191456,194560,195101,917760,917999],d=/^\/\/\/?\s*@(ts-expect-error|ts-ignore)/,p=/^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;function f(e,t){if(e<t[0])return !1;for(var r,n=0,i=t.length;n+1<i;){if(r=n+(i-n)/2,t[r-=r%2]<=e&&e<=t[r+1])return !0;e<t[r]?i=r:n=r+2;}return !1}function g(e,t){return f(e,t>=2?u:1===t?c:o)}e.isUnicodeIdentifierStart=g;var m,y=(m=[],a.forEach((function(e,t){m[e]=t;})),m);function v(e){for(var t=new Array,r=0,n=0;r<e.length;){var i=e.charCodeAt(r);switch(r++,i){case 13:10===e.charCodeAt(r)&&r++;case 10:t.push(n),n=r;break;default:i>127&&C(i)&&(t.push(n),n=r);}}return t.push(n),t}function h(t,r,n,i,a){(r<0||r>=t.length)&&(a?r=r<0?0:r>=t.length?t.length-1:r:e.Debug.fail("Bad line number. Line: ".concat(r,", lineStarts.length: ").concat(t.length," , line map is correct? ").concat(void 0!==i?e.arraysEqual(t,v(i)):"unknown")));var o=t[r]+n;return a?o>t[r+1]?t[r+1]:"string"==typeof i&&o>i.length?i.length:o:(r<t.length-1?e.Debug.assert(o<t[r+1]):void 0!==i&&e.Debug.assert(o<=i.length),o)}function b(e){return e.lineMap||(e.lineMap=v(e.text))}function x(e,t){var r=D(e,t);return {line:r,character:t-e[r]}}function D(t,r,n){var i=e.binarySearch(t,r,e.identity,e.compareValues,n);return i<0&&(i=~i-1,e.Debug.assert(-1!==i,"position cannot precede the beginning of the file")),i}function S(e){return T(e)||C(e)}function T(e){return 32===e||9===e||11===e||12===e||160===e||133===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function C(e){return 10===e||13===e||8232===e||8233===e}function E(e){return e>=48&&e<=57}function k(e){return E(e)||e>=65&&e<=70||e>=97&&e<=102}function N(e){return e>=48&&e<=55}e.tokenToString=function(e){return y[e]},e.stringToToken=function(e){return a.get(e)},e.computeLineStarts=v,e.getPositionOfLineAndCharacter=function(e,t,r,n){return e.getPositionOfLineAndCharacter?e.getPositionOfLineAndCharacter(t,r,n):h(b(e),t,r,e.text,n)},e.computePositionOfLineAndCharacter=h,e.getLineStarts=b,e.computeLineAndCharacterOfPosition=x,e.computeLineOfPosition=D,e.getLinesBetweenPositions=function(e,t,r){if(t===r)return 0;var n=b(e),i=Math.min(t,r),a=i===r,o=a?t:r,s=D(n,i),c=D(n,o,s);return a?s-c:c-s},e.getLineAndCharacterOfPosition=function(e,t){return x(b(e),t)},e.isWhiteSpaceLike=S,e.isWhiteSpaceSingleLine=T,e.isLineBreak=C,e.isOctalDigit=N,e.couldStartTrivia=function(e,t){var r=e.charCodeAt(t);switch(r){case 13:case 10:case 9:case 11:case 12:case 32:case 47:case 60:case 124:case 61:case 62:return !0;case 35:return 0===t;default:return r>127}},e.skipTrivia=function(t,r,n,i,a){if(e.positionIsSynthesized(r))return r;for(var o=!1;;){var s=t.charCodeAt(r);switch(s){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)return r;o=!!a;continue;case 9:case 11:case 12:case 32:r++;continue;case 47:if(i)break;if(47===t.charCodeAt(r+1)){for(r+=2;r<t.length&&!C(t.charCodeAt(r));)r++;o=!1;continue}if(42===t.charCodeAt(r+1)){for(r+=2;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}o=!1;continue}break;case 60:case 124:case 61:case 62:if(A(t,r)){r=P(t,r),o=!1;continue}break;case 35:if(0===r&&I(t,r)){r=O(t,r),o=!1;continue}break;case 42:if(o){r++,o=!1;continue}break;default:if(s>127&&S(s)){r++;continue}}return r}};var F="<<<<<<<".length;function A(t,r){if(e.Debug.assert(r>=0),0===r||C(t.charCodeAt(r-1))){var n=t.charCodeAt(r);if(r+F<t.length){for(var i=0;i<F;i++)if(t.charCodeAt(r+i)!==n)return !1;return 61===n||32===t.charCodeAt(r+F)}}return !1}function P(t,r,n){n&&n(e.Diagnostics.Merge_conflict_marker_encountered,r,F);var i=t.charCodeAt(r),a=t.length;if(60===i||62===i)for(;r<a&&!C(t.charCodeAt(r));)r++;else for(e.Debug.assert(124===i||61===i);r<a;){var o=t.charCodeAt(r);if((61===o||62===o)&&o!==i&&A(t,r))break;r++;}return r}var w=/^#!.*/;function I(t,r){return e.Debug.assert(0===r),w.test(t)}function O(e,t){return t+w.exec(e)[0].length}function M(e,t,r,n,i,a,o){var s,c,l,u,_=!1,d=n,p=o;if(0===r){d=!0;var f=j(t);f&&(r=f.length);}e:for(;r>=0&&r<t.length;){var g=t.charCodeAt(r);switch(g){case 13:10===t.charCodeAt(r+1)&&r++;case 10:if(r++,n)break e;d=!0,_&&(u=!0);continue;case 9:case 11:case 12:case 32:r++;continue;case 47:var m=t.charCodeAt(r+1),y=!1;if(47===m||42===m){var v=47===m?2:3,h=r;if(r+=2,47===m)for(;r<t.length;){if(C(t.charCodeAt(r))){y=!0;break}r++;}else for(;r<t.length;){if(42===t.charCodeAt(r)&&47===t.charCodeAt(r+1)){r+=2;break}r++;}if(d){if(_&&(p=i(s,c,l,u,a,p),!e&&p))return p;s=h,c=r,l=v,u=y,_=!0;}continue}break e;default:if(g>127&&S(g)){_&&C(g)&&(u=!0),r++;continue}break e}}return _&&(p=i(s,c,l,u,a,p)),p}function L(e,t,r,n,i){return M(!0,e,t,!1,r,n,i)}function R(e,t,r,n,i){return M(!0,e,t,!0,r,n,i)}function B(e,t,r,n,i,a){return a||(a=[]),a.push({kind:r,pos:e,end:t,hasTrailingNewLine:n}),a}function j(e){var t=w.exec(e);if(t)return t[0]}function J(e,t){return e>=65&&e<=90||e>=97&&e<=122||36===e||95===e||e>127&&g(e,t)}function z(e,t,r){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||36===e||95===e||1===r&&(45===e||58===e)||e>127&&function(e,t){return f(e,t>=2?_:1===t?l:s)}(e,t)}e.isShebangTrivia=I,e.scanShebangTrivia=O,e.forEachLeadingCommentRange=function(e,t,r,n){return M(!1,e,t,!1,r,n)},e.forEachTrailingCommentRange=function(e,t,r,n){return M(!1,e,t,!0,r,n)},e.reduceEachLeadingCommentRange=L,e.reduceEachTrailingCommentRange=R,e.getLeadingCommentRanges=function(e,t){return L(e,t,B,void 0,void 0)},e.getTrailingCommentRanges=function(e,t){return R(e,t,B,void 0,void 0)},e.getShebang=j,e.isIdentifierStart=J,e.isIdentifierPart=z,e.isIdentifierText=function(e,t,r){var n=U(e,0);if(!J(n,t))return !1;for(var i=K(n);i<e.length;i+=K(n))if(!z(n=U(e,i),t,r))return !1;return !0},e.createScanner=function(t,i,a,o,s,c,l){void 0===a&&(a=0);var u,_,f,g,m,y,v,h,b=o,x=0;le(b,c,l);var D={getStartPos:function(){return f},getTextPos:function(){return u},getToken:function(){return m},getTokenPos:function(){return g},getTokenText:function(){return b.substring(g,u)},getTokenValue:function(){return y},hasUnicodeEscape:function(){return 0!=(1024&v)},hasExtendedUnicodeEscape:function(){return 0!=(8&v)},hasPrecedingLineBreak:function(){return 0!=(1&v)},hasPrecedingJSDocComment:function(){return 0!=(2&v)},isIdentifier:function(){return 79===m||m>116},isReservedWord:function(){return m>=81&&m<=116},isUnterminated:function(){return 0!=(4&v)},getCommentDirectives:function(){return h},getNumericLiteralFlags:function(){return 1008&v},getTokenFlags:function(){return v},reScanGreaterToken:function(){if(31===m){if(62===b.charCodeAt(u))return 62===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=72):(u+=2,m=49):61===b.charCodeAt(u+1)?(u+=2,m=71):(u++,m=48);if(61===b.charCodeAt(u))return u++,m=33}return m},reScanAsteriskEqualsToken:function(){return e.Debug.assert(66===m,"'reScanAsteriskEqualsToken' should only be called on a '*='"),u=g+1,m=63},reScanSlashToken:function(){if(43===m||68===m){for(var r=g+1,n=!1,i=!1;;){if(r>=_){v|=4,F(e.Diagnostics.Unterminated_regular_expression_literal);break}var a=b.charCodeAt(r);if(C(a)){v|=4,F(e.Diagnostics.Unterminated_regular_expression_literal);break}if(n)n=!1;else {if(47===a&&!i){r++;break}91===a?i=!0:92===a?n=!0:93===a&&(i=!1);}r++;}for(;r<_&&z(b.charCodeAt(r),t);)r++;u=r,y=b.substring(g,u),m=13;}return m},reScanTemplateToken:function(t){return e.Debug.assert(19===m,"'reScanTemplateToken' should only be called on a '}'"),u=g,m=H(t)},reScanTemplateHeadOrNoSubstitutionTemplate:function(){return u=g,m=H(!0)},scanJsxIdentifier:function(){if(r(m)){for(var e=!1;u<_;){var t=b.charCodeAt(u);if(45!==t)if(58!==t||e){var n=u;if(y+=$(),u===n)break}else y+=":",u++,e=!0,m=79;else y+="-",u++;}":"===y.slice(-1)&&(y=y.slice(0,-1),u--);}return m},scanJsxAttributeValue:se,reScanJsxAttributeValue:function(){return u=g=f,se()},reScanJsxToken:function(e){return void 0===e&&(e=!0),u=g=f,m=oe(e)},reScanLessThanToken:function(){return 47===m?(u=g+1,m=29):m},reScanHashToken:function(){return 80===m?(u=g+1,m=62):m},reScanQuestionToken:function(){return e.Debug.assert(60===m,"'reScanQuestionToken' should only be called on a '??'"),u=g+1,m=57},reScanInvalidIdentifier:function(){e.Debug.assert(0===m,"'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."),u=g=f,v=0;var t=U(b,u),r=ie(t,99);return r?m=r:(u+=K(t),m)},scanJsxToken:oe,scanJsDocToken:function(){if(f=g=u,v=0,u>=_)return m=1;var e=U(b,u);switch(u+=K(e),e){case 9:case 11:case 12:case 32:for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 64:return m=59;case 13:10===b.charCodeAt(u)&&u++;case 10:return v|=1,m=4;case 42:return m=41;case 123:return m=18;case 125:return m=19;case 91:return m=22;case 93:return m=23;case 60:return m=29;case 62:return m=31;case 61:return m=63;case 44:return m=27;case 46:return m=24;case 96:return m=61;case 35:return m=62;case 92:u--;var r=Z();if(r>=0&&J(r,t))return u+=3,v|=8,y=X()+$(),m=ee();var n=Y();return n>=0&&J(n,t)?(u+=6,v|=1024,y=String.fromCharCode(n)+$(),m=ee()):(u++,m=0)}if(J(e,t)){for(var i=e;u<_&&z(i=U(b,u),t)||45===b.charCodeAt(u);)u+=K(i);return y=b.substring(g,u),92===i&&(y+=$()),m=ee()}return m=0},scan:ne,getText:function(){return b},clearCommentDirectives:function(){h=void 0;},setText:le,setScriptTarget:function(e){t=e;},setLanguageVariant:function(e){a=e;},setOnError:function(e){s=e;},setTextPos:ue,setInJSDocType:function(e){x+=e?1:-1;},tryScan:function(e){return ce(e,!1)},lookAhead:function(e){return ce(e,!0)},scanRange:function(e,t,r){var n=_,i=u,a=f,o=g,s=m,c=y,l=v,d=h;le(b,e,t);var p=r();return _=n,u=i,f=a,g=o,m=s,y=c,v=l,h=d,p}};return e.Debug.isDebugging&&Object.defineProperty(D,"__debugShowCurrentPositionInText",{get:function(){var e=D.getText();return e.slice(0,D.getStartPos())+"║"+e.slice(D.getStartPos())}}),D;function F(e,t,r){if(void 0===t&&(t=u),s){var n=u;u=t,s(e,r||0),u=n;}}function w(){for(var t=u,r=!1,n=!1,i="";;){var a=b.charCodeAt(u);if(95!==a){if(!E(a))break;r=!0,n=!1,u++;}else v|=512,r?(r=!1,n=!0,i+=b.substring(t,u)):F(n?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),t=++u;}return 95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),i+b.substring(t,u)}function M(){var t,r,n=u,i=w();46===b.charCodeAt(u)&&(u++,t=w());var a,o=u;if(69===b.charCodeAt(u)||101===b.charCodeAt(u)){u++,v|=16,43!==b.charCodeAt(u)&&45!==b.charCodeAt(u)||u++;var s=u,c=w();c?(r=b.substring(o,s)+c,o=u):F(e.Diagnostics.Digit_expected);}if(512&v?(a=i,t&&(a+="."+t),r&&(a+=r)):a=b.substring(n,o),void 0!==t||16&v)return L(n,void 0===t&&!!(16&v)),{type:8,value:""+ +a};y=a;var l=re();return L(n),{type:l,value:y}}function L(r,n){if(J(U(b,u),t)){var i=u,a=$().length;1===a&&"n"===b[i]?F(n?e.Diagnostics.A_bigint_literal_cannot_use_exponential_notation:e.Diagnostics.A_bigint_literal_must_be_an_integer,r,i-r+1):(F(e.Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal,i,a),u=i);}}function R(){for(var e=u;N(b.charCodeAt(u));)u++;return +b.substring(e,u)}function B(e,t){var r=V(e,!1,t);return r?parseInt(r,16):-1}function j(e,t){return V(e,!0,t)}function V(t,r,n){for(var i=[],a=!1,o=!1;i.length<t||r;){var s=b.charCodeAt(u);if(n&&95===s)v|=512,a?(a=!1,o=!0):F(o?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;else {if(a=n,s>=65&&s<=70)s+=32;else if(!(s>=48&&s<=57||s>=97&&s<=102))break;i.push(s),u++,o=!1;}}return i.length<t&&(i=[]),95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),String.fromCharCode.apply(String,i)}function W(t){void 0===t&&(t=!1);for(var r=b.charCodeAt(u),n="",i=++u;;){if(u>=_){n+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_string_literal);break}var a=b.charCodeAt(u);if(a===r){n+=b.substring(i,u),u++;break}if(92!==a||t){if(C(a)&&!t){n+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_string_literal);break}u++;}else n+=b.substring(i,u),n+=G(),i=u;}return n}function H(t){for(var r,n=96===b.charCodeAt(u),i=++u,a="";;){if(u>=_){a+=b.substring(i,u),v|=4,F(e.Diagnostics.Unterminated_template_literal),r=n?14:17;break}var o=b.charCodeAt(u);if(96===o){a+=b.substring(i,u),u++,r=n?14:17;break}if(36===o&&u+1<_&&123===b.charCodeAt(u+1)){a+=b.substring(i,u),u+=2,r=n?15:16;break}92!==o?13!==o?u++:(a+=b.substring(i,u),++u<_&&10===b.charCodeAt(u)&&u++,a+="\n",i=u):(a+=b.substring(i,u),a+=G(t),i=u);}return e.Debug.assert(void 0!==r),y=a,r}function G(t){var r=u;if(++u>=_)return F(e.Diagnostics.Unexpected_end_of_text),"";var n=b.charCodeAt(u);switch(u++,n){case 48:return t&&u<_&&E(b.charCodeAt(u))?(u++,v|=2048,b.substring(r,u)):"\0";case 98:return "\b";case 116:return "\t";case 110:return "\n";case 118:return "\v";case 102:return "\f";case 114:return "\r";case 39:return "'";case 34:return '"';case 117:if(t)for(var i=u;i<u+4;i++)if(i<_&&!k(b.charCodeAt(i))&&123!==b.charCodeAt(i))return u=i,v|=2048,b.substring(r,u);if(u<_&&123===b.charCodeAt(u)){if(u++,t&&!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(t){var a=u,o=j(1,!1);if(!((o?parseInt(o,16):-1)<=1114111&&125===b.charCodeAt(u)))return v|=2048,b.substring(r,u);u=a;}return v|=8,X()}return v|=1024,Q(4);case 120:if(t){if(!k(b.charCodeAt(u)))return v|=2048,b.substring(r,u);if(!k(b.charCodeAt(u+1)))return u++,v|=2048,b.substring(r,u)}return Q(2);case 13:u<_&&10===b.charCodeAt(u)&&u++;case 10:case 8232:case 8233:return "";default:return String.fromCharCode(n)}}function Q(t){var r=B(t,!1);return r>=0?String.fromCharCode(r):(F(e.Diagnostics.Hexadecimal_digit_expected),"")}function X(){var t=j(1,!1),r=t?parseInt(t,16):-1,n=!1;return r<0?(F(e.Diagnostics.Hexadecimal_digit_expected),n=!0):r>1114111&&(F(e.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive),n=!0),u>=_?(F(e.Diagnostics.Unexpected_end_of_text),n=!0):125===b.charCodeAt(u)?u++:(F(e.Diagnostics.Unterminated_Unicode_escape_sequence),n=!0),n?"":q(r)}function Y(){if(u+5<_&&117===b.charCodeAt(u+1)){var e=u;u+=2;var t=B(4,!1);return u=e,t}return -1}function Z(){if(t>=2&&117===U(b,u+1)&&123===U(b,u+2)){var e=u;u+=3;var r=j(1,!1),n=r?parseInt(r,16):-1;return u=e,n}return -1}function $(){for(var e="",r=u;u<_;){var n=U(b,u);if(z(n,t))u+=K(n);else {if(92!==n)break;if((n=Z())>=0&&z(n,t)){u+=3,v|=8,e+=X(),r=u;continue}if(!((n=Y())>=0&&z(n,t)))break;v|=1024,e+=b.substring(r,u),e+=q(n),r=u+=6;}}return e+b.substring(r,u)}function ee(){var e=y.length;if(e>=2&&e<=12){var t=y.charCodeAt(0);if(t>=97&&t<=122){var r=n.get(y);if(void 0!==r)return m=r}}return m=79}function te(t){for(var r="",n=!1,i=!1;;){var a=b.charCodeAt(u);if(95!==a){if(n=!0,!E(a)||a-48>=t)break;r+=b[u],u++,i=!1;}else v|=512,n?(n=!1,i=!0):F(i?e.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted:e.Diagnostics.Numeric_separators_are_not_allowed_here,u,1),u++;}return 95===b.charCodeAt(u-1)&&F(e.Diagnostics.Numeric_separators_are_not_allowed_here,u-1,1),r}function re(){if(110===b.charCodeAt(u))return y+="n",384&v&&(y=e.parsePseudoBigInt(y)+"n"),u++,9;var t=128&v?parseInt(y.slice(2),2):256&v?parseInt(y.slice(2),8):+y;return y=""+t,8}function ne(){var r;f=u,v=0;for(var n=!1;;){if(g=u,u>=_)return m=1;var o=U(b,u);if(35===o&&0===u&&I(b,u)){if(u=O(b,u),i)continue;return m=6}switch(o){case 10:case 13:if(v|=1,i){u++;continue}return 13===o&&u+1<_&&10===b.charCodeAt(u+1)?u+=2:u++,m=4;case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8203:case 8239:case 8287:case 12288:case 65279:if(i){u++;continue}for(;u<_&&T(b.charCodeAt(u));)u++;return m=5;case 33:return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=37):(u+=2,m=35):(u++,m=53);case 34:case 39:return y=W(),m=10;case 96:return m=H(!1);case 37:return 61===b.charCodeAt(u+1)?(u+=2,m=69):(u++,m=44);case 38:return 38===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=76):(u+=2,m=55):61===b.charCodeAt(u+1)?(u+=2,m=73):(u++,m=50);case 40:return u++,m=20;case 41:return u++,m=21;case 42:if(61===b.charCodeAt(u+1))return u+=2,m=66;if(42===b.charCodeAt(u+1))return 61===b.charCodeAt(u+2)?(u+=3,m=67):(u+=2,m=42);if(u++,x&&!n&&1&v){n=!0;continue}return m=41;case 43:return 43===b.charCodeAt(u+1)?(u+=2,m=45):61===b.charCodeAt(u+1)?(u+=2,m=64):(u++,m=39);case 44:return u++,m=27;case 45:return 45===b.charCodeAt(u+1)?(u+=2,m=46):61===b.charCodeAt(u+1)?(u+=2,m=65):(u++,m=40);case 46:return E(b.charCodeAt(u+1))?(y=M().value,m=8):46===b.charCodeAt(u+1)&&46===b.charCodeAt(u+2)?(u+=3,m=25):(u++,m=24);case 47:if(47===b.charCodeAt(u+1)){for(u+=2;u<_&&!C(b.charCodeAt(u));)u++;if(h=ae(h,b.slice(g,u),d,g),i)continue;return m=2}if(42===b.charCodeAt(u+1)){u+=2,42===b.charCodeAt(u)&&47!==b.charCodeAt(u+1)&&(v|=2);for(var s=!1,c=g;u<_;){var l=b.charCodeAt(u);if(42===l&&47===b.charCodeAt(u+1)){u+=2,s=!0;break}u++,C(l)&&(c=u,v|=1);}if(h=ae(h,b.slice(c,u),p,c),s||F(e.Diagnostics.Asterisk_Slash_expected),i)continue;return s||(v|=4),m=3}return 61===b.charCodeAt(u+1)?(u+=2,m=68):(u++,m=43);case 48:if(u+2<_&&(88===b.charCodeAt(u+1)||120===b.charCodeAt(u+1)))return u+=2,(y=j(1,!0))||(F(e.Diagnostics.Hexadecimal_digit_expected),y="0"),y="0x"+y,v|=64,m=re();if(u+2<_&&(66===b.charCodeAt(u+1)||98===b.charCodeAt(u+1)))return u+=2,(y=te(2))||(F(e.Diagnostics.Binary_digit_expected),y="0"),y="0b"+y,v|=128,m=re();if(u+2<_&&(79===b.charCodeAt(u+1)||111===b.charCodeAt(u+1)))return u+=2,(y=te(8))||(F(e.Diagnostics.Octal_digit_expected),y="0"),y="0o"+y,v|=256,m=re();if(u+1<_&&N(b.charCodeAt(u+1)))return y=""+R(),v|=32,m=8;case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r=M(),m=r.type,y=r.value,m;case 58:return u++,m=58;case 59:return u++,m=26;case 60:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 60===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=70):(u+=2,m=47):61===b.charCodeAt(u+1)?(u+=2,m=32):1===a&&47===b.charCodeAt(u+1)&&42!==b.charCodeAt(u+2)?(u+=2,m=30):(u++,m=29);case 61:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 61===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=36):(u+=2,m=34):62===b.charCodeAt(u+1)?(u+=2,m=38):(u++,m=63);case 62:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return u++,m=31;case 63:return 46!==b.charCodeAt(u+1)||E(b.charCodeAt(u+2))?63===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=77):(u+=2,m=60):(u++,m=57):(u+=2,m=28);case 91:return u++,m=22;case 93:return u++,m=23;case 94:return 61===b.charCodeAt(u+1)?(u+=2,m=78):(u++,m=52);case 123:return u++,m=18;case 124:if(A(b,u)){if(u=P(b,u,F),i)continue;return m=7}return 124===b.charCodeAt(u+1)?61===b.charCodeAt(u+2)?(u+=3,m=75):(u+=2,m=56):61===b.charCodeAt(u+1)?(u+=2,m=74):(u++,m=51);case 125:return u++,m=19;case 126:return u++,m=54;case 64:return u++,m=59;case 92:var D=Z();if(D>=0&&J(D,t))return u+=3,v|=8,y=X()+$(),m=ee();var S=Y();return S>=0&&J(S,t)?(u+=6,v|=1024,y=String.fromCharCode(S)+$(),m=ee()):(F(e.Diagnostics.Invalid_character),u++,m=0);case 35:return 0!==u&&"!"===b[u+1]?(F(e.Diagnostics.can_only_be_used_at_the_start_of_a_file),u++,m=0):(J(U(b,u+1),t)?(u++,ie(U(b,u),t)):(y=String.fromCharCode(U(b,u)),F(e.Diagnostics.Invalid_character,u++,K(o))),m=80);default:var k=ie(o,t);if(k)return m=k;if(T(o)){u+=K(o);continue}if(C(o)){v|=1,u+=K(o);continue}var w=K(o);return F(e.Diagnostics.Invalid_character,u,w),u+=w,m=0}}}function ie(e,t){var r=e;if(J(r,t)){for(u+=K(r);u<_&&z(r=U(b,u),t);)u+=K(r);return y=b.substring(g,u),92===r&&(y+=$()),ee()}}function ae(t,r,n,i){var a=function(e,t){var r=t.exec(e);if(r)switch(r[1]){case"ts-expect-error":return 0;case"ts-ignore":return 1}}(e.trimStringStart(r),n);return void 0===a?t:e.append(t,{range:{pos:i,end:u},type:a})}function oe(t){if(void 0===t&&(t=!0),f=g=u,u>=_)return m=1;var r=b.charCodeAt(u);if(60===r)return 47===b.charCodeAt(u+1)?(u+=2,m=30):(u++,m=29);if(123===r)return u++,m=18;for(var n=0;u<_&&123!==(r=b.charCodeAt(u));){if(60===r){if(A(b,u))return u=P(b,u,F),m=7;break}if(62===r&&F(e.Diagnostics.Unexpected_token_Did_you_mean_or_gt,u,1),125===r&&F(e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace,u,1),C(r)&&0===n)n=-1;else {if(!t&&C(r)&&n>0)break;S(r)||(n=u);}u++;}return y=b.substring(f,u),-1===n?12:11}function se(){switch(f=u,b.charCodeAt(u)){case 34:case 39:return y=W(!0),m=10;default:return ne()}}function ce(e,t){var r=u,n=f,i=g,a=m,o=y,s=v,c=e();return c&&!t||(u=r,f=n,g=i,m=a,y=o,v=s),c}function le(e,t,r){b=e||"",_=void 0===r?b.length:t+r,ue(t||0);}function ue(t){e.Debug.assert(t>=0),u=t,f=t,g=t,m=0,y=void 0,v=0;}};var U=String.prototype.codePointAt?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n=e.charCodeAt(t);if(n>=55296&&n<=56319&&r>t+1){var i=e.charCodeAt(t+1);if(i>=56320&&i<=57343)return 1024*(n-55296)+i-56320+65536}return n}};function K(e){return e>=65536?2:1}var V=String.fromCodePoint?function(e){return String.fromCodePoint(e)}:function(t){if(e.Debug.assert(0<=t&&t<=1114111),t<=65535)return String.fromCharCode(t);var r=Math.floor((t-65536)/1024)+55296,n=(t-65536)%1024+56320;return String.fromCharCode(r,n)};function q(e){return V(e)}e.utf16EncodeAsString=q;}(t),function(e){function t(e){return e.start+e.length}function r(e){return 0===e.length}function n(e,t){var r=a(e,t);return r&&0===r.length?void 0:r}function i(e,t,r,n){return r<=e+t&&r+n>=e}function a(e,r){var n=Math.max(e.start,r.start),i=Math.min(t(e),t(r));return n<=i?s(n,i):void 0}function o(e,t){if(e<0)throw new Error("start < 0");if(t<0)throw new Error("length < 0");return {start:e,length:t}}function s(e,t){return o(e,t-e)}function c(e,t){if(t<0)throw new Error("newLength < 0");return {span:e,newLength:t}}function l(t){return !!Z(t)&&e.every(t.elements,u)}function u(t){return !!e.isOmittedExpression(t)||l(t.name)}function _(t){for(var r=t.parent;e.isBindingElement(r.parent);)r=r.parent.parent;return r.parent}function d(t,r){e.isBindingElement(t)&&(t=_(t));var n=r(t);return 253===t.kind&&(t=t.parent),t&&254===t.kind&&(n|=r(t),t=t.parent),t&&236===t.kind&&(n|=r(t)),n}function p(e){return 0==(8&e.flags)}function f(e){var t=e;return t.length>=3&&95===t.charCodeAt(0)&&95===t.charCodeAt(1)&&95===t.charCodeAt(2)?t.substr(1):t}function g(e){return f(e.escapedText)}function m(t){var r=t.parent.parent;if(r){if(se(r))return y(r);switch(r.kind){case 236:if(r.declarationList&&r.declarationList.declarations[0])return y(r.declarationList.declarations[0]);break;case 237:var n=r.expression;switch(220===n.kind&&63===n.operatorToken.kind&&(n=n.left),n.kind){case 205:return n.name;case 206:var i=n.argumentExpression;if(e.isIdentifier(i))return i}break;case 211:return y(r.expression);case 249:if(se(r.statement)||ne(r.statement))return y(r.statement)}}}function y(t){var r=x(t);return r&&e.isIdentifier(r)?r:void 0}function v(e){return e.name||m(e)}function h(e){return !!e.name}function b(t){switch(t.kind){case 79:return t;case 345:case 338:var r=t.name;if(160===r.kind)return r.right;break;case 207:case 220:var n=t;switch(e.getAssignmentDeclarationKind(n)){case 1:case 4:case 5:case 3:return e.getElementOrPropertyAccessArgumentExpressionOrName(n.left);case 7:case 8:case 9:return n.arguments[1];default:return}case 343:return v(t);case 337:return m(t);case 270:var i=t.expression;return e.isIdentifier(i)?i:void 0;case 206:var a=t;if(e.isBindableStaticElementAccessExpression(a))return a.argumentExpression}return t.name}function x(t){if(void 0!==t)return b(t)||(e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t)?D(t):void 0)}function D(t){if(t.parent){if(e.isPropertyAssignment(t.parent)||e.isBindingElement(t.parent))return t.parent.name;if(e.isBinaryExpression(t.parent)&&t===t.parent.right){if(e.isIdentifier(t.parent.left))return t.parent.left;if(e.isAccessExpression(t.parent.left))return e.getElementOrPropertyAccessArgumentExpressionOrName(t.parent.left)}else if(e.isVariableDeclaration(t.parent)&&e.isIdentifier(t.parent.name))return t.parent.name}}function S(t,r){if(t.name){if(e.isIdentifier(t.name)){var n=t.name.escapedText;return F(t.parent,r).filter((function(t){return e.isJSDocParameterTag(t)&&e.isIdentifier(t.name)&&t.name.escapedText===n}))}var i=t.parent.parameters.indexOf(t);e.Debug.assert(i>-1,"Parameters should always be in their parents' parameter list");var a=F(t.parent,r).filter(e.isJSDocParameterTag);if(i<a.length)return [a[i]]}return e.emptyArray}function T(e){return S(e,!1)}function C(t,r){var n=t.name.escapedText;return F(t.parent,r).filter((function(t){return e.isJSDocTemplateTag(t)&&t.typeParameters.some((function(e){return e.name.escapedText===n}))}))}function E(t){return P(t,e.isJSDocReturnTag)}function k(t){var r=P(t,e.isJSDocTypeTag);if(r&&r.typeExpression&&r.typeExpression.type)return r}function N(t){var r=P(t,e.isJSDocTypeTag);return !r&&e.isParameter(t)&&(r=e.find(T(t),(function(e){return !!e.typeExpression}))),r&&r.typeExpression&&r.typeExpression.type}function F(t,r){var n=t.jsDocCache;if(void 0===n||r){var i=e.getJSDocCommentsAndTags(t,r);e.Debug.assert(i.length<2||i[0]!==i[1]),n=e.flatMap(i,(function(t){return e.isJSDoc(t)?t.tags:t})),r||(t.jsDocCache=n);}return n}function A(e){return F(e,!1)}function P(t,r,n){return e.find(F(t,n),r)}function w(e,t){return A(e).filter(t)}function I(e){var t=e.kind;return !!(32&e.flags)&&(205===t||206===t||207===t||229===t)}function O(t){return I(t)&&!e.isNonNullExpression(t)&&!!t.questionDotToken}function M(t){return e.skipOuterExpressions(t,8)}function L(e){switch(e.kind){case 300:case 301:return !0;default:return !1}}function R(e){return e>=160}function B(e){return e>=0&&e<=159}function j(e){return 8<=e&&e<=14}function J(e){return 14<=e&&e<=17}function z(t){return (e.isPropertyDeclaration(t)||Q(t))&&e.isPrivateIdentifier(t.name)}function U(e){switch(e){case 126:case 131:case 85:case 135:case 88:case 93:case 123:case 121:case 122:case 144:case 124:case 158:return !0}return !1}function K(t){return !!(16476&e.modifierToFlag(t))}function V(e){return !!e&&W(e.kind)}function q(e){switch(e){case 255:case 168:case 170:case 171:case 172:case 212:case 213:return !0;default:return !1}}function W(e){switch(e){case 167:case 173:case 321:case 174:case 175:case 178:case 315:case 179:return !0;default:return q(e)}}function H(e){var t=e.kind;return 170===t||166===t||168===t||171===t||172===t||175===t||169===t||233===t}function G(e){return e&&(256===e.kind||225===e.kind)}function Q(e){switch(e.kind){case 168:case 171:case 172:return !0;default:return !1}}function X(e){var t=e.kind;return 174===t||173===t||165===t||167===t||175===t}function Y(e){var t=e.kind;return 294===t||295===t||296===t||168===t||171===t||172===t}function Z(e){if(e){var t=e.kind;return 201===t||200===t}return !1}function $(e){switch(e.kind){case 200:case 204:return !0}return !1}function ee(e){switch(e.kind){case 201:case 203:return !0}return !1}function te(e){switch(e){case 205:case 206:case 208:case 207:case 277:case 278:case 281:case 209:case 203:case 211:case 204:case 225:case 212:case 79:case 80:case 13:case 8:case 9:case 10:case 14:case 222:case 95:case 104:case 108:case 110:case 106:case 229:case 230:case 100:return !0;default:return !1}}function re(e){switch(e){case 218:case 219:case 214:case 215:case 216:case 217:case 210:return !0;default:return te(e)}}function ne(e){return function(e){switch(e){case 221:case 223:case 213:case 220:case 224:case 228:case 226:case 349:case 348:return !0;default:return re(e)}}(M(e).kind)}function ie(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function ae(e){return 255===e||275===e||256===e||257===e||258===e||259===e||260===e||265===e||264===e||271===e||270===e||263===e}function oe(e){return 245===e||244===e||252===e||239===e||237===e||235===e||242===e||243===e||241===e||238===e||249===e||246===e||248===e||250===e||251===e||236===e||240===e||247===e||347===e||351===e||350===e}function se(t){return 162===t.kind?t.parent&&342!==t.parent.kind||e.isInJSFile(t):213===(r=t.kind)||202===r||256===r||225===r||169===r||170===r||259===r||297===r||274===r||255===r||212===r||171===r||266===r||264===r||269===r||257===r||284===r||168===r||167===r||260===r||263===r||267===r||273===r||163===r||294===r||166===r||165===r||172===r||295===r||258===r||162===r||253===r||343===r||336===r||345===r;var r;}function ce(e){return e.kind>=325&&e.kind<=345}e.isExternalModuleNameRelative=function(t){return e.pathIsRelative(t)||e.isRootedDiskPath(t)},e.sortAndDeduplicateDiagnostics=function(t){return e.sortAndDeduplicate(t,e.compareDiagnostics)},e.getDefaultLibFileName=function(t){switch(e.getEmitScriptTarget(t)){case 99:return "lib.esnext.full.d.ts";case 8:return "lib.es2021.full.d.ts";case 7:return "lib.es2020.full.d.ts";case 6:return "lib.es2019.full.d.ts";case 5:return "lib.es2018.full.d.ts";case 4:return "lib.es2017.full.d.ts";case 3:return "lib.es2016.full.d.ts";case 2:return "lib.es6.d.ts";default:return "lib.d.ts"}},e.textSpanEnd=t,e.textSpanIsEmpty=r,e.textSpanContainsPosition=function(e,r){return r>=e.start&&r<t(e)},e.textRangeContainsPositionInclusive=function(e,t){return t>=e.pos&&t<=e.end},e.textSpanContainsTextSpan=function(e,r){return r.start>=e.start&&t(r)<=t(e)},e.textSpanOverlapsWith=function(e,t){return void 0!==n(e,t)},e.textSpanOverlap=n,e.textSpanIntersectsWithTextSpan=function(e,t){return i(e.start,e.length,t.start,t.length)},e.textSpanIntersectsWith=function(e,t,r){return i(e.start,e.length,t,r)},e.decodedTextSpanIntersectsWith=i,e.textSpanIntersectsWithPosition=function(e,r){return r<=t(e)&&r>=e.start},e.textSpanIntersection=a,e.createTextSpan=o,e.createTextSpanFromBounds=s,e.textChangeRangeNewSpan=function(e){return o(e.span.start,e.newLength)},e.textChangeRangeIsUnchanged=function(e){return r(e.span)&&0===e.newLength},e.createTextChangeRange=c,e.unchangedTextChangeRange=c(o(0,0),0),e.collapseTextChangeRangesAcrossMultipleVersions=function(r){if(0===r.length)return e.unchangedTextChangeRange;if(1===r.length)return r[0];for(var n=r[0],i=n.span.start,a=t(n.span),o=i+n.newLength,l=1;l<r.length;l++){var u=r[l],_=i,d=a,p=o,f=u.span.start,g=t(u.span),m=f+u.newLength;i=Math.min(_,f),a=Math.max(d,d+(g-p)),o=Math.max(m,m+(p-g));}return c(s(i,a),o-i)},e.getTypeParameterOwner=function(e){if(e&&162===e.kind)for(var t=e;t;t=t.parent)if(V(t)||G(t)||257===t.kind)return t},e.isParameterPropertyDeclaration=function(t,r){return e.hasSyntacticModifier(t,16476)&&170===r.kind},e.isEmptyBindingPattern=l,e.isEmptyBindingElement=u,e.walkUpBindingElementsAndPatterns=_,e.getCombinedModifierFlags=function(t){return d(t,e.getEffectiveModifierFlags)},e.getCombinedNodeFlagsAlwaysIncludeJSDoc=function(t){return d(t,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc)},e.getCombinedNodeFlags=function(e){return d(e,(function(e){return e.flags}))},e.supportedLocaleDirectories=["cs","de","es","fr","it","ja","ko","pl","pt-br","ru","tr","zh-cn","zh-tw"],e.validateLocaleAndSetLanguage=function(t,r,n){var i=t.toLowerCase(),a=/^([a-z]+)([_\-]([a-z]+))?$/.exec(i);if(a){var o=a[1],s=a[3];e.contains(e.supportedLocaleDirectories,i)&&!c(o,s,n)&&c(o,void 0,n),e.setUILocale(t);}else n&&n.push(e.createCompilerDiagnostic(e.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1,"en","ja-jp"));function c(t,n,i){var a=e.normalizePath(r.getExecutingFilePath()),o=e.getDirectoryPath(a),s=e.combinePaths(o,t);if(n&&(s=s+"-"+n),s=r.resolvePath(e.combinePaths(s,"diagnosticMessages.generated.json")),!r.fileExists(s))return !1;var c="";try{c=r.readFile(s);}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Unable_to_open_file_0,s)),!1}try{e.setLocalizedDiagnosticMessages(JSON.parse(c));}catch(t){return i&&i.push(e.createCompilerDiagnostic(e.Diagnostics.Corrupted_locale_file_0,s)),!1}return !0}},e.getOriginalNode=function(e,t){if(e)for(;void 0!==e.original;)e=e.original;return !t||t(e)?e:void 0},e.findAncestor=function(e,t){for(;e;){var r=t(e);if("quit"===r)return;if(r)return e;e=e.parent;}},e.isParseTreeNode=p,e.getParseTreeNode=function(e,t){if(void 0===e||p(e))return e;for(e=e.original;e;){if(p(e))return !t||t(e)?e:void 0;e=e.original;}},e.escapeLeadingUnderscores=function(e){return e.length>=2&&95===e.charCodeAt(0)&&95===e.charCodeAt(1)?"_"+e:e},e.unescapeLeadingUnderscores=f,e.idText=g,e.symbolName=function(e){return e.valueDeclaration&&z(e.valueDeclaration)?g(e.valueDeclaration.name):f(e.escapedName)},e.nodeHasName=function t(r,n){return !(!h(r)||!e.isIdentifier(r.name)||g(r.name)!==g(n))||!(!e.isVariableStatement(r)||!e.some(r.declarationList.declarations,(function(e){return t(e,n)})))},e.getNameOfJSDocTypedef=v,e.isNamedDeclaration=h,e.getNonAssignedNameOfDeclaration=b,e.getNameOfDeclaration=x,e.getAssignedName=D,e.getJSDocParameterTags=T,e.getJSDocParameterTagsNoCache=function(e){return S(e,!0)},e.getJSDocTypeParameterTags=function(e){return C(e,!1)},e.getJSDocTypeParameterTagsNoCache=function(e){return C(e,!0)},e.hasJSDocParameterTags=function(t){return !!P(t,e.isJSDocParameterTag)},e.getJSDocAugmentsTag=function(t){return P(t,e.isJSDocAugmentsTag)},e.getJSDocImplementsTags=function(t){return w(t,e.isJSDocImplementsTag)},e.getJSDocClassTag=function(t){return P(t,e.isJSDocClassTag)},e.getJSDocPublicTag=function(t){return P(t,e.isJSDocPublicTag)},e.getJSDocPublicTagNoCache=function(t){return P(t,e.isJSDocPublicTag,!0)},e.getJSDocPrivateTag=function(t){return P(t,e.isJSDocPrivateTag)},e.getJSDocPrivateTagNoCache=function(t){return P(t,e.isJSDocPrivateTag,!0)},e.getJSDocProtectedTag=function(t){return P(t,e.isJSDocProtectedTag)},e.getJSDocProtectedTagNoCache=function(t){return P(t,e.isJSDocProtectedTag,!0)},e.getJSDocReadonlyTag=function(t){return P(t,e.isJSDocReadonlyTag)},e.getJSDocReadonlyTagNoCache=function(t){return P(t,e.isJSDocReadonlyTag,!0)},e.getJSDocOverrideTagNoCache=function(t){return P(t,e.isJSDocOverrideTag,!0)},e.getJSDocDeprecatedTag=function(t){return P(t,e.isJSDocDeprecatedTag)},e.getJSDocDeprecatedTagNoCache=function(t){return P(t,e.isJSDocDeprecatedTag,!0)},e.getJSDocEnumTag=function(t){return P(t,e.isJSDocEnumTag)},e.getJSDocThisTag=function(t){return P(t,e.isJSDocThisTag)},e.getJSDocReturnTag=E,e.getJSDocTemplateTag=function(t){return P(t,e.isJSDocTemplateTag)},e.getJSDocTypeTag=k,e.getJSDocType=N,e.getJSDocReturnType=function(t){var r=E(t);if(r&&r.typeExpression)return r.typeExpression.type;var n=k(t);if(n&&n.typeExpression){var i=n.typeExpression.type;if(e.isTypeLiteralNode(i)){var a=e.find(i.members,e.isCallSignatureDeclaration);return a&&a.type}if(e.isFunctionTypeNode(i)||e.isJSDocFunctionType(i))return i.type}},e.getJSDocTags=A,e.getJSDocTagsNoCache=function(e){return F(e,!0)},e.getAllJSDocTags=w,e.getAllJSDocTagsOfKind=function(e,t){return A(e).filter((function(e){return e.kind===t}))},e.getTextOfJSDocComment=function(t){return "string"==typeof t?t:null==t?void 0:t.map((function(t){return 319===t.kind?t.text:"{@link ".concat(t.name?e.entityNameToString(t.name)+" ":"").concat(t.text,"}")})).join("")},e.getEffectiveTypeParameterDeclarations=function(t){if(e.isJSDocSignature(t))return e.emptyArray;if(e.isJSDocTypeAlias(t))return e.Debug.assert(318===t.parent.kind),e.flatMap(t.parent.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}));if(t.typeParameters)return t.typeParameters;if(e.isInJSFile(t)){var r=e.getJSDocTypeParameterDeclarations(t);if(r.length)return r;var n=N(t);if(n&&e.isFunctionTypeNode(n)&&n.typeParameters)return n.typeParameters}return e.emptyArray},e.getEffectiveConstraintOfTypeParameter=function(t){return t.constraint?t.constraint:e.isJSDocTemplateTag(t.parent)&&t===t.parent.typeParameters[0]?t.parent.constraint:void 0},e.isMemberName=function(e){return 79===e.kind||80===e.kind},e.isGetOrSetAccessorDeclaration=function(e){return 172===e.kind||171===e.kind},e.isPropertyAccessChain=function(t){return e.isPropertyAccessExpression(t)&&!!(32&t.flags)},e.isElementAccessChain=function(t){return e.isElementAccessExpression(t)&&!!(32&t.flags)},e.isCallChain=function(t){return e.isCallExpression(t)&&!!(32&t.flags)},e.isOptionalChain=I,e.isOptionalChainRoot=O,e.isExpressionOfOptionalChainRoot=function(e){return O(e.parent)&&e.parent.expression===e},e.isOutermostOptionalChain=function(e){return !I(e.parent)||O(e.parent)||e!==e.parent.expression},e.isNullishCoalesce=function(e){return 220===e.kind&&60===e.operatorToken.kind},e.isConstTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"const"===t.typeName.escapedText&&!t.typeArguments},e.skipPartiallyEmittedExpressions=M,e.isNonNullChain=function(t){return e.isNonNullExpression(t)&&!!(32&t.flags)},e.isBreakOrContinueStatement=function(e){return 245===e.kind||244===e.kind},e.isNamedExportBindings=function(e){return 273===e.kind||272===e.kind},e.isUnparsedTextLike=L,e.isUnparsedNode=function(e){return L(e)||298===e.kind||302===e.kind},e.isJSDocPropertyLikeTag=function(e){return 345===e.kind||338===e.kind},e.isNode=function(e){return R(e.kind)},e.isNodeKind=R,e.isTokenKind=B,e.isToken=function(e){return B(e.kind)},e.isNodeArray=function(e){return e.hasOwnProperty("pos")&&e.hasOwnProperty("end")},e.isLiteralKind=j,e.isLiteralExpression=function(e){return j(e.kind)},e.isTemplateLiteralKind=J,e.isTemplateLiteralToken=function(e){return J(e.kind)},e.isTemplateMiddleOrTemplateTail=function(e){var t=e.kind;return 16===t||17===t},e.isImportOrExportSpecifier=function(t){return e.isImportSpecifier(t)||e.isExportSpecifier(t)},e.isTypeOnlyImportOrExportDeclaration=function(e){switch(e.kind){case 269:case 274:return e.isTypeOnly||e.parent.parent.isTypeOnly;case 267:return e.parent.isTypeOnly;case 266:case 264:return e.isTypeOnly;default:return !1}},e.isAssertionKey=function(t){return e.isStringLiteral(t)||e.isIdentifier(t)},e.isStringTextContainingNode=function(e){return 10===e.kind||J(e.kind)},e.isGeneratedIdentifier=function(t){return e.isIdentifier(t)&&(7&t.autoGenerateFlags)>0},e.isPrivateIdentifierClassElementDeclaration=z,e.isPrivateIdentifierPropertyAccessExpression=function(t){return e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name)},e.isModifierKind=U,e.isParameterPropertyModifier=K,e.isClassMemberModifier=function(e){return K(e)||124===e||158===e},e.isModifier=function(e){return U(e.kind)},e.isEntityName=function(e){var t=e.kind;return 160===t||79===t},e.isPropertyName=function(e){var t=e.kind;return 79===t||80===t||10===t||8===t||161===t},e.isBindingName=function(e){var t=e.kind;return 79===t||200===t||201===t},e.isFunctionLike=V,e.isFunctionLikeOrClassStaticBlockDeclaration=function(t){return !!t&&(W(t.kind)||e.isClassStaticBlockDeclaration(t))},e.isFunctionLikeDeclaration=function(e){return e&&q(e.kind)},e.isBooleanLiteral=function(e){return 110===e.kind||95===e.kind},e.isFunctionLikeKind=W,e.isFunctionOrModuleBlock=function(t){return e.isSourceFile(t)||e.isModuleBlock(t)||e.isBlock(t)&&V(t.parent)},e.isClassElement=H,e.isClassLike=G,e.isAccessor=function(e){return e&&(171===e.kind||172===e.kind)},e.isMethodOrAccessor=Q,e.isTypeElement=X,e.isClassOrTypeElement=function(e){return X(e)||H(e)},e.isObjectLiteralElementLike=Y,e.isTypeNode=function(t){return e.isTypeNodeKind(t.kind)},e.isFunctionOrConstructorTypeNode=function(e){switch(e.kind){case 178:case 179:return !0}return !1},e.isBindingPattern=Z,e.isAssignmentPattern=function(e){var t=e.kind;return 203===t||204===t},e.isArrayBindingElement=function(e){var t=e.kind;return 202===t||226===t},e.isDeclarationBindingElement=function(e){switch(e.kind){case 253:case 163:case 202:return !0}return !1},e.isBindingOrAssignmentPattern=function(e){return $(e)||ee(e)},e.isObjectBindingOrAssignmentPattern=$,e.isObjectBindingOrAssignmentElement=function(e){switch(e.kind){case 202:case 294:case 295:case 296:return !0}return !1},e.isArrayBindingOrAssignmentPattern=ee,e.isPropertyAccessOrQualifiedNameOrImportTypeNode=function(e){var t=e.kind;return 205===t||160===t||199===t},e.isPropertyAccessOrQualifiedName=function(e){var t=e.kind;return 205===t||160===t},e.isCallLikeExpression=function(e){switch(e.kind){case 279:case 278:case 207:case 208:case 209:case 164:return !0;default:return !1}},e.isCallOrNewExpression=function(e){return 207===e.kind||208===e.kind},e.isTemplateLiteral=function(e){var t=e.kind;return 222===t||14===t},e.isLeftHandSideExpression=function(e){return te(M(e).kind)},e.isUnaryExpression=function(e){return re(M(e).kind)},e.isUnaryExpressionWithWrite=function(e){switch(e.kind){case 219:return !0;case 218:return 45===e.operator||46===e.operator;default:return !1}},e.isExpression=ne,e.isAssertionExpression=function(e){var t=e.kind;return 210===t||228===t},e.isNotEmittedOrPartiallyEmittedNode=function(t){return e.isNotEmittedStatement(t)||e.isPartiallyEmittedExpression(t)},e.isIterationStatement=function e(t,r){switch(t.kind){case 241:case 242:case 243:case 239:case 240:return !0;case 249:return r&&e(t.statement,r)}return !1},e.isScopeMarker=ie,e.hasScopeMarker=function(t){return e.some(t,ie)},e.needsScopeMarker=function(t){return !(e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)||e.isAmbientModule(t))},e.isExternalModuleIndicator=function(t){return e.isAnyImportOrReExport(t)||e.isExportAssignment(t)||e.hasSyntacticModifier(t,1)},e.isForInOrOfStatement=function(e){return 242===e.kind||243===e.kind},e.isConciseBody=function(t){return e.isBlock(t)||ne(t)},e.isFunctionBody=function(t){return e.isBlock(t)},e.isForInitializer=function(t){return e.isVariableDeclarationList(t)||ne(t)},e.isModuleBody=function(e){var t=e.kind;return 261===t||260===t||79===t},e.isNamespaceBody=function(e){var t=e.kind;return 261===t||260===t},e.isJSDocNamespaceBody=function(e){var t=e.kind;return 79===t||260===t},e.isNamedImportBindings=function(e){var t=e.kind;return 268===t||267===t},e.isModuleOrEnumDeclaration=function(e){return 260===e.kind||259===e.kind},e.isDeclaration=se,e.isDeclarationStatement=function(e){return ae(e.kind)},e.isStatementButNotDeclaration=function(e){return oe(e.kind)},e.isStatement=function(t){var r=t.kind;return oe(r)||ae(r)||function(t){return 234===t.kind&&((void 0===t.parent||251!==t.parent.kind&&291!==t.parent.kind)&&!e.isFunctionBlock(t))}(t)},e.isStatementOrBlock=function(e){var t=e.kind;return oe(t)||ae(t)||234===t},e.isModuleReference=function(e){var t=e.kind;return 276===t||160===t||79===t},e.isJsxTagNameExpression=function(e){var t=e.kind;return 108===t||79===t||205===t},e.isJsxChild=function(e){var t=e.kind;return 277===t||287===t||278===t||11===t||281===t},e.isJsxAttributeLike=function(e){var t=e.kind;return 284===t||286===t},e.isStringLiteralOrJsxExpression=function(e){var t=e.kind;return 10===t||287===t},e.isJsxOpeningLikeElement=function(e){var t=e.kind;return 279===t||278===t},e.isCaseOrDefaultClause=function(e){var t=e.kind;return 288===t||289===t},e.isJSDocNode=function(e){return e.kind>=307&&e.kind<=345},e.isJSDocCommentContainingNode=function(t){return 318===t.kind||317===t.kind||319===t.kind||ue(t)||ce(t)||e.isJSDocTypeLiteral(t)||e.isJSDocSignature(t)},e.isJSDocTag=ce,e.isSetAccessor=function(e){return 172===e.kind},e.isGetAccessor=function(e){return 171===e.kind},e.hasJSDocNodes=function(e){var t=e.jsDoc;return !!t&&t.length>0},e.hasType=function(e){return !!e.type},e.hasInitializer=function(e){return !!e.initializer},e.hasOnlyExpressionInitializer=function(e){switch(e.kind){case 253:case 163:case 202:case 165:case 166:case 294:case 297:return !0;default:return !1}},e.isObjectLiteralElement=function(e){return 284===e.kind||286===e.kind||Y(e)},e.isTypeReferenceType=function(e){return 177===e.kind||227===e.kind};var le=1073741823;function ue(e){return 322===e.kind||323===e.kind||324===e.kind}e.guessIndentation=function(t){for(var r=le,n=0,i=t;n<i.length;n++){var a=i[n];if(a.length){for(var o=0;o<a.length&&o<r&&e.isWhiteSpaceLike(a.charCodeAt(o));o++);if(o<r&&(r=o),0===r)return 0}}return r===le?void 0:r},e.isStringLiteralLike=function(e){return 10===e.kind||14===e.kind},e.isJSDocLinkLike=ue;}(t),function(e){e.resolvingEmptyArray=[],e.externalHelpersModuleNameText="tslib",e.defaultMaximumTruncationLength=160,e.noTruncationMaximumTruncationLength=1e6,e.getDeclarationOfKind=function(e,t){var r=e.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(a.kind===t)return a}},e.createUnderscoreEscapedMap=function(){return new e.Map},e.hasEntries=function(e){return !!e&&!!e.size},e.createSymbolTable=function(t){var r=new e.Map;if(t)for(var n=0,i=t;n<i.length;n++){var a=i[n];r.set(a.escapedName,a);}return r},e.isTransientSymbol=function(e){return 0!=(33554432&e.flags)};var t,r,a,o=(t="",{getText:function(){return t},write:r=function(e){return t+=e},rawWrite:r,writeKeyword:r,writeOperator:r,writePunctuation:r,writeSpace:r,writeStringLiteral:r,writeLiteral:r,writeParameter:r,writeProperty:r,writeSymbol:function(e,t){return r(e)},writeTrailingSemicolon:r,writeComment:r,getTextPos:function(){return t.length},getLine:function(){return 0},getColumn:function(){return 0},getIndent:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingComment:function(){return !1},hasTrailingWhitespace:function(){return !!t.length&&e.isWhiteSpaceLike(t.charCodeAt(t.length-1))},writeLine:function(){return t+=" "},increaseIndent:e.noop,decreaseIndent:e.noop,clear:function(){return t=""},trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop});function s(t,r){return c(t,r,e.moduleResolutionOptionDeclarations)}function c(e,t,r){return e!==t&&r.some((function(r){return !di(An(e,r),An(t,r))}))}function l(e){return e.end-e.pos}function u(e){for(;e&&303!==e.kind;)e=e.parent;return e}function _(t,r){e.Debug.assert(t>=0);var n=e.getLineStarts(r),i=t,a=r.text;if(i+1===n.length)return a.length-1;var o=n[i],s=n[i+1]-1;for(e.Debug.assert(e.isLineBreak(a.charCodeAt(s)));o<=s&&e.isLineBreak(a.charCodeAt(s));)s--;return s}function d(e){return void 0===e||e.pos===e.end&&e.pos>=0&&1!==e.kind}function p(e){return !d(e)}function f(e,t,r){if(void 0===t||0===t.length)return e;for(var i=0;i<e.length&&r(e[i]);++i);return e.splice.apply(e,n$3([i,0],t,!1)),e}function g(e,t,r){if(void 0===t)return e;for(var n=0;n<e.length&&r(e[n]);++n);return e.splice(n,0,t),e}function m(e){return G(e)||!!(1048576&S(e))}function y(e,t){return 42===e.charCodeAt(t+1)&&33===e.charCodeAt(t+2)}function v(t,r,n){return d(t)?t.pos:e.isJSDocNode(t)||11===t.kind?e.skipTrivia((r||u(t)).text,t.pos,!1,!0):n&&e.hasJSDocNodes(t)?v(t.jsDoc[0],r):346===t.kind&&t._children.length>0?v(t._children[0],r,n):e.skipTrivia((r||u(t)).text,t.pos,!1,!1,De(t))}function h(e,t,r){return void 0===r&&(r=!1),b(e.text,t,r)}function b(t,r,n){if(void 0===n&&(n=!1),d(r))return "";var i=t.substring(n?r.pos:e.skipTrivia(t,r.pos),r.end);return function(t){return !!e.findAncestor(t,e.isJSDocTypeExpression)}(r)&&(i=i.split(/\r\n|\n|\r/).map((function(t){return e.trimStringStart(t.replace(/^\s*\*/,""))})).join("\n")),i}function x(e,t){return void 0===t&&(t=!1),h(u(e),e,t)}function D(e){return e.pos}function S(e){var t=e.emitNode;return t&&t.flags||0}function T(e){var t=Nt(e);return 253===t.kind&&291===t.parent.kind}function C(t){return e.isModuleDeclaration(t)&&(10===t.name.kind||k(t))}function E(t){return e.isModuleDeclaration(t)||e.isIdentifier(t)}function k(e){return !!(1024&e.flags)}function N(e){return C(e)&&F(e)}function F(t){switch(t.parent.kind){case 303:return e.isExternalModule(t.parent);case 261:return C(t.parent.parent)&&e.isSourceFile(t.parent.parent.parent)&&!e.isExternalModule(t.parent.parent.parent)}return !1}function A(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find((function(t){return !(N(t)||e.isModuleDeclaration(t)&&k(t))}))}function P(t,r){switch(t.kind){case 303:case 262:case 291:case 260:case 241:case 242:case 243:case 170:case 168:case 171:case 172:case 255:case 212:case 213:case 166:case 169:return !0;case 234:return !e.isFunctionLikeOrClassStaticBlockDeclaration(r)}return !1}function w(t){switch(t.kind){case 173:case 174:case 167:case 175:case 178:case 179:case 315:case 256:case 225:case 257:case 258:case 342:case 255:case 168:case 170:case 171:case 172:case 212:case 213:return !0;default:return e.assertType(t),!1}}function I(e){switch(e.kind){case 265:case 264:return !0;default:return !1}}function O(t){return I(t)||e.isExportDeclaration(t)}function M(t){return e.findAncestor(t.parent,(function(e){return P(e,e.parent)}))}function L(e){return e&&0!==l(e)?x(e):"(Missing)"}function R(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:case 14:return e.escapeLeadingUnderscores(t.text);case 161:return xt(t.expression)?e.escapeLeadingUnderscores(t.expression.text):e.Debug.fail("Text of property name cannot be read from non-literal-valued ComputedPropertyNames");default:return e.Debug.assertNever(t)}}function B(t){switch(t.kind){case 108:return "this";case 80:case 79:return 0===l(t)?e.idText(t):x(t);case 160:return B(t.left)+"."+B(t.right);case 205:return e.isIdentifier(t.name)||e.isPrivateIdentifier(t.name)?B(t.expression)+"."+B(t.name):e.Debug.assertNever(t.name);case 309:return B(t.left)+B(t.right);default:return e.Debug.assertNever(t)}}function j(e,t,r,n,i,a,o){var s=K(e,t);return vn(e,s.start,s.length,r,n,i,a,o)}function J(t,r,n){e.Debug.assertGreaterThanOrEqual(r,0),e.Debug.assertGreaterThanOrEqual(n,0),t&&(e.Debug.assertLessThanOrEqual(r,t.text.length),e.Debug.assertLessThanOrEqual(r+n,t.text.length));}function z(e,t,r,n,i){return J(e,t,r),{file:e,start:t,length:r,code:n.code,category:n.category,messageText:n.next?n:n.messageText,relatedInformation:i}}function U(t,r){var n=e.createScanner(t.languageVersion,!0,t.languageVariant,t.text,void 0,r);n.scan();var i=n.getTokenPos();return e.createTextSpanFromBounds(i,n.getTextPos())}function K(t,r){var n=r;switch(r.kind){case 303:var i=e.skipTrivia(t.text,0,!1);return i===t.text.length?e.createTextSpan(0,0):U(t,i);case 253:case 202:case 256:case 225:case 257:case 260:case 259:case 297:case 255:case 212:case 168:case 171:case 172:case 258:case 166:case 165:case 267:n=r.name;break;case 213:return function(t,r){var n=e.skipTrivia(t.text,r.pos);if(r.body&&234===r.body.kind){var i=e.getLineAndCharacterOfPosition(t,r.body.pos).line;if(i<e.getLineAndCharacterOfPosition(t,r.body.end).line)return e.createTextSpan(n,_(i,t)-n+1)}return e.createTextSpanFromBounds(n,r.end)}(t,r);case 288:case 289:var a=e.skipTrivia(t.text,r.pos),o=r.statements.length>0?r.statements[0].pos:r.end;return e.createTextSpanFromBounds(a,o)}if(void 0===n)return U(t,r.pos);e.Debug.assert(!e.isJSDoc(n));var s=d(n),c=s||e.isJsxText(r)?n.pos:e.skipTrivia(t.text,n.pos);return s?(e.Debug.assert(c===n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c===n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")):(e.Debug.assert(c>=n.pos,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"),e.Debug.assert(c<=n.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809")),e.createTextSpanFromBounds(c,n.end)}function V(e){return 6===e.scriptKind}function q(t){return !!(2&e.getCombinedNodeFlags(t))}function W(e){return 207===e.kind&&100===e.expression.kind}function H(t){return e.isImportTypeNode(t)&&e.isLiteralTypeNode(t.argument)&&e.isStringLiteral(t.argument.literal)}function G(e){return 237===e.kind&&10===e.expression.kind}function Q(e){return !!(1048576&S(e))}function X(t){return e.isIdentifier(t.name)&&!t.initializer}e.changesAffectModuleResolution=function(e,t){return e.configFilePath!==t.configFilePath||s(e,t)},e.optionsHaveModuleResolutionChanges=s,e.changesAffectingProgramStructure=function(t,r){return c(t,r,e.optionsAffectingProgramStructure)},e.optionsHaveChanges=c,e.forEachAncestor=function(t,r){for(;;){var n=r(t);if("quit"===n)return;if(void 0!==n)return n;if(e.isSourceFile(t))return;t=t.parent;}},e.forEachEntry=function(e,t){for(var r=e.entries(),n=r.next();!n.done;n=r.next()){var i=n.value,a=i[0],o=t(i[1],a);if(o)return o}},e.forEachKey=function(e,t){for(var r=e.keys(),n=r.next();!n.done;n=r.next()){var i=t(n.value);if(i)return i}},e.copyEntries=function(e,t){e.forEach((function(e,r){t.set(r,e);}));},e.usingSingleLineStringWriter=function(e){var t=o.getText();try{return e(o),o.getText()}finally{o.clear(),o.writeKeyword(t);}},e.getFullWidth=l,e.getResolvedModule=function(e,t,r){return e&&e.resolvedModules&&e.resolvedModules.get(t,r)},e.setResolvedModule=function(t,r,n,i){t.resolvedModules||(t.resolvedModules=e.createModeAwareCache()),t.resolvedModules.set(r,i,n);},e.setResolvedTypeReferenceDirective=function(t,r,n){t.resolvedTypeReferenceDirectiveNames||(t.resolvedTypeReferenceDirectiveNames=e.createModeAwareCache()),t.resolvedTypeReferenceDirectiveNames.set(r,void 0,n);},e.projectReferenceIsEqualTo=function(e,t){return e.path===t.path&&!e.prepend==!t.prepend&&!e.circular==!t.circular},e.moduleResolutionIsEqualTo=function(e,t){return e.isExternalLibraryImport===t.isExternalLibraryImport&&e.extension===t.extension&&e.resolvedFileName===t.resolvedFileName&&e.originalPath===t.originalPath&&((r=e.packageId)===(n=t.packageId)||!!r&&!!n&&r.name===n.name&&r.subModuleName===n.subModuleName&&r.version===n.version);var r,n;},e.packageIdToString=function(e){var t=e.name,r=e.subModuleName,n=e.version,i=r?"".concat(t,"/").concat(r):t;return "".concat(i,"@").concat(n)},e.typeDirectiveIsEqualTo=function(e,t){return e.resolvedFileName===t.resolvedFileName&&e.primary===t.primary&&e.originalPath===t.originalPath},e.hasChangesInResolutions=function(t,r,n,i,a){e.Debug.assert(t.length===r.length);for(var o=0;o<t.length;o++){var s=r[o],c=n&&n.get(t[o],i&&e.getModeForResolutionAtIndex(i,o));if(c?!s||!a(c,s):s)return !0}return !1},e.containsParseError=function t(r){return function(r){524288&r.flags||((0!=(65536&r.flags)||e.forEachChild(r,t))&&(r.flags|=262144),r.flags|=524288);}(r),0!=(262144&r.flags)},e.getSourceFileOfNode=u,e.getSourceFileOfModule=function(e){return u(e.valueDeclaration||A(e))},e.isStatementWithLocals=function(e){switch(e.kind){case 234:case 262:case 241:case 242:case 243:return !0}return !1},e.getStartPositionOfLine=function(t,r){return e.Debug.assert(t>=0),e.getLineStarts(r)[t]},e.nodePosToString=function(t){var r=u(t),n=e.getLineAndCharacterOfPosition(r,t.pos);return "".concat(r.fileName,"(").concat(n.line+1,",").concat(n.character+1,")")},e.getEndLinePosition=_,e.isFileLevelUniqueName=function(e,t,r){return !(r&&r(t)||e.identifiers.has(t))},e.nodeIsMissing=d,e.nodeIsPresent=p,e.insertStatementsAfterStandardPrologue=function(e,t){return f(e,t,G)},e.insertStatementsAfterCustomPrologue=function(e,t){return f(e,t,m)},e.insertStatementAfterStandardPrologue=function(e,t){return g(e,t,G)},e.insertStatementAfterCustomPrologue=function(e,t){return g(e,t,m)},e.isRecognizedTripleSlashComment=function(t,r,n){if(47===t.charCodeAt(r+1)&&r+2<n&&47===t.charCodeAt(r+2)){var i=t.substring(r,n);return !!(e.fullTripleSlashReferencePathRegEx.test(i)||e.fullTripleSlashAMDReferencePathRegEx.test(i)||Y.test(i)||re.test(i))}return !1},e.isPinnedComment=y,e.createCommentDirectivesMap=function(t,r){var n=new e.Map(r.map((function(r){return ["".concat(e.getLineAndCharacterOfPosition(t,r.range.end).line),r]}))),i=new e.Map;return {getUnusedExpectations:function(){return e.arrayFrom(n.entries()).filter((function(e){var t=e[0];return 0===e[1].type&&!i.get(t)})).map((function(e){return e[1]}))},markUsed:function(e){return !!n.has("".concat(e))&&(i.set("".concat(e),!0),!0)}}},e.getTokenPosOfNode=v,e.getNonDecoratorTokenPosOfNode=function(t,r){return d(t)||!t.decorators?v(t,r):e.skipTrivia((r||u(t)).text,t.decorators.end)},e.getSourceTextOfNodeFromSourceFile=h,e.isExportNamespaceAsDefaultDeclaration=function(t){return !!(e.isExportDeclaration(t)&&t.exportClause&&e.isNamespaceExport(t.exportClause)&&"default"===t.exportClause.name.escapedText)},e.getTextOfNodeFromSourceText=b,e.getTextOfNode=x,e.indexOfNode=function(t,r){return e.binarySearch(t,r,D,e.compareValues)},e.getEmitFlags=S,e.getScriptTargetFeatures=function(){return {es2015:{Array:["find","findIndex","fill","copyWithin","entries","keys","values"],RegExp:["flags","sticky","unicode"],Reflect:["apply","construct","defineProperty","deleteProperty","get"," getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"],ArrayConstructor:["from","of"],ObjectConstructor:["assign","getOwnPropertySymbols","keys","is","setPrototypeOf"],NumberConstructor:["isFinite","isInteger","isNaN","isSafeInteger","parseFloat","parseInt"],Math:["clz32","imul","sign","log10","log2","log1p","expm1","cosh","sinh","tanh","acosh","asinh","atanh","hypot","trunc","fround","cbrt"],Map:["entries","keys","values"],Set:["entries","keys","values"],Promise:e.emptyArray,PromiseConstructor:["all","race","reject","resolve"],Symbol:["for","keyFor"],WeakMap:["entries","keys","values"],WeakSet:["entries","keys","values"],Iterator:e.emptyArray,AsyncIterator:e.emptyArray,String:["codePointAt","includes","endsWith","normalize","repeat","startsWith","anchor","big","blink","bold","fixed","fontcolor","fontsize","italics","link","small","strike","sub","sup"],StringConstructor:["fromCodePoint","raw"]},es2016:{Array:["includes"]},es2017:{Atomics:e.emptyArray,SharedArrayBuffer:e.emptyArray,String:["padStart","padEnd"],ObjectConstructor:["values","entries","getOwnPropertyDescriptors"],DateTimeFormat:["formatToParts"]},es2018:{Promise:["finally"],RegExpMatchArray:["groups"],RegExpExecArray:["groups"],RegExp:["dotAll"],Intl:["PluralRules"],AsyncIterable:e.emptyArray,AsyncIterableIterator:e.emptyArray,AsyncGenerator:e.emptyArray,AsyncGeneratorFunction:e.emptyArray},es2019:{Array:["flat","flatMap"],ObjectConstructor:["fromEntries"],String:["trimStart","trimEnd","trimLeft","trimRight"],Symbol:["description"]},es2020:{BigInt:e.emptyArray,BigInt64Array:e.emptyArray,BigUint64Array:e.emptyArray,PromiseConstructor:["allSettled"],SymbolConstructor:["matchAll"],String:["matchAll"],DataView:["setBigInt64","setBigUint64","getBigInt64","getBigUint64"],RelativeTimeFormat:["format","formatToParts","resolvedOptions"]},es2021:{PromiseConstructor:["any"],String:["replaceAll"]},esnext:{NumberFormat:["formatToParts"]}}},(a=e.GetLiteralTextFlags||(e.GetLiteralTextFlags={}))[a.None=0]="None",a[a.NeverAsciiEscape=1]="NeverAsciiEscape",a[a.JsxAttributeEscape=2]="JsxAttributeEscape",a[a.TerminateUnterminatedLiterals=4]="TerminateUnterminatedLiterals",a[a.AllowNumericSeparator=8]="AllowNumericSeparator",e.getLiteralText=function(t,r,n){var i;if(function(t,r){return !(Ft(t)||!t.parent||4&r&&t.isUnterminated)&&(e.isNumericLiteral(t)&&512&t.numericLiteralFlags?!!(8&r):!e.isBigIntLiteral(t))}(t,n))return h(r,t);switch(t.kind){case 10:var a=2&n?Gt:1&n||16777216&S(t)?zt:Kt;return t.singleQuote?"'"+a(t.text,39)+"'":'"'+a(t.text,34)+'"';case 14:case 15:case 16:case 17:a=1&n||16777216&S(t)?zt:Kt;var o=null!==(i=t.rawText)&&void 0!==i?i:function(e){return e.replace(Ot,"\\${")}(a(t.text,96));switch(t.kind){case 14:return "`"+o+"`";case 15:return "`"+o+"${";case 16:return "}"+o+"${";case 17:return "}"+o+"`"}break;case 8:case 9:return t.text;case 13:return 4&n&&t.isUnterminated?t.text+(92===t.text.charCodeAt(t.text.length-1)?" /":"/"):t.text}return e.Debug.fail("Literal kind '".concat(t.kind,"' not accounted for."))},e.getTextOfConstantValue=function(t){return e.isString(t)?'"'+Kt(t)+'"':""+t},e.makeIdentifierFromModuleName=function(t){return e.getBaseFileName(t).replace(/^(\d)/,"_$1").replace(/\W/g,"_")},e.isBlockOrCatchScoped=function(t){return 0!=(3&e.getCombinedNodeFlags(t))||T(t)},e.isCatchClauseVariableDeclarationOrBindingElement=T,e.isAmbientModule=C,e.isModuleWithStringLiteralName=function(t){return e.isModuleDeclaration(t)&&10===t.name.kind},e.isNonGlobalAmbientModule=function(t){return e.isModuleDeclaration(t)&&e.isStringLiteral(t.name)},e.isEffectiveModuleDeclaration=E,e.isShorthandAmbientModuleSymbol=function(e){return !!(t=e.valueDeclaration)&&260===t.kind&&!t.body;var t;},e.isBlockScopedContainerTopLevel=function(t){return 303===t.kind||260===t.kind||e.isFunctionLikeOrClassStaticBlockDeclaration(t)},e.isGlobalScopeAugmentation=k,e.isExternalModuleAugmentation=N,e.isModuleAugmentationExternal=F,e.getNonAugmentationDeclaration=A,e.isEffectiveExternalModule=function(t,r){return e.isExternalModule(t)||r.isolatedModules||((n=Cn(r))===e.ModuleKind.CommonJS||n===e.ModuleKind.Node12||n===e.ModuleKind.NodeNext)&&!!t.commonJsModuleIndicator;var n;},e.isEffectiveStrictModeSourceFile=function(t,r){switch(t.scriptKind){case 1:case 3:case 2:case 4:break;default:return !1}return !(t.isDeclarationFile||!Nn(r,"alwaysStrict")&&!e.startsWithUseStrict(t.statements)&&(!e.isExternalModule(t)&&!r.isolatedModules||!(Cn(r)>=e.ModuleKind.ES2015)&&r.noImplicitUseStrict))},e.isBlockScope=P,e.isDeclarationWithTypeParameters=function(t){switch(t.kind){case 336:case 343:case 321:return !0;default:return e.assertType(t),w(t)}},e.isDeclarationWithTypeParameterChildren=w,e.isAnyImportSyntax=I,e.isLateVisibilityPaintedStatement=function(e){switch(e.kind){case 265:case 264:case 236:case 256:case 255:case 260:case 258:case 257:case 259:return !0;default:return !1}},e.hasPossibleExternalModuleReference=function(t){return O(t)||e.isModuleDeclaration(t)||e.isImportTypeNode(t)||W(t)},e.isAnyImportOrReExport=O,e.getEnclosingBlockScopeContainer=M,e.forEachEnclosingBlockScopeContainer=function(e,t){for(var r=M(e);r;)t(r),r=M(r);},e.declarationNameToString=L,e.getNameFromIndexInfo=function(e){return e.declaration?L(e.declaration.parameters[0].name):void 0},e.isComputedNonLiteralName=function(e){return 161===e.kind&&!xt(e.expression)},e.getTextOfPropertyName=R,e.entityNameToString=B,e.createDiagnosticForNode=function(e,t,r,n,i,a){return j(u(e),e,t,r,n,i,a)},e.createDiagnosticForNodeArray=function(t,r,n,i,a,o,s){var c=e.skipTrivia(t.text,r.pos);return vn(t,c,r.end-c,n,i,a,o,s)},e.createDiagnosticForNodeInSourceFile=j,e.createDiagnosticForNodeFromMessageChain=function(e,t,r){var n=u(e),i=K(n,e);return z(n,i.start,i.length,t,r)},e.createFileDiagnosticFromMessageChain=z,e.createDiagnosticForFileFromMessageChain=function(e,t,r){return {file:e,start:0,length:0,code:t.code,category:t.category,messageText:t.next?t:t.messageText,relatedInformation:r}},e.createDiagnosticForRange=function(e,t,r){return {file:e,start:t.pos,length:t.end-t.pos,code:r.code,category:r.category,messageText:r.message}},e.getSpanOfTokenAtPosition=U,e.getErrorSpanForNode=K,e.isExternalOrCommonJsModule=function(e){return void 0!==(e.externalModuleIndicator||e.commonJsModuleIndicator)},e.isJsonSourceFile=V,e.isEnumConst=function(t){return !!(2048&e.getCombinedModifierFlags(t))},e.isDeclarationReadonly=function(t){return !(!(64&e.getCombinedModifierFlags(t))||e.isParameterPropertyDeclaration(t,t.parent))},e.isVarConst=q,e.isLet=function(t){return !!(1&e.getCombinedNodeFlags(t))},e.isSuperCall=function(e){return 207===e.kind&&106===e.expression.kind},e.isImportCall=W,e.isImportMeta=function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText},e.isLiteralImportTypeNode=H,e.isPrologueDirective=G,e.isCustomPrologue=Q,e.isHoistedFunction=function(t){return Q(t)&&e.isFunctionDeclaration(t)},e.isHoistedVariableStatement=function(t){return Q(t)&&e.isVariableStatement(t)&&e.every(t.declarationList.declarations,X)},e.getLeadingCommentRangesOfNode=function(t,r){return 11!==t.kind?e.getLeadingCommentRanges(r.text,t.pos):void 0},e.getJSDocCommentRanges=function(t,r){var n=163===t.kind||162===t.kind||212===t.kind||213===t.kind||211===t.kind||253===t.kind?e.concatenate(e.getTrailingCommentRanges(r,t.pos),e.getLeadingCommentRanges(r,t.pos)):e.getLeadingCommentRanges(r,t.pos);return e.filter(n,(function(e){return 42===r.charCodeAt(e.pos+1)&&42===r.charCodeAt(e.pos+2)&&47!==r.charCodeAt(e.pos+3)}))},e.fullTripleSlashReferencePathRegEx=/^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var Y=/^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;e.fullTripleSlashAMDReferencePathRegEx=/^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;var Z,$,ee,te,re=/^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/;function ne(t){if(176<=t.kind&&t.kind<=199)return !0;switch(t.kind){case 130:case 154:case 146:case 157:case 149:case 133:case 150:case 147:case 152:case 143:return !0;case 114:return 216!==t.parent.kind;case 227:return !Jr(t);case 162:return 194===t.parent.kind||189===t.parent.kind;case 79:(160===t.parent.kind&&t.parent.right===t||205===t.parent.kind&&t.parent.name===t)&&(t=t.parent),e.Debug.assert(79===t.kind||160===t.kind||205===t.kind,"'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");case 160:case 205:case 108:var r=t.parent;if(180===r.kind)return !1;if(199===r.kind)return !r.isTypeOf;if(176<=r.kind&&r.kind<=199)return !0;switch(r.kind){case 227:return !Jr(r);case 162:case 342:return t===r.constraint;case 166:case 165:case 163:case 253:return t===r.type;case 255:case 212:case 213:case 170:case 168:case 167:case 171:case 172:return t===r.type;case 173:case 174:case 175:case 210:return t===r.type;case 207:case 208:return e.contains(r.typeArguments,t);case 209:return !1}}return !1}function ie(e){if(e)switch(e.kind){case 202:case 297:case 163:case 294:case 166:case 165:case 295:case 253:return !0}return !1}function ae(e){return 254===e.parent.kind&&236===e.parent.parent.kind}function oe(e,t,r){return e.properties.filter((function(e){if(294===e.kind){var n=R(e.name);return t===n||!!r&&r===n}return !1}))}function se(t){if(t&&t.statements.length){var r=t.statements[0].expression;return e.tryCast(r,e.isObjectLiteralExpression)}}function ce(t,r){var n=se(t);return n?oe(n,r):e.emptyArray}function le(t,r){for(e.Debug.assert(303!==t.kind);;){if(!(t=t.parent))return e.Debug.fail();switch(t.kind){case 161:if(e.isClassLike(t.parent.parent))return t;t=t.parent;break;case 164:163===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);break;case 213:if(!r)continue;case 255:case 212:case 260:case 169:case 166:case 165:case 168:case 167:case 170:case 171:case 172:case 173:case 174:case 175:case 259:case 303:return t}}}function ue(e){var t=e.kind;return (205===t||206===t)&&106===e.expression.kind}function _e(t,r,n){if(e.isNamedDeclaration(t)&&e.isPrivateIdentifier(t.name))return !1;switch(t.kind){case 256:return !0;case 166:return 256===r.kind;case 171:case 172:case 168:return void 0!==t.body&&256===r.kind;case 163:return void 0!==r.body&&(170===r.kind||168===r.kind||172===r.kind)&&256===n.kind}return !1}function de(e,t,r){return void 0!==e.decorators&&_e(e,t,r)}function pe(e,t,r){return de(e,t,r)||fe(e,t)}function fe(t,r){switch(t.kind){case 256:return e.some(t.members,(function(e){return pe(e,t,r)}));case 168:case 172:case 170:return e.some(t.parameters,(function(e){return de(e,t,r)}));default:return !1}}function ge(e){var t=e.parent;return (279===t.kind||278===t.kind||280===t.kind)&&t.tagName===e}function me(t){switch(t.kind){case 106:case 104:case 110:case 95:case 13:case 203:case 204:case 205:case 206:case 207:case 208:case 209:case 228:case 210:case 229:case 211:case 212:case 225:case 213:case 216:case 214:case 215:case 218:case 219:case 220:case 221:case 224:case 222:case 226:case 277:case 278:case 281:case 223:case 217:case 230:return !0;case 160:for(;160===t.parent.kind;)t=t.parent;return 180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 309:for(;e.isJSDocMemberName(t.parent);)t=t.parent;return 180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t);case 80:return e.isBinaryExpression(t.parent)&&t.parent.left===t&&101===t.parent.operatorToken.kind;case 79:if(180===t.parent.kind||e.isJSDocLinkLike(t.parent)||e.isJSDocNameReference(t.parent)||e.isJSDocMemberName(t.parent)||ge(t))return !0;case 8:case 9:case 10:case 14:case 108:return ye(t);default:return !1}}function ye(e){var t=e.parent;switch(t.kind){case 253:case 163:case 166:case 165:case 297:case 294:case 202:return t.initializer===e;case 237:case 238:case 239:case 240:case 246:case 247:case 248:case 288:case 250:return t.expression===e;case 241:var r=t;return r.initializer===e&&254!==r.initializer.kind||r.condition===e||r.incrementor===e;case 242:case 243:var n=t;return n.initializer===e&&254!==n.initializer.kind||n.expression===e;case 210:case 228:case 232:case 161:return e===t.expression;case 164:case 287:case 286:case 296:return !0;case 227:return t.expression===e&&Jr(t);case 295:return t.objectAssignmentInitializer===e;default:return me(t)}}function ve(e){for(;160===e.kind||79===e.kind;)e=e.parent;return 180===e.kind}function he(e){return 264===e.kind&&276===e.moduleReference.kind}function be(e){return xe(e)}function xe(e){return !!e&&!!(131072&e.flags)}function De(e){return !!e&&!!(4194304&e.flags)}function Se(t,r){if(207!==t.kind)return !1;var n=t,i=n.expression,a=n.arguments;if(79!==i.kind||"require"!==i.escapedText)return !1;if(1!==a.length)return !1;var o=a[0];return !r||e.isStringLiteralLike(o)}function Te(t){return 202===t.kind&&(t=t.parent.parent),e.isVariableDeclaration(t)&&!!t.initializer&&Se(on(t.initializer),!0)}function Ce(t){return e.isBinaryExpression(t)||an(t)||e.isIdentifier(t)||e.isCallExpression(t)}function Ee(t){return xe(t)&&t.initializer&&e.isBinaryExpression(t.initializer)&&(56===t.initializer.operatorToken.kind||60===t.initializer.operatorToken.kind)&&t.name&&zr(t.name)&&Ne(t.name,t.initializer.left)?t.initializer.right:t.initializer}function ke(t,r){if(e.isCallExpression(t)){var n=lt(t.expression);return 212===n.kind||213===n.kind?t:void 0}return 212===t.kind||225===t.kind||213===t.kind||e.isObjectLiteralExpression(t)&&(0===t.properties.length||r)?t:void 0}function Ne(t,r){if(Et(t)&&Et(r))return kt(t)===kt(r);if(e.isIdentifier(t)&&Me(r)&&(108===r.expression.kind||e.isIdentifier(r.expression)&&("window"===r.expression.escapedText||"self"===r.expression.escapedText||"global"===r.expression.escapedText))){var n=Je(r);return e.isPrivateIdentifier(n)&&e.Debug.fail("Unexpected PrivateIdentifier in name expression with literal-like access."),Ne(t,n)}return !(!Me(t)||!Me(r))&&Ue(t)===Ue(r)&&Ne(t.expression,r.expression)}function Fe(e){for(;jr(e,!0);)e=e.right;return e}function Ae(t){return e.isIdentifier(t)&&"exports"===t.escapedText}function Pe(t){return e.isIdentifier(t)&&"module"===t.escapedText}function we(t){return (e.isPropertyAccessExpression(t)||Le(t))&&Pe(t.expression)&&"exports"===Ue(t)}function Ie(t){var r=function(t){if(e.isCallExpression(t)){if(!Oe(t))return 0;var r=t.arguments[0];return Ae(r)||we(r)?8:Re(r)&&"prototype"===Ue(r)?9:7}return 63!==t.operatorToken.kind||!an(t.left)||(n=Fe(t),e.isVoidExpression(n)&&e.isNumericLiteral(n.expression)&&"0"===n.expression.text)?0:je(t.left.expression,!0)&&"prototype"===Ue(t.left)&&e.isObjectLiteralExpression(Ve(t))?6:Ke(t.left);var n;}(t);return 5===r||xe(t)?r:0}function Oe(t){return 3===e.length(t.arguments)&&e.isPropertyAccessExpression(t.expression)&&e.isIdentifier(t.expression.expression)&&"Object"===e.idText(t.expression.expression)&&"defineProperty"===e.idText(t.expression.name)&&xt(t.arguments[1])&&je(t.arguments[0],!0)}function Me(t){return e.isPropertyAccessExpression(t)||Le(t)}function Le(t){return e.isElementAccessExpression(t)&&xt(t.argumentExpression)}function Re(t,r){return e.isPropertyAccessExpression(t)&&(!r&&108===t.expression.kind||e.isIdentifier(t.name)&&je(t.expression,!0))||Be(t,r)}function Be(e,t){return Le(e)&&(!t&&108===e.expression.kind||zr(e.expression)||Re(e.expression,!0))}function je(e,t){return zr(e)||Re(e,t)}function Je(t){return e.isPropertyAccessExpression(t)?t.name:t.argumentExpression}function ze(t){if(e.isPropertyAccessExpression(t))return t.name;var r=lt(t.argumentExpression);return e.isNumericLiteral(r)||e.isStringLiteralLike(r)?r:t}function Ue(t){var r=ze(t);if(r){if(e.isIdentifier(r))return r.escapedText;if(e.isStringLiteralLike(r)||e.isNumericLiteral(r))return e.escapeLeadingUnderscores(r.text)}}function Ke(t){if(108===t.expression.kind)return 4;if(we(t))return 2;if(je(t.expression,!0)){if(Kr(t.expression))return 3;for(var r=t;!e.isIdentifier(r.expression);)r=r.expression;var n=r.expression;if(("exports"===n.escapedText||"module"===n.escapedText&&"exports"===Ue(r))&&Re(t))return 1;if(je(t,!0)||e.isElementAccessExpression(t)&&Tt(t))return 5}return 0}function Ve(t){for(;e.isBinaryExpression(t.right);)t=t.right;return t.right}function qe(t){switch(t.parent.kind){case 265:case 271:return t.parent;case 276:return t.parent.parent;case 207:return W(t.parent)||Se(t.parent,!1)?t.parent:void 0;case 195:return e.Debug.assert(e.isStringLiteral(t)),e.tryCast(t.parent.parent,e.isImportTypeNode);default:return}}function We(t){switch(t.kind){case 265:case 271:return t.moduleSpecifier;case 264:return 276===t.moduleReference.kind?t.moduleReference.expression:void 0;case 199:return H(t)?t.argument.literal:void 0;case 207:return t.arguments[0];case 260:return 10===t.name.kind?t.name:void 0;default:return e.Debug.assertNever(t)}}function He(e){return 343===e.kind||336===e.kind||337===e.kind}function Ge(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&0!==Ie(t.expression)&&e.isBinaryExpression(t.expression.right)&&(56===t.expression.right.operatorToken.kind||60===t.expression.right.operatorToken.kind)?t.expression.right.right:void 0}function Qe(e){switch(e.kind){case 236:var t=Xe(e);return t&&t.initializer;case 166:case 294:return e.initializer}}function Xe(t){return e.isVariableStatement(t)?e.firstOrUndefined(t.declarationList.declarations):void 0}function Ye(t){return e.isModuleDeclaration(t)&&t.body&&260===t.body.kind?t.body:void 0}function Ze(t,r){if(e.isJSDoc(r)){var n=e.filter(r.tags,(function(e){return $e(t,e)}));return r.tags===n?[r]:n}return $e(t,r)?[r]:void 0}function $e(t,r){return !(e.isJSDocTypeTag(r)&&r.parent&&e.isJSDoc(r.parent)&&e.isParenthesizedExpression(r.parent.parent)&&r.parent.parent!==t)}function et(t){var r=t.parent;return 294===r.kind||270===r.kind||166===r.kind||237===r.kind&&205===t.kind||246===r.kind||Ye(r)||e.isBinaryExpression(t)&&63===t.operatorToken.kind?r:r.parent&&(Xe(r.parent)===t||e.isBinaryExpression(r)&&63===r.operatorToken.kind)?r.parent:r.parent&&r.parent.parent&&(Xe(r.parent.parent)||Qe(r.parent.parent)===t||Ge(r.parent.parent))?r.parent.parent:void 0}function tt(t){var r=rt(t);return r&&e.isFunctionLike(r)?r:void 0}function rt(t){var r=nt(t);if(r)return Ge(r)||function(t){return e.isExpressionStatement(t)&&e.isBinaryExpression(t.expression)&&63===t.expression.operatorToken.kind?Fe(t.expression):void 0}(r)||Qe(r)||Xe(r)||Ye(r)||r}function nt(t){var r=it(t);if(r){var n=r.parent;return n&&n.jsDoc&&r===e.lastOrUndefined(n.jsDoc)?n:void 0}}function it(t){return e.findAncestor(t.parent,e.isJSDoc)}function at(t){var r=e.isJSDocParameterTag(t)?t.typeExpression&&t.typeExpression.type:t.type;return void 0!==t.dotDotDotToken||!!r&&316===r.kind}function ot(e){for(var t=e.parent;;){switch(t.kind){case 220:var r=t.operatorToken.kind;return Lr(r)&&t.left===e?63===r||Mr(r)?1:2:0;case 218:case 219:var n=t.operator;return 45===n||46===n?2:0;case 242:case 243:return t.initializer===e?1:0;case 211:case 203:case 224:case 229:e=t;break;case 296:e=t.parent;break;case 295:if(t.name!==e)return 0;e=t.parent;break;case 294:if(t.name===e)return 0;e=t.parent;break;default:return 0}t=e.parent;}}function st(e,t){for(;e&&e.kind===t;)e=e.parent;return e}function ct(e){return st(e,211)}function lt(t,r){var n=r?17:1;return e.skipOuterExpressions(t,n)}function ut(t){return zr(t)||e.isClassExpression(t)}function _t(e){return ut(dt(e))}function dt(t){return e.isExportAssignment(t)?t.expression:t.right}function pt(t){var r=ft(t);if(r&&xe(t)){var n=e.getJSDocAugmentsTag(t);if(n)return n.class}return r}function ft(e){var t=yt(e.heritageClauses,94);return t&&t.types.length>0?t.types[0]:void 0}function gt(t){if(xe(t))return e.getJSDocImplementsTags(t).map((function(e){return e.class}));var r=yt(t.heritageClauses,117);return null==r?void 0:r.types}function mt(e){var t=yt(e.heritageClauses,94);return t?t.types:void 0}function yt(e,t){if(e)for(var r=0,n=e;r<n.length;r++){var i=n[r];if(i.token===t)return i}}function vt(e){return 81<=e&&e<=159}function ht(e){return 126<=e&&e<=159}function bt(e){return vt(e)&&!ht(e)}function xt(t){return e.isStringLiteralLike(t)||e.isNumericLiteral(t)}function Dt(t){return e.isPrefixUnaryExpression(t)&&(39===t.operator||40===t.operator)&&e.isNumericLiteral(t.operand)}function St(t){var r=e.getNameOfDeclaration(t);return !!r&&Tt(r)}function Tt(t){if(161!==t.kind&&206!==t.kind)return !1;var r=e.isElementAccessExpression(t)?lt(t.argumentExpression):t.expression;return !xt(r)&&!Dt(r)}function Ct(t){switch(t.kind){case 79:case 80:return t.escapedText;case 10:case 8:return e.escapeLeadingUnderscores(t.text);case 161:var r=t.expression;return xt(r)?e.escapeLeadingUnderscores(r.text):Dt(r)?40===r.operator?e.tokenToString(r.operator)+r.operand.text:r.operand.text:void 0;default:return e.Debug.assertNever(t)}}function Et(e){switch(e.kind){case 79:case 10:case 14:case 8:return !0;default:return !1}}function kt(t){return e.isMemberName(t)?e.idText(t):t.text}function Nt(e){for(;202===e.kind;)e=e.parent.parent;return e}function Ft(e){return li(e.pos)||li(e.end)}function At(e,t,r){switch(e){case 208:return r?0:1;case 218:case 215:case 216:case 214:case 217:case 221:case 223:return 1;case 220:switch(t){case 42:case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 1}}return 0}function Pt(e){return 220===e.kind?e.operatorToken.kind:218===e.kind||219===e.kind?e.operator:e.kind}function wt(e,t,r){switch(e){case 349:return 0;case 224:return 1;case 223:return 2;case 221:return 4;case 220:switch(t){case 27:return 0;case 63:case 64:case 65:case 67:case 66:case 68:case 69:case 70:case 71:case 72:case 73:case 78:case 74:case 75:case 76:case 77:return 3;default:return It(t)}case 210:case 229:case 218:case 215:case 216:case 214:case 217:return 16;case 219:return 17;case 207:return 18;case 208:return r?19:18;case 209:case 205:case 206:case 230:return 19;case 228:return 11;case 108:case 106:case 79:case 80:case 104:case 110:case 95:case 8:case 9:case 10:case 203:case 204:case 212:case 213:case 225:case 13:case 14:case 222:case 211:case 226:case 277:case 278:case 281:return 20;default:return -1}}function It(e){switch(e){case 60:return 4;case 56:return 5;case 55:return 6;case 51:return 7;case 52:return 8;case 50:return 9;case 34:case 35:case 36:case 37:return 10;case 29:case 31:case 32:case 33:case 102:case 101:case 127:return 11;case 47:case 48:case 49:return 12;case 39:case 40:return 13;case 41:case 43:case 44:return 14;case 42:return 15}return -1}e.isPartOfTypeNode=ne,e.isChildOfNodeWithKind=function(e,t){for(;e;){if(e.kind===t)return !0;e=e.parent;}return !1},e.forEachReturnStatement=function(t,r){return function t(n){switch(n.kind){case 246:return r(n);case 262:case 234:case 238:case 239:case 240:case 241:case 242:case 243:case 247:case 248:case 288:case 289:case 249:case 251:case 291:return e.forEachChild(n,t)}}(t)},e.forEachYieldExpression=function(t,r){return function t(n){switch(n.kind){case 223:r(n);var i=n.expression;return void(i&&t(i));case 259:case 257:case 260:case 258:return;default:if(e.isFunctionLike(n)){if(n.name&&161===n.name.kind)return void t(n.name.expression)}else ne(n)||e.forEachChild(n,t);}}(t)},e.getRestParameterElementType=function(t){return t&&182===t.kind?t.elementType:t&&177===t.kind?e.singleOrUndefined(t.typeArguments):void 0},e.getMembersOfDeclaration=function(e){switch(e.kind){case 257:case 256:case 225:case 181:return e.members;case 204:return e.properties}},e.isVariableLike=ie,e.isVariableLikeOrAccessor=function(t){return ie(t)||e.isAccessor(t)},e.isVariableDeclarationInVariableStatement=ae,e.isValidESSymbolDeclaration=function(t){return e.isVariableDeclaration(t)?q(t)&&e.isIdentifier(t.name)&&ae(t):e.isPropertyDeclaration(t)?Cr(t)&&Tr(t):e.isPropertySignature(t)&&Cr(t)},e.introducesArgumentsExoticObject=function(e){switch(e.kind){case 168:case 167:case 170:case 171:case 172:case 255:case 212:return !0}return !1},e.unwrapInnermostStatementOfLabel=function(e,t){for(;;){if(t&&t(e),249!==e.statement.kind)return e.statement;e=e.statement;}},e.isFunctionBlock=function(t){return t&&234===t.kind&&e.isFunctionLike(t.parent)},e.isObjectLiteralMethod=function(e){return e&&168===e.kind&&204===e.parent.kind},e.isObjectLiteralOrClassExpressionMethodOrAccessor=function(e){return !(168!==e.kind&&171!==e.kind&&172!==e.kind||204!==e.parent.kind&&225!==e.parent.kind)},e.isIdentifierTypePredicate=function(e){return e&&1===e.kind},e.isThisTypePredicate=function(e){return e&&0===e.kind},e.getPropertyAssignment=oe,e.getPropertyArrayElementValue=function(t,r,n){return e.firstDefined(oe(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigObjectLiteralExpression=se,e.getTsConfigPropArrayElementValue=function(t,r,n){return e.firstDefined(ce(t,r),(function(t){return e.isArrayLiteralExpression(t.initializer)?e.find(t.initializer.elements,(function(t){return e.isStringLiteral(t)&&t.text===n})):void 0}))},e.getTsConfigPropArray=ce,e.getContainingFunction=function(t){return e.findAncestor(t.parent,e.isFunctionLike)},e.getContainingFunctionDeclaration=function(t){return e.findAncestor(t.parent,e.isFunctionLikeDeclaration)},e.getContainingClass=function(t){return e.findAncestor(t.parent,e.isClassLike)},e.getContainingClassStaticBlock=function(t){return e.findAncestor(t.parent,(function(t){return e.isClassLike(t)||e.isFunctionLike(t)?"quit":e.isClassStaticBlockDeclaration(t)}))},e.getContainingFunctionOrClassStaticBlock=function(t){return e.findAncestor(t.parent,e.isFunctionLikeOrClassStaticBlockDeclaration)},e.getThisContainer=le,e.isInTopLevelContext=function(t){e.isIdentifier(t)&&(e.isClassDeclaration(t.parent)||e.isFunctionDeclaration(t.parent))&&t.parent.name===t&&(t=t.parent);var r=le(t,!0);return e.isSourceFile(r)},e.getNewTargetContainer=function(e){var t=le(e,!1);if(t)switch(t.kind){case 170:case 255:case 212:return t}},e.getSuperContainer=function(t,r){for(;;){if(!(t=t.parent))return t;switch(t.kind){case 161:t=t.parent;break;case 255:case 212:case 213:if(!r)continue;case 166:case 165:case 168:case 167:case 170:case 171:case 172:case 169:return t;case 164:163===t.parent.kind&&e.isClassElement(t.parent.parent)?t=t.parent.parent:e.isClassElement(t.parent)&&(t=t.parent);}}},e.getImmediatelyInvokedFunctionExpression=function(e){if(212===e.kind||213===e.kind){for(var t=e,r=e.parent;211===r.kind;)t=r,r=r.parent;if(207===r.kind&&r.expression===t)return r}},e.isSuperOrSuperProperty=function(e){return 106===e.kind||ue(e)},e.isSuperProperty=ue,e.isThisProperty=function(e){var t=e.kind;return (205===t||206===t)&&108===e.expression.kind},e.isThisInitializedDeclaration=function(t){var r;return !!t&&e.isVariableDeclaration(t)&&108===(null===(r=t.initializer)||void 0===r?void 0:r.kind)},e.isThisInitializedObjectBindingExpression=function(t){return !!t&&(e.isShorthandPropertyAssignment(t)||e.isPropertyAssignment(t))&&e.isBinaryExpression(t.parent.parent)&&63===t.parent.parent.operatorToken.kind&&108===t.parent.parent.right.kind},e.getEntityNameFromTypeNode=function(e){switch(e.kind){case 177:return e.typeName;case 227:return zr(e.expression)?e.expression:void 0;case 79:case 160:return e}},e.getInvokedExpression=function(e){switch(e.kind){case 209:return e.tag;case 279:case 278:return e.tagName;default:return e.expression}},e.nodeCanBeDecorated=_e,e.nodeIsDecorated=de,e.nodeOrChildIsDecorated=pe,e.childIsDecorated=fe,e.classOrConstructorParameterIsDecorated=function(e){if(de(e))return !0;var t=ur(e);return !!t&&fe(t,e)},e.isJSXTagName=ge,e.isExpressionNode=me,e.isInExpressionContext=ye,e.isPartOfTypeQuery=ve,e.isNamespaceReexportDeclaration=function(t){return e.isNamespaceExport(t)&&!!t.parent.moduleSpecifier},e.isExternalModuleImportEqualsDeclaration=he,e.getExternalModuleImportEqualsDeclarationExpression=function(t){return e.Debug.assert(he(t)),t.moduleReference.expression},e.getExternalModuleRequireArgument=function(e){return Te(e)&&on(e.initializer).arguments[0]},e.isInternalModuleImportEqualsDeclaration=function(e){return 264===e.kind&&276!==e.moduleReference.kind},e.isSourceFileJS=be,e.isSourceFileNotJS=function(e){return !xe(e)},e.isInJSFile=xe,e.isInJsonFile=function(e){return !!e&&!!(33554432&e.flags)},e.isSourceFileNotJson=function(e){return !V(e)},e.isInJSDoc=De,e.isJSDocIndexSignature=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&t.typeArguments&&2===t.typeArguments.length&&(149===t.typeArguments[0].kind||146===t.typeArguments[0].kind)},e.isRequireCall=Se,e.isRequireVariableDeclaration=Te,e.isRequireVariableStatement=function(t){return e.isVariableStatement(t)&&t.declarationList.declarations.length>0&&e.every(t.declarationList.declarations,(function(e){return Te(e)}))},e.isSingleOrDoubleQuote=function(e){return 39===e||34===e},e.isStringDoubleQuoted=function(e,t){return 34===h(t,e).charCodeAt(0)},e.isAssignmentDeclaration=Ce,e.getEffectiveInitializer=Ee,e.getDeclaredExpandoInitializer=function(e){var t=Ee(e);return t&&ke(t,Kr(e.name))},e.getAssignedExpandoInitializer=function(t){if(t&&t.parent&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind){var r=Kr(t.parent.left);return ke(t.parent.right,r)||function(t,r,n){var i=e.isBinaryExpression(r)&&(56===r.operatorToken.kind||60===r.operatorToken.kind)&&ke(r.right,n);if(i&&Ne(t,r.left))return i}(t.parent.left,t.parent.right,r)}if(t&&e.isCallExpression(t)&&Oe(t)){var n=function(t,r){return e.forEach(t.properties,(function(t){return e.isPropertyAssignment(t)&&e.isIdentifier(t.name)&&"value"===t.name.escapedText&&t.initializer&&ke(t.initializer,r)}))}(t.arguments[2],"prototype"===t.arguments[1].text);if(n)return n}},e.getExpandoInitializer=ke,e.isDefaultedExpandoInitializer=function(t){var r=e.isVariableDeclaration(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind?t.parent.left:void 0;return r&&ke(t.right,Kr(r))&&zr(r)&&Ne(r,t.left)},e.getNameOfExpando=function(t){if(e.isBinaryExpression(t.parent)){var r=56!==t.parent.operatorToken.kind&&60!==t.parent.operatorToken.kind||!e.isBinaryExpression(t.parent.parent)?t.parent:t.parent.parent;if(63===r.operatorToken.kind&&e.isIdentifier(r.left))return r.left}else if(e.isVariableDeclaration(t.parent))return t.parent.name},e.isSameEntityName=Ne,e.getRightMostAssignedExpression=Fe,e.isExportsIdentifier=Ae,e.isModuleIdentifier=Pe,e.isModuleExportsAccessExpression=we,e.getAssignmentDeclarationKind=Ie,e.isBindableObjectDefinePropertyCall=Oe,e.isLiteralLikeAccess=Me,e.isLiteralLikeElementAccess=Le,e.isBindableStaticAccessExpression=Re,e.isBindableStaticElementAccessExpression=Be,e.isBindableStaticNameExpression=je,e.getNameOrArgument=Je,e.getElementOrPropertyAccessArgumentExpressionOrName=ze,e.getElementOrPropertyAccessName=Ue,e.getAssignmentDeclarationPropertyAccessKind=Ke,e.getInitializerOfBinaryExpression=Ve,e.isPrototypePropertyAssignment=function(t){return e.isBinaryExpression(t)&&3===Ie(t)},e.isSpecialPropertyDeclaration=function(t){return xe(t)&&t.parent&&237===t.parent.kind&&(!e.isElementAccessExpression(t)||Le(t))&&!!e.getJSDocTypeTag(t.parent)},e.setValueDeclaration=function(e,t){var r=e.valueDeclaration;(!r||(!(8388608&t.flags)||8388608&r.flags)&&Ce(r)&&!Ce(t)||r.kind!==t.kind&&E(r))&&(e.valueDeclaration=t);},e.isFunctionSymbol=function(t){if(!t||!t.valueDeclaration)return !1;var r=t.valueDeclaration;return 255===r.kind||e.isVariableDeclaration(r)&&r.initializer&&e.isFunctionLike(r.initializer)},e.tryGetModuleSpecifierFromDeclaration=function(t){var r,n,i;switch(t.kind){case 253:return t.initializer.arguments[0].text;case 265:return null===(r=e.tryCast(t.moduleSpecifier,e.isStringLiteralLike))||void 0===r?void 0:r.text;case 264:return null===(i=e.tryCast(null===(n=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===n?void 0:n.expression,e.isStringLiteralLike))||void 0===i?void 0:i.text;default:e.Debug.assertNever(t);}},e.importFromModuleSpecifier=function(t){return qe(t)||e.Debug.failBadSyntaxKind(t.parent)},e.tryGetImportFromModuleSpecifier=qe,e.getExternalModuleName=We,e.getNamespaceDeclarationNode=function(t){switch(t.kind){case 265:return t.importClause&&e.tryCast(t.importClause.namedBindings,e.isNamespaceImport);case 264:return t;case 271:return t.exportClause&&e.tryCast(t.exportClause,e.isNamespaceExport);default:return e.Debug.assertNever(t)}},e.isDefaultImport=function(e){return 265===e.kind&&!!e.importClause&&!!e.importClause.name},e.forEachImportClauseDeclaration=function(t,r){var n;return t.name&&(n=r(t))||t.namedBindings&&(n=e.isNamespaceImport(t.namedBindings)?r(t.namedBindings):e.forEach(t.namedBindings.elements,r))?n:void 0},e.hasQuestionToken=function(e){if(e)switch(e.kind){case 163:case 168:case 167:case 295:case 294:case 166:case 165:return void 0!==e.questionToken}return !1},e.isJSDocConstructSignature=function(t){var r=e.isJSDocFunctionType(t)?e.firstOrUndefined(t.parameters):void 0,n=e.tryCast(r&&r.name,e.isIdentifier);return !!n&&"new"===n.escapedText},e.isJSDocTypeAlias=He,e.isTypeAlias=function(t){return He(t)||e.isTypeAliasDeclaration(t)},e.getSingleInitializerOfVariableStatementOrPropertyDeclaration=Qe,e.getSingleVariableOfVariableStatement=Xe,e.getJSDocCommentsAndTags=function(t,r){var n;ie(t)&&e.hasInitializer(t)&&e.hasJSDocNodes(t.initializer)&&(n=e.addRange(n,Ze(t,e.last(t.initializer.jsDoc))));for(var i=t;i&&i.parent;){if(e.hasJSDocNodes(i)&&(n=e.addRange(n,Ze(t,e.last(i.jsDoc)))),163===i.kind){n=e.addRange(n,(r?e.getJSDocParameterTagsNoCache:e.getJSDocParameterTags)(i));break}if(162===i.kind){n=e.addRange(n,(r?e.getJSDocTypeParameterTagsNoCache:e.getJSDocTypeParameterTags)(i));break}i=et(i);}return n||e.emptyArray},e.getNextJSDocCommentLocation=et,e.getParameterSymbolFromJSDoc=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t.name)){var r=t.name.escapedText,n=tt(t);if(n){var i=e.find(n.parameters,(function(e){return 79===e.name.kind&&e.name.escapedText===r}));return i&&i.symbol}}},e.getEffectiveContainerForJSDocTemplateTag=function(t){if(e.isJSDoc(t.parent)&&t.parent.tags){var r=e.find(t.parent.tags,He);if(r)return r}return tt(t)},e.getHostSignatureFromJSDoc=tt,e.getEffectiveJSDocHost=rt,e.getJSDocHost=nt,e.getJSDocRoot=it,e.getTypeParameterFromJsDoc=function(t){var r=t.name.escapedText,n=t.parent.parent.parent.typeParameters;return n&&e.find(n,(function(e){return e.name.escapedText===r}))},e.hasRestParameter=function(t){var r=e.lastOrUndefined(t.parameters);return !!r&&at(r)},e.isRestParameter=at,e.hasTypeArguments=function(e){return !!e.typeArguments},(te=e.AssignmentKind||(e.AssignmentKind={}))[te.None=0]="None",te[te.Definite=1]="Definite",te[te.Compound=2]="Compound",e.getAssignmentTargetKind=ot,e.isAssignmentTarget=function(e){return 0!==ot(e)},e.isNodeWithPossibleHoistedDeclaration=function(e){switch(e.kind){case 234:case 236:case 247:case 238:case 248:case 262:case 288:case 289:case 249:case 241:case 242:case 243:case 239:case 240:case 251:case 291:return !0}return !1},e.isValueSignatureDeclaration=function(t){return e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isMethodOrAccessor(t)||e.isFunctionDeclaration(t)||e.isConstructorDeclaration(t)},e.walkUpParenthesizedTypes=function(e){return st(e,190)},e.walkUpParenthesizedExpressions=ct,e.walkUpParenthesizedTypesAndGetParentAndChild=function(e){for(var t;e&&190===e.kind;)t=e,e=e.parent;return [t,e]},e.skipParentheses=lt,e.isDeleteTarget=function(e){return (205===e.kind||206===e.kind)&&(e=ct(e.parent))&&214===e.kind},e.isNodeDescendantOf=function(e,t){for(;e;){if(e===t)return !0;e=e.parent;}return !1},e.isDeclarationName=function(t){return !e.isSourceFile(t)&&!e.isBindingPattern(t)&&e.isDeclaration(t.parent)&&t.parent.name===t},e.getDeclarationFromName=function(t){var r=t.parent;switch(t.kind){case 10:case 14:case 8:if(e.isComputedPropertyName(r))return r.parent;case 79:if(e.isDeclaration(r))return r.name===t?r:void 0;if(e.isQualifiedName(r)){var n=r.parent;return e.isJSDocParameterTag(n)&&n.name===r?n:void 0}var i=r.parent;return e.isBinaryExpression(i)&&0!==Ie(i)&&(i.left.symbol||i.symbol)&&e.getNameOfDeclaration(i)===t?i:void 0;case 80:return e.isDeclaration(r)&&r.name===t?r:void 0;default:return}},e.isLiteralComputedPropertyDeclarationName=function(t){return xt(t)&&161===t.parent.kind&&e.isDeclaration(t.parent.parent)},e.isIdentifierName=function(e){var t=e.parent;switch(t.kind){case 166:case 165:case 168:case 167:case 171:case 172:case 297:case 294:case 205:return t.name===e;case 160:return t.right===e;case 202:case 269:return t.propertyName===e;case 274:case 284:return !0}return !1},e.isAliasSymbolDeclaration=function(t){return 264===t.kind||263===t.kind||266===t.kind&&!!t.name||267===t.kind||273===t.kind||269===t.kind||274===t.kind||270===t.kind&&_t(t)||e.isBinaryExpression(t)&&2===Ie(t)&&_t(t)||e.isPropertyAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&ut(t.parent.right)||295===t.kind||294===t.kind&&ut(t.initializer)},e.getAliasDeclarationFromName=function e(t){switch(t.parent.kind){case 266:case 269:case 267:case 274:case 270:case 264:return t.parent;case 160:do{t=t.parent;}while(160===t.parent.kind);return e(t)}},e.isAliasableExpression=ut,e.exportAssignmentIsAlias=_t,e.getExportAssignmentExpression=dt,e.getPropertyAssignmentAliasLikeExpression=function(e){return 295===e.kind?e.name:294===e.kind?e.initializer:e.parent.right},e.getEffectiveBaseTypeNode=pt,e.getClassExtendsHeritageElement=ft,e.getEffectiveImplementsTypeNodes=gt,e.getAllSuperTypeNodes=function(t){return e.isInterfaceDeclaration(t)?mt(t)||e.emptyArray:e.isClassLike(t)&&e.concatenate(e.singleElementArray(pt(t)),gt(t))||e.emptyArray},e.getInterfaceBaseTypeNodes=mt,e.getHeritageClause=yt,e.getAncestor=function(e,t){for(;e;){if(e.kind===t)return e;e=e.parent;}},e.isKeyword=vt,e.isContextualKeyword=ht,e.isNonContextualKeyword=bt,e.isFutureReservedKeyword=function(e){return 117<=e&&e<=125},e.isStringANonContextualKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&bt(r)},e.isStringAKeyword=function(t){var r=e.stringToToken(t);return void 0!==r&&vt(r)},e.isIdentifierANonContextualKeyword=function(e){var t=e.originalKeywordKind;return !!t&&!ht(t)},e.isTrivia=function(e){return 2<=e&&e<=7},(ee=e.FunctionFlags||(e.FunctionFlags={}))[ee.Normal=0]="Normal",ee[ee.Generator=1]="Generator",ee[ee.Async=2]="Async",ee[ee.Invalid=4]="Invalid",ee[ee.AsyncGenerator=3]="AsyncGenerator",e.getFunctionFlags=function(e){if(!e)return 4;var t=0;switch(e.kind){case 255:case 212:case 168:e.asteriskToken&&(t|=1);case 213:Dr(e,256)&&(t|=2);}return e.body||(t|=4),t},e.isAsyncFunction=function(e){switch(e.kind){case 255:case 212:case 213:case 168:return void 0!==e.body&&void 0===e.asteriskToken&&Dr(e,256)}return !1},e.isStringOrNumericLiteralLike=xt,e.isSignedNumericLiteral=Dt,e.hasDynamicName=St,e.isDynamicName=Tt,e.getPropertyNameForPropertyNameNode=Ct,e.isPropertyNameLiteral=Et,e.getTextOfIdentifierOrLiteral=kt,e.getEscapedTextOfIdentifierOrLiteral=function(t){return e.isMemberName(t)?t.escapedText:e.escapeLeadingUnderscores(t.text)},e.getPropertyNameForUniqueESSymbol=function(t){return "__@".concat(e.getSymbolId(t),"@").concat(t.escapedName)},e.getSymbolNameForPrivateIdentifier=function(t,r){return "__#".concat(e.getSymbolId(t),"@").concat(r)},e.isKnownSymbol=function(t){return e.startsWith(t.escapedName,"__@")},e.isPrivateIdentifierSymbol=function(t){return e.startsWith(t.escapedName,"__#")},e.isESSymbolIdentifier=function(e){return 79===e.kind&&"Symbol"===e.escapedText},e.isPushOrUnshiftIdentifier=function(e){return "push"===e.escapedText||"unshift"===e.escapedText},e.isParameterDeclaration=function(e){return 163===Nt(e).kind},e.getRootDeclaration=Nt,e.nodeStartsNewLexicalEnvironment=function(e){var t=e.kind;return 170===t||212===t||255===t||213===t||168===t||171===t||172===t||260===t||303===t},e.nodeIsSynthesized=Ft,e.getOriginalSourceFile=function(t){return e.getParseTreeNode(t,e.isSourceFile)||t},($=e.Associativity||(e.Associativity={}))[$.Left=0]="Left",$[$.Right=1]="Right",e.getExpressionAssociativity=function(e){var t=Pt(e),r=208===e.kind&&void 0!==e.arguments;return At(e.kind,t,r)},e.getOperatorAssociativity=At,e.getExpressionPrecedence=function(e){var t=Pt(e),r=208===e.kind&&void 0!==e.arguments;return wt(e.kind,t,r)},e.getOperator=Pt,(Z=e.OperatorPrecedence||(e.OperatorPrecedence={}))[Z.Comma=0]="Comma",Z[Z.Spread=1]="Spread",Z[Z.Yield=2]="Yield",Z[Z.Assignment=3]="Assignment",Z[Z.Conditional=4]="Conditional",Z[Z.Coalesce=4]="Coalesce",Z[Z.LogicalOR=5]="LogicalOR",Z[Z.LogicalAND=6]="LogicalAND",Z[Z.BitwiseOR=7]="BitwiseOR",Z[Z.BitwiseXOR=8]="BitwiseXOR",Z[Z.BitwiseAND=9]="BitwiseAND",Z[Z.Equality=10]="Equality",Z[Z.Relational=11]="Relational",Z[Z.Shift=12]="Shift",Z[Z.Additive=13]="Additive",Z[Z.Multiplicative=14]="Multiplicative",Z[Z.Exponentiation=15]="Exponentiation",Z[Z.Unary=16]="Unary",Z[Z.Update=17]="Update",Z[Z.LeftHandSide=18]="LeftHandSide",Z[Z.Member=19]="Member",Z[Z.Primary=20]="Primary",Z[Z.Highest=20]="Highest",Z[Z.Lowest=0]="Lowest",Z[Z.Invalid=-1]="Invalid",e.getOperatorPrecedence=wt,e.getBinaryOperatorPrecedence=It,e.getSemanticJsxChildren=function(t){return e.filter(t,(function(e){switch(e.kind){case 287:return !!e.expression;case 11:return !e.containsOnlyTriviaWhiteSpaces;default:return !0}}))},e.createDiagnosticCollection=function(){var t=[],r=[],n=new e.Map,i=!1;return {add:function(a){var o;a.file?(o=n.get(a.file.fileName))||(o=[],n.set(a.file.fileName,o),e.insertSorted(r,a.file.fileName,e.compareStringsCaseSensitive)):(i&&(i=!1,t=t.slice()),o=t),e.insertSorted(o,a,xn);},lookup:function(r){var i;if(i=r.file?n.get(r.file.fileName):t){var a=e.binarySearch(i,r,e.identity,Dn);return a>=0?i[a]:void 0}},getGlobalDiagnostics:function(){return i=!0,t},getDiagnostics:function(i){if(i)return n.get(i)||[];var a=e.flatMapToMutable(r,(function(e){return n.get(e)}));return t.length?(a.unshift.apply(a,t),a):a}}};var Ot=/\$\{/g;e.hasInvalidEscape=function(t){return t&&!!(e.isNoSubstitutionTemplateLiteral(t)?t.templateFlags:t.head.templateFlags||e.some(t.templateSpans,(function(e){return !!e.literal.templateFlags})))};var Mt=/[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Lt=/[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g,Rt=/\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g,Bt=new e.Map(e.getEntries({"\t":"\\t","\v":"\\v","\f":"\\f","\b":"\\b","\r":"\\r","\n":"\\n","\\":"\\\\",'"':'\\"',"'":"\\'","`":"\\`","\u2028":"\\u2028","\u2029":"\\u2029","
":"\\u0085","\r\n":"\\r\\n"}));function jt(e){return "\\u"+("0000"+e.toString(16).toUpperCase()).slice(-4)}function Jt(e,t,r){if(0===e.charCodeAt(0)){var n=r.charCodeAt(t+e.length);return n>=48&&n<=57?"\\x00":"\\0"}return Bt.get(e)||jt(e.charCodeAt(0))}function zt(e,t){var r=96===t?Rt:39===t?Lt:Mt;return e.replace(r,Jt)}e.escapeString=zt;var Ut=/[^\u0000-\u007F]/g;function Kt(e,t){return e=zt(e,t),Ut.test(e)?e.replace(Ut,(function(e){return jt(e.charCodeAt(0))})):e}e.escapeNonAsciiString=Kt;var Vt=/[\"\u0000-\u001f\u2028\u2029\u0085]/g,qt=/[\'\u0000-\u001f\u2028\u2029\u0085]/g,Wt=new e.Map(e.getEntries({'"':""","'":"'"}));function Ht(e){return 0===e.charCodeAt(0)?"�":Wt.get(e)||"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function Gt(e,t){var r=39===t?qt:Vt;return e.replace(r,Ht)}e.escapeJsxAttributeString=Gt,e.stripQuotes=function(e){var t,r=e.length;return r>=2&&e.charCodeAt(0)===e.charCodeAt(r-1)&&(39===(t=e.charCodeAt(0))||34===t||96===t)?e.substring(1,r-1):e},e.isIntrinsicJsxName=function(t){var r=t.charCodeAt(0);return r>=97&&r<=122||e.stringContains(t,"-")||e.stringContains(t,":")};var Qt=[""," "];function Xt(e){for(var t=Qt[1],r=Qt.length;r<=e;r++)Qt.push(Qt[r-1]+t);return Qt[e]}function Yt(){return Qt[1].length}function Zt(e){return !!e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames()}function $t(e,t,r){return t.moduleName||tr(e,t.fileName,r&&r.fileName)}function er(t,r){return t.getCanonicalFileName(e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()))}function tr(t,r,n){var i=function(e){return t.getCanonicalFileName(e)},a=e.toPath(n?e.getDirectoryPath(n):t.getCommonSourceDirectory(),t.getCurrentDirectory(),i),o=e.getNormalizedAbsolutePath(r,t.getCurrentDirectory()),s=ai(e.getRelativePathToDirectoryOrUrl(a,o,a,i,!1));return n?e.ensurePathIsNonModuleName(s):s}function rr(e,t,r,n,i){var a=t.declarationDir||t.outDir,o=a?sr(e,a,r,n,i):e,s=nr(o);return ai(o)+s}function nr(t){return e.fileExtensionIsOneOf(t,[".mjs",".mts"])?".d.mts":e.fileExtensionIsOneOf(t,[".cjs",".cts"])?".d.cts":e.fileExtensionIsOneOf(t,[".json"])?".json.d.ts":".d.ts"}function ir(e){return e.outFile||e.out}function ar(e,t,r){return !(t.getCompilerOptions().noEmitForJsFiles&&be(e))&&!e.isDeclarationFile&&!t.isSourceFileFromExternalLibrary(e)&&(r||!(V(e)&&t.getResolvedProjectReferenceToRedirect(e.fileName))&&!t.isSourceOfProjectReferenceRedirect(e.fileName))}function or(e,t,r){return sr(e,r,t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))}function sr(t,r,n,i,a){var o=e.getNormalizedAbsolutePath(t,n);return o=0===a(o).indexOf(a(i))?o.substring(i.length):o,e.combinePaths(r,o)}function cr(t,r,n){t.length>e.getRootLength(t)&&!n(t)&&(cr(e.getDirectoryPath(t),r,n),r(t));}function lr(t,r){return e.computeLineOfPosition(t,r)}function ur(t){return e.find(t.members,(function(t){return e.isConstructorDeclaration(t)&&p(t.body)}))}function _r(e){if(e&&e.parameters.length>0){var t=2===e.parameters.length&&dr(e.parameters[0]);return e.parameters[t?1:0]}}function dr(e){return pr(e.name)}function pr(e){return !!e&&79===e.kind&&fr(e)}function fr(e){return 108===e.originalKeywordKind}function gr(t){if(xe(t)||!e.isFunctionDeclaration(t)){var r=t.type;return r||!xe(t)?r:e.isJSDocPropertyLikeTag(t)?t.typeExpression&&t.typeExpression.type:e.getJSDocType(t)}}function mr(e,t,r,n){yr(e,t,r.pos,n);}function yr(e,t,r,n){n&&n.length&&r!==n[0].pos&&lr(e,r)!==lr(e,n[0].pos)&&t.writeLine();}function vr(e,t,r,n,i,a,o,s){if(n&&n.length>0){i&&r.writeSpace(" ");for(var c=!1,l=0,u=n;l<u.length;l++){var _=u[l];c&&(r.writeSpace(" "),c=!1),s(e,t,r,_.pos,_.end,o),_.hasTrailingNewLine?r.writeLine():c=!0;}c&&a&&r.writeSpace(" ");}}function hr(t,r,n,i,a,o){var s=Math.min(r,o-1),c=e.trimString(t.substring(a,s));c?(n.writeComment(c),s!==r&&n.writeLine()):n.rawWrite(i);}function br(t,r,n){for(var i=0;r<n&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));r++)9===t.charCodeAt(r)?i+=Yt()-i%Yt():i++;return i}function xr(e,t){return !!Er(e,t)}function Dr(e,t){return !!kr(e,t)}function Sr(t){return e.isClassElement(t)&&Tr(t)||e.isClassStaticBlockDeclaration(t)}function Tr(e){return Dr(e,32)}function Cr(e){return xr(e,64)}function Er(e,t){return Fr(e)&t}function kr(e,t){return Ar(e)&t}function Nr(e,t,r){return e.kind>=0&&e.kind<=159?0:(536870912&e.modifierFlagsCache||(e.modifierFlagsCache=536870912|wr(e)),!t||4096&e.modifierFlagsCache||!r&&!xe(e)||!e.parent||(e.modifierFlagsCache|=4096|Pr(e)),-536875009&e.modifierFlagsCache)}function Fr(e){return Nr(e,!0)}function Ar(e){return Nr(e,!1)}function Pr(t){var r=0;return t.parent&&!e.isParameter(t)&&(xe(t)&&(e.getJSDocPublicTagNoCache(t)&&(r|=4),e.getJSDocPrivateTagNoCache(t)&&(r|=8),e.getJSDocProtectedTagNoCache(t)&&(r|=16),e.getJSDocReadonlyTagNoCache(t)&&(r|=64),e.getJSDocOverrideTagNoCache(t)&&(r|=16384)),e.getJSDocDeprecatedTagNoCache(t)&&(r|=8192)),r}function wr(e){var t=Ir(e.modifiers);return (4&e.flags||79===e.kind&&e.isInJSDocNamespace)&&(t|=1),t}function Ir(e){var t=0;if(e)for(var r=0,n=e;r<n.length;r++)t|=Or(n[r].kind);return t}function Or(e){switch(e){case 124:return 32;case 123:return 4;case 122:return 16;case 121:return 8;case 126:return 128;case 93:return 1;case 135:return 2;case 85:return 2048;case 88:return 512;case 131:return 256;case 144:return 64;case 158:return 16384}return 0}function Mr(e){return 75===e||76===e||77===e}function Lr(e){return e>=63&&e<=78}function Rr(e){var t=Br(e);return t&&!t.isImplements?t.class:void 0}function Br(t){return e.isExpressionWithTypeArguments(t)&&e.isHeritageClause(t.parent)&&e.isClassLike(t.parent.parent)?{class:t.parent.parent,isImplements:117===t.parent.token}:void 0}function jr(t,r){return e.isBinaryExpression(t)&&(r?63===t.operatorToken.kind:Lr(t.operatorToken.kind))&&e.isLeftHandSideExpression(t.left)}function Jr(e){return void 0!==Rr(e)}function zr(e){return 79===e.kind||Ur(e)}function Ur(t){return e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&zr(t.expression)}function Kr(e){return Re(e)&&"prototype"===Ue(e)}e.getIndentString=Xt,e.getIndentSize=Yt,e.createTextWriter=function(t){var r,n,i,a,o,s=!1;function c(t){var n=e.computeLineStarts(t);n.length>1?(a=a+n.length-1,o=r.length-t.length+e.last(n),i=o-r.length==0):i=!1;}function l(e){e&&e.length&&(i&&(e=Xt(n)+e,i=!1),r+=e,c(e));}function u(e){e&&(s=!1),l(e);}function _(){r="",n=0,i=!0,a=0,o=0,s=!1;}return _(),{write:u,rawWrite:function(e){void 0!==e&&(r+=e,c(e),s=!1);},writeLiteral:function(e){e&&e.length&&u(e);},writeLine:function(e){i&&!e||(a++,o=(r+=t).length,i=!0,s=!1);},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},getIndent:function(){return n},getTextPos:function(){return r.length},getLine:function(){return a},getColumn:function(){return i?n*Yt():r.length-o},getText:function(){return r},isAtStartOfLine:function(){return i},hasTrailingComment:function(){return s},hasTrailingWhitespace:function(){return !!r.length&&e.isWhiteSpaceLike(r.charCodeAt(r.length-1))},clear:_,reportInaccessibleThisError:e.noop,reportPrivateInBaseOfClassExpression:e.noop,reportInaccessibleUniqueSymbolError:e.noop,trackSymbol:function(){return !1},writeKeyword:u,writeOperator:u,writeParameter:u,writeProperty:u,writePunctuation:u,writeSpace:u,writeStringLiteral:u,writeSymbol:function(e,t){return u(e)},writeTrailingSemicolon:u,writeComment:function(e){e&&(s=!0),l(e);},getTextPosWithWriteLine:function(){return i?r.length:r.length+t.length}}},e.getTrailingSemicolonDeferringWriter=function(e){var t=!1;function r(){t&&(e.writeTrailingSemicolon(";"),t=!1);}return i$1(i$1({},e),{writeTrailingSemicolon:function(){t=!0;},writeLiteral:function(t){r(),e.writeLiteral(t);},writeStringLiteral:function(t){r(),e.writeStringLiteral(t);},writeSymbol:function(t,n){r(),e.writeSymbol(t,n);},writePunctuation:function(t){r(),e.writePunctuation(t);},writeKeyword:function(t){r(),e.writeKeyword(t);},writeOperator:function(t){r(),e.writeOperator(t);},writeParameter:function(t){r(),e.writeParameter(t);},writeSpace:function(t){r(),e.writeSpace(t);},writeProperty:function(t){r(),e.writeProperty(t);},writeComment:function(t){r(),e.writeComment(t);},writeLine:function(){r(),e.writeLine();},increaseIndent:function(){r(),e.increaseIndent();},decreaseIndent:function(){r(),e.decreaseIndent();}})},e.hostUsesCaseSensitiveFileNames=Zt,e.hostGetCanonicalFileName=function(t){return e.createGetCanonicalFileName(Zt(t))},e.getResolvedExternalModuleName=$t,e.getExternalModuleNameFromDeclaration=function(t,r,n){var i=r.getExternalModuleFileFromDeclaration(n);if(i&&!i.isDeclarationFile){var a=We(n);if(!a||!e.isStringLiteralLike(a)||e.pathIsRelative(a.text)||-1!==er(t,i.path).indexOf(er(t,e.ensureTrailingDirectorySeparator(t.getCommonSourceDirectory()))))return $t(t,i)}},e.getExternalModuleNameFromPath=tr,e.getOwnEmitOutputFilePath=function(e,t,r){var n=t.getCompilerOptions();return (n.outDir?ai(or(e,t,n.outDir)):ai(e))+r},e.getDeclarationEmitOutputFilePath=function(e,t){return rr(e,t.getCompilerOptions(),t.getCurrentDirectory(),t.getCommonSourceDirectory(),(function(e){return t.getCanonicalFileName(e)}))},e.getDeclarationEmitOutputFilePathWorker=rr,e.getDeclarationEmitExtensionForPath=nr,e.outFile=ir,e.getPathsBasePath=function(t,r){var n,i;if(t.paths)return null!==(n=t.baseUrl)&&void 0!==n?n:e.Debug.checkDefined(t.pathsBasePath||(null===(i=r.getCurrentDirectory)||void 0===i?void 0:i.call(r)),"Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'.")},e.getSourceFilesToEmit=function(t,r,n){var i=t.getCompilerOptions();if(ir(i)){var a=Cn(i),o=i.emitDeclarationOnly||a===e.ModuleKind.AMD||a===e.ModuleKind.System;return e.filter(t.getSourceFiles(),(function(r){return (o||!e.isExternalModule(r))&&ar(r,t,n)}))}var s=void 0===r?t.getSourceFiles():[r];return e.filter(s,(function(e){return ar(e,t,n)}))},e.sourceFileMayBeEmitted=ar,e.getSourceFilePathInNewDir=or,e.getSourceFilePathInNewDirWorker=sr,e.writeFile=function(t,r,n,i,a,o){t.writeFile(n,i,a,(function(t){r.add(hn(e.Diagnostics.Could_not_write_file_0_Colon_1,n,t));}),o);},e.writeFileEnsuringDirectories=function(t,r,n,i,a,o){try{i(t,r,n);}catch(s){cr(e.getDirectoryPath(e.normalizePath(t)),a,o),i(t,r,n);}},e.getLineOfLocalPosition=function(t,r){var n=e.getLineStarts(t);return e.computeLineOfPosition(n,r)},e.getLineOfLocalPositionFromLineMap=lr,e.getFirstConstructorWithBody=ur,e.getSetAccessorValueParameter=_r,e.getSetAccessorTypeAnnotationNode=function(e){var t=_r(e);return t&&t.type},e.getThisParameter=function(t){if(t.parameters.length&&!e.isJSDocSignature(t)){var r=t.parameters[0];if(dr(r))return r}},e.parameterIsThisKeyword=dr,e.isThisIdentifier=pr,e.isThisInTypeQuery=function(t){if(!pr(t))return !1;for(;e.isQualifiedName(t.parent)&&t.parent.left===t;)t=t.parent;return 180===t.parent.kind},e.identifierIsThisKeyword=fr,e.getAllAccessorDeclarations=function(t,r){var n,i,a,o;return St(r)?(n=r,171===r.kind?a=r:172===r.kind?o=r:e.Debug.fail("Accessor has wrong kind")):e.forEach(t,(function(t){e.isAccessor(t)&&Sr(t)===Sr(r)&&Ct(t.name)===Ct(r.name)&&(n?i||(i=t):n=t,171!==t.kind||a||(a=t),172!==t.kind||o||(o=t));})),{firstAccessor:n,secondAccessor:i,getAccessor:a,setAccessor:o}},e.getEffectiveTypeAnnotationNode=gr,e.getTypeAnnotationNode=function(e){return e.type},e.getEffectiveReturnTypeNode=function(t){return e.isJSDocSignature(t)?t.type&&t.type.typeExpression&&t.type.typeExpression.type:t.type||(xe(t)?e.getJSDocReturnType(t):void 0)},e.getJSDocTypeParameterDeclarations=function(t){return e.flatMap(e.getJSDocTags(t),(function(t){return function(t){return e.isJSDocTemplateTag(t)&&!(318===t.parent.kind&&t.parent.tags.some(He))}(t)?t.typeParameters:void 0}))},e.getEffectiveSetAccessorTypeAnnotationNode=function(e){var t=_r(e);return t&&gr(t)},e.emitNewLineBeforeLeadingComments=mr,e.emitNewLineBeforeLeadingCommentsOfPosition=yr,e.emitNewLineBeforeLeadingCommentOfPosition=function(e,t,r,n){r!==n&&lr(e,r)!==lr(e,n)&&t.writeLine();},e.emitComments=vr,e.emitDetachedComments=function(t,r,n,i,a,o,s){var c,l;if(s?0===a.pos&&(c=e.filter(e.getLeadingCommentRanges(t,a.pos),(function(e){return y(t,e.pos)}))):c=e.getLeadingCommentRanges(t,a.pos),c){for(var u=[],_=void 0,d=0,p=c;d<p.length;d++){var f=p[d];if(_){var g=lr(r,_.end);if(lr(r,f.pos)>=g+2)break}u.push(f),_=f;}u.length&&(g=lr(r,e.last(u).end),lr(r,e.skipTrivia(t,a.pos))>=g+2&&(mr(r,n,a,c),vr(t,r,n,u,!1,!0,o,i),l={nodePos:a.pos,detachedCommentEndPos:e.last(u).end}));}return l},e.writeCommentRange=function(t,r,n,i,a,o){if(42===t.charCodeAt(i+1))for(var s=e.computeLineAndCharacterOfPosition(r,i),c=r.length,l=void 0,u=i,_=s.line;u<a;_++){var d=_+1===c?t.length+1:r[_+1];if(u!==i){void 0===l&&(l=br(t,r[s.line],i));var p=n.getIndent()*Yt()-l+br(t,u,d);if(p>0){var f=p%Yt(),g=Xt((p-f)/Yt());for(n.rawWrite(g);f;)n.rawWrite(" "),f--;}else n.rawWrite("");}hr(t,a,n,o,u,d),u=d;}else n.writeComment(t.substring(i,a));},e.hasEffectiveModifiers=function(e){return 0!==Fr(e)},e.hasSyntacticModifiers=function(e){return 0!==Ar(e)},e.hasEffectiveModifier=xr,e.hasSyntacticModifier=Dr,e.isStatic=Sr,e.hasStaticModifier=Tr,e.hasOverrideModifier=function(e){return xr(e,16384)},e.hasAbstractModifier=function(e){return Dr(e,128)},e.hasAmbientModifier=function(e){return Dr(e,2)},e.hasEffectiveReadonlyModifier=Cr,e.getSelectedEffectiveModifierFlags=Er,e.getSelectedSyntacticModifierFlags=kr,e.getEffectiveModifierFlags=Fr,e.getEffectiveModifierFlagsAlwaysIncludeJSDoc=function(e){return Nr(e,!0,!0)},e.getSyntacticModifierFlags=Ar,e.getEffectiveModifierFlagsNoCache=function(e){return wr(e)|Pr(e)},e.getSyntacticModifierFlagsNoCache=wr,e.modifiersToFlags=Ir,e.modifierToFlag=Or,e.createModifiers=function(t){return t?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(t)):void 0},e.isLogicalOperator=function(e){return 56===e||55===e||53===e},e.isLogicalOrCoalescingAssignmentOperator=Mr,e.isLogicalOrCoalescingAssignmentExpression=function(e){return Mr(e.operatorToken.kind)},e.isAssignmentOperator=Lr,e.tryGetClassExtendingExpressionWithTypeArguments=Rr,e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments=Br,e.isAssignmentExpression=jr,e.isLeftHandSideOfAssignment=function(e){return jr(e.parent)&&e.parent.left===e},e.isDestructuringAssignment=function(e){if(jr(e,!0)){var t=e.left.kind;return 204===t||203===t}return !1},e.isExpressionWithTypeArgumentsInClassExtendsClause=Jr,e.isEntityNameExpression=zr,e.getFirstIdentifier=function(e){switch(e.kind){case 79:return e;case 160:do{e=e.left;}while(79!==e.kind);return e;case 205:do{e=e.expression;}while(79!==e.kind);return e}},e.isDottedName=function e(t){return 79===t.kind||108===t.kind||106===t.kind||230===t.kind||205===t.kind&&e(t.expression)||211===t.kind&&e(t.expression)},e.isPropertyAccessEntityNameExpression=Ur,e.tryGetPropertyAccessOrIdentifierToString=function t(r){if(e.isPropertyAccessExpression(r)){if(void 0!==(n=t(r.expression)))return n+"."+B(r.name)}else if(e.isElementAccessExpression(r)){var n;if(void 0!==(n=t(r.expression))&&e.isPropertyName(r.argumentExpression))return n+"."+Ct(r.argumentExpression)}else if(e.isIdentifier(r))return e.unescapeLeadingUnderscores(r.escapedText)},e.isPrototypeAccess=Kr,e.isRightSideOfQualifiedNameOrPropertyAccess=function(e){return 160===e.parent.kind&&e.parent.right===e||205===e.parent.kind&&e.parent.name===e},e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName=function(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t||e.isJSDocMemberName(t.parent)&&t.parent.right===t},e.isEmptyObjectLiteral=function(e){return 204===e.kind&&0===e.properties.length},e.isEmptyArrayLiteral=function(e){return 203===e.kind&&0===e.elements.length},e.getLocalSymbolForExportDefault=function(t){if(function(t){return t&&e.length(t.declarations)>0&&Dr(t.declarations[0],512)}(t)&&t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(i.localSymbol)return i.localSymbol}},e.tryExtractTSExtension=function(t){return e.find(Zn,(function(r){return e.fileExtensionIs(t,r)}))};var Vr,qr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Wr(t){for(var r,n,i,a,o="",s=function(t){for(var r=[],n=t.length,i=0;i<n;i++){var a=t.charCodeAt(i);a<128?r.push(a):a<2048?(r.push(a>>6|192),r.push(63&a|128)):a<65536?(r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)):a<131072?(r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)):e.Debug.assert(!1,"Unexpected code point");}return r}(t),c=0,l=s.length;c<l;)r=s[c]>>2,n=(3&s[c])<<4|s[c+1]>>4,i=(15&s[c+1])<<2|s[c+2]>>6,a=63&s[c+2],c+1>=l?i=a=64:c+2>=l&&(a=64),o+=qr.charAt(r)+qr.charAt(n)+qr.charAt(i)+qr.charAt(a),c+=3;return o}function Hr(t,r){return void 0===r&&(r=t),e.Debug.assert(r>=t||-1===r),{pos:t,end:r}}function Gr(e,t){return Hr(t,e.end)}function Qr(e){return e.decorators&&e.decorators.length>0?Gr(e,e.decorators.end):e}function Xr(e,t,r){return Yr(Zr(e,r,!1),t.end,r)}function Yr(t,r,n){return 0===e.getLinesBetweenPositions(n,t,r)}function Zr(t,r,n){return li(t.pos)?-1:e.skipTrivia(r.text,t.pos,!1,n)}function $r(e){return void 0!==e.initializer}function en(e){return 33554432&e.flags?e.checkFlags:0}function tn(t){var r=t.parent;if(!r)return 0;switch(r.kind){case 211:return tn(r);case 219:case 218:var n=r.operator;return 45===n||46===n?c():0;case 220:var i=r,a=i.left,o=i.operatorToken;return a===t&&Lr(o.kind)?63===o.kind?1:c():0;case 205:return r.name!==t?0:tn(r);case 294:var s=tn(r.parent);return t===r.name?function(t){switch(t){case 0:return 1;case 1:return 0;case 2:return 2;default:return e.Debug.assertNever(t)}}(s):s;case 295:return t===r.objectAssignmentInitializer?0:tn(r.parent);case 203:return tn(r);default:return 0}function c(){return r.parent&&237===ct(r.parent).kind?1:2}}function rn(e,t,r){var n=r.onDeleteValue,i=r.onExistingValue;e.forEach((function(r,a){var o=t.get(a);void 0===o?(e.delete(a),n(r,a)):i&&i(r,o,a);}));}function nn(t){var r;return null===(r=t.declarations)||void 0===r?void 0:r.find(e.isClassLike)}function an(e){return 205===e.kind||206===e.kind}function on(e){for(;an(e);)e=e.expression;return e}function sn(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=void 0,this.mergeId=void 0,this.parent=void 0;}function cn(t,r){this.flags=r,(e.Debug.isDebugging||e.tracing)&&(this.checker=t);}function ln(t,r){this.flags=r,e.Debug.isDebugging&&(this.checker=t);}function un(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0;}function _n(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0;}function dn(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.flowNode=void 0;}function pn(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||function(e){return e};}function fn(t,r,n){return void 0===n&&(n=0),t.replace(/{(\d+)}/g,(function(t,i){return ""+e.Debug.checkDefined(r[+i+n])}))}function gn(t){return e.localizedDiagnosticMessages&&e.localizedDiagnosticMessages[t.key]||t.message}function mn(e){return void 0===e.file&&void 0!==e.start&&void 0!==e.length&&"string"==typeof e.fileName}function yn(t,r){var n=r.fileName||"",i=r.text.length;e.Debug.assertEqual(t.fileName,n),e.Debug.assertLessThanOrEqual(t.start,i),e.Debug.assertLessThanOrEqual(t.start+t.length,i);var a={file:r,start:t.start,length:t.length,messageText:t.messageText,category:t.category,code:t.code,reportsUnnecessary:t.reportsUnnecessary};if(t.relatedInformation){a.relatedInformation=[];for(var o=0,s=t.relatedInformation;o<s.length;o++){var c=s[o];mn(c)&&c.fileName===n?(e.Debug.assertLessThanOrEqual(c.start,i),e.Debug.assertLessThanOrEqual(c.start+c.length,i),a.relatedInformation.push(yn(c,r))):a.relatedInformation.push(c);}}return a}function vn(e,t,r,n){J(e,t,r);var i=gn(n);return arguments.length>4&&(i=fn(i,arguments,4)),{file:e,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated}}function hn(e){var t=gn(e);return arguments.length>1&&(t=fn(t,arguments,1)),{file:void 0,start:void 0,length:void 0,messageText:t,category:e.category,code:e.code,reportsUnnecessary:e.reportsUnnecessary,reportsDeprecated:e.reportsDeprecated}}function bn(e){return e.file?e.file.path:void 0}function xn(t,r){return Dn(t,r)||function(t,r){return t.relatedInformation||r.relatedInformation?t.relatedInformation&&r.relatedInformation?e.compareValues(t.relatedInformation.length,r.relatedInformation.length)||e.forEach(t.relatedInformation,(function(e,t){return xn(e,r.relatedInformation[t])}))||0:t.relatedInformation?-1:1:0}(t,r)||0}function Dn(t,r){return e.compareStringsCaseSensitive(bn(t),bn(r))||e.compareValues(t.start,r.start)||e.compareValues(t.length,r.length)||e.compareValues(t.code,r.code)||Sn(t.messageText,r.messageText)||0}function Sn(t,r){if("string"==typeof t&&"string"==typeof r)return e.compareStringsCaseSensitive(t,r);if("string"==typeof t)return -1;if("string"==typeof r)return 1;var n=e.compareStringsCaseSensitive(t.messageText,r.messageText);if(n)return n;if(!t.next&&!r.next)return 0;if(!t.next)return -1;if(!r.next)return 1;for(var i=Math.min(t.next.length,r.next.length),a=0;a<i;a++)if(n=Sn(t.next[a],r.next[a]))return n;return t.next.length<r.next.length?-1:t.next.length>r.next.length?1:0}function Tn(t){return t.target||t.module===e.ModuleKind.Node12&&7||t.module===e.ModuleKind.NodeNext&&99||0}function Cn(t){return "number"==typeof t.module?t.module:Tn(t)>=2?e.ModuleKind.ES2015:e.ModuleKind.CommonJS}function En(t){if(void 0!==t.esModuleInterop)return t.esModuleInterop;switch(Cn(t)){case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return !0}}function kn(e){return !(!e.declaration&&!e.composite)}function Nn(e,t){return void 0===e[t]?!!e.strict:!!e[t]}function Fn(e){return void 0===e.allowJs?!!e.checkJs:e.allowJs}function An(e,t){return t.strictFlag?Nn(e,t.name):e[t.name]}function Pn(t,r,n,i){for(var a=e.getPathComponents(e.getNormalizedAbsolutePath(t,n)),o=e.getPathComponents(e.getNormalizedAbsolutePath(r,n)),s=!1;a.length>=2&&o.length>=2&&!wn(a[a.length-2],i)&&!wn(o[o.length-2],i)&&i(a[a.length-1])===i(o[o.length-1]);)a.pop(),o.pop(),s=!0;return s?[e.getPathFromPathComponents(a),e.getPathFromPathComponents(o)]:void 0}function wn(t,r){return void 0!==t&&("node_modules"===r(t)||e.startsWith(t,"@"))}e.convertToBase64=Wr,e.base64encode=function(e,t){return e&&e.base64encode?e.base64encode(t):Wr(t)},e.base64decode=function(e,t){if(e&&e.base64decode)return e.base64decode(t);for(var r=t.length,n=[],i=0;i<r&&t.charCodeAt(i)!==qr.charCodeAt(64);){var a=qr.indexOf(t[i]),o=qr.indexOf(t[i+1]),s=qr.indexOf(t[i+2]),c=qr.indexOf(t[i+3]),l=(63&a)<<2|o>>4&3,u=(15&o)<<4|s>>2&15,_=(3&s)<<6|63&c;0===u&&0!==s?n.push(l):0===_&&0!==c?n.push(l,u):n.push(l,u,_),i+=4;}return function(e){for(var t="",r=0,n=e.length;r<n;){var i=e[r];if(i<128)t+=String.fromCharCode(i),r++;else if(192==(192&i)){for(var a=63&i,o=e[++r];128==(192&o);)a=a<<6|63&o,o=e[++r];t+=String.fromCharCode(a);}else t+=String.fromCharCode(i),r++;}return t}(n)},e.readJson=function(t,r){try{var n=r.readFile(t);if(!n)return {};var i=e.parseConfigFileTextToJson(t,n);return i.error?{}:i.config}catch(e){return {}}},e.directoryProbablyExists=function(e,t){return !t.directoryExists||t.directoryExists(e)},e.getNewLineCharacter=function(t,r){switch(t.newLine){case 0:return "\r\n";case 1:return "\n"}return r?r():e.sys?e.sys.newLine:"\r\n"},e.createRange=Hr,e.moveRangeEnd=function(e,t){return Hr(e.pos,t)},e.moveRangePos=Gr,e.moveRangePastDecorators=Qr,e.moveRangePastModifiers=function(e){return e.modifiers&&e.modifiers.length>0?Gr(e,e.modifiers.end):Qr(e)},e.isCollapsedRange=function(e){return e.pos===e.end},e.createTokenRange=function(t,r){return Hr(t,t+e.tokenToString(r).length)},e.rangeIsOnSingleLine=function(e,t){return Xr(e,e,t)},e.rangeStartPositionsAreOnSameLine=function(e,t,r){return Yr(Zr(e,r,!1),Zr(t,r,!1),r)},e.rangeEndPositionsAreOnSameLine=function(e,t,r){return Yr(e.end,t.end,r)},e.rangeStartIsOnSameLineAsRangeEnd=Xr,e.rangeEndIsOnSameLineAsRangeStart=function(e,t,r){return Yr(e.end,Zr(t,r,!1),r)},e.getLinesBetweenRangeEndAndRangeStart=function(t,r,n,i){var a=Zr(r,n,i);return e.getLinesBetweenPositions(n,t.end,a)},e.getLinesBetweenRangeEndPositions=function(t,r,n){return e.getLinesBetweenPositions(n,t.end,r.end)},e.isNodeArrayMultiLine=function(e,t){return !Yr(e.pos,e.end,t)},e.positionsAreOnSameLine=Yr,e.getStartPositionOfRange=Zr,e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i),o=function(t,r,n){for(void 0===r&&(r=0);t-- >r;)if(!e.isWhiteSpaceLike(n.text.charCodeAt(t)))return t}(a,r,n);return e.getLinesBetweenPositions(n,null!=o?o:r,a)},e.getLinesBetweenPositionAndNextNonWhitespaceCharacter=function(t,r,n,i){var a=e.skipTrivia(n.text,t,!1,i);return e.getLinesBetweenPositions(n,t,Math.min(r,a))},e.isDeclarationNameOfEnumOrNamespace=function(t){var r=e.getParseTreeNode(t);if(r)switch(r.parent.kind){case 259:case 260:return r===r.parent.name}return !1},e.getInitializedVariables=function(t){return e.filter(t.declarations,$r)},e.isWatchSet=function(e){return e.watch&&e.hasOwnProperty("watch")},e.closeFileWatcher=function(e){e.close();},e.getCheckFlags=en,e.getDeclarationModifierFlagsFromSymbol=function(t,r){if(void 0===r&&(r=!1),t.valueDeclaration){var n=r&&t.declarations&&e.find(t.declarations,(function(e){return 172===e.kind}))||t.valueDeclaration,i=e.getCombinedModifierFlags(n);return t.parent&&32&t.parent.flags?i:-29&i}if(6&en(t)){var a=t.checkFlags;return (1024&a?8:256&a?4:16)|(2048&a?32:0)}return 4194304&t.flags?36:0},e.skipAlias=function(e,t){return 2097152&e.flags?t.getAliasedSymbol(e):e},e.getCombinedLocalAndExportSymbolFlags=function(e){return e.exportSymbol?e.exportSymbol.flags|e.flags:e.flags},e.isWriteOnlyAccess=function(e){return 1===tn(e)},e.isWriteAccess=function(e){return 0!==tn(e)},function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite";}(Vr||(Vr={})),e.compareDataObjects=function e(t,r){if(!t||!r||Object.keys(t).length!==Object.keys(r).length)return !1;for(var n in t)if("object"==typeof t[n]){if(!e(t[n],r[n]))return !1}else if("function"!=typeof t[n]&&t[n]!==r[n])return !1;return !0},e.clearMap=function(e,t){e.forEach(t),e.clear();},e.mutateMapSkippingNewValues=rn,e.mutateMap=function(e,t,r){rn(e,t,r);var n=r.createNewValue;t.forEach((function(t,r){e.has(r)||e.set(r,n(r,t));}));},e.isAbstractConstructorSymbol=function(e){if(32&e.flags){var t=nn(e);return !!t&&Dr(t,128)}return !1},e.getClassLikeDeclarationOfSymbol=nn,e.getObjectFlags=function(e){return 3899393&e.flags?e.objectFlags:0},e.typeHasCallOrConstructSignatures=function(e,t){return 0!==t.getSignaturesOfType(e,0).length||0!==t.getSignaturesOfType(e,1).length},e.forSomeAncestorDirectory=function(t,r){return !!e.forEachAncestorDirectory(t,(function(e){return !!r(e)||void 0}))},e.isUMDExportSymbol=function(t){return !!t&&!!t.declarations&&!!t.declarations[0]&&e.isNamespaceExportDeclaration(t.declarations[0])},e.showModuleSpecifier=function(t){var r=t.moduleSpecifier;return e.isStringLiteral(r)?r.text:x(r)},e.getLastChild=function(t){var r;return e.forEachChild(t,(function(e){p(e)&&(r=e);}),(function(e){for(var t=e.length-1;t>=0;t--)if(p(e[t])){r=e[t];break}})),r},e.addToSeen=function(e,t,r){return void 0===r&&(r=!0),!e.has(t)&&(e.set(t,r),!0)},e.isObjectTypeDeclaration=function(t){return e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isTypeLiteralNode(t)},e.isTypeNodeKind=function(e){return e>=176&&e<=199||130===e||154===e||146===e||157===e||147===e||133===e||149===e||150===e||114===e||152===e||143===e||227===e||310===e||311===e||312===e||313===e||314===e||315===e||316===e},e.isAccessExpression=an,e.getNameOfAccessExpression=function(t){return 205===t.kind?t.name:(e.Debug.assert(206===t.kind),t.argumentExpression)},e.isBundleFileTextLike=function(e){switch(e.kind){case"text":case"internal":return !0;default:return !1}},e.isNamedImportsOrExports=function(e){return 268===e.kind||272===e.kind},e.getLeftmostAccessExpression=on,e.getLeftmostExpression=function(e,t){for(;;){switch(e.kind){case 219:e=e.operand;continue;case 220:e=e.left;continue;case 221:e=e.condition;continue;case 209:e=e.tag;continue;case 207:if(t)return e;case 228:case 206:case 205:case 229:case 348:e=e.expression;continue}return e}},e.objectAllocator={getNodeConstructor:function(){return un},getTokenConstructor:function(){return _n},getIdentifierConstructor:function(){return dn},getPrivateIdentifierConstructor:function(){return un},getSourceFileConstructor:function(){return un},getSymbolConstructor:function(){return sn},getTypeConstructor:function(){return cn},getSignatureConstructor:function(){return ln},getSourceMapSourceConstructor:function(){return pn}},e.setObjectAllocator=function(t){e.objectAllocator=t;},e.formatStringFromArgs=fn,e.setLocalizedDiagnosticMessages=function(t){e.localizedDiagnosticMessages=t;},e.getLocaleSpecificMessage=gn,e.createDetachedDiagnostic=function(e,t,r,n){J(void 0,t,r);var i=gn(n);return arguments.length>4&&(i=fn(i,arguments,4)),{file:void 0,start:t,length:r,messageText:i,category:n.category,code:n.code,reportsUnnecessary:n.reportsUnnecessary,fileName:e}},e.attachFileToDiagnostics=function(e,t){for(var r=[],n=0,i=e;n<i.length;n++){var a=i[n];r.push(yn(a,t));}return r},e.createFileDiagnostic=vn,e.formatMessage=function(e,t){var r=gn(t);return arguments.length>2&&(r=fn(r,arguments,2)),r},e.createCompilerDiagnostic=hn,e.createCompilerDiagnosticFromMessageChain=function(e,t){return {file:void 0,start:void 0,length:void 0,code:e.code,category:e.category,messageText:e.next?e:e.messageText,relatedInformation:t}},e.chainDiagnosticMessages=function(e,t){var r=gn(t);return arguments.length>2&&(r=fn(r,arguments,2)),{messageText:r,category:t.category,code:t.code,next:void 0===e||Array.isArray(e)?e:[e]}},e.concatenateDiagnosticMessageChains=function(e,t){for(var r=e;r.next;)r=r.next[0];r.next=[t];},e.compareDiagnostics=xn,e.compareDiagnosticsSkipRelatedInformation=Dn,e.getLanguageVariant=function(e){return 4===e||2===e||1===e||6===e?1:0},e.getEmitScriptTarget=Tn,e.getEmitModuleKind=Cn,e.getEmitModuleResolutionKind=function(t){var r=t.moduleResolution;if(void 0===r)switch(Cn(t)){case e.ModuleKind.CommonJS:r=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node12:r=e.ModuleResolutionKind.Node12;break;case e.ModuleKind.NodeNext:r=e.ModuleResolutionKind.NodeNext;break;default:r=e.ModuleResolutionKind.Classic;}return r},e.hasJsonModuleEmitEnabled=function(t){switch(Cn(t)){case e.ModuleKind.CommonJS:case e.ModuleKind.AMD:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return !0;default:return !1}},e.unreachableCodeIsError=function(e){return !1===e.allowUnreachableCode},e.unusedLabelIsError=function(e){return !1===e.allowUnusedLabels},e.getAreDeclarationMapsEnabled=function(e){return !(!kn(e)||!e.declarationMap)},e.getESModuleInterop=En,e.getAllowSyntheticDefaultImports=function(t){var r=Cn(t);return void 0!==t.allowSyntheticDefaultImports?t.allowSyntheticDefaultImports:En(t)||r===e.ModuleKind.System},e.getEmitDeclarations=kn,e.shouldPreserveConstEnums=function(e){return !(!e.preserveConstEnums&&!e.isolatedModules)},e.isIncrementalCompilation=function(e){return !(!e.incremental&&!e.composite)},e.getStrictOptionValue=Nn,e.getAllowJSCompilerOption=Fn,e.getUseDefineForClassFields=function(e){return void 0===e.useDefineForClassFields?99===Tn(e):e.useDefineForClassFields},e.compilerOptionsAffectSemanticDiagnostics=function(t,r){return c(r,t,e.semanticDiagnosticsOptionDeclarations)},e.compilerOptionsAffectEmit=function(t,r){return c(r,t,e.affectsEmitOptionDeclarations)},e.getCompilerOptionValue=An,e.getJSXTransformEnabled=function(e){var t=e.jsx;return 2===t||4===t||5===t},e.getJSXImplicitImportBase=function(t,r){var n=null==r?void 0:r.pragmas.get("jsximportsource"),i=e.isArray(n)?n[n.length-1]:n;return 4===t.jsx||5===t.jsx||t.jsxImportSource||i?(null==i?void 0:i.arguments.factory)||t.jsxImportSource||"react":void 0},e.getJSXRuntimeImport=function(e,t){return e?"".concat(e,"/").concat(5===t.jsx?"jsx-dev-runtime":"jsx-runtime"):void 0},e.hasZeroOrOneAsteriskCharacter=function(e){for(var t=!1,r=0;r<e.length;r++)if(42===e.charCodeAt(r)){if(t)return !1;t=!0;}return !0},e.createSymlinkCache=function(t,r){var n,i,a,o=!1;return {getSymlinkedFiles:function(){return a},getSymlinkedDirectories:function(){return n},getSymlinkedDirectoriesByRealpath:function(){return i},setSymlinkedFile:function(t,r){return (a||(a=new e.Map)).set(t,r)},setSymlinkedDirectory:function(a,o){var s=e.toPath(a,t,r);vi(s)||(s=e.ensureTrailingDirectorySeparator(s),!1===o||(null==n?void 0:n.has(s))||(i||(i=e.createMultiMap())).add(e.ensureTrailingDirectorySeparator(o.realPath),a),(n||(n=new e.Map)).set(s,o));},setSymlinkedDirectoryFromSymlinkedFile:function(n,i){this.setSymlinkedFile(e.toPath(n,t,r),i);var a=Pn(i,n,t,r)||e.emptyArray,o=a[0],s=a[1];o&&s&&this.setSymlinkedDirectory(s,{real:o,realPath:e.toPath(o,t,r)});},setSymlinksFromResolutions:function(t,r){var n,i=this;e.Debug.assert(!o),o=!0;for(var a=0,c=t;a<c.length;a++)null===(n=c[a].resolvedModules)||void 0===n||n.forEach((function(e){return s(i,e)}));null==r||r.forEach((function(e){return s(i,e)}));},hasProcessedResolutions:function(){return o}};function s(n,i){if(i&&i.originalPath&&i.resolvedFileName){var a=i.resolvedFileName,o=i.originalPath;n.setSymlinkedFile(e.toPath(o,t,r),a);var s=Pn(a,o,t,r)||e.emptyArray,c=s[0],l=s[1];c&&l&&n.setSymlinkedDirectory(l,{real:c,realPath:e.toPath(c,t,r)});}}},e.tryRemoveDirectoryPrefix=function(t,r,n){var i,a=e.tryRemovePrefix(t,r,n);return void 0===a?void 0:(i=a,e.isAnyDirectorySeparator(i.charCodeAt(0))?i.slice(1):void 0)};var In=/[^\w\s\/]/g;function On(e){return "\\"+e}e.regExpEscape=function(e){return e.replace(In,On)};var Mn=[42,63];e.commonPackageFolders=["node_modules","bower_components","jspm_packages"];var Ln="(?!(".concat(e.commonPackageFolders.join("|"),")(/|$))"),Rn={singleAsteriskRegexFragment:"([^./]|(\\.(?!min\\.js$))?)*",doubleAsteriskRegexFragment:"(/".concat(Ln,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return qn(e,Rn.singleAsteriskRegexFragment)}},Bn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/".concat(Ln,"[^/.][^/]*)*?"),replaceWildcardCharacter:function(e){return qn(e,Bn.singleAsteriskRegexFragment)}},jn={singleAsteriskRegexFragment:"[^/]*",doubleAsteriskRegexFragment:"(/.+?)?",replaceWildcardCharacter:function(e){return qn(e,jn.singleAsteriskRegexFragment)}},Jn={files:Rn,directories:Bn,exclude:jn};function zn(e,t,r){var n=Un(e,t,r);if(n&&n.length){var i=n.map((function(e){return "(".concat(e,")")})).join("|"),a="exclude"===r?"($|/)":"$";return "^(".concat(i,")").concat(a)}}function Un(t,r,n){if(void 0!==t&&0!==t.length)return e.flatMap(t,(function(e){return e&&Vn(e,r,n,Jn[n])}))}function Kn(e){return !/[.*?]/.test(e)}function Vn(t,r,n,i){var a=i.singleAsteriskRegexFragment,o=i.doubleAsteriskRegexFragment,s=i.replaceWildcardCharacter,c="",l=!1,u=e.getNormalizedPathComponents(t,r),_=e.last(u);if("exclude"===n||"**"!==_){u[0]=e.removeTrailingDirectorySeparator(u[0]),Kn(_)&&u.push("**","*");for(var d=0,p=0,f=u;p<f.length;p++){var g=f[p];if("**"===g)c+=o;else if("directories"===n&&(c+="(",d++),l&&(c+=e.directorySeparator),"exclude"!==n){var m="";42===g.charCodeAt(0)?(m+="([^./]"+a+")?",g=g.substr(1)):63===g.charCodeAt(0)&&(m+="[^./]",g=g.substr(1)),(m+=g.replace(In,s))!==g&&(c+=Ln),c+=m;}else c+=g.replace(In,s);l=!0;}for(;d>0;)c+=")?",d--;return c}}function qn(e,t){return "*"===e?t:"?"===e?"[^/]":"\\"+e}function Wn(t,r,n,i,a){t=e.normalizePath(t),a=e.normalizePath(a);var o=e.combinePaths(a,t);return {includeFilePatterns:e.map(Un(n,o,"files"),(function(e){return "^".concat(e,"$")})),includeFilePattern:zn(n,o,"files"),includeDirectoryPattern:zn(n,o,"directories"),excludePattern:zn(r,o,"exclude"),basePaths:Gn(t,n,i)}}function Hn(e,t){return new RegExp(e,t?"":"i")}function Gn(t,r,n){var i=[t];if(r){for(var a=[],o=0,s=r;o<s.length;o++){var c=s[o],l=e.isRootedDiskPath(c)?c:e.normalizePath(e.combinePaths(t,c));a.push(Qn(l));}a.sort(e.getStringComparer(!n));for(var u=function(r){e.every(i,(function(i){return !e.containsPath(i,r,t,!n)}))&&i.push(r);},_=0,d=a;_<d.length;_++)u(d[_]);}return i}function Qn(t){var r=e.indexOfAnyCharCode(t,Mn);return r<0?e.hasExtension(t)?e.removeTrailingDirectorySeparator(e.getDirectoryPath(t)):t:t.substring(0,t.lastIndexOf(e.directorySeparator,r))}function Xn(e){switch(e.substr(e.lastIndexOf(".")).toLowerCase()){case".js":case".cjs":case".mjs":return 1;case".jsx":return 2;case".ts":case".cts":case".mts":return 3;case".tsx":return 4;case".json":return 6;default:return 0}}e.getRegularExpressionForWildcard=zn,e.getRegularExpressionsForWildcards=Un,e.isImplicitGlob=Kn,e.getPatternFromSpec=function(e,t,r){var n=e&&Vn(e,t,r,Jn[r]);return n&&"^(".concat(n,")").concat("exclude"===r?"($|/)":"$")},e.getFileMatcherPatterns=Wn,e.getRegexFromPattern=Hn,e.matchFiles=function(t,r,n,i,a,o,s,c,l){t=e.normalizePath(t),o=e.normalizePath(o);for(var u=Wn(t,n,i,a,o),_=u.includeFilePatterns&&u.includeFilePatterns.map((function(e){return Hn(e,a)})),d=u.includeDirectoryPattern&&Hn(u.includeDirectoryPattern,a),p=u.excludePattern&&Hn(u.excludePattern,a),f=_?_.map((function(){return []})):[[]],g=new e.Map,m=e.createGetCanonicalFileName(a),y=0,v=u.basePaths;y<v.length;y++){var h=v[y];b(h,e.combinePaths(o,h),s);}return e.flatten(f);function b(t,n,i){var a=m(l(n));if(!g.has(a)){g.set(a,!0);for(var o=c(t),s=o.files,u=o.directories,y=function(i){var a=e.combinePaths(t,i),o=e.combinePaths(n,i);if(r&&!e.fileExtensionIsOneOf(a,r))return "continue";if(p&&p.test(o))return "continue";if(_){var s=e.findIndex(_,(function(e){return e.test(o)}));-1!==s&&f[s].push(a);}else f[0].push(a);},v=0,h=e.sort(s,e.compareStringsCaseSensitive);v<h.length;v++)y(S=h[v]);if(void 0===i||0!=--i)for(var x=0,D=e.sort(u,e.compareStringsCaseSensitive);x<D.length;x++){var S=D[x],T=e.combinePaths(t,S),C=e.combinePaths(n,S);d&&!d.test(C)||p&&p.test(C)||b(T,C,i);}}}},e.ensureScriptKind=function(e,t){return t||Xn(e)||3},e.getScriptKindFromFileName=Xn,e.supportedTSExtensions=[[".ts",".tsx",".d.ts"],[".cts",".d.cts"],[".mts",".d.mts"]],e.supportedTSExtensionsFlat=e.flatten(e.supportedTSExtensions);var Yn=n$3(n$3([],e.supportedTSExtensions,!0),[[".json"]],!1),Zn=[".d.ts",".d.cts",".d.mts",".cts",".mts",".ts",".tsx",".cts",".mts"];e.supportedJSExtensions=[[".js",".jsx"],[".mjs"],[".cjs"]],e.supportedJSExtensionsFlat=e.flatten(e.supportedJSExtensions);var $n=[[".ts",".tsx",".d.ts",".js",".jsx"],[".cts",".d.cts",".cjs"],[".mts",".d.mts",".mjs"]],ei=n$3(n$3([],$n,!0),[[".json"]],!1);function ti(t,r){var i=t&&Fn(t);if(!r||0===r.length)return i?$n:e.supportedTSExtensions;var a=i?$n:e.supportedTSExtensions,o=e.flatten(a);return n$3(n$3([],a,!0),e.mapDefined(r,(function(e){return 7===e.scriptKind||i&&(1===(t=e.scriptKind)||2===t)&&-1===o.indexOf(e.extension)?[e.extension]:void 0;var t;})),!0)}function ri(t,r){return t&&t.resolveJsonModule?r===$n?ei:r===e.supportedTSExtensions?Yn:n$3(n$3([],r,!0),[[".json"]],!1):r}function ni(e){var t=e.match(/\//g);return t?t.length:0}e.getSupportedExtensions=ti,e.getSupportedExtensionsWithJsonIfResolveJsonModule=ri,e.hasJSFileExtension=function(t){return e.some(e.supportedJSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.hasTSFileExtension=function(t){return e.some(e.supportedTSExtensionsFlat,(function(r){return e.fileExtensionIs(t,r)}))},e.isSupportedSourceFileName=function(t,r,n){if(!t)return !1;for(var i=ti(r,n),a=0,o=e.flatten(ri(r,i));a<o.length;a++){var s=o[a];if(e.fileExtensionIs(t,s))return !0}return !1},e.compareNumberOfDirectorySeparators=function(t,r){return e.compareValues(ni(t),ni(r))};var ii=[".d.ts",".d.mts",".d.cts",".mjs",".mts",".cjs",".cts",".ts",".js",".tsx",".jsx",".json"];function ai(e){for(var t=0,r=ii;t<r.length;t++){var n=oi(e,r[t]);if(void 0!==n)return n}return e}function oi(t,r){return e.fileExtensionIs(t,r)?si(t,r):void 0}function si(e,t){return e.substring(0,e.length-t.length)}function ci(e){var t=e.indexOf("*");return -1===t?e:-1!==e.indexOf("*",t+1)?void 0:{prefix:e.substr(0,t),suffix:e.substr(t+1)}}function li(e){return !(e>=0)}function ui(e){return ".ts"===e||".tsx"===e||".d.ts"===e||".cts"===e||".mts"===e||".d.mts"===e||".d.cts"===e}function _i(t){return e.find(ii,(function(r){return e.fileExtensionIs(t,r)}))}function di(t,r){return t===r||"object"==typeof t&&null!==t&&"object"==typeof r&&null!==r&&e.equalOwnProperties(t,r,di)}function pi(e,t){return e.pos=t,e}function fi(e,t){return e.end=t,e}function gi(e,t,r){return fi(pi(e,t),r)}function mi(e,t){return e&&t&&(e.parent=t),e}function yi(t){return !e.isOmittedExpression(t)}function vi(t){return e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))}function hi(e){return 253===e.kind&&291===e.parent.kind}e.removeFileExtension=ai,e.tryRemoveExtension=oi,e.removeExtension=si,e.changeExtension=function(t,r){return e.changeAnyExtension(t,r,ii,!1)},e.tryParsePattern=ci,e.tryParsePatterns=function(t){return e.mapDefined(e.getOwnKeys(t),(function(e){return ci(e)}))},e.positionIsSynthesized=li,e.extensionIsTS=ui,e.resolutionExtensionIsTSOrJson=function(e){return ui(e)||".json"===e},e.extensionFromPath=function(t){var r=_i(t);return void 0!==r?r:e.Debug.fail("File ".concat(t," has unknown extension."))},e.isAnySupportedFileExtension=function(e){return void 0!==_i(e)},e.tryGetExtensionFromPath=_i,e.isCheckJsEnabledForFile=function(e,t){return e.checkJsDirective?e.checkJsDirective.enabled:t.checkJs},e.emptyFileSystemEntries={files:e.emptyArray,directories:e.emptyArray},e.matchPatternOrExact=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i];if(o===r)return r;e.isString(o)||n.push(o);}return e.findBestPatternMatch(n,(function(e){return e}),r)},e.sliceAfter=function(t,r){var n=t.indexOf(r);return e.Debug.assert(-1!==n),t.slice(n)},e.addRelatedInfo=function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return n.length?(t.relatedInformation||(t.relatedInformation=[]),e.Debug.assert(t.relatedInformation!==e.emptyArray,"Diagnostic had empty array singleton for related info, but is still being constructed!"),(r=t.relatedInformation).push.apply(r,n),t):t},e.minAndMax=function(t,r){e.Debug.assert(0!==t.length);for(var n=r(t[0]),i=n,a=1;a<t.length;a++){var o=r(t[a]);o<n?n=o:o>i&&(i=o);}return {min:n,max:i}},e.rangeOfNode=function(e){return {pos:v(e),end:e.end}},e.rangeOfTypeParameters=function(t,r){return {pos:r.pos-1,end:e.skipTrivia(t.text,r.end)+1}},e.skipTypeChecking=function(e,t,r){return t.skipLibCheck&&e.isDeclarationFile||t.skipDefaultLibCheck&&e.hasNoDefaultLib||r.isSourceOfProjectReferenceRedirect(e.fileName)},e.isJsonEqual=di,e.parsePseudoBigInt=function(e){var t;switch(e.charCodeAt(1)){case 98:case 66:t=1;break;case 111:case 79:t=3;break;case 120:case 88:t=4;break;default:for(var r=e.length-1,n=0;48===e.charCodeAt(n);)n++;return e.slice(n,r)||"0"}for(var i=e.length-1,a=(i-2)*t,o=new Uint16Array((a>>>4)+(15&a?1:0)),s=i-1,c=0;s>=2;s--,c+=t){var l=c>>>4,u=e.charCodeAt(s),_=(u<=57?u-48:10+u-(u<=70?65:97))<<(15&c);o[l]|=_;var d=_>>>16;d&&(o[l+1]|=d);}for(var p="",f=o.length-1,g=!0;g;){var m=0;for(g=!1,l=f;l>=0;l--){var y=m<<16|o[l],v=y/10|0;o[l]=v,m=y-10*v,v&&!g&&(f=l,g=!0);}p=m+p;}return p},e.pseudoBigIntToString=function(e){var t=e.negative,r=e.base10Value;return (t&&"0"!==r?"-":"")+r},e.isValidTypeOnlyAliasUseSite=function(t){return !!(8388608&t.flags)||ve(t)||function(t){if(79!==t.kind)return !1;var r=e.findAncestor(t.parent,(function(e){switch(e.kind){case 290:return !0;case 205:case 227:return !1;default:return "quit"}}));return 117===(null==r?void 0:r.token)||257===(null==r?void 0:r.parent.kind)}(t)||function(e){for(;79===e.kind||205===e.kind;)e=e.parent;if(161!==e.kind)return !1;if(Dr(e.parent,128))return !0;var t=e.parent.parent.kind;return 257===t||181===t}(t)||!(me(t)||function(t){return e.isIdentifier(t)&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t}(t))},e.isIdentifierTypeReference=function(t){return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)},e.arrayIsHomogeneous=function(t,r){if(void 0===r&&(r=e.equateValues),t.length<2)return !0;for(var n=t[0],i=1,a=t.length;i<a;i++)if(!r(n,t[i]))return !1;return !0},e.setTextRangePos=pi,e.setTextRangeEnd=fi,e.setTextRangePosEnd=gi,e.setTextRangePosWidth=function(e,t,r){return gi(e,t,t+r)},e.setNodeFlags=function(e,t){return e&&(e.flags=t),e},e.setParent=mi,e.setEachParent=function(e,t){if(e)for(var r=0,n=e;r<n.length;r++)mi(n[r],t);return e},e.setParentRecursive=function(t,r){return t?(e.forEachChildRecursively(t,e.isJSDocNode(t)?n:function(t,r){return n(t,r)||function(t){if(e.hasJSDocNodes(t))for(var r=0,i=t.jsDoc;r<i.length;r++){var a=i[r];n(a,t),e.forEachChildRecursively(a,n);}}(t)}),t):t;function n(e,t){if(r&&e.parent===t)return "skip";mi(e,t);}},e.isPackedArrayLiteral=function(t){return e.isArrayLiteralExpression(t)&&e.every(t.elements,yi)},e.expressionResultIsUnused=function(t){for(e.Debug.assertIsDefined(t.parent);;){var r=t.parent;if(e.isParenthesizedExpression(r))t=r;else {if(e.isExpressionStatement(r)||e.isVoidExpression(r)||e.isForStatement(r)&&(r.initializer===t||r.incrementor===t))return !0;if(e.isCommaListExpression(r)){if(t!==e.last(r.elements))return !0;t=r;}else {if(!e.isBinaryExpression(r)||27!==r.operatorToken.kind)return !1;if(t===r.left)return !0;t=r;}}}},e.containsIgnoredPath=vi,e.getContainingNodeArray=function(t){if(t.parent){switch(t.kind){case 162:var r=t.parent;return 189===r.kind?void 0:r.typeParameters;case 163:return t.parent.parameters;case 198:case 232:return t.parent.templateSpans;case 164:return t.parent.decorators;case 290:return t.parent.heritageClauses}var n=t.parent;if(e.isJSDocTag(t))return e.isJSDocTypeLiteral(t.parent)?void 0:t.parent.tags;switch(n.kind){case 181:case 257:return e.isTypeElement(t)?n.members:void 0;case 186:case 187:return n.types;case 183:case 203:case 349:case 268:case 272:return n.elements;case 204:case 285:return n.properties;case 207:case 208:return e.isTypeNode(t)?n.typeArguments:n.expression===t?void 0:n.arguments;case 277:case 281:return e.isJsxChild(t)?n.children:void 0;case 279:case 278:return e.isTypeNode(t)?n.typeArguments:void 0;case 234:case 288:case 289:case 261:return n.statements;case 262:return n.clauses;case 256:case 225:return e.isClassElement(t)?n.members:void 0;case 259:return e.isEnumMember(t)?n.members:void 0;case 303:return n.statements}}},e.hasContextSensitiveParameters=function(t){if(!t.typeParameters){if(e.some(t.parameters,(function(e){return !gr(e)})))return !0;if(213!==t.kind){var r=e.firstOrUndefined(t.parameters);if(!r||!dr(r))return !0}}return !1},e.isInfinityOrNaNString=function(e){return "Infinity"===e||"-Infinity"===e||"NaN"===e},e.isCatchClauseVariableDeclaration=hi,e.isParameterOrCatchClauseVariable=function(t){var r=t.valueDeclaration&&Nt(t.valueDeclaration);return !!r&&(e.isParameter(r)||hi(r))},e.isFunctionExpressionOrArrowFunction=function(e){return 212===e.kind||213===e.kind},e.escapeSnippetText=function(e){return e.replace(/\$/gm,"\\$")};}(t),function(e){e.createBaseNodeFactory=function(){var t,r,n,i,a;return {createBaseSourceFileNode:function(t){return new(a||(a=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(n||(n=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(i||(i=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(r||(r=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(r){return new(t||(t=e.objectAllocator.getNodeConstructor()))(r,-1,-1)}}};}(t),function(e){e.createParenthesizerRules=function(t){var r,n;return {getParenthesizeLeftSideOfBinaryForOperator:function(t){r||(r=new e.Map);var n=r.get(t);return n||(n=function(e){return o(t,e)},r.set(t,n)),n},getParenthesizeRightSideOfBinaryForOperator:function(t){n||(n=new e.Map);var r=n.get(t);return r||(r=function(e){return s(t,void 0,e)},n.set(t,r)),r},parenthesizeLeftSideOfBinary:o,parenthesizeRightSideOfBinary:s,parenthesizeExpressionOfComputedPropertyName:function(r){return e.isCommaSequence(r)?t.createParenthesizedExpression(r):r},parenthesizeConditionOfConditionalExpression:function(r){var n=e.getOperatorPrecedence(221,57),i=e.skipPartiallyEmittedExpressions(r),a=e.getExpressionPrecedence(i);return 1!==e.compareValues(a,n)?t.createParenthesizedExpression(r):r},parenthesizeBranchOfConditionalExpression:function(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isCommaSequence(n)?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfExportDefault:function(r){var n=e.skipPartiallyEmittedExpressions(r),i=e.isCommaSequence(n);if(!i)switch(e.getLeftmostExpression(n,!1).kind){case 225:case 212:i=!0;}return i?t.createParenthesizedExpression(r):r},parenthesizeExpressionOfNew:function(r){var n=e.getLeftmostExpression(r,!0);switch(n.kind){case 207:return t.createParenthesizedExpression(r);case 208:return n.arguments?r:t.createParenthesizedExpression(r)}return c(r)},parenthesizeLeftSideOfAccess:c,parenthesizeOperandOfPostfixUnary:function(r){return e.isLeftHandSideExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeOperandOfPrefixUnary:function(r){return e.isUnaryExpression(r)?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeExpressionsOfCommaDelimitedList:function(r){var n=e.sameMap(r,l);return e.setTextRange(t.createNodeArray(n,r.hasTrailingComma),r)},parenthesizeExpressionForDisallowedComma:l,parenthesizeExpressionOfExpressionStatement:function(r){var n=e.skipPartiallyEmittedExpressions(r);if(e.isCallExpression(n)){var i=n.expression,a=e.skipPartiallyEmittedExpressions(i).kind;if(212===a||213===a){var o=t.updateCallExpression(n,e.setTextRange(t.createParenthesizedExpression(i),i),n.typeArguments,n.arguments);return t.restoreOuterExpressions(r,o,8)}}var s=e.getLeftmostExpression(n,!1).kind;return 204===s||212===s?e.setTextRange(t.createParenthesizedExpression(r),r):r},parenthesizeConciseBodyOfArrowFunction:function(r){return e.isBlock(r)||!e.isCommaSequence(r)&&204!==e.getLeftmostExpression(r,!1).kind?r:e.setTextRange(t.createParenthesizedExpression(r),r)},parenthesizeMemberOfConditionalType:u,parenthesizeMemberOfElementType:_,parenthesizeElementTypeOfArrayType:function(e){switch(e.kind){case 180:case 192:case 189:return t.createParenthesizedType(e)}return _(e)},parenthesizeConstituentTypesOfUnionOrIntersectionType:function(r){return t.createNodeArray(e.sameMap(r,_))},parenthesizeTypeArguments:function(r){if(e.some(r))return t.createNodeArray(e.sameMap(r,d))}};function i(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isLiteralKind(t.kind))return t.kind;if(220===t.kind&&39===t.operatorToken.kind){if(void 0!==t.cachedLiteralKind)return t.cachedLiteralKind;var r=i(t.left),n=e.isLiteralKind(r)&&r===i(t.right)?r:0;return t.cachedLiteralKind=n,n}return 0}function a(r,n,a,o){return 211===e.skipPartiallyEmittedExpressions(n).kind?n:function(t,r,n,a){var o=e.getOperatorPrecedence(220,t),s=e.getOperatorAssociativity(220,t),c=e.skipPartiallyEmittedExpressions(r);if(!n&&213===r.kind&&o>3)return !0;var l=e.getExpressionPrecedence(c);switch(e.compareValues(l,o)){case-1:return !(!n&&1===s&&223===r.kind);case 1:return !1;case 0:if(n)return 1===s;if(e.isBinaryExpression(c)&&c.operatorToken.kind===t){if(function(e){return 41===e||51===e||50===e||52===e}(t))return !1;if(39===t){var u=a?i(a):0;if(e.isLiteralKind(u)&&u===i(c))return !1}}return 0===e.getExpressionAssociativity(c)}}(r,n,a,o)?t.createParenthesizedExpression(n):n}function o(e,t){return a(e,t,!0)}function s(e,t,r){return a(e,r,!1,t)}function c(r){var n=e.skipPartiallyEmittedExpressions(r);return e.isLeftHandSideExpression(n)&&(208!==n.kind||n.arguments)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function l(r){var n=e.skipPartiallyEmittedExpressions(r);return e.getExpressionPrecedence(n)>e.getOperatorPrecedence(220,27)?r:e.setTextRange(t.createParenthesizedExpression(r),r)}function u(e){return 188===e.kind?t.createParenthesizedType(e):e}function _(e){switch(e.kind){case 186:case 187:case 178:case 179:return t.createParenthesizedType(e)}return u(e)}function d(r,n){return 0===n&&e.isFunctionOrConstructorTypeNode(r)&&r.typeParameters?t.createParenthesizedType(r):r}},e.nullParenthesizerRules={getParenthesizeLeftSideOfBinaryForOperator:function(t){return e.identity},getParenthesizeRightSideOfBinaryForOperator:function(t){return e.identity},parenthesizeLeftSideOfBinary:function(e,t){return t},parenthesizeRightSideOfBinary:function(e,t,r){return r},parenthesizeExpressionOfComputedPropertyName:e.identity,parenthesizeConditionOfConditionalExpression:e.identity,parenthesizeBranchOfConditionalExpression:e.identity,parenthesizeExpressionOfExportDefault:e.identity,parenthesizeExpressionOfNew:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeLeftSideOfAccess:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPostfixUnary:function(t){return e.cast(t,e.isLeftHandSideExpression)},parenthesizeOperandOfPrefixUnary:function(t){return e.cast(t,e.isUnaryExpression)},parenthesizeExpressionsOfCommaDelimitedList:function(t){return e.cast(t,e.isNodeArray)},parenthesizeExpressionForDisallowedComma:e.identity,parenthesizeExpressionOfExpressionStatement:e.identity,parenthesizeConciseBodyOfArrowFunction:e.identity,parenthesizeMemberOfConditionalType:e.identity,parenthesizeMemberOfElementType:e.identity,parenthesizeElementTypeOfArrayType:e.identity,parenthesizeConstituentTypesOfUnionOrIntersectionType:function(t){return e.cast(t,e.isNodeArray)},parenthesizeTypeArguments:function(t){return t&&e.cast(t,e.isNodeArray)}};}(t),function(e){e.createNodeConverters=function(t){return {convertToFunctionBlock:function(r,n){if(e.isBlock(r))return r;var i=t.createReturnStatement(r);e.setTextRange(i,r);var a=t.createBlock([i],n);return e.setTextRange(a,r),a},convertToFunctionExpression:function(r){if(!r.body)return e.Debug.fail("Cannot convert a FunctionDeclaration without a body");var n=t.createFunctionExpression(r.modifiers,r.asteriskToken,r.name,r.typeParameters,r.parameters,r.type,r.body);return e.setOriginalNode(n,r),e.setTextRange(n,r),e.getStartsOnNewLine(r)&&e.setStartsOnNewLine(n,!0),n},convertToArrayAssignmentElement:r,convertToObjectAssignmentElement:n,convertToAssignmentPattern:i,convertToObjectAssignmentPattern:a,convertToArrayAssignmentPattern:o,convertToAssignmentElementTarget:s};function r(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadElement(r.name),r),r);var n=s(r.name);return r.initializer?e.setOriginalNode(e.setTextRange(t.createAssignment(n,r.initializer),r),r):n}return e.cast(r,e.isExpression)}function n(r){if(e.isBindingElement(r)){if(r.dotDotDotToken)return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createSpreadAssignment(r.name),r),r);if(r.propertyName){var n=s(r.name);return e.setOriginalNode(e.setTextRange(t.createPropertyAssignment(r.propertyName,r.initializer?t.createAssignment(n,r.initializer):n),r),r)}return e.Debug.assertNode(r.name,e.isIdentifier),e.setOriginalNode(e.setTextRange(t.createShorthandPropertyAssignment(r.name,r.initializer),r),r)}return e.cast(r,e.isObjectLiteralElementLike)}function i(e){switch(e.kind){case 201:case 203:return o(e);case 200:case 204:return a(e)}}function a(r){return e.isObjectBindingPattern(r)?e.setOriginalNode(e.setTextRange(t.createObjectLiteralExpression(e.map(r.elements,n)),r),r):e.cast(r,e.isObjectLiteralExpression)}function o(n){return e.isArrayBindingPattern(n)?e.setOriginalNode(e.setTextRange(t.createArrayLiteralExpression(e.map(n.elements,r)),n),n):e.cast(n,e.isArrayLiteralExpression)}function s(t){return e.isBindingPattern(t)?i(t):e.cast(t,e.isExpression)}},e.nullNodeConverters={convertToFunctionBlock:e.notImplemented,convertToFunctionExpression:e.notImplemented,convertToArrayAssignmentElement:e.notImplemented,convertToObjectAssignmentElement:e.notImplemented,convertToAssignmentPattern:e.notImplemented,convertToObjectAssignmentPattern:e.notImplemented,convertToArrayAssignmentPattern:e.notImplemented,convertToAssignmentElementTarget:e.notImplemented};}(t),function(e){var t,r,i=0;function a(r,a){var f=8&r?o:s,g=e.memoize((function(){return 1&r?e.nullParenthesizerRules:e.createParenthesizerRules(N)})),m=e.memoize((function(){return 2&r?e.nullNodeConverters:e.createNodeConverters(N)})),y=e.memoizeOne((function(e){return function(t,r){return Mt(t,e,r)}})),v=e.memoizeOne((function(e){return function(t){return It(e,t)}})),b=e.memoizeOne((function(e){return function(t){return Ot(t,e)}})),x=e.memoizeOne((function(e){return function(){return function(e){return A(e)}(e)}})),D=e.memoizeOne((function(e){return function(t){return tn(e,t)}})),S=e.memoizeOne((function(e){return function(t,r){return function(e,t,r){return t.type!==r?f(tn(e,r),t):t}(e,t,r)}})),T=e.memoizeOne((function(e){return function(t,r){return Dn(e,t,r)}})),C=e.memoizeOne((function(e){return function(t,r,n){return function(e,t,r,n){return void 0===r&&(r=sn(t)),t.tagName!==r||t.comment!==n?f(Dn(e,r,n),t):t}(e,t,r,n)}})),E=e.memoizeOne((function(e){return function(t,r,n){return Sn(e,t,r,n)}})),k=e.memoizeOne((function(e){return function(t,r,n,i){return function(e,t,r,n,i){return void 0===r&&(r=sn(t)),t.tagName!==r||t.typeExpression!==n||t.comment!==i?f(Sn(e,r,n,i),t):t}(e,t,r,n,i)}})),N={get parenthesizer(){return g()},get converters(){return m()},createNodeArray:F,createNumericLiteral:K,createBigIntLiteral:V,createStringLiteral:W,createStringLiteralFromNode:function(t){var r=q(e.getTextOfIdentifierOrLiteral(t),void 0);return r.textSourceNode=t,r},createRegularExpressionLiteral:H,createLiteralLikeNode:function(e,t){switch(e){case 8:return K(t,0);case 9:return V(t);case 10:return W(t,void 0);case 11:return wn(t,!1);case 12:return wn(t,!0);case 13:return H(t);case 14:return Jt(e,t,void 0,0)}},createIdentifier:X,updateIdentifier:function(t,r){return t.typeArguments!==r?f(X(e.idText(t),r),t):t},createTempVariable:Y,createLoopVariable:function(e){var t=2;return e&&(t|=8),Q("",t)},createUniqueName:function(t,r){return void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags"),e.Debug.assert(32!=(48&r),"GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"),Q(t,3|r)},getGeneratedNameForNode:Z,createPrivateIdentifier:function(t){e.startsWith(t,"#")||e.Debug.fail("First character of private identifier must be #: "+t);var r=a.createBasePrivateIdentifierNode(80);return r.escapedText=e.escapeLeadingUnderscores(t),r.transformFlags|=8388608,r},createToken:ee,createSuper:function(){return ee(106)},createThis:te,createNull:function(){return ee(104)},createTrue:re,createFalse:ne,createModifier:ie,createModifiersFromModifierFlags:ae,createQualifiedName:oe,updateQualifiedName:function(e,t,r){return e.left!==t||e.right!==r?f(oe(t,r),e):e},createComputedPropertyName:se,updateComputedPropertyName:function(e,t){return e.expression!==t?f(se(t),e):e},createTypeParameterDeclaration:ce,updateTypeParameterDeclaration:function(e,t,r,n){return e.name!==t||e.constraint!==r||e.default!==n?f(ce(t,r,n),e):e},createParameterDeclaration:le,updateParameterDeclaration:ue,createDecorator:_e,updateDecorator:function(e,t){return e.expression!==t?f(_e(t),e):e},createPropertySignature:de,updatePropertySignature:pe,createPropertyDeclaration:fe,updatePropertyDeclaration:ge,createMethodSignature:me,updateMethodSignature:ye,createMethodDeclaration:ve,updateMethodDeclaration:he,createConstructorDeclaration:xe,updateConstructorDeclaration:De,createGetAccessorDeclaration:Se,updateGetAccessorDeclaration:Te,createSetAccessorDeclaration:Ce,updateSetAccessorDeclaration:Ee,createCallSignature:ke,updateCallSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(ke(t,r,n),e):e},createConstructSignature:Ne,updateConstructSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(Ne(t,r,n),e):e},createIndexSignature:Fe,updateIndexSignature:Ae,createClassStaticBlockDeclaration:be,updateClassStaticBlockDeclaration:function(e,t,r,n){return e.decorators!==t||e.modifier!==r||e.body!==n?f(be(t,r,n),e):e},createTemplateLiteralTypeSpan:Pe,updateTemplateLiteralTypeSpan:function(e,t,r){return e.type!==t||e.literal!==r?f(Pe(t,r),e):e},createKeywordTypeNode:function(e){return ee(e)},createTypePredicateNode:we,updateTypePredicateNode:function(e,t,r,n){return e.assertsModifier!==t||e.parameterName!==r||e.type!==n?f(we(t,r,n),e):e},createTypeReferenceNode:Ie,updateTypeReferenceNode:function(e,t,r){return e.typeName!==t||e.typeArguments!==r?f(Ie(t,r),e):e},createFunctionTypeNode:Oe,updateFunctionTypeNode:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?M(Oe(t,r,n),e):e},createConstructorTypeNode:Me,updateConstructorTypeNode:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 5===t.length?Be.apply(void 0,t):4===t.length?je.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")},createTypeQueryNode:Je,updateTypeQueryNode:function(e,t){return e.exprName!==t?f(Je(t),e):e},createTypeLiteralNode:ze,updateTypeLiteralNode:function(e,t){return e.members!==t?f(ze(t),e):e},createArrayTypeNode:Ue,updateArrayTypeNode:function(e,t){return e.elementType!==t?f(Ue(t),e):e},createTupleTypeNode:Ke,updateTupleTypeNode:function(e,t){return e.elements!==t?f(Ke(t),e):e},createNamedTupleMember:Ve,updateNamedTupleMember:function(e,t,r,n,i){return e.dotDotDotToken!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(Ve(t,r,n,i),e):e},createOptionalTypeNode:qe,updateOptionalTypeNode:function(e,t){return e.type!==t?f(qe(t),e):e},createRestTypeNode:We,updateRestTypeNode:function(e,t){return e.type!==t?f(We(t),e):e},createUnionTypeNode:function(e){return He(186,e)},updateUnionTypeNode:function(e,t){return Ge(e,t)},createIntersectionTypeNode:function(e){return He(187,e)},updateIntersectionTypeNode:function(e,t){return Ge(e,t)},createConditionalTypeNode:Qe,updateConditionalTypeNode:function(e,t,r,n,i){return e.checkType!==t||e.extendsType!==r||e.trueType!==n||e.falseType!==i?f(Qe(t,r,n,i),e):e},createInferTypeNode:Xe,updateInferTypeNode:function(e,t){return e.typeParameter!==t?f(Xe(t),e):e},createImportTypeNode:Ze,updateImportTypeNode:function(e,t,r,n,i){return void 0===i&&(i=e.isTypeOf),e.argument!==t||e.qualifier!==r||e.typeArguments!==n||e.isTypeOf!==i?f(Ze(t,r,n,i),e):e},createParenthesizedType:$e,updateParenthesizedType:function(e,t){return e.type!==t?f($e(t),e):e},createThisTypeNode:function(){var e=A(191);return e.transformFlags=1,e},createTypeOperatorNode:et,updateTypeOperatorNode:function(e,t){return e.type!==t?f(et(e.operator,t),e):e},createIndexedAccessTypeNode:tt,updateIndexedAccessTypeNode:function(e,t,r){return e.objectType!==t||e.indexType!==r?f(tt(t,r),e):e},createMappedTypeNode:rt,updateMappedTypeNode:function(e,t,r,n,i,a,o){return e.readonlyToken!==t||e.typeParameter!==r||e.nameType!==n||e.questionToken!==i||e.type!==a||e.members!==o?f(rt(t,r,n,i,a,o),e):e},createLiteralTypeNode:nt,updateLiteralTypeNode:function(e,t){return e.literal!==t?f(nt(t),e):e},createTemplateLiteralType:Ye,updateTemplateLiteralType:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(Ye(t,r),e):e},createObjectBindingPattern:it,updateObjectBindingPattern:function(e,t){return e.elements!==t?f(it(t),e):e},createArrayBindingPattern:at,updateArrayBindingPattern:function(e,t){return e.elements!==t?f(at(t),e):e},createBindingElement:ot,updateBindingElement:function(e,t,r,n,i){return e.propertyName!==r||e.dotDotDotToken!==t||e.name!==n||e.initializer!==i?f(ot(t,r,n,i),e):e},createArrayLiteralExpression:ct,updateArrayLiteralExpression:function(e,t){return e.elements!==t?f(ct(t,e.multiLine),e):e},createObjectLiteralExpression:lt,updateObjectLiteralExpression:function(e,t){return e.properties!==t?f(lt(t,e.multiLine),e):e},createPropertyAccessExpression:4&r?function(t,r){return e.setEmitFlags(ut(t,r),131072)}:ut,updatePropertyAccessExpression:function(t,r,n){return e.isPropertyAccessChain(t)?dt(t,r,t.questionDotToken,e.cast(n,e.isIdentifier)):t.expression!==r||t.name!==n?f(ut(r,n),t):t},createPropertyAccessChain:4&r?function(t,r,n){return e.setEmitFlags(_t(t,r,n),131072)}:_t,updatePropertyAccessChain:dt,createElementAccessExpression:pt,updateElementAccessExpression:function(t,r,n){return e.isElementAccessChain(t)?gt(t,r,t.questionDotToken,n):t.expression!==r||t.argumentExpression!==n?f(pt(r,n),t):t},createElementAccessChain:ft,updateElementAccessChain:gt,createCallExpression:mt,updateCallExpression:function(t,r,n,i){return e.isCallChain(t)?vt(t,r,t.questionDotToken,n,i):t.expression!==r||t.typeArguments!==n||t.arguments!==i?f(mt(r,n,i),t):t},createCallChain:yt,updateCallChain:vt,createNewExpression:ht,updateNewExpression:function(e,t,r,n){return e.expression!==t||e.typeArguments!==r||e.arguments!==n?f(ht(t,r,n),e):e},createTaggedTemplateExpression:bt,updateTaggedTemplateExpression:function(e,t,r,n){return e.tag!==t||e.typeArguments!==r||e.template!==n?f(bt(t,r,n),e):e},createTypeAssertion:xt,updateTypeAssertion:Dt,createParenthesizedExpression:St,updateParenthesizedExpression:Tt,createFunctionExpression:Ct,updateFunctionExpression:Et,createArrowFunction:kt,updateArrowFunction:Nt,createDeleteExpression:Ft,updateDeleteExpression:function(e,t){return e.expression!==t?f(Ft(t),e):e},createTypeOfExpression:At,updateTypeOfExpression:function(e,t){return e.expression!==t?f(At(t),e):e},createVoidExpression:Pt,updateVoidExpression:function(e,t){return e.expression!==t?f(Pt(t),e):e},createAwaitExpression:wt,updateAwaitExpression:function(e,t){return e.expression!==t?f(wt(t),e):e},createPrefixUnaryExpression:It,updatePrefixUnaryExpression:function(e,t){return e.operand!==t?f(It(e.operator,t),e):e},createPostfixUnaryExpression:Ot,updatePostfixUnaryExpression:function(e,t){return e.operand!==t?f(Ot(t,e.operator),e):e},createBinaryExpression:Mt,updateBinaryExpression:function(e,t,r,n){return e.left!==t||e.operatorToken!==r||e.right!==n?f(Mt(t,r,n),e):e},createConditionalExpression:Rt,updateConditionalExpression:function(e,t,r,n,i,a){return e.condition!==t||e.questionToken!==r||e.whenTrue!==n||e.colonToken!==i||e.whenFalse!==a?f(Rt(t,r,n,i,a),e):e},createTemplateExpression:Bt,updateTemplateExpression:function(e,t,r){return e.head!==t||e.templateSpans!==r?f(Bt(t,r),e):e},createTemplateHead:function(e,t,r){return jt(15,e,t,r)},createTemplateMiddle:function(e,t,r){return jt(16,e,t,r)},createTemplateTail:function(e,t,r){return jt(17,e,t,r)},createNoSubstitutionTemplateLiteral:function(e,t,r){return jt(14,e,t,r)},createTemplateLiteralLikeNode:Jt,createYieldExpression:zt,updateYieldExpression:function(e,t,r){return e.expression!==r||e.asteriskToken!==t?f(zt(t,r),e):e},createSpreadElement:Ut,updateSpreadElement:function(e,t){return e.expression!==t?f(Ut(t),e):e},createClassExpression:Kt,updateClassExpression:Vt,createOmittedExpression:function(){return st(226)},createExpressionWithTypeArguments:qt,updateExpressionWithTypeArguments:function(e,t,r){return e.expression!==t||e.typeArguments!==r?f(qt(t,r),e):e},createAsExpression:Wt,updateAsExpression:Ht,createNonNullExpression:Gt,updateNonNullExpression:Qt,createNonNullChain:Xt,updateNonNullChain:Yt,createMetaProperty:Zt,updateMetaProperty:function(e,t){return e.name!==t?f(Zt(e.keywordToken,t),e):e},createTemplateSpan:$t,updateTemplateSpan:function(e,t,r){return e.expression!==t||e.literal!==r?f($t(t,r),e):e},createSemicolonClassElement:function(){var e=A(233);return e.transformFlags|=512,e},createBlock:er,updateBlock:function(e,t){return e.statements!==t?f(er(t,e.multiLine),e):e},createVariableStatement:tr,updateVariableStatement:rr,createEmptyStatement:nr,createExpressionStatement:ir,updateExpressionStatement:function(e,t){return e.expression!==t?f(ir(t),e):e},createIfStatement:ar,updateIfStatement:function(e,t,r,n){return e.expression!==t||e.thenStatement!==r||e.elseStatement!==n?f(ar(t,r,n),e):e},createDoStatement:or,updateDoStatement:function(e,t,r){return e.statement!==t||e.expression!==r?f(or(t,r),e):e},createWhileStatement:sr,updateWhileStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(sr(t,r),e):e},createForStatement:cr,updateForStatement:function(e,t,r,n,i){return e.initializer!==t||e.condition!==r||e.incrementor!==n||e.statement!==i?f(cr(t,r,n,i),e):e},createForInStatement:lr,updateForInStatement:function(e,t,r,n){return e.initializer!==t||e.expression!==r||e.statement!==n?f(lr(t,r,n),e):e},createForOfStatement:ur,updateForOfStatement:function(e,t,r,n,i){return e.awaitModifier!==t||e.initializer!==r||e.expression!==n||e.statement!==i?f(ur(t,r,n,i),e):e},createContinueStatement:_r,updateContinueStatement:function(e,t){return e.label!==t?f(_r(t),e):e},createBreakStatement:dr,updateBreakStatement:function(e,t){return e.label!==t?f(dr(t),e):e},createReturnStatement:pr,updateReturnStatement:function(e,t){return e.expression!==t?f(pr(t),e):e},createWithStatement:fr,updateWithStatement:function(e,t,r){return e.expression!==t||e.statement!==r?f(fr(t,r),e):e},createSwitchStatement:gr,updateSwitchStatement:function(e,t,r){return e.expression!==t||e.caseBlock!==r?f(gr(t,r),e):e},createLabeledStatement:mr,updateLabeledStatement:yr,createThrowStatement:vr,updateThrowStatement:function(e,t){return e.expression!==t?f(vr(t),e):e},createTryStatement:hr,updateTryStatement:function(e,t,r,n){return e.tryBlock!==t||e.catchClause!==r||e.finallyBlock!==n?f(hr(t,r,n),e):e},createDebuggerStatement:function(){return A(252)},createVariableDeclaration:br,updateVariableDeclaration:function(e,t,r,n,i){return e.name!==t||e.type!==n||e.exclamationToken!==r||e.initializer!==i?f(br(t,r,n,i),e):e},createVariableDeclarationList:xr,updateVariableDeclarationList:function(e,t){return e.declarations!==t?f(xr(t,e.flags),e):e},createFunctionDeclaration:Dr,updateFunctionDeclaration:Sr,createClassDeclaration:Tr,updateClassDeclaration:Cr,createInterfaceDeclaration:Er,updateInterfaceDeclaration:kr,createTypeAliasDeclaration:Nr,updateTypeAliasDeclaration:Fr,createEnumDeclaration:Ar,updateEnumDeclaration:Pr,createModuleDeclaration:wr,updateModuleDeclaration:Ir,createModuleBlock:Or,updateModuleBlock:function(e,t){return e.statements!==t?f(Or(t),e):e},createCaseBlock:Mr,updateCaseBlock:function(e,t){return e.clauses!==t?f(Mr(t),e):e},createNamespaceExportDeclaration:Lr,updateNamespaceExportDeclaration:function(e,t){return e.name!==t?f(Lr(t),e):e},createImportEqualsDeclaration:Rr,updateImportEqualsDeclaration:Br,createImportDeclaration:jr,updateImportDeclaration:Jr,createImportClause:zr,updateImportClause:function(e,t,r,n){return e.isTypeOnly!==t||e.name!==r||e.namedBindings!==n?f(zr(t,r,n),e):e},createAssertClause:Ur,updateAssertClause:function(e,t,r){return e.elements!==t||e.multiLine!==r?f(Ur(t,r),e):e},createAssertEntry:Kr,updateAssertEntry:function(e,t,r){return e.name!==t||e.value!==r?f(Kr(t,r),e):e},createNamespaceImport:Vr,updateNamespaceImport:function(e,t){return e.name!==t?f(Vr(t),e):e},createNamespaceExport:qr,updateNamespaceExport:function(e,t){return e.name!==t?f(qr(t),e):e},createNamedImports:Wr,updateNamedImports:function(e,t){return e.elements!==t?f(Wr(t),e):e},createImportSpecifier:Hr,updateImportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f(Hr(t,r,n),e):e},createExportAssignment:Gr,updateExportAssignment:Qr,createExportDeclaration:Xr,updateExportDeclaration:Yr,createNamedExports:Zr,updateNamedExports:function(e,t){return e.elements!==t?f(Zr(t),e):e},createExportSpecifier:$r,updateExportSpecifier:function(e,t,r,n){return e.isTypeOnly!==t||e.propertyName!==r||e.name!==n?f($r(t,r,n),e):e},createMissingDeclaration:function(){return P(275,void 0,void 0)},createExternalModuleReference:en,updateExternalModuleReference:function(e,t){return e.expression!==t?f(en(t),e):e},get createJSDocAllType(){return x(310)},get createJSDocUnknownType(){return x(311)},get createJSDocNonNullableType(){return D(313)},get updateJSDocNonNullableType(){return S(313)},get createJSDocNullableType(){return D(312)},get updateJSDocNullableType(){return S(312)},get createJSDocOptionalType(){return D(314)},get updateJSDocOptionalType(){return S(314)},get createJSDocVariadicType(){return D(316)},get updateJSDocVariadicType(){return S(316)},get createJSDocNamepathType(){return D(317)},get updateJSDocNamepathType(){return S(317)},createJSDocFunctionType:rn,updateJSDocFunctionType:function(e,t,r){return e.parameters!==t||e.type!==r?f(rn(t,r),e):e},createJSDocTypeLiteral:nn,updateJSDocTypeLiteral:function(e,t,r){return e.jsDocPropertyTags!==t||e.isArrayType!==r?f(nn(t,r),e):e},createJSDocTypeExpression:an,updateJSDocTypeExpression:function(e,t){return e.type!==t?f(an(t),e):e},createJSDocSignature:on,updateJSDocSignature:function(e,t,r,n){return e.typeParameters!==t||e.parameters!==r||e.type!==n?f(on(t,r,n),e):e},createJSDocTemplateTag:ln,updateJSDocTemplateTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.constraint!==r||e.typeParameters!==n||e.comment!==i?f(ln(t,r,n,i),e):e},createJSDocTypedefTag:un,updateJSDocTypedefTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(un(t,r,n,i),e):e},createJSDocParameterTag:_n,updateJSDocParameterTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=sn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(_n(t,r,n,i,a,o),e):e},createJSDocPropertyTag:dn,updateJSDocPropertyTag:function(e,t,r,n,i,a,o){return void 0===t&&(t=sn(e)),e.tagName!==t||e.name!==r||e.isBracketed!==n||e.typeExpression!==i||e.isNameFirst!==a||e.comment!==o?f(dn(t,r,n,i,a,o),e):e},createJSDocCallbackTag:pn,updateJSDocCallbackTag:function(e,t,r,n,i){return void 0===t&&(t=sn(e)),e.tagName!==t||e.typeExpression!==r||e.fullName!==n||e.comment!==i?f(pn(t,r,n,i),e):e},createJSDocAugmentsTag:fn,updateJSDocAugmentsTag:function(e,t,r,n){return void 0===t&&(t=sn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(fn(t,r,n),e):e},createJSDocImplementsTag:gn,updateJSDocImplementsTag:function(e,t,r,n){return void 0===t&&(t=sn(e)),e.tagName!==t||e.class!==r||e.comment!==n?f(gn(t,r,n),e):e},createJSDocSeeTag:mn,updateJSDocSeeTag:function(e,t,r,n){return e.tagName!==t||e.name!==r||e.comment!==n?f(mn(t,r,n),e):e},createJSDocNameReference:yn,updateJSDocNameReference:function(e,t){return e.name!==t?f(yn(t),e):e},createJSDocMemberName:vn,updateJSDocMemberName:function(e,t,r){return e.left!==t||e.right!==r?f(vn(t,r),e):e},createJSDocLink:hn,updateJSDocLink:function(e,t,r){return e.name!==t?f(hn(t,r),e):e},createJSDocLinkCode:bn,updateJSDocLinkCode:function(e,t,r){return e.name!==t?f(bn(t,r),e):e},createJSDocLinkPlain:xn,updateJSDocLinkPlain:function(e,t,r){return e.name!==t?f(xn(t,r),e):e},get createJSDocTypeTag(){return E(341)},get updateJSDocTypeTag(){return k(341)},get createJSDocReturnTag(){return E(339)},get updateJSDocReturnTag(){return k(339)},get createJSDocThisTag(){return E(340)},get updateJSDocThisTag(){return k(340)},get createJSDocEnumTag(){return E(337)},get updateJSDocEnumTag(){return k(337)},get createJSDocAuthorTag(){return T(328)},get updateJSDocAuthorTag(){return C(328)},get createJSDocClassTag(){return T(330)},get updateJSDocClassTag(){return C(330)},get createJSDocPublicTag(){return T(331)},get updateJSDocPublicTag(){return C(331)},get createJSDocPrivateTag(){return T(332)},get updateJSDocPrivateTag(){return C(332)},get createJSDocProtectedTag(){return T(333)},get updateJSDocProtectedTag(){return C(333)},get createJSDocReadonlyTag(){return T(334)},get updateJSDocReadonlyTag(){return C(334)},get createJSDocOverrideTag(){return T(335)},get updateJSDocOverrideTag(){return C(335)},get createJSDocDeprecatedTag(){return T(329)},get updateJSDocDeprecatedTag(){return C(329)},createJSDocUnknownTag:Tn,updateJSDocUnknownTag:function(e,t,r){return e.tagName!==t||e.comment!==r?f(Tn(t,r),e):e},createJSDocText:Cn,updateJSDocText:function(e,t){return e.text!==t?f(Cn(t),e):e},createJSDocComment:En,updateJSDocComment:function(e,t,r){return e.comment!==t||e.tags!==r?f(En(t,r),e):e},createJsxElement:kn,updateJsxElement:function(e,t,r,n){return e.openingElement!==t||e.children!==r||e.closingElement!==n?f(kn(t,r,n),e):e},createJsxSelfClosingElement:Nn,updateJsxSelfClosingElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Nn(t,r,n),e):e},createJsxOpeningElement:Fn,updateJsxOpeningElement:function(e,t,r,n){return e.tagName!==t||e.typeArguments!==r||e.attributes!==n?f(Fn(t,r,n),e):e},createJsxClosingElement:An,updateJsxClosingElement:function(e,t){return e.tagName!==t?f(An(t),e):e},createJsxFragment:Pn,createJsxText:wn,updateJsxText:function(e,t,r){return e.text!==t||e.containsOnlyTriviaWhiteSpaces!==r?f(wn(t,r),e):e},createJsxOpeningFragment:function(){var e=A(282);return e.transformFlags|=2,e},createJsxJsxClosingFragment:function(){var e=A(283);return e.transformFlags|=2,e},updateJsxFragment:function(e,t,r,n){return e.openingFragment!==t||e.children!==r||e.closingFragment!==n?f(Pn(t,r,n),e):e},createJsxAttribute:In,updateJsxAttribute:function(e,t,r){return e.name!==t||e.initializer!==r?f(In(t,r),e):e},createJsxAttributes:On,updateJsxAttributes:function(e,t){return e.properties!==t?f(On(t),e):e},createJsxSpreadAttribute:Mn,updateJsxSpreadAttribute:function(e,t){return e.expression!==t?f(Mn(t),e):e},createJsxExpression:Ln,updateJsxExpression:function(e,t){return e.expression!==t?f(Ln(e.dotDotDotToken,t),e):e},createCaseClause:Rn,updateCaseClause:function(e,t,r){return e.expression!==t||e.statements!==r?f(Rn(t,r),e):e},createDefaultClause:Bn,updateDefaultClause:function(e,t){return e.statements!==t?f(Bn(t),e):e},createHeritageClause:jn,updateHeritageClause:function(e,t){return e.types!==t?f(jn(e.token,t),e):e},createCatchClause:Jn,updateCatchClause:function(e,t,r){return e.variableDeclaration!==t||e.block!==r?f(Jn(t,r),e):e},createPropertyAssignment:zn,updatePropertyAssignment:function(e,t,r){return e.name!==t||e.initializer!==r?(n=zn(t,r),(i=e).decorators&&(n.decorators=i.decorators),i.modifiers&&(n.modifiers=i.modifiers),i.questionToken&&(n.questionToken=i.questionToken),i.exclamationToken&&(n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createShorthandPropertyAssignment:Un,updateShorthandPropertyAssignment:function(e,t,r){return e.name!==t||e.objectAssignmentInitializer!==r?(n=Un(t,r),(i=e).decorators&&(n.decorators=i.decorators),i.modifiers&&(n.modifiers=i.modifiers),i.equalsToken&&(n.equalsToken=i.equalsToken),i.questionToken&&(n.questionToken=i.questionToken),i.exclamationToken&&(n.exclamationToken=i.exclamationToken),f(n,i)):e;var n,i;},createSpreadAssignment:Kn,updateSpreadAssignment:function(e,t){return e.expression!==t?f(Kn(t),e):e},createEnumMember:Vn,updateEnumMember:function(e,t,r){return e.name!==t||e.initializer!==r?f(Vn(t,r),e):e},createSourceFile:function(e,t,r){var n=a.createBaseSourceFileNode(303);return n.statements=F(e),n.endOfFileToken=t,n.flags|=r,n.fileName="",n.text="",n.languageVersion=0,n.languageVariant=0,n.scriptKind=0,n.isDeclarationFile=!1,n.hasNoDefaultLib=!1,n.transformFlags|=d(n.statements)|_(n.endOfFileToken),n},updateSourceFile:function(t,r,n,i,o,s,c){return void 0===n&&(n=t.isDeclarationFile),void 0===i&&(i=t.referencedFiles),void 0===o&&(o=t.typeReferenceDirectives),void 0===s&&(s=t.hasNoDefaultLib),void 0===c&&(c=t.libReferenceDirectives),t.statements!==r||t.isDeclarationFile!==n||t.referencedFiles!==i||t.typeReferenceDirectives!==o||t.hasNoDefaultLib!==s||t.libReferenceDirectives!==c?f(function(t,r,n,i,o,s,c){var l=a.createBaseSourceFileNode(303);for(var u in t)"emitNode"!==u&&!e.hasProperty(l,u)&&e.hasProperty(t,u)&&(l[u]=t[u]);return l.flags|=t.flags,l.statements=F(r),l.endOfFileToken=t.endOfFileToken,l.isDeclarationFile=n,l.referencedFiles=i,l.typeReferenceDirectives=o,l.hasNoDefaultLib=s,l.libReferenceDirectives=c,l.transformFlags=d(l.statements)|_(l.endOfFileToken),l.impliedNodeFormat=t.impliedNodeFormat,l}(t,r,n,i,o,s,c),t):t},createBundle:qn,updateBundle:function(t,r,n){return void 0===n&&(n=e.emptyArray),t.sourceFiles!==r||t.prepends!==n?f(qn(r,n),t):t},createUnparsedSource:function(t,r,n){var i=A(305);return i.prologues=t,i.syntheticReferences=r,i.texts=n,i.fileName="",i.text="",i.referencedFiles=e.emptyArray,i.libReferenceDirectives=e.emptyArray,i.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(i,t)},i},createUnparsedPrologue:function(e){return Wn(298,e)},createUnparsedPrepend:function(e,t){var r=Wn(299,e);return r.texts=t,r},createUnparsedTextLike:function(e,t){return Wn(t?301:300,e)},createUnparsedSyntheticReference:function(e){var t=A(302);return t.data=e.data,t.section=e,t},createInputFiles:function(){var e=A(306);return e.javascriptText="",e.declarationText="",e},createSyntheticExpression:function(e,t,r){void 0===t&&(t=!1);var n=A(231);return n.type=e,n.isSpread=t,n.tupleNameSource=r,n},createSyntaxList:function(e){var t=A(346);return t._children=e,t},createNotEmittedStatement:function(t){var r=A(347);return r.original=t,e.setTextRange(r,t),r},createPartiallyEmittedExpression:Hn,updatePartiallyEmittedExpression:Gn,createCommaListExpression:Xn,updateCommaListExpression:function(e,t){return e.elements!==t?f(Xn(t),e):e},createEndOfDeclarationMarker:function(e){var t=A(351);return t.emitNode={},t.original=e,t},createMergeDeclarationMarker:function(e){var t=A(350);return t.emitNode={},t.original=e,t},createSyntheticReferenceExpression:Yn,updateSyntheticReferenceExpression:function(e,t,r){return e.expression!==t||e.thisArg!==r?f(Yn(t,r),e):e},cloneNode:Zn,get createComma(){return y(27)},get createAssignment(){return y(63)},get createLogicalOr(){return y(56)},get createLogicalAnd(){return y(55)},get createBitwiseOr(){return y(51)},get createBitwiseXor(){return y(52)},get createBitwiseAnd(){return y(50)},get createStrictEquality(){return y(36)},get createStrictInequality(){return y(37)},get createEquality(){return y(34)},get createInequality(){return y(35)},get createLessThan(){return y(29)},get createLessThanEquals(){return y(32)},get createGreaterThan(){return y(31)},get createGreaterThanEquals(){return y(33)},get createLeftShift(){return y(47)},get createRightShift(){return y(48)},get createUnsignedRightShift(){return y(49)},get createAdd(){return y(39)},get createSubtract(){return y(40)},get createMultiply(){return y(41)},get createDivide(){return y(43)},get createModulo(){return y(44)},get createExponent(){return y(42)},get createPrefixPlus(){return v(39)},get createPrefixMinus(){return v(40)},get createPrefixIncrement(){return v(45)},get createPrefixDecrement(){return v(46)},get createBitwiseNot(){return v(54)},get createLogicalNot(){return v(53)},get createPostfixIncrement(){return b(45)},get createPostfixDecrement(){return b(46)},createImmediatelyInvokedFunctionExpression:function(e,t,r){return mt(Ct(void 0,void 0,void 0,void 0,t?[t]:[],void 0,er(e,!0)),void 0,r?[r]:[])},createImmediatelyInvokedArrowFunction:function(e,t,r){return mt(kt(void 0,void 0,t?[t]:[],void 0,void 0,er(e,!0)),void 0,r?[r]:[])},createVoidZero:$n,createExportDefault:function(e){return Gr(void 0,void 0,!1,e)},createExternalModuleExport:function(e){return Xr(void 0,void 0,!1,Zr([$r(!1,void 0,e)]))},createTypeCheck:function(e,t){return "undefined"===t?N.createStrictEquality(e,$n()):N.createStrictEquality(At(e),W(t))},createMethodCall:ei,createGlobalMethodCall:ti,createFunctionBindCall:function(e,t,r){return ei(e,"bind",n$3([t],r,!0))},createFunctionCallCall:function(e,t,r){return ei(e,"call",n$3([t],r,!0))},createFunctionApplyCall:function(e,t,r){return ei(e,"apply",[t,r])},createArraySliceCall:function(e,t){return ei(e,"slice",void 0===t?[]:[pi(t)])},createArrayConcatCall:function(e,t){return ei(e,"concat",t)},createObjectDefinePropertyCall:function(e,t,r){return ti("Object","defineProperty",[e,pi(t),r])},createReflectGetCall:function(e,t,r){return ti("Reflect","get",r?[e,t,r]:[e,t])},createReflectSetCall:function(e,t,r,n){return ti("Reflect","set",n?[e,t,r,n]:[e,t,r])},createPropertyDescriptor:function(t,r){var n=[];ri(n,"enumerable",pi(t.enumerable)),ri(n,"configurable",pi(t.configurable));var i=ri(n,"writable",pi(t.writable));i=ri(n,"value",t.value)||i;var a=ri(n,"get",t.get);return a=ri(n,"set",t.set)||a,e.Debug.assert(!(i&&a),"A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."),lt(n,!r)},createCallBinding:function(t,r,n,i){void 0===i&&(i=!1);var a,o,s=e.skipOuterExpressions(t,15);return e.isSuperProperty(s)?(a=te(),o=s):e.isSuperKeyword(s)?(a=te(),o=void 0!==n&&n<2?e.setTextRange(X("_super"),s):s):4096&e.getEmitFlags(s)?(a=$n(),o=g().parenthesizeLeftSideOfAccess(s)):e.isPropertyAccessExpression(s)?ni(s.expression,i)?(a=Y(r),o=ut(e.setTextRange(N.createAssignment(a,s.expression),s.expression),s.name),e.setTextRange(o,s)):(a=s.expression,o=s):e.isElementAccessExpression(s)?ni(s.expression,i)?(a=Y(r),o=pt(e.setTextRange(N.createAssignment(a,s.expression),s.expression),s.argumentExpression),e.setTextRange(o,s)):(a=s.expression,o=s):(a=$n(),o=g().parenthesizeLeftSideOfAccess(t)),{target:o,thisArg:a}},createAssignmentTargetWrapper:function(e,t){return ut(St(lt([Ce(void 0,void 0,"value",[le(void 0,void 0,void 0,e,void 0,void 0,void 0)],er([ir(t)]))])),"value")},inlineExpressions:function(t){return t.length>10?Xn(t):e.reduceLeft(t,N.createComma)},getInternalName:function(e,t,r){return ii(e,t,r,49152)},getLocalName:function(e,t,r){return ii(e,t,r,16384)},getExportName:ai,getDeclarationName:function(e,t,r){return ii(e,t,r)},getNamespaceMemberName:oi,getExternalModuleOrNamespaceExportName:function(t,r,n,i){return t&&e.hasSyntacticModifier(r,1)?oi(t,ii(r),n,i):ai(r,n,i)},restoreOuterExpressions:function t(r,n,i){return void 0===i&&(i=15),r&&e.isOuterExpression(r,i)&&(a=r,!(e.isParenthesizedExpression(a)&&e.nodeIsSynthesized(a)&&e.nodeIsSynthesized(e.getSourceMapRange(a))&&e.nodeIsSynthesized(e.getCommentRange(a)))||e.some(e.getSyntheticLeadingComments(a))||e.some(e.getSyntheticTrailingComments(a)))?function(e,t){switch(e.kind){case 211:return Tt(e,t);case 210:return Dt(e,e.type,t);case 228:return Ht(e,t,e.type);case 229:return Qt(e,t);case 348:return Gn(e,t)}}(r,t(r.expression,n)):n;var a;},restoreEnclosingLabel:function t(r,n,i){if(!n)return r;var a=yr(n,n.label,e.isLabeledStatement(n.statement)?t(r,n.statement):r);return i&&i(n),a},createUseStrictPrologue:si,copyPrologue:function(e,t,r,n){return li(e,t,ci(e,t,r),n)},copyStandardPrologue:ci,copyCustomPrologue:li,ensureUseStrict:function(t){return e.findUseStrictPrologue(t)?t:e.setTextRange(F(n$3([si()],t,!0)),t)},liftToBlock:function(t){return e.Debug.assert(e.every(t,e.isStatementOrBlock),"Cannot lift nodes to a Block."),e.singleOrUndefined(t)||er(t)},mergeLexicalEnvironment:function(t,r){if(!e.some(r))return t;var i=ui(t,e.isPrologueDirective,0),a=ui(t,e.isHoistedFunction,i),o=ui(t,e.isHoistedVariableStatement,a),s=ui(r,e.isPrologueDirective,0),c=ui(r,e.isHoistedFunction,s),l=ui(r,e.isHoistedVariableStatement,c),u=ui(r,e.isCustomPrologue,l);e.Debug.assert(u===r.length,"Expected declarations to be valid standard or custom prologues");var _=e.isNodeArray(t)?t.slice():t;if(u>l&&_.splice.apply(_,n$3([o,0],r.slice(l,u),!1)),l>c&&_.splice.apply(_,n$3([a,0],r.slice(c,l),!1)),c>s&&_.splice.apply(_,n$3([i,0],r.slice(s,c),!1)),s>0)if(0===i)_.splice.apply(_,n$3([0,0],r.slice(0,s),!1));else {for(var d=new e.Map,p=0;p<i;p++){var f=t[p];d.set(f.expression.text,!0);}for(p=s-1;p>=0;p--){var g=r[p];d.has(g.expression.text)||_.unshift(g);}}return e.isNodeArray(t)?e.setTextRange(F(_,t.hasTrailingComma),t):t},updateModifiers:function(t,r){var n;return "number"==typeof r&&(r=ae(r)),e.isParameter(t)?ue(t,t.decorators,r,t.dotDotDotToken,t.name,t.questionToken,t.type,t.initializer):e.isPropertySignature(t)?pe(t,r,t.name,t.questionToken,t.type):e.isPropertyDeclaration(t)?ge(t,t.decorators,r,t.name,null!==(n=t.questionToken)&&void 0!==n?n:t.exclamationToken,t.type,t.initializer):e.isMethodSignature(t)?ye(t,r,t.name,t.questionToken,t.typeParameters,t.parameters,t.type):e.isMethodDeclaration(t)?he(t,t.decorators,r,t.asteriskToken,t.name,t.questionToken,t.typeParameters,t.parameters,t.type,t.body):e.isConstructorDeclaration(t)?De(t,t.decorators,r,t.parameters,t.body):e.isGetAccessorDeclaration(t)?Te(t,t.decorators,r,t.name,t.parameters,t.type,t.body):e.isSetAccessorDeclaration(t)?Ee(t,t.decorators,r,t.name,t.parameters,t.body):e.isIndexSignatureDeclaration(t)?Ae(t,t.decorators,r,t.parameters,t.type):e.isFunctionExpression(t)?Et(t,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isArrowFunction(t)?Nt(t,r,t.typeParameters,t.parameters,t.type,t.equalsGreaterThanToken,t.body):e.isClassExpression(t)?Vt(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isVariableStatement(t)?rr(t,r,t.declarationList):e.isFunctionDeclaration(t)?Sr(t,t.decorators,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body):e.isClassDeclaration(t)?Cr(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isInterfaceDeclaration(t)?kr(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members):e.isTypeAliasDeclaration(t)?Fr(t,t.decorators,r,t.name,t.typeParameters,t.type):e.isEnumDeclaration(t)?Pr(t,t.decorators,r,t.name,t.members):e.isModuleDeclaration(t)?Ir(t,t.decorators,r,t.name,t.body):e.isImportEqualsDeclaration(t)?Br(t,t.decorators,r,t.isTypeOnly,t.name,t.moduleReference):e.isImportDeclaration(t)?Jr(t,t.decorators,r,t.importClause,t.moduleSpecifier,t.assertClause):e.isExportAssignment(t)?Qr(t,t.decorators,r,t.expression):e.isExportDeclaration(t)?Yr(t,t.decorators,r,t.isTypeOnly,t.exportClause,t.moduleSpecifier,t.assertClause):e.Debug.assertNever(t)}};return N;function F(t,r){if(void 0===t||t===e.emptyArray)t=[];else if(e.isNodeArray(t)){if(void 0===r||t.hasTrailingComma===r)return void 0===t.transformFlags&&p(t),e.Debug.attachNodeArrayDebugInfo(t),t;var n=t.slice();return n.pos=t.pos,n.end=t.end,n.hasTrailingComma=r,n.transformFlags=t.transformFlags,e.Debug.attachNodeArrayDebugInfo(n),n}var i=t.length,a=i>=1&&i<=4?t.slice():t;return e.setTextRangePosEnd(a,-1,-1),a.hasTrailingComma=!!r,p(a),e.Debug.attachNodeArrayDebugInfo(a),a}function A(e){return a.createBaseNode(e)}function P(e,t,r){var n=A(e);return n.decorators=_i(t),n.modifiers=_i(r),n.transformFlags|=d(n.decorators)|d(n.modifiers),n.symbol=void 0,n.localSymbol=void 0,n.locals=void 0,n.nextContainer=void 0,n}function w(t,r,n,i){var a=P(t,r,n);if(i=di(i),a.name=i,i)switch(a.kind){case 168:case 171:case 172:case 166:case 294:if(e.isIdentifier(i)){a.transformFlags|=u(i);break}default:a.transformFlags|=_(i);}return a}function I(e,t,r,n,i){var a=w(e,t,r,n);return a.typeParameters=_i(i),a.transformFlags|=d(a.typeParameters),i&&(a.transformFlags|=1),a}function O(e,t,r,n,i,a,o){var s=I(e,t,r,n,i);return s.parameters=F(a),s.type=o,s.transformFlags|=d(s.parameters)|_(s.type),o&&(s.transformFlags|=1),s}function M(e,t){return t.typeArguments&&(e.typeArguments=t.typeArguments),f(e,t)}function L(e,t,r,n,i,a,o,s){var c=O(e,t,r,n,i,a,o);return c.body=s,c.transformFlags|=-16777217&_(c.body),s||(c.transformFlags|=1),c}function R(e,t){return t.exclamationToken&&(e.exclamationToken=t.exclamationToken),t.typeArguments&&(e.typeArguments=t.typeArguments),M(e,t)}function B(e,t,r,n,i,a){var o=I(e,t,r,n,i);return o.heritageClauses=_i(a),o.transformFlags|=d(o.heritageClauses),o}function j(e,t,r,n,i,a,o){var s=B(e,t,r,n,i,a);return s.members=F(o),s.transformFlags|=d(s.members),s}function J(e,t,r,n,i){var a=w(e,t,r,n);return a.initializer=i,a.transformFlags|=_(a.initializer),a}function z(e,t,r,n,i,a){var o=J(e,t,r,n,a);return o.type=i,o.transformFlags|=_(i),i&&(o.transformFlags|=1),o}function U(e,t){var r=$(e);return r.text=t,r}function K(e,t){void 0===t&&(t=0);var r=U(8,"number"==typeof e?e+"":e);return r.numericLiteralFlags=t,384&t&&(r.transformFlags|=512),r}function V(t){var r=U(9,"string"==typeof t?t:e.pseudoBigIntToString(t)+"n");return r.transformFlags|=4,r}function q(e,t){var r=U(10,e);return r.singleQuote=t,r}function W(e,t,r){var n=q(e,t);return n.hasExtendedUnicodeEscape=r,r&&(n.transformFlags|=512),n}function H(e){return U(13,e)}function G(t,r){void 0===r&&t&&(r=e.stringToToken(t)),79===r&&(r=void 0);var n=a.createBaseIdentifierNode(79);return n.originalKeywordKind=r,n.escapedText=e.escapeLeadingUnderscores(t),n}function Q(e,t){var r=G(e,void 0);return r.autoGenerateFlags=t,r.autoGenerateId=i,i++,r}function X(e,t,r){var n=G(e,r);return t&&(n.typeArguments=F(t)),132===n.originalKeywordKind&&(n.transformFlags|=16777216),n}function Y(e,t){var r=1;t&&(r|=8);var n=Q("",r);return e&&e(n),n}function Z(t,r){void 0===r&&(r=0),e.Debug.assert(!(7&r),"Argument out of range: flags");var n=Q(t&&e.isIdentifier(t)?e.idText(t):"",4|r);return n.original=t,n}function $(e){return a.createBaseTokenNode(e)}function ee(t){e.Debug.assert(t>=0&&t<=159,"Invalid token"),e.Debug.assert(t<=14||t>=17,"Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."),e.Debug.assert(t<=8||t>=14,"Invalid token. Use 'createLiteralLikeNode' to create literals."),e.Debug.assert(79!==t,"Invalid token. Use 'createIdentifier' to create identifiers");var r=$(t),n=0;switch(t){case 131:n=192;break;case 123:case 121:case 122:case 144:case 126:case 135:case 85:case 130:case 146:case 157:case 143:case 147:case 158:case 149:case 133:case 150:case 114:case 154:case 152:n=1;break;case 106:n=33554944;break;case 124:n=512;break;case 108:n=8192;}return n&&(r.transformFlags|=n),r}function te(){return ee(108)}function re(){return ee(110)}function ne(){return ee(95)}function ie(e){return ee(e)}function ae(e){var t=[];return 1&e&&t.push(ie(93)),2&e&&t.push(ie(135)),512&e&&t.push(ie(88)),2048&e&&t.push(ie(85)),4&e&&t.push(ie(123)),8&e&&t.push(ie(121)),16&e&&t.push(ie(122)),128&e&&t.push(ie(126)),32&e&&t.push(ie(124)),16384&e&&t.push(ie(158)),64&e&&t.push(ie(144)),256&e&&t.push(ie(131)),t}function oe(e,t){var r=A(160);return r.left=e,r.right=di(t),r.transformFlags|=_(r.left)|u(r.right),r}function se(e){var t=A(161);return t.expression=g().parenthesizeExpressionOfComputedPropertyName(e),t.transformFlags|=66048|_(t.expression),t}function ce(e,t,r){var n=w(162,void 0,void 0,e);return n.constraint=t,n.default=r,n.transformFlags=1,n}function le(t,r,n,i,a,o,s){var c=z(163,t,r,i,o,s&&g().parenthesizeExpressionForDisallowedComma(s));return c.dotDotDotToken=n,c.questionToken=a,e.isThisIdentifier(c.name)?c.transformFlags=1:(c.transformFlags|=_(c.dotDotDotToken)|_(c.questionToken),a&&(c.transformFlags|=1),16476&e.modifiersToFlags(c.modifiers)&&(c.transformFlags|=4096),(s||n)&&(c.transformFlags|=512)),c}function ue(e,t,r,n,i,a,o,s){return e.decorators!==t||e.modifiers!==r||e.dotDotDotToken!==n||e.name!==i||e.questionToken!==a||e.type!==o||e.initializer!==s?f(le(t,r,n,i,a,o,s),e):e}function _e(e){var t=A(164);return t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=4097|_(t.expression),t}function de(e,t,r,n){var i=w(165,void 0,e,t);return i.type=n,i.questionToken=r,i.transformFlags=1,i}function pe(e,t,r,n,i){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.type!==i?f(de(t,r,n,i),e):e}function fe(t,r,n,i,a,o){var s=z(166,t,r,n,a,o);return s.questionToken=i&&e.isQuestionToken(i)?i:void 0,s.exclamationToken=i&&e.isExclamationToken(i)?i:void 0,s.transformFlags|=_(s.questionToken)|_(s.exclamationToken)|8388608,(e.isComputedPropertyName(s.name)||e.hasStaticModifier(s)&&s.initializer)&&(s.transformFlags|=4096),(i||2&e.modifiersToFlags(s.modifiers))&&(s.transformFlags|=1),s}function ge(t,r,n,i,a,o,s){return t.decorators!==r||t.modifiers!==n||t.name!==i||t.questionToken!==(void 0!==a&&e.isQuestionToken(a)?a:void 0)||t.exclamationToken!==(void 0!==a&&e.isExclamationToken(a)?a:void 0)||t.type!==o||t.initializer!==s?f(fe(r,n,i,a,o,s),t):t}function me(e,t,r,n,i,a){var o=O(167,void 0,e,t,n,i,a);return o.questionToken=r,o.transformFlags=1,o}function ye(e,t,r,n,i,a,o){return e.modifiers!==t||e.name!==r||e.questionToken!==n||e.typeParameters!==i||e.parameters!==a||e.type!==o?M(me(t,r,n,i,a,o),e):e}function ve(t,r,n,i,a,o,s,c,l){var u=L(168,t,r,i,o,s,c,l);return u.asteriskToken=n,u.questionToken=a,u.transformFlags|=_(u.asteriskToken)|_(u.questionToken)|512,a&&(u.transformFlags|=1),256&e.modifiersToFlags(u.modifiers)?u.transformFlags|=n?64:128:n&&(u.transformFlags|=1024),u}function he(e,t,r,n,i,a,o,s,c,l){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.questionToken!==a||e.typeParameters!==o||e.parameters!==s||e.type!==c||e.body!==l?R(ve(t,r,n,i,a,o,s,c,l),e):e}function be(e,t,r){var n=I(169,e,t,void 0,void 0);return n.body=r,n.transformFlags=8388608|_(r),n}function xe(e,t,r,n){var i=L(170,e,t,void 0,void 0,r,void 0,n);return i.transformFlags|=512,i}function De(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.parameters!==n||e.body!==i?R(xe(t,r,n,i),e):e}function Se(e,t,r,n,i,a){return L(171,e,t,r,void 0,n,i,a)}function Te(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.type!==a||e.body!==o?R(Se(t,r,n,i,a,o),e):e}function Ce(e,t,r,n,i){return L(172,e,t,r,void 0,n,void 0,i)}function Ee(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.parameters!==i||e.body!==a?R(Ce(t,r,n,i,a),e):e}function ke(e,t,r){var n=O(173,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Ne(e,t,r){var n=O(174,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Fe(e,t,r,n){var i=O(175,e,t,void 0,void 0,r,n);return i.transformFlags=1,i}function Ae(e,t,r,n,i){return e.parameters!==n||e.type!==i||e.decorators!==t||e.modifiers!==r?M(Fe(t,r,n,i),e):e}function Pe(e,t){var r=A(198);return r.type=e,r.literal=t,r.transformFlags=1,r}function we(e,t,r){var n=A(176);return n.assertsModifier=e,n.parameterName=di(t),n.type=r,n.transformFlags=1,n}function Ie(e,t){var r=A(177);return r.typeName=di(e),r.typeArguments=t&&g().parenthesizeTypeArguments(F(t)),r.transformFlags=1,r}function Oe(e,t,r){var n=O(178,void 0,void 0,void 0,e,t,r);return n.transformFlags=1,n}function Me(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 4===t.length?Le.apply(void 0,t):3===t.length?Re.apply(void 0,t):e.Debug.fail("Incorrect number of arguments specified.")}function Le(e,t,r,n){var i=O(179,void 0,e,void 0,t,r,n);return i.transformFlags=1,i}function Re(e,t,r){return Le(void 0,e,t,r)}function Be(e,t,r,n,i){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i?M(Me(t,r,n,i),e):e}function je(e,t,r,n){return Be(e,e.modifiers,t,r,n)}function Je(e){var t=A(180);return t.exprName=e,t.transformFlags=1,t}function ze(e){var t=A(181);return t.members=F(e),t.transformFlags=1,t}function Ue(e){var t=A(182);return t.elementType=g().parenthesizeElementTypeOfArrayType(e),t.transformFlags=1,t}function Ke(e){var t=A(183);return t.elements=F(e),t.transformFlags=1,t}function Ve(e,t,r,n){var i=A(196);return i.dotDotDotToken=e,i.name=t,i.questionToken=r,i.type=n,i.transformFlags=1,i}function qe(e){var t=A(184);return t.type=g().parenthesizeElementTypeOfArrayType(e),t.transformFlags=1,t}function We(e){var t=A(185);return t.type=e,t.transformFlags=1,t}function He(e,t){var r=A(e);return r.types=g().parenthesizeConstituentTypesOfUnionOrIntersectionType(t),r.transformFlags=1,r}function Ge(e,t){return e.types!==t?f(He(e.kind,t),e):e}function Qe(e,t,r,n){var i=A(188);return i.checkType=g().parenthesizeMemberOfConditionalType(e),i.extendsType=g().parenthesizeMemberOfConditionalType(t),i.trueType=r,i.falseType=n,i.transformFlags=1,i}function Xe(e){var t=A(189);return t.typeParameter=e,t.transformFlags=1,t}function Ye(e,t){var r=A(197);return r.head=e,r.templateSpans=F(t),r.transformFlags=1,r}function Ze(e,t,r,n){void 0===n&&(n=!1);var i=A(199);return i.argument=e,i.qualifier=t,i.typeArguments=r&&g().parenthesizeTypeArguments(r),i.isTypeOf=n,i.transformFlags=1,i}function $e(e){var t=A(190);return t.type=e,t.transformFlags=1,t}function et(e,t){var r=A(192);return r.operator=e,r.type=g().parenthesizeMemberOfElementType(t),r.transformFlags=1,r}function tt(e,t){var r=A(193);return r.objectType=g().parenthesizeMemberOfElementType(e),r.indexType=t,r.transformFlags=1,r}function rt(e,t,r,n,i,a){var o=A(194);return o.readonlyToken=e,o.typeParameter=t,o.nameType=r,o.questionToken=n,o.type=i,o.members=a&&F(a),o.transformFlags=1,o}function nt(e){var t=A(195);return t.literal=e,t.transformFlags=1,t}function it(e){var t=A(200);return t.elements=F(e),t.transformFlags|=262656|d(t.elements),16384&t.transformFlags&&(t.transformFlags|=32832),t}function at(e){var t=A(201);return t.elements=F(e),t.transformFlags|=262656|d(t.elements),t}function ot(t,r,n,i){var a=J(202,void 0,void 0,n,i&&g().parenthesizeExpressionForDisallowedComma(i));return a.propertyName=di(r),a.dotDotDotToken=t,a.transformFlags|=512|_(a.dotDotDotToken),a.propertyName&&(a.transformFlags|=e.isIdentifier(a.propertyName)?u(a.propertyName):_(a.propertyName)),t&&(a.transformFlags|=16384),a}function st(e){return A(e)}function ct(t,r){var n=st(203),i=t&&e.lastOrUndefined(t),a=F(t,!(!i||!e.isOmittedExpression(i))||void 0);return n.elements=g().parenthesizeExpressionsOfCommaDelimitedList(a),n.multiLine=r,n.transformFlags|=d(n.elements),n}function lt(e,t){var r=st(204);return r.properties=F(e),r.multiLine=t,r.transformFlags|=d(r.properties),r}function ut(t,r){var n=st(205);return n.expression=g().parenthesizeLeftSideOfAccess(t),n.name=di(r),n.transformFlags=_(n.expression)|(e.isIdentifier(n.name)?u(n.name):_(n.name)),e.isSuperKeyword(t)&&(n.transformFlags|=192),n}function _t(t,r,n){var i=st(205);return i.flags|=32,i.expression=g().parenthesizeLeftSideOfAccess(t),i.questionDotToken=r,i.name=di(n),i.transformFlags|=16|_(i.expression)|_(i.questionDotToken)|(e.isIdentifier(i.name)?u(i.name):_(i.name)),i}function dt(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."),t.expression!==r||t.questionDotToken!==n||t.name!==i?f(_t(r,n,i),t):t}function pt(t,r){var n=st(206);return n.expression=g().parenthesizeLeftSideOfAccess(t),n.argumentExpression=pi(r),n.transformFlags|=_(n.expression)|_(n.argumentExpression),e.isSuperKeyword(t)&&(n.transformFlags|=192),n}function ft(e,t,r){var n=st(206);return n.flags|=32,n.expression=g().parenthesizeLeftSideOfAccess(e),n.questionDotToken=t,n.argumentExpression=pi(r),n.transformFlags|=_(n.expression)|_(n.questionDotToken)|_(n.argumentExpression)|16,n}function gt(t,r,n,i){return e.Debug.assert(!!(32&t.flags),"Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."),t.expression!==r||t.questionDotToken!==n||t.argumentExpression!==i?f(ft(r,n,i),t):t}function mt(t,r,n){var i=st(207);return i.expression=g().parenthesizeLeftSideOfAccess(t),i.typeArguments=_i(r),i.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(F(n)),i.transformFlags|=_(i.expression)|d(i.typeArguments)|d(i.arguments),i.typeArguments&&(i.transformFlags|=1),e.isImportKeyword(i.expression)?i.transformFlags|=4194304:e.isSuperProperty(i.expression)&&(i.transformFlags|=8192),i}function yt(t,r,n,i){var a=st(207);return a.flags|=32,a.expression=g().parenthesizeLeftSideOfAccess(t),a.questionDotToken=r,a.typeArguments=_i(n),a.arguments=g().parenthesizeExpressionsOfCommaDelimitedList(F(i)),a.transformFlags|=_(a.expression)|_(a.questionDotToken)|d(a.typeArguments)|d(a.arguments)|16,a.typeArguments&&(a.transformFlags|=1),e.isSuperProperty(a.expression)&&(a.transformFlags|=8192),a}function vt(t,r,n,i,a){return e.Debug.assert(!!(32&t.flags),"Cannot update a CallExpression using updateCallChain. Use updateCall instead."),t.expression!==r||t.questionDotToken!==n||t.typeArguments!==i||t.arguments!==a?f(yt(r,n,i,a),t):t}function ht(e,t,r){var n=st(208);return n.expression=g().parenthesizeExpressionOfNew(e),n.typeArguments=_i(t),n.arguments=r?g().parenthesizeExpressionsOfCommaDelimitedList(r):void 0,n.transformFlags|=_(n.expression)|d(n.typeArguments)|d(n.arguments)|16,n.typeArguments&&(n.transformFlags|=1),n}function bt(t,r,n){var i=st(209);return i.tag=g().parenthesizeLeftSideOfAccess(t),i.typeArguments=_i(r),i.template=n,i.transformFlags|=_(i.tag)|d(i.typeArguments)|_(i.template)|512,i.typeArguments&&(i.transformFlags|=1),e.hasInvalidEscape(i.template)&&(i.transformFlags|=64),i}function xt(e,t){var r=st(210);return r.expression=g().parenthesizeOperandOfPrefixUnary(t),r.type=e,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Dt(e,t,r){return e.type!==t||e.expression!==r?f(xt(t,r),e):e}function St(e){var t=st(211);return t.expression=e,t.transformFlags=_(t.expression),t}function Tt(e,t){return e.expression!==t?f(St(t),e):e}function Ct(t,r,n,i,a,o,s){var c=L(212,void 0,t,n,i,a,o,s);return c.asteriskToken=r,c.transformFlags|=_(c.asteriskToken),c.typeParameters&&(c.transformFlags|=1),256&e.modifiersToFlags(c.modifiers)?c.asteriskToken?c.transformFlags|=64:c.transformFlags|=128:c.asteriskToken&&(c.transformFlags|=1024),c}function Et(e,t,r,n,i,a,o,s){return e.name!==n||e.modifiers!==t||e.asteriskToken!==r||e.typeParameters!==i||e.parameters!==a||e.type!==o||e.body!==s?R(Ct(t,r,n,i,a,o,s),e):e}function kt(t,r,n,i,a,o){var s=L(213,void 0,t,void 0,r,n,i,g().parenthesizeConciseBodyOfArrowFunction(o));return s.equalsGreaterThanToken=null!=a?a:ee(38),s.transformFlags|=512|_(s.equalsGreaterThanToken),256&e.modifiersToFlags(s.modifiers)&&(s.transformFlags|=8320),s}function Nt(e,t,r,n,i,a,o){return e.modifiers!==t||e.typeParameters!==r||e.parameters!==n||e.type!==i||e.equalsGreaterThanToken!==a||e.body!==o?R(kt(t,r,n,i,a,o),e):e}function Ft(e){var t=st(214);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function At(e){var t=st(215);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function Pt(e){var t=st(216);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=_(t.expression),t}function wt(e){var t=st(217);return t.expression=g().parenthesizeOperandOfPrefixUnary(e),t.transformFlags|=1048768|_(t.expression),t}function It(t,r){var n=st(218);return n.operator=t,n.operand=g().parenthesizeOperandOfPrefixUnary(r),n.transformFlags|=_(n.operand),45!==t&&46!==t||!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=67108864),n}function Ot(t,r){var n=st(219);return n.operator=r,n.operand=g().parenthesizeOperandOfPostfixUnary(t),n.transformFlags|=_(n.operand),!e.isIdentifier(n.operand)||e.isGeneratedIdentifier(n.operand)||e.isLocalName(n.operand)||(n.transformFlags|=67108864),n}function Mt(t,r,n){var i,a=st(220),o="number"==typeof(i=r)?ee(i):i,s=o.kind;return a.left=g().parenthesizeLeftSideOfBinary(s,t),a.operatorToken=o,a.right=g().parenthesizeRightSideOfBinary(s,a.left,n),a.transformFlags|=_(a.left)|_(a.operatorToken)|_(a.right),60===s?a.transformFlags|=16:63===s?e.isObjectLiteralExpression(a.left)?a.transformFlags|=2624|Lt(a.left):e.isArrayLiteralExpression(a.left)&&(a.transformFlags|=2560|Lt(a.left)):42===s||67===s?a.transformFlags|=256:e.isLogicalOrCoalescingAssignmentOperator(s)&&(a.transformFlags|=8),a}function Lt(t){if(32768&t.transformFlags)return 32768;if(64&t.transformFlags)for(var r=0,n=e.getElementsOfBindingOrAssignmentPattern(t);r<n.length;r++){var i=n[r],a=e.getTargetOfBindingOrAssignmentElement(i);if(a&&e.isAssignmentPattern(a)){if(32768&a.transformFlags)return 32768;if(64&a.transformFlags){var o=Lt(a);if(o)return o}}}return 0}function Rt(e,t,r,n,i){var a=st(221);return a.condition=g().parenthesizeConditionOfConditionalExpression(e),a.questionToken=null!=t?t:ee(57),a.whenTrue=g().parenthesizeBranchOfConditionalExpression(r),a.colonToken=null!=n?n:ee(58),a.whenFalse=g().parenthesizeBranchOfConditionalExpression(i),a.transformFlags|=_(a.condition)|_(a.questionToken)|_(a.whenTrue)|_(a.colonToken)|_(a.whenFalse),a}function Bt(e,t){var r=st(222);return r.head=e,r.templateSpans=F(t),r.transformFlags|=_(r.head)|d(r.templateSpans)|512,r}function jt(r,n,i,a){void 0===a&&(a=0),e.Debug.assert(!(-2049&a),"Unsupported template flags.");var o=void 0;if(void 0!==i&&i!==n&&"object"==typeof(o=function(r,n){switch(t||(t=e.createScanner(99,!1,0)),r){case 14:t.setText("`"+n+"`");break;case 15:t.setText("`"+n+"${");break;case 16:t.setText("}"+n+"${");break;case 17:t.setText("}"+n+"`");}var i,a=t.scan();if(19===a&&(a=t.reScanTemplateToken(!1)),t.isUnterminated())return t.setText(void 0),l;switch(a){case 14:case 15:case 16:case 17:i=t.getTokenValue();}return void 0===i||1!==t.scan()?(t.setText(void 0),l):(t.setText(void 0),i)}(r,i)))return e.Debug.fail("Invalid raw text");if(void 0===n){if(void 0===o)return e.Debug.fail("Arguments 'text' and 'rawText' may not both be undefined.");n=o;}else void 0!==o&&e.Debug.assert(n===o,"Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'.");return Jt(r,n,i,a)}function Jt(e,t,r,n){var i=$(e);return i.text=t,i.rawText=r,i.templateFlags=2048&n,i.transformFlags|=512,i.templateFlags&&(i.transformFlags|=64),i}function zt(t,r){e.Debug.assert(!t||!!r,"A `YieldExpression` with an asteriskToken must have an expression.");var n=st(223);return n.expression=r&&g().parenthesizeExpressionForDisallowedComma(r),n.asteriskToken=t,n.transformFlags|=_(n.expression)|_(n.asteriskToken)|524864,n}function Ut(e){var t=st(224);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=16896|_(t.expression),t}function Kt(e,t,r,n,i,a){var o=j(225,e,t,r,n,i,a);return o.transformFlags|=512,o}function Vt(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Kt(t,r,n,i,a,o),e):e}function qt(e,t){var r=A(227);return r.expression=g().parenthesizeLeftSideOfAccess(e),r.typeArguments=t&&g().parenthesizeTypeArguments(t),r.transformFlags|=_(r.expression)|d(r.typeArguments)|512,r}function Wt(e,t){var r=st(228);return r.expression=e,r.type=t,r.transformFlags|=_(r.expression)|_(r.type)|1,r}function Ht(e,t,r){return e.expression!==t||e.type!==r?f(Wt(t,r),e):e}function Gt(e){var t=st(229);return t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=1|_(t.expression),t}function Qt(t,r){return e.isNonNullChain(t)?Yt(t,r):t.expression!==r?f(Gt(r),t):t}function Xt(e){var t=st(229);return t.flags|=32,t.expression=g().parenthesizeLeftSideOfAccess(e),t.transformFlags|=1|_(t.expression),t}function Yt(t,r){return e.Debug.assert(!!(32&t.flags),"Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."),t.expression!==r?f(Xt(r),t):t}function Zt(t,r){var n=st(230);switch(n.keywordToken=t,n.name=r,n.transformFlags|=_(n.name),t){case 103:n.transformFlags|=512;break;case 100:n.transformFlags|=4;break;default:return e.Debug.assertNever(t)}return n}function $t(e,t){var r=A(232);return r.expression=e,r.literal=t,r.transformFlags|=_(r.expression)|_(r.literal)|512,r}function er(e,t){var r=A(234);return r.statements=F(e),r.multiLine=t,r.transformFlags|=d(r.statements),r}function tr(t,r){var n=P(236,void 0,t);return n.declarationList=e.isArray(r)?xr(r):r,n.transformFlags|=_(n.declarationList),2&e.modifiersToFlags(n.modifiers)&&(n.transformFlags=1),n}function rr(e,t,r){return e.modifiers!==t||e.declarationList!==r?f(tr(t,r),e):e}function nr(){return A(235)}function ir(e){var t=A(237);return t.expression=g().parenthesizeExpressionOfExpressionStatement(e),t.transformFlags|=_(t.expression),t}function ar(e,t,r){var n=A(238);return n.expression=e,n.thenStatement=fi(t),n.elseStatement=fi(r),n.transformFlags|=_(n.expression)|_(n.thenStatement)|_(n.elseStatement),n}function or(e,t){var r=A(239);return r.statement=fi(e),r.expression=t,r.transformFlags|=_(r.statement)|_(r.expression),r}function sr(e,t){var r=A(240);return r.expression=e,r.statement=fi(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function cr(e,t,r,n){var i=A(241);return i.initializer=e,i.condition=t,i.incrementor=r,i.statement=fi(n),i.transformFlags|=_(i.initializer)|_(i.condition)|_(i.incrementor)|_(i.statement),i}function lr(e,t,r){var n=A(242);return n.initializer=e,n.expression=t,n.statement=fi(r),n.transformFlags|=_(n.initializer)|_(n.expression)|_(n.statement),n}function ur(e,t,r,n){var i=A(243);return i.awaitModifier=e,i.initializer=t,i.expression=g().parenthesizeExpressionForDisallowedComma(r),i.statement=fi(n),i.transformFlags|=_(i.awaitModifier)|_(i.initializer)|_(i.expression)|_(i.statement)|512,e&&(i.transformFlags|=64),i}function _r(e){var t=A(244);return t.label=di(e),t.transformFlags|=2097152|_(t.label),t}function dr(e){var t=A(245);return t.label=di(e),t.transformFlags|=2097152|_(t.label),t}function pr(e){var t=A(246);return t.expression=e,t.transformFlags|=2097216|_(t.expression),t}function fr(e,t){var r=A(247);return r.expression=e,r.statement=fi(t),r.transformFlags|=_(r.expression)|_(r.statement),r}function gr(e,t){var r=A(248);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.caseBlock=t,r.transformFlags|=_(r.expression)|_(r.caseBlock),r}function mr(e,t){var r=A(249);return r.label=di(e),r.statement=fi(t),r.transformFlags|=_(r.label)|_(r.statement),r}function yr(e,t,r){return e.label!==t||e.statement!==r?f(mr(t,r),e):e}function vr(e){var t=A(250);return t.expression=e,t.transformFlags|=_(t.expression),t}function hr(e,t,r){var n=A(251);return n.tryBlock=e,n.catchClause=t,n.finallyBlock=r,n.transformFlags|=_(n.tryBlock)|_(n.catchClause)|_(n.finallyBlock),n}function br(e,t,r,n){var i=z(253,void 0,void 0,e,r,n&&g().parenthesizeExpressionForDisallowedComma(n));return i.exclamationToken=t,i.transformFlags|=_(i.exclamationToken),t&&(i.transformFlags|=1),i}function xr(e,t){void 0===t&&(t=0);var r=A(254);return r.flags|=3&t,r.declarations=F(e),r.transformFlags|=2097152|d(r.declarations),3&t&&(r.transformFlags|=131584),r}function Dr(t,r,n,i,a,o,s,c){var l=L(255,t,r,i,a,o,s,c);return l.asteriskToken=n,!l.body||2&e.modifiersToFlags(l.modifiers)?l.transformFlags=1:(l.transformFlags|=2097152|_(l.asteriskToken),256&e.modifiersToFlags(l.modifiers)?l.asteriskToken?l.transformFlags|=64:l.transformFlags|=128:l.asteriskToken&&(l.transformFlags|=1024)),l}function Sr(e,t,r,n,i,a,o,s,c){return e.decorators!==t||e.modifiers!==r||e.asteriskToken!==n||e.name!==i||e.typeParameters!==a||e.parameters!==o||e.type!==s||e.body!==c?R(Dr(t,r,n,i,a,o,s,c),e):e}function Tr(t,r,n,i,a,o){var s=j(256,t,r,n,i,a,o);return 2&e.modifiersToFlags(s.modifiers)?s.transformFlags=1:(s.transformFlags|=512,4096&s.transformFlags&&(s.transformFlags|=1)),s}function Cr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Tr(t,r,n,i,a,o),e):e}function Er(e,t,r,n,i,a){var o=B(257,e,t,r,n,i);return o.members=F(a),o.transformFlags=1,o}function kr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.heritageClauses!==a||e.members!==o?f(Er(t,r,n,i,a,o),e):e}function Nr(e,t,r,n,i){var a=I(258,e,t,r,n);return a.type=i,a.transformFlags=1,a}function Fr(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.typeParameters!==i||e.type!==a?f(Nr(t,r,n,i,a),e):e}function Ar(e,t,r,n){var i=w(259,e,t,r);return i.members=F(n),i.transformFlags|=1|d(i.members),i.transformFlags&=-16777217,i}function Pr(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.members!==i?f(Ar(t,r,n,i),e):e}function wr(t,r,n,i,a){void 0===a&&(a=0);var o=P(260,t,r);return o.flags|=1044&a,o.name=n,o.body=i,2&e.modifiersToFlags(o.modifiers)?o.transformFlags=1:o.transformFlags|=_(o.name)|_(o.body)|1,o.transformFlags&=-16777217,o}function Ir(e,t,r,n,i){return e.decorators!==t||e.modifiers!==r||e.name!==n||e.body!==i?f(wr(t,r,n,i,e.flags),e):e}function Or(e){var t=A(261);return t.statements=F(e),t.transformFlags|=d(t.statements),t}function Mr(e){var t=A(262);return t.clauses=F(e),t.transformFlags|=d(t.clauses),t}function Lr(e){var t=w(263,void 0,void 0,e);return t.transformFlags=1,t}function Rr(t,r,n,i,a){var o=w(264,t,r,i);return o.isTypeOnly=n,o.moduleReference=a,o.transformFlags|=_(o.moduleReference),e.isExternalModuleReference(o.moduleReference)||(o.transformFlags|=1),o.transformFlags&=-16777217,o}function Br(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.isTypeOnly!==n||e.name!==i||e.moduleReference!==a?f(Rr(t,r,n,i,a),e):e}function jr(e,t,r,n,i){var a=P(265,e,t);return a.importClause=r,a.moduleSpecifier=n,a.assertClause=i,a.transformFlags|=_(a.importClause)|_(a.moduleSpecifier),a.transformFlags&=-16777217,a}function Jr(e,t,r,n,i,a){return e.decorators!==t||e.modifiers!==r||e.importClause!==n||e.moduleSpecifier!==i||e.assertClause!==a?f(jr(t,r,n,i,a),e):e}function zr(e,t,r){var n=A(266);return n.isTypeOnly=e,n.name=t,n.namedBindings=r,n.transformFlags|=_(n.name)|_(n.namedBindings),e&&(n.transformFlags|=1),n.transformFlags&=-16777217,n}function Ur(e,t){var r=A(292);return r.elements=e,r.multiLine=t,r.transformFlags|=4,r}function Kr(e,t){var r=A(293);return r.name=e,r.value=t,r.transformFlags|=4,r}function Vr(e){var t=A(267);return t.name=e,t.transformFlags|=_(t.name),t.transformFlags&=-16777217,t}function qr(e){var t=A(273);return t.name=e,t.transformFlags|=4|_(t.name),t.transformFlags&=-16777217,t}function Wr(e){var t=A(268);return t.elements=F(e),t.transformFlags|=d(t.elements),t.transformFlags&=-16777217,t}function Hr(e,t,r){var n=A(269);return n.isTypeOnly=e,n.propertyName=t,n.name=r,n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-16777217,n}function Gr(e,t,r,n){var i=P(270,e,t);return i.isExportEquals=r,i.expression=r?g().parenthesizeRightSideOfBinary(63,void 0,n):g().parenthesizeExpressionOfExportDefault(n),i.transformFlags|=_(i.expression),i.transformFlags&=-16777217,i}function Qr(e,t,r,n){return e.decorators!==t||e.modifiers!==r||e.expression!==n?f(Gr(t,r,e.isExportEquals,n),e):e}function Xr(e,t,r,n,i,a){var o=P(271,e,t);return o.isTypeOnly=r,o.exportClause=n,o.moduleSpecifier=i,o.assertClause=a,o.transformFlags|=_(o.exportClause)|_(o.moduleSpecifier),o.transformFlags&=-16777217,o}function Yr(e,t,r,n,i,a,o){return e.decorators!==t||e.modifiers!==r||e.isTypeOnly!==n||e.exportClause!==i||e.moduleSpecifier!==a||e.assertClause!==o?f(Xr(t,r,n,i,a,o),e):e}function Zr(e){var t=A(272);return t.elements=F(e),t.transformFlags|=d(t.elements),t.transformFlags&=-16777217,t}function $r(e,t,r){var n=A(274);return n.isTypeOnly=e,n.propertyName=di(t),n.name=di(r),n.transformFlags|=_(n.propertyName)|_(n.name),n.transformFlags&=-16777217,n}function en(e){var t=A(276);return t.expression=e,t.transformFlags|=_(t.expression),t.transformFlags&=-16777217,t}function tn(e,t){var r=A(e);return r.type=t,r}function rn(e,t){return O(315,void 0,void 0,void 0,void 0,e,t)}function nn(e,t){void 0===t&&(t=!1);var r=A(320);return r.jsDocPropertyTags=_i(e),r.isArrayType=t,r}function an(e){var t=A(307);return t.type=e,t}function on(e,t,r){var n=A(321);return n.typeParameters=_i(e),n.parameters=F(t),n.type=r,n}function sn(t){var r=c(t.kind);return t.tagName.escapedText===e.escapeLeadingUnderscores(r)?t.tagName:X(r)}function cn(e,t,r){var n=A(e);return n.tagName=t,n.comment=r,n}function ln(e,t,r,n){var i=cn(342,null!=e?e:X("template"),n);return i.constraint=t,i.typeParameters=F(r),i}function un(t,r,n,i){var a=cn(343,null!=t?t:X("typedef"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function _n(e,t,r,n,i,a){var o=cn(338,null!=e?e:X("param"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function dn(e,t,r,n,i,a){var o=cn(345,null!=e?e:X("prop"),a);return o.typeExpression=n,o.name=t,o.isNameFirst=!!i,o.isBracketed=r,o}function pn(t,r,n,i){var a=cn(336,null!=t?t:X("callback"),i);return a.typeExpression=r,a.fullName=n,a.name=e.getJSDocTypeAliasName(n),a}function fn(e,t,r){var n=cn(326,null!=e?e:X("augments"),r);return n.class=t,n}function gn(e,t,r){var n=cn(327,null!=e?e:X("implements"),r);return n.class=t,n}function mn(e,t,r){var n=cn(344,null!=e?e:X("see"),r);return n.name=t,n}function yn(e){var t=A(308);return t.name=e,t}function vn(e,t){var r=A(309);return r.left=e,r.right=t,r.transformFlags|=_(r.left)|_(r.right),r}function hn(e,t){var r=A(322);return r.name=e,r.text=t,r}function bn(e,t){var r=A(323);return r.name=e,r.text=t,r}function xn(e,t){var r=A(324);return r.name=e,r.text=t,r}function Dn(e,t,r){return cn(e,null!=t?t:X(c(e)),r)}function Sn(e,t,r,n){var i=cn(e,null!=t?t:X(c(e)),n);return i.typeExpression=r,i}function Tn(e,t){return cn(325,e,t)}function Cn(e){var t=A(319);return t.text=e,t}function En(e,t){var r=A(318);return r.comment=e,r.tags=_i(t),r}function kn(e,t,r){var n=A(277);return n.openingElement=e,n.children=F(t),n.closingElement=r,n.transformFlags|=_(n.openingElement)|d(n.children)|_(n.closingElement)|2,n}function Nn(e,t,r){var n=A(278);return n.tagName=e,n.typeArguments=_i(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,n.typeArguments&&(n.transformFlags|=1),n}function Fn(e,t,r){var n=A(279);return n.tagName=e,n.typeArguments=_i(t),n.attributes=r,n.transformFlags|=_(n.tagName)|d(n.typeArguments)|_(n.attributes)|2,t&&(n.transformFlags|=1),n}function An(e){var t=A(280);return t.tagName=e,t.transformFlags|=2|_(t.tagName),t}function Pn(e,t,r){var n=A(281);return n.openingFragment=e,n.children=F(t),n.closingFragment=r,n.transformFlags|=_(n.openingFragment)|d(n.children)|_(n.closingFragment)|2,n}function wn(e,t){var r=A(11);return r.text=e,r.containsOnlyTriviaWhiteSpaces=!!t,r.transformFlags|=2,r}function In(e,t){var r=A(284);return r.name=e,r.initializer=t,r.transformFlags|=_(r.name)|_(r.initializer)|2,r}function On(e){var t=A(285);return t.properties=F(e),t.transformFlags|=2|d(t.properties),t}function Mn(e){var t=A(286);return t.expression=e,t.transformFlags|=2|_(t.expression),t}function Ln(e,t){var r=A(287);return r.dotDotDotToken=e,r.expression=t,r.transformFlags|=_(r.dotDotDotToken)|_(r.expression)|2,r}function Rn(e,t){var r=A(288);return r.expression=g().parenthesizeExpressionForDisallowedComma(e),r.statements=F(t),r.transformFlags|=_(r.expression)|d(r.statements),r}function Bn(e){var t=A(289);return t.statements=F(e),t.transformFlags=d(t.statements),t}function jn(t,r){var n=A(290);switch(n.token=t,n.types=F(r),n.transformFlags|=d(n.types),t){case 94:n.transformFlags|=512;break;case 117:n.transformFlags|=1;break;default:return e.Debug.assertNever(t)}return n}function Jn(t,r){var n=A(291);return ("string"==typeof t||t&&!e.isVariableDeclaration(t))&&(t=br(t,void 0,void 0,void 0)),n.variableDeclaration=t,n.block=r,n.transformFlags|=_(n.variableDeclaration)|_(n.block),t||(n.transformFlags|=32),n}function zn(e,t){var r=w(294,void 0,void 0,e);return r.initializer=g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer),r}function Un(e,t){var r=w(295,void 0,void 0,e);return r.objectAssignmentInitializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=512|_(r.objectAssignmentInitializer),r}function Kn(e){var t=A(296);return t.expression=g().parenthesizeExpressionForDisallowedComma(e),t.transformFlags|=32832|_(t.expression),t}function Vn(e,t){var r=A(297);return r.name=di(e),r.initializer=t&&g().parenthesizeExpressionForDisallowedComma(t),r.transformFlags|=_(r.name)|_(r.initializer)|1,r}function qn(t,r){void 0===r&&(r=e.emptyArray);var n=A(304);return n.prepends=r,n.sourceFiles=t,n}function Wn(e,t){var r=A(e);return r.data=t,r}function Hn(t,r){var n=A(348);return n.expression=t,n.original=r,n.transformFlags|=1|_(n.expression),e.setTextRange(n,r),n}function Gn(e,t){return e.expression!==t?f(Hn(t,e.original),e):e}function Qn(t){if(e.nodeIsSynthesized(t)&&!e.isParseTreeNode(t)&&!t.original&&!t.emitNode&&!t.id){if(e.isCommaListExpression(t))return t.elements;if(e.isBinaryExpression(t)&&e.isCommaToken(t.operatorToken))return [t.left,t.right]}return t}function Xn(t){var r=A(349);return r.elements=F(e.sameFlatMap(t,Qn)),r.transformFlags|=d(r.elements),r}function Yn(e,t){var r=A(352);return r.expression=e,r.thisArg=t,r.transformFlags|=_(r.expression)|_(r.thisArg),r}function Zn(t){if(void 0===t)return t;var r=e.isSourceFile(t)?a.createBaseSourceFileNode(303):e.isIdentifier(t)?a.createBaseIdentifierNode(79):e.isPrivateIdentifier(t)?a.createBasePrivateIdentifierNode(80):e.isNodeKind(t.kind)?a.createBaseNode(t.kind):a.createBaseTokenNode(t.kind);for(var n in r.flags|=-9&t.flags,r.transformFlags=t.transformFlags,h(r,t),t)!r.hasOwnProperty(n)&&t.hasOwnProperty(n)&&(r[n]=t[n]);return r}function $n(){return Pt(K("0"))}function ei(t,r,n){return e.isCallChain(t)?yt(_t(t,void 0,r),void 0,void 0,n):mt(ut(t,r),void 0,n)}function ti(e,t,r){return ei(X(e),t,r)}function ri(e,t,r){return !!r&&(e.push(zn(t,r)),!0)}function ni(t,r){var n=e.skipParentheses(t);switch(n.kind){case 79:return r;case 108:case 8:case 9:case 10:return !1;case 203:return 0!==n.elements.length;case 204:return n.properties.length>0;default:return !0}}function ii(t,r,n,i){void 0===i&&(i=0);var a=e.getNameOfDeclaration(t);if(a&&e.isIdentifier(a)&&!e.isGeneratedIdentifier(a)){var o=e.setParent(e.setTextRange(Zn(a),a),a.parent);return i|=e.getEmitFlags(a),n||(i|=48),r||(i|=1536),i&&e.setEmitFlags(o,i),o}return Z(t)}function ai(e,t,r){return ii(e,t,r,8192)}function oi(t,r,n,i){var a=ut(t,e.nodeIsSynthesized(r)?r:Zn(r));e.setTextRange(a,r);var o=0;return i||(o|=48),n||(o|=1536),o&&e.setEmitFlags(a,o),a}function si(){return e.startOnNewLine(ir(W("use strict")))}function ci(t,r,n){e.Debug.assert(0===r.length,"Prologue directives should be at the first statement in the target statements array");for(var i,a=!1,o=0,s=t.length;o<s;){var c=t[o];if(!e.isPrologueDirective(c))break;i=c,e.isStringLiteral(i.expression)&&"use strict"===i.expression.text&&(a=!0),r.push(c),o++;}return n&&!a&&r.push(si()),o}function li(t,r,n,i,a){void 0===a&&(a=e.returnTrue);for(var o=t.length;void 0!==n&&n<o;){var s=t[n];if(!(1048576&e.getEmitFlags(s)&&a(s)))break;e.append(r,i?e.visitNode(s,i,e.isStatement):s),n++;}return n}function ui(e,t,r){for(var n=r;n<e.length&&t(e[n]);)n++;return n}function _i(e){return e?F(e):void 0}function di(e){return "string"==typeof e?X(e):e}function pi(e){return "string"==typeof e?W(e):"number"==typeof e?K(e):"boolean"==typeof e?e?re():ne():e}function fi(t){return t&&e.isNotEmittedStatement(t)?e.setTextRange(h(nr(),t),t):t}}function o(t,r){return t!==r&&e.setTextRange(t,r),t}function s(t,r){return t!==r&&(h(t,r),e.setTextRange(t,r)),t}function c(t){switch(t){case 341:return "type";case 339:return "returns";case 340:return "this";case 337:return "enum";case 328:return "author";case 330:return "class";case 331:return "public";case 332:return "private";case 333:return "protected";case 334:return "readonly";case 335:return "override";case 342:return "template";case 343:return "typedef";case 338:return "param";case 345:return "prop";case 336:return "callback";case 326:return "augments";case 327:return "implements";default:return e.Debug.fail("Unsupported kind: ".concat(e.Debug.formatSyntaxKind(t)))}}(r=e.NodeFactoryFlags||(e.NodeFactoryFlags={}))[r.None=0]="None",r[r.NoParenthesizerRules=1]="NoParenthesizerRules",r[r.NoNodeConverters=2]="NoNodeConverters",r[r.NoIndentationOnFreshPropertyAccess=4]="NoIndentationOnFreshPropertyAccess",r[r.NoOriginalNode=8]="NoOriginalNode",e.createNodeFactory=a;var l={};function u(e){return -16777217&_(e)}function _(t){if(!t)return 0;var r=t.transformFlags&~f(t.kind);return e.isNamedDeclaration(t)&&e.isPropertyName(t.name)?r|33562624&t.name.transformFlags:r}function d(e){return e?e.transformFlags:0}function p(e){for(var t=0,r=0,n=e;r<n.length;r++)t|=_(n[r]);e.transformFlags=t;}function f(e){if(e>=176&&e<=199)return -2;switch(e){case 207:case 208:case 203:return 536887296;case 260:return 589443072;case 163:return 536870912;case 213:return 557748224;case 212:case 255:return 591310848;case 254:return 537165824;case 256:case 225:return 536940544;case 170:return 591306752;case 166:return 570433536;case 168:case 171:case 172:return 574529536;case 130:case 146:case 157:case 143:case 149:case 147:case 133:case 150:case 114:case 162:case 165:case 167:case 173:case 174:case 175:case 257:case 258:return -2;case 204:return 536973312;case 291:return 536903680;case 200:case 201:return 536887296;case 210:case 228:case 348:case 211:case 106:return 536870912;case 205:case 206:default:return 536870912}}e.getTransformFlagsSubtreeExclusions=f;var g=e.createBaseNodeFactory();function m(e){return e.flags|=8,e}var y,v={createBaseSourceFileNode:function(e){return m(g.createBaseSourceFileNode(e))},createBaseIdentifierNode:function(e){return m(g.createBaseIdentifierNode(e))},createBasePrivateIdentifierNode:function(e){return m(g.createBasePrivateIdentifierNode(e))},createBaseTokenNode:function(e){return m(g.createBaseTokenNode(e))},createBaseNode:function(e){return m(g.createBaseNode(e))}};function h(t,r){if(t.original=r,r){var n=r.emitNode;n&&(t.emitNode=function(t,r){var n=t.flags,i=t.leadingComments,a=t.trailingComments,o=t.commentRange,s=t.sourceMapRange,c=t.tokenSourceMapRanges,l=t.constantValue,u=t.helpers,_=t.startsOnNewLine;if(r||(r={}),i&&(r.leadingComments=e.addRange(i.slice(),r.leadingComments)),a&&(r.trailingComments=e.addRange(a.slice(),r.trailingComments)),n&&(r.flags=-268435457&n),o&&(r.commentRange=o),s&&(r.sourceMapRange=s),c&&(r.tokenSourceMapRanges=function(e,t){for(var r in t||(t=[]),e)t[r]=e[r];return t}(c,r.tokenSourceMapRanges)),void 0!==l&&(r.constantValue=l),u)for(var d=0,p=u;d<p.length;d++){var f=p[d];r.helpers=e.appendIfUnique(r.helpers,f);}return void 0!==_&&(r.startsOnNewLine=_),r}(n,t.emitNode));}return t}e.factory=a(4,v),e.createUnparsedSourceFile=function(t,r,n){var i,a,o,s,c,l,u,_,d,p;e.isString(t)?(o="",s=t,c=t.length,l=r,u=n):(e.Debug.assert("js"===r||"dts"===r),o=("js"===r?t.javascriptPath:t.declarationPath)||"",l="js"===r?t.javascriptMapPath:t.declarationMapPath,_=function(){return "js"===r?t.javascriptText:t.declarationText},d=function(){return "js"===r?t.javascriptMapText:t.declarationMapText},c=function(){return _().length},t.buildInfo&&t.buildInfo.bundle&&(e.Debug.assert(void 0===n||"boolean"==typeof n),i=n,a="js"===r?t.buildInfo.bundle.js:t.buildInfo.bundle.dts,p=t.oldFileOfCurrentEmit));var f=p?function(t){for(var r,n,i=0,a=t.sections;i<a.length;i++){var o=a[i];switch(o.kind){case"internal":case"text":r=e.append(r,e.setTextRange(e.factory.createUnparsedTextLike(o.data,"internal"===o.kind),o));break;case"no-default-lib":case"reference":case"type":case"lib":n=e.append(n,e.setTextRange(e.factory.createUnparsedSyntheticReference(o),o));break;case"prologue":case"emitHelpers":case"prepend":break;default:e.Debug.assertNever(o);}}var s=e.factory.createUnparsedSource(e.emptyArray,n,null!=r?r:e.emptyArray);return e.setEachParent(n,s),e.setEachParent(r,s),s.helpers=e.map(t.sources&&t.sources.helpers,(function(t){return e.getAllUnscopedEmitHelpers().get(t)})),s}(e.Debug.assertDefined(a)):function(t,r,n){for(var i,a,o,s,c,l,u,_,d=0,p=t?t.sections:e.emptyArray;d<p.length;d++){var f=p[d];switch(f.kind){case"prologue":i=e.append(i,e.setTextRange(e.factory.createUnparsedPrologue(f.data),f));break;case"emitHelpers":a=e.append(a,e.getAllUnscopedEmitHelpers().get(f.data));break;case"no-default-lib":_=!0;break;case"reference":o=e.append(o,{pos:-1,end:-1,fileName:f.data});break;case"type":s=e.append(s,f.data);break;case"lib":c=e.append(c,{pos:-1,end:-1,fileName:f.data});break;case"prepend":for(var g=void 0,m=0,y=f.texts;m<y.length;m++){var v=y[m];r&&"internal"===v.kind||(g=e.append(g,e.setTextRange(e.factory.createUnparsedTextLike(v.data,"internal"===v.kind),v)));}l=e.addRange(l,g),u=e.append(u,e.factory.createUnparsedPrepend(f.data,null!=g?g:e.emptyArray));break;case"internal":if(r){u||(u=[]);break}case"text":u=e.append(u,e.setTextRange(e.factory.createUnparsedTextLike(f.data,"internal"===f.kind),f));break;default:e.Debug.assertNever(f);}}if(!u){var h=e.factory.createUnparsedTextLike(void 0,!1);e.setTextRangePosWidth(h,0,"function"==typeof n?n():n),u=[h];}var b=e.parseNodeFactory.createUnparsedSource(null!=i?i:e.emptyArray,void 0,u);return e.setEachParent(i,b),e.setEachParent(u,b),e.setEachParent(l,b),b.hasNoDefaultLib=_,b.helpers=a,b.referencedFiles=o||e.emptyArray,b.typeReferenceDirectives=s,b.libReferenceDirectives=c||e.emptyArray,b}(a,i,c);return f.fileName=o,f.sourceMapPath=l,f.oldFileOfCurrentEmit=p,_&&d?(Object.defineProperty(f,"text",{get:_}),Object.defineProperty(f,"sourceMapText",{get:d})):(e.Debug.assert(!p),f.text=null!=s?s:"",f.sourceMapText=u),f},e.createInputFiles=function(t,r,n,i,a,o,s,c,l,u,_){var d=e.parseNodeFactory.createInputFiles();if(e.isString(t))d.javascriptText=t,d.javascriptMapPath=n,d.javascriptMapText=i,d.declarationText=r,d.declarationMapPath=a,d.declarationMapText=o,d.javascriptPath=s,d.declarationPath=c,d.buildInfoPath=l,d.buildInfo=u,d.oldFileOfCurrentEmit=_;else {var p,f=new e.Map,g=function(e){if(void 0!==e){var r=f.get(e);return void 0===r&&(r=t(e),f.set(e,void 0!==r&&r)),!1!==r?r:void 0}},m=function(e){var t=g(e);return void 0!==t?t:"/* Input file ".concat(e," was missing */\r\n")};d.javascriptPath=r,d.javascriptMapPath=n,d.declarationPath=e.Debug.assertDefined(i),d.declarationMapPath=a,d.buildInfoPath=o,Object.defineProperties(d,{javascriptText:{get:function(){return m(r)}},javascriptMapText:{get:function(){return g(n)}},declarationText:{get:function(){return m(e.Debug.assertDefined(i))}},declarationMapText:{get:function(){return g(a)}},buildInfo:{get:function(){return function(t){if(void 0===p){var r=g(o);p=void 0!==r&&e.getBuildInfo(r);}return p||void 0}()}}});}return d},e.createSourceMapSource=function(t,r,n){return new(y||(y=e.objectAllocator.getSourceMapSourceConstructor()))(t,r,n)},e.setOriginalNode=h;}(t),function(e){function t(r){var n;if(r.emitNode)e.Debug.assert(!(268435456&r.emitNode.flags),"Invalid attempt to mutate an immutable node.");else {if(e.isParseTreeNode(r)){if(303===r.kind)return r.emitNode={annotatedNodes:[r]};t(null!==(n=e.getSourceFileOfNode(e.getParseTreeNode(e.getSourceFileOfNode(r))))&&void 0!==n?n:e.Debug.fail("Could not determine parsed source file.")).annotatedNodes.push(r);}r.emitNode={};}return r.emitNode}function r(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.leadingComments}function n(e,r){return t(e).leadingComments=r,e}function i(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.trailingComments}function a(e,r){return t(e).trailingComments=r,e}e.getOrCreateEmitNode=t,e.disposeEmitNodes=function(t){var r,n,i=null===(n=null===(r=e.getSourceFileOfNode(e.getParseTreeNode(t)))||void 0===r?void 0:r.emitNode)||void 0===n?void 0:n.annotatedNodes;if(i)for(var a=0,o=i;a<o.length;a++)o[a].emitNode=void 0;},e.removeAllComments=function(e){var r=t(e);return r.flags|=1536,r.leadingComments=void 0,r.trailingComments=void 0,e},e.setEmitFlags=function(e,r){return t(e).flags=r,e},e.addEmitFlags=function(e,r){var n=t(e);return n.flags=n.flags|r,e},e.getSourceMapRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.sourceMapRange)&&void 0!==r?r:e},e.setSourceMapRange=function(e,r){return t(e).sourceMapRange=r,e},e.getTokenSourceMapRange=function(e,t){var r,n;return null===(n=null===(r=e.emitNode)||void 0===r?void 0:r.tokenSourceMapRanges)||void 0===n?void 0:n[t]},e.setTokenSourceMapRange=function(e,r,n){var i,a=t(e);return (null!==(i=a.tokenSourceMapRanges)&&void 0!==i?i:a.tokenSourceMapRanges=[])[r]=n,e},e.getStartsOnNewLine=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.startsOnNewLine},e.setStartsOnNewLine=function(e,r){return t(e).startsOnNewLine=r,e},e.getCommentRange=function(e){var t,r;return null!==(r=null===(t=e.emitNode)||void 0===t?void 0:t.commentRange)&&void 0!==r?r:e},e.setCommentRange=function(e,r){return t(e).commentRange=r,e},e.getSyntheticLeadingComments=r,e.setSyntheticLeadingComments=n,e.addSyntheticLeadingComment=function(t,i,a,o){return n(t,e.append(r(t),{kind:i,pos:-1,end:-1,hasTrailingNewLine:o,text:a}))},e.getSyntheticTrailingComments=i,e.setSyntheticTrailingComments=a,e.addSyntheticTrailingComment=function(t,r,n,o){return a(t,e.append(i(t),{kind:r,pos:-1,end:-1,hasTrailingNewLine:o,text:n}))},e.moveSyntheticComments=function(e,o){n(e,r(o)),a(e,i(o));var s=t(o);return s.leadingComments=void 0,s.trailingComments=void 0,e},e.getConstantValue=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.constantValue},e.setConstantValue=function(e,r){return t(e).constantValue=r,e},e.addEmitHelper=function(r,n){var i=t(r);return i.helpers=e.append(i.helpers,n),r},e.addEmitHelpers=function(r,n){if(e.some(n))for(var i=t(r),a=0,o=n;a<o.length;a++){var s=o[a];i.helpers=e.appendIfUnique(i.helpers,s);}return r},e.removeEmitHelper=function(t,r){var n,i=null===(n=t.emitNode)||void 0===n?void 0:n.helpers;return !!i&&e.orderedRemoveItem(i,r)},e.getEmitHelpers=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.helpers},e.moveEmitHelpers=function(r,n,i){var a=r.emitNode,o=a&&a.helpers;if(e.some(o)){for(var s=t(n),c=0,l=0;l<o.length;l++){var u=o[l];i(u)?(c++,s.helpers=e.appendIfUnique(s.helpers,u)):c>0&&(o[l-c]=u);}c>0&&(o.length-=c);}},e.getSnippetElement=function(e){var t;return null===(t=e.emitNode)||void 0===t?void 0:t.snippetElement},e.setSnippetElement=function(e,r){return t(e).snippetElement=r,e},e.ignoreSourceNewlines=function(e){return t(e).flags|=134217728,e};}(t),function(e){function t(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return function(r){for(var n="",i=0;i<t.length;i++)n+=e[i],n+=r(t[i]);return n+e[e.length-1]}}var r;e.createEmitHelperFactory=function(t){var r=t.factory,i=e.memoize((function(){return e.setEmitFlags(r.createTrue(),268435456)})),a=e.memoize((function(){return e.setEmitFlags(r.createFalse(),268435456)}));return {getUnscopedHelperName:o,createDecorateHelper:function(n,i,a,s){t.requestEmitHelper(e.decorateHelper);var c=[];return c.push(r.createArrayLiteralExpression(n,!0)),c.push(i),a&&(c.push(a),s&&c.push(s)),r.createCallExpression(o("__decorate"),void 0,c)},createMetadataHelper:function(n,i){return t.requestEmitHelper(e.metadataHelper),r.createCallExpression(o("__metadata"),void 0,[r.createStringLiteral(n),i])},createParamHelper:function(n,i,a){return t.requestEmitHelper(e.paramHelper),e.setTextRange(r.createCallExpression(o("__param"),void 0,[r.createNumericLiteral(i+""),n]),a)},createAssignHelper:function(n){return e.getEmitScriptTarget(t.getCompilerOptions())>=2?r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("Object"),"assign"),void 0,n):(t.requestEmitHelper(e.assignHelper),r.createCallExpression(o("__assign"),void 0,n))},createAwaitHelper:function(n){return t.requestEmitHelper(e.awaitHelper),r.createCallExpression(o("__await"),void 0,[n])},createAsyncGeneratorHelper:function(n,i){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncGeneratorHelper),(n.emitNode||(n.emitNode={})).flags|=786432,r.createCallExpression(o("__asyncGenerator"),void 0,[i?r.createThis():r.createVoidZero(),r.createIdentifier("arguments"),n])},createAsyncDelegatorHelper:function(n){return t.requestEmitHelper(e.awaitHelper),t.requestEmitHelper(e.asyncDelegator),r.createCallExpression(o("__asyncDelegator"),void 0,[n])},createAsyncValuesHelper:function(n){return t.requestEmitHelper(e.asyncValues),r.createCallExpression(o("__asyncValues"),void 0,[n])},createRestHelper:function(n,i,a,s){t.requestEmitHelper(e.restHelper);for(var c=[],l=0,u=0;u<i.length-1;u++){var _=e.getPropertyNameOfBindingOrAssignmentElement(i[u]);if(_)if(e.isComputedPropertyName(_)){e.Debug.assertIsDefined(a,"Encountered computed property name but 'computedTempVariables' argument was not provided.");var d=a[l];l++,c.push(r.createConditionalExpression(r.createTypeCheck(d,"symbol"),void 0,d,void 0,r.createAdd(d,r.createStringLiteral(""))));}else c.push(r.createStringLiteralFromNode(_));}return r.createCallExpression(o("__rest"),void 0,[n,e.setTextRange(r.createArrayLiteralExpression(c),s)])},createAwaiterHelper:function(n,i,a,s){t.requestEmitHelper(e.awaiterHelper);var c=r.createFunctionExpression(void 0,r.createToken(41),void 0,void 0,[],void 0,s);return (c.emitNode||(c.emitNode={})).flags|=786432,r.createCallExpression(o("__awaiter"),void 0,[n?r.createThis():r.createVoidZero(),i?r.createIdentifier("arguments"):r.createVoidZero(),a?e.createExpressionFromEntityName(r,a):r.createVoidZero(),c])},createExtendsHelper:function(n){return t.requestEmitHelper(e.extendsHelper),r.createCallExpression(o("__extends"),void 0,[n,r.createUniqueName("_super",48)])},createTemplateObjectHelper:function(n,i){return t.requestEmitHelper(e.templateObjectHelper),r.createCallExpression(o("__makeTemplateObject"),void 0,[n,i])},createSpreadArrayHelper:function(n,s,c){return t.requestEmitHelper(e.spreadArrayHelper),r.createCallExpression(o("__spreadArray"),void 0,[n,s,c?i():a()])},createValuesHelper:function(n){return t.requestEmitHelper(e.valuesHelper),r.createCallExpression(o("__values"),void 0,[n])},createReadHelper:function(n,i){return t.requestEmitHelper(e.readHelper),r.createCallExpression(o("__read"),void 0,void 0!==i?[n,r.createNumericLiteral(i+"")]:[n])},createGeneratorHelper:function(n){return t.requestEmitHelper(e.generatorHelper),r.createCallExpression(o("__generator"),void 0,[r.createThis(),n])},createCreateBindingHelper:function(i,a,s){return t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__createBinding"),void 0,n$3([r.createIdentifier("exports"),i,a],s?[s]:[],!0))},createImportStarHelper:function(n){return t.requestEmitHelper(e.importStarHelper),r.createCallExpression(o("__importStar"),void 0,[n])},createImportStarCallbackHelper:function(){return t.requestEmitHelper(e.importStarHelper),o("__importStar")},createImportDefaultHelper:function(n){return t.requestEmitHelper(e.importDefaultHelper),r.createCallExpression(o("__importDefault"),void 0,[n])},createExportStarHelper:function(n,i){return void 0===i&&(i=r.createIdentifier("exports")),t.requestEmitHelper(e.exportStarHelper),t.requestEmitHelper(e.createBindingHelper),r.createCallExpression(o("__exportStar"),void 0,[n,i])},createClassPrivateFieldGetHelper:function(n,i,a,s){var c;return t.requestEmitHelper(e.classPrivateFieldGetHelper),c=s?[n,i,r.createStringLiteral(a),s]:[n,i,r.createStringLiteral(a)],r.createCallExpression(o("__classPrivateFieldGet"),void 0,c)},createClassPrivateFieldSetHelper:function(n,i,a,s,c){var l;return t.requestEmitHelper(e.classPrivateFieldSetHelper),l=c?[n,i,a,r.createStringLiteral(s),c]:[n,i,a,r.createStringLiteral(s)],r.createCallExpression(o("__classPrivateFieldSet"),void 0,l)},createClassPrivateFieldInHelper:function(n,i){return t.requestEmitHelper(e.classPrivateFieldInHelper),r.createCallExpression(o("__classPrivateFieldIn"),void 0,[n,i])}};function o(t){return e.setEmitFlags(r.createIdentifier(t),4098)}},e.compareEmitHelpers=function(t,r){return t===r||t.priority===r.priority?0:void 0===t.priority?1:void 0===r.priority?-1:e.compareValues(t.priority,r.priority)},e.helperString=t,e.decorateHelper={name:"typescript:decorate",importName:"__decorate",scoped:!1,priority:2,text:'\n var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n };'},e.metadataHelper={name:"typescript:metadata",importName:"__metadata",scoped:!1,priority:3,text:'\n var __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);\n };'},e.paramHelper={name:"typescript:param",importName:"__param",scoped:!1,priority:4,text:"\n var __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n };"},e.assignHelper={name:"typescript:assign",importName:"__assign",scoped:!1,priority:1,text:"\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };"},e.awaitHelper={name:"typescript:await",importName:"__await",scoped:!1,text:"\n var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }"},e.asyncGeneratorHelper={name:"typescript:asyncGenerator",importName:"__asyncGenerator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume("next", value); }\n function reject(value) { resume("throw", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n };'},e.asyncDelegator={name:"typescript:asyncDelegator",importName:"__asyncDelegator",scoped:!1,dependencies:[e.awaitHelper],text:'\n var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {\n var i, p;\n return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }\n };'},e.asyncValues={name:"typescript:asyncValues",importName:"__asyncValues",scoped:!1,text:'\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n };'},e.restHelper={name:"typescript:rest",importName:"__rest",scoped:!1,text:'\n var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === "function")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };'},e.awaiterHelper={name:"typescript:awaiter",importName:"__awaiter",scoped:!1,priority:5,text:'\n var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n };'},e.extendsHelper={name:"typescript:extends",importName:"__extends",scoped:!1,priority:0,text:'\n var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n })();'},e.templateObjectHelper={name:"typescript:makeTemplateObject",importName:"__makeTemplateObject",scoped:!1,priority:0,text:'\n var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n };'},e.readHelper={name:"typescript:read",importName:"__read",scoped:!1,text:'\n var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === "function" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i["return"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n };'},e.spreadArrayHelper={name:"typescript:spreadArray",importName:"__spreadArray",scoped:!1,text:"\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"},e.valuesHelper={name:"typescript:values",importName:"__values",scoped:!1,text:'\n var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === "number") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");\n };'},e.generatorHelper={name:"typescript:generator",importName:"__generator",scoped:!1,priority:6,text:'\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError("Generator is already executing.");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };'},e.createBindingHelper={name:"typescript:commonjscreatebinding",importName:"__createBinding",scoped:!1,priority:1,text:"\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));"},e.setModuleDefaultHelper={name:"typescript:commonjscreatevalue",importName:"__setModuleDefault",scoped:!1,priority:1,text:'\n var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n }) : function(o, v) {\n o["default"] = v;\n });'},e.importStarHelper={name:"typescript:commonjsimportstar",importName:"__importStar",scoped:!1,dependencies:[e.createBindingHelper,e.setModuleDefaultHelper],priority:2,text:'\n var __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n };'},e.importDefaultHelper={name:"typescript:commonjsimportdefault",importName:"__importDefault",scoped:!1,text:'\n var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n };'},e.exportStarHelper={name:"typescript:export-star",importName:"__exportStar",scoped:!1,dependencies:[e.createBindingHelper],priority:2,text:'\n var __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n };'},e.classPrivateFieldGetHelper={name:"typescript:classPrivateFieldGet",importName:"__classPrivateFieldGet",scoped:!1,text:'\n var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");\n return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);\n };'},e.classPrivateFieldSetHelper={name:"typescript:classPrivateFieldSet",importName:"__classPrivateFieldSet",scoped:!1,text:'\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === "m") throw new TypeError("Private method is not writable");\n if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");\n if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");\n return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };'},e.classPrivateFieldInHelper={name:"typescript:classPrivateFieldIn",importName:"__classPrivateFieldIn",scoped:!1,text:'\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use \'in\' operator on non-object");\n return typeof state === "function" ? receiver === state : state.has(receiver);\n };'},e.getAllUnscopedEmitHelpers=function(){return r||(r=e.arrayToMap([e.decorateHelper,e.metadataHelper,e.paramHelper,e.assignHelper,e.awaitHelper,e.asyncGeneratorHelper,e.asyncDelegator,e.asyncValues,e.restHelper,e.awaiterHelper,e.extendsHelper,e.templateObjectHelper,e.spreadArrayHelper,e.valuesHelper,e.readHelper,e.generatorHelper,e.importStarHelper,e.importDefaultHelper,e.exportStarHelper,e.classPrivateFieldGetHelper,e.classPrivateFieldSetHelper,e.classPrivateFieldInHelper,e.createBindingHelper,e.setModuleDefaultHelper],(function(e){return e.name})))},e.asyncSuperHelper={name:"typescript:async-super",scoped:!0,text:t(a(["\n const "," = name => super[name];"],["\n const "," = name => super[name];"]),"_superIndex")},e.advancedAsyncSuperHelper={name:"typescript:advanced-async-super",scoped:!0,text:t(a(["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"],["\n const "," = (function (geti, seti) {\n const cache = Object.create(null);\n return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } });\n })(name => super[name], (name, value) => super[name] = value);"]),"_superIndex")},e.isCallToHelper=function(t,r){return e.isCallExpression(t)&&e.isIdentifier(t.expression)&&0!=(4096&e.getEmitFlags(t.expression))&&t.expression.escapedText===r};}(t),function(e){e.isNumericLiteral=function(e){return 8===e.kind},e.isBigIntLiteral=function(e){return 9===e.kind},e.isStringLiteral=function(e){return 10===e.kind},e.isJsxText=function(e){return 11===e.kind},e.isRegularExpressionLiteral=function(e){return 13===e.kind},e.isNoSubstitutionTemplateLiteral=function(e){return 14===e.kind},e.isTemplateHead=function(e){return 15===e.kind},e.isTemplateMiddle=function(e){return 16===e.kind},e.isTemplateTail=function(e){return 17===e.kind},e.isDotDotDotToken=function(e){return 25===e.kind},e.isCommaToken=function(e){return 27===e.kind},e.isPlusToken=function(e){return 39===e.kind},e.isMinusToken=function(e){return 40===e.kind},e.isAsteriskToken=function(e){return 41===e.kind},e.isExclamationToken=function(e){return 53===e.kind},e.isQuestionToken=function(e){return 57===e.kind},e.isColonToken=function(e){return 58===e.kind},e.isQuestionDotToken=function(e){return 28===e.kind},e.isEqualsGreaterThanToken=function(e){return 38===e.kind},e.isIdentifier=function(e){return 79===e.kind},e.isPrivateIdentifier=function(e){return 80===e.kind},e.isExportModifier=function(e){return 93===e.kind},e.isAsyncModifier=function(e){return 131===e.kind},e.isAssertsKeyword=function(e){return 128===e.kind},e.isAwaitKeyword=function(e){return 132===e.kind},e.isReadonlyKeyword=function(e){return 144===e.kind},e.isStaticModifier=function(e){return 124===e.kind},e.isAbstractModifier=function(e){return 126===e.kind},e.isSuperKeyword=function(e){return 106===e.kind},e.isImportKeyword=function(e){return 100===e.kind},e.isQualifiedName=function(e){return 160===e.kind},e.isComputedPropertyName=function(e){return 161===e.kind},e.isTypeParameterDeclaration=function(e){return 162===e.kind},e.isParameter=function(e){return 163===e.kind},e.isDecorator=function(e){return 164===e.kind},e.isPropertySignature=function(e){return 165===e.kind},e.isPropertyDeclaration=function(e){return 166===e.kind},e.isMethodSignature=function(e){return 167===e.kind},e.isMethodDeclaration=function(e){return 168===e.kind},e.isClassStaticBlockDeclaration=function(e){return 169===e.kind},e.isConstructorDeclaration=function(e){return 170===e.kind},e.isGetAccessorDeclaration=function(e){return 171===e.kind},e.isSetAccessorDeclaration=function(e){return 172===e.kind},e.isCallSignatureDeclaration=function(e){return 173===e.kind},e.isConstructSignatureDeclaration=function(e){return 174===e.kind},e.isIndexSignatureDeclaration=function(e){return 175===e.kind},e.isTypePredicateNode=function(e){return 176===e.kind},e.isTypeReferenceNode=function(e){return 177===e.kind},e.isFunctionTypeNode=function(e){return 178===e.kind},e.isConstructorTypeNode=function(e){return 179===e.kind},e.isTypeQueryNode=function(e){return 180===e.kind},e.isTypeLiteralNode=function(e){return 181===e.kind},e.isArrayTypeNode=function(e){return 182===e.kind},e.isTupleTypeNode=function(e){return 183===e.kind},e.isNamedTupleMember=function(e){return 196===e.kind},e.isOptionalTypeNode=function(e){return 184===e.kind},e.isRestTypeNode=function(e){return 185===e.kind},e.isUnionTypeNode=function(e){return 186===e.kind},e.isIntersectionTypeNode=function(e){return 187===e.kind},e.isConditionalTypeNode=function(e){return 188===e.kind},e.isInferTypeNode=function(e){return 189===e.kind},e.isParenthesizedTypeNode=function(e){return 190===e.kind},e.isThisTypeNode=function(e){return 191===e.kind},e.isTypeOperatorNode=function(e){return 192===e.kind},e.isIndexedAccessTypeNode=function(e){return 193===e.kind},e.isMappedTypeNode=function(e){return 194===e.kind},e.isLiteralTypeNode=function(e){return 195===e.kind},e.isImportTypeNode=function(e){return 199===e.kind},e.isTemplateLiteralTypeSpan=function(e){return 198===e.kind},e.isTemplateLiteralTypeNode=function(e){return 197===e.kind},e.isObjectBindingPattern=function(e){return 200===e.kind},e.isArrayBindingPattern=function(e){return 201===e.kind},e.isBindingElement=function(e){return 202===e.kind},e.isArrayLiteralExpression=function(e){return 203===e.kind},e.isObjectLiteralExpression=function(e){return 204===e.kind},e.isPropertyAccessExpression=function(e){return 205===e.kind},e.isElementAccessExpression=function(e){return 206===e.kind},e.isCallExpression=function(e){return 207===e.kind},e.isNewExpression=function(e){return 208===e.kind},e.isTaggedTemplateExpression=function(e){return 209===e.kind},e.isTypeAssertionExpression=function(e){return 210===e.kind},e.isParenthesizedExpression=function(e){return 211===e.kind},e.isFunctionExpression=function(e){return 212===e.kind},e.isArrowFunction=function(e){return 213===e.kind},e.isDeleteExpression=function(e){return 214===e.kind},e.isTypeOfExpression=function(e){return 215===e.kind},e.isVoidExpression=function(e){return 216===e.kind},e.isAwaitExpression=function(e){return 217===e.kind},e.isPrefixUnaryExpression=function(e){return 218===e.kind},e.isPostfixUnaryExpression=function(e){return 219===e.kind},e.isBinaryExpression=function(e){return 220===e.kind},e.isConditionalExpression=function(e){return 221===e.kind},e.isTemplateExpression=function(e){return 222===e.kind},e.isYieldExpression=function(e){return 223===e.kind},e.isSpreadElement=function(e){return 224===e.kind},e.isClassExpression=function(e){return 225===e.kind},e.isOmittedExpression=function(e){return 226===e.kind},e.isExpressionWithTypeArguments=function(e){return 227===e.kind},e.isAsExpression=function(e){return 228===e.kind},e.isNonNullExpression=function(e){return 229===e.kind},e.isMetaProperty=function(e){return 230===e.kind},e.isSyntheticExpression=function(e){return 231===e.kind},e.isPartiallyEmittedExpression=function(e){return 348===e.kind},e.isCommaListExpression=function(e){return 349===e.kind},e.isTemplateSpan=function(e){return 232===e.kind},e.isSemicolonClassElement=function(e){return 233===e.kind},e.isBlock=function(e){return 234===e.kind},e.isVariableStatement=function(e){return 236===e.kind},e.isEmptyStatement=function(e){return 235===e.kind},e.isExpressionStatement=function(e){return 237===e.kind},e.isIfStatement=function(e){return 238===e.kind},e.isDoStatement=function(e){return 239===e.kind},e.isWhileStatement=function(e){return 240===e.kind},e.isForStatement=function(e){return 241===e.kind},e.isForInStatement=function(e){return 242===e.kind},e.isForOfStatement=function(e){return 243===e.kind},e.isContinueStatement=function(e){return 244===e.kind},e.isBreakStatement=function(e){return 245===e.kind},e.isReturnStatement=function(e){return 246===e.kind},e.isWithStatement=function(e){return 247===e.kind},e.isSwitchStatement=function(e){return 248===e.kind},e.isLabeledStatement=function(e){return 249===e.kind},e.isThrowStatement=function(e){return 250===e.kind},e.isTryStatement=function(e){return 251===e.kind},e.isDebuggerStatement=function(e){return 252===e.kind},e.isVariableDeclaration=function(e){return 253===e.kind},e.isVariableDeclarationList=function(e){return 254===e.kind},e.isFunctionDeclaration=function(e){return 255===e.kind},e.isClassDeclaration=function(e){return 256===e.kind},e.isInterfaceDeclaration=function(e){return 257===e.kind},e.isTypeAliasDeclaration=function(e){return 258===e.kind},e.isEnumDeclaration=function(e){return 259===e.kind},e.isModuleDeclaration=function(e){return 260===e.kind},e.isModuleBlock=function(e){return 261===e.kind},e.isCaseBlock=function(e){return 262===e.kind},e.isNamespaceExportDeclaration=function(e){return 263===e.kind},e.isImportEqualsDeclaration=function(e){return 264===e.kind},e.isImportDeclaration=function(e){return 265===e.kind},e.isImportClause=function(e){return 266===e.kind},e.isAssertClause=function(e){return 292===e.kind},e.isAssertEntry=function(e){return 293===e.kind},e.isNamespaceImport=function(e){return 267===e.kind},e.isNamespaceExport=function(e){return 273===e.kind},e.isNamedImports=function(e){return 268===e.kind},e.isImportSpecifier=function(e){return 269===e.kind},e.isExportAssignment=function(e){return 270===e.kind},e.isExportDeclaration=function(e){return 271===e.kind},e.isNamedExports=function(e){return 272===e.kind},e.isExportSpecifier=function(e){return 274===e.kind},e.isMissingDeclaration=function(e){return 275===e.kind},e.isNotEmittedStatement=function(e){return 347===e.kind},e.isSyntheticReference=function(e){return 352===e.kind},e.isMergeDeclarationMarker=function(e){return 350===e.kind},e.isEndOfDeclarationMarker=function(e){return 351===e.kind},e.isExternalModuleReference=function(e){return 276===e.kind},e.isJsxElement=function(e){return 277===e.kind},e.isJsxSelfClosingElement=function(e){return 278===e.kind},e.isJsxOpeningElement=function(e){return 279===e.kind},e.isJsxClosingElement=function(e){return 280===e.kind},e.isJsxFragment=function(e){return 281===e.kind},e.isJsxOpeningFragment=function(e){return 282===e.kind},e.isJsxClosingFragment=function(e){return 283===e.kind},e.isJsxAttribute=function(e){return 284===e.kind},e.isJsxAttributes=function(e){return 285===e.kind},e.isJsxSpreadAttribute=function(e){return 286===e.kind},e.isJsxExpression=function(e){return 287===e.kind},e.isCaseClause=function(e){return 288===e.kind},e.isDefaultClause=function(e){return 289===e.kind},e.isHeritageClause=function(e){return 290===e.kind},e.isCatchClause=function(e){return 291===e.kind},e.isPropertyAssignment=function(e){return 294===e.kind},e.isShorthandPropertyAssignment=function(e){return 295===e.kind},e.isSpreadAssignment=function(e){return 296===e.kind},e.isEnumMember=function(e){return 297===e.kind},e.isUnparsedPrepend=function(e){return 299===e.kind},e.isSourceFile=function(e){return 303===e.kind},e.isBundle=function(e){return 304===e.kind},e.isUnparsedSource=function(e){return 305===e.kind},e.isJSDocTypeExpression=function(e){return 307===e.kind},e.isJSDocNameReference=function(e){return 308===e.kind},e.isJSDocMemberName=function(e){return 309===e.kind},e.isJSDocLink=function(e){return 322===e.kind},e.isJSDocLinkCode=function(e){return 323===e.kind},e.isJSDocLinkPlain=function(e){return 324===e.kind},e.isJSDocAllType=function(e){return 310===e.kind},e.isJSDocUnknownType=function(e){return 311===e.kind},e.isJSDocNullableType=function(e){return 312===e.kind},e.isJSDocNonNullableType=function(e){return 313===e.kind},e.isJSDocOptionalType=function(e){return 314===e.kind},e.isJSDocFunctionType=function(e){return 315===e.kind},e.isJSDocVariadicType=function(e){return 316===e.kind},e.isJSDocNamepathType=function(e){return 317===e.kind},e.isJSDoc=function(e){return 318===e.kind},e.isJSDocTypeLiteral=function(e){return 320===e.kind},e.isJSDocSignature=function(e){return 321===e.kind},e.isJSDocAugmentsTag=function(e){return 326===e.kind},e.isJSDocAuthorTag=function(e){return 328===e.kind},e.isJSDocClassTag=function(e){return 330===e.kind},e.isJSDocCallbackTag=function(e){return 336===e.kind},e.isJSDocPublicTag=function(e){return 331===e.kind},e.isJSDocPrivateTag=function(e){return 332===e.kind},e.isJSDocProtectedTag=function(e){return 333===e.kind},e.isJSDocReadonlyTag=function(e){return 334===e.kind},e.isJSDocOverrideTag=function(e){return 335===e.kind},e.isJSDocDeprecatedTag=function(e){return 329===e.kind},e.isJSDocSeeTag=function(e){return 344===e.kind},e.isJSDocEnumTag=function(e){return 337===e.kind},e.isJSDocParameterTag=function(e){return 338===e.kind},e.isJSDocReturnTag=function(e){return 339===e.kind},e.isJSDocThisTag=function(e){return 340===e.kind},e.isJSDocTypeTag=function(e){return 341===e.kind},e.isJSDocTemplateTag=function(e){return 342===e.kind},e.isJSDocTypedefTag=function(e){return 343===e.kind},e.isJSDocUnknownTag=function(e){return 325===e.kind},e.isJSDocPropertyTag=function(e){return 345===e.kind},e.isJSDocImplementsTag=function(e){return 327===e.kind},e.isSyntaxList=function(e){return 346===e.kind};}(t),function(e){function t(t,r,n,i){if(e.isComputedPropertyName(n))return e.setTextRange(t.createElementAccessExpression(r,n.expression),i);var a=e.setTextRange(e.isMemberName(n)?t.createPropertyAccessExpression(r,n):t.createElementAccessExpression(r,n),n);return e.getOrCreateEmitNode(a).flags|=64,a}function r(t,r){var n=e.parseNodeFactory.createIdentifier(t||"React");return e.setParent(n,e.getParseTreeNode(r)),n}function i(t,n,a){if(e.isQualifiedName(n)){var o=i(t,n.left,a),s=t.createIdentifier(e.idText(n.right));return s.escapedText=n.right.escapedText,t.createPropertyAccessExpression(o,s)}return r(e.idText(n),a)}function a(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"createElement")}function o(t,r){return e.isIdentifier(r)?t.createStringLiteralFromNode(r):e.isComputedPropertyName(r)?e.setParent(e.setTextRange(t.cloneNode(r.expression),r.expression),r.expression.parent):e.setParent(e.setTextRange(t.cloneNode(r),r),r.parent)}function s(t){return e.isStringLiteral(t.expression)&&"use strict"===t.expression.text}function c(t){return e.isParenthesizedExpression(t)&&e.isInJSFile(t)&&!!e.getJSDocTypeTag(t)}function l(e,t){switch(void 0===t&&(t=15),e.kind){case 211:return !(16&t&&c(e))&&0!=(1&t);case 210:case 228:return 0!=(2&t);case 229:return 0!=(4&t);case 348:return 0!=(8&t)}return !1}function u(e,t){for(void 0===t&&(t=15);l(e,t);)e=e.expression;return e}function _(t){return e.setStartsOnNewLine(t,!0)}function d(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return n&&n.externalHelpersModuleName}function p(t,r,n,i,a){if(n.importHelpers&&e.isEffectiveExternalModule(r,n)){var o=d(r);if(o)return o;var s=e.getEmitModuleKind(n),c=(i||e.getESModuleInterop(n)&&a)&&s!==e.ModuleKind.System&&(s<e.ModuleKind.ES2015||r.impliedNodeFormat===e.ModuleKind.CommonJS);if(!c){var l=e.getEmitHelpers(r);if(l)for(var u=0,_=l;u<_.length;u++)if(!_[u].scoped){c=!0;break}}if(c){var p=e.getOriginalNode(r,e.isSourceFile),f=e.getOrCreateEmitNode(p);return f.externalHelpersModuleName||(f.externalHelpersModuleName=t.createUniqueName(e.externalHelpersModuleNameText))}}}function f(t,r,n,i){if(r)return r.moduleName?t.createStringLiteral(r.moduleName):!r.isDeclarationFile&&e.outFile(i)?t.createStringLiteral(e.getExternalModuleNameFromPath(n,r.fileName)):void 0}function g(t){if(e.isDeclarationBindingElement(t))return t.name;if(!e.isObjectLiteralElementLike(t))return e.isAssignmentExpression(t,!0)?g(t.left):e.isSpreadElement(t)?g(t.expression):t;switch(t.kind){case 294:return g(t.initializer);case 295:return t.name;case 296:return g(t.expression)}}function m(t){switch(t.kind){case 202:if(t.propertyName){var r=t.propertyName;return e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r}break;case 294:if(t.name)return r=t.name,e.isPrivateIdentifier(r)?e.Debug.failBadSyntaxKind(r):e.isComputedPropertyName(r)&&y(r.expression)?r.expression:r;break;case 296:return t.name&&e.isPrivateIdentifier(t.name)?e.Debug.failBadSyntaxKind(t.name):t.name}var n=g(t);if(n&&e.isPropertyName(n))return n}function y(e){var t=e.kind;return 10===t||8===t}var v;e.createEmptyExports=function(e){return e.createExportDeclaration(void 0,void 0,!1,e.createNamedExports([]),void 0)},e.createMemberAccessForPropertyName=t,e.createJsxFactoryExpression=a,e.createExpressionForJsxElement=function(t,r,n,i,a,o){var s=[n];if(i&&s.push(i),a&&a.length>0)if(i||s.push(t.createNull()),a.length>1)for(var c=0,l=a;c<l.length;c++){var u=l[c];_(u),s.push(u);}else s.push(a[0]);return e.setTextRange(t.createCallExpression(r,void 0,s),o)},e.createExpressionForJsxFragment=function(t,n,o,s,c,l,u){var d=[function(e,t,n,a){return t?i(e,t,a):e.createPropertyAccessExpression(r(n,a),"Fragment")}(t,o,s,l),t.createNull()];if(c&&c.length>0)if(c.length>1)for(var p=0,f=c;p<f.length;p++){var g=f[p];_(g),d.push(g);}else d.push(c[0]);return e.setTextRange(t.createCallExpression(a(t,n,s,l),void 0,d),u)},e.createForOfBindingStatement=function(t,r,n){if(e.isVariableDeclarationList(r)){var i=e.first(r.declarations),a=t.updateVariableDeclaration(i,i.name,void 0,void 0,n);return e.setTextRange(t.createVariableStatement(void 0,t.updateVariableDeclarationList(r,[a])),r)}var o=e.setTextRange(t.createAssignment(r,n),r);return e.setTextRange(t.createExpressionStatement(o),r)},e.insertLeadingStatement=function(t,r,i){return e.isBlock(r)?t.updateBlock(r,e.setTextRange(t.createNodeArray(n$3([i],r.statements,!0)),r.statements)):t.createBlock(t.createNodeArray([r,i]),!0)},e.createExpressionFromEntityName=function t(r,n){if(e.isQualifiedName(n)){var i=t(r,n.left),a=e.setParent(e.setTextRange(r.cloneNode(n.right),n.right),n.right.parent);return e.setTextRange(r.createPropertyAccessExpression(i,a),n)}return e.setParent(e.setTextRange(r.cloneNode(n),n),n.parent)},e.createExpressionForPropertyName=o,e.createExpressionForObjectLiteralElementLike=function(r,n,i,a){switch(i.name&&e.isPrivateIdentifier(i.name)&&e.Debug.failBadSyntaxKind(i.name,"Private identifiers are not allowed in object literals."),i.kind){case 171:case 172:return function(t,r,n,i,a){var s=e.getAllAccessorDeclarations(r,n),c=s.firstAccessor,l=s.getAccessor,u=s.setAccessor;if(n===c)return e.setTextRange(t.createObjectDefinePropertyCall(i,o(t,n.name),t.createPropertyDescriptor({enumerable:t.createFalse(),configurable:!0,get:l&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(l.modifiers,void 0,void 0,void 0,l.parameters,void 0,l.body),l),l),set:u&&e.setTextRange(e.setOriginalNode(t.createFunctionExpression(u.modifiers,void 0,void 0,void 0,u.parameters,void 0,u.body),u),u)},!a)),c)}(r,n.properties,i,a,!!n.multiLine);case 294:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),n.initializer),n),n)}(r,i,a);case 295:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),r.cloneNode(n.name)),n),n)}(r,i,a);case 168:return function(r,n,i){return e.setOriginalNode(e.setTextRange(r.createAssignment(t(r,i,n.name,n.name),e.setOriginalNode(e.setTextRange(r.createFunctionExpression(n.modifiers,n.asteriskToken,void 0,void 0,n.parameters,void 0,n.body),n),n)),n),n)}(r,i,a)}},e.expandPreOrPostfixIncrementOrDecrementExpression=function(t,r,n,i,a){var o=r.operator;e.Debug.assert(45===o||46===o,"Expected 'node' to be a pre- or post-increment or pre- or post-decrement expression");var s=t.createTempVariable(i);n=t.createAssignment(s,n),e.setTextRange(n,r.operand);var c=e.isPrefixUnaryExpression(r)?t.createPrefixUnaryExpression(o,s):t.createPostfixUnaryExpression(s,o);return e.setTextRange(c,r),a&&(c=t.createAssignment(a,c),e.setTextRange(c,r)),n=t.createComma(n,c),e.setTextRange(n,r),e.isPostfixUnaryExpression(r)&&(n=t.createComma(n,s),e.setTextRange(n,r)),n},e.isInternalName=function(t){return 0!=(32768&e.getEmitFlags(t))},e.isLocalName=function(t){return 0!=(16384&e.getEmitFlags(t))},e.isExportName=function(t){return 0!=(8192&e.getEmitFlags(t))},e.findUseStrictPrologue=function(t){for(var r=0,n=t;r<n.length;r++){var i=n[r];if(!e.isPrologueDirective(i))break;if(s(i))return i}},e.startsWithUseStrict=function(t){var r=e.firstOrUndefined(t);return void 0!==r&&e.isPrologueDirective(r)&&s(r)},e.isCommaSequence=function(e){return 220===e.kind&&27===e.operatorToken.kind||349===e.kind},e.isJSDocTypeAssertion=c,e.getJSDocTypeAssertionType=function(t){var r=e.getJSDocType(t);return e.Debug.assertIsDefined(r),r},e.isOuterExpression=l,e.skipOuterExpressions=u,e.skipAssertions=function(e){return u(e,6)},e.startOnNewLine=_,e.getExternalHelpersModuleName=d,e.hasRecordedExternalHelpers=function(t){var r=e.getOriginalNode(t,e.isSourceFile),n=r&&r.emitNode;return !(!n||!n.externalHelpersModuleName&&!n.externalHelpers)},e.createExternalHelpersImportDeclarationIfNeeded=function(t,r,n,i,a,o,s){if(i.importHelpers&&e.isEffectiveExternalModule(n,i)){var c=void 0,l=e.getEmitModuleKind(i);if(l>=e.ModuleKind.ES2015&&l<=e.ModuleKind.ESNext||n.impliedNodeFormat===e.ModuleKind.ESNext){var u=e.getEmitHelpers(n);if(u){for(var _=[],d=0,f=u;d<f.length;d++){var g=f[d];if(!g.scoped){var m=g.importName;m&&e.pushIfUnique(_,m);}}if(e.some(_)){_.sort(e.compareStringsCaseSensitive),c=t.createNamedImports(e.map(_,(function(i){return e.isFileLevelUniqueName(n,i)?t.createImportSpecifier(!1,void 0,t.createIdentifier(i)):t.createImportSpecifier(!1,t.createIdentifier(i),r.getUnscopedHelperName(i))})));var y=e.getOriginalNode(n,e.isSourceFile);e.getOrCreateEmitNode(y).externalHelpers=!0;}}}else {var v=p(t,n,i,a,o||s);v&&(c=t.createNamespaceImport(v));}if(c){var h=t.createImportDeclaration(void 0,void 0,t.createImportClause(!1,void 0,c),t.createStringLiteral(e.externalHelpersModuleNameText),void 0);return e.addEmitFlags(h,67108864),h}}},e.getOrCreateExternalHelpersModuleNameIfNeeded=p,e.getLocalNameForExternalImport=function(t,r,n){var i=e.getNamespaceDeclarationNode(r);if(i&&!e.isDefaultImport(r)&&!e.isExportNamespaceAsDefaultDeclaration(r)){var a=i.name;return e.isGeneratedIdentifier(a)?a:t.createIdentifier(e.getSourceTextOfNodeFromSourceFile(n,a)||e.idText(a))}return 265===r.kind&&r.importClause||271===r.kind&&r.moduleSpecifier?t.getGeneratedNameForNode(r):void 0},e.getExternalModuleNameLiteral=function(t,r,n,i,a,o){var s=e.getExternalModuleName(r);if(s&&e.isStringLiteral(s))return function(e,t,r,n,i){return f(r,n.getExternalModuleFileFromDeclaration(e),t,i)}(r,i,t,a,o)||function(e,t,r){var n=r.renamedDependencies&&r.renamedDependencies.get(t.text);return n?e.createStringLiteral(n):void 0}(t,s,n)||t.cloneNode(s)},e.tryGetModuleNameFromFile=f,e.getInitializerOfBindingOrAssignmentElement=function t(r){if(e.isDeclarationBindingElement(r))return r.initializer;if(e.isPropertyAssignment(r)){var n=r.initializer;return e.isAssignmentExpression(n,!0)?n.right:void 0}return e.isShorthandPropertyAssignment(r)?r.objectAssignmentInitializer:e.isAssignmentExpression(r,!0)?r.right:e.isSpreadElement(r)?t(r.expression):void 0},e.getTargetOfBindingOrAssignmentElement=g,e.getRestIndicatorOfBindingOrAssignmentElement=function(e){switch(e.kind){case 163:case 202:return e.dotDotDotToken;case 224:case 296:return e}},e.getPropertyNameOfBindingOrAssignmentElement=function(t){var r=m(t);return e.Debug.assert(!!r||e.isSpreadAssignment(t),"Invalid property name for binding element."),r},e.tryGetPropertyNameOfBindingOrAssignmentElement=m,e.getElementsOfBindingOrAssignmentPattern=function(e){switch(e.kind){case 200:case 201:case 203:return e.elements;case 204:return e.properties}},e.getJSDocTypeAliasName=function(t){if(t)for(var r=t;;){if(e.isIdentifier(r)||!r.body)return e.isIdentifier(r)?r:r.name;r=r.body;}},e.canHaveModifiers=function(e){var t=e.kind;return 163===t||165===t||166===t||167===t||168===t||170===t||171===t||172===t||175===t||212===t||213===t||225===t||236===t||255===t||256===t||257===t||258===t||259===t||260===t||264===t||265===t||270===t||271===t},e.isTypeNodeOrTypeParameterDeclaration=e.or(e.isTypeNode,e.isTypeParameterDeclaration),e.isQuestionOrExclamationToken=e.or(e.isQuestionToken,e.isExclamationToken),e.isIdentifierOrThisTypeNode=e.or(e.isIdentifier,e.isThisTypeNode),e.isReadonlyKeywordOrPlusOrMinusToken=e.or(e.isReadonlyKeyword,e.isPlusToken,e.isMinusToken),e.isQuestionOrPlusOrMinusToken=e.or(e.isQuestionToken,e.isPlusToken,e.isMinusToken),e.isModuleName=e.or(e.isIdentifier,e.isStringLiteral),e.isLiteralTypeLikeExpression=function(t){var r=t.kind;return 104===r||110===r||95===r||e.isLiteralExpression(t)||e.isPrefixUnaryExpression(t)},e.isBinaryOperatorToken=function(t){return function(t){return 60===t||function(e){return function(e){return 55===e||56===e}(e)||function(e){return function(e){return 50===e||51===e||52===e}(e)||function(e){return function(e){return 34===e||36===e||35===e||37===e}(e)||function(e){return function(e){return 29===e||32===e||31===e||33===e||102===e||101===e}(e)||function(e){return function(e){return 47===e||48===e||49===e}(e)||function(e){return function(e){return 39===e||40===e}(e)||function(e){return function(e){return 42===e}(e)||function(e){return 41===e||43===e||44===e}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(t)||e.isAssignmentOperator(t)}(r=t.kind)||27===r;var r;},function(t){function r(t,n,i,a,o,s,l){var u=n>0?o[n-1]:void 0;return e.Debug.assertEqual(i[n],r),o[n]=t.onEnter(a[n],u,l),i[n]=c(t,r),n}function n(t,r,i,a,o,s,_){e.Debug.assertEqual(i[r],n),e.Debug.assertIsDefined(t.onLeft),i[r]=c(t,n);var d=t.onLeft(a[r].left,o[r],a[r]);return d?(u(r,a,d),l(r,i,a,o,d)):r}function i(t,r,n,a,o,s,l){return e.Debug.assertEqual(n[r],i),e.Debug.assertIsDefined(t.onOperator),n[r]=c(t,i),t.onOperator(a[r].operatorToken,o[r],a[r]),r}function a(t,r,n,i,o,s,_){e.Debug.assertEqual(n[r],a),e.Debug.assertIsDefined(t.onRight),n[r]=c(t,a);var d=t.onRight(i[r].right,o[r],i[r]);return d?(u(r,i,d),l(r,n,i,o,d)):r}function o(t,r,n,i,a,s,l){e.Debug.assertEqual(n[r],o),n[r]=c(t,o);var u=t.onExit(i[r],a[r]);if(r>0){if(r--,t.foldState){var _=n[r]===o?"right":"left";a[r]=t.foldState(a[r],u,_);}}else s.value=u;return r}function s(t,r,n,i,a,o,c){return e.Debug.assertEqual(n[r],s),r}function c(t,c){switch(c){case r:if(t.onLeft)return n;case n:if(t.onOperator)return i;case i:if(t.onRight)return a;case a:return o;case o:case s:return s;default:e.Debug.fail("Invalid state");}}function l(e,t,n,i,a){return t[++e]=r,n[e]=a,i[e]=void 0,e}function u(t,r,n){if(e.Debug.shouldAssert(2))for(;t>=0;)e.Debug.assert(r[t]!==n,"Circular traversal detected."),t--;}t.enter=r,t.left=n,t.operator=i,t.right=a,t.exit=o,t.done=s,t.nextState=c;}(v||(v={}));var h=function(e,t,r,n,i,a){this.onEnter=e,this.onLeft=t,this.onOperator=r,this.onRight=n,this.onExit=i,this.foldState=a;};e.createBinaryExpressionTrampoline=function(t,r,n,i,a,o){var s=new h(t,r,n,i,a,o);return function(t,r){for(var n={value:void 0},i=[v.enter],a=[t],o=[void 0],c=0;i[c]!==v.done;)c=i[c](s,c,i,a,o,n,r);return e.Debug.assertEqual(c,0),n.value}};}(t),function(e){e.setTextRange=function(t,r){return r?e.setTextRangePosEnd(t,r.pos,r.end):t};}(t),function(e){var t,r,i,a,o,s,c,l,u;function _(e,t){return t&&e(t)}function d(e,t,r){if(r){if(t)return t(r);for(var n=0,i=r;n<i.length;n++){var a=e(i[n]);if(a)return a}}}function p(e,t){return 42===e.charCodeAt(t+1)&&42===e.charCodeAt(t+2)&&47!==e.charCodeAt(t+3)}function f(t,r,n){if(t&&!(t.kind<=159))switch(t.kind){case 160:return _(r,t.left)||_(r,t.right);case 162:return _(r,t.name)||_(r,t.constraint)||_(r,t.default)||_(r,t.expression);case 295:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||_(r,t.equalsToken)||_(r,t.objectAssignmentInitializer);case 296:return _(r,t.expression);case 163:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.dotDotDotToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type)||_(r,t.initializer);case 166:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||_(r,t.type)||_(r,t.initializer);case 165:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type)||_(r,t.initializer);case 294:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.questionToken)||_(r,t.initializer);case 253:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.exclamationToken)||_(r,t.type)||_(r,t.initializer);case 202:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.dotDotDotToken)||_(r,t.propertyName)||_(r,t.name)||_(r,t.initializer);case 178:case 179:case 173:case 174:case 175:return d(r,n,t.decorators)||d(r,n,t.modifiers)||d(r,n,t.typeParameters)||d(r,n,t.parameters)||_(r,t.type);case 168:case 167:case 170:case 171:case 172:case 212:case 255:case 213:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.asteriskToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.exclamationToken)||d(r,n,t.typeParameters)||d(r,n,t.parameters)||_(r,t.type)||_(r,t.equalsGreaterThanToken)||_(r,t.body);case 169:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.body);case 177:return _(r,t.typeName)||d(r,n,t.typeArguments);case 176:return _(r,t.assertsModifier)||_(r,t.parameterName)||_(r,t.type);case 180:return _(r,t.exprName);case 181:return d(r,n,t.members);case 182:return _(r,t.elementType);case 183:return d(r,n,t.elements);case 186:case 187:return d(r,n,t.types);case 188:return _(r,t.checkType)||_(r,t.extendsType)||_(r,t.trueType)||_(r,t.falseType);case 189:return _(r,t.typeParameter);case 199:return _(r,t.argument)||_(r,t.qualifier)||d(r,n,t.typeArguments);case 190:case 192:return _(r,t.type);case 193:return _(r,t.objectType)||_(r,t.indexType);case 194:return _(r,t.readonlyToken)||_(r,t.typeParameter)||_(r,t.nameType)||_(r,t.questionToken)||_(r,t.type)||d(r,n,t.members);case 195:return _(r,t.literal);case 196:return _(r,t.dotDotDotToken)||_(r,t.name)||_(r,t.questionToken)||_(r,t.type);case 200:case 201:case 203:return d(r,n,t.elements);case 204:return d(r,n,t.properties);case 205:return _(r,t.expression)||_(r,t.questionDotToken)||_(r,t.name);case 206:return _(r,t.expression)||_(r,t.questionDotToken)||_(r,t.argumentExpression);case 207:case 208:return _(r,t.expression)||_(r,t.questionDotToken)||d(r,n,t.typeArguments)||d(r,n,t.arguments);case 209:return _(r,t.tag)||_(r,t.questionDotToken)||d(r,n,t.typeArguments)||_(r,t.template);case 210:return _(r,t.type)||_(r,t.expression);case 211:case 214:case 215:case 216:return _(r,t.expression);case 218:return _(r,t.operand);case 223:return _(r,t.asteriskToken)||_(r,t.expression);case 217:return _(r,t.expression);case 219:return _(r,t.operand);case 220:return _(r,t.left)||_(r,t.operatorToken)||_(r,t.right);case 228:return _(r,t.expression)||_(r,t.type);case 229:return _(r,t.expression);case 230:return _(r,t.name);case 221:return _(r,t.condition)||_(r,t.questionToken)||_(r,t.whenTrue)||_(r,t.colonToken)||_(r,t.whenFalse);case 224:return _(r,t.expression);case 234:case 261:return d(r,n,t.statements);case 303:return d(r,n,t.statements)||_(r,t.endOfFileToken);case 236:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.declarationList);case 254:return d(r,n,t.declarations);case 237:return _(r,t.expression);case 238:return _(r,t.expression)||_(r,t.thenStatement)||_(r,t.elseStatement);case 239:return _(r,t.statement)||_(r,t.expression);case 240:return _(r,t.expression)||_(r,t.statement);case 241:return _(r,t.initializer)||_(r,t.condition)||_(r,t.incrementor)||_(r,t.statement);case 242:return _(r,t.initializer)||_(r,t.expression)||_(r,t.statement);case 243:return _(r,t.awaitModifier)||_(r,t.initializer)||_(r,t.expression)||_(r,t.statement);case 244:case 245:return _(r,t.label);case 246:return _(r,t.expression);case 247:return _(r,t.expression)||_(r,t.statement);case 248:return _(r,t.expression)||_(r,t.caseBlock);case 262:return d(r,n,t.clauses);case 288:return _(r,t.expression)||d(r,n,t.statements);case 289:return d(r,n,t.statements);case 249:return _(r,t.label)||_(r,t.statement);case 250:return _(r,t.expression);case 251:return _(r,t.tryBlock)||_(r,t.catchClause)||_(r,t.finallyBlock);case 291:return _(r,t.variableDeclaration)||_(r,t.block);case 164:return _(r,t.expression);case 256:case 225:case 257:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.typeParameters)||d(r,n,t.heritageClauses)||d(r,n,t.members);case 258:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.typeParameters)||_(r,t.type);case 259:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||d(r,n,t.members);case 297:return _(r,t.name)||_(r,t.initializer);case 260:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.body);case 264:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.name)||_(r,t.moduleReference);case 265:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.importClause)||_(r,t.moduleSpecifier)||_(r,t.assertClause);case 266:return _(r,t.name)||_(r,t.namedBindings);case 292:return d(r,n,t.elements);case 293:return _(r,t.name)||_(r,t.value);case 263:case 267:case 273:return _(r,t.name);case 268:case 272:return d(r,n,t.elements);case 271:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.exportClause)||_(r,t.moduleSpecifier)||_(r,t.assertClause);case 269:case 274:return _(r,t.propertyName)||_(r,t.name);case 270:return d(r,n,t.decorators)||d(r,n,t.modifiers)||_(r,t.expression);case 222:return _(r,t.head)||d(r,n,t.templateSpans);case 232:return _(r,t.expression)||_(r,t.literal);case 197:return _(r,t.head)||d(r,n,t.templateSpans);case 198:return _(r,t.type)||_(r,t.literal);case 161:return _(r,t.expression);case 290:return d(r,n,t.types);case 227:return _(r,t.expression)||d(r,n,t.typeArguments);case 276:return _(r,t.expression);case 275:return d(r,n,t.decorators);case 349:return d(r,n,t.elements);case 277:return _(r,t.openingElement)||d(r,n,t.children)||_(r,t.closingElement);case 281:return _(r,t.openingFragment)||d(r,n,t.children)||_(r,t.closingFragment);case 278:case 279:return _(r,t.tagName)||d(r,n,t.typeArguments)||_(r,t.attributes);case 285:return d(r,n,t.properties);case 284:return _(r,t.name)||_(r,t.initializer);case 286:return _(r,t.expression);case 287:return _(r,t.dotDotDotToken)||_(r,t.expression);case 280:return _(r,t.tagName);case 184:case 185:case 307:case 313:case 312:case 314:case 316:return _(r,t.type);case 315:return d(r,n,t.parameters)||_(r,t.type);case 318:return ("string"==typeof t.comment?void 0:d(r,n,t.comment))||d(r,n,t.tags);case 344:return _(r,t.tagName)||_(r,t.name)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 308:return _(r,t.name);case 309:return _(r,t.left)||_(r,t.right);case 338:case 345:return _(r,t.tagName)||(t.isNameFirst?_(r,t.name)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment)):_(r,t.typeExpression)||_(r,t.name)||("string"==typeof t.comment?void 0:d(r,n,t.comment)));case 328:return _(r,t.tagName)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 327:case 326:return _(r,t.tagName)||_(r,t.class)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 342:return _(r,t.tagName)||_(r,t.constraint)||d(r,n,t.typeParameters)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 343:return _(r,t.tagName)||(t.typeExpression&&307===t.typeExpression.kind?_(r,t.typeExpression)||_(r,t.fullName)||("string"==typeof t.comment?void 0:d(r,n,t.comment)):_(r,t.fullName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment)));case 336:return _(r,t.tagName)||_(r,t.fullName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 339:case 341:case 340:case 337:return _(r,t.tagName)||_(r,t.typeExpression)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 321:return e.forEach(t.typeParameters,r)||e.forEach(t.parameters,r)||_(r,t.type);case 322:case 323:case 324:return _(r,t.name);case 320:return e.forEach(t.jsDocPropertyTags,r);case 325:case 330:case 331:case 332:case 333:case 334:case 329:return _(r,t.tagName)||("string"==typeof t.comment?void 0:d(r,n,t.comment));case 348:return _(r,t.expression)}}function g(e){var t=[];return f(e,r,r),t;function r(e){t.unshift(e);}}function m(e){return void 0!==e.externalModuleIndicator}function y(t){return e.fileExtensionIsOneOf(t,[".d.ts",".d.mts",".d.cts"])}function v(t,r){for(var n=[],i=0,a=e.getLeadingCommentRanges(r,0)||e.emptyArray;i<a.length;i++){var o=a[i];T(n,o,r.substring(o.pos,o.end));}t.pragmas=new e.Map;for(var s=0,c=n;s<c.length;s++){var l=c[s];if(t.pragmas.has(l.name)){var u=t.pragmas.get(l.name);u instanceof Array?u.push(l.args):t.pragmas.set(l.name,[u,l.args]);}else t.pragmas.set(l.name,l.args);}}function h(t,r){t.checkJsDirective=void 0,t.referencedFiles=[],t.typeReferenceDirectives=[],t.libReferenceDirectives=[],t.amdDependencies=[],t.hasNoDefaultLib=!1,t.pragmas.forEach((function(n,i){switch(i){case"reference":var a=t.referencedFiles,o=t.typeReferenceDirectives,s=t.libReferenceDirectives;e.forEach(e.toArray(n),(function(n){var i=n.arguments,c=i.types,l=i.lib,u=i.path;n.arguments["no-default-lib"]?t.hasNoDefaultLib=!0:c?o.push({pos:c.pos,end:c.end,fileName:c.value}):l?s.push({pos:l.pos,end:l.end,fileName:l.value}):u?a.push({pos:u.pos,end:u.end,fileName:u.value}):r(n.range.pos,n.range.end-n.range.pos,e.Diagnostics.Invalid_reference_directive_syntax);}));break;case"amd-dependency":t.amdDependencies=e.map(e.toArray(n),(function(e){return {name:e.arguments.name,path:e.arguments.path}}));break;case"amd-module":if(n instanceof Array)for(var c=0,l=n;c<l.length;c++){var u=l[c];t.moduleName&&r(u.range.pos,u.range.end-u.range.pos,e.Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments),t.moduleName=u.arguments.name;}else t.moduleName=n.arguments.name;break;case"ts-nocheck":case"ts-check":e.forEach(e.toArray(n),(function(e){(!t.checkJsDirective||e.range.pos>t.checkJsDirective.pos)&&(t.checkJsDirective={enabled:"ts-check"===i,end:e.range.end,pos:e.range.pos});}));break;case"jsx":case"jsxfrag":case"jsximportsource":case"jsxruntime":return;default:e.Debug.fail("Unhandled pragma kind");}}));}!function(e){e[e.None=0]="None",e[e.Yield=1]="Yield",e[e.Await=2]="Await",e[e.Type=4]="Type",e[e.IgnoreMissingOpenBrace=16]="IgnoreMissingOpenBrace",e[e.JSDoc=32]="JSDoc";}(t||(t={})),function(e){e[e.TryParse=0]="TryParse",e[e.Lookahead=1]="Lookahead",e[e.Reparse=2]="Reparse";}(r||(r={})),e.parseBaseNodeFactory={createBaseSourceFileNode:function(t){return new(c||(c=e.objectAllocator.getSourceFileConstructor()))(t,-1,-1)},createBaseIdentifierNode:function(t){return new(o||(o=e.objectAllocator.getIdentifierConstructor()))(t,-1,-1)},createBasePrivateIdentifierNode:function(t){return new(s||(s=e.objectAllocator.getPrivateIdentifierConstructor()))(t,-1,-1)},createBaseTokenNode:function(t){return new(a||(a=e.objectAllocator.getTokenConstructor()))(t,-1,-1)},createBaseNode:function(t){return new(i||(i=e.objectAllocator.getNodeConstructor()))(t,-1,-1)}},e.parseNodeFactory=e.createNodeFactory(1,e.parseBaseNodeFactory),e.isJSDocLikeText=p,e.forEachChild=f,e.forEachChildRecursively=function(t,r,n){for(var i=g(t),a=[];a.length<i.length;)a.push(t);for(;0!==i.length;){var o=i.pop(),s=a.pop();if(e.isArray(o)){if(n&&(l=n(o,s))){if("skip"===l)continue;return l}for(var c=o.length-1;c>=0;--c)i.push(o[c]),a.push(s);}else {var l;if(l=r(o,s)){if("skip"===l)continue;return l}if(o.kind>=160)for(var u=0,_=g(o);u<_.length;u++){var d=_[u];i.push(d),a.push(o);}}}},e.createSourceFile=function(t,r,n,i,a){var o;return void 0===i&&(i=!1),null===e.tracing||void 0===e.tracing||e.tracing.push("parse","createSourceFile",{path:t},!0),e.performance.mark("beforeParse"),e.perfLogger.logStartParseSourceFile(t),o=100===n?l.parseSourceFile(t,r,n,void 0,i,6):l.parseSourceFile(t,r,n,void 0,i,a),e.perfLogger.logStopParseSourceFile(),e.performance.mark("afterParse"),e.performance.measure("Parse","beforeParse","afterParse"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o},e.parseIsolatedEntityName=function(e,t){return l.parseIsolatedEntityName(e,t)},e.parseJsonText=function(e,t){return l.parseJsonText(e,t)},e.isExternalModule=m,e.updateSourceFile=function(e,t,r,n){void 0===n&&(n=!1);var i=u.updateSourceFile(e,t,r,n);return i.flags|=3145728&e.flags,i},e.parseIsolatedJSDocComment=function(e,t,r){var n=l.JSDocParser.parseIsolatedJSDocComment(e,t,r);return n&&n.jsDoc&&l.fixupParentReferences(n.jsDoc),n},e.parseJSDocTypeExpressionForTests=function(e,t,r){return l.JSDocParser.parseJSDocTypeExpressionForTests(e,t,r)},function(t){var r,i,a,o,s,c=e.createScanner(99,!0);function l(e){return N++,e}var _,d,g,b,x,D,S,T,C,k,N,F,A,P,w,I,O,M={createBaseSourceFileNode:function(e){return l(new s(e,0,0))},createBaseIdentifierNode:function(e){return l(new a(e,0,0))},createBasePrivateIdentifierNode:function(e){return l(new o(e,0,0))},createBaseTokenNode:function(e){return l(new i(e,0,0))},createBaseNode:function(e){return l(new r(e,0,0))}},L=e.createNodeFactory(11,M),R=!0,B=!1;function j(t,r,n,i,a){void 0===n&&(n=2),void 0===a&&(a=!1),J(t,r,n,i,6),d=O,ve();var o,s,c=pe();if(1===ge())o=We([],c,c),s=Ue();else {for(var l=void 0;1!==ge();){var u=void 0;switch(ge()){case 22:u=Tn();break;case 110:case 95:case 104:u=Ue();break;case 40:u=ke((function(){return 8===ve()&&58!==ve()}))?Zr():En();break;case 8:case 10:if(ke((function(){return 58!==ve()}))){u=Mt();break}default:u=En();}l&&e.isArray(l)?l.push(u):l?l=[l,u]:(l=u,1!==ge()&&ce(e.Diagnostics.Unexpected_token));}var _=e.isArray(l)?He(L.createArrayLiteralExpression(l),c):e.Debug.checkDefined(l),p=L.createExpressionStatement(_);He(p,c),o=We([p],c),s=ze(1,e.Diagnostics.Unexpected_token);}var f=H(t,2,6,!1,o,s,d);a&&W(f),f.nodeCount=N,f.identifierCount=P,f.identifiers=F,f.parseDiagnostics=e.attachFileToDiagnostics(S,f),T&&(f.jsDocDiagnostics=e.attachFileToDiagnostics(T,f));var g=f;return z(),g}function J(t,n,l,u,p){switch(r=e.objectAllocator.getNodeConstructor(),i=e.objectAllocator.getTokenConstructor(),a=e.objectAllocator.getIdentifierConstructor(),o=e.objectAllocator.getPrivateIdentifierConstructor(),s=e.objectAllocator.getSourceFileConstructor(),_=e.normalizePath(t),g=n,b=l,C=u,x=p,D=e.getLanguageVariant(p),S=[],w=0,F=new e.Map,A=new e.Map,P=0,N=0,d=0,R=!0,x){case 1:case 2:O=131072;break;case 6:O=33685504;break;default:O=0;}B=!1,c.setText(g),c.setOnError(de),c.setScriptTarget(b),c.setLanguageVariant(D);}function z(){c.clearCommentDirectives(),c.setText(""),c.setOnError(void 0),g=void 0,b=void 0,C=void 0,x=void 0,D=void 0,d=0,S=void 0,T=void 0,w=0,F=void 0,I=void 0,R=!0;}function U(t,r,n){var i=y(_);i&&(O|=8388608),d=O,ve();var a=ht(0,zn);e.Debug.assert(1===ge());var o=q(Ue()),s=H(_,t,n,i,a,o,d);return v(s,g),h(s,(function(t,r,n){S.push(e.createDetachedDiagnostic(_,t,r,n));})),s.commentDirectives=c.getCommentDirectives(),s.nodeCount=N,s.identifierCount=P,s.identifiers=F,s.parseDiagnostics=e.attachFileToDiagnostics(S,s),T&&(s.jsDocDiagnostics=e.attachFileToDiagnostics(T,s)),r&&W(s),s}function K(e,t){return t?q(e):e}t.parseSourceFile=function(t,r,n,i,a,o){var s;if(void 0===a&&(a=!1),6===(o=e.ensureScriptKind(t,o))){var c=j(t,r,n,i,a);return e.convertToObjectWorker(c,null===(s=c.statements[0])||void 0===s?void 0:s.expression,c.parseDiagnostics,!1,void 0,void 0),c.referencedFiles=e.emptyArray,c.typeReferenceDirectives=e.emptyArray,c.libReferenceDirectives=e.emptyArray,c.amdDependencies=e.emptyArray,c.hasNoDefaultLib=!1,c.pragmas=e.emptyMap,c}J(t,r,n,i,o);var l=U(n,a,o);return z(),l},t.parseIsolatedEntityName=function(e,t){J("",e,t,void 0,1),ve();var r=Nt(!0),n=1===ge()&&!S.length;return z(),n?r:void 0},t.parseJsonText=j;var V=!1;function q(t){e.Debug.assert(!t.jsDoc);var r=e.mapDefined(e.getJSDocCommentRanges(t,g),(function(e){return Oe.parseJSDocComment(t,e.pos,e.end-e.pos)}));return r.length&&(t.jsDoc=r),V&&(V=!1,t.flags|=134217728),t}function W(t){e.setParentRecursive(t,!0);}function H(t,r,n,i,a,o,s){var l=L.createSourceFile(a,o,s);return e.setTextRangePosWidth(l,0,g.length),function(t){t.externalModuleIndicator=e.forEach(t.statements,Mi)||function(e){return 2097152&e.flags?Li(e):void 0}(t);}(l),!i&&m(l)&&16777216&l.transformFlags&&(l=function(t){var r=C,n=u.createSyntaxCursor(t);C={currentNode:function(e){var t=n.currentNode(e);return R&&t&&p(t)&&(t.intersectsChange=!0),t}};var i=[],a=S;S=[];for(var o=0,s=f(t.statements,0),l=function(){var r=t.statements[o],n=t.statements[s];e.addRange(i,t.statements,o,s),o=g(t.statements,s);var l=e.findIndex(a,(function(e){return e.start>=r.pos})),u=l>=0?e.findIndex(a,(function(e){return e.start>=n.pos}),l):-1;l>=0&&e.addRange(S,a,l,u>=0?u:void 0),Ee((function(){var e=O;for(O|=32768,c.setTextPos(n.pos),ve();1!==ge();){var r=c.getStartPos(),a=bt(0,zn);if(i.push(a),r===c.getStartPos()&&ve(),o>=0){var s=t.statements[o];if(a.end===s.pos)break;a.end>s.pos&&(o=g(t.statements,o+1));}}O=e;}),2),s=o>=0?f(t.statements,o):-1;};-1!==s;)l();if(o>=0){var _=t.statements[o];e.addRange(i,t.statements,o);var d=e.findIndex(a,(function(e){return e.start>=_.pos}));d>=0&&e.addRange(S,a,d);}return C=r,L.updateSourceFile(t,e.setTextRange(L.createNodeArray(i),t.statements));function p(e){return !(32768&e.flags||!(16777216&e.transformFlags))}function f(e,t){for(var r=t;r<e.length;r++)if(p(e[r]))return r;return -1}function g(e,t){for(var r=t;r<e.length;r++)if(!p(e[r]))return r;return -1}}(l)),l.text=g,l.bindDiagnostics=[],l.bindSuggestionDiagnostics=void 0,l.languageVersion=r,l.fileName=t,l.languageVariant=e.getLanguageVariant(n),l.isDeclarationFile=i,l.scriptKind=n,l}function G(e,t){e?O|=t:O&=~t;}function Q(e){G(e,4096);}function X(e){G(e,8192);}function Y(e){G(e,16384);}function Z(e){G(e,32768);}function $(e,t){var r=e&O;if(r){G(!1,r);var n=t();return G(!0,r),n}return t()}function ee(e,t){var r=e&~O;if(r){G(!0,r);var n=t();return G(!1,r),n}return t()}function te(e){return $(4096,e)}function re(e){return ee(32768,e)}function ne(e){return 0!=(O&e)}function ie(){return ne(8192)}function ae(){return ne(4096)}function oe(){return ne(16384)}function se(){return ne(32768)}function ce(e,t){ue(c.getTokenPos(),c.getTextPos(),e,t);}function le(t,r,n,i){var a=e.lastOrUndefined(S);a&&t===a.start||S.push(e.createDetachedDiagnostic(_,t,r,n,i)),B=!0;}function ue(e,t,r,n){le(e,t-e,r,n);}function _e(e,t,r){ue(e.pos,e.end,t,r);}function de(e,t){le(c.getTextPos(),t,e);}function pe(){return c.getStartPos()}function fe(){return c.hasPrecedingJSDocComment()}function ge(){return k}function me(){return k=c.scan()}function ye(e){return ve(),e()}function ve(){return e.isKeyword(k)&&(c.hasUnicodeEscape()||c.hasExtendedUnicodeEscape())&&ue(c.getTokenPos(),c.getTextPos(),e.Diagnostics.Keywords_cannot_contain_escape_characters),me()}function he(){return k=c.scanJsDocToken()}function be(){return k=c.reScanGreaterToken()}function xe(){return k=c.reScanTemplateHeadOrNoSubstitutionTemplate()}function De(){return k=c.reScanLessThanToken()}function Se(){return k=c.reScanHashToken()}function Te(){return k=c.scanJsxIdentifier()}function Ce(){return k=c.scanJsxToken()}function Ee(t,r){var n=k,i=S.length,a=B,o=O,s=0!==r?c.lookAhead(t):c.tryScan(t);return e.Debug.assert(o===O),s&&0===r||(k=n,2!==r&&(S.length=i),B=a),s}function ke(e){return Ee(e,1)}function Ne(e){return Ee(e,0)}function Fe(){return 79===ge()||ge()>116}function Ae(){return 79===ge()||(125!==ge()||!ie())&&(132!==ge()||!se())&&ge()>116}function Pe(t,r,n){return void 0===n&&(n=!0),ge()===t?(n&&ve(),!0):(r?ce(r):ce(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}t.fixupParentReferences=W;var we,Ie,Oe,Me=Object.keys(e.textToKeywordObj).filter((function(e){return e.length>2}));function Le(t){var r;if(e.isTaggedTemplateExpression(t))ue(e.skipTrivia(g,t.template.pos),t.template.end,e.Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings);else {var n=e.isIdentifier(t)?e.idText(t):void 0;if(n&&e.isIdentifierText(n,b)){var i=e.skipTrivia(g,t.pos);switch(n){case"const":case"let":case"var":return void ue(i,t.end,e.Diagnostics.Variable_declaration_not_allowed_at_this_location);case"declare":return;case"interface":return void Re(e.Diagnostics.Interface_name_cannot_be_0,e.Diagnostics.Interface_must_be_given_a_name,18);case"is":return void ue(i,c.getTextPos(),e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);case"module":case"namespace":return void Re(e.Diagnostics.Namespace_name_cannot_be_0,e.Diagnostics.Namespace_must_be_given_a_name,18);case"type":return void Re(e.Diagnostics.Type_alias_name_cannot_be_0,e.Diagnostics.Type_alias_must_be_given_a_name,63)}var a=null!==(r=e.getSpellingSuggestion(n,Me,(function(e){return e})))&&void 0!==r?r:function(t){for(var r=0,n=Me;r<n.length;r++){var i=n[r];if(t.length>i.length+2&&e.startsWith(t,i))return "".concat(i," ").concat(t.slice(i.length))}}(n);a?ue(i,t.end,e.Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0,a):0!==ge()&&ue(i,t.end,e.Diagnostics.Unexpected_keyword_or_identifier);}else ce(e.Diagnostics._0_expected,e.tokenToString(26));}}function Re(e,t,r){ge()===r?ce(t):ce(e,c.getTokenValue());}function Be(t){return ge()===t?(he(),!0):(ce(e.Diagnostics._0_expected,e.tokenToString(t)),!1)}function je(e){return ge()===e&&(ve(),!0)}function Je(e){if(ge()===e)return Ue()}function ze(t,r,n){return Je(t)||Ge(t,!1,r||e.Diagnostics._0_expected,n||e.tokenToString(t))}function Ue(){var e=pe(),t=ge();return ve(),He(L.createToken(t),e)}function Ke(){return 26===ge()||19===ge()||1===ge()||c.hasPrecedingLineBreak()}function Ve(){return !!Ke()&&(26===ge()&&ve(),!0)}function qe(){return Ve()||Pe(26)}function We(t,r,n,i){var a=L.createNodeArray(t,i);return e.setTextRangePosEnd(a,r,null!=n?n:c.getStartPos()),a}function He(t,r,n){return e.setTextRangePosEnd(t,r,null!=n?n:c.getStartPos()),O&&(t.flags|=O),B&&(B=!1,t.flags|=65536),t}function Ge(t,r,n,i){r?le(c.getStartPos(),0,n,i):n&&ce(n,i);var a=pe();return He(79===t?L.createIdentifier("",void 0,void 0):e.isTemplateLiteralKind(t)?L.createTemplateLiteralLikeNode(t,"","",void 0):8===t?L.createNumericLiteral("",void 0):10===t?L.createStringLiteral("",void 0):275===t?L.createMissingDeclaration():L.createToken(t),a)}function Qe(e){var t=F.get(e);return void 0===t&&F.set(e,t=e),t}function Xe(t,r,n){if(t){P++;var i=pe(),a=ge(),o=Qe(c.getTokenValue());return me(),He(L.createIdentifier(o,void 0,a),i)}if(80===ge())return ce(n||e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),Xe(!0);if(0===ge()&&c.tryScan((function(){return 79===c.reScanInvalidIdentifier()})))return Xe(!0);P++;var s=1===ge(),l=c.isReservedWord(),u=c.getTokenText(),_=l?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here:e.Diagnostics.Identifier_expected;return Ge(79,s,r||_,u)}function Ye(e){return Xe(Fe(),void 0,e)}function Ze(e,t){return Xe(Ae(),e,t)}function $e(t){return Xe(e.tokenIsIdentifierOrKeyword(ge()),t)}function et(){return e.tokenIsIdentifierOrKeyword(ge())||10===ge()||8===ge()}function tt(){return function(e){if(10===ge()||8===ge()){var t=Mt();return t.text=Qe(t.text),t}return e&&22===ge()?function(){var e=pe();Pe(22);var t=te(jr);return Pe(23),He(L.createComputedPropertyName(t),e)}():80===ge()?rt():$e()}(!0)}function rt(){var e,t,r=pe(),n=L.createPrivateIdentifier((e=c.getTokenText(),void 0===(t=A.get(e))&&A.set(e,t=e),t));return ve(),He(n,r)}function nt(e){return ge()===e&&Ne(at)}function it(){return ve(),!c.hasPrecedingLineBreak()&&ct()}function at(){switch(ge()){case 85:return 92===ve();case 93:return ve(),88===ge()?ke(lt):151===ge()?ke(st):ot();case 88:return lt();case 124:case 136:case 148:return ve(),ct();default:return it()}}function ot(){return 41!==ge()&&127!==ge()&&18!==ge()&&ct()}function st(){return ve(),ot()}function ct(){return 22===ge()||18===ge()||41===ge()||25===ge()||et()}function lt(){return ve(),84===ge()||98===ge()||118===ge()||126===ge()&&ke(On)||131===ge()&&ke(Mn)}function ut(t,r){if(xt(t))return !0;switch(t){case 0:case 1:case 3:return !(26===ge()&&r)&&jn();case 2:return 82===ge()||88===ge();case 4:return ke(ar);case 5:return ke(oi)||26===ge()&&!r;case 6:return 22===ge()||et();case 12:switch(ge()){case 22:case 41:case 25:case 24:return !0;default:return et()}case 18:return et();case 9:return 22===ge()||25===ge()||et();case 24:return e.tokenIsIdentifierOrKeyword(ge())||10===ge();case 7:return 18===ge()?ke(_t):r?Ae()&&!gt():Rr()&&!gt();case 8:return Gn();case 10:return 27===ge()||25===ge()||Gn();case 19:return Ae();case 15:switch(ge()){case 27:case 24:return !0}case 11:return 25===ge()||Br();case 16:return Ht(!1);case 17:return Ht(!0);case 20:case 21:return 27===ge()||Sr();case 22:return bi();case 23:return e.tokenIsIdentifierOrKeyword(ge());case 13:return e.tokenIsIdentifierOrKeyword(ge())||18===ge();case 14:return !0}return e.Debug.fail("Non-exhaustive case in 'isListElement'.")}function _t(){if(e.Debug.assert(18===ge()),19===ve()){var t=ve();return 27===t||18===t||94===t||117===t}return !0}function dt(){return ve(),Ae()}function pt(){return ve(),e.tokenIsIdentifierOrKeyword(ge())}function ft(){return ve(),e.tokenIsIdentifierOrKeywordOrGreaterThan(ge())}function gt(){return (117===ge()||94===ge())&&ke(mt)}function mt(){return ve(),Br()}function yt(){return ve(),Sr()}function vt(e){if(1===ge())return !0;switch(e){case 1:case 2:case 4:case 5:case 6:case 12:case 9:case 23:case 24:return 19===ge();case 3:return 19===ge()||82===ge()||88===ge();case 7:return 18===ge()||94===ge()||117===ge();case 8:return !!Ke()||!!Qr(ge())||38===ge();case 19:return 31===ge()||20===ge()||18===ge()||94===ge()||117===ge();case 11:return 21===ge()||26===ge();case 15:case 21:case 10:return 23===ge();case 17:case 16:case 18:return 21===ge()||23===ge();case 20:return 27!==ge();case 22:return 18===ge()||19===ge();case 13:return 31===ge()||43===ge();case 14:return 29===ge()&&ke(ki);default:return !1}}function ht(e,t){var r=w;w|=1<<e;for(var n=[],i=pe();!vt(e);)if(ut(e,!1))n.push(bt(e,t));else if(St(e))break;return w=r,We(n,i)}function bt(e,t){var r=xt(e);return r?Dt(r):t()}function xt(t){if(C&&function(e){switch(e){case 5:case 2:case 0:case 1:case 3:case 6:case 4:case 8:case 17:case 16:return !0}return !1}(t)&&!B){var r=C.currentNode(c.getStartPos());if(!(e.nodeIsMissing(r)||r.intersectsChange||e.containsParseError(r))&&(25358336&r.flags)===O&&function(e,t){switch(t){case 5:return function(e){if(e)switch(e.kind){case 170:case 175:case 171:case 172:case 166:case 233:return !0;case 168:var t=e;return !(79===t.name.kind&&134===t.name.originalKeywordKind)}return !1}(e);case 2:return function(e){if(e)switch(e.kind){case 288:case 289:return !0}return !1}(e);case 0:case 1:case 3:return function(e){if(e)switch(e.kind){case 255:case 236:case 234:case 238:case 237:case 250:case 246:case 248:case 245:case 244:case 242:case 243:case 241:case 240:case 247:case 235:case 251:case 249:case 239:case 252:case 265:case 264:case 271:case 270:case 260:case 256:case 257:case 259:case 258:return !0}return !1}(e);case 6:return function(e){return 297===e.kind}(e);case 4:return function(e){if(e)switch(e.kind){case 174:case 167:case 175:case 165:case 173:return !0}return !1}(e);case 8:return function(e){return 253===e.kind&&void 0===e.initializer}(e);case 17:case 16:return function(e){return 163===e.kind&&void 0===e.initializer}(e)}return !1}(r,t))return r.jsDocCache&&(r.jsDocCache=void 0),r}}function Dt(e){return c.setTextPos(e.end),ve(),e}function St(t){return function(t){switch(t){case 0:return 88===ge()?ce(e.Diagnostics._0_expected,e.tokenToString(93)):ce(e.Diagnostics.Declaration_or_statement_expected);case 1:return ce(e.Diagnostics.Declaration_or_statement_expected);case 2:return ce(e.Diagnostics.case_or_default_expected);case 3:return ce(e.Diagnostics.Statement_expected);case 18:case 4:return ce(e.Diagnostics.Property_or_signature_expected);case 5:return ce(e.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected);case 6:return ce(e.Diagnostics.Enum_member_expected);case 7:return ce(e.Diagnostics.Expression_expected);case 8:return e.isKeyword(ge())?ce(e.Diagnostics._0_is_not_allowed_as_a_variable_declaration_name,e.tokenToString(ge())):ce(e.Diagnostics.Variable_declaration_expected);case 9:return ce(e.Diagnostics.Property_destructuring_pattern_expected);case 10:return ce(e.Diagnostics.Array_element_destructuring_pattern_expected);case 11:return ce(e.Diagnostics.Argument_expression_expected);case 12:return ce(e.Diagnostics.Property_assignment_expected);case 15:return ce(e.Diagnostics.Expression_or_comma_expected);case 17:return ce(e.Diagnostics.Parameter_declaration_expected);case 16:return e.isKeyword(ge())?ce(e.Diagnostics._0_is_not_allowed_as_a_parameter_name,e.tokenToString(ge())):ce(e.Diagnostics.Parameter_declaration_expected);case 19:return ce(e.Diagnostics.Type_parameter_declaration_expected);case 20:return ce(e.Diagnostics.Type_argument_expected);case 21:return ce(e.Diagnostics.Type_expected);case 22:return ce(e.Diagnostics.Unexpected_token_expected);case 23:case 13:case 14:ce(e.Diagnostics.Identifier_expected);}}(t),!!function(){for(var e=0;e<25;e++)if(w&1<<e&&(ut(e,!0)||vt(e)))return !0;return !1}()||(ve(),!1)}function Tt(e,t,r){var n=w;w|=1<<e;for(var i=[],a=pe(),o=-1;;)if(ut(e,!1)){var s=c.getStartPos();if(i.push(bt(e,t)),o=c.getTokenPos(),je(27))continue;if(o=-1,vt(e))break;Pe(27,Ct(e)),r&&26===ge()&&!c.hasPrecedingLineBreak()&&ve(),s===c.getStartPos()&&ve();}else {if(vt(e))break;if(St(e))break}return w=n,We(i,a,void 0,o>=0)}function Ct(t){return 6===t?e.Diagnostics.An_enum_member_name_must_be_followed_by_a_or:void 0}function Et(){var e=We([],pe());return e.isMissingList=!0,e}function kt(e,t,r,n){if(Pe(r)){var i=Tt(e,t);return Pe(n),i}return Et()}function Nt(e,t){for(var r=pe(),n=e?$e(t):Ze(t),i=pe();je(24);){if(29===ge()){n.jsdocDotPos=i;break}i=pe(),n=He(L.createQualifiedName(n,At(e,!1)),r);}return n}function Ft(e,t){return He(L.createQualifiedName(e,t),e.pos)}function At(t,r){if(c.hasPrecedingLineBreak()&&e.tokenIsIdentifierOrKeyword(ge())&&ke(In))return Ge(79,!0,e.Diagnostics.Identifier_expected);if(80===ge()){var n=rt();return r?n:Ge(79,!0,e.Diagnostics.Identifier_expected)}return t?$e():Ze()}function Pt(e){var t=pe();return He(L.createTemplateExpression(Lt(e),function(e){var t,r=pe(),n=[];do{t=Ot(e),n.push(t);}while(16===t.literal.kind);return We(n,r)}(e)),t)}function wt(){var e=pe();return He(L.createTemplateLiteralTypeSpan(Or(),It(!1)),e)}function It(t){return 19===ge()?(function(e){k=c.reScanTemplateToken(e);}(t),r=Rt(ge()),e.Debug.assert(16===r.kind||17===r.kind,"Template fragment has wrong token kind"),r):ze(17,e.Diagnostics._0_expected,e.tokenToString(19));var r;}function Ot(e){var t=pe();return He(L.createTemplateSpan(te(jr),It(e)),t)}function Mt(){return Rt(ge())}function Lt(t){t&&xe();var r=Rt(ge());return e.Debug.assert(15===r.kind,"Template head has wrong token kind"),r}function Rt(t){var r=pe(),n=e.isTemplateLiteralKind(t)?L.createTemplateLiteralLikeNode(t,c.getTokenValue(),function(e){var t=14===e||17===e,r=c.getTokenText();return r.substring(1,r.length-(c.isUnterminated()?0:t?1:2))}(t),2048&c.getTokenFlags()):8===t?L.createNumericLiteral(c.getTokenValue(),c.getNumericLiteralFlags()):10===t?L.createStringLiteral(c.getTokenValue(),void 0,c.hasExtendedUnicodeEscape()):e.isLiteralKind(t)?L.createLiteralLikeNode(t,c.getTokenValue()):e.Debug.fail();return c.hasExtendedUnicodeEscape()&&(n.hasExtendedUnicodeEscape=!0),c.isUnterminated()&&(n.isUnterminated=!0),ve(),He(n,r)}function Bt(){return Nt(!0,e.Diagnostics.Type_expected)}function jt(){if(!c.hasPrecedingLineBreak()&&29===De())return kt(20,Or,29,31)}function Jt(){var e=pe();return He(L.createTypeReferenceNode(Bt(),jt()),e)}function zt(t){switch(t.kind){case 177:return e.nodeIsMissing(t.typeName);case 178:case 179:var r=t,n=r.parameters,i=r.type;return !!n.isMissingList||zt(i);case 190:return zt(t.type);default:return !1}}function Ut(){var e=pe();return ve(),He(L.createThisTypeNode(),e)}function Kt(){var e,t=pe();return 108!==ge()&&103!==ge()||(e=$e(),Pe(58)),He(L.createParameterDeclaration(void 0,void 0,void 0,e,void 0,Vt(),void 0),t)}function Vt(){c.setInJSDocType(!0);var e=pe();if(je(141)){var t=L.createJSDocNamepathType(void 0);e:for(;;)switch(ge()){case 19:case 1:case 27:case 5:break e;default:he();}return c.setInJSDocType(!1),He(t,e)}var r=je(25),n=wr();return c.setInJSDocType(!1),r&&(n=He(L.createJSDocVariadicType(n),e)),63===ge()?(ve(),He(L.createJSDocOptionalType(n),e)):n}function qt(){var e,t,r=pe(),n=Ze();je(94)&&(Sr()||!Br()?e=Or():t=$r());var i=je(63)?Or():void 0,a=L.createTypeParameterDeclaration(n,e,i);return a.expression=t,He(a,r)}function Wt(){if(29===ge())return kt(19,qt,29,31)}function Ht(t){return 25===ge()||Gn()||e.isModifierKind(ge())||59===ge()||Sr(!t)}function Gt(){return Xt(!0)}function Qt(){return Xt(!1)}function Xt(t){var r=pe(),n=fe(),i=t?re(li):li();if(108===ge()){var a=L.createParameterDeclaration(i,void 0,void 0,Xe(!0),void 0,Lr(),void 0);return i&&_e(i[0],e.Diagnostics.Decorators_may_not_be_applied_to_this_parameters),K(He(a,r),n)}var o=R;R=!1;var s=_i(),c=K(He(L.createParameterDeclaration(i,s,Je(25),function(t){var r=Qn(e.Diagnostics.Private_identifiers_cannot_be_used_as_parameters);return 0===e.getFullWidth(r)&&!e.some(t)&&e.isModifierKind(ge())&&ve(),r}(s),Je(57),Lr(),Jr()),r),n);return R=o,c}function Yt(t,r){if(function(t,r){return 38===t?(Pe(t),!0):!!je(58)||!(!r||38!==ge())&&(ce(e.Diagnostics._0_expected,e.tokenToString(58)),ve(),!0)}(t,r))return wr()}function Zt(e){var t=ie(),r=se();X(!!(1&e)),Z(!!(2&e));var n=32&e?Tt(17,Kt):Tt(16,r?Gt:Qt);return X(t),Z(r),n}function $t(e){if(!Pe(20))return Et();var t=Zt(e);return Pe(21),t}function er(){je(27)||qe();}function tr(e){var t=pe(),r=fe();174===e&&Pe(103);var n=Wt(),i=$t(4),a=Yt(58,!0);return er(),K(He(173===e?L.createCallSignature(n,i,a):L.createConstructSignature(n,i,a),t),r)}function rr(){return 22===ge()&&ke(nr)}function nr(){if(ve(),25===ge()||23===ge())return !0;if(e.isModifierKind(ge())){if(ve(),Ae())return !0}else {if(!Ae())return !1;ve();}return 58===ge()||27===ge()||57===ge()&&(ve(),58===ge()||27===ge()||23===ge())}function ir(e,t,r,n){var i=kt(16,Qt,22,23),a=Lr();return er(),K(He(L.createIndexSignature(r,n,i,a),e),t)}function ar(){if(20===ge()||29===ge()||136===ge()||148===ge())return !0;for(var t=!1;e.isModifierKind(ge());)t=!0,ve();return 22===ge()||(et()&&(t=!0,ve()),!!t&&(20===ge()||29===ge()||57===ge()||58===ge()||27===ge()||Ke()))}function or(){if(20===ge()||29===ge())return tr(173);if(103===ge()&&ke(sr))return tr(174);var e=pe(),t=fe(),r=_i();return nt(136)?ai(e,t,void 0,r,171):nt(148)?ai(e,t,void 0,r,172):rr()?ir(e,t,void 0,r):function(e,t,r){var n,i=tt(),a=Je(57);if(20===ge()||29===ge()){var o=Wt(),s=$t(4),c=Yt(58,!0);n=L.createMethodSignature(r,i,a,o,s,c);}else c=Lr(),n=L.createPropertySignature(r,i,a,c),63===ge()&&(n.initializer=Jr());return er(),K(He(n,e),t)}(e,t,r)}function sr(){return ve(),20===ge()||29===ge()}function cr(){return 24===ve()}function lr(){switch(ve()){case 20:case 29:case 24:return !0}return !1}function ur(){var e;return Pe(18)?(e=ht(4,or),Pe(19)):e=Et(),e}function _r(){return ve(),39===ge()||40===ge()?144===ve():(144===ge()&&ve(),22===ge()&&dt()&&101===ve())}function dr(){var t=pe();if(je(25))return He(L.createRestTypeNode(Or()),t);var r=Or();if(e.isJSDocNullableType(r)&&r.pos===r.type.pos){var n=L.createOptionalTypeNode(r.type);return e.setTextRange(n,r),n.flags=r.flags,n}return r}function pr(){return 58===ve()||57===ge()&&58===ve()}function fr(){return 25===ge()?e.tokenIsIdentifierOrKeyword(ve())&&pr():e.tokenIsIdentifierOrKeyword(ge())&&pr()}function gr(){if(ke(fr)){var e=pe(),t=fe(),r=Je(25),n=$e(),i=Je(57);Pe(58);var a=dr();return K(He(L.createNamedTupleMember(r,n,i,a),e),t)}return dr()}function mr(){var e=pe(),t=fe(),r=function(){var e;if(126===ge()){var t=pe();ve(),e=We([He(L.createToken(126),t)],t);}return e}(),n=je(103),i=Wt(),a=$t(4),o=Yt(38,!1),s=n?L.createConstructorTypeNode(r,i,a,o):L.createFunctionTypeNode(i,a,o);return n||(s.modifiers=r),K(He(s,e),t)}function yr(){var e=Ue();return 24===ge()?void 0:e}function vr(e){var t=pe();e&&ve();var r=110===ge()||95===ge()||104===ge()?Ue():Rt(ge());return e&&(r=He(L.createPrefixUnaryExpression(40,r),t)),He(L.createLiteralTypeNode(r),t)}function hr(){return ve(),100===ge()}function br(){d|=1048576;var e=pe(),t=je(112);Pe(100),Pe(20);var r=Or();Pe(21);var n=je(24)?Bt():void 0,i=jt();return He(L.createImportTypeNode(r,n,i,t),e)}function xr(){return ve(),8===ge()||9===ge()}function Dr(){switch(ge()){case 130:case 154:case 149:case 146:case 157:case 150:case 133:case 152:case 143:case 147:return Ne(yr)||Jt();case 66:c.reScanAsteriskEqualsToken();case 41:return r=pe(),ve(),He(L.createJSDocAllType(),r);case 60:c.reScanQuestionToken();case 57:return function(){var e=pe();return ve(),27===ge()||19===ge()||21===ge()||31===ge()||63===ge()||51===ge()?He(L.createJSDocUnknownType(),e):He(L.createJSDocNullableType(Or()),e)}();case 98:return function(){var e=pe(),t=fe();if(ke(Ci)){ve();var r=$t(36),n=Yt(58,!1);return K(He(L.createJSDocFunctionType(r,n),e),t)}return He(L.createTypeReferenceNode($e(),void 0),e)}();case 53:return function(){var e=pe();return ve(),He(L.createJSDocNonNullableType(Dr()),e)}();case 14:case 10:case 8:case 9:case 110:case 95:case 104:return vr();case 40:return ke(xr)?vr(!0):Jt();case 114:return Ue();case 108:var e=Ut();return 139!==ge()||c.hasPrecedingLineBreak()?e:(t=e,ve(),He(L.createTypePredicateNode(void 0,t,Or()),t.pos));case 112:return ke(hr)?br():function(){var e=pe();return Pe(112),He(L.createTypeQueryNode(Nt(!0)),e)}();case 18:return ke(_r)?function(){var e,t=pe();Pe(18),144!==ge()&&39!==ge()&&40!==ge()||144!==(e=Ue()).kind&&Pe(144),Pe(22);var r,n=function(){var e=pe(),t=$e();Pe(101);var r=Or();return He(L.createTypeParameterDeclaration(t,r,void 0),e)}(),i=je(127)?Or():void 0;Pe(23),57!==ge()&&39!==ge()&&40!==ge()||57!==(r=Ue()).kind&&Pe(57);var a=Lr();qe();var o=ht(4,or);return Pe(19),He(L.createMappedTypeNode(e,n,i,r,a,o),t)}():function(){var e=pe();return He(L.createTypeLiteralNode(ur()),e)}();case 22:return function(){var e=pe();return He(L.createTupleTypeNode(kt(21,gr,22,23)),e)}();case 20:return function(){var e=pe();Pe(20);var t=Or();return Pe(21),He(L.createParenthesizedType(t),e)}();case 100:return br();case 128:return ke(In)?function(){var e=pe(),t=ze(128),r=108===ge()?Ut():Ze(),n=je(139)?Or():void 0;return He(L.createTypePredicateNode(t,r,n),e)}():Jt();case 15:return function(){var e=pe();return He(L.createTemplateLiteralType(Lt(!1),function(){var e,t=pe(),r=[];do{e=wt(),r.push(e);}while(16===e.literal.kind);return We(r,t)}()),e)}();default:return Jt()}var t,r;}function Sr(e){switch(ge()){case 130:case 154:case 149:case 146:case 157:case 133:case 144:case 150:case 153:case 114:case 152:case 104:case 108:case 112:case 143:case 18:case 22:case 29:case 51:case 50:case 103:case 10:case 8:case 9:case 110:case 95:case 147:case 41:case 57:case 53:case 25:case 137:case 100:case 128:case 14:case 15:return !0;case 98:return !e;case 40:return !e&&ke(xr);case 20:return !e&&ke(Tr);default:return Ae()}}function Tr(){return ve(),21===ge()||Ht(!1)||Sr()}function Cr(){var e,t=ge();switch(t){case 140:case 153:case 144:return function(e){var t=pe();return Pe(e),He(L.createTypeOperatorNode(e,Cr()),t)}(t);case 137:return e=pe(),Pe(137),He(L.createInferTypeNode(function(){var e=pe();return He(L.createTypeParameterDeclaration(Ze(),void 0,void 0),e)}()),e)}return function(){for(var e=pe(),t=Dr();!c.hasPrecedingLineBreak();)switch(ge()){case 53:ve(),t=He(L.createJSDocNonNullableType(t),e);break;case 57:if(ke(yt))return t;ve(),t=He(L.createJSDocNullableType(t),e);break;case 22:if(Pe(22),Sr()){var r=Or();Pe(23),t=He(L.createIndexedAccessTypeNode(t,r),e);}else Pe(23),t=He(L.createArrayTypeNode(t),e);break;default:return t}return t}()}function Er(t){if(Ar()){var r=mr();return _e(r,e.isFunctionTypeNode(r)?t?e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type:t?e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type:e.Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type),r}}function kr(e,t,r){var n=pe(),i=51===e,a=je(e),o=a&&Er(i)||t();if(ge()===e||a){for(var s=[o];je(e);)s.push(Er(i)||t());o=He(r(We(s,n)),n);}return o}function Nr(){return kr(50,Cr,L.createIntersectionTypeNode)}function Fr(){return ve(),103===ge()}function Ar(){return 29===ge()||!(20!==ge()||!ke(Pr))||103===ge()||126===ge()&&ke(Fr)}function Pr(){if(ve(),21===ge()||25===ge())return !0;if(function(){if(e.isModifierKind(ge())&&_i(),Ae()||108===ge())return ve(),!0;if(22===ge()||18===ge()){var t=S.length;return Qn(),t===S.length}return !1}()){if(58===ge()||27===ge()||57===ge()||63===ge())return !0;if(21===ge()&&(ve(),38===ge()))return !0}return !1}function wr(){var e=pe(),t=Ae()&&Ne(Ir),r=Or();return t?He(L.createTypePredicateNode(void 0,t,r),e):r}function Ir(){var e=Ze();if(139===ge()&&!c.hasPrecedingLineBreak())return ve(),e}function Or(){return $(40960,Mr)}function Mr(e){if(Ar())return mr();var t=pe(),r=kr(51,Nr,L.createUnionTypeNode);if(!e&&!c.hasPrecedingLineBreak()&&je(94)){var n=Mr(!0);Pe(57);var i=Mr();Pe(58);var a=Mr();return He(L.createConditionalTypeNode(r,n,i,a),t)}return r}function Lr(){return je(58)?Or():void 0}function Rr(){switch(ge()){case 108:case 106:case 104:case 110:case 95:case 8:case 9:case 10:case 14:case 15:case 20:case 22:case 18:case 98:case 84:case 103:case 43:case 68:case 79:return !0;case 100:return ke(lr);default:return Ae()}}function Br(){if(Rr())return !0;switch(ge()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 45:case 46:case 29:case 132:case 125:case 80:return !0;default:return !(ae()&&101===ge()||!(e.getBinaryOperatorPrecedence(ge())>0))||Ae()}}function jr(){var e=oe();e&&Y(!1);for(var t,r=pe(),n=zr();t=Je(27);)n=Yr(n,t,zr(),r);return e&&Y(!0),n}function Jr(){return je(63)?zr():void 0}function zr(){if(125===ge()&&(ie()||ke(Ln)))return function(){var e=pe();return ve(),c.hasPrecedingLineBreak()||41!==ge()&&!Br()?He(L.createYieldExpression(void 0,void 0),e):He(L.createYieldExpression(Je(41),zr()),e)}();var t=function(){var e=20===ge()||29===ge()||131===ge()?ke(Kr):38===ge()?1:0;if(0!==e)return 1===e?Wr(!0):Ne(Vr)}()||function(){if(131===ge()&&1===ke(qr)){var e=pe(),t=di();return Ur(e,Gr(0),t)}}();if(t)return t;var r=pe(),n=Gr(0);return 79===n.kind&&38===ge()?Ur(r,n,void 0):e.isLeftHandSideExpression(n)&&e.isAssignmentOperator(be())?Yr(n,Ue(),zr(),r):function(t,r){var n,i=Je(57);return i?He(L.createConditionalExpression(t,i,$(20480,zr),n=ze(58),e.nodeIsPresent(n)?zr():Ge(79,!1,e.Diagnostics._0_expected,e.tokenToString(58))),r):t}(n,r)}function Ur(t,r,n){e.Debug.assert(38===ge(),"parseSimpleArrowFunctionExpression should only have been called if we had a =>");var i=L.createParameterDeclaration(void 0,void 0,void 0,r,void 0,void 0,void 0);He(i,r.pos);var a=We([i],i.pos,i.end),o=ze(38),s=Hr(!!n);return q(He(L.createArrowFunction(n,void 0,a,void 0,o,s),t))}function Kr(){if(131===ge()){if(ve(),c.hasPrecedingLineBreak())return 0;if(20!==ge()&&29!==ge())return 0}var t=ge(),r=ve();if(20===t){if(21===r)switch(ve()){case 38:case 58:case 18:return 1;default:return 0}if(22===r||18===r)return 2;if(25===r)return 1;if(e.isModifierKind(r)&&131!==r&&ke(dt))return 1;if(!Ae()&&108!==r)return 0;switch(ve()){case 58:return 1;case 57:return ve(),58===ge()||27===ge()||63===ge()||21===ge()?1:0;case 27:case 63:case 21:return 2}return 0}return e.Debug.assert(29===t),Ae()?1===D?ke((function(){var e=ve();if(94===e)switch(ve()){case 63:case 31:return !1;default:return !0}else if(27===e)return !0;return !1}))?1:0:2:0}function Vr(){var t=c.getTokenPos();if(!(null==I?void 0:I.has(t))){var r=Wr(!1);return r||(I||(I=new e.Set)).add(t),r}}function qr(){if(131===ge()){if(ve(),c.hasPrecedingLineBreak()||38===ge())return 0;var e=Gr(0);if(!c.hasPrecedingLineBreak()&&79===e.kind&&38===ge())return 1}return 0}function Wr(t){var r,n=pe(),i=fe(),a=di(),o=e.some(a,e.isAsyncModifier)?2:0,s=Wt();if(Pe(20)){if(r=Zt(o),!Pe(21)&&!t)return}else {if(!t)return;r=Et();}var c=Yt(58,!1);if(!c||t||!zt(c)){var l=c&&e.isJSDocFunctionType(c);if(t||38===ge()||!l&&18===ge()){var u=ge(),_=ze(38),d=38===u||18===u?Hr(e.some(a,e.isAsyncModifier)):Ze();return K(He(L.createArrowFunction(a,s,r,c,_,d),n),i)}}}function Hr(e){if(18===ge())return An(e?2:0);if(26!==ge()&&98!==ge()&&84!==ge()&&jn()&&(18===ge()||98===ge()||84===ge()||59===ge()||!Br()))return An(16|(e?2:0));var t=R;R=!1;var r=e?re(zr):$(32768,zr);return R=t,r}function Gr(e){var t=pe();return Xr(e,$r(),t)}function Qr(e){return 101===e||159===e}function Xr(t,r,n){for(;;){be();var i=e.getBinaryOperatorPrecedence(ge());if(!(42===ge()?i>=t:i>t))break;if(101===ge()&&ae())break;if(127===ge()){if(c.hasPrecedingLineBreak())break;ve(),a=r,o=Or(),r=He(L.createAsExpression(a,o),a.pos);}else r=Yr(r,Ue(),Gr(i),n);}var a,o;return r}function Yr(e,t,r,n){return He(L.createBinaryExpression(e,t,r),n)}function Zr(){var e=pe();return He(L.createPrefixUnaryExpression(ge(),ye(en)),e)}function $r(){if(function(){switch(ge()){case 39:case 40:case 54:case 53:case 89:case 112:case 114:case 132:return !1;case 29:if(1!==D)return !1;default:return !0}}()){var t=pe(),r=tn();return 42===ge()?Xr(e.getBinaryOperatorPrecedence(ge()),r,t):r}var n=ge(),i=en();if(42===ge()){t=e.skipTrivia(g,i.pos);var a=i.end;210===i.kind?ue(t,a,e.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses):ue(t,a,e.Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses,e.tokenToString(n));}return i}function en(){switch(ge()){case 39:case 40:case 54:case 53:return Zr();case 89:return e=pe(),He(L.createDeleteExpression(ye(en)),e);case 112:return function(){var e=pe();return He(L.createTypeOfExpression(ye(en)),e)}();case 114:return function(){var e=pe();return He(L.createVoidExpression(ye(en)),e)}();case 29:return function(){var e=pe();Pe(29);var t=Or();Pe(31);var r=en();return He(L.createTypeAssertion(t,r),e)}();case 132:if(132===ge()&&(se()||ke(Ln)))return function(){var e=pe();return He(L.createAwaitExpression(ye(en)),e)}();default:return tn()}var e;}function tn(){if(45===ge()||46===ge()){var t=pe();return He(L.createPrefixUnaryExpression(ge(),ye(rn)),t)}if(1===D&&29===ge()&&ke(ft))return an(!0);var r=rn();if(e.Debug.assert(e.isLeftHandSideExpression(r)),(45===ge()||46===ge())&&!c.hasPrecedingLineBreak()){var n=ge();return ve(),He(L.createPostfixUnaryExpression(r,n),r.pos)}return r}function rn(){var t,r=pe();return 100===ge()?ke(sr)?(d|=1048576,t=Ue()):ke(cr)?(ve(),ve(),t=He(L.createMetaProperty(100,$e()),r),d|=2097152):t=nn():t=106===ge()?function(){var t=pe(),r=Ue();if(29===ge()){var n=pe();void 0!==Ne(bn)&&ue(n,pe(),e.Diagnostics.super_may_not_use_type_arguments);}return 20===ge()||24===ge()||22===ge()?r:(ze(24,e.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access),He(L.createPropertyAccessExpression(r,At(!0,!0)),t))}():nn(),vn(r,t)}function nn(){return gn(pe(),xn(),!0)}function an(t,r,i){var a,o=pe(),s=function(e){var t=pe();if(Pe(29),31===ge())return Ce(),He(L.createJsxOpeningFragment(),t);var r,n=cn(),i=0==(131072&O)?hi():void 0,a=function(){var e=pe();return He(L.createJsxAttributes(ht(13,un)),e)}();return 31===ge()?(Ce(),r=L.createJsxOpeningElement(n,i,a)):(Pe(43),Pe(31,void 0,!1)&&(e?ve():Ce()),r=L.createJsxSelfClosingElement(n,i,a)),He(r,t)}(t);if(279===s.kind){var c=sn(s),l=void 0,u=c[c.length-1];if(277===(null==u?void 0:u.kind)&&!E(u.openingElement.tagName,u.closingElement.tagName)&&E(s.tagName,u.closingElement.tagName)){var _=u.children.end,d=He(L.createJsxElement(u.openingElement,u.children,He(L.createJsxClosingElement(He(L.createIdentifier(""),_,_)),_,_)),u.openingElement.pos,_);c=We(n$3(n$3([],c.slice(0,c.length-1),!0),[d],!1),c.pos,_),l=u.closingElement;}else l=function(e,t){var r=pe();Pe(30);var n=cn();return Pe(31,void 0,!1)&&(t||!E(e.tagName,n)?ve():Ce()),He(L.createJsxClosingElement(n),r)}(s,t),E(s.tagName,l.tagName)||(i&&e.isJsxOpeningElement(i)&&E(l.tagName,i.tagName)?_e(s.tagName,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(g,s.tagName)):_e(l.tagName,e.Diagnostics.Expected_corresponding_JSX_closing_tag_for_0,e.getTextOfNodeFromSourceText(g,s.tagName)));a=He(L.createJsxElement(s,c,l),o);}else 282===s.kind?a=He(L.createJsxFragment(s,sn(s),function(t){var r=pe();return Pe(30),e.tokenIsIdentifierOrKeyword(ge())&&_e(cn(),e.Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment),Pe(31,void 0,!1)&&(t?ve():Ce()),He(L.createJsxJsxClosingFragment(),r)}(t)),o):(e.Debug.assert(278===s.kind),a=s);if(t&&29===ge()){var p=void 0===r?a.pos:r,f=Ne((function(){return an(!0,p)}));if(f){var m=Ge(27,!1);return e.setTextRangePosWidth(m,f.pos,0),ue(e.skipTrivia(g,p),f.end,e.Diagnostics.JSX_expressions_must_have_one_parent_element),He(L.createBinaryExpression(a,m,f),o)}}return a}function on(t,r){switch(r){case 1:if(e.isJsxOpeningFragment(t))_e(t,e.Diagnostics.JSX_fragment_has_no_corresponding_closing_tag);else {var n=t.tagName;ue(e.skipTrivia(g,n.pos),n.end,e.Diagnostics.JSX_element_0_has_no_corresponding_closing_tag,e.getTextOfNodeFromSourceText(g,t.tagName));}return;case 30:case 7:return;case 11:case 12:return i=pe(),a=L.createJsxText(c.getTokenValue(),12===k),k=c.scanJsxToken(),He(a,i);case 18:return ln(!1);case 29:return an(!1,void 0,t);default:return e.Debug.assertNever(r)}var i,a;}function sn(t){var r=[],n=pe(),i=w;for(w|=16384;;){var a=on(t,k=c.reScanJsxToken());if(!a)break;if(r.push(a),e.isJsxOpeningElement(t)&&277===(null==a?void 0:a.kind)&&!E(a.openingElement.tagName,a.closingElement.tagName)&&E(t.tagName,a.closingElement.tagName))break}return w=i,We(r,n)}function cn(){var e=pe();Te();for(var t=108===ge()?Ue():$e();je(24);)t=He(L.createPropertyAccessExpression(t,At(!0,!1)),e);return t}function ln(e){var t,r,n=pe();if(Pe(18))return 19!==ge()&&(t=Je(25),r=jr()),e?Pe(19):Pe(19,void 0,!1)&&Ce(),He(L.createJsxExpression(t,r),n)}function un(){if(18===ge())return function(){var e=pe();Pe(18),Pe(25);var t=jr();return Pe(19),He(L.createJsxSpreadAttribute(t),e)}();Te();var e=pe();return He(L.createJsxAttribute($e(),63!==ge()?void 0:10===(k=c.scanJsxAttributeValue())?Mt():ln(!0)),e)}function _n(){return ve(),e.tokenIsIdentifierOrKeyword(ge())||22===ge()||mn()}function dn(t){if(32&t.flags)return !0;if(e.isNonNullExpression(t)){for(var r=t.expression;e.isNonNullExpression(r)&&!(32&r.flags);)r=r.expression;if(32&r.flags){for(;e.isNonNullExpression(t);)t.flags|=32,t=t.expression;return !0}}return !1}function pn(t,r,n){var i=At(!0,!0),a=n||dn(r),o=a?L.createPropertyAccessChain(r,n,i):L.createPropertyAccessExpression(r,i);return a&&e.isPrivateIdentifier(o.name)&&_e(o.name,e.Diagnostics.An_optional_chain_cannot_contain_private_identifiers),He(o,t)}function fn(t,r,n){var i;if(23===ge())i=Ge(79,!0,e.Diagnostics.An_element_access_expression_should_take_an_argument);else {var a=te(jr);e.isStringOrNumericLiteralLike(a)&&(a.text=Qe(a.text)),i=a;}return Pe(23),He(n||dn(r)?L.createElementAccessChain(r,n,i):L.createElementAccessExpression(r,i),t)}function gn(t,r,n){for(;;){var i=void 0,a=!1;if(n&&28===ge()&&ke(_n)?(i=ze(28),a=e.tokenIsIdentifierOrKeyword(ge())):a=je(24),a)r=pn(t,r,i);else if(i||53!==ge()||c.hasPrecedingLineBreak())if(!i&&oe()||!je(22)){if(!mn())return r;r=yn(t,r,i,void 0);}else r=fn(t,r,i);else ve(),r=He(L.createNonNullExpression(r),t);}}function mn(){return 14===ge()||15===ge()}function yn(e,t,r,n){var i=L.createTaggedTemplateExpression(t,n,14===ge()?(xe(),Mt()):Pt(!0));return (r||32&t.flags)&&(i.flags|=32),i.questionDotToken=r,He(i,e)}function vn(t,r){for(;;){r=gn(t,r,!0);var n=Je(28);if(0!=(131072&O)||29!==ge()&&47!==ge()){if(20===ge()){a=hn(),r=He(n||dn(r)?L.createCallChain(r,n,void 0,a):L.createCallExpression(r,void 0,a),t);continue}}else {var i=Ne(bn);if(i){if(mn()){r=yn(t,r,n,i);continue}var a=hn();r=He(n||dn(r)?L.createCallChain(r,n,i,a):L.createCallExpression(r,i,a),t);continue}}if(n){var o=Ge(79,!1,e.Diagnostics.Identifier_expected);r=He(L.createPropertyAccessChain(r,n,o),t);}break}return r}function hn(){Pe(20);var e=Tt(11,Sn);return Pe(21),e}function bn(){if(0==(131072&O)&&29===De()){ve();var e=Tt(20,Or);if(Pe(31))return e&&function(){switch(ge()){case 20:case 14:case 15:case 24:case 21:case 23:case 58:case 26:case 57:case 34:case 36:case 35:case 37:case 55:case 56:case 60:case 52:case 50:case 51:case 19:case 1:return !0;case 27:case 18:default:return !1}}()?e:void 0}}function xn(){switch(ge()){case 8:case 9:case 10:case 14:return Mt();case 108:case 106:case 104:case 110:case 95:return Ue();case 20:return function(){var e=pe(),t=fe();Pe(20);var r=te(jr);return Pe(21),K(He(L.createParenthesizedExpression(r),e),t)}();case 22:return Tn();case 18:return En();case 131:if(!ke(Mn))break;return kn();case 84:return gi(pe(),fe(),void 0,void 0,225);case 98:return kn();case 103:return function(){var t=pe();if(Pe(103),je(24)){var r=$e();return He(L.createMetaProperty(103,r),t)}for(var n,i,a=pe(),o=xn();;){o=gn(a,o,!1),n=Ne(bn),mn()&&(e.Debug.assert(!!n,"Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'"),o=yn(a,o,void 0,n),n=void 0);break}return 20===ge()?i=hn():n&&ue(t,c.getStartPos(),e.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list),He(L.createNewExpression(o,n,i),t)}();case 43:case 68:if(13===(k=c.reScanSlashToken()))return Mt();break;case 15:return Pt(!1);case 80:return rt()}return Ze(e.Diagnostics.Expression_expected)}function Dn(){return 25===ge()?function(){var e=pe();Pe(25);var t=zr();return He(L.createSpreadElement(t),e)}():27===ge()?He(L.createOmittedExpression(),pe()):zr()}function Sn(){return $(20480,Dn)}function Tn(){var e=pe();Pe(22);var t=c.hasPrecedingLineBreak(),r=Tt(15,Dn);return Pe(23),He(L.createArrayLiteralExpression(r,t),e)}function Cn(){var e=pe(),t=fe();if(Je(25)){var r=zr();return K(He(L.createSpreadAssignment(r),e),t)}var n=li(),i=_i();if(nt(136))return ai(e,t,n,i,171);if(nt(148))return ai(e,t,n,i,172);var a,o=Je(41),s=Ae(),c=tt(),l=Je(57),u=Je(53);if(o||20===ge()||29===ge())return ri(e,t,n,i,o,c,l,u);if(s&&58!==ge()){var _=Je(63),d=_?te(zr):void 0;(a=L.createShorthandPropertyAssignment(c,d)).equalsToken=_;}else {Pe(58);var p=te(zr);a=L.createPropertyAssignment(c,p);}return a.decorators=n,a.modifiers=i,a.questionToken=l,a.exclamationToken=u,K(He(a,e),t)}function En(){var t=pe(),r=c.getTokenPos();Pe(18);var n=c.hasPrecedingLineBreak(),i=Tt(12,Cn,!0);if(!Pe(19)){var a=e.lastOrUndefined(S);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}return He(L.createObjectLiteralExpression(i,n),t)}function kn(){var t=oe();Y(!1);var r=pe(),n=fe(),i=_i();Pe(98);var a=Je(41),o=a?1:0,s=e.some(i,e.isAsyncModifier)?2:0,c=o&&s?ee(40960,Nn):o?ee(8192,Nn):s?re(Nn):Nn(),l=Wt(),u=$t(o|s),_=Yt(58,!1),d=An(o|s);return Y(t),K(He(L.createFunctionExpression(i,a,c,l,u,_,d),r),n)}function Nn(){return Fe()?Ye():void 0}function Fn(t,r){var n=pe(),i=fe(),a=c.getTokenPos();if(Pe(18,r)||t){var o=c.hasPrecedingLineBreak(),s=ht(1,zn);if(!Pe(19)){var l=e.lastOrUndefined(S);l&&l.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(l,e.createDetachedDiagnostic(_,a,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}var u=K(He(L.createBlock(s,o),n),i);return 63===ge()&&(ce(e.Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses),ve()),u}return s=Et(),K(He(L.createBlock(s,void 0),n),i)}function An(e,t){var r=ie();X(!!(1&e));var n=se();Z(!!(2&e));var i=R;R=!1;var a=oe();a&&Y(!1);var o=Fn(!!(16&e),t);return a&&Y(!0),R=i,X(r),Z(n),o}function Pn(e){var t=pe(),r=fe();Pe(245===e?81:86);var n=Ke()?void 0:Ze();return qe(),K(He(245===e?L.createBreakStatement(n):L.createContinueStatement(n),t),r)}function wn(){return 82===ge()?function(){var e=pe();Pe(82);var t=te(jr);Pe(58);var r=ht(3,zn);return He(L.createCaseClause(t,r),e)}():function(){var e=pe();Pe(88),Pe(58);var t=ht(3,zn);return He(L.createDefaultClause(t),e)}()}function In(){return ve(),e.tokenIsIdentifierOrKeyword(ge())&&!c.hasPrecedingLineBreak()}function On(){return ve(),84===ge()&&!c.hasPrecedingLineBreak()}function Mn(){return ve(),98===ge()&&!c.hasPrecedingLineBreak()}function Ln(){return ve(),(e.tokenIsIdentifierOrKeyword(ge())||8===ge()||9===ge()||10===ge())&&!c.hasPrecedingLineBreak()}function Rn(){for(;;)switch(ge()){case 113:case 119:case 85:case 98:case 84:case 92:return !0;case 118:case 151:return ve(),!c.hasPrecedingLineBreak()&&Ae();case 141:case 142:return ve(),!c.hasPrecedingLineBreak()&&(Ae()||10===ge());case 126:case 131:case 135:case 121:case 122:case 123:case 144:if(ve(),c.hasPrecedingLineBreak())return !1;continue;case 156:return ve(),18===ge()||79===ge()||93===ge();case 100:return ve(),10===ge()||41===ge()||18===ge()||e.tokenIsIdentifierOrKeyword(ge());case 93:var t=ve();if(151===t&&(t=ke(ve)),63===t||41===t||18===t||88===t||127===t)return !0;continue;case 124:ve();continue;default:return !1}}function Bn(){return ke(Rn)}function jn(){switch(ge()){case 59:case 26:case 18:case 113:case 119:case 98:case 84:case 92:case 99:case 90:case 115:case 97:case 86:case 81:case 105:case 116:case 107:case 109:case 111:case 87:case 83:case 96:return !0;case 100:return Bn()||ke(lr);case 85:case 93:return Bn();case 131:case 135:case 118:case 141:case 142:case 151:case 156:return !0;case 123:case 121:case 122:case 124:case 144:return Bn()||!ke(In);default:return Br()}}function Jn(){return ve(),Fe()||18===ge()||22===ge()}function zn(){switch(ge()){case 26:return t=pe(),r=fe(),Pe(26),K(He(L.createEmptyStatement(),t),r);case 18:return Fn(!1);case 113:return ei(pe(),fe(),void 0,void 0);case 119:if(ke(Jn))return ei(pe(),fe(),void 0,void 0);break;case 98:return ti(pe(),fe(),void 0,void 0);case 84:return fi(pe(),fe(),void 0,void 0);case 99:return function(){var e=pe(),t=fe();Pe(99),Pe(20);var r=te(jr);Pe(21);var n=zn(),i=je(91)?zn():void 0;return K(He(L.createIfStatement(r,n,i),e),t)}();case 90:return function(){var e=pe(),t=fe();Pe(90);var r=zn();Pe(115),Pe(20);var n=te(jr);return Pe(21),je(26),K(He(L.createDoStatement(r,n),e),t)}();case 115:return function(){var e=pe(),t=fe();Pe(115),Pe(20);var r=te(jr);Pe(21);var n=zn();return K(He(L.createWhileStatement(r,n),e),t)}();case 97:return function(){var e=pe(),t=fe();Pe(97);var r,n,i=Je(132);if(Pe(20),26!==ge()&&(r=113===ge()||119===ge()||85===ge()?Zn(!0):ee(4096,jr)),i?Pe(159):je(159)){var a=te(zr);Pe(21),n=L.createForOfStatement(i,r,a,zn());}else if(je(101))a=te(jr),Pe(21),n=L.createForInStatement(r,a,zn());else {Pe(26);var o=26!==ge()&&21!==ge()?te(jr):void 0;Pe(26);var s=21!==ge()?te(jr):void 0;Pe(21),n=L.createForStatement(r,o,s,zn());}return K(He(n,e),t)}();case 86:return Pn(244);case 81:return Pn(245);case 105:return function(){var e=pe(),t=fe();Pe(105);var r=Ke()?void 0:te(jr);return qe(),K(He(L.createReturnStatement(r),e),t)}();case 116:return function(){var e=pe(),t=fe();Pe(116),Pe(20);var r=te(jr);Pe(21);var n=ee(16777216,zn);return K(He(L.createWithStatement(r,n),e),t)}();case 107:return function(){var e=pe(),t=fe();Pe(107),Pe(20);var r=te(jr);Pe(21);var n=function(){var e=pe();Pe(18);var t=ht(2,wn);return Pe(19),He(L.createCaseBlock(t),e)}();return K(He(L.createSwitchStatement(r,n),e),t)}();case 109:return function(){var e=pe(),t=fe();Pe(109);var r=c.hasPrecedingLineBreak()?void 0:te(jr);return void 0===r&&(P++,r=He(L.createIdentifier(""),pe())),Ve()||Le(r),K(He(L.createThrowStatement(r),e),t)}();case 111:case 83:case 96:return function(){var e=pe(),t=fe();Pe(111);var r,n=Fn(!1),i=83===ge()?function(){var e,t=pe();Pe(83),je(20)?(e=Yn(),Pe(21)):e=void 0;var r=Fn(!1);return He(L.createCatchClause(e,r),t)}():void 0;return i&&96!==ge()||(Pe(96),r=Fn(!1)),K(He(L.createTryStatement(n,i,r),e),t)}();case 87:return function(){var e=pe(),t=fe();return Pe(87),qe(),K(He(L.createDebuggerStatement(),e),t)}();case 59:return Kn();case 131:case 118:case 151:case 141:case 142:case 135:case 85:case 92:case 93:case 100:case 121:case 122:case 123:case 126:case 124:case 144:case 156:if(Bn())return Kn()}var t,r;return function(){var t,r=pe(),n=fe(),i=20===ge(),a=te(jr);return e.isIdentifier(a)&&je(58)?t=L.createLabeledStatement(a,zn()):(Ve()||Le(a),t=L.createExpressionStatement(a),i&&(n=!1)),K(He(t,r),n)}()}function Un(e){return 135===e.kind}function Kn(){var t=e.some(ke((function(){return li(),_i()})),Un);if(t){var r=ee(8388608,(function(){var e=xt(w);if(e)return Dt(e)}));if(r)return r}var n=pe(),i=fe(),a=li(),o=_i();if(t){for(var s=0,c=o;s<c.length;s++)c[s].flags|=8388608;return ee(8388608,(function(){return Vn(n,i,a,o)}))}return Vn(n,i,a,o)}function Vn(t,r,n,i){switch(ge()){case 113:case 119:case 85:return ei(t,r,n,i);case 98:return ti(t,r,n,i);case 84:return fi(t,r,n,i);case 118:return function(e,t,r,n){Pe(118);var i=Ze(),a=Wt(),o=mi(),s=ur();return K(He(L.createInterfaceDeclaration(r,n,i,a,o,s),e),t)}(t,r,n,i);case 151:return function(e,t,r,n){Pe(151);var i=Ze(),a=Wt();Pe(63);var o=138===ge()&&Ne(yr)||Or();return qe(),K(He(L.createTypeAliasDeclaration(r,n,i,a,o),e),t)}(t,r,n,i);case 92:return function(e,t,r,n){Pe(92);var i,a=Ze();return Pe(18)?(i=$(40960,(function(){return Tt(6,xi)})),Pe(19)):i=Et(),K(He(L.createEnumDeclaration(r,n,a,i),e),t)}(t,r,n,i);case 156:case 141:case 142:return function(e,t,r,n){var i=0;if(156===ge())return Ti(e,t,r,n);if(je(142))i|=16;else if(Pe(141),10===ge())return Ti(e,t,r,n);return Si(e,t,r,n,i)}(t,r,n,i);case 100:return function(e,t,r,n){Pe(100);var i,a=c.getStartPos();Ae()&&(i=Ze());var o,s=!1;if(155===ge()||"type"!==(null==i?void 0:i.escapedText)||!Ae()&&41!==ge()&&18!==ge()||(s=!0,i=Ae()?Ze():void 0),i&&27!==ge()&&155!==ge())return function(e,t,r,n,i,a){Pe(63);var o=145===ge()&&ke(Ci)?function(){var e=pe();Pe(145),Pe(20);var t=Ai();return Pe(21),He(L.createExternalModuleReference(t),e)}():Nt(!1);return qe(),K(He(L.createImportEqualsDeclaration(r,n,a,i,o),e),t)}(e,t,r,n,i,s);(i||41===ge()||18===ge())&&(o=function(e,t,r){var n;return e&&!je(27)||(n=41===ge()?function(){var e=pe();Pe(41),Pe(127);var t=Ze();return He(L.createNamespaceImport(t),e)}():Pi(268)),He(L.createImportClause(r,e,n),t)}(i,a,s),Pe(155));var l,u=Ai();return 129!==ge()||c.hasPrecedingLineBreak()||(l=Fi()),qe(),K(He(L.createImportDeclaration(r,n,o,u,l),e),t)}(t,r,n,i);case 93:switch(ve(),ge()){case 88:case 63:return function(e,t,r,n){var i,a=se();Z(!0),je(63)?i=!0:Pe(88);var o=zr();return qe(),Z(a),K(He(L.createExportAssignment(r,n,i,o),e),t)}(t,r,n,i);case 127:return function(e,t,r,n){Pe(127),Pe(142);var i=Ze();qe();var a=L.createNamespaceExportDeclaration(i);return a.decorators=r,a.modifiers=n,K(He(a,e),t)}(t,r,n,i);default:return function(e,t,r,n){var i,a,o,s=se();Z(!0);var l=je(151),u=pe();return je(41)?(je(127)&&(i=function(e){return He(L.createNamespaceExport($e()),e)}(u)),Pe(155),a=Ai()):(i=Pi(272),(155===ge()||10===ge()&&!c.hasPrecedingLineBreak())&&(Pe(155),a=Ai())),a&&129===ge()&&!c.hasPrecedingLineBreak()&&(o=Fi()),qe(),Z(s),K(He(L.createExportDeclaration(r,n,l,i,a,o),e),t)}(t,r,n,i)}default:if(n||i){var a=Ge(275,!0,e.Diagnostics.Declaration_expected);return e.setTextRangePos(a,t),a.decorators=n,a.modifiers=i,a}return}}function qn(e,t){if(18===ge()||!Ke())return An(e,t);qe();}function Wn(){var e=pe();if(27===ge())return He(L.createOmittedExpression(),e);var t=Je(25),r=Qn(),n=Jr();return He(L.createBindingElement(t,void 0,r,n),e)}function Hn(){var e,t=pe(),r=Je(25),n=Fe(),i=tt();n&&58!==ge()?(e=i,i=void 0):(Pe(58),e=Qn());var a=Jr();return He(L.createBindingElement(r,i,e,a),t)}function Gn(){return 18===ge()||22===ge()||80===ge()||Fe()}function Qn(e){return 22===ge()?function(){var e=pe();Pe(22);var t=Tt(10,Wn);return Pe(23),He(L.createArrayBindingPattern(t),e)}():18===ge()?function(){var e=pe();Pe(18);var t=Tt(9,Hn);return Pe(19),He(L.createObjectBindingPattern(t),e)}():Ye(e)}function Xn(){return Yn(!0)}function Yn(t){var r,n=pe(),i=fe(),a=Qn(e.Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations);t&&79===a.kind&&53===ge()&&!c.hasPrecedingLineBreak()&&(r=Ue());var o=Lr(),s=Qr(ge())?void 0:Jr();return K(He(L.createVariableDeclaration(a,r,o,s),n),i)}function Zn(t){var r,n=pe(),i=0;switch(ge()){case 113:break;case 119:i|=1;break;case 85:i|=2;break;default:e.Debug.fail();}if(ve(),159===ge()&&ke($n))r=Et();else {var a=ae();Q(t),r=Tt(8,t?Yn:Xn),Q(a);}return He(L.createVariableDeclarationList(r,i),n)}function $n(){return dt()&&21===ve()}function ei(e,t,r,n){var i=Zn(!1);qe();var a=L.createVariableStatement(n,i);return a.decorators=r,K(He(a,e),t)}function ti(t,r,n,i){var a=se(),o=e.modifiersToFlags(i);Pe(98);var s=Je(41),c=512&o?Nn():Ye(),l=s?1:0,u=256&o?2:0,_=Wt();1&o&&Z(!0);var d=$t(l|u),p=Yt(58,!1),f=qn(l|u,e.Diagnostics.or_expected);return Z(a),K(He(L.createFunctionDeclaration(n,i,s,c,_,d,p,f),t),r)}function ri(t,r,n,i,a,o,s,c,l){var u=a?1:0,_=e.some(i,e.isAsyncModifier)?2:0,d=Wt(),p=$t(u|_),f=Yt(58,!1),g=qn(u|_,l),m=L.createMethodDeclaration(n,i,a,o,s,d,p,f,g);return m.exclamationToken=c,K(He(m,t),r)}function ni(t,r,n,i,a,o){var s=o||c.hasPrecedingLineBreak()?void 0:Je(53),l=Lr(),u=$(45056,Jr);return function(t,r,n){if(59!==ge()||c.hasPrecedingLineBreak())return 20===ge()?(ce(e.Diagnostics.Cannot_start_a_function_call_in_a_type_annotation),void ve()):void(!r||Ke()?Ve()||(n?18===ge()&&ce(e.Diagnostics._0_expected,e.tokenToString(26)):Le(t)):n?ce(e.Diagnostics._0_expected,e.tokenToString(26)):ce(e.Diagnostics.Expected_for_property_initializer));ce(e.Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations);}(a,l,u),K(He(L.createPropertyDeclaration(n,i,a,o||s,l,u),t),r)}function ii(t,r,n,i){var a=Je(41),o=tt(),s=Je(57);return a||20===ge()||29===ge()?ri(t,r,n,i,a,o,s,void 0,e.Diagnostics.or_expected):ni(t,r,n,i,o,s)}function ai(e,t,r,n,i){var a=tt(),o=Wt(),s=$t(0),c=Yt(58,!1),l=qn(0),u=171===i?L.createGetAccessorDeclaration(r,n,a,s,c,l):L.createSetAccessorDeclaration(r,n,a,s,l);return u.typeParameters=o,c&&172===u.kind&&(u.type=c),K(He(u,e),t)}function oi(){var t;if(59===ge())return !0;for(;e.isModifierKind(ge());){if(t=ge(),e.isClassMemberModifier(t))return !0;ve();}if(41===ge())return !0;if(et()&&(t=ge(),ve()),22===ge())return !0;if(void 0!==t){if(!e.isKeyword(t)||148===t||136===t)return !0;switch(ge()){case 20:case 29:case 53:case 58:case 63:case 57:return !0;default:return Ke()}}return !1}function si(){if(se()&&132===ge()){var t=pe(),r=Ze(e.Diagnostics.Expression_expected);return ve(),vn(t,gn(t,r,!0))}return rn()}function ci(){var e=pe();if(je(59)){var t=ee(16384,si);return He(L.createDecorator(t),e)}}function li(){for(var t,r,n=pe();r=ci();)t=e.append(t,r);return t&&We(t,n)}function ui(t,r,n){var i=pe(),a=ge();if(85===ge()&&t){if(!Ne(it))return}else {if(r&&124===ge()&&ke(Ei))return;if(n&&124===ge())return;if(!e.isModifierKind(ge())||!Ne(at))return}return He(L.createToken(a),i)}function _i(t,r){for(var n,i,a=pe(),o=!1;i=ui(t,r,o);)124===i.kind&&(o=!0),n=e.append(n,i);return n&&We(n,a)}function di(){var e;if(131===ge()){var t=pe();ve(),e=We([He(L.createToken(131),t)],t);}return e}function pi(){var t=pe();if(26===ge())return ve(),He(L.createSemicolonClassElement(),t);var r=fe(),n=li(),i=_i(!0,!0);if(124===ge()&&ke(Ei))return function(e,t,r,n){ze(124);var i=function(){var e=ie(),t=se();X(!1),Z(!0);var r=Fn(!1);return X(e),Z(t),r}();return K(He(L.createClassStaticBlockDeclaration(r,n,i),e),t)}(t,r,n,i);if(nt(136))return ai(t,r,n,i,171);if(nt(148))return ai(t,r,n,i,172);if(134===ge()||10===ge()){var a=function(t,r,n,i){return Ne((function(){if(134===ge()?Pe(134):10===ge()&&20===ke(ve)?Ne((function(){var e=Mt();return "constructor"===e.text?e:void 0})):void 0){var a=Wt(),o=$t(0),s=Yt(58,!1),c=qn(0,e.Diagnostics.or_expected),l=L.createConstructorDeclaration(n,i,o,c);return l.typeParameters=a,l.type=s,K(He(l,t),r)}}))}(t,r,n,i);if(a)return a}if(rr())return ir(t,r,n,i);if(e.tokenIsIdentifierOrKeyword(ge())||10===ge()||8===ge()||41===ge()||22===ge()){if(e.some(i,Un)){for(var o=0,s=i;o<s.length;o++)s[o].flags|=8388608;return ee(8388608,(function(){return ii(t,r,n,i)}))}return ii(t,r,n,i)}if(n||i){var c=Ge(79,!0,e.Diagnostics.Declaration_expected);return ni(t,r,n,i,c,void 0)}return e.Debug.fail("Should not have attempted to parse class member declaration.")}function fi(e,t,r,n){return gi(e,t,r,n,256)}function gi(t,r,n,i,a){var o=se();Pe(84);var s=!Fe()||117===ge()&&ke(pt)?void 0:Xe(Fe()),c=Wt();e.some(i,e.isExportModifier)&&Z(!0);var l,u=mi();return Pe(18)?(l=ht(5,pi),Pe(19)):l=Et(),Z(o),K(He(256===a?L.createClassDeclaration(n,i,s,c,u,l):L.createClassExpression(n,i,s,c,u,l),t),r)}function mi(){if(bi())return ht(22,yi)}function yi(){var t=pe(),r=ge();e.Debug.assert(94===r||117===r),ve();var n=Tt(7,vi);return He(L.createHeritageClause(r,n),t)}function vi(){var e=pe(),t=rn(),r=hi();return He(L.createExpressionWithTypeArguments(t,r),e)}function hi(){return 29===ge()?kt(20,Or,29,31):void 0}function bi(){return 94===ge()||117===ge()}function xi(){var e=pe(),t=fe(),r=tt(),n=te(Jr);return K(He(L.createEnumMember(r,n),e),t)}function Di(){var e,t=pe();return Pe(18)?(e=ht(1,zn),Pe(19)):e=Et(),He(L.createModuleBlock(e),t)}function Si(e,t,r,n,i){var a=16&i,o=Ze(),s=je(24)?Si(pe(),!1,void 0,void 0,4|a):Di();return K(He(L.createModuleDeclaration(r,n,o,s,i),e),t)}function Ti(e,t,r,n){var i,a,o=0;return 156===ge()?(i=Ze(),o|=1024):(i=Mt()).text=Qe(i.text),18===ge()?a=Di():qe(),K(He(L.createModuleDeclaration(r,n,i,a,o),e),t)}function Ci(){return 20===ve()}function Ei(){return 18===ve()}function ki(){return 43===ve()}function Ni(){var t=pe(),r=e.tokenIsIdentifierOrKeyword(ge())?$e():Rt(10);Pe(58);var n=Rt(10);return He(L.createAssertEntry(r,n),t)}function Fi(){var t=pe();Pe(129);var r=c.getTokenPos();if(Pe(18)){var n=c.hasPrecedingLineBreak(),i=Tt(24,Ni,!0);if(!Pe(19)){var a=e.lastOrUndefined(S);a&&a.code===e.Diagnostics._0_expected.code&&e.addRelatedInfo(a,e.createDetachedDiagnostic(_,r,1,e.Diagnostics.The_parser_expected_to_find_a_to_match_the_token_here));}return He(L.createAssertClause(i,n),t)}return i=We([],pe(),void 0,!1),He(L.createAssertClause(i,!1),t)}function Ai(){if(10===ge()){var e=Mt();return e.text=Qe(e.text),e}return jr()}function Pi(e){var t=pe();return He(268===e?L.createNamedImports(kt(23,Ii,18,19)):L.createNamedExports(kt(23,wi,18,19)),t)}function wi(){return Oi(274)}function Ii(){return Oi(269)}function Oi(t){var r,n=pe(),i=e.isKeyword(ge())&&!Ae(),a=c.getTokenPos(),o=c.getTextPos(),s=!1,l=!0,u=$e();if("type"===u.escapedText)if(127===ge()){var _=$e();if(127===ge()){var d=$e();e.tokenIsIdentifierOrKeyword(ge())?(s=!0,r=_,u=p(),l=!1):(r=u,u=d,l=!1);}else e.tokenIsIdentifierOrKeyword(ge())?(r=u,l=!1,u=p()):(s=!0,u=_);}else e.tokenIsIdentifierOrKeyword(ge())&&(s=!0,u=p());return l&&127===ge()&&(r=u,Pe(127),u=p()),269===t&&i&&ue(a,o,e.Diagnostics.Identifier_expected),He(269===t?L.createImportSpecifier(s,r,u):L.createExportSpecifier(s,r,u),n);function p(){return i=e.isKeyword(ge())&&!Ae(),a=c.getTokenPos(),o=c.getTextPos(),$e()}}function Mi(t){return function(t,r){return e.some(t.modifiers,(function(e){return 93===e.kind}))}(t)||e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)||e.isImportDeclaration(t)||e.isExportAssignment(t)||e.isExportDeclaration(t)?t:void 0}function Li(t){return function(t){return e.isMetaProperty(t)&&100===t.keywordToken&&"meta"===t.name.escapedText}(t)?t:f(t,Li)}!function(e){e[e.SourceElements=0]="SourceElements",e[e.BlockStatements=1]="BlockStatements",e[e.SwitchClauses=2]="SwitchClauses",e[e.SwitchClauseStatements=3]="SwitchClauseStatements",e[e.TypeMembers=4]="TypeMembers",e[e.ClassMembers=5]="ClassMembers",e[e.EnumMembers=6]="EnumMembers",e[e.HeritageClauseElement=7]="HeritageClauseElement",e[e.VariableDeclarations=8]="VariableDeclarations",e[e.ObjectBindingElements=9]="ObjectBindingElements",e[e.ArrayBindingElements=10]="ArrayBindingElements",e[e.ArgumentExpressions=11]="ArgumentExpressions",e[e.ObjectLiteralMembers=12]="ObjectLiteralMembers",e[e.JsxAttributes=13]="JsxAttributes",e[e.JsxChildren=14]="JsxChildren",e[e.ArrayLiteralMembers=15]="ArrayLiteralMembers",e[e.Parameters=16]="Parameters",e[e.JSDocParameters=17]="JSDocParameters",e[e.RestProperties=18]="RestProperties",e[e.TypeParameters=19]="TypeParameters",e[e.TypeArguments=20]="TypeArguments",e[e.TupleElementTypes=21]="TupleElementTypes",e[e.HeritageClauses=22]="HeritageClauses",e[e.ImportOrExportSpecifiers=23]="ImportOrExportSpecifiers",e[e.AssertEntries=24]="AssertEntries",e[e.Count=25]="Count";}(we||(we={})),function(e){e[e.False=0]="False",e[e.True=1]="True",e[e.Unknown=2]="Unknown";}(Ie||(Ie={})),function(t){function r(e){var t=pe(),r=(e?je:Pe)(18),n=ee(4194304,Vt);e&&!r||Be(19);var i=L.createJSDocTypeExpression(n);return W(i),He(i,t)}function n(){for(var e=pe(),t=je(18),r=pe(),n=Nt(!1);80===ge();)Se(),he(),n=He(L.createJSDocMemberName(n,Ze()),r);t&&Be(19);var i=L.createJSDocNameReference(n);return W(i),He(i,e)}var i,a;function o(t,i){void 0===t&&(t=0);var a=g,o=void 0===i?a.length:t+i;if(i=o-t,e.Debug.assert(t>=0),e.Debug.assert(t<=o),e.Debug.assert(o<=a.length),p(a,t)){var s,l,u,d,f,m=[],y=[];return c.scanRange(t+3,i-5,(function(){var r,n,i=1,_=t-(a.lastIndexOf("\n",t)+1)+4;function p(e){r||(r=_),m.push(e),_+=e.length;}for(he();W(5););W(4)&&(i=0,_=0);e:for(;;){switch(ge()){case 59:0===i||1===i?(h(m),f||(f=pe()),(n=T(_))&&(s?s.push(n):(s=[n],l=n.pos),u=n.end),i=0,r=void 0):p(c.getTokenText());break;case 4:m.push(c.getTokenText()),i=0,_=0;break;case 41:var g=c.getTokenText();1===i||2===i?(i=2,p(g)):(i=1,_+=g.length);break;case 5:var b=c.getTokenText();2===i?m.push(b):void 0!==r&&_+b.length>r&&m.push(b.slice(r-_)),_+=b.length;break;case 1:break e;case 18:i=2;var x=c.getStartPos(),D=N(c.getTextPos()-1);if(D){d||v(m),y.push(He(L.createJSDocText(m.join("")),null!=d?d:t,x)),y.push(D),m=[],d=c.getTextPos();break}default:i=2,p(c.getTokenText());}he();}h(m),y.length&&m.length&&y.push(He(L.createJSDocText(m.join("")),null!=d?d:t,f)),y.length&&s&&e.Debug.assertIsDefined(f,"having parsed tags implies that the end of the comment span should be set");var S=s&&We(s,l,u);return He(L.createJSDocComment(y.length?We(y,t,f):m.length?m.join(""):void 0,S),t,o)}))}function v(e){for(;e.length&&("\n"===e[0]||"\r"===e[0]);)e.shift();}function h(e){for(;e.length&&""===e[e.length-1].trim();)e.pop();}function b(){for(;;){if(he(),1===ge())return !0;if(5!==ge()&&4!==ge())return !1}}function x(){if(5!==ge()&&4!==ge()||!ke(b))for(;5===ge()||4===ge();)he();}function D(){if((5===ge()||4===ge())&&ke(b))return "";for(var e=c.hasPrecedingLineBreak(),t=!1,r="";e&&41===ge()||5===ge()||4===ge();)r+=c.getTokenText(),4===ge()?(e=!0,t=!0,r=""):41===ge()&&(e=!1),he();return t?r:""}function T(t){e.Debug.assert(59===ge());var i=c.getTokenPos();he();var a,o=H(void 0),l=D();switch(o.escapedText){case"author":a=function(t,r,n,i){var a=pe(),o=function(){for(var e=[],t=!1,r=c.getToken();1!==r&&4!==r;){if(29===r)t=!0;else {if(59===r&&!t)break;if(31===r&&t){e.push(c.getTokenText()),c.setTextPos(c.getTokenPos()+1);break}}e.push(c.getTokenText()),r=he();}return L.createJSDocText(e.join(""))}(),s=c.getStartPos(),l=C(t,s,n,i);l||(s=c.getStartPos());var u="string"!=typeof l?We(e.concatenate([He(o,a,s)],l),a):o.text+l;return He(L.createJSDocAuthorTag(r,u),t)}(i,o,t,l);break;case"implements":a=function(e,t,r,n){var i=R();return He(L.createJSDocImplementsTag(t,i,C(e,pe(),r,n)),e)}(i,o,t,l);break;case"augments":case"extends":a=function(e,t,r,n){var i=R();return He(L.createJSDocAugmentsTag(t,i,C(e,pe(),r,n)),e)}(i,o,t,l);break;case"class":case"constructor":a=B(i,L.createJSDocClassTag,o,t,l);break;case"public":a=B(i,L.createJSDocPublicTag,o,t,l);break;case"private":a=B(i,L.createJSDocPrivateTag,o,t,l);break;case"protected":a=B(i,L.createJSDocProtectedTag,o,t,l);break;case"readonly":a=B(i,L.createJSDocReadonlyTag,o,t,l);break;case"override":a=B(i,L.createJSDocOverrideTag,o,t,l);break;case"deprecated":V=!0,a=B(i,L.createJSDocDeprecatedTag,o,t,l);break;case"this":a=function(e,t,n,i){var a=r(!0);return x(),He(L.createJSDocThisTag(t,a,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"enum":a=function(e,t,n,i){var a=r(!0);return x(),He(L.createJSDocEnumTag(t,a,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"arg":case"argument":case"param":return O(i,o,2,t);case"return":case"returns":a=function(t,r,n,i){e.some(s,e.isJSDocReturnTag)&&ue(r.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,r.escapedText);var a=A();return He(L.createJSDocReturnTag(r,a,C(t,pe(),n,i)),t)}(i,o,t,l);break;case"template":a=function(e,t,n,i){var a=18===ge()?r():void 0,o=function(){var e=pe(),t=[];do{x();var r=q();void 0!==r&&t.push(r),D();}while(W(27));return We(t,e)}();return He(L.createJSDocTemplateTag(t,a,o,C(e,pe(),n,i)),e)}(i,o,t,l);break;case"type":a=M(i,o,t,l);break;case"typedef":a=function(t,r,n,i){var a,o=A();D();var s=j();x();var c,l=E(n);if(!o||I(o.type)){for(var u=void 0,d=void 0,p=void 0,f=!1;u=Ne((function(){return z(n)}));)if(f=!0,341===u.kind){if(d){ce(e.Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);var g=e.lastOrUndefined(S);g&&e.addRelatedInfo(g,e.createDetachedDiagnostic(_,0,0,e.Diagnostics.The_tag_was_first_specified_here));break}d=u;}else p=e.append(p,u);if(f){var m=o&&182===o.type.kind,y=L.createJSDocTypeLiteral(p,m);c=(o=d&&d.typeExpression&&!I(d.typeExpression.type)?d.typeExpression:He(y,t)).end;}}return c=c||void 0!==l?pe():(null!==(a=null!=s?s:o)&&void 0!==a?a:r).end,l||(l=C(t,c,n,i)),He(L.createJSDocTypedefTag(r,o,s,l),t,c)}(i,o,t,l);break;case"callback":a=function(t,r,n,i){var a=j();x();var o=E(n),s=function(t){for(var r,n,i=pe();r=Ne((function(){return U(4,t)}));)n=e.append(n,r);return We(n||[],i)}(n),c=Ne((function(){if(W(59)){var e=T(n);if(e&&339===e.kind)return e}})),l=He(L.createJSDocSignature(void 0,s,c),t);return o||(o=C(t,pe(),n,i)),He(L.createJSDocCallbackTag(r,l,a,o),t)}(i,o,t,l);break;case"see":a=function(t,r,i,a){var o=22===ge()||ke((function(){return 59===he()&&e.tokenIsIdentifierOrKeyword(he())&&"link"===c.getTokenValue()}))?void 0:n(),s=void 0!==i&&void 0!==a?C(t,pe(),i,a):void 0;return He(L.createJSDocSeeTag(r,o,s),t)}(i,o,t,l);break;default:a=function(e,t,r,n){return He(L.createJSDocUnknownTag(t,C(e,pe(),r,n)),e)}(i,o,t,l);}return a}function C(e,t,r,n){return n||(r+=t-e),E(r,n.slice(r))}function E(e,t){var r,n,i=pe(),a=[],o=[],s=0,l=!0;function u(t){n||(n=e),a.push(t),e+=t.length;}void 0!==t&&(""!==t&&u(t),s=1);var _=ge();e:for(;;){switch(_){case 4:s=0,a.push(c.getTokenText()),e=0;break;case 59:if(3===s||2===s&&(!l||ke(k))){a.push(c.getTokenText());break}c.setTextPos(c.getTextPos()-1);case 1:break e;case 5:if(2===s||3===s)u(c.getTokenText());else {var d=c.getTokenText();void 0!==n&&e+d.length>n&&a.push(d.slice(n-e)),e+=d.length;}break;case 18:s=2;var p=c.getStartPos(),f=N(c.getTextPos()-1);f?(o.push(He(L.createJSDocText(a.join("")),null!=r?r:i,p)),o.push(f),a=[],r=c.getTextPos()):u(c.getTokenText());break;case 61:s=3===s?2:3,u(c.getTokenText());break;case 41:if(0===s){s=1,e+=1;break}default:3!==s&&(s=2),u(c.getTokenText());}l=5===ge(),_=he();}return v(a),h(a),o.length?(a.length&&o.push(He(L.createJSDocText(a.join("")),null!=r?r:i)),We(o,i,c.getTextPos())):a.length?a.join(""):void 0}function k(){var e=he();return 5===e||4===e}function N(t){var r=Ne(F);if(r){he(),x();var n=pe(),i=e.tokenIsIdentifierOrKeyword(ge())?Nt(!0):void 0;if(i)for(;80===ge();)Se(),he(),i=He(L.createJSDocMemberName(i,Ze()),n);for(var a=[];19!==ge()&&4!==ge()&&1!==ge();)a.push(c.getTokenText()),he();return He(("link"===r?L.createJSDocLink:"linkcode"===r?L.createJSDocLinkCode:L.createJSDocLinkPlain)(i,a.join("")),t,c.getTextPos())}}function F(){if(D(),18===ge()&&59===he()&&e.tokenIsIdentifierOrKeyword(he())){var t=c.getTokenValue();if("link"===t||"linkcode"===t||"linkplain"===t)return t}}function A(){return D(),18===ge()?r():void 0}function w(){var t=W(22);t&&x();var r=W(61),n=function(){var e=H();for(je(22)&&Pe(23);je(24);){var t=H();je(22)&&Pe(23),e=Ft(e,t);}return e}();return r&&(function(e){if(ge()===e)return t=pe(),r=ge(),he(),He(L.createToken(r),t);var t,r;}(61)||Ge(61,!1,e.Diagnostics._0_expected,e.tokenToString(61))),t&&(x(),Je(63)&&jr(),Pe(23)),{name:n,isBracketed:t}}function I(t){switch(t.kind){case 147:return !0;case 182:return I(t.elementType);default:return e.isTypeReferenceNode(t)&&e.isIdentifier(t.typeName)&&"Object"===t.typeName.escapedText&&!t.typeArguments}}function O(t,r,n,i){var a=A(),o=!a;D();var s=w(),c=s.name,l=s.isBracketed,u=D();o&&!ke(F)&&(a=A());var _=C(t,pe(),i,u),d=4!==n&&function(t,r,n,i){if(t&&I(t.type)){for(var a=pe(),o=void 0,s=void 0;o=Ne((function(){return U(n,i,r)}));)338!==o.kind&&345!==o.kind||(s=e.append(s,o));if(s){var c=He(L.createJSDocTypeLiteral(s,182===t.type.kind),a);return He(L.createJSDocTypeExpression(c),a)}}}(a,c,n,i);return d&&(a=d,o=!0),He(1===n?L.createJSDocPropertyTag(r,c,l,a,o,_):L.createJSDocParameterTag(r,c,l,a,o,_),t)}function M(t,n,i,a){e.some(s,e.isJSDocTypeTag)&&ue(n.pos,c.getTokenPos(),e.Diagnostics._0_tag_already_specified,n.escapedText);var o=r(!0),l=void 0!==i&&void 0!==a?C(t,pe(),i,a):void 0;return He(L.createJSDocTypeTag(n,o,l),t)}function R(){var e=je(18),t=pe(),r=function(){for(var e=pe(),t=H();je(24);){var r=H();t=He(L.createPropertyAccessExpression(t,r),e);}return t}(),n=hi(),i=He(L.createExpressionWithTypeArguments(r,n),t);return e&&Pe(19),i}function B(e,t,r,n,i){return He(t(r,C(e,pe(),n,i)),e)}function j(t){var r=c.getTokenPos();if(e.tokenIsIdentifierOrKeyword(ge())){var n=H();if(je(24)){var i=j(!0);return He(L.createModuleDeclaration(void 0,void 0,n,i,t?4:void 0),r)}return t&&(n.isInJSDocNamespace=!0),n}}function J(t,r){for(;!e.isIdentifier(t)||!e.isIdentifier(r);){if(e.isIdentifier(t)||e.isIdentifier(r)||t.right.escapedText!==r.right.escapedText)return !1;t=t.left,r=r.left;}return t.escapedText===r.escapedText}function z(e){return U(1,e)}function U(t,r,n){for(var i=!0,a=!1;;)switch(he()){case 59:if(i){var o=K(t,r);return !(o&&(338===o.kind||345===o.kind)&&4!==t&&n&&(e.isIdentifier(o.name)||!J(n,o.name.left)))&&o}a=!1;break;case 4:i=!0,a=!1;break;case 41:a&&(i=!1),a=!0;break;case 79:i=!1;break;case 1:return !1}}function K(t,r){e.Debug.assert(59===ge());var n=c.getStartPos();he();var i,a=H();switch(x(),a.escapedText){case"type":return 1===t&&M(n,a);case"prop":case"property":i=1;break;case"arg":case"argument":case"param":i=6;break;default:return !1}return !!(t&i)&&O(n,a,t,r)}function q(){var t=pe(),r=W(22);r&&x();var n,i=H(e.Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces);if(r&&(x(),Pe(63),n=ee(4194304,Vt),Pe(23)),!e.nodeIsMissing(i))return He(L.createTypeParameterDeclaration(i,void 0,n),t)}function W(e){return ge()===e&&(he(),!0)}function H(t){if(!e.tokenIsIdentifierOrKeyword(ge()))return Ge(79,!t,t||e.Diagnostics.Identifier_expected);P++;var r=c.getTokenPos(),n=c.getTextPos(),i=ge(),a=Qe(c.getTokenValue()),o=He(L.createIdentifier(a,void 0,i),r,n);return he(),o}}t.parseJSDocTypeExpressionForTests=function(t,n,i){J("file.js",t,99,void 0,1),c.setText(t,n,i),k=c.scan();var a=r(),o=H("file.js",99,1,!1,[],L.createToken(1),0),s=e.attachFileToDiagnostics(S,o);return T&&(o.jsDocDiagnostics=e.attachFileToDiagnostics(T,o)),z(),a?{jsDocTypeExpression:a,diagnostics:s}:void 0},t.parseJSDocTypeExpression=r,t.parseJSDocNameReference=n,t.parseIsolatedJSDocComment=function(t,r,n){J("",t,99,void 0,1);var i=ee(4194304,(function(){return o(r,n)})),a={languageVariant:0,text:t},s=e.attachFileToDiagnostics(S,a);return z(),i?{jsDoc:i,diagnostics:s}:void 0},t.parseJSDocComment=function(t,r,n){var i=k,a=S.length,s=B,c=ee(4194304,(function(){return o(r,n)}));return e.setParent(c,t),131072&O&&(T||(T=[]),T.push.apply(T,S)),k=i,S.length=a,B=s,c},function(e){e[e.BeginningOfLine=0]="BeginningOfLine",e[e.SawAsterisk=1]="SawAsterisk",e[e.SavingComments=2]="SavingComments",e[e.SavingBackticks=3]="SavingBackticks";}(i||(i={})),function(e){e[e.Property=1]="Property",e[e.Parameter=2]="Parameter",e[e.CallbackParameter=4]="CallbackParameter";}(a||(a={}));}(Oe=t.JSDocParser||(t.JSDocParser={}));}(l||(l={})),function(t){function r(t,r,i,o,s,c){return void(r?u(t):l(t));function l(t){var r="";if(c&&n(t)&&(r=o.substring(t.pos,t.end)),t._children&&(t._children=void 0),e.setTextRangePosEnd(t,t.pos+i,t.end+i),c&&n(t)&&e.Debug.assert(r===s.substring(t.pos,t.end)),f(t,l,u),e.hasJSDocNodes(t))for(var _=0,d=t.jsDoc;_<d.length;_++)l(d[_]);a(t,c);}function u(t){t._children=void 0,e.setTextRangePosEnd(t,t.pos+i,t.end+i);for(var r=0,n=t;r<n.length;r++)l(n[r]);}}function n(e){switch(e.kind){case 10:case 8:case 79:return !0}return !1}function i(t,r,n,i,a){e.Debug.assert(t.end>=r,"Adjusting an element that was entirely before the change range"),e.Debug.assert(t.pos<=n,"Adjusting an element that was entirely after the change range"),e.Debug.assert(t.pos<=t.end);var o=Math.min(t.pos,i),s=t.end>=n?t.end+a:Math.min(t.end,i);e.Debug.assert(o<=s),t.parent&&(e.Debug.assertGreaterThanOrEqual(o,t.parent.pos),e.Debug.assertLessThanOrEqual(s,t.parent.end)),e.setTextRangePosEnd(t,o,s);}function a(t,r){if(r){var n=t.pos,i=function(t){e.Debug.assert(t.pos>=n),n=t.end;};if(e.hasJSDocNodes(t))for(var a=0,o=t.jsDoc;a<o.length;a++)i(o[a]);f(t,i),e.Debug.assert(n<=t.end);}}function o(t,r){var n,i=t;if(f(t,(function t(a){if(!e.nodeIsMissing(a))return a.pos<=r?(a.pos>=i.pos&&(i=a),r<a.end?(f(a,t),!0):(e.Debug.assert(a.end<=r),void(n=a))):(e.Debug.assert(a.pos>r),!0)})),n){var a=function(t){for(;;){var r=e.getLastChild(t);if(!r)return t;t=r;}}(n);a.pos>i.pos&&(i=a);}return i}function s(t,r,n,i){var a=t.text;if(n&&(e.Debug.assert(a.length-n.span.length+n.newLength===r.length),i||e.Debug.shouldAssert(3))){var o=a.substr(0,n.span.start),s=r.substr(0,n.span.start);e.Debug.assert(o===s);var c=a.substring(e.textSpanEnd(n.span),a.length),l=r.substring(e.textSpanEnd(e.textChangeRangeNewSpan(n)),r.length);e.Debug.assert(c===l);}}function c(t){var r=t.statements,n=0;e.Debug.assert(n<r.length);var i=r[n],a=-1;return {currentNode:function(o){return o!==a&&(i&&i.end===o&&n<r.length-1&&(n++,i=r[n]),i&&i.pos===o||function(e){return r=void 0,n=-1,i=void 0,void f(t,a,o);function a(t){return e>=t.pos&&e<t.end&&(f(t,a,o),!0)}function o(t){if(e>=t.pos&&e<t.end)for(var s=0;s<t.length;s++){var c=t[s];if(c){if(c.pos===e)return r=t,n=s,i=c,!0;if(c.pos<e&&e<c.end)return f(c,a,o),!0}}return !1}}(o)),a=o,e.Debug.assert(!i||i.pos===o),i}}}var u;t.updateSourceFile=function(t,n,u,_){if(s(t,n,u,_=_||e.Debug.shouldAssert(2)),e.textChangeRangeIsUnchanged(u))return t;if(0===t.statements.length)return l.parseSourceFile(t.fileName,n,t.languageVersion,void 0,!0,t.scriptKind);var d=t;e.Debug.assert(!d.hasBeenIncrementallyParsed),d.hasBeenIncrementallyParsed=!0,l.fixupParentReferences(d);var p=t.text,g=c(t),m=function(t,r){for(var n=r.span.start,i=0;n>0&&i<=1;i++){var a=o(t,n);e.Debug.assert(a.pos<=n);var s=a.pos;n=Math.max(0,s-1);}var c=e.createTextSpanFromBounds(n,e.textSpanEnd(r.span)),l=r.newLength+(r.span.start-n);return e.createTextChangeRange(c,l)}(t,u);s(t,n,m,_),e.Debug.assert(m.span.start<=u.span.start),e.Debug.assert(e.textSpanEnd(m.span)===e.textSpanEnd(u.span)),e.Debug.assert(e.textSpanEnd(e.textChangeRangeNewSpan(m))===e.textSpanEnd(e.textChangeRangeNewSpan(u)));var y=e.textChangeRangeNewSpan(m).length-m.span.length;!function(t,n,o,s,c,l,u,_){return void d(t);function d(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!1,c,l,u,_);else {var g=t.end;if(g>=n){if(t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c),f(t,d,p),e.hasJSDocNodes(t))for(var m=0,y=t.jsDoc;m<y.length;m++)d(y[m]);a(t,_);}else e.Debug.assert(g<n);}}function p(t){if(e.Debug.assert(t.pos<=t.end),t.pos>o)r(t,!0,c,l,u,_);else {var a=t.end;if(a>=n){t.intersectsChange=!0,t._children=void 0,i(t,n,o,s,c);for(var p=0,f=t;p<f.length;p++)d(f[p]);}else e.Debug.assert(a<n);}}}(d,m.span.start,e.textSpanEnd(m.span),e.textSpanEnd(e.textChangeRangeNewSpan(m)),y,p,n,_);var v=l.parseSourceFile(t.fileName,n,t.languageVersion,g,!0,t.scriptKind);return v.commentDirectives=function(t,r,n,i,a,o,s,c){if(!t)return r;for(var l,u=!1,_=0,d=t;_<d.length;_++){var p=d[_],f=p.range,g=p.type;if(f.end<n)l=e.append(l,p);else if(f.pos>i){y();var m={range:{pos:f.pos+a,end:f.end+a},type:g};l=e.append(l,m),c&&e.Debug.assert(o.substring(f.pos,f.end)===s.substring(m.range.pos,m.range.end));}}return y(),l;function y(){u||(u=!0,l?r&&l.push.apply(l,r):l=r);}}(t.commentDirectives,v.commentDirectives,m.span.start,e.textSpanEnd(m.span),y,p,n,_),v.impliedNodeFormat=t.impliedNodeFormat,v},t.createSyntaxCursor=c,function(e){e[e.Value=-1]="Value";}(u||(u={}));}(u||(u={})),e.isDeclarationFileName=y,e.processCommentPragmas=v,e.processPragmasIntoFields=h;var b=new e.Map;function x(e){if(b.has(e))return b.get(e);var t=new RegExp("(\\s".concat(e,"\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"),"im");return b.set(e,t),t}var D=/^\/\/\/\s*<(\S+)\s.*?\/>/im,S=/^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im;function T(t,r,n){var i=2===r.kind&&D.exec(n);if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(!(o&&1&o.kind))return;if(o.args){for(var s={},c=0,l=o.args;c<l.length;c++){var u=l[c],_=x(u.name).exec(n);if(!_&&!u.optional)return;if(_){var d=_[2]||_[3];if(u.captureSpan){var p=r.pos+_.index+_[1].length+1;s[u.name]={value:d,pos:p,end:p+d.length};}else s[u.name]=d;}}t.push({name:a,args:{arguments:s,range:r}});}else t.push({name:a,args:{arguments:{},range:r}});}else {var f=2===r.kind&&S.exec(n);if(f)return C(t,r,2,f);if(3===r.kind)for(var g=/@(\S+)(\s+.*)?$/gim,m=void 0;m=g.exec(n);)C(t,r,4,m);}}function C(t,r,n,i){if(i){var a=i[1].toLowerCase(),o=e.commentPragmas[a];if(o&&o.kind&n){var s=function(t,r){if(!r)return {};if(!t.args)return {};for(var n=e.trimString(r).split(/\s+/),i={},a=0;a<t.args.length;a++){var o=t.args[a];if(!n[a]&&!o.optional)return "fail";if(o.captureSpan)return e.Debug.fail("Capture spans not yet implemented for non-xml pragmas");i[o.name]=n[a];}return i}(o,i[2]);"fail"!==s&&t.push({name:a,args:{arguments:s,range:r}});}}}function E(e,t){return e.kind===t.kind&&(79===e.kind?e.escapedText===t.escapedText:108===e.kind||e.name.escapedText===t.name.escapedText&&E(e.expression,t.expression))}e.tagNamesAreEquivalent=E;}(t),function(e){e.compileOnSaveCommandLineOption={name:"compileOnSave",type:"boolean",defaultValueDescription:"false"};var t=new e.Map(e.getEntries({preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5}));e.inverseJsxOptionMap=new e.Map(e.arrayFrom(e.mapIterator(t.entries(),(function(e){var t=e[0];return [""+e[1],t]}))));var r=[["es5","lib.es5.d.ts"],["es6","lib.es2015.d.ts"],["es2015","lib.es2015.d.ts"],["es7","lib.es2016.d.ts"],["es2016","lib.es2016.d.ts"],["es2017","lib.es2017.d.ts"],["es2018","lib.es2018.d.ts"],["es2019","lib.es2019.d.ts"],["es2020","lib.es2020.d.ts"],["es2021","lib.es2021.d.ts"],["esnext","lib.esnext.d.ts"],["dom","lib.dom.d.ts"],["dom.iterable","lib.dom.iterable.d.ts"],["webworker","lib.webworker.d.ts"],["webworker.importscripts","lib.webworker.importscripts.d.ts"],["webworker.iterable","lib.webworker.iterable.d.ts"],["scripthost","lib.scripthost.d.ts"],["es2015.core","lib.es2015.core.d.ts"],["es2015.collection","lib.es2015.collection.d.ts"],["es2015.generator","lib.es2015.generator.d.ts"],["es2015.iterable","lib.es2015.iterable.d.ts"],["es2015.promise","lib.es2015.promise.d.ts"],["es2015.proxy","lib.es2015.proxy.d.ts"],["es2015.reflect","lib.es2015.reflect.d.ts"],["es2015.symbol","lib.es2015.symbol.d.ts"],["es2015.symbol.wellknown","lib.es2015.symbol.wellknown.d.ts"],["es2016.array.include","lib.es2016.array.include.d.ts"],["es2017.object","lib.es2017.object.d.ts"],["es2017.sharedmemory","lib.es2017.sharedmemory.d.ts"],["es2017.string","lib.es2017.string.d.ts"],["es2017.intl","lib.es2017.intl.d.ts"],["es2017.typedarrays","lib.es2017.typedarrays.d.ts"],["es2018.asyncgenerator","lib.es2018.asyncgenerator.d.ts"],["es2018.asynciterable","lib.es2018.asynciterable.d.ts"],["es2018.intl","lib.es2018.intl.d.ts"],["es2018.promise","lib.es2018.promise.d.ts"],["es2018.regexp","lib.es2018.regexp.d.ts"],["es2019.array","lib.es2019.array.d.ts"],["es2019.object","lib.es2019.object.d.ts"],["es2019.string","lib.es2019.string.d.ts"],["es2019.symbol","lib.es2019.symbol.d.ts"],["es2020.bigint","lib.es2020.bigint.d.ts"],["es2020.promise","lib.es2020.promise.d.ts"],["es2020.sharedmemory","lib.es2020.sharedmemory.d.ts"],["es2020.string","lib.es2020.string.d.ts"],["es2020.symbol.wellknown","lib.es2020.symbol.wellknown.d.ts"],["es2020.intl","lib.es2020.intl.d.ts"],["es2021.promise","lib.es2021.promise.d.ts"],["es2021.string","lib.es2021.string.d.ts"],["es2021.weakref","lib.es2021.weakref.d.ts"],["es2021.intl","lib.es2021.intl.d.ts"],["esnext.array","lib.es2019.array.d.ts"],["esnext.symbol","lib.es2019.symbol.d.ts"],["esnext.asynciterable","lib.es2018.asynciterable.d.ts"],["esnext.intl","lib.esnext.intl.d.ts"],["esnext.bigint","lib.es2020.bigint.d.ts"],["esnext.string","lib.es2021.string.d.ts"],["esnext.promise","lib.es2021.promise.d.ts"],["esnext.weakref","lib.es2021.weakref.d.ts"]];e.libs=r.map((function(e){return e[0]})),e.libMap=new e.Map(r),e.optionsForWatch=[{name:"watchFile",type:new e.Map(e.getEntries({fixedpollinginterval:e.WatchFileKind.FixedPollingInterval,prioritypollinginterval:e.WatchFileKind.PriorityPollingInterval,dynamicprioritypolling:e.WatchFileKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchFileKind.FixedChunkSizePolling,usefsevents:e.WatchFileKind.UseFsEvents,usefseventsonparentdirectory:e.WatchFileKind.UseFsEventsOnParentDirectory})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_the_TypeScript_watch_mode_works},{name:"watchDirectory",type:new e.Map(e.getEntries({usefsevents:e.WatchDirectoryKind.UseFsEvents,fixedpollinginterval:e.WatchDirectoryKind.FixedPollingInterval,dynamicprioritypolling:e.WatchDirectoryKind.DynamicPriorityPolling,fixedchunksizepolling:e.WatchDirectoryKind.FixedChunkSizePolling})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality},{name:"fallbackPolling",type:new e.Map(e.getEntries({fixedinterval:e.PollingWatchKind.FixedInterval,priorityinterval:e.PollingWatchKind.PriorityInterval,dynamicpriority:e.PollingWatchKind.DynamicPriority,fixedchunksize:e.PollingWatchKind.FixedChunkSize})),category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers},{name:"synchronousWatchDirectory",type:"boolean",category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,defaultValueDescription:"false"},{name:"excludeDirectories",type:"list",element:{name:"excludeDirectory",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_directories_from_the_watch_process},{name:"excludeFiles",type:"list",element:{name:"excludeFile",type:"string",isFilePath:!0,extraValidation:Te},category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing}],e.commonOptionsWithBuild=[{name:"help",shortName:"h",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_this_message,defaultValueDescription:"false"},{name:"help",shortName:"?",type:"boolean",defaultValueDescription:"false"},{name:"watch",shortName:"w",type:"boolean",showInSimplifiedHelpView:!0,isCommandLineOnly:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Watch_input_files,defaultValueDescription:"false"},{name:"preserveWatchOutput",type:"boolean",showInSimplifiedHelpView:!1,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_wiping_the_console_in_watch_mode,defaultValueDescription:"false"},{name:"listFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_all_of_the_files_read_during_the_compilation,defaultValueDescription:"false"},{name:"explainFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,defaultValueDescription:"false"},{name:"listEmittedFiles",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,defaultValueDescription:"false"},{name:"pretty",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,defaultValueDescription:"true"},{name:"traceResolution",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Log_paths_used_during_the_moduleResolution_process,defaultValueDescription:"false"},{name:"diagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_compiler_performance_information_after_building,defaultValueDescription:"false"},{name:"extendedDiagnostics",type:"boolean",category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,defaultValueDescription:"false"},{name:"generateCpuProfile",type:"string",isFilePath:!0,paramType:e.Diagnostics.FILE_OR_DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging,defaultValueDescription:"profile.cpuprofile"},{name:"generateTrace",type:"string",isFilePath:!0,isCommandLineOnly:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Compiler_Diagnostics,description:e.Diagnostics.Generates_an_event_trace_and_a_list_of_types},{name:"incremental",shortName:"i",type:"boolean",category:e.Diagnostics.Projects,description:e.Diagnostics.Enable_incremental_compilation,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Watch_and_Build_Modes,description:e.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,defaultValueDescription:"false"},{name:"locale",type:"string",category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit,defaultValueDescription:e.Diagnostics.Platform_specific}],e.targetOptionDeclaration={name:"target",shortName:"t",type:new e.Map(e.getEntries({es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,esnext:99})),affectsSourceFile:!0,affectsModuleResolution:!0,affectsEmit:!0,paramType:e.Diagnostics.VERSION,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,defaultValueDescription:"ES3"};var a,o=[{name:"all",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_all_compiler_options,defaultValueDescription:"false"},{name:"version",shortName:"v",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Print_the_compiler_s_version,defaultValueDescription:"false"},{name:"init",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,defaultValueDescription:"false"},{name:"project",shortName:"p",type:"string",isFilePath:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,paramType:e.Diagnostics.FILE_OR_DIRECTORY,description:e.Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json},{name:"build",type:"boolean",shortName:"b",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,defaultValueDescription:"false"},{name:"showConfig",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Command_line_Options,isCommandLineOnly:!0,description:e.Diagnostics.Print_the_final_configuration_instead_of_building,defaultValueDescription:"false"},{name:"listFilesOnly",type:"boolean",category:e.Diagnostics.Command_line_Options,affectsSemanticDiagnostics:!0,affectsEmit:!0,isCommandLineOnly:!0,description:e.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,defaultValueDescription:"false"},e.targetOptionDeclaration,{name:"module",shortName:"m",type:new e.Map(e.getEntries({none:e.ModuleKind.None,commonjs:e.ModuleKind.CommonJS,amd:e.ModuleKind.AMD,system:e.ModuleKind.System,umd:e.ModuleKind.UMD,es6:e.ModuleKind.ES2015,es2015:e.ModuleKind.ES2015,es2020:e.ModuleKind.ES2020,es2022:e.ModuleKind.ES2022,esnext:e.ModuleKind.ESNext,node12:e.ModuleKind.Node12,nodenext:e.ModuleKind.NodeNext})),affectsModuleResolution:!0,affectsEmit:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_what_module_code_is_generated},{name:"lib",type:"list",element:{name:"lib",type:e.libMap},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment,transpileOptionValue:void 0},{name:"allowJs",type:"boolean",affectsModuleResolution:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,defaultValueDescription:"false"},{name:"checkJs",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,defaultValueDescription:"false"},{name:"jsx",type:t,affectsSourceFile:!0,affectsEmit:!0,affectsModuleResolution:!0,paramType:e.Diagnostics.KIND,showInSimplifiedHelpView:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_what_JSX_code_is_generated,defaultValueDescription:"undefined"},{name:"declaration",shortName:"d",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project,defaultValueDescription:e.Diagnostics.false_unless_composite_is_set},{name:"declarationMap",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,defaultValueDescription:"false",description:e.Diagnostics.Create_sourcemaps_for_d_ts_files},{name:"emitDeclarationOnly",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,transpileOptionValue:void 0,defaultValueDescription:"false"},{name:"sourceMap",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:"false",description:e.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files},{name:"outFile",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,transpileOptionValue:void 0},{name:"outDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_an_output_folder_for_all_emitted_files},{name:"rootDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_root_folder_within_your_source_files,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"composite",type:"boolean",affectsEmit:!0,isTSConfigOnly:!0,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:"false",description:e.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references},{name:"tsBuildInfoFile",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.FILE,category:e.Diagnostics.Projects,transpileOptionValue:void 0,defaultValueDescription:".tsbuildinfo",description:e.Diagnostics.Specify_the_folder_for_tsbuildinfo_incremental_compilation_files},{name:"removeComments",type:"boolean",affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,defaultValueDescription:"false",description:e.Diagnostics.Disable_emitting_comments},{name:"noEmit",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_files_from_a_compilation,transpileOptionValue:void 0,defaultValueDescription:"false"},{name:"importHelpers",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,defaultValueDescription:"false"},{name:"importsNotUsedAsValues",type:new e.Map(e.getEntries({remove:0,preserve:1,error:2})),affectsEmit:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types},{name:"downlevelIteration",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,defaultValueDescription:"false"},{name:"isolatedModules",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"strict",type:"boolean",showInSimplifiedHelpView:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_all_strict_type_checking_options,defaultValueDescription:"false"},{name:"noImplicitAny",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictNullChecks",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_type_checking_take_into_account_null_and_undefined,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictFunctionTypes",type:"boolean",strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictBindCallApply",type:"boolean",strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"strictPropertyInitialization",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noImplicitThis",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"useUnknownInCatchVariables",type:"boolean",affectsSemanticDiagnostics:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,defaultValueDescription:"false"},{name:"alwaysStrict",type:"boolean",affectsSourceFile:!0,strictFlag:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_use_strict_is_always_emitted,defaultValueDescription:e.Diagnostics.false_unless_strict_is_set},{name:"noUnusedLocals",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,defaultValueDescription:"false"},{name:"noUnusedParameters",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,defaultValueDescription:"false"},{name:"exactOptionalPropertyTypes",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,defaultValueDescription:"false"},{name:"noImplicitReturns",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,defaultValueDescription:"false"},{name:"noFallthroughCasesInSwitch",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,defaultValueDescription:"false"},{name:"noUncheckedIndexedAccess",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Include_undefined_in_index_signature_results,defaultValueDescription:"false"},{name:"noImplicitOverride",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,defaultValueDescription:"false"},{name:"noPropertyAccessFromIndexSignature",type:"boolean",showInSimplifiedHelpView:!1,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,defaultValueDescription:"false"},{name:"moduleResolution",type:new e.Map(e.getEntries({node:e.ModuleResolutionKind.NodeJs,classic:e.ModuleResolutionKind.Classic,node12:e.ModuleResolutionKind.Node12,nodenext:e.ModuleResolutionKind.NodeNext})),affectsModuleResolution:!0,paramType:e.Diagnostics.STRATEGY,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier,defaultValueDescription:e.Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node},{name:"baseUrl",type:"string",affectsModuleResolution:!0,isFilePath:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names},{name:"paths",type:"object",affectsModuleResolution:!0,isTSConfigOnly:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations,transpileOptionValue:void 0},{name:"rootDirs",type:"list",isTSConfigOnly:!0,element:{name:"rootDirs",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules,transpileOptionValue:void 0,defaultValueDescription:e.Diagnostics.Computed_from_the_list_of_input_files},{name:"typeRoots",type:"list",element:{name:"typeRoots",type:"string",isFilePath:!0},affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types},{name:"types",type:"list",element:{name:"types",type:"string"},affectsProgramStructure:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file,transpileOptionValue:void 0},{name:"allowSyntheticDefaultImports",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export,defaultValueDescription:e.Diagnostics.module_system_or_esModuleInterop},{name:"esModuleInterop",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,showInSimplifiedHelpView:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,defaultValueDescription:"false"},{name:"preserveSymlinks",type:"boolean",category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,defaultValueDescription:"false"},{name:"allowUmdGlobalAccess",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Allow_accessing_UMD_globals_from_modules,defaultValueDescription:"false"},{name:"sourceRoot",type:"string",affectsEmit:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code},{name:"mapRoot",type:"string",affectsEmit:!0,paramType:e.Diagnostics.LOCATION,category:e.Diagnostics.Emit,description:e.Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations},{name:"inlineSourceMap",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,defaultValueDescription:"false"},{name:"inlineSources",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,defaultValueDescription:"false"},{name:"experimentalDecorators",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,defaultValueDescription:"false"},{name:"emitDecoratorMetadata",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,defaultValueDescription:"false"},{name:"jsxFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h,defaultValueDescription:"`React.createElement`"},{name:"jsxFragmentFactory",type:"string",category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment},{name:"jsxImportSource",type:"string",affectsSemanticDiagnostics:!0,affectsEmit:!0,affectsModuleResolution:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,defaultValueDescription:"react"},{name:"resolveJsonModule",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Enable_importing_json_files,defaultValueDescription:"false"},{name:"out",type:"string",affectsEmit:!0,isFilePath:!1,category:e.Diagnostics.Backwards_Compatibility,paramType:e.Diagnostics.FILE,transpileOptionValue:void 0,description:e.Diagnostics.Deprecated_setting_Use_outFile_instead},{name:"reactNamespace",type:"string",affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit,defaultValueDescription:"`React`"},{name:"skipDefaultLibCheck",type:"boolean",category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,defaultValueDescription:"false"},{name:"charset",type:"string",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files,defaultValueDescription:"utf8"},{name:"emitBOM",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,defaultValueDescription:"false"},{name:"newLine",type:new e.Map(e.getEntries({crlf:0,lf:1})),affectsEmit:!0,paramType:e.Diagnostics.NEWLINE,category:e.Diagnostics.Emit,description:e.Diagnostics.Set_the_newline_character_for_emitting_files,defaultValueDescription:e.Diagnostics.Platform_specific},{name:"noErrorTruncation",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Output_Formatting,description:e.Diagnostics.Disable_truncating_types_in_error_messages,defaultValueDescription:"false"},{name:"noLib",type:"boolean",category:e.Diagnostics.Language_and_Environment,affectsProgramStructure:!0,description:e.Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"noResolve",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Modules,description:e.Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project,transpileOptionValue:!0,defaultValueDescription:"false"},{name:"stripInternal",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,defaultValueDescription:"false"},{name:"disableSizeLimit",type:"boolean",affectsProgramStructure:!0,category:e.Diagnostics.Editor_Support,description:e.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,defaultValueDescription:"false"},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,defaultValueDescription:"false"},{name:"disableSolutionSearching",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,defaultValueDescription:"false"},{name:"disableReferencedProjectLoad",type:"boolean",isTSConfigOnly:!0,category:e.Diagnostics.Projects,description:e.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,defaultValueDescription:"false"},{name:"noImplicitUseStrict",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,defaultValueDescription:"false"},{name:"noEmitHelpers",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,defaultValueDescription:"false"},{name:"noEmitOnError",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,defaultValueDescription:"false"},{name:"preserveConstEnums",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,defaultValueDescription:"false"},{name:"declarationDir",type:"string",affectsEmit:!0,isFilePath:!0,paramType:e.Diagnostics.DIRECTORY,category:e.Diagnostics.Emit,transpileOptionValue:void 0,description:e.Diagnostics.Specify_the_output_directory_for_generated_declaration_files},{name:"skipLibCheck",type:"boolean",category:e.Diagnostics.Completeness,description:e.Diagnostics.Skip_type_checking_all_d_ts_files,defaultValueDescription:"false"},{name:"allowUnusedLabels",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unused_labels,defaultValueDescription:"undefined"},{name:"allowUnreachableCode",type:"boolean",affectsBindDiagnostics:!0,affectsSemanticDiagnostics:!0,category:e.Diagnostics.Type_Checking,description:e.Diagnostics.Disable_error_reporting_for_unreachable_code,defaultValueDescription:"undefined"},{name:"suppressExcessPropertyErrors",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,defaultValueDescription:"false"},{name:"suppressImplicitAnyIndexErrors",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,defaultValueDescription:"false"},{name:"forceConsistentCasingInFileNames",type:"boolean",affectsModuleResolution:!0,category:e.Diagnostics.Interop_Constraints,description:e.Diagnostics.Ensure_that_casing_is_correct_in_imports,defaultValueDescription:"false"},{name:"maxNodeModuleJsDepth",type:"number",affectsModuleResolution:!0,category:e.Diagnostics.JavaScript_Support,description:e.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,defaultValueDescription:"0"},{name:"noStrictGenericChecks",type:"boolean",affectsSemanticDiagnostics:!0,category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,defaultValueDescription:"false"},{name:"useDefineForClassFields",type:"boolean",affectsSemanticDiagnostics:!0,affectsEmit:!0,category:e.Diagnostics.Language_and_Environment,description:e.Diagnostics.Emit_ECMAScript_standard_compliant_class_fields,defaultValueDescription:e.Diagnostics.true_for_ES2022_and_above_including_ESNext},{name:"preserveValueImports",type:"boolean",affectsEmit:!0,category:e.Diagnostics.Emit,description:e.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,defaultValueDescription:"false"},{name:"keyofStringsOnly",type:"boolean",category:e.Diagnostics.Backwards_Compatibility,description:e.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,defaultValueDescription:"false"},{name:"plugins",type:"list",isTSConfigOnly:!0,element:{name:"plugin",type:"object"},description:e.Diagnostics.List_of_language_service_plugins,category:e.Diagnostics.Editor_Support}];function s(t){var r=new e.Map,n=new e.Map;return e.forEach(t,(function(e){r.set(e.name.toLowerCase(),e),e.shortName&&n.set(e.shortName,e.name);})),{optionsNameMap:r,shortOptionNames:n}}function c(){return a||(a=s(e.optionDeclarations))}e.optionDeclarations=n$3(n$3([],e.commonOptionsWithBuild,!0),o,!0),e.semanticDiagnosticsOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsSemanticDiagnostics})),e.affectsEmitOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsEmit})),e.moduleResolutionOptionDeclarations=e.optionDeclarations.filter((function(e){return !!e.affectsModuleResolution})),e.sourceFileAffectingCompilerOptions=e.optionDeclarations.filter((function(e){return !!e.affectsSourceFile||!!e.affectsModuleResolution||!!e.affectsBindDiagnostics})),e.optionsAffectingProgramStructure=e.optionDeclarations.filter((function(e){return !!e.affectsProgramStructure})),e.transpileOptionValueCompilerOptions=e.optionDeclarations.filter((function(t){return e.hasProperty(t,"transpileOptionValue")})),e.optionsForBuild=[{name:"verbose",shortName:"v",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Enable_verbose_logging,type:"boolean",defaultValueDescription:"false"},{name:"dry",shortName:"d",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,type:"boolean",defaultValueDescription:"false"},{name:"force",shortName:"f",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,type:"boolean",defaultValueDescription:"false"},{name:"clean",category:e.Diagnostics.Command_line_Options,description:e.Diagnostics.Delete_the_outputs_of_all_projects,type:"boolean",defaultValueDescription:"false"}],e.buildOpts=n$3(n$3([],e.commonOptionsWithBuild,!0),e.optionsForBuild,!0),e.typeAcquisitionDeclarations=[{name:"enableAutoDiscovery",type:"boolean",defaultValueDescription:"false"},{name:"enable",type:"boolean",defaultValueDescription:"false"},{name:"include",type:"list",element:{name:"include",type:"string"}},{name:"exclude",type:"list",element:{name:"exclude",type:"string"}},{name:"disableFilenameBasedTypeAcquisition",type:"boolean",defaultValueDescription:"false"}],e.createOptionNameMap=s,e.getOptionsNameMap=c;var l,u={diagnostic:e.Diagnostics.Compiler_option_0_may_only_be_used_with_build,getOptionsNameMap:D};function _(e){return e&&void 0!==e.enableAutoDiscovery&&void 0===e.enable?{enable:e.enableAutoDiscovery,include:e.include||[],exclude:e.exclude||[]}:e}function d(t){return p(t,e.createCompilerDiagnostic)}function p(t,r){var n=e.arrayFrom(t.type.keys()).map((function(e){return "'".concat(e,"'")})).join(", ");return r(e.Diagnostics.Argument_for_0_option_must_be_Colon_1,"--".concat(t.name),n)}function f(t,r,n){return ye(t,e.trimString(r||""),n)}function g(t,r,n){if(void 0===r&&(r=""),r=e.trimString(r),!e.startsWith(r,"-")){if(""===r)return [];var i=r.split(",");switch(t.element.type){case"number":return e.mapDefined(i,(function(e){return me(t.element,parseInt(e),n)}));case"string":return e.mapDefined(i,(function(e){return me(t.element,e||"",n)}));default:return e.mapDefined(i,(function(e){return f(t.element,e,n)}))}}}function m(e){return e.name}function y(t,r,n,i){var a;if(null===(a=r.alternateMode)||void 0===a?void 0:a.getOptionsNameMap().optionsNameMap.has(t.toLowerCase()))return n(r.alternateMode.diagnostic,t);var o=e.getSpellingSuggestion(t,r.optionDeclarations,m);return o?n(r.unknownDidYouMeanDiagnostic,i||t,o.name):n(r.unknownOptionDiagnostic,i||t)}function v(t,r,n){var i,a={},o=[],s=[];return c(r),{options:a,watchOptions:i,fileNames:o,errors:s};function c(r){for(var n=0;n<r.length;){var c=r[n];if(n++,64===c.charCodeAt(0))l(c.slice(1));else if(45===c.charCodeAt(0)){var u=c.slice(45===c.charCodeAt(1)?2:1),_=x(t.getOptionsNameMap,u,!0);if(_)n=h(r,n,t,_,a,s);else {var d=x(M.getOptionsNameMap,u,!0);d?n=h(r,n,M,d,i||(i={}),s):s.push(y(u,t,e.createCompilerDiagnostic,c));}}else o.push(c);}}function l(t){var r=E(t,n||function(t){return e.sys.readFile(t)});if(e.isString(r)){for(var i=[],a=0;;){for(;a<r.length&&r.charCodeAt(a)<=32;)a++;if(a>=r.length)break;var o=a;if(34===r.charCodeAt(o)){for(a++;a<r.length&&34!==r.charCodeAt(a);)a++;a<r.length?(i.push(r.substring(o+1,a)),a++):s.push(e.createCompilerDiagnostic(e.Diagnostics.Unterminated_quoted_string_in_response_file_0,t));}else {for(;r.charCodeAt(a)>32;)a++;i.push(r.substring(o,a));}}c(i);}else s.push(r);}}function h(t,r,n,i,a,o){if(i.isTSConfigOnly)"null"===(s=t[r])?(a[i.name]=void 0,r++):"boolean"===i.type?"false"===s?(a[i.name]=me(i,!1,o),r++):("true"===s&&r++,o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line,i.name))):(o.push(e.createCompilerDiagnostic(e.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line,i.name)),s&&!e.startsWith(s,"-")&&r++);else if(t[r]||"boolean"===i.type||o.push(e.createCompilerDiagnostic(n.optionTypeMismatchDiagnostic,i.name,U(i))),"null"!==t[r])switch(i.type){case"number":a[i.name]=me(i,parseInt(t[r]),o),r++;break;case"boolean":var s=t[r];a[i.name]=me(i,"false"!==s,o),"false"!==s&&"true"!==s||r++;break;case"string":a[i.name]=me(i,t[r]||"",o),r++;break;case"list":var c=g(i,t[r],o);a[i.name]=c||[],c&&r++;break;default:a[i.name]=f(i,t[r],o),r++;}else a[i.name]=void 0,r++;return r}function b(e,t){return x(c,e,t)}function x(e,t,r){void 0===r&&(r=!1),t=t.toLowerCase();var n=e(),i=n.optionsNameMap,a=n.shortOptionNames;if(r){var o=a.get(t);void 0!==o&&(t=o);}return i.get(t)}function D(){return l||(l=s(e.buildOpts))}e.defaultInitCompilerOptions={module:e.ModuleKind.CommonJS,target:3,strict:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,skipLibCheck:!0},e.convertEnableAutoDiscoveryToEnable=_,e.createCompilerDiagnosticForInvalidCustomType=d,e.parseCustomTypeOption=f,e.parseListTypeOption=g,e.parseCommandLineWorker=v,e.compilerOptionsDidYouMeanDiagnostics={alternateMode:u,getOptionsNameMap:c,optionDeclarations:e.optionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_compiler_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_compiler_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Compiler_option_0_expects_an_argument},e.parseCommandLine=function(t,r){return v(e.compilerOptionsDidYouMeanDiagnostics,t,r)},e.getOptionFromName=b;var S={alternateMode:{diagnostic:e.Diagnostics.Compiler_option_0_may_not_be_used_with_build,getOptionsNameMap:c},getOptionsNameMap:D,optionDeclarations:e.buildOpts,unknownOptionDiagnostic:e.Diagnostics.Unknown_build_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_build_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Build_option_0_requires_a_value_of_type_1};function T(t,r){var n=e.parseJsonText(t,r);return {config:j(n,n.parseDiagnostics,!1,void 0),error:n.parseDiagnostics.length?n.parseDiagnostics[0]:void 0}}function C(t,r){var n=E(t,r);return e.isString(n)?e.parseJsonText(t,n):{fileName:t,parseDiagnostics:[n]}}function E(t,r){var n;try{n=r(t);}catch(r){return e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0_Colon_1,t,r.message)}return void 0===n?e.createCompilerDiagnostic(e.Diagnostics.Cannot_read_file_0,t):n}function k(t){return e.arrayToMap(t,m)}e.parseBuildCommand=function(t){var r=v(S,t),n=r.options,i=r.watchOptions,a=r.fileNames,o=r.errors,s=n;return 0===a.length&&a.push("."),s.clean&&s.force&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","force")),s.clean&&s.verbose&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","verbose")),s.clean&&s.watch&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"clean","watch")),s.watch&&s.dry&&o.push(e.createCompilerDiagnostic(e.Diagnostics.Options_0_and_1_cannot_be_combined,"watch","dry")),{buildOptions:s,watchOptions:i,projects:a,errors:o}},e.getDiagnosticText=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=e.createCompilerDiagnostic.apply(void 0,arguments);return i.messageText},e.getParsedCommandLineOfConfigFile=function(t,r,n,i,a,o){var s=E(t,(function(e){return n.readFile(e)}));if(e.isString(s)){var c=e.parseJsonText(t,s),l=n.getCurrentDirectory();return c.path=e.toPath(t,l,e.createGetCanonicalFileName(n.useCaseSensitiveFileNames)),c.resolvedPath=c.path,c.originalFileName=c.fileName,Z(c,n,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),l),r,e.getNormalizedAbsolutePath(t,l),void 0,o,i,a)}n.onUnRecoverableConfigFileDiagnostic(s);},e.readConfigFile=function(t,r){var n=E(t,r);return e.isString(n)?T(t,n):{config:{},error:n}},e.parseConfigFileTextToJson=T,e.readJsonConfigFile=C,e.tryReadFile=E;var N,F={optionDeclarations:e.typeAcquisitionDeclarations,unknownOptionDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1};function A(){return N||(N=s(e.optionsForWatch))}var P,w,I,O,M={getOptionsNameMap:A,optionDeclarations:e.optionsForWatch,unknownOptionDiagnostic:e.Diagnostics.Unknown_watch_option_0,unknownDidYouMeanDiagnostic:e.Diagnostics.Unknown_watch_option_0_Did_you_mean_1,optionTypeMismatchDiagnostic:e.Diagnostics.Watch_option_0_requires_a_value_of_type_1};function L(){return P||(P=k(e.optionDeclarations))}function R(){return w||(w=k(e.optionsForWatch))}function B(){return I||(I=k(e.typeAcquisitionDeclarations))}function j(t,r,n,i){var a,o=null===(a=t.statements[0])||void 0===a?void 0:a.expression,s=n?(void 0===O&&(O={name:void 0,type:"object",elementOptions:k([{name:"compilerOptions",type:"object",elementOptions:L(),extraKeyDiagnostics:e.compilerOptionsDidYouMeanDiagnostics},{name:"watchOptions",type:"object",elementOptions:R(),extraKeyDiagnostics:M},{name:"typingOptions",type:"object",elementOptions:B(),extraKeyDiagnostics:F},{name:"typeAcquisition",type:"object",elementOptions:B(),extraKeyDiagnostics:F},{name:"extends",type:"string",category:e.Diagnostics.File_Management},{name:"references",type:"list",element:{name:"references",type:"object"},category:e.Diagnostics.Projects},{name:"files",type:"list",element:{name:"files",type:"string"},category:e.Diagnostics.File_Management},{name:"include",type:"list",element:{name:"include",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk},{name:"exclude",type:"list",element:{name:"exclude",type:"string"},category:e.Diagnostics.File_Management,defaultValueDescription:e.Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified},e.compileOnSaveCommandLineOption])}),O):void 0;if(o&&204!==o.kind){if(r.push(e.createDiagnosticForNodeInSourceFile(t,o,e.Diagnostics.The_root_value_of_a_0_file_must_be_an_object,"jsconfig.json"===e.getBaseFileName(t.fileName)?"jsconfig.json":"tsconfig.json")),e.isArrayLiteralExpression(o)){var c=e.find(o.elements,e.isObjectLiteralExpression);if(c)return z(t,c,r,!0,s,i)}return {}}return z(t,o,r,!0,s,i)}function J(e,t){var r;return z(e,null===(r=e.statements[0])||void 0===r?void 0:r.expression,t,!0,void 0,void 0)}function z(t,r,i,a,o,s){return r?u(r,o):a?{}:void 0;function c(e){return o&&o.elementOptions===e}function l(r,n,o,l){for(var d=a?{}:void 0,p=function(r){if(294!==r.kind)return i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_assignment_expected)),"continue";r.questionToken&&i.push(e.createDiagnosticForNodeInSourceFile(t,r.questionToken,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),_(r.name)||i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,e.Diagnostics.String_literal_with_double_quotes_expected));var p=e.isComputedNonLiteralName(r.name)?void 0:e.getTextOfPropertyName(r.name),f=p&&e.unescapeLeadingUnderscores(p),g=f&&n?n.get(f):void 0;f&&o&&!g&&(n?i.push(y(f,o,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r.name,n,i,a)}))):i.push(e.createDiagnosticForNodeInSourceFile(t,r.name,o.unknownOptionDiagnostic,f)));var m=u(r.initializer,g);if(void 0!==f&&(a&&(d[f]=m),s&&(l||c(n)))){var v=K(g,m);l?v&&s.onSetValidOptionKeyValueInParent(l,g,m):c(n)&&(v?s.onSetValidOptionKeyValueInRoot(f,r.name,m,r.initializer):g||s.onSetUnknownOptionKeyValueInRoot(f,r.name,m,r.initializer));}},f=0,g=r.properties;f<g.length;f++)p(g[f]);return d}function u(r,o){var s;switch(r.kind){case 110:return y(o&&"boolean"!==o.type),m(!0);case 95:return y(o&&"boolean"!==o.type),m(!1);case 104:return y(o&&"extends"===o.name),m(null);case 10:_(r)||i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.String_literal_with_double_quotes_expected)),y(o&&e.isString(o.type)&&"string"!==o.type);var c=r.text;if(o&&!e.isString(o.type)){var d=o;d.type.has(c.toLowerCase())||(i.push(p(d,(function(n,i,a){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a)}))),s=!0);}return m(c);case 8:return y(o&&"number"!==o.type),m(Number(r.text));case 218:if(40!==r.operator||8!==r.operand.kind)break;return y(o&&"number"!==o.type),m(-Number(r.operand.text));case 204:y(o&&"object"!==o.type);var f=r;if(o){var g=o;return m(l(f,g.elementOptions,g.extraKeyDiagnostics,g.name))}return m(l(f,void 0,void 0,void 0));case 203:return y(o&&"list"!==o.type),m(function(t,r){if(a)return e.filter(t.map((function(e){return u(e,r)})),(function(e){return void 0!==e}));t.forEach((function(e){return u(e,r)}));}(r.elements,o&&o.element))}return void(o?y(!0):i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)));function m(a){var c;if(!s){var l=null===(c=null==o?void 0:o.extraValidation)||void 0===c?void 0:c.call(o,a);if(l)return void i.push(e.createDiagnosticForNodeInSourceFile.apply(void 0,n$3([t,r],l,!1)))}return a}function y(n){n&&(i.push(e.createDiagnosticForNodeInSourceFile(t,r,e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,o.name,U(o))),s=!0);}}function _(r){return e.isStringLiteral(r)&&e.isStringDoubleQuoted(r,t)}}function U(t){return "list"===t.type?"Array":e.isString(t.type)?t.type:"string"}function K(t,r){return !!t&&(!!ee(r)||("list"===t.type?e.isArray(r):typeof r===(e.isString(t.type)?t.type:"string")))}function V(t){return i$1({},e.arrayFrom(t.entries()).reduce((function(e,t){var r;return i$1(i$1({},e),((r={})[t[0]]=t[1],r))}),{}))}function q(t){if(e.length(t)){if(1!==e.length(t))return t;if("**/*"!==t[0])return t}}function W(e){return "string"===e.type||"number"===e.type||"boolean"===e.type||"object"===e.type?void 0:"list"===e.type?W(e.element):e.type}function H(t,r){return e.forEachEntry(r,(function(e,r){if(e===t)return r}))}function G(e,t){return Q(e,c(),t)}function Q(t,r,n){var i=r.optionsNameMap,a=new e.Map,o=n&&e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),s=function(r){if(e.hasProperty(t,r)){if(i.has(r)&&(i.get(r).category===e.Diagnostics.Command_line_Options||i.get(r).category===e.Diagnostics.Output_Formatting))return "continue";var s=t[r],c=i.get(r.toLowerCase());if(c){var l=W(c);l?"list"===c.type?a.set(r,s.map((function(e){return H(e,l)}))):a.set(r,H(s,l)):n&&c.isFilePath?a.set(r,e.getRelativePathFromFile(n.configFilePath,e.getNormalizedAbsolutePath(s,e.getDirectoryPath(n.configFilePath)),o)):a.set(r,s);}}};for(var c in t)s(c);return a}function X(t){return G(e.extend(t,e.defaultInitCompilerOptions))}function Y(e,t,r){if(e&&!ee(t))if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function Z(e,t,r,n,i,a,o,s,c){return re(void 0,e,t,r,n,c,i,a,o,s)}function $(e,t){t&&Object.defineProperty(e,"configFile",{enumerable:!1,writable:!1,value:t});}function ee(e){return null==e}function te(t,r){return e.getDirectoryPath(e.getNormalizedAbsolutePath(t,r))}function re(t,r,n,i,a,o,s,c,l,u){void 0===a&&(a={}),void 0===c&&(c=[]),void 0===l&&(l=[]),e.Debug.assert(void 0===t&&void 0!==r||void 0!==t&&void 0===r);var _=[],d=oe(t,r,n,i,s,c,_,u),p=d.raw,f=e.extend(a,d.options||{}),g=o&&d.watchOptions?e.extend(o,d.watchOptions):d.watchOptions||o;f.configFilePath=s&&e.normalizeSlashes(s);var m=function(){var t=b("references",(function(e){return "object"==typeof e}),"object"),n=v(h("files"));if(n){var i="no-prop"===t||e.isArray(t)&&0===t.length,a=e.hasProperty(p,"extends");if(0===n.length&&i&&!a)if(r){var o=s||"tsconfig.json",c=e.Diagnostics.The_files_list_in_config_file_0_is_empty,l=e.firstDefined(e.getTsConfigPropArray(r,"files"),(function(e){return e.initializer})),u=l?e.createDiagnosticForNodeInSourceFile(r,l,c,o):e.createCompilerDiagnostic(c,o);_.push(u);}else x(e.Diagnostics.The_files_list_in_config_file_0_is_empty,s||"tsconfig.json");}var d,f,g=v(h("include")),m=h("exclude"),y=v(m);if("no-prop"===m&&p.compilerOptions){var D=p.compilerOptions.outDir,S=p.compilerOptions.declarationDir;(D||S)&&(y=[D,S].filter((function(e){return !!e})));}return void 0===n&&void 0===g&&(g=["**/*"]),g&&(d=Se(g,_,!0,r,"include")),y&&(f=Se(y,_,!1,r,"exclude")),{filesSpecs:n,includeSpecs:g,excludeSpecs:y,validatedFilesSpec:e.filter(n,e.isString),validatedIncludeSpecs:d,validatedExcludeSpecs:f,pathPatterns:void 0}}();r&&(r.configFileSpecs=m),$(f,r);var y=e.normalizePath(s?te(s,i):i);return {options:f,watchOptions:g,fileNames:function(e){var t=be(m,e,f,n,l);return ie(t,ae(p),c)&&_.push(ne(m,s)),t}(y),projectReferences:function(t){var r,n=b("references",(function(e){return "object"==typeof e}),"object");if(e.isArray(n))for(var i=0,a=n;i<a.length;i++){var o=a[i];"string"!=typeof o.path?x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"reference.path","string"):(r||(r=[])).push({path:e.getNormalizedAbsolutePath(o.path,t),originalPath:o.path,prepend:o.prepend,circular:o.circular});}return r}(y),typeAcquisition:d.typeAcquisition||ue(),raw:p,errors:_,wildcardDirectories:Ce(m,y,n.useCaseSensitiveFileNames),compileOnSave:!!p.compileOnSave};function v(t){return e.isArray(t)?t:void 0}function h(t){return b(t,e.isString,"string")}function b(t,n,i){if(e.hasProperty(p,t)&&!ee(p[t])){if(e.isArray(p[t])){var a=p[t];return r||e.every(a,n)||_.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,i)),a}return x(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t,"Array"),"not-array"}return "no-prop"}function x(t,n,i){r||_.push(e.createCompilerDiagnostic(t,n,i));}}function ne(t,r){var n=t.includeSpecs,i=t.excludeSpecs;return e.createCompilerDiagnostic(e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2,r||"tsconfig.json",JSON.stringify(n||[]),JSON.stringify(i||[]))}function ie(e,t,r){return 0===e.length&&t&&(!r||0===r.length)}function ae(t){return !e.hasProperty(t,"files")&&!e.hasProperty(t,"references")}function oe(t,r,i,a,s,c,l,u){var _;a=e.normalizeSlashes(a);var d=e.getNormalizedAbsolutePath(s||"",a);if(c.indexOf(d)>=0)return l.push(e.createCompilerDiagnostic(e.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0,n$3(n$3([],c,!0),[d],!1).join(" -> "))),{raw:t||J(r,l)};var p=t?function(t,r,n,i,a){e.hasProperty(t,"excludes")&&a.push(e.createCompilerDiagnostic(e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude));var o,s=le(t.compilerOptions,n,a,i),c=_e(t.typeAcquisition||t.typingOptions,n,a,i),l=function(e,t,r){return de(R(),e,t,void 0,M,r)}(t.watchOptions,n,a);if(t.compileOnSave=function(t,r,n){if(!e.hasProperty(t,e.compileOnSaveCommandLineOption.name))return !1;var i=pe(e.compileOnSaveCommandLineOption,t.compileOnSave,r,n);return "boolean"==typeof i&&i}(t,n,a),t.extends)if(e.isString(t.extends)){var u=i?te(i,n):n;o=se(t.extends,r,u,a,e.createCompilerDiagnostic);}else a.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,"extends","string"));return {raw:t,options:s,watchOptions:l,typeAcquisition:c,extendedConfigPath:o}}(t,i,a,s,l):function(t,r,n,i,a){var s,c,l,u,_,d=ce(i),p={onSetValidOptionKeyValueInParent:function(t,r,a){var o;switch(t){case"compilerOptions":o=d;break;case"watchOptions":o=l||(l={});break;case"typeAcquisition":o=s||(s=ue(i));break;case"typingOptions":o=c||(c=ue(i));break;default:e.Debug.fail("Unknown option");}o[r.name]=fe(r,n,a);},onSetValidOptionKeyValueInRoot:function(o,s,c,l){switch(o){case"extends":var _=i?te(i,n):n;return void(u=se(c,r,_,a,(function(r,n){return e.createDiagnosticForNodeInSourceFile(t,l,r,n)})))}},onSetUnknownOptionKeyValueInRoot:function(r,n,i,s){"excludes"===r&&a.push(e.createDiagnosticForNodeInSourceFile(t,n,e.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)),e.find(o,(function(e){return e.name===r}))&&(_=e.append(_,n));}},f=j(t,a,!0,p);return s||(s=c?void 0!==c.enableAutoDiscovery?{enable:c.enableAutoDiscovery,include:c.include,exclude:c.exclude}:c:ue(i)),_&&f&&void 0===f.compilerOptions&&a.push(e.createDiagnosticForNodeInSourceFile(t,_[0],e.Diagnostics._0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file,e.getTextOfPropertyName(_[0]))),{raw:f,options:d,watchOptions:l,typeAcquisition:s,extendedConfigPath:u}}(r,i,a,s,l);if((null===(_=p.options)||void 0===_?void 0:_.paths)&&(p.options.pathsBasePath=a),p.extendedConfigPath){c=c.concat([d]);var f=function(t,r,n,i,a,o){var s,c,l,u,_=n.useCaseSensitiveFileNames?r:e.toFileNameLowerCase(r);if(o&&(c=o.get(_))?(l=c.extendedResult,u=c.extendedConfig):((l=C(r,(function(e){return n.readFile(e)}))).parseDiagnostics.length||(u=oe(void 0,l,n,e.getDirectoryPath(r),e.getBaseFileName(r),i,a,o)),o&&o.set(_,{extendedResult:l,extendedConfig:u})),t&&(t.extendedSourceFiles=[l.fileName],l.extendedSourceFiles&&(s=t.extendedSourceFiles).push.apply(s,l.extendedSourceFiles)),!l.parseDiagnostics.length)return u;a.push.apply(a,l.parseDiagnostics);}(r,p.extendedConfigPath,i,c,l,u);if(f&&f.options){var g,m=f.raw,y=p.raw,v=function(t){!y[t]&&m[t]&&(y[t]=e.map(m[t],(function(t){return e.isRootedDiskPath(t)?t:e.combinePaths(g||(g=e.convertToRelativePath(e.getDirectoryPath(p.extendedConfigPath),a,e.createGetCanonicalFileName(i.useCaseSensitiveFileNames))),t)})));};v("include"),v("exclude"),v("files"),void 0===y.compileOnSave&&(y.compileOnSave=m.compileOnSave),p.options=e.assign({},f.options,p.options),p.watchOptions=p.watchOptions&&f.watchOptions?e.assign({},f.watchOptions,p.watchOptions):p.watchOptions||f.watchOptions;}}return p}function se(t,r,n,i,a){if(t=e.normalizeSlashes(t),e.isRootedDiskPath(t)||e.startsWith(t,"./")||e.startsWith(t,"../")){var o=e.getNormalizedAbsolutePath(t,n);return r.fileExists(o)||e.endsWith(o,".json")||(o="".concat(o,".json"),r.fileExists(o))?o:void i.push(a(e.Diagnostics.File_0_not_found,t))}var s=e.nodeModuleNameResolver(t,e.combinePaths(n,"tsconfig.json"),{moduleResolution:e.ModuleResolutionKind.NodeJs},r,void 0,void 0,!0);if(s.resolvedModule)return s.resolvedModule.resolvedFileName;i.push(a(e.Diagnostics.File_0_not_found,t));}function ce(t){return t&&"jsconfig.json"===e.getBaseFileName(t)?{allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0}:{}}function le(t,r,n,i){var a=ce(i);return de(L(),t,r,a,e.compilerOptionsDidYouMeanDiagnostics,n),i&&(a.configFilePath=e.normalizeSlashes(i)),a}function ue(t){return {enable:!!t&&"jsconfig.json"===e.getBaseFileName(t),include:[],exclude:[]}}function _e(e,t,r,n){var i=ue(n),a=_(e);return de(B(),a,t,i,F,r),i}function de(t,r,n,i,a,o){if(r){for(var s in r){var c=t.get(s);c?(i||(i={}))[c.name]=pe(c,r[s],n,o):o.push(y(s,a,e.createCompilerDiagnostic));}return i}}function pe(t,r,n,i){if(K(t,r)){var a=t.type;if("list"===a&&e.isArray(r))return function(t,r,n,i){return e.filter(e.map(r,(function(e){return pe(t.element,e,n,i)})),(function(e){return !!e}))}(t,r,n,i);if(!e.isString(a))return ye(t,r,i);var o=me(t,r,i);return ee(o)?o:ge(t,n,o)}i.push(e.createCompilerDiagnostic(e.Diagnostics.Compiler_option_0_requires_a_value_of_type_1,t.name,U(t)));}function fe(t,r,n){if(!ee(n)){if("list"===t.type){var i=t;return i.element.isFilePath||!e.isString(i.element.type)?e.filter(e.map(n,(function(e){return fe(i.element,r,e)})),(function(e){return !!e})):n}return e.isString(t.type)?ge(t,r,n):t.type.get(e.isString(n)?n.toLowerCase():n)}}function ge(t,r,n){return t.isFilePath&&""===(n=e.getNormalizedAbsolutePath(n,r))&&(n="."),n}function me(t,r,n){var i;if(!ee(r)){var a=null===(i=t.extraValidation)||void 0===i?void 0:i.call(t,r);if(!a)return r;n.push(e.createCompilerDiagnostic.apply(void 0,a));}}function ye(e,t,r){if(!ee(t)){var n=t.toLowerCase(),i=e.type.get(n);if(void 0!==i)return me(e,i,r);r.push(d(e));}}e.convertToObject=J,e.convertToObjectWorker=z,e.convertToTSConfig=function(t,r,n){var a,o,s,c=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),l=e.map(e.filter(t.fileNames,(null===(o=null===(a=t.options.configFile)||void 0===a?void 0:a.configFileSpecs)||void 0===o?void 0:o.validatedIncludeSpecs)?function(t,r,n,i){if(!r)return e.returnTrue;var a=e.getFileMatcherPatterns(t,n,r,i.useCaseSensitiveFileNames,i.getCurrentDirectory()),o=a.excludePattern&&e.getRegexFromPattern(a.excludePattern,i.useCaseSensitiveFileNames),s=a.includeFilePattern&&e.getRegexFromPattern(a.includeFilePattern,i.useCaseSensitiveFileNames);return s?o?function(e){return !(s.test(e)&&!o.test(e))}:function(e){return !s.test(e)}:o?function(e){return o.test(e)}:e.returnTrue}(r,t.options.configFile.configFileSpecs.validatedIncludeSpecs,t.options.configFile.configFileSpecs.validatedExcludeSpecs,n):e.returnTrue),(function(t){return e.getRelativePathFromFile(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),e.getNormalizedAbsolutePath(t,n.getCurrentDirectory()),c)})),u=G(t.options,{configFilePath:e.getNormalizedAbsolutePath(r,n.getCurrentDirectory()),useCaseSensitiveFileNames:n.useCaseSensitiveFileNames}),_=t.watchOptions&&Q(t.watchOptions,A());return i$1(i$1({compilerOptions:i$1(i$1({},V(u)),{showConfig:void 0,configFile:void 0,configFilePath:void 0,help:void 0,init:void 0,listFiles:void 0,listEmittedFiles:void 0,project:void 0,build:void 0,version:void 0}),watchOptions:_&&V(_),references:e.map(t.projectReferences,(function(e){return i$1(i$1({},e),{path:e.originalPath?e.originalPath:"",originalPath:void 0})})),files:e.length(l)?l:void 0},(null===(s=t.options.configFile)||void 0===s?void 0:s.configFileSpecs)?{include:q(t.options.configFile.configFileSpecs.validatedIncludeSpecs),exclude:t.options.configFile.configFileSpecs.validatedExcludeSpecs}:{}),{compileOnSave:!!t.compileOnSave||void 0})},e.getCompilerOptionsDiffValue=function(t,r){var n,i,a=X(t);return n=[],i=Array(3).join(" "),o.forEach((function(t){if(a.has(t.name)){var r=a.get(t.name),o=Ne(t);r!==o?n.push("".concat(i).concat(t.name,": ").concat(r)):e.hasProperty(e.defaultInitCompilerOptions,t.name)&&n.push("".concat(i).concat(t.name,": ").concat(o));}})),n.join(r)+r},e.generateTSConfig=function(t,r,n){var i=X(t);return function(){for(var t=e.createMultiMap(),s=0,c=e.optionDeclarations;s<c.length;s++){var l=c[s],u=l.category;o(l)&&t.add(e.getLocaleSpecificMessage(u),l);}var _=0,d=0,p=[];t.forEach((function(t,r){0!==p.length&&p.push({value:""}),p.push({value:"/* ".concat(r," */")});for(var n=0,a=t;n<a.length;n++){var o,s=a[n];o=i.has(s.name)?'"'.concat(s.name,'": ').concat(JSON.stringify(i.get(s.name))).concat((d+=1)===i.size?"":","):'// "'.concat(s.name,'": ').concat(JSON.stringify(Ne(s)),","),p.push({value:o,description:"/* ".concat(s.description&&e.getLocaleSpecificMessage(s.description)||s.name," */")}),_=Math.max(o.length,_);}}));var f=a(2),g=[];g.push("{"),g.push("".concat(f,'"compilerOptions": {')),g.push("".concat(f).concat(f,"/* ").concat(e.getLocaleSpecificMessage(e.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file)," */")),g.push("");for(var m=0,y=p;m<y.length;m++){var v=y[m],h=v.value,b=v.description,x=void 0===b?"":b;g.push(h&&"".concat(f).concat(f).concat(h).concat(x&&a(_-h.length+2)+x));}if(r.length){g.push("".concat(f,"},")),g.push("".concat(f,'"files": ['));for(var D=0;D<r.length;D++)g.push("".concat(f).concat(f).concat(JSON.stringify(r[D])).concat(D===r.length-1?"":","));g.push("".concat(f,"]"));}else g.push("".concat(f,"}"));return g.push("}"),g.join(n)+n}();function a(e){return Array(e+1).join(" ")}function o(t){var r=t.category,n=t.name,a=t.isCommandLineOnly,o=[e.Diagnostics.Command_line_Options,e.Diagnostics.Editor_Support,e.Diagnostics.Compiler_Diagnostics,e.Diagnostics.Backwards_Compatibility,e.Diagnostics.Watch_and_Build_Modes,e.Diagnostics.Output_Formatting];return !a&&void 0!==r&&(!o.includes(r)||i.has(n))}},e.convertToOptionsWithAbsolutePaths=function(t,r){var n={},i=c().optionsNameMap;for(var a in t)e.hasProperty(t,a)&&(n[a]=Y(i.get(a.toLowerCase()),t[a],r));return n.configFilePath&&(n.configFilePath=r(n.configFilePath)),n},e.parseJsonConfigFileContent=function(e,t,r,n,i,a,o,s,c){return re(e,void 0,t,r,n,c,i,a,o,s)},e.parseJsonSourceFileConfigFileContent=Z,e.setConfigFileInOptions=$,e.canJsonReportNoInputFiles=ae,e.updateErrorForNoInputFiles=function(t,r,n,i,a){var o=i.length;return ie(t,a)?i.push(ne(n,r)):e.filterMutate(i,(function(t){return !function(t){return t.code===e.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code}(t)})),o!==i.length},e.convertCompilerOptionsFromJson=function(e,t,r){var n=[];return {options:le(e,t,n,r),errors:n}},e.convertTypeAcquisitionFromJson=function(e,t,r){var n=[];return {options:_e(e,t,n,r),errors:n}},e.convertJsonOption=pe;var ve=/(^|\/)\*\*\/?$/,he=/^[^*?]*(?=\/[^/]*[*?])/;function be(t,r,n,i,a){void 0===a&&(a=e.emptyArray),r=e.normalizePath(r);var o,s=e.createGetCanonicalFileName(i.useCaseSensitiveFileNames),c=new e.Map,l=new e.Map,u=new e.Map,_=t.validatedFilesSpec,d=t.validatedIncludeSpecs,p=t.validatedExcludeSpecs,f=e.getSupportedExtensions(n,a),g=e.getSupportedExtensionsWithJsonIfResolveJsonModule(n,f);if(_)for(var m=0,y=_;m<y.length;m++){var v=y[m],h=e.getNormalizedAbsolutePath(v,r);c.set(s(h),h);}if(d&&d.length>0)for(var b=function(t){if(e.fileExtensionIs(t,".json")){if(!o){var n=d.filter((function(t){return e.endsWith(t,".json")})),a=e.map(e.getRegularExpressionsForWildcards(n,r,"files"),(function(e){return "^".concat(e,"$")}));o=a?a.map((function(t){return e.getRegexFromPattern(t,i.useCaseSensitiveFileNames)})):e.emptyArray;}if(-1!==e.findIndex(o,(function(e){return e.test(t)}))){var _=s(t);c.has(_)||u.has(_)||u.set(_,t);}return "continue"}if(function(t,r,n,i,a){var o=e.forEach(i,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(!o)return !1;for(var s=0,c=o;s<c.length;s++){var l=c[s];if(e.fileExtensionIs(t,l))return !1;var u=a(e.changeExtension(t,l));if(r.has(u)||n.has(u)){if(".d.ts"===l&&(e.fileExtensionIs(t,".js")||e.fileExtensionIs(t,".jsx")))continue;return !0}}return !1}(t,c,l,f,s))return "continue";!function(t,r,n,i){var a=e.forEach(n,(function(r){return e.fileExtensionIsOneOf(t,r)?r:void 0}));if(a)for(var o=a.length-1;o>=0;o--){var s=a[o];if(e.fileExtensionIs(t,s))return;var c=i(e.changeExtension(t,s));r.delete(c);}}(t,l,f,s);var p=s(t);c.has(p)||l.has(p)||l.set(p,t);},x=0,D=i.readDirectory(r,e.flatten(g),p,d,void 0);x<D.length;x++)b(h=D[x]);var S=e.arrayFrom(c.values()),T=e.arrayFrom(l.values());return S.concat(T,e.arrayFrom(u.values()))}function xe(t){var r=e.startsWith(t,"**/")?0:t.indexOf("/**/");return -1!==r&&(e.endsWith(t,"/..")?t.length:t.lastIndexOf("/../"))>r}function De(t,r,n,i,a){var o=e.getRegularExpressionForWildcard(r,e.combinePaths(e.normalizePath(i),a),"exclude"),s=o&&e.getRegexFromPattern(o,n);return !!s&&(!!s.test(t)||!e.hasExtension(t)&&s.test(e.ensureTrailingDirectorySeparator(t)))}function Se(t,r,n,i,a){return t.filter((function(t){if(!e.isString(t))return !1;var i=Te(t,n);return void 0!==i&&r.push(o.apply(void 0,i)),void 0===i}));function o(t,r){var n=e.getTsConfigPropArrayElementValue(i,a,r);return n?e.createDiagnosticForNodeInSourceFile(i,n,t,r):e.createCompilerDiagnostic(t,r)}}function Te(t,r){return r&&ve.test(t)?[e.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:xe(t)?[e.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0,t]:void 0}function Ce(t,r,n){var i=t.validatedIncludeSpecs,a=t.validatedExcludeSpecs,o=e.getRegularExpressionForWildcard(a,r,"exclude"),s=o&&new RegExp(o,n?"":"i"),c={};if(void 0!==i){for(var l=[],u=0,_=i;u<_.length;u++){var d=_[u],p=e.normalizePath(e.combinePaths(r,d));if(!s||!s.test(p)){var f=Ee(p,n);if(f){var g=f.key,m=f.flags,y=c[g];(void 0===y||y<m)&&(c[g]=m,1===m&&l.push(g));}}}for(var g in c)if(e.hasProperty(c,g))for(var v=0,h=l;v<h.length;v++){var b=h[v];g!==b&&e.containsPath(b,g,r,!n)&&delete c[g];}}return c}function Ee(t,r){var n=he.exec(t);if(n){var i=t.indexOf("?"),a=t.indexOf("*"),o=t.lastIndexOf(e.directorySeparator);return {key:r?n[0]:e.toFileNameLowerCase(n[0]),flags:-1!==i&&i<o||-1!==a&&a<o?1:0}}if(e.isImplicitGlob(t))return {key:r?t:e.toFileNameLowerCase(t),flags:1}}function ke(t,r){switch(r.type){case"object":case"string":return "";case"number":return "number"==typeof t?t:"";case"boolean":return "boolean"==typeof t?t:"";case"list":var n=r.element;return e.isArray(t)?t.map((function(e){return ke(e,n)})):"";default:return e.forEachEntry(r.type,(function(e,r){if(e===t)return r}))}}function Ne(t){switch(t.type){case"number":return 1;case"boolean":return !0;case"string":return t.isFilePath?"./":"";case"list":return [];case"object":return {};default:var r=t.type.keys().next();return r.done?e.Debug.fail("Expected 'option.type' to have entries."):r.value}}e.getFileNamesFromConfigSpecs=be,e.isExcludedFile=function(t,r,n,i,a){var o=r.validatedFilesSpec,s=r.validatedIncludeSpecs,c=r.validatedExcludeSpecs;if(!e.length(s)||!e.length(c))return !1;n=e.normalizePath(n);var l=e.createGetCanonicalFileName(i);if(o)for(var u=0,_=o;u<_.length;u++){var d=_[u];if(l(e.getNormalizedAbsolutePath(d,n))===t)return !1}return De(t,c,i,a,n)},e.matchesExclude=function(t,r,n,i){return De(t,e.filter(r,(function(e){return !xe(e)})),n,i)},e.convertCompilerOptionsForTelemetry=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=b(r);void 0!==n&&(t[r]=ke(e[r],n));}return t};}(t),function(e){function t(t){t.trace(e.formatMessage.apply(void 0,arguments));}function r(e,t){return !!e.traceResolution&&void 0!==t.trace}function a(t,r){var n;if(r&&t){var i=t.packageJsonContent;"string"==typeof i.name&&"string"==typeof i.version&&(n={name:i.name,subModuleName:r.path.slice(t.packageDirectory.length+e.directorySeparator.length),version:i.version});}return r&&{path:r.path,extension:r.ext,packageId:n}}function o(e){return a(void 0,e)}function s(t){if(t)return e.Debug.assert(void 0===t.packageId),{path:t.path,ext:t.extension}}var c,l;function u(t){if(t)return e.Debug.assert(e.extensionIsTS(t.extension)),{fileName:t.path,packageId:t.packageId}}function _(e,t,r,n){var i;return n?((i=n.failedLookupLocations).push.apply(i,r),n):{resolvedModule:e&&{resolvedFileName:e.path,originalPath:!0===e.originalPath?void 0:e.originalPath,extension:e.extension,isExternalLibraryImport:t,packageId:e.packageId},failedLookupLocations:r}}function d(r,n,i,a){if(e.hasProperty(r,n)){var o=r[n];if(typeof o===i&&null!==o)return o;a.traceEnabled&&t(a.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,n,i,null===o?"null":typeof o);}else a.traceEnabled&&t(a.host,e.Diagnostics.package_json_does_not_have_a_0_field,n);}function p(r,n,i,a){var o=d(r,n,"string",a);if(void 0!==o){if(o){var s=e.normalizePath(e.combinePaths(i,o));return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_0_field_1_that_references_2,n,o,s),s}a.traceEnabled&&t(a.host,e.Diagnostics.package_json_had_a_falsy_0_field,n);}}function f(e,t,r){return p(e,"typings",t,r)||p(e,"types",t,r)}function g(e,t,r){return p(e,"main",t,r)}function m(r,n){var i=function(r,n){var i=d(r,"typesVersions","object",n);if(void 0!==i)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings),i}(r,n);if(void 0!==i){if(n.traceEnabled)for(var a in i)e.hasProperty(i,a)&&!e.VersionRange.tryParse(a)&&t(n.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range,a);var o=y(i);if(o){var s=o.version,c=o.paths;if("object"==typeof c)return o;n.traceEnabled&&t(n.host,e.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2,"typesVersions['".concat(s,"']"),"object",typeof c);}else n.traceEnabled&&t(n.host,e.Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0,e.versionMajorMinor);}}function y(t){for(var r in l||(l=new e.Version(e.version)),t)if(e.hasProperty(t,r)){var n=e.VersionRange.tryParse(r);if(void 0!==n&&n.test(l))return {version:r,paths:t[r]}}}function v(t,r){return t.typeRoots?t.typeRoots:(t.configFilePath?n=e.getDirectoryPath(t.configFilePath):r.getCurrentDirectory&&(n=r.getCurrentDirectory()),void 0!==n?function(t,r){return r.directoryExists?(e.forEachAncestorDirectory(e.normalizePath(t),(function(t){var i=e.combinePaths(t,b);r.directoryExists(i)&&(n||(n=[])).push(i);})),n):[e.combinePaths(t,b)];var n;}(n,r):void 0);var n;}e.trace=t,e.isTraceEnabled=r,function(e){e[e.TypeScript=0]="TypeScript",e[e.JavaScript=1]="JavaScript",e[e.Json=2]="Json",e[e.TSConfig=3]="TSConfig",e[e.DtsOnly=4]="DtsOnly";}(c||(c={})),e.getPackageJsonTypesVersionsPaths=y,e.getEffectiveTypeRoots=v;var h,b=e.combinePaths("node_modules","@types");function x(t,r,n){var i="function"==typeof n.useCaseSensitiveFileNames?n.useCaseSensitiveFileNames():n.useCaseSensitiveFileNames;return 0===e.comparePaths(t,r,!i)}function D(t){var r=new e.Map,n=new e.Map;return {getOwnMap:function(){return r},redirectsMap:n,getOrCreateMapOfCacheRedirects:function(i){if(!i)return r;var a=i.sourceFile.path,o=n.get(a);return o||(o=!t||e.optionsHaveModuleResolutionChanges(t,i.commandLine.options)?new e.Map:r,n.set(a,o)),o},clear:function(){r.clear(),n.clear();},setOwnOptions:function(e){t=e;},setOwnMap:function(e){r=e;}}}function S(t,r){var n;return {getPackageJsonInfo:function(i){return null==n?void 0:n.get(e.toPath(i,t,r))},setPackageJsonInfo:function(i,a){(n||(n=new e.Map)).set(e.toPath(i,t,r),a);},clear:function(){n=void 0;},entries:function(){var t=null==n?void 0:n.entries();return t?e.arrayFrom(t):[]}}}function T(e,t,r,n){var i=e.getOrCreateMapOfCacheRedirects(t),a=i.get(r);return a||(a=n(),i.set(r,a)),a}function C(t,r,n){if(t.configFile){if(0===r.redirectsMap.size)e.Debug.assert(!n||0===n.redirectsMap.size),e.Debug.assert(0===r.getOwnMap().size),e.Debug.assert(!n||0===n.getOwnMap().size),r.redirectsMap.set(t.configFile.path,r.getOwnMap()),null==n||n.redirectsMap.set(t.configFile.path,n.getOwnMap());else {e.Debug.assert(!n||n.redirectsMap.size>0);var i={sourceFile:t.configFile,commandLine:{options:t}};r.setOwnMap(r.getOrCreateMapOfCacheRedirects(i)),null==n||n.setOwnMap(n.getOrCreateMapOfCacheRedirects(i));}r.setOwnOptions(t),null==n||n.setOwnOptions(t);}}function E(t,r,n){return {getOrCreateCacheForDirectory:function(i,a){var o=e.toPath(i,t,r);return T(n,a,o,(function(){return k()}))},clear:function(){n.clear();},update:function(e){C(e,n);}}}function k(){var t=new e.Map,r=new e.Map,n={get:function(e,r){return t.get(i(e,r))},set:function(e,r,a){return t.set(i(e,r),a),n},delete:function(e,r){return t.delete(i(e,r)),n},has:function(e,r){return t.has(i(e,r))},forEach:function(e){return t.forEach((function(t,n){var i=r.get(n),a=i[0],o=i[1];return e(t,a,o)}))},size:function(){return t.size}};return n;function i(e,t){var n=void 0===t?e:"".concat(t,"|").concat(e);return r.set(n,[e,t]),n}}function N(r,n,i,a,o){var s=function(r,n,i,a){var o,s=a.compilerOptions,c=s.baseUrl,l=s.paths,u=s.configFile;if(l&&!e.pathIsRelative(n))return a.traceEnabled&&(c&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,c,n),t(a.host,e.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0,n)),se(r,n,e.getPathsBasePath(a.compilerOptions,a.host),l,(null==u?void 0:u.configFileSpecs)?(o=u.configFileSpecs).pathPatterns||(o.pathPatterns=e.tryParsePatterns(l)):void 0,i,!1,a)}(r,n,a,o);return s?s.value:e.isExternalModuleNameRelative(n)?function(r,n,i,a,o){if(o.compilerOptions.rootDirs){o.traceEnabled&&t(o.host,e.Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0,n);for(var s,c,l=e.normalizePath(e.combinePaths(i,n)),u=0,_=o.compilerOptions.rootDirs;u<_.length;u++){var d=_[u],p=e.normalizePath(d);e.endsWith(p,e.directorySeparator)||(p+=e.directorySeparator);var f=e.startsWith(l,p)&&(void 0===c||c.length<p.length);o.traceEnabled&&t(o.host,e.Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2,p,l,f),f&&(c=p,s=d);}if(c){o.traceEnabled&&t(o.host,e.Diagnostics.Longest_matching_prefix_for_0_is_1,l,c);var g=l.substr(c.length);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,c,l);var m=a(r,l,!e.directoryProbablyExists(i,o.host),o);if(m)return m;o.traceEnabled&&t(o.host,e.Diagnostics.Trying_other_entries_in_rootDirs);for(var y=0,v=o.compilerOptions.rootDirs;y<v.length;y++)if((d=v[y])!==s){var h=e.combinePaths(e.normalizePath(d),g);o.traceEnabled&&t(o.host,e.Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2,g,d,h);var b=e.getDirectoryPath(h),x=a(r,h,!e.directoryProbablyExists(b,o.host),o);if(x)return x}o.traceEnabled&&t(o.host,e.Diagnostics.Module_resolution_using_rootDirs_has_failed);}}}(r,n,i,a,o):function(r,n,i,a){var o=a.compilerOptions.baseUrl;if(o){a.traceEnabled&&t(a.host,e.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1,o,n);var s=e.normalizePath(e.combinePaths(o,n));return a.traceEnabled&&t(a.host,e.Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2,n,o,s),i(r,s,!e.directoryProbablyExists(e.getDirectoryPath(s),a.host),a)}}(r,n,a,o)}function F(t,r,n,i,a,o,s,c){var l=e.getDirectoryPath(n);return L(t|(c===e.ModuleKind.ESNext?h.EsmMode:0),r,l,i,a,o,i.resolveJsonModule?w:P,s)}e.resolveTypeReferenceDirective=function(n,i,a,o,s,l){var _=r(a,o);s&&(a=s.commandLine.options);var d=i?e.getDirectoryPath(i):void 0,p=d?l&&l.getOrCreateCacheForDirectory(d,s):void 0,f=p&&p.get(n,void 0);if(f)return _&&(t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1,n,i),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName),t(o,e.Diagnostics.Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1,n,d),N(f)),f;var g=v(a,o);_&&(void 0===i?void 0===g?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set,n):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1,n,g):void 0===g?t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set,n,i):t(o,e.Diagnostics.Resolving_type_reference_directive_0_containing_file_1_root_directory_2,n,i,g),s&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,s.sourceFile.fileName));var m,y=[],b=e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Node12?h.Node12Default:e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.NodeNext?h.NodeNextDefault:h.None,D={compilerOptions:a,host:o,traceEnabled:_,failedLookupLocations:y,packageJsonInfoCache:l,features:b,conditions:["node","require","types"]},S=function(){if(g&&g.length)return _&&t(o,e.Diagnostics.Resolving_with_primary_search_path_0,g.join(", ")),e.firstDefined(g,(function(r){var i=e.combinePaths(r,n),a=e.getDirectoryPath(i),s=e.directoryProbablyExists(a,o);return !s&&_&&t(o,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,a),u(H(c.DtsOnly,i,!s,D))}));_&&t(o,e.Diagnostics.Root_directory_cannot_be_determined_skipping_primary_search_paths);}(),T=!0;if(S||(S=function(){var r=i&&e.getDirectoryPath(i);if(void 0!==r){var a;if(_&&t(o,e.Diagnostics.Looking_up_in_node_modules_folder_initial_location_0,r),e.isExternalModuleNameRelative(n)){var s=e.normalizePathAndParts(e.combinePaths(r,n)).path;a=B(c.DtsOnly,s,!1,D,!0);}else {var l=ne(c.DtsOnly,n,r,D,void 0,void 0);a=l&&l.value;}return u(a)}_&&t(o,e.Diagnostics.Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder);}(),T=!1),S){var C=S.fileName,E=S.packageId,k=a.preserveSymlinks?C:R(C,o,_);m={primary:T,resolvedFileName:k,originalPath:x(C,k,o)?void 0:C,packageId:E,isExternalLibraryImport:j(C)};}return f={resolvedTypeReferenceDirective:m,failedLookupLocations:y},null==p||p.set(n,void 0,f),_&&N(f),f;function N(r){var i;(null===(i=r.resolvedTypeReferenceDirective)||void 0===i?void 0:i.resolvedFileName)?r.resolvedTypeReferenceDirective.packageId?t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3,n,r.resolvedTypeReferenceDirective.resolvedFileName,e.packageIdToString(r.resolvedTypeReferenceDirective.packageId),r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2,n,r.resolvedTypeReferenceDirective.resolvedFileName,r.resolvedTypeReferenceDirective.primary):t(o,e.Diagnostics.Type_reference_directive_0_was_not_resolved,n);}},e.getAutomaticTypeDirectiveNames=function(t,r){if(t.types)return t.types;var n=[];if(r.directoryExists&&r.getDirectories){var i=v(t,r);if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];if(r.directoryExists(s))for(var c=0,l=r.getDirectories(s);c<l.length;c++){var u=l[c],_=e.normalizePath(u),d=e.combinePaths(s,_,"package.json");if(!r.fileExists(d)||null!==e.readJson(d,r).typings){var p=e.getBaseFileName(_);46!==p.charCodeAt(0)&&n.push(p);}}}}return n},e.createCacheWithRedirects=D,e.createModeAwareCache=k,e.zipToModeAwareCache=function(t,r,n){e.Debug.assert(r.length===n.length);for(var i=k(),a=0;a<r.length;++a)i.set(r[a],e.getModeForResolutionAtIndex(t,a),n[a]);return i},e.createModuleResolutionCache=function(t,r,n,a,o){var s=E(t,r,a||(a=D(n)));o||(o=D(n));var c=S(t,r);return i$1(i$1(i$1({},c),s),{getOrCreateCacheForModuleName:function(t,r,n){return e.Debug.assert(!e.isExternalModuleNameRelative(t)),T(o,n,void 0===r?t:"".concat(r,"|").concat(t),l)},clear:function(){s.clear(),o.clear(),c.clear();},update:function(e){C(e,a,o);},getPackageJsonInfoCache:function(){return c}});function l(){var n=new e.Map;return {get:function(i){return n.get(e.toPath(i,t,r))},set:function(i,a){var o=e.toPath(i,t,r);if(!n.has(o)){n.set(o,a);for(var s=a.resolvedModule&&(a.resolvedModule.originalPath||a.resolvedModule.resolvedFileName),c=s&&function(n,i){for(var a=e.toPath(e.getDirectoryPath(i),t,r),o=0,s=Math.min(n.length,a.length);o<s&&n.charCodeAt(o)===a.charCodeAt(o);)o++;if(o===n.length&&(a.length===o||a[o]===e.directorySeparator))return n;var c=e.getRootLength(n);if(!(o<c)){var l=n.lastIndexOf(e.directorySeparator,o-1);if(-1!==l)return n.substr(0,Math.max(l,c))}}(o,s),l=o;l!==c;){var u=e.getDirectoryPath(l);if(u===l||n.has(u))break;n.set(u,a),l=u;}}}}}},e.createTypeReferenceDirectiveResolutionCache=function(e,t,r,n,a){var o=E(e,t,a||(a=D(r)));return n||(n=S(e,t)),i$1(i$1(i$1({},n),o),{clear:function(){o.clear(),n.clear();}})},e.resolveModuleNameFromCache=function(t,r,n,i){var a=e.getDirectoryPath(r),o=n&&n.getOrCreateCacheForDirectory(a);if(o)return o.get(t,i)},e.resolveModuleName=function(n,i,a,o,s,c,l){var u=r(a,o);c&&(a=c.commandLine.options),u&&(t(o,e.Diagnostics.Resolving_module_0_from_1,n,i),c&&t(o,e.Diagnostics.Using_compiler_options_of_project_reference_redirect_0,c.sourceFile.fileName));var _=e.getDirectoryPath(i),d=s&&s.getOrCreateCacheForDirectory(_,c),p=d&&d.get(n,l);if(p)u&&t(o,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,_);else {var f=a.moduleResolution;if(void 0===f){switch(e.getEmitModuleKind(a)){case e.ModuleKind.CommonJS:f=e.ModuleResolutionKind.NodeJs;break;case e.ModuleKind.Node12:f=e.ModuleResolutionKind.Node12;break;case e.ModuleKind.NodeNext:f=e.ModuleResolutionKind.NodeNext;break;default:f=e.ModuleResolutionKind.Classic;}u&&t(o,e.Diagnostics.Module_resolution_kind_is_not_specified_using_0,e.ModuleResolutionKind[f]);}else u&&t(o,e.Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0,e.ModuleResolutionKind[f]);switch(e.perfLogger.logStartResolveModule(n),f){case e.ModuleResolutionKind.Node12:p=function(e,t,r,n,i,a,o){return F(h.Node12Default,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeNext:p=function(e,t,r,n,i,a,o){return F(h.NodeNextDefault,e,t,r,n,i,a,o)}(n,i,a,o,s,c,l);break;case e.ModuleResolutionKind.NodeJs:p=M(n,i,a,o,s,c);break;case e.ModuleResolutionKind.Classic:p=de(n,i,a,o,s,c);break;default:return e.Debug.fail("Unexpected moduleResolution: ".concat(f))}p&&p.resolvedModule&&e.perfLogger.logInfoEvent('Module "'.concat(n,'" resolved to "').concat(p.resolvedModule.resolvedFileName,'"')),e.perfLogger.logStopResolveModule(p&&p.resolvedModule?""+p.resolvedModule.resolvedFileName:"null"),d&&(d.set(n,l,p),e.isExternalModuleNameRelative(n)||s.getOrCreateCacheForModuleName(n,l,c).set(_,p));}return u&&(p.resolvedModule?p.resolvedModule.packageId?t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2,n,p.resolvedModule.resolvedFileName,e.packageIdToString(p.resolvedModule.packageId)):t(o,e.Diagnostics.Module_name_0_was_successfully_resolved_to_1,n,p.resolvedModule.resolvedFileName):t(o,e.Diagnostics.Module_name_0_was_not_resolved,n)),p},e.resolveJSModule=function(e,t,r){var n=O(e,t,r),i=n.resolvedModule,a=n.failedLookupLocations;if(!i)throw new Error("Could not resolve JS module '".concat(e,"' starting at '").concat(t,"'. Looked in: ").concat(a.join(", ")));return i.resolvedFileName},e.tryResolveJSModule=function(e,t,r){return O(e,t,r).resolvedModule},function(e){e[e.None=0]="None",e[e.Imports=2]="Imports",e[e.SelfName=4]="SelfName",e[e.Exports=8]="Exports",e[e.ExportsPatternTrailers=16]="ExportsPatternTrailers",e[e.AllFeatures=30]="AllFeatures",e[e.Node12Default=14]="Node12Default",e[e.NodeNextDefault=30]="NodeNextDefault",e[e.EsmMode=32]="EsmMode";}(h||(h={}));var A=[c.JavaScript],P=[c.TypeScript,c.JavaScript],w=n$3(n$3([],P,!0),[c.Json],!1),I=[c.TSConfig];function O(t,r,n){return L(h.None,t,r,{moduleResolution:e.ModuleResolutionKind.NodeJs,allowJs:!0},n,void 0,A,void 0)}function M(t,r,n,i,a,o,s){return L(h.None,t,e.getDirectoryPath(r),n,i,a,s?I:n.resolveJsonModule?w:P,o)}function L(n,a,o,s,l,u,d,p){var f,g,m=r(s,l),y=[],v={compilerOptions:s,host:l,traceEnabled:m,failedLookupLocations:y,packageJsonInfoCache:u,features:n,conditions:n&h.EsmMode?["node","import","types"]:["node","require","types"]},b=e.forEach(d,(function(r){return function(r){var _,d=N(r,a,o,(function(e,t,r,n){return B(e,t,r,n,!0)}),v);if(d)return pe({resolved:d,isExternalLibraryImport:j(d.path)});if(e.isExternalModuleNameRelative(a)){var f=e.normalizePathAndParts(e.combinePaths(o,a)),g=f.path,y=f.parts,b=B(r,g,!1,v,!0);return b&&pe({resolved:b,isExternalLibraryImport:e.contains(y,"node_modules")})}if(n&h.Imports&&e.startsWith(a,"#")&&(_=function(r,n,i,a,o,s){var c,l;if("#"===n||e.startsWith(n,"#/"))return a.traceEnabled&&t(a.host,e.Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions,n),pe(void 0);var u="function"==typeof a.host.useCaseSensitiveFileNames?a.host.useCaseSensitiveFileNames():a.host.useCaseSensitiveFileNames,_=e.toPath(e.combinePaths(i,"dummy"),null===(l=(c=a.host).getCurrentDirectory)||void 0===l?void 0:l.call(c),e.createGetCanonicalFileName(void 0===u||u)),d=G(_,a.packageJsonInfoCache,a.host,a.compilerOptions);if(!d)return a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve,_),pe(void 0);if(!d.packageJsonContent.imports)return a.traceEnabled&&t(a.host,e.Diagnostics.package_json_scope_0_has_no_imports_defined,d.packageDirectory),pe(void 0);var p=ee(r,a,o,s,n,d.packageJsonContent.imports,d,!0);return p||(a.traceEnabled&&t(a.host,e.Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1,n,d.packageDirectory),pe(void 0))}(r,a,o,v,u,p)),!_&&n&h.SelfName&&(_=function(t,r,n,i,a,o){var s,c,l="function"==typeof i.host.useCaseSensitiveFileNames?i.host.useCaseSensitiveFileNames():i.host.useCaseSensitiveFileNames,u=G(e.toPath(e.combinePaths(n,"dummy"),null===(c=(s=i.host).getCurrentDirectory)||void 0===c?void 0:c.call(s),e.createGetCanonicalFileName(void 0===l||l)),i.packageJsonInfoCache,i.host,i.compilerOptions);if(u&&u.packageJsonContent.exports&&"string"==typeof u.packageJsonContent.name){var _=e.getPathComponents(r),d=e.getPathComponents(u.packageJsonContent.name);if(e.every(d,(function(e,t){return _[t]===e}))){var p=_.slice(d.length);return $(u,t,e.length(p)?".".concat(e.directorySeparator).concat(p.join(e.directorySeparator)):".",i,a,o)}}}(r,a,o,v,u,p)),_||(m&&t(l,e.Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1,a,c[r]),_=ne(r,a,o,v,u,p)),_){var D=_.value;if(!s.preserveSymlinks&&D&&!D.originalPath){var S=R(D.path,l,m),T=x(S,D.path,l)?void 0:D.path;D=i$1(i$1({},D),{path:S,originalPath:T});}return {value:D&&{resolved:D,isExternalLibraryImport:!0}}}}(r)}));return _(null===(f=null==b?void 0:b.value)||void 0===f?void 0:f.resolved,null===(g=null==b?void 0:b.value)||void 0===g?void 0:g.isExternalLibraryImport,y,v.resultFromCache)}function R(r,n,i){if(!n.realpath)return r;var a=e.normalizePath(n.realpath(r));return i&&t(n,e.Diagnostics.Resolving_real_path_for_0_result_1,r,a),e.Debug.assert(n.fileExists(a),"".concat(r," linked to nonexistent file ").concat(a)),a}function B(r,n,i,o,s){if(o.traceEnabled&&t(o.host,e.Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1,n,c[r]),!e.hasTrailingDirectorySeparator(n)){if(!i){var l=e.getDirectoryPath(n);e.directoryProbablyExists(l,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,l),i=!0);}var u=K(r,n,i,o);if(u){var _=s?J(u.path):void 0;return a(_?Q(_,!1,o):void 0,u)}}return i||e.directoryProbablyExists(n,o.host)||(o.traceEnabled&&t(o.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,n),i=!0),H(r,n,i,o,s)}function j(t){return e.stringContains(t,e.nodeModulesPathPart)}function J(t){var r=e.normalizePath(t),n=r.lastIndexOf(e.nodeModulesPathPart);if(-1!==n){var i=n+e.nodeModulesPathPart.length,a=z(r,i);return 64===r.charCodeAt(i)&&(a=z(r,a)),r.slice(0,a)}}function z(t,r){var n=t.indexOf(e.directorySeparator,r+1);return -1===n?r:n}function U(e,t,r,n){return o(K(e,t,r,n))}function K(t,r,n,i){if(t===c.Json||t===c.TSConfig){var a=e.tryRemoveExtension(r,".json"),o=a?r.substring(a.length):"";return void 0===a&&t===c.Json?void 0:q(a||r,t,o,n,i)}if(!(i.features&h.EsmMode)){var s=q(r,t,"",n,i);if(s)return s}return V(t,r,n,i)}function V(r,n,i,a){if(e.hasJSFileExtension(n)||e.fileExtensionIs(n,".json")&&a.compilerOptions.resolveJsonModule){var o=e.removeFileExtension(n),s=n.substring(o.length);return a.traceEnabled&&t(a.host,e.Diagnostics.File_name_0_has_a_1_extension_stripping_it,n,s),q(o,r,s,i,a)}}function q(t,r,n,i,a){if(!i){var o=e.getDirectoryPath(t);o&&(i=!e.directoryProbablyExists(o,a.host));}switch(r){case c.DtsOnly:switch(n){case".mjs":case".mts":case".d.mts":return s(".d.mts");case".cjs":case".cts":case".d.cts":return s(".d.cts");case".json":return t+=".json",s(".d.ts");default:return s(".d.ts")}case c.TypeScript:switch(n){case".mjs":case".mts":case".d.mts":return s(".mts")||s(".d.mts");case".cjs":case".cts":case".d.cts":return s(".cts")||s(".d.cts");case".json":return t+=".json",s(".d.ts");default:return s(".ts")||s(".tsx")||s(".d.ts")}case c.JavaScript:switch(n){case".mjs":case".mts":case".d.mts":return s(".mjs");case".cjs":case".cts":case".d.cts":return s(".cjs");case".json":return s(".json");default:return s(".js")||s(".jsx")}case c.TSConfig:case c.Json:return s(".json")}function s(e){var r=W(t+e,i,a);return void 0===r?void 0:{path:r,ext:e}}}function W(r,n,i){if(!n){if(i.host.fileExists(r))return i.traceEnabled&&t(i.host,e.Diagnostics.File_0_exist_use_it_as_a_name_resolution_result,r),r;i.traceEnabled&&t(i.host,e.Diagnostics.File_0_does_not_exist,r);}i.failedLookupLocations.push(r);}function H(e,t,r,n,i){void 0===i&&(i=!0);var o=i?Q(t,r,n):void 0;return a(o,X(e,t,r,n,o&&o.packageJsonContent,o&&o.versionPaths))}function G(t,n,i,a){var o={host:i,compilerOptions:a,traceEnabled:r(a,i),failedLookupLocations:[],packageJsonInfoCache:n,features:0,conditions:[]},s=e.getPathComponents(t);for(s.pop();s.length>0;){var c=Q(e.getPathFromPathComponents(s),!1,o);if(c)return c;s.pop();}}function Q(r,n,i){var a,o,s,c=i.host,l=i.traceEnabled,u=e.combinePaths(r,"package.json");if(n)i.failedLookupLocations.push(u);else {var _=null===(a=i.packageJsonInfoCache)||void 0===a?void 0:a.getPackageJsonInfo(u);if(void 0!==_)return "boolean"!=typeof _?(l&&t(c,e.Diagnostics.File_0_exists_according_to_earlier_cached_lookups,u),_):(_&&l&&t(c,e.Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups,u),void i.failedLookupLocations.push(u));var d=e.directoryProbablyExists(r,c);if(d&&c.fileExists(u)){var p=e.readJson(u,c);l&&t(c,e.Diagnostics.Found_package_json_at_0,u);var f={packageDirectory:r,packageJsonContent:p,versionPaths:m(p,i)};return null===(o=i.packageJsonInfoCache)||void 0===o||o.setPackageJsonInfo(u,f),f}d&&l&&t(c,e.Diagnostics.File_0_does_not_exist,u),null===(s=i.packageJsonInfoCache)||void 0===s||s.setPackageJsonInfo(u,d),i.failedLookupLocations.push(u);}}function X(r,n,i,a,l,u){var _;if(l)switch(r){case c.JavaScript:case c.Json:_=g(l,n,a);break;case c.TypeScript:_=f(l,n,a)||g(l,n,a);break;case c.DtsOnly:_=f(l,n,a);break;case c.TSConfig:_=function(e,t,r){return p(e,"tsconfig",t,r)}(l,n,a);break;default:return e.Debug.assertNever(r)}var d=function(r,n,i,a){var s=W(n,i,a);if(s){var l=function(t,r){var n=e.tryGetExtensionFromPath(r);return void 0!==n&&function(e,t){switch(e){case c.JavaScript:return ".js"===t||".jsx"===t;case c.TSConfig:case c.Json:return ".json"===t;case c.TypeScript:return ".ts"===t||".tsx"===t||".d.ts"===t;case c.DtsOnly:return ".d.ts"===t}}(t,n)?{path:r,ext:n}:void 0}(r,s);if(l)return o(l);a.traceEnabled&&t(a.host,e.Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it,s);}return B(r===c.DtsOnly?c.TypeScript:r,n,i,a,!1)},m=_?!e.directoryProbablyExists(e.getDirectoryPath(_),a.host):void 0,y=i||!e.directoryProbablyExists(n,a.host),v=e.combinePaths(n,r===c.TSConfig?"tsconfig":"index");if(u&&(!_||e.containsPath(n,_))){var b=e.getRelativePathFromDirectory(n,_||v,!1);a.traceEnabled&&t(a.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,u.version,e.version,b);var x=se(r,b,n,u.paths,void 0,d,m||y,a);if(x)return s(x.value)}return _&&s(d(r,_,m,a))||(a.features&h.EsmMode?void 0:K(r,v,y,a))}function Y(t){var r=t.indexOf(e.directorySeparator);return "@"===t[0]&&(r=t.indexOf(e.directorySeparator,r+1)),-1===r?{packageName:t,rest:""}:{packageName:t.slice(0,r),rest:t.slice(r+1)}}function Z(t){return e.every(e.getOwnKeys(t),(function(t){return e.startsWith(t,".")}))}function $(r,n,i,a,o,s){if(r.packageJsonContent.exports){if("."===i){var c=void 0;if("string"==typeof r.packageJsonContent.exports||Array.isArray(r.packageJsonContent.exports)||"object"==typeof r.packageJsonContent.exports&&(u=r.packageJsonContent.exports,!e.some(e.getOwnKeys(u),(function(t){return e.startsWith(t,".")})))?c=r.packageJsonContent.exports:e.hasProperty(r.packageJsonContent.exports,".")&&(c=r.packageJsonContent.exports["."]),c)return te(n,a,o,s,i,r,!1)(c,"",!1)}else if(Z(r.packageJsonContent.exports)){if("object"!=typeof r.packageJsonContent.exports)return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),pe(void 0);var l=ee(n,a,o,s,i,r.packageJsonContent.exports,r,!1);if(l)return l}var u;return a.traceEnabled&&t(a.host,e.Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1,i,r.packageDirectory),pe(void 0)}}function ee(t,r,n,i,a,o,s,c){var l=te(t,r,n,i,a,s,c);if(!e.endsWith(a,e.directorySeparator)&&-1===a.indexOf("*")&&e.hasProperty(o,a))return l(p=o[a],"",!1);for(var u=0,_=e.sort(e.filter(e.getOwnKeys(o),(function(t){return -1!==t.indexOf("*")||e.endsWith(t,"/")})),(function(e,t){return e.length-t.length}));u<_.length;u++){var d=_[u];if(r.features&h.ExportsPatternTrailers&&g(d,a)){var p=o[d],f=d.indexOf("*");return l(p,a.substring(d.substring(0,f).length,a.length-(d.length-1-f)),!0)}if(e.endsWith(d,"*")&&e.startsWith(a,d.substring(0,d.length-1)))return l(p=o[d],a.substring(d.length-1),!0);if(e.startsWith(a,d))return l(p=o[d],a.substring(d.length),!1)}function g(t,r){if(e.endsWith(t,"*"))return !1;var n=t.indexOf("*");return -1!==n&&e.startsWith(r,t.substring(0,n))&&e.endsWith(r,t.substring(n+1))}}function te(r,n,i,o,s,l,u){return function _(d,p,f){var g,m;if("string"==typeof d){if(!f&&p.length>0&&!e.endsWith(d,"/"))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);if(!e.startsWith(d,"./")){if(u&&!e.startsWith(d,"../")&&!e.startsWith(d,"/")&&!e.isRootedDiskPath(d)){var y=f?d.replace(/\*/g,p):d+p;return pe((k=L(n.features,y,l.packageDirectory+"/",n.compilerOptions,n.host,i,[r],o)).resolvedModule?{path:k.resolvedModule.resolvedFileName,extension:k.resolvedModule.extension,packageId:k.resolvedModule.packageId,originalPath:k.resolvedModule.originalPath}:void 0)}return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0)}var v=(e.pathIsRelative(d)?e.getPathComponents(d).slice(1):e.getPathComponents(d)).slice(1);if(v.indexOf("..")>=0||v.indexOf(".")>=0||v.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);var h=e.combinePaths(l.packageDirectory,d),b=e.getPathComponents(p);if(b.indexOf("..")>=0||b.indexOf(".")>=0||b.indexOf("node_modules")>=0)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);var x=e.getNormalizedAbsolutePath(f?h.replace(/\*/g,p):h+p,null===(m=(g=n.host).getCurrentDirectory)||void 0===m?void 0:m.call(g));return pe(a(l,function(t,r,n,i){return t!==c.TypeScript&&t!==c.DtsOnly||!e.fileExtensionIsOneOf(r,[".d.ts",".d.cts",".d.mts"])?V(t,r,false,i):void 0!==W(r,false,i)?{path:r,ext:e.forEach([".d.ts",".d.cts",".d.mts"],(function(t){return e.fileExtensionIs(r,t)?t:void 0}))}:void 0}(r,x,0,n)))}if("object"==typeof d&&null!==d){if(!Array.isArray(d)){for(var D=0,S=e.getOwnKeys(d);D<S.length;D++){var T=S[D];if("default"===T||n.conditions.indexOf(T)>=0||re(n.conditions,T))if(k=_(d[T],p,f))return k}return}if(!e.length(d))return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0);for(var C=0,E=d;C<E.length;C++){var k;if(k=_(E[C],p,f))return k}}else if(null===d)return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null,l.packageDirectory,s),pe(void 0);return n.traceEnabled&&t(n.host,e.Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1,l.packageDirectory,s),pe(void 0)}}function re(t,r){if(-1===t.indexOf("types"))return !1;if(!e.startsWith(r,"types@"))return !1;var n=e.VersionRange.tryParse(r.substring("types@".length));return !!n&&n.test(e.version)}function ne(e,t,r,n,i,a){return ie(e,t,r,n,!1,i,a)}function ie(t,r,n,i,a,o,s){var c=o&&o.getOrCreateCacheForModuleName(r,0===i.features?void 0:i.features&h.EsmMode?e.ModuleKind.ESNext:e.ModuleKind.CommonJS,s);return e.forEachAncestorDirectory(e.normalizeSlashes(n),(function(n){if("node_modules"!==e.getBaseFileName(n))return _e(c,r,n,i)||pe(ae(t,r,n,i,a,o,s))}))}function ae(r,n,i,a,o,s,l){var u=e.combinePaths(i,"node_modules"),_=e.directoryProbablyExists(u,a.host);!_&&a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,u);var d=o?void 0:oe(r,n,u,_,a,s,l);if(d)return d;if(r===c.TypeScript||r===c.DtsOnly){var p=e.combinePaths(u,"@types"),f=_;return _&&!e.directoryProbablyExists(p,a.host)&&(a.traceEnabled&&t(a.host,e.Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it,p),f=!1),oe(c.DtsOnly,function(r,n){var i=le(r);return n.traceEnabled&&i!==r&&t(n.host,e.Diagnostics.Scoped_package_detected_looking_in_0,i),i}(n,a),p,f,a,s,l)}}function oe(r,n,i,s,c,l,u){var _=e.normalizePath(e.combinePaths(i,n)),d=Q(_,!s,c);if(!(c.features&h.Exports)&&d){var p=K(r,_,!s,c);if(p)return o(p);var f=X(r,_,!s,c,d.packageJsonContent,d.versionPaths);return a(d,f)}var g=Y(n),m=g.packageName,y=g.rest,v=function(t,r,n,i){var o;if(d&&d.packageJsonContent.exports&&i.features&h.Exports)return null===(o=$(d,t,e.combinePaths(".",y),i,l,u))||void 0===o?void 0:o.value;var s=K(t,r,n,i)||X(t,r,n,i,d&&d.packageJsonContent,d&&d.versionPaths);return a(d,s)};if(""!==y){var b=e.combinePaths(i,m);if((d=Q(b,!s,c))&&d.versionPaths){c.traceEnabled&&t(c.host,e.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2,d.versionPaths.version,e.version,y);var x=s&&e.directoryProbablyExists(b,c.host),D=se(r,y,b,d.versionPaths.paths,void 0,v,!x,c);if(D)return D.value}}return v(r,_,!s,c)}function se(r,n,i,a,s,c,l,u){s||(s=e.tryParsePatterns(a));var _=e.matchPatternOrExact(s,n);if(_){var d=e.isString(_)?void 0:e.matchedText(_,n),p=e.isString(_)?_:e.patternText(_);return u.traceEnabled&&t(u.host,e.Diagnostics.Module_name_0_matched_pattern_1,n,p),{value:e.forEach(a[p],(function(n){var a=d?n.replace("*",d):n,s=e.normalizePath(e.combinePaths(i,a));u.traceEnabled&&t(u.host,e.Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1,n,a);var _=e.tryGetExtensionFromPath(n);if(void 0!==_){var p=W(s,l,u);if(void 0!==p)return o({path:p,ext:_})}return c(r,s,l||!e.directoryProbablyExists(e.getDirectoryPath(s),u.host),u)}))}}}e.nodeModuleNameResolver=M,e.nodeModulesPathPart="/node_modules/",e.pathContainsNodeModules=j,e.parseNodeModuleFromPath=J,e.getPackageScopeForPath=G,e.getPackageJsonInfo=Q,e.parsePackageName=Y,e.allKeysStartWithDot=Z,e.isApplicableVersionedTypesKey=re;var ce="__";function le(t){if(e.startsWith(t,"@")){var r=t.replace(e.directorySeparator,ce);if(r!==t)return r.slice(1)}return t}function ue(t){return e.stringContains(t,ce)?"@"+t.replace(ce,e.directorySeparator):t}function _e(r,n,i,a){var o=r&&r.get(i);if(o)return a.traceEnabled&&t(a.host,e.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1,n,i),a.resultFromCache=o,{value:o.resolvedModule&&{path:o.resolvedModule.resolvedFileName,originalPath:o.resolvedModule.originalPath||!0,extension:o.resolvedModule.extension,packageId:o.resolvedModule.packageId}}}function de(t,n,i,a,o,s){var l=[],u={compilerOptions:i,host:a,traceEnabled:r(i,a),failedLookupLocations:l,packageJsonInfoCache:o,features:h.None,conditions:[]},d=e.getDirectoryPath(n),p=f(c.TypeScript)||f(c.JavaScript);return _(p&&p.value,!1,l,u.resultFromCache);function f(r){var n=N(r,t,d,U,u);if(n)return {value:n};if(e.isExternalModuleNameRelative(t)){var i=e.normalizePath(e.combinePaths(d,t));return pe(U(r,i,!1,u))}var a=o&&o.getOrCreateCacheForModuleName(t,void 0,s);return e.forEachAncestorDirectory(d,(function(n){var i=_e(a,t,n,u);if(i)return i;var o=e.normalizePath(e.combinePaths(n,t));return pe(U(r,o,!1,u))}))||(r===c.TypeScript?function(e,t,r){return ie(c.DtsOnly,e,t,r,!0,void 0,void 0)}(t,d,u):void 0)}}function pe(e){return void 0!==e?{value:e}:void 0}e.getTypesPackageName=function(e){return "@types/".concat(le(e))},e.mangleScopedPackageName=le,e.getPackageNameFromTypesPackageName=function(t){var r=e.removePrefix(t,"@types/");return r!==t?ue(r):t},e.unmangleScopedPackageName=ue,e.classicNameResolver=de,e.loadModuleFromGlobalCache=function(n,i,a,o,s,l){var u=r(a,o);u&&t(o,e.Diagnostics.Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2,i,n,s);var d=[],p={compilerOptions:a,host:o,traceEnabled:u,failedLookupLocations:d,packageJsonInfoCache:l,features:h.None,conditions:[]};return _(ae(c.DtsOnly,n,s,p,!1,void 0,void 0),!0,d,p.resultFromCache)};}(t),function(e){var t,r;function a(t,r){return t.body&&!t.body.parent&&(e.setParent(t.body,t),e.setParentRecursive(t.body,!1)),t.body?o(t.body,r):1}function o(t,r){void 0===r&&(r=new e.Map);var n=e.getNodeId(t);if(r.has(n))return r.get(n)||0;r.set(n,void 0);var i=function(t,r){switch(t.kind){case 257:case 258:return 0;case 259:if(e.isEnumConst(t))return 2;break;case 265:case 264:if(!e.hasSyntacticModifier(t,1))return 0;break;case 271:var n=t;if(!n.moduleSpecifier&&n.exportClause&&272===n.exportClause.kind){for(var i=0,c=0,l=n.exportClause.elements;c<l.length;c++){var u=s(l[c],r);if(u>i&&(i=u),1===i)return i}return i}break;case 261:var _=0;return e.forEachChild(t,(function(t){var n=o(t,r);switch(n){case 0:return;case 2:return void(_=2);case 1:return _=1,!0;default:e.Debug.assertNever(n);}})),_;case 260:return a(t,r);case 79:if(t.isInJSDocNamespace)return 0}return 1}(t,r);return r.set(n,i),i}function s(t,r){for(var n=t.propertyName||t.name,i=t.parent;i;){if(e.isBlock(i)||e.isModuleBlock(i)||e.isSourceFile(i)){for(var a=void 0,s=0,c=i.statements;s<c.length;s++){var l=c[s];if(e.nodeHasName(l,n)){l.parent||(e.setParent(l,i),e.setParentRecursive(l,!1));var u=o(l,r);if((void 0===a||u>a)&&(a=u),1===a)return a}}if(void 0!==a)return a}i=i.parent;}return 1}function c(t){return e.Debug.attachFlowNodeDebugInfo(t),t}(r=e.ModuleInstanceState||(e.ModuleInstanceState={}))[r.NonInstantiated=0]="NonInstantiated",r[r.Instantiated=1]="Instantiated",r[r.ConstEnumOnly=2]="ConstEnumOnly",e.getModuleInstanceState=a,function(e){e[e.None=0]="None",e[e.IsContainer=1]="IsContainer",e[e.IsBlockScopedContainer=2]="IsBlockScopedContainer",e[e.IsControlFlowContainer=4]="IsControlFlowContainer",e[e.IsFunctionLike=8]="IsFunctionLike",e[e.IsFunctionExpression=16]="IsFunctionExpression",e[e.HasLocals=32]="HasLocals",e[e.IsInterface=64]="IsInterface",e[e.IsObjectLiteralOrClassExpressionMethodOrAccessor=128]="IsObjectLiteralOrClassExpressionMethodOrAccessor";}(t||(t={}));var l=function(){var t,r,o,s,l,p,f,g,m,y,v,h,b,x,D,S,T,C,E,k,N,F,A,P,w=!1,I=0,O={flags:1},M={flags:1},L=function(){return e.createBinaryExpressionTrampoline((function(t,r){if(r){r.stackIndex++,e.setParent(t,s);var n=F;je(t);var i=s;s=t,r.skip=!1,r.inStrictModeStack[r.stackIndex]=n,r.parentStack[r.stackIndex]=i;}else r={stackIndex:0,skip:!1,inStrictModeStack:[void 0],parentStack:[void 0]};var a=t.operatorToken.kind;if(55===a||56===a||60===a||e.isLogicalOrCoalescingAssignmentOperator(a)){if(_e(t)){var o=$();be(t,o,o),v=ce(o);}else be(t,D,S);r.skip=!0;}return r}),(function(e,r,n){if(!r.skip)return t(e)}),(function(e,t,r){t.skip||(27===e.kind&&ye(r.left),Le(e));}),(function(e,r,n){if(!r.skip)return t(e)}),(function(t,r){if(!r.skip){var n=t.operatorToken.kind;e.isAssignmentOperator(n)&&!e.isAssignmentTarget(t)&&(he(t.left),63===n&&206===t.left.kind&&Z(t.left.expression)&&(v=oe(256,v,t)));}var i=r.inStrictModeStack[r.stackIndex],a=r.parentStack[r.stackIndex];void 0!==i&&(F=i),void 0!==a&&(s=a),r.skip=!1,r.stackIndex--;}),void 0);function t(t){if(t&&e.isBinaryExpression(t)&&!e.isDestructuringAssignment(t))return t;Le(t);}}();function R(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(e.getSourceFileOfNode(r)||t,r,n,i,a,o)}return function(n,i){t=n,r=i,o=e.getEmitScriptTarget(r),F=function(t,r){return !(!e.getStrictOptionValue(r,"alwaysStrict")||t.isDeclarationFile)||!!t.externalModuleIndicator}(t,i),P=new e.Set,I=0,A=e.objectAllocator.getSymbolConstructor(),e.Debug.attachFlowNodeDebugInfo(O),e.Debug.attachFlowNodeDebugInfo(M),t.locals||(Le(t),t.symbolCount=I,t.classifiableNames=P,function(){if(m){for(var r=l,n=g,i=f,a=s,o=v,u=0,d=m;u<d.length;u++){var p=d[u],y=p.parent.parent;l=e.findAncestor(y.parent,(function(e){return !!(1&Ce(e))}))||t,f=e.getEnclosingBlockScopeContainer(y)||t,v=c({flags:2}),s=p,Le(p.typeExpression);var h=e.getNameOfDeclaration(p);if((e.isJSDocEnumTag(p)||!p.fullName)&&h&&e.isPropertyAccessEntityNameExpression(h.parent)){var b=Ye(h.parent);if(b){Qe(t.symbol,h.parent,b,!!e.findAncestor(h,(function(t){return e.isPropertyAccessExpression(t)&&"prototype"===t.name.escapedText})),!1);var x=l;switch(e.getAssignmentDeclarationPropertyAccessKind(h.parent)){case 1:case 2:l=e.isExternalOrCommonJsModule(t)?t:void 0;break;case 4:l=h.parent.expression;break;case 3:l=h.parent.expression.name;break;case 5:l=_(t,h.parent.expression)?t:e.isPropertyAccessExpression(h.parent.expression)?h.parent.expression.name:h.parent.expression;break;case 0:return e.Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration")}l&&K(p,524288,788968),l=x;}}else e.isJSDocEnumTag(p)||!p.fullName||79===p.fullName.kind?(s=p.parent,Pe(p,524288,788968)):Le(p.fullName);}l=r,g=n,f=i,s=a,v=o;}}()),t=void 0,r=void 0,o=void 0,s=void 0,l=void 0,p=void 0,f=void 0,g=void 0,m=void 0,y=!1,v=void 0,h=void 0,b=void 0,x=void 0,D=void 0,S=void 0,T=void 0,E=void 0,k=!1,w=!1,N=0;};function B(e,t){return I++,new A(e,t)}function j(t,r,n){t.flags|=n,r.symbol=t,t.declarations=e.appendIfUnique(t.declarations,r),1955&n&&!t.exports&&(t.exports=e.createSymbolTable()),6240&n&&!t.members&&(t.members=e.createSymbolTable()),t.constEnumOnlyModule&&304&t.flags&&(t.constEnumOnlyModule=!1),111551&n&&e.setValueDeclaration(t,r);}function J(t){if(270===t.kind)return t.isExportEquals?"export=":"default";var r=e.getNameOfDeclaration(t);if(r){if(e.isAmbientModule(t)){var n=e.getTextOfIdentifierOrLiteral(r);return e.isGlobalScopeAugmentation(t)?"__global":'"'.concat(n,'"')}if(161===r.kind){var i=r.expression;if(e.isStringOrNumericLiteralLike(i))return e.escapeLeadingUnderscores(i.text);if(e.isSignedNumericLiteral(i))return e.tokenToString(i.operator)+i.operand.text;e.Debug.fail("Only computed properties with literal names have declaration names");}if(e.isPrivateIdentifier(r)){var a=e.getContainingClass(t);if(!a)return;var o=a.symbol;return e.getSymbolNameForPrivateIdentifier(o,r.escapedText)}return e.isPropertyNameLiteral(r)?e.getEscapedTextOfIdentifierOrLiteral(r):void 0}switch(t.kind){case 170:return "__constructor";case 178:case 173:case 321:return "__call";case 179:case 174:return "__new";case 175:return "__index";case 271:return "__export";case 303:return "export=";case 220:if(2===e.getAssignmentDeclarationKind(t))return "export=";e.Debug.fail("Unknown binary declaration kind");break;case 315:return e.isJSDocConstructSignature(t)?"__new":"__call";case 163:return e.Debug.assert(315===t.parent.kind,"Impossible parameter parent kind",(function(){return "parent is: ".concat(e.SyntaxKind?e.SyntaxKind[t.parent.kind]:t.parent.kind,", expected JSDocFunctionType")})),"arg"+t.parent.parameters.indexOf(t)}}function z(t){return e.isNamedDeclaration(t)?e.declarationNameToString(t.name):e.unescapeLeadingUnderscores(e.Debug.checkDefined(J(t)))}function U(r,i,a,o,s,c,l){e.Debug.assert(l||!e.hasDynamicName(a));var u,_=e.hasSyntacticModifier(a,512)||e.isExportSpecifier(a)&&"default"===a.name.escapedText,d=l?"__computed":_&&i?"default":J(a);if(void 0===d)u=B(0,"__missing");else if(u=r.get(d),2885600&o&&P.add(d),u){if(c&&!u.isReplaceableByMethod)return u;if(u.flags&s)if(u.isReplaceableByMethod)r.set(d,u=B(0,d));else if(!(3&o&&67108864&u.flags)){e.isNamedDeclaration(a)&&e.setParent(a.name,a);var p=2&u.flags?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,f=!0;(384&u.flags||384&o)&&(p=e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations,f=!1);var g=!1;e.length(u.declarations)&&(_||u.declarations&&u.declarations.length&&270===a.kind&&!a.isExportEquals)&&(p=e.Diagnostics.A_module_cannot_have_multiple_default_exports,f=!1,g=!0);var m=[];e.isTypeAliasDeclaration(a)&&e.nodeIsMissing(a.type)&&e.hasSyntacticModifier(a,1)&&2887656&u.flags&&m.push(R(a,e.Diagnostics.Did_you_mean_0,"export type { ".concat(e.unescapeLeadingUnderscores(a.name.escapedText)," }")));var y=e.getNameOfDeclaration(a)||a;e.forEach(u.declarations,(function(r,n){var i=e.getNameOfDeclaration(r)||r,a=R(i,p,f?z(r):void 0);t.bindDiagnostics.push(g?e.addRelatedInfo(a,R(y,0===n?e.Diagnostics.Another_export_default_is_here:e.Diagnostics.and_here)):a),g&&m.push(R(i,e.Diagnostics.The_first_export_default_is_here));}));var v=R(y,p,f?z(a):void 0);t.bindDiagnostics.push(e.addRelatedInfo.apply(void 0,n$3([v],m,!1))),u=B(0,d);}}else r.set(d,u=B(0,d)),c&&(u.isReplaceableByMethod=!0);return j(u,a,o),u.parent?e.Debug.assert(u.parent===i,"Existing symbol parent should match new one"):u.parent=i,u}function K(t,r,n){var i=!!(1&e.getCombinedModifierFlags(t))||function(t){if(t.parent&&e.isModuleDeclaration(t)&&(t=t.parent),!e.isJSDocTypeAlias(t))return !1;if(!e.isJSDocEnumTag(t)&&t.fullName)return !0;var r=e.getNameOfDeclaration(t);return !!(r&&(e.isPropertyAccessEntityNameExpression(r.parent)&&Ye(r.parent)||e.isDeclaration(r.parent)&&1&e.getCombinedModifierFlags(r.parent)))}(t);if(2097152&r)return 274===t.kind||264===t.kind&&i?U(l.symbol.exports,l.symbol,t,r,n):U(l.locals,void 0,t,r,n);if(e.isJSDocTypeAlias(t)&&e.Debug.assert(e.isInJSFile(t)),!e.isAmbientModule(t)&&(i||64&l.flags)){if(!l.locals||e.hasSyntacticModifier(t,512)&&!J(t))return U(l.symbol.exports,l.symbol,t,r,n);var a=111551&r?1048576:0,o=U(l.locals,void 0,t,a,n);return o.exportSymbol=U(l.symbol.exports,l.symbol,t,r,n),t.localSymbol=o,o}return U(l.locals,void 0,t,r,n)}function V(e){q(e,(function(e){return 255===e.kind?Le(e):void 0})),q(e,(function(e){return 255!==e.kind?Le(e):void 0}));}function q(t,r){void 0===r&&(r=Le),void 0!==t&&e.forEach(t,r);}function W(t){e.forEachChild(t,Le,q);}function H(t){var n=w;if(w=!1,function(t){if(!(1&v.flags))return !1;if(v===O&&(e.isStatementButNotDeclaration(t)&&235!==t.kind||256===t.kind||260===t.kind&&function(t){var n=a(t);return 1===n||2===n&&e.shouldPreserveConstEnums(r)}(t))&&(v=M,!r.allowUnreachableCode)){var n=e.unreachableCodeIsError(r)&&!(8388608&t.flags)&&(!e.isVariableStatement(t)||!!(3&e.getCombinedNodeFlags(t.declarationList))||t.declarationList.declarations.some((function(e){return !!e.initializer})));!function(t,r){if(e.isStatement(t)&&u(t)&&e.isBlock(t.parent)){var n=t.parent.statements,i=e.sliceAfter(n,t);e.getRangesWhere(i,u,(function(e,t){return r(i[e],i[t-1])}));}else r(t,t);}(t,(function(t,r){return Me(n,t,r,e.Diagnostics.Unreachable_code_detected)}));}return !0}(t))return W(t),Re(t),void(w=n);switch(t.kind>=236&&t.kind<=252&&!r.allowUnreachableCode&&(t.flowNode=v),t.kind){case 240:!function(e){var t=ge(e,ee()),r=$(),n=$();ne(t,v),v=t,pe(e.expression,r,n),v=ce(r),fe(e.statement,n,t),ne(t,v),v=ce(n);}(t);break;case 239:!function(e){var t=ee(),r=ge(e,$()),n=$();ne(t,v),v=t,fe(e.statement,n,r),ne(r,v),v=ce(r),pe(e.expression,t,n),v=ce(n);}(t);break;case 241:!function(e){var t=ge(e,ee()),r=$(),n=$();Le(e.initializer),ne(t,v),v=t,pe(e.condition,r,n),v=ce(r),fe(e.statement,n,t),Le(e.incrementor),ne(t,v),v=ce(n);}(t);break;case 242:case 243:!function(e){var t=ge(e,ee()),r=$();Le(e.expression),ne(t,v),v=t,243===e.kind&&Le(e.awaitModifier),ne(r,v),Le(e.initializer),254!==e.initializer.kind&&he(e.initializer),fe(e.statement,r,t),ne(t,v),v=ce(r);}(t);break;case 238:!function(e){var t=$(),r=$(),n=$();pe(e.expression,t,r),v=ce(t),Le(e.thenStatement),ne(n,v),v=ce(r),Le(e.elseStatement),ne(n,v),v=ce(n);}(t);break;case 246:case 250:!function(e){Le(e.expression),246===e.kind&&(k=!0,x&&ne(x,v)),v=O;}(t);break;case 245:case 244:!function(e){if(Le(e.label),e.label){var t=function(e){for(var t=E;t;t=t.next)if(t.name===e)return t}(e.label.escapedText);t&&(t.referenced=!0,me(e,t.breakTarget,t.continueTarget));}else me(e,h,b);}(t);break;case 251:!function(t){var r=x,n=T,i=$(),a=$(),o=$();if(t.finallyBlock&&(x=a),ne(o,v),T=o,Le(t.tryBlock),ne(i,v),t.catchClause&&(v=ce(o),ne(o=$(),v),T=o,Le(t.catchClause),ne(i,v)),x=r,T=n,t.finallyBlock){var s=$();s.antecedents=e.concatenate(e.concatenate(i.antecedents,o.antecedents),a.antecedents),v=s,Le(t.finallyBlock),1&v.flags?v=O:(x&&a.antecedents&&ne(x,te(s,a.antecedents,v)),T&&o.antecedents&&ne(T,te(s,o.antecedents,v)),v=i.antecedents?te(s,i.antecedents,v):O);}else v=ce(i);}(t);break;case 248:!function(t){var r=$();Le(t.expression);var n=h,i=C;h=r,C=v,Le(t.caseBlock),ne(r,v);var a=e.forEach(t.caseBlock.clauses,(function(e){return 289===e.kind}));t.possiblyExhaustive=!a&&!r.antecedents,a||ne(r,ae(C,t,0,0)),h=n,C=i,v=ce(r);}(t);break;case 262:!function(e){for(var t=e.clauses,n=G(e.parent.expression),i=O,a=0;a<t.length;a++){for(var o=a;!t[a].statements.length&&a+1<t.length;)Le(t[a]),a++;var s=$();ne(s,n?ae(C,e.parent,o,a+1):C),ne(s,i),v=ce(s);var c=t[a];Le(c),i=v,1&v.flags||a===t.length-1||!r.noFallthroughCasesInSwitch||(c.fallthroughFlowNode=v);}}(t);break;case 288:!function(e){var t=v;v=C,Le(e.expression),v=t,q(e.statements);}(t);break;case 237:!function(e){Le(e.expression),ye(e.expression);}(t);break;case 249:!function(t){var n=$();E={next:E,name:t.label.escapedText,breakTarget:n,continueTarget:void 0,referenced:!1},Le(t.label),Le(t.statement),E.referenced||r.allowUnusedLabels||function(e,t,r){Me(e,t,t,r);}(e.unusedLabelIsError(r),t.label,e.Diagnostics.Unused_label),E=E.next,ne(n,v),v=ce(n);}(t);break;case 218:!function(e){if(53===e.operator){var t=D;D=S,S=t,W(e),S=D,D=t;}else W(e),45!==e.operator&&46!==e.operator||he(e.operand);}(t);break;case 219:!function(e){W(e),(45===e.operator||46===e.operator)&&he(e.operand);}(t);break;case 220:if(e.isDestructuringAssignment(t))return w=n,void function(e){w?(w=!1,Le(e.operatorToken),Le(e.right),w=!0,Le(e.left)):(w=!0,Le(e.left),w=!1,Le(e.operatorToken),Le(e.right)),he(e.left);}(t);L(t);break;case 214:!function(e){W(e),205===e.expression.kind&&he(e.expression);}(t);break;case 221:!function(e){var t=$(),r=$(),n=$();pe(e.condition,t,r),v=ce(t),Le(e.questionToken),Le(e.whenTrue),ne(n,v),v=ce(r),Le(e.colonToken),Le(e.whenFalse),ne(n,v),v=ce(n);}(t);break;case 253:!function(t){W(t),(t.initializer||e.isForInOrOfStatement(t.parent.parent))&&xe(t);}(t);break;case 205:case 206:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 207:!function(t){if(e.isOptionalChain(t))Te(t);else {var r=e.skipParentheses(t.expression);212===r.kind||213===r.kind?(q(t.typeArguments),q(t.arguments),Le(t.expression)):(W(t),106===t.expression.kind&&(v=se(v,t)));}if(205===t.expression.kind){var n=t.expression;e.isIdentifier(n.name)&&Z(n.expression)&&e.isPushOrUnshiftIdentifier(n.name)&&(v=oe(256,v,t));}}(t);break;case 229:!function(t){e.isOptionalChain(t)?Te(t):W(t);}(t);break;case 343:case 336:case 337:!function(t){Le(t.tagName),337!==t.kind&&t.fullName&&(e.setParent(t.fullName,t),e.setParentRecursive(t.fullName,!1)),"string"!=typeof t.comment&&q(t.comment);}(t);break;case 303:V(t.statements),Le(t.endOfFileToken);break;case 234:case 261:V(t.statements);break;case 202:!function(t){e.isBindingPattern(t.name)?(q(t.decorators),q(t.modifiers),Le(t.dotDotDotToken),Le(t.propertyName),Le(t.initializer),Le(t.name)):W(t);}(t);break;case 204:case 203:case 294:case 224:w=n;default:W(t);}Re(t),w=n;}function G(e){switch(e.kind){case 79:case 80:case 108:case 205:case 206:return X(e);case 207:return function(e){if(e.arguments)for(var t=0,r=e.arguments;t<r.length;t++)if(X(r[t]))return !0;return !(205!==e.expression.kind||!X(e.expression.expression))}(e);case 211:case 229:return G(e.expression);case 220:return function(e){switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return X(e.left);case 34:case 35:case 36:case 37:return Z(e.left)||Z(e.right)||Y(e.right,e.left)||Y(e.left,e.right);case 102:return Z(e.left);case 101:case 27:return G(e.right)}return !1}(e);case 218:return 53===e.operator&&G(e.operand);case 215:return G(e.expression)}return !1}function Q(t){return e.isDottedName(t)||(e.isPropertyAccessExpression(t)||e.isNonNullExpression(t)||e.isParenthesizedExpression(t))&&Q(t.expression)||e.isBinaryExpression(t)&&27===t.operatorToken.kind&&Q(t.right)||e.isElementAccessExpression(t)&&e.isStringOrNumericLiteralLike(t.argumentExpression)&&Q(t.expression)||e.isAssignmentExpression(t)&&Q(t.left)}function X(t){return Q(t)||e.isOptionalChain(t)&&X(t.expression)}function Y(t,r){return e.isTypeOfExpression(t)&&Z(t.expression)&&e.isStringLiteralLike(r)}function Z(e){switch(e.kind){case 211:return Z(e.expression);case 220:switch(e.operatorToken.kind){case 63:return Z(e.left);case 27:return Z(e.right)}}return X(e)}function $(){return c({flags:4,antecedents:void 0})}function ee(){return c({flags:8,antecedents:void 0})}function te(e,t,r){return c({flags:1024,target:e,antecedents:t,antecedent:r})}function re(e){e.flags|=2048&e.flags?4096:2048;}function ne(t,r){1&r.flags||e.contains(t.antecedents,r)||((t.antecedents||(t.antecedents=[])).push(r),re(r));}function ie(t,r,n){return 1&r.flags?r:n?!(110===n.kind&&64&t||95===n.kind&&32&t)||e.isExpressionOfOptionalChainRoot(n)||e.isNullishCoalesce(n.parent)?G(n)?(re(r),c({flags:t,antecedent:r,node:n})):r:O:32&t?r:O}function ae(e,t,r,n){return re(e),c({flags:128,antecedent:e,switchStatement:t,clauseStart:r,clauseEnd:n})}function oe(e,t,r){re(t);var n=c({flags:e,antecedent:t,node:r});return T&&ne(T,n),n}function se(e,t){return re(e),c({flags:512,antecedent:e,node:t})}function ce(e){var t=e.antecedents;return t?1===t.length?t[0]:e:O}function le(e){for(;;)if(211===e.kind)e=e.expression;else {if(218!==e.kind||53!==e.operator)return 220===e.kind&&(55===e.operatorToken.kind||56===e.operatorToken.kind||60===e.operatorToken.kind);e=e.operand;}}function ue(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)&&e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)}function _e(t){for(;e.isParenthesizedExpression(t.parent)||e.isPrefixUnaryExpression(t.parent)&&53===t.parent.operator;)t=t.parent;return !(function(e){var t=e.parent;switch(t.kind){case 238:case 240:case 239:return t.expression===e;case 241:case 221:return t.condition===e}return !1}(t)||ue(t.parent)||le(t.parent)||e.isOptionalChain(t.parent)&&t.parent.expression===t)}function de(e,t,r,n){var i=D,a=S;D=r,S=n,e(t),D=i,S=a;}function pe(t,r,n){de(Le,t,r,n),t&&(ue(t)||le(t)||e.isOptionalChain(t)&&e.isOutermostOptionalChain(t))||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function fe(e,t,r){var n=h,i=b;h=t,b=r,Le(e),h=n,b=i;}function ge(e,t){for(var r=E;r&&249===e.parent.kind;)r.continueTarget=t,r=r.next,e=e.parent;return t}function me(e,t,r){var n=245===e.kind?t:r;n&&(ne(n,v),v=O);}function ye(t){if(207===t.kind){var r=t;106!==r.expression.kind&&e.isDottedName(r.expression)&&(v=se(v,r));}}function ve(e){220===e.kind&&63===e.operatorToken.kind?he(e.left):he(e);}function he(e){if(Q(e))v=oe(16,v,e);else if(203===e.kind)for(var t=0,r=e.elements;t<r.length;t++){var n=r[t];224===n.kind?he(n.expression):ve(n);}else if(204===e.kind)for(var i=0,a=e.properties;i<a.length;i++){var o=a[i];294===o.kind?ve(o.initializer):295===o.kind?he(o.name):296===o.kind&&he(o.expression);}}function be(t,r,n){var i=$();55===t.operatorToken.kind||76===t.operatorToken.kind?pe(t.left,i,n):pe(t.left,r,i),v=ce(i),Le(t.operatorToken),e.isLogicalOrCoalescingAssignmentOperator(t.operatorToken.kind)?(de(Le,t.right,r,n),he(t.left),ne(r,ie(32,v,t)),ne(n,ie(64,v,t))):pe(t.right,r,n);}function xe(t){var r=e.isOmittedExpression(t)?void 0:t.name;if(e.isBindingPattern(r))for(var n=0,i=r.elements;n<i.length;n++)xe(i[n]);else v=oe(16,v,t);}function De(e){switch(e.kind){case 205:Le(e.questionDotToken),Le(e.name);break;case 206:Le(e.questionDotToken),Le(e.argumentExpression);break;case 207:Le(e.questionDotToken),q(e.typeArguments),q(e.arguments);}}function Se(t,r,n){var i=e.isOptionalChainRoot(t)?$():void 0;!function(t,r,n){de(Le,t,r,n),e.isOptionalChain(t)&&!e.isOutermostOptionalChain(t)||(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}(t.expression,i||r,n),i&&(v=ce(i)),de(De,t,r,n),e.isOutermostOptionalChain(t)&&(ne(r,ie(32,v,t)),ne(n,ie(64,v,t)));}function Te(e){if(_e(e)){var t=$();Se(e,t,t),v=ce(t);}else Se(e,D,S);}function Ce(t){switch(t.kind){case 225:case 256:case 259:case 204:case 181:case 320:case 285:return 1;case 257:return 65;case 260:case 258:case 194:return 33;case 303:return 37;case 171:case 172:case 168:if(e.isObjectLiteralOrClassExpressionMethodOrAccessor(t))return 173;case 170:case 255:case 167:case 173:case 321:case 315:case 178:case 174:case 175:case 179:case 169:return 45;case 212:case 213:return 61;case 261:return 4;case 166:return t.initializer?4:0;case 291:case 241:case 242:case 243:case 262:return 2;case 234:return e.isFunctionLike(t.parent)||e.isClassStaticBlockDeclaration(t.parent)?0:2}return 0}function Ee(e){g&&(g.nextContainer=e),g=e;}function ke(r,n,i){switch(l.kind){case 260:return K(r,n,i);case 303:return function(r,n,i){return e.isExternalModule(t)?K(r,n,i):U(t.locals,void 0,r,n,i)}(r,n,i);case 225:case 256:return function(t,r,n){return e.isStatic(t)?U(l.symbol.exports,l.symbol,t,r,n):U(l.symbol.members,l.symbol,t,r,n)}(r,n,i);case 259:return U(l.symbol.exports,l.symbol,r,n,i);case 181:case 320:case 204:case 257:case 285:return U(l.symbol.members,l.symbol,r,n,i);case 178:case 179:case 173:case 174:case 321:case 175:case 168:case 167:case 170:case 171:case 172:case 255:case 212:case 213:case 315:case 343:case 336:case 169:case 258:case 194:return U(l.locals,void 0,r,n,i)}}function Ne(t){8388608&t.flags&&!function(t){var r=e.isSourceFile(t)?t:e.tryCast(t.body,e.isModuleBlock);return !!r&&r.statements.some((function(t){return e.isExportDeclaration(t)||e.isExportAssignment(t)}))}(t)?t.flags|=64:t.flags&=-65;}function Fe(e){var t=a(e),r=0!==t;return ke(e,r?512:1024,r?110735:0),t}function Ae(e,t,r){var n=B(t,r);return 106508&t&&(n.parent=l.symbol),j(n,e,t),n}function Pe(t,r,n){switch(f.kind){case 260:K(t,r,n);break;case 303:if(e.isExternalOrCommonJsModule(l)){K(t,r,n);break}default:f.locals||(f.locals=e.createSymbolTable(),Ee(f)),U(f.locals,void 0,t,r,n);}}function we(r,n){if(n&&79===n.kind){var i=n;if(o=i,e.isIdentifier(o)&&("eval"===o.escapedText||"arguments"===o.escapedText)){var a=e.getErrorSpanForNode(t,n);t.bindDiagnostics.push(e.createFileDiagnostic(t,a.start,a.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode:t.externalModuleIndicator?e.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode:e.Diagnostics.Invalid_use_of_0_in_strict_mode}(r),e.idText(i)));}}var o;}function Ie(e){F&&we(e,e.name);}function Oe(r,n,i,a,o){var s=e.getSpanOfTokenAtPosition(t,r.pos);t.bindDiagnostics.push(e.createFileDiagnostic(t,s.start,s.length,n,i,a,o));}function Me(r,n,a,o){!function(r,n,a){var o=e.createFileDiagnostic(t,n.pos,n.end-n.pos,a);r?t.bindDiagnostics.push(o):t.bindSuggestionDiagnostics=e.append(t.bindSuggestionDiagnostics,i$1(i$1({},o),{category:e.DiagnosticCategory.Suggestion}));}(r,{pos:e.getTokenPosOfNode(n,t),end:a.end},o);}function Le(t){if(t){e.setParent(t,s);var r=F;if(je(t),t.kind>159){var n=s;s=t;var i=Ce(t);0===i?H(t):function(t,r){var n=l,i=p,a=f;if(1&r?(213!==t.kind&&(p=l),l=f=t,32&r&&(l.locals=e.createSymbolTable()),Ee(l)):2&r&&((f=t).locals=void 0),4&r){var o=v,s=h,u=b,_=x,d=T,g=E,m=k,D=16&r&&!e.hasSyntacticModifier(t,256)&&!t.asteriskToken&&!!e.getImmediatelyInvokedFunctionExpression(t);D||(v=c({flags:2}),144&r&&(v.node=t)),x=D||170===t.kind||169===t.kind||e.isInJSFile(t)&&(255===t.kind||212===t.kind)?$():void 0,T=void 0,h=void 0,b=void 0,E=void 0,k=!1,H(t),t.flags&=-2817,!(1&v.flags)&&8&r&&e.nodeIsPresent(t.body)&&(t.flags|=256,k&&(t.flags|=512),t.endFlowNode=v),303===t.kind&&(t.flags|=N,t.endFlowNode=v),x&&(ne(x,v),v=ce(x),(170===t.kind||169===t.kind||e.isInJSFile(t)&&(255===t.kind||212===t.kind))&&(t.returnFlowNode=v)),D||(v=o),h=s,b=u,x=_,T=d,E=g,k=m;}else 64&r?(y=!1,H(t),t.flags=y?128|t.flags:-129&t.flags):H(t);l=n,p=i,f=a;}(t,i),s=n;}else n=s,1===t.kind&&(s=t),Re(t),s=n;F=r;}}function Re(t){if(e.hasJSDocNodes(t))if(e.isInJSFile(t))for(var r=0,n=t.jsDoc;r<n.length;r++)Le(o=n[r]);else for(var i=0,a=t.jsDoc;i<a.length;i++){var o=a[i];e.setParent(o,t),e.setParentRecursive(o,!1);}}function Be(r){if(!F)for(var n=0,i=r;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))return;if(o=a,'"use strict"'===(s=e.getSourceTextOfNodeFromSourceFile(t,o.expression))||"'use strict'"===s)return void(F=!0)}var o,s;}function je(n){switch(n.kind){case 79:if(n.isInJSDocNamespace){for(var i=n.parent;i&&!e.isJSDocTypeAlias(i);)i=i.parent;Pe(i,524288,788968);break}case 108:return v&&(e.isExpression(n)||295===s.kind)&&(n.flowNode=v),function(r){t.parseDiagnostics.length||8388608&r.flags||4194304&r.flags||e.isIdentifierName(r)||(F&&r.originalKeywordKind>=117&&r.originalKeywordKind<=125?t.bindDiagnostics.push(R(r,function(r){return e.getContainingClass(r)?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode:e.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode}(r),e.declarationNameToString(r))):132===r.originalKeywordKind?e.isExternalModule(t)&&e.isInTopLevelContext(r)?t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module,e.declarationNameToString(r))):32768&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))):125===r.originalKeywordKind&&8192&r.flags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,e.declarationNameToString(r))));}(n);case 160:v&&e.isPartOfTypeQuery(n)&&(n.flowNode=v);break;case 230:case 106:n.flowNode=v;break;case 80:return function(r){"#constructor"===r.escapedText&&(t.parseDiagnostics.length||t.bindDiagnostics.push(R(r,e.Diagnostics.constructor_is_a_reserved_word,e.declarationNameToString(r))));}(n);case 205:case 206:var a=n;v&&Q(a)&&(a.flowNode=v),e.isSpecialPropertyDeclaration(a)&&function(t){108===t.expression.kind?Ve(t):e.isBindableStaticAccessExpression(t)&&303===t.parent.parent.kind&&(e.isPrototypeAccess(t.expression)?He(t,t.parent):Ge(t));}(a),e.isInJSFile(a)&&t.commonJsModuleIndicator&&e.isModuleExportsAccessExpression(a)&&!d(f,"module")&&U(t.locals,void 0,a.expression,134217729,111550);break;case 220:switch(e.getAssignmentDeclarationKind(n)){case 1:Ue(n);break;case 2:!function(r){if(ze(r)){var n=e.getRightMostAssignedExpression(r.right);if(!(e.isEmptyObjectLiteral(n)||l===t&&_(t,n)))if(e.isObjectLiteralExpression(n)&&e.every(n.properties,e.isShorthandPropertyAssignment))e.forEach(n.properties,Ke);else {var i=e.exportAssignmentIsAlias(r)?2097152:1049092,a=U(t.symbol.exports,t.symbol,r,67108864|i,0);e.setValueDeclaration(a,r);}}}(n);break;case 3:He(n.left,n);break;case 6:!function(t){e.setParent(t.left,t),e.setParent(t.right,t),Ze(t.left.expression,t.left,!1,!0);}(n);break;case 4:Ve(n);break;case 5:var c=n.left.expression;if(e.isInJSFile(n)&&e.isIdentifier(c)){var u=d(f,c.escapedText);if(e.isThisInitializedDeclaration(null==u?void 0:u.valueDeclaration)){Ve(n);break}}!function(r){var n,i=$e(r.left.expression,l)||$e(r.left.expression,f);if(e.isInJSFile(r)||e.isFunctionSymbol(i)){var a=e.getLeftmostAccessExpression(r.left);e.isIdentifier(a)&&2097152&(null===(n=d(l,a.escapedText))||void 0===n?void 0:n.flags)||(e.setParent(r.left,r),e.setParent(r.right,r),e.isIdentifier(r.left.expression)&&l===t&&_(t,r.left.expression)?Ue(r):e.hasDynamicName(r)?(Ae(r,67108868,"__computed"),We(r,Qe(i,r.left.expression,Ye(r.left),!1,!1))):Ge(e.cast(r.left,e.isBindableStaticNameExpression)));}}(n);break;case 0:break;default:e.Debug.fail("Unknown binary expression special property assignment kind");}return function(t){F&&e.isLeftHandSideExpression(t.left)&&e.isAssignmentOperator(t.operatorToken.kind)&&we(t,t.left);}(n);case 291:return function(e){F&&e.variableDeclaration&&we(e,e.variableDeclaration.name);}(n);case 214:return function(r){if(F&&79===r.expression.kind){var n=e.getErrorSpanForNode(t,r.expression);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,e.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode));}}(n);case 8:return function(r){F&&32&r.numericLiteralFlags&&t.bindDiagnostics.push(R(r,e.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));}(n);case 219:return function(e){F&&we(e,e.operand);}(n);case 218:return function(e){F&&(45!==e.operator&&46!==e.operator||we(e,e.operand));}(n);case 247:return function(t){F&&Oe(t,e.Diagnostics.with_statements_are_not_allowed_in_strict_mode);}(n);case 249:return function(t){F&&e.getEmitScriptTarget(r)>=2&&(e.isDeclarationStatement(t.statement)||e.isVariableStatement(t.statement))&&Oe(t.label,e.Diagnostics.A_label_is_not_allowed_here);}(n);case 191:return void(y=!0);case 176:break;case 162:return function(t){if(e.isJSDocTemplateTag(t.parent)){var r=e.getEffectiveContainerForJSDocTemplateTag(t.parent);r?(r.locals||(r.locals=e.createSymbolTable()),U(r.locals,void 0,t,262144,526824)):ke(t,262144,526824);}else if(189===t.parent.kind){var n=function(t){var r=e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&t.parent.extendsType===t}));return r&&r.parent}(t.parent);n?(n.locals||(n.locals=e.createSymbolTable()),U(n.locals,void 0,t,262144,526824)):Ae(t,262144,J(t));}else ke(t,262144,526824);}(n);case 163:return rt(n);case 253:return tt(n);case 202:return n.flowNode=v,tt(n);case 166:case 165:return function(e){return nt(e,4|(e.questionToken?16777216:0),0)}(n);case 294:case 295:return nt(n,4,0);case 297:return nt(n,8,900095);case 173:case 174:case 175:return ke(n,131072,0);case 168:case 167:return nt(n,8192|(n.questionToken?16777216:0),e.isObjectLiteralMethod(n)?0:103359);case 255:return function(r){t.isDeclarationFile||8388608&r.flags||e.isAsyncFunction(r)&&(N|=2048),Ie(r),F?(function(r){if(o<2&&303!==f.kind&&260!==f.kind&&!e.isFunctionLikeOrClassStaticBlockDeclaration(f)){var n=e.getErrorSpanForNode(t,r);t.bindDiagnostics.push(e.createFileDiagnostic(t,n.start,n.length,function(r){return e.getContainingClass(r)?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode:t.externalModuleIndicator?e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode:e.Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5}(r)));}}(r),Pe(r,16,110991)):ke(r,16,110991);}(n);case 170:return ke(n,16384,0);case 171:return nt(n,32768,46015);case 172:return nt(n,65536,78783);case 178:case 315:case 321:case 179:return function(t){var r=B(131072,J(t));j(r,t,131072);var n=B(2048,"__type");j(n,t,2048),n.members=e.createSymbolTable(),n.members.set(r.escapedName,r);}(n);case 181:case 320:case 194:return function(e){return Ae(e,2048,"__type")}(n);case 330:return function(t){W(t);var r=e.getHostSignatureFromJSDoc(t);r&&168!==r.kind&&j(r.symbol,r,32);}(n);case 204:return function(r){var n;if(function(e){e[e.Property=1]="Property",e[e.Accessor=2]="Accessor";}(n||(n={})),F&&!e.isAssignmentTarget(r))for(var i=new e.Map,a=0,o=r.properties;a<o.length;a++){var s=o[a];if(296!==s.kind&&79===s.name.kind){var c=s.name,l=294===s.kind||295===s.kind||168===s.kind?1:2,u=i.get(c.escapedText);if(u){if(1===l&&1===u){var _=e.getErrorSpanForNode(t,c);t.bindDiagnostics.push(e.createFileDiagnostic(t,_.start,_.length,e.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));}}else i.set(c.escapedText,l);}}return Ae(r,4096,"__object")}(n);case 212:case 213:return function(r){return t.isDeclarationFile||8388608&r.flags||e.isAsyncFunction(r)&&(N|=2048),v&&(r.flowNode=v),Ie(r),Ae(r,16,r.name?r.name.escapedText:"__function")}(n);case 207:switch(e.getAssignmentDeclarationKind(n)){case 7:return function(e){var t=$e(e.arguments[0]),r=303===e.parent.parent.kind;Xe(e,t=Qe(t,e.arguments[0],r,!1,!1),!1);}(n);case 8:return function(e){if(ze(e)){var t=et(e.arguments[0],void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(t){U(t.exports,t,e,1048580,0);}}}(n);case 9:return function(e){var t=$e(e.arguments[0].expression);t&&t.valueDeclaration&&j(t,t.valueDeclaration,32),Xe(e,t,!0);}(n);case 0:break;default:return e.Debug.fail("Unknown call expression assignment declaration kind")}e.isInJSFile(n)&&function(r){!t.commonJsModuleIndicator&&e.isRequireCall(r,!1)&&ze(r);}(n);break;case 225:case 256:return F=!0,function(r){256===r.kind?Pe(r,32,899503):(Ae(r,32,r.name?r.name.escapedText:"__class"),r.name&&P.add(r.name.escapedText));var n=r.symbol,i=B(4194308,"prototype"),a=n.exports.get(i.escapedName);a&&(r.name&&e.setParent(r.name,r),t.bindDiagnostics.push(R(a.declarations[0],e.Diagnostics.Duplicate_identifier_0,e.symbolName(i)))),n.exports.set(i.escapedName,i),i.parent=n;}(n);case 257:return Pe(n,64,788872);case 258:return Pe(n,524288,788968);case 259:return function(t){return e.isEnumConst(t)?Pe(t,128,899967):Pe(t,256,899327)}(n);case 260:return function(r){if(Ne(r),e.isAmbientModule(r))if(e.hasSyntacticModifier(r,1)&&Oe(r,e.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible),e.isModuleAugmentationExternal(r))Fe(r);else {var n=void 0;if(10===r.name.kind){var i=r.name.text;void 0===(n=e.tryParsePattern(i))&&Oe(r.name,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,i);}var a=ke(r,512,110735);t.patternAmbientModules=e.append(t.patternAmbientModules,n&&!e.isString(n)?{pattern:n,symbol:a}:void 0);}else {var o=Fe(r);0!==o&&((a=r.symbol).constEnumOnlyModule=!(304&a.flags)&&2===o&&!1!==a.constEnumOnlyModule);}}(n);case 285:return function(e){return Ae(e,4096,"__jsxAttributes")}(n);case 284:return function(e,t,r){return ke(e,4,0)}(n);case 264:case 267:case 269:case 274:return ke(n,2097152,2097152);case 263:return function(r){r.modifiers&&r.modifiers.length&&t.bindDiagnostics.push(R(r,e.Diagnostics.Modifiers_cannot_appear_here));var n=e.isSourceFile(r.parent)?e.isExternalModule(r.parent)?r.parent.isDeclarationFile?void 0:e.Diagnostics.Global_module_exports_may_only_appear_in_declaration_files:e.Diagnostics.Global_module_exports_may_only_appear_in_module_files:e.Diagnostics.Global_module_exports_may_only_appear_at_top_level;n?t.bindDiagnostics.push(R(r,n)):(t.symbol.globalExports=t.symbol.globalExports||e.createSymbolTable(),U(t.symbol.globalExports,t.symbol,r,2097152,2097152));}(n);case 266:return function(e){e.name&&ke(e,2097152,2097152);}(n);case 271:return function(t){l.symbol&&l.symbol.exports?t.exportClause?e.isNamespaceExport(t.exportClause)&&(e.setParent(t.exportClause,t),U(l.symbol.exports,l.symbol,t.exportClause,2097152,2097152)):U(l.symbol.exports,l.symbol,t,8388608,0):Ae(t,8388608,J(t));}(n);case 270:return function(t){if(l.symbol&&l.symbol.exports){var r=e.exportAssignmentIsAlias(t)?2097152:4,n=U(l.symbol.exports,l.symbol,t,r,67108863);t.isExportEquals&&e.setValueDeclaration(n,t);}else Ae(t,111551,J(t));}(n);case 303:return Be(n.statements),function(){if(Ne(t),e.isExternalModule(t))Je();else if(e.isJsonSourceFile(t)){Je();var r=t.symbol;U(t.symbol.exports,t.symbol,t,4,67108863),t.symbol=r;}}();case 234:if(!e.isFunctionLikeOrClassStaticBlockDeclaration(n.parent))return;case 261:return Be(n.statements);case 338:if(321===n.parent.kind)return rt(n);if(320!==n.parent.kind)break;case 345:var p=n;return ke(p,p.isBracketed||p.typeExpression&&314===p.typeExpression.type.kind?16777220:4,0);case 343:case 336:case 337:return (m||(m=[])).push(n)}}function Je(){Ae(t,512,'"'.concat(e.removeFileExtension(t.fileName),'"'));}function ze(e){return !t.externalModuleIndicator&&(t.commonJsModuleIndicator||(t.commonJsModuleIndicator=e,Je()),!0)}function Ue(t){if(ze(t)){var r=et(t.left.expression,void 0,(function(e,t){return t&&j(t,e,67110400),t}));if(r){var n=e.isAliasableExpression(t.right)&&(e.isExportsIdentifier(t.left.expression)||e.isModuleExportsAccessExpression(t.left.expression))?2097152:1048580;e.setParent(t.left,t),U(r.exports,r,t.left,n,0);}}}function Ke(e){U(t.symbol.exports,t.symbol,e,69206016,0);}function Ve(t){if(e.Debug.assert(e.isInJSFile(t)),!(e.isBinaryExpression(t)&&e.isPropertyAccessExpression(t.left)&&e.isPrivateIdentifier(t.left.name)||e.isPropertyAccessExpression(t)&&e.isPrivateIdentifier(t.name))){var r=e.getThisContainer(t,!1);switch(r.kind){case 255:case 212:var n=r.symbol;if(e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind){var i=r.parent.left;e.isBindableStaticAccessExpression(i)&&e.isPrototypeAccess(i.expression)&&(n=$e(i.expression.expression,p));}n&&n.valueDeclaration&&(n.members=n.members||e.createSymbolTable(),e.hasDynamicName(t)?qe(t,n,n.members):U(n.members,n,t,67108868,0),j(n,n.valueDeclaration,32));break;case 170:case 166:case 168:case 171:case 172:case 169:var a=r.parent,o=e.isStatic(r)?a.symbol.exports:a.symbol.members;e.hasDynamicName(t)?qe(t,a.symbol,o):U(o,a.symbol,t,67108868,0,!0);break;case 303:if(e.hasDynamicName(t))break;r.commonJsModuleIndicator?U(r.symbol.exports,r.symbol,t,1048580,0):ke(t,1,111550);break;default:e.Debug.failBadSyntaxKind(r);}}}function qe(e,t,r){U(r,t,e,4,0,!0,!0),We(e,t);}function We(t,r){r&&(r.assignmentDeclarationMembers||(r.assignmentDeclarationMembers=new e.Map)).set(e.getNodeId(t),t);}function He(t,r){var n=t.expression,i=n.expression;e.setParent(i,n),e.setParent(n,t),e.setParent(t,r),Ze(i,t,!0,!0);}function Ge(t){e.Debug.assert(!e.isIdentifier(t)),e.setParent(t.expression,t),Ze(t.expression,t,!1,!1);}function Qe(r,n,i,a,o){if(2097152&(null==r?void 0:r.flags))return r;if(i&&!a){var s=67110400;r=et(n,r,(function(r,n,i){return n?(j(n,r,s),n):U(i?i.exports:t.jsGlobalAugmentations||(t.jsGlobalAugmentations=e.createSymbolTable()),i,r,s,110735)}));}return o&&r&&r.valueDeclaration&&j(r,r.valueDeclaration,32),r}function Xe(t,r,n){if(r&&function(t){if(1072&t.flags)return !0;var r=t.valueDeclaration;if(r&&e.isCallExpression(r))return !!e.getAssignedExpandoInitializer(r);var n=r?e.isVariableDeclaration(r)?r.initializer:e.isBinaryExpression(r)?r.right:e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)?r.parent.right:void 0:void 0;if(n=n&&e.getRightMostAssignedExpression(n)){var i=e.isPrototypeAccess(e.isVariableDeclaration(r)?r.name:e.isBinaryExpression(r)?r.left:r);return !!e.getExpandoInitializer(!e.isBinaryExpression(n)||56!==n.operatorToken.kind&&60!==n.operatorToken.kind?n:n.right,i)}return !1}(r)){var i=n?r.members||(r.members=e.createSymbolTable()):r.exports||(r.exports=e.createSymbolTable()),a=0,o=0;e.isFunctionLikeDeclaration(e.getAssignedExpandoInitializer(t))?(a=8192,o=103359):e.isCallExpression(t)&&e.isBindableObjectDefinePropertyCall(t)&&(e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"set"===e.idText(r)}))&&(a|=65540,o|=78783),e.some(t.arguments[2].properties,(function(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isIdentifier(r)&&"get"===e.idText(r)}))&&(a|=32772,o|=46015)),0===a&&(a=4,o=0),U(i,r,t,67108864|a,-67108865&o);}}function Ye(t){return e.isBinaryExpression(t.parent)?303===function(t){for(;e.isBinaryExpression(t.parent);)t=t.parent;return t.parent}(t.parent).parent.kind:303===t.parent.parent.kind}function Ze(e,t,r,n){var i=$e(e,l)||$e(e,f),a=Ye(t);Xe(t,i=Qe(i,t.expression,a,r,n),r);}function $e(t,r){if(void 0===r&&(r=l),e.isIdentifier(t))return d(r,t.escapedText);var n=$e(t.expression);return n&&n.exports&&n.exports.get(e.getElementOrPropertyAccessName(t))}function et(r,n,i){if(_(t,r))return t.symbol;if(e.isIdentifier(r))return i(r,$e(r),n);var a=et(r.expression,n,i),o=e.getNameOrArgument(r);return e.isPrivateIdentifier(o)&&e.Debug.fail("unexpected PrivateIdentifier"),i(o,a&&a.exports&&a.exports.get(e.getElementOrPropertyAccessName(r)),a)}function tt(t){F&&we(t,t.name),e.isBindingPattern(t.name)||(e.isInJSFile(t)&&e.isRequireVariableDeclaration(t)&&!e.getJSDocTypeTag(t)?ke(t,2097152,2097152):e.isBlockOrCatchScoped(t)?Pe(t,2,111551):e.isParameterDeclaration(t)?ke(t,1,111551):ke(t,1,111550));}function rt(t){if((338!==t.kind||321===l.kind)&&(!F||8388608&t.flags||we(t,t.name),e.isBindingPattern(t.name)?Ae(t,1,"__"+t.parent.parameters.indexOf(t)):ke(t,1,111551),e.isParameterPropertyDeclaration(t,t.parent))){var r=t.parent.parent;U(r.symbol.members,r.symbol,t,4|(t.questionToken?16777216:0),0);}}function nt(r,n,i){return t.isDeclarationFile||8388608&r.flags||!e.isAsyncFunction(r)||(N|=2048),v&&e.isObjectLiteralOrClassExpressionMethodOrAccessor(r)&&(r.flowNode=v),e.hasDynamicName(r)?Ae(r,n,"__computed"):ke(r,n,i)}}();function u(t){return !(e.isFunctionDeclaration(t)||function(t){switch(t.kind){case 257:case 258:return !0;case 260:return 1!==a(t);case 259:return e.hasSyntacticModifier(t,2048);default:return !1}}(t)||e.isEnumDeclaration(t)||e.isVariableStatement(t)&&!(3&e.getCombinedNodeFlags(t))&&t.declarationList.declarations.some((function(e){return !e.initializer})))}function _(t,r){for(var n=0,i=[r];i.length&&n<100;){if(n++,r=i.shift(),e.isExportsIdentifier(r)||e.isModuleExportsAccessExpression(r))return !0;if(e.isIdentifier(r)){var a=d(t,r.escapedText);if(a&&a.valueDeclaration&&e.isVariableDeclaration(a.valueDeclaration)&&a.valueDeclaration.initializer){var o=a.valueDeclaration.initializer;i.push(o),e.isAssignmentExpression(o,!0)&&(i.push(o.left),i.push(o.right));}}}return !1}function d(t,r){var n=t.locals&&t.locals.get(r);return n?n.exportSymbol||n:e.isSourceFile(t)&&t.jsGlobalAugmentations&&t.jsGlobalAugmentations.has(r)?t.jsGlobalAugmentations.get(r):t.symbol&&t.symbol.exports&&t.symbol.exports.get(r)}e.bindSourceFile=function(t,r){null===e.tracing||void 0===e.tracing||e.tracing.push("bind","bindSourceFile",{path:t.path},!0),e.performance.mark("beforeBind"),e.perfLogger.logStartBindFile(""+t.fileName),l(t,r),e.perfLogger.logStopBindFile(),e.performance.mark("afterBind"),e.performance.measure("Bind","beforeBind","afterBind"),null===e.tracing||void 0===e.tracing||e.tracing.pop();},e.isExportsOrModuleExportsOrAlias=_;}(t),function(e){e.createGetSymbolWalker=function(t,r,n,i,a,o,s,c,l,u){return function(_){void 0===_&&(_=function(){return !0});var d=[],p=[];return {walkType:function(t){try{return f(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}},walkSymbol:function(t){try{return y(t),{visitedTypes:e.getOwnValues(d),visitedSymbols:e.getOwnValues(p)}}finally{e.clear(d),e.clear(p);}}};function f(t){if(t&&!d[t.id]&&(d[t.id]=t,!y(t.symbol))){if(524288&t.flags){var r=t,n=r.objectFlags;4&n&&function(t){f(t.target),e.forEach(u(t),f);}(t),32&n&&function(e){f(e.typeParameter),f(e.constraintType),f(e.templateType),f(e.modifiersType);}(t),3&n&&(m(a=t),e.forEach(a.typeParameters,f),e.forEach(i(a),f),f(a.thisType)),24&n&&m(r);}var a;262144&t.flags&&function(e){f(c(e));}(t),3145728&t.flags&&function(t){e.forEach(t.types,f);}(t),4194304&t.flags&&function(e){f(e.type);}(t),8388608&t.flags&&function(e){f(e.objectType),f(e.indexType),f(e.constraint);}(t);}}function g(i){var a=r(i);a&&f(a.type),e.forEach(i.typeParameters,f);for(var o=0,s=i.parameters;o<s.length;o++)y(s[o]);f(t(i)),f(n(i));}function m(e){for(var t=a(e),r=0,n=t.indexInfos;r<n.length;r++){var i=n[r];f(i.keyType),f(i.type);}for(var o=0,s=t.callSignatures;o<s.length;o++)g(s[o]);for(var c=0,l=t.constructSignatures;c<l.length;c++)g(l[c]);for(var u=0,_=t.properties;u<_.length;u++)y(_[u]);}function y(t){if(!t)return !1;var r=e.getSymbolId(t);return !p[r]&&(p[r]=t,!_(t)||(f(o(t)),t.exports&&t.exports.forEach(y),e.forEach(t.declarations,(function(e){if(e.type&&180===e.type.kind){var t=e.type;y(s(l(t.exprName)));}})),!1))}}};}(t),function(e){var t,r,a,s,c=/^".+"$/,l="(anonymous)",u=1,_=1,d=1,p=1;!function(e){e[e.AllowsSyncIterablesFlag=1]="AllowsSyncIterablesFlag",e[e.AllowsAsyncIterablesFlag=2]="AllowsAsyncIterablesFlag",e[e.AllowsStringInputFlag=4]="AllowsStringInputFlag",e[e.ForOfFlag=8]="ForOfFlag",e[e.YieldStarFlag=16]="YieldStarFlag",e[e.SpreadFlag=32]="SpreadFlag",e[e.DestructuringFlag=64]="DestructuringFlag",e[e.PossiblyOutOfBounds=128]="PossiblyOutOfBounds",e[e.Element=1]="Element",e[e.Spread=33]="Spread",e[e.Destructuring=65]="Destructuring",e[e.ForOf=13]="ForOf",e[e.ForAwaitOf=15]="ForAwaitOf",e[e.YieldStar=17]="YieldStar",e[e.AsyncYieldStar=19]="AsyncYieldStar",e[e.GeneratorReturnType=1]="GeneratorReturnType",e[e.AsyncGeneratorReturnType=2]="AsyncGeneratorReturnType";}(t||(t={})),function(e){e[e.Yield=0]="Yield",e[e.Return=1]="Return",e[e.Next=2]="Next";}(r||(r={})),function(e){e[e.Normal=0]="Normal",e[e.FunctionReturn=1]="FunctionReturn",e[e.GeneratorNext=2]="GeneratorNext",e[e.GeneratorYield=3]="GeneratorYield";}(a||(a={})),function(e){e[e.None=0]="None",e[e.TypeofEQString=1]="TypeofEQString",e[e.TypeofEQNumber=2]="TypeofEQNumber",e[e.TypeofEQBigInt=4]="TypeofEQBigInt",e[e.TypeofEQBoolean=8]="TypeofEQBoolean",e[e.TypeofEQSymbol=16]="TypeofEQSymbol",e[e.TypeofEQObject=32]="TypeofEQObject",e[e.TypeofEQFunction=64]="TypeofEQFunction",e[e.TypeofEQHostObject=128]="TypeofEQHostObject",e[e.TypeofNEString=256]="TypeofNEString",e[e.TypeofNENumber=512]="TypeofNENumber",e[e.TypeofNEBigInt=1024]="TypeofNEBigInt",e[e.TypeofNEBoolean=2048]="TypeofNEBoolean",e[e.TypeofNESymbol=4096]="TypeofNESymbol",e[e.TypeofNEObject=8192]="TypeofNEObject",e[e.TypeofNEFunction=16384]="TypeofNEFunction",e[e.TypeofNEHostObject=32768]="TypeofNEHostObject",e[e.EQUndefined=65536]="EQUndefined",e[e.EQNull=131072]="EQNull",e[e.EQUndefinedOrNull=262144]="EQUndefinedOrNull",e[e.NEUndefined=524288]="NEUndefined",e[e.NENull=1048576]="NENull",e[e.NEUndefinedOrNull=2097152]="NEUndefinedOrNull",e[e.Truthy=4194304]="Truthy",e[e.Falsy=8388608]="Falsy",e[e.All=16777215]="All",e[e.BaseStringStrictFacts=3735041]="BaseStringStrictFacts",e[e.BaseStringFacts=12582401]="BaseStringFacts",e[e.StringStrictFacts=16317953]="StringStrictFacts",e[e.StringFacts=16776705]="StringFacts",e[e.EmptyStringStrictFacts=12123649]="EmptyStringStrictFacts",e[e.EmptyStringFacts=12582401]="EmptyStringFacts",e[e.NonEmptyStringStrictFacts=7929345]="NonEmptyStringStrictFacts",e[e.NonEmptyStringFacts=16776705]="NonEmptyStringFacts",e[e.BaseNumberStrictFacts=3734786]="BaseNumberStrictFacts",e[e.BaseNumberFacts=12582146]="BaseNumberFacts",e[e.NumberStrictFacts=16317698]="NumberStrictFacts",e[e.NumberFacts=16776450]="NumberFacts",e[e.ZeroNumberStrictFacts=12123394]="ZeroNumberStrictFacts",e[e.ZeroNumberFacts=12582146]="ZeroNumberFacts",e[e.NonZeroNumberStrictFacts=7929090]="NonZeroNumberStrictFacts",e[e.NonZeroNumberFacts=16776450]="NonZeroNumberFacts",e[e.BaseBigIntStrictFacts=3734276]="BaseBigIntStrictFacts",e[e.BaseBigIntFacts=12581636]="BaseBigIntFacts",e[e.BigIntStrictFacts=16317188]="BigIntStrictFacts",e[e.BigIntFacts=16775940]="BigIntFacts",e[e.ZeroBigIntStrictFacts=12122884]="ZeroBigIntStrictFacts",e[e.ZeroBigIntFacts=12581636]="ZeroBigIntFacts",e[e.NonZeroBigIntStrictFacts=7928580]="NonZeroBigIntStrictFacts",e[e.NonZeroBigIntFacts=16775940]="NonZeroBigIntFacts",e[e.BaseBooleanStrictFacts=3733256]="BaseBooleanStrictFacts",e[e.BaseBooleanFacts=12580616]="BaseBooleanFacts",e[e.BooleanStrictFacts=16316168]="BooleanStrictFacts",e[e.BooleanFacts=16774920]="BooleanFacts",e[e.FalseStrictFacts=12121864]="FalseStrictFacts",e[e.FalseFacts=12580616]="FalseFacts",e[e.TrueStrictFacts=7927560]="TrueStrictFacts",e[e.TrueFacts=16774920]="TrueFacts",e[e.SymbolStrictFacts=7925520]="SymbolStrictFacts",e[e.SymbolFacts=16772880]="SymbolFacts",e[e.ObjectStrictFacts=7888800]="ObjectStrictFacts",e[e.ObjectFacts=16736160]="ObjectFacts",e[e.FunctionStrictFacts=7880640]="FunctionStrictFacts",e[e.FunctionFacts=16728e3]="FunctionFacts",e[e.UndefinedFacts=9830144]="UndefinedFacts",e[e.NullFacts=9363232]="NullFacts",e[e.EmptyObjectStrictFacts=16318463]="EmptyObjectStrictFacts",e[e.AllTypeofNE=556800]="AllTypeofNE",e[e.EmptyObjectFacts=16777215]="EmptyObjectFacts";}(s||(s={}));var f,g,m,y,v,h,b,x,D,S=new e.Map(e.getEntries({string:1,number:2,bigint:4,boolean:8,symbol:16,undefined:65536,object:32,function:64})),T=new e.Map(e.getEntries({string:256,number:512,bigint:1024,boolean:2048,symbol:4096,undefined:524288,object:8192,function:16384}));!function(e){e[e.Type=0]="Type",e[e.ResolvedBaseConstructorType=1]="ResolvedBaseConstructorType",e[e.DeclaredType=2]="DeclaredType",e[e.ResolvedReturnType=3]="ResolvedReturnType",e[e.ImmediateBaseConstraint=4]="ImmediateBaseConstraint",e[e.EnumTagType=5]="EnumTagType",e[e.ResolvedTypeArguments=6]="ResolvedTypeArguments",e[e.ResolvedBaseTypes=7]="ResolvedBaseTypes";}(f||(f={})),function(e){e[e.Normal=0]="Normal",e[e.Contextual=1]="Contextual",e[e.Inferential=2]="Inferential",e[e.SkipContextSensitive=4]="SkipContextSensitive",e[e.SkipGenericFunctions=8]="SkipGenericFunctions",e[e.IsForSignatureHelp=16]="IsForSignatureHelp";}(g||(g={})),function(e){e[e.BivariantCallback=1]="BivariantCallback",e[e.StrictCallback=2]="StrictCallback",e[e.IgnoreReturnTypes=4]="IgnoreReturnTypes",e[e.StrictArity=8]="StrictArity",e[e.Callback=3]="Callback";}(m||(m={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.PropertyCheck=4]="PropertyCheck",e[e.UnionIntersectionCheck=8]="UnionIntersectionCheck",e[e.InPropertyCheck=16]="InPropertyCheck";}(y||(y={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(v||(v={})),function(e){e[e.IncludeReadonly=1]="IncludeReadonly",e[e.ExcludeReadonly=2]="ExcludeReadonly",e[e.IncludeOptional=4]="IncludeOptional",e[e.ExcludeOptional=8]="ExcludeOptional";}(h||(h={})),function(e){e[e.None=0]="None",e[e.Source=1]="Source",e[e.Target=2]="Target",e[e.Both=3]="Both";}(b||(b={})),function(e){e.resolvedExports="resolvedExports",e.resolvedMembers="resolvedMembers";}(x||(x={})),function(e){e[e.Local=0]="Local",e[e.Parameter=1]="Parameter";}(D||(D={}));var C,E,k,N,F=e.and(R,(function(t){return !e.isAccessor(t)}));!function(e){e[e.GetAccessor=1]="GetAccessor",e[e.SetAccessor=2]="SetAccessor",e[e.PropertyAssignment=4]="PropertyAssignment",e[e.Method=8]="Method",e[e.PrivateStatic=16]="PrivateStatic",e[e.GetOrSetAccessor=3]="GetOrSetAccessor",e[e.PropertyAssignmentOrMethod=12]="PropertyAssignmentOrMethod";}(C||(C={})),function(e){e[e.None=0]="None",e[e.ExportValue=1]="ExportValue",e[e.ExportType=2]="ExportType",e[e.ExportNamespace=4]="ExportNamespace";}(E||(E={})),function(e){e[e.None=0]="None",e[e.StrongArityForUntypedJS=1]="StrongArityForUntypedJS",e[e.VoidIsNonOptional=2]="VoidIsNonOptional";}(k||(k={})),function(e){e[e.Uppercase=0]="Uppercase",e[e.Lowercase=1]="Lowercase",e[e.Capitalize=2]="Capitalize",e[e.Uncapitalize=3]="Uncapitalize";}(N||(N={}));var A,P=new e.Map(e.getEntries({Uppercase:0,Lowercase:1,Capitalize:2,Uncapitalize:3}));function w(){}function I(){this.flags=0;}function O(e){return e.id||(e.id=_,_++),e.id}function M(e){return e.id||(e.id=u,u++),e.id}function L(t,r){var n=e.getModuleInstanceState(t);return 1===n||r&&2===n}function R(e){return 255!==e.kind&&168!==e.kind||!!e.body}function B(t){switch(t.parent.kind){case 269:case 274:return e.isIdentifier(t);default:return e.isDeclarationName(t)}}function j(e){switch(e){case 0:return "yieldType";case 1:return "returnType";case 2:return "nextType"}}function J(e){return !!(1&e.flags)}function z(e){return !!(2&e.flags)}e.getNodeId=O,e.getSymbolId=M,e.isInstantiatedModule=L,e.createTypeChecker=function(t,r){var a,s,u,_,f=e.memoize((function(){var r=new e.Map;return t.getSourceFiles().forEach((function(e){e.resolvedModules&&e.resolvedModules.forEach((function(e){e&&e.packageId&&r.set(e.packageId.name,".d.ts"===e.extension||!!r.get(e.packageId.name));}));})),r})),g=e.objectAllocator.getSymbolConstructor(),m=e.objectAllocator.getTypeConstructor(),y=e.objectAllocator.getSignatureConstructor(),v=0,h=0,b=0,x=0,D=0,C=0,E=0,k=e.createSymbolTable(),N=[1],U=t.getCompilerOptions(),K=e.getEmitScriptTarget(U),V=e.getEmitModuleKind(U),q=e.getUseDefineForClassFields(U),W=e.getAllowSyntheticDefaultImports(U),H=e.getStrictOptionValue(U,"strictNullChecks"),G=e.getStrictOptionValue(U,"strictFunctionTypes"),Q=e.getStrictOptionValue(U,"strictBindCallApply"),X=e.getStrictOptionValue(U,"strictPropertyInitialization"),Y=e.getStrictOptionValue(U,"noImplicitAny"),Z=e.getStrictOptionValue(U,"noImplicitThis"),$=e.getStrictOptionValue(U,"useUnknownInCatchVariables"),ee=!!U.keyofStringsOnly,te=U.suppressExcessPropertyErrors?0:16384,re=U.exactOptionalPropertyTypes,ne=function(){var t=e.createBinaryExpressionTrampoline((function(t,r,i){return r?(r.stackIndex++,r.skip=!1,n(r,void 0),a(r,void 0)):r={checkMode:i,skip:!1,stackIndex:0,typeStack:[void 0,void 0]},e.isInJSFile(t)&&e.getAssignedExpandoInitializer(t)?(r.skip=!0,a(r,ax(t.right,i)),r):(function(t){var r=t.left,n=t.operatorToken,i=t.right;60===n.kind&&(!e.isBinaryExpression(r)||56!==r.operatorToken.kind&&55!==r.operatorToken.kind||YT(r,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(r.operatorToken.kind),e.tokenToString(n.kind)),!e.isBinaryExpression(i)||56!==i.operatorToken.kind&&55!==i.operatorToken.kind||YT(i,e.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses,e.tokenToString(i.operatorToken.kind),e.tokenToString(n.kind)));}(t),63!==t.operatorToken.kind||204!==t.left.kind&&203!==t.left.kind||(r.skip=!0,a(r,Ib(t.left,ax(t.right,i),i,108===t.right.kind))),r)}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r,o){if(!r.skip){var s=i(r);e.Debug.assertIsDefined(s),n(r,s),a(r,void 0);var c=t.kind;if(55===c||56===c||60===c){if(55===c){var l=e.walkUpParenthesizedExpressions(o.parent);fD(o.left,s,e.isIfStatement(l)?l.thenStatement:void 0);}gD(s,o.left);}}}),(function(e,t,n){if(!t.skip)return r(t,e)}),(function(t,r){var o;if(r.skip)o=i(r);else {var s=function(e){return e.typeStack[e.stackIndex]}(r);e.Debug.assertIsDefined(s);var c=i(r);e.Debug.assertIsDefined(c),o=Lb(t.left,t.operatorToken,t.right,s,c,t);}return r.skip=!1,n(r,void 0),a(r,void 0),r.stackIndex--,o}),(function(e,t,r){return a(e,t),e}));return function(r,n){var i=t(r,n);return e.Debug.assertIsDefined(i),i};function r(t,r){if(e.isBinaryExpression(r))return r;a(t,ax(r,t.checkMode));}function n(e,t){e.typeStack[e.stackIndex]=t;}function i(e){return e.typeStack[e.stackIndex+1]}function a(e,t){e.typeStack[e.stackIndex+1]=t;}}(),ie=function(){var r,n=t.getResolvedTypeReferenceDirectives();return n&&(r=new e.Map,n.forEach((function(e,r){if(e&&e.resolvedFileName){var n=t.getSourceFile(e.resolvedFileName);n&&a(n,r);}}))),{getReferencedExportContainer:qS,getReferencedImportDeclaration:WS,getReferencedDeclarationWithCollidingName:GS,isDeclarationWithCollidingName:QS,isValueAliasDeclaration:function(t){var r=e.getParseTreeNode(t);return !r||XS(r)},hasGlobalName:gT,isReferencedAliasDeclaration:function(t,r){var n=e.getParseTreeNode(t);return !n||eT(n,r)},getNodeCheckFlags:function(t){var r=e.getParseTreeNode(t);return r?oT(r):0},isTopLevelValueImportEqualsWithEntityName:YS,isDeclarationVisible:Ha,isImplementationOfOverload:tT,isRequiredInitializedParameter:rT,isOptionalUninitializedParameterProperty:nT,isExpandoFunctionDeclaration:iT,getPropertiesOfContainerFunction:aT,createTypeOfDeclaration:dT,createReturnTypeOfSignatureDeclaration:pT,createTypeOfExpression:fT,createLiteralConstValue:hT,isSymbolAccessible:Ea,isEntityNameVisible:wa,getConstantValue:function(t){var r=e.getParseTreeNode(t,cT);return r?lT(r):void 0},collectLinkedAliases:Ga,getReferencedValueDeclaration:yT,getTypeReferenceSerializationKind:_T,isOptionalParameter:nl,moduleExportsSomeValue:VS,isArgumentsLocalBinding:KS,getExternalModuleFileFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.hasPossibleExternalModuleReference);return r&&DT(r)},getTypeReferenceDirectivesForEntityName:function(e){if(r){var t=790504;(79===e.kind&&Tg(e)||205===e.kind&&!function(e){return e.parent&&227===e.parent.kind&&e.parent.parent&&290===e.parent.parent.kind}(e))&&(t=1160127);var n=Mi(e,t,!0);return n&&n!==Ne?i(n,t):void 0}},getTypeReferenceDirectivesForSymbol:i,isLiteralConstDeclaration:vT,isLateBound:function(t){var r=e.getParseTreeNode(t,e.isDeclaration),n=r&&$i(r);return !!(n&&4096&e.getCheckFlags(n))},getJsxFactoryEntity:bT,getJsxFragmentFactoryEntity:xT,getAllAccessorDeclarations:function(t){var r=172===(t=e.getParseTreeNode(t,e.isGetOrSetAccessorDeclaration)).kind?171:172,n=e.getDeclarationOfKind($i(t),r);return {firstAccessor:n&&n.pos<t.pos?n:t,secondAccessor:n&&n.pos<t.pos?t:n,setAccessor:172===t.kind?t:n,getAccessor:171===t.kind?t:n}},getSymbolOfExternalModuleSpecifier:function(e){return Bi(e,e,void 0)},isBindingCapturedByNode:function(t,r){var n=e.getParseTreeNode(t),i=e.getParseTreeNode(r);return !!n&&!!i&&(e.isVariableDeclaration(i)||e.isBindingElement(i))&&function(t,r){var n=Qn(t);return !!n&&e.contains(n.capturedBlockScopeBindings,$i(r))}(n,i)},getDeclarationStatementsForSourceFile:function(t,r,n,i){var a=e.getParseTreeNode(t);e.Debug.assert(a&&303===a.kind,"Non-sourcefile node passed into getDeclarationsForSourceFile");var o=$i(t);return o?o.exports?ae.symbolTableToDeclarationStatements(o.exports,t,r,n,i):[]:t.locals?ae.symbolTableToDeclarationStatements(t.locals,t,r,n,i):[]},isImportRequiredByAugmentation:function(t){var r=e.getSourceFileOfNode(t);if(!r.symbol)return !1;var n=DT(t);if(!n)return !1;if(n===r)return !1;for(var i=Qi(r.symbol),a=0,o=e.arrayFrom(i.values());a<o.length;a++){var s=o[a];if(s.mergeId){var c=Zi(s);if(c.declarations)for(var l=0,u=c.declarations;l<u.length;l++){var _=u[l];if(e.getSourceFileOfNode(_)===n)return !0}}}return !1}};function i(t,n){if(r&&function(t){if(!t.declarations)return !1;for(var n=t;;){var i=ea(n);if(!i)break;n=i;}if(n.valueDeclaration&&303===n.valueDeclaration.kind&&512&n.flags)return !1;for(var a=0,o=t.declarations;a<o.length;a++){var s=o[a],c=e.getSourceFileOfNode(s);if(r.has(c.path))return !0}return !1}(t)){for(var i,a=0,o=t.declarations;a<o.length;a++){var s=o[a];if(s.symbol&&s.symbol.flags&n){var c=e.getSourceFileOfNode(s),l=r.get(c.path);if(!l)return;(i||(i=[])).push(l);}}return i}}function a(n,i){if(!r.has(n.path)){r.set(n.path,i);for(var o=0,s=n.referencedFiles;o<s.length;o++){var c=s[o].fileName,l=e.resolveTripleslashReference(c,n.fileName),u=t.getSourceFile(l);u&&a(u,i);}}}}(),ae=function(){return {typeToTypeNode:function(e,t,n,i){return r(t,n,i,(function(t){return l(e,t)}))},indexInfoToIndexSignatureDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return f(e,t,void 0)}))},signatureToSignatureDeclaration:function(e,t,n,i,a){return r(n,i,a,(function(r){return g(e,t,r)}))},symbolToEntityName:function(e,t,n,i,a){return r(n,i,a,(function(r){return A(e,r,t,!1)}))},symbolToExpression:function(e,t,n,i,a){return r(n,i,a,(function(r){return P(e,r,t)}))},symbolToTypeParameterDeclarations:function(e,t,n,i){return r(t,n,i,(function(t){return D(e,t)}))},symbolToParameterDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return v(e,t)}))},typeParameterToDeclaration:function(e,t,n,i){return r(t,n,i,(function(t){return y(e,t)}))},symbolTableToDeclarationStatements:function(t,a,s,c,u){return r(a,s,c,(function(r){return function(t,r,a){var s=X(e.factory.createPropertyDeclaration,168,!0),c=X((function(t,r,n,i,a){return e.factory.createPropertySignature(r,n,i,a)}),167,!1),u=r.enclosingDeclaration,_=[],d=new e.Set,p=[],m=r;(r=i$1(i$1({},m),{usedSymbolNames:new e.Set(m.usedSymbolNames),remappedSymbolNames:new e.Map,tracker:i$1(i$1({},m.tracker),{trackSymbol:function(e,t,n){if(0===Ea(e,t,n,!1).accessibility){var i=x(e,r,n);4&e.flags||F(i[0]);}else if(m.tracker&&m.tracker.trackSymbol)return m.tracker.trackSymbol(e,t,n);return !1}})})).tracker=o(r,r.tracker),e.forEachEntry(t,(function(t,r){ne(t,e.unescapeLeadingUnderscores(r));}));var v,h=!a,b=t.get("export=");return b&&t.size>1&&2097152&b.flags&&(t=e.createSymbolTable()).set("export=",b),k(t),v=function(t){var r=e.findIndex(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!t.assertClause&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(r>=0){var n=t[r],i=e.mapDefined(n.exportClause.elements,(function(r){if(!r.propertyName){var n=e.indicesOf(t),i=e.filter(n,(function(n){return e.nodeHasName(t[n],r.name)}));if(e.length(i)&&e.every(i,(function(e){return S(t[e])}))){for(var a=0,o=i;a<o.length;a++){var s=o[a];t[s]=T(t[s]);}return}}return r}));e.length(i)?t[r]=e.factory.updateExportDeclaration(n,n.decorators,n.modifiers,n.isTypeOnly,e.factory.updateNamedExports(n.exportClause,i),n.moduleSpecifier,n.assertClause):e.orderedRemoveItemAt(t,r);}return t}(v=function(t){var r=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(r)>1){var i=e.filter(t,(function(t){return !e.isExportDeclaration(t)||!!t.moduleSpecifier||!t.exportClause}));t=n$3(n$3([],i,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),void 0)],!1);}var a=e.filter(t,(function(t){return e.isExportDeclaration(t)&&!!t.moduleSpecifier&&!!t.exportClause&&e.isNamedExports(t.exportClause)}));if(e.length(a)>1){var o=e.group(a,(function(t){return e.isStringLiteral(t.moduleSpecifier)?">"+t.moduleSpecifier.text:">"}));if(o.length!==a.length)for(var s=function(r){r.length>1&&(t=n$3(n$3([],e.filter(t,(function(e){return -1===r.indexOf(e)})),!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.flatMap(r,(function(t){return e.cast(t.exportClause,e.isNamedExports).elements}))),r[0].moduleSpecifier)],!1));},c=0,l=o;c<l.length;c++)s(l[c]);}return t}(v=function(t){var r=e.find(t,e.isExportAssignment),i=e.findIndex(t,e.isModuleDeclaration),a=-1!==i?t[i]:void 0;if(a&&r&&r.isExportEquals&&e.isIdentifier(r.expression)&&e.isIdentifier(a.name)&&e.idText(a.name)===e.idText(r.expression)&&a.body&&e.isModuleBlock(a.body)){var o=e.filter(t,(function(t){return !!(1&e.getEffectiveModifierFlags(t))})),s=a.name,c=a.body;if(e.length(o)&&(a=e.factory.updateModuleDeclaration(a,a.decorators,a.modifiers,a.name,c=e.factory.updateModuleBlock(c,e.factory.createNodeArray(n$3(n$3([],a.body.statements,!0),[e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.map(e.flatMap(o,(function(t){return r=t,e.isVariableStatement(r)?e.filter(e.map(r.declarationList.declarations,e.getNameOfDeclaration),D):e.filter([e.getNameOfDeclaration(r)],D);var r;})),(function(t){return e.factory.createExportSpecifier(!1,void 0,t)}))),void 0)],!1)))),t=n$3(n$3(n$3([],t.slice(0,i),!0),[a],!1),t.slice(i+1),!0)),!e.find(t,(function(t){return t!==a&&e.nodeHasName(t,s)}))){_=[];var l=!e.some(c.statements,(function(t){return e.hasSyntacticModifier(t,1)||e.isExportAssignment(t)||e.isExportDeclaration(t)}));e.forEach(c.statements,(function(e){w(e,l?1:0);})),t=n$3(n$3([],e.filter(t,(function(e){return e!==a&&e!==r})),!0),_,!0);}}return t}(v=_))),u&&(e.isSourceFile(u)&&e.isExternalOrCommonJsModule(u)||e.isModuleDeclaration(u))&&(!e.some(v,e.isExternalModuleIndicator)||!e.hasScopeMarker(v)&&e.some(v,e.needsScopeMarker))&&v.push(e.createEmptyExports(e.factory)),v;function D(e){return !!e&&79===e.kind}function S(t){return e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isModuleDeclaration(t)&&!e.isExternalModuleAugmentation(t)&&!e.isGlobalScopeAugmentation(t)||e.isInterfaceDeclaration(t)||NS(t)}function T(t){var r=-3&(1|e.getEffectiveModifierFlags(t));return e.factory.updateModifiers(t,r)}function E(t){var r=-2&e.getEffectiveModifierFlags(t);return e.factory.updateModifiers(t,r)}function k(t,r,n){r||p.push(new e.Map),t.forEach((function(e){N(e,!1,!!n);})),r||(p[p.length-1].forEach((function(e){N(e,!0,!!n);})),p.pop());}function N(t,_,p){var f=Zi(t);if(!d.has(M(f))&&(d.add(M(f)),!_||e.length(t.declarations)&&e.some(t.declarations,(function(t){return !!e.findAncestor(t,(function(e){return e===u}))})))){var g=r;r=function(t){var r=i$1({},t);return r.typeParameterNames&&(r.typeParameterNames=new e.Map(r.typeParameterNames)),r.typeParameterNamesByText&&(r.typeParameterNamesByText=new e.Set(r.typeParameterNamesByText)),r.typeParameterSymbolList&&(r.typeParameterSymbolList=new e.Set(r.typeParameterSymbolList)),r.tracker=o(r,r.tracker),r}(r);var v=function(t,i,o){var _,d,p=e.unescapeLeadingUnderscores(t.escapedName),f="default"===t.escapedName;if(!i||131072&r.flags||!e.isStringANonContextualKeyword(p)||f){var g=f&&!!(-113&t.flags||16&t.flags&&e.length(yc(Uo(t))))&&!(2097152&t.flags),m=!g&&!i&&e.isStringANonContextualKeyword(p)&&!f;(g||m)&&(i=!0);var v=(i?0:1)|(f&&!g?512:0),h=1536&t.flags&&7&t.flags&&"export="!==t.escapedName,b=h&&Q(Uo(t),t);if((8208&t.flags||b)&&O(Uo(t),t,ne(t,p),v),524288&t.flags&&function(t,n,i){var o,s=cs(t),c=Gn(t).typeParameters,u=e.map(c,(function(e){return y(e,r)})),_=null===(o=t.declarations)||void 0===o?void 0:o.find(e.isJSDocTypeAlias),d=e.getTextOfJSDocComment(_?_.comment||_.parent.comment:void 0),p=r.flags;r.flags|=8388608;var f=r.enclosingDeclaration;r.enclosingDeclaration=_;var g=_&&_.typeExpression&&e.isJSDocTypeExpression(_.typeExpression)&&V(r,_.typeExpression.type,F,a)||l(s,r);w(e.setSyntheticLeadingComments(e.factory.createTypeAliasDeclaration(void 0,void 0,ne(t,n),u,g),d?[{kind:3,text:"*\n * "+d.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]:[]),i),r.flags=p,r.enclosingDeclaration=f;}(t,p,v),7&t.flags&&"export="!==t.escapedName&&!(4194304&t.flags)&&!(32&t.flags)&&!b)if(o)G(t)&&(m=!1,g=!1);else {var x=Uo(t),D=ne(t,p);if(16&t.flags||!Q(x,t)){var S=2&t.flags?Mm(t)?2:1:void 0,T=!g&&4&t.flags?te(D,t):D,E=t.declarations&&e.find(t.declarations,(function(t){return e.isVariableDeclaration(t)}));E&&e.isVariableDeclarationList(E.parent)&&1===E.parent.declarations.length&&(E=E.parent.parent);var k=null===(_=t.declarations)||void 0===_?void 0:_.find(e.isPropertyAccessExpression);if(k&&e.isBinaryExpression(k.parent)&&e.isIdentifier(k.parent.right)&&(null===(d=x.symbol)||void 0===d?void 0:d.valueDeclaration)&&e.isSourceFile(x.symbol.valueDeclaration)){var N=D===k.parent.right.escapedText?void 0:k.parent.right;w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,N,D)])),0),r.tracker.trackSymbol(x.symbol,r.enclosingDeclaration,111551);}else w(e.setTextRange(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(T,void 0,J(r,x,t,u,F,a))],S)),E),T!==D?-2&v:v),T===D||i||(w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,T,D)])),0),m=!1,g=!1);}else O(x,t,D,v);}if(384&t.flags&&function(t,r,n){w(e.factory.createEnumDeclaration(void 0,e.factory.createModifiersFromModifierFlags(Ab(t)?2048:0),ne(t,r),e.map(e.filter(yc(Uo(t)),(function(e){return !!(8&e.flags)})),(function(t){var r=t.declarations&&t.declarations[0]&&e.isEnumMember(t.declarations[0])?lT(t.declarations[0]):void 0;return e.factory.createEnumMember(e.unescapeLeadingUnderscores(t.escapedName),void 0===r?void 0:"string"==typeof r?e.factory.createStringLiteral(r):e.factory.createNumericLiteral(r))}))),n);}(t,p,v),32&t.flags&&(4&t.flags&&t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration.parent)&&e.isClassExpression(t.valueDeclaration.parent.right)?W(t,ne(t,p),v):function(t,i,o){var c,u,_=null===(c=t.declarations)||void 0===c?void 0:c.find(e.isClassLike),d=r.enclosingDeclaration;r.enclosingDeclaration=_||d;var p=Xo(t),f=e.map(p,(function(e){return y(e,r)})),g=ss(t),m=is(g),v=_&&e.getEffectiveImplementsTypeNodes(_),h=v&&function(t){var n=e.mapDefined(t,(function(t){var n,i=r.enclosingDeclaration;r.enclosingDeclaration=t;var o=t.expression;if(e.isEntityNameExpression(o)){if(e.isIdentifier(o)&&""===e.idText(o))return c(void 0);var s=void 0;if(s=(n=z(o,r,F)).introducesError,o=n.node,s)return c(void 0)}return c(e.factory.createExpressionWithTypeArguments(o,e.map(t.typeArguments,(function(e){return V(r,e,F,a)||l(dd(e),r)}))));function c(e){return r.enclosingDeclaration=i,e}}));if(n.length===t.length)return n}(v)||e.mapDefined(function(t){var r=e.emptyArray;if(t.symbol.declarations)for(var n=0,i=t.symbol.declarations;n<i.length;n++){var a=i[n],o=e.getEffectiveImplementsTypeNodes(a);if(o)for(var s=0,c=o;s<c.length;s++){var l=dd(c[s]);ro(l)||(r===e.emptyArray?r=[l]:r.push(l));}}return r}(g),ee),b=Uo(t),x=!!(null===(u=b.symbol)||void 0===u?void 0:u.valueDeclaration)&&e.isClassLike(b.symbol.valueDeclaration),D=x?rs(b):we,S=n$3(n$3([],e.length(m)?[e.factory.createHeritageClause(94,e.map(m,(function(t){return function(t,n,i){var a=$(t,111551);if(a)return a;var o=te("".concat(i,"_base"));return w(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(o,void 0,l(n,r))],2)),0),e.factory.createExpressionWithTypeArguments(e.factory.createIdentifier(o),void 0)}(t,D,i)})))]:[],!0),e.length(h)?[e.factory.createHeritageClause(117,h)]:[],!0),T=function(t,r,n){if(!e.length(r))return n;var i=new e.Map;e.forEach(n,(function(e){i.set(e.escapedName,e);}));for(var a=0,o=r;a<o.length;a++)for(var s=0,c=yc(Ls(o[a],t.thisType));s<c.length;s++){var l=c[s],u=i.get(l.escapedName);u&&!zp(u,l)&&i.delete(l.escapedName);}return e.arrayFrom(i.values())}(g,m,yc(g)),C=e.filter(T,(function(t){var r=t.valueDeclaration;return !(!r||e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name))})),E=e.some(T,(function(t){var r=t.valueDeclaration;return !!r&&e.isNamedDeclaration(r)&&e.isPrivateIdentifier(r.name)}))?[e.factory.createPropertyDeclaration(void 0,void 0,e.factory.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:e.emptyArray,k=e.flatMap(C,(function(e){return s(e,!1,m[0])})),N=e.flatMap(e.filter(yc(b),(function(e){return !(4194304&e.flags||"prototype"===e.escapedName||q(e))})),(function(e){return s(e,!0,D)})),A=!x&&t.valueDeclaration&&e.isInJSFile(t.valueDeclaration)&&!e.some(Uc(b,1))?[e.factory.createConstructorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(8),[],void 0)]:Y(1,b,D,170),P=Z(g,m[0]);r.enclosingDeclaration=d,w(e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,i,f,S,n$3(n$3(n$3(n$3(n$3([],P,!0),N,!0),A,!0),k,!0),E,!0)),t.declarations&&e.filter(t.declarations,(function(t){return e.isClassDeclaration(t)||e.isClassExpression(t)}))[0]),o);}(t,ne(t,p),v)),(1536&t.flags&&(!h||function(t){return e.every(I(t),(function(e){return !(111551&Ei(e).flags)}))}(t))||b)&&function(t,n,i){var a=I(t),o=e.arrayToMultiMap(a,(function(e){return e.parent&&e.parent===t?"real":"merged"})),s=o.get("real")||e.emptyArray,c=o.get("merged")||e.emptyArray;if(e.length(s)&&j(s,u=ne(t,n),i,!!(67108880&t.flags)),e.length(c)){var l=e.getSourceFileOfNode(r.enclosingDeclaration),u=ne(t,n),_=e.factory.createModuleBlock([e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports(e.mapDefined(e.filter(c,(function(e){return "export="!==e.escapedName})),(function(n){var i,a,o=e.unescapeLeadingUnderscores(n.escapedName),s=ne(n,o),c=n.declarations&&di(n);if(!l||(c?l===e.getSourceFileOfNode(c):e.some(n.declarations,(function(t){return e.getSourceFileOfNode(t)===l})))){var u=c&&Ti(c,!0);F(u||n);var _=u?ne(u,e.unescapeLeadingUnderscores(u.escapedName)):s;return e.factory.createExportSpecifier(!1,o===_?void 0:_,o)}null===(a=null===(i=r.tracker)||void 0===i?void 0:i.reportNonlocalAugmentation)||void 0===a||a.call(i,l,t,n);}))))]);w(e.factory.createModuleDeclaration(void 0,void 0,e.factory.createIdentifier(u),_,16),0);}}(t,p,v),64&t.flags&&!(32&t.flags)&&function(t,i,a){var o=ss(t),s=Xo(t),l=e.map(s,(function(e){return y(e,r)})),u=is(o),_=e.length(u)?$u(u):void 0,d=e.flatMap(yc(o),(function(e){return function(e,t){return c(e,!1,t)}(e,_)})),p=Y(0,o,_,173),f=Y(1,o,_,174),g=Z(o,_),m=e.length(u)?[e.factory.createHeritageClause(94,e.mapDefined(u,(function(e){return $(e,111551)})))]:void 0;w(e.factory.createInterfaceDeclaration(void 0,void 0,ne(t,i),l,m,n$3(n$3(n$3(n$3([],g,!0),f,!0),p,!0),d,!0)),a);}(t,p,v),2097152&t.flags&&W(t,ne(t,p),v),4&t.flags&&"export="===t.escapedName&&G(t),8388608&t.flags&&t.declarations)for(var A=0,P=t.declarations;A<P.length;A++){var M=P[A],L=Ri(M,M.moduleSpecifier);L&&w(e.factory.createExportDeclaration(void 0,void 0,!1,void 0,e.factory.createStringLiteral(C(L,r))),0);}g?w(e.factory.createExportAssignment(void 0,void 0,!1,e.factory.createIdentifier(ne(t,p))),0):m&&w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,ne(t,p),p)])),0);}else r.encounteredError=!0;}(t,_,p);return r.reportedDiagnostic&&(m.reportedDiagnostic=r.reportedDiagnostic),r=g,v}}function F(t){if(!e.some(t.declarations,e.isParameterDeclaration)){e.Debug.assertIsDefined(p[p.length-1]),te(e.unescapeLeadingUnderscores(t.escapedName),t);var r=!!(2097152&t.flags)&&!e.some(t.declarations,(function(t){return !!e.findAncestor(t,e.isExportDeclaration)||e.isNamespaceExport(t)||e.isImportEqualsDeclaration(t)&&!e.isExternalModuleReference(t.moduleReference)}));p[r?0:p.length-1].set(M(t),t);}}function w(t,n){if(e.canHaveModifiers(t)){var i=0,a=r.enclosingDeclaration&&(e.isJSDocTypeAlias(r.enclosingDeclaration)?e.getSourceFileOfNode(r.enclosingDeclaration):r.enclosingDeclaration);1&n&&a&&(function(t){return e.isSourceFile(t)&&(e.isExternalOrCommonJsModule(t)||e.isJsonSourceFile(t))||e.isAmbientModule(t)&&!e.isGlobalScopeAugmentation(t)}(a)||e.isModuleDeclaration(a))&&S(t)&&(i|=1),!h||1&i||a&&8388608&a.flags||!(e.isEnumDeclaration(t)||e.isVariableStatement(t)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isModuleDeclaration(t))||(i|=2),512&n&&(e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionDeclaration(t))&&(i|=512),i&&(t=e.factory.updateModifiers(t,i|e.getEffectiveModifierFlags(t)));}_.push(t);}function I(t){return t.exports?e.filter(e.arrayFrom(t.exports.values()),q):[]}function O(t,n,i,o){for(var s=0,c=Uc(t,0);s<c.length;s++){var l=c[s],u=g(l,255,r,{name:e.factory.createIdentifier(i),privateSymbolVisitor:F,bundledImports:a});w(e.setTextRange(u,R(l)),o);}1536&n.flags&&n.exports&&n.exports.size||j(e.filter(yc(t),q),i,o,!0);}function R(t){if(t.declaration&&t.declaration.parent){if(e.isBinaryExpression(t.declaration.parent)&&5===e.getAssignmentDeclarationKind(t.declaration.parent))return t.declaration.parent;if(e.isVariableDeclaration(t.declaration.parent)&&t.declaration.parent.parent)return t.declaration.parent.parent}return t.declaration}function j(t,n,a,o){if(e.length(t)){var s=e.arrayToMultiMap(t,(function(t){return !e.length(t.declarations)||e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(r.enclosingDeclaration)}))?"local":"remote"})).get("local")||e.emptyArray,c=e.parseNodeFactory.createModuleDeclaration(void 0,void 0,e.factory.createIdentifier(n),e.factory.createModuleBlock([]),16);e.setParent(c,u),c.locals=e.createSymbolTable(t),c.symbol=t[0].parent;var l=_;_=[];var d=h;h=!1;var p=i$1(i$1({},r),{enclosingDeclaration:c}),f=r;r=p,k(e.createSymbolTable(s),o,!0),r=f,h=d;var g=_;_=l;var m=e.map(g,(function(t){return e.isExportAssignment(t)&&!t.isExportEquals&&e.isIdentifier(t.expression)?e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t.expression,e.factory.createIdentifier("default"))])):t})),y=e.every(m,(function(t){return e.hasSyntacticModifier(t,1)}))?e.map(m,E):m;w(c=e.factory.updateModuleDeclaration(c,c.decorators,c.modifiers,c.name,e.factory.createModuleBlock(y)),a);}}function q(t){return !!(2887656&t.flags)||!(4194304&t.flags||"prototype"===t.escapedName||t.valueDeclaration&&e.isStatic(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))}function W(t,n,i){var a,o,s,c,l,u=di(t);if(!u)return e.Debug.fail();var _,d=Zi(Ti(u,!0));if(d){var p=e.isShorthandAmbientModuleSymbol(d)&&(_=t.declarations,e.firstDefined(_,(function(t){if(e.isImportSpecifier(t)||e.isExportSpecifier(t))return e.idText(t.propertyName||t.name);if(e.isBinaryExpression(t)||e.isExportAssignment(t)){var r=e.isExportAssignment(t)?t.expression:t.right;if(e.isPropertyAccessExpression(r))return e.idText(r.name)}if(pi(t)){var n=e.getNameOfDeclaration(t);if(n&&e.isIdentifier(n))return e.idText(n)}})))||e.unescapeLeadingUnderscores(d.escapedName);"export="===p&&(e.getESModuleInterop(U)||U.allowSyntheticDefaultImports)&&(p="default");var f=ne(d,p);switch(F(d),u.kind){case 202:if(253===(null===(o=null===(a=u.parent)||void 0===a?void 0:a.parent)||void 0===o?void 0:o.kind)){var g=C(d.parent||d,r),m=u.propertyName;w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,m&&e.isIdentifier(m)?e.factory.createIdentifier(e.idText(m)):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(g),void 0),0);break}e.Debug.failBadSyntaxKind((null===(s=u.parent)||void 0===s?void 0:s.parent)||u,"Unhandled binding element grandparent kind in declaration serialization");break;case 295:220===(null===(l=null===(c=u.parent)||void 0===c?void 0:c.parent)||void 0===l?void 0:l.kind)&&H(e.unescapeLeadingUnderscores(t.escapedName),f);break;case 253:if(e.isPropertyAccessExpression(u.initializer)){var y=u.initializer,v=e.factory.createUniqueName(n),h=C(d.parent||d,r);w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,v,e.factory.createExternalModuleReference(e.factory.createStringLiteral(h))),0),w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(n),e.factory.createQualifiedName(v,y.name)),i);break}case 264:if("export="===d.escapedName&&e.some(d.declarations,e.isJsonSourceFile)){G(t);break}var b=!(512&d.flags||e.isVariableDeclaration(u));w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(n),b?A(d,r,67108863,!1):e.factory.createExternalModuleReference(e.factory.createStringLiteral(C(d,r)))),b?i:0);break;case 263:w(e.factory.createNamespaceExportDeclaration(e.idText(u.name)),0);break;case 266:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,e.factory.createIdentifier(n),void 0),e.factory.createStringLiteral(C(d.parent||d,r)),void 0),0);break;case 267:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(n))),e.factory.createStringLiteral(C(d,r)),void 0),0);break;case 273:w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamespaceExport(e.factory.createIdentifier(n)),e.factory.createStringLiteral(C(d,r))),0);break;case 269:w(e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamedImports([e.factory.createImportSpecifier(!1,n!==p?e.factory.createIdentifier(p):void 0,e.factory.createIdentifier(n))])),e.factory.createStringLiteral(C(d.parent||d,r)),void 0),0);break;case 274:var x=u.parent.parent.moduleSpecifier;H(e.unescapeLeadingUnderscores(t.escapedName),x?p:f,x&&e.isStringLiteralLike(x)?e.factory.createStringLiteral(x.text):void 0);break;case 270:G(t);break;case 220:case 205:case 206:"default"===t.escapedName||"export="===t.escapedName?G(t):H(n,f);break;default:return e.Debug.failBadSyntaxKind(u,"Unhandled alias declaration kind in symbol serializer!")}}}function H(t,r,n){w(e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([e.factory.createExportSpecifier(!1,t!==r?r:void 0,t)]),n),0);}function G(t){if(4194304&t.flags)return !1;var n=e.unescapeLeadingUnderscores(t.escapedName),i="export="===n,o=i||"default"===n,s=t.declarations&&di(t),c=s&&Ti(s,!0);if(c&&e.length(c.declarations)&&e.some(c.declarations,(function(t){return e.getSourceFileOfNode(t)===e.getSourceFileOfNode(u)}))){var l=s&&(e.isExportAssignment(s)||e.isBinaryExpression(s)?e.getExportAssignmentExpression(s):e.getPropertyAssignmentAliasLikeExpression(s)),d=l&&e.isEntityNameExpression(l)?function(t){switch(t.kind){case 79:return t;case 160:do{t=t.left;}while(79!==t.kind);return t;case 205:do{if(e.isModuleExportsAccessExpression(t.expression)&&!e.isPrivateIdentifier(t.name))return t.name;t=t.expression;}while(79!==t.kind);return t}}(l):void 0,p=d&&Mi(d,67108863,!0,!0,u);(p||c)&&F(p||c);var f=r.tracker.trackSymbol;if(r.tracker.trackSymbol=function(){return !1},o)_.push(e.factory.createExportAssignment(void 0,void 0,i,P(c,r,67108863)));else if(d===l&&d)H(n,e.idText(d));else if(l&&e.isClassExpression(l))H(n,ne(c,e.symbolName(c)));else {var g=te(n,t);w(e.factory.createImportEqualsDeclaration(void 0,void 0,!1,e.factory.createIdentifier(g),A(c,r,67108863,!1)),0),H(n,g);}return r.tracker.trackSymbol=f,!0}g=te(n,t);var m=jf(Uo(Zi(t)));return Q(m,t)?O(m,t,g,o?0:1):w(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(g,void 0,J(r,m,t,u,F,a))],2)),c&&4&c.flags&&"export="===c.escapedName?2:n===g?1:0),o?(_.push(e.factory.createExportAssignment(void 0,void 0,i,e.factory.createIdentifier(g))),!0):n!==g&&(H(n,g),!0)}function Q(t,n){var i=e.getSourceFileOfNode(r.enclosingDeclaration);return 48&e.getObjectFlags(t)&&!e.length(Hc(t))&&!Ja(t)&&!(!e.length(e.filter(yc(t),q))&&!e.length(Uc(t,0)))&&!e.length(Uc(t,1))&&!B(n,u)&&!(t.symbol&&e.some(t.symbol.declarations,(function(t){return e.getSourceFileOfNode(t)!==i})))&&!e.some(yc(t),(function(e){return Ns(e.escapedName)}))&&!e.some(yc(t),(function(t){return e.some(t.declarations,(function(t){return e.getSourceFileOfNode(t)!==i}))}))&&e.every(yc(t),(function(t){return e.isIdentifierText(e.symbolName(t),K)}))}function X(t,n,i){return function(o,s,c){var l,_,d,p,f,m=e.getDeclarationModifierFlagsFromSymbol(o),y=!!(8&m);if(s&&2887656&o.flags)return [];if(4194304&o.flags||c&&Jc(c,o.escapedName)&&Db(Jc(c,o.escapedName))===Db(o)&&(16777216&o.flags)==(16777216&Jc(c,o.escapedName).flags)&&Wd(Uo(o),eo(c,o.escapedName)))return [];var v=-257&m|(s?32:0),h=L(o,r),b=null===(l=o.declarations)||void 0===l?void 0:l.find(e.or(e.isPropertyDeclaration,e.isAccessor,e.isVariableDeclaration,e.isPropertySignature,e.isBinaryExpression,e.isPropertyAccessExpression));if(98304&o.flags&&i){var x=[];if(65536&o.flags&&x.push(e.setTextRange(e.factory.createSetAccessorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(v),h,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"arg",void 0,y?void 0:J(r,Uo(o),o,u,F,a))],void 0),(null===(_=o.declarations)||void 0===_?void 0:_.find(e.isSetAccessor))||b)),32768&o.flags){var D=8&m;x.push(e.setTextRange(e.factory.createGetAccessorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(v),h,[],D?void 0:J(r,Uo(o),o,u,F,a),void 0),(null===(d=o.declarations)||void 0===d?void 0:d.find(e.isGetAccessor))||b));}return x}if(98311&o.flags)return e.setTextRange(t(void 0,e.factory.createModifiersFromModifierFlags((Db(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,y?void 0:J(r,Uo(o),o,u,F,a),void 0),(null===(p=o.declarations)||void 0===p?void 0:p.find(e.or(e.isPropertyDeclaration,e.isVariableDeclaration)))||b);if(8208&o.flags){var S=Uc(Uo(o),0);if(8&v)return e.setTextRange(t(void 0,e.factory.createModifiersFromModifierFlags((Db(o)?64:0)|v),h,16777216&o.flags?e.factory.createToken(57):void 0,void 0,void 0),(null===(f=o.declarations)||void 0===f?void 0:f.find(e.isFunctionLikeDeclaration))||S[0]&&S[0].declaration||o.declarations&&o.declarations[0]);for(var T=[],C=0,E=S;C<E.length;C++){var k=E[C],N=g(k,n,r,{name:h,questionToken:16777216&o.flags?e.factory.createToken(57):void 0,modifiers:v?e.factory.createModifiersFromModifierFlags(v):void 0}),A=k.declaration&&e.isPrototypePropertyAssignment(k.declaration.parent)?k.declaration.parent:k.declaration;T.push(e.setTextRange(N,A));}return T}return e.Debug.fail("Unhandled class member kind! ".concat(o.__debugFlags||o.flags))}}function Y(t,n,i,a){var o=Uc(n,t);if(1===t){if(!i&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(i){var s=Uc(i,1);if(!e.length(s)&&e.every(o,(function(t){return 0===e.length(t.parameters)})))return [];if(s.length===o.length){for(var c=!1,l=0;l<s.length;l++)if(!Kp(o[l],s[l],!1,!1,!0,Hd)){c=!0;break}if(!c)return []}}for(var u=0,_=0,d=o;_<d.length;_++){var p=d[_];p.declaration&&(u|=e.getSelectedEffectiveModifierFlags(p.declaration,24));}if(u)return [e.setTextRange(e.factory.createConstructorDeclaration(void 0,e.factory.createModifiersFromModifierFlags(u),[],void 0),o[0].declaration)]}for(var f=[],m=0,y=o;m<y.length;m++){var v=y[m],h=g(v,a,r);f.push(e.setTextRange(h,v.declaration));}return f}function Z(e,t){for(var n=[],i=0,a=Hc(e);i<a.length;i++){var o=a[i];if(t){var s=Gc(t,o.keyType);if(s&&Wd(o.type,s.type))continue}n.push(f(o,r,void 0));}return n}function $(t,n){var i,a;if(t.target&&Ta(t.target.symbol,u,n)?(i=e.map(zl(t),(function(e){return l(e,r)})),a=P(t.target.symbol,r,788968)):t.symbol&&Ta(t.symbol,u,n)&&(a=P(t.symbol,r,788968)),a)return e.factory.createExpressionWithTypeArguments(a,i)}function ee(t){return $(t,788968)||(t.symbol?e.factory.createExpressionWithTypeArguments(P(t.symbol,r,788968),void 0):void 0)}function te(e,t){var n,i,a=t?M(t):void 0;if(a&&r.remappedSymbolNames.has(a))return r.remappedSymbolNames.get(a);t&&(e=re(t,e));for(var o=0,s=e;null===(n=r.usedSymbolNames)||void 0===n?void 0:n.has(e);)o++,e="".concat(s,"_").concat(o);return null===(i=r.usedSymbolNames)||void 0===i||i.add(e),a&&r.remappedSymbolNames.set(a,e),e}function re(t,n){if("default"===n||"__class"===n||"__function"===n){var i=r.flags;r.flags|=16777216;var a=Wa(t,r);r.flags=i,n=a.length>0&&e.isSingleOrDoubleQuote(a.charCodeAt(0))?e.stripQuotes(a):a;}return "default"===n?n="_default":"export="===n&&(n="_exports"),e.isIdentifierText(n,K)&&!e.isStringANonContextualKeyword(n)?n:"_"+n.replace(/[^a-zA-Z0-9]/g,"_")}function ne(e,t){var n=M(e);return r.remappedSymbolNames.has(n)?r.remappedSymbolNames.get(n):(t=re(e,t),r.remappedSymbolNames.set(n,t),t)}}(t,r,u)}))}};function r(r,n,i,a){var s,c;e.Debug.assert(void 0===r||0==(8&r.flags));var l={enclosingDeclaration:r,flags:n||0,tracker:i&&i.trackSymbol?i:{trackSymbol:function(){return !1},moduleResolverHost:134217728&n?{getCommonSourceDirectory:t.getCommonSourceDirectory?function(){return t.getCommonSourceDirectory()}:function(){return ""},getCurrentDirectory:function(){return t.getCurrentDirectory()},getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),useCaseSensitiveFileNames:e.maybeBind(t,t.useCaseSensitiveFileNames),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},fileExists:function(e){return t.fileExists(e)},getFileIncludeReasons:function(){return t.getFileIncludeReasons()},readFile:t.readFile?function(e){return t.readFile(e)}:void 0}:void 0},encounteredError:!1,reportedDiagnostic:!1,visitedTypes:void 0,symbolDepth:void 0,inferTypeParameters:void 0,approximateLength:0};l.tracker=o(l,l.tracker);var u=a(l);return l.truncating&&1&l.flags&&(null===(c=null===(s=l.tracker)||void 0===s?void 0:s.reportTruncationError)||void 0===c||c.call(s)),l.encounteredError?void 0:u}function o(e,t){var r=t.trackSymbol;return i$1(i$1({},t),{reportCyclicStructureError:n(t.reportCyclicStructureError),reportInaccessibleThisError:n(t.reportInaccessibleThisError),reportInaccessibleUniqueSymbolError:n(t.reportInaccessibleUniqueSymbolError),reportLikelyUnsafeImportRequiredError:n(t.reportLikelyUnsafeImportRequiredError),reportNonlocalAugmentation:n(t.reportNonlocalAugmentation),reportPrivateInBaseOfClassExpression:n(t.reportPrivateInBaseOfClassExpression),reportNonSerializableProperty:n(t.reportNonSerializableProperty),trackSymbol:r&&function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(void 0,t);return i&&(e.reportedDiagnostic=!0),i}});function n(t){return t?function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.reportedDiagnostic=!0,t.apply(void 0,r)}:t}}function s(t){return t.truncating?t.truncating:t.truncating=t.approximateLength>(1&t.flags?e.noTruncationMaximumTruncationLength:e.defaultMaximumTruncationLength)}function l(t,r){a&&a.throwIfCancellationRequested&&a.throwIfCancellationRequested();var n=8388608&r.flags;if(r.flags&=-8388609,!t)return 262144&r.flags?(r.approximateLength+=3,e.factory.createKeywordTypeNode(130)):void(r.encounteredError=!0);if(536870912&r.flags||(t=Mc(t)),1&t.flags)return t.aliasSymbol?e.factory.createTypeReferenceNode(E(t.aliasSymbol),p(t.aliasTypeArguments,r)):t===Le?e.addSyntheticLeadingComment(e.factory.createKeywordTypeNode(130),3,"unresolved"):(r.approximateLength+=3,e.factory.createKeywordTypeNode(t===Be?138:130));if(2&t.flags)return e.factory.createKeywordTypeNode(154);if(4&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(149);if(8&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(146);if(64&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(157);if(16&t.flags&&!t.aliasSymbol)return r.approximateLength+=7,e.factory.createKeywordTypeNode(133);if(1024&t.flags&&!(1048576&t.flags)){var i=ea(t.symbol),o=k(i,r,788968);if(ms(i)===t)return o;var c=e.symbolName(t.symbol);return e.isIdentifierText(c,0)?J(o,e.factory.createTypeReferenceNode(c,void 0)):e.isImportTypeNode(o)?(o.isTypeOf=!0,e.factory.createIndexedAccessTypeNode(o,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c)))):e.isTypeReferenceNode(o)?e.factory.createIndexedAccessTypeNode(e.factory.createTypeQueryNode(o.typeName),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(c))):e.Debug.fail("Unhandled type node kind returned from `symbolToTypeNode`.")}if(1056&t.flags)return k(t.symbol,r,788968);if(128&t.flags)return r.approximateLength+=t.value.length+2,e.factory.createLiteralTypeNode(e.setEmitFlags(e.factory.createStringLiteral(t.value,!!(268435456&r.flags)),16777216));if(256&t.flags){var _=t.value;return r.approximateLength+=(""+_).length,e.factory.createLiteralTypeNode(_<0?e.factory.createPrefixUnaryExpression(40,e.factory.createNumericLiteral(-_)):e.factory.createNumericLiteral(_))}if(2048&t.flags)return r.approximateLength+=e.pseudoBigIntToString(t.value).length+1,e.factory.createLiteralTypeNode(e.factory.createBigIntLiteral(t.value));if(512&t.flags)return r.approximateLength+=t.intrinsicName.length,e.factory.createLiteralTypeNode("true"===t.intrinsicName?e.factory.createTrue():e.factory.createFalse());if(8192&t.flags){if(!(1048576&r.flags)){if(Sa(t.symbol,r.enclosingDeclaration))return r.approximateLength+=6,k(t.symbol,r,111551);r.tracker.reportInaccessibleUniqueSymbolError&&r.tracker.reportInaccessibleUniqueSymbolError();}return r.approximateLength+=13,e.factory.createTypeOperatorNode(153,e.factory.createKeywordTypeNode(150))}if(16384&t.flags)return r.approximateLength+=4,e.factory.createKeywordTypeNode(114);if(32768&t.flags)return r.approximateLength+=9,e.factory.createKeywordTypeNode(152);if(65536&t.flags)return r.approximateLength+=4,e.factory.createLiteralTypeNode(e.factory.createNull());if(131072&t.flags)return r.approximateLength+=5,e.factory.createKeywordTypeNode(143);if(4096&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(150);if(67108864&t.flags)return r.approximateLength+=6,e.factory.createKeywordTypeNode(147);if(T_(t))return 4194304&r.flags&&(r.encounteredError||32768&r.flags||(r.encounteredError=!0),r.tracker.reportInaccessibleThisError&&r.tracker.reportInaccessibleThisError()),r.approximateLength+=4,e.factory.createThisTypeNode();if(!n&&t.aliasSymbol&&(16384&r.flags||Da(t.aliasSymbol,r.enclosingDeclaration))){var y=p(t.aliasTypeArguments,r);return !pa(t.aliasSymbol.escapedName)||32&t.aliasSymbol.flags?k(t.aliasSymbol,r,788968,y):e.factory.createTypeReferenceNode(e.factory.createIdentifier(""),y)}var v=e.getObjectFlags(t);if(4&v)return e.Debug.assert(!!(524288&t.flags)),t.node?R(t,j):j(t);if(262144&t.flags||3&v){if(262144&t.flags&&e.contains(r.inferTypeParameters,t))return r.approximateLength+=e.symbolName(t.symbol).length+6,e.factory.createInferTypeNode(m(t,r,void 0));if(4&r.flags&&262144&t.flags&&!Da(t.symbol,r.enclosingDeclaration)){var h=F(t,r);return r.approximateLength+=e.idText(h).length,e.factory.createTypeReferenceNode(e.factory.createIdentifier(e.idText(h)),void 0)}return t.symbol?k(t.symbol,r,788968):e.factory.createTypeReferenceNode(e.factory.createIdentifier("?"),void 0)}if(1048576&t.flags&&t.origin&&(t=t.origin),3145728&t.flags){var b=1048576&t.flags?function(e){for(var t=[],r=0,n=0;n<e.length;n++){var i=e[n];if(r|=i.flags,!(98304&i.flags)){if(1536&i.flags){var a=512&i.flags?et:ds(i);if(1048576&a.flags){var o=a.types.length;if(n+o<=e.length&&rd(e[n+o-1])===rd(a.types[o-1])){t.push(a),n+=o-1;continue}}}t.push(i);}}return 65536&r&&t.push(qe),32768&r&&t.push(ze),t||e}(t.types):t.types;if(1===e.length(b))return l(b[0],r);var x=p(b,r,!0);return x&&x.length>0?1048576&t.flags?e.factory.createUnionTypeNode(x):e.factory.createIntersectionTypeNode(x):void(r.encounteredError||262144&r.flags||(r.encounteredError=!0))}if(48&v)return e.Debug.assert(!!(524288&t.flags)),L(t);if(4194304&t.flags){var D=t.type;r.approximateLength+=6;var S=l(D,r);return e.factory.createTypeOperatorNode(140,S)}if(134217728&t.flags){var T=t.texts,C=t.types,N=e.factory.createTemplateHead(T[0]),A=e.factory.createNodeArray(e.map(C,(function(t,n){return e.factory.createTemplateLiteralTypeSpan(l(t,r),(n<C.length-1?e.factory.createTemplateMiddle:e.factory.createTemplateTail)(T[n+1]))})));return r.approximateLength+=2,e.factory.createTemplateLiteralType(N,A)}if(268435456&t.flags){var P=l(t.type,r);return k(t.symbol,r,788968,[P])}if(8388608&t.flags){var w=l(t.objectType,r);return S=l(t.indexType,r),r.approximateLength+=2,e.factory.createIndexedAccessTypeNode(w,S)}return 16777216&t.flags?R(t,(function(t){return function(t){var n=l(t.checkType,r),i=r.inferTypeParameters;r.inferTypeParameters=t.root.inferTypeParameters;var a=l(t.extendsType,r);r.inferTypeParameters=i;var o=I(j_(t)),s=I(J_(t));return r.approximateLength+=15,e.factory.createConditionalTypeNode(n,a,o,s)}(t)})):33554432&t.flags?l(t.baseType,r):e.Debug.fail("Should be unreachable.");function I(e){var t,n,i;return 1048576&e.flags?(null===(t=r.visitedTypes)||void 0===t?void 0:t.has(Bu(e)))?(131072&r.flags||(r.encounteredError=!0,null===(i=null===(n=r.tracker)||void 0===n?void 0:n.reportCyclicStructureError)||void 0===i||i.call(n)),u(r)):R(e,(function(e){return l(e,r)})):l(e,r)}function L(t){var n,i=t.id,a=t.symbol;if(a){var o=Ja(t)?788968:111551;if(Fh(a.valueDeclaration))return k(a,r,o);if(32&a.flags&&!Bo(a)&&!(a.valueDeclaration&&225===a.valueDeclaration.kind&&2048&r.flags)||896&a.flags||function(){var t,n=!!(8192&a.flags)&&e.some(a.declarations,(function(t){return e.isStatic(t)})),o=!!(16&a.flags)&&(a.parent||e.forEach(a.declarations,(function(e){return 303===e.parent.kind||261===e.parent.kind})));if(n||o)return (!!(4096&r.flags)||(null===(t=r.visitedTypes)||void 0===t?void 0:t.has(i)))&&(!(8&r.flags)||Sa(a,r.enclosingDeclaration))}())return k(a,r,o);if(null===(n=r.visitedTypes)||void 0===n?void 0:n.has(i)){var s=function(t){if(t.symbol&&2048&t.symbol.flags&&t.symbol.declarations){var r=e.walkUpParenthesizedTypes(t.symbol.declarations[0].parent);if(258===r.kind)return $i(r)}}(t);return s?k(s,r,788968):u(r)}return R(t,B)}return B(t)}function R(t,n){var i,a,o=t.id,s=16&e.getObjectFlags(t)&&t.symbol&&32&t.symbol.flags,c=4&e.getObjectFlags(t)&&t.node?"N"+O(t.node):16777216&t.flags?"N"+O(t.root.node):t.symbol?(s?"+":"")+M(t.symbol):void 0;r.visitedTypes||(r.visitedTypes=new e.Set),c&&!r.symbolDepth&&(r.symbolDepth=new e.Map);var l=r.enclosingDeclaration&&Qn(r.enclosingDeclaration),_="".concat(Bu(t),"|").concat(r.flags);l&&(l.serializedTypes||(l.serializedTypes=new e.Map));var d,p=null===(i=null==l?void 0:l.serializedTypes)||void 0===i?void 0:i.get(_);if(p)return p.truncating&&(r.truncating=!0),r.approximateLength+=p.addedLength,function t(r){return e.nodeIsSynthesized(r)||e.getParseTreeNode(r)!==r?e.setTextRange(e.factory.cloneNode(e.visitEachChild(r,t,e.nullTransformationContext)),r):r}(p);if(c){if((d=r.symbolDepth.get(c)||0)>10)return u(r);r.symbolDepth.set(c,d+1);}r.visitedTypes.add(o);var f=r.approximateLength,g=n(t),m=r.approximateLength-f;return r.reportedDiagnostic||r.encounteredError||(r.truncating&&(g.truncating=!0),g.addedLength=m,null===(a=null==l?void 0:l.serializedTypes)||void 0===a||a.set(_,g)),r.visitedTypes.delete(o),c&&r.symbolDepth.set(c,d),g}function B(t){if(dc(t)||t.containsError)return function(t){e.Debug.assert(!!(524288&t.flags));var n,i=t.declaration.readonlyToken?e.factory.createToken(t.declaration.readonlyToken.kind):void 0,a=t.declaration.questionToken?e.factory.createToken(t.declaration.questionToken.kind):void 0;n=sc(t)?e.factory.createTypeOperatorNode(140,l(cc(t),r)):l(nc(t),r);var o=m(rc(t),r,n),s=t.declaration.nameType?l(ic(t),r):void 0,c=l(Nf(ac(t),!!(4&lc(t))),r),u=e.factory.createMappedTypeNode(i,o,s,a,c,void 0);return r.approximateLength+=10,e.setEmitFlags(u,1)}(t);var n=pc(t);if(!n.properties.length&&!n.indexInfos.length){if(!n.callSignatures.length&&!n.constructSignatures.length)return r.approximateLength+=2,e.setEmitFlags(e.factory.createTypeLiteralNode(void 0),1);if(1===n.callSignatures.length&&!n.constructSignatures.length)return g(n.callSignatures[0],178,r);if(1===n.constructSignatures.length&&!n.callSignatures.length)return g(n.constructSignatures[0],179,r)}var i=e.filter(n.constructSignatures,(function(e){return !!(4&e.flags)}));if(e.some(i)){var a=e.map(i,Cl);return n.callSignatures.length+(n.constructSignatures.length-i.length)+n.indexInfos.length+(2048&r.flags?e.countWhere(n.properties,(function(e){return !(4194304&e.flags)})):e.length(n.properties))&&a.push(function(t){if(0===t.constructSignatures.length)return t;if(t.objectTypeWithoutAbstractConstructSignatures)return t.objectTypeWithoutAbstractConstructSignatures;var r=e.filter(t.constructSignatures,(function(e){return !(4&e.flags)}));if(t.constructSignatures===r)return t;var n=ya(t.symbol,t.members,t.callSignatures,e.some(r)?r:e.emptyArray,t.indexInfos);return t.objectTypeWithoutAbstractConstructSignatures=n,n.objectTypeWithoutAbstractConstructSignatures=n,n}(n)),l($u(a),r)}var o=r.flags;r.flags|=4194304;var c=function(t){if(s(r))return [e.factory.createPropertySignature(void 0,"...",void 0,void 0)];for(var n=[],i=0,a=t.callSignatures;i<a.length;i++){var o=a[i];n.push(g(o,173,r));}for(var c=0,l=t.constructSignatures;c<l.length;c++)4&(o=l[c]).flags||n.push(g(o,174,r));for(var _=0,p=t.indexInfos;_<p.length;_++){var m=p[_];n.push(f(m,r,1024&t.objectFlags?u(r):void 0));}var y=t.properties;if(!y)return n;for(var v=0,h=0,b=y;h<b.length;h++){var x=b[h];if(v++,2048&r.flags){if(4194304&x.flags)continue;24&e.getDeclarationModifierFlagsFromSymbol(x)&&r.tracker.reportPrivateInBaseOfClassExpression&&r.tracker.reportPrivateInBaseOfClassExpression(e.unescapeLeadingUnderscores(x.escapedName));}if(s(r)&&v+2<y.length-1){n.push(e.factory.createPropertySignature(void 0,"... ".concat(y.length-v," more ..."),void 0,void 0)),d(y[y.length-1],r,n);break}d(x,r,n);}return n.length?n:void 0}(n);r.flags=o;var _=e.factory.createTypeLiteralNode(c);return r.approximateLength+=2,e.setEmitFlags(_,1024&r.flags?0:1),_}function j(t){var n=zl(t);if(t.target===Mt||t.target===Lt){if(2&r.flags){var i=l(n[0],r);return e.factory.createTypeReferenceNode(t.target===Mt?"Array":"ReadonlyArray",[i])}var a=l(n[0],r),o=e.factory.createArrayTypeNode(a);return t.target===Mt?o:e.factory.createTypeOperatorNode(144,o)}if(!(8&t.target.objectFlags)){if(2048&r.flags&&t.symbol.valueDeclaration&&e.isClassLike(t.symbol.valueDeclaration)&&!Sa(t.symbol,r.enclosingDeclaration))return L(t);var s=t.target.outerTypeParameters,c=void(D=0);if(s)for(var u=s.length;D<u;){var _=D,d=Ol(s[D]);do{D++;}while(D<u&&Ol(s[D])===d);if(!e.rangeEquals(s,n,_,D)){var f=p(n.slice(_,D),r),g=r.flags;r.flags|=16;var m=k(d,r,788968,f);r.flags=g,c=c?J(c,m):m;}}var y=void 0;if(n.length>0){var v=(t.target.typeParameters||e.emptyArray).length;y=p(n.slice(D,v),r);}S=r.flags,r.flags|=16;var h=k(t.symbol,r,788968,y);return r.flags=S,c?J(c,h):h}if((n=e.sameMap(n,(function(e,r){return Nf(e,!!(2&t.target.elementFlags[r]))}))).length>0){var b=Ul(t),x=p(n.slice(0,b),r);if(x){if(t.target.labeledElementDeclarations)for(var D=0;D<x.length;D++){var S=t.target.elementFlags[D];x[D]=e.factory.createNamedTupleMember(12&S?e.factory.createToken(25):void 0,e.factory.createIdentifier(e.unescapeLeadingUnderscores(Vh(t.target.labeledElementDeclarations[D]))),2&S?e.factory.createToken(57):void 0,4&S?e.factory.createArrayTypeNode(x[D]):x[D]);}else for(D=0;D<Math.min(b,x.length);D++){S=t.target.elementFlags[D];x[D]=12&S?e.factory.createRestTypeNode(4&S?e.factory.createArrayTypeNode(x[D]):x[D]):2&S?e.factory.createOptionalTypeNode(x[D]):x[D];}var T=e.setEmitFlags(e.factory.createTupleTypeNode(x),1);return t.target.readonly?e.factory.createTypeOperatorNode(144,T):T}}if(r.encounteredError||524288&r.flags)return T=e.setEmitFlags(e.factory.createTupleTypeNode([]),1),t.target.readonly?e.factory.createTypeOperatorNode(144,T):T;r.encounteredError=!0;}function J(t,r){if(e.isImportTypeNode(t)){var n=t.typeArguments,i=t.qualifier;i&&(i=e.isIdentifier(i)?e.factory.updateIdentifier(i,n):e.factory.updateQualifiedName(i,i.left,e.factory.updateIdentifier(i.right,n))),n=r.typeArguments;for(var a=0,o=z(r);a<o.length;a++){var s=o[a];i=i?e.factory.createQualifiedName(i,s):s;}return e.factory.updateImportTypeNode(t,t.argument,i,n,t.isTypeOf)}n=t.typeArguments;var c=t.typeName;c=e.isIdentifier(c)?e.factory.updateIdentifier(c,n):e.factory.updateQualifiedName(c,c.left,e.factory.updateIdentifier(c.right,n)),n=r.typeArguments;for(var l=0,u=z(r);l<u.length;l++)s=u[l],c=e.factory.createQualifiedName(c,s);return e.factory.updateTypeReferenceNode(t,c,n)}function z(t){for(var r=t.typeName,n=[];!e.isIdentifier(r);)n.unshift(r.right),r=r.left;return n.unshift(r),n}}function u(t){return t.approximateLength+=3,1&t.flags?e.factory.createKeywordTypeNode(130):e.factory.createTypeReferenceNode(e.factory.createIdentifier("..."),void 0)}function _(t,r){var n;return !!(8192&e.getCheckFlags(t))&&(e.contains(r.reverseMappedStack,t)||(null===(n=r.reverseMappedStack)||void 0===n?void 0:n[0])&&!(16&e.getObjectFlags(e.last(r.reverseMappedStack).propertyType)))}function d(t,r,n){var i,a,o=!!(8192&e.getCheckFlags(t)),s=_(t,r)?we:Ko(t),c=r.enclosingDeclaration;if(r.enclosingDeclaration=void 0,r.tracker.trackSymbol&&4096&e.getCheckFlags(t)&&Ns(t.escapedName))if(t.declarations){var l=e.first(t.declarations);if(Fs(l))if(e.isBinaryExpression(l)){var d=e.getNameOfDeclaration(l);d&&e.isElementAccessExpression(d)&&e.isPropertyAccessEntityNameExpression(d.argumentExpression)&&h(d.argumentExpression,c,r);}else h(l.name.expression,c,r);}else (null===(i=r.tracker)||void 0===i?void 0:i.reportNonSerializableProperty)&&r.tracker.reportNonSerializableProperty(Ia(t));r.enclosingDeclaration=t.valueDeclaration||(null===(a=t.declarations)||void 0===a?void 0:a[0])||c;var p=L(t,r);r.enclosingDeclaration=c,r.approximateLength+=e.symbolName(t).length+1;var f=16777216&t.flags?e.factory.createToken(57):void 0;if(8208&t.flags&&!fc(s).length&&!Db(t))for(var m=0,y=Uc(om(s,(function(e){return !(32768&e.flags)})),0);m<y.length;m++){var v=g(y[m],167,r,{name:p,questionToken:f});n.push(S(v));}else {var b=void 0;_(t,r)?b=u(r):(o&&(r.reverseMappedStack||(r.reverseMappedStack=[]),r.reverseMappedStack.push(t)),b=s?J(r,s,t,c):e.factory.createKeywordTypeNode(130),o&&r.reverseMappedStack.pop());var x=Db(t)?[e.factory.createToken(144)]:void 0;x&&(r.approximateLength+=9);var D=e.factory.createPropertySignature(x,p,f,b);n.push(S(D));}function S(r){var n;if(e.some(t.declarations,(function(e){return 345===e.kind}))){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(e){return 345===e.kind})),a=e.getTextOfJSDocComment(i.comment);a&&e.setSyntheticLeadingComments(r,[{kind:3,text:"*\n * "+a.replace(/\n/g,"\n * ")+"\n ",pos:-1,end:-1,hasTrailingNewLine:!0}]);}else t.valueDeclaration&&e.setCommentRange(r,t.valueDeclaration);return r}}function p(t,r,n){if(e.some(t)){if(s(r)){if(!n)return [e.factory.createTypeReferenceNode("...",void 0)];if(t.length>2)return [l(t[0],r),e.factory.createTypeReferenceNode("... ".concat(t.length-2," more ..."),void 0),l(t[t.length-1],r)]}for(var i=64&r.flags?void 0:e.createUnderscoreEscapedMultiMap(),a=[],o=0,c=0,u=t;c<u.length;c++){var _=u[c];if(o++,s(r)&&o+2<t.length-1){a.push(e.factory.createTypeReferenceNode("... ".concat(t.length-o," more ..."),void 0));var d=l(t[t.length-1],r);d&&a.push(d);break}r.approximateLength+=2;var p=l(_,r);p&&(a.push(p),i&&e.isIdentifierTypeReference(p)&&i.add(p.typeName.escapedText,[_,a.length-1]));}if(i){var f=r.flags;r.flags|=64,i.forEach((function(t){if(!e.arrayIsHomogeneous(t,(function(e,t){return r=e[0],n=t[0],r===n||!!r.symbol&&r.symbol===n.symbol||!!r.aliasSymbol&&r.aliasSymbol===n.aliasSymbol;var r,n;})))for(var n=0,i=t;n<i.length;n++){var o=i[n],s=o[0],c=o[1];a[c]=l(s,r);}})),r.flags=f;}return a}}function f(t,r,n){var i=e.getNameFromIndexInfo(t)||"x",a=l(t.keyType,r),o=e.factory.createParameterDeclaration(void 0,void 0,void 0,i,void 0,a,void 0);return n||(n=l(t.type||we,r)),t.type||2097152&r.flags||(r.encounteredError=!0),r.approximateLength+=i.length+4,e.factory.createIndexSignature(void 0,t.isReadonly?[e.factory.createToken(144)]:void 0,[o],n)}function g(t,r,n,i){var a,o,s,c,u,_,d=256&n.flags;d&&(n.flags&=-257),n.approximateLength+=3,32&n.flags&&t.target&&t.mapper&&t.target.typeParameters?_=t.target.typeParameters.map((function(e){return l(Rd(e,t.mapper),n)})):u=t.typeParameters&&t.typeParameters.map((function(e){return y(e,n)}));var p,f=Us(t,!0)[0],g=(e.some(f,(function(t){return t!==f[f.length-1]&&!!(32768&e.getCheckFlags(t))}))?t.parameters:f).map((function(e){return v(e,n,170===r,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports)}));if(t.thisParameter){var m=v(t.thisParameter,n);g.unshift(m);}var h=fl(t);if(h){var b=2===h.kind||3===h.kind?e.factory.createToken(128):void 0,x=1===h.kind||3===h.kind?e.setEmitFlags(e.factory.createIdentifier(h.parameterName),16777216):e.factory.createThisTypeNode(),D=h.type&&l(h.type,n);p=e.factory.createTypePredicateNode(b,x,D);}else {var S=ml(t);!S||d&&to(S)?d||(p=e.factory.createKeywordTypeNode(130)):p=function(t,r,n,i,a){if(!ro(r)&&t.enclosingDeclaration){var o=n.declaration&&e.getEffectiveReturnTypeNode(n.declaration);if(e.findAncestor(o,(function(e){return e===t.enclosingDeclaration}))&&o){var s=dd(o);if((262144&s.flags&&s.isThisType?Rd(s,n.mapper):s)===r&&j(o,r)){var c=V(t,o,i,a);if(c)return c}}}return l(r,t)}(n,S,t,null==i?void 0:i.privateSymbolVisitor,null==i?void 0:i.bundledImports);}var T=null==i?void 0:i.modifiers;if(179===r&&4&t.flags){var C=e.modifiersToFlags(T);T=e.factory.createModifiersFromModifierFlags(128|C);}var E=173===r?e.factory.createCallSignature(u,g,p):174===r?e.factory.createConstructSignature(u,g,p):167===r?e.factory.createMethodSignature(T,null!==(a=null==i?void 0:i.name)&&void 0!==a?a:e.factory.createIdentifier(""),null==i?void 0:i.questionToken,u,g,p):168===r?e.factory.createMethodDeclaration(void 0,T,void 0,null!==(o=null==i?void 0:i.name)&&void 0!==o?o:e.factory.createIdentifier(""),void 0,u,g,p,void 0):170===r?e.factory.createConstructorDeclaration(void 0,T,g,void 0):171===r?e.factory.createGetAccessorDeclaration(void 0,T,null!==(s=null==i?void 0:i.name)&&void 0!==s?s:e.factory.createIdentifier(""),g,p,void 0):172===r?e.factory.createSetAccessorDeclaration(void 0,T,null!==(c=null==i?void 0:i.name)&&void 0!==c?c:e.factory.createIdentifier(""),g,void 0):175===r?e.factory.createIndexSignature(void 0,T,g,p):315===r?e.factory.createJSDocFunctionType(g,p):178===r?e.factory.createFunctionTypeNode(u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):179===r?e.factory.createConstructorTypeNode(T,u,g,null!=p?p:e.factory.createTypeReferenceNode(e.factory.createIdentifier(""))):255===r?e.factory.createFunctionDeclaration(void 0,T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,void 0):212===r?e.factory.createFunctionExpression(T,void 0,(null==i?void 0:i.name)?e.cast(i.name,e.isIdentifier):e.factory.createIdentifier(""),u,g,p,e.factory.createBlock([])):213===r?e.factory.createArrowFunction(T,u,g,p,void 0,e.factory.createBlock([])):e.Debug.assertNever(r);return _&&(E.typeArguments=e.factory.createNodeArray(_)),E}function m(t,r,n){var i=r.flags;r.flags&=-513;var a=F(t,r),o=Fc(t),s=o&&l(o,r);return r.flags=i,e.factory.createTypeParameterDeclaration(a,n,s)}function y(e,t,r){return void 0===r&&(r=hc(e)),m(e,t,r&&l(r,t))}function v(t,r,n,i,a){var o=e.getDeclarationOfKind(t,163);o||e.isTransientSymbol(t)||(o=e.getDeclarationOfKind(t,338));var s,c=Uo(t);o&&rT(o)&&(c=Df(c)),1073741824&r.flags&&o&&!e.isJSDocParameterTag(o)&&(s=o,H&&nl(s)&&!s.initializer)&&(c=Jg(c,524288));var l=J(r,c,t,r.enclosingDeclaration,i,a),u=!(8192&r.flags)&&n&&o&&o.modifiers?o.modifiers.map(e.factory.cloneNode):void 0,_=o&&e.isRestParameter(o)||32768&e.getCheckFlags(t)?e.factory.createToken(25):void 0,d=o&&o.name?79===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name),16777216):160===o.name.kind?e.setEmitFlags(e.factory.cloneNode(o.name.right),16777216):function t(n){r.tracker.trackSymbol&&e.isComputedPropertyName(n)&&ks(n)&&h(n.expression,r.enclosingDeclaration,r);var i=e.visitEachChild(n,t,e.nullTransformationContext,void 0,t);return e.isBindingElement(i)&&(i=e.factory.updateBindingElement(i,i.dotDotDotToken,i.propertyName,i.name,void 0)),e.nodeIsSynthesized(i)||(i=e.factory.cloneNode(i)),e.setEmitFlags(i,16777217)}(o.name):e.symbolName(t),p=o&&nl(o)||16384&e.getCheckFlags(t)?e.factory.createToken(57):void 0,f=e.factory.createParameterDeclaration(void 0,u,_,d,p,l,void 0);return r.approximateLength+=e.symbolName(t).length+3,f}function h(t,r,n){if(n.tracker.trackSymbol){var i=e.getFirstIdentifier(t),a=ei(i,i.escapedText,1160127,void 0,void 0,!0);a&&n.tracker.trackSymbol(a,r,111551);}}function b(e,t,r,n){return t.tracker.trackSymbol(e,t.enclosingDeclaration,r),x(e,t,r,n)}function x(t,r,n,i){var a;return 262144&t.flags||!(r.enclosingDeclaration||64&r.flags)||134217728&r.flags?a=[t]:(a=e.Debug.checkDefined(function t(n,a,o){var s,c=ba(n,r.enclosingDeclaration,a,!!(128&r.flags));if(!c||xa(c[0],r.enclosingDeclaration,1===c.length?a:ha(a))){var l=ta(c?c[0]:n,r.enclosingDeclaration,a);if(e.length(l)){s=l.map((function(t){return e.some(t.declarations,Aa)?C(t,r):void 0}));var u=l.map((function(e,t){return t}));u.sort((function(t,r){var n=s[t],i=s[r];if(n&&i){var a=e.pathIsRelative(i);return e.pathIsRelative(n)===a?e.moduleSpecifiers.countPathComponents(n)-e.moduleSpecifiers.countPathComponents(i):a?-1:1}return 0}));for(var _=0,d=u.map((function(e){return l[e]}));_<d.length;_++){var p=d[_],f=t(p,ha(a),!1);if(f){if(p.exports&&p.exports.get("export=")&&ia(p.exports.get("export="),n)){c=f;break}c=f.concat(c||[na(p,n)||n]);break}}}}if(c)return c;if(o||!(6144&n.flags)){if(!o&&!i&&e.forEach(n.declarations,Aa))return;return [n]}}(t,n,!0)),e.Debug.assert(a&&a.length>0)),a}function D(t,r){var n;return 524384&tS(t).flags&&(n=e.factory.createNodeArray(e.map(Xo(t),(function(e){return y(e,r)})))),n}function S(t,r,n){var i;e.Debug.assert(t&&0<=r&&r<t.length);var a=t[r],o=M(a);if(!(null===(i=n.typeParameterSymbolList)||void 0===i?void 0:i.has(o))){var s;if((n.typeParameterSymbolList||(n.typeParameterSymbolList=new e.Set)).add(o),512&n.flags&&r<t.length-1){var c=a,l=t[r+1];if(1&e.getCheckFlags(l)){var u=function(t){return e.concatenate(Qo(t),Xo(t))}(2097152&c.flags?ki(c):c);s=p(e.map(u,(function(e){return hd(e,l.mapper)})),n);}else s=D(a,n);}return s}}function T(t){return e.isIndexedAccessTypeNode(t.objectType)?T(t.objectType):t}function C(t,r){var n,a=e.getDeclarationOfKind(t,303);if(!a){var o=e.firstDefined(t.declarations,(function(e){return ra(e,t)}));o&&(a=e.getDeclarationOfKind(o,303));}if(a&&void 0!==a.moduleName)return a.moduleName;if(!a){if(r.tracker.trackReferencedAmbientModule){var s=e.filter(t.declarations,e.isAmbientModule);if(e.length(s))for(var l=0,u=s;l<u.length;l++){var _=u[l];r.tracker.trackReferencedAmbientModule(_,t);}}if(c.test(t.escapedName))return t.escapedName.substring(1,t.escapedName.length-1)}if(!r.enclosingDeclaration||!r.tracker.moduleResolverHost)return c.test(t.escapedName)?t.escapedName.substring(1,t.escapedName.length-1):e.getSourceFileOfNode(e.getNonAugmentationDeclaration(t)).fileName;var d=e.getSourceFileOfNode(e.getOriginalNode(r.enclosingDeclaration)),p=Gn(t),f=p.specifierCache&&p.specifierCache.get(d.path);if(!f){var g=!!e.outFile(U),m=r.tracker.moduleResolverHost,y=g?i$1(i$1({},U),{baseUrl:m.getCommonSourceDirectory()}):U;f=e.first(e.moduleSpecifiers.getModuleSpecifiers(t,de,y,d,m,{importModuleSpecifierPreference:g?"non-relative":"project-relative",importModuleSpecifierEnding:g?"minimal":void 0})),null!==(n=p.specifierCache)&&void 0!==n||(p.specifierCache=new e.Map),p.specifierCache.set(d.path,f);}return f}function E(t){var r=e.factory.createIdentifier(e.unescapeLeadingUnderscores(t.escapedName));return t.parent?e.factory.createQualifiedName(E(t.parent),r):r}function k(t,r,n,i){var a=b(t,r,n,!(16384&r.flags)),o=111551===n;if(e.some(a[0].declarations,Aa)){var s=a.length>1?m(a,a.length-1,1):void 0,c=i||S(a,0,r),l=C(a[0],r);!(67108864&r.flags)&&e.getEmitModuleResolutionKind(U)!==e.ModuleResolutionKind.Classic&&l.indexOf("/node_modules/")>=0&&(r.encounteredError=!0,r.tracker.reportLikelyUnsafeImportRequiredError&&r.tracker.reportLikelyUnsafeImportRequiredError(l));var u=e.factory.createLiteralTypeNode(e.factory.createStringLiteral(l));if(r.tracker.trackExternalModuleSymbolOfImportTypeNode&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(a[0]),r.approximateLength+=l.length+10,!s||e.isEntityName(s))return s&&((f=e.isIdentifier(s)?s:s.right).typeArguments=void 0),e.factory.createImportTypeNode(u,s,c,o);var _=T(s),d=_.objectType.typeName;return e.factory.createIndexedAccessTypeNode(e.factory.createImportTypeNode(u,d,c,o),_.indexType)}var p=m(a,a.length-1,0);if(e.isIndexedAccessTypeNode(p))return p;if(o)return e.factory.createTypeQueryNode(p);var f,g=(f=e.isIdentifier(p)?p:p.right).typeArguments;return f.typeArguments=void 0,e.factory.createTypeReferenceNode(p,g);function m(t,n,a){var o,s=n===t.length-1?i:S(t,n,r),c=t[n],l=t[n-1];if(0===n)r.flags|=16777216,o=Wa(c,r),r.approximateLength+=(o?o.length:0)+1,r.flags^=16777216;else if(l&&Gi(l)){var u=Gi(l);e.forEachEntry(u,(function(t,r){if(ia(t,c)&&!Ns(r)&&"export="!==r)return o=e.unescapeLeadingUnderscores(r),!0}));}if(o||(o=Wa(c,r)),r.approximateLength+=o.length+1,!(16&r.flags)&&l&&Os(l)&&Os(l).get(c.escapedName)&&ia(Os(l).get(c.escapedName),c)){var _=m(t,n-1,a);return e.isIndexedAccessTypeNode(_)?e.factory.createIndexedAccessTypeNode(_,e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o))):e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(_,s),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(o)))}var d=e.setEmitFlags(e.factory.createIdentifier(o,s),16777216);return d.symbol=c,n>a?(_=m(t,n-1,a),e.isEntityName(_)?e.factory.createQualifiedName(_,d):e.Debug.fail("Impossible construct - an export of an indexed access cannot be reachable")):d}}function N(e,t,r){var n=ei(t.enclosingDeclaration,e,788968,void 0,e,!1);return !(!n||262144&n.flags&&n===r.symbol)}function F(t,r){var n,i;if(4&r.flags&&r.typeParameterNames){var a=r.typeParameterNames.get(Bu(t));if(a)return a}var o=A(t.symbol,r,788968,!0);if(!(79&o.kind))return e.factory.createIdentifier("(Missing type parameter)");if(4&r.flags){for(var s=o.escapedText,c=(null===(n=r.typeParameterNamesByTextNextNameCount)||void 0===n?void 0:n.get(s))||0,l=s;(null===(i=r.typeParameterNamesByText)||void 0===i?void 0:i.has(l))||N(l,r,t);)c++,l="".concat(s,"_").concat(c);l!==s&&(o=e.factory.createIdentifier(l,o.typeArguments)),(r.typeParameterNamesByTextNextNameCount||(r.typeParameterNamesByTextNextNameCount=new e.Map)).set(s,c),(r.typeParameterNames||(r.typeParameterNames=new e.Map)).set(Bu(t),o),(r.typeParameterNamesByText||(r.typeParameterNamesByText=new e.Set)).add(s);}return o}function A(t,r,n,i){var a=b(t,r,n);return !i||1===a.length||r.encounteredError||65536&r.flags||(r.encounteredError=!0),function t(n,i){var a=S(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=Wa(o,r);0===i&&(r.flags^=16777216);var c=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return c.symbol=o,i>0?e.factory.createQualifiedName(t(n,i-1),c):c}(a,a.length-1)}function P(t,r,n){var i=b(t,r,n);return function t(n,i){var a=S(n,i,r),o=n[i];0===i&&(r.flags|=16777216);var s=Wa(o,r);0===i&&(r.flags^=16777216);var c=s.charCodeAt(0);if(e.isSingleOrDoubleQuote(c)&&e.some(o.declarations,Aa))return e.factory.createStringLiteral(C(o,r));var l=35===c?s.length>1&&e.isIdentifierStart(s.charCodeAt(1),K):e.isIdentifierStart(c,K);if(0===i||l){var u=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216);return u.symbol=o,i>0?e.factory.createPropertyAccessExpression(t(n,i-1),u):u}91===c&&(c=(s=s.substring(1,s.length-1)).charCodeAt(0));var _=void 0;return e.isSingleOrDoubleQuote(c)?_=e.factory.createStringLiteral(s.substring(1,s.length-1).replace(/\\./g,(function(e){return e.substring(1)})),39===c):""+ +s===s&&(_=e.factory.createNumericLiteral(+s)),_||((_=e.setEmitFlags(e.factory.createIdentifier(s,a),16777216)).symbol=o),e.factory.createElementAccessExpression(t(n,i-1),_)}(i,i.length-1)}function w(t){var r=e.getNameOfDeclaration(t);return !!r&&e.isStringLiteral(r)}function I(t){var r=e.getNameOfDeclaration(t);return !!(r&&e.isStringLiteral(r)&&(r.singleQuote||!e.nodeIsSynthesized(r)&&e.startsWith(e.getTextOfNode(r,!1),"'")))}function L(t,r){var n=!!e.length(t.declarations)&&e.every(t.declarations,I);return function(t,r,n){var i=Gn(t).nameType;if(i){if(384&i.flags){var a=""+i.value;return e.isIdentifierText(a,e.getEmitScriptTarget(U))||ky(a)?ky(a)&&e.startsWith(a,"-")?e.factory.createComputedPropertyName(e.factory.createNumericLiteral(+a)):R(a):e.factory.createStringLiteral(a,!!n)}if(8192&i.flags)return e.factory.createComputedPropertyName(P(i.symbol,r,111551))}}(t,r,n)||R(e.unescapeLeadingUnderscores(t.escapedName),!!e.length(t.declarations)&&e.every(t.declarations,w),n)}function R(t,r,n){return e.isIdentifierText(t,e.getEmitScriptTarget(U))?e.factory.createIdentifier(t):!r&&ky(t)&&+t>=0?e.factory.createNumericLiteral(+t):e.factory.createStringLiteral(t,!!n)}function B(t,r){return t.declarations&&e.find(t.declarations,(function(t){return !(!e.getEffectiveTypeAnnotationNode(t)||r&&!e.findAncestor(t,(function(e){return e===r})))}))}function j(t,r){return !(4&e.getObjectFlags(r))||!e.isTypeReferenceNode(t)||e.length(t.typeArguments)>=ol(r.target.typeParameters)}function J(t,r,n,i,a,o){if(!ro(r)&&i){var s=B(n,i);if(s&&!e.isFunctionLikeDeclaration(s)&&!e.isGetAccessorDeclaration(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(dd(c)===r&&j(c,r)){var u=V(t,c,a,o);if(u)return u}}}var _=t.flags;8192&r.flags&&r.symbol===n&&(!t.enclosingDeclaration||e.some(n.declarations,(function(r){return e.getSourceFileOfNode(r)===e.getSourceFileOfNode(t.enclosingDeclaration)})))&&(t.flags|=1048576);var d=l(r,t);return t.flags=_,d}function z(t,r,n){var i,a,o=!1,s=e.getFirstIdentifier(t);if(e.isInJSFile(t)&&(e.isExportsIdentifier(s)||e.isModuleExportsAccessExpression(s.parent)||e.isQualifiedName(s.parent)&&e.isModuleIdentifier(s.parent.left)&&e.isExportsIdentifier(s.parent.right)))return {introducesError:o=!0,node:t};var c=Mi(s,67108863,!0,!0);if(c&&(0!==Ea(c,r.enclosingDeclaration,67108863,!1).accessibility?o=!0:(null===(a=null===(i=r.tracker)||void 0===i?void 0:i.trackSymbol)||void 0===a||a.call(i,c,r.enclosingDeclaration,67108863),null==n||n(c)),e.isIdentifier(t))){var l=262144&c.flags?F(ms(c),r):e.factory.cloneNode(t);return l.symbol=c,{introducesError:o,node:e.setEmitFlags(e.setOriginalNode(l,t),16777216)}}return {introducesError:o,node:t}}function V(r,n,i,o){a&&a.throwIfCancellationRequested&&a.throwIfCancellationRequested();var s=!1,c=e.getSourceFileOfNode(n),u=e.visitNode(n,(function n(a){if(e.isJSDocAllType(a)||317===a.kind)return e.factory.createKeywordTypeNode(130);if(e.isJSDocUnknownType(a))return e.factory.createKeywordTypeNode(154);if(e.isJSDocNullableType(a))return e.factory.createUnionTypeNode([e.visitNode(a.type,n),e.factory.createLiteralTypeNode(e.factory.createNull())]);if(e.isJSDocOptionalType(a))return e.factory.createUnionTypeNode([e.visitNode(a.type,n),e.factory.createKeywordTypeNode(152)]);if(e.isJSDocNonNullableType(a))return e.visitNode(a.type,n);if(e.isJSDocVariadicType(a))return e.factory.createArrayTypeNode(e.visitNode(a.type,n));if(e.isJSDocTypeLiteral(a))return e.factory.createTypeLiteralNode(e.map(a.jsDocPropertyTags,(function(t){var i=e.isIdentifier(t.name)?t.name:t.name.right,o=eo(dd(a),i.escapedText),s=o&&t.typeExpression&&dd(t.typeExpression.type)!==o?l(o,r):void 0;return e.factory.createPropertySignature(void 0,i,t.isBracketed||t.typeExpression&&e.isJSDocOptionalType(t.typeExpression.type)?e.factory.createToken(57):void 0,s||t.typeExpression&&e.visitNode(t.typeExpression.type,n)||e.factory.createKeywordTypeNode(130))})));if(e.isTypeReferenceNode(a)&&e.isIdentifier(a.typeName)&&""===a.typeName.escapedText)return e.setOriginalNode(e.factory.createKeywordTypeNode(130),a);if((e.isExpressionWithTypeArguments(a)||e.isTypeReferenceNode(a))&&e.isJSDocIndexSignature(a))return e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,e.visitNode(a.typeArguments[0],n))],e.visitNode(a.typeArguments[1],n))]);var u;if(e.isJSDocFunctionType(a))return e.isJSDocConstructSignature(a)?e.factory.createConstructorTypeNode(a.modifiers,e.visitNodes(a.typeParameters,n),e.mapDefined(a.parameters,(function(t,r){return t.name&&e.isIdentifier(t.name)&&"new"===t.name.escapedText?void(u=t.type):e.factory.createParameterDeclaration(void 0,void 0,g(t),m(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(u||a.type,n)||e.factory.createKeywordTypeNode(130)):e.factory.createFunctionTypeNode(e.visitNodes(a.typeParameters,n),e.map(a.parameters,(function(t,r){return e.factory.createParameterDeclaration(void 0,void 0,g(t),m(t,r),t.questionToken,e.visitNode(t.type,n),void 0)})),e.visitNode(a.type,n)||e.factory.createKeywordTypeNode(130));if(e.isTypeReferenceNode(a)&&e.isInJSDoc(a)&&(!j(a,dd(a))||ru(a)||Ne===Gl(a,788968,!0)))return e.setOriginalNode(l(dd(a),r),a);if(e.isLiteralImportTypeNode(a)){var _=Qn(a).resolvedSymbol;return !e.isInJSDoc(a)||!_||(a.isTypeOf||788968&_.flags)&&e.length(a.typeArguments)>=ol(Xo(_))?e.factory.updateImportTypeNode(a,e.factory.updateLiteralTypeNode(a.argument,function(n,i){if(o){if(r.tracker&&r.tracker.moduleResolverHost){var a=DT(n);if(a){var s={getCanonicalFileName:e.createGetCanonicalFileName(!!t.useCaseSensitiveFileNames),getCurrentDirectory:function(){return r.tracker.moduleResolverHost.getCurrentDirectory()},getCommonSourceDirectory:function(){return r.tracker.moduleResolverHost.getCommonSourceDirectory()}},c=e.getResolvedExternalModuleName(s,a);return e.factory.createStringLiteral(c)}}}else if(r.tracker&&r.tracker.trackExternalModuleSymbolOfImportTypeNode){var l=Bi(i,i,void 0);l&&r.tracker.trackExternalModuleSymbolOfImportTypeNode(l);}return i}(a,a.argument.literal)),a.qualifier,e.visitNodes(a.typeArguments,n,e.isTypeNode),a.isTypeOf):e.setOriginalNode(l(dd(a),r),a)}if(e.isEntityName(a)||e.isEntityNameExpression(a)){var d=z(a,r,i),p=d.introducesError,f=d.node;if(s=s||p,f!==a)return f}return c&&e.isTupleTypeNode(a)&&e.getLineAndCharacterOfPosition(c,a.pos).line===e.getLineAndCharacterOfPosition(c,a.end).line&&e.setEmitFlags(a,1),e.visitEachChild(a,n,e.nullTransformationContext);function g(t){return t.dotDotDotToken||(t.type&&e.isJSDocVariadicType(t.type)?e.factory.createToken(25):void 0)}function m(t,r){return t.name&&e.isIdentifier(t.name)&&"this"===t.name.escapedText?"this":g(t)?"args":"arg".concat(r)}}));if(!s)return u===n?e.setTextRange(e.factory.cloneNode(n),n):u}}(),oe=e.createSymbolTable(),se=jn(4,"undefined");se.declarations=[];var ce=jn(1536,"globalThis",8);ce.exports=oe,ce.declarations=[],oe.set(ce.escapedName,ce);var le,ue=jn(4,"arguments"),_e=jn(4,"require"),de={getNodeCount:function(){return e.sum(t.getSourceFiles(),"nodeCount")},getIdentifierCount:function(){return e.sum(t.getSourceFiles(),"identifierCount")},getSymbolCount:function(){return e.sum(t.getSourceFiles(),"symbolCount")+h},getTypeCount:function(){return v},getInstantiationCount:function(){return x},getRelationCacheSizes:function(){return {assignable:Dn.size,identity:Tn.size,subtype:bn.size,strictSubtype:xn.size}},isUndefinedSymbol:function(e){return e===se},isArgumentsSymbol:function(e){return e===ue},isUnknownSymbol:function(e){return e===Ne},getMergedSymbol:Zi,getDiagnostics:ES,getGlobalDiagnostics:function(){return kS(),mn.getGlobalDiagnostics()},getRecursionIdentity:Jp,getUnmatchedProperties:ag,getTypeOfSymbolAtLocation:function(t,r){var n=e.getParseTreeNode(r);return n?function(t,r){if(t=t.exportSymbol||t,(79===r.kind||80===r.kind)&&(e.isRightSideOfQualifiedNameOrPropertyAccess(r)&&(r=r.parent),e.isExpressionNode(r)&&(!e.isAssignmentTarget(r)||e.isWriteAccess(r)))){var n=rx(r);if(aa(Qn(r).resolvedSymbol)===t)return n}return e.isDeclarationName(r)&&e.isSetAccessor(r.parent)&&Io(r.parent)?Ro(r.parent.symbol,!0):Ko(t)}(t,n):Me},getSymbolsOfParameterPropertyDeclaration:function(t,r){var n=e.getParseTreeNode(t,e.isParameter);return void 0===n?e.Debug.fail("Cannot get symbols of a synthetic parameter that cannot be resolved to a parse-tree node."):function(t,r){var n=t.parent,i=t.parent.parent,a=Yn(n.locals,r,111551),o=Yn(Os(i.symbol),r,111551);return a&&o?[a,o]:e.Debug.fail("There should exist two symbols, one as property declaration and one as parameter declaration")}(n,e.escapeLeadingUnderscores(r))},getDeclaredTypeOfSymbol:ms,getPropertiesOfType:yc,getPropertyOfType:function(t,r){return Jc(t,e.escapeLeadingUnderscores(r))},getPrivateIdentifierPropertyOfType:function(t,r,n){var i=e.getParseTreeNode(n);if(i){var a=gv(e.escapeLeadingUnderscores(r),i);return a?yv(t,a):void 0}},getTypeOfPropertyOfType:function(t,r){return eo(t,e.escapeLeadingUnderscores(r))},getIndexInfoOfType:function(e,t){return Gc(e,0===t?He:Ge)},getIndexInfosOfType:Hc,getSignaturesOfType:Uc,getIndexTypeOfType:function(e,t){return Qc(e,0===t?He:Ge)},getBaseTypes:is,getBaseTypeOfLiteralType:of,getWidenedType:jf,getTypeFromTypeNode:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r?dd(r):Me},getParameterType:Qh,getParameterIdentifierNameAtPosition:function(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r){var n=e.parameters[t];return Wh(n)?[n.escapedName,!1]:void 0}var i=e.parameters[r]||Ne;if(Wh(i)){var a=Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations,s=null==o?void 0:o[t-r],c=!!(null==s?void 0:s.dotDotDotToken);return s?[Vh(s),c]:void 0}return t===r?[i.escapedName,!0]:void 0}},getPromisedTypeOfPromise:Cx,getAwaitedType:function(e){return Ax(e)},getReturnTypeOfSignature:ml,isNullableType:av,getNullableType:xf,getNonNullableType:Sf,getNonOptionalType:Cf,getTypeArguments:zl,typeToTypeNode:ae.typeToTypeNode,indexInfoToIndexSignatureDeclaration:ae.indexInfoToIndexSignatureDeclaration,signatureToSignatureDeclaration:ae.signatureToSignatureDeclaration,symbolToEntityName:ae.symbolToEntityName,symbolToExpression:ae.symbolToExpression,symbolToTypeParameterDeclarations:ae.symbolToTypeParameterDeclarations,symbolToParameterDeclaration:ae.symbolToParameterDeclaration,typeParameterToDeclaration:ae.typeParameterToDeclaration,getSymbolsInScope:function(t,r){var n=e.getParseTreeNode(t);return n?function(t,r){if(16777216&t.flags)return [];var n=e.createSymbolTable(),i=!1;return function(){for(;t;){switch(t.locals&&!Xn(t)&&o(t.locals,r),t.kind){case 303:if(!e.isExternalModule(t))break;case 260:s($i(t).exports,2623475&r);break;case 259:o($i(t).exports,8&r);break;case 225:t.name&&a(t.symbol,r);case 256:case 257:i||o(Os($i(t)),788968&r);break;case 212:t.name&&a(t.symbol,r);}e.introducesArgumentsExoticObject(t)&&a(ue,r),i=e.isStatic(t),t=t.parent;}o(oe,r);}(),n.delete("this"),el(n);function a(t,r){if(e.getCombinedLocalAndExportSymbolFlags(t)&r){var i=t.escapedName;n.has(i)||n.set(i,t);}}function o(e,t){t&&e.forEach((function(e){a(e,t);}));}function s(t,r){r&&t.forEach((function(t){e.getDeclarationOfKind(t,274)||e.getDeclarationOfKind(t,273)||a(t,r);}));}}(n,r):[]},getSymbolAtLocation:function(t){var r=e.getParseTreeNode(t);return r?MS(r,!0):void 0},getIndexInfosAtLocation:function(t){var r=e.getParseTreeNode(t);return r?function(t){if(e.isIdentifier(t)&&e.isPropertyAccessExpression(t.parent)&&t.parent.name===t){var r=i_(t),n=rx(t.parent.expression),i=1048576&n.flags?n.types:[n];return e.flatMap(i,(function(t){return e.filter(Hc(t),(function(e){return qc(r,e.keyType)}))}))}}(r):void 0},getShorthandAssignmentValueSymbol:function(t){var r=e.getParseTreeNode(t);return r?function(e){if(e&&295===e.kind)return Mi(e.name,2208703)}(r):void 0},getExportSpecifierLocalTargetSymbol:function(t){var r=e.getParseTreeNode(t,e.isExportSpecifier);return r?function(t){return e.isExportSpecifier(t)?t.parent.parent.moduleSpecifier?bi(t.parent.parent,t):Mi(t.propertyName||t.name,2998271):Mi(t,2998271)}(r):void 0},getExportSymbolOfSymbol:function(e){return Zi(e.exportSymbol||e)},getTypeAtLocation:function(t){var r=e.getParseTreeNode(t);return r?LS(r):Me},getTypeOfAssignmentPattern:function(t){var r=e.getParseTreeNode(t,e.isAssignmentPattern);return r&&RS(r)||Me},getPropertySymbolOfDestructuringAssignment:function(t){var r=e.getParseTreeNode(t,e.isIdentifier);return r?function(t){var r=RS(e.cast(t.parent.parent,e.isAssignmentPattern));return r&&Jc(r,t.escapedText)}(r):void 0},signatureToString:function(t,r,n,i){return Oa(t,e.getParseTreeNode(r),n,i)},typeToString:function(t,r,n){return Ma(t,e.getParseTreeNode(r),n)},symbolToString:function(t,r,n,i){return Ia(t,e.getParseTreeNode(r),n,i)},typePredicateToString:function(t,r,n){return za(t,e.getParseTreeNode(r),n)},writeSignature:function(t,r,n,i,a){return Oa(t,e.getParseTreeNode(r),n,i,a)},writeType:function(t,r,n,i){return Ma(t,e.getParseTreeNode(r),n,i)},writeSymbol:function(t,r,n,i,a){return Ia(t,e.getParseTreeNode(r),n,i,a)},writeTypePredicate:function(t,r,n,i){return za(t,e.getParseTreeNode(r),n,i)},getAugmentedPropertiesOfType:zS,getRootSymbols:function t(r){var n=function(t){if(6&e.getCheckFlags(t))return e.mapDefined(Gn(t).containingType.types,(function(e){return Jc(e,t.escapedName)}));if(33554432&t.flags){var r=t,n=r.leftSpread,i=r.rightSpread,a=r.syntheticOrigin;return n?[n,i]:a?[a]:e.singleElementArray(function(e){for(var t,r=e;r=Gn(r).target;)t=r;return t}(t))}}(r);return n?e.flatMap(n,t):[r]},getSymbolOfExpando:Ph,getContextualType:function(t,r){var n=e.getParseTreeNode(t,e.isExpression);if(n){var i=e.findAncestor(n,e.isCallLikeExpression),a=i&&Qn(i).resolvedSignature;if(4&r&&i){var o=n;do{Qn(o).skipDirectInference=!0,o=o.parent;}while(o&&o!==i);Qn(i).resolvedSignature=void 0;}var s=my(n,r);if(4&r&&i){o=n;do{Qn(o).skipDirectInference=void 0,o=o.parent;}while(o&&o!==i);Qn(i).resolvedSignature=a;}return s}},getContextualTypeForObjectLiteralElement:function(t){var r=e.getParseTreeNode(t,e.isObjectLiteralElementLike);return r?ly(r):void 0},getContextualTypeForArgumentAtIndex:function(t,r){var n=e.getParseTreeNode(t,e.isCallLikeExpression);return n&&ay(n,r)},getContextualTypeForJsxAttribute:function(t){var r=e.getParseTreeNode(t,e.isJsxAttributeLike);return r&&_y(r)},isContextSensitive:Ud,getTypeOfPropertyOfContextualType:cy,getFullyQualifiedName:Oi,getResolvedSignature:function(e,t,r){return pe(e,t,r,0)},getResolvedSignatureForSignatureHelp:function(e,t,r){return pe(e,t,r,16)},getExpandedParameters:Us,hasEffectiveRestParameter:eb,containsArgumentsReference:ul,getConstantValue:function(t){var r=e.getParseTreeNode(t,cT);return r?lT(r):void 0},isValidPropertyAccess:function(t,r){var n=e.getParseTreeNode(t,e.isPropertyAccessOrQualifiedNameOrImportTypeNode);return !!n&&function(e,t){switch(e.kind){case 205:return Lv(e,106===e.expression.kind,t,jf(ax(e.expression)));case 160:return Lv(e,!1,t,jf(ax(e.left)));case 199:return Lv(e,!1,t,dd(e))}}(n,e.escapeLeadingUnderscores(r))},isValidPropertyAccessForCompletions:function(t,r,n){var i=e.getParseTreeNode(t,e.isPropertyAccessExpression);return !!i&&Mv(i,r,n)},getSignatureFromDeclaration:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?cl(r):void 0},isImplementationOfOverload:function(t){var r=e.getParseTreeNode(t,e.isFunctionLike);return r?tT(r):void 0},getImmediateAliasedSymbol:Py,getAliasedSymbol:ki,getEmitResolver:function(e,t){return ES(e,t),ie},getExportsOfModule:qi,getExportsAndPropertiesOfModule:function(t){var r=qi(t),n=zi(t);if(n!==t){var i=Uo(n);Hi(i)&&e.addRange(r,yc(i));}return r},forEachExportAndPropertyOfModule:function(e,t){Qi(e).forEach((function(e,r){pa(r)||t(e,r);}));var r=zi(e);if(r!==e){var n=Uo(r);Hi(n)&&function(e,r){3670016&(e=Pc(e)).flags&&pc(e).members.forEach((function(e,r){ga(e,r)&&function(e,r){t(e,r);}(e,r);}));}(n);}},getSymbolWalker:e.createGetSymbolWalker((function(e){return hl(e)||we}),fl,ml,is,pc,Uo,Sg,hc,e.getFirstIdentifier,zl),getAmbientModules:function(){return Nt||(Nt=[],oe.forEach((function(e,t){c.test(t)&&Nt.push(e);}))),Nt},getJsxIntrinsicTagNamesAt:function(t){var r=By(A.IntrinsicElements,t);return r?yc(r):e.emptyArray},isOptionalParameter:function(t){var r=e.getParseTreeNode(t,e.isParameter);return !!r&&nl(r)},tryGetMemberInModuleExports:function(t,r){return Wi(e.escapeLeadingUnderscores(t),r)},tryGetMemberInModuleExportsAndProperties:function(t,r){return function(e,t){var r=Wi(e,t);if(r)return r;var n=zi(t);if(n!==t){var i=Uo(n);return Hi(i)?Jc(i,e):void 0}}(e.escapeLeadingUnderscores(t),r)},tryFindAmbientModule:function(e){return rl(e,!0)},tryFindAmbientModuleWithoutAugmentations:function(e){return rl(e,!1)},getApparentType:Ac,getUnionType:qu,isTypeAssignableTo:Yd,createAnonymousType:ya,createSignature:Bs,createSymbol:jn,createIndexInfo:Nl,getAnyType:function(){return we},getStringType:function(){return He},getNumberType:function(){return Ge},createPromiseType:cb,createArrayType:Tu,getElementTypeOfArrayType:Gp,getBooleanType:function(){return et},getFalseType:function(e){return e?Xe:Ye},getTrueType:function(e){return e?Ze:$e},getVoidType:function(){return rt},getUndefinedType:function(){return ze},getNullType:function(){return qe},getESSymbolType:function(){return tt},getNeverType:function(){return nt},getOptionalType:function(){return Ke},getPromiseType:function(){return mu(!1)},getPromiseLikeType:function(){return yu(!1)},isSymbolAccessible:Ea,isArrayType:qp,isTupleType:_f,isArrayLikeType:Qp,isTypeInvalidDueToUnionDiscriminant:function(e,t){return t.properties.some((function(t){var r=t.name&&i_(t.name),n=r&&Es(r)?Ps(r):void 0,i=void 0===n?void 0:eo(e,n);return !!i&&af(i)&&!Yd(LS(t),i)}))},getExactOptionalProperties:function(e){return yc(e).filter((function(e){return Ff(Uo(e))}))},getAllPossiblePropertiesOfTypes:function(t){var r=qu(t);if(!(1048576&r.flags))return zS(r);for(var n=e.createSymbolTable(),i=0,a=t;i<a.length;i++)for(var o=0,s=zS(a[i]);o<s.length;o++){var c=s[o].escapedName;if(!n.has(c)){var l=wc(r,c);l&&n.set(c,l);}}return e.arrayFrom(n.values())},getSuggestedSymbolForNonexistentProperty:kv,getSuggestionForNonexistentProperty:Fv,getSuggestedSymbolForNonexistentJSXAttribute:Nv,getSuggestedSymbolForNonexistentSymbol:function(t,r,n){return Av(t,e.escapeLeadingUnderscores(r),n)},getSuggestionForNonexistentSymbol:function(t,r,n){return function(t,r,n){var i=Av(t,r,n);return i&&e.symbolName(i)}(t,e.escapeLeadingUnderscores(r),n)},getSuggestedSymbolForNonexistentModule:Pv,getSuggestionForNonexistentExport:function(t,r){var n=Pv(t,r);return n&&e.symbolName(n)},getSuggestedSymbolForNonexistentClassMember:Ev,getBaseConstraintOfType:Tc,getDefaultFromTypeParameter:function(e){return e&&262144&e.flags?Fc(e):void 0},resolveName:function(t,r,n,i){return ei(r,e.escapeLeadingUnderscores(t),n,void 0,void 0,!1,i)},getJsxNamespace:function(t){return e.unescapeLeadingUnderscores(Nn(t))},getJsxFragmentFactory:function(t){var r=xT(t);return r&&e.unescapeLeadingUnderscores(e.getFirstIdentifier(r).escapedText)},getAccessibleSymbolChain:ba,getTypePredicateOfSignature:fl,resolveExternalModuleName:function(t){var r=e.getParseTreeNode(t,e.isExpression);return r&&Ri(r,r,!0)},resolveExternalModuleSymbol:zi,tryGetThisTypeAt:function(t,r){var n=e.getParseTreeNode(t);return n&&Hm(n,r)},getTypeArgumentConstraint:function(t){var r=e.getParseTreeNode(t,e.isTypeNode);return r&&function(t){var r=e.tryCast(t.parent,e.isTypeReferenceType);if(r){var n=yx(r);if(n){var i=hc(n[r.typeArguments.indexOf(t)]);return i&&Rd(i,vd(n,gx(r,n)))}}}(r)},getSuggestionDiagnostics:function(r,n){var o,s=e.getParseTreeNode(r,e.isSourceFile)||e.Debug.fail("Could not determine parsed source file.");if(e.skipTypeChecking(s,U,t))return e.emptyArray;try{return a=n,SS(s),e.Debug.assert(!!(1&Qn(s).flags)),o=e.addRange(o,yn.getDiagnostics(s.fileName)),Ux(CS(s),(function(t,r,n){e.containsParseError(t)||TS(r,!!(8388608&t.flags))||(o||(o=[])).push(i$1(i$1({},n),{category:e.DiagnosticCategory.Suggestion}));})),o||e.emptyArray}finally{a=void 0;}},runWithCancellationToken:function(e,t){try{return a=e,t(de)}finally{a=void 0;}},getLocalTypeParametersOfClassOrInterfaceOrTypeAlias:Xo,isDeclarationVisible:Ha,isPropertyAccessible:Rv,getTypeOnlyAliasDeclaration:Ai,getMemberOverrideModifierStatus:function(t,r){if(!r.name)return 0;var n=$i(t),i=ms(n),a=Ls(i),o=Uo(n),s=e.getEffectiveBaseTypeNode(t)&&is(i),c=(null==s?void 0:s.length)?Ls(e.first(s),i.thisType):void 0,l=rs(i),u=r.parent?e.hasOverrideModifier(r):e.hasSyntacticModifier(r,16384),_=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(r.name));return $D(t,o,l,c,i,a,u,e.hasAbstractModifier(r),e.isStatic(r),!1,_)}};function pe(t,r,n,i){var a=e.getParseTreeNode(t,e.isCallLikeExpression);le=n;var o=a?Nh(a,r,i):void 0;return le=void 0,o}var fe=new e.Map,ge=new e.Map,me=new e.Map,ye=new e.Map,ve=new e.Map,he=new e.Map,be=new e.Map,xe=new e.Map,De=new e.Map,Se=new e.Map,Te=new e.Map,Ce=new e.Map,Ee=[],ke=new e.Map,Ne=jn(4,"unknown"),Fe=jn(0,"__resolving__"),Ae=new e.Map,Pe=new e.Map,we=ua(1,"any"),Ie=ua(1,"any"),Oe=ua(1,"any"),Me=ua(1,"error"),Le=ua(1,"unresolved"),Re=ua(1,"any",131072),Be=ua(1,"intrinsic"),je=ua(2,"unknown"),Je=ua(2,"unknown"),ze=ua(32768,"undefined"),Ue=H?ze:ua(32768,"undefined",131072),Ke=ua(32768,"undefined"),Ve=re?ua(32768,"undefined"):ze,qe=ua(65536,"null"),We=H?qe:ua(65536,"null",131072),He=ua(4,"string"),Ge=ua(8,"number"),Qe=ua(64,"bigint"),Xe=ua(512,"false"),Ye=ua(512,"false"),Ze=ua(512,"true"),$e=ua(512,"true");Ze.regularType=$e,Ze.freshType=Ze,$e.regularType=$e,$e.freshType=Ze,Xe.regularType=Ye,Xe.freshType=Xe,Ye.regularType=Ye,Ye.freshType=Xe;var et=qu([Ye,$e]),tt=ua(4096,"symbol"),rt=ua(16384,"void"),nt=ua(131072,"never"),it=ua(131072,"never"),at=ua(131072,"never",524288),ot=ua(131072,"never"),st=ua(131072,"never"),ct=ua(67108864,"object"),lt=qu([He,Ge]),ut=qu([He,Ge,tt]),_t=ee?He:ut,dt=qu([Ge,Qe]),pt=qu([He,Ge,et,Qe,qe,ze]),ft=xd((function(e){return 262144&e.flags?(t=e).constraint===je?t:t.restrictiveInstantiation||(t.restrictiveInstantiation=da(t.symbol),t.restrictiveInstantiation.constraint=je,t.restrictiveInstantiation):e;var t;})),gt=xd((function(e){return 262144&e.flags?Oe:e})),mt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),yt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);yt.objectFlags|=2048;var vt=jn(2048,"__type");vt.members=e.createSymbolTable();var ht=ya(vt,k,e.emptyArray,e.emptyArray,e.emptyArray),bt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);bt.instantiations=new e.Map;var xt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray);xt.objectFlags|=524288;var Dt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),St=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),Tt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray),Ct=da(),Et=da();Et.constraint=Ct;var kt,Nt,Ft,At,Pt,wt,It,Ot,Mt,Lt,Rt,Bt,jt,Jt,zt,Ut,Kt,Vt,qt,Wt,Ht,Gt,Qt,Xt,Yt,Zt,$t,er,tr,rr,nr,ir,ar,or,sr,cr,lr,ur,_r,dr,pr,fr,gr,mr,yr,vr,hr,br,xr,Dr,Sr,Tr=da(),Cr=al(1,"<<unresolved>>",0,we),Er=Bs(void 0,void 0,void 0,e.emptyArray,we,void 0,0,0),kr=Bs(void 0,void 0,void 0,e.emptyArray,Me,void 0,0,0),Nr=Bs(void 0,void 0,void 0,e.emptyArray,we,void 0,0,0),Fr=Bs(void 0,void 0,void 0,e.emptyArray,it,void 0,0,0),Ar=Nl(Ge,He,!0),Pr=new e.Map,wr={get yieldType(){return e.Debug.fail("Not supported")},get returnType(){return e.Debug.fail("Not supported")},get nextType(){return e.Debug.fail("Not supported")}},Ir=DD(we,we,we),Or=DD(we,we,je),Mr=DD(nt,we,ze),Lr={iterableCacheKey:"iterationTypesOfAsyncIterable",iteratorCacheKey:"iterationTypesOfAsyncIterator",iteratorSymbolName:"asyncIterator",getGlobalIteratorType:function(e){return sr||(sr=_u("AsyncIterator",3,e))||bt},getGlobalIterableType:function(e){return or||(or=_u("AsyncIterable",1,e))||bt},getGlobalIterableIteratorType:function(e){return cr||(cr=_u("AsyncIterableIterator",1,e))||bt},getGlobalGeneratorType:function(e){return lr||(lr=_u("AsyncGenerator",3,e))||bt},resolveIterationType:Ax,mustHaveANextMethodDiagnostic:e.Diagnostics.An_async_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_async_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property},Rr={iterableCacheKey:"iterationTypesOfIterable",iteratorCacheKey:"iterationTypesOfIterator",iteratorSymbolName:"iterator",getGlobalIteratorType:function(e){return tr||(tr=_u("Iterator",3,e))||bt},getGlobalIterableType:hu,getGlobalIterableIteratorType:function(e){return rr||(rr=_u("IterableIterator",1,e))||bt},getGlobalGeneratorType:function(e){return nr||(nr=_u("Generator",3,e))||bt},resolveIterationType:function(e,t){return e},mustHaveANextMethodDiagnostic:e.Diagnostics.An_iterator_must_have_a_next_method,mustBeAMethodDiagnostic:e.Diagnostics.The_0_property_of_an_iterator_must_be_a_method,mustHaveAValueDiagnostic:e.Diagnostics.The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property},Br=new e.Map,jr=!1,Jr=new e.Map,zr=0,Ur=0,Kr=0,Vr=!1,qr=0,Wr=id(""),Hr=ad(0),Gr=od({negative:!1,base10Value:"0"}),Qr=[],Xr=[],Yr=[],Zr=0,$r=[],en=[],tn=[],rn=[],nn=[],an=[],on=[],sn=[],cn=[],ln=[],un=[],_n=[],dn=[],pn=[],fn=[],gn=[],mn=e.createDiagnosticCollection(),yn=e.createDiagnosticCollection(),vn=new e.Map(e.getEntries({string:He,number:Ge,bigint:Qe,boolean:et,symbol:tt,undefined:ze})),hn=qu(e.arrayFrom(S.keys(),id)),bn=new e.Map,xn=new e.Map,Dn=new e.Map,Sn=new e.Map,Tn=new e.Map,Cn=new e.Map,En=e.createSymbolTable();En.set(se.escapedName,se);var kn=[[".mts",".mjs"],[".ts",".js"],[".cts",".cjs"],[".mjs",".mjs"],[".js",".js"],[".cjs",".cjs"],[".tsx",1===U.jsx?".jsx":".js"],[".jsx",".jsx"],[".json",".json"]];return function(){for(var r=0,n=t.getSourceFiles();r<n.length;r++){var i=n[r];e.bindSourceFile(i,U);}var a,o,s,c;kt=new e.Map;for(var l=0,u=t.getSourceFiles();l<u.length;l++)if(!(i=u[l]).redirectInfo){if(!e.isExternalOrCommonJsModule(i)){var _=i.locals.get("globalThis");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f=p[d];mn.add(e.createDiagnosticForNode(f,e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,"globalThis"));}Wn(oe,i.locals);}i.jsGlobalAugmentations&&Wn(oe,i.jsGlobalAugmentations),i.patternAmbientModules&&i.patternAmbientModules.length&&(Ft=e.concatenate(Ft,i.patternAmbientModules)),i.moduleAugmentations.length&&(a||(a=[])).push(i.moduleAugmentations),i.symbol&&i.symbol.globalExports&&i.symbol.globalExports.forEach((function(e,t){oe.has(t)||oe.set(t,e);}));}if(a)for(var g=0,m=a;g<m.length;g++)for(var y=m[g],v=0,h=y;v<h.length;v++){var b=h[v];e.isGlobalScopeAugmentation(b.parent)&&Hn(b);}if(o=oe,s=En,c=e.Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0,s.forEach((function(t,r){var n=o.get(r);n?e.forEach(n.declarations,function(t,r){return function(n){return mn.add(e.createDiagnosticForNode(n,r,t))}}(e.unescapeLeadingUnderscores(r),c)):o.set(r,t);})),Gn(se).type=Ue,Gn(ue).type=_u("IArguments",0,!0),Gn(Ne).type=Me,Gn(ce).type=_a(16,ce),Mt=_u("Array",1,!0),Pt=_u("Object",0,!0),wt=_u("Function",0,!0),It=Q&&_u("CallableFunction",0,!0)||wt,Ot=Q&&_u("NewableFunction",0,!0)||wt,Rt=_u("String",0,!0),Bt=_u("Number",0,!0),jt=_u("Boolean",0,!0),Jt=_u("RegExp",0,!0),Ut=Tu(we),(Kt=Tu(Ie))===mt&&(Kt=ya(void 0,k,e.emptyArray,e.emptyArray,e.emptyArray)),Lt=bu("ReadonlyArray",1)||Mt,Vt=Lt?Du(Lt,[we]):Ut,zt=bu("ThisType",1),a)for(var x=0,D=a;x<D.length;x++)for(var S=0,T=y=D[x];S<T.length;S++)b=T[S],e.isGlobalScopeAugmentation(b.parent)||Hn(b);kt.forEach((function(t){var r=t.firstFile,n=t.secondFile,i=t.conflictingSymbols;if(i.size<8)i.forEach((function(t,r){for(var n=t.isBlockScoped,i=t.firstFileLocations,a=t.secondFileLocations,o=n?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,s=0,c=i;s<c.length;s++)qn(c[s],o,r,a);for(var l=0,u=a;l<u.length;l++)qn(u[l],o,r,i);}));else {var a=e.arrayFrom(i.keys()).join(", ");mn.add(e.addRelatedInfo(e.createDiagnosticForNode(r,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(n,e.Diagnostics.Conflicts_are_in_this_file))),mn.add(e.addRelatedInfo(e.createDiagnosticForNode(n,e.Diagnostics.Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0,a),e.createDiagnosticForNode(r,e.Diagnostics.Conflicts_are_in_this_file)));}})),kt=void 0;}(),de;function Nn(t){if(t){var r=e.getSourceFileOfNode(t);if(r)if(e.isJsxOpeningFragment(t)){if(r.localJsxFragmentNamespace)return r.localJsxFragmentNamespace;var n=r.pragmas.get("jsxfrag");if(n){var i=e.isArray(n)?n[0]:n;if(r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,K),e.visitNode(r.localJsxFragmentFactory,An),r.localJsxFragmentFactory)return r.localJsxFragmentNamespace=e.getFirstIdentifier(r.localJsxFragmentFactory).escapedText}var a=xT(t);if(a)return r.localJsxFragmentFactory=a,r.localJsxFragmentNamespace=e.getFirstIdentifier(a).escapedText}else {var o=Fn(r);if(o)return r.localJsxNamespace=o}}return xr||(xr="React",U.jsxFactory?(Dr=e.parseIsolatedEntityName(U.jsxFactory,K),e.visitNode(Dr,An),Dr&&(xr=e.getFirstIdentifier(Dr).escapedText)):U.reactNamespace&&(xr=e.escapeLeadingUnderscores(U.reactNamespace))),Dr||(Dr=e.factory.createQualifiedName(e.factory.createIdentifier(e.unescapeLeadingUnderscores(xr)),"createElement")),xr}function Fn(t){if(t.localJsxNamespace)return t.localJsxNamespace;var r=t.pragmas.get("jsx");if(r){var n=e.isArray(r)?r[0]:r;if(t.localJsxFactory=e.parseIsolatedEntityName(n.arguments.factory,K),e.visitNode(t.localJsxFactory,An),t.localJsxFactory)return t.localJsxNamespace=e.getFirstIdentifier(t.localJsxFactory).escapedText}}function An(t){return e.setTextRangePosEnd(t,-1,-1),e.visitEachChild(t,An,e.nullTransformationContext)}function Pn(e,t,r,n,i,a,o){var s=In(t,r,n,i,a,o);return s.skippedOn=e,s}function wn(t,r,n,i,a,o){return t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o)}function In(e,t,r,n,i,a){var o=wn(e,t,r,n,i,a);return mn.add(o),o}function On(t,r){t?mn.add(r):yn.add(i$1(i$1({},r),{category:e.DiagnosticCategory.Suggestion}));}function Mn(t,r,n,i,a,o,s){if(r.pos<0||r.end<0){if(!t)return;var c=e.getSourceFileOfNode(r);On(t,"message"in n?e.createFileDiagnostic(c,0,0,n,i,a,o,s):e.createDiagnosticForFileFromMessageChain(c,n));}else On(t,"message"in n?e.createDiagnosticForNode(r,n,i,a,o,s):e.createDiagnosticForNodeFromMessageChain(r,n));}function Ln(t,r,n,i,a,o,s){var c=In(t,n,i,a,o,s);if(r){var l=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);e.addRelatedInfo(c,l);}return c}function Rn(t,r){var n=Array.isArray(t)?e.forEach(t,e.getJSDocDeprecatedTag):e.getJSDocDeprecatedTag(t);return n&&e.addRelatedInfo(r,e.createDiagnosticForNode(n,e.Diagnostics.The_declaration_was_marked_as_deprecated_here)),yn.add(r),r}function Bn(t,r,n){return Rn(r,e.createDiagnosticForNode(t,e.Diagnostics._0_is_deprecated,n))}function jn(e,t,r){h++;var n=new g(33554432|e,t);return n.checkFlags=r||0,n}function Jn(e){var t=0;return 2&e&&(t|=111551),1&e&&(t|=111550),4&e&&(t|=0),8&e&&(t|=900095),16&e&&(t|=110991),32&e&&(t|=899503),64&e&&(t|=788872),256&e&&(t|=899327),128&e&&(t|=899967),512&e&&(t|=110735),8192&e&&(t|=103359),32768&e&&(t|=46015),65536&e&&(t|=78783),262144&e&&(t|=526824),524288&e&&(t|=788968),2097152&e&&(t|=2097152),t}function zn(e,t){t.mergeId||(t.mergeId=d,d++),$r[t.mergeId]=e;}function Un(t){var r=jn(t.flags,t.escapedName);return r.declarations=t.declarations?t.declarations.slice():[],r.parent=t.parent,t.valueDeclaration&&(r.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(r.constEnumOnlyModule=!0),t.members&&(r.members=new e.Map(t.members)),t.exports&&(r.exports=new e.Map(t.exports)),zn(r,t),r}function Kn(t,r,n){if(void 0===n&&(n=!1),!(t.flags&Jn(r.flags))||67108864&(r.flags|t.flags)){if(r===t)return t;if(!(33554432&t.flags)){var i=Ei(t);if(i===Ne)return r;t=Un(i);}512&r.flags&&512&t.flags&&t.constEnumOnlyModule&&!r.constEnumOnlyModule&&(t.constEnumOnlyModule=!1),t.flags|=r.flags,r.valueDeclaration&&e.setValueDeclaration(t,r.valueDeclaration),e.addRange(t.declarations,r.declarations),r.members&&(t.members||(t.members=e.createSymbolTable()),Wn(t.members,r.members,n)),r.exports&&(t.exports||(t.exports=e.createSymbolTable()),Wn(t.exports,r.exports,n)),n||zn(t,r);}else if(1024&t.flags)t!==ce&&In(r.declarations&&e.getNameOfDeclaration(r.declarations[0]),e.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity,Ia(t));else {var a=!!(384&t.flags||384&r.flags),o=!!(2&t.flags||2&r.flags),s=a?e.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations:o?e.Diagnostics.Cannot_redeclare_block_scoped_variable_0:e.Diagnostics.Duplicate_identifier_0,c=r.declarations&&e.getSourceFileOfNode(r.declarations[0]),l=t.declarations&&e.getSourceFileOfNode(t.declarations[0]),u=Ia(r);if(c&&l&&kt&&!a&&c!==l){var _=-1===e.comparePaths(c.path,l.path)?c:l,d=_===c?l:c,p=e.getOrUpdate(kt,"".concat(_.path,"|").concat(d.path),(function(){return {firstFile:_,secondFile:d,conflictingSymbols:new e.Map}})),f=e.getOrUpdate(p.conflictingSymbols,u,(function(){return {isBlockScoped:o,firstFileLocations:[],secondFileLocations:[]}}));g(f.firstFileLocations,r),g(f.secondFileLocations,t);}else Vn(r,s,u,t),Vn(t,s,u,r);}return t;function g(t,r){if(r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];e.pushIfUnique(t,a);}}}function Vn(t,r,n,i){e.forEach(t.declarations,(function(e){qn(e,r,n,i.declarations);}));}function qn(t,r,n,i){for(var a=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t,o=function(t,r,n,i,a,o){var s=t?e.createDiagnosticForNode(t,r,n,i,a,o):e.createCompilerDiagnostic(r,n,i,a,o);return mn.lookup(s)||(mn.add(s),s)}(a,r,n),s=function(t){var r=(e.getExpandoInitializer(t,!1)?e.getNameOfExpando(t):e.getNameOfDeclaration(t))||t;if(r===a)return "continue";o.relatedInformation=o.relatedInformation||[];var i=e.createDiagnosticForNode(r,e.Diagnostics._0_was_also_declared_here,n),s=e.createDiagnosticForNode(r,e.Diagnostics.and_here);if(e.length(o.relatedInformation)>=5||e.some(o.relatedInformation,(function(t){return 0===e.compareDiagnostics(t,s)||0===e.compareDiagnostics(t,i)})))return "continue";e.addRelatedInfo(o,e.length(o.relatedInformation)?s:i);},c=0,l=i||e.emptyArray;c<l.length;c++)s(l[c]);}function Wn(e,t,r){void 0===r&&(r=!1),t.forEach((function(t,n){var i=e.get(n);e.set(n,i?Kn(i,t,r):t);}));}function Hn(t){var r,n,i,a=t.parent;if((null===(r=a.symbol.declarations)||void 0===r?void 0:r[0])===a)if(e.isGlobalScopeAugmentation(a))Wn(oe,a.symbol.exports);else {var o=Bi(t,t,8388608&t.parent.parent.flags?void 0:e.Diagnostics.Invalid_module_name_in_augmentation_module_0_cannot_be_found,!0);if(!o)return;if(1920&(o=zi(o)).flags)if(e.some(Ft,(function(e){return o===e.symbol}))){var s=Kn(a.symbol,o,!0);At||(At=new e.Map),At.set(t.text,s);}else {if((null===(n=o.exports)||void 0===n?void 0:n.get("__export"))&&(null===(i=a.symbol.exports)||void 0===i?void 0:i.size))for(var c=Is(o,"resolvedExports"),l=0,u=e.arrayFrom(a.symbol.exports.entries());l<u.length;l++){var _=u[l],d=_[0],p=_[1];c.has(d)&&!o.exports.has(d)&&Kn(c.get(d),p);}Kn(o,a.symbol);}else In(t,e.Diagnostics.Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity,t.text);}else e.Debug.assert(a.symbol.declarations.length>1);}function Gn(e){if(33554432&e.flags)return e;var t=M(e);return en[t]||(en[t]=new w)}function Qn(e){var t=O(e);return tn[t]||(tn[t]=new I)}function Xn(t){return 303===t.kind&&!e.isExternalOrCommonJsModule(t)}function Yn(t,r,n){if(n){var i=Zi(t.get(r));if(i){if(e.Debug.assert(0==(1&e.getCheckFlags(i)),"Should never get an instantiated symbol here."),i.flags&n)return i;if(2097152&i.flags){var a=ki(i);if(a===Ne||a.flags&n)return i}}}}function Zn(r,n){var i=e.getSourceFileOfNode(r),a=e.getSourceFileOfNode(n),o=e.getEnclosingBlockScopeContainer(r);if(i!==a){if(V&&(i.externalModuleIndicator||a.externalModuleIndicator)||!e.outFile(U)||Tg(n)||8388608&r.flags)return !0;if(l(n,r))return !0;var s=t.getSourceFiles();return s.indexOf(i)<=s.indexOf(a)}if(r.pos<=n.pos&&(!e.isPropertyDeclaration(r)||!e.isThisProperty(n.parent)||r.initializer||r.exclamationToken)){if(202===r.kind){var c=e.getAncestor(n,202);return c?e.findAncestor(c,e.isBindingElement)!==e.findAncestor(r,e.isBindingElement)||r.pos<c.pos:Zn(e.getAncestor(r,253),n)}return 253===r.kind?!function(t,r){switch(t.parent.parent.kind){case 236:case 241:case 243:if(ui(r,t,o))return !0}var n=t.parent.parent;return e.isForInOrOfStatement(n)&&ui(r,n.expression,o)}(r,n):e.isClassDeclaration(r)?!e.findAncestor(n,(function(t){return e.isComputedPropertyName(t)&&t.parent.parent===r})):e.isPropertyDeclaration(r)?!u(r,n,!1):!e.isParameterPropertyDeclaration(r,r.parent)||!(99===e.getEmitScriptTarget(U)&&q&&e.getContainingClass(r)===e.getContainingClass(n)&&l(n,r))}return !(!(274===n.parent.kind||270===n.parent.kind&&n.parent.isExportEquals)&&(270!==n.kind||!n.isExportEquals)&&!(4194304&n.flags||Tg(n)||e.findAncestor(n,(function(t){return e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)})))&&(!l(n,r)||99===e.getEmitScriptTarget(U)&&q&&e.getContainingClass(r)&&(e.isPropertyDeclaration(r)||e.isParameterPropertyDeclaration(r,r.parent))&&u(r,n,!0)));function l(t,r){return !!e.findAncestor(t,(function(n){if(n===o)return "quit";if(e.isFunctionLike(n))return !0;if(e.isClassStaticBlockDeclaration(n))return r.pos<t.pos;var i=e.tryCast(n.parent,e.isPropertyDeclaration);if(i&&i.initializer===n)if(e.isStatic(n.parent)){if(168===r.kind)return !0;if(e.isPropertyDeclaration(r)&&e.getContainingClass(t)===e.getContainingClass(r)){var a=r.name;if((e.isIdentifier(a)||e.isPrivateIdentifier(a))&&function(t,r,n,i,a){for(var o=0,s=n;o<s.length;o++){var c=s[o];if(c.pos>=i&&c.pos<=a){var l=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);if(e.setParent(l.expression,l),e.setParent(l,c),l.flowNode=c.returnFlowNode,!(32768&vf(Pm(l,r,Df(r)))))return !0}}return !1}(a,Uo($i(r)),e.filter(r.parent.members,e.isClassStaticBlockDeclaration),r.parent.pos,n.pos))return !0}}else if(166!==r.kind||e.isStatic(r)||e.getContainingClass(t)!==e.getContainingClass(r))return !0;return !1}))}function u(t,r,n){return !(r.end>t.end)&&void 0===e.findAncestor(r,(function(r){if(r===t)return "quit";switch(r.kind){case 213:return !0;case 166:return !n||!(e.isPropertyDeclaration(t)&&r.parent===t.parent||e.isParameterPropertyDeclaration(t,t.parent)&&r.parent===t.parent.parent)||"quit";case 234:switch(r.parent.kind){case 171:case 168:case 172:return !0;default:return !1}default:return !1}}))}}function $n(t,r,n){var i=e.getEmitScriptTarget(U),a=r;if(e.isParameter(n)&&a.body&&t.valueDeclaration&&t.valueDeclaration.pos>=a.body.pos&&t.valueDeclaration.end<=a.body.end&&i>=2){var o=Qn(a);return void 0===o.declarationRequiresScopeChange&&(o.declarationRequiresScopeChange=e.forEach(a.parameters,(function(e){return s(e.name)||!!e.initializer&&s(e.initializer)}))||!1),!o.declarationRequiresScopeChange}return !1;function s(t){switch(t.kind){case 213:case 212:case 255:case 170:return !1;case 168:case 171:case 172:case 294:return s(t.name);case 166:return e.hasStaticModifier(t)?i<99||!q:s(t.name);default:return e.isNullishCoalesce(t)||e.isOptionalChain(t)?i<7:e.isBindingElement(t)&&t.dotDotDotToken&&e.isObjectBindingPattern(t.parent)?i<4:!e.isTypeNode(t)&&(e.forEachChild(t,s)||!1)}}}function ei(e,t,r,n,i,a,o,s){return void 0===o&&(o=!1),void 0===s&&(s=!0),ti(e,t,r,n,i,a,o,s,Yn)}function ti(t,n,i,a,o,s,c,l,u){var _,d,p,f,g,m,y,v,h,b=t,x=!1,D=t,S=!1;e:for(;t;){if(t.locals&&!Xn(t)&&(f=u(t.locals,n,i))){var T=!0;if(e.isFunctionLike(t)&&g&&g!==t.body?(i&f.flags&788968&&318!==g.kind&&(T=!!(262144&f.flags)&&(g===t.type||163===g.kind||162===g.kind)),i&f.flags&3&&($n(f,t,g)?T=!1:1&f.flags&&(T=163===g.kind||g===t.type&&!!e.findAncestor(f.valueDeclaration,e.isParameter)))):188===t.kind&&(T=g===t.trueType),T)break e;f=void 0;}switch(x=x||ni(t,g),t.kind){case 303:if(!e.isExternalOrCommonJsModule(t))break;S=!0;case 260:var C=(null===(_=$i(t))||void 0===_?void 0:_.exports)||k;if(303===t.kind||e.isModuleDeclaration(t)&&8388608&t.flags&&!e.isGlobalScopeAugmentation(t)){if(f=C.get("default")){var E=e.getLocalSymbolForExportDefault(f);if(E&&f.flags&i&&E.escapedName===n)break e;f=void 0;}var N=C.get(n);if(N&&2097152===N.flags&&(e.getDeclarationOfKind(N,274)||e.getDeclarationOfKind(N,273)))break}if("default"!==n&&(f=u(C,n,2623475&i))){if(!e.isSourceFile(t)||!t.commonJsModuleIndicator||(null===(d=f.declarations)||void 0===d?void 0:d.some(e.isJSDocTypeAlias)))break e;f=void 0;}break;case 259:if(f=u((null===(p=$i(t))||void 0===p?void 0:p.exports)||k,n,8&i))break e;break;case 166:if(!e.isStatic(t)){var F=sa(t.parent);F&&F.locals&&u(F.locals,n,111551&i)&&(y=t);}break;case 256:case 225:case 257:if(f=u($i(t).members||k,n,788968&i)){if(!oi(f,t)){f=void 0;break}if(g&&e.isStatic(g))return void In(D,e.Diagnostics.Static_members_cannot_reference_class_type_parameters);break e}if(225===t.kind&&32&i){var A=t.name;if(A&&n===A.escapedText){f=t.symbol;break e}}break;case 227:if(g===t.expression&&94===t.parent.token){var P=t.parent.parent;if(e.isClassLike(P)&&(f=u($i(P).members,n,788968&i)))return void(a&&In(D,e.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters))}break;case 161:if(h=t.parent.parent,(e.isClassLike(h)||257===h.kind)&&(f=u($i(h).members,n,788968&i)))return void In(D,e.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);break;case 213:if(e.getEmitScriptTarget(U)>=2)break;case 168:case 170:case 171:case 172:case 255:if(3&i&&"arguments"===n){f=ue;break e}break;case 212:if(3&i&&"arguments"===n){f=ue;break e}if(16&i){var w=t.name;if(w&&n===w.escapedText){f=t.symbol;break e}}break;case 164:t.parent&&163===t.parent.kind&&(t=t.parent),t.parent&&(e.isClassElement(t.parent)||256===t.parent.kind)&&(t=t.parent);break;case 343:case 336:case 337:(B=e.getJSDocRoot(t))&&(t=B.parent);break;case 163:g&&(g===t.initializer||g===t.name&&e.isBindingPattern(g))&&(v||(v=t));break;case 202:g&&(g===t.initializer||g===t.name&&e.isBindingPattern(g))&&e.isParameterDeclaration(t)&&!v&&(v=t);break;case 189:if(262144&i){var I=t.typeParameter.name;if(I&&n===I.escapedText){f=t.typeParameter.symbol;break e}}}ii(t)&&(m=t),g=t,t=e.isJSDocTemplateTag(t)&&e.getEffectiveContainerForJSDocTemplateTag(t)||t.parent;}if(!s||!f||m&&f===m.symbol||(f.isReferenced|=i),!f){if(g&&(e.Debug.assert(303===g.kind),g.commonJsModuleIndicator&&"exports"===n&&i&g.symbol.flags))return g.symbol;c||(f=u(oe,n,i));}if(!f&&b&&e.isInJSFile(b)&&b.parent&&e.isRequireCall(b.parent,!1))return _e;if(f){if(a&&r){if(y&&(99!==e.getEmitScriptTarget(U)||!q)){var O=y.name;return void In(D,e.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,e.declarationNameToString(O),ai(o))}if(D&&(2&i||(32&i||384&i)&&111551==(111551&i))){var M=aa(f);(2&M.flags||32&M.flags||384&M.flags)&&function(t,r){var n;if(e.Debug.assert(!!(2&t.flags||32&t.flags||384&t.flags)),!(67108881&t.flags&&32&t.flags)){var i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isBlockOrCatchScoped(t)||e.isClassLike(t)||259===t.kind}));if(void 0===i)return e.Debug.fail("checkResolvedBlockScopedVariable could not find block-scoped declaration");if(!(8388608&i.flags||Zn(i,r))){var a=void 0,o=e.declarationNameToString(e.getNameOfDeclaration(i));2&t.flags?a=In(r,e.Diagnostics.Block_scoped_variable_0_used_before_its_declaration,o):32&t.flags?a=In(r,e.Diagnostics.Class_0_used_before_its_declaration,o):256&t.flags?a=In(r,e.Diagnostics.Enum_0_used_before_its_declaration,o):(e.Debug.assert(!!(128&t.flags)),e.shouldPreserveConstEnums(U)&&(a=In(r,e.Diagnostics.Enum_0_used_before_its_declaration,o))),a&&e.addRelatedInfo(a,e.createDiagnosticForNode(i,e.Diagnostics._0_is_declared_here,o));}}}(M,D);}if(f&&S&&111551==(111551&i)&&!(4194304&b.flags)){var L=Zi(f);e.length(L.declarations)&&e.every(L.declarations,(function(t){return e.isNamespaceExportDeclaration(t)||e.isSourceFile(t)&&!!t.symbol.globalExports}))&&Mn(!U.allowUmdGlobalAccess,D,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead,e.unescapeLeadingUnderscores(n));}if(f&&v&&!x&&111551==(111551&i)){var R=Zi(Ms(f)),B=e.getRootDeclaration(v);R===$i(v)?In(D,e.Diagnostics.Parameter_0_cannot_reference_itself,e.declarationNameToString(v.name)):R.valueDeclaration&&R.valueDeclaration.pos>v.pos&&B.parent.locals&&u(B.parent.locals,R.escapedName,i)===R&&In(D,e.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it,e.declarationNameToString(v.name),e.declarationNameToString(D));}f&&D&&111551&i&&2097152&f.flags&&function(t,r,n){if(!e.isValidTypeOnlyAliasUseSite(n)){var i=Ai(t);if(i){var a=274===i.kind?e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type:e.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type,o=e.unescapeLeadingUnderscores(r);ri(In(n,a,o),i,o);}}}(f,n,D);}return f}if(a&&r&&(!D||!(function(t,r,n){if(!e.isIdentifier(t)||t.escapedText!==r||FS(t)||Tg(t))return !1;for(var i=e.getThisContainer(t,!1),a=i;a;){if(e.isClassLike(a.parent)){var o=$i(a.parent);if(!o)break;if(Jc(Uo(o),r))return In(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0,ai(n),Ia(o)),!0;if(a===i&&!e.isStatic(a)&&Jc(ms(o).thisType,r))return In(t,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0,ai(n)),!0}a=a.parent;}return !1}(D,n,o)||si(D)||function(t,r,n){var i=1920|(e.isInJSFile(t)?111551:0);if(n===i){var a=Ei(ei(t,r,788968&~i,void 0,void 0,!1)),o=t.parent;if(a){if(e.isQualifiedName(o)){e.Debug.assert(o.left===t,"Should only be resolving left side of qualified name as a namespace");var s=o.right.escapedText;if(Jc(ms(a),s))return In(o,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,e.unescapeLeadingUnderscores(r),e.unescapeLeadingUnderscores(s)),!0}return In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here,e.unescapeLeadingUnderscores(r)),!0}}return !1}(D,n,i)||function(t,r){return !(!li(r)||274!==t.parent.kind)&&(In(t,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,r),!0)}(D,n)||function(t,r,n){if(111551&n){if(li(r))return In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,e.unescapeLeadingUnderscores(r)),!0;var i=Ei(ei(t,r,788544,void 0,void 0,!1));if(i&&!(1024&i.flags)){var a=e.unescapeLeadingUnderscores(r);return function(e){switch(e){case"Promise":case"Symbol":case"Map":case"WeakMap":case"Set":case"WeakSet":return !0}return !1}(r)?In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later,a):function(t,r){var n=e.findAncestor(t.parent,(function(t){return !e.isComputedPropertyName(t)&&!e.isPropertySignature(t)&&(e.isTypeLiteralNode(t)||"quit")}));if(n&&1===n.members.length){var i=ms(r);return !!(1048576&i.flags)&&Nb(i,384,!0)}return !1}(t,i)?In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0,a,"K"===a?"P":"K"):In(t,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here,a),!0}}return !1}(D,n,i)||function(t,r,n){if(111127&n){if(Ei(ei(t,r,1024,void 0,void 0,!1)))return In(t,e.Diagnostics.Cannot_use_namespace_0_as_a_value,e.unescapeLeadingUnderscores(r)),!0}else if(788544&n&&Ei(ei(t,r,1536,void 0,void 0,!1)))return In(t,e.Diagnostics.Cannot_use_namespace_0_as_a_type,e.unescapeLeadingUnderscores(r)),!0;return !1}(D,n,i)||function(t,r,n){if(788584&n){var i=Ei(ei(t,r,111127,void 0,void 0,!1));if(i&&!(1920&i.flags))return In(t,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.unescapeLeadingUnderscores(r)),!0}return !1}(D,n,i)))){var j=void 0;if(l&&Zr<10&&((null==(j=Av(b,n,i))?void 0:j.valueDeclaration)&&e.isAmbientModule(j.valueDeclaration)&&e.isGlobalScopeAugmentation(j.valueDeclaration)&&(j=void 0),j)){var J=Ia(j),z=bv(b,j,!1),K=wn(D,1920===i||o&&"string"!=typeof o&&e.nodeIsSynthesized(o)?e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1:z?e.Diagnostics.Could_not_find_name_0_Did_you_mean_1:e.Diagnostics.Cannot_find_name_0_Did_you_mean_1,ai(o),J);On(!z,K),j.valueDeclaration&&e.addRelatedInfo(K,e.createDiagnosticForNode(j.valueDeclaration,e.Diagnostics._0_is_declared_here,J));}if(!j&&o){var V=function(t){for(var r=ai(t),n=e.getScriptTargetFeatures(),i=0,a=e.getOwnKeys(n);i<a.length;i++){var o=a[i],s=e.getOwnKeys(n[o]);if(void 0!==s&&e.contains(s,r))return o}}(o);V?In(D,a,ai(o),V):In(D,a,ai(o));}Zr++;}}function ri(t,r,n){return r?e.addRelatedInfo(t,e.createDiagnosticForNode(r,274===r.kind?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,n)):t}function ni(t,r){return 213!==t.kind&&212!==t.kind?e.isTypeQueryNode(t)||(e.isFunctionLikeDeclaration(t)||166===t.kind&&!e.isStatic(t))&&(!r||r!==t.name):!(r&&r===t.name||!t.asteriskToken&&!e.hasSyntacticModifier(t,256)&&e.getImmediatelyInvokedFunctionExpression(t))}function ii(e){switch(e.kind){case 255:case 256:case 257:case 259:case 258:case 260:return !0;default:return !1}}function ai(t){return e.isString(t)?e.unescapeLeadingUnderscores(t):e.declarationNameToString(t)}function oi(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(162===a.kind&&(e.isJSDocTemplateTag(a.parent)?e.getJSDocHost(a.parent):a.parent)===r)return !(e.isJSDocTemplateTag(a.parent)&&e.find(a.parent.parent.tags,e.isJSDocTypeAlias))}return !1}function si(t){var r=ci(t);return !(!r||!Mi(r,64,!0)||(In(t,e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements,e.getTextOfNode(r)),0))}function ci(t){switch(t.kind){case 79:case 205:return t.parent?ci(t.parent):void 0;case 227:if(e.isEntityNameExpression(t.expression))return t.expression;default:return}}function li(e){return "any"===e||"string"===e||"number"===e||"boolean"===e||"never"===e||"unknown"===e}function ui(t,r,n){return !!r&&!!e.findAncestor(t,(function(t){return t===n||e.isFunctionLike(t)?"quit":t===r}))}function _i(e){switch(e.kind){case 264:return e;case 266:return e.parent;case 267:return e.parent.parent;case 269:return e.parent.parent.parent;default:return}}function di(t){return t.declarations&&e.findLast(t.declarations,pi)}function pi(t){return 264===t.kind||263===t.kind||266===t.kind&&!!t.name||267===t.kind||273===t.kind||269===t.kind||274===t.kind||270===t.kind&&e.exportAssignmentIsAlias(t)||e.isBinaryExpression(t)&&2===e.getAssignmentDeclarationKind(t)&&e.exportAssignmentIsAlias(t)||e.isAccessExpression(t)&&e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind&&fi(t.parent.right)||295===t.kind||294===t.kind&&fi(t.initializer)||e.isRequireVariableDeclaration(t)}function fi(t){return e.isAliasableExpression(t)||e.isFunctionExpression(t)&&Fh(t)}function gi(e,t,r,n){var i=e.exports.get("export="),a=i?Jc(Uo(i),t):e.exports.get(t),o=Ei(a,n);return Ni(r,a,o,!1),o}function mi(t){return e.isExportAssignment(t)&&!t.isExportEquals||e.hasSyntacticModifier(t,512)||e.isExportSpecifier(t)}function yi(t){return e.isStringLiteralLike(t)?e.getModeForUsageLocation(e.getSourceFileOfNode(t),t):void 0}function vi(t){return yi(t)===e.ModuleKind.ESNext&&e.endsWith(t.text,".json")}function hi(t,r,n,i){var a=t&&yi(i);if(t&&void 0!==a){var o=function(t,r){return t===e.ModuleKind.ESNext&&r===e.ModuleKind.CommonJS}(a,t.impliedNodeFormat);if(a===e.ModuleKind.ESNext||o)return o}if(!W)return !1;if(!t||t.isDeclarationFile){var s=gi(r,"default",void 0,!0);return !(s&&e.some(s.declarations,mi)||gi(r,e.escapeLeadingUnderscores("__esModule"),void 0,n))}return e.isSourceFileJS(t)?!t.externalModuleIndicator&&!gi(r,e.escapeLeadingUnderscores("__esModule"),void 0,n):Vi(r)}function bi(t,r,i){var a,o;void 0===i&&(i=!1);var s=e.getExternalModuleRequireArgument(t)||t.moduleSpecifier,c=Ri(t,s),l=!e.isPropertyAccessExpression(r)&&r.propertyName||r.name;if(e.isIdentifier(l)){var u=Ui(c,s,!1,"default"===l.escapedText&&!(!U.allowSyntheticDefaultImports&&!e.getESModuleInterop(U)));if(u&&l.escapedText){if(e.isShorthandAmbientModuleSymbol(c))return c;var _=void 0;_=c&&c.exports&&c.exports.get("export=")?Jc(Uo(u),l.escapedText,!0):function(e,t){if(3&e.flags){var r=e.valueDeclaration.type;if(r)return Ei(Jc(dd(r),t))}}(u,l.escapedText),_=Ei(_,i);var d=function(e,t,r,n){if(1536&e.flags){var i=Gi(e).get(t.escapedText),a=Ei(i,n);return Ni(r,i,a,!1),a}}(u,l,r,i);if(void 0===d&&"default"===l.escapedText){var p=null===(a=c.declarations)||void 0===a?void 0:a.find(e.isSourceFile);(vi(s)||hi(p,c,i,s))&&(d=zi(c,i)||Ei(c,i));}var f=d&&_&&d!==_?function(t,r){if(t===Ne&&r===Ne)return Ne;if(790504&t.flags)return t;var n=jn(t.flags|r.flags,t.escapedName);return n.declarations=e.deduplicate(e.concatenate(t.declarations,r.declarations),e.equateValues),n.parent=t.parent||r.parent,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration),r.members&&(n.members=new e.Map(r.members)),t.exports&&(n.exports=new e.Map(t.exports)),n}(_,d):d||_;if(!f){var g=Oi(c,t),m=e.declarationNameToString(l),y=Pv(l,u);if(void 0!==y){var v=Ia(y),h=In(l,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,g,m,v);y.valueDeclaration&&e.addRelatedInfo(h,e.createDiagnosticForNode(y.valueDeclaration,e.Diagnostics._0_is_declared_here,v));}else (null===(o=c.exports)||void 0===o?void 0:o.has("default"))?In(l,e.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead,g,m):function(t,r,i,a,o){var s,c,l=null===(c=null===(s=a.valueDeclaration)||void 0===s?void 0:s.locals)||void 0===c?void 0:c.get(r.escapedText),u=a.exports;if(l){var _=null==u?void 0:u.get("export=");if(_)ia(_,l)?function(t,r,n,i){V>=e.ModuleKind.ES2015?In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):e.isInJSFile(t)?In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n):In(r,e.getESModuleInterop(U)?e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import:e.Diagnostics._0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import,n,n,i);}(t,r,i,o):In(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);else {var d=u?e.find(el(u),(function(e){return !!ia(e,l)})):void 0,p=d?In(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_exported_as_2,o,i,Ia(d)):In(r,e.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported,o,i);l.declarations&&e.addRelatedInfo.apply(void 0,n$3([p],e.map(l.declarations,(function(t,r){return e.createDiagnosticForNode(t,0===r?e.Diagnostics._0_is_declared_here:e.Diagnostics.and_here,i)})),!1));}}else In(r,e.Diagnostics.Module_0_has_no_exported_member_1,o,i);}(t,l,m,c,g);}return f}}}function xi(t){if(e.isVariableDeclaration(t)&&t.initializer&&e.isPropertyAccessExpression(t.initializer))return t.initializer}function Di(e,t,r){var n=e.parent.parent.moduleSpecifier?bi(e.parent.parent,e,r):Mi(e.propertyName||e.name,t,!1,r);return Ni(e,void 0,n,!1),n}function Si(t,r){return e.isClassExpression(t)?zb(t).symbol:e.isEntityName(t)||e.isEntityNameExpression(t)?Mi(t,901119,!0,r)||(zb(t),Qn(t).resolvedSymbol):void 0}function Ti(t,r){switch(void 0===r&&(r=!1),t.kind){case 264:case 253:return function(t,r){var n=xi(t);if(n){var i=e.getLeftmostAccessExpression(n.expression).arguments[0];return e.isIdentifier(n.name)?Ei(Jc(dl(i),n.name.escapedText)):void 0}if(e.isVariableDeclaration(t)||276===t.moduleReference.kind){var a=Ri(t,e.getExternalModuleRequireArgument(t)||e.getExternalModuleImportEqualsDeclarationExpression(t)),o=zi(a);return Ni(t,a,o,!1),o}var s=Ii(t.moduleReference,r);return function(t,r){if(Ni(t,void 0,r,!1)&&!t.isTypeOnly){var n=Ai($i(t)),i=274===n.kind,a=i?e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type:e.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type,o=i?e.Diagnostics._0_was_exported_here:e.Diagnostics._0_was_imported_here,s=e.unescapeLeadingUnderscores(n.name.escapedText);e.addRelatedInfo(In(t.moduleReference,a),e.createDiagnosticForNode(n,o,s));}}(t,s),s}(t,r);case 266:return function(t,r){var n,i=Ri(t,t.parent.moduleSpecifier);if(i){var a;a=e.isShorthandAmbientModuleSymbol(i)?i:gi(i,"default",t,r);var o=null===(n=i.declarations)||void 0===n?void 0:n.find(e.isSourceFile),s=vi(t.parent.moduleSpecifier),c=hi(o,i,r,t.parent.moduleSpecifier);if(a||c||s){if(c||s){var l=zi(i,r)||Ei(i,r);return Ni(t,i,l,!1),l}}else if(Vi(i)){var u=V>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop",_=i.exports.get("export=").valueDeclaration,d=In(t.name,e.Diagnostics.Module_0_can_only_be_default_imported_using_the_1_flag,Ia(i),u);_&&e.addRelatedInfo(d,e.createDiagnosticForNode(_,e.Diagnostics.This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag,u));}else !function(t,r){var n,i,a;if(null===(n=t.exports)||void 0===n?void 0:n.has(r.symbol.escapedName))In(r.name,e.Diagnostics.Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead,Ia(t),Ia(r.symbol));else {var o=In(r.name,e.Diagnostics.Module_0_has_no_default_export,Ia(t)),s=null===(i=t.exports)||void 0===i?void 0:i.get("__export");if(s){var c=null===(a=s.declarations)||void 0===a?void 0:a.find((function(t){var r,n;return !!(e.isExportDeclaration(t)&&t.moduleSpecifier&&(null===(n=null===(r=Ri(t,t.moduleSpecifier))||void 0===r?void 0:r.exports)||void 0===n?void 0:n.has("default")))}));c&&e.addRelatedInfo(o,e.createDiagnosticForNode(c,e.Diagnostics.export_Asterisk_does_not_re_export_a_default));}}}(i,t);return Ni(t,a,void 0,!1),a}}(t,r);case 267:return function(e,t){var r=e.parent.parent.moduleSpecifier,n=Ri(e,r),i=Ui(n,r,t,!1);return Ni(e,n,i,!1),i}(t,r);case 273:return function(e,t){var r=e.parent.moduleSpecifier,n=r&&Ri(e,r),i=r&&Ui(n,r,t,!1);return Ni(e,n,i,!1),i}(t,r);case 269:case 202:return function(t,r){var n=e.isBindingElement(t)?e.getRootDeclaration(t):t.parent.parent.parent,i=xi(n),a=bi(n,i||t,r),o=t.propertyName||t.name;return i&&a&&e.isIdentifier(o)?Ei(Jc(Uo(a),o.escapedText),r):(Ni(t,void 0,a,!1),a)}(t,r);case 274:return Di(t,901119,r);case 270:case 220:return function(t,r){var n=Si(e.isExportAssignment(t)?t.expression:t.right,r);return Ni(t,void 0,n,!1),n}(t,r);case 263:return function(e,t){var r=zi(e.parent.symbol,t);return Ni(e,void 0,r,!1),r}(t,r);case 295:return Mi(t.name,901119,!0,r);case 294:return function(e,t){return Si(e.initializer,t)}(t,r);case 206:case 205:return function(t,r){if(e.isBinaryExpression(t.parent)&&t.parent.left===t&&63===t.parent.operatorToken.kind)return Si(t.parent.right,r)}(t,r);default:return e.Debug.fail()}}function Ci(e,t){return void 0===t&&(t=901119),!(!e||2097152!=(e.flags&(2097152|t))&&!(2097152&e.flags&&67108864&e.flags))}function Ei(e,t){return !t&&Ci(e)?ki(e):e}function ki(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=Gn(t);if(r.target)r.target===Fe&&(r.target=Ne);else {r.target=Fe;var n=di(t);if(!n)return e.Debug.fail();var i=Ti(n);r.target===Fe?r.target=i||Ne:In(n,e.Diagnostics.Circular_definition_of_import_alias_0,Ia(t));}return r.target}function Ni(t,r,n,i){if(!t||e.isPropertyAccessExpression(t))return !1;var a=$i(t);if(e.isTypeOnlyImportOrExportDeclaration(t))return Gn(a).typeOnlyDeclaration=t,!0;var o=Gn(a);return Fi(o,r,i)||Fi(o,n,i)}function Fi(t,r,n){var i,a,o;if(r&&(void 0===t.typeOnlyDeclaration||n&&!1===t.typeOnlyDeclaration)){var s=null!==(a=null===(i=r.exports)||void 0===i?void 0:i.get("export="))&&void 0!==a?a:r,c=s.declarations&&e.find(s.declarations,e.isTypeOnlyImportOrExportDeclaration);t.typeOnlyDeclaration=null!==(o=null!=c?c:Gn(s).typeOnlyDeclaration)&&void 0!==o&&o;}return !!t.typeOnlyDeclaration}function Ai(e){if(2097152&e.flags)return Gn(e).typeOnlyDeclaration||void 0}function Pi(e){var t=$i(e),r=ki(t);r&&(r===Ne||111551&r.flags&&!$S(r)&&!Ai(t))&&wi(t);}function wi(t){var r=Gn(t);if(!r.referenced){r.referenced=!0;var n=di(t);if(!n)return e.Debug.fail();if(e.isInternalModuleImportEqualsDeclaration(n)){var i=Ei(t);(i===Ne||111551&i.flags)&&zb(n.moduleReference);}}}function Ii(t,r){return 79===t.kind&&e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),79===t.kind||160===t.parent.kind?Mi(t,1920,!1,r):(e.Debug.assert(264===t.parent.kind),Mi(t,901119,!1,r))}function Oi(e,t){return e.parent?Oi(e.parent,t)+"."+Ia(e):Ia(e,t,void 0,20)}function Mi(t,r,n,i,a){if(!e.nodeIsMissing(t)){var o,s=1920|(e.isInJSFile(t)?111551&r:0);if(79===t.kind){var c=r===s||e.nodeIsSynthesized(t)?e.Diagnostics.Cannot_find_namespace_0:Dg(e.getFirstIdentifier(t)),l=e.isInJSFile(t)&&!e.nodeIsSynthesized(t)?function(t,r){if(eu(t.parent)){var n=function(t){if(!e.findAncestor(t,(function(t){return e.isJSDocNode(t)||4194304&t.flags?e.isJSDocTypeAlias(t):"quit"}))){var r=e.getJSDocHost(t);if(r&&e.isExpressionStatement(r)&&e.isBinaryExpression(r.expression)&&3===e.getAssignmentDeclarationKind(r.expression)&&(n=$i(r.expression.left)))return Li(n);if(r&&(e.isObjectLiteralMethod(r)||e.isPropertyAssignment(r))&&e.isBinaryExpression(r.parent.parent)&&6===e.getAssignmentDeclarationKind(r.parent.parent)&&(n=$i(r.parent.parent.left)))return Li(n);var n,i=e.getEffectiveJSDocHost(t);if(i&&e.isFunctionLike(i))return (n=$i(i))&&n.valueDeclaration}}(t.parent);if(n)return ei(n,t.escapedText,r,void 0,t,!0)}}(t,r):void 0;if(!(o=Zi(ei(a||t,t.escapedText,r,n||l?void 0:c,t,!0,!1))))return Zi(l)}else {if(160!==t.kind&&205!==t.kind)throw e.Debug.assertNever(t,"Unknown entity name kind.");var u=160===t.kind?t.left:t.expression,_=160===t.kind?t.right:t.name,d=Mi(u,s,n,!1,a);if(!d||e.nodeIsMissing(_))return;if(d===Ne)return d;if(d.valueDeclaration&&e.isInJSFile(d.valueDeclaration)&&e.isVariableDeclaration(d.valueDeclaration)&&d.valueDeclaration.initializer&&Bh(d.valueDeclaration.initializer)){var p=d.valueDeclaration.initializer.arguments[0],f=Ri(p,p);if(f){var g=zi(f);g&&(d=g);}}if(!(o=Zi(Yn(Gi(d),_.escapedText,r)))){if(!n){var m=Oi(d),y=e.declarationNameToString(_),v=Pv(_,d);if(v)return void In(_,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2,m,y,Ia(v));var h=e.isQualifiedName(t)&&function(t){for(;e.isQualifiedName(t.parent);)t=t.parent;return t}(t);if(Pt&&788968&r&&h&&!e.isTypeOfExpression(h.parent)&&function(t){var r=e.getFirstIdentifier(t),n=ei(r,r.escapedText,111551,void 0,r,!0);if(n){for(;e.isQualifiedName(r.parent);){if(!(n=Jc(Uo(n),r.parent.right.escapedText)))return;r=r.parent;}return n}}(h))return void In(h,e.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0,e.entityNameToString(h));if(1920&r&&e.isQualifiedName(t.parent)){var b=Zi(Yn(Gi(d),_.escapedText,788968));if(b)return void In(t.parent.right,e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1,Ia(b),e.unescapeLeadingUnderscores(t.parent.right.escapedText))}In(_,e.Diagnostics.Namespace_0_has_no_exported_member_1,m,y);}return}}return e.Debug.assert(0==(1&e.getCheckFlags(o)),"Should never get an instantiated symbol here."),!e.nodeIsSynthesized(t)&&e.isEntityName(t)&&(2097152&o.flags||270===t.parent.kind)&&Ni(e.getAliasDeclarationFromName(t),o,void 0,!0),o.flags&r||i?o:ki(o)}}function Li(t){var r=t.parent.valueDeclaration;if(r)return (e.isAssignmentDeclaration(r)?e.getAssignedExpandoInitializer(r):e.hasOnlyExpressionInitializer(r)?e.getDeclaredExpandoInitializer(r):void 0)||r}function Ri(t,r,n){var i=e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;return Bi(t,r,n?void 0:i)}function Bi(t,r,n,i){return void 0===i&&(i=!1),e.isStringLiteralLike(r)?ji(t,r.text,n,r,i):void 0}function ji(r,n,i,a,o){var s,c,l,u,_,d,p;void 0===o&&(o=!1),e.startsWith(n,"@types/")&&In(a,N=e.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1,e.removePrefix(n,"@types/"),n);var f=rl(n,!0);if(f)return f;var g=e.getSourceFileOfNode(r),m=e.isStringLiteralLike(r)?r:(null===(s=e.findAncestor(r,e.isImportCall))||void 0===s?void 0:s.arguments[0])||(null===(c=e.findAncestor(r,e.isImportDeclaration))||void 0===c?void 0:c.moduleSpecifier)||(null===(l=e.findAncestor(r,e.isExternalModuleImportEqualsDeclaration))||void 0===l?void 0:l.moduleReference.expression)||(null===(u=e.findAncestor(r,e.isExportDeclaration))||void 0===u?void 0:u.moduleSpecifier)||(null===(_=e.isModuleDeclaration(r)?r:r.parent&&e.isModuleDeclaration(r.parent)&&r.parent.name===r?r.parent:void 0)||void 0===_?void 0:_.name)||(null===(d=e.isLiteralImportTypeNode(r)?r:void 0)||void 0===d?void 0:d.argument.literal),y=m&&e.isStringLiteralLike(m)?e.getModeForUsageLocation(g,m):g.impliedNodeFormat,v=e.getResolvedModule(g,n,y),h=v&&e.getResolutionDiagnostic(U,v),b=v&&!h&&t.getSourceFile(v.resolvedFileName);if(b){if(b.symbol)return v.isExternalLibraryImport&&!e.resolutionExtensionIsTSOrJson(v.extension)&&Ji(!1,a,v,n),(e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.NodeNext)&&((g.impliedNodeFormat===e.ModuleKind.CommonJS&&!e.findAncestor(r,e.isImportCall)||!!e.findAncestor(r,e.isImportEqualsDeclaration))&&b.impliedNodeFormat===e.ModuleKind.ESNext&&In(a,e.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead,n),y===e.ModuleKind.ESNext&&U.resolveJsonModule&&".json"===v.extension&&In(a,e.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports)),Zi(b.symbol);i&&In(a,e.Diagnostics.File_0_is_not_a_module,b.fileName);}else {if(Ft){var x=e.findBestPatternMatch(Ft,(function(e){return e.pattern}),n);if(x){var D=At&&At.get(n);return Zi(D||x.symbol)}}if(v&&!e.resolutionExtensionIsTSOrJson(v.extension)&&void 0===h||h===e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type)o?In(a,N=e.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented,n,v.resolvedFileName):Ji(Y&&!!i,a,v,n);else if(i){if(v){var S=t.getProjectReferenceRedirect(v.resolvedFileName);if(S)return void In(a,e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,S,v.resolvedFileName)}if(h)In(a,h,n,v.resolvedFileName);else {var T=e.tryExtractTSExtension(n),C=e.pathIsRelative(n)&&!e.hasExtension(n),E=e.getEmitModuleResolutionKind(U),k=E===e.ModuleResolutionKind.Node12||E===e.ModuleResolutionKind.NodeNext;if(T){var N=e.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead,F=e.removeExtension(n,T);V>=e.ModuleKind.ES2015&&(F+=".mts"===T?".mjs":".cts"===T?".cjs":".js"),In(a,N,T,F);}else if(!U.resolveJsonModule&&e.fileExtensionIs(n,".json")&&e.getEmitModuleResolutionKind(U)!==e.ModuleResolutionKind.Classic&&e.hasJsonModuleEmitEnabled(U))In(a,e.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension,n);else if(y===e.ModuleKind.ESNext&&k&&C){var A=e.getNormalizedAbsolutePath(n,e.getDirectoryPath(g.path)),P=null===(p=kn.find((function(e){var r=e[0];return t.fileExists(A+r)})))||void 0===p?void 0:p[1];P?In(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0,n+P):In(a,e.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);}else In(a,i,n);}}}}function Ji(t,r,n,i){var a,o=n.packageId,s=n.resolvedFileName,c=!e.isExternalModuleNameRelative(i)&&o?(a=o.name,f().has(e.getTypesPackageName(a))?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,o.name,e.mangleScopedPackageName(o.name)):function(e){return !!f().get(e)}(o.name)?e.chainDiagnosticMessages(void 0,e.Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,o.name,i):e.chainDiagnosticMessages(void 0,e.Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,i,e.mangleScopedPackageName(o.name))):void 0;Mn(t,r,e.chainDiagnosticMessages(c,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,i,s));}function zi(t,r){if(null==t?void 0:t.exports){var n=function(t,r){if(!t||t===Ne||t===r||1===r.exports.size||2097152&t.flags)return t;var n=Gn(t);if(n.cjsExportMerged)return n.cjsExportMerged;var i=33554432&t.flags?t:Un(t);return i.flags=512|i.flags,void 0===i.exports&&(i.exports=e.createSymbolTable()),r.exports.forEach((function(e,t){"export="!==t&&i.exports.set(t,i.exports.has(t)?Kn(i.exports.get(t),e):e);})),Gn(i).cjsExportMerged=i,n.cjsExportMerged=i}(Zi(Ei(t.exports.get("export="),r)),Zi(t));return Zi(n)||t}}function Ui(t,r,n,i){var a=zi(t,n);if(!n&&a){if(!(i||1539&a.flags||e.getDeclarationOfKind(a,303))){var o=V>=e.ModuleKind.ES2015?"allowSyntheticDefaultImports":"esModuleInterop";return In(r,e.Diagnostics.This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export,o),a}var s=r.parent;if(e.isImportDeclaration(s)&&e.getNamespaceDeclarationNode(s)||e.isImportCall(s)){var c=e.isImportCall(s)?s.arguments[0]:s.moduleSpecifier,l=Uo(a),u=Lh(l,a,t,c);if(u)return Ki(a,u,s);if(e.getESModuleInterop(U)){var _=zc(l,0);if(_&&_.length||(_=zc(l,1)),_&&_.length||Jc(l,"default"))return Ki(a,Rh(l,a,t,c),s)}}}return a}function Ki(t,r,n){var i=jn(t.flags,t.escapedName);i.declarations=t.declarations?t.declarations.slice():[],i.parent=t.parent,i.target=t,i.originatingImport=n,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),t.constEnumOnlyModule&&(i.constEnumOnlyModule=!0),t.members&&(i.members=new e.Map(t.members)),t.exports&&(i.exports=new e.Map(t.exports));var a=pc(r);return i.type=ya(i,a.members,e.emptyArray,e.emptyArray,a.indexInfos),i}function Vi(e){return void 0!==e.exports.get("export=")}function qi(e){return el(Qi(e))}function Wi(e,t){var r=Qi(t);if(r)return r.get(e)}function Hi(t){return !(131068&t.flags||1&e.getObjectFlags(t)||qp(t)||_f(t))}function Gi(e){return 6256&e.flags?Is(e,"resolvedExports"):1536&e.flags?Qi(e):e.exports||k}function Qi(e){var t=Gn(e);return t.resolvedExports||(t.resolvedExports=Yi(e))}function Xi(t,r,n,i){r&&r.forEach((function(r,a){if("default"!==a){var o=t.get(a);if(o){if(n&&i&&o&&Ei(o)!==Ei(r)){var s=n.get(a);s.exportsWithDuplicate?s.exportsWithDuplicate.push(i):s.exportsWithDuplicate=[i];}}else t.set(a,r),n&&i&&n.set(a,{specifierText:e.getTextOfNode(i.moduleSpecifier)});}}));}function Yi(t){var r=[];return function t(n){if(n&&n.exports&&e.pushIfUnique(r,n)){var i=new e.Map(n.exports),a=n.exports.get("__export");if(a){var o=e.createSymbolTable(),s=new e.Map;if(a.declarations)for(var c=0,l=a.declarations;c<l.length;c++){var u=l[c];Xi(o,t(Ri(u,u.moduleSpecifier)),s,u);}s.forEach((function(t,r){var n=t.exportsWithDuplicate;if("export="!==r&&n&&n.length&&!i.has(r))for(var a=0,o=n;a<o.length;a++){var c=o[a];mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity,s.get(r).specifierText,e.unescapeLeadingUnderscores(r)));}})),Xi(i,o);}return i}}(t=zi(t))||k}function Zi(e){var t;return e&&e.mergeId&&(t=$r[e.mergeId])?t:e}function $i(e){return Zi(e.symbol&&Ms(e.symbol))}function ea(e){return Zi(e.parent&&Ms(e.parent))}function ta(r,i,a){var o=ea(r);if(o&&!(262144&r.flags)){var s=e.mapDefined(o.declarations,(function(e){return o&&ra(e,o)})),c=i&&function(r,n){var i,a=e.getSourceFileOfNode(n),o=O(a),s=Gn(r);if(s.extendedContainersByFile&&(i=s.extendedContainersByFile.get(o)))return i;if(a&&a.imports){for(var c=0,l=a.imports;c<l.length;c++){var u=l[c];if(!e.nodeIsSynthesized(u)){var _=Ri(n,u,!0);_&&na(_,r)&&(i=e.append(i,_));}}if(e.length(i))return (s.extendedContainersByFile||(s.extendedContainersByFile=new e.Map)).set(o,i),i}if(s.extendedContainers)return s.extendedContainers;for(var d=0,p=t.getSourceFiles();d<p.length;d++){var f=p[d];if(e.isExternalModule(f)){var g=$i(f);na(g,r)&&(i=e.append(i,g));}}return s.extendedContainers=i||e.emptyArray}(r,i),l=function(t,r){var n=!!e.length(t.declarations)&&e.first(t.declarations);if(111551&r&&n&&n.parent&&e.isVariableDeclaration(n.parent)&&(e.isObjectLiteralExpression(n)&&n===n.parent.initializer||e.isTypeLiteralNode(n)&&n===n.parent.type))return $i(n.parent)}(o,a);if(i&&o.flags&ha(a)&&ba(o,i,1920,!1))return e.append(e.concatenate(e.concatenate([o],s),c),l);var u=!(o.flags&ha(a))&&788968&o.flags&&524288&ms(o).flags&&111551===a?va(i,(function(t){return e.forEachEntry(t,(function(e){if(e.flags&ha(a)&&Uo(e)===ms(o))return e}))})):void 0,_=n$3(n$3(u?[u]:[],s,!0),[o],!1);return _=e.append(_,l),e.addRange(_,c)}var d=e.mapDefined(r.declarations,(function(t){return !e.isAmbientModule(t)&&t.parent&&Aa(t.parent)?$i(t.parent):e.isClassExpression(t)&&e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind&&e.isAccessExpression(t.parent.left)&&e.isEntityNameExpression(t.parent.left.expression)?e.isModuleExportsAccessExpression(t.parent.left)||e.isExportsIdentifier(t.parent.left.expression)?$i(e.getSourceFileOfNode(t)):(zb(t.parent.left.expression),Qn(t.parent.left.expression).resolvedSymbol):void 0}));if(e.length(d))return e.mapDefined(d,(function(e){return na(e,r)?e:void 0}))}function ra(e,t){var r=Na(e),n=r&&r.exports&&r.exports.get("export=");return n&&ia(n,t)?r:void 0}function na(t,r){if(t===ea(r))return r;var n=t.exports&&t.exports.get("export=");if(n&&ia(n,r))return t;var i=Gi(t),a=i.get(r.escapedName);return a&&ia(a,r)?a:e.forEachEntry(i,(function(e){if(ia(e,r))return e}))}function ia(e,t){if(Zi(Ei(Zi(e)))===Zi(Ei(Zi(t))))return e}function aa(e){return Zi(e&&0!=(1048576&e.flags)?e.exportSymbol:e)}function oa(e){return !!(111551&e.flags||2097152&e.flags&&111551&ki(e).flags&&!Ai(e))}function sa(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r];if(170===i.kind&&e.nodeIsPresent(i.body))return i}}function ca(t){var n=new m(de,t);return v++,n.id=v,r&&(null===e.tracing||void 0===e.tracing||e.tracing.recordType(n)),n}function la(e){return new m(de,e)}function ua(e,t,r){void 0===r&&(r=0);var n=ca(e);return n.intrinsicName=t,n.objectFlags=r,n}function _a(e,t){var r=ca(524288);return r.objectFlags=e,r.symbol=t,r.members=void 0,r.properties=void 0,r.callSignatures=void 0,r.constructSignatures=void 0,r.indexInfos=void 0,r}function da(e){var t=ca(262144);return e&&(t.symbol=e),t}function pa(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&95!==e.charCodeAt(2)&&64!==e.charCodeAt(2)&&35!==e.charCodeAt(2)}function fa(t){var r;return t.forEach((function(e,t){ga(e,t)&&(r||(r=[])).push(e);})),r||e.emptyArray}function ga(e,t){return !pa(t)&&oa(e)}function ma(t,r,n,i,a){var o=t;return o.members=r,o.properties=e.emptyArray,o.callSignatures=n,o.constructSignatures=i,o.indexInfos=a,r!==k&&(o.properties=fa(r)),o}function ya(e,t,r,n,i){return ma(_a(16,e),t,r,n,i)}function va(t,r){for(var n,i=function(t){if(t.locals&&!Xn(t)&&(n=r(t.locals,void 0,!0,t)))return {value:n};switch(t.kind){case 303:if(!e.isExternalOrCommonJsModule(t))break;case 260:var i=$i(t);if(n=r((null==i?void 0:i.exports)||k,void 0,!0,t))return {value:n};break;case 256:case 225:case 257:var a;if(($i(t).members||k).forEach((function(t,r){788968&t.flags&&(a||(a=e.createSymbolTable())).set(r,t);})),a&&(n=r(a,void 0,!1,t)))return {value:n}}},a=t;a;a=a.parent){var o=i(a);if("object"==typeof o)return o.value}return r(oe,void 0,!0)}function ha(e){return 111551===e?111551:1920}function ba(t,r,n,i,a){if(void 0===a&&(a=new e.Map),t&&!function(e){if(e.declarations&&e.declarations.length){for(var t=0,r=e.declarations;t<r.length;t++)switch(r[t].kind){case 166:case 168:case 171:case 172:continue;default:return !1}return !0}return !1}(t)){var o=Gn(t),s=o.accessibleChainCache||(o.accessibleChainCache=new e.Map),c=va(r,(function(e,t,r,n){return n})),l="".concat(i?0:1,"|").concat(c&&O(c),"|").concat(n);if(s.has(l))return s.get(l);var u=M(t),_=a.get(u);_||a.set(u,_=[]);var d=va(r,p);return s.set(l,d),d}function p(n,a,o){if(e.pushIfUnique(_,n)){var s=function(n,a,o){return g(n.get(t.escapedName),void 0,a)?[t]:e.forEachEntry(n,(function(n){if(2097152&n.flags&&"export="!==n.escapedName&&"default"!==n.escapedName&&!(e.isUMDExportSymbol(n)&&r&&e.isExternalModule(e.getSourceFileOfNode(r)))&&(!i||e.some(n.declarations,e.isExternalModuleImportEqualsDeclaration))&&(!o||!e.some(n.declarations,e.isNamespaceReexportDeclaration))&&(a||!e.getDeclarationOfKind(n,274))){var s=m(n,ki(n),a);if(s)return s}if(n.escapedName===t.escapedName&&n.exportSymbol&&g(Zi(n.exportSymbol),void 0,a))return [t]}))||(n===oe?m(ce,ce,a):void 0)}(n,a,o);return _.pop(),s}}function f(e,t){return !xa(e,r,t)||!!ba(e.parent,r,ha(t),i,a)}function g(r,i,a){return (t===(i||r)||Zi(t)===Zi(i||r))&&!e.some(r.declarations,Aa)&&(a||f(Zi(r),n))}function m(e,t,r){if(g(e,t,r))return [e];var i=Gi(t),a=i&&p(i,!0);return a&&f(e,ha(n))?[e].concat(a):void 0}}function xa(t,r,n){var i=!1;return va(r,(function(r){var a=Zi(r.get(t.escapedName));return !!a&&(a===t||!!((a=2097152&a.flags&&!e.getDeclarationOfKind(a,274)?ki(a):a).flags&n)&&(i=!0,!0))})),i}function Da(e,t){return 0===ka(e,t,788968,!1,!0).accessibility}function Sa(e,t){return 0===ka(e,t,111551,!1,!0).accessibility}function Ta(e,t,r){return 0===ka(e,t,r,!1,!1).accessibility}function Ca(t,r,n,i,a,o){if(e.length(t)){for(var s,c=!1,l=0,u=t;l<u.length;l++){var _=u[l],d=ba(_,r,i,!1);if(d){s=_;var p=Pa(d[0],a);if(p)return p}if(o&&e.some(_.declarations,Aa)){if(a){c=!0;continue}return {accessibility:0}}var f=Ca(ta(_,r,i),r,n,n===_?ha(i):i,a,o);if(f)return f}return c?{accessibility:0}:s?{accessibility:1,errorSymbolName:Ia(n,r,i),errorModuleName:s!==n?Ia(s,r,1920):void 0}:void 0}}function Ea(e,t,r,n){return ka(e,t,r,n,!0)}function ka(t,r,n,i,a){if(t&&r){var o=Ca([t],r,t,n,i,a);if(o)return o;var s=e.forEach(t.declarations,Na);return s&&s!==Na(r)?{accessibility:2,errorSymbolName:Ia(t,r,n),errorModuleName:Ia(s),errorNode:e.isInJSFile(r)?r:void 0}:{accessibility:1,errorSymbolName:Ia(t,r,n)}}return {accessibility:0}}function Na(t){var r=e.findAncestor(t,Fa);return r&&$i(r)}function Fa(t){return e.isAmbientModule(t)||303===t.kind&&e.isExternalOrCommonJsModule(t)}function Aa(t){return e.isModuleWithStringLiteralName(t)||303===t.kind&&e.isExternalOrCommonJsModule(t)}function Pa(t,r){var n;if(e.every(e.filter(t.declarations,(function(e){return 79!==e.kind})),(function(r){var n,a;if(!Ha(r)){var o=_i(r);return o&&!e.hasSyntacticModifier(o,1)&&Ha(o.parent)?i(r,o):e.isVariableDeclaration(r)&&e.isVariableStatement(r.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent,1)&&Ha(r.parent.parent.parent)?i(r,r.parent.parent):e.isLateVisibilityPaintedStatement(r)&&!e.hasSyntacticModifier(r,1)&&Ha(r.parent)?i(r,r):!!(2097152&t.flags&&e.isBindingElement(r)&&e.isInJSFile(r)&&(null===(n=r.parent)||void 0===n?void 0:n.parent)&&e.isVariableDeclaration(r.parent.parent)&&(null===(a=r.parent.parent.parent)||void 0===a?void 0:a.parent)&&e.isVariableStatement(r.parent.parent.parent.parent)&&!e.hasSyntacticModifier(r.parent.parent.parent.parent,1)&&r.parent.parent.parent.parent.parent&&Ha(r.parent.parent.parent.parent.parent))&&i(r,r.parent.parent.parent.parent)}return !0})))return {accessibility:0,aliasesToMakeVisible:n};function i(t,i){return r&&(Qn(t).isVisible=!0,n=e.appendIfUnique(n,i)),!0}}function wa(t,r){var n;n=180===t.parent.kind||e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)||161===t.parent.kind?1160127:160===t.kind||205===t.kind||264===t.parent.kind?1920:788968;var i=e.getFirstIdentifier(t),a=ei(r,i.escapedText,n,void 0,void 0,!1);return a&&262144&a.flags&&788968&n?{accessibility:0}:a&&Pa(a,!0)||{accessibility:1,errorSymbolName:e.getTextOfNode(i),errorNode:i}}function Ia(t,r,n,i,a){void 0===i&&(i=4);var o=70221824;2&i&&(o|=128),1&i&&(o|=512),8&i&&(o|=16384),16&i&&(o|=134217728);var s=4&i?ae.symbolToExpression:ae.symbolToEntityName;return a?c(a).getText():e.usingSingleLineStringWriter(c);function c(i){var a=s(t,n,r,o),c=303===(null==r?void 0:r.kind)?e.createPrinter({removeComments:!0,neverAsciiEscape:!0}):e.createPrinter({removeComments:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,a,l,i),i}}function Oa(t,r,n,i,a){return void 0===n&&(n=0),a?o(a).getText():e.usingSingleLineStringWriter(o);function o(a){var o;o=262144&n?1===i?179:178:1===i?174:173;var s=ae.signatureToSignatureDeclaration(t,o,r,70222336|ja(n)),c=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0}),l=r&&e.getSourceFileOfNode(r);return c.writeNode(4,s,l,e.getTrailingSemicolonDeferringWriter(a)),a}}function Ma(t,r,n,i){void 0===n&&(n=1064960),void 0===i&&(i=e.createTextWriter(""));var a=U.noErrorTruncation||1&n,o=ae.typeToTypeNode(t,r,70221824|ja(n)|(a?1:0),i);if(void 0===o)return e.Debug.fail("should always get typenode");var s={removeComments:t!==Le},c=e.createPrinter(s),l=r&&e.getSourceFileOfNode(r);c.writeNode(4,o,l,i);var u=i.getText(),_=a?2*e.noTruncationMaximumTruncationLength:2*e.defaultMaximumTruncationLength;return _&&u&&u.length>=_?u.substr(0,_-"...".length)+"...":u}function La(e,t){var r=Ba(e.symbol)?Ma(e,e.symbol.valueDeclaration):Ma(e),n=Ba(t.symbol)?Ma(t,t.symbol.valueDeclaration):Ma(t);return r===n&&(r=Ra(e),n=Ra(t)),[r,n]}function Ra(e){return Ma(e,void 0,64)}function Ba(t){return t&&!!t.valueDeclaration&&e.isExpression(t.valueDeclaration)&&!Ud(t.valueDeclaration)}function ja(e){return void 0===e&&(e=0),814775659&e}function Ja(t){return !!(t.symbol&&32&t.symbol.flags&&(t===ss(t.symbol)||524288&t.flags&&16777216&e.getObjectFlags(t)))}function za(t,r,n,i){return void 0===n&&(n=16384),i?a(i).getText():e.usingSingleLineStringWriter(a);function a(i){var a=e.factory.createTypePredicateNode(2===t.kind||3===t.kind?e.factory.createToken(128):void 0,1===t.kind||3===t.kind?e.factory.createIdentifier(t.parameterName):e.factory.createThisTypeNode(),t.type&&ae.typeToTypeNode(t.type,r,70222336|ja(n))),o=e.createPrinter({removeComments:!0}),s=r&&e.getSourceFileOfNode(r);return o.writeNode(4,a,s,i),i}}function Ua(e){return 8===e?"private":16===e?"protected":"public"}function Ka(t){return t&&t.parent&&261===t.parent.kind&&e.isExternalModuleAugmentation(t.parent.parent)}function Va(t){return 303===t.kind||e.isAmbientModule(t)}function qa(t,r){var n=Gn(t).nameType;if(n){if(384&n.flags){var i=""+n.value;return e.isIdentifierText(i,e.getEmitScriptTarget(U))||ky(i)?ky(i)&&e.startsWith(i,"-")?"[".concat(i,"]"):i:'"'.concat(e.escapeString(i,34),'"')}if(8192&n.flags)return "[".concat(Wa(n.symbol,r),"]")}}function Wa(t,r){if(r&&"default"===t.escapedName&&!(16384&r.flags)&&(!(16777216&r.flags)||!t.declarations||r.enclosingDeclaration&&e.findAncestor(t.declarations[0],Va)!==e.findAncestor(r.enclosingDeclaration,Va)))return "default";if(t.declarations&&t.declarations.length){var n=e.firstDefined(t.declarations,(function(t){return e.getNameOfDeclaration(t)?t:void 0})),i=n&&e.getNameOfDeclaration(n);if(n&&i){if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n))return e.symbolName(t);if(e.isComputedPropertyName(i)&&!(4096&e.getCheckFlags(t))){var a=Gn(t).nameType;if(a&&384&a.flags){var o=qa(t,r);if(void 0!==o)return o}}return e.declarationNameToString(i)}if(n||(n=t.declarations[0]),n.parent&&253===n.parent.kind)return e.declarationNameToString(n.parent.name);switch(n.kind){case 225:case 212:case 213:return !r||r.encounteredError||131072&r.flags||(r.encounteredError=!0),225===n.kind?"(Anonymous class)":"(Anonymous function)"}}var s=qa(t,r);return void 0!==s?s:e.symbolName(t)}function Ha(t){if(t){var r=Qn(t);return void 0===r.isVisible&&(r.isVisible=!!function(){switch(t.kind){case 336:case 343:case 337:return !!(t.parent&&t.parent.parent&&t.parent.parent.parent&&e.isSourceFile(t.parent.parent.parent));case 202:return Ha(t.parent.parent);case 253:if(e.isBindingPattern(t.name)&&!t.name.elements.length)return !1;case 260:case 256:case 257:case 258:case 255:case 259:case 264:if(e.isExternalModuleAugmentation(t))return !0;var r=$a(t);return 1&e.getCombinedModifierFlags(t)||264!==t.kind&&303!==r.kind&&8388608&r.flags?Ha(r):Xn(r);case 166:case 165:case 171:case 172:case 168:case 167:if(e.hasEffectiveModifier(t,24))return !1;case 170:case 174:case 173:case 175:case 163:case 261:case 178:case 179:case 181:case 177:case 182:case 183:case 186:case 187:case 190:case 196:return Ha(t.parent);case 266:case 267:case 269:return !1;case 162:case 303:case 263:return !0;case 270:default:return !1}}()),r.isVisible}return !1}function Ga(t,r){var n,i,a;return t.parent&&270===t.parent.kind?n=ei(t,t.escapedText,2998271,void 0,t,!1):274===t.parent.kind&&(n=Di(t.parent,2998271)),n&&((a=new e.Set).add(M(n)),function t(n){e.forEach(n,(function(n){var o=_i(n)||n;if(r?Qn(n).isVisible=!0:(i=i||[],e.pushIfUnique(i,o)),e.isInternalModuleImportEqualsDeclaration(n)){var s=n.moduleReference,c=ei(n,e.getFirstIdentifier(s).escapedText,901119,void 0,void 0,!1);c&&a&&e.tryAddToSet(a,M(c))&&t(c.declarations);}}));}(n.declarations)),i}function Qa(e,t){var r=Xa(e,t);if(r>=0){for(var n=Qr.length,i=r;i<n;i++)Xr[i]=!1;return !1}return Qr.push(e),Xr.push(!0),Yr.push(t),!0}function Xa(e,t){for(var r=Qr.length-1;r>=0;r--){if(Ya(Qr[r],Yr[r]))return -1;if(Qr[r]===e&&Yr[r]===t)return r}return -1}function Ya(t,r){switch(r){case 0:return !!Gn(t).type;case 5:return !!Qn(t).resolvedEnumType;case 2:return !!Gn(t).declaredType;case 1:return !!t.resolvedBaseConstructorType;case 3:return !!t.resolvedReturnType;case 4:return !!t.immediateBaseConstraint;case 6:return !!t.resolvedTypeArguments;case 7:return !!t.baseTypesResolved}return e.Debug.assertNever(r)}function Za(){return Qr.pop(),Yr.pop(),Xr.pop()}function $a(t){return e.findAncestor(e.getRootDeclaration(t),(function(e){switch(e.kind){case 253:case 254:case 269:case 268:case 267:case 266:return !1;default:return !0}})).parent}function eo(e,t){var r=Jc(e,t);return r?Uo(r):void 0}function to(e){return e&&0!=(1&e.flags)}function ro(e){return e===Me||!!(1&e.flags&&e.aliasSymbol)}function no(e){var t=$i(e);return t&&Gn(t).type||mo(e,!1)}function io(t,r,n){if(131072&(t=om(t,(function(e){return !(98304&e.flags)}))).flags)return mt;if(1048576&t.flags)return lm(t,(function(e){return io(e,r,n)}));var i=qu(e.map(r,i_));if(x_(t)||D_(i)){if(131072&i.flags)return t;var a=(gr||(gr=lu("Omit",2,!0)||Ne),gr===Ne?void 0:gr);return a?Vl(a,[t,i]):Me}for(var o=e.createSymbolTable(),s=0,c=yc(t);s<c.length;s++){var l=c[s];Yd(a_(l,8576),i)||24&e.getDeclarationModifierFlagsFromSymbol(l)||!Z_(l)||o.set(l.escapedName,$_(l,!1));}var u=ya(n,o,e.emptyArray,e.emptyArray,Hc(t));return u.objectFlags|=8388608,u}function ao(e){return !!(465829888&e.flags)&&Eb(Tc(e)||je,32768)}function oo(e){return Jg(im(e,ao)?lm(e,(function(e){return 465829888&e.flags?Cc(e):e})):e,524288)}function so(e,t){var r=co(e);return r?Pm(r,t):t}function co(t){var r=function(e){var t=e.parent.parent;switch(t.kind){case 202:case 294:return co(t);case 203:return co(e.parent);case 253:return t.initializer;case 220:return t.right}}(t);if(r&&r.flowNode){var n=lo(t);if(n){var i=e.setTextRange(e.parseNodeFactory.createStringLiteral(n),t),a=e.isLeftHandSideExpression(r)?r:e.parseNodeFactory.createParenthesizedExpression(r),o=e.setTextRange(e.parseNodeFactory.createElementAccessExpression(a,i),t);return e.setParent(i,o),e.setParent(o,t),a!==r&&e.setParent(a,o),o.flowNode=r.flowNode,o}}}function lo(e){var t=e.parent;return 202===e.kind&&200===t.kind?uo(e.propertyName||e.name):294===e.kind||295===e.kind?uo(e.name):""+t.elements.indexOf(e)}function uo(e){var t=i_(e);return 384&t.flags?""+t.value:void 0}function _o(t){var r,n=t.parent,i=no(n.parent);if(!i||to(i))return i;if(H&&8388608&t.flags&&e.isParameterDeclaration(t)?i=Sf(i):!H||!n.parent.initializer||65536&jg(Qg(n.parent.initializer))||(i=Jg(i,524288)),200===n.kind)if(t.dotDotDotToken){if(2&(i=Mc(i)).flags||!wy(i))return In(t,e.Diagnostics.Rest_types_may_only_be_created_from_object_types),Me;for(var a=[],o=0,s=n.elements;o<s.length;o++){var c=s[o];c.dotDotDotToken||a.push(c.propertyName||c.name);}r=io(i,a,t.symbol);}else {var l=t.propertyName||t.name;r=so(t,F_(i,i_(l),32,l));}else {var u=hD(65|(t.dotDotDotToken?0:128),i,ze,n),_=n.elements.indexOf(t);r=t.dotDotDotToken?am(i,_f)?lm(i,(function(e){return Ou(e,_)})):Tu(u):Qp(i)?so(t,P_(i,ad(_),32|(Sy(t)?16:0),t.name)||Me):u;}return t.initializer?e.getEffectiveTypeAnnotationNode(e.walkUpBindingElementsAndPatterns(t))?!H||32768&vf(Kb(t))?r:oo(r):Vb(t,qu([oo(r),Kb(t)],2)):r}function po(t){var r=e.getJSDocType(t);if(r)return dd(r)}function fo(t){var r=e.skipParentheses(t,!0);return 203===r.kind&&0===r.elements.length}function go(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!0),H&&r?Df(e,t):e}function mo(t,r){if(e.isVariableDeclaration(t)&&242===t.parent.parent.kind){var n=c_(ov(ax(t.parent.parent.expression)));return 4456448&n.flags?l_(n):He}if(e.isVariableDeclaration(t)&&243===t.parent.parent.kind)return vD(t.parent.parent)||we;if(e.isBindingPattern(t.parent))return _o(t);var i,a,o=e.isPropertyDeclaration(t)||e.isPropertySignature(t),s=r&&(o&&!!t.questionToken||e.isParameter(t)&&(!!t.questionToken||tl(t))||il(t)),c=wo(t);if(c)return go(c,o,s);if((Y||e.isInJSFile(t))&&e.isVariableDeclaration(t)&&!e.isBindingPattern(t.name)&&!(1&e.getCombinedModifierFlags(t))&&!(8388608&t.flags)){if(!(2&e.getCombinedNodeFlags(t)||t.initializer&&(i=t.initializer,a=e.skipParentheses(i,!0),104!==a.kind&&(79!==a.kind||Sg(a)!==se))))return Ie;if(t.initializer&&fo(t.initializer))return Kt}if(e.isParameter(t)){var l=t.parent;if(172===l.kind&&As(l)){var u=e.getDeclarationOfKind($i(t.parent),171);if(u){var _=cl(u),d=jT(l);return d&&t===d?(e.Debug.assert(!d.type),Uo(_.thisParameter)):ml(_)}}if(e.isInJSFile(t)){var p=e.getJSDocType(l);if(p&&e.isFunctionTypeNode(p)){var f=cl(p),g=l.parameters.indexOf(t);return t.dotDotDotToken?Yh(f,g):Qh(f,g)}}if(v="this"===t.symbol.escapedName?Zm(l):$m(t))return go(v,!1,s)}if(e.hasOnlyExpressionInitializer(t)&&t.initializer){if(e.isInJSFile(t)&&!e.isParameter(t)){var m=So(t,$i(t),e.getDeclaredExpandoInitializer(t));if(m)return m}return go(v=Vb(t,Kb(t)),o,s)}if(e.isPropertyDeclaration(t)&&(Y||e.isInJSFile(t))){if(e.hasStaticModifier(t)){var y=e.filter(t.parent.members,e.isClassStaticBlockDeclaration);return (v=y.length?function(t,r){for(var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=0,a=r;i<a.length;i++){var o=a[i],s=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(s.expression,s),e.setParent(s,o),s.flowNode=o.returnFlowNode;var c=xo(s,t);if(!Y||c!==Ie&&c!==Kt||In(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,Ia(t),Ma(c)),!am(c,av))return cD(c)}}(t.symbol,y):2&e.getEffectiveModifierFlags(t)?Bp(t.symbol):void 0)&&go(v,!0,s)}var v,h=sa(t.parent);return (v=h?bo(t.symbol,h):2&e.getEffectiveModifierFlags(t)?Bp(t.symbol):void 0)&&go(v,!0,s)}return e.isJsxAttribute(t)?Ze:e.isBindingPattern(t.name)?No(t.name,!1,!0):void 0}function yo(t){if(t.valueDeclaration&&e.isBinaryExpression(t.valueDeclaration)){var r=Gn(t);return void 0===r.isConstructorDeclaredProperty&&(r.isConstructorDeclaredProperty=!1,r.isConstructorDeclaredProperty=!!ho(t)&&e.every(t.declarations,(function(r){return e.isBinaryExpression(r)&&oy(r)&&(206!==r.left.kind||e.isStringOrNumericLiteralLike(r.left.argumentExpression))&&!To(void 0,r,t,r)}))),r.isConstructorDeclaredProperty}return !1}function vo(t){var r=t.valueDeclaration;return r&&e.isPropertyDeclaration(r)&&!e.getEffectiveTypeAnnotationNode(r)&&!r.initializer&&(Y||e.isInJSFile(r))}function ho(t){if(t.declarations)for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=e.getThisContainer(i,!1);if(a&&(170===a.kind||Fh(a)))return a}}function bo(t,r){var n=e.startsWith(t.escapedName,"__#")?e.factory.createPrivateIdentifier(t.escapedName.split("@")[1]):e.unescapeLeadingUnderscores(t.escapedName),i=e.factory.createPropertyAccessExpression(e.factory.createThis(),n);e.setParent(i.expression,i),e.setParent(i,r),i.flowNode=r.returnFlowNode;var a=xo(i,t);return !Y||a!==Ie&&a!==Kt||In(t.valueDeclaration,e.Diagnostics.Member_0_implicitly_has_an_1_type,Ia(t),Ma(a)),am(a,av)?void 0:cD(a)}function xo(t,r){var n=(null==r?void 0:r.valueDeclaration)&&(!vo(r)||2&e.getEffectiveModifierFlags(r.valueDeclaration))&&Bp(r)||ze;return Pm(t,Ie,n)}function Do(t,r){var n,i=e.getAssignedExpandoInitializer(t.valueDeclaration);if(i){var a=e.getJSDocTypeTag(i);return a&&a.typeExpression?dd(a.typeExpression):t.valueDeclaration&&So(t.valueDeclaration,t,i)||sf(zb(i))}var o=!1,s=!1;if(yo(t)&&(n=bo(t,ho(t))),!n){var c=void 0;if(t.declarations){for(var l=void 0,u=0,_=t.declarations;u<_.length;u++){var d=_[u],p=e.isBinaryExpression(d)||e.isCallExpression(d)?d:e.isAccessExpression(d)?e.isBinaryExpression(d.parent)?d.parent:d:void 0;if(p){var f=e.isAccessExpression(p)?e.getAssignmentDeclarationPropertyAccessKind(p):e.getAssignmentDeclarationKind(p);(4===f||e.isBinaryExpression(p)&&oy(p,f))&&(Eo(p)?o=!0:s=!0),e.isCallExpression(p)||(l=To(l,p,t,d)),l||(c||(c=[])).push(e.isBinaryExpression(p)||e.isCallExpression(p)?Co(t,r,p,f):nt);}}n=l;}if(!n){if(!e.length(c))return Me;var g=o&&t.declarations?function(t,r){return e.Debug.assert(t.length===r.length),t.filter((function(t,n){var i=r[n],a=e.isBinaryExpression(i)?i:e.isBinaryExpression(i.parent)?i.parent:void 0;return a&&Eo(a)}))}(c,t.declarations):void 0;if(s){var m=Bp(t);m&&((g||(g=[])).push(m),o=!0);}n=qu(e.some(g,(function(e){return !!(-98305&e.flags)}))?g:c,2);}}var y=jf(go(n,!1,s&&!o));return t.valueDeclaration&&om(y,(function(e){return !!(-98305&e.flags)}))===nt?(Uf(t.valueDeclaration,we),we):y}function So(t,r,n){var i,a;if(e.isInJSFile(t)&&n&&e.isObjectLiteralExpression(n)&&!n.properties.length){for(var o=e.createSymbolTable();e.isBinaryExpression(t)||e.isPropertyAccessExpression(t);){var s=$i(t);(null===(i=null==s?void 0:s.exports)||void 0===i?void 0:i.size)&&Wn(o,s.exports),t=e.isBinaryExpression(t)?t.parent:t.parent.parent;}var c=$i(t);(null===(a=null==c?void 0:c.exports)||void 0===a?void 0:a.size)&&Wn(o,c.exports);var l=ya(r,o,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=8192,l}}function To(t,r,n,i){var a,o=e.getEffectiveTypeAnnotationNode(r.parent);if(o){var s=jf(dd(o));if(!t)return s;ro(t)||ro(s)||Wd(t,s)||uD(void 0,t,i,s);}if(null===(a=n.parent)||void 0===a?void 0:a.valueDeclaration){var c=e.getEffectiveTypeAnnotationNode(n.parent.valueDeclaration);if(c){var l=Jc(dd(c),n.escapedName);if(l)return Ko(l)}}return t}function Co(t,r,n,i){if(e.isCallExpression(n)){if(r)return Uo(r);var a=zb(n.arguments[2]),o=eo(a,"value");if(o)return o;var s=eo(a,"get");if(s){var c=Qv(s);if(c)return ml(c)}var l=eo(a,"set");if(l){var u=Qv(l);if(u)return nb(u)}return we}if(function(t,r){return e.isPropertyAccessExpression(t)&&108===t.expression.kind&&e.forEachChildRecursively(r,(function(e){return Eg(t,e)}))}(n.left,n.right))return we;var _=r?Uo(r):sf(zb(n.right));if(524288&_.flags&&2===i&&"export="===t.escapedName){var d=pc(_),p=e.createSymbolTable();e.copyEntries(d.members,p);var f=p.size;r&&!r.exports&&(r.exports=e.createSymbolTable()),(r||t).exports.forEach((function(t,r){var n,i=p.get(r);if(i&&i!==t)if(111551&t.flags&&111551&i.flags){if(t.valueDeclaration&&i.valueDeclaration&&e.getSourceFileOfNode(t.valueDeclaration)!==e.getSourceFileOfNode(i.valueDeclaration)){var a=e.unescapeLeadingUnderscores(t.escapedName),o=(null===(n=e.tryCast(i.valueDeclaration,e.isNamedDeclaration))||void 0===n?void 0:n.name)||i.valueDeclaration;e.addRelatedInfo(In(t.valueDeclaration,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(o,e.Diagnostics._0_was_also_declared_here,a)),e.addRelatedInfo(In(o,e.Diagnostics.Duplicate_identifier_0,a),e.createDiagnosticForNode(t.valueDeclaration,e.Diagnostics._0_was_also_declared_here,a));}var s=jn(t.flags|i.flags,r);s.type=qu([Uo(t),Uo(i)]),s.valueDeclaration=i.valueDeclaration,s.declarations=e.concatenate(i.declarations,t.declarations),p.set(r,s);}else p.set(r,Kn(t,i));else p.set(r,t);}));var g=ya(f!==p.size?void 0:d.symbol,p,d.callSignatures,d.constructSignatures,d.indexInfos);return g.objectFlags|=8192&e.getObjectFlags(_),g.symbol&&32&g.symbol.flags&&_===ss(g.symbol)&&(g.objectFlags|=16777216),g}return Zp(_)?(Uf(n,Ut),Ut):_}function Eo(t){var r=e.getThisContainer(t,!1);return 170===r.kind||255===r.kind||212===r.kind&&!e.isPrototypePropertyAssignment(r.parent)}function ko(t,r,n){return t.initializer?go(Vb(t,Kb(t,e.isBindingPattern(t.name)?No(t.name,!0,!1):je))):e.isBindingPattern(t.name)?No(t.name,r,n):(n&&!Po(t)&&Uf(t,we),r?Re:we)}function No(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),200===t.kind?function(t,r,n){var i,a=e.createSymbolTable(),o=262272;e.forEach(t.elements,(function(e){var t=e.propertyName||e.name;if(e.dotDotDotToken)i=Nl(He,we,!1);else {var s=i_(t);if(Es(s)){var c=Ps(s),l=jn(4|(e.initializer?16777216:0),c);l.type=ko(e,r,n),l.bindingElement=e,a.set(l.escapedName,l);}else o|=512;}}));var s=ya(void 0,a,e.emptyArray,e.emptyArray,i?[i]:e.emptyArray);return s.objectFlags|=o,r&&(s.pattern=t,s.objectFlags|=262144),s}(t,r,n):function(t,r,n){var i,a=t.elements,o=e.lastOrUndefined(a),s=o&&202===o.kind&&o.dotDotDotToken?o:void 0;if(0===a.length||1===a.length&&s)return K>=2?(i=we,Du(hu(!0),[i])):Ut;var c=e.map(a,(function(t){return e.isOmittedExpression(t)?we:ko(t,r,n)})),l=e.findLastIndex(a,(function(t){return !(t===s||e.isOmittedExpression(t)||Sy(t))}),a.length-1)+1,u=Au(c,e.map(a,(function(e,t){return e===s?4:t>=l?2:1})));return r&&((u=jl(u)).pattern=t,u.objectFlags|=262144),u}(t,r,n)}function Fo(e,t){return Ao(mo(e,!0),e,t)}function Ao(t,r,n){return t?(4096&t.flags&&(i=r.parent,a=$i(i),(o=Ht||(Ht=cu("SymbolConstructor",!1)))&&a&&a===o)&&(t=cd(r)),n&&Kf(r,t),8192&t.flags&&(e.isBindingElement(r)||!r.type)&&t.symbol!==$i(r)&&(t=tt),jf(t)):(t=e.isParameter(r)&&r.dotDotDotToken?Ut:we,n&&(Po(r)||Uf(r,t)),t);var i,a,o;}function Po(t){var r=e.getRootDeclaration(t);return bx(163===r.kind?r.parent:r)}function wo(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return dd(r)}function Io(t){if(t)return 171===t.kind?e.getEffectiveReturnTypeNode(t):e.getEffectiveSetAccessorTypeAnnotationNode(t)}function Oo(e){var t=Io(e);return t&&dd(t)}function Mo(t){var r=Gn(t);return r.type||(r.type=Lo(t)||e.Debug.fail("Read type of accessor must always produce a type"))}function Lo(t,r){if(void 0===r&&(r=!1),!Qa(t,0))return Me;var n=Ro(t,r);return Za()||(n=we,Y&&In(e.getDeclarationOfKind(t,171),e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,Ia(t))),n}function Ro(t,r){void 0===r&&(r=!1);var n=e.getDeclarationOfKind(t,171),i=e.getDeclarationOfKind(t,172),a=Oo(i);if(r&&a)return c(a,t);if(n&&e.isInJSFile(n)){var o=po(n);if(o)return c(o,t)}var s=Oo(n);return s?c(s,t):a||(n&&n.body?c(_b(n),t):i?(bx(i)||Mn(Y,i,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation,Ia(t)),we):n?(e.Debug.assert(!!n,"there must exist a getter as we are current checking either setter or getter in this function"),bx(n)||Mn(Y,n,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation,Ia(t)),we):void 0);function c(t,r){return 1&e.getCheckFlags(r)?Rd(t,Gn(r).mapper):t}}function Bo(t){var r=rs(ss(t));return 8650752&r.flags?r:2097152&r.flags?e.find(r.types,(function(e){return !!(8650752&e.flags)})):void 0}function jo(t){var r=Gn(t),n=r;if(!r.type){var i=t.valueDeclaration&&Ph(t.valueDeclaration,!1);if(i){var a=Ah(t,i);a&&(t=r=a);}n.type=r.type=function(t){var r=t.valueDeclaration;if(1536&t.flags&&e.isShorthandAmbientModuleSymbol(t))return we;if(r&&(220===r.kind||e.isAccessExpression(r)&&220===r.parent.kind))return Do(t);if(512&t.flags&&r&&e.isSourceFile(r)&&r.commonJsModuleIndicator){var n=zi(t);if(n!==t){if(!Qa(t,0))return Me;var i=Zi(t.exports.get("export=")),a=Do(i,i===n?void 0:n);return Za()?a:zo(t)}}var o=_a(16,t);if(32&t.flags){var s=Bo(t);return s?$u([o,s]):o}return H&&16777216&t.flags?Df(o):o}(t);}return r.type}function Jo(e){var t=Gn(e);return t.type||(t.type=fs(e))}function zo(t){var r=t.valueDeclaration;return e.getEffectiveTypeAnnotationNode(r)?(In(t.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation,Ia(t)),Me):(Y&&(163!==r.kind||r.initializer)&&In(t.valueDeclaration,e.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer,Ia(t)),we)}function Uo(t){var r=e.getCheckFlags(t);return 65536&r?function(t){var r=Gn(t);return r.type||(e.Debug.assertIsDefined(r.deferralParent),e.Debug.assertIsDefined(r.deferralConstituents),r.type=1048576&r.deferralParent.flags?qu(r.deferralConstituents):$u(r.deferralConstituents)),r.type}(t):1&r?function(e){var t=Gn(e);if(!t.type){if(!Qa(e,0))return t.type=Me;var r=Rd(Uo(t.target),t.mapper);Za()||(r=zo(e)),t.type=r;}return t.type}(t):262144&r?function(t){if(!t.type){var r=t.mappedType;if(!Qa(t,0))return r.containsError=!0,Me;var n=Rd(ac(r.target||r),Ed(r.mapper,rc(r),t.keyType)),i=H&&16777216&t.flags&&!Eb(n,49152)?Df(n,!0):524288&t.checkFlags?Af(n):n;Za()||(In(_,e.Diagnostics.Type_of_property_0_circularly_references_itself_in_mapped_type_1,Ia(t),Ma(r)),i=Me),t.type=i;}return t.type}(t):8192&r?function(e){var t=Gn(e);return t.type||(t.type=ig(e.propertyType,e.mappedType,e.constraintType)),t.type}(t):7&t.flags?function(t){var r=Gn(t);if(!r.type){var n=function(t){if(4194304&t.flags)return (r=ms(ea(t))).typeParameters?Bl(r,e.map(r.typeParameters,(function(e){return we}))):r;var r;if(t===_e)return we;if(134217728&t.flags&&t.valueDeclaration){var n=$i(e.getSourceFileOfNode(t.valueDeclaration)),i=jn(n.flags,"exports");i.declarations=n.declarations?n.declarations.slice():[],i.parent=t,i.target=n,n.valueDeclaration&&(i.valueDeclaration=n.valueDeclaration),n.members&&(i.members=new e.Map(n.members)),n.exports&&(i.exports=new e.Map(n.exports));var a=e.createSymbolTable();return a.set("exports",i),ya(t,a,e.emptyArray,e.emptyArray,e.emptyArray)}e.Debug.assertIsDefined(t.valueDeclaration);var o,s=t.valueDeclaration;if(e.isCatchClauseVariableDeclarationOrBindingElement(s)){var c=e.getEffectiveTypeAnnotationNode(s);if(void 0===c)return $?je:we;var l=LS(c);return to(l)||l===je?l:Me}if(e.isSourceFile(s)&&e.isJsonSourceFile(s))return s.statements.length?jf(sf(ax(s.statements[0].expression))):mt;if(!Qa(t,0))return 512&t.flags&&!(67108864&t.flags)?jo(t):zo(t);if(270===s.kind)o=Ao(wo(s)||zb(s.expression),s);else if(e.isBinaryExpression(s)||e.isInJSFile(s)&&(e.isCallExpression(s)||(e.isPropertyAccessExpression(s)||e.isBindableStaticElementAccessExpression(s))&&e.isBinaryExpression(s.parent)))o=Do(t);else if(e.isPropertyAccessExpression(s)||e.isElementAccessExpression(s)||e.isIdentifier(s)||e.isStringLiteralLike(s)||e.isNumericLiteral(s)||e.isClassDeclaration(s)||e.isFunctionDeclaration(s)||e.isMethodDeclaration(s)&&!e.isObjectLiteralMethod(s)||e.isMethodSignature(s)||e.isSourceFile(s)){if(9136&t.flags)return jo(t);o=e.isBinaryExpression(s.parent)?Do(t):wo(s)||we;}else if(e.isPropertyAssignment(s))o=wo(s)||Gb(s);else if(e.isJsxAttribute(s))o=wo(s)||My(s);else if(e.isShorthandPropertyAssignment(s))o=wo(s)||Hb(s.name,0);else if(e.isObjectLiteralMethod(s))o=wo(s)||Qb(s,0);else if(e.isParameter(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isVariableDeclaration(s)||e.isBindingElement(s)||e.isJSDocPropertyLikeTag(s))o=Fo(s,!0);else if(e.isEnumDeclaration(s))o=jo(t);else if(e.isEnumMember(s))o=Jo(t);else {if(!e.isAccessor(s))return e.Debug.fail("Unhandled declaration kind! "+e.Debug.formatSyntaxKind(s.kind)+" for "+e.Debug.formatSymbol(t));o=Ro(t)||e.Debug.fail("Non-write accessor resolution must always produce a type");}return Za()?o:512&t.flags&&!(67108864&t.flags)?jo(t):zo(t)}(t);r.type||(r.type=n);}return r.type}(t):9136&t.flags?jo(t):8&t.flags?Jo(t):98304&t.flags?Mo(t):2097152&t.flags?function(t){var r=Gn(t);if(!r.type){var n=ki(t),i=t.declarations&&Ti(di(t),!0),a=e.firstDefined(null==i?void 0:i.declarations,(function(t){return e.isExportAssignment(t)?wo(t):void 0}));r.type=(null==i?void 0:i.declarations)&&vS(i.declarations)&&t.declarations.length?function(t){var r=e.getSourceFileOfNode(t.declarations[0]),n=e.unescapeLeadingUnderscores(t.escapedName),i=t.declarations.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&e.isModuleExportsAccessExpression(t.expression)})),a=i?e.factory.createPropertyAccessExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("module"),e.factory.createIdentifier("exports")),n):e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),n);return i&&e.setParent(a.expression.expression,a.expression),e.setParent(a.expression,a),e.setParent(a,r),a.flowNode=r.endFlowNode,Pm(a,Ie,ze)}(i):vS(t.declarations)?Ie:a||(111551&n.flags?Uo(n):Me);}return r.type}(t):Me}function Ko(e){return Nf(Uo(e),!!(16777216&e.flags))}function Vo(t,r){return void 0!==t&&void 0!==r&&0!=(4&e.getObjectFlags(t))&&t.target===r}function qo(t){return 4&e.getObjectFlags(t)?t.target:t}function Wo(t,r){return function t(n){if(7&e.getObjectFlags(n)){var i=qo(n);return i===r||e.some(is(i),t)}return !!(2097152&n.flags)&&e.some(n.types,t)}(t)}function Ho(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];t=e.appendIfUnique(t,gs($i(a)));}return t}function Go(t,r){for(;;){if((t=t.parent)&&e.isBinaryExpression(t)){var n=e.getAssignmentDeclarationKind(t);if(6===n||3===n){var i=$i(t.left);i&&i.parent&&!e.findAncestor(i.parent.valueDeclaration,(function(e){return t===e}))&&(t=i.parent.valueDeclaration);}}if(!t)return;switch(t.kind){case 256:case 225:case 257:case 173:case 174:case 167:case 178:case 179:case 315:case 255:case 168:case 212:case 213:case 258:case 342:case 343:case 337:case 336:case 194:case 188:var a=Go(t,r);if(194===t.kind)return e.append(a,gs($i(t.typeParameter)));if(188===t.kind)return e.concatenate(a,z_(t));var o=Ho(a,e.getEffectiveTypeParameterDeclarations(t)),s=r&&(256===t.kind||225===t.kind||257===t.kind||Fh(t))&&ss($i(t)).thisType;return s?e.append(o,s):o;case 338:var c=e.getParameterSymbolFromJSDoc(t);c&&(t=c.valueDeclaration);break;case 318:return a=Go(t,r),t.tags?Ho(a,e.flatMap(t.tags,(function(t){return e.isJSDocTemplateTag(t)?t.typeParameters:void 0}))):a}}}function Qo(t){var r=32&t.flags?t.valueDeclaration:e.getDeclarationOfKind(t,257);return e.Debug.assert(!!r,"Class was missing valueDeclaration -OR- non-class had no interface declarations"),Go(r)}function Xo(t){if(t.declarations){for(var r,n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(257===a.kind||256===a.kind||225===a.kind||Fh(a)||e.isTypeAlias(a)){var o=a;r=Ho(r,e.getEffectiveTypeParameterDeclarations(o));}}return r}}function Yo(e){var t=Uc(e,1);if(1===t.length){var r=t[0];if(!r.typeParameters&&1===r.parameters.length&&J(r)){var n=Kh(r.parameters[0]);return to(n)||Gp(n)===we}}return !1}function Zo(e){if(Uc(e,1).length>0)return !0;if(8650752&e.flags){var t=Tc(e);return !!t&&Yo(t)}return !1}function $o(t){return e.getEffectiveBaseTypeNode(t.symbol.valueDeclaration)}function es(t,r,n){var i=e.length(r),a=e.isInJSFile(n);return e.filter(Uc(t,1),(function(t){return (a||i>=ol(t.typeParameters))&&i<=e.length(t.typeParameters)}))}function ts(t,r,n){var i=es(t,r,n),a=e.map(r,dd);return e.sameMap(i,(function(t){return e.some(t.typeParameters)?bl(t,a,e.isInJSFile(n)):t}))}function rs(t){if(!t.resolvedBaseConstructorType){var r=t.symbol.valueDeclaration,n=e.getEffectiveBaseTypeNode(r),i=$o(t);if(!i)return t.resolvedBaseConstructorType=ze;if(!Qa(t,1))return Me;var a=ax(i.expression);if(n&&i!==n&&(e.Debug.assert(!n.typeArguments),ax(n.expression)),2621440&a.flags&&pc(a),!Za())return In(t.symbol.valueDeclaration,e.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_base_expression,Ia(t.symbol)),t.resolvedBaseConstructorType=Me;if(!(1&a.flags||a===We||Zo(a))){var o=In(i.expression,e.Diagnostics.Type_0_is_not_a_constructor_function_type,Ma(a));if(262144&a.flags){var s=Il(a),c=je;if(s){var l=Uc(s,1);l[0]&&(c=ml(l[0]));}a.symbol.declarations&&e.addRelatedInfo(o,e.createDiagnosticForNode(a.symbol.declarations[0],e.Diagnostics.Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1,Ia(a.symbol),Ma(c)));}return t.resolvedBaseConstructorType=Me}t.resolvedBaseConstructorType=a;}return t.resolvedBaseConstructorType}function ns(t,r){In(t,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Ma(r,void 0,2));}function is(t){if(!t.baseTypesResolved){if(Qa(t,7)&&(8&t.objectFlags?t.resolvedBaseTypes=[as(t)]:96&t.symbol.flags?(32&t.symbol.flags&&function(t){t.resolvedBaseTypes=e.resolvingEmptyArray;var r=Ac(rs(t));if(!(2621441&r.flags))return t.resolvedBaseTypes=e.emptyArray;var n,i=$o(t),a=r.symbol?ms(r.symbol):void 0;if(r.symbol&&32&r.symbol.flags&&function(e){var t=e.outerTypeParameters;if(t){var r=t.length-1,n=zl(e);return t[r].symbol!==n[r].symbol}return !0}(a))n=Kl(i,r.symbol);else if(1&r.flags)n=r;else {var o=ts(r,i.typeArguments,i);if(!o.length)return In(i.expression,e.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments),t.resolvedBaseTypes=e.emptyArray;n=ml(o[0]);}if(ro(n))return t.resolvedBaseTypes=e.emptyArray;var s=Mc(n);if(!os(s)){var c=jc(void 0,n),l=e.chainDiagnosticMessages(c,e.Diagnostics.Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members,Ma(s));return mn.add(e.createDiagnosticForNodeFromMessageChain(i.expression,l)),t.resolvedBaseTypes=e.emptyArray}if(t===s||Wo(s,t))return In(t.symbol.valueDeclaration,e.Diagnostics.Type_0_recursively_references_itself_as_a_base_type,Ma(t,void 0,2)),t.resolvedBaseTypes=e.emptyArray;t.resolvedBaseTypes===e.resolvingEmptyArray&&(t.members=void 0),t.resolvedBaseTypes=[s];}(t),64&t.symbol.flags&&function(t){if(t.resolvedBaseTypes=t.resolvedBaseTypes||e.emptyArray,t.symbol.declarations)for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];if(257===i.kind&&e.getInterfaceBaseTypeNodes(i))for(var a=0,o=e.getInterfaceBaseTypeNodes(i);a<o.length;a++){var s=o[a],c=Mc(dd(s));ro(c)||(os(c)?t===c||Wo(c,t)?ns(i,t):t.resolvedBaseTypes===e.emptyArray?t.resolvedBaseTypes=[c]:t.resolvedBaseTypes.push(c):In(s,e.Diagnostics.An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members));}}}(t)):e.Debug.fail("type must be class or interface"),!Za()&&t.symbol.declarations))for(var r=0,n=t.symbol.declarations;r<n.length;r++){var i=n[r];256!==i.kind&&257!==i.kind||ns(i,t);}t.baseTypesResolved=!0;}return t.resolvedBaseTypes}function as(t){return Tu(qu(e.sameMap(t.typeParameters,(function(e,r){return 8&t.elementFlags[r]?F_(e,Ge):e}))||e.emptyArray),t.readonly)}function os(t){if(262144&t.flags){var r=Tc(t);if(r)return os(r)}return !!(67633153&t.flags&&!dc(t)||2097152&t.flags&&e.every(t.types,os))}function ss(t){var r,n,i,a,o,s=Gn(t),c=s;if(!s.declaredType){var l=32&t.flags?1:2,u=Ah(t,t.valueDeclaration&&((o=(null==(a=null===(n=null==(i=(r=t.valueDeclaration)&&Ph(r,!0))?void 0:i.exports)||void 0===n?void 0:n.get("prototype"))?void 0:a.valueDeclaration)&&function(t){if(!t.parent)return !1;for(var r=t.parent;r&&205===r.kind;)r=r.parent;if(r&&e.isBinaryExpression(r)&&e.isPrototypeAccess(r.left)&&63===r.operatorToken.kind){var n=e.getInitializerOfBinaryExpression(r);return e.isObjectLiteralExpression(n)&&n}}(a.valueDeclaration))?$i(o):void 0));u&&(t=s=u);var _=c.declaredType=s.declaredType=_a(l,t),d=Qo(t),p=Xo(t);(d||p||1===l||!function(t){if(!t.declarations)return !0;for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r];if(257===i.kind){if(128&i.flags)return !1;var a=e.getInterfaceBaseTypeNodes(i);if(a)for(var o=0,s=a;o<s.length;o++){var c=s[o];if(e.isEntityNameExpression(c.expression)){var l=Mi(c.expression,788968,!0);if(!l||!(64&l.flags)||ss(l).thisType)return !1}}}}return !0}(t))&&(_.objectFlags|=4,_.typeParameters=e.concatenate(d,p),_.outerTypeParameters=d,_.localTypeParameters=p,_.instantiations=new e.Map,_.instantiations.set(Ml(_.typeParameters),_),_.target=_,_.resolvedTypeArguments=_.typeParameters,_.thisType=da(t),_.thisType.isThisType=!0,_.thisType.constraint=_);}return s.declaredType}function cs(t){var r,n=Gn(t);if(!n.declaredType){if(!Qa(t,2))return Me;var i=e.Debug.checkDefined(null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias),"Type alias symbol with no valid declaration found"),a=e.isJSDocTypeAlias(i)?i.typeExpression:i.type,o=a?dd(a):Me;if(Za()){var s=Xo(t);s&&(n.typeParameters=s,n.instantiations=new e.Map,n.instantiations.set(Ml(s),o));}else o=Me,337===i.kind?In(i.typeExpression.type,e.Diagnostics.Type_alias_0_circularly_references_itself,Ia(t)):In(e.isNamedDeclaration(i)?i.name:i||i,e.Diagnostics.Type_alias_0_circularly_references_itself,Ia(t));n.declaredType=o;}return n.declaredType}function ls(t){return !!e.isStringLiteralLike(t)||220===t.kind&&ls(t.left)&&ls(t.right)}function us(t){var r=t.initializer;if(!r)return !(8388608&t.flags);switch(r.kind){case 10:case 8:case 14:return !0;case 218:return 40===r.operator&&8===r.operand.kind;case 79:return e.nodeIsMissing(r)||!!$i(t.parent).exports.get(r.escapedText);case 220:return ls(r);default:return !1}}function _s(t){var r=Gn(t);if(void 0!==r.enumKind)return r.enumKind;var n=!1;if(t.declarations)for(var i=0,a=t.declarations;i<a.length;i++){var o=a[i];if(259===o.kind)for(var s=0,c=o.members;s<c.length;s++){var l=c[s];if(l.initializer&&e.isStringLiteralLike(l.initializer))return r.enumKind=1;us(l)||(n=!0);}}return r.enumKind=n?0:1}function ds(e){return 1024&e.flags&&!(1048576&e.flags)?ms(ea(e.symbol)):e}function ps(e){var t=Gn(e);if(t.declaredType)return t.declaredType;if(1===_s(e)){b++;var r=[];if(e.declarations)for(var n=0,i=e.declarations;n<i.length;n++){var a=i[n];if(259===a.kind)for(var o=0,s=a.members;o<s.length;o++){var c=s[o],l=sT(c),u=td(sd(void 0!==l?l:0,b,$i(c)));Gn($i(c)).declaredType=u,r.push(rd(u));}}if(r.length){var _=qu(r,1,e,void 0);return 1048576&_.flags&&(_.flags|=1024,_.symbol=e),t.declaredType=_}}var d=ca(32);return d.symbol=e,t.declaredType=d}function fs(e){var t=Gn(e);if(!t.declaredType){var r=ps(ea(e));t.declaredType||(t.declaredType=r);}return t.declaredType}function gs(e){var t=Gn(e);return t.declaredType||(t.declaredType=da(e))}function ms(e){return ys(e)||Me}function ys(e){return 96&e.flags?ss(e):524288&e.flags?cs(e):262144&e.flags?gs(e):384&e.flags?ps(e):8&e.flags?fs(e):2097152&e.flags?function(e){var t=Gn(e);return t.declaredType||(t.declaredType=ms(ki(e)))}(e):void 0}function vs(e){switch(e.kind){case 130:case 154:case 149:case 146:case 157:case 133:case 150:case 147:case 114:case 152:case 143:case 195:return !0;case 182:return vs(e.elementType);case 177:return !e.typeArguments||e.typeArguments.every(vs)}return !1}function hs(t){var r=e.getEffectiveConstraintOfTypeParameter(t);return !r||vs(r)}function bs(t){var r=e.getEffectiveTypeAnnotationNode(t);return r?vs(r):!e.hasInitializer(t)}function xs(t){if(t.declarations&&1===t.declarations.length){var r=t.declarations[0];if(r)switch(r.kind){case 166:case 165:return bs(r);case 168:case 167:case 170:case 171:case 172:return n=r,i=e.getEffectiveReturnTypeNode(n),a=e.getEffectiveTypeParameterDeclarations(n),(170===n.kind||!!i&&vs(i))&&n.parameters.every(bs)&&a.every(hs)}}var n,i,a;return !1}function Ds(t,r,n){for(var i=e.createSymbolTable(),a=0,o=t;a<o.length;a++){var s=o[a];i.set(s.escapedName,n&&xs(s)?s:Fd(s,r));}return i}function Ss(e,t){for(var r=0,n=t;r<n.length;r++){var i=n[r];e.has(i.escapedName)||Ts(i)||e.set(i.escapedName,i);}}function Ts(t){return !!t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration)&&e.isStatic(t.valueDeclaration)}function Cs(t){if(!t.declaredProperties){var r=t.symbol,n=Os(r);t.declaredProperties=fa(n),t.declaredCallSignatures=e.emptyArray,t.declaredConstructSignatures=e.emptyArray,t.declaredIndexInfos=e.emptyArray,t.declaredCallSignatures=_l(n.get("__call")),t.declaredConstructSignatures=_l(n.get("__new")),t.declaredIndexInfos=Fl(r);}return t}function Es(e){return !!(8576&e.flags)}function ks(t){if(!e.isComputedPropertyName(t)&&!e.isElementAccessExpression(t))return !1;var r=e.isComputedPropertyName(t)?t.expression:t.argumentExpression;return e.isEntityNameExpression(r)&&Es(e.isComputedPropertyName(t)?Ny(t):zb(r))}function Ns(e){return 95===e.charCodeAt(0)&&95===e.charCodeAt(1)&&64===e.charCodeAt(2)}function Fs(t){var r=e.getNameOfDeclaration(t);return !!r&&ks(r)}function As(t){return !e.hasDynamicName(t)||Fs(t)}function Ps(t){return 8192&t.flags?t.escapedName:384&t.flags?e.escapeLeadingUnderscores(""+t.value):e.Debug.fail()}function ws(t,r,n,i){e.Debug.assert(!!i.symbol,"The member is expected to have a symbol.");var a=Qn(i);if(!a.resolvedSymbol){a.resolvedSymbol=i.symbol;var o=e.isBinaryExpression(i)?i.left:i.name,s=e.isElementAccessExpression(o)?zb(o.argumentExpression):Ny(o);if(Es(s)){var c=Ps(s),l=i.symbol.flags,u=n.get(c);u||n.set(c,u=jn(0,c,4096));var _=r&&r.get(c);if(u.flags&Jn(l)||_){var d=_?e.concatenate(_.declarations,u.declarations):u.declarations,p=!(8192&s.flags)&&e.unescapeLeadingUnderscores(c)||e.declarationNameToString(o);e.forEach(d,(function(t){return In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Property_0_was_also_declared_here,p)})),In(o||i,e.Diagnostics.Duplicate_property_0,p),u=jn(0,c,4096);}return u.nameType=s,function(t,r,n){e.Debug.assert(!!(4096&e.getCheckFlags(t)),"Expected a late-bound symbol."),t.flags|=n,Gn(r.symbol).lateSymbol=t,t.declarations?r.symbol.isReplaceableByMethod||t.declarations.push(r):t.declarations=[r],111551&n&&(t.valueDeclaration&&t.valueDeclaration.kind===r.kind||(t.valueDeclaration=r));}(u,i,l),u.parent?e.Debug.assert(u.parent===t,"Existing symbol parent should match new one"):u.parent=t,a.resolvedSymbol=u}}return a.resolvedSymbol}function Is(t,r){var n=Gn(t);if(!n[r]){var i="resolvedExports"===r,a=i?1536&t.flags?Yi(t):t.exports:t.members;n[r]=a||k;for(var o=e.createSymbolTable(),s=0,c=t.declarations||e.emptyArray;s<c.length;s++){var l=c[s],u=e.getMembersOfDeclaration(l);if(u)for(var _=0,d=u;_<d.length;_++){var p=d[_];i===e.hasStaticModifier(p)&&Fs(p)&&ws(t,a,o,p);}}var f=t.assignmentDeclarationMembers;if(f)for(var g=0,m=e.arrayFrom(f.values());g<m.length;g++){p=m[g];var y=e.getAssignmentDeclarationKind(p);i===!(3===y||e.isBinaryExpression(p)&&oy(p,y)||9===y||6===y)&&Fs(p)&&ws(t,a,o,p);}n[r]=function(t,r){if(!(null==t?void 0:t.size))return r;if(!(null==r?void 0:r.size))return t;var n=e.createSymbolTable();return Wn(n,t),Wn(n,r),n}(a,o)||k;}return n[r]}function Os(e){return 6256&e.flags?Is(e,"resolvedMembers"):e.members||k}function Ms(t){if(106500&t.flags&&"__computed"===t.escapedName){var r=Gn(t);if(!r.lateSymbol&&e.some(t.declarations,Fs)){var n=Zi(t.parent);e.some(t.declarations,e.hasStaticModifier)?Gi(n):Os(n);}return r.lateSymbol||(r.lateSymbol=t)}return t}function Ls(t,r,n){if(4&e.getObjectFlags(t)){var i=t.target,a=zl(t);if(e.length(i.typeParameters)===e.length(a)){var o=Bl(i,e.concatenate(a,[r||i.thisType]));return n?Ac(o):o}}else if(2097152&t.flags){var s=e.sameMap(t.types,(function(e){return Ls(e,r,n)}));return s!==t.types?$u(s):t}return n?Ac(t):t}function Rs(t,r,n,i){var a,o,s,c,l;e.rangeEquals(n,i,0,n.length)?(o=r.symbol?Os(r.symbol):e.createSymbolTable(r.declaredProperties),s=r.declaredCallSignatures,c=r.declaredConstructSignatures,l=r.declaredIndexInfos):(a=vd(n,i),o=Ds(r.declaredProperties,a,1===n.length),s=md(r.declaredCallSignatures,a),c=md(r.declaredConstructSignatures,a),l=yd(r.declaredIndexInfos,a));var u=is(r);if(u.length){r.symbol&&o===Os(r.symbol)&&(o=e.createSymbolTable(r.declaredProperties)),ma(t,o,s,c,l);for(var _=e.lastOrUndefined(i),d=0,p=u;d<p.length;d++){var f=p[d],g=_?Ls(Rd(f,a),_):f;Ss(o,yc(g)),s=e.concatenate(s,Uc(g,0)),c=e.concatenate(c,Uc(g,1));var m=g!==we?Hc(g):[Nl(He,we,!1)];l=e.concatenate(l,e.filter(m,(function(e){return !Kc(l,e.keyType)})));}}ma(t,o,s,c,l);}function Bs(e,t,r,n,i,a,o,s){var c=new y(de,s);return c.declaration=e,c.typeParameters=t,c.parameters=n,c.thisParameter=r,c.resolvedReturnType=i,c.resolvedTypePredicate=a,c.minArgumentCount=o,c.resolvedMinArgumentCount=void 0,c.target=void 0,c.mapper=void 0,c.compositeSignatures=void 0,c.compositeKind=void 0,c}function js(e){var t=Bs(e.declaration,e.typeParameters,e.thisParameter,e.parameters,void 0,void 0,e.minArgumentCount,39&e.flags);return t.target=e.target,t.mapper=e.mapper,t.compositeSignatures=e.compositeSignatures,t.compositeKind=e.compositeKind,t}function Js(e,t){var r=js(e);return r.compositeSignatures=t,r.compositeKind=1048576,r.target=void 0,r.mapper=void 0,r}function zs(t,r){if((24&t.flags)===r)return t;t.optionalCallSignatureCache||(t.optionalCallSignatureCache={});var n=8===r?"inner":"outer";return t.optionalCallSignatureCache[n]||(t.optionalCallSignatureCache[n]=function(t,r){e.Debug.assert(8===r||16===r,"An optional call signature can either be for an inner call chain or an outer call chain, but not both.");var n=js(t);return n.flags|=r,n}(t,r))}function Us(t,r){if(J(t)){var n=t.parameters.length-1,i=Uo(t.parameters[n]);if(_f(i))return [a(i,n)];if(!r&&1048576&i.flags&&e.every(i.types,_f))return e.map(i.types,(function(e){return a(e,n)}))}return [t.parameters];function a(r,n){var i=zl(r),a=r.target.labeledElementDeclarations,o=e.map(i,(function(e,i){var o=!!a&&Vh(a[i])||qh(t,n+i,r),s=r.target.elementFlags[i],c=jn(1,o,12&s?32768:2&s?16384:0);return c.type=4&s?Tu(e):e,c}));return e.concatenate(t.parameters.slice(0,n),o)}}function Ks(e,t,r,n,i){for(var a=0,o=e;a<o.length;a++){var s=o[a];if(Kp(s,t,r,n,i,r?Qd:Hd))return s}}function Vs(t,r,n){if(r.typeParameters){if(n>0)return;for(var i=1;i<t.length;i++)if(!Ks(t[i],r,!1,!1,!1))return;return [r]}var a;for(i=0;i<t.length;i++){var o=i===n?r:Ks(t[i],r,!0,!1,!0);if(!o)return;a=e.appendIfUnique(a,o);}return a}function qs(t){for(var r,n,i=0;i<t.length;i++){if(0===t[i].length)return e.emptyArray;t[i].length>1&&(n=void 0===n?i:-1);for(var a=0,o=t[i];a<o.length;a++){var s=o[a];if(!r||!Ks(r,s,!1,!1,!0)){var c=Vs(t,s,i);if(c){var l=s;if(c.length>1){var u=s.thisParameter,_=e.forEach(c,(function(e){return e.thisParameter}));_&&(u=wf(_,$u(e.mapDefined(c,(function(e){return e.thisParameter&&Uo(e.thisParameter)}))))),(l=Js(s,c)).thisParameter=u;}(r||(r=[])).push(l);}}}}if(!e.length(r)&&-1!==n){for(var d=t[void 0!==n?n:0],p=d.slice(),f=function(t){if(t!==d){var r=t[0];if(e.Debug.assert(!!r,"getUnionSignatures bails early on empty signature lists and should not have empty lists on second pass"),!(p=r.typeParameters&&e.some(p,(function(e){return !!e.typeParameters&&!Ws(r.typeParameters,e.typeParameters)}))?void 0:e.map(p,(function(t){return function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=vd(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Zh(e),i=Zh(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=eb(e)||eb(t),l=c&&!eb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Xh(a,_);a===t&&(d=Rd(d,r));var p=Xh(o,_)||je;o===t&&(p=Rd(p,r));var f=$u([d,p]),g=c&&!l&&_===s-1,m=_>=$h(a)&&_>=$h(o),y=_>=n?void 0:qh(e,_),v=_>=i?void 0:qh(t,_),h=jn(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?Tu(f):f,u[_]=h;}if(l){var b=jn(1,"args");b.type=Tu(Qh(o,s)),o===t&&(b.type=Rd(b.type,r)),u[s]=b;}return u}(t,r,n),s=Bs(a,i,function(e,t,r){return e&&t?wf(e,$u([Uo(e),Rd(Uo(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return s.compositeKind=1048576,s.compositeSignatures=e.concatenate(2097152!==t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(s.mapper=2097152!==t.compositeKind&&t.mapper&&t.compositeSignatures?Td(t.mapper,n):n),s}(t,r)}))))return "break"}},g=0,m=t;g<m.length&&"break"!==f(m[g]);g++);r=p;}return r||e.emptyArray}function Ws(t,r){if(e.length(t)!==e.length(r))return !1;if(!t||!r)return !0;for(var n=vd(r,t),i=0;i<t.length;i++){var a=t[i],o=r[i];if(a!==o&&!Wd(Il(a)||je,Rd(Il(o)||je,n)))return !1}return !0}function Hs(t){var r=Hc(t[0]);if(r){for(var n=[],i=function(r){var i=r.keyType;e.every(t,(function(e){return !!Gc(e,i)}))&&n.push(Nl(i,qu(e.map(t,(function(e){return Qc(e,i)}))),e.some(t,(function(e){return Gc(e,i).isReadonly}))));},a=0,o=r;a<o.length;a++)i(o[a]);return n}return e.emptyArray}function Gs(e,t){return e?t?$u([e,t]):e:t}function Qs(t){var r=e.countWhere(t,(function(e){return Uc(e,1).length>0})),n=e.map(t,Yo);if(r>0&&r===e.countWhere(n,(function(e){return e}))){var i=n.indexOf(!0);n[i]=!1;}return n}function Xs(t,r){for(var n=function(r){t&&!e.every(t,(function(e){return !Kp(e,r,!1,!1,!1,Hd)}))||(t=e.append(t,r));},i=0,a=r;i<a.length;i++)n(a[i]);return t}function Ys(t,r,n){if(t)for(var i=0;i<t.length;i++){var a=t[i];if(a.keyType===r.keyType)return t[i]=Nl(a.keyType,n?qu([a.type,r.type]):$u([a.type,r.type]),n?a.isReadonly||r.isReadonly:a.isReadonly&&r.isReadonly),t}return e.append(t,r)}function Zs(e,t,r){return Rd(e,vd([t.indexType,t.objectType],[ad(0),Au([r])]))}function $s(t){if(4194304&t.flags){var r=Ac(t.type);return df(r)?Mu(r):c_(r)}if(16777216&t.flags){if(t.root.isDistributive){var n=t.checkType,i=$s(n);if(i!==n)return Ld(t,Cd(t.root.checkType,i,t.mapper))}return t}return 1048576&t.flags?lm(t,$s):2097152&t.flags?$u(e.sameMap(t.types,$s)):t}function ec(t){return 4096&e.getCheckFlags(t)}function tc(e,t,r,n){for(var i=0,a=yc(e);i<a.length;i++)n(a_(a[i],t));if(1&e.flags)n(He);else for(var o=0,s=Hc(e);o<s.length;o++){var c=s[o];(!r||134217732&c.keyType.flags)&&n(c.keyType);}}function rc(e){return e.typeParameter||(e.typeParameter=gs($i(e.declaration.typeParameter)))}function nc(e){return e.constraintType||(e.constraintType=hc(rc(e))||Me)}function ic(e){return e.declaration.nameType?e.nameType||(e.nameType=Rd(dd(e.declaration.nameType),e.mapper)):void 0}function ac(e){return e.templateType||(e.templateType=e.declaration.type?Rd(go(dd(e.declaration.type),!0,!!(4&lc(e))),e.mapper):Me)}function oc(t){return e.getEffectiveConstraintOfTypeParameter(t.declaration.typeParameter)}function sc(e){var t=oc(e);return 192===t.kind&&140===t.operator}function cc(e){if(!e.modifiersType)if(sc(e))e.modifiersType=Rd(dd(oc(e).type),e.mapper);else {var t=nc(I_(e.declaration)),r=t&&262144&t.flags?hc(t):t;e.modifiersType=r&&4194304&r.flags?Rd(r.type,e.mapper):je;}return e.modifiersType}function lc(e){var t=e.declaration;return (t.readonlyToken?40===t.readonlyToken.kind?2:1:0)|(t.questionToken?40===t.questionToken.kind?8:4:0)}function uc(e){var t=lc(e);return 8&t?-1:4&t?1:0}function _c(e){var t=uc(e),r=cc(e);return t||(dc(r)?uc(r):0)}function dc(t){return !!(32&e.getObjectFlags(t))&&D_(nc(t))}function pc(t){return t.members||(524288&t.flags?4&t.objectFlags?function(t){var r=Cs(t.target),n=e.concatenate(r.typeParameters,[r.thisType]),i=zl(t);Rs(t,r,n,i.length===n.length?i:e.concatenate(i,[t]));}(t):3&t.objectFlags?function(t){Rs(t,Cs(t),e.emptyArray,e.emptyArray);}(t):1024&t.objectFlags?function(t){for(var r=Gc(t.source,He),n=lc(t.mappedType),i=!(1&n),a=4&n?0:16777216,o=r?[Nl(He,ig(r.type,t.mappedType,t.constraintType),i&&r.isReadonly)]:e.emptyArray,s=e.createSymbolTable(),c=0,l=yc(t.source);c<l.length;c++){var u=l[c],_=8192|(i&&Db(u)?8:0),d=jn(4|u.flags&a,u.escapedName,_);if(d.declarations=u.declarations,d.nameType=Gn(u).nameType,d.propertyType=Uo(u),8388608&t.constraintType.type.flags&&262144&t.constraintType.type.objectType.flags&&262144&t.constraintType.type.indexType.flags){var p=t.constraintType.type.objectType,f=Zs(t.mappedType,t.constraintType.type,p);d.mappedType=f,d.constraintType=c_(p);}else d.mappedType=t.mappedType,d.constraintType=t.constraintType;s.set(u.escapedName,d);}ma(t,s,e.emptyArray,e.emptyArray,o);}(t):16&t.objectFlags?function(t){var r=Zi(t.symbol);if(t.target)ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray),ma(t,a=Ds(fc(t.target),t.mapper,!1),n=md(Uc(t.target,0),t.mapper),i=md(Uc(t.target,1),t.mapper),o=yd(Hc(t.target),t.mapper));else if(2048&r.flags){ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray);var n=_l((a=Os(r)).get("__call")),i=_l(a.get("__new"));ma(t,a,n,i,o=Fl(r));}else {var a=k,o=void 0;if(r.exports&&(a=Gi(r),r===ce)){var s=new e.Map;a.forEach((function(e){418&e.flags||s.set(e.escapedName,e);})),a=s;}var c=void 0;if(ma(t,a,e.emptyArray,e.emptyArray,e.emptyArray),32&r.flags){var l=rs(ss(r));11272192&l.flags?Ss(a=e.createSymbolTable(function(t){var r=fa(t),n=kl(t);return n?e.concatenate(r,[n]):r}(a)),yc(l)):l===we&&(c=Nl(He,we,!1));}var u=kl(a);if(u?o=Al(u):(c&&(o=e.append(o,c)),384&r.flags&&(32&ms(r).flags||e.some(t.properties,(function(e){return !!(296&Uo(e).flags)})))&&(o=e.append(o,Ar))),ma(t,a,e.emptyArray,e.emptyArray,o||e.emptyArray),8208&r.flags&&(t.callSignatures=_l(r)),32&r.flags){var _=ss(r);i=r.members?_l(r.members.get("__constructor")):e.emptyArray,16&r.flags&&(i=e.addRange(i.slice(),e.mapDefined(t.callSignatures,(function(e){return Fh(e.declaration)?Bs(e.declaration,e.typeParameters,e.thisParameter,e.parameters,_,void 0,e.minArgumentCount,39&e.flags):void 0})))),i.length||(i=function(t){var r=Uc(rs(t),1),n=e.getClassLikeDeclarationOfSymbol(t.symbol),i=!!n&&e.hasSyntacticModifier(n,128);if(0===r.length)return [Bs(void 0,t.localTypeParameters,void 0,e.emptyArray,t,void 0,0,i?4:0)];for(var a=$o(t),o=e.isInJSFile(a),s=iu(a),c=e.length(s),l=[],u=0,_=r;u<_.length;u++){var d=_[u],p=ol(d.typeParameters),f=e.length(d.typeParameters);if(o||c>=p&&c<=f){var g=f?Dl(d,sl(s,d.typeParameters,p,o)):js(d);g.typeParameters=t.localTypeParameters,g.resolvedReturnType=t,g.flags=i?4|g.flags:-5&g.flags,l.push(g);}}return l}(_)),t.constructSignatures=i;}}}(t):32&t.objectFlags&&function(t){var r,n=e.createSymbolTable();ma(t,k,e.emptyArray,e.emptyArray,e.emptyArray);var i=rc(t),a=nc(t),o=ic(t.target||t),s=ac(t.target||t),c=Ac(cc(t)),l=lc(t),u=ee?128:8576;function _(e){nm(o?Rd(o,Ed(t.mapper,i,e)):e,(function(a){return function(e,a){if(Es(a)){var u=Ps(a),_=n.get(u);if(_)_.nameType=qu([_.nameType,a]),_.keyType=qu([_.keyType,e]);else {var d=Es(e)?Jc(c,Ps(e)):void 0,p=!!(4&l||!(8&l)&&d&&16777216&d.flags),f=!!(1&l||!(2&l)&&d&&Db(d)),g=H&&!p&&d&&16777216&d.flags,m=jn(4|(p?16777216:0),u,262144|(d?ec(d):0)|(f?8:0)|(g?524288:0));m.mappedType=t,m.nameType=a,m.keyType=e,d&&(m.syntheticOrigin=d,m.declarations=o?void 0:d.declarations),n.set(u,m);}}else if(Pl(a)||33&a.flags){var y=Nl(5&a.flags?He:40&a.flags?Ge:a,Rd(s,Ed(t.mapper,i,e)),!!(1&l));r=Ys(r,y,!0);}}(e,a)}));}sc(t)?tc(c,u,ee,_):nm($s(a),_),ma(t,n,e.emptyArray,e.emptyArray,r||e.emptyArray);}(t):1048576&t.flags?function(t){var r=qs(e.map(t.types,(function(e){return e===wt?[kr]:Uc(e,0)}))),n=qs(e.map(t.types,(function(e){return Uc(e,1)}))),i=Hs(t.types);ma(t,k,r,n,i);}(t):2097152&t.flags&&function(t){for(var r,n,i,a=t.types,o=Qs(a),s=e.countWhere(o,(function(e){return e})),c=function(c){var l=t.types[c];if(!o[c]){var u=Uc(l,1);u.length&&s>0&&(u=e.map(u,(function(e){var t=js(e);return t.resolvedReturnType=function(e,t,r,n){for(var i=[],a=0;a<t.length;a++)a===n?i.push(e):r[a]&&i.push(ml(Uc(t[a],1)[0]));return $u(i)}(ml(e),a,o,c),t}))),n=Xs(n,u);}r=Xs(r,Uc(l,0)),i=e.reduceLeft(Hc(l),(function(e,t){return Ys(e,t,!1)}),i);},l=0;l<a.length;l++)c(l);ma(t,k,r||e.emptyArray,n||e.emptyArray,i||e.emptyArray);}(t)),t}function fc(t){return 524288&t.flags?pc(t).properties:e.emptyArray}function gc(e,t){if(524288&e.flags){var r=pc(e).members.get(t);if(r&&oa(r))return r}}function mc(t){if(!t.resolvedProperties){for(var r=e.createSymbolTable(),n=0,i=t.types;n<i.length;n++){for(var a=i[n],o=0,s=yc(a);o<s.length;o++){var c=s[o];if(!r.has(c.escapedName)){var l=Oc(t,c.escapedName);l&&r.set(c.escapedName,l);}}if(1048576&t.flags&&0===Hc(a).length)break}t.resolvedProperties=fa(r);}return t.resolvedProperties}function yc(e){return 3145728&(e=Pc(e)).flags?mc(e):fc(e)}function vc(e){return 262144&e.flags?hc(e):8388608&e.flags?function(e){return Ec(e)?function(e){var t=bc(e.indexType);if(t&&t!==e.indexType){var r=P_(e.objectType,t,e.accessFlags);if(r)return r}var n=bc(e.objectType);if(n&&n!==e.objectType)return P_(n,e.indexType,e.accessFlags)}(e):void 0}(e):16777216&e.flags?function(e){return Ec(e)?Sc(e):void 0}(e):Tc(e)}function hc(e){return Ec(e)?Il(e):void 0}function bc(e){var t=C_(e,!1);return t!==e?t:vc(e)}function xc(e){if(!e.resolvedDefaultConstraint){var t=function(e){return e.resolvedInferredTrueType||(e.resolvedInferredTrueType=e.combinedMapper?Rd(dd(e.root.node.trueType),e.combinedMapper):j_(e))}(e),r=J_(e);e.resolvedDefaultConstraint=to(t)?r:to(r)?t:qu([t,r]);}return e.resolvedDefaultConstraint}function Dc(e){if(e.root.isDistributive&&e.restrictiveInstantiation!==e){var t=C_(e.checkType,!1),r=t===e.checkType?vc(t):t;if(r&&r!==e.checkType){var n=Ld(e,Cd(e.root.checkType,r,e.mapper));if(!(131072&n.flags))return n}}}function Sc(e){return Dc(e)||xc(e)}function Tc(e){if(464781312&e.flags){var t=kc(e);return t!==Dt&&t!==St?t:void 0}return 4194304&e.flags?_t:void 0}function Cc(e){return Tc(e)||e}function Ec(e){return kc(e)!==St}function kc(t){if(t.resolvedBaseConstraint)return t.resolvedBaseConstraint;var r=[];return t.resolvedBaseConstraint=Ls(n(t),t);function n(t){if(!t.immediateBaseConstraint){if(!Qa(t,4))return St;var n=void 0;if((r.length<10||r.length<50&&!jp(t,r,r.length))&&(r.push(t),n=function(t){if(262144&t.flags){var r=Il(t);return t.isThisType||!r?r:i(r)}if(3145728&t.flags){for(var n=[],a=!1,o=0,s=u=t.types;o<s.length;o++){var c=s[o],l=i(c);l?(l!==c&&(a=!0),n.push(l)):a=!0;}return a?1048576&t.flags&&n.length===u.length?qu(n):2097152&t.flags&&n.length?$u(n):void 0:t}if(4194304&t.flags)return _t;if(134217728&t.flags){var u=t.types,_=e.mapDefined(u,i);return _.length===u.length?u_(t.texts,_):He}if(268435456&t.flags)return (r=i(t.type))?d_(t.symbol,r):He;if(8388608&t.flags){var d=i(t.objectType),p=i(t.indexType),f=d&&p&&P_(d,p,t.accessFlags);return f&&i(f)}return 16777216&t.flags?(r=Sc(t))&&i(r):33554432&t.flags?i(t.substitute):t}(C_(t,!1)),r.pop()),!Za()){if(262144&t.flags){var a=wl(t);if(a){var o=In(a,e.Diagnostics.Type_parameter_0_has_a_circular_constraint,Ma(t));!_||e.isNodeDescendantOf(a,_)||e.isNodeDescendantOf(_,a)||e.addRelatedInfo(o,e.createDiagnosticForNode(_,e.Diagnostics.Circularity_originates_in_type_at_this_location));}}n=St;}t.immediateBaseConstraint=n||Dt;}return t.immediateBaseConstraint}function i(e){var t=n(e);return t!==Dt&&t!==St?t:void 0}}function Nc(t){if(t.default)t.default===Tt&&(t.default=St);else if(t.target){var r=Nc(t.target);t.default=r?Rd(r,t.mapper):Dt;}else {t.default=Tt;var n=t.symbol&&e.forEach(t.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default})),i=n?dd(n):Dt;t.default===Tt&&(t.default=i);}return t.default}function Fc(e){var t=Nc(e);return t!==Dt&&t!==St?t:void 0}function Ac(t){var r=465829888&t.flags?Tc(t)||je:t;return 32&e.getObjectFlags(r)?function(e){return e.resolvedApparentType||(e.resolvedApparentType=function(e){var t=Pd(e);if(t&&!e.declaration.nameType){var r=hc(t);if(r&&(qp(r)||_f(r)))return Rd(e,Cd(t,r,e.mapper))}return e}(e))}(r):2097152&r.flags?function(e){return e.resolvedApparentType||(e.resolvedApparentType=Ls(e,e,!0))}(r):402653316&r.flags?Rt:296&r.flags?Bt:2112&r.flags?yr||(yr=_u("BigInt",0,K>=7))||mt:528&r.flags?jt:12288&r.flags?gu(K>=2):67108864&r.flags?mt:4194304&r.flags?_t:2&r.flags&&!H?mt:r}function Pc(e){return Mc(Ac(Mc(e)))}function wc(t,r,n){for(var i,a,o,s,c,l=1048576&t.flags,u=l?0:16777216,_=4,d=l?0:8,p=!1,f=0,g=t.types;f<g.length;f++)if(!(ro(F=Ac(g[f]))||131072&F.flags)){var m=(N=Jc(F,r,n))?e.getDeclarationModifierFlagsFromSymbol(N):0;if(N){if(l?u|=16777216&N.flags:u&=N.flags,o){if(N!==o)if((tS(N)||N)===(tS(o)||o)&&-1===Up(o,N,(function(e,t){return e===t?-1:0})))p=!!o.parent&&!!e.length(Xo(o.parent));else {s||(s=new e.Map).set(M(o),o);var y=M(N);s.has(y)||s.set(y,N);}}else o=N;l&&Db(N)?d|=8:l||Db(N)||(d&=-9),d|=(24&m?0:256)|(16&m?512:0)|(8&m?1024:0)|(32&m?2048:0),ev(N)||(_=2);}else if(l){var v=!Ns(r)&&Zc(F,r);v?(d|=32|(v.isReadonly?8:0),c=e.append(c,_f(F)?ff(F)||ze:v.type)):!yg(F)||4194304&e.getObjectFlags(F)?d|=16:(d|=32,c=e.append(c,ze));}}if(o&&!(l&&(s||48&d)&&1536&d)){if(!(s||16&d||c)){if(p){var h=wf(o,o.type);return h.parent=null===(a=null===(i=o.valueDeclaration)||void 0===i?void 0:i.symbol)||void 0===a?void 0:a.parent,h.containingType=t,h.mapper=o.mapper,h}return o}for(var b,x,D,S,T=[],C=!1,E=0,k=s?e.arrayFrom(s.values()):[o];E<k.length;E++){var N=k[E];S?N.valueDeclaration&&N.valueDeclaration!==S&&(C=!0):S=N.valueDeclaration,b=e.addRange(b,N.declarations);var F=Uo(N);x?F!==x&&(d|=64):(x=F,D=Gn(N).nameType),(af(F)||h_(F))&&(d|=128),131072&F.flags&&(d|=131072),T.push(F);}e.addRange(T,c);var A=jn(4|u,r,_|d);return A.containingType=t,!C&&S&&(A.valueDeclaration=S,S.symbol.parent&&(A.parent=S.symbol.parent)),A.declarations=b,A.nameType=D,T.length>2?(A.checkFlags|=65536,A.deferralParent=t,A.deferralConstituents=T):A.type=l?qu(T):$u(T),A}}function Ic(t,r,n){var i,a,o=(null===(i=t.propertyCacheWithoutObjectFunctionPropertyAugment)||void 0===i?void 0:i.get(r))||!n?null===(a=t.propertyCache)||void 0===a?void 0:a.get(r):void 0;return o||(o=wc(t,r,n))&&(n?t.propertyCacheWithoutObjectFunctionPropertyAugment||(t.propertyCacheWithoutObjectFunctionPropertyAugment=e.createSymbolTable()):t.propertyCache||(t.propertyCache=e.createSymbolTable())).set(r,o),o}function Oc(t,r,n){var i=Ic(t,r,n);return !i||16&e.getCheckFlags(i)?void 0:i}function Mc(t){return 1048576&t.flags&&33554432&t.objectFlags?t.resolvedReducedType||(t.resolvedReducedType=function(t){var r=e.sameMap(t.types,Mc);if(r===t.types)return t;var n=qu(r);return 1048576&n.flags&&(n.resolvedReducedType=n),n}(t)):2097152&t.flags?(33554432&t.objectFlags||(t.objectFlags|=33554432|(e.some(mc(t),Lc)?67108864:0)),67108864&t.objectFlags?nt:t):t}function Lc(e){return Rc(e)||Bc(e)}function Rc(t){return !(16777216&t.flags||192!=(131264&e.getCheckFlags(t))||!(131072&Uo(t).flags))}function Bc(t){return !t.valueDeclaration&&!!(1024&e.getCheckFlags(t))}function jc(t,r){if(2097152&r.flags&&67108864&e.getObjectFlags(r)){var n=e.find(mc(r),Rc);if(n)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents,Ma(r,void 0,536870912),Ia(n));var i=e.find(mc(r),Bc);if(i)return e.chainDiagnosticMessages(t,e.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some,Ma(r,void 0,536870912),Ia(i))}return t}function Jc(e,t,r){if(524288&(e=Pc(e)).flags){var n=pc(e),i=n.members.get(t);if(i&&oa(i))return i;if(r)return;var a=n===xt?wt:n.callSignatures.length?It:n.constructSignatures.length?Ot:void 0;if(a){var o=gc(a,t);if(o)return o}return gc(Pt,t)}if(3145728&e.flags)return Oc(e,t,r)}function zc(t,r){if(3670016&t.flags){var n=pc(t);return 0===r?n.callSignatures:n.constructSignatures}return e.emptyArray}function Uc(e,t){return zc(Pc(e),t)}function Kc(t,r){return e.find(t,(function(e){return e.keyType===r}))}function Vc(t,r){for(var n,i,a,o=0,s=t;o<s.length;o++){var c=s[o];c.keyType===He?n=c:qc(r,c.keyType)&&(i?(a||(a=[i])).push(c):i=c);}return a?Nl(je,$u(e.map(a,(function(e){return e.type}))),e.reduceLeft(a,(function(e,t){return e&&t.isReadonly}),!0)):i||(n&&qc(r,He)?n:void 0)}function qc(e,t){return Yd(e,t)||t===He&&Yd(e,Ge)||t===Ge&&!!(128&e.flags)&&ky(e.value)}function Wc(t){return 3670016&t.flags?pc(t).indexInfos:e.emptyArray}function Hc(e){return Wc(Pc(e))}function Gc(e,t){return Kc(Hc(e),t)}function Qc(e,t){var r;return null===(r=Gc(e,t))||void 0===r?void 0:r.type}function Xc(e,t){return Hc(e).filter((function(e){return qc(t,e.keyType)}))}function Yc(e,t){return Vc(Hc(e),t)}function Zc(t,r){return Yc(t,Ns(r)?tt:id(e.unescapeLeadingUnderscores(r)))}function $c(t){for(var r,n=0,i=e.getEffectiveTypeParameterDeclarations(t);n<i.length;n++){var a=i[n];r=e.appendIfUnique(r,gs(a.symbol));}return r}function el(e){var t=[];return e.forEach((function(e,r){pa(r)||t.push(e);})),t}function tl(t){return e.isInJSFile(t)&&(t.type&&314===t.type.kind||e.getJSDocParameterTags(t).some((function(e){var t=e.isBracketed,r=e.typeExpression;return t||!!r&&314===r.type.kind})))}function rl(t,r){if(!e.isExternalModuleNameRelative(t)){var n=Yn(oe,'"'+t+'"',512);return n&&r?Zi(n):n}}function nl(t){if(e.hasQuestionToken(t)||il(t)||tl(t))return !0;if(t.initializer){var r=cl(t.parent),n=t.parent.parameters.indexOf(t);return e.Debug.assert(n>=0),n>=$h(r,3)}var i=e.getImmediatelyInvokedFunctionExpression(t.parent);return !!i&&!t.type&&!t.dotDotDotToken&&t.parent.parameters.indexOf(t)>=i.arguments.length}function il(t){if(!e.isJSDocPropertyLikeTag(t))return !1;var r=t.isBracketed,n=t.typeExpression;return r||!!n&&314===n.type.kind}function al(e,t,r,n){return {kind:e,parameterName:t,parameterIndex:r,type:n}}function ol(t){var r,n=0;if(t)for(var i=0;i<t.length;i++)(r=t[i]).symbol&&e.forEach(r.symbol.declarations,(function(t){return e.isTypeParameterDeclaration(t)&&t.default}))||(n=i+1);return n}function sl(t,r,n,i){var a=e.length(r);if(!a)return [];var o=e.length(t);if(i||o>=n&&o<=a){for(var s=t?t.slice():[],c=o;c<a;c++)s[c]=Me;var l=bg(i);for(c=o;c<a;c++){var u=Fc(r[c]);i&&u&&(Wd(u,je)||Wd(u,mt))&&(u=we),s[c]=u?Rd(u,vd(r,s)):l;}return s.length=r.length,s}return t&&t.slice()}function cl(t){var r,n=Qn(t);if(!n.resolvedSignature){var i=[],a=0,o=0,s=void 0,c=!1,l=e.getImmediatelyInvokedFunctionExpression(t),u=e.isJSDocConstructSignature(t);!l&&e.isInJSFile(t)&&e.isValueSignatureDeclaration(t)&&!e.hasJSDocParameterTags(t)&&!e.getJSDocType(t)&&(a|=32);for(var _=u?1:0;_<t.parameters.length;_++){var d=t.parameters[_],p=d.symbol,f=e.isJSDocParameterTag(d)?d.typeExpression&&d.typeExpression.type:d.type;p&&4&p.flags&&!e.isBindingPattern(d.name)&&(p=ei(d,p.escapedName,111551,void 0,void 0,!1)),0===_&&"this"===p.escapedName?(c=!0,s=d.symbol):i.push(p),f&&195===f.kind&&(a|=2),il(d)||d.initializer||d.questionToken||e.isRestParameter(d)||l&&i.length>l.arguments.length&&!f||tl(d)||(o=i.length);}if((171===t.kind||172===t.kind)&&As(t)&&(!c||!s)){var g=171===t.kind?172:171,m=e.getDeclarationOfKind($i(t),g);m&&(s=(r=jT(m))&&r.symbol);}var y=170===t.kind?ss(Zi(t.parent.symbol)):void 0,v=y?y.localTypeParameters:$c(t);(e.hasRestParameter(t)||e.isInJSFile(t)&&function(t,r){if(e.isJSDocSignature(t)||!ul(t))return !1;var n=e.lastOrUndefined(t.parameters),i=n?e.getJSDocParameterTags(n):e.getJSDocTags(t).filter(e.isJSDocParameterTag),a=e.firstDefined(i,(function(t){return t.typeExpression&&e.isJSDocVariadicType(t.typeExpression.type)?t.typeExpression.type:void 0})),o=jn(3,"args",32768);return o.type=a?Tu(dd(a.type)):Ut,a&&r.pop(),r.push(o),!0}(t,i))&&(a|=1),(e.isConstructorTypeNode(t)&&e.hasSyntacticModifier(t,128)||e.isConstructorDeclaration(t)&&e.hasSyntacticModifier(t.parent,128))&&(a|=4),n.resolvedSignature=Bs(t,v,s,i,void 0,void 0,o,a);}return n.resolvedSignature}function ll(t){if(e.isInJSFile(t)&&e.isFunctionLikeDeclaration(t)){var r=e.getJSDocTypeTag(t);return (null==r?void 0:r.typeExpression)&&Qv(dd(r.typeExpression))}}function ul(t){var r=Qn(t);return void 0===r.containsArgumentsReference&&(8192&r.flags?r.containsArgumentsReference=!0:r.containsArgumentsReference=function t(r){if(!r)return !1;switch(r.kind){case 79:return r.escapedText===ue.escapedName&&mT(r)===ue;case 166:case 168:case 171:case 172:return 161===r.name.kind&&t(r.name);case 205:case 206:return t(r.expression);default:return !e.nodeStartsNewLexicalEnvironment(r)&&!e.isPartOfTypeNode(r)&&!!e.forEachChild(r,t)}}(t.body)),r.containsArgumentsReference}function _l(t){if(!t||!t.declarations)return e.emptyArray;for(var r=[],n=0;n<t.declarations.length;n++){var i=t.declarations[n];if(e.isFunctionLike(i)){if(n>0&&i.body){var a=t.declarations[n-1];if(i.parent===a.parent&&i.kind===a.kind&&i.pos===a.end)continue}r.push(cl(i));}}return r}function dl(e){var t=Ri(e,e);if(t){var r=zi(t);if(r)return Uo(r)}return we}function pl(e){if(e.thisParameter)return Uo(e.thisParameter)}function fl(t){if(!t.resolvedTypePredicate){if(t.target){var r=fl(t.target);t.resolvedTypePredicate=r?(o=r,s=t.mapper,al(o.kind,o.parameterName,o.parameterIndex,Rd(o.type,s))):Cr;}else if(t.compositeSignatures)t.resolvedTypePredicate=function(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=fl(a[i]);if(!o||2===o.kind||3===o.kind){if(2097152!==t)continue;return}if(r){if(!Wu(r,o))return}else r=o;n.push(o.type);}if(r){var s=gl(n,t);return al(r.kind,r.parameterName,r.parameterIndex,s)}}(t.compositeSignatures,t.compositeKind)||Cr;else {var n=t.declaration&&e.getEffectiveReturnTypeNode(t.declaration),i=void 0;if(!n&&e.isInJSFile(t.declaration)){var a=ll(t.declaration);a&&t!==a&&(i=fl(a));}t.resolvedTypePredicate=n&&e.isTypePredicateNode(n)?function(t,r){var n=t.parameterName,i=t.type&&dd(t.type);return 191===n.kind?al(t.assertsModifier?2:0,void 0,void 0,i):al(t.assertsModifier?3:1,n.escapedText,e.findIndex(r.parameters,(function(e){return e.escapedName===n.escapedText})),i)}(n,t):i||Cr;}e.Debug.assert(!!t.resolvedTypePredicate);}var o,s;return t.resolvedTypePredicate===Cr?void 0:t.resolvedTypePredicate}function gl(e,t,r){return 2097152!==t?qu(e,r):$u(e)}function ml(t){if(!t.resolvedReturnType){if(!Qa(t,3))return Me;var r=t.target?Rd(ml(t.target),t.mapper):t.compositeSignatures?Rd(gl(e.map(t.compositeSignatures,ml),t.compositeKind,2),t.mapper):yl(t.declaration)||(e.nodeIsMissing(t.declaration.body)?we:_b(t.declaration));if(8&t.flags?r=Tf(r):16&t.flags&&(r=Df(r)),!Za()){if(t.declaration){var n=e.getEffectiveReturnTypeNode(t.declaration);if(n)In(n,e.Diagnostics.Return_type_annotation_circularly_references_itself);else if(Y){var i=t.declaration,a=e.getNameOfDeclaration(i);a?In(a,e.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions,e.declarationNameToString(a)):In(i,e.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);}}r=we;}t.resolvedReturnType=r;}return t.resolvedReturnType}function yl(t){if(170===t.kind)return ss(Zi(t.parent.symbol));if(e.isJSDocConstructSignature(t))return dd(t.parameters[0].type);var r,n=e.getEffectiveReturnTypeNode(t);if(n)return dd(n);if(171===t.kind&&As(t)){var i=e.isInJSFile(t)&&po(t);if(i)return i;var a=Oo(e.getDeclarationOfKind($i(t),172));if(a)return a}return (r=ll(t))&&ml(r)}function vl(e){return !e.resolvedReturnType&&Xa(e,3)>=0}function hl(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]),r=_f(t)?ff(t):t;return r&&Qc(r,Ge)}}function bl(e,t,r,n){var i=xl(e,sl(t,e.typeParameters,ol(e.typeParameters),r));if(n){var a=Xv(ml(i));if(a){var o=js(a);o.typeParameters=n;var s=js(i);return s.resolvedReturnType=Cl(o),s}}return i}function xl(t,r){var n=t.instantiations||(t.instantiations=new e.Map),i=Ml(r),a=n.get(i);return a||n.set(i,a=Dl(t,r)),a}function Dl(e,t){return Nd(e,function(e,t){return vd(e.typeParameters,t)}(e,t),!0)}function Sl(e){return e.typeParameters?e.erasedSignatureCache||(e.erasedSignatureCache=function(e){return Nd(e,Sd(e.typeParameters),!0)}(e)):e}function Tl(t){var r=t.typeParameters;if(r){if(t.baseSignatureCache)return t.baseSignatureCache;for(var n=Sd(r),i=vd(r,e.map(r,(function(e){return hc(e)||je}))),a=e.map(r,(function(e){return Rd(e,i)||je})),o=0;o<r.length-1;o++)a=gd(a,i);return a=gd(a,n),t.baseSignatureCache=Nd(t,vd(r,a),!0)}return t}function Cl(t){if(!t.isolatedSignatureType){var r=t.declaration?t.declaration.kind:0,n=170===r||174===r||179===r,i=_a(16);i.members=k,i.properties=e.emptyArray,i.callSignatures=n?e.emptyArray:[t],i.constructSignatures=n?[t]:e.emptyArray,i.indexInfos=e.emptyArray,t.isolatedSignatureType=i;}return t.isolatedSignatureType}function El(e){return e.members?kl(e.members):void 0}function kl(e){return e.get("__index")}function Nl(e,t,r,n){return {keyType:e,type:t,isReadonly:r,declaration:n}}function Fl(t){var r=El(t);return r?Al(r):e.emptyArray}function Al(t){if(t.declarations){for(var r=[],n=function(t){if(1===t.parameters.length){var n=t.parameters[0];n.type&&nm(dd(n.type),(function(n){Pl(n)&&!Kc(r,n)&&r.push(Nl(n,t.type?dd(t.type):we,e.hasEffectiveModifier(t,64),t));}));}},i=0,a=t.declarations;i<a.length;i++)n(a[i]);return r}return e.emptyArray}function Pl(t){return !!(4108&t.flags)||h_(t)||!!(2097152&t.flags)&&!b_(t)&&e.some(t.types,Pl)}function wl(t){return e.mapDefined(e.filter(t.symbol&&t.symbol.declarations,e.isTypeParameterDeclaration),e.getEffectiveConstraintOfTypeParameter)[0]}function Il(t){if(!t.constraint)if(t.target){var r=hc(t.target);t.constraint=r?Rd(r,t.mapper):Dt;}else {var n=wl(t);if(n){var i=dd(n);1&i.flags&&!ro(i)&&(i=194===n.parent.parent.kind?_t:je),t.constraint=i;}else t.constraint=function(t){var r,n;if(null===(r=t.symbol)||void 0===r?void 0:r.declarations)for(var i=0,a=t.symbol.declarations;i<a.length;i++){var o=a[i];if(189===o.parent.kind){var s=e.walkUpParenthesizedTypesAndGetParentAndChild(o.parent.parent),c=s[0],l=void 0===c?o.parent:c,u=s[1];if(177===u.kind){var _=u,d=yx(_);if(d){var p=_.typeArguments.indexOf(l);if(p<d.length){var f=hc(d[p]);if(f){var g=Rd(f,vd(d,gx(_,d)));g!==t&&(n=e.append(n,g));}}}}else if(163===u.kind&&u.dotDotDotToken||185===u.kind||196===u.kind&&u.dotDotDotToken)n=e.append(n,Tu(je));else if(198===u.kind)n=e.append(n,He);else if(162===u.kind&&194===u.parent.kind)n=e.append(n,_t);else if(194===u.kind&&u.type&&e.skipParentheses(u.type)===o.parent&&188===u.parent.kind&&u.parent.extendsType===u&&194===u.parent.checkType.kind&&u.parent.checkType.type){var m=u.parent.checkType,y=dd(m.type);n=e.append(n,Rd(y,bd(gs($i(m.typeParameter)),m.typeParameter.constraint?dd(m.typeParameter.constraint):_t)));}}}return n&&$u(n)}(t)||Dt;}return t.constraint===Dt?void 0:t.constraint}function Ol(t){var r=e.getDeclarationOfKind(t.symbol,162),n=e.isJSDocTemplateTag(r.parent)?e.getEffectiveContainerForJSDocTemplateTag(r.parent):r.parent;return n&&$i(n)}function Ml(e){var t="";if(e)for(var r=e.length,n=0;n<r;){for(var i=e[n].id,a=1;n+a<r&&e[n+a].id===i+a;)a++;t.length&&(t+=","),t+=i,a>1&&(t+=":"+a),n+=a;}return t}function Ll(e,t){return e?"@".concat(M(e))+(t?":".concat(Ml(t)):""):""}function Rl(t,r){for(var n=0,i=0,a=t;i<a.length;i++){var o=a[i];o.flags&r||(n|=e.getObjectFlags(o));}return 917504&n}function Bl(e,t){var r=Ml(t),n=e.instantiations.get(r);return n||(n=_a(4,e.symbol),e.instantiations.set(r,n),n.objectFlags|=t?Rl(t,0):0,n.target=e,n.resolvedTypeArguments=t),n}function jl(e){var t=ca(e.flags);return t.symbol=e.symbol,t.objectFlags=e.objectFlags,t.target=e.target,t.resolvedTypeArguments=e.resolvedTypeArguments,t}function Jl(e,t,r,n,i){if(!n){var a=H_(n=W_(t));i=r?gd(a,r):a;}var o=_a(4,e.symbol);return o.target=e,o.node=t,o.mapper=r,o.aliasSymbol=n,o.aliasTypeArguments=i,o}function zl(t){var r,n;if(!t.resolvedTypeArguments){if(!Qa(t,6))return (null===(r=t.target.localTypeParameters)||void 0===r?void 0:r.map((function(){return Me})))||e.emptyArray;var i=t.node,a=i?177===i.kind?e.concatenate(t.target.outerTypeParameters,gx(i,t.target.localTypeParameters)):182===i.kind?[dd(i.elementType)]:e.map(i.elements,dd):e.emptyArray;Za()?t.resolvedTypeArguments=t.mapper?gd(a,t.mapper):a:(t.resolvedTypeArguments=(null===(n=t.target.localTypeParameters)||void 0===n?void 0:n.map((function(){return Me})))||e.emptyArray,In(t.node||_,t.target.symbol?e.Diagnostics.Type_arguments_for_0_circularly_reference_themselves:e.Diagnostics.Tuple_type_arguments_circularly_reference_themselves,t.target.symbol&&Ia(t.target.symbol)));}return t.resolvedTypeArguments}function Ul(t){return e.length(t.target.typeParameters)}function Kl(t,r){var n=ms(Zi(r)),i=n.localTypeParameters;if(i){var a=e.length(t.typeArguments),o=ol(i),s=e.isInJSFile(t);if((Y||!s)&&(a<o||a>i.length)){var c=s&&e.isExpressionWithTypeArguments(t)&&!e.isJSDocAugmentsTag(t.parent);if(In(t,o===i.length?c?e.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_1_type_argument_s:c?e.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ma(n,void 0,2),o,i.length),!s)return Me}return 177===t.kind&&ku(t,e.length(t.typeArguments)!==i.length)?Jl(n,t,void 0):Bl(n,e.concatenate(n.outerTypeParameters,sl(iu(t),i,o,s)))}return tu(t,r)?n:Me}function Vl(t,r,n,i){var a=ms(t);if(a===Be&&P.has(t.escapedName)&&r&&1===r.length)return d_(t,r[0]);var o=Gn(t),s=o.typeParameters,c=Ml(r)+Ll(n,i),l=o.instantiations.get(c);return l||o.instantiations.set(c,l=Bd(a,vd(s,sl(r,s,ol(s),e.isInJSFile(t.valueDeclaration))),n,i)),l}function ql(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r.find(e.isTypeAlias);return !(!n||!e.getContainingFunction(n))}function Wl(e){return e.parent?"".concat(Wl(e.parent),".").concat(e.escapedName):e.escapedName}function Hl(e){var t=(160===e.kind?e.right:205===e.kind?e.name:e).escapedText;if(t){var r=160===e.kind?Hl(e.left):205===e.kind?Hl(e.expression):void 0,n=r?"".concat(Wl(r),".").concat(t):t,i=Ae.get(n);return i||(Ae.set(n,i=jn(524288,t,1048576)),i.parent=r,i.declaredType=Le),i}return Ne}function Gl(t,r,n){var i=function(t){switch(t.kind){case 177:return t.typeName;case 227:var r=t.expression;if(e.isEntityNameExpression(r))return r}}(t);if(!i)return Ne;var a=Mi(i,r,n);return a&&a!==Ne?a:n?Ne:Hl(i)}function Ql(t,r){if(r===Ne)return Me;if(96&(r=function(t){var r=t.valueDeclaration;if(r&&e.isInJSFile(r)&&!(524288&t.flags)&&!e.getExpandoInitializer(r,!1)){var n=e.isVariableDeclaration(r)?e.getDeclaredExpandoInitializer(r):e.getAssignedExpandoInitializer(r);if(n){var i=$i(n);if(i)return Ah(i,t)}}}(r)||r).flags)return Kl(t,r);if(524288&r.flags)return function(t,r){if(1048576&e.getCheckFlags(r)){var n=iu(t),i=Ll(r,n),a=Pe.get(i);return a||((a=ua(1,"error")).aliasSymbol=r,a.aliasTypeArguments=n,Pe.set(i,a)),a}var o=ms(r),s=Gn(r).typeParameters;if(s){var c=e.length(t.typeArguments),l=ol(s);if(c<l||c>s.length)return In(t,l===s.length?e.Diagnostics.Generic_type_0_requires_1_type_argument_s:e.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments,Ia(r),l,s.length),Me;var u=W_(t),_=!u||!ql(r)&&ql(u)?void 0:u;return Vl(r,iu(t),_,H_(_))}return tu(t,r)?o:Me}(t,r);var n=ys(r);return n?tu(t,r)?rd(n):Me:111551&r.flags&&eu(t)?function(e,t){var r=Qn(e);if(!r.resolvedJSDocType){var n=Uo(t),i=n;if(t.valueDeclaration){var a=199===e.kind&&e.qualifier;n.symbol&&n.symbol!==t&&a&&(i=Ql(e,n.symbol));}r.resolvedJSDocType=i;}return r.resolvedJSDocType}(t,r)||(Gl(t,788968),Uo(r)):Me}function Xl(e,t){if(3&t.flags||t===e)return e;var r="".concat(Bu(e),">").concat(Bu(t)),n=Te.get(r);if(n)return n;var i=ca(33554432);return i.baseType=e,i.substitute=t,Te.set(r,i),i}function Yl(e){return 183===e.kind&&1===e.elements.length}function Zl(e,t,r){return Yl(t)&&Yl(r)?Zl(e,t.elements[0],r.elements[0]):O_(dd(t))===e?dd(r):void 0}function $l(t,r){for(var n,i=!0;r&&!e.isStatement(r)&&318!==r.kind;){var a=r.parent;if(163===a.kind&&(i=!i),(i||8650752&t.flags)&&188===a.kind&&r===a.trueType){var o=Zl(t,a.checkType,a.extendsType);o&&(n=e.append(n,o));}r=a;}return n?Xl(t,$u(e.append(n,t))):t}function eu(e){return !!(4194304&e.flags)&&(177===e.kind||199===e.kind)}function tu(t,r){return !t.typeArguments||(In(t,e.Diagnostics.Type_0_is_not_generic,r?Ia(r):t.typeName?e.declarationNameToString(t.typeName):l),!1)}function ru(t){if(e.isIdentifier(t.typeName)){var r=t.typeArguments;switch(t.typeName.escapedText){case"String":return tu(t),He;case"Number":return tu(t),Ge;case"Boolean":return tu(t),et;case"Void":return tu(t),rt;case"Undefined":return tu(t),ze;case"Null":return tu(t),qe;case"Function":case"function":return tu(t),wt;case"array":return r&&r.length||Y?void 0:Ut;case"promise":return r&&r.length||Y?void 0:cb(we);case"Object":if(r&&2===r.length){if(e.isJSDocIndexSignature(t)){var n=dd(r[0]),i=dd(r[1]),a=n===He||n===Ge?[Nl(n,i,!1)]:e.emptyArray;return ya(void 0,k,e.emptyArray,e.emptyArray,a)}return we}return tu(t),Y?void 0:we}}}function nu(t){var r=Qn(t);if(!r.resolvedType){if(e.isConstTypeReference(t)&&e.isAssertionExpression(t.parent))return r.resolvedSymbol=Ne,r.resolvedType=zb(t.parent.expression);var n=void 0,i=void 0,a=788968;eu(t)&&((i=ru(t))||((n=Gl(t,a,!0))===Ne?n=Gl(t,900095):Gl(t,a),i=Ql(t,n))),i||(i=Ql(t,n=Gl(t,a))),r.resolvedSymbol=n,r.resolvedType=i;}return r.resolvedType}function iu(t){return e.map(t.typeArguments,dd)}function au(t){var r=Qn(t);if(!r.resolvedType){var n=e.isThisIdentifier(t.exprName)?Wm(t.exprName):ax(t.exprName);r.resolvedType=rd(jf(n));}return r.resolvedType}function ou(t,r){function n(e){var t=e.declarations;if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];switch(i.kind){case 256:case 257:case 259:return i}}}if(!t)return r?bt:mt;var i=ms(t);return 524288&i.flags?e.length(i.typeParameters)!==r?(In(n(t),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(t),r),r?bt:mt):i:(In(n(t),e.Diagnostics.Global_type_0_must_be_a_class_or_interface_type,e.symbolName(t)),r?bt:mt)}function su(t,r){return uu(t,111551,r?e.Diagnostics.Cannot_find_global_value_0:void 0)}function cu(t,r){return uu(t,788968,r?e.Diagnostics.Cannot_find_global_type_0:void 0)}function lu(t,r,n){var i=uu(t,788968,n?e.Diagnostics.Cannot_find_global_type_0:void 0);if(!i||(ms(i),e.length(Gn(i).typeParameters)===r))return i;In(i.declarations&&e.find(i.declarations,e.isTypeAliasDeclaration),e.Diagnostics.Global_type_0_must_have_1_type_parameter_s,e.symbolName(i),r);}function uu(e,t,r){return ei(void 0,e,t,r,e,!1,!1,!1)}function _u(e,t,r){var n=cu(e,r);return n||r?ou(n,t):void 0}function du(){return _r||(_r=_u("ImportMeta",0,!0)||mt)}function pu(e){return pr||(pr=_u("ImportCallOptions",0,e))||mt}function fu(e){return Wt||(Wt=su("Symbol",e))}function gu(e){return Gt||(Gt=_u("Symbol",0,e))||mt}function mu(e){return Xt||(Xt=_u("Promise",1,e))||bt}function yu(e){return Yt||(Yt=_u("PromiseLike",1,e))||bt}function vu(e){return Zt||(Zt=su("Promise",e))}function hu(e){return er||(er=_u("Iterable",1,e))||bt}function bu(e,t){void 0===t&&(t=0);var r=uu(e,788968,void 0);return r&&ou(r,t)}function xu(e){return mr||(mr=lu("Awaited",1,e)||(e?Ne:void 0)),mr===Ne?void 0:mr}function Du(e,t){return e!==bt?Bl(e,t):mt}function Su(e){return Du(Qt||(Qt=_u("TypedPropertyDescriptor",1,!0)||bt),[e])}function Tu(e,t){return Du(t?Lt:Mt,[e])}function Cu(e){switch(e.kind){case 184:return 2;case 185:return Eu(e);case 196:return e.questionToken?2:e.dotDotDotToken?Eu(e):1;default:return 1}}function Eu(e){return _d(e.type)?4:8}function ku(t,r){return !!W_(t)||Nu(t)&&(182===t.kind?Fu(t.elementType):183===t.kind?e.some(t.elements,Fu):r||e.some(t.typeArguments,Fu))}function Nu(e){var t=e.parent;switch(t.kind){case 190:case 196:case 177:case 186:case 187:case 193:case 188:case 192:case 182:case 183:return Nu(t);case 258:return !0}return !1}function Fu(t){switch(t.kind){case 177:return eu(t)||!!(524288&Gl(t,788968).flags);case 180:return !0;case 192:return 153!==t.operator&&Fu(t.type);case 190:case 184:case 196:case 314:case 312:case 313:case 307:return Fu(t.type);case 185:return 182!==t.type.kind||Fu(t.type.elementType);case 186:case 187:return e.some(t.types,Fu);case 193:return Fu(t.objectType)||Fu(t.indexType);case 188:return Fu(t.checkType)||Fu(t.extendsType)||Fu(t.trueType)||Fu(t.falseType)}return !1}function Au(t,r,n,i){void 0===n&&(n=!1);var a=Pu(r||e.map(t,(function(e){return 1})),n,i);return a===bt?mt:t.length?wu(a,t):a}function Pu(t,r,n){if(1===t.length&&4&t[0])return r?Lt:Mt;var i=e.map(t,(function(e){return 1&e?"#":2&e?"?":4&e?".":"*"})).join()+(r?"R":"")+(n&&n.length?","+e.map(n,O).join(","):""),a=fe.get(i);return a||fe.set(i,a=function(t,r,n){var i,a=t.length,o=e.countWhere(t,(function(e){return !!(9&e)})),s=[],c=0;if(a){i=new Array(a);for(var l=0;l<a;l++){var u=i[l]=da(),_=t[l];if(!(12&(c|=_))){var d=jn(4|(2&_?16777216:0),""+l,r?8:0);d.tupleLabelDeclaration=null==n?void 0:n[l],d.type=u,s.push(d);}}}var p=s.length,f=jn(4,"length");if(12&c)f.type=Ge;else {var g=[];for(l=o;l<=a;l++)g.push(ad(l));f.type=qu(g);}s.push(f);var m=_a(12);return m.typeParameters=i,m.outerTypeParameters=void 0,m.localTypeParameters=i,m.instantiations=new e.Map,m.instantiations.set(Ml(m.typeParameters),m),m.target=m,m.resolvedTypeArguments=m.typeParameters,m.thisType=da(),m.thisType.isThisType=!0,m.thisType.constraint=m,m.declaredProperties=s,m.declaredCallSignatures=e.emptyArray,m.declaredConstructSignatures=e.emptyArray,m.declaredIndexInfos=e.emptyArray,m.elementFlags=t,m.minLength=o,m.fixedLength=p,m.hasRestElement=!!(12&c),m.combinedFlags=c,m.readonly=r,m.labeledElementDeclarations=n,m}(t,r,n)),a}function wu(e,t){return 8&e.objectFlags?Iu(e,t):Bl(e,t)}function Iu(t,r){var n,i,a;if(!(14&t.combinedFlags))return Bl(t,r);if(8&t.combinedFlags){var o=e.findIndex(r,(function(e,r){return !!(8&t.elementFlags[r]&&1179648&e.flags)}));if(o>=0)return t_(e.map(r,(function(e,r){return 8&t.elementFlags[r]?e:je})))?lm(r[o],(function(n){return Iu(t,e.replaceElement(r,o,n))})):Me}for(var s=[],c=[],l=[],u=-1,d=-1,p=-1,f=function(o){var c=r[o],l=t.elementFlags[o];if(8&l)if(58982400&c.flags||dc(c))v(c,8,null===(n=t.labeledElementDeclarations)||void 0===n?void 0:n[o]);else if(_f(c)){var u=zl(c);if(u.length+s.length>=1e4)return In(_,e.isPartOfTypeNode(_)?e.Diagnostics.Type_produces_a_tuple_type_that_is_too_large_to_represent:e.Diagnostics.Expression_produces_a_tuple_type_that_is_too_large_to_represent),{value:Me};e.forEach(u,(function(e,t){var r;return v(e,c.target.elementFlags[t],null===(r=c.target.labeledElementDeclarations)||void 0===r?void 0:r[t])}));}else v(Qp(c)&&Qc(c,Ge)||Me,4,null===(i=t.labeledElementDeclarations)||void 0===i?void 0:i[o]);else v(c,l,null===(a=t.labeledElementDeclarations)||void 0===a?void 0:a[o]);},g=0;g<r.length;g++){var m=f(g);if("object"==typeof m)return m.value}for(g=0;g<u;g++)2&c[g]&&(c[g]=1);d>=0&&d<p&&(s[d]=qu(e.sameMap(s.slice(d,p+1),(function(e,t){return 8&c[d+t]?F_(e,Ge):e}))),s.splice(d+1,p-d),c.splice(d+1,p-d),null==l||l.splice(d+1,p-d));var y=Pu(c,t.readonly,l);return y===bt?mt:c.length?Bl(y,s):y;function v(e,t,r){1&t&&(u=c.length),4&t&&d<0&&(d=c.length),6&t&&(p=c.length),s.push(e),c.push(t),l&&r?l.push(r):l=void 0;}}function Ou(t,r,n){void 0===n&&(n=0);var i=t.target,a=Ul(t)-n;return r>i.fixedLength?function(e){var t=ff(e);return t&&Tu(t)}(t)||Au(e.emptyArray):Au(zl(t).slice(r,a),i.elementFlags.slice(r,a),!1,i.labeledElementDeclarations&&i.labeledElementDeclarations.slice(r,a))}function Mu(t){return qu(e.append(e.arrayOf(t.target.fixedLength,(function(e){return id(""+e)})),c_(t.target.readonly?Lt:Mt)))}function Lu(t,r){var n=e.findIndex(t.elementFlags,(function(e){return !(e&r)}));return n>=0?n:t.elementFlags.length}function Ru(t,r){return t.elementFlags.length-e.findLastIndex(t.elementFlags,(function(e){return !(e&r)}))-1}function Bu(e){return e.id}function ju(t,r){return e.binarySearch(t,r,Bu,e.compareValues)>=0}function Ju(t,r){var n=e.binarySearch(t,r,Bu,e.compareValues);return n<0&&(t.splice(~n,0,r),!0)}function zu(t,r,n){var i=n.flags;if(1048576&i)return Uu(t,r|(function(e){return !!(1048576&e.flags&&(e.aliasSymbol||e.origin))}(n)?1048576:0),n.types);if(!(131072&i))if(r|=205258751&i,465829888&i&&(r|=33554432),n===Oe&&(r|=8388608),!H&&98304&i)131072&e.getObjectFlags(n)||(r|=4194304);else {var a=t.length,o=a&&n.id>t[a-1].id?~a:e.binarySearch(t,n,Bu,e.compareValues);o<0&&t.splice(~o,0,n);}return r}function Uu(e,t,r){for(var n=0,i=r;n<i.length;n++)t=zu(e,t,i[n]);return t}function Ku(t,r){for(var n=0,i=r;n<i.length;n++){var a=i[n];if(1048576&a.flags){var o=a.origin;a.aliasSymbol||o&&!(1048576&o.flags)?e.pushIfUnique(t,a):o&&1048576&o.flags&&Ku(t,o.types);}}}function Vu(e,t){var r=la(e);return r.types=t,r}function qu(t,r,n,i,a){if(void 0===r&&(r=1),0===t.length)return nt;if(1===t.length)return t[0];var o=[],s=Uu(o,0,t);if(0!==r){if(3&s)return 1&s?8388608&s?Oe:we:65536&s||ju(o,je)?je:Je;if(re&&32768&s){var c=e.binarySearch(o,Ve,Bu,e.compareValues);c>=0&&ju(o,ze)&&e.orderedRemoveItemAt(o,c);}if((402664320&s||16384&s&&32768&s)&&function(t,r,n){for(var i=t.length;i>0;){var a=t[--i],o=a.flags;(402653312&o&&4&r||256&o&&8&r||2048&o&&64&r||8192&o&&4096&r||n&&32768&o&&16384&r||nd(a)&&ju(t,a.regularType))&&e.orderedRemoveItemAt(t,i);}}(o,s,!!(2&r)),128&s&&134217728&s&&function(t){var r=e.filter(t,h_);if(r.length)for(var n=t.length,i=function(){n--;var i=t[n];128&i.flags&&e.some(r,(function(e){return _g(i,e)}))&&e.orderedRemoveItemAt(t,n);};n>0;)i();}(o),2===r&&!(o=function(t,r){var n=Ml(t),i=Ce.get(n);if(i)return i;for(var a=r&&e.some(t,(function(e){return !!(524288&e.flags)&&!dc(e)&&pp(pc(e))})),o=t.length,s=o,c=0;s>0;){var l=t[--s];if(a||469499904&l.flags)for(var u=61603840&l.flags?e.find(yc(l),(function(e){return rf(Uo(e))})):void 0,d=u&&rd(Uo(u)),p=0,f=t;p<f.length;p++){var g=f[p];if(l!==g){if(1e5===c&&c/(o-s)*o>1e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","removeSubtypes_DepthLimit",{typeIds:t.map((function(e){return e.id}))}),void In(_,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);if(c++,u&&61603840&g.flags){var m=eo(g,u.escapedName);if(m&&rf(m)&&rd(m)!==d)continue}if(hp(l,g,xn)&&(!(1&e.getObjectFlags(qo(l)))||!(1&e.getObjectFlags(qo(g)))||Zd(l,g))){e.orderedRemoveItemAt(t,s);break}}}}return Ce.set(n,t),t}(o,!!(524288&s))))return Me;if(0===o.length)return 65536&s?4194304&s?qe:We:32768&s?4194304&s?ze:Ue:nt}if(!a&&1048576&s){var l=[];Ku(l,t);for(var u=[],d=function(t){e.some(l,(function(e){return ju(e.types,t)}))||u.push(t);},p=0,f=o;p<f.length;p++)d(f[p]);if(!n&&1===l.length&&0===u.length)return l[0];if(e.reduceLeft(l,(function(e,t){return e+t.types.length}),0)+u.length===o.length){for(var g=0,m=l;g<m.length;g++)Ju(u,m[g]);a=Vu(1048576,u);}}return Hu(o,(36323363&s?0:65536)|(2097152&s?33554432:0),n,i,a)}function Wu(e,t){return e.kind===t.kind&&e.parameterIndex===t.parameterIndex}function Hu(e,t,r,n,i){if(0===e.length)return nt;if(1===e.length)return e[0];var a=(i?1048576&i.flags?"|".concat(Ml(i.types)):2097152&i.flags?"&".concat(Ml(i.types)):"#".concat(i.type.id,"|").concat(Ml(e)):Ml(e))+Ll(r,n),o=ge.get(a);return o||((o=ca(1048576)).objectFlags=t|Rl(e,98304),o.types=e,o.origin=i,o.aliasSymbol=r,o.aliasTypeArguments=n,2===e.length&&512&e[0].flags&&512&e[1].flags&&(o.flags|=16,o.intrinsicName="boolean"),ge.set(a,o)),o}function Gu(e,t,r){var n=r.flags;return 2097152&n?Qu(e,t,r.types):(gp(r)?16777216&t||(t|=16777216,e.set(r.id.toString(),r)):(3&n?r===Oe&&(t|=8388608):!H&&98304&n||(re&&r===Ve&&(t|=262144,r=ze),e.has(r.id.toString())||(109440&r.flags&&109440&t&&(t|=67108864),e.set(r.id.toString(),r))),t|=205258751&n),t)}function Qu(e,t,r){for(var n=0,i=r;n<i.length;n++)t=Gu(e,t,rd(i[n]));return t}function Xu(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!ju(i.types,t)){var a=128&t.flags?He:256&t.flags?Ge:2048&t.flags?Qe:8192&t.flags?tt:void 0;if(!a||!ju(i.types,a))return !1}}return !0}function Yu(t,r){return e.every(t,(function(t){return !!(1048576&t.flags)&&e.some(t.types,(function(e){return !!(e.flags&r)}))}))}function Zu(e,t){for(var r=0;r<e.length;r++)e[r]=om(e[r],(function(e){return !(e.flags&t)}));}function $u(t,r,n){var i=new e.Map,a=Qu(i,0,t),o=e.arrayFrom(i.values());if(131072&a)return e.contains(o,it)?it:nt;if(H&&98304&a&&84410368&a||67108864&a&&402783228&a||402653316&a&&67238776&a||296&a&&469891796&a||2112&a&&469889980&a||12288&a&&469879804&a||49152&a&&469842940&a)return nt;if(134217728&a&&128&a&&function(t){for(var r=t.length,n=e.filter(t,(function(e){return !!(128&e.flags)}));r>0;){var i=t[--r];if(134217728&i.flags)for(var a=0,o=n;a<o.length;a++){if(Xd(o[a],i)){e.orderedRemoveItemAt(t,r);break}if(h_(i))return !0}}return !1}(o))return nt;if(1&a)return 8388608&a?Oe:we;if(!H&&98304&a)return 32768&a?ze:qe;if((4&a&&128&a||8&a&&256&a||64&a&&2048&a||4096&a&&8192&a)&&function(t,r){for(var n=t.length;n>0;){var i=t[--n];(4&i.flags&&128&r||8&i.flags&&256&r||64&i.flags&&2048&r||4096&i.flags&&8192&r)&&e.orderedRemoveItemAt(t,n);}}(o,a),16777216&a&&524288&a&&e.orderedRemoveItemAt(o,e.findIndex(o,gp)),262144&a&&(o[o.indexOf(ze)]=Ve),0===o.length)return je;if(1===o.length)return o[0];var s=Ml(o)+Ll(r,n),c=me.get(s);if(!c){if(1048576&a)if(function(t){var r,n=e.findIndex(t,(function(t){return !!(65536&e.getObjectFlags(t))}));if(n<0)return !1;for(var i=n+1;i<t.length;){var a=t[i];65536&e.getObjectFlags(a)?((r||(r=[t[n]])).push(a),e.orderedRemoveItemAt(t,i)):i++;}if(!r)return !1;for(var o=[],s=[],c=0,l=r;c<l.length;c++)for(var u=0,_=l[c].types;u<_.length;u++)Ju(o,a=_[u])&&Xu(r,a)&&Ju(s,a);return t[n]=Hu(s,65536),!0}(o))c=$u(o,r,n);else if(Yu(o,32768)){var l=re&&e.some(o,(function(e){return ju(e.types,Ve)}))?Ve:ze;Zu(o,32768),c=qu([$u(o),l],1,r,n);}else if(Yu(o,65536))Zu(o,65536),c=qu([$u(o),qe],1,r,n);else {if(!t_(o))return Me;var u=function(e){for(var t=e_(e),r=[],n=0;n<t;n++){for(var i=e.slice(),a=n,o=e.length-1;o>=0;o--)if(1048576&e[o].flags){var s=e[o].types,c=s.length;i[o]=s[a%c],a=Math.floor(a/c);}var l=$u(i);131072&l.flags||r.push(l);}return r}(o);c=qu(u,1,r,n,e.some(u,(function(e){return !!(2097152&e.flags)}))?Vu(2097152,o):void 0);}else c=function(e,t,r){var n=ca(2097152);return n.objectFlags=Rl(e,98304),n.types=e,n.aliasSymbol=t,n.aliasTypeArguments=r,n}(o,r,n);me.set(s,c);}return c}function e_(t){return e.reduceLeft(t,(function(e,t){return 1048576&t.flags?e*t.types.length:131072&t.flags?0:e}),1)}function t_(t){var r=e_(t);return !(r>=1e5&&(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkCrossProductUnion_DepthLimit",{typeIds:t.map((function(e){return e.id})),size:r}),In(_,e.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent),1))}function r_(e,t){var r=ca(4194304);return r.type=e,r.stringsOnly=t,r}function n_(e,t){return t?e.resolvedStringIndexType||(e.resolvedStringIndexType=r_(e,!0)):e.resolvedIndexType||(e.resolvedIndexType=r_(e,!1))}function i_(t){return e.isPrivateIdentifier(t)?nt:e.isIdentifier(t)?id(e.unescapeLeadingUnderscores(t.escapedText)):rd(e.isComputedPropertyName(t)?Ny(t):ax(t))}function a_(t,r,n){if(n||!(24&e.getDeclarationModifierFlagsFromSymbol(t))){var i=Gn(Ms(t)).nameType;if(!i){var a=e.getNameOfDeclaration(t.valueDeclaration);i="default"===t.escapedName?id("default"):a&&i_(a)||(e.isKnownSymbol(t)?void 0:id(e.symbolName(t)));}if(i&&i.flags&r)return i}return nt}function o_(t,r){return !!(t.flags&r||2097152&t.flags&&e.some(t.types,(function(e){return o_(e,r)})))}function s_(t,r,n){var i=n&&(7&e.getObjectFlags(t)||t.aliasSymbol)?function(e){var t=la(4194304);return t.type=e,t}(t):void 0,a=e.map(yc(t),(function(e){return a_(e,r)})),o=e.map(Hc(t),(function(e){return e!==Ar&&o_(e.keyType,r)?e.keyType===He&&8&r?lt:e.keyType:nt}));return qu(e.concatenate(a,o),1,void 0,void 0,i)}function c_(t,r,n){return void 0===r&&(r=ee),1048576&(t=Mc(t)).flags?$u(e.map(t.types,(function(e){return c_(e,r,n)}))):2097152&t.flags?qu(e.map(t.types,(function(e){return c_(e,r,n)}))):58982400&t.flags||df(t)||dc(t)&&(a=rc(i=t),!function t(r){return !!(68157439&r.flags)||(16777216&r.flags?r.root.isDistributive&&r.checkType===a:137363456&r.flags?e.every(r.types,t):8388608&r.flags?t(r.objectType)&&t(r.indexType):33554432&r.flags?t(r.substitute):!!(268435456&r.flags)&&t(r.type))}(ic(i)||a))?n_(t,r):32&e.getObjectFlags(t)?function(e,t,r){var n=rc(e),i=nc(e),a=ic(e.target||e);if(!a&&!r)return i;var o=[];if(sc(e)){if(D_(i))return n_(e,t);tc(Ac(cc(e)),8576,t,c);}else nm($s(i),c);D_(i)&&nm(i,c);var s=r?om(qu(o),(function(e){return !(5&e.flags)})):qu(o);return 1048576&s.flags&&1048576&i.flags&&Ml(s.types)===Ml(i.types)?i:s;function c(t){var r=a?Rd(a,Ed(e.mapper,n,t)):t;o.push(r===He?lt:r);}}(t,r,n):t===Oe?Oe:2&t.flags?nt:131073&t.flags?_t:s_(t,(n?128:402653316)|(r?0:12584),r===ee&&!n);var i,a;}function l_(e){if(ee)return e;var t=(fr||(fr=lu("Extract",2,!0)||Ne),fr===Ne?void 0:fr);return t?Vl(t,[e,He]):He}function u_(t,r){var n=e.findIndex(r,(function(e){return !!(1179648&e.flags)}));if(n>=0)return t_(r)?lm(r[n],(function(i){return u_(t,e.replaceElement(r,n,i))})):Me;if(e.contains(r,Oe))return Oe;var i=[],a=[],o=t[0];if(!function e(t,r){for(var n=0;n<r.length;n++){var s=r[n];if(101248&s.flags)o+=__(s)||"",o+=t[n+1];else if(134217728&s.flags){if(o+=s.texts[0],!e(s.texts,s.types))return !1;o+=t[n+1];}else {if(!D_(s)&&!v_(s))return !1;i.push(s),a.push(o),o=t[n+1];}}return !0}(t,r))return He;if(0===i.length)return id(o);if(a.push(o),e.every(a,(function(e){return ""===e}))&&e.every(i,(function(e){return !!(4&e.flags)})))return He;var s="".concat(Ml(i),"|").concat(e.map(a,(function(e){return e.length})).join(","),"|").concat(a.join("")),c=De.get(s);return c||De.set(s,c=function(e,t){var r=ca(134217728);return r.texts=e,r.types=t,r}(a,i)),c}function __(t){return 128&t.flags?t.value:256&t.flags?""+t.value:2048&t.flags?e.pseudoBigIntToString(t.value):98816&t.flags?t.intrinsicName:void 0}function d_(e,t){return 1179648&t.flags?lm(t,(function(t){return d_(e,t)})):D_(t)?function(e,t){var r="".concat(M(e),",").concat(Bu(t)),n=Se.get(r);return n||Se.set(r,n=function(e,t){var r=ca(268435456);return r.symbol=e,r.type=t,r}(e,t)),n}(e,t):128&t.flags?id(function(e,t){switch(P.get(e.escapedName)){case 0:return t.toUpperCase();case 1:return t.toLowerCase();case 2:return t.charAt(0).toUpperCase()+t.slice(1);case 3:return t.charAt(0).toLowerCase()+t.slice(1)}return t}(e,t.value)):t}function p_(t){if(Y)return !1;if(8192&e.getObjectFlags(t))return !0;if(1048576&t.flags)return e.every(t.types,p_);if(2097152&t.flags)return e.some(t.types,p_);if(465829888&t.flags){var r=kc(t);return r!==t&&p_(r)}return !1}function f_(t,r){return Es(t)?Ps(t):r&&e.isPropertyName(r)?e.getPropertyNameForPropertyNameNode(r):void 0}function g_(t,r){if(8208&r.flags){var n=e.findAncestor(t.parent,(function(t){return !e.isAccessExpression(t)}))||t.parent;return e.isCallLikeExpression(n)?e.isCallOrNewExpression(n)&&e.isIdentifier(t)&&Lg(n,t):e.every(r.declarations,(function(t){return !e.isFunctionLike(t)||!!(134217728&e.getCombinedNodeFlags(t))}))}return !0}function m_(t,r,n,i,a,o){var s,c=a&&206===a.kind?a:void 0,l=a&&e.isPrivateIdentifier(a)?void 0:f_(n,a);if(void 0!==l){if(256&o)return cy(r,l)||we;var u=Jc(r,l);if(u){if(64&o&&a&&u.declarations&&134217728&$y(u)&&g_(a,u)&&Bn(null!==(s=null==c?void 0:c.argumentExpression)&&void 0!==s?s:e.isIndexedAccessTypeNode(a)?a.indexType:a,u.declarations,l),c){if(Iv(u,c,Ov(c.expression,r.symbol)),Sb(c,u,e.getAssignmentTargetKind(c)))return void In(c.argumentExpression,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ia(u));if(8&o&&(Qn(a).resolvedSymbol=u),vv(c,u))return Ie}var _=Uo(u);return c&&1!==e.getAssignmentTargetKind(c)?Pm(c,_):_}if(am(r,_f)&&ky(l)&&+l>=0){if(a&&am(r,(function(e){return !e.target.hasRestElement}))&&!(16&o)){var d=y_(a);_f(r)?In(d,e.Diagnostics.Tuple_type_0_of_length_1_has_no_element_at_index_2,Ma(r),Ul(r),e.unescapeLeadingUnderscores(l)):In(d,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Ma(r));}return b(Gc(r,Ge)),lm(r,(function(e){var t=ff(e)||ze;return 1&o?qu([t,ze]):t}))}}if(!(98304&n.flags)&&kb(n,402665900)){if(131073&r.flags)return r;var p=Yc(r,n)||Gc(r,He);if(p)return 2&o&&p.keyType!==Ge?void(c&&In(c,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Ma(n),Ma(t))):a&&p.keyType===He&&!kb(n,12)?(In(d=y_(a),e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Ma(n)),1&o?qu([p.type,ze]):p.type):(b(p),1&o?qu([p.type,ze]):p.type);if(131072&n.flags)return nt;if(p_(r))return we;if(c&&!Fb(r)){if(yg(r)){if(Y&&384&n.flags)return mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Ma(r))),ze;if(12&n.flags){var f=e.map(r.properties,(function(e){return Uo(e)}));return qu(e.append(f,ze))}}if(r.symbol===ce&&void 0!==l&&ce.exports.has(l)&&418&ce.exports.get(l).flags)In(c,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(l),Ma(r));else if(Y&&!U.suppressImplicitAnyIndexErrors&&!(128&o))if(void 0!==l&&Cv(l,r)){var g=Ma(r);In(c,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,g,g+"["+e.getTextOfNode(c.argumentExpression)+"]");}else if(Qc(r,Ge))In(c.argumentExpression,e.Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);else {var m=void 0;if(void 0!==l&&(m=Fv(l,r)))void 0!==m&&In(c.argumentExpression,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,l,Ma(r),m);else {var y=function(t,r,n){var i=e.isAssignmentTarget(r)?"set":"get";if(function(e){var r=gc(t,e);if(r){var i=Qv(Uo(r));return !!i&&$h(i)>=1&&Yd(n,Qh(i,0))}return !1}(i)){var a=e.tryGetPropertyAccessOrIdentifierToString(r.expression);return void 0===a?a=i:a+="."+i,a}}(r,c,n);if(void 0!==y)In(c,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1,Ma(r),y);else {var v=void 0;if(1024&n.flags)v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+Ma(n)+"]",Ma(r));else if(8192&n.flags){var h=Oi(n.symbol,c);v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,"["+h+"]",Ma(r));}else 128&n.flags||256&n.flags?v=e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_does_not_exist_on_type_1,n.value,Ma(r)):12&n.flags&&(v=e.chainDiagnosticMessages(void 0,e.Diagnostics.No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1,Ma(n),Ma(r)));v=e.chainDiagnosticMessages(v,e.Diagnostics.Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1,Ma(i),Ma(r)),mn.add(e.createDiagnosticForNodeFromMessageChain(c,v));}}}return}}return p_(r)?we:(a&&(d=y_(a),384&n.flags?In(d,e.Diagnostics.Property_0_does_not_exist_on_type_1,""+n.value,Ma(r)):12&n.flags?In(d,e.Diagnostics.Type_0_has_no_matching_index_signature_for_type_1,Ma(r),Ma(n)):In(d,e.Diagnostics.Type_0_cannot_be_used_as_an_index_type,Ma(n))),to(n)?n:void 0);function b(t){t&&t.isReadonly&&c&&(e.isAssignmentTarget(c)||e.isDeleteTarget(c))&&In(c,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(r));}}function y_(e){return 206===e.kind?e.argumentExpression:193===e.kind?e.indexType:161===e.kind?e.expression:e}function v_(e){return !!(77&e.flags)}function h_(t){return !!(134217728&t.flags)&&e.every(t.types,v_)}function b_(e){return !!S_(e)}function x_(e){return !!(8388608&S_(e))}function D_(e){return !!(16777216&S_(e))}function S_(t){return 3145728&t.flags?(4194304&t.objectFlags||(t.objectFlags|=4194304|e.reduceLeft(t.types,(function(e,t){return e|S_(t)}),0)),25165824&t.objectFlags):33554432&t.flags?(4194304&t.objectFlags||(t.objectFlags|=4194304|S_(t.substitute)|S_(t.baseType)),25165824&t.objectFlags):(58982400&t.flags||dc(t)||df(t)?8388608:0)|(465829888&t.flags&&!h_(t)?16777216:0)}function T_(e){return !!(262144&e.flags&&e.isThisType)}function C_(t,r){return 8388608&t.flags?function(t,r){var n=r?"simplifiedForWriting":"simplifiedForReading";if(t[n])return t[n]===St?t:t[n];t[n]=St;var i=C_(t.objectType,r),a=C_(t.indexType,r),o=function(t,r,n){if(1048576&r.flags){var i=e.map(r.types,(function(e){return C_(F_(t,e),n)}));return n?$u(i):qu(i)}}(i,a,r);if(o)return t[n]=o;if(!(465829888&a.flags)){var s=E_(i,a,r);if(s)return t[n]=s}if(df(i)&&296&a.flags){var c=gf(i,8&a.flags?0:i.target.fixedLength,0,r);if(c)return t[n]=c}return dc(i)?t[n]=lm(N_(i,t.indexType),(function(e){return C_(e,r)})):t[n]=t}(t,r):16777216&t.flags?function(e,t){var r=e.checkType,n=e.extendsType,i=j_(e),a=J_(e);if(131072&a.flags&&O_(i)===O_(r)){if(1&r.flags||Yd(Jd(r),Jd(n)))return C_(i,t);if(k_(r,n))return nt}else if(131072&i.flags&&O_(a)===O_(r)){if(!(1&r.flags)&&Yd(Jd(r),Jd(n)))return nt;if(1&r.flags||k_(r,n))return C_(a,t)}return e}(t,r):t}function E_(t,r,n){if(3145728&t.flags){var i=e.map(t.types,(function(e){return C_(F_(e,r),n)}));return 2097152&t.flags||n?$u(i):qu(i)}}function k_(e,t){return !!(131072&qu([Gs(e,t),nt]).flags)}function N_(e,t){var r=vd([rc(e)],[t]),n=Td(e.mapper,r);return Rd(ac(e),n)}function F_(e,t,r,n,i,a){return void 0===r&&(r=0),P_(e,t,r,n,i,a)||(n?Me:je)}function A_(e,t){return am(e,(function(e){if(384&e.flags){var r=Ps(e);if(ky(r)){var n=+r;return n>=0&&n<t}}return !1}))}function P_(e,t,r,n,i,a){if(void 0===r&&(r=0),e===Oe||t===Oe)return Oe;if(!mp(e)||98304&t.flags||!kb(t,12)||(t=He),U.noUncheckedIndexedAccess&&32&r&&(r|=1),D_(t)||(n&&193!==n.kind?df(e)&&!A_(t,e.target.fixedLength):x_(e)&&(!_f(e)||!A_(t,e.target.fixedLength)))){if(3&e.flags)return e;var o=1&r,s=e.id+","+t.id+","+o+Ll(i,a),c=xe.get(s);return c||xe.set(s,c=function(e,t,r,n,i){var a=ca(8388608);return a.objectType=e,a.indexType=t,a.accessFlags=r,a.aliasSymbol=n,a.aliasTypeArguments=i,a}(e,t,o,i,a)),c}var l=Pc(e);if(1048576&t.flags&&!(16&t.flags)){for(var u=[],_=!1,d=0,p=t.types;d<p.length;d++){var f=m_(e,l,p[d],t,n,r|(_?128:0));if(f)u.push(f);else {if(!n)return;_=!0;}}if(_)return;return 4&r?$u(u,i,a):qu(u,1,i,a)}return m_(e,l,t,t,n,72|r)}function w_(e){var t=Qn(e);if(!t.resolvedType){var r=dd(e.objectType),n=dd(e.indexType),i=W_(e),a=F_(r,n,0,e,i,H_(i));t.resolvedType=8388608&a.flags&&a.objectType===r&&a.indexType===n?$l(a,e):a;}return t.resolvedType}function I_(e){var t=Qn(e);if(!t.resolvedType){var r=_a(32,e.symbol);r.declaration=e,r.aliasSymbol=W_(e),r.aliasTypeArguments=H_(r.aliasSymbol),t.resolvedType=r,nc(r);}return t.resolvedType}function O_(e){return 33554432&e.flags?e.baseType:8388608&e.flags&&(33554432&e.objectType.flags||33554432&e.indexType.flags)?F_(O_(e.objectType),O_(e.indexType)):e}function M_(e){return !e.isDistributive&&L_(e.node.checkType)&&L_(e.node.extendsType)}function L_(t){return e.isTupleTypeNode(t)&&1===e.length(t.elements)&&!e.isOptionalTypeNode(t.elements[0])&&!e.isRestTypeNode(t.elements[0])}function R_(e,t){return M_(e)&&_f(t)?zl(t)[0]:t}function B_(t,r,n,i){for(var a,o,s=0;;){if(1e3===s){In(_,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),a=Me;break}var c=M_(t),l=Rd(R_(t,O_(t.checkType)),r),u=b_(l),d=Rd(R_(t,t.extendsType),r);if(l===Oe||d===Oe)return Oe;var p=void 0;if(t.inferTypeParameters){var f=Wf(t.inferTypeParameters,void 0,0);u||fg(f.inferences,l,d,1536),p=r?Td(f.mapper,r):f.mapper;}var g=p?Rd(R_(t,t.extendsType),p):d;if(!u&&!b_(g)){if(!(3&g.flags)&&(1&l.flags&&!c||!Yd(jd(l),jd(g)))){1&l.flags&&!c&&(o||(o=[])).push(Rd(dd(t.node.trueType),p||r));var m=dd(t.node.falseType);if(16777216&m.flags){var y=m.root;if(y.node.parent===t.node&&(!y.isDistributive||y.checkType===t.checkType)){t=y;continue}if(b(m,r))continue}a=Rd(m,r);break}if(3&g.flags||Yd(Jd(l),Jd(g))){var v=dd(t.node.trueType),h=p||r;if(b(v,h))continue;a=Rd(v,h);break}}(a=ca(16777216)).root=t,a.checkType=Rd(t.checkType,r),a.extendsType=Rd(t.extendsType,r),a.mapper=r,a.combinedMapper=p,a.aliasSymbol=n||t.aliasSymbol,a.aliasTypeArguments=n?i:gd(t.aliasTypeArguments,r);break}return o?qu(e.append(o,a)):a;function b(a,o){if(16777216&a.flags&&o){var c=a.root;if(c.outerTypeParameters){var l=Td(a.mapper,o),u=e.map(c.outerTypeParameters,(function(e){return hd(e,l)})),_=vd(c.outerTypeParameters,u),d=c.isDistributive?hd(c.checkType,_):void 0;if(!(d&&d!==c.checkType&&1179648&d.flags))return t=c,r=_,n=void 0,i=void 0,c.aliasSymbol&&s++,!0}}return !1}}function j_(e){return e.resolvedTrueType||(e.resolvedTrueType=Rd(dd(e.root.node.trueType),e.mapper))}function J_(e){return e.resolvedFalseType||(e.resolvedFalseType=Rd(dd(e.root.node.falseType),e.mapper))}function z_(t){var r;return t.locals&&t.locals.forEach((function(t){262144&t.flags&&(r=e.append(r,ms(t)));})),r}function U_(t){return e.isIdentifier(t)?[t]:e.append(U_(t.left),t.right)}function K_(t){var r=Qn(t);if(!r.resolvedType){if(t.isTypeOf&&t.typeArguments)return In(t,e.Diagnostics.Type_arguments_cannot_be_used_here),r.resolvedSymbol=Ne,r.resolvedType=Me;if(!e.isLiteralImportTypeNode(t))return In(t.argument,e.Diagnostics.String_literal_expected),r.resolvedSymbol=Ne,r.resolvedType=Me;var n=t.isTypeOf?111551:4194304&t.flags?900095:788968,i=Ri(t,t.argument.literal);if(!i)return r.resolvedSymbol=Ne,r.resolvedType=Me;var a=zi(i,!1);if(e.nodeIsMissing(t.qualifier))a.flags&n?r.resolvedType=V_(t,r,a,n):(In(t,111551===n?e.Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here:e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0,t.argument.literal.text),r.resolvedSymbol=Ne,r.resolvedType=Me);else {for(var o=U_(t.qualifier),s=a,c=void 0;c=o.shift();){var l=o.length?1920:n,u=Zi(Ei(s)),_=t.isTypeOf?Jc(Uo(u),c.escapedText):Yn(Gi(u),c.escapedText,l);if(!_)return In(c,e.Diagnostics.Namespace_0_has_no_exported_member_1,Oi(s),e.declarationNameToString(c)),r.resolvedType=Me;Qn(c).resolvedSymbol=_,Qn(c.parent).resolvedSymbol=_,s=_;}r.resolvedType=V_(t,r,s,n);}}return r.resolvedType}function V_(e,t,r,n){var i=Ei(r);return t.resolvedSymbol=i,111551===n?Uo(r):Ql(e,i)}function q_(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);if(0!==Os(t.symbol).size||n){var i=_a(16,t.symbol);i.aliasSymbol=n,i.aliasTypeArguments=H_(n),e.isJSDocTypeLiteral(t)&&t.isArrayType&&(i=Tu(i)),r.resolvedType=i;}else r.resolvedType=ht;}return r.resolvedType}function W_(t){for(var r=t.parent;e.isParenthesizedTypeNode(r)||e.isJSDocTypeExpression(r)||e.isTypeOperatorNode(r)&&144===r.operator;)r=r.parent;return e.isTypeAlias(r)?$i(r):void 0}function H_(e){return e?Xo(e):void 0}function G_(e){return !!(524288&e.flags)&&!dc(e)}function Q_(e){return fp(e)||!!(474058748&e.flags)}function X_(t,r){if(!(1048576&t.flags))return t;if(e.every(t.types,Q_))return e.find(t.types,fp)||mt;var n=e.find(t.types,(function(e){return !Q_(e)}));return n?e.find(t.types,(function(e){return e!==n&&!Q_(e)}))?t:function(t){for(var n=e.createSymbolTable(),i=0,a=yc(t);i<a.length;i++){var o=a[i];if(24&e.getDeclarationModifierFlagsFromSymbol(o));else if(Z_(o)){var s=65536&o.flags&&!(32768&o.flags),c=jn(16777220,o.escapedName,ec(o)|(r?8:0));c.type=s?ze:go(Uo(o),!0),c.declarations=o.declarations,c.nameType=Gn(o).nameType,c.syntheticOrigin=o,n.set(o.escapedName,c);}}var l=ya(t.symbol,n,e.emptyArray,e.emptyArray,Hc(t));return l.objectFlags|=262272,l}(n):t}function Y_(t,r,n,i,a){if(1&t.flags||1&r.flags)return we;if(2&t.flags||2&r.flags)return je;if(131072&t.flags)return r;if(131072&r.flags)return t;if(1048576&(t=X_(t,a)).flags)return t_([t,r])?lm(t,(function(e){return Y_(e,r,n,i,a)})):Me;if(1048576&(r=X_(r,a)).flags)return t_([t,r])?lm(r,(function(e){return Y_(t,e,n,i,a)})):Me;if(473960444&r.flags)return t;if(x_(t)||x_(r)){if(fp(t))return r;if(2097152&t.flags){var o=t.types,s=o[o.length-1];if(G_(s)&&G_(r))return $u(e.concatenate(o.slice(0,o.length-1),[Y_(s,r,n,i,a)]))}return $u([t,r])}for(var c=e.createSymbolTable(),l=new e.Set,u=t===mt?Hc(r):Hs([t,r]),_=0,d=yc(r);_<d.length;_++){var p=d[_];24&e.getDeclarationModifierFlagsFromSymbol(p)?l.add(p.escapedName):Z_(p)&&c.set(p.escapedName,$_(p,a));}for(var f=0,g=yc(t);f<g.length;f++){var m=g[f];if(!l.has(m.escapedName)&&Z_(m))if(c.has(m.escapedName)){var y=Uo(p=c.get(m.escapedName));if(16777216&p.flags){var v=e.concatenate(m.declarations,p.declarations),h=jn(4|16777216&m.flags,m.escapedName);h.type=qu([Uo(m),Af(y)]),h.leftSpread=m,h.rightSpread=p,h.declarations=v,h.nameType=Gn(m).nameType,c.set(m.escapedName,h);}}else c.set(m.escapedName,$_(m,a));}var b=ya(n,c,e.emptyArray,e.emptyArray,e.sameMap(u,(function(e){return function(e,t){return e.isReadonly!==t?Nl(e.keyType,e.type,t,e.declaration):e}(e,a)})));return b.objectFlags|=4456576|i,b}function Z_(t){var r;return !(e.some(t.declarations,e.isPrivateIdentifierClassElementDeclaration)||106496&t.flags&&(null===(r=t.declarations)||void 0===r?void 0:r.some((function(t){return e.isClassLike(t.parent)}))))}function $_(e,t){var r=65536&e.flags&&!(32768&e.flags);if(!r&&t===Db(e))return e;var n=jn(4|16777216&e.flags,e.escapedName,ec(e)|(t?8:0));return n.type=r?ze:Uo(e),n.declarations=e.declarations,n.nameType=Gn(e).nameType,n.syntheticOrigin=e,n}function ed(e,t,r,n){var i=ca(e);return i.symbol=r,i.value=t,i.regularType=n||i,i}function td(e){if(2944&e.flags){if(!e.freshType){var t=ed(e.flags,e.value,e.symbol,e);t.freshType=t,e.freshType=t;}return e.freshType}return e}function rd(e){return 2944&e.flags?e.regularType:1048576&e.flags?e.regularType||(e.regularType=lm(e,rd)):e}function nd(e){return !!(2944&e.flags)&&e.freshType===e}function id(e){var t;return ye.get(e)||(ye.set(e,t=ed(128,e)),t)}function ad(e){var t;return ve.get(e)||(ve.set(e,t=ed(256,e)),t)}function od(t){var r,n=e.pseudoBigIntToString(t);return he.get(n)||(he.set(n,r=ed(2048,t)),r)}function sd(e,t,r){var n,i=t+("string"==typeof e?"@":"#")+e,a=1024|("string"==typeof e?128:256);return be.get(i)||(be.set(i,n=ed(a,e,r)),n)}function cd(t){if(e.isValidESSymbolDeclaration(t)){var r=$i(t),n=Gn(r);return n.uniqueESSymbolType||(n.uniqueESSymbolType=function(e){var t=ca(8192);return t.symbol=e,t.escapedName="__@".concat(t.symbol.escapedName,"@").concat(M(t.symbol)),t}(r))}return tt}function ld(t){var r=Qn(t);return r.resolvedType||(r.resolvedType=function(t){var r=e.getThisContainer(t,!1),n=r&&r.parent;if(n&&(e.isClassLike(n)||257===n.kind)&&!e.isStatic(r)&&(!e.isConstructorDeclaration(r)||e.isNodeDescendantOf(t,r.body)))return ss($i(n)).thisType;if(n&&e.isObjectLiteralExpression(n)&&e.isBinaryExpression(n.parent)&&6===e.getAssignmentDeclarationKind(n.parent))return ss($i(n.parent.left).parent).thisType;var i=4194304&t.flags?e.getHostSignatureFromJSDoc(t):void 0;return i&&e.isFunctionExpression(i)&&e.isBinaryExpression(i.parent)&&3===e.getAssignmentDeclarationKind(i.parent)?ss($i(i.parent.left).parent).thisType:Fh(r)&&e.isNodeDescendantOf(t,r.body)?ss($i(r)).thisType:(In(t,e.Diagnostics.A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface),Me)}(t)),r.resolvedType}function ud(e){return dd(_d(e.type)||e.type)}function _d(e){switch(e.kind){case 190:return _d(e.type);case 183:if(1===e.elements.length&&(185===(e=e.elements[0]).kind||196===e.kind&&e.dotDotDotToken))return _d(e.type);break;case 182:return e.elementType}}function dd(e){return $l(pd(e),e)}function pd(t){switch(t.kind){case 130:case 310:case 311:return we;case 154:return je;case 149:return He;case 146:return Ge;case 157:return Qe;case 133:return et;case 150:return tt;case 114:return rt;case 152:return ze;case 104:return qe;case 143:return nt;case 147:return 131072&t.flags&&!Y?we:ct;case 138:return Be;case 191:case 108:return ld(t);case 195:return function(e){if(104===e.literal.kind)return qe;var t=Qn(e);return t.resolvedType||(t.resolvedType=rd(ax(e.literal))),t.resolvedType}(t);case 177:return nu(t);case 176:return t.assertsModifier?rt:et;case 227:return nu(t);case 180:return au(t);case 182:case 183:return function(t){var r=Qn(t);if(!r.resolvedType){var n=function(t){var r=function(t){return e.isTypeOperatorNode(t)&&144===t.operator}(t.parent);return _d(t)?r?Lt:Mt:Pu(e.map(t.elements,Cu),r,e.some(t.elements,(function(e){return 196!==e.kind}))?void 0:t.elements)}(t);if(n===bt)r.resolvedType=mt;else if(183===t.kind&&e.some(t.elements,(function(e){return !!(8&Cu(e))}))||!ku(t)){var i=182===t.kind?[dd(t.elementType)]:e.map(t.elements,dd);r.resolvedType=wu(n,i);}else r.resolvedType=183===t.kind&&0===t.elements.length?n:Jl(n,t,void 0);}return r.resolvedType}(t);case 184:return function(e){return go(dd(e.type),!0)}(t);case 186:return function(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);r.resolvedType=qu(e.map(t.types,dd),1,n,H_(n));}return r.resolvedType}(t);case 187:return function(t){var r=Qn(t);if(!r.resolvedType){var n=W_(t);r.resolvedType=$u(e.map(t.types,dd),n,H_(n));}return r.resolvedType}(t);case 312:return function(e){var t=dd(e.type);return H?xf(t,65536):t}(t);case 314:return go(dd(t.type));case 196:return function(e){var t=Qn(e);return t.resolvedType||(t.resolvedType=e.dotDotDotToken?ud(e):go(dd(e.type),!0,!!e.questionToken))}(t);case 190:case 313:case 307:return dd(t.type);case 185:return ud(t);case 316:return function(t){var r=dd(t.type),n=t.parent,i=t.parent.parent;if(e.isJSDocTypeExpression(t.parent)&&e.isJSDocParameterTag(i)){var a=e.getHostSignatureFromJSDoc(i),o=e.isJSDocCallbackTag(i.parent.parent);if(a||o){var s=o?e.lastOrUndefined(i.parent.parent.typeExpression.parameters):e.lastOrUndefined(a.parameters),c=e.getParameterSymbolFromJSDoc(i);if(!s||c&&s.symbol===c&&e.isRestParameter(s))return Tu(r)}}return e.isParameter(n)&&e.isJSDocFunctionType(n.parent)?Tu(r):go(r)}(t);case 178:case 179:case 181:case 320:case 315:case 321:return q_(t);case 192:return function(t){var r=Qn(t);if(!r.resolvedType)switch(t.operator){case 140:r.resolvedType=c_(dd(t.type));break;case 153:r.resolvedType=150===t.type.kind?cd(e.walkUpParenthesizedTypes(t.parent)):Me;break;case 144:r.resolvedType=dd(t.type);break;default:throw e.Debug.assertNever(t.operator)}return r.resolvedType}(t);case 193:return w_(t);case 194:return I_(t);case 188:return function(t){var r=Qn(t);if(!r.resolvedType){var n=dd(t.checkType),i=W_(t),a=H_(i),o=Go(t,!0),s=a?o:e.filter(o,(function(e){return Ad(e,t)})),c={node:t,checkType:n,extendsType:dd(t.extendsType),isDistributive:!!(262144&n.flags),inferTypeParameters:z_(t),outerTypeParameters:s,instantiations:void 0,aliasSymbol:i,aliasTypeArguments:a};r.resolvedType=B_(c,void 0),s&&(c.instantiations=new e.Map,c.instantiations.set(Ml(s),r.resolvedType));}return r.resolvedType}(t);case 189:return function(e){var t=Qn(e);return t.resolvedType||(t.resolvedType=gs($i(e.typeParameter))),t.resolvedType}(t);case 197:return function(t){var r=Qn(t);return r.resolvedType||(r.resolvedType=u_(n$3([t.head.text],e.map(t.templateSpans,(function(e){return e.literal.text})),!0),e.map(t.templateSpans,(function(e){return dd(e.type)})))),r.resolvedType}(t);case 199:return K_(t);case 79:case 160:case 205:var r=MS(t);return r?ms(r):Me;default:return Me}}function fd(e,t,r){if(e&&e.length)for(var n=0;n<e.length;n++){var i=e[n],a=r(i,t);if(i!==a){var o=0===n?[]:e.slice(0,n);for(o.push(a),n++;n<e.length;n++)o.push(r(e[n],t));return o}}return e}function gd(e,t){return fd(e,t,Rd)}function md(e,t){return fd(e,t,Nd)}function yd(e,t){return fd(e,t,zd)}function vd(e,t){return 1===e.length?bd(e[0],t?t[0]:we):function(e,t){return {kind:1,sources:e,targets:t}}(e,t)}function hd(e,t){switch(t.kind){case 0:return e===t.source?t.target:e;case 1:for(var r=t.sources,n=t.targets,i=0;i<r.length;i++)if(e===r[i])return n?n[i]:we;return e;case 2:return t.func(e);case 3:case 4:var a=hd(e,t.mapper1);return a!==e&&3===t.kind?Rd(a,t.mapper2):hd(a,t.mapper2)}}function bd(e,t){return {kind:0,source:e,target:t}}function xd(e){return {kind:2,func:e}}function Dd(e,t,r){return {kind:e,mapper1:t,mapper2:r}}function Sd(e){return vd(e,void 0)}function Td(e,t){return e?Dd(3,e,t):t}function Cd(e,t,r){return r?Dd(4,bd(e,t),r):bd(e,t)}function Ed(e,t,r){return e?Dd(4,e,bd(t,r)):bd(t,r)}function kd(e){var t=da(e.symbol);return t.target=e,t}function Nd(t,r,n){var i;if(t.typeParameters&&!n){i=e.map(t.typeParameters,kd),r=Td(vd(t.typeParameters,i),r);for(var a=0,o=i;a<o.length;a++)o[a].mapper=r;}var s=Bs(t.declaration,i,t.thisParameter&&Fd(t.thisParameter,r),fd(t.parameters,r,Fd),void 0,void 0,t.minArgumentCount,39&t.flags);return s.target=t,s.mapper=r,s}function Fd(t,r){var n=Gn(t);if(n.type&&!$f(n.type))return t;1&e.getCheckFlags(t)&&(t=n.target,r=Td(n.mapper,r));var i=jn(t.flags,t.escapedName,1|53256&e.getCheckFlags(t));return i.declarations=t.declarations,i.parent=t.parent,i.target=t,i.mapper=r,t.valueDeclaration&&(i.valueDeclaration=t.valueDeclaration),n.nameType&&(i.nameType=n.nameType),i}function Ad(t,r){if(t.symbol&&t.symbol.declarations&&1===t.symbol.declarations.length){for(var n=t.symbol.declarations[0].parent,i=r;i!==n;i=i.parent)if(!i||234===i.kind||188===i.kind&&e.forEachChild(i.extendsType,a))return !0;return a(r)}return !0;function a(r){switch(r.kind){case 191:return !!t.isThisType;case 79:return !t.isThisType&&e.isPartOfTypeNode(r)&&function(e){return !(177===e.parent.kind&&e.parent.typeArguments&&e===e.parent.typeName||199===e.parent.kind&&e.parent.typeArguments&&e===e.parent.qualifier)}(r)&&pd(r)===t;case 180:return !0;case 168:case 167:return !r.type&&!!r.body||e.some(r.typeParameters,a)||e.some(r.parameters,a)||!!r.type&&a(r.type)}return !!e.forEachChild(r,a)}}function Pd(e){var t=nc(e);if(4194304&t.flags){var r=O_(t.type);if(262144&r.flags)return r}}function wd(t,r,n,i){var a=Pd(t);if(a){var o=Rd(a,r);if(a!==o)return um(Mc(o),(function(n){if(61603843&n.flags&&n!==Oe&&!ro(n)){if(!t.declaration.nameType){var i=void 0;if(qp(n)||1&n.flags&&Xa(a,4)<0&&(i=hc(a))&&am(i,e.or(qp,_f)))return function(e,t,r){var n=Od(t,Ge,!0,r);return ro(n)?Me:Tu(n,Id(Wp(e),lc(t)))}(n,t,Cd(a,n,r));if(df(n))return function(t,r,n,i){var a=t.target.elementFlags,o=e.map(zl(t),(function(e,t){var o=8&a[t]?e:4&a[t]?Tu(e):Au([e],[a[t]]);return wd(r,Cd(n,o,i))})),s=Id(t.target.readonly,lc(r));return Au(o,e.map(o,(function(e){return 8})),s)}(n,t,a,r);if(_f(n))return function(t,r,n){var i=t.target.elementFlags,a=e.map(zl(t),(function(e,t){return Od(r,id(""+t),!!(2&i[t]),n)})),o=lc(r),s=4&o?e.map(i,(function(e){return 1&e?2:e})):8&o?e.map(i,(function(e){return 2&e?1:e})):i,c=Id(t.target.readonly,o);return e.contains(a,Me)?Me:Au(a,s,c,t.target.labeledElementDeclarations)}(n,t,Cd(a,n,r))}return Md(t,Cd(a,n,r))}return n}),n,i)}return Rd(nc(t),r)===Oe?Oe:Md(t,r,n,i)}function Id(e,t){return !!(1&t)||!(2&t)&&e}function Od(e,t,r,n){var i=Ed(n,rc(e),t),a=Rd(ac(e.target||e),i),o=lc(e);return H&&4&o&&!Eb(a,49152)?Df(a,!0):H&&8&o&&r?Jg(a,524288):a}function Md(e,t,r,n){var i=_a(64|e.objectFlags,e.symbol);if(32&e.objectFlags){i.declaration=e.declaration;var a=rc(e),o=kd(a);i.typeParameter=o,t=Td(bd(a,o),t),o.mapper=t;}return i.target=e,i.mapper=t,i.aliasSymbol=r||e.aliasSymbol,i.aliasTypeArguments=r?n:gd(e.aliasTypeArguments,t),i}function Ld(t,r,n,i){var a=t.root;if(a.outerTypeParameters){var o=e.map(a.outerTypeParameters,(function(e){return hd(e,r)})),s=Ml(o)+Ll(n,i),c=a.instantiations.get(s);if(!c){var l=vd(a.outerTypeParameters,o),u=a.checkType,_=a.isDistributive?hd(u,l):void 0;c=_&&u!==_&&1179648&_.flags?um(_,(function(e){return B_(a,Cd(u,e,l))}),n,i):B_(a,l,n,i),a.instantiations.set(s,c);}return c}return t}function Rd(e,t){return e&&t?Bd(e,t,void 0,void 0):e}function Bd(t,r,n,i){if(!$f(t))return t;if(100===C||D>=5e6)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","instantiateType_DepthLimit",{typeId:t.id,instantiationDepth:C,instantiationCount:D}),In(_,e.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite),Me;x++,D++,C++;var a=function(t,r,n,i){var a=t.flags;if(262144&a)return hd(t,r);if(524288&a){var o=t.objectFlags;if(52&o){if(4&o&&!t.node){var s=t.resolvedTypeArguments,c=gd(s,r);return c!==s?wu(t.target,c):t}return 1024&o?function(t,r){var n=Rd(t.mappedType,r);if(!(32&e.getObjectFlags(n)))return t;var i=Rd(t.constraintType,r);if(!(4194304&i.flags))return t;var a=rg(Rd(t.source,r),n,i);return a||t}(t,r):function(t,r,n,i){var a=4&t.objectFlags?t.node:t.symbol.declarations[0],o=Qn(a),s=4&t.objectFlags?o.resolvedType:64&t.objectFlags?t.target:t,c=o.outerTypeParameters;if(!c){var l=Go(a,!0);if(Fh(a)){var u=$c(a);l=e.addRange(l,u);}c=l||e.emptyArray;var _=4&t.objectFlags?[a]:t.symbol.declarations;c=(4&s.objectFlags||8192&s.symbol.flags||2048&s.symbol.flags)&&!s.aliasTypeArguments?e.filter(c,(function(t){return e.some(_,(function(e){return Ad(t,e)}))})):c,o.outerTypeParameters=c;}if(c.length){var d=Td(t.mapper,r),p=e.map(c,(function(e){return hd(e,d)})),f=n||t.aliasSymbol,g=n?i:gd(t.aliasTypeArguments,r),m=Ml(p)+Ll(f,g);s.instantiations||(s.instantiations=new e.Map,s.instantiations.set(Ml(c)+Ll(s.aliasSymbol,s.aliasTypeArguments),s));var y=s.instantiations.get(m);if(!y){var v=vd(c,p);y=4&s.objectFlags?Jl(t.target,t.node,v,f,g):32&s.objectFlags?wd(s,v,f,g):Md(s,v,f,g),s.instantiations.set(m,y);}return y}return t}(t,r,n,i)}return t}if(3145728&a){var l=1048576&t.flags?t.origin:void 0,u=l&&3145728&l.flags?l.types:t.types,_=gd(u,r);if(_===u&&n===t.aliasSymbol)return t;var d=n||t.aliasSymbol,p=n?i:gd(t.aliasTypeArguments,r);return 2097152&a||l&&2097152&l.flags?$u(_,d,p):qu(_,1,d,p)}if(4194304&a)return c_(Rd(t.type,r));if(134217728&a)return u_(t.texts,gd(t.types,r));if(268435456&a)return d_(t.symbol,Rd(t.type,r));if(8388608&a)return d=n||t.aliasSymbol,p=n?i:gd(t.aliasTypeArguments,r),F_(Rd(t.objectType,r),Rd(t.indexType,r),t.accessFlags,void 0,d,p);if(16777216&a)return Ld(t,Td(t.mapper,r),n,i);if(33554432&a){var f=Rd(t.baseType,r);if(8650752&f.flags)return Xl(f,Rd(t.substitute,r));var g=Rd(t.substitute,r);return 3&g.flags||Yd(Jd(f),Jd(g))?f:g}return t}(t,r,n,i);return C--,a}function jd(e){return 262143&e.flags?e:e.permissiveInstantiation||(e.permissiveInstantiation=Rd(e,gt))}function Jd(e){return 262143&e.flags?e:(e.restrictiveInstantiation||(e.restrictiveInstantiation=Rd(e,ft),e.restrictiveInstantiation.restrictiveInstantiation=e.restrictiveInstantiation),e.restrictiveInstantiation)}function zd(e,t){return Nl(e.keyType,Rd(e.type,t),e.isReadonly,e.declaration)}function Ud(t){switch(e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t)),t.kind){case 212:case 213:case 168:case 255:return Kd(t);case 204:return e.some(t.properties,Ud);case 203:return e.some(t.elements,Ud);case 221:return Ud(t.whenTrue)||Ud(t.whenFalse);case 220:return (56===t.operatorToken.kind||60===t.operatorToken.kind)&&(Ud(t.left)||Ud(t.right));case 294:return Ud(t.initializer);case 211:return Ud(t.expression);case 285:return e.some(t.properties,Ud)||e.isJsxOpeningElement(t.parent)&&e.some(t.parent.parent.children,Ud);case 284:var r=t.initializer;return !!r&&Ud(r);case 287:var n=t.expression;return !!n&&Ud(n)}return !1}function Kd(t){return (!e.isFunctionDeclaration(t)||e.isInJSFile(t)&&!!po(t))&&(e.hasContextSensitiveParameters(t)||function(t){return !t.typeParameters&&!e.getEffectiveReturnTypeNode(t)&&!!t.body&&234!==t.body.kind&&Ud(t.body)}(t))}function Vd(t){return (e.isInJSFile(t)&&e.isFunctionDeclaration(t)||e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t))&&Kd(t)}function qd(t){if(524288&t.flags){var r=pc(t);if(r.constructSignatures.length||r.callSignatures.length){var n=_a(16,t.symbol);return n.members=r.members,n.properties=r.properties,n.callSignatures=e.emptyArray,n.constructSignatures=e.emptyArray,n.indexInfos=e.emptyArray,n}}else if(2097152&t.flags)return $u(e.map(t.types,qd));return t}function Wd(e,t){return hp(e,t,Tn)}function Hd(e,t){return hp(e,t,Tn)?-1:0}function Gd(e,t){return hp(e,t,Dn)?-1:0}function Qd(e,t){return hp(e,t,bn)?-1:0}function Xd(e,t){return hp(e,t,bn)}function Yd(e,t){return hp(e,t,Dn)}function Zd(t,r){return 1048576&t.flags?e.every(t.types,(function(e){return Zd(e,r)})):1048576&r.flags?e.some(r.types,(function(e){return Zd(t,e)})):58982400&t.flags?Zd(Tc(t)||je,r):r===Pt?!!(67633152&t.flags):r===wt?!!(524288&t.flags)&&Bg(t):Wo(t,qo(r))||qp(r)&&!Wp(r)&&Zd(t,Lt)}function $d(e,t){return hp(e,t,Sn)}function ep(e,t){return $d(e,t)||$d(t,e)}function tp(e,t,r,n,i,a){return Dp(e,t,Dn,r,n,i,a)}function rp(e,t,r,n,i,a){return np(e,t,Dn,r,n,i,a,void 0)}function np(e,t,r,n,i,a,o,s){return !!hp(e,t,r)||(!n||!ap(i,e,t,r,a,o,s))&&Dp(e,t,r,n,a,o,s)}function ip(t){return !!(16777216&t.flags||2097152&t.flags&&e.some(t.types,ip))}function ap(t,r,n,a,s,c,l){if(!t||ip(n))return !1;if(!Dp(r,n,a,void 0)&&function(t,r,n,i,a,o,s){for(var c=Uc(r,0),l=Uc(r,1),u=0,_=[l,c];u<_.length;u++){var d=_[u];if(e.some(d,(function(e){var t=ml(e);return !(131073&t.flags)&&Dp(t,n,i,void 0)}))){var p=s||{};tp(r,n,t,a,o,p);var f=p.errors[p.errors.length-1];return e.addRelatedInfo(f,e.createDiagnosticForNode(t,d===l?e.Diagnostics.Did_you_mean_to_use_new_with_this_expression:e.Diagnostics.Did_you_mean_to_call_this_expression)),!0}}return !1}(t,r,n,a,s,c,l))return !0;switch(t.kind){case 287:case 211:return ap(t.expression,r,n,a,s,c,l);case 220:switch(t.operatorToken.kind){case 63:case 27:return ap(t.right,r,n,a,s,c,l)}break;case 204:return function(t,r,n,i,a,s){return !(131068&n.flags)&&cp(function(t){var r,n,i,a;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,o.label=1;case 1:if(!(r<n.length))return [3,8];if(i=n[r],e.isSpreadAssignment(i))return [3,7];if(!(a=a_($i(i),8576))||131072&a.flags)return [3,7];switch(i.kind){case 172:case 171:case 168:case 295:return [3,2];case 294:return [3,4]}return [3,6];case 2:return [4,{errorNode:i.name,innerExpression:void 0,nameType:a}];case 3:return o.sent(),[3,7];case 4:return [4,{errorNode:i.name,innerExpression:i.initializer,nameType:a,errorMessage:e.isComputedNonLiteralName(i.name)?e.Diagnostics.Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1:void 0}];case 5:return o.sent(),[3,7];case 6:e.Debug.assertNever(i),o.label=7;case 7:return r++,[3,1];case 8:return [2]}}))}(t),r,n,i,a,s)}(t,r,n,a,c,l);case 203:return function(e,t,r,n,i,a){if(131068&r.flags)return !1;if($p(t))return cp(up(e,r),t,r,n,i,a);var o=e.contextualType;e.contextualType=r;try{var s=Ty(e,1,!0);return e.contextualType=o,!!$p(s)&&cp(up(e,r),s,r,n,i,a)}finally{e.contextualType=o;}}(t,r,n,a,c,l);case 285:return function(t,r,n,a,s,c){var l,u=cp(function(t){var r,n,i;return o(this,(function(a){switch(a.label){case 0:if(!e.length(t.properties))return [2];r=0,n=t.properties,a.label=1;case 1:return r<n.length?(i=n[r],e.isJsxSpreadAttribute(i)||Iy(e.idText(i.name))?[3,3]:[4,{errorNode:i.name,innerExpression:i.initializer,nameType:id(e.idText(i.name))}]):[3,4];case 2:a.sent(),a.label=3;case 3:return r++,[3,1];case 4:return [2]}}))}(t),r,n,a,s,c);if(e.isJsxOpeningElement(t.parent)&&e.isJsxElement(t.parent.parent)){var _=t.parent.parent,d=Ky(zy(t)),p=void 0===d?"children":e.unescapeLeadingUnderscores(d),f=id(p),g=F_(n,f),m=e.getSemanticJsxChildren(_.children);if(!e.length(m))return u;var y=e.length(m)>1,v=om(g,ef),h=om(g,(function(e){return !ef(e)}));if(y){if(v!==nt){var b=Au(Ly(_,0));u=cp(function(t,r){var n,i,a,s,c;return o(this,(function(o){switch(o.label){case 0:if(!e.length(t.children))return [2];n=0,i=0,o.label=1;case 1:return i<t.children.length?(a=t.children[i],s=ad(i-n),(c=lp(a,s,r))?[4,c]:[3,3]):[3,5];case 2:return o.sent(),[3,4];case 3:n++,o.label=4;case 4:return i++,[3,1];case 5:return [2]}}))}(_,S),b,v,a,s,c)||u;}else if(!hp(F_(r,f),g,a)){u=!0;var x=In(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided,p,Ma(g));c&&c.skipLogging&&(c.errors||(c.errors=[])).push(x);}}else if(h!==nt){var D=lp(m[0],f,S);D&&(u=cp(function(){return o(this,(function(e){switch(e.label){case 0:return [4,D];case 1:return e.sent(),[2]}}))}(),r,n,a,s,c)||u);}else hp(F_(r,f),g,a)||(u=!0,x=In(_.openingElement.tagName,e.Diagnostics.This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided,p,Ma(g)),c&&c.skipLogging&&(c.errors||(c.errors=[])).push(x));}return u;function S(){if(!l){var r=e.getTextOfNode(t.parent.tagName),a=Ky(zy(t)),o=void 0===a?"children":e.unescapeLeadingUnderscores(a),s=F_(n,id(o)),c=e.Diagnostics._0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2;l=i$1(i$1({},c),{key:"!!ALREADY FORMATTED!!",message:e.formatMessage(void 0,c,r,o,Ma(s))});}return l}}(t,r,n,a,c,l);case 213:return function(t,r,n,i,a,o){if(e.isBlock(t.body))return !1;if(e.some(t.parameters,e.hasType))return !1;var s=Qv(r);if(!s)return !1;var c=Uc(n,0);if(!e.length(c))return !1;var l=t.body,u=ml(s),_=qu(e.map(c,ml));if(!Dp(u,_,i,void 0)){var d=l&&ap(l,u,_,i,void 0,a,o);if(d)return d;var p=o||{};if(Dp(u,_,i,l,void 0,a,p),p.errors)return n.symbol&&e.length(n.symbol.declarations)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(n.symbol.declarations[0],e.Diagnostics.The_expected_type_comes_from_the_return_type_of_this_signature)),0==(2&e.getFunctionFlags(t))&&!eo(u,"then")&&Dp(cb(u),_,i,void 0)&&e.addRelatedInfo(p.errors[p.errors.length-1],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async)),!0}return !1}(t,r,n,a,c,l)}return !1}function op(e,t,r){var n=P_(t,r);if(n)return n;if(1048576&t.flags){var i=Ep(e,t);if(i)return P_(i,r)}}function sp(e,t){e.contextualType=t;try{return Hb(e,1,t)}finally{e.contextualType=void 0;}}function cp(t,r,n,i,a,o){for(var s=!1,c=t.next();!c.done;c=t.next()){var l=c.value,u=l.errorNode,_=l.innerExpression,d=l.nameType,p=l.errorMessage,f=op(r,n,d);if(f&&!(8388608&f.flags)){var g=P_(r,d);if(g){var m=f_(d,void 0);if(!Dp(g,f,i,void 0)&&(s=!0,!_||!ap(_,g,f,i,void 0,a,o))){var y=o||{},v=_?sp(_,g):g;if(re&&Cp(v,f)){var h=e.createDiagnosticForNode(u,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target,Ma(v),Ma(f));mn.add(h),y.errors=[h];}else {var b=!!(m&&16777216&(Jc(n,m)||Ne).flags),x=!!(m&&16777216&(Jc(r,m)||Ne).flags);f=Nf(f,b),g=Nf(g,b&&x),Dp(v,f,i,u,p,a,y)&&v!==g&&Dp(g,f,i,u,p,a,y);}if(y.errors){var D=y.errors[y.errors.length-1],S=Es(d)?Ps(d):void 0,T=void 0!==S?Jc(n,S):void 0,C=!1;if(!T){var E=Yc(n,d);E&&E.declaration&&!e.getSourceFileOfNode(E.declaration).hasNoDefaultLib&&(C=!0,e.addRelatedInfo(D,e.createDiagnosticForNode(E.declaration,e.Diagnostics.The_expected_type_comes_from_this_index_signature)));}if(!C&&(T&&e.length(T.declarations)||n.symbol&&e.length(n.symbol.declarations))){var k=T&&e.length(T.declarations)?T.declarations[0]:n.symbol.declarations[0];e.getSourceFileOfNode(k).hasNoDefaultLib||e.addRelatedInfo(D,e.createDiagnosticForNode(k,e.Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1,!S||8192&d.flags?Ma(d):e.unescapeLeadingUnderscores(S),Ma(n)));}}}}}}return s}function lp(t,r,n){switch(t.kind){case 287:return {errorNode:t,innerExpression:t.expression,nameType:r};case 11:if(t.containsOnlyTriviaWhiteSpaces)break;return {errorNode:t,innerExpression:void 0,nameType:r,errorMessage:n()};case 277:case 278:case 281:return {errorNode:t,innerExpression:t,nameType:r};default:return e.Debug.assertNever(t,"Found invalid jsx child")}}function up(t,r){var n,i,a,s;return o(this,(function(o){switch(o.label){case 0:if(!(n=e.length(t.elements)))return [2];i=0,o.label=1;case 1:return i<n?$p(r)&&!Jc(r,""+i)?[3,3]:(a=t.elements[i],e.isOmittedExpression(a)?[3,3]:(s=ad(i),[4,{errorNode:a,innerExpression:a,nameType:s}])):[3,4];case 2:o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return [2]}}))}function _p(e,t,r,n,i){return Dp(e,t,Sn,r,n,i)}function dp(t,r,n,i,a,o,s,c){if(t===r)return -1;if(!(l=r).typeParameters&&(!l.thisParameter||to(Kh(l.thisParameter)))&&1===l.parameters.length&&J(l)&&(Kh(l.parameters[0])===Ut||to(Kh(l.parameters[0])))&&to(ml(l)))return -1;var l,u,_=Zh(r);if(!eb(r)&&(8&n?eb(t)||Zh(t)>_:$h(t)>_))return 0;t.typeParameters&&t.typeParameters!==r.typeParameters&&(t=Zv(t,r=(u=r).typeParameters?u.canonicalSignatureCache||(u.canonicalSignatureCache=function(t){return bl(t,e.map(t.typeParameters,(function(e){return e.target&&!hc(e.target)?e.target:e})),e.isInJSFile(t.declaration))}(u)):u,void 0,s));var d=Zh(t),p=rb(t),f=rb(r);if((p||f)&&Rd(p||f,c),p&&f&&d!==_)return 0;var g=r.declaration?r.declaration.kind:0,m=!(3&n)&&G&&168!==g&&167!==g&&170!==g,y=-1,v=pl(t);if(v&&v!==rt){var h=pl(r);if(h){if(!(C=!m&&s(v,h,!1)||s(h,v,i)))return i&&a(e.Diagnostics.The_this_types_of_each_signature_are_incompatible),0;y&=C;}}for(var b=p||f?Math.min(d,_):Math.max(d,_),x=p||f?b-1:-1,D=0;D<b;D++){var S=D===x?Yh(t,D):Xh(t,D),T=D===x?Yh(r,D):Xh(r,D);if(S&&T){var C,E=3&n?void 0:Qv(Sf(S)),k=3&n?void 0:Qv(Sf(T));if((C=E&&k&&!fl(E)&&!fl(k)&&(98304&vf(S))==(98304&vf(T))?dp(k,E,8&n|(m?2:1),i,a,o,s,c):!(3&n)&&!m&&s(S,T,!1)||s(T,S,i))&&8&n&&D>=$h(t)&&D<$h(r)&&s(S,T,!1)&&(C=0),!C)return i&&a(e.Diagnostics.Types_of_parameters_0_and_1_are_incompatible,e.unescapeLeadingUnderscores(qh(t,D)),e.unescapeLeadingUnderscores(qh(r,D))),0;y&=C;}}if(!(4&n)){var N=vl(r)?we:r.declaration&&Fh(r.declaration)?ss(Zi(r.declaration.symbol)):ml(r);if(N===rt)return y;var F=vl(t)?we:t.declaration&&Fh(t.declaration)?ss(Zi(t.declaration.symbol)):ml(t),A=fl(r);if(A){var P=fl(t);if(P)y&=function(t,r,n,i,a){if(t.kind!==r.kind)return n&&(i(e.Diagnostics.A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r))),0;if((1===t.kind||3===t.kind)&&t.parameterIndex!==r.parameterIndex)return n&&(i(e.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1,t.parameterName,r.parameterName),i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r))),0;var o=t.type===r.type?-1:t.type&&r.type?a(t.type,r.type,n):0;return 0===o&&n&&i(e.Diagnostics.Type_predicate_0_is_not_assignable_to_1,za(t),za(r)),o}(P,A,i,a,s);else if(e.isIdentifierTypePredicate(A))return i&&a(e.Diagnostics.Signature_0_must_be_a_type_predicate,Oa(t)),0}else !(y&=1&n&&s(N,F,!1)||s(F,N,i))&&i&&o&&o(F,N);}return y}function pp(e){return e!==xt&&0===e.properties.length&&0===e.callSignatures.length&&0===e.constructSignatures.length&&0===e.indexInfos.length}function fp(t){return 524288&t.flags?!dc(t)&&pp(pc(t)):!!(67108864&t.flags)||(1048576&t.flags?e.some(t.types,fp):!!(2097152&t.flags)&&e.every(t.types,fp))}function gp(t){return !!(16&e.getObjectFlags(t)&&(t.members&&pp(t)||t.symbol&&2048&t.symbol.flags&&0===Os(t.symbol).size))}function mp(t){return 524288&t.flags&&!dc(t)&&0===yc(t).length&&1===Hc(t).length&&!!Gc(t,He)||3145728&t.flags&&e.every(t.types,mp)||!1}function yp(t,r,n){if(t===r)return !0;var i=M(t)+","+M(r),a=Cn.get(i);if(void 0!==a&&(4&a||!(2&a)||!n))return !!(1&a);if(!(t.escapedName===r.escapedName&&256&t.flags&&256&r.flags))return Cn.set(i,6),!1;for(var o=Uo(r),s=0,c=yc(Uo(t));s<c.length;s++){var l=c[s];if(8&l.flags){var u=Jc(o,l.escapedName);if(!(u&&8&u.flags))return n?(n(e.Diagnostics.Property_0_is_missing_in_type_1,e.symbolName(l),Ma(ms(r),void 0,64)),Cn.set(i,6)):Cn.set(i,2),!1}}return Cn.set(i,1),!0}function vp(e,t,r,n){var i=e.flags,a=t.flags;if(3&a||131072&i||e===Oe)return !0;if(131072&a)return !1;if(402653316&i&&4&a)return !0;if(128&i&&1024&i&&128&a&&!(1024&a)&&e.value===t.value)return !0;if(296&i&&8&a)return !0;if(256&i&&1024&i&&256&a&&!(1024&a)&&e.value===t.value)return !0;if(2112&i&&64&a)return !0;if(528&i&&16&a)return !0;if(12288&i&&4096&a)return !0;if(32&i&&32&a&&yp(e.symbol,t.symbol,n))return !0;if(1024&i&&1024&a){if(1048576&i&&1048576&a&&yp(e.symbol,t.symbol,n))return !0;if(2944&i&&2944&a&&e.value===t.value&&yp(ea(e.symbol),ea(t.symbol),n))return !0}if(32768&i&&(!H||49152&a))return !0;if(65536&i&&(!H||65536&a))return !0;if(524288&i&&67108864&a)return !0;if(r===Dn||r===Sn){if(1&i)return !0;if(264&i&&!(1024&i)&&(32&a||r===Dn&&256&a&&1024&a))return !0}return !1}function hp(e,t,r){if(nd(e)&&(e=e.regularType),nd(t)&&(t=t.regularType),e===t)return !0;if(r!==Tn){if(r===Sn&&!(131072&t.flags)&&vp(t,e,r)||vp(e,t,r))return !0}else {if(e.flags!==t.flags)return !1;if(67358815&e.flags)return !0}if(524288&e.flags&&524288&t.flags){var n=r.get(Mp(e,t,0,r,!1));if(void 0!==n)return !!(1&n)}return !!(469499904&e.flags||469499904&t.flags)&&Dp(e,t,r,void 0)}function bp(t,r){return 2048&e.getObjectFlags(t)&&Iy(r.escapedName)}function xp(t,r){for(;;){var n=nd(t)?t.regularType:4&e.getObjectFlags(t)&&t.node?Bl(t.target,zl(t)):3145728&t.flags?Mc(t):33554432&t.flags?r?t.baseType:t.substitute:25165824&t.flags?C_(t,r):t;if((n=Xp(n)||n)===t)break;t=n;}return t}function Dp(t,r,i,a,o,s,c){var u,d,p,f,g,m,y=0,v=0,h=0,b=0,x=!1,D=0,S=[],T=!1;e.Debug.assert(i!==Tn||!a,"no error reporting in identity checking");var C=J(t,r,3,!!a,o);if(S.length&&M(),x){null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","checkTypeRelatedTo_DepthLimit",{sourceId:t.id,targetId:r.id,depth:v,targetDepth:h});var E=In(a||_,e.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1,Ma(t),Ma(r));c&&(c.errors||(c.errors=[])).push(E);}else if(u){if(s){var k=s();k&&(e.concatenateDiagnosticMessageChains(k,u),u=k);}var N=void 0;if(o&&a&&!C&&t.symbol){var F=Gn(t.symbol);if(F.originatingImport&&!e.isImportCall(F.originatingImport)&&Dp(Uo(F.target),r,i,void 0)){var P=e.createDiagnosticForNode(F.originatingImport,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead);N=e.append(N,P);}}E=e.createDiagnosticForNodeFromMessageChain(a,u,N),d&&e.addRelatedInfo.apply(void 0,n$3([E],d,!1)),c&&(c.errors||(c.errors=[])).push(E),c&&c.skipLogging||mn.add(E);}return a&&c&&c.skipLogging&&0===C&&e.Debug.assert(!!c.errors,"missed opportunity to interact with error."),0!==C;function w(e){u=e.errorInfo,m=e.lastSkippedInfo,S=e.incompatibleStack,D=e.overrideNextErrorInfo,d=e.relatedInfo;}function I(){return {errorInfo:u,lastSkippedInfo:m,incompatibleStack:S.slice(),overrideNextErrorInfo:D,relatedInfo:d?d.slice():void 0}}function O(e,t,r,n,i){D++,m=void 0,S.push([e,t,r,n,i]);}function M(){var t=S;S=[];var r=m;if(m=void 0,1===t.length)return L.apply(void 0,t[0]),void(r&&R.apply(void 0,n$3([void 0],r,!1)));for(var i="",a=[];t.length;){var o=t.pop(),s=o[0],c=o.slice(1);switch(s.code){case e.Diagnostics.Types_of_property_0_are_incompatible.code:0===i.indexOf("new ")&&(i="(".concat(i,")"));var l=""+c[0];i=0===i.length?"".concat(l):e.isIdentifierText(l,e.getEmitScriptTarget(U))?"".concat(i,".").concat(l):"["===l[0]&&"]"===l[l.length-1]?"".concat(i).concat(l):"".concat(i,"[").concat(l,"]");break;case e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code:case e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:case e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code:if(0===i.length){var u=s;s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?u=e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible:s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code&&(u=e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible),a.unshift([u,c[0],c[1]]);}else {var _=s.code===e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"new ":"",d=s.code===e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code||s.code===e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code?"":"...";i="".concat(_).concat(i,"(").concat(d,")");}break;case e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target.code:a.unshift([e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,c[0],c[1]]);break;case e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target.code:a.unshift([e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,c[0],c[1],c[2]]);break;default:return e.Debug.fail("Unhandled Diagnostic: ".concat(s.code))}}i?L(")"===i[i.length-1]?e.Diagnostics.The_types_returned_by_0_are_incompatible_between_these_types:e.Diagnostics.The_types_of_0_are_incompatible_between_these_types,i):a.shift();for(var p=0,f=a;p<f.length;p++){var g=f[p],y=(s=g[0],c=g.slice(1),s.elidedInCompatabilityPyramid);s.elidedInCompatabilityPyramid=!1,L.apply(void 0,n$3([s],c,!1)),s.elidedInCompatabilityPyramid=y;}r&&R.apply(void 0,n$3([void 0],r,!1));}function L(t,r,n,i,o){e.Debug.assert(!!a),S.length&&M(),t.elidedInCompatabilityPyramid||(u=e.chainDiagnosticMessages(u,t,r,n,i,o));}function R(t,r,n){S.length&&M();var a=La(r,n),o=a[0],s=a[1],c=r,l=o;if(af(r)&&!Sp(n)&&(c=of(r),e.Debug.assert(!Yd(c,n),"generalized source shouldn't be assignable"),l=Ra(c)),262144&n.flags){var _=Tc(n),d=void 0;_&&(Yd(c,_)||(d=Yd(r,_)))?L(e.Diagnostics._0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2,d?o:l,s,Ma(_)):(u=void 0,L(e.Diagnostics._0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1,s,l));}if(t)t===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1&&re&&Tp(r,n).length&&(t=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties);else if(i===Sn)t=e.Diagnostics.Type_0_is_not_comparable_to_type_1;else if(o===s)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated;else if(re&&Tp(r,n).length)t=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;else {if(128&r.flags&&1048576&n.flags){var p=function(t,r){var n=r.types.filter((function(e){return !!(128&e.flags)}));return e.getSpellingSuggestion(t.value,n,(function(e){return e.value}))}(r,n);if(p)return void L(e.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2,l,s,Ma(p))}t=e.Diagnostics.Type_0_is_not_assignable_to_type_1;}L(t,l,s);}function B(t,r,n){return _f(t)?t.target.readonly&&Hp(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Ma(t),Ma(r)),!1):_f(r)||qp(r):Wp(t)&&Hp(r)?(n&&L(e.Diagnostics.The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1,Ma(t),Ma(r)),!1):!_f(r)||qp(t)}function j(e,t,r){return J(e,t,3,r)}function J(t,r,n,o,s,c){if(void 0===n&&(n=3),void 0===o&&(o=!1),void 0===c&&(c=0),524288&t.flags&&131068&r.flags)return vp(t,r,i,o?L:void 0)?-1:(E(t,r,0,!!(2048&e.getObjectFlags(t))),0);var l=xp(t,!1),_=xp(r,!0);if(l===_)return -1;if(i===Tn)return function(e,t,r){if(e.flags!==t.flags)return 0;if(67358815&e.flags)return -1;if(z(e,t),3145728&e.flags){var n=K(e,t);return n&&(n&=K(t,e)),n}return W(e,t,!1,0,r)}(l,_,n);if(262144&l.flags&&vc(l)===_)return -1;if(1048576&_.flags&&524288&l.flags&&_.types.length<=3&&Eb(_,98304)){var d=dm(_,-98305);if(1179648&d.flags||(_=xp(d,!0)),l===d)return -1}if(i===Sn&&!(131072&_.flags)&&vp(_,l,i)||vp(l,_,i,o?L:void 0))return -1;var p=!!(2048&e.getObjectFlags(l)),f=!(2&c)&&yg(l)&&16384&e.getObjectFlags(l);if(f&&function(t,r,n){var o;if(!Zy(r)||!Y&&8192&e.getObjectFlags(r))return !1;var s=!!(2048&e.getObjectFlags(t));if((i===Dn||i===Sn)&&(rm(Pt,r)||!s&&fp(r)))return !1;var c,l=r;1048576&r.flags&&(l=rC(t,r,J)||function(e){if(Eb(e,67108864)){var t=om(e,(function(e){return !(131068&e.flags)}));if(!(131072&t.flags))return t}return e}(r),c=1048576&l.flags?l.types:[l]);for(var u=function(r){if(function(e,t){return e.valueDeclaration&&t.valueDeclaration&&e.valueDeclaration.parent===t.valueDeclaration}(r,t.symbol)&&!bp(t,r)){if(!Yy(l,r.escapedName,s)){if(n){var i=om(l,Zy);if(!a)return {value:e.Debug.fail()};if(e.isJsxAttributes(a)||e.isJsxOpeningLikeElement(a)||e.isJsxOpeningLikeElement(a.parent)){r.valueDeclaration&&e.isJsxAttribute(r.valueDeclaration)&&e.getSourceFileOfNode(a)===e.getSourceFileOfNode(r.valueDeclaration.name)&&(a=r.valueDeclaration.name);var u=Ia(r),_=Nv(u,i);(p=_?Ia(_):void 0)?L(e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2,u,Ma(i),p):L(e.Diagnostics.Property_0_does_not_exist_on_type_1,u,Ma(i));}else {var d=(null===(o=t.symbol)||void 0===o?void 0:o.declarations)&&e.firstOrUndefined(t.symbol.declarations),p=void 0;if(r.valueDeclaration&&e.findAncestor(r.valueDeclaration,(function(e){return e===d}))&&e.getSourceFileOfNode(d)===e.getSourceFileOfNode(a)){var f=r.valueDeclaration;e.Debug.assertNode(f,e.isObjectLiteralElementLike),a=f;var g=f.name;e.isIdentifier(g)&&(p=Fv(g,i));}void 0!==p?L(e.Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,Ia(r),Ma(i),p):L(e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,Ia(r),Ma(i));}}return {value:!0}}if(c&&!J(Uo(r),function(t,r){return qu(e.reduceLeft(t,(function(t,n){var i,a=3145728&(n=Ac(n)).flags?Oc(n,r):gc(n,r),o=a&&Uo(a)||(null===(i=Zc(n,r))||void 0===i?void 0:i.type)||ze;return e.append(t,o)}),void 0)||e.emptyArray)}(c,r.escapedName),3,n))return n&&O(e.Diagnostics.Types_of_property_0_are_incompatible,Ia(r)),{value:!0}}},_=0,d=yc(t);_<d.length;_++){var p=u(d[_]);if("object"==typeof p)return p.value}return !1}(l,_,o))return o&&R(s,l,r.aliasSymbol?r:_),0;var g=i!==Sn&&!(2&c)&&2752508&l.flags&&l!==Pt&&2621440&_.flags&&Np(_)&&(yc(l).length>0||US(l));if(g&&!function(e,t,r){for(var n=0,i=yc(e);n<i.length;n++)if(Yy(t,i[n].escapedName,r))return !0;return !1}(l,_,p)){if(o){var y=Ma(t.aliasSymbol?t:l),v=Ma(r.aliasSymbol?r:_),h=Uc(l,0),b=Uc(l,1);h.length>0&&J(ml(h[0]),_,1,!1)||b.length>0&&J(ml(b[0]),_,1,!1)?L(e.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it,y,v):L(e.Diagnostics.Type_0_has_no_properties_in_common_with_type_1,y,v);}return 0}z(l,_);var x=0,S=I();if((1048576&l.flags||1048576&_.flags)&&_m(l)*_m(_)<4?x=G(l,_,o,8|c):(3145728&l.flags||3145728&_.flags)&&(x=W(l,_,o,8|c,n)),x||1048576&l.flags||!(469499904&l.flags||469499904&_.flags)||(x=W(l,_,o,c,n))&&w(S),!x&&2359296&l.flags){var C=function(t,r){for(var n,i=!1,a=0,o=t;a<o.length;a++)if(465829888&(u=o[a]).flags){for(var s=vc(u);s&&21233664&s.flags;)s=vc(s);s&&(n=e.append(n,s),r&&(n=e.append(n,u)));}else 469892092&u.flags&&(i=!0);if(n&&(r||i)){if(i)for(var c=0,l=t;c<l.length;c++){var u;469892092&(u=l[c]).flags&&(n=e.append(n,u));}return $u(n)}}(2097152&l.flags?l.types:[l],!!(1048576&_.flags));C&&(2097152&l.flags||1048576&_.flags)&&am(C,(function(e){return e!==l}))&&(x=J(C,_,1,!1,void 0,c))&&w(S);}return x&&!T&&(2097152&_.flags&&(f||g)||G_(_)&&!qp(_)&&!_f(_)&&2097152&l.flags&&3670016&Ac(l).flags&&!e.some(l.types,(function(t){return !!(524288&e.getObjectFlags(t))})))&&(T=!0,x&=W(l,_,o,4,n),T=!1),E(l,_,x,p),x;function E(n,i,c,l){if(!c&&o){var _=!!Xp(t),d=!!Xp(r);n=t.aliasSymbol||_?t:n,i=r.aliasSymbol||d?r:i;var p=D>0;if(p&&D--,524288&n.flags&&524288&i.flags){var f=u;B(n,i,o),u!==f&&(p=!!u);}if(524288&n.flags&&131068&i.flags)!function(t,r){var n=Ba(t.symbol)?Ma(t,t.symbol.valueDeclaration):Ma(t),i=Ba(r.symbol)?Ma(r,r.symbol.valueDeclaration):Ma(r);(Rt===t&&He===r||Bt===t&&Ge===r||jt===t&&et===r||gu(!1)===t&&tt===r)&&L(e.Diagnostics._0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible,i,n);}(n,i);else if(n.symbol&&524288&n.flags&&Pt===n)L(e.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);else if(l&&2097152&i.flags){var g=i.types,y=By(A.IntrinsicAttributes,a),v=By(A.IntrinsicClassAttributes,a);if(!ro(y)&&!ro(v)&&(e.contains(g,y)||e.contains(g,v)))return c}else u=jc(u,r);if(!s&&p)return m=[n,i],c;R(s,n,i);}}}function z(t,r){if(e.tracing&&3145728&t.flags&&3145728&r.flags){var n=t,i=r;if(n.objectFlags&i.objectFlags&65536)return;var o=n.types.length,s=i.types.length;o*s>1e6&&e.tracing.instant("checkTypes","traceUnionsOrIntersectionsTooLarge_DepthLimit",{sourceId:t.id,sourceSize:o,targetId:r.id,targetSize:s,pos:null==a?void 0:a.pos,end:null==a?void 0:a.end});}}function K(e,t){for(var r=-1,n=0,i=e.types;n<i.length;n++){var a=V(i[n],t,!1);if(!a)return 0;r&=a;}return r}function V(e,t,r){var n=t.types;if(1048576&t.flags){if(ju(n,e))return -1;var i=Og(t,e);if(i&&(s=J(e,i,2,!1)))return s}for(var a=0,o=n;a<o.length;a++){var s;if(s=J(e,o[a],2,!1))return s}return r&&J(e,Ep(e,t,J)||n[n.length-1],2,!0),0}function q(e,t,r,n){var i=e.types;if(1048576&e.flags&&ju(i,t))return -1;for(var a=i.length,o=0;o<a;o++){var s=J(i[o],t,1,r&&o===a-1,void 0,n);if(s)return s}return 0}function W(t,r,n,a,o){if(x)return 0;var s=a|(T?16:0),c=Mp(t,r,s,i,!1),l=i.get(c);if(void 0!==l&&(!(n&&2&l)||4&l)){if(Sr){var u=24&l;8&u&&Rd(t,xd(Q)),16&u&&Rd(t,xd(X));}return 1&l?-1:0}if(p){for(var _=c.startsWith("*")?Mp(t,r,s,i,!0):void 0,d=0;d<y;d++)if(c===p[d]||_&&_===p[d])return 3;if(100===v||100===h)return x=!0,0}else p=[],f=[],g=[];var m=y;p[y]=c,y++;var D,S=b;1&o&&(f[v]=t,v++,1&b||!jp(t,f,v)||(b|=1)),2&o&&(g[h]=r,h++,2&b||!jp(r,g,h)||(b|=2));var C=0;Sr&&(D=Sr,Sr=function(e){return C|=e?16:8,D(e)}),3===b&&(null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","recursiveTypeRelatedTo_DepthLimit",{sourceId:t.id,sourceIdStack:f.map((function(e){return e.id})),targetId:r.id,targetIdStack:g.map((function(e){return e.id})),depth:v,targetDepth:h}));var E=3!==b?G(t,r,n,a):3;if(Sr&&(Sr=D),1&o&&v--,2&o&&h--,b=S,E){if(-1===E||0===v&&0===h){if(-1===E||3===E)for(d=m;d<y;d++)i.set(p[d],1|C);y=m;}}else i.set(c,2|(n?4:0)|C),y=m;return E}function G(t,r,a,o){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","structuredTypeRelatedTo",{sourceId:t.id,targetId:r.id});var s=function(t,r,a,o){if(4&o)return ee(t,r,a,void 0,0);if(8&o){if(1048576&t.flags)return i===Sn?q(t,r,a&&!(131068&t.flags),-9&o):function(e,t,r,n){for(var i=-1,a=e.types,o=function(e,t){return 1048576&e.flags&&1048576&t.flags&&!(32768&e.types[0].flags)&&32768&t.types[0].flags?dm(t,-32769):t}(e,t),s=0;s<a.length;s++){var c=a[s];if(1048576&o.flags&&a.length>=o.types.length&&a.length%o.types.length==0){var l=J(c,o.types[s%o.types.length],3,!1,void 0,n);if(l){i&=l;continue}}var u=J(c,t,1,r,void 0,n);if(!u)return 0;i&=u;}return i}(t,r,a&&!(131068&t.flags),-9&o);if(1048576&r.flags)return V(If(t),r,a&&!(131068&t.flags)&&!(131068&r.flags));if(2097152&r.flags)return function(e,t,r,n){for(var i=-1,a=0,o=t.types;a<o.length;a++){var s=J(e,o[a],2,r,void 0,2);if(!s)return 0;i&=s;}return i}(If(t),r,a);if(i===Sn&&131068&r.flags){var s=e.sameMap(t.types,Cc);if(s!==t.types&&!(2097152&(t=$u(s)).flags))return J(t,r,1,!1)}return q(t,r,!1,1)}var c,l,_=t.flags&r.flags;if(i===Tn&&!(524288&_)){if(4194304&_)return J(t.type,r.type,3,!1);var d=0;return 8388608&_&&(d=J(t.objectType,r.objectType,3,!1))&&(d&=J(t.indexType,r.indexType,3,!1))||16777216&_&&t.root.isDistributive===r.root.isDistributive&&(d=J(t.checkType,r.checkType,3,!1))&&(d&=J(t.extendsType,r.extendsType,3,!1))&&(d&=J(j_(t),j_(r),3,!1))&&(d&=J(J_(t),J_(r),3,!1))?d:33554432&_?J(t.substitute,r.substitute,3,!1):0}var p,m,y=!1,b=I();if(17301504&t.flags&&t.aliasSymbol&&t.aliasTypeArguments&&t.aliasSymbol===r.aliasSymbol&&!t.aliasTypeArgumentsContainsMarker&&!r.aliasTypeArgumentsContainsMarker){if((_e=Ap(t.aliasSymbol))===e.emptyArray)return 1;if(void 0!==(de=ye(t.aliasTypeArguments,r.aliasTypeArguments,_e,o)))return de}if(pf(t)&&!t.target.readonly&&(c=J(zl(t)[0],r,1))||pf(r)&&(r.target.readonly||Hp(Tc(t)||t))&&(c=J(t,zl(r)[0],2)))return c;if(262144&r.flags){if(32&e.getObjectFlags(t)&&!t.declaration.nameType&&J(c_(r),nc(t),3)&&!(4&lc(t))){var x=ac(t),D=F_(r,rc(t));if(c=J(x,D,3,a))return c}}else if(4194304&r.flags){var S=r.type;if(4194304&t.flags&&(c=J(S,t.type,3,!1)))return c;if(_f(S)){if(c=J(t,Mu(S),2,a))return c}else if(re=bc(S)){if(-1===J(t,c_(re,r.stringsOnly),2,a))return -1}else if(dc(S)){var T=ic(S),C=nc(S),E=void 0;if(T&&sc(S)){var k=Ac(cc(S)),N=[];tc(k,8576,!1,(function(e){N.push(Rd(T,Ed(S.mapper,rc(S),e)));})),E=qu(n$3(n$3([],N,!0),[T],!1));}else E=T||C;if(-1===J(t,E,2,a))return -1}}else if(8388608&r.flags){if(8388608&t.flags){if((c=J(t.objectType,r.objectType,3,a))&&(c&=J(t.indexType,r.indexType,3,a)),c)return w(b),c;a&&(l=u);}if(i===Dn||i===Sn){var F=r.objectType,A=r.indexType,P=Tc(F)||F,O=Tc(A)||A;if(!x_(P)&&!D_(O)&&(re=P_(P,O,4|(P!==F?2:0)))){if(a&&l&&w(b),c=J(t,re,2,a))return c;a&&l&&u&&(u=me([l])<=me([u])?l:u);}}a&&(l=void 0);}else if(dc(r)&&i!==Tn){var M=!!r.declaration.nameType,L=(x=ac(r),lc(r));if(!(8&L)){if(!M&&8388608&x.flags&&x.objectType===t&&x.indexType===rc(r))return -1;if(!dc(t)){E=M?ic(r):nc(r);var R=c_(t,void 0,!0),B=4&L,z=B?Gs(E,R):void 0;if(B?!(131072&z.flags):J(E,R,3)){var U=ac(r),K=rc(r),W=dm(U,-98305);if(!M&&8388608&W.flags&&W.indexType===K){if(c=J(t,W.objectType,2,a))return c}else if(D=F_(t,M?z||E:z?$u([z,K]):K),c=J(D,U,3,a))return c}l=u,w(b);}}}else if(16777216&r.flags){if(jp(r,g,h,10))return w(b),3;var G=r;if(!(G.root.inferTypeParameters||(p=G.root).isDistributive&&(Ad(p.checkType,p.node.trueType)||Ad(p.checkType,p.node.falseType)))){var Y=!Yd(jd(G.checkType),jd(G.extendsType)),Z=!Y&&Yd(Jd(G.checkType),Jd(G.extendsType));if((c=Y?-1:J(t,j_(G),2,!1))&&(c&=Z?-1:J(t,J_(G),2,!1)))return w(b),c}}else if(134217728&r.flags){if(134217728&t.flags){if(i===Sn)return function(e,t){var r=e.texts[0],n=t.texts[0],i=e.texts[e.texts.length-1],a=t.texts[t.texts.length-1],o=Math.min(r.length,n.length),s=Math.min(i.length,a.length);return r.slice(0,o)!==n.slice(0,o)||i.slice(i.length-s)!==a.slice(a.length-s)}(t,r)?0:-1;Rd(t,xd(X));}if(_g(t,r))return -1}if(8650752&t.flags){if(!(8388608&t.flags&&8388608&r.flags))if(!(re=vc(t))||262144&t.flags&&1&re.flags){if(c=J(mt,dm(r,-67108865),3))return w(b),c}else {if(c=J(re,r,1,!1,void 0,o))return w(b),c;if(c=J(Ls(re,t),r,1,a&&!(r.flags&t.flags&262144),void 0,o))return w(b),c}}else if(4194304&t.flags){if(c=J(_t,r,1,a))return w(b),c}else if(134217728&t.flags&&!(524288&r.flags)){if(!(134217728&r.flags)&&(re=Tc(t))&&re!==t&&(c=J(re,r,1,a)))return w(b),c}else if(268435456&t.flags){var re;if(268435456&r.flags&&t.symbol===r.symbol){if(c=J(t.type,r.type,3,a))return w(b),c}else if((re=Tc(t))&&(c=J(re,r,1,a)))return w(b),c}else if(16777216&t.flags){if(jp(t,f,v,10))return w(b),3;if(16777216&r.flags){var ne=t.root.inferTypeParameters,ie=t.extendsType,ae=void 0;if(ne){var oe=Wf(ne,void 0,0,j);fg(oe.inferences,r.extendsType,ie,1536),ie=Rd(ie,oe.mapper),ae=oe.mapper;}if(Wd(ie,r.extendsType)&&(J(t.checkType,r.checkType,3)||J(r.checkType,t.checkType,3))&&((c=J(Rd(j_(t),ae),j_(r),3,a))&&(c&=J(J_(t),J_(r),3,a)),c))return w(b),c}else {var ce=Dc(t);if(ce&&(c=J(ce,r,1,a)))return w(b),c}var le=xc(t);if(le&&(c=J(le,r,1,a)))return w(b),c}else {if(i!==bn&&i!==xn&&(m=r,32&e.getObjectFlags(m)&&4&lc(m))&&fp(t))return -1;if(dc(r))return dc(t)&&(c=function(e,t,r){var n;if((i===Sn||(i===Tn?lc(e)===lc(t):_c(e)<=_c(t)))&&(n=J(nc(t),Rd(nc(e),xd(_c(e)<0?Q:X)),3,r))){var a=vd([rc(e)],[rc(t)]);if(Rd(ic(e),a)===Rd(ic(t),a))return n&J(Rd(ac(e),a),ac(t),3,r)}return 0}(t,r,a))?(w(b),c):0;var ue=!!(131068&t.flags);if(i!==Tn)t=Ac(t);else if(dc(t))return 0;if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&t.target===r.target&&!_f(t)&&!(4096&e.getObjectFlags(t)||4096&e.getObjectFlags(r))){var _e,de;if((_e=wp(t.target))===e.emptyArray)return 1;if(void 0!==(de=ye(zl(t),zl(r),_e,o)))return de}else {if(Wp(r)?qp(t)||_f(t):qp(r)&&_f(t)&&!t.target.readonly)return i!==Tn?J(Qc(t,Ge)||we,Qc(r,Ge)||we,3,a):0;if((i===bn||i===xn)&&fp(r)&&16384&e.getObjectFlags(r)&&!fp(t))return 0}if(2621440&t.flags&&524288&r.flags){var pe=a&&u===b.errorInfo&&!ue;if((c=ee(t,r,pe,void 0,o))&&(c&=te(t,r,0,pe))&&(c&=te(t,r,1,pe))&&(c&=se(t,r,ue,pe,o)),y&&c)u=l||u||b.errorInfo;else if(c)return c}if(2621440&t.flags&&1048576&r.flags){var fe=dm(r,36175872);if(1048576&fe.flags){var ge=function(t,r){var n=Pg(yc(t),r);if(!n)return 0;for(var a=1,o=0,s=n;o<s.length;o++)if((a*=cm(Ko(_=s[o])))>25)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","typeRelatedToDiscriminatedType_DepthLimit",{sourceId:t.id,targetId:r.id,numCombinations:a}),0;for(var c=new Array(n.length),l=new e.Set,u=0;u<n.length;u++){var _,d=Ko(_=n[u]);c[u]=1048576&d.flags?d.types:[d],l.add(_.escapedName);}for(var p=e.cartesianProduct(c),f=[],g=function(a){var o=!1;e:for(var s=0,c=r.types;s<c.length;s++){for(var l=c[s],u=function(e){var o=n[e],s=Jc(l,o.escapedName);return s?o===s?"continue":$(t,r,o,s,(function(t){return a[e]}),!1,0,H||i===Sn)?void 0:"continue-outer":"continue-outer"},_=0;_<n.length;_++)switch(u(_)){case"continue-outer":continue e}e.pushIfUnique(f,l,e.equateValues),o=!0;}if(!o)return {value:0}},m=0,y=p;m<y.length;m++){var v=g(y[m]);if("object"==typeof v)return v.value}for(var h=-1,b=0,x=f;b<x.length;b++){var D=x[b];if((h&=ee(t,D,!1,l,0))&&(h&=te(t,D,0,!1))&&(!(h&=te(t,D,1,!1))||_f(t)&&_f(D)||(h&=se(t,D,!1,!1,0))),!h)return h}return h}(t,fe);if(ge)return ge}}}return 0;function me(t){return t?e.reduceLeft(t,(function(e,t){return e+1+me(t.next)}),0):0}function ye(t,r,n,o){if(c=function(t,r,n,a,o){if(void 0===t&&(t=e.emptyArray),void 0===r&&(r=e.emptyArray),void 0===n&&(n=e.emptyArray),t.length!==r.length&&i===Tn)return 0;for(var s=t.length<=r.length?t.length:r.length,c=-1,l=0;l<s;l++){var u=l<n.length?n[l]:1,_=7&u;if(4!==_){var d=t[l],p=r[l],f=-1;if(8&u?f=i===Tn?J(d,p,3,!1):Hd(d,p):1===_?f=J(d,p,3,a,void 0,o):2===_?f=J(p,d,3,a,void 0,o):3===_?(f=J(p,d,3,!1))||(f=J(d,p,3,a,void 0,o)):(f=J(d,p,3,a,void 0,o))&&(f&=J(p,d,3,a,void 0,o)),!f)return 0;c&=f;}}return c}(t,r,n,a,o))return c;if(e.some(n,(function(e){return !!(24&e)})))return l=void 0,void w(b);var s=r&&function(e,t){for(var r=0;r<t.length;r++)if(1==(7&t[r])&&16384&e[r].flags)return !0;return !1}(r,n);if(y=!s,n!==e.emptyArray&&!s){if(y&&(!a||!e.some(n,(function(e){return 0==(7&e)}))))return 0;l=u,w(b);}}}(t,r,a,o);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function Q(e){return !Sr||e!==Ct&&e!==Et&&e!==Tr||Sr(!1),e}function X(e){return !Sr||e!==Ct&&e!==Et&&e!==Tr||Sr(!0),e}function Z(e,t){if(!t||0===e.length)return e;for(var r,n=0;n<e.length;n++)t.has(e[n].escapedName)?r||(r=e.slice(0,n)):r&&r.push(e[n]);return r||e}function $(t,r,n,i,a,o,s,c){var l=e.getDeclarationModifierFlagsFromSymbol(n),u=e.getDeclarationModifierFlagsFromSymbol(i);if(8&l||8&u){if(n.valueDeclaration!==i.valueDeclaration)return o&&(8&l&&8&u?L(e.Diagnostics.Types_have_separate_declarations_of_a_private_property_0,Ia(i)):L(e.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2,Ia(i),Ma(8&l?t:r),Ma(8&l?r:t))),0}else if(16&u){if(!function(t,r){return !Lp(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r))&&(n=t,i=Rp(r),!Lp(n,(function(e){var t=Rp(e);return !!t&&Wo(t,i)})));var n,i;}))}(n,i))return o&&L(e.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2,Ia(i),Ma(Rp(n)||t),Ma(Rp(i)||r)),0}else if(16&l)return o&&L(e.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2,Ia(i),Ma(t),Ma(r)),0;var _=function(t,r,n,i,a){var o=H&&!!(48&e.getCheckFlags(r)),s=go(Ko(r),!1,o);return J(n(t),s,3,i,void 0,a)}(n,i,a,o,s);return _?c||!(16777216&n.flags)||16777216&i.flags?_:(o&&L(e.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2,Ia(i),Ma(t),Ma(r)),0):(o&&O(e.Diagnostics.Types_of_property_0_are_incompatible,Ia(i)),0)}function ee(t,r,a,s,c){if(i===Tn)return function(e,t,r){if(!(524288&e.flags&&524288&t.flags))return 0;var n=Z(fc(e),r),i=Z(fc(t),r);if(n.length!==i.length)return 0;for(var a=-1,o=0,s=n;o<s.length;o++){var c=s[o],l=gc(t,c.escapedName);if(!l)return 0;var u=Up(c,l,J);if(!u)return 0;a&=u;}return a}(t,r,s);var _=-1;if(_f(r)){if(qp(t)||_f(t)){if(!r.target.readonly&&(Wp(t)||_f(t)&&t.target.readonly))return 0;var p=Ul(t),f=Ul(r),g=_f(t)?4&t.target.combinedFlags:4,m=4&r.target.combinedFlags,y=_f(t)?t.target.minLength:0,v=r.target.minLength;if(!g&&p<v)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_requires_1,p,v),0;if(!m&&f<y)return a&&L(e.Diagnostics.Source_has_0_element_s_but_target_allows_only_1,y,f),0;if(!m&&(g||f<p))return a&&(y<v?L(e.Diagnostics.Target_requires_0_element_s_but_source_may_have_fewer,v):L(e.Diagnostics.Target_allows_only_0_element_s_but_source_may_have_more,f)),0;for(var h=zl(t),b=zl(r),x=Math.min(_f(t)?Lu(t.target,11):0,Lu(r.target,11)),S=Math.min(_f(t)?Ru(t.target,11):0,m?Ru(r.target,11):0),T=!!s,C=0;C<f;C++){var E=C<f-S?C:C+p-f,k=_f(t)&&(C<x||C>=f-S)?t.target.elementFlags[E]:4,N=r.target.elementFlags[C];if(8&N&&!(8&k))return a&&L(e.Diagnostics.Source_provides_no_match_for_variadic_element_at_position_0_in_target,C),0;if(8&k&&!(12&N))return a&&L(e.Diagnostics.Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target,E,C),0;if(1&N&&!(1&k))return a&&L(e.Diagnostics.Source_provides_no_match_for_required_element_at_position_0_in_target,C),0;if(!(T&&((12&k||12&N)&&(T=!1),T&&(null==s?void 0:s.has(""+C))))){var F=_f(t)?C<x||C>=f-S?Nf(h[E],!!(k&N&2)):gf(t,x,S)||nt:h[0],A=b[C];if(!(W=J(F,8&k&&4&N?Tu(A):Nf(A,!!(2&N)),3,a,void 0,c)))return a&&(f>1||p>1)&&(C<x||C>=f-S||p-x-S==1?O(e.Diagnostics.Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target,E,C):O(e.Diagnostics.Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target,x,p-S-1,C)),0;_&=W;}}return _}if(12&r.target.combinedFlags)return 0}var P=!(i!==bn&&i!==xn||yg(t)||Zp(t)||_f(t)),w=og(t,r,P,!1);if(w)return a&&function(t,r,i,a){var s=!1;if(i.valueDeclaration&&e.isNamedDeclaration(i.valueDeclaration)&&e.isPrivateIdentifier(i.valueDeclaration.name)&&t.symbol&&32&t.symbol.flags){var c=i.valueDeclaration.name.escapedText,_=e.getSymbolNameForPrivateIdentifier(t.symbol,c);if(_&&Jc(t,_)){var p=e.factory.getDeclarationName(t.symbol.valueDeclaration),f=e.factory.getDeclarationName(r.symbol.valueDeclaration);return void L(e.Diagnostics.Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2,ai(c),ai(""===p.escapedText?l:p),ai(""===f.escapedText?l:f))}}var g,m=e.arrayFrom(ag(t,r,a,!1));if((!o||o.code!==e.Diagnostics.Class_0_incorrectly_implements_interface_1.code&&o.code!==e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code)&&(s=!0),1===m.length){var y=Ia(i);L.apply(void 0,n$3([e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2,y],La(t,r),!1)),e.length(i.declarations)&&(g=e.createDiagnosticForNode(i.declarations[0],e.Diagnostics._0_is_declared_here,y),e.Debug.assert(!!u),d?d.push(g):d=[g]),s&&u&&D++;}else B(t,r,!1)&&(m.length>5?L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more,Ma(t),Ma(r),e.map(m.slice(0,4),(function(e){return Ia(e)})).join(", "),m.length-4):L(e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2,Ma(t),Ma(r),e.map(m,(function(e){return Ia(e)})).join(", ")),s&&u&&D++);}(t,r,w,P),0;if(yg(r))for(var I=0,M=Z(yc(t),s);I<M.length;I++)if(!(gc(r,(K=M[I]).escapedName)||32768&(F=Uo(K)).flags))return a&&L(e.Diagnostics.Property_0_does_not_exist_on_type_1,Ia(K),Ma(r)),0;for(var R=yc(r),j=_f(t)&&_f(r),z=0,U=Z(R,s);z<U.length;z++){var K,V=U[z],q=V.escapedName;if(!(4194304&V.flags)&&(!j||ky(q)||"length"===q)&&(K=Jc(t,q))&&K!==V){var W;if(!(W=$(t,r,K,V,Ko,a,c,i===Sn)))return 0;_&=W;}}return _}function te(t,r,n,a){var o,s;if(i===Tn)return function(e,t,r){var n=Uc(e,r),i=Uc(t,r);if(n.length!==i.length)return 0;for(var a=-1,o=0;o<n.length;o++){var s=Kp(n[o],i[o],!1,!1,!1,J);if(!s)return 0;a&=s;}return a}(t,r,n);if(r===xt||t===xt)return -1;var c=t.symbol&&Fh(t.symbol.valueDeclaration),l=r.symbol&&Fh(r.symbol.valueDeclaration),u=Uc(t,c&&1===n?0:n),_=Uc(r,l&&1===n?0:n);if(1===n&&u.length&&_.length){var d=!!(4&u[0].flags),p=!!(4&_[0].flags);if(d&&!p)return a&&L(e.Diagnostics.Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type),0;if(!function(t,r,n){if(!t.declaration||!r.declaration)return !0;var i=e.getSelectedEffectiveModifierFlags(t.declaration,24),a=e.getSelectedEffectiveModifierFlags(r.declaration,24);return 8===a||(16===a&&8!==i||(16!==a&&!i||(n&&L(e.Diagnostics.Cannot_assign_a_0_constructor_type_to_a_1_constructor_type,Ua(i),Ua(a)),!1)))}(u[0],_[0],a))return 0}var f=-1,g=I(),m=1===n?ie:ne,y=e.getObjectFlags(t),v=e.getObjectFlags(r);if(64&y&&64&v&&t.symbol===r.symbol)for(var h=0;h<_.length;h++){if(!(A=ae(u[h],_[h],!0,a,m(u[h],_[h]))))return 0;f&=A;}else if(1===u.length&&1===_.length){var b=i===Sn||!!U.noStrictGenericChecks,x=e.first(u),D=e.first(_);if(!(f=ae(x,D,b,a,m(x,D)))&&a&&1===n&&y&v&&(170===(null===(o=D.declaration)||void 0===o?void 0:o.kind)||170===(null===(s=x.declaration)||void 0===s?void 0:s.kind))){var S=function(e){return Oa(e,void 0,262144,n)};return L(e.Diagnostics.Type_0_is_not_assignable_to_type_1,S(x),S(D)),L(e.Diagnostics.Types_of_construct_signatures_are_incompatible),f}}else e:for(var T=0,C=_;T<C.length;T++){for(var E=C[T],k=a,N=0,F=u;N<F.length;N++){var A,P=F[N];if(A=ae(P,E,!0,k,m(P,E))){f&=A,w(g);continue e}k=!1;}return k&&L(e.Diagnostics.Type_0_provides_no_match_for_the_signature_1,Ma(t),Oa(E,void 0,void 0,n)),0}return f}function ne(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Ma(t),Ma(r))}:function(t,r){return O(e.Diagnostics.Call_signature_return_types_0_and_1_are_incompatible,Ma(t),Ma(r))}}function ie(t,r){return 0===t.parameters.length&&0===r.parameters.length?function(t,r){return O(e.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1,Ma(t),Ma(r))}:function(t,r){return O(e.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible,Ma(t),Ma(r))}}function ae(e,t,r,n,a){return dp(r?Sl(e):e,r?Sl(t):t,i===xn?8:0,n,L,a,j,xd(X))}function oe(t,r,n){var i=J(t.type,r.type,3,n);return !i&&n&&(t.keyType===r.keyType?L(e.Diagnostics._0_index_signatures_are_incompatible,Ma(t.keyType)):L(e.Diagnostics._0_and_1_index_signatures_are_incompatible,Ma(t.keyType),Ma(r.keyType))),i}function se(t,r,n,a,o){if(i===Tn)return function(e,t){var r=Hc(e),n=Hc(t);if(r.length!==n.length)return 0;for(var i=0,a=n;i<a.length;i++){var o=a[i],s=Gc(e,o.keyType);if(!s||!J(s.type,o.type,3)||s.isReadonly!==o.isReadonly)return 0}return -1}(t,r);for(var s=Hc(r),c=e.some(s,(function(e){return e.keyType===He})),l=-1,u=0,_=s;u<_.length;u++){var d=_[u],p=!n&&c&&1&d.type.flags?-1:dc(t)&&c?J(ac(t),d.type,3,a):ce(t,d,a,o);if(!p)return 0;l&=p;}return l}function ce(t,r,n,i){var a=Yc(t,r.keyType);return a?oe(a,r,n):1&i||!Pf(t)?(n&&L(e.Diagnostics.Index_signature_for_type_0_is_missing_in_type_1,Ma(r.keyType),Ma(t)),0):function(t,r,n){for(var i=-1,a=r.keyType,o=0,s=2097152&t.flags?mc(t):fc(t);o<s.length;o++){var c=s[o];if(!bp(t,c)&&qc(a_(c,8576),a)){var l=Ko(c);if(!(p=J(re||32768&l.flags||a===Ge||!(16777216&c.flags)?l:Jg(l,524288),r.type,3,n)))return n&&L(e.Diagnostics.Property_0_is_incompatible_with_index_signature,Ia(c)),0;i&=p;}}for(var u=0,_=Hc(t);u<_.length;u++){var d=_[u];if(qc(d.keyType,a)){var p;if(!(p=oe(d,r,n)))return 0;i&=p;}}return i}(t,r,n)}}function Sp(t){if(16&t.flags)return !1;if(3145728&t.flags)return !!e.forEach(t.types,Sp);if(465829888&t.flags){var r=vc(t);if(r&&r!==t)return Sp(r)}return rf(t)||!!(134217728&t.flags)}function Tp(t,r){return _f(t)&&_f(r)?e.emptyArray:yc(r).filter((function(e){return Cp(eo(t,e.escapedName),Uo(e))}))}function Cp(e,t){return !!e&&!!t&&Eb(e,32768)&&!!Ff(t)}function Ep(t,r,n){return void 0===n&&(n=Gd),rC(t,r,n,!0)||function(t,r){var n=e.getObjectFlags(t);if(20&n&&1048576&r.flags)return e.find(r.types,(function(r){if(524288&r.flags){var i=n&e.getObjectFlags(r);if(4&i)return t.target===r.target;if(16&i)return !!t.aliasSymbol&&t.aliasSymbol===r.aliasSymbol}return !1}))}(t,r)||function(t,r){if(128&e.getObjectFlags(t)&&im(r,Qp))return e.find(r.types,(function(e){return !Qp(e)}))}(t,r)||function(t,r){var n=0;if(Uc(t,n).length>0||Uc(t,n=1).length>0)return e.find(r.types,(function(e){return Uc(e,n).length>0}))}(t,r)||function(t,r){for(var n,i=0,a=0,o=r.types;a<o.length;a++){var s=o[a],c=$u([c_(t),c_(s)]);if(4194304&c.flags)n=s,i=1/0;else if(1048576&c.flags){var l=e.length(e.filter(c.types,rf));l>=i&&(n=s,i=l);}else rf(c)&&1>=i&&(n=s,i=1);}return n}(t,r)}function kp(t,r,n,i,a){for(var o=t.types.map((function(e){})),s=0,c=r;s<c.length;s++){var l=c[s],u=l[0],_=l[1],d=Ic(t,_);if(!(a&&d&&16&e.getCheckFlags(d)))for(var p=0,f=0,g=t.types;f<g.length;f++){var m=eo(g[f],_);m&&n(u(),m)?o[p]=void 0===o[p]||o[p]:o[p]=!1,p++;}}var y=o.indexOf(!0);if(-1===y)return i;for(var v=o.indexOf(!0,y+1);-1!==v;){if(!Wd(t.types[y],t.types[v]))return i;v=o.indexOf(!0,v+1);}return t.types[y]}function Np(t){if(524288&t.flags){var r=pc(t);return 0===r.callSignatures.length&&0===r.constructSignatures.length&&0===r.indexInfos.length&&r.properties.length>0&&e.every(r.properties,(function(e){return !!(16777216&e.flags)}))}return !!(2097152&t.flags)&&e.every(t.types,Np)}function Fp(t,r,n){var i=Bl(t,e.map(t.typeParameters,(function(e){return e===r?n:e})));return i.objectFlags|=4096,i}function Ap(e){var t=Gn(e);return Pp(t.typeParameters,t,(function(r,n,i){var a=Vl(e,gd(t.typeParameters,bd(n,i)));return a.aliasTypeArgumentsContainsMarker=!0,a}))}function Pp(t,r,n){var i,a,o;void 0===t&&(t=e.emptyArray);var s=r.variances;if(!s){null===e.tracing||void 0===e.tracing||e.tracing.push("checkTypes","getVariancesWorker",{arity:t.length,id:null!==(o=null!==(i=r.id)&&void 0!==i?i:null===(a=r.declaredType)||void 0===a?void 0:a.id)&&void 0!==o?o:-1}),r.variances=e.emptyArray,s=[];for(var c=function(e){var t=!1,i=!1,a=Sr;Sr=function(e){return e?i=!0:t=!0};var o=n(r,e,Ct),c=n(r,e,Et),l=(Yd(c,o)?1:0)|(Yd(o,c)?2:0);3===l&&Yd(n(r,e,Tr),o)&&(l=4),Sr=a,(t||i)&&(t&&(l|=8),i&&(l|=16)),s.push(l);},l=0,u=t;l<u.length;l++)c(u[l]);r.variances=s,null===e.tracing||void 0===e.tracing||e.tracing.pop();}return s}function wp(e){return e===Mt||e===Lt||8&e.objectFlags?N:Pp(e.typeParameters,e,Fp)}function Ip(e){return 262144&e.flags&&!hc(e)}function Op(t){return function(t){return !!(4&e.getObjectFlags(t))&&!t.node}(t)&&e.some(zl(t),(function(e){return !!(262144&e.flags)||Op(e)}))}function Mp(e,t,r,n,i){if(n===Tn&&e.id>t.id){var a=e;e=t,t=a;}var o=r?":"+r:"";return Op(e)&&Op(t)?function(e,t,r,n){var i=[],a="",o=c(e,0),s=c(t,0);return "".concat(a).concat(o,",").concat(s).concat(r);function c(e,t){void 0===t&&(t=0);for(var r=""+e.target.id,o=0,s=zl(e);o<s.length;o++){var l=s[o];if(262144&l.flags){if(n||Ip(l)){var u=i.indexOf(l);u<0&&(u=i.length,i.push(l)),r+="="+u;continue}a="*";}else if(t<4&&Op(l)){r+="<"+c(l,t+1)+">";continue}r+="-"+l.id;}return r}}(e,t,o,i):"".concat(e.id,",").concat(t.id).concat(o)}function Lp(t,r){if(!(6&e.getCheckFlags(t)))return r(t);for(var n=0,i=t.containingType.types;n<i.length;n++){var a=Jc(i[n],t.escapedName),o=a&&Lp(a,r);if(o)return o}}function Rp(e){return e.parent&&32&e.parent.flags?ms(ea(e)):void 0}function Bp(e){var t=Rp(e),r=t&&is(t)[0];return r&&eo(r,e.escapedName)}function jp(e,t,r,n){if(void 0===n&&(n=3),r>=n)for(var i=Jp(e),a=0,o=0,s=0;s<r;s++){var c=t[s];if(Jp(c)===i){if(c.id>=o&&++a>=n)return !0;o=c.id;}}return !1}function Jp(t){if(524288&t.flags&&!vg(t)){if(e.getObjectFlags(t)&&t.node)return t.node;if(t.symbol&&!(16&e.getObjectFlags(t)&&32&t.symbol.flags))return t.symbol;if(_f(t))return t.target}if(262144&t.flags)return t.symbol;if(8388608&t.flags){do{t=t.objectType;}while(8388608&t.flags);return t}return 16777216&t.flags?t.root:t}function zp(e,t){return 0!==Up(e,t,Hd)}function Up(t,r,n){if(t===r)return -1;var i=24&e.getDeclarationModifierFlagsFromSymbol(t);if(i!==(24&e.getDeclarationModifierFlagsFromSymbol(r)))return 0;if(i){if(tS(t)!==tS(r))return 0}else if((16777216&t.flags)!=(16777216&r.flags))return 0;return Db(t)!==Db(r)?0:n(Uo(t),Uo(r))}function Kp(t,r,n,i,a,o){if(t===r)return -1;if(!function(e,t,r){var n=Zh(e),i=Zh(t),a=$h(e),o=$h(t),s=eb(e),c=eb(t);return n===i&&a===o&&s===c||!!(r&&a<=o)}(t,r,n))return 0;if(e.length(t.typeParameters)!==e.length(r.typeParameters))return 0;if(r.typeParameters){for(var s=vd(t.typeParameters,r.typeParameters),c=0;c<r.typeParameters.length;c++)if(!((g=t.typeParameters[c])===(p=r.typeParameters[c])||o(Rd(Il(g),s)||je,Il(p)||je)&&o(Rd(Fc(g),s)||je,Fc(p)||je)))return 0;t=Nd(t,s,!0);}var l=-1;if(!i){var u=pl(t);if(u){var _=pl(r);if(_){if(!(f=o(u,_)))return 0;l&=f;}}}var d=Zh(r);for(c=0;c<d;c++){var p,f,g=Qh(t,c);if(!(f=o(p=Qh(r,c),g)))return 0;l&=f;}if(!a){var m=fl(t),y=fl(r);l&=m||y?function(e,t,r){return e&&t&&Wu(e,t)?e.type===t.type?-1:e.type&&t.type?r(e.type,t.type):0:0}(m,y,o):o(ml(t),ml(r));}return l}function Vp(t){return 1===t.length?t[0]:function(e){for(var t,r=0,n=e;r<n.length;r++){var i=n[r],a=of(i);if(t||(t=a),a===i||a!==t)return !1}return !0}(t)?qu(t):e.reduceLeft(t,(function(e,t){return Xd(e,t)?t:e}))}function qp(t){return !!(4&e.getObjectFlags(t))&&(t.target===Mt||t.target===Lt)}function Wp(t){return !!(4&e.getObjectFlags(t))&&t.target===Lt}function Hp(e){return qp(e)&&!Wp(e)||_f(e)&&!e.target.readonly}function Gp(e){return qp(e)?zl(e)[0]:void 0}function Qp(e){return qp(e)||!(98304&e.flags)&&Yd(e,Vt)}function Xp(t){if(4&e.getObjectFlags(t)&&3&e.getObjectFlags(t.target)){if(33554432&e.getObjectFlags(t))return 67108864&e.getObjectFlags(t)?t.cachedEquivalentBaseType:void 0;t.objectFlags|=33554432;var r=t.target;if(1&e.getObjectFlags(r)){var n=$o(r);if(n&&79!==n.expression.kind&&205!==n.expression.kind)return}var i=is(r);if(1===i.length&&!Os(t.symbol).size){var a=e.length(r.typeParameters)?Rd(i[0],vd(r.typeParameters,zl(t).slice(0,r.typeParameters.length))):i[0];return e.length(zl(t))>e.length(r.typeParameters)&&(a=Ls(a,e.last(zl(t)))),t.objectFlags|=67108864,t.cachedEquivalentBaseType=a}}}function Yp(e){return H?e===ot:e===Ue}function Zp(e){var t=Gp(e);return !!t&&Yp(t)}function $p(e){return _f(e)||!!Jc(e,"0")}function ef(e){return Qp(e)||$p(e)}function tf(e){return !(240512&e.flags)}function rf(e){return !!(109440&e.flags)}function nf(t){return 2097152&t.flags?e.some(t.types,rf):!!(109440&t.flags)}function af(t){return !!(16&t.flags)||(1048576&t.flags?!!(1024&t.flags)||e.every(t.types,rf):rf(t))}function of(e){return 1024&e.flags?ds(e):128&e.flags?He:256&e.flags?Ge:2048&e.flags?Qe:512&e.flags?et:1048576&e.flags?lm(e,of):e}function sf(e){return 1024&e.flags&&nd(e)?ds(e):128&e.flags&&nd(e)?He:256&e.flags&&nd(e)?Ge:2048&e.flags&&nd(e)?Qe:512&e.flags&&nd(e)?et:1048576&e.flags?lm(e,sf):e}function cf(e){return 8192&e.flags?tt:1048576&e.flags?lm(e,cf):e}function lf(e,t){return qb(e,t)||(e=cf(sf(e))),e}function uf(e,t,r,n){return e&&rf(e)&&(e=lf(e,t?zD(r,t,n):void 0)),e}function _f(t){return !!(4&e.getObjectFlags(t)&&8&t.target.objectFlags)}function df(e){return _f(e)&&!!(8&e.target.combinedFlags)}function pf(e){return df(e)&&1===e.target.elementFlags.length}function ff(e){return gf(e,e.target.fixedLength)}function gf(e,t,r,n){void 0===r&&(r=0),void 0===n&&(n=!1);var i=Ul(e)-r;if(t<i){for(var a=zl(e),o=[],s=t;s<i;s++){var c=a[s];o.push(8&e.target.elementFlags[s]?F_(c,Ge):c);}return n?$u(o):qu(o)}}function mf(e){return "0"===e.value.base10Value}function yf(e){for(var t=0,r=0,n=e;r<n.length;r++)t|=vf(n[r]);return t}function vf(e){return 1048576&e.flags?yf(e.types):128&e.flags?""===e.value?128:0:256&e.flags?0===e.value?256:0:2048&e.flags?mf(e)?2048:0:512&e.flags?e===Xe||e===Ye?512:0:117724&e.flags}function hf(e){return 117632&vf(e)?om(e,(function(e){return !(117632&vf(e))})):e}function bf(e){return 4&e.flags?Wr:8&e.flags?Hr:64&e.flags?Gr:e===Ye||e===Xe||114691&e.flags||128&e.flags&&""===e.value||256&e.flags&&0===e.value||2048&e.flags&&mf(e)?e:nt}function xf(e,t){var r=t&~e.flags&98304;return 0===r?e:qu(32768===r?[e,ze]:65536===r?[e,qe]:[e,ze,qe])}function Df(t,r){return void 0===r&&(r=!1),e.Debug.assert(H),32768&t.flags?t:qu([t,r?Ve:ze])}function Sf(e){return H?function(e){var t=Jg(e,2097152);return qt||(qt=uu("NonNullable",524288,void 0)||Ne),qt!==Ne?Vl(qt,[t]):t}(e):e}function Tf(e){return H?qu([e,Ke]):e}function Cf(e){return H?sm(e,Ke):e}function Ef(t,r,n){return n?e.isOutermostOptionalChain(r)?Df(t):Tf(t):t}function kf(t,r){return e.isExpressionOfOptionalChainRoot(r)?Sf(t):e.isOptionalChain(r)?Cf(t):t}function Nf(e,t){return re&&t?sm(e,Ve):e}function Ff(e){return re&&(e===Ve||1048576&e.flags&&ju(e.types,Ve))}function Af(e){return re?sm(e,Ve):Jg(e,524288)}function Pf(t){return 2097152&t.flags?e.every(t.types,Pf):!(!t.symbol||0==(7040&t.symbol.flags)||US(t))||!!(1024&e.getObjectFlags(t)&&Pf(t.source))}function wf(t,r){var n=jn(t.flags,t.escapedName,8&e.getCheckFlags(t));n.declarations=t.declarations,n.parent=t.parent,n.type=r,n.target=t,t.valueDeclaration&&(n.valueDeclaration=t.valueDeclaration);var i=Gn(t).nameType;return i&&(n.nameType=i),n}function If(t){if(!(yg(t)&&16384&e.getObjectFlags(t)))return t;var r=t.regularType;if(r)return r;var n=t,i=function(t,r){for(var n=e.createSymbolTable(),i=0,a=fc(t);i<a.length;i++){var o=a[i],s=Uo(o),c=r(s);n.set(o.escapedName,c===s?o:wf(o,c));}return n}(t,If),a=ya(n.symbol,i,n.callSignatures,n.constructSignatures,n.indexInfos);return a.flags=n.flags,a.objectFlags|=-16385&n.objectFlags,t.regularType=a,a}function Of(e,t,r){return {parent:e,propertyName:t,siblings:r,resolvedProperties:void 0}}function Mf(e){if(!e.siblings){for(var t=[],r=0,n=Mf(e.parent);r<n.length;r++){var i=n[r];if(yg(i)){var a=gc(i,e.propertyName);a&&nm(Uo(a),(function(e){t.push(e);}));}}e.siblings=t;}return e.siblings}function Lf(t){if(!t.resolvedProperties){for(var r=new e.Map,n=0,i=Mf(t);n<i.length;n++){var a=i[n];if(yg(a)&&!(4194304&e.getObjectFlags(a)))for(var o=0,s=yc(a);o<s.length;o++){var c=s[o];r.set(c.escapedName,c);}}t.resolvedProperties=e.arrayFrom(r.values());}return t.resolvedProperties}function Rf(e,t){if(!(4&e.flags))return e;var r=Uo(e),n=Jf(r,t&&Of(t,e.escapedName,void 0));return n===r?e:wf(e,n)}function Bf(e){var t=ke.get(e.escapedName);if(t)return t;var r=wf(e,Ve);return r.flags|=16777216,ke.set(e.escapedName,r),r}function jf(e){return Jf(e,void 0)}function Jf(t,r){if(393216&e.getObjectFlags(t)){if(void 0===r&&t.widened)return t.widened;var n=void 0;if(98305&t.flags)n=we;else if(yg(t))n=function(t,r){for(var n=e.createSymbolTable(),i=0,a=fc(t);i<a.length;i++){var o=a[i];n.set(o.escapedName,Rf(o,r));}if(r)for(var s=0,c=Lf(r);s<c.length;s++)o=c[s],n.has(o.escapedName)||n.set(o.escapedName,Bf(o));var l=ya(t.symbol,n,e.emptyArray,e.emptyArray,e.sameMap(Hc(t),(function(e){return Nl(e.keyType,jf(e.type),e.isReadonly)})));return l.objectFlags|=532480&e.getObjectFlags(t),l}(t,r);else if(1048576&t.flags){var i=r||Of(void 0,void 0,t.types),a=e.sameMap(t.types,(function(e){return 98304&e.flags?e:Jf(e,i)}));n=qu(a,e.some(a,fp)?2:1);}else 2097152&t.flags?n=$u(e.sameMap(t.types,jf)):(qp(t)||_f(t))&&(n=Bl(t.target,e.sameMap(zl(t),jf)));return n&&void 0===r&&(t.widened=n),n||t}return t}function zf(t){var r=!1;if(131072&e.getObjectFlags(t)){if(1048576&t.flags)if(e.some(t.types,fp))r=!0;else for(var n=0,i=t.types;n<i.length;n++)zf(u=i[n])&&(r=!0);if(qp(t)||_f(t))for(var a=0,o=zl(t);a<o.length;a++)zf(u=o[a])&&(r=!0);if(yg(t))for(var s=0,c=fc(t);s<c.length;s++){var l=c[s],u=Uo(l);131072&e.getObjectFlags(u)&&(zf(u)||In(l.valueDeclaration,e.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type,Ia(l),Ma(jf(u))),r=!0);}}return r}function Uf(t,r,n){var i=Ma(jf(r));if(!e.isInJSFile(t)||e.isCheckJsEnabledForFile(e.getSourceFileOfNode(t),U)){var a;switch(t.kind){case 220:case 166:case 165:a=Y?e.Diagnostics.Member_0_implicitly_has_an_1_type:e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 163:var o=t;if(e.isIdentifier(o.name)&&(e.isCallSignatureDeclaration(o.parent)||e.isMethodSignature(o.parent)||e.isFunctionTypeNode(o.parent))&&o.parent.parameters.indexOf(o)>-1&&(ei(o,o.name.escapedText,788968,void 0,o.name.escapedText,!0)||o.name.originalKeywordKind&&e.isTypeNodeKind(o.name.originalKeywordKind))){var s="arg"+o.parent.parameters.indexOf(o),c=e.declarationNameToString(o.name)+(o.dotDotDotToken?"[]":"");return void Mn(Y,t,e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1,s,c)}a=t.dotDotDotToken?Y?e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type:e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage:Y?e.Diagnostics.Parameter_0_implicitly_has_an_1_type:e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;break;case 202:if(a=e.Diagnostics.Binding_element_0_implicitly_has_an_1_type,!Y)return;break;case 315:return void In(t,e.Diagnostics.Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);case 255:case 168:case 167:case 171:case 172:case 212:case 213:if(Y&&!t.name)return void In(t,3===n?e.Diagnostics.Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation:e.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type,i);a=Y?3===n?e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type:e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type:e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage;break;case 194:return void(Y&&In(t,e.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type));default:a=Y?e.Diagnostics.Variable_0_implicitly_has_an_1_type:e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;}Mn(Y,t,a,e.declarationNameToString(e.getNameOfDeclaration(t)),i);}}function Kf(t,n,i){!(r&&Y&&131072&e.getObjectFlags(n))||i&&xy(t)||zf(n)||Uf(t,n,i);}function Vf(e,t,r){var n=Zh(e),i=Zh(t),a=tb(e),o=tb(t),s=o?i-1:i,c=a?s:Math.min(n,s),l=pl(e);if(l){var u=pl(t);u&&r(l,u);}for(var _=0;_<c;_++)r(Qh(e,_),Qh(t,_));o&&r(Yh(e,c),o);}function qf(e,t,r){var n=fl(e),i=fl(t);n&&i&&Wu(n,i)&&n.type&&i.type?r(n.type,i.type):r(ml(e),ml(t));}function Wf(e,t,r,n){return Hf(e.map(Xf),t,r,n||Gd)}function Hf(e,t,r,n){var i={inferences:e,signature:t,flags:r,compareTypes:n,mapper:xd((function(e){return Gf(i,e,!0)})),nonFixingMapper:xd((function(e){return Gf(i,e,!1)}))};return i}function Gf(e,t,r){for(var n=e.inferences,i=0;i<n.length;i++){var a=n[i];if(t===a.typeParameter)return r&&!a.isFixed&&(Qf(n),a.isFixed=!0),hg(e,i)}return t}function Qf(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];n.isFixed||(n.inferredType=void 0);}}function Xf(e){return {typeParameter:e,candidates:void 0,contraCandidates:void 0,inferredType:void 0,priority:void 0,topLevel:!0,isFixed:!1,impliedArity:void 0}}function Yf(e){return {typeParameter:e.typeParameter,candidates:e.candidates&&e.candidates.slice(),contraCandidates:e.contraCandidates&&e.contraCandidates.slice(),inferredType:e.inferredType,priority:e.priority,topLevel:e.topLevel,isFixed:e.isFixed,impliedArity:e.impliedArity}}function Zf(e){return e&&e.mapper}function $f(t){var r=e.getObjectFlags(t);if(1048576&r)return !!(2097152&r);var n=!!(465829888&t.flags||524288&t.flags&&!eg(t)&&(4&r&&(t.node||e.forEach(zl(t),$f))||16&r&&t.symbol&&14384&t.symbol.flags&&t.symbol.declarations||8389664&r)||3145728&t.flags&&!(1024&t.flags)&&!eg(t)&&e.some(t.types,$f));return 3899393&t.flags&&(t.objectFlags|=1048576|(n?2097152:0)),n}function eg(t){if(t.aliasSymbol&&!t.aliasTypeArguments){var r=e.getDeclarationOfKind(t.aliasSymbol,258);return !(!r||!e.findAncestor(r.parent,(function(e){return 303===e.kind||260!==e.kind&&"quit"})))}return !1}function tg(t,r){return !!(t===r||3145728&t.flags&&e.some(t.types,(function(e){return tg(e,r)}))||16777216&t.flags&&(j_(t)===r||J_(t)===r))}function rg(t,r,n){if(!jr){var i=t.id+","+r.id+","+n.id;if(Br.has(i))return Br.get(i);jr=!0;var a=function(t,r,n){if(Gc(t,He)||0!==yc(t).length&&ng(t)){if(qp(t))return Tu(ig(zl(t)[0],r,n),Wp(t));if(_f(t))return Au(e.map(zl(t),(function(e){return ig(e,r,n)})),4&lc(r)?e.sameMap(t.target.elementFlags,(function(e){return 2&e?1:e})):t.target.elementFlags,t.target.readonly,t.target.labeledElementDeclarations);var i=_a(1040,void 0);return i.source=t,i.mappedType=r,i.constraintType=n,i}}(t,r,n);return jr=!1,Br.set(i,a),a}}function ng(t){return !(524288&e.getObjectFlags(t))||yg(t)&&e.some(yc(t),(function(e){return ng(Uo(e))}))||_f(t)&&e.some(zl(t),ng)}function ig(e,t,r){var n=F_(r.type,rc(t)),i=ac(t),a=Xf(n);return fg([a],e,i),sg(a)||je}function ag(t,r,n,i){var a,s,c,l,u,_,d;return o(this,(function(o){switch(o.label){case 0:a=yc(r),s=0,c=a,o.label=1;case 1:return s<c.length?Ts(l=c[s])||!n&&(16777216&l.flags||48&e.getCheckFlags(l))?[3,5]:(u=Jc(t,l.escapedName))?[3,3]:[4,l]:[3,6];case 2:return o.sent(),[3,5];case 3:return i&&109440&(_=Uo(l)).flags?1&(d=Uo(u)).flags||rd(d)===rd(_)?[3,5]:[4,l]:[3,5];case 4:o.sent(),o.label=5;case 5:return s++,[3,1];case 6:return [2]}}))}function og(e,t,r,n){var i=ag(e,t,r,n).next();if(!i.done)return i.value}function sg(e){return e.candidates?qu(e.candidates,2):e.contraCandidates?$u(e.contraCandidates):void 0}function cg(e){return !!Qn(e).skipDirectInference}function lg(t){return !(!t.symbol||!e.some(t.symbol.declarations,cg))}function ug(t,r){return 128&t.flags?pg([t.value],e.emptyArray,r):134217728&t.flags?e.arraysEqual(t.texts,r.texts)?e.map(t.types,dg):pg(t.texts,t.types,r):void 0}function _g(t,r){var n=ug(t,r);return !!n&&e.every(n,(function(t,n){return function(t,r){if(t===r||5&r.flags)return !0;if(128&t.flags){var n=t.value;return !!(8&r.flags&&""!==n&&isFinite(+n)||64&r.flags&&""!==n&&function(t){var r=e.createScanner(99,!1),n=!0;r.setOnError((function(){return n=!1})),r.setText(t+"n");var i=r.scan();40===i&&(i=r.scan());var a=r.getTokenFlags();return n&&9===i&&r.getTextPos()===t.length+1&&!(512&a)}(n)||98816&r.flags&&n===r.intrinsicName)}if(134217728&t.flags){var i=t.texts;return 2===i.length&&""===i[0]&&""===i[1]&&Yd(t.types[0],r)}return Yd(t,r)}(t,r.types[n])}))}function dg(e){return 402653317&e.flags?e:u_(["",""],[e])}function pg(e,t,r){var i=e.length-1,a=e[0],o=e[i],s=r.texts,c=s.length-1,l=s[0],u=s[c];if(!(0===i&&a.length<l.length+u.length)&&a.startsWith(l)&&o.endsWith(u)){for(var _=o.slice(0,o.length-u.length),d=[],p=0,f=l.length,g=1;g<c;g++){var m=s[g];if(m.length>0){for(var y=p,v=f;!((v=h(y).indexOf(m,v))>=0);){if(++y===e.length)return;v=0;}b(y,v),f+=m.length;}else if(f<h(p).length)b(p,f+1);else {if(!(p<i))return;b(p+1,0);}}return b(i,h(i).length),d}function h(t){return t<i?e[t]:_}function b(r,i){var a=r===p?id(h(r).slice(f,i)):u_(n$3(n$3([e[p].slice(f)],e.slice(p+1,r),!0),[h(r).slice(0,i)],!1),t.slice(p,r));d.push(a),p=r,f=i;}}function fg(t,r,n,i,a){void 0===i&&(i=0),void 0===a&&(a=!1);var o,s,c,l,u=!1,_=2048,d=!0,p=0;function f(r,s){if($f(s)){if(r===Oe){var c=o;return o=r,f(s,s),void(o=c)}if(r.aliasSymbol&&r.aliasTypeArguments&&r.aliasSymbol===s.aliasSymbol)v(r.aliasTypeArguments,s.aliasTypeArguments,Ap(r.aliasSymbol));else if(r===s&&3145728&r.flags)for(var l=0,p=r.types;l<p.length;l++){var h=p[l];f(h,h);}else {if(1048576&s.flags){var D=y(1048576&r.flags?r.types:[r],s.types,gg),C=y(D[0],D[1],mg),E=C[0];if(0===(N=C[1]).length)return;if(s=qu(N),0===E.length)return void g(r,s,1);r=qu(E);}else if(2097152&s.flags&&e.some(s.types,(function(e){return !!b(e)||dc(e)&&!!b(Pd(e)||nt)}))){if(!(1048576&r.flags)){var k=y(2097152&r.flags?r.types:[r],s.types,Wd),N=(E=k[0],k[1]);if(0===E.length||0===N.length)return;r=$u(E),s=$u(N);}}else 41943040&s.flags&&(s=O_(s));if(8650752&s.flags){if(524288&e.getObjectFlags(r)||r===Re||r===it||128&i&&(r===Ie||r===Kt)||lg(r))return;var F=b(s);if(F){if(!F.isFixed){if((void 0===F.priority||i<F.priority)&&(F.candidates=void 0,F.contraCandidates=void 0,F.topLevel=!0,F.priority=i),i===F.priority){var A=o||r;a&&!u?e.contains(F.contraCandidates,A)||(F.contraCandidates=e.append(F.contraCandidates,A),Qf(t)):e.contains(F.candidates,A)||(F.candidates=e.append(F.candidates,A),Qf(t));}!(128&i)&&262144&s.flags&&F.topLevel&&!tg(n,s)&&(F.topLevel=!1,Qf(t));}return void(_=Math.min(_,i))}var P=C_(s,!1);if(P!==s)m(r,P,f);else if(8388608&s.flags){var w=C_(s.indexType,!1);if(465829888&w.flags){var I=E_(C_(s.objectType,!1),w,!1);I&&I!==s&&m(r,I,f);}}}if(!(4&e.getObjectFlags(r)&&4&e.getObjectFlags(s)&&(r.target===s.target||qp(r)&&qp(s)))||r.node&&s.node)if(4194304&r.flags&&4194304&s.flags)a=!a,f(r.type,s.type),a=!a;else if((af(r)||4&r.flags)&&4194304&s.flags){var O=function(t){var r=e.createSymbolTable();nm(t,(function(t){if(128&t.flags){var n=e.escapeLeadingUnderscores(t.value),i=jn(4,n);i.type=we,t.symbol&&(i.declarations=t.symbol.declarations,i.valueDeclaration=t.symbol.valueDeclaration),r.set(n,i);}}));var n=4&t.flags?[Nl(He,mt,!1)]:e.emptyArray;return ya(void 0,r,e.emptyArray,e.emptyArray,n)}(r);a=!a,g(O,s.type,256),a=!a;}else if(8388608&r.flags&&8388608&s.flags)f(r.objectType,s.objectType),f(r.indexType,s.indexType);else if(268435456&r.flags&&268435456&s.flags)r.symbol===s.symbol&&f(r.type,s.type);else if(33554432&r.flags){f(r.baseType,s);var M=i;i|=4,f(r.substitute,s),i=M;}else if(16777216&s.flags)m(r,s,S);else if(3145728&s.flags)x(r,s.types,s.flags);else if(1048576&r.flags)for(var L=0,R=r.types;L<R.length;L++)f(R[L],s);else if(134217728&s.flags)!function(t,r){var n=ug(t,r),i=r.types;if(n||e.every(r.texts,(function(e){return 0===e.length})))for(var a=0;a<i.length;a++)f(n?n[a]:nt,i[a]);}(r,s);else {if(r=Mc(r),!(512&i&&467927040&r.flags)){var B=Ac(r);if(B!==r&&d&&!(2621440&B.flags))return d=!1,f(B,s);r=B;}2621440&r.flags&&m(r,s,T);}else v(zl(r),zl(s),wp(r.target));}}}function g(e,t,r){var n=i;i|=r,f(e,t),i=n;}function m(t,r,n){var i=t.id+","+r.id,a=s&&s.get(i);if(void 0===a){(s||(s=new e.Map)).set(i,-1);var o=_;_=2048;var u=p,d=Jp(t),f=Jp(r);e.contains(c,d)&&(p|=1),e.contains(l,f)&&(p|=2),3!==p?((c||(c=[])).push(d),(l||(l=[])).push(f),n(t,r),l.pop(),c.pop()):_=-1,p=u,s.set(i,_),_=Math.min(_,o);}else _=Math.min(_,a);}function y(t,r,n){for(var i,a,o=0,s=r;o<s.length;o++)for(var c=s[o],l=0,u=t;l<u.length;l++){var _=u[l];n(_,c)&&(f(_,c),i=e.appendIfUnique(i,_),a=e.appendIfUnique(a,c));}return [i?e.filter(t,(function(t){return !e.contains(i,t)})):t,a?e.filter(r,(function(t){return !e.contains(a,t)})):r]}function v(e,t,r){for(var n=e.length<t.length?e.length:t.length,i=0;i<n;i++)i<r.length&&2==(7&r[i])?h(e[i],t[i]):f(e[i],t[i]);}function h(e,t){G||1024&i?(a=!a,f(e,t),a=!a):f(e,t);}function b(e){if(8650752&e.flags)for(var r=0,n=t;r<n.length;r++){var i=n[r];if(e===i.typeParameter)return i}}function x(t,r,n){var a=0;if(1048576&n){for(var o=void 0,s=1048576&t.flags?t.types:[t],c=new Array(s.length),l=!1,u=0,d=r;u<d.length;u++)if(b(T=d[u]))o=T,a++;else for(var p=0;p<s.length;p++){var m=_;_=2048,f(s[p],T),_===i&&(c[p]=!0),l=l||-1===_,_=Math.min(_,m);}if(0===a){var y=function(t){for(var r,n=0,i=t;n<i.length;n++){var a=i[n],o=2097152&a.flags&&e.find(a.types,(function(e){return !!b(e)}));if(!o||r&&o!==r)return;r=o;}return r}(r);return void(y&&g(t,y,1))}if(1===a&&!l){var v=e.flatMap(s,(function(e,t){return c[t]?void 0:e}));if(v.length)return void f(qu(v),o)}}else for(var h=0,x=r;h<x.length;h++)b(T=x[h])?a++:f(t,T);if(2097152&n?1===a:a>0)for(var D=0,S=r;D<S.length;D++){var T;b(T=S[D])&&g(t,T,1);}}function D(t,r,n){if(1048576&n.flags){for(var i=!1,a=0,o=n.types;a<o.length;a++)i=D(t,r,o[a])||i;return i}if(4194304&n.flags){var s=b(n.type);if(s&&!s.isFixed&&!lg(t)){var c=rg(t,r,n);c&&g(c,s.typeParameter,524288&e.getObjectFlags(t)?16:8);}return !0}if(262144&n.flags){g(c_(t),n,32);var l=vc(n);if(l&&D(t,r,l))return !0;var u=e.map(yc(t),Uo),_=e.map(Hc(t),(function(e){return e!==Ar?e.type:nt}));return f(qu(e.concatenate(u,_)),ac(r)),!0}return !1}function S(e,t){if(16777216&e.flags)f(e.checkType,t.checkType),f(e.extendsType,t.extendsType),f(j_(e),j_(t)),f(J_(e),J_(t));else {var r=i;i|=a?64:0,x(e,[j_(t),J_(t)],t.flags),i=r;}}function T(t,r){if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)&&(t.target===r.target||qp(t)&&qp(r)))v(zl(t),zl(r),wp(t.target));else {if(dc(t)&&dc(r)){f(nc(t),nc(r)),f(ac(t),ac(r));var n=ic(t),i=ic(r);n&&i&&f(n,i);}var a,o;if(32&e.getObjectFlags(r)&&!r.declaration.nameType&&D(t,r,nc(r)))return;if(!function(e,t){return _f(e)&&_f(t)?function(e,t){return !(8&t.target.combinedFlags)&&t.target.minLength>e.target.minLength||!t.target.hasRestElement&&(e.target.hasRestElement||t.target.fixedLength<e.target.fixedLength)}(e,t):!!og(e,t,!1,!0)&&!!og(t,e,!1,!1)}(t,r)){if(qp(t)||_f(t)){if(_f(r)){var s=Ul(t),c=Ul(r),l=zl(r),u=r.target.elementFlags;if(_f(t)&&(o=r,Ul(a=t)===Ul(o)&&e.every(a.target.elementFlags,(function(e,t){return (12&e)==(12&o.target.elementFlags[t])})))){for(var _=0;_<c;_++)f(zl(t)[_],l[_]);return}var d=_f(t)?Math.min(t.target.fixedLength,r.target.fixedLength):0,p=Math.min(_f(t)?Ru(t.target,3):0,r.target.hasRestElement?Ru(r.target,3):0);for(_=0;_<d;_++)f(zl(t)[_],l[_]);if(!_f(t)||s-d-p==1&&4&t.target.elementFlags[d]){var m=zl(t)[d];for(_=d;_<c-p;_++)f(8&u[_]?Tu(m):m,l[_]);}else {var y=c-d-p;if(2===y&&u[d]&u[d+1]&8&&_f(t)){var h=b(l[d]);h&&void 0!==h.impliedArity&&(f(Ou(t,d,p+s-h.impliedArity),l[d]),f(Ou(t,d+h.impliedArity,p),l[d+1]));}else if(1===y&&8&u[d]){var x=2&r.target.elementFlags[c-1];g(_f(t)?Ou(t,d,p):Tu(zl(t)[0]),l[d],x?2:0);}else 1===y&&4&u[d]&&(m=_f(t)?gf(t,d,p):zl(t)[0])&&f(m,l[d]);}for(_=0;_<p;_++)f(zl(t)[s-_-1],l[c-_-1]);return}if(qp(r))return void k(t,r)}!function(e,t){for(var r=0,n=fc(t);r<n.length;r++){var i=n[r],a=Jc(e,i.escapedName);a&&f(Uo(a),Uo(i));}}(t,r),C(t,r,0),C(t,r,1),k(t,r);}}}function C(t,r,n){for(var i=Uc(t,n),a=Uc(r,n),o=i.length,s=a.length,c=o<s?o:s,l=!!(524288&e.getObjectFlags(t)),u=0;u<c;u++)E(Tl(i[o-c+u]),Sl(a[s-c+u]),l);}function E(e,t,r){if(!r){var n=u,i=t.declaration?t.declaration.kind:0;u=u||168===i||167===i||170===i,Vf(e,t,h),u=n;}qf(e,t,f);}function k(t,r){var n=e.getObjectFlags(t)&e.getObjectFlags(r)&32?8:0,i=Hc(r);if(Pf(t))for(var a=0,o=i;a<o.length;a++){for(var s=o[a],c=[],l=0,u=yc(t);l<u.length;l++){var _=u[l];if(qc(a_(_,8576),s.keyType)){var d=Uo(_);c.push(16777216&_.flags?Af(d):d);}}for(var p=0,f=Hc(t);p<f.length;p++){var m=f[p];qc(m.keyType,s.keyType)&&c.push(m.type);}c.length&&g(qu(c),s.type,n);}for(var y=0,v=i;y<v.length;y++){var h=Yc(t,(s=v[y]).keyType);h&&g(h.type,s.type,n);}}f(r,n);}function gg(e,t){return re&&t===Ve?e===t:Wd(e,t)||!!(4&t.flags&&128&e.flags||8&t.flags&&256&e.flags)}function mg(e,t){return !!(524288&e.flags&&524288&t.flags&&e.symbol&&e.symbol===t.symbol||e.aliasSymbol&&e.aliasTypeArguments&&e.aliasSymbol===t.aliasSymbol)}function yg(t){return !!(128&e.getObjectFlags(t))}function vg(t){return !!(32896&e.getObjectFlags(t))}function hg(t,r){var n,i,a=t.inferences[r];if(!a.inferredType){var o=void 0,s=t.signature;if(s){var c=a.candidates?function(t,r){var n,i=function(t){if(t.length>1){var r=e.filter(t,vg);if(r.length){var n=qu(r,2);return e.concatenate(e.filter(t,(function(e){return !vg(e)})),[n])}}return t}(t.candidates),a=!!(n=hc(t.typeParameter))&&Eb(16777216&n.flags?xc(n):n,406978556),o=!a&&t.topLevel&&(t.isFixed||!tg(ml(r),t.typeParameter)),s=a?e.sameMap(i,rd):o?e.sameMap(i,sf):i;return jf(416&t.priority?qu(s,2):function(t){if(!H)return Vp(t);var r=e.filter(t,(function(e){return !(98304&e.flags)}));return r.length?xf(Vp(r),98304&yf(t)):qu(t,2)}(s))}(a,s):void 0;if(a.contraCandidates)o=!c||131072&c.flags||!e.some(a.contraCandidates,(function(e){return Xd(c,e)}))?function(t){return 416&t.priority?$u(t.contraCandidates):(r=t.contraCandidates,e.reduceLeft(r,(function(e,t){return Xd(t,e)?t:e})));var r;}(a):c;else if(c)o=c;else if(1&t.flags)o=it;else {var l=Fc(a.typeParameter);l&&(o=Rd(l,(n=function(t,r){return xd((function(n){return e.findIndex(t.inferences,(function(e){return e.typeParameter===n}))>=r?je:n}))}(t,r),i=t.nonFixingMapper,n?Dd(4,n,i):i)));}}else o=sg(a);a.inferredType=o||bg(!!(2&t.flags));var u=hc(a.typeParameter);if(u){var _=Rd(u,t.nonFixingMapper);o&&t.compareTypes(o,Ls(_,o))||(a.inferredType=o=_);}}return a.inferredType}function bg(e){return e?we:je}function xg(e){for(var t=[],r=0;r<e.inferences.length;r++)t.push(hg(e,r));return t}function Dg(t){switch(t.escapedText){case"document":case"console":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;case"$":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery;case"describe":case"suite":case"it":case"test":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha;case"process":case"require":case"Buffer":case"module":return U.types?e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig:e.Diagnostics.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode;case"Map":case"Set":case"Promise":case"Symbol":case"WeakMap":case"WeakSet":case"Iterator":case"AsyncIterator":case"SharedArrayBuffer":case"Atomics":case"AsyncIterable":case"AsyncIterableIterator":case"AsyncGenerator":case"AsyncGeneratorFunction":case"BigInt":case"Reflect":case"BigInt64Array":case"BigUint64Array":return e.Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later;default:return 295===t.parent.kind?e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer:e.Diagnostics.Cannot_find_name_0}}function Sg(t){var r=Qn(t);return r.resolvedSymbol||(r.resolvedSymbol=!e.nodeIsMissing(t)&&ei(t,t.escapedText,1160127,Dg(t),t,!e.isWriteOnlyAccess(t),!1)||Ne),r.resolvedSymbol}function Tg(t){return !!e.findAncestor(t,(function(e){return 180===e.kind||79!==e.kind&&160!==e.kind&&"quit"}))}function Cg(t,r,n,i){switch(t.kind){case 79:if(!e.isThisInTypeQuery(t)){var a=Sg(t);return a!==Ne?"".concat(i?O(i):"-1","|").concat(Bu(r),"|").concat(Bu(n),"|").concat(M(a)):void 0}case 108:return "0|".concat(i?O(i):"-1","|").concat(Bu(r),"|").concat(Bu(n));case 229:case 211:return Cg(t.expression,r,n,i);case 160:var o=Cg(t.left,r,n,i);return o&&o+"."+t.right.escapedText;case 205:case 206:var s=kg(t);if(void 0!==s){var c=Cg(t.expression,r,n,i);return c&&c+"."+s}}}function Eg(t,r){switch(r.kind){case 211:case 229:return Eg(t,r.expression);case 220:return e.isAssignmentExpression(r)&&Eg(t,r.left)||e.isBinaryExpression(r)&&27===r.operatorToken.kind&&Eg(t,r.right)}switch(t.kind){case 230:return 230===r.kind&&t.keywordToken===r.keywordToken&&t.name.escapedText===r.name.escapedText;case 79:case 80:return e.isThisInTypeQuery(t)?108===r.kind:79===r.kind&&Sg(t)===Sg(r)||(253===r.kind||202===r.kind)&&aa(Sg(t))===$i(r);case 108:return 108===r.kind;case 106:return 106===r.kind;case 229:case 211:return Eg(t.expression,r);case 205:case 206:return e.isAccessExpression(r)&&kg(t)===kg(r)&&Eg(t.expression,r.expression);case 160:return e.isAccessExpression(r)&&t.right.escapedText===kg(r)&&Eg(t.left,r.expression);case 220:return e.isBinaryExpression(t)&&27===t.operatorToken.kind&&Eg(t.right,r)}return !1}function kg(t){var r;return 205===t.kind?t.name.escapedText:206===t.kind&&e.isStringOrNumericLiteralLike(t.argumentExpression)?e.escapeLeadingUnderscores(t.argumentExpression.text):202===t.kind&&(r=lo(t))?e.escapeLeadingUnderscores(r):void 0}function Ng(t,r){for(;e.isAccessExpression(t);)if(Eg(t=t.expression,r))return !0;return !1}function Fg(t,r){for(;e.isOptionalChain(t);)if(Eg(t=t.expression,r))return !0;return !1}function Ag(t,r){if(t&&1048576&t.flags){var n=Ic(t,r);if(n&&2&e.getCheckFlags(n))return void 0===n.isDiscriminantProperty&&(n.isDiscriminantProperty=192==(192&n.checkFlags)&&!b_(Uo(n))),!!n.isDiscriminantProperty}return !1}function Pg(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(Ag(t,a.escapedName)){if(r){r.push(a);continue}r=[a];}}return r}function wg(t){var r=t.types;if(!(r.length<10||65536&e.getObjectFlags(t)||e.countWhere(r,(function(e){return !!(59506688&e.flags)}))<10)){if(void 0===t.keyPropertyName){var n=e.forEach(r,(function(t){return 59506688&t.flags?e.forEach(yc(t),(function(e){return rf(Uo(e))?e.escapedName:void 0})):void 0})),i=n&&function(t,r){for(var n=new e.Map,i=0,a=function(e){if(61603840&e.flags){var t=eo(e,r);if(t){if(!af(t))return {value:void 0};var a=!1;nm(t,(function(t){var r=Bu(rd(t)),i=n.get(r);i?i!==je&&(n.set(r,je),a=!0):n.set(r,e);})),a||i++;}}},o=0,s=t;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return i>=10&&2*i>=t.length?n:void 0}(r,n);t.keyPropertyName=i?n:"",t.constituentMap=i;}return t.keyPropertyName.length?t.keyPropertyName:void 0}}function Ig(e,t){var r,n=null===(r=e.constituentMap)||void 0===r?void 0:r.get(Bu(rd(t)));return n!==je?n:void 0}function Og(e,t){var r=wg(e),n=r&&eo(t,r);return n&&Ig(e,n)}function Mg(e,t){return Eg(e,t)||Ng(e,t)}function Lg(e,t){if(e.arguments)for(var r=0,n=e.arguments;r<n.length;r++)if(Mg(t,n[r]))return !0;return !(205!==e.expression.kind||!Mg(t,e.expression.expression))}function Rg(e){return (!e.id||e.id<0)&&(e.id=p,p++),e.id}function Bg(e){var t=pc(e);return !!(t.callSignatures.length||t.constructSignatures.length||t.members.get("bind")&&Xd(e,wt))}function jg(t,r){void 0===r&&(r=!1);var n=t.flags;if(4&n)return H?16317953:16776705;if(128&n){var i=""===t.value;return H?i?12123649:7929345:i?12582401:16776705}if(40&n)return H?16317698:16776450;if(256&n){var a=0===t.value;return H?a?12123394:7929090:a?12582146:16776450}return 64&n?H?16317188:16775940:2048&n?(a=mf(t),H?a?12122884:7928580:a?12581636:16775940):16&n?H?16316168:16774920:528&n?H?t===Xe||t===Ye?12121864:7927560:t===Xe||t===Ye?12580616:16774920:524288&n&&!r?16&e.getObjectFlags(t)&&fp(t)?H?16318463:16777215:Bg(t)?H?7880640:16728e3:H?7888800:16736160:49152&n?9830144:65536&n?9363232:12288&n?H?7925520:16772880:67108864&n?H?7888800:16736160:131072&n?0:465829888&n?h_(t)?H?7929345:16776705:jg(Tc(t)||je,r):1048576&n?e.reduceLeft(t.types,(function(e,t){return e|jg(t,r)}),0):2097152&n?(r||(r=Eb(t,131068)),e.reduceLeft(t.types,(function(e,t){return e&jg(t,r)}),16777215)):16777215}function Jg(e,t){return om(e,(function(e){return 0!=(jg(e)&t)}))}function zg(e,t){return t?qu([oo(e),rx(t)]):e}function Ug(e,t){var r,n=i_(t);if(!Es(n))return Me;var i=Ps(n);return eo(e,i)||Vg(null===(r=Zc(e,i))||void 0===r?void 0:r.type)||Me}function Kg(e,t){return am(e,$p)&&function(e,t){return eo(e,""+t)||(am(e,_f)?lm(e,(function(e){return ff(e)||ze})):void 0)}(e,t)||Vg(hD(65,e,ze,void 0))||Me}function Vg(e){return e&&U.noUncheckedIndexedAccess?qu([e,ze]):e}function qg(e){return Tu(hD(65,e,ze,void 0)||Me)}function Wg(e){return 220===e.parent.kind&&e.parent.left===e||243===e.parent.kind&&e.parent.initializer===e}function Hg(e){return Ug(Gg(e.parent),e.name)}function Gg(e){var t=e.parent;switch(t.kind){case 242:return He;case 243:return vD(t)||Me;case 220:return function(e){return 203===e.parent.kind&&Wg(e.parent)||294===e.parent.kind&&Wg(e.parent.parent)?zg(Gg(e),e.right):rx(e.right)}(t);case 214:return ze;case 203:return function(e,t){return Kg(Gg(e),e.elements.indexOf(t))}(t,e);case 224:return function(e){return qg(Gg(e.parent))}(t);case 294:return Hg(t);case 295:return function(e){return zg(Hg(e),e.objectAssignmentInitializer)}(t)}return Me}function Qg(e){return Qn(e).resolvedType||rx(e)}function Xg(e){return 253===e.kind?function(e){return e.initializer?Qg(e.initializer):242===e.parent.parent.kind?He:243===e.parent.parent.kind&&vD(e.parent.parent)||Me}(e):function(e){var t=e.parent,r=Xg(t.parent);return zg(200===t.kind?Ug(r,e.propertyName||e.name):e.dotDotDotToken?qg(r):Kg(r,t.elements.indexOf(e)),e.initializer)}(e)}function Yg(e){switch(e.kind){case 211:return Yg(e.expression);case 220:switch(e.operatorToken.kind){case 63:case 75:case 76:case 77:return Yg(e.left);case 27:return Yg(e.right)}}return e}function Zg(e){var t=e.parent;return 211===t.kind||220===t.kind&&63===t.operatorToken.kind&&t.left===e||220===t.kind&&27===t.operatorToken.kind&&t.right===e?Zg(t):e}function $g(e){return 288===e.kind?rd(rx(e.expression)):nt}function em(e){var t=Qn(e);if(!t.switchTypes){t.switchTypes=[];for(var r=0,n=e.caseBlock.clauses;r<n.length;r++){var i=n[r];t.switchTypes.push($g(i));}}return t.switchTypes}function tm(t,r){for(var n=[],i=0,a=t.caseBlock.clauses;i<a.length;i++){var o=a[i];if(288===o.kind){if(e.isStringLiteralLike(o.expression)){n.push(o.expression.text);continue}return e.emptyArray}r&&n.push(void 0);}return n}function rm(e,t){return e===t||1048576&t.flags&&function(e,t){if(1048576&e.flags){for(var r=0,n=e.types;r<n.length;r++){var i=n[r];if(!ju(t.types,i))return !1}return !0}return !!(1024&e.flags&&ds(e)===t)||ju(t.types,e)}(e,t)}function nm(t,r){return 1048576&t.flags?e.forEach(t.types,r):r(t)}function im(t,r){return 1048576&t.flags?e.some(t.types,r):r(t)}function am(t,r){return 1048576&t.flags?e.every(t.types,r):r(t)}function om(t,r){if(1048576&t.flags){var n=t.types,i=e.filter(n,r);if(i===n)return t;var a=t.origin,o=void 0;if(a&&1048576&a.flags){var s=a.types,c=e.filter(s,(function(e){return !!(1048576&e.flags)||r(e)}));if(s.length-c.length==n.length-i.length){if(1===c.length)return c[0];o=Vu(1048576,c);}}return Hu(i,t.objectFlags,void 0,void 0,o)}return 131072&t.flags||r(t)?t:nt}function sm(e,t){return om(e,(function(e){return e!==t}))}function cm(e){return 1048576&e.flags?e.types.length:1}function lm(e,t,r){if(131072&e.flags)return e;if(!(1048576&e.flags))return t(e);for(var n,i=e.origin,a=!1,o=0,s=i&&1048576&i.flags?i.types:e.types;o<s.length;o++){var c=s[o],l=1048576&c.flags?lm(c,t,r):t(c);a||(a=c!==l),l&&(n?n.push(l):n=[l]);}return a?n&&qu(n,r?0:1):e}function um(t,r,n,i){return 1048576&t.flags&&n?qu(e.map(t.types,r),1,n,i):lm(t,r)}function _m(e){return 1048576&e.flags?e.types.length:1}function dm(e,t){return om(e,(function(e){return 0!=(e.flags&t)}))}function pm(e,t){return Eb(e,134217804)&&Eb(t,402655616)?lm(e,(function(e){return 4&e.flags?dm(t,402653316):h_(e)&&!Eb(t,402653188)?dm(t,128):8&e.flags?dm(t,264):64&e.flags?dm(t,2112):e})):e}function fm(e){return 0===e.flags}function gm(e){return 0===e.flags?e.type:e}function mm(e,t){return t?{flags:0,type:131072&e.flags?it:e}:e}function ym(e){return Ee[e.id]||(Ee[e.id]=function(e){var t=_a(256);return t.elementType=e,t}(e))}function vm(e,t){var r=If(of(ix(t)));return rm(r,e.elementType)?e:ym(qu([e.elementType,r]))}function hm(t){return 256&e.getObjectFlags(t)?(r=t).finalArrayType||(r.finalArrayType=131072&(n=r.elementType).flags?Kt:Tu(1048576&n.flags?qu(n.types,2):n)):t;var r,n;}function bm(t){return 256&e.getObjectFlags(t)?t.elementType:nt}function xm(t){var r=Zg(t),n=r.parent,i=e.isPropertyAccessExpression(n)&&("length"===n.name.escapedText||207===n.parent.kind&&e.isIdentifier(n.name)&&e.isPushOrUnshiftIdentifier(n.name)),a=206===n.kind&&n.expression===r&&220===n.parent.kind&&63===n.parent.operatorToken.kind&&n.parent.left===n&&!e.isAssignmentTarget(n.parent)&&kb(rx(n.argumentExpression),296);return i||a}function Dm(t,r){if(8752&t.flags)return Uo(t);if(7&t.flags){if(262144&e.getCheckFlags(t)){var n=t.syntheticOrigin;if(n&&Dm(n))return Uo(t)}var i=t.valueDeclaration;if(i){if(s=i,(e.isVariableDeclaration(s)||e.isPropertyDeclaration(s)||e.isPropertySignature(s)||e.isParameter(s))&&(e.getEffectiveTypeAnnotationNode(s)||e.isInJSFile(s)&&e.hasInitializer(s)&&s.initializer&&e.isFunctionExpressionOrArrowFunction(s.initializer)&&e.getEffectiveReturnTypeNode(s.initializer)))return Uo(t);if(e.isVariableDeclaration(i)&&243===i.parent.parent.kind){var a=i.parent.parent,o=Sm(a.expression,void 0);if(o)return hD(a.awaitModifier?15:13,o,ze,void 0)}r&&e.addRelatedInfo(r,e.createDiagnosticForNode(i,e.Diagnostics._0_needs_an_explicit_type_annotation,Ia(t)));}}var s;}function Sm(t,r){if(!(16777216&t.flags))switch(t.kind){case 79:var n=aa(Sg(t));return Dm(2097152&n.flags?ki(n):n,r);case 108:return function(t){var r=e.getThisContainer(t,!1);if(e.isFunctionLike(r)){var n=cl(r);if(n.thisParameter)return Dm(n.thisParameter)}if(e.isClassLike(r.parent)){var i=$i(r.parent);return e.isStatic(r)?Uo(i):ms(i).thisType}}(t);case 106:return Qm(t);case 205:var i=Sm(t.expression,r);if(i){var a=t.name,o=void 0;if(e.isPrivateIdentifier(a)){if(!i.symbol)return;o=Jc(i,e.getSymbolNameForPrivateIdentifier(i.symbol,a.escapedText));}else o=Jc(i,a.escapedText);return o&&Dm(o,r)}return;case 211:return Sm(t.expression,r)}}function Tm(t){var r=Qn(t),n=r.effectsSignature;if(void 0===n){var i=void 0;237===t.parent.kind?i=Sm(t.expression,void 0):106!==t.expression.kind&&(i=e.isOptionalChain(t)?uv(kf(ax(t.expression),t.expression),t.expression):iv(t.expression));var a=Uc(i&&Ac(i)||je,0),o=1!==a.length||a[0].typeParameters?e.some(a,Cm)?Nh(t):void 0:a[0];n=r.effectsSignature=o&&Cm(o)?o:kr;}return n===kr?void 0:n}function Cm(e){return !!(fl(e)||e.declaration&&131072&(yl(e.declaration)||je).flags)}function Em(e){var t=Nm(e,!1);return vr=e,hr=t,t}function km(t){var r=e.skipParentheses(t,!0);return 95===r.kind||220===r.kind&&(55===r.operatorToken.kind&&(km(r.left)||km(r.right))||56===r.operatorToken.kind&&km(r.left)&&km(r.right))}function Nm(t,r){for(;;){if(t===vr)return hr;var n=t.flags;if(4096&n){if(!r){var i=Rg(t),a=ln[i];return void 0!==a?a:ln[i]=Nm(t,!0)}r=!1;}if(368&n)t=t.antecedent;else if(512&n){var o=Tm(t.node);if(o){var s=fl(o);if(s&&3===s.kind&&!s.type){var c=t.node.arguments[s.parameterIndex];if(c&&km(c))return !1}if(131072&ml(o).flags)return !1}t=t.antecedent;}else {if(4&n)return e.some(t.antecedents,(function(e){return Nm(e,!1)}));if(8&n){var l=t.antecedents;if(void 0===l||0===l.length)return !1;t=l[0];}else {if(!(128&n)){if(1024&n){vr=void 0;var u=t.target,_=u.antecedents;u.antecedents=t.antecedents;var d=Nm(t.antecedent,!1);return u.antecedents=_,d}return !(1&n)}if(t.clauseStart===t.clauseEnd&&gb(t.switchStatement))return !1;t=t.antecedent;}}}}function Fm(t,r){for(;;){var n=t.flags;if(4096&n){if(!r){var i=Rg(t),a=un[i];return void 0!==a?a:un[i]=Fm(t,!0)}r=!1;}if(496&n)t=t.antecedent;else if(512&n){if(106===t.node.expression.kind)return !0;t=t.antecedent;}else {if(4&n)return e.every(t.antecedents,(function(e){return Fm(e,!1)}));if(!(8&n)){if(1024&n){var o=t.target,s=o.antecedents;o.antecedents=t.antecedents;var c=Fm(t.antecedent,!1);return o.antecedents=s,c}return !!(1&n)}t=t.antecedents[0];}}}function Am(t){switch(t.kind){case 79:var r=Sg(t);return Mm(r)||e.isParameterOrCatchClauseVariable(r)&&!Im(r);case 205:case 206:return Am(t.expression)&&Db(Qn(t).resolvedSymbol||Ne)}return !1}function Pm(t,r,n,i){var a;void 0===n&&(n=r);var o=!1,s=0;if(Vr)return Me;if(!t.flowNode)return r;qr++;var c=Kr,l=gm(d(t.flowNode));Kr=c;var u=256&e.getObjectFlags(l)&&xm(t)?Kt:hm(l);return u===st||t.parent&&229===t.parent.kind&&!(131072&u.flags)&&131072&Jg(u,2097152).flags?r:u===Je?je:u;function _(){return o?a:(o=!0,a=Cg(t,r,n,i))}function d(a){if(2e3===s)return null===e.tracing||void 0===e.tracing||e.tracing.instant("checkTypes","getTypeAtFlowNode_DepthLimit",{flowId:a.id}),Vr=!0,o=t,l=e.findAncestor(o,e.isFunctionOrModuleBlock),u=e.getSourceFileOfNode(o),_=e.getSpanOfTokenAtPosition(u,l.statements.pos),mn.add(e.createFileDiagnostic(u,_.start,_.length,e.Diagnostics.The_containing_function_or_module_body_is_too_large_for_control_flow_analysis)),Me;var o,l,u,_,p;for(s++;;){var g=a.flags;if(4096&g){for(var D=c;D<Kr;D++)if(sn[D]===a)return s--,cn[D];p=a;}var S=void 0;if(16&g){if(!(S=f(a))){a=a.antecedent;continue}}else if(512&g){if(!(S=m(a))){a=a.antecedent;continue}}else if(96&g)S=v(a);else if(128&g)S=h(a);else if(12&g){if(1===a.antecedents.length){a=a.antecedents[0];continue}S=4&g?b(a):x(a);}else if(256&g){if(!(S=y(a))){a=a.antecedent;continue}}else if(1024&g){var T=a.target,C=T.antecedents;T.antecedents=a.antecedents,S=d(a.antecedent),T.antecedents=C;}else if(2&g){var E=a.node;if(E&&E!==i&&205!==t.kind&&206!==t.kind&&108!==t.kind){a=E.flowNode;continue}S=n;}else S=cD(r);return p&&(sn[Kr]=p,cn[Kr]=S,Kr++),s--,S}}function p(e){var r=e.node;return Bm(253===r.kind||202===r.kind?Xg(r):Gg(r),t)}function f(n){var i=n.node;if(Eg(t,i)){if(!Em(n))return st;if(2===e.getAssignmentTargetKind(i)){var a=d(n.antecedent);return mm(of(gm(a)),fm(a))}if(r===Ie||r===Kt){if(function(e){return 253===e.kind&&e.initializer&&fo(e.initializer)||202!==e.kind&&220===e.parent.kind&&fo(e.parent.right)}(i))return ym(nt);var o=sf(p(n));return Yd(o,r)?o:Ut}return 1048576&r.flags?function(e,t){if(e!==t){if(131072&t.flags)return t;var r=om(e,(function(e){return function(e,t){if(!(1048576&e.flags))return Yd(e,t);for(var r=0,n=e.types;r<n.length;r++)if(Yd(n[r],t))return !0;return !1}(t,e)}));if(512&t.flags&&nd(t)&&(r=lm(r,td)),Yd(t,r))return r}return e}(r,p(n)):r}if(Ng(t,i)){if(!Em(n))return st;if(e.isVariableDeclaration(i)&&(e.isInJSFile(i)||e.isVarConst(i))){var s=e.getDeclaredExpandoInitializer(i);if(s&&(212===s.kind||213===s.kind))return d(n.antecedent)}return r}if(e.isVariableDeclaration(i)&&242===i.parent.parent.kind&&Eg(t,i.parent.parent.expression))return ov(gm(d(n.antecedent)))}function g(t,r){var n=e.skipParentheses(r,!0);if(95===n.kind)return st;if(220===n.kind){if(55===n.operatorToken.kind)return g(g(t,n.left),n.right);if(56===n.operatorToken.kind)return qu([g(t,n.left),g(t,n.right)])}return U(t,n,!0)}function m(e){var t=Tm(e.node);if(t){var r=fl(t);if(r&&(2===r.kind||3===r.kind)){var n=d(e.antecedent),i=hm(gm(n)),a=r.type?z(i,r,e.node,!0):3===r.kind&&r.parameterIndex>=0&&r.parameterIndex<e.node.arguments.length?g(i,e.node.arguments[r.parameterIndex]):i;return a===i?n:mm(a,fm(n))}if(131072&ml(t).flags)return st}}function y(n){if(r===Ie||r===Kt){var i=n.node,a=207===i.kind?i.expression.expression:i.left.expression;if(Eg(t,Yg(a))){var o=d(n.antecedent),s=gm(o);if(256&e.getObjectFlags(s)){var c=s;if(207===i.kind)for(var l=0,u=i.arguments;l<u.length;l++)c=vm(c,u[l]);else kb(ix(i.left.argumentExpression),296)&&(c=vm(c,i.right));return c===s?o:mm(c,fm(o))}return o}}}function v(e){var t=d(e.antecedent),r=gm(t);if(131072&r.flags)return t;var n=0!=(32&e.flags),i=hm(r),a=U(i,e.node,n);return a===i?t:mm(a,fm(t))}function h(r){var n=r.switchStatement.expression,i=d(r.antecedent),a=gm(i);if(Eg(t,n))a=M(a,r.switchStatement,r.clauseStart,r.clauseEnd);else if(215===n.kind&&Eg(t,n.expression))a=function(t,r,n,i){var a=tm(r,!0);if(!a.length)return t;var o,s,c=e.findIndex(a,(function(e){return void 0===e})),l=n===i||c>=n&&c<i;if(c>-1){var u=a.filter((function(e){return void 0!==e})),_=c<n?n-1:n,d=c<i?i-1:i;o=u.slice(_,d),s=fb(_,d,u,l);}else o=a.slice(n,i),s=fb(n,i,a,l);if(l)return om(t,(function(e){return (jg(e)&s)===s}));var p=Jg(qu(o.map((function(e){return L(t,e)||t}))),s);return Jg(lm(t,R(p)),s)}(a,r.switchStatement,r.clauseStart,r.clauseEnd);else {H&&(Fg(n,t)?a=O(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(163840&e.flags)})):215===n.kind&&Fg(n.expression,t)&&(a=O(a,r.switchStatement,r.clauseStart,r.clauseEnd,(function(e){return !(131072&e.flags||128&e.flags&&"undefined"===e.value)}))));var o=C(n,a);o&&(a=function(t,r,n,i,a){if(i<a&&1048576&t.flags&&wg(t)===kg(r)){var o=em(n).slice(i,a),s=qu(e.map(o,(function(e){return Ig(t,e)||je})));if(s!==je)return s}return k(t,r,(function(e){return M(e,n,i,a)}))}(a,o,r.switchStatement,r.clauseStart,r.clauseEnd));}return mm(a,fm(i))}function b(t){for(var i,a=[],o=!1,s=!1,c=0,l=t.antecedents;c<l.length;c++){var u=l[c];if(!i&&128&u.flags&&u.clauseStart===u.clauseEnd)i=u;else {if((p=gm(_=d(u)))===r&&r===n)return p;e.pushIfUnique(a,p),rm(p,r)||(o=!0),fm(_)&&(s=!0);}}if(i){var _,p=gm(_=d(i));if(!e.contains(a,p)&&!gb(i.switchStatement)){if(p===r&&r===n)return p;a.push(p),rm(p,r)||(o=!0),fm(_)&&(s=!0);}}return mm(D(a,o?2:1),s)}function x(t){var n=Rg(t),i=rn[n]||(rn[n]=new e.Map),a=_();if(!a)return r;var o=i.get(a);if(o)return o;for(var s=zr;s<Ur;s++)if(nn[s]===t&&an[s]===a&&on[s].length)return mm(D(on[s],1),!0);for(var c,l=[],u=!1,p=0,f=t.antecedents;p<f.length;p++){var g=f[p],m=void 0;if(c){nn[Ur]=t,an[Ur]=a,on[Ur]=l,Ur++;var y=br;br=void 0,m=d(g),br=y,Ur--;var v=i.get(a);if(v)return v}else m=c=d(g);var h=gm(m);if(e.pushIfUnique(l,h),rm(h,r)||(u=!0),h===r)break}var b=D(l,u?2:1);return fm(c)?mm(b,!0):(i.set(a,b),b)}function D(t,n){if(function(t){for(var r=!1,n=0,i=t;n<i.length;n++){var a=i[n];if(!(131072&a.flags)){if(!(256&e.getObjectFlags(a)))return !1;r=!0;}}return r}(t))return ym(qu(e.map(t,bm)));var i=qu(e.sameMap(t,hm),n);return i!==r&&i.flags&r.flags&1048576&&e.arraysEqual(i.types,r.types)?r:i}function C(n,i){var a,o,s=1048576&r.flags?r:i;return 1048576&s.flags&&(a=function(t){if(e.isAccessExpression(t))return t;if(e.isIdentifier(t)){var r=Sg(t);if(Mm(r)){var n=r.valueDeclaration;if(e.isVariableDeclaration(n)&&!n.type&&n.initializer&&e.isAccessExpression(n.initializer))return n.initializer;if(e.isBindingElement(n)&&!n.initializer){var i=n.parent.parent;if(e.isVariableDeclaration(i)&&!i.type&&i.initializer&&(e.isIdentifier(i.initializer)||e.isAccessExpression(i.initializer)))return n}}}}(n))&&(o=kg(a))&&Eg(t,e.isAccessExpression(a)?a.expression:a.parent.parent.initializer)&&Ag(s,o)?a:void 0}function k(t,r,n){var i=kg(r);if(void 0===i)return t;var a=H&&e.isOptionalChain(r)&&Eb(t,98304),o=eo(a?Jg(t,2097152):t,i);if(!o)return t;var s=n(o=a?Df(o):o);return om(t,(function(e){var t=function(e,t){var r;return eo(e,t)||(null===(r=Zc(e,t))||void 0===r?void 0:r.type)||je}(e,i);return !(131072&s.flags)&&$d(s,t)}))}function N(e,t,r,n,i){if((36===r||37===r)&&1048576&e.flags){var a=wg(e);if(a&&a===kg(t)){var o=Ig(e,rx(n));if(o)return r===(i?36:37)?o:rf(eo(o,a)||je)?sm(e,o):e}}return k(e,t,(function(e){return w(e,r,n,i)}))}function F(e,r,n){if(Eg(t,r))return 2&e.flags&&n?Je:Jg(e,n?4194304:8388608);H&&n&&Fg(r,t)&&(e=Jg(e,2097152));var i=C(r,e);return i?k(e,i,(function(e){return Jg(e,n?4194304:8388608)})):e}function A(n,i,a){switch(i.operatorToken.kind){case 63:case 75:case 76:case 77:return F(U(n,i.right,a),i.left,a);case 34:case 35:case 36:case 37:var o=i.operatorToken.kind,s=Yg(i.left),c=Yg(i.right);if(215===s.kind&&e.isStringLiteralLike(c))return I(n,s,o,c,a);if(215===c.kind&&e.isStringLiteralLike(s))return I(n,c,o,s,a);if(Eg(t,s))return w(n,o,c,a);if(Eg(t,c))return w(n,o,s,a);H&&(Fg(s,t)?n=P(n,o,c,a):Fg(c,t)&&(n=P(n,o,s,a)));var l=C(s,n);if(l)return N(n,l,o,c,a);var u=C(c,n);if(u)return N(n,u,o,s,a);if(B(s))return j(n,o,c,a);if(B(c))return j(n,o,s,a);break;case 102:return function(r,n,i){var a=Yg(n.left);if(!Eg(t,a))return i&&H&&Fg(a,t)?Jg(r,2097152):r;var o,s=rx(n.right);if(!Zd(s,wt))return r;var c=Jc(s,"prototype");if(c){var l=Uo(c);to(l)||(o=l);}if(to(r)&&(o===Pt||o===wt))return r;if(!o){var u=Uc(s,1);o=u.length?qu(e.map(u,(function(e){return ml(Sl(e))}))):mt;}return !i&&1048576&s.flags&&!e.find(s.types,(function(e){return !Zo(e)}))?r:J(r,o,i,Zd)}(n,i,a);case 101:if(e.isPrivateIdentifier(i.left))return function(r,n,i){var a=Yg(n.right);if(!Eg(t,a))return r;e.Debug.assertNode(n.left,e.isPrivateIdentifier);var o=mv(n.left);if(void 0===o)return r;var s=o.parent;return J(r,e.hasStaticModifier(e.Debug.checkDefined(o.valueDeclaration,"should always have a declaration"))?Uo(s):ms(s),i,Zd)}(n,i,a);var _=Yg(i.right),d=LS(i.left);if(128&d.flags){var p=e.escapeLeadingUnderscores(d.value);if(Ff(n)&&e.isAccessExpression(t)&&Eg(t.expression,_)&&kg(t)===p)return Jg(n,a?524288:65536);if(Eg(t,_))return function(t,n,i){return 1048576&t.flags||524288&t.flags&&r!==t||T_(t)||2097152&t.flags&&e.every(t.types,(function(e){return e.symbol!==ce}))?om(t,(function(e){return function(e,t,r){var n=Jc(e,t);return n?!!(16777216&n.flags)||r:!!Zc(e,t)||!r}(e,n,i)})):t}(n,p,a)}break;case 27:return U(n,i.right,a);case 55:return a?U(U(n,i.left,!0),i.right,!0):qu([U(n,i.left,!1),U(n,i.right,!1)]);case 56:return a?qu([U(n,i.left,!0),U(n,i.right,!0)]):U(U(n,i.left,!1),i.right,!1)}return n}function P(e,t,r,n){var i=34===t||36===t,a=34===t||35===t?98304:32768,o=rx(r);return i!==n&&am(o,(function(e){return !!(e.flags&a)}))||i===n&&am(o,(function(e){return !(e.flags&(3|a))}))?Jg(e,2097152):e}function w(e,t,r,n){if(1&e.flags)return e;35!==t&&37!==t||(n=!n);var i=rx(r);if(n&&2&e.flags&&(34===t||35===t)&&65536&i.flags)return qu([qe,ze]);if(2&e.flags&&n&&(36===t||37===t))return 67239932&i.flags?i:524288&i.flags?ct:e;if(98304&i.flags){if(!H)return e;var a=34===t||35===t?n?262144:2097152:65536&i.flags?n?131072:1048576:n?65536:524288;return 2&e.flags&&3145728&a?Je:Jg(e,a)}return n?pm(om(e,34===t?function(e){return ep(e,i)||(t=i,0!=(524&e.flags)&&0!=(28&t.flags));var t;}:function(e){return ep(e,i)}),i):rf(i)?om(e,(function(e){return !(nf(e)&&ep(e,i))})):e}function I(e,r,n,i,a){35!==n&&37!==n||(a=!a);var o=Yg(r.expression);if(!Eg(t,o))return H&&Fg(o,t)&&a===("undefined"!==i.text)?Jg(e,2097152):e;if(1&e.flags&&"function"===i.text)return e;if(a&&2&e.flags&&"object"===i.text)return e===Je?ct:qu([ct,qe]);var s=a?S.get(i.text)||128:T.get(i.text)||32768,c=L(e,i.text);return Jg(a&&c?lm(e,R(c)):e,s)}function O(t,r,n,i,a){return n!==i&&e.every(em(r).slice(n,i),a)?Jg(t,2097152):t}function M(t,r,n,i){var a=em(r);if(!a.length)return t;var o=a.slice(n,i),s=n===i||e.contains(o,nt);if(2&t.flags&&!s){for(var c=void 0,l=0;l<o.length;l+=1){var u=o[l];if(67239932&u.flags)void 0!==c&&c.push(u);else {if(!(524288&u.flags))return t;void 0===c&&(c=o.slice(0,l)),c.push(ct);}}return qu(void 0===c?o:c)}var _=qu(o),d=131072&_.flags?nt:pm(om(t,(function(e){return ep(_,e)})),_);if(!s)return d;var p=om(t,(function(t){return !(nf(t)&&e.contains(a,rd(function(t){return 2097152&t.flags&&e.find(t.types,rf)||t}(t))))}));return 131072&d.flags?p:qu([d,p])}function L(e,t){switch(t){case"function":return 1&e.flags?e:wt;case"object":return 2&e.flags?qu([ct,qe]):e;default:return vn.get(t)}}function R(e){return function(t){if(Xd(t,e))return t;if(Xd(e,t))return e;if(465829888&t.flags){var r=Tc(t)||we;if(Xd(e,r))return $u([t,e])}return t}}function B(r){return (e.isPropertyAccessExpression(r)&&"constructor"===e.idText(r.name)||e.isElementAccessExpression(r)&&e.isStringLiteralLike(r.argumentExpression)&&"constructor"===r.argumentExpression.text)&&Eg(t,r.expression)}function j(t,r,n,i){if(i?34!==r&&36!==r:35!==r&&37!==r)return t;var a=rx(n);if(!uT(a)&&!Zo(a))return t;var o=Jc(a,"prototype");if(!o)return t;var s=Uo(o),c=to(s)?void 0:s;return c&&c!==Pt&&c!==wt?to(t)?c:om(t,(function(t){return n=c,524288&(r=t).flags&&1&e.getObjectFlags(r)||524288&n.flags&&1&e.getObjectFlags(n)?r.symbol===n.symbol:Xd(r,n);var r,n;})):t}function J(e,t,r,n){if(!r)return om(e,(function(e){return !n(e,t)}));if(1048576&e.flags){var i=om(e,(function(e){return n(e,t)}));if(!(131072&i.flags))return i}return Xd(t,e)?t:Yd(e,t)?e:Yd(t,e)?t:$u([e,t])}function z(r,n,i,a){if(n.type&&(!to(r)||n.type!==Pt&&n.type!==wt)){var o=function(t,r){if(1===t.kind||3===t.kind)return r.arguments[t.parameterIndex];var n=e.skipParentheses(r.expression);return e.isAccessExpression(n)?e.skipParentheses(n.expression):void 0}(n,i);if(o){if(Eg(t,o))return J(r,n.type,a,Xd);H&&a&&Fg(o,t)&&!(65536&jg(n.type))&&(r=Jg(r,2097152));var s=C(o,r);if(s)return k(r,s,(function(e){return J(e,n.type,a,Xd)}))}}return r}function U(r,n,i){if(e.isExpressionOfOptionalChainRoot(n)||e.isBinaryExpression(n.parent)&&60===n.parent.operatorToken.kind&&n.parent.left===n)return function(e,r,n){if(Eg(t,r))return Jg(e,n?2097152:262144);var i=C(r,e);return i?k(e,i,(function(e){return Jg(e,n?2097152:262144)})):e}(r,n,i);switch(n.kind){case 79:if(!Eg(t,n)&&E<5){var a=Sg(n);if(Mm(a)){var o=a.valueDeclaration;if(o&&e.isVariableDeclaration(o)&&!o.type&&o.initializer&&Am(t)){E++;var s=U(r,o.initializer,i);return E--,s}}}case 108:case 106:case 205:case 206:return F(r,n,i);case 207:return function(r,n,i){if(Lg(n,t)){var a=i||!e.isCallChain(n)?Tm(n):void 0,o=a&&fl(a);if(o&&(0===o.kind||1===o.kind))return z(r,o,n,i)}if(Ff(r)&&e.isAccessExpression(t)&&e.isPropertyAccessExpression(n.expression)){var s=n.expression;if(Eg(t.expression,Yg(s.expression))&&e.isIdentifier(s.name)&&"hasOwnProperty"===s.name.escapedText&&1===n.arguments.length){var c=n.arguments[0];if(e.isStringLiteralLike(c)&&kg(t)===e.escapeLeadingUnderscores(c.text))return Jg(r,i?524288:65536)}}return r}(r,n,i);case 211:case 229:return U(r,n.expression,i);case 220:return A(r,n,i);case 218:if(53===n.operator)return U(r,n.operand,!i)}return r}}function wm(t){return e.findAncestor(t.parent,(function(t){return e.isFunctionLike(t)&&!e.getImmediatelyInvokedFunctionExpression(t)||261===t.kind||303===t.kind||166===t.kind}))}function Im(t){if(!t.valueDeclaration)return !1;var r,n=e.getRootDeclaration(t.valueDeclaration).parent,i=Qn(n);return 8388608&i.flags||(i.flags|=8388608,r=n,e.findAncestor(r.parent,(function(t){return (e.isFunctionLike(t)||e.isCatchClause(t))&&!!(8388608&Qn(t).flags)}))||Om(n)),t.isAssigned||!1}function Om(t){if(79===t.kind){if(e.isAssignmentTarget(t)){var r=Sg(t);e.isParameterOrCatchClauseVariable(r)&&(r.isAssigned=!0);}}else e.forEachChild(t,Om);}function Mm(e){return 3&e.flags&&0!=(2&$y(e))}function Lm(e){return !!(465829888&e.flags&&1146880&Cc(e).flags)}function Rm(e){return !(!(465829888&e.flags)||Eb(Cc(e),98304))}function Bm(t,r,n){var i,a;return n&&2&n||!im(t,Lm)||!function(e,t){var r=t.parent;return 205===r.kind||207===r.kind&&r.expression===t||206===r.kind&&r.expression===t&&!(im(e,Rm)&&D_(rx(r.argumentExpression)))}(t,r)&&(i=r,!(a=(e.isIdentifier(i)||e.isPropertyAccessExpression(i)||e.isElementAccessExpression(i))&&!((e.isJsxOpeningElement(i.parent)||e.isJsxSelfClosingElement(i.parent))&&i.parent.tagName===i)&&my(i,8))||b_(a))?t:lm(t,(function(e){return 465829888&e.flags?Cc(e):e}))}function jm(t){return !!e.findAncestor(t,(function(t){var r=t.parent;return void 0===r?"quit":e.isExportAssignment(r)?r.expression===t&&e.isEntityNameExpression(t):!!e.isExportSpecifier(r)&&(r.name===t||r.propertyName===t)}))}function Jm(t,r){if(Ci(t,111551)&&!Tg(r)&&!Ai(t)){var n=ki(t);111551&n.flags&&(U.isolatedModules||e.shouldPreserveConstEnums(U)&&jm(r)||!$S(n)?wi(t):function(e){var t=Gn(e);t.constEnumReferenced||(t.constEnumReferenced=!0);}(t));}}function zm(t){return e.findAncestor(t,(function(t){return !t||e.nodeStartsNewLexicalEnvironment(t)?"quit":e.isIterationStatement(t,!1)}))}function Um(e,t){Qn(e).flags|=2,166===t.kind||170===t.kind?Qn(t.parent).flags|=4:Qn(t).flags|=4;}function Km(t){return e.isSuperCall(t)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,Km)}function Vm(e){return rs(ms($i(e)))===We}function qm(t,r,n){var i=r.parent;e.getClassExtendsHeritageElement(i)&&!Vm(i)&&t.flowNode&&!Fm(t.flowNode,!1)&&In(t,n);}function Wm(t){var r=Tg(t),n=e.getThisContainer(t,!0),i=!1;switch(170===n.kind&&qm(t,n,e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class),213===n.kind&&(n=e.getThisContainer(n,!1),i=!0),function(t,r){e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)&&r.initializer&&e.textRangeContainsPositionInclusive(r.initializer,t.pos)&&e.length(r.parent.decorators)&&In(t,e.Diagnostics.Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class);}(t,n),n.kind){case 260:In(t,e.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body);break;case 259:In(t,e.Diagnostics.this_cannot_be_referenced_in_current_location);break;case 170:Gm(t,n)&&In(t,e.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);break;case 161:In(t,e.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name);}!r&&i&&K<2&&Um(t,n);var a=Hm(t,!0,n);if(Z){var o=Uo(ce);if(a===o&&i)In(t,e.Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this);else if(!a){var s=In(t,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);if(!e.isSourceFile(n)){var c=Hm(n);c&&c!==o&&e.addRelatedInfo(s,e.createDiagnosticForNode(n,e.Diagnostics.An_outer_value_of_this_is_shadowed_by_this_container));}}}return a||we}function Hm(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=e.getThisContainer(t,!1));var i=e.isInJSFile(t);if(e.isFunctionLike(n)&&(!ty(t)||e.getThisParameter(n))){var a=pl(cl(n))||i&&function(t){var r=e.getJSDocType(t);if(r&&315===r.kind){var n=r;if(n.parameters.length>0&&n.parameters[0].name&&"this"===n.parameters[0].name.escapedText)return dd(n.parameters[0].type)}var i=e.getJSDocThisTag(t);if(i&&i.typeExpression)return dd(i.typeExpression)}(n);if(!a){var o=function(t){return 212===t.kind&&e.isBinaryExpression(t.parent)&&3===e.getAssignmentDeclarationKind(t.parent)?t.parent.left.expression.expression:168===t.kind&&204===t.parent.kind&&e.isBinaryExpression(t.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.left.expression:212===t.kind&&294===t.parent.kind&&204===t.parent.parent.kind&&e.isBinaryExpression(t.parent.parent.parent)&&6===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.left.expression:212===t.kind&&e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)&&("value"===t.parent.name.escapedText||"get"===t.parent.name.escapedText||"set"===t.parent.name.escapedText)&&e.isObjectLiteralExpression(t.parent.parent)&&e.isCallExpression(t.parent.parent.parent)&&t.parent.parent.parent.arguments[2]===t.parent.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent.parent)?t.parent.parent.parent.arguments[0].expression:e.isMethodDeclaration(t)&&e.isIdentifier(t.name)&&("value"===t.name.escapedText||"get"===t.name.escapedText||"set"===t.name.escapedText)&&e.isObjectLiteralExpression(t.parent)&&e.isCallExpression(t.parent.parent)&&t.parent.parent.arguments[2]===t.parent&&9===e.getAssignmentDeclarationKind(t.parent.parent)?t.parent.parent.arguments[0].expression:void 0}(n);if(i&&o){var s=ax(o).symbol;s&&s.members&&16&s.flags&&(a=ms(s).thisType);}else Fh(n)&&(a=ms(Zi(n.symbol)).thisType);a||(a=Zm(n));}if(a)return Pm(t,a)}if(e.isClassLike(n.parent)){var c=$i(n.parent);return Pm(t,e.isStatic(n)?Uo(c):ms(c).thisType)}if(e.isSourceFile(n)){if(n.commonJsModuleIndicator){var l=$i(n);return l&&Uo(l)}if(n.externalModuleIndicator)return ze;if(r)return Uo(ce)}}function Gm(t,r){return !!e.findAncestor(t,(function(t){return e.isFunctionLikeDeclaration(t)?"quit":163===t.kind&&t.parent===r}))}function Qm(t){var r=207===t.parent.kind&&t.parent.expression===t,n=e.getSuperContainer(t,!0),i=n,a=!1;if(!r)for(;i&&213===i.kind;)i=e.getSuperContainer(i,!0),a=K<2;var o=0;if(!function(t){return !!t&&(r?170===t.kind:!(!e.isClassLike(t.parent)&&204!==t.parent.kind)&&(e.isStatic(t)?168===t.kind||167===t.kind||171===t.kind||172===t.kind||166===t.kind||169===t.kind:168===t.kind||167===t.kind||171===t.kind||172===t.kind||166===t.kind||165===t.kind||170===t.kind))}(i)){var s=e.findAncestor(t,(function(e){return e===i?"quit":161===e.kind}));return s&&161===s.kind?In(t,e.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name):r?In(t,e.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors):i&&i.parent&&(e.isClassLike(i.parent)||204===i.parent.kind)?In(t,e.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class):In(t,e.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions),Me}if(r||170!==n.kind||qm(t,i,e.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class),e.isStatic(i)||r?(o=512,!r&&K>=2&&K<=8&&(e.isPropertyDeclaration(i)||e.isClassStaticBlockDeclaration(i))&&e.forEachEnclosingBlockScopeContainer(t.parent,(function(t){e.isSourceFile(t)&&!e.isExternalOrCommonJsModule(t)||(Qn(t).flags|=134217728);}))):o=256,Qn(t).flags|=o,168===i.kind&&e.hasSyntacticModifier(i,256)&&(e.isSuperProperty(t.parent)&&e.isAssignmentTarget(t.parent)?Qn(i).flags|=4096:Qn(i).flags|=2048),a&&Um(t.parent,i),204===i.parent.kind)return K<2?(In(t,e.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher),Me):we;var c=i.parent;if(!e.getClassExtendsHeritageElement(c))return In(t,e.Diagnostics.super_can_only_be_referenced_in_a_derived_class),Me;var l=ms($i(c)),u=l&&is(l)[0];return u?170===i.kind&&Gm(t,i)?(In(t,e.Diagnostics.super_cannot_be_referenced_in_constructor_arguments),Me):512===o?rs(l):Ls(u,l.thisType):Me}function Xm(t){return 4&e.getObjectFlags(t)&&t.target===zt?zl(t)[0]:void 0}function Ym(t){return lm(t,(function(t){return 2097152&t.flags?e.forEach(t.types,Xm):Xm(t)}))}function Zm(t){if(213!==t.kind){if(Vd(t)){var r=Dy(t);if(r){var n=r.thisParameter;if(n)return Uo(n)}}var i=e.isInJSFile(t);if(Z||i){var a=function(e){return 168!==e.kind&&171!==e.kind&&172!==e.kind||204!==e.parent.kind?212===e.kind&&294===e.parent.kind?e.parent.parent:void 0:e.parent}(t);if(a){for(var o=py(a),s=a,c=o;c;){var l=Ym(c);if(l)return Rd(l,Zf(yy(a)));if(294!==s.parent.kind)break;c=py(s=s.parent.parent);}return jf(o?Sf(o):zb(a))}var u=e.walkUpParenthesizedExpressions(t.parent);if(220===u.kind&&63===u.operatorToken.kind){var _=u.left;if(e.isAccessExpression(_)){var d=_.expression;if(i&&e.isIdentifier(d)){var p=e.getSourceFileOfNode(u);if(p.commonJsModuleIndicator&&Sg(d)===p.symbol)return}return jf(zb(d))}}}}}function $m(t){var r=t.parent;if(Vd(r)){var n=e.getImmediatelyInvokedFunctionExpression(r);if(n&&n.arguments){var i=ch(n),a=r.parameters.indexOf(t);if(t.dotDotDotToken)return rh(i,a,i.length,we,void 0,0);var o=Qn(n),s=o.resolvedSignature;o.resolvedSignature=Er;var c=a<i.length?sf(ax(i[a])):t.initializer?void 0:Ue;return o.resolvedSignature=s,c}var l=Dy(r);if(l){var u=r.parameters.indexOf(t)-(e.getThisParameter(r)?1:0);return t.dotDotDotToken&&e.lastOrUndefined(r.parameters)===t?Yh(l,u):Xh(l,u)}}}function ey(t){var r=e.getEffectiveTypeAnnotationNode(t);if(r)return dd(r);switch(t.kind){case 163:return $m(t);case 202:return function(t){var r=t.parent.parent,n=t.propertyName||t.name,i=ey(r)||202!==r.kind&&r.initializer&&Kb(r);if(i&&!e.isBindingPattern(n)&&!e.isComputedNonLiteralName(n)){if(201===r.name.kind){var a=e.indexOfNode(t.parent.elements,t);if(a<0)return;return uy(i,a)}var o=i_(n);return Es(o)?eo(i,Ps(o)):void 0}}(t);case 166:if(e.isStatic(t))return function(t){var r=e.isExpression(t.parent)&&my(t.parent);return r?cy(r,$i(t).escapedName):void 0}(t)}}function ty(t){for(var r=!1;t.parent&&!e.isFunctionLike(t.parent);){if(e.isParameter(t.parent)&&(r||t.parent.initializer===t))return !0;e.isBindingElement(t.parent)&&t.parent.initializer===t&&(r=!0),t=t.parent;}return !1}function ry(t,r){var n=!!(2&e.getFunctionFlags(r)),i=ny(r);if(i)return zD(t,i,n)||void 0}function ny(t){var r=yl(t);if(r)return r;var n=xy(t);if(n&&!vl(n))return ml(n);var i=e.getImmediatelyInvokedFunctionExpression(t);return i?my(i):void 0}function iy(e,t){var r=ch(e).indexOf(t);return -1===r?void 0:ay(e,r)}function ay(t,r){if(e.isImportCall(t))return 0===r?He:1===r?pu(!1):we;var n=Qn(t).resolvedSignature===Nr?Nr:Nh(t);if(e.isJsxOpeningLikeElement(t)&&0===r)return vy(n,t);var i=n.parameters.length-1;return J(n)&&r>=i?F_(Uo(n.parameters[i]),ad(r-i),256):Qh(n,r)}function oy(t,r){if(void 0===r&&(r=e.getAssignmentDeclarationKind(t)),4===r)return !0;if(!e.isInJSFile(t)||5!==r||!e.isIdentifier(t.left.expression))return !1;var n=t.left.expression.escapedText,i=ei(t.left,n,111551,void 0,void 0,!0,!0);return e.isThisInitializedDeclaration(null==i?void 0:i.valueDeclaration)}function sy(t){if(!t.symbol)return rx(t.left);if(t.symbol.valueDeclaration){var r=e.getEffectiveTypeAnnotationNode(t.symbol.valueDeclaration);if(r){var n=dd(r);if(n)return n}}var i=e.cast(t.left,e.isAccessExpression);if(e.isObjectLiteralMethod(e.getThisContainer(i.expression,!1))){var a=Wm(i.expression),o=e.getElementOrPropertyAccessName(i);return void 0!==o&&cy(a,o)||void 0}}function cy(t,r){return lm(t,(function(t){var n,i;if(dc(t)){var a=nc(t),o=Tc(a)||a,s=id(e.unescapeLeadingUnderscores(r));if(Yd(s,o))return N_(t,s)}else if(3670016&t.flags){var c=Jc(t,r);if(c)return i=c,262144&e.getCheckFlags(i)&&!i.type&&Xa(i,0)>=0?void 0:Uo(c);if(_f(t)){var l=ff(t);if(l&&ky(r)&&+r>=0)return l}return null===(n=Vc(Wc(t),id(e.unescapeLeadingUnderscores(r))))||void 0===n?void 0:n.type}}),!0)}function ly(t,r){var n=t.parent,i=e.isPropertyAssignment(t)&&ey(t);if(i)return i;var a=py(n,r);if(a){if(As(t))return cy(a,$i(t).escapedName);if(t.name){var o=i_(t.name);return lm(a,(function(e){var t;return null===(t=Vc(Wc(e),o))||void 0===t?void 0:t.type}),!0)}}}function uy(e,t){return e&&(cy(e,""+t)||lm(e,(function(e){return bD(1,e,ze,void 0,!1)}),!0))}function _y(t){if(e.isJsxAttribute(t)){var r=py(t.parent);if(!r||to(r))return;return cy(r,t.name.escapedText)}return my(t.parent)}function dy(e){switch(e.kind){case 10:case 8:case 9:case 14:case 110:case 95:case 104:case 79:case 152:return !0;case 205:case 211:return dy(e.expression);case 287:return !e.expression||dy(e.expression)}return !1}function py(t,r){var n=fy(e.isObjectLiteralMethod(t)?function(t,r){if(e.Debug.assert(e.isObjectLiteralMethod(t)),!(16777216&t.flags))return ly(t,r)}(t,r):my(t,r),t,r);if(n&&!(r&&2&r&&8650752&n.flags)){var i=lm(n,Ac,!0);return 1048576&i.flags&&e.isObjectLiteralExpression(t)?function(t,r){return function(t,r){var n=wg(t),i=n&&e.find(r.properties,(function(e){return e.symbol&&294===e.kind&&e.symbol.escapedName===n&&dy(e.initializer)})),a=i&&ix(i.initializer);return a&&Ig(t,a)}(r,t)||kp(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&294===e.kind&&dy(e.initializer)&&Ag(r,e.symbol.escapedName)})),(function(e){return [function(){return ix(e.initializer)},e.symbol.escapedName]})),e.map(e.filter(yc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&Ag(r,e.escapedName)})),(function(e){return [function(){return ze},e.escapedName]}))),Yd,r)}(t,i):1048576&i.flags&&e.isJsxAttributes(t)?function(t,r){return kp(r,e.concatenate(e.map(e.filter(t.properties,(function(e){return !!e.symbol&&284===e.kind&&Ag(r,e.symbol.escapedName)&&(!e.initializer||dy(e.initializer))})),(function(e){return [e.initializer?function(){return ix(e.initializer)}:function(){return Ze},e.symbol.escapedName]})),e.map(e.filter(yc(r),(function(e){var n;return !!(16777216&e.flags)&&!!(null===(n=null==t?void 0:t.symbol)||void 0===n?void 0:n.members)&&!t.symbol.members.has(e.escapedName)&&Ag(r,e.escapedName)})),(function(e){return [function(){return ze},e.escapedName]}))),Yd,r)}(t,i):i}}function fy(t,r,n){if(t&&Eb(t,465829888)){var i=yy(r);if(i&&e.some(i.inferences,Zb)){if(n&&1&n)return gy(t,i.nonFixingMapper);if(i.returnMapper)return gy(t,i.returnMapper)}}return t}function gy(t,r){return 465829888&t.flags?Rd(t,r):1048576&t.flags?qu(e.map(t.types,(function(e){return gy(e,r)})),0):2097152&t.flags?$u(e.map(t.types,(function(e){return gy(e,r)}))):t}function my(t,r){if(16777216&t.flags);else {if(t.contextualType)return t.contextualType;var n=t.parent;switch(n.kind){case 253:case 163:case 166:case 165:case 202:return function(t,r){var n=t.parent;if(e.hasInitializer(n)&&t===n.initializer){var i=ey(n);if(i)return i;if(!(8&r)&&e.isBindingPattern(n.name))return No(n.name,!0,!1)}}(t,r);case 213:case 246:return function(t){var r=e.getContainingFunction(t);if(r){var n=ny(r);if(n){var i=e.getFunctionFlags(r);if(1&i){var a=ED(n,2&i?2:1,void 0);if(!a)return;n=a.returnType;}if(2&i){var o=lm(n,Px);return o&&qu([o,lb(o)])}return n}}}(t);case 223:return function(t){var r=e.getContainingFunction(t);if(r){var n=e.getFunctionFlags(r),i=ny(r);if(i)return t.asteriskToken?i:zD(0,i,0!=(2&n))}}(n);case 217:return function(e,t){var r=my(e,t);if(r){var n=Px(r);return n&&qu([n,lb(n)])}}(n,r);case 207:case 208:return iy(n,t);case 210:case 228:return e.isConstTypeReference(n.type)?o(n):dd(n.type);case 220:return function(t,r){var n=t.parent,i=n.left,a=n.operatorToken,o=n.right;switch(a.kind){case 63:case 76:case 75:case 77:return t===o?function(t){var r,n,i=e.getAssignmentDeclarationKind(t);switch(i){case 0:case 4:var a=function(t){if(t.symbol)return t.symbol;if(e.isIdentifier(t))return Sg(t);if(e.isPropertyAccessExpression(t)){var r=rx(t.expression);return e.isPrivateIdentifier(t.name)?function(e,t){var r=gv(t.escapedText,t);return r&&yv(e,r)}(r,t.name):Jc(r,t.name.escapedText)}}(t.left),o=a&&a.valueDeclaration;return o&&(e.isPropertyDeclaration(o)||e.isPropertySignature(o))?(c=e.getEffectiveTypeAnnotationNode(o))&&Rd(dd(c),Gn(a).mapper)||o.initializer&&rx(t.left):0===i?rx(t.left):sy(t);case 5:if(oy(t,i))return sy(t);if(t.left.symbol){var s=t.left.symbol.valueDeclaration;if(!s)return;var c,l=e.cast(t.left,e.isAccessExpression);if(c=e.getEffectiveTypeAnnotationNode(s))return dd(c);if(e.isIdentifier(l.expression)){var u=l.expression,_=ei(u,u.escapedText,111551,void 0,u.escapedText,!0);if(_){var d=_.valueDeclaration&&e.getEffectiveTypeAnnotationNode(_.valueDeclaration);if(d){var p=e.getElementOrPropertyAccessName(l);if(void 0!==p)return cy(dd(d),p)}return}}return e.isInJSFile(s)?void 0:rx(t.left)}return rx(t.left);case 1:case 6:case 3:var f=null===(r=t.left.symbol)||void 0===r?void 0:r.valueDeclaration;case 2:f||(f=null===(n=t.symbol)||void 0===n?void 0:n.valueDeclaration);var g=f&&e.getEffectiveTypeAnnotationNode(f);return g?dd(g):void 0;case 7:case 8:case 9:return e.Debug.fail("Does not apply");default:return e.Debug.assertNever(i)}}(n):void 0;case 56:case 60:var s=my(n,r);return t===o&&(s&&s.pattern||!s&&!e.isDefaultedExpandoInitializer(n))?rx(i):s;case 55:case 27:return t===o?my(n,r):void 0;default:return}}(t,r);case 294:case 295:return ly(n,r);case 296:return my(n.parent,r);case 203:var i=n;return uy(py(i,r),e.indexOfNode(i.elements,t));case 221:return function(e,t){var r=e.parent;return e===r.whenTrue||e===r.whenFalse?my(r,t):void 0}(t,r);case 232:return e.Debug.assert(222===n.parent.kind),function(e,t){if(209===e.parent.kind)return iy(e.parent,t)}(n.parent,t);case 211:var a=e.isInJSFile(n)?e.getJSDocTypeTag(n):void 0;return a?e.isJSDocTypeTag(a)&&e.isConstTypeReference(a.typeExpression.type)?o(n):dd(a.typeExpression.type):my(n,r);case 229:return my(n,r);case 287:return function(t){var r=t.parent;return e.isJsxAttributeLike(r)?my(t):e.isJsxElement(r)?function(t,r){var n=py(t.openingElement.tagName),i=Ky(zy(t));if(n&&!to(n)&&i&&""!==i){var a=e.getSemanticJsxChildren(t.children),o=a.indexOf(r),s=cy(n,i);return s&&(1===a.length?s:lm(s,(function(e){return Qp(e)?F_(e,ad(o)):e}),!0))}}(r,t):void 0}(n);case 284:case 286:return _y(n);case 279:case 278:return function(t,r){return e.isJsxOpeningElement(t)&&t.parent.contextualType&&4!==r?t.parent.contextualType:ay(t,0)}(n,r)}}function o(e){return my(e)}}function yy(t){var r=e.findAncestor(t,(function(e){return !!e.inferenceContext}));return r&&r.inferenceContext}function vy(t,r){return 0!==ih(r)?function(e,t){var r=ib(e,je);r=hy(t,zy(t),r);var n=By(A.IntrinsicAttributes,t);return ro(n)||(r=Gs(n,r)),r}(t,r):function(t,r){var n,i=zy(r),a=(n=i,Uy(A.ElementAttributesPropertyNameContainer,n)),o=void 0===a?ib(t,je):""===a?ml(t):function(e,t){if(e.compositeSignatures){for(var r=[],n=0,i=e.compositeSignatures;n<i.length;n++){var a=ml(i[n]);if(to(a))return a;var o=eo(a,t);if(!o)return;r.push(o);}return $u(r)}var s=ml(e);return to(s)?s:eo(s,t)}(t,a);if(!o)return a&&e.length(r.attributes.properties)&&In(r,e.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property,e.unescapeLeadingUnderscores(a)),je;if(to(o=hy(r,i,o)))return o;var s=o,c=By(A.IntrinsicClassAttributes,r);if(!ro(c)){var l=Xo(c.symbol),u=ml(t);s=Gs(l?Bl(c,sl([u],l,ol(l),e.isInJSFile(r))):c,s);}var _=By(A.IntrinsicAttributes,r);return ro(_)||(s=Gs(_,s)),s}(t,r)}function hy(t,r,n){var i,a=(i=r)&&Yn(i.exports,A.LibraryManagedAttributes,788968);if(a){var o=ms(a),s=function(e){if(Oy(e.tagName))return Cl(Ch(e,t=Wy(e)));var t,r=zb(e.tagName);return 128&r.flags?(t=qy(r,e))?Cl(Ch(e,t)):Me:r}(t);if(524288&a.flags){var c=Gn(a).typeParameters;if(e.length(c)>=2)return Vl(a,sl([s,n],c,2,e.isInJSFile(t)))}if(e.length(o.typeParameters)>=2)return Bl(o,sl([s,n],o.typeParameters,2,e.isInJSFile(t)))}return n}function by(t,r){var n=Uc(t,0),i=e.filter(n,(function(t){return !function(t,r){for(var n=0;n<r.parameters.length;n++){var i=r.parameters[n];if(i.initializer||i.questionToken||i.dotDotDotToken||tl(i))break}return r.parameters.length&&e.parameterIsThisKeyword(r.parameters[0])&&n--,!eb(t)&&Zh(t)<n}(t,r)}));return 1===i.length?i[0]:function(t){return e.getStrictOptionValue(U,"noImplicitAny")?e.reduceLeft(t,(function(t,r){return t!==r&&t?Ws(t.typeParameters,r.typeParameters)?function(t,r){var n,i=t.typeParameters||r.typeParameters;t.typeParameters&&r.typeParameters&&(n=vd(r.typeParameters,t.typeParameters));var a=t.declaration,o=function(e,t,r){for(var n=Zh(e),i=Zh(t),a=n>=i?e:t,o=a===e?t:e,s=a===e?n:i,c=eb(e)||eb(t),l=c&&!eb(a),u=new Array(s+(l?1:0)),_=0;_<s;_++){var d=Xh(a,_);a===t&&(d=Rd(d,r));var p=Xh(o,_)||je;o===t&&(p=Rd(p,r));var f=qu([d,p]),g=c&&!l&&_===s-1,m=_>=$h(a)&&_>=$h(o),y=_>=n?void 0:qh(e,_),v=_>=i?void 0:qh(t,_),h=jn(1|(m&&!g?16777216:0),(y===v?y:y?v?void 0:y:v)||"arg".concat(_));h.type=g?Tu(f):f,u[_]=h;}if(l){var b=jn(1,"args");b.type=Tu(Qh(o,s)),o===t&&(b.type=Rd(b.type,r)),u[s]=b;}return u}(t,r,n),s=Bs(a,i,function(e,t,r){return e&&t?wf(e,qu([Uo(e),Rd(Uo(t),r)])):e||t}(t.thisParameter,r.thisParameter,n),o,void 0,void 0,Math.max(t.minArgumentCount,r.minArgumentCount),39&(t.flags|r.flags));return s.compositeKind=2097152,s.compositeSignatures=e.concatenate(2097152===t.compositeKind&&t.compositeSignatures||[t],[r]),n&&(s.mapper=2097152===t.compositeKind&&t.mapper&&t.compositeSignatures?Td(t.mapper,n):n),s}(t,r):void 0:t})):void 0}(i)}function xy(t){return e.isFunctionExpressionOrArrowFunction(t)||e.isObjectLiteralMethod(t)?Dy(t):void 0}function Dy(t){e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t));var r=ll(t);if(r)return r;var n=py(t,1);if(n){if(!(1048576&n.flags))return by(n,t);for(var i,a=0,o=n.types;a<o.length;a++){var s=by(o[a],t);if(s)if(i){if(!Kp(i[0],s,!1,!0,!0,Hd))return;i.push(s);}else i=[s];}return i?1===i.length?i[0]:Js(i[0],i):void 0}}function Sy(e){return 202===e.kind&&!!e.initializer||220===e.kind&&63===e.operatorToken.kind}function Ty(t,r,n){for(var i=t.elements,a=i.length,o=[],s=[],c=py(t),l=e.isAssignmentTarget(t),u=Wb(t),_=!1,d=0;d<a;d++){var p=i[d];if(224===p.kind){K<2&&ST(p,U.downlevelIteration?1536:1024);var f=ax(p.expression,r,n);if(Qp(f))o.push(f),s.push(8);else if(l){var g=Qc(f,Ge)||bD(65,f,ze,void 0,!1)||je;o.push(g),s.push(4);}else o.push(hD(33,f,ze,p.expression)),s.push(4);}else if(re&&226===p.kind)_=!0,o.push(Ve),s.push(2);else {var m=Hb(p,r,uy(c,o.length),n);o.push(go(m,!0,_)),s.push(_?2:1);}}return l?Au(o,s):n||u||c&&im(c,$p)?Cy(Au(o,s,u)):Cy(Tu(o.length?qu(e.sameMap(o,(function(e,t){return 8&s[t]?P_(e,Ge)||we:e})),2):H?ot:Ue,u))}function Cy(t){if(!(4&e.getObjectFlags(t)))return t;var r=t.literalType;return r||((r=t.literalType=jl(t)).objectFlags|=294912),r}function Ey(e){switch(e.kind){case 161:return function(e){return kb(Ny(e),296)}(e);case 79:return ky(e.escapedText);case 8:case 10:return ky(e.text);default:return !1}}function ky(e){return (+e).toString()===e}function Ny(t){var r=Qn(t.expression);if(!r.resolvedType){if((e.isTypeLiteralNode(t.parent.parent)||e.isClassLike(t.parent.parent)||e.isInterfaceDeclaration(t.parent.parent))&&e.isBinaryExpression(t.expression)&&101===t.expression.operatorToken.kind)return r.resolvedType=Me;if(r.resolvedType=ax(t.expression),e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&e.isClassExpression(t.parent.parent)){var n=zm(e.getEnclosingBlockScopeContainer(t.parent.parent));n&&(Qn(n).flags|=65536,Qn(t).flags|=524288,Qn(t.parent.parent).flags|=524288);}(98304&r.resolvedType.flags||!kb(r.resolvedType,402665900)&&!Yd(r.resolvedType,ut))&&In(t,e.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any);}return r.resolvedType}function Fy(t){var r,n=null===(r=t.declarations)||void 0===r?void 0:r[0];return e.isKnownSymbol(t)||n&&e.isNamedDeclaration(n)&&e.isComputedPropertyName(n.name)&&kb(Ny(n.name),4096)}function Ay(t,r,n,i){for(var a,o,s,c=[],l=r;l<n.length;l++){var u=n[l];(i===He&&!Fy(u)||i===Ge&&(s=null===(o=(a=u).declarations)||void 0===o?void 0:o[0],ky(a.escapedName)||s&&e.isNamedDeclaration(s)&&Ey(s.name))||i===tt&&Fy(u))&&c.push(Uo(n[l]));}return Nl(i,c.length?qu(c,2):ze,Wb(t))}function Py(t){e.Debug.assert(0!=(2097152&t.flags),"Should only get Alias here.");var r=Gn(t);if(!r.immediateTarget){var n=di(t);if(!n)return e.Debug.fail();r.immediateTarget=Ti(n,!0);}return r.immediateTarget}function wy(t){if(465829888&t.flags){var r=Tc(t);if(void 0!==r)return wy(r)}return !!(126615553&t.flags||117632&vf(t)&&wy(hf(t))||3145728&t.flags&&e.every(t.types,wy))}function Iy(t){return e.stringContains(t,"-")}function Oy(t){return 79===t.kind&&e.isIntrinsicJsxName(t.escapedText)}function My(e,t){return e.initializer?Hb(e.initializer,t):Ze}function Ly(e,t){for(var r=[],n=0,i=e.children;n<i.length;n++){var a=i[n];if(11===a.kind)a.containsOnlyTriviaWhiteSpaces||r.push(He);else {if(287===a.kind&&!a.expression)continue;r.push(Hb(a,t));}}return r}function Ry(t,r,n){for(var i=0,a=yc(t);i<a.length;i++){var o=a[i];if(!(16777216&o.flags)){var s=r.get(o.escapedName);if(s){var c=In(s.valueDeclaration,e.Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten,e.unescapeLeadingUnderscores(s.escapedName));e.addRelatedInfo(c,e.createDiagnosticForNode(n,e.Diagnostics.This_spread_always_overwrites_this_property));}}}}function By(e,t){var r=zy(t),n=r&&Gi(r),i=n&&Yn(n,e,788968);return i?ms(i):Me}function jy(t){var r=Qn(t);if(!r.resolvedSymbol){var n=By(A.IntrinsicElements,t);if(ro(n))return Y&&In(t,e.Diagnostics.JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists,e.unescapeLeadingUnderscores(A.IntrinsicElements)),r.resolvedSymbol=Ne;if(!e.isIdentifier(t.tagName))return e.Debug.fail();var i=Jc(n,t.tagName.escapedText);return i?(r.jsxFlags|=1,r.resolvedSymbol=i):Qc(n,He)?(r.jsxFlags|=2,r.resolvedSymbol=n.symbol):(In(t,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.idText(t.tagName),"JSX."+A.IntrinsicElements),r.resolvedSymbol=Ne)}return r.resolvedSymbol}function Jy(t){var r=t&&e.getSourceFileOfNode(t),n=r&&Qn(r);if(!n||!1!==n.jsxImplicitImportContainer){if(n&&n.jsxImplicitImportContainer)return n.jsxImplicitImportContainer;var i=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(U,r),U);if(i){var a=ji(t,i,e.getEmitModuleResolutionKind(U)===e.ModuleResolutionKind.Classic?e.Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option:e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations,t),o=a&&a!==Ne?Zi(Ei(a)):void 0;return n&&(n.jsxImplicitImportContainer=o||!1),o}}}function zy(e){var t=e&&Qn(e);if(t&&t.jsxNamespace)return t.jsxNamespace;if(!t||!1!==t.jsxNamespace){var r=Jy(e);if(!r||r===Ne){var n=Nn(e);r=ei(e,n,1920,void 0,n,!1);}if(r){var i=Ei(Yn(Gi(Ei(r)),A.JSX,1920));if(i&&i!==Ne)return t&&(t.jsxNamespace=i),i}t&&(t.jsxNamespace=!1);}var a=Ei(uu(A.JSX,1920,void 0));return a!==Ne?a:void 0}function Uy(t,r){var n=r&&Yn(r.exports,t,788968),i=n&&ms(n),a=i&&yc(i);if(a){if(0===a.length)return "";if(1===a.length)return a[0].escapedName;a.length>1&&n.declarations&&In(n.declarations[0],e.Diagnostics.The_global_type_JSX_0_may_not_have_more_than_one_property,e.unescapeLeadingUnderscores(t));}}function Ky(e){return Uy(A.ElementChildrenAttributeNameContainer,e)}function Vy(t,r){if(4&t.flags)return [Er];if(128&t.flags){var n=qy(t,r);return n?[Ch(r,n)]:(In(r,e.Diagnostics.Property_0_does_not_exist_on_type_1,t.value,"JSX."+A.IntrinsicElements),e.emptyArray)}var i=Ac(t),a=Uc(i,1);return 0===a.length&&(a=Uc(i,0)),0===a.length&&1048576&i.flags&&(a=qs(e.map(i.types,(function(e){return Vy(e,r)})))),a}function qy(t,r){var n=By(A.IntrinsicElements,r);if(!ro(n)){var i=t.value,a=Jc(n,e.escapeLeadingUnderscores(i));return a?Uo(a):Qc(n,He)||void 0}return we}function Wy(t){e.Debug.assert(Oy(t.tagName));var r=Qn(t);if(!r.resolvedJsxElementAttributesType){var n=jy(t);return 1&r.jsxFlags?r.resolvedJsxElementAttributesType=Uo(n)||Me:2&r.jsxFlags?r.resolvedJsxElementAttributesType=Qc(By(A.IntrinsicElements,t),He)||Me:r.resolvedJsxElementAttributesType=Me}return r.resolvedJsxElementAttributesType}function Hy(e){var t=By(A.ElementClass,e);if(!ro(t))return t}function Gy(e){return By(A.Element,e)}function Qy(e){var t=Gy(e);if(t)return qu([t,qe])}function Xy(t){var r,n=e.isJsxOpeningLikeElement(t);if(n&&function(t){(function(t){if(e.isPropertyAccessExpression(t)){var r=t;do{var n=a(r.name);if(n)return n;r=r.expression;}while(e.isPropertyAccessExpression(r));var i=a(r);if(i)return i}function a(t){if(e.isIdentifier(t)&&-1!==e.idText(t).indexOf(":"))return YT(t,e.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names)}})(t.tagName),AT(t,t.typeArguments);for(var r=new e.Map,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(286!==a.kind){var o=a.name,s=a.initializer;if(r.get(o.escapedText))return YT(o,e.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name);if(r.set(o.escapedText,!0),s&&287===s.kind&&!s.expression)return YT(s,e.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression)}}}(t),r=t,0===(U.jsx||0)&&In(r,e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided),void 0===Gy(r)&&Y&&In(r,e.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist),!Jy(t)){var i=mn&&2===U.jsx?e.Diagnostics.Cannot_find_name_0:void 0,a=Nn(t),o=n?t.tagName:t,s=void 0;if(e.isJsxOpeningFragment(t)&&"null"===a||(s=ei(o,a,111551,i,a,!0)),s&&(s.isReferenced=67108863,2097152&s.flags&&!Ai(s)&&wi(s)),e.isJsxOpeningFragment(t)){var c=Fn(e.getSourceFileOfNode(t));c&&ei(o,c,111551,i,c,!0);}}if(n){var l=t,u=Nh(l);wh(u,t),function(t,r,n){if(1===t)(i=Qy(n))&&Dp(r,i,Dn,n.tagName,e.Diagnostics.Its_return_type_0_is_not_a_valid_JSX_element,o);else if(0===t)(a=Hy(n))&&Dp(r,a,Dn,n.tagName,e.Diagnostics.Its_instance_type_0_is_not_a_valid_JSX_element,o);else {var i=Qy(n),a=Hy(n);if(!i||!a)return;Dp(r,qu([i,a]),Dn,n.tagName,e.Diagnostics.Its_element_type_0_is_not_a_valid_JSX_element,o);}function o(){var t=e.getTextOfNode(n.tagName);return e.chainDiagnosticMessages(void 0,e.Diagnostics._0_cannot_be_used_as_a_JSX_component,t)}}(ih(l),ml(u),l);}}function Yy(e,t,r){if(524288&e.flags){if(gc(e,t)||Zc(e,t)||Ns(t)&&Gc(e,He)||r&&Iy(t))return !0}else if(3145728&e.flags&&Zy(e))for(var n=0,i=e.types;n<i.length;n++)if(Yy(i[n],t,r))return !0;return !1}function Zy(t){return !!(524288&t.flags&&!(512&e.getObjectFlags(t))||67108864&t.flags||1048576&t.flags&&e.some(t.types,Zy)||2097152&t.flags&&e.every(t.types,Zy))}function $y(t){return t.valueDeclaration?e.getCombinedNodeFlags(t.valueDeclaration):0}function ev(t){if(8192&t.flags||4&e.getCheckFlags(t))return !0;if(e.isInJSFile(t.valueDeclaration)){var r=t.valueDeclaration.parent;return r&&e.isBinaryExpression(r)&&3===e.getAssignmentDeclarationKind(r)}}function tv(e,t,r,n,i,a){return void 0===a&&(a=!0),rv(e,t,r,n,i,a?160===e.kind?e.right:199===e.kind?e:202===e.kind&&e.propertyName?e.propertyName:e.name:void 0)}function rv(t,r,n,i,a,o){var s,c,l=e.getDeclarationModifierFlagsFromSymbol(a,n);if(r){if(K<2&&nv(a))return o&&In(o,e.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword),!1;if(128&l)return o&&In(o,e.Diagnostics.Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression,Ia(a),Ma(Rp(a))),!1}if(128&l&&nv(a)&&(e.isThisProperty(t)||e.isThisInitializedObjectBindingExpression(t)||e.isObjectBindingPattern(t.parent)&&e.isThisInitializedDeclaration(t.parent.parent))&&(c=e.getClassLikeDeclarationOfSymbol(ea(a)))&&(s=t,e.findAncestor(s,(function(t){return !!(e.isConstructorDeclaration(t)&&e.nodeIsPresent(t.body)||e.isPropertyDeclaration(t))||!(!e.isClassLike(t)&&!e.isFunctionLikeDeclaration(t))&&"quit"}))))return o&&In(o,e.Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor,Ia(a),e.getTextOfIdentifierOrLiteral(c.name)),!1;if(!(24&l))return !0;if(8&l)return !!PS(t,c=e.getClassLikeDeclarationOfSymbol(ea(a)))||(o&&In(o,e.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1,Ia(a),Ma(Rp(a))),!1);if(r)return !0;var u=AS(t,(function(t){var r=ms($i(t));return function(t,r,n){return Lp(r,(function(r){return !!(16&e.getDeclarationModifierFlagsFromSymbol(r,n))&&!Wo(t,Rp(r))}))?void 0:t}(r,a,n)?r:void 0}));if(!u){var _=void 0;if(32&l||!(_=function(t){var r=e.getThisContainer(t,!1);return r&&e.isFunctionLike(r)?e.getThisParameter(r):void 0}(t))||!_.type)return o&&In(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses,Ia(a),Ma(Rp(a)||i)),!1;var d=dd(_.type);u=(262144&d.flags?hc(d):d).target;}return !!(32&l)||(262144&i.flags&&(i=i.isThisType?hc(i):Tc(i)),!(!i||!Wo(i,u))||(o&&In(o,e.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2,Ia(a),Ma(u),Ma(i)),!1))}function nv(e){return !!Lp(e,(function(e){return !(8192&e.flags)}))}function iv(e){return uv(ax(e),e)}function av(e){return !!(98304&(H?vf(e):e.flags))}function ov(e){return av(e)?Sf(e):e}function sv(t,r){In(t,32768&r?65536&r?e.Diagnostics.Object_is_possibly_null_or_undefined:e.Diagnostics.Object_is_possibly_undefined:e.Diagnostics.Object_is_possibly_null);}function cv(t,r){In(t,32768&r?65536&r?e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined:e.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null);}function lv(t,r,n){if(H&&2&t.flags)return In(r,e.Diagnostics.Object_is_of_type_unknown),Me;var i=98304&(H?vf(t):t.flags);if(i){n(r,i);var a=Sf(t);return 229376&a.flags?Me:a}return t}function uv(e,t){return lv(e,t,sv)}function _v(t,r){var n=uv(t,r);return 16384&n.flags&&In(r,e.Diagnostics.Object_is_possibly_undefined),n}function dv(e,t){return 32&e.flags?function(e,t){var r=ax(e.expression),n=kf(r,e.expression);return Ef(hv(e,e.expression,uv(n,e.expression),e.name,t),e,n!==r)}(e,t):hv(e,e.expression,iv(e.expression),e.name,t)}function pv(t,r){var n=e.isPartOfTypeQuery(t)&&e.isThisIdentifier(t.left)?uv(Wm(t.left),t.left):iv(t.left);return hv(t,t.left,n,t.right,r)}function fv(t){for(;211===t.parent.kind;)t=t.parent;return e.isCallOrNewExpression(t.parent)&&t.parent.expression===t}function gv(t,r){for(var n=e.getContainingClass(r);n;n=e.getContainingClass(n)){var i=n.symbol,a=e.getSymbolNameForPrivateIdentifier(i,t),o=i.members&&i.members.get(a)||i.exports&&i.exports.get(a);if(o)return o}}function mv(t){if(e.isExpressionNode(t)){var r=Qn(t);return void 0===r.resolvedSymbol&&(r.resolvedSymbol=gv(t.escapedText,t)),r.resolvedSymbol}}function yv(e,t){return Jc(e,t.escapedName)}function vv(t,r){return (yo(r)||e.isThisProperty(t)&&vo(r))&&e.getThisContainer(t,!0)===ho(r)}function hv(t,r,n,i,a){var o,s,c=Qn(r).resolvedSymbol,u=e.getAssignmentTargetKind(t),_=Ac(0!==u||fv(t)?jf(n):n),d=to(_)||_===it;if(e.isPrivateIdentifier(i)){K<99&&(0!==u&&ST(t,1048576),1!==u&&ST(t,524288));var p=gv(i.escapedText,i);if(u&&p&&p.valueDeclaration&&e.isMethodDeclaration(p.valueDeclaration)&&YT(i,e.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable,e.idText(i)),(null==p?void 0:p.valueDeclaration)&&99===e.getEmitScriptTarget(U)&&!q){var f=e.getContainingClass(p.valueDeclaration),g=e.findAncestor(t,(function(t){return t===f?"quit":!(!e.isPropertyDeclaration(t.parent)||!e.hasStaticModifier(t.parent)||t.parent.initializer!==t||t.parent.parent!==f)}));if(g){var m=$i(g.parent);e.Debug.assert(m,"Initializer without declaration symbol");var y=In(t,e.Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false,e.symbolName(p));e.addRelatedInfo(y,e.createDiagnosticForNode(g.parent,e.Diagnostics.Initializer_for_property_0,e.symbolName(m)));}}if(d){if(p)return ro(_)?Me:_;if(!e.getContainingClass(i))return YT(i,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),we}if(!(o=p?yv(n,p):void 0)&&function(t,r,n){var i,a=yc(t);a&&e.forEach(a,(function(t){var n=t.valueDeclaration;if(n&&e.isNamedDeclaration(n)&&e.isPrivateIdentifier(n.name)&&n.name.escapedText===r.escapedText)return i=t,!0}));var o=ai(r);if(i){var s=e.Debug.checkDefined(i.valueDeclaration),c=e.Debug.checkDefined(e.getContainingClass(s));if(null==n?void 0:n.valueDeclaration){var u=n.valueDeclaration,_=e.getContainingClass(u);if(e.Debug.assert(!!_),e.findAncestor(_,(function(e){return c===e}))){var d=In(r,e.Diagnostics.The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling,o,Ma(t));return e.addRelatedInfo(d,e.createDiagnosticForNode(u,e.Diagnostics.The_shadowing_declaration_of_0_is_defined_here,o),e.createDiagnosticForNode(s,e.Diagnostics.The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here,o)),!0}}return In(r,e.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier,o,ai(c.name||l)),!0}return !1}(n,i,p))return Me;o&&65536&o.flags&&!(32768&o.flags)&&1!==u&&In(t,e.Diagnostics.Private_accessor_was_defined_without_a_getter);}else {if(d)return e.isIdentifier(r)&&c&&Jm(c,t),ro(_)?Me:_;o=Jc(_,i.escapedText);}if(e.isIdentifier(r)&&c&&(U.isolatedModules||!o||!$S(o)||e.shouldPreserveConstEnums(U)&&jm(t))&&Jm(c,t),o){o.declarations&&134217728&$y(o)&&g_(t,o)&&Bn(i,o.declarations,i.escapedText),function(t,r,n){var i,a=t.valueDeclaration;if(a&&!e.getSourceFileOfNode(r).isDeclarationFile){var o=e.idText(n);!Dv(r)||function(t){return e.isPropertyDeclaration(t)&&t.questionToken}(a)||e.isAccessExpression(r)&&e.isAccessExpression(r.expression)||Zn(a,n)||!U.useDefineForClassFields&&function(e){if(!(32&e.parent.flags))return !1;for(var t=Uo(e.parent);;){if(!(t=t.symbol&&Sv(t)))return !1;var r=Jc(t,e.escapedName);if(r&&r.valueDeclaration)return !0}}(t)?256!==a.kind||177===r.parent.kind||8388608&a.flags||Zn(a,n)||(i=In(n,e.Diagnostics.Class_0_used_before_its_declaration,o)):i=In(n,e.Diagnostics.Property_0_is_used_before_its_initialization,o),i&&e.addRelatedInfo(i,e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_here,o));}}(o,t,i),Iv(o,t,Ov(r,c)),Qn(t).resolvedSymbol=o;var v=e.isWriteAccess(t);if(tv(t,106===r.kind,v,_,o),Sb(t,o,u))return In(i,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,e.idText(i)),Me;s=vv(t,o)?Ie:v?function(e){if(98304&e.flags){var t=function(e){var t=Gn(e);return t.writeType||(t.writeType=Lo(e,!0))}(e);if(t)return t}return Uo(e)}(o):Uo(o);}else {var h=e.isPrivateIdentifier(i)||0!==u&&x_(n)&&!T_(n)?void 0:Zc(_,i.escapedText);if(!h||!h.type){var b=bv(t,n.symbol,!0);return !b&&p_(n)?we:n.symbol===ce?(ce.exports.has(i.escapedText)&&418&ce.exports.get(i.escapedText).flags?In(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.unescapeLeadingUnderscores(i.escapedText),Ma(n)):Y&&In(i,e.Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature,Ma(n)),we):(i.escapedText&&!si(t)&&Tv(i,T_(n)?_:n,b),Me)}h.isReadonly&&(e.isAssignmentTarget(t)||e.isDeleteTarget(t))&&In(t,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(_)),s=U.noUncheckedIndexedAccess&&!e.isAssignmentTarget(t)?qu([h.type,ze]):h.type,U.noPropertyAccessFromIndexSignature&&e.isPropertyAccessExpression(t)&&In(i,e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0,e.unescapeLeadingUnderscores(i.escapedText));}return xv(t,o,s,i,a)}function bv(t,r,n){var i=e.getSourceFileOfNode(t);if(i&&void 0===U.checkJs&&void 0===i.checkJsDirective&&(1===i.scriptKind||2===i.scriptKind)){var a=e.forEach(null==r?void 0:r.declarations,e.getSourceFileOfNode);return !(i!==a&&a&&Xn(a)||n&&r&&32&r.flags||t&&n&&e.isPropertyAccessExpression(t)&&108===t.expression.kind)}return !1}function xv(t,r,n,i,a){var o=e.getAssignmentTargetKind(t);if(1===o)return Nf(n,!!(r&&16777216&r.flags));if(r&&!(98311&r.flags)&&!(8192&r.flags&&1048576&n.flags)&&!vS(r.declarations))return n;if(n===Ie)return xo(t,r);n=Bm(n,t,a);var s=!1;if(H&&X&&e.isAccessExpression(t)&&108===t.expression.kind){var c=r&&r.valueDeclaration;if(c&&rS(c)&&!e.isStatic(c)){var l=wm(t);170!==l.kind||l.parent!==c.parent||8388608&c.flags||(s=!0);}}else H&&r&&r.valueDeclaration&&e.isPropertyAccessExpression(r.valueDeclaration)&&e.getAssignmentDeclarationPropertyAccessKind(r.valueDeclaration)&&wm(t)===wm(r.valueDeclaration)&&(s=!0);var u=Pm(t,n,s?Df(n):n);return s&&!(32768&vf(n))&&32768&vf(u)?(In(i,e.Diagnostics.Property_0_is_used_before_being_assigned,Ia(r)),n):o?of(u):u}function Dv(t){return !!e.findAncestor(t,(function(t){switch(t.kind){case 166:return !0;case 294:case 168:case 171:case 172:case 296:case 161:case 232:case 287:case 284:case 285:case 286:case 279:case 227:case 290:return !1;case 213:case 237:return !(!e.isBlock(t.parent)||!e.isClassStaticBlockDeclaration(t.parent.parent))||"quit";default:return !e.isExpressionNode(t)&&"quit"}}))}function Sv(e){var t=is(e);if(0!==t.length)return $u(t)}function Tv(t,r,n){var i,a;if(!e.isPrivateIdentifier(t)&&1048576&r.flags&&!(131068&r.flags))for(var o=0,s=r.types;o<s.length;o++){var c=s[o];if(!Jc(c,t.escapedText)&&!Zc(c,t.escapedText)){i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),Ma(c));break}}if(Cv(t.escapedText,r)){var l=e.declarationNameToString(t),u=Ma(r);i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead,l,u,u+"."+l);}else {var _=Cx(r);if(_&&Jc(_,t.escapedText))i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1,e.declarationNameToString(t),Ma(r)),a=e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await);else {var d=e.declarationNameToString(t),p=Ma(r),f=function(t,r){var n=Ac(r).symbol;if(n)for(var i=e.getScriptTargetFeatures(),a=0,o=e.getOwnKeys(i);a<o.length;a++){var s=o[a],c=i[s][e.symbolName(n)];if(void 0!==c&&e.contains(c,t))return s}}(d,r);if(void 0!==f)i=e.chainDiagnosticMessages(i,e.Diagnostics.Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later,d,p,f);else {var g=kv(t,r);if(void 0!==g){var m=e.symbolName(g),y=n?e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2:e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;i=e.chainDiagnosticMessages(i,y,d,p,m),a=g.valueDeclaration&&e.createDiagnosticForNode(g.valueDeclaration,e.Diagnostics._0_is_declared_here,m);}else {var v=function(t){return U.lib&&!U.lib.includes("dom")&&(n=function(t){return t.symbol&&/^(EventTarget|Node|((HTML[a-zA-Z]*)?Element))$/.test(e.unescapeLeadingUnderscores(t.symbol.escapedName))},3145728&(r=t).flags?e.every(r.types,n):n(r))&&fp(t);var r,n;}(r)?e.Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom:e.Diagnostics.Property_0_does_not_exist_on_type_1;i=e.chainDiagnosticMessages(jc(i,r),v,d,p);}}}}var h=e.createDiagnosticForNodeFromMessageChain(t,i);a&&e.addRelatedInfo(h,a),On(!n||i.code!==e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,h);}function Cv(t,r){var n=r.symbol&&Jc(Uo(r.symbol),t);return void 0!==n&&!!n.valueDeclaration&&e.isStatic(n.valueDeclaration)}function Ev(e,t){return wv(e,yc(t),106500)}function kv(t,r){var n=yc(r);if("string"!=typeof t){var i=t.parent;e.isPropertyAccessExpression(i)&&(n=e.filter(n,(function(e){return Mv(i,r,e)}))),t=e.idText(t);}return wv(t,n,111551)}function Nv(t,r){var n=e.isString(t)?t:e.idText(t),i=yc(r),a="for"===n?e.find(i,(function(t){return "htmlFor"===e.symbolName(t)})):"class"===n?e.find(i,(function(t){return "className"===e.symbolName(t)})):void 0;return null!=a?a:wv(n,i,111551)}function Fv(t,r){var n=kv(t,r);return n&&e.symbolName(n)}function Av(t,r,n){return e.Debug.assert(void 0!==r,"outername should always be defined"),ti(t,r,n,void 0,r,!1,!1,!0,(function(t,n,i){e.Debug.assertEqual(r,n,"name should equal outerName");var a,o=Yn(t,n,i);return o||(a=t===oe?e.mapDefined(["string","number","boolean","object","bigint","symbol"],(function(e){return t.has(e.charAt(0).toUpperCase()+e.slice(1))?jn(524288,e):void 0})).concat(e.arrayFrom(t.values())):e.arrayFrom(t.values()),wv(e.unescapeLeadingUnderscores(n),a,i))}))}function Pv(t,r){return r.exports&&wv(e.idText(t),qi(r),2623475)}function wv(t,r,n){return e.getSpellingSuggestion(t,r,(function(t){var r=e.symbolName(t);if(!e.startsWith(r,'"')){if(t.flags&n)return r;if(2097152&t.flags){var i=function(e){if(Gn(e).target!==Fe)return ki(e)}(t);if(i&&i.flags&n)return r}}}))}function Iv(t,r,n){var i=t&&106500&t.flags&&t.valueDeclaration;if(i){var a=e.hasEffectiveModifier(i,8),o=t.valueDeclaration&&e.isNamedDeclaration(t.valueDeclaration)&&e.isPrivateIdentifier(t.valueDeclaration.name);if((a||o)&&(!r||!e.isWriteOnlyAccess(r)||65536&t.flags)){if(n){var s=e.findAncestor(r,e.isFunctionLikeDeclaration);if(s&&s.symbol===t)return}(1&e.getCheckFlags(t)?Gn(t).target:t).isReferenced=67108863;}}}function Ov(t,r){return 108===t.kind||!!r&&e.isEntityNameExpression(t)&&r===Sg(e.getFirstIdentifier(t))}function Mv(e,t,r){return Rv(e,205===e.kind&&106===e.expression.kind,!1,t,r)}function Lv(e,t,r,n){if(to(n))return !0;var i=Jc(n,r);return !!i&&Rv(e,t,!1,n,i)}function Rv(t,r,n,i,a){if(to(i))return !0;if(a.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(a.valueDeclaration)){var o=e.getContainingClass(a.valueDeclaration);return !e.isOptionalChain(t)&&!!e.findAncestor(t,(function(e){return e===o}))}return rv(t,r,n,i,a)}function Bv(t){var r=t.initializer;if(254===r.kind){var n=r.declarations[0];if(n&&!e.isBindingPattern(n.name))return $i(n)}else if(79===r.kind)return Sg(r)}function jv(t,r,n){var i=0!==e.getAssignmentTargetKind(t)||fv(t)?jf(r):r,a=t.argumentExpression,o=ax(a);if(ro(i)||i===it)return i;if(Fb(i)&&!e.isStringLiteralLike(a))return In(a,e.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal),Me;var s=P_(i,function(t){var r,n=e.skipParentheses(t);if(79===n.kind){var i=Sg(n);if(3&i.flags)for(var a=t,o=t.parent;o;){if(242===o.kind&&a===o.statement&&Bv(o)===i&&1===Hc(r=rx(o.expression)).length&&Gc(r,Ge))return !0;a=o,o=o.parent;}}return !1}(a)?Ge:o,e.isAssignmentTarget(t)?4|(x_(i)&&!T_(i)?2:0):32,t)||Me;return hx(xv(t,Qn(t).resolvedSymbol,s,a,n),t)}function Jv(t){return e.isCallOrNewExpression(t)||e.isTaggedTemplateExpression(t)||e.isJsxOpeningLikeElement(t)}function zv(t){return Jv(t)&&e.forEach(t.typeArguments,hS),209===t.kind?ax(t.template):e.isJsxOpeningLikeElement(t)?ax(t.attributes):164!==t.kind&&e.forEach(t.arguments,(function(e){ax(e);})),Er}function Uv(e){return zv(e),kr}function Kv(e){return !!e&&(224===e.kind||231===e.kind&&e.isSpread)}function Vv(t){return e.findIndex(t,Kv)}function qv(e){return !!(16384&e.flags)}function Wv(e){return !!(49155&e.flags)}function Hv(t,r,n,i){var a;void 0===i&&(i=!1);var o=!1,s=Zh(n),c=$h(n);if(209===t.kind)if(a=r.length,222===t.template.kind){var l=e.last(t.template.templateSpans);o=e.nodeIsMissing(l.literal)||!!l.literal.isUnterminated;}else {var u=t.template;e.Debug.assert(14===u.kind),o=!!u.isUnterminated;}else if(164===t.kind)a=lh(t,n);else if(e.isJsxOpeningLikeElement(t)){if(o=t.attributes.end===t.end)return !0;a=0===c?r.length:1,s=0===r.length?s:1,c=Math.min(c,1);}else {if(!t.arguments)return e.Debug.assert(208===t.kind),0===$h(n);a=i?r.length+1:r.length,o=t.arguments.end===t.end;var _=Vv(r);if(_>=0)return _>=$h(n)&&(eb(n)||_<Zh(n))}if(!eb(n)&&a>s)return !1;if(o||a>=c)return !0;for(var d=a;d<c;d++)if(131072&om(Qh(n,d),e.isInJSFile(t)&&!H?Wv:qv).flags)return !1;return !0}function Gv(t,r){var n=e.length(t.typeParameters),i=ol(t.typeParameters);return !e.some(r)||r.length>=i&&r.length<=n}function Qv(e){return Yv(e,0,!1)}function Xv(e){return Yv(e,0,!1)||Yv(e,1,!1)}function Yv(e,t,r){if(524288&e.flags){var n=pc(e);if(r||0===n.properties.length&&0===n.indexInfos.length){if(0===t&&1===n.callSignatures.length&&0===n.constructSignatures.length)return n.callSignatures[0];if(1===t&&1===n.constructSignatures.length&&0===n.callSignatures.length)return n.constructSignatures[0]}}}function Zv(t,r,n,i){var a=Wf(t.typeParameters,t,0,i),o=tb(r),s=n&&(o&&262144&o.flags?n.nonFixingMapper:n.mapper);return Vf(s?Nd(r,s):r,t,(function(e,t){fg(a.inferences,e,t);})),n||qf(r,t,(function(e,t){fg(a.inferences,e,t,128);})),bl(t,xg(a),e.isInJSFile(r.declaration))}function $v(t){if(!t)return rt;var r=ax(t);return e.isOptionalChainRoot(t.parent)?Sf(r):e.isOptionalChain(t.parent)?Cf(r):r}function eh(t,r,n,i,a){if(e.isJsxOpeningLikeElement(t))return function(e,t,r,n){var i=vy(t,e),a=Jb(e.attributes,i,n,r);return fg(n.inferences,a,i),xg(n)}(t,r,i,a);if(164!==t.kind){var o=my(t,e.every(r.typeParameters,(function(e){return !!Fc(e)}))?8:0);if(o){var s=yy(t),c=Rd(o,Zf(function(t,r){return void 0===r&&(r=0),t&&Hf(e.map(t.inferences,Yf),t.signature,t.flags|r,t.compareTypes)}(s,1))),l=Qv(c),u=l&&l.typeParameters?Cl(xl(l,l.typeParameters)):c,_=ml(r);fg(a.inferences,u,_,128);var d=Wf(r.typeParameters,r,a.flags),p=Rd(o,s&&s.returnMapper);fg(d.inferences,p,_),a.returnMapper=e.some(d.inferences,Zb)?Zf(function(t){var r=e.filter(t.inferences,Zb);return r.length?Hf(e.map(r,Yf),t.signature,t.flags,t.compareTypes):void 0}(d)):void 0;}}var f=rb(r),g=f?Math.min(Zh(r)-1,n.length):n.length;if(f&&262144&f.flags){var m=e.find(a.inferences,(function(e){return e.typeParameter===f}));m&&(m.impliedArity=e.findIndex(n,Kv,g)<0?n.length-g:void 0);}var y=pl(r);if(y){var v=oh(t);fg(a.inferences,$v(v),y);}for(var h=0;h<g;h++){var b=n[h];if(226!==b.kind){var x=Qh(r,h),D=Jb(b,x,a,i);fg(a.inferences,D,x);}}if(f){var S=rh(n,g,n.length,f,a,i);fg(a.inferences,S,f);}return xg(a)}function th(e){return 1048576&e.flags?lm(e,th):1&e.flags||Hp(Tc(e)||e)?e:_f(e)?Au(zl(e),e.target.elementFlags,!1,e.target.labeledElementDeclarations):Au([e],[8])}function rh(t,r,n,i,a,o){if(r>=n-1&&Kv(_=t[n-1]))return th(231===_.kind?_.type:Jb(_.expression,i,a,o));for(var s=[],c=[],l=[],u=r;u<n;u++){var _;if(Kv(_=t[u])){var d=231===_.kind?_.type:ax(_.expression);Qp(d)?(s.push(d),c.push(8)):(s.push(hD(33,d,ze,224===_.kind?_.expression:_)),c.push(4));}else {var p=F_(i,ad(u-r),256),f=Jb(_,p,a,o),g=Eb(p,406978556);s.push(g?rd(f):sf(f)),c.push(1);}231===_.kind&&_.tupleNameSource&&l.push(_.tupleNameSource);}return Au(s,c,!1,e.length(l)===e.length(s)?l:void 0)}function nh(t,r,n,i){for(var a,o=e.isInJSFile(t.declaration),s=t.typeParameters,c=sl(e.map(r,dd),s,ol(s),o),l=0;l<r.length;l++){e.Debug.assert(void 0!==s[l],"Should not call checkTypeArguments with too many type arguments");var u=hc(s[l]);if(u){var _=n&&i?function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1)}:void 0,d=i||e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1;a||(a=vd(s,c));var p=c[l];if(!tp(p,Ls(Rd(u,a),p),n?r[l]:void 0,d,_))return}}return c}function ih(t){if(Oy(t.tagName))return 2;var r=Ac(ax(t.tagName));return e.length(Uc(r,1))?0:e.length(Uc(r,0))?1:2}function ah(t,r,n,i,a,o,s){var c={errors:void 0,skipLogging:!0};if(e.isJsxOpeningLikeElement(t))return function(t,r,n,i,a,o,s){var c=vy(r,t),l=Jb(t.attributes,c,void 0,i);return function(){var r;if(Jy(t))return !0;var n=e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)&&!Oy(t.tagName)?ax(t.tagName):void 0;if(!n)return !0;var i=Uc(n,0);if(!e.length(i))return !0;var o=bT(t);if(!o)return !0;var c=Mi(o,111551,!0,!1,t);if(!c)return !0;var l=Uc(Uo(c),0);if(!e.length(l))return !0;for(var u=!1,_=0,d=0,p=l;d<p.length;d++){var f=Uc(Qh(p[d],0),0);if(e.length(f))for(var g=0,m=f;g<m.length;g++){var y=m[g];if(u=!0,eb(y))return !0;var v=Zh(y);v>_&&(_=v);}}if(!u)return !0;for(var h=1/0,b=0,x=i;b<x.length;b++){var D=$h(x[b]);D<h&&(h=D);}if(h<=_)return !0;if(a){var S=e.createDiagnosticForNode(t.tagName,e.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3,e.entityNameToString(t.tagName),h,e.entityNameToString(o),_),T=null===(r=MS(t.tagName))||void 0===r?void 0:r.valueDeclaration;T&&e.addRelatedInfo(S,e.createDiagnosticForNode(T,e.Diagnostics._0_is_declared_here,e.entityNameToString(t.tagName))),s&&s.skipLogging&&(s.errors||(s.errors=[])).push(S),s.skipLogging||mn.add(S);}return !1}()&&np(l,c,n,a?t.tagName:void 0,t.attributes,void 0,o,s)}(t,n,i,a,o,s,c)?void 0:(e.Debug.assert(!o||!!c.errors,"jsx should have errors when reporting errors"),c.errors||e.emptyArray);var l=pl(n);if(l&&l!==rt&&208!==t.kind){var u=oh(t),_=$v(u),d=o?u||t:void 0,p=e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1;if(!Dp(_,l,i,d,p,s,c))return e.Debug.assert(!o||!!c.errors,"this parameter should have errors when reporting errors"),c.errors||e.emptyArray}for(var f=e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1,g=rb(n),m=g?Math.min(Zh(n)-1,r.length):r.length,y=0;y<m;y++){var v=r[y];if(226!==v.kind){var h=Qh(n,y),b=Jb(v,h,void 0,a),x=4&a?If(b):b;if(!np(x,h,i,o?v:void 0,v,f,s,c))return e.Debug.assert(!o||!!c.errors,"parameter should have errors when reporting errors"),T(v,x,h),c.errors||e.emptyArray}}if(g){var D=rh(r,m,r.length,g,void 0,a),S=r.length-m;if(d=o?0===S?t:1===S?r[m]:e.setTextRangePosEnd(sh(t,D),r[m].pos,r[r.length-1].end):void 0,!Dp(D,g,i,d,f,void 0,c))return e.Debug.assert(!o||!!c.errors,"rest parameter should have errors when reporting errors"),T(d,D,g),c.errors||e.emptyArray}return;function T(t,r,n){if(t&&o&&c.errors&&c.errors.length){if(Tx(n))return;var a=Tx(r);a&&hp(a,n,i)&&e.addRelatedInfo(c.errors[0],e.createDiagnosticForNode(t,e.Diagnostics.Did_you_forget_to_use_await));}}}function oh(t){var r=207===t.kind?t.expression:209===t.kind?t.tag:void 0;if(r){var n=e.skipOuterExpressions(r);if(e.isAccessExpression(n))return n.expression}}function sh(t,r,n,i){var a=e.parseNodeFactory.createSyntheticExpression(r,n,i);return e.setTextRange(a,t),e.setParent(a,t),a}function ch(t){if(209===t.kind){var r=t.template,n=[sh(r,ur||(ur=_u("TemplateStringsArray",0,!0)||mt))];return 222===r.kind&&e.forEach(r.templateSpans,(function(e){n.push(e.expression);})),n}if(164===t.kind)return function(t){var r=t.parent,n=t.expression;switch(r.kind){case 256:case 225:return [sh(n,Uo($i(r)))];case 163:var i=r.parent;return [sh(n,170===r.parent.kind?Uo($i(i)):Me),sh(n,we),sh(n,Ge)];case 166:case 168:case 171:case 172:var a=166!==r.kind&&0!==K;return [sh(n,jS(r)),sh(n,JS(r)),sh(n,a?Su(LS(r)):we)]}return e.Debug.fail()}(t);if(e.isJsxOpeningLikeElement(t))return t.attributes.properties.length>0||e.isJsxOpeningElement(t)&&t.parent.children.length>0?[t.attributes]:e.emptyArray;var i=t.arguments||e.emptyArray,a=Vv(i);if(a>=0){for(var o=i.slice(0,a),s=function(t){var r=i[t],n=224===r.kind&&(Ur?ax(r.expression):zb(r.expression));n&&_f(n)?e.forEach(zl(n),(function(e,t){var i,a=n.target.elementFlags[t],s=sh(r,4&a?Tu(e):e,!!(12&a),null===(i=n.target.labeledElementDeclarations)||void 0===i?void 0:i[t]);o.push(s);})):o.push(r);},c=a;c<i.length;c++)s(c);return o}return i}function lh(t,r){switch(t.parent.kind){case 256:case 225:return 1;case 166:return 2;case 168:case 171:case 172:return 0===K||r.parameters.length<=2?2:3;case 163:return 3;default:return e.Debug.fail()}}function uh(t,r){var n,i,a=e.getSourceFileOfNode(t);if(e.isPropertyAccessExpression(t.expression)){var o=e.getErrorSpanForNode(a,t.expression.name);n=o.start,i=r?o.length:t.end-n;}else {var s=e.getErrorSpanForNode(a,t.expression);n=s.start,i=r?s.length:t.end-n;}return {start:n,length:i,sourceFile:a}}function _h(t,r,n,i,a,o){if(e.isCallExpression(t)){var s=uh(t),c=s.sourceFile,l=s.start,u=s.length;return e.createFileDiagnostic(c,l,u,r,n,i,a,o)}return e.createDiagnosticForNode(t,r,n,i,a,o)}function dh(t,r,n){var i,a=Vv(n);if(a>-1)return e.createDiagnosticForNode(n[a],e.Diagnostics.A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter);for(var o,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,_=0,d=r;_<d.length;_++){var p=d[_],f=$h(p),g=Zh(p);f<s&&(s=f,o=p),c=Math.max(c,g),f<n.length&&f>l&&(l=f),n.length<g&&g<u&&(u=g);}var m=e.some(r,eb),y=m?s:s<c?s+"-"+c:s,v=m?e.Diagnostics.Expected_at_least_0_arguments_but_got_1:1===y&&0===n.length&&function(t){if(!e.isCallExpression(t)||!e.isIdentifier(t.expression))return !1;var r=ei(t.expression,t.expression.escapedText,111551,void 0,void 0,!1),n=null==r?void 0:r.valueDeclaration;if(!(n&&e.isParameter(n)&&e.isFunctionExpressionOrArrowFunction(n.parent)&&e.isNewExpression(n.parent.parent)&&e.isIdentifier(n.parent.parent.expression)))return !1;var i=vu(!1);return !!i&&MS(n.parent.parent.expression,!0)===i}(t)?e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise:e.Diagnostics.Expected_0_arguments_but_got_1;if(s<n.length&&n.length<c)return _h(t,e.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments,n.length,l,u);if(n.length<s){var h=_h(t,v,y,n.length),b=null===(i=null==o?void 0:o.declaration)||void 0===i?void 0:i.parameters[o.thisParameter?n.length+1:n.length];if(b){var x=e.createDiagnosticForNode(b,e.isBindingPattern(b.name)?e.Diagnostics.An_argument_matching_this_binding_pattern_was_not_provided:e.isRestParameter(b)?e.Diagnostics.Arguments_for_the_rest_parameter_0_were_not_provided:e.Diagnostics.An_argument_for_0_was_not_provided,b.name?e.isBindingPattern(b.name)?void 0:e.idText(e.getFirstIdentifier(b.name)):n.length);return e.addRelatedInfo(h,x)}return h}var D=e.factory.createNodeArray(n.slice(c)),S=e.first(D).pos,T=e.last(D).end;return T===S&&T++,e.setTextRangePosEnd(D,S,T),e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),D,v,y,n.length)}function ph(t,i,a,o,s,c){var l,u=209===t.kind,_=164===t.kind,d=e.isJsxOpeningLikeElement(t),p=!a&&r;_||(l=t.typeArguments,(u||d||106!==t.expression.kind)&&e.forEach(l,hS));var f=a||[];if(function(t,r,n){var i,a,o,s,c=0,l=-1;e.Debug.assert(!r.length);for(var u=0,_=t;u<_.length;u++){var d=_[u],p=d.declaration&&$i(d.declaration),f=d.declaration&&d.declaration.parent;a&&p!==a?(o=c=r.length,i=f):i&&f===i?o+=1:(i=f,o=c),a=p,z(d)?(s=++l,c++):s=o,r.splice(s,0,n?zs(d,n):d);}}(i,f,s),!f.length)return p&&mn.add(_h(t,e.Diagnostics.Call_target_does_not_contain_any_signatures)),Uv(t);var g,m,y,v,h=ch(t),b=1===f.length&&!f[0].typeParameters,x=_||b||!e.some(h,Ud)?0:4,D=!!(16&o)&&207===t.kind&&t.arguments.hasTrailingComma;if(f.length>1&&(v=W(f,bn,b,D)),v||(v=W(f,Dn,b,D)),v)return v;if(p)if(g)if(1===g.length||g.length>3){var S,T=g[g.length-1];g.length>3&&(S=e.chainDiagnosticMessages(S,e.Diagnostics.The_last_overload_gave_the_following_error),S=e.chainDiagnosticMessages(S,e.Diagnostics.No_overload_matches_this_call));var C=ah(t,h,T,Dn,0,!0,(function(){return S}));if(C)for(var E=0,k=C;E<k.length;E++){var N=k[E];T.declaration&&g.length>3&&e.addRelatedInfo(N,e.createDiagnosticForNode(T.declaration,e.Diagnostics.The_last_overload_is_declared_here)),q(T,N),mn.add(N);}else e.Debug.fail("No error for last overload signature");}else {for(var F=[],A=0,P=Number.MAX_VALUE,w=0,I=0,O=function(r){var n=ah(t,h,r,Dn,0,!0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Overload_0_of_1_2_gave_the_following_error,I+1,f.length,Oa(r))}));n?(n.length<=P&&(P=n.length,w=I),A=Math.max(A,n.length),F.push(n)):e.Debug.fail("No error for 3 or fewer overload signatures"),I++;},M=0,L=g;M<L.length;M++)O(L[M]);var R=A>1?F[w]:e.flatten(F);e.Debug.assert(R.length>0,"No errors reported for 3 or fewer overload signatures");var B=e.chainDiagnosticMessages(e.map(R,(function(e){return "string"==typeof e.messageText?e:e.messageText})),e.Diagnostics.No_overload_matches_this_call),j=n$3([],e.flatMap(R,(function(e){return e.relatedInformation})),!0),U=void 0;if(e.every(R,(function(e){return e.start===R[0].start&&e.length===R[0].length&&e.file===R[0].file}))){var K=R[0];U={file:K.file,start:K.start,length:K.length,code:B.code,category:B.category,messageText:B,relatedInformation:j};}else U=e.createDiagnosticForNodeFromMessageChain(t,B,j);q(g[0],U),mn.add(U);}else if(m)mn.add(dh(t,[m],h));else if(y)nh(y,t.typeArguments,!0,c);else {var V=e.filter(i,(function(e){return Gv(e,l)}));0===V.length?mn.add(function(t,r,n){var i=n.length;if(1===r.length){var a=ol((_=r[0]).typeParameters),o=e.length(_.typeParameters);return e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,a<o?a+"-"+o:a,i)}for(var s=-1/0,c=1/0,l=0,u=r;l<u.length;l++){var _,d=ol((_=u[l]).typeParameters);o=e.length(_.typeParameters),d>i?c=Math.min(c,d):o<i&&(s=Math.max(s,o));}return s!==-1/0&&c!==1/0?e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments,i,s,c):e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),n,e.Diagnostics.Expected_0_type_arguments_but_got_1,s===-1/0?c:s,i)}(t,i,l)):_?c&&mn.add(_h(t,c)):mn.add(dh(t,V,h));}return function(t,r,n,i){return e.Debug.assert(r.length>0),xS(t),i||1===r.length||r.some((function(e){return !!e.typeParameters}))?function(t,r,n){var i=function(e,t){for(var r=-1,n=-1,i=0;i<e.length;i++){var a=e[i],o=Zh(a);if(eb(a)||o>=t)return i;o>n&&(n=o,r=i);}return r}(r,void 0===le?n.length:le),a=r[i],o=a.typeParameters;if(!o)return a;var s=Jv(t)?t.typeArguments:void 0,c=s?Dl(a,function(e,t,r){for(var n=e.map(LS);n.length>t.length;)n.pop();for(;n.length<t.length;)n.push(hc(t[n.length])||bg(r));return n}(s,o,e.isInJSFile(t))):function(t,r,n,i){return Dl(n,eh(t,n,i,12,Wf(r,n,e.isInJSFile(t)?2:0)))}(t,o,a,n);return r[i]=c,c}(t,r,n):function(t){var r,n=e.mapDefined(t,(function(e){return e.thisParameter}));n.length&&(r=gh(n,n.map(Kh)));for(var i=e.minAndMax(t,fh),a=i.min,o=i.max,s=[],c=function(r){var n=e.mapDefined(t,(function(t){return J(t)?r<t.parameters.length-1?t.parameters[r]:e.last(t.parameters):r<t.parameters.length?t.parameters[r]:void 0}));e.Debug.assert(0!==n.length),s.push(gh(n,e.mapDefined(t,(function(e){return Xh(e,r)}))));},l=0;l<o;l++)c(l);var u=e.mapDefined(t,(function(t){return J(t)?e.last(t.parameters):void 0})),_=0;if(0!==u.length){var d=Tu(qu(e.mapDefined(t,hl),2));s.push(mh(u,d)),_|=1;}return t.some(z)&&(_|=2),Bs(t[0].declaration,void 0,r,s,$u(t.map(ml)),void 0,a,_)}(r)}(t,f,h,!!a);function q(t,r){var n,i,a=g,o=m,s=y,c=(null===(i=null===(n=t.declaration)||void 0===n?void 0:n.symbol)||void 0===i?void 0:i.declarations)||e.emptyArray,l=c.length>1?e.find(c,(function(t){return e.isFunctionLikeDeclaration(t)&&e.nodeIsPresent(t.body)})):void 0;if(l){var u=cl(l),_=!u.typeParameters;W([u],Dn,_)&&e.addRelatedInfo(r,e.createDiagnosticForNode(l,e.Diagnostics.The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible));}g=a,m=o,y=s;}function W(r,n,i,a){if(void 0===a&&(a=!1),g=void 0,m=void 0,y=void 0,i){var o=r[0];if(e.some(l)||!Hv(t,h,o,a))return;return ah(t,h,o,n,0,!1,void 0)?void(g=[o]):o}for(var s=0;s<r.length;s++)if(Gv(o=r[s],l)&&Hv(t,h,o,a)){var c=void 0,u=void 0;if(o.typeParameters){var _=void 0;if(e.some(l)){if(!(_=nh(o,l,!1))){y=o;continue}}else u=Wf(o.typeParameters,o,e.isInJSFile(t)?2:0),_=eh(t,o,h,8|x,u),x|=4&u.flags?8:0;if(c=bl(o,_,e.isInJSFile(o.declaration),u&&u.inferredTypeParameters),rb(o)&&!Hv(t,h,c,a)){m=c;continue}}else c=o;if(!ah(t,h,c,n,x,!1,void 0)){if(x){if(x=0,u&&(c=bl(o,_=eh(t,o,h,x,u),e.isInJSFile(o.declaration),u&&u.inferredTypeParameters),rb(o)&&!Hv(t,h,c,a))){m=c;continue}if(ah(t,h,c,n,x,!1,void 0)){(g||(g=[])).push(c);continue}}return r[s]=c,c}(g||(g=[])).push(c);}}}function fh(e){var t=e.parameters.length;return J(e)?t-1:t}function gh(e,t){return mh(e,qu(t,2))}function mh(t,r){return wf(e.first(t),r)}function yh(e){return !(!e.typeParameters||!uT(ml(e)))}function vh(e,t,r,n){return to(e)||to(t)&&!!(262144&e.flags)||!r&&!n&&!(1048576&t.flags)&&!(131072&Mc(t).flags)&&Yd(e,wt)}function hh(t,r,n){if(t.arguments&&K<1){var i=Vv(t.arguments);i>=0&&In(t.arguments[i],e.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher);}var a=iv(t.expression);if(a===it)return Fr;if(ro(a=Ac(a)))return Uv(t);if(to(a))return t.typeArguments&&In(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),zv(t);var o=Uc(a,1);if(o.length){if(!function(t,r){if(!r||!r.declaration)return !0;var n=r.declaration,i=e.getSelectedEffectiveModifierFlags(n,24);if(!i||170!==n.kind)return !0;var a=e.getClassLikeDeclarationOfSymbol(n.parent.symbol),o=ms(n.parent.symbol);if(!PS(t,a)){var s=e.getContainingClass(t);if(s&&16&i){var c=LS(s);if(bh(n.parent.symbol,c))return !0}return 8&i&&In(t,e.Diagnostics.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration,Ma(o)),16&i&&In(t,e.Diagnostics.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration,Ma(o)),!1}return !0}(t,o[0]))return Uv(t);if(o.some((function(e){return 4&e.flags})))return In(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Uv(t);var s=a.symbol&&e.getClassLikeDeclarationOfSymbol(a.symbol);return s&&e.hasSyntacticModifier(s,128)?(In(t,e.Diagnostics.Cannot_create_an_instance_of_an_abstract_class),Uv(t)):ph(t,o,r,n,0)}var c=Uc(a,0);if(c.length){var l=ph(t,c,r,n,0);return Y||(l.declaration&&!Fh(l.declaration)&&ml(l)!==rt&&In(t,e.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword),pl(l)===rt&&In(t,e.Diagnostics.A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void)),l}return Dh(t.expression,a,1),Uv(t)}function bh(t,r){var n=is(r);if(!e.length(n))return !1;var i=n[0];if(2097152&i.flags){for(var a=Qs(i.types),o=0,s=0,c=i.types;s<c.length;s++){var l=c[s];if(!a[o]&&3&e.getObjectFlags(l)){if(l.symbol===t)return !0;if(bh(t,l))return !0}o++;}return !1}return i.symbol===t||bh(t,i)}function xh(t,r,n){var i,a=0===n,o=Ax(r),s=o&&Uc(o,n).length>0;if(1048576&r.flags){for(var c=!1,l=0,u=r.types;l<u.length;l++){var _=u[l];if(0!==Uc(_,n).length){if(c=!0,i)break}else if(i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,Ma(_)),i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Not_all_constituents_of_type_0_are_callable:e.Diagnostics.Not_all_constituents_of_type_0_are_constructable,Ma(r))),c)break}c||(i=e.chainDiagnosticMessages(void 0,a?e.Diagnostics.No_constituent_of_type_0_is_callable:e.Diagnostics.No_constituent_of_type_0_is_constructable,Ma(r))),i||(i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other:e.Diagnostics.Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other,Ma(r)));}else i=e.chainDiagnosticMessages(i,a?e.Diagnostics.Type_0_has_no_call_signatures:e.Diagnostics.Type_0_has_no_construct_signatures,Ma(r));var d=a?e.Diagnostics.This_expression_is_not_callable:e.Diagnostics.This_expression_is_not_constructable;if(e.isCallExpression(t.parent)&&0===t.parent.arguments.length){var p=Qn(t).resolvedSymbol;p&&32768&p.flags&&(d=e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without);}return {messageChain:e.chainDiagnosticMessages(i,d),relatedMessage:s?e.Diagnostics.Did_you_forget_to_use_await:void 0}}function Dh(t,r,n,i){var a=xh(t,r,n),o=a.messageChain,s=a.relatedMessage,c=e.createDiagnosticForNodeFromMessageChain(t,o);if(s&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,s)),e.isCallExpression(t.parent)){var l=uh(t.parent,!0),u=l.start,_=l.length;c.start=u,c.length=_;}mn.add(c),Sh(r,n,i?e.addRelatedInfo(c,i):c);}function Sh(t,r,n){if(t.symbol){var i=Gn(t.symbol).originatingImport;if(i&&!e.isImportCall(i)){var a=Uc(Uo(Gn(t.symbol).target),r);if(!a||!a.length)return;e.addRelatedInfo(n,e.createDiagnosticForNode(i,e.Diagnostics.Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead));}}}function Th(t){switch(t.parent.kind){case 256:case 225:return e.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression;case 163:return e.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression;case 166:return e.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression;case 168:case 171:case 172:return e.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression;default:return e.Debug.fail()}}function Ch(t,r){var n=zy(t),i=n&&Gi(n),a=i&&Yn(i,A.Element,788968),o=a&&ae.symbolToEntityName(a,788968,t),s=e.factory.createFunctionTypeNode(void 0,[e.factory.createParameterDeclaration(void 0,void 0,void 0,"props",void 0,ae.typeToTypeNode(r,t))],o?e.factory.createTypeReferenceNode(o,void 0):e.factory.createKeywordTypeNode(130)),c=jn(1,"props");return c.type=r,Bs(s,void 0,void 0,[c],a?ms(a):Me,void 0,1,0)}function Eh(t,r,n){if(Oy(t.tagName)){var i=Wy(t),a=Ch(t,i);return rp(Jb(t.attributes,vy(a,t),void 0,0),i,t.tagName,t.attributes),e.length(t.typeArguments)&&(e.forEach(t.typeArguments,hS),mn.add(e.createDiagnosticForNodeArray(e.getSourceFileOfNode(t),t.typeArguments,e.Diagnostics.Expected_0_type_arguments_but_got_1,0,e.length(t.typeArguments)))),a}var o=ax(t.tagName),s=Ac(o);if(ro(s))return Uv(t);var c=Vy(o,t);return vh(o,s,c.length,0)?zv(t):0===c.length?(In(t.tagName,e.Diagnostics.JSX_element_type_0_does_not_have_any_construct_or_call_signatures,e.getTextOfNode(t.tagName)),Uv(t)):ph(t,c,r,n,0)}function kh(t,r,n){switch(t.kind){case 207:return function(t,r,n){if(106===t.expression.kind){var i=Qm(t.expression);if(to(i)){for(var a=0,o=t.arguments;a<o.length;a++)ax(o[a]);return Er}if(!ro(i)){var s=e.getEffectiveBaseTypeNode(e.getContainingClass(t));if(s)return ph(t,ts(i,s.typeArguments,s),r,n,0)}return zv(t)}var c,l=ax(t.expression);if(e.isCallChain(t)){var u=kf(l,t.expression);c=u===l?0:e.isOutermostOptionalChain(t)?16:8,l=u;}else c=0;if((l=lv(l,t.expression,cv))===it)return Fr;var _=Ac(l);if(ro(_))return Uv(t);var d=Uc(_,0),p=Uc(_,1).length;if(vh(l,_,d.length,p))return !ro(l)&&t.typeArguments&&In(t,e.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments),zv(t);if(!d.length){if(p)In(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,Ma(l));else {var f=void 0;if(1===t.arguments.length){var g=e.getSourceFileOfNode(t).text;e.isLineBreak(g.charCodeAt(e.skipTrivia(g,t.expression.end,!0)-1))&&(f=e.createDiagnosticForNode(t.expression,e.Diagnostics.Are_you_missing_a_semicolon));}Dh(t.expression,_,0,f);}return Uv(t)}return 8&n&&!t.typeArguments&&d.some(yh)?(Yb(t,n),Nr):d.some((function(t){return e.isInJSFile(t.declaration)&&!!e.getJSDocClassTag(t.declaration)}))?(In(t,e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new,Ma(l)),Uv(t)):ph(t,d,r,n,c)}(t,r,n);case 208:return hh(t,r,n);case 209:return function(t,r,n){var i=ax(t.tag),a=Ac(i);if(ro(a))return Uv(t);var o=Uc(a,0),s=Uc(a,1).length;if(vh(i,a,o.length,s))return zv(t);if(!o.length){if(e.isArrayLiteralExpression(t.parent)){var c=e.createDiagnosticForNode(t.tag,e.Diagnostics.It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked);return mn.add(c),Uv(t)}return Dh(t.tag,a,0),Uv(t)}return ph(t,o,r,n,0)}(t,r,n);case 164:return function(t,r,n){var i=ax(t.expression),a=Ac(i);if(ro(a))return Uv(t);var o,s,c=Uc(a,0),l=Uc(a,1).length;if(vh(i,a,c.length,l))return zv(t);if(o=t,(s=c).length&&e.every(s,(function(e){return 0===e.minArgumentCount&&!J(e)&&e.parameters.length<lh(o,e)}))){var u=e.getTextOfNode(t.expression,!1);return In(t,e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0,u),Uv(t)}var _=Th(t);if(!c.length){var d=xh(t.expression,a,0),p=e.chainDiagnosticMessages(d.messageChain,_),f=e.createDiagnosticForNodeFromMessageChain(t.expression,p);return d.relatedMessage&&e.addRelatedInfo(f,e.createDiagnosticForNode(t.expression,d.relatedMessage)),mn.add(f),Sh(a,0,f),Uv(t)}return ph(t,c,r,n,0,_)}(t,r,n);case 279:case 278:return Eh(t,r,n)}throw e.Debug.assertNever(t,"Branch in 'resolveSignature' should be unreachable.")}function Nh(e,t,r){var n=Qn(e),i=n.resolvedSignature;if(i&&i!==Nr&&!t)return i;n.resolvedSignature=Nr;var a=kh(e,t,r||0);return a!==Nr&&(n.resolvedSignature=zr===Ur?a:i),a}function Fh(t){var r;if(!t||!e.isInJSFile(t))return !1;var n=e.isFunctionDeclaration(t)||e.isFunctionExpression(t)?t:e.isVariableDeclaration(t)&&t.initializer&&e.isFunctionExpression(t.initializer)?t.initializer:void 0;if(n){if(e.getJSDocClassTag(t))return !0;var i=$i(n);return !!(null===(r=null==i?void 0:i.members)||void 0===r?void 0:r.size)}return !1}function Ah(t,r){var n,i;if(r){var a=Gn(r);if(!a.inferredClassSymbol||!a.inferredClassSymbol.has(M(t))){var o=e.isTransientSymbol(t)?t:Un(t);return o.exports=o.exports||e.createSymbolTable(),o.members=o.members||e.createSymbolTable(),o.flags|=32&r.flags,(null===(n=r.exports)||void 0===n?void 0:n.size)&&Wn(o.exports,r.exports),(null===(i=r.members)||void 0===i?void 0:i.size)&&Wn(o.members,r.members),(a.inferredClassSymbol||(a.inferredClassSymbol=new e.Map)).set(M(o),o),o}return a.inferredClassSymbol.get(M(t))}}function Ph(t,r){if(t.parent){var n,i;if(e.isVariableDeclaration(t.parent)&&t.parent.initializer===t){if(!(e.isInJSFile(t)||e.isVarConst(t.parent)&&e.isFunctionLikeDeclaration(t)))return;n=t.parent.name,i=t.parent;}else if(e.isBinaryExpression(t.parent)){var a=t.parent,o=t.parent.operatorToken.kind;if(63!==o||!r&&a.right!==t){if(!(56!==o&&60!==o||(e.isVariableDeclaration(a.parent)&&a.parent.initializer===a?(n=a.parent.name,i=a.parent):e.isBinaryExpression(a.parent)&&63===a.parent.operatorToken.kind&&(r||a.parent.right===a)&&(i=n=a.parent.left),n&&e.isBindableStaticNameExpression(n)&&e.isSameEntityName(n,a.left))))return}else i=n=a.left;}else r&&e.isFunctionDeclaration(t)&&(n=t.name,i=t);if(i&&n&&(r||e.getExpandoInitializer(t,e.isPrototypeAccess(n))))return $i(i)}}function wh(t,r){if(t.declaration&&134217728&t.declaration.flags){var n=Ih(r),i=e.tryGetPropertyAccessOrIdentifierToString(e.getInvokedExpression(r));a=n,o=t.declaration,s=i,c=Oa(t),Rn(o,s?e.createDiagnosticForNode(a,e.Diagnostics.The_signature_0_of_1_is_deprecated,c,s):e.createDiagnosticForNode(a,e.Diagnostics._0_is_deprecated,c));}var a,o,s,c;}function Ih(t){switch((t=e.skipParentheses(t)).kind){case 207:case 164:case 208:return Ih(t.expression);case 209:return Ih(t.tag);case 279:case 278:return Ih(t.tagName);case 206:return t.argumentExpression;case 205:return t.name;case 177:var r=t;return e.isQualifiedName(r.typeName)?r.typeName.right:r;default:return t}}function Oh(t){if(!e.isCallExpression(t))return !1;var r=t.expression;if(e.isPropertyAccessExpression(r)&&"for"===r.name.escapedText&&(r=r.expression),!e.isIdentifier(r)||"Symbol"!==r.escapedText)return !1;var n=fu(!1);return !!n&&n===ei(r,"Symbol",111551,void 0,void 0,!1)}function Mh(t,r,n){var i=e.createSymbolTable(),a=jn(2097152,"default");return a.parent=r,a.nameType=id("default"),a.target=Ei(t),i.set("default",a),ya(n,i,e.emptyArray,e.emptyArray,e.emptyArray)}function Lh(e,t,r,n){if(vi(n)&&e&&!ro(e)){var i=e;if(!i.defaultOnlyType){var a=Mh(t,r);i.defaultOnlyType=a;}return i.defaultOnlyType}}function Rh(t,r,n,i){var a;if(W&&t&&!ro(t)){var o=t;if(!o.syntheticType)if(hi(null===(a=n.declarations)||void 0===a?void 0:a.find(e.isSourceFile),n,!1,i)){var s=jn(2048,"__type"),c=Mh(r,n,s);s.type=c,o.syntheticType=wy(t)?Y_(t,c,s,0,!1):c;}else o.syntheticType=t;return o.syntheticType}return t}function Bh(t){if(!e.isRequireCall(t,!0))return !1;if(!e.isIdentifier(t.expression))return e.Debug.fail();var r=ei(t.expression,t.expression.escapedText,111551,void 0,void 0,!0);if(r===_e)return !0;if(2097152&r.flags)return !1;var n=16&r.flags?255:3&r.flags?253:0;if(0!==n){var i=e.getDeclarationOfKind(r,n);return !!i&&!!(8388608&i.flags)}return !1}function jh(e){switch(e.kind){case 10:case 14:case 8:case 9:case 110:case 95:case 203:case 204:case 222:return !0;case 211:return jh(e.expression);case 218:var t=e.operator,r=e.operand;return 40===t&&(8===r.kind||9===r.kind)||39===t&&8===r.kind;case 205:case 206:var n=LS(e.expression).symbol;return n&&2097152&n.flags&&(n=ki(n)),!!(n&&384&n.flags&&1===_s(n))}return !1}function Jh(t,n,i,a){var o=ax(i,a);if(e.isConstTypeReference(n))return jh(i)||In(i,e.Diagnostics.A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals),rd(o);hS(n),o=If(of(o));var s=dd(n);return r&&!ro(s)&&($d(s,jf(o))||_p(o,s,t,e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first)),s}function zh(t){switch(t.keywordToken){case 100:return function(){if(!dr){var t=jn(0,"ImportMetaExpression"),r=du(),n=jn(4,"meta",8);n.parent=t,n.type=r;var i=e.createSymbolTable([n]);t.members=i,dr=ya(t,i,e.emptyArray,e.emptyArray,e.emptyArray);}return dr}();case 103:var r=Uh(t);return ro(r)?Me:function(t){var r=jn(0,"NewTargetExpression"),n=jn(4,"target",8);n.parent=r,n.type=t;var i=e.createSymbolTable([n]);return r.members=i,ya(r,i,e.emptyArray,e.emptyArray,e.emptyArray)}(r);default:e.Debug.assertNever(t.keywordToken);}}function Uh(t){var r=e.getNewTargetContainer(t);return r?170===r.kind?Uo($i(r.parent)):Uo($i(r)):(In(t,e.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor,"new.target"),Me)}function Kh(t){var r=Uo(t);if(H){var n=t.valueDeclaration;if(n&&e.hasInitializer(n))return Df(r)}return r}function Vh(t){return e.Debug.assert(e.isIdentifier(t.name)),t.name.escapedText}function qh(e,t,r){var n=e.parameters.length-(J(e)?1:0);if(t<n)return e.parameters[t].escapedName;var i=e.parameters[n]||Ne,a=r||Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations,s=t-n;return o&&Vh(o[s])||i.escapedName+"_"+s}return i.escapedName}function Wh(t){return t.valueDeclaration&&e.isParameter(t.valueDeclaration)&&e.isIdentifier(t.valueDeclaration.name)}function Hh(t){return 196===t.kind||e.isParameter(t)&&t.name&&e.isIdentifier(t.name)}function Gh(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r){var n=e.parameters[t].valueDeclaration;return n&&Hh(n)?n:void 0}var i=e.parameters[r]||Ne,a=Uo(i);if(_f(a)){var o=a.target.labeledElementDeclarations;return o&&o[t-r]}return i.valueDeclaration&&Hh(i.valueDeclaration)?i.valueDeclaration:void 0}function Qh(e,t){return Xh(e,t)||we}function Xh(e,t){var r=e.parameters.length-(J(e)?1:0);if(t<r)return Kh(e.parameters[t]);if(J(e)){var n=Uo(e.parameters[r]),i=t-r;if(!_f(n)||n.target.hasRestElement||i<n.target.fixedLength)return F_(n,ad(i))}}function Yh(t,r){var n=Zh(t),i=$h(t),a=tb(t);if(a&&r>=n-1)return r===n-1?a:Tu(F_(a,Ge));for(var o=[],s=[],c=[],l=r;l<n;l++){!a||l<n-1?(o.push(Qh(t,l)),s.push(l<i?1:2)):(o.push(a),s.push(8));var u=Gh(t,l);u&&c.push(u);}return Au(o,s,!1,e.length(c)===e.length(o)?c:void 0)}function Zh(e){var t=e.parameters.length;if(J(e)){var r=Uo(e.parameters[t-1]);if(_f(r))return t+r.target.fixedLength-(r.target.hasRestElement?0:1)}return t}function $h(t,r){var n=1&r,i=2&r;if(i||void 0===t.resolvedMinArgumentCount){var a=void 0;if(J(t)){var o=Uo(t.parameters[t.parameters.length-1]);if(_f(o)){var s=e.findIndex(o.target.elementFlags,(function(e){return !(1&e)})),c=s<0?o.target.fixedLength:s;c>0&&(a=t.parameters.length-1+c);}}if(void 0===a){if(!n&&32&t.flags)return 0;a=t.minArgumentCount;}if(i)return a;for(var l=a-1;l>=0&&!(131072&om(Qh(t,l),qv).flags);l--)a=l;t.resolvedMinArgumentCount=a;}return t.resolvedMinArgumentCount}function eb(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]);return !_f(t)||t.target.hasRestElement}return !1}function tb(e){if(J(e)){var t=Uo(e.parameters[e.parameters.length-1]);if(!_f(t))return t;if(t.target.hasRestElement)return Ou(t,t.target.fixedLength)}}function rb(e){var t=tb(e);return !t||qp(t)||to(t)||0!=(131072&Mc(t).flags)?void 0:t}function nb(e){return ib(e,nt)}function ib(e,t){return e.parameters.length>0?Qh(e,0):t}function ab(t,r){if(r.typeParameters){if(t.typeParameters)return;t.typeParameters=r.typeParameters;}r.thisParameter&&(!(a=t.thisParameter)||a.valueDeclaration&&!a.valueDeclaration.type)&&(a||(t.thisParameter=wf(r.thisParameter,void 0)),ob(t.thisParameter,Uo(r.thisParameter)));for(var n=t.parameters.length-(J(t)?1:0),i=0;i<n;i++){var a=t.parameters[i];e.getEffectiveTypeAnnotationNode(a.valueDeclaration)||ob(a,Xh(r,i));}J(t)&&(a=e.last(t.parameters),!e.isTransientSymbol(a)&&e.getEffectiveTypeAnnotationNode(a.valueDeclaration)||ob(a,Yh(r,n)));}function ob(e,t){var r=Gn(e);if(!r.type){var n=e.valueDeclaration;r.type=t||Fo(n,!0),79!==n.name.kind&&(r.type===je&&(r.type=No(n.name)),sb(n.name));}}function sb(t){for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];e.isOmittedExpression(i)||(79===i.name.kind?Gn($i(i)).type=_o(i):sb(i.name));}}function cb(e){var t=mu(!0);return t!==bt?Bl(t,[e=Px(Fx(e))||je]):je}function lb(e){var t=yu(!0);return t!==bt?Bl(t,[e=Px(Fx(e))||je]):je}function ub(t,r){var n=cb(r);return n===je?(In(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option),Me):(vu(!0)||In(t,e.isImportCall(t)?e.Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option:e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option),n)}function _b(t,r){if(!t.body)return Me;var n,i,a,o=e.getFunctionFlags(t),s=0!=(2&o),c=0!=(1&o),l=rt;if(234!==t.body.kind)n=zb(t.body,r&&-9&r),s&&(n=Fx(Ex(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)));else if(c){var u=yb(t,r);u?u.length>0&&(n=qu(u,2)):l=nt;var _=function(t,r){var n=[],i=[],a=0!=(2&e.getFunctionFlags(t));return e.forEachYieldExpression(t.body,(function(t){var o,s=t.expression?ax(t.expression,r):Ue;if(e.pushIfUnique(n,pb(t,s,we,a)),t.asteriskToken){var c=ED(s,a?19:17,t.expression);o=c&&c.nextType;}else o=my(t);o&&e.pushIfUnique(i,o);})),{yieldTypes:n,nextTypes:i}}(t,r),d=_.yieldTypes,p=_.nextTypes;i=e.some(d)?qu(d,2):void 0,a=e.some(p)?$u(p):void 0;}else {var f=yb(t,r);if(!f)return 2&o?ub(t,nt):nt;if(0===f.length)return 2&o?ub(t,rt):rt;n=qu(f,2);}if(n||i||a){if(i&&Kf(t,i,3),n&&Kf(t,n,1),a&&Kf(t,a,2),n&&rf(n)||i&&rf(i)||a&&rf(a)){var g=xy(t),m=g?g===cl(t)?c?void 0:n:fy(ml(g),t):void 0;c?(i=uf(i,m,0,s),n=uf(n,m,1,s),a=uf(a,m,2,s)):n=function(e,t,r){return e&&rf(e)&&(e=lf(e,t?r?Cx(t):t:void 0)),e}(n,m,s);}i&&(i=jf(i)),n&&(n=jf(n)),a&&(a=jf(a));}return c?db(i||nt,n||l,a||ry(2,t)||je,s):s?cb(n||l):n||l}function db(e,t,r,n){var i=n?Lr:Rr,a=i.getGlobalGeneratorType(!1);if(e=i.resolveIterationType(e,void 0)||je,t=i.resolveIterationType(t,void 0)||je,r=i.resolveIterationType(r,void 0)||je,a===bt){var o=i.getGlobalIterableIteratorType(!1),s=o!==bt?AD(o,i):void 0,c=s?s.returnType:we,l=s?s.nextType:ze;return Yd(t,c)&&Yd(l,r)?o!==bt?Du(o,[e]):(i.getGlobalIterableIteratorType(!0),mt):(i.getGlobalGeneratorType(!0),mt)}return Du(a,[e,t,r])}function pb(t,r,n,i){var a=t.expression||t,o=t.asteriskToken?hD(i?19:17,r,n,a):r;return i?Ax(o,a,t.asteriskToken?e.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member:e.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o}function fb(e,t,r,n){var i=0;if(n){for(var a=t;a<r.length;a++)i|=T.get(r[a])||32768;for(a=e;a<t;a++)i&=~(T.get(r[a])||0);for(a=0;a<e;a++)i|=T.get(r[a])||32768;}else {for(a=e;a<t;a++)i|=S.get(r[a])||128;for(a=0;a<e;a++)i&=~(S.get(r[a])||0);}return i}function gb(t){var r=Qn(t);return void 0!==r.isExhaustive?r.isExhaustive:r.isExhaustive=function(t){if(215===t.expression.kind){var r=rx(t.expression.expression),n=fb(0,0,tm(t,!1),!0),i=Tc(r)||r;return 3&i.flags?556800==(556800&n):!!(131072&om(i,(function(e){return (jg(e)&n)===n})).flags)}var a=rx(t.expression);if(!af(a))return !1;var o,s,c=em(t);return !(!c.length||e.some(c,tf))&&(o=lm(a,rd),s=c,1048576&o.flags?!e.forEach(o.types,(function(t){return !e.contains(s,t)})):e.contains(s,o))}(t)}function mb(e){return e.endFlowNode&&Em(e.endFlowNode)}function yb(t,r){var n=e.getFunctionFlags(t),i=[],a=mb(t),o=!1;if(e.forEachReturnStatement(t.body,(function(s){var c=s.expression;if(c){var l=zb(c,r&&-9&r);2&n&&(l=Fx(Ex(l,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member))),131072&l.flags&&(o=!0),e.pushIfUnique(i,l);}else a=!0;})),0!==i.length||a||!o&&!function(e){switch(e.kind){case 212:case 213:return !0;case 168:return 204===e.parent.kind;default:return !1}}(t))return !(H&&i.length&&a)||Fh(t)&&i.some((function(e){return e.symbol===t.symbol}))||e.pushIfUnique(i,ze),i}function vb(t,n){if(r){var i=e.getFunctionFlags(t),a=n&&KD(n,i);if((!a||!Eb(a,16385))&&167!==t.kind&&!e.nodeIsMissing(t.body)&&234===t.body.kind&&mb(t)){var o=512&t.flags,s=e.getEffectiveReturnTypeNode(t)||t;if(a&&131072&a.flags)In(s,e.Diagnostics.A_function_returning_never_cannot_have_a_reachable_end_point);else if(a&&!o)In(s,e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value);else if(a&&H&&!Yd(ze,a))In(s,e.Diagnostics.Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined);else if(U.noImplicitReturns){if(!a){if(!o)return;if(VD(t,ml(cl(t))))return}In(s,e.Diagnostics.Not_all_code_paths_return_a_value);}}}}function hb(t,r){if(e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t)),xS(t),e.isFunctionExpression(t)&&sD(t,t.name),r&&4&r&&Ud(t)){if(!e.getEffectiveReturnTypeNode(t)&&!e.hasContextSensitiveParameters(t)){var n=Dy(t);if(n&&$f(ml(n))){var i=Qn(t);if(i.contextFreeType)return i.contextFreeType;var a=_b(t,r),o=Bs(void 0,void 0,void 0,e.emptyArray,a,void 0,0,0),s=ya(t.symbol,k,[o],e.emptyArray,e.emptyArray);return s.objectFlags|=524288,i.contextFreeType=s}}return xt}return FT(t)||212!==t.kind||MT(t),function(t,r){var n=Qn(t);if(!(1024&n.flags)){var i=Dy(t);if(!(1024&n.flags)){n.flags|=1024;var a=e.firstOrUndefined(Uc(Uo($i(t)),0));if(!a)return;if(Ud(t))if(i){var o=yy(t);r&&2&r&&function(t,r,n){for(var i=t.parameters.length-(J(t)?1:0),a=0;a<i;a++){var o=t.parameters[a].valueDeclaration;if(o.type){var s=e.getEffectiveTypeAnnotationNode(o);s&&fg(n.inferences,dd(s),Qh(r,a));}}var c=tb(r);if(c&&262144&c.flags){ab(t,Nd(r,n.nonFixingMapper));var l=Zh(r)-1;fg(n.inferences,Yh(t,l),c);}}(a,i,o),ab(a,o?Nd(i,o.mapper):i);}else !function(e){e.thisParameter&&ob(e.thisParameter);for(var t=0,r=e.parameters;t<r.length;t++)ob(r[t]);}(a);if(i&&!yl(t)&&!a.resolvedReturnType){var s=_b(t,r);a.resolvedReturnType||(a.resolvedReturnType=s);}lx(t);}}}(t,r),Uo($i(t))}function bb(e,t,r,n){if(void 0===n&&(n=!1),!Yd(t,dt)){var i=n&&Tx(t);return Ln(e,!!i&&Yd(i,dt),r),!1}return !0}function xb(t){if(!e.isCallExpression(t))return !1;if(!e.isBindableObjectDefinePropertyCall(t))return !1;var r=zb(t.arguments[2]);if(eo(r,"value")){var n=Jc(r,"writable"),i=n&&Uo(n);if(!i||i===Xe||i===Ye)return !0;if(n&&n.valueDeclaration&&e.isPropertyAssignment(n.valueDeclaration)){var a=ax(n.valueDeclaration.initializer);if(a===Xe||a===Ye)return !0}return !1}return !Jc(r,"set")}function Db(t){return !!(8&e.getCheckFlags(t)||4&t.flags&&64&e.getDeclarationModifierFlagsFromSymbol(t)||3&t.flags&&2&$y(t)||98304&t.flags&&!(65536&t.flags)||8&t.flags||e.some(t.declarations,xb))}function Sb(t,r,n){var i,a;if(0===n)return !1;if(Db(r)){if(4&r.flags&&e.isAccessExpression(t)&&108===t.expression.kind){var o=e.getContainingFunction(t);if(!o||170!==o.kind&&!Fh(o))return !0;if(r.valueDeclaration){var s=e.isBinaryExpression(r.valueDeclaration),c=o.parent===r.valueDeclaration.parent,l=o===r.valueDeclaration.parent,u=s&&(null===(i=r.parent)||void 0===i?void 0:i.valueDeclaration)===o.parent,_=s&&(null===(a=r.parent)||void 0===a?void 0:a.valueDeclaration)===o;return !(c||l||u||_)}}return !0}if(e.isAccessExpression(t)){var d=e.skipParentheses(t.expression);if(79===d.kind){var p=Qn(d).resolvedSymbol;if(2097152&p.flags){var f=di(p);return !!f&&267===f.kind}}}return !1}function Tb(t,r,n){var i=e.skipOuterExpressions(t,7);return 79===i.kind||e.isAccessExpression(i)?!(32&i.flags&&(In(t,n),1)):(In(t,r),!1)}function Cb(e){return Eb(e,2112)?kb(e,3)||Eb(e,296)?dt:Qe:Ge}function Eb(e,t){if(e.flags&t)return !0;if(3145728&e.flags)for(var r=0,n=e.types;r<n.length;r++)if(Eb(n[r],t))return !0;return !1}function kb(e,t,r){return !!(e.flags&t)||!(r&&114691&e.flags)&&(!!(296&t)&&Yd(e,Ge)||!!(2112&t)&&Yd(e,Qe)||!!(402653316&t)&&Yd(e,He)||!!(528&t)&&Yd(e,et)||!!(16384&t)&&Yd(e,rt)||!!(131072&t)&&Yd(e,nt)||!!(65536&t)&&Yd(e,qe)||!!(32768&t)&&Yd(e,ze)||!!(4096&t)&&Yd(e,tt)||!!(67108864&t)&&Yd(e,ct))}function Nb(t,r,n){return 1048576&t.flags?e.every(t.types,(function(e){return Nb(e,r,n)})):kb(t,r,n)}function Fb(t){return !!(16&e.getObjectFlags(t))&&!!t.symbol&&Ab(t.symbol)}function Ab(e){return 0!=(128&e.flags)}function Pb(t,r,n,i,a){void 0===a&&(a=!1);var o=t.properties,s=o[n];if(294===s.kind||295===s.kind){var c=s.name,l=i_(c);if(Es(l)){var u=Jc(r,Ps(l));u&&(Iv(u,s,a),tv(s,!1,!0,r,u));}var _=so(s,F_(r,l,32,c));return Ib(295===s.kind?s:s.initializer,_)}if(296===s.kind){if(!(n<o.length-1)){K<99&&ST(s,4);var d=[];if(i)for(var p=0,f=i;p<f.length;p++){var g=f[p];e.isSpreadAssignment(g)||d.push(g.name);}return _=io(r,d,r.symbol),kT(i,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Ib(s.expression,_)}In(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);}else In(s,e.Diagnostics.Property_assignment_expected);}function wb(t,r,n,i,a){var o=t.elements,s=o[n];if(226!==s.kind){if(224!==s.kind){var c=ad(n);if(Qp(r)){var l=P_(r,c,32|(Sy(s)?16:0),sh(s,c))||Me;return Ib(s,so(s,Sy(s)?Jg(l,524288):l),a)}return Ib(s,i,a)}if(n<o.length-1)In(s,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);else {var u=s.expression;if(220!==u.kind||63!==u.operatorToken.kind)return kT(t.elements,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),Ib(u,am(r,_f)?lm(r,(function(e){return Ou(e,n)})):Tu(i),a);In(u.operatorToken,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}}}function Ib(t,r,n,i){var a;if(295===t.kind){var o=t;o.objectAssignmentInitializer&&(!H||32768&vf(ax(o.objectAssignmentInitializer))||(r=Jg(r,524288)),function(e,t,r,n,i){var a=t.kind;if(63===a&&(204===e.kind||203===e.kind))return Ib(e,ax(r,n),n,108===r.kind);Lb(e,t,r,55===a||56===a||60===a?mD(e,n):ax(e,n),ax(r,n),void 0);}(o.name,o.equalsToken,o.objectAssignmentInitializer,n)),a=t.name;}else a=t;return 220===a.kind&&63===a.operatorToken.kind&&(ne(a,n),a=a.left),204===a.kind?function(e,t,r){var n=e.properties;if(H&&0===n.length)return uv(t,e);for(var i=0;i<n.length;i++)Pb(e,t,i,n,r);return t}(a,r,i):203===a.kind?function(e,t,r){var n=e.elements;K<2&&U.downlevelIteration&&ST(e,512);for(var i=hD(193,t,ze,e)||Me,a=U.noUncheckedIndexedAccess?void 0:i,o=0;o<n.length;o++){var s=i;224===e.elements[o].kind&&(s=a=null!=a?a:hD(65,t,ze,e)||Me),wb(e,t,o,s,r);}return t}(a,r,n):function(t,r,n){var i=ax(t,n);return Tb(t,296===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,296===t.parent.kind?e.Diagnostics.The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access:e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&rp(r,i,t,t),e.isPrivateIdentifierPropertyAccessExpression(t)&&ST(t.parent,1048576),r}(a,r,n)}function Ob(t){switch((t=e.skipParentheses(t)).kind){case 79:case 10:case 13:case 209:case 222:case 14:case 8:case 9:case 110:case 95:case 104:case 152:case 212:case 225:case 213:case 203:case 204:case 215:case 229:case 278:case 277:return !0;case 221:return Ob(t.whenTrue)&&Ob(t.whenFalse);case 220:return !e.isAssignmentOperator(t.operatorToken.kind)&&Ob(t.left)&&Ob(t.right);case 218:case 219:switch(t.operator){case 53:case 39:case 40:case 54:return !0}return !1;case 216:case 210:case 228:default:return !1}}function Mb(e,t){return 0!=(98304&t.flags)||$d(e,t)}function Lb(t,n,i,a,o,s){var c,l,u=n.kind;switch(u){case 41:case 42:case 66:case 67:case 43:case 68:case 44:case 69:case 40:case 65:case 47:case 70:case 48:case 71:case 49:case 72:case 51:case 74:case 52:case 78:case 50:case 73:if(a===it||o===it)return it;a=uv(a,t),o=uv(o,i);var _=void 0;if(528&a.flags&&528&o.flags&&void 0!==(_=function(e){switch(e){case 51:case 74:return 56;case 52:case 78:return 37;case 50:case 73:return 55;default:return}}(n.kind)))return In(s||n,e.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead,e.tokenToString(n.kind),e.tokenToString(_)),Ge;var d,p=bb(t,a,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0),f=bb(i,o,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type,!0);if(kb(a,3)&&kb(o,3)||!Eb(a,2112)&&!Eb(o,2112))d=Ge;else if(T(a,o)){switch(u){case 49:case 72:N();break;case 42:case 67:K<3&&In(s,e.Diagnostics.Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later);}d=Qe;}else N(T),d=Me;return p&&f&&E(d),d;case 39:case 64:if(a===it||o===it)return it;kb(a,402653316)||kb(o,402653316)||(a=uv(a,t),o=uv(o,i));var g=void 0;if(kb(a,296,!0)&&kb(o,296,!0)?g=Ge:kb(a,2112,!0)&&kb(o,2112,!0)?g=Qe:kb(a,402653316,!0)||kb(o,402653316,!0)?g=He:(to(a)||to(o))&&(g=ro(a)||ro(o)?Me:we),g&&!C(u))return g;if(!g){var m=402655727;return N((function(e,t){return kb(e,m)&&kb(t,m)})),we}return 64===u&&E(g),g;case 29:case 31:case 32:case 33:return C(u)&&(a=of(uv(a,t)),o=of(uv(o,i)),k((function(e,t){return $d(e,t)||$d(t,e)||Yd(e,dt)&&Yd(t,dt)}))),et;case 34:case 35:case 36:case 37:return k((function(e,t){return Mb(e,t)||Mb(t,e)})),et;case 102:return function(t,r,n,i){return n===it||i===it?it:(!to(n)&&Nb(n,131068)&&In(t,e.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter),to(i)||US(i)||Xd(i,wt)||In(r,e.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type),et)}(t,i,a,o);case 101:return function(t,r,n,i){if(n===it||i===it)return it;e.isPrivateIdentifier(t)?(K<99&&ST(t,2097152),!Qn(t).resolvedSymbol&&e.getContainingClass(t)&&Tv(t,i,bv(t,i.symbol,!0))):Nb(n=uv(n,t),402665900)||kb(n,407109632)||In(t,e.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);var a=vc(i=uv(i,r));return (!Nb(i,126091264)||a&&(kb(i,3145728)&&!Nb(a,126091264)||!Eb(a,126615552)))&&In(r,e.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive),et}(t,i,a,o);case 55:case 76:var y=4194304&jg(a)?qu([(l=H?a:of(o),lm(l,bf)),o]):a;return 76===u&&E(o),y;case 56:case 75:var v=8388608&jg(a)?qu([hf(a),o],2):a;return 75===u&&E(o),v;case 60:case 77:var h=262144&jg(a)?qu([Sf(a),o],2):a;return 77===u&&E(o),h;case 63:var b=e.isBinaryExpression(t.parent)?e.getAssignmentDeclarationKind(t.parent):0;return function(t,r){if(2===t)for(var n=0,i=fc(r);n<i.length;n++){var a=i[n],o=Uo(a);if(o.symbol&&32&o.symbol.flags){var s=a.escapedName,c=ei(a.valueDeclaration,s,788968,void 0,s,!1);(null==c?void 0:c.declarations)&&c.declarations.some(e.isJSDocTypedefTag)&&(Vn(c,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),a),Vn(a,e.Diagnostics.Duplicate_identifier_0,e.unescapeLeadingUnderscores(s),c));}}}(b,o),function(r){var n;switch(r){case 2:return !0;case 1:case 5:case 6:case 3:case 4:var a=$i(t),o=e.getAssignedExpandoInitializer(i);return !!o&&e.isObjectLiteralExpression(o)&&!!(null===(n=null==a?void 0:a.exports)||void 0===n?void 0:n.size);default:return !1}}(b)?(524288&o.flags&&(2===b||6===b||fp(o)||Bg(o)||1&e.getObjectFlags(o))||E(o),a):(E(o),If(o));case 27:if(!U.allowUnreachableCode&&Ob(t)&&(79!==(c=i).kind||"eval"!==c.escapedText)){var x=e.getSourceFileOfNode(t),D=x.text,S=e.skipTrivia(D,t.pos);x.parseDiagnostics.some((function(t){return t.code===e.Diagnostics.JSX_expressions_must_have_one_parent_element.code&&e.textSpanContainsPosition(t,S)}))||In(t,e.Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);}return o;default:return e.Debug.fail()}function T(e,t){return kb(e,2112)&&kb(t,2112)}function C(r){var n=Eb(a,12288)?t:Eb(o,12288)?i:void 0;return !n||(In(n,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(r)),!1)}function E(n){if(r&&e.isAssignmentOperator(u)&&Tb(t,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access)&&(!e.isIdentifier(t)||"exports"!==e.unescapeLeadingUnderscores(t.escapedText))){var o=void 0;re&&e.isPropertyAccessExpression(t)&&Eb(n,32768)&&Cp(n,eo(rx(t.expression),t.name.escapedText))&&(o=e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target),rp(n,a,t,i,o);}}function k(e){return !e(a,o)&&(N(e),!0)}function N(t){var r,i=!1,c=s||n;if(t){var l=Px(a),u=Px(o);i=!(l===a&&u===o)&&!(!l||!u)&&t(l,u);}var _=a,d=o;!i&&t&&(r=function(e,t,r){var n=e,i=t,a=of(e),o=of(t);return r(a,o)||(n=a,i=o),[n,i]}(a,o,t),_=r[0],d=r[1]);var p=La(_,d),f=p[0],g=p[1];(function(t,r,i,a){var o;switch(n.kind){case 36:case 34:o="false";break;case 37:case 35:o="true";}if(o)return Ln(t,r,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap,o,i,a)})(c,i,f,g)||Ln(c,i,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2,e.tokenToString(n.kind),f,g);}}function Rb(t){var r=t.parent;return e.isParenthesizedExpression(r)&&Rb(r)||e.isElementAccessExpression(r)&&r.argumentExpression===t}function Bb(t){for(var r=[t.head.text],n=[],i=0,a=t.templateSpans;i<a.length;i++){var o=a[i],s=ax(o.expression);Eb(s,12288)&&In(o.expression,e.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String),r.push(o.literal.text),n.push(Yd(s,pt)?s:He);}return Wb(t)||Rb(t)||im(my(t)||je,jb)?u_(r,n):He}function jb(e){return !!(134217856&e.flags||58982400&e.flags&&Eb(Tc(e)||je,402653316))}function Jb(t,r,n,i){var a=function(t){return 285!==t.kind||e.isJsxSelfClosingElement(t.parent)?t:t.parent.parent}(t),o=a.contextualType,s=a.inferenceContext;try{a.contextualType=r,a.inferenceContext=n;var c=ax(t,1|i|(n?2:0));return Eb(c,2944)&&qb(c,fy(r,t))?rd(c):c}finally{a.contextualType=o,a.inferenceContext=s;}}function zb(e,t){var r=Qn(e);if(!r.resolvedType){if(t&&0!==t)return ax(e,t);var n=zr,i=br;zr=Ur,br=void 0,r.resolvedType=ax(e,t),br=i,zr=n;}return r.resolvedType}function Ub(t){return 210===(t=e.skipParentheses(t,!0)).kind||228===t.kind||e.isJSDocTypeAssertion(t)}function Kb(t,r){var n=e.getEffectiveInitializer(t),i=nx(n)||(r?Jb(n,r,void 0,0):zb(n));return e.isParameter(t)&&201===t.name.kind&&_f(i)&&!i.target.hasRestElement&&Ul(i)<t.name.elements.length?function(t,r){for(var n=r.elements,i=zl(t).slice(),a=t.target.elementFlags.slice(),o=Ul(t);o<n.length;o++){var s=n[o];(o<n.length-1||202!==s.kind||!s.dotDotDotToken)&&(i.push(!e.isOmittedExpression(s)&&Sy(s)?ko(s,!1,!1):we),a.push(2),e.isOmittedExpression(s)||Sy(s)||Uf(s,we));}return Au(i,a,t.target.readonly)}(i,t.name):i}function Vb(t,r){var n=2&e.getCombinedNodeFlags(t)||e.isDeclarationReadonly(t)?r:sf(r);if(e.isInJSFile(t)){if(Yp(n))return Uf(t,we),we;if(Zp(n))return Uf(t,Ut),Ut}return n}function qb(t,r){if(r){if(3145728&r.flags){var n=r.types;return e.some(n,(function(e){return qb(t,e)}))}if(58982400&r.flags){var i=Tc(r)||je;return Eb(i,4)&&Eb(t,128)||Eb(i,8)&&Eb(t,256)||Eb(i,64)&&Eb(t,2048)||Eb(i,4096)&&Eb(t,8192)||qb(t,i)}return !!(406847616&r.flags&&Eb(t,128)||256&r.flags&&Eb(t,256)||2048&r.flags&&Eb(t,2048)||512&r.flags&&Eb(t,512)||8192&r.flags&&Eb(t,8192))}return !1}function Wb(t){var r=t.parent;return e.isAssertionExpression(r)&&e.isConstTypeReference(r.type)||e.isJSDocTypeAssertion(r)&&e.isConstTypeReference(e.getJSDocTypeAssertionType(r))||(e.isParenthesizedExpression(r)||e.isArrayLiteralExpression(r)||e.isSpreadElement(r))&&Wb(r)||(e.isPropertyAssignment(r)||e.isShorthandPropertyAssignment(r)||e.isTemplateSpan(r))&&Wb(r.parent)}function Hb(e,t,r,n){var i=ax(e,t,n);return Wb(e)?rd(i):Ub(e)?i:lf(i,fy(2===arguments.length?my(e):r,e))}function Gb(e,t){return 161===e.name.kind&&Ny(e.name),Hb(e.initializer,t)}function Qb(e,t){return zT(e),161===e.name.kind&&Ny(e.name),Xb(e,hb(e,t),t)}function Xb(t,r,n){if(n&&10&n){var i=Yv(r,0,!0),a=Yv(r,1,!0),o=i||a;if(o&&o.typeParameters){var s=py(t,2);if(s){var c=Yv(Sf(s),i?0:1,!1);if(c&&!c.typeParameters){if(8&n)return Yb(t,n),xt;var l=yy(t),u=l.signature&&ml(l.signature),_=u&&Xv(u);if(_&&!_.typeParameters&&!e.every(l.inferences,Zb)){var d=function(t,r){for(var n,i,a=[],o=0,s=r;o<s.length;o++){var c=(p=s[o]).symbol.escapedName;if($b(t.inferredTypeParameters,c)||$b(a,c)){var l=da(jn(262144,ex(e.concatenate(t.inferredTypeParameters,a),c)));l.target=p,n=e.append(n,p),i=e.append(i,l),a.push(l);}else a.push(p);}if(i)for(var u=vd(n,i),_=0,d=i;_<d.length;_++){var p;(p=d[_]).mapper=u;}return a}(l,o.typeParameters),p=xl(o,d),f=e.map(l.inferences,(function(e){return Xf(e.typeParameter)}));if(Vf(p,c,(function(e,t){fg(f,e,t,0,!0);})),e.some(f,Zb)&&(qf(p,c,(function(e,t){fg(f,e,t);})),!function(e,t){for(var r=0;r<e.length;r++)if(Zb(e[r])&&Zb(t[r]))return !0;return !1}(l.inferences,f)))return function(e,t){for(var r=0;r<e.length;r++)!Zb(e[r])&&Zb(t[r])&&(e[r]=t[r]);}(l.inferences,f),l.inferredTypeParameters=e.concatenate(l.inferredTypeParameters,d),Cl(p)}return Cl(Zv(o,c,l))}}}}return r}function Yb(e,t){2&t&&(yy(e).flags|=4);}function Zb(e){return !(!e.candidates&&!e.contraCandidates)}function $b(t,r){return e.some(t,(function(e){return e.symbol.escapedName===r}))}function ex(e,t){for(var r=t.length;r>1&&t.charCodeAt(r-1)>=48&&t.charCodeAt(r-1)<=57;)r--;for(var n=t.slice(0,r),i=1;;i++){var a=n+i;if(!$b(e,a))return a}}function tx(e){var t=Qv(e);if(t&&!t.typeParameters)return ml(t)}function rx(t){var r=nx(t);if(r)return r;if(67108864&t.flags&&br){var n=br[O(t)];if(n)return n}var i=qr,a=ax(t);return qr!==i&&((br||(br=[]))[O(t)]=a,e.setNodeFlags(t,67108864|t.flags)),a}function nx(t){var r=e.skipParentheses(t,!0);if(e.isJSDocTypeAssertion(r)){var n=e.getJSDocTypeAssertionType(r);if(!e.isConstTypeReference(n))return dd(n)}if(r=e.skipParentheses(t),!e.isCallExpression(r)||106===r.expression.kind||e.isRequireCall(r,!0)||Oh(r)){if(e.isAssertionExpression(r)&&!e.isConstTypeReference(r.type))return dd(r.type);if(8===t.kind||10===t.kind||110===t.kind||95===t.kind)return ax(t)}else if(n=e.isCallChain(r)?function(e){var t=ax(e.expression),r=kf(t,e.expression),n=tx(t);return n&&Ef(n,e,r!==t)}(r):tx(iv(r.expression)))return n}function ix(e){var t=Qn(e);if(t.contextFreeType)return t.contextFreeType;var r=e.contextualType;e.contextualType=we;try{return t.contextFreeType=ax(e,4)}finally{e.contextualType=r;}}function ax(t,n,i){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkExpression",{kind:t.kind,pos:t.pos,end:t.end});var o=_;_=t,D=0;var s=Xb(t,function(t,n,i){var o=t.kind;if(a)switch(o){case 225:case 212:case 213:a.throwIfCancellationRequested();}switch(o){case 79:return function(t,r){var n=Sg(t);if(n===Ne)return Me;if(n===ue){if(Dv(t))return In(t,e.Diagnostics.arguments_cannot_be_referenced_in_property_initializers),Me;var i=e.getContainingFunction(t);return K<2&&(213===i.kind?In(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression):e.hasSyntacticModifier(i,256)&&In(t,e.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method)),Qn(i).flags|=8192,Uo(n)}t.parent&&e.isPropertyAccessExpression(t.parent)&&t.parent.expression===t||Jm(n,t);var a=aa(n),o=2097152&a.flags?ki(a):a;o.declarations&&134217728&$y(o)&&g_(t,o)&&Bn(t,o.declarations,t.escapedText);var s=a.valueDeclaration;if(s&&32&a.flags)if(256===s.kind&&e.nodeIsDecorated(s))for(i=e.getContainingClass(t);void 0!==i;){if(i===s&&i.name!==t){Qn(s).flags|=16777216,Qn(t).flags|=33554432;break}i=e.getContainingClass(i);}else if(225===s.kind)for(i=e.getThisContainer(t,!1);303!==i.kind;){if(i.parent===s){(e.isPropertyDeclaration(i)&&e.isStatic(i)||e.isClassStaticBlockDeclaration(i))&&(Qn(s).flags|=16777216,Qn(t).flags|=33554432);break}i=e.getThisContainer(i,!1);}!function(t,r){if(!(K>=2||0==(34&r.flags)||!r.valueDeclaration||e.isSourceFile(r.valueDeclaration)||291===r.valueDeclaration.parent.kind)){var n=e.getEnclosingBlockScopeContainer(r.valueDeclaration),i=function(t,r){return !!e.findAncestor(t,(function(t){return t===r?"quit":e.isFunctionLike(t)||t.parent&&e.isPropertyDeclaration(t.parent)&&!e.hasStaticModifier(t.parent)&&t.parent.initializer===t}))}(t,n),a=zm(n);if(a){if(i){var o=!0;if(e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,254))&&u.parent===n){var s=function(t,r){return e.findAncestor(t,(function(e){return e===r?"quit":e===r.initializer||e===r.condition||e===r.incrementor||e===r.statement}))}(t.parent,n);if(s){var c=Qn(s);c.flags|=131072;var l=c.capturedBlockScopeBindings||(c.capturedBlockScopeBindings=[]);e.pushIfUnique(l,r),s===n.initializer&&(o=!1);}}o&&(Qn(a).flags|=65536);}var u;e.isForStatement(n)&&(u=e.getAncestor(r.valueDeclaration,254))&&u.parent===n&&function(t,r){for(var n=t;211===n.parent.kind;)n=n.parent;var i=!1;if(e.isAssignmentTarget(n))i=!0;else if(218===n.parent.kind||219===n.parent.kind){var a=n.parent;i=45===a.operator||46===a.operator;}return !!i&&!!e.findAncestor(n,(function(e){return e===r?"quit":e===r.statement}))}(t,n)&&(Qn(r.valueDeclaration).flags|=4194304),Qn(r.valueDeclaration).flags|=524288;}i&&(Qn(r.valueDeclaration).flags|=262144);}}(t,n);var c=Uo(a),l=e.getAssignmentTargetKind(t);if(l){if(!(3&a.flags||e.isInJSFile(t)&&512&a.flags))return In(t,384&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_enum:32&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_class:1536&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace:16&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_a_function:2097152&a.flags?e.Diagnostics.Cannot_assign_to_0_because_it_is_an_import:e.Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable,Ia(n)),Me;if(Db(a))return 3&a.flags?In(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant,Ia(n)):In(t,e.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property,Ia(n)),Me}var u=2097152&a.flags;if(3&a.flags){if(1===l)return c}else {if(!u)return c;s=di(n);}if(!s)return c;c=Bm(c,t,r);for(var _=163===e.getRootDeclaration(s).kind,d=wm(s),p=wm(t),f=p!==d,g=t.parent&&t.parent.parent&&e.isSpreadAssignment(t.parent)&&Wg(t.parent.parent),m=134217728&n.flags;p!==d&&(212===p.kind||213===p.kind||e.isObjectLiteralOrClassExpressionMethodOrAccessor(p))&&(Mm(a)&&c!==Kt||_&&!Im(a));)p=wm(p);var y=_||u||f||g||m||e.isBindingElement(s)||c!==Ie&&c!==Kt&&(!H||0!=(16387&c.flags)||Tg(t)||274===t.parent.kind)||229===t.parent.kind||253===s.kind&&s.exclamationToken||8388608&s.flags,v=Pm(t,c,y?_?function(e,t){if(Qa(t.symbol,2)){var r=H&&163===t.kind&&t.initializer&&32768&vf(e)&&!(32768&vf(ax(t.initializer)));return Za(),r?Jg(e,524288):e}return zo(t.symbol),e}(c,s):c:c===Ie||c===Kt?ze:Df(c),p);if(xm(t)||c!==Ie&&c!==Kt){if(!y&&!(32768&vf(c))&&32768&vf(v))return In(t,e.Diagnostics.Variable_0_is_used_before_being_assigned,Ia(n)),c}else if(v===Ie||v===Kt)return Y&&(In(e.getNameOfDeclaration(s),e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined,Ia(n),Ma(v)),In(t,e.Diagnostics.Variable_0_implicitly_has_an_1_type,Ia(n),Ma(v))),cD(v);return l?of(v):v}(t,n);case 80:return function(t){!function(t){e.getContainingClass(t)?e.isExpressionNode(t)?!mv(t)&&YT(t,e.Diagnostics.Cannot_find_name_0,e.idText(t)):YT(t,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression):YT(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);}(t);var r=mv(t);return r&&Iv(r,void 0,!1),we}(t);case 108:return Wm(t);case 106:return Qm(t);case 104:return We;case 14:case 10:return td(id(t.text));case 8:return eC(t),td(ad(+t.text));case 9:return function(t){if(!(e.isLiteralTypeNode(t.parent)||e.isPrefixUnaryExpression(t.parent)&&e.isLiteralTypeNode(t.parent.parent))&&K<7&&YT(t,e.Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020));}(t),td(od({negative:!1,base10Value:e.parsePseudoBigInt(t.text)}));case 110:return Ze;case 95:return Xe;case 222:return Bb(t);case 13:return Jt;case 203:return Ty(t,n,i);case 204:return function(t,r){var n=e.isAssignmentTarget(t);!function(t,r){for(var n=new e.Map,i=0,a=t.properties;i<a.length;i++){var o=a[i];if(296!==o.kind){var s=o.name;if(161===s.kind&&OT(s),295===o.kind&&!r&&o.objectAssignmentInitializer)return YT(o.equalsToken,e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);if(80===s.kind&&YT(s,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),o.modifiers)for(var c=0,l=o.modifiers;c<l.length;c++){var u=l[c];131===u.kind&&168===o.kind||YT(u,e.Diagnostics._0_modifier_cannot_be_used_here,e.getTextOfNode(u));}var _=void 0;switch(o.kind){case 295:RT(o.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context);case 294:LT(o.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional),8===s.kind&&eC(s),_=4;break;case 168:_=8;break;case 171:_=1;break;case 172:_=2;break;default:throw e.Debug.assertNever(o,"Unexpected syntax kind:"+o.kind)}if(!r){var d=e.getPropertyNameForPropertyNameNode(s);if(void 0===d)continue;var p=n.get(d);if(p)if(12&_&&12&p)YT(s,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(s));else {if(!(3&_&&3&p))return YT(s,e.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name);if(3===p||_===p)return YT(s,e.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name);n.set(d,_|p);}else n.set(d,_);}}else if(r){var f=e.skipParentheses(o.expression);if(e.isArrayLiteralExpression(f)||e.isObjectLiteralExpression(f))return YT(o.expression,e.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern)}}}(t,n);for(var i=H?e.createSymbolTable():void 0,a=e.createSymbolTable(),o=[],s=mt,c=py(t),l=c&&c.pattern&&(200===c.pattern.kind||204===c.pattern.kind),u=Wb(t),_=u?8:0,d=e.isInJSFile(t)&&!e.isInJsonFile(t),p=e.getJSDocEnumTag(t),f=!c&&d&&!p,g=te,m=!1,y=!1,v=!1,h=!1,b=0,x=t.properties;b<x.length;b++){var D=x[b];D.name&&e.isComputedPropertyName(D.name)&&Ny(D.name);}for(var S=0,T=0,C=t.properties;T<C.length;T++){var E=C[T],k=$i(E),N=E.name&&161===E.name.kind?Ny(E.name):void 0;if(294===E.kind||295===E.kind||e.isObjectLiteralMethod(E)){var F=294===E.kind?Gb(E,r):295===E.kind?Hb(!n&&E.objectAssignmentInitializer?E.objectAssignmentInitializer:E.name,r):Qb(E,r);if(d){var A=po(E);A?(tp(F,A,E),F=A):p&&p.typeExpression&&tp(F,dd(p.typeExpression),E);}g|=917504&e.getObjectFlags(F);var P=N&&Es(N)?N:void 0,w=P?jn(4|k.flags,Ps(P),4096|_):jn(4|k.flags,k.escapedName,_);if(P&&(w.nameType=P),n)(294===E.kind&&Sy(E.initializer)||295===E.kind&&E.objectAssignmentInitializer)&&(w.flags|=16777216);else if(l&&!(512&e.getObjectFlags(c))){var I=Jc(c,k.escapedName);I?w.flags|=16777216&I.flags:U.suppressExcessPropertyErrors||Gc(c,He)||In(E.name,e.Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,Ia(k),Ma(c));}w.declarations=k.declarations,w.parent=k.parent,k.valueDeclaration&&(w.valueDeclaration=k.valueDeclaration),w.type=F,w.target=k,k=w,null==i||i.set(w.escapedName,w);}else {if(296===E.kind){if(K<2&&ST(E,2),o.length>0&&(s=Y_(s,R(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1,h=!1),wy(F=Mc(ax(E.expression)))){var O=X_(F,u);if(i&&Ry(O,i,E),S=o.length,ro(s))continue;s=Y_(s,O,t.symbol,g,u);}else In(E,e.Diagnostics.Spread_types_may_only_be_created_from_object_types),s=Me;continue}e.Debug.assert(171===E.kind||172===E.kind),xS(E);}!N||8576&N.flags?a.set(k.escapedName,k):Yd(N,ut)&&(Yd(N,Ge)?v=!0:Yd(N,tt)?h=!0:y=!0,n&&(m=!0)),o.push(k);}if(l&&296!==t.parent.kind)for(var M=0,L=yc(c);M<L.length;M++)w=L[M],a.get(w.escapedName)||Jc(s,w.escapedName)||(16777216&w.flags||In(w.valueDeclaration||w.bindingElement,e.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value),a.set(w.escapedName,w),o.push(w));return ro(s)?Me:s!==mt?(o.length>0&&(s=Y_(s,R(),t.symbol,g,u),o=[],a=e.createSymbolTable(),y=!1,v=!1),lm(s,(function(e){return e===mt?R():e}))):R();function R(){var r=[];y&&r.push(Ay(t,S,o,He)),v&&r.push(Ay(t,S,o,Ge)),h&&r.push(Ay(t,S,o,tt));var i=ya(t.symbol,a,e.emptyArray,e.emptyArray,r);return i.objectFlags|=262272|g,f&&(i.objectFlags|=8192),m&&(i.objectFlags|=512),n&&(i.pattern=t),i}}(t,n);case 205:return dv(t,n);case 160:return pv(t,n);case 206:return function(e,t){return 32&e.flags?function(e,t){var r=ax(e.expression),n=kf(r,e.expression);return Ef(jv(e,uv(n,e.expression),t),e,n!==r)}(e,t):jv(e,iv(e.expression),t)}(t,n);case 207:if(100===t.expression.kind)return function(t){if(PT(t.arguments)||function(t){if(V===e.ModuleKind.ES2015)return YT(t,e.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);if(t.typeArguments)return YT(t,e.Diagnostics.Dynamic_import_cannot_have_type_arguments);var r=t.arguments;if(V!==e.ModuleKind.ESNext&&(kT(r),r.length>1))return YT(r[1],e.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext);if(0===r.length||r.length>2)return YT(t,e.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);var n=e.find(r,e.isSpreadElement);n&&YT(n,e.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element);}(t),0===t.arguments.length)return ub(t,we);for(var r=t.arguments[0],n=zb(r),i=t.arguments.length>1?zb(t.arguments[1]):void 0,a=2;a<t.arguments.length;++a)zb(t.arguments[a]);if((32768&n.flags||65536&n.flags||!Yd(n,He))&&In(r,e.Diagnostics.Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0,Ma(n)),i){var o=pu(!0);o!==mt&&tp(i,xf(o,32768),t.arguments[1]);}var s=Ri(t,r);if(s){var c=Ui(s,r,!0,!1);if(c)return ub(t,Lh(Uo(c),c,s,r)||Rh(Uo(c),c,s,r))}return ub(t,we)}(t);case 208:return function(t,r){var n;AT(t,t.typeArguments)||PT(t.arguments);var i=Nh(t,void 0,r);if(i===Nr)return at;if(wh(i,t),106===t.expression.kind)return rt;if(208===t.kind){var a=i.declaration;if(a&&170!==a.kind&&174!==a.kind&&179!==a.kind&&!e.isJSDocConstructSignature(a)&&!Fh(a))return Y&&In(t,e.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type),we}if(e.isInJSFile(t)&&Bh(t))return dl(t.arguments[0]);var o=ml(i);if(12288&o.flags&&Oh(t))return cd(e.walkUpParenthesizedExpressions(t.parent));if(207===t.kind&&!t.questionDotToken&&237===t.parent.kind&&16384&o.flags&&fl(i))if(e.isDottedName(t.expression)){if(!Tm(t)){var s=In(t.expression,e.Diagnostics.Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation);Sm(t.expression,s);}}else In(t.expression,e.Diagnostics.Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name);if(e.isInJSFile(t)){var c=Ph(t,!1);if(null===(n=null==c?void 0:c.exports)||void 0===n?void 0:n.size){var l=ya(c,c.exports,e.emptyArray,e.emptyArray,e.emptyArray);return l.objectFlags|=8192,$u([o,l])}}return o}(t,n);case 209:return function(t){(function(t){return !!(t.questionDotToken||32&t.flags)&&YT(t.template,e.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain)})(t)||AT(t,t.typeArguments),K<2&&ST(t,262144);var r=Nh(t);return wh(r,t),ml(r)}(t);case 211:return function(t,r){if(e.hasJSDocNodes(t)&&e.isJSDocTypeAssertion(t)){var n=e.getJSDocTypeAssertionType(t);return Jh(n,n,t.expression,r)}return ax(t.expression,r)}(t,n);case 225:return function(e){return YD(e),xS(e),Uo($i(e))}(t);case 212:case 213:return hb(t,n);case 215:return function(e){return ax(e.expression),hn}(t);case 210:case 228:return function(t){if(210===t.kind){var r=e.getSourceFileOfNode(t);r&&e.fileExtensionIsOneOf(r.fileName,[".cts",".mts"])&&YT(t,e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);}return Jh(t,t.type,t.expression)}(t);case 229:return function(e){return 32&e.flags?function(e){var t=ax(e.expression),r=kf(t,e.expression);return Ef(Sf(r),e,r!==t)}(e):Sf(ax(e.expression))}(t);case 230:return function(t){return function(t){var r=t.name.escapedText;switch(t.keywordToken){case 103:if("target"!==r)return YT(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"target");break;case 100:"meta"!==r&&YT(t.name,e.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2,t.name.escapedText,e.tokenToString(t.keywordToken),"meta");}}(t),103===t.keywordToken?Uh(t):100===t.keywordToken?function(t){V===e.ModuleKind.Node12||V===e.ModuleKind.NodeNext?e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext&&In(t,e.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output):V<e.ModuleKind.ES2020&&V!==e.ModuleKind.System&&In(t,e.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);var r=e.getSourceFileOfNode(t);return e.Debug.assert(!!(2097152&r.flags),"Containing file is missing import meta node flag."),"meta"===t.name.escapedText?du():Me}(t):e.Debug.assertNever(t.keywordToken)}(t);case 214:return function(t){ax(t.expression);var r=e.skipParentheses(t.expression);if(!e.isAccessExpression(r))return In(r,e.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference),et;e.isPropertyAccessExpression(r)&&e.isPrivateIdentifier(r.name)&&In(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier);var n=aa(Qn(r).resolvedSymbol);return n&&(Db(n)&&In(r,e.Diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property),function(t,r){var n=Uo(r);!H||131075&n.flags||(re?16777216&r.flags:32768&vf(n))||In(t,e.Diagnostics.The_operand_of_a_delete_operator_must_be_optional);}(r,n)),et}(t);case 216:return function(e){return ax(e.expression),Ue}(t);case 217:return function(t){if(r){var n=e.getContainingFunctionOrClassStaticBlock(t);if(n&&e.isClassStaticBlockDeclaration(n))In(t,e.Diagnostics.Await_expression_cannot_be_used_inside_a_class_static_block);else if(!(32768&t.flags)){var i;if(e.isInTopLevelContext(t)){if(!GT(i=e.getSourceFileOfNode(t))){var a=void 0;if(!e.isEffectiveExternalModule(i,U)){a||(a=e.getSpanOfTokenAtPosition(i,t.pos));var o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module);mn.add(o);}(V!==e.ModuleKind.ES2022&&V!==e.ModuleKind.ESNext&&V!==e.ModuleKind.System&&(V!==e.ModuleKind.NodeNext||e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext)||K<4)&&(a=e.getSpanOfTokenAtPosition(i,t.pos),o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher),mn.add(o));}}else if(!GT(i=e.getSourceFileOfNode(t))){if(a=e.getSpanOfTokenAtPosition(i,t.pos),o=e.createFileDiagnostic(i,a.start,a.length,e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),n&&170!==n.kind&&0==(2&e.getFunctionFlags(n))){var s=e.createDiagnosticForNode(n,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(o,s);}mn.add(o);}}ty(t)&&In(t,e.Diagnostics.await_expressions_cannot_be_used_in_a_parameter_initializer);}var c=ax(t.expression),l=Ex(c,!0,t,e.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);return l!==c||ro(l)||3&c.flags||On(!1,e.createDiagnosticForNode(t,e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression)),l}(t);case 218:return function(t){var r=ax(t.operand);if(r===it)return it;switch(t.operand.kind){case 8:switch(t.operator){case 40:return td(ad(-t.operand.text));case 39:return td(ad(+t.operand.text))}break;case 9:if(40===t.operator)return td(od({negative:!0,base10Value:e.parsePseudoBigInt(t.operand.text)}))}switch(t.operator){case 39:case 40:case 54:return uv(r,t.operand),Eb(r,12288)&&In(t.operand,e.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol,e.tokenToString(t.operator)),39===t.operator?(Eb(r,2112)&&In(t.operand,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1,e.tokenToString(t.operator),Ma(of(r))),Ge):Cb(r);case 53:mD(t.operand);var n=12582912&jg(r);return 4194304===n?Xe:8388608===n?Ze:et;case 45:case 46:return bb(t.operand,uv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Tb(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),Cb(r)}return Me}(t);case 219:return function(t){var r=ax(t.operand);return r===it?it:(bb(t.operand,uv(r,t.operand),e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type)&&Tb(t.operand,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access,e.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access),Cb(r))}(t);case 220:return ne(t,n);case 221:return function(e,t){var r=mD(e.condition);return fD(e.condition,r,e.whenTrue),qu([ax(e.whenTrue,t),ax(e.whenFalse,t)],2)}(t,n);case 224:return function(e,t){return K<2&&ST(e,U.downlevelIteration?1536:1024),hD(33,ax(e.expression,t),ze,e.expression)}(t,n);case 226:return Ue;case 223:return function(t){r&&(8192&t.flags||QT(t,e.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body),ty(t)&&In(t,e.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer));var n=e.getContainingFunction(t);if(!n)return we;var i=e.getFunctionFlags(n);if(!(1&i))return we;var a=0!=(2&i);t.asteriskToken&&(a&&K<99&&ST(t,26624),!a&&K<2&&U.downlevelIteration&&ST(t,256));var o=yl(n),s=o&&UD(o,a),c=s&&s.yieldType||we,l=s&&s.nextType||we,u=a?Ax(l)||we:l,_=t.expression?ax(t.expression):Ue,d=pb(t,_,u,a);if(o&&d&&rp(d,c,t.expression||t,t.expression),t.asteriskToken)return xD(a?19:17,1,_,t.expression)||we;if(o)return zD(2,o,a)||we;var p=ry(2,n);if(!p&&(p=we,r&&Y&&!e.expressionResultIsUnused(t))){var f=my(t);f&&!to(f)||In(t,e.Diagnostics.yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation);}return p}(t);case 231:return function(e){return e.isSpread?F_(e.type,Ge):e.type}(t);case 287:return function(t,r){if(function(t){t.expression&&e.isCommaSequence(t.expression)&&YT(t.expression,e.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array);}(t),t.expression){var n=ax(t.expression,r);return t.dotDotDotToken&&n!==we&&!qp(n)&&In(t,e.Diagnostics.JSX_spread_child_must_be_an_array_type),n}return Me}(t,n);case 277:case 278:return function(e,t){return xS(e),Gy(e)||we}(t);case 281:return function(t){Xy(t.openingFragment);var r=e.getSourceFileOfNode(t);return !e.getJSXTransformEnabled(U)||!U.jsxFactory&&!r.pragmas.has("jsx")||U.jsxFragmentFactory||r.pragmas.has("jsxfrag")||In(t,U.jsxFactory?e.Diagnostics.The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option:e.Diagnostics.An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments),Ly(t),Gy(t)||we}(t);case 285:return function(t,r){return function(t,r){for(var n,i=t.attributes,a=H?e.createSymbolTable():void 0,o=e.createSymbolTable(),s=yt,c=!1,l=!1,u=2048,_=Ky(zy(t)),d=0,p=i.properties;d<p.length;d++){var f=p[d],g=f.symbol;if(e.isJsxAttribute(f)){var m=My(f,r);u|=917504&e.getObjectFlags(m);var y=jn(4|g.flags,g.escapedName);y.declarations=g.declarations,y.parent=g.parent,g.valueDeclaration&&(y.valueDeclaration=g.valueDeclaration),y.type=m,y.target=g,o.set(y.escapedName,y),null==a||a.set(y.escapedName,y),f.name.escapedText===_&&(l=!0);}else e.Debug.assert(286===f.kind),o.size>0&&(s=Y_(s,T(),i.symbol,u,!1),o=e.createSymbolTable()),to(m=Mc(zb(f.expression,r)))&&(c=!0),wy(m)?(s=Y_(s,m,i.symbol,u,!1),a&&Ry(m,a,f)):n=n?$u([n,m]):m;}c||o.size>0&&(s=Y_(s,T(),i.symbol,u,!1));var v=277===t.parent.kind?t.parent:void 0;if(v&&v.openingElement===t&&v.children.length>0){var h=Ly(v,r);if(!c&&_&&""!==_){l&&In(i,e.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten,e.unescapeLeadingUnderscores(_));var b=py(t.attributes),x=b&&cy(b,_),D=jn(4,_);D.type=1===h.length?h[0]:x&&im(x,$p)?Au(h):Tu(qu(h)),D.valueDeclaration=e.factory.createPropertySignature(void 0,e.unescapeLeadingUnderscores(_),void 0,void 0),e.setParent(D.valueDeclaration,i),D.valueDeclaration.symbol=D;var S=e.createSymbolTable();S.set(_,D),s=Y_(s,ya(i.symbol,S,e.emptyArray,e.emptyArray,e.emptyArray),i.symbol,u,!1);}}return c?we:n&&s!==yt?$u([n,s]):n||(s===yt?T():s);function T(){u|=te;var t=ya(i.symbol,o,e.emptyArray,e.emptyArray,e.emptyArray);return t.objectFlags|=262272|u,t}}(t.parent,r)}(t,n);case 279:e.Debug.fail("Shouldn't ever directly check a JsxOpeningElement");}return Me}(t,n,i),n);return Fb(s)&&function(t,r){205===t.parent.kind&&t.parent.expression===t||206===t.parent.kind&&t.parent.expression===t||(79===t.kind||160===t.kind)&&wS(t)||180===t.parent.kind&&t.parent.exprName===t||274===t.parent.kind||In(t,e.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query),U.isolatedModules&&(e.Debug.assert(!!(128&r.symbol.flags)),8388608&r.symbol.valueDeclaration.flags&&In(t,e.Diagnostics.Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided));}(t,s),_=o,null===e.tracing||void 0===e.tracing||e.tracing.pop(),s}function ox(t){t.expression&&QT(t.expression,e.Diagnostics.Type_expected),hS(t.constraint),hS(t.default);var n=gs($i(t));Tc(n),function(e){return Nc(e)!==St}(n)||In(t.default,e.Diagnostics.Type_parameter_0_has_a_circular_default,Ma(n));var i=hc(n),a=Fc(n);i&&a&&tp(a,Ls(Rd(i,bd(n,a)),a),t.default,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1),r&&GD(t.name,e.Diagnostics.Type_parameter_name_cannot_be_0);}function sx(t){CT(t),lD(t);var r=e.getContainingFunction(t);e.hasSyntacticModifier(t,16476)&&(170===r.kind&&e.nodeIsPresent(r.body)||In(t,e.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation),170===r.kind&&e.isIdentifier(t.name)&&"constructor"===t.name.escapedText&&In(t.name,e.Diagnostics.constructor_cannot_be_used_as_a_parameter_property_name)),t.questionToken&&e.isBindingPattern(t.name)&&r.body&&In(t,e.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature),t.name&&e.isIdentifier(t.name)&&("this"===t.name.escapedText||"new"===t.name.escapedText)&&(0!==r.parameters.indexOf(t)&&In(t,e.Diagnostics.A_0_parameter_must_be_the_first_parameter,t.name.escapedText),170!==r.kind&&174!==r.kind&&179!==r.kind||In(t,e.Diagnostics.A_constructor_cannot_have_a_this_parameter),213===r.kind&&In(t,e.Diagnostics.An_arrow_function_cannot_have_a_this_parameter),171!==r.kind&&172!==r.kind||In(t,e.Diagnostics.get_and_set_accessors_cannot_declare_this_parameters)),!t.dotDotDotToken||e.isBindingPattern(t.name)||Yd(Mc(Uo(t.symbol)),Vt)||In(t,e.Diagnostics.A_rest_parameter_must_be_of_an_array_type);}function cx(t,r,n){for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(!e.isOmittedExpression(o)){var s=o.name;if(79===s.kind&&s.escapedText===n)return In(r,e.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern,n),!0;if((201===s.kind||200===s.kind)&&cx(s,r,n))return !0}}}function lx(t){175===t.kind?function(t){CT(t)||function(t){var r=t.parameters[0];if(1!==t.parameters.length)return YT(r?r.name:t,e.Diagnostics.An_index_signature_must_have_exactly_one_parameter);if(kT(t.parameters,e.Diagnostics.An_index_signature_cannot_have_a_trailing_comma),r.dotDotDotToken)return YT(r.dotDotDotToken,e.Diagnostics.An_index_signature_cannot_have_a_rest_parameter);if(e.hasEffectiveModifiers(r))return YT(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier);if(r.questionToken)return YT(r.questionToken,e.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark);if(r.initializer)return YT(r.name,e.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer);if(!r.type)return YT(r.name,e.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);var n=dd(r.type);im(n,(function(e){return !!(8576&e.flags)}))||b_(n)?YT(r.name,e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead):am(n,Pl)?t.type||YT(t,e.Diagnostics.An_index_signature_must_have_a_type_annotation):YT(r.name,e.Diagnostics.An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type);}(t);}(t):178!==t.kind&&255!==t.kind&&179!==t.kind&&173!==t.kind&&170!==t.kind&&174!==t.kind||FT(t);var n=e.getFunctionFlags(t);if(4&n||(3==(3&n)&&K<99&&ST(t,6144),2==(3&n)&&K<4&&ST(t,64),0!=(3&n)&&K<2&&ST(t,128)),QD(e.getEffectiveTypeParameterDeclarations(t)),e.forEach(t.parameters,sx),t.type&&hS(t.type),r){!function(t){K>=2||!e.hasRestParameter(t)||8388608&t.flags||e.nodeIsMissing(t.body)||e.forEach(t.parameters,(function(t){t.name&&!e.isBindingPattern(t.name)&&t.name.escapedText===ue.escapedName&&Pn("noEmit",t,e.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);}));}(t);var i=e.getEffectiveReturnTypeNode(t);if(Y&&!i)switch(t.kind){case 174:In(t,e.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);break;case 173:In(t,e.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);}if(i){var a=e.getFunctionFlags(t);if(1==(5&a)){var o=dd(i);if(o===rt)In(i,e.Diagnostics.A_generator_cannot_have_a_void_type_annotation);else {var s=zD(0,o,0!=(2&a))||we;tp(db(s,zD(1,o,0!=(2&a))||s,zD(2,o,0!=(2&a))||je,!!(2&a)),o,i);}}else 2==(3&a)&&function(t,r){var n=dd(r);if(K>=2){if(ro(n))return;var i=mu(!0);if(i!==bt&&!Vo(n,i))return void In(r,e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0,Ma(Px(n)||rt))}else {if(function(t){Ix(t&&e.getEntityNameFromTypeNode(t));}(r),ro(n))return;var a=e.getEntityNameFromTypeNode(r);if(void 0===a)return void In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,Ma(n));var o=Mi(a,111551,!0),s=o?Uo(o):Me;if(ro(s))return void(79===a.kind&&"Promise"===a.escapedText&&qo(n)===mu(!1)?In(r,e.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option):In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a)));var c=($t||($t=_u("PromiseConstructorLike",0,true))||mt);if(c===mt)return void In(r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value,e.entityNameToString(a));if(!tp(s,c,r,e.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value))return;var l=a&&e.getFirstIdentifier(a),u=Yn(t.locals,l.escapedText,111551);if(u)return void In(u.valueDeclaration,e.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions,e.idText(l),e.entityNameToString(a))}Ex(n,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);}(t,i);}175!==t.kind&&315!==t.kind&&zx(t);}}function ux(t){for(var r=new e.Map,n=0,i=t.members;n<i.length;n++){var a=i[n];if(165===a.kind){var o=void 0,s=a.name;switch(s.kind){case 10:case 8:o=s.text;break;case 79:o=e.idText(s);break;default:continue}r.get(o)?(In(e.getNameOfDeclaration(a.symbol.valueDeclaration),e.Diagnostics.Duplicate_identifier_0,o),In(a.name,e.Diagnostics.Duplicate_identifier_0,o)):r.set(o,!0);}}}function _x(t){if(257===t.kind){var r=$i(t);if(r.declarations&&r.declarations.length>0&&r.declarations[0]!==t)return}var n=El($i(t));if(null==n?void 0:n.declarations){for(var i=new e.Map,a=function(e){1===e.parameters.length&&e.parameters[0].type&&nm(dd(e.parameters[0].type),(function(t){var r=i.get(Bu(t));r?r.declarations.push(e):i.set(Bu(t),{type:t,declarations:[e]});}));},o=0,s=n.declarations;o<s.length;o++)a(s[o]);i.forEach((function(t){if(t.declarations.length>1)for(var r=0,n=t.declarations;r<n.length;r++)In(n[r],e.Diagnostics.Duplicate_index_signature_for_type_0,Ma(t.type));}));}}function dx(t){CT(t)||function(t){if(e.isComputedPropertyName(t.name)&&e.isBinaryExpression(t.name.expression)&&101===t.name.expression.operatorToken.kind)return YT(t.parent.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);if(e.isClassLike(t.parent)){if(e.isStringLiteral(t.name)&&"constructor"===t.name.text)return YT(t.name,e.Diagnostics.Classes_may_not_have_a_field_named_constructor);if(JT(t.name,e.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type))return !0;if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher)}else if(257===t.parent.kind){if(JT(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(t.initializer)return YT(t.initializer,e.Diagnostics.An_interface_property_cannot_have_an_initializer)}else if(e.isTypeLiteralNode(t.parent)){if(JT(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type))return !0;if(t.initializer)return YT(t.initializer,e.Diagnostics.A_type_literal_property_cannot_have_an_initializer)}if(8388608&t.flags&&KT(t),e.isPropertyDeclaration(t)&&t.exclamationToken&&(!e.isClassLike(t.parent)||!t.type||t.initializer||8388608&t.flags||e.isStatic(t)||e.hasAbstractModifier(t))){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return YT(t.exclamationToken,r)}}(t)||OT(t.name),lD(t),px(t),e.isPrivateIdentifier(t.name)&&e.hasStaticModifier(t)&&t.initializer&&99===K&&!U.useDefineForClassFields&&In(t.initializer,e.Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag),e.hasSyntacticModifier(t,128)&&166===t.kind&&t.initializer&&In(t,e.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract,e.declarationNameToString(t.name));}function px(t){if(e.isPrivateIdentifier(t.name)&&K<99){for(var r=e.getEnclosingBlockScopeContainer(t);r;r=e.getEnclosingBlockScopeContainer(r))Qn(r).flags|=67108864;if(e.isClassExpression(t.parent)){var n=zm(t.parent);n&&(Qn(t.name).flags|=524288,Qn(n).flags|=65536);}}}function fx(t){if(r){if(FT(t)||function(t){if(!(8388608&t.flags)&&181!==t.parent.kind&&257!==t.parent.kind){if(K<1)return YT(t.name,e.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher);if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(void 0===t.body&&!e.hasSyntacticModifier(t,128))return XT(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(t.body){if(e.hasSyntacticModifier(t,128))return YT(t,e.Diagnostics.An_abstract_accessor_cannot_have_an_implementation);if(181===t.parent.kind||257===t.parent.kind)return YT(t.body,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts)}if(t.typeParameters)return YT(t.name,e.Diagnostics.An_accessor_cannot_have_type_parameters);if(!function(e){return jT(e)||e.parameters.length===(171===e.kind?0:1)}(t))return YT(t.name,171===t.kind?e.Diagnostics.A_get_accessor_cannot_have_parameters:e.Diagnostics.A_set_accessor_must_have_exactly_one_parameter);if(172===t.kind){if(t.type)return YT(t.name,e.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation);var r=e.Debug.checkDefined(e.getSetAccessorValueParameter(t),"Return value does not match parameter count assertion.");if(r.dotDotDotToken)return YT(r.dotDotDotToken,e.Diagnostics.A_set_accessor_cannot_have_rest_parameter);if(r.questionToken)return YT(r.questionToken,e.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter);if(r.initializer)return YT(t.name,e.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer)}return !1}(t)||OT(t.name),Bx(t),lx(t),171===t.kind&&!(8388608&t.flags)&&e.nodeIsPresent(t.body)&&256&t.flags&&(512&t.flags||In(t.name,e.Diagnostics.A_get_accessor_must_return_a_value)),161===t.name.kind&&Ny(t.name),As(t)){var n=$i(t),i=e.getDeclarationOfKind(n,171),a=e.getDeclarationOfKind(n,172);if(i&&a&&!(1&oT(i))){Qn(i).flags|=1;var o=e.getEffectiveModifierFlags(i),s=e.getEffectiveModifierFlags(a);(128&o)!=(128&s)&&(In(i.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract),In(a.name,e.Diagnostics.Accessors_must_both_be_abstract_or_non_abstract)),(16&o&&!(24&s)||8&o&&!(8&s))&&(In(i.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter),In(a.name,e.Diagnostics.A_get_accessor_must_be_at_least_as_accessible_as_the_setter));var c=Oo(i),l=Oo(a);c&&l&&tp(c,l,i,e.Diagnostics.The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type);}}var u=Mo($i(t));171===t.kind&&vb(t,u);}hS(t.body),px(t);}function gx(t,r){return sl(e.map(t.typeArguments,dd),r,ol(r),e.isInJSFile(t))}function mx(t,r){for(var n,i,a=!0,o=0;o<r.length;o++){var s=hc(r[o]);s&&(n||(i=vd(r,n=gx(t,r))),a=a&&tp(n[o],Rd(s,i),t.typeArguments[o],e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1));}return a}function yx(t){var r=nu(t);if(!ro(r)){var n=Qn(t).resolvedSymbol;if(n)return 524288&n.flags&&Gn(n).typeParameters||(4&e.getObjectFlags(r)?r.target.localTypeParameters:void 0)}}function vx(t){AT(t,t.typeArguments),177!==t.kind||void 0===t.typeName.jsdocDotPos||e.isInJSFile(t)||e.isInJSDoc(t)||XT(t,t.typeName.jsdocDotPos,1,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments),e.forEach(t.typeArguments,hS);var n=nu(t);if(!ro(n)){if(t.typeArguments&&r){var i=yx(t);i&&mx(t,i);}var a=Qn(t).resolvedSymbol;a&&(e.some(a.declarations,(function(e){return NS(e)&&!!(134217728&e.flags)}))&&Bn(Ih(t),a.declarations,a.escapedName),32&n.flags&&8&a.flags&&In(t,e.Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals,Ma(n)));}}function hx(t,r){if(!(8388608&t.flags))return t;var n=t.objectType,i=t.indexType;if(Yd(i,c_(n,!1)))return 206===r.kind&&e.isAssignmentTarget(r)&&32&e.getObjectFlags(n)&&1&lc(n)&&In(r,e.Diagnostics.Index_signature_in_type_0_only_permits_reading,Ma(n)),t;var a=Ac(n);if(Gc(a,Ge)&&kb(i,296))return t;if(x_(n)){var o=f_(i,r);if(o){var s=nm(a,(function(e){return Jc(e,o)}));if(s&&24&e.getDeclarationModifierFlagsFromSymbol(s))return In(r,e.Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter,e.unescapeLeadingUnderscores(o)),Me}}return In(r,e.Diagnostics.Type_0_cannot_be_used_to_index_type_1,Ma(i),Ma(n)),Me}function bx(t){return (e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t))&&!!(8388608&t.flags)}function xx(t,r){var n=e.getCombinedModifierFlags(t);return 257!==t.parent.kind&&256!==t.parent.kind&&225!==t.parent.kind&&8388608&t.flags&&(2&n||e.isModuleBlock(t.parent)&&e.isModuleDeclaration(t.parent.parent)&&e.isGlobalScopeAugmentation(t.parent.parent)||(n|=1),n|=2),n&r}function Dx(t){if(r){var i,a,o,s=0,c=155,l=!1,u=!0,_=!1,d=t.declarations,p=0!=(16384&t.flags),f=!1,g=!1,m=!1,y=[];if(d)for(var v=0,h=d;v<h.length;v++){var b=h[v],x=8388608&b.flags,D=b.parent&&(257===b.parent.kind||181===b.parent.kind)||x;if(D&&(o=void 0),256!==b.kind&&225!==b.kind||x||(m=!0),255===b.kind||168===b.kind||167===b.kind||170===b.kind){y.push(b);var S=xx(b,155);s|=S,c&=S,l=l||e.hasQuestionToken(b),u=u&&e.hasQuestionToken(b);var T=e.nodeIsPresent(b.body);T&&i?p?g=!0:f=!0:(null==o?void 0:o.parent)===b.parent&&o.end!==b.pos&&R(o),T?i||(i=b):_=!0,o=b,D||(a=b);}}if(g&&e.forEach(y,(function(t){In(t,e.Diagnostics.Multiple_constructor_implementations_are_not_allowed);})),f&&e.forEach(y,(function(t){In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Duplicate_function_implementation);})),m&&!p&&16&t.flags&&d){var C=e.filter(d,(function(e){return 256===e.kind})).map((function(t){return e.createDiagnosticForNode(t,e.Diagnostics.Consider_adding_a_declare_modifier_to_this_class)}));e.forEach(d,(function(r){var i=256===r.kind?e.Diagnostics.Class_declaration_cannot_implement_overload_list_for_0:255===r.kind?e.Diagnostics.Function_with_bodies_can_only_merge_with_classes_that_are_ambient:void 0;i&&e.addRelatedInfo.apply(void 0,n$3([In(e.getNameOfDeclaration(r)||r,i,e.symbolName(t))],C,!1));}));}if(!a||a.body||e.hasSyntacticModifier(a,128)||a.questionToken||R(a),_&&(d&&(function(t,r,n,i,a){if(0!=(i^a)){var o=xx(L(t,r),155);e.forEach(t,(function(t){var r=xx(t,155)^o;1&r?In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported):2&r?In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient):24&r?In(e.getNameOfDeclaration(t)||t,e.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected):128&r&&In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);}));}}(d,i,0,s,c),function(t,r,n,i){if(n!==i){var a=e.hasQuestionToken(L(t,r));e.forEach(t,(function(t){e.hasQuestionToken(t)!==a&&In(e.getNameOfDeclaration(t),e.Diagnostics.Overload_signatures_must_all_be_optional_or_required);}));}}(d,i,l,u)),i))for(var E=_l(t),k=cl(i),N=0,F=E;N<F.length;N++){var A=F[N];if(P=A,w=void 0,I=void 0,O=void 0,M=void 0,w=Sl(k),I=Sl(P),O=ml(w),(M=ml(I))!==rt&&!hp(M,O,Dn)&&!hp(O,M,Dn)||0===dp(w,I,4,!1,void 0,void 0,Gd,void 0)){e.addRelatedInfo(In(A.declaration,e.Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),e.createDiagnosticForNode(i,e.Diagnostics.The_implementation_signature_is_declared_here));break}}}var P,w,I,O,M;function L(e,t){return void 0!==t&&t.parent===e[0].parent?t:e[0]}function R(t){if(!t.name||!e.nodeIsMissing(t.name)){var r=!1,n=e.forEachChild(t.parent,(function(e){if(r)return e;r=e===t;}));if(n&&n.pos===t.end&&n.kind===t.kind){var i=n.name||n,a=n.name;if(t.name&&a&&(e.isPrivateIdentifier(t.name)&&e.isPrivateIdentifier(a)&&t.name.escapedText===a.escapedText||e.isComputedPropertyName(t.name)&&e.isComputedPropertyName(a)||e.isPropertyNameLiteral(t.name)&&e.isPropertyNameLiteral(a)&&e.getEscapedTextOfIdentifierOrLiteral(t.name)===e.getEscapedTextOfIdentifierOrLiteral(a)))return void(168!==t.kind&&167!==t.kind||e.isStatic(t)===e.isStatic(n)||In(i,e.isStatic(t)?e.Diagnostics.Function_overload_must_be_static:e.Diagnostics.Function_overload_must_not_be_static));if(e.nodeIsPresent(n.body))return void In(i,e.Diagnostics.Function_implementation_name_must_be_0,e.declarationNameToString(t.name))}var o=t.name||t;p?In(o,e.Diagnostics.Constructor_implementation_is_missing):e.hasSyntacticModifier(t,128)?In(o,e.Diagnostics.All_declarations_of_an_abstract_method_must_be_consecutive):In(o,e.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);}}}function Sx(t){if(r){var n=t.localSymbol;if((n||(n=$i(t)).exportSymbol)&&e.getDeclarationOfKind(n,t.kind)===t){for(var i=0,a=0,o=0,s=0,c=n.declarations;s<c.length;s++){var l=y(g=c[s]),u=xx(g,513);1&u?512&u?o|=l:i|=l:a|=l;}var _=i&a,d=o&(i|a);if(_||d)for(var p=0,f=n.declarations;p<f.length;p++){l=y(g=f[p]);var g,m=e.getNameOfDeclaration(g);l&d?In(m,e.Diagnostics.Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead,e.declarationNameToString(m)):l&_&&In(m,e.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local,e.declarationNameToString(m));}}}function y(t){var r=t;switch(r.kind){case 257:case 258:case 343:case 336:case 337:return 2;case 260:return e.isAmbientModule(r)||0!==e.getModuleInstanceState(r)?5:4;case 256:case 259:case 297:return 3;case 303:return 7;case 270:case 220:var n=r,i=e.isExportAssignment(n)?n.expression:n.right;if(!e.isEntityNameExpression(i))return 1;r=i;case 264:case 267:case 266:var a=0,o=ki($i(r));return e.forEach(o.declarations,(function(e){a|=y(e);})),a;case 253:case 202:case 255:case 269:case 79:return 1;default:return e.Debug.failBadSyntaxKind(r)}}}function Tx(e,t,r,n){var i=Cx(e,t);return i&&Ax(i,t,r,n)}function Cx(t,r){if(!to(t)){var n=t;if(n.promisedTypeOfPromise)return n.promisedTypeOfPromise;if(Vo(t,mu(!1)))return n.promisedTypeOfPromise=zl(t)[0];if(!Nb(t,262140)){var i=eo(t,"then");if(!to(i)){var a=i?Uc(i,0):e.emptyArray;if(0!==a.length){var o=Jg(qu(e.map(a,nb)),2097152);if(!to(o)){var s=Uc(o,0);if(0!==s.length)return n.promisedTypeOfPromise=qu(e.map(s,nb),2);r&&In(r,e.Diagnostics.The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback);}}else r&&In(r,e.Diagnostics.A_promise_must_have_a_then_method);}}}}function Ex(e,t,r,n,i){return (t?Ax(e,r,n,i):Px(e,r,n,i))||Me}function kx(e){if(Nb(e,262140))return !1;var t=eo(e,"then");return !!t&&Uc(Jg(t,2097152),0).length>0}function Nx(e){var t;if(16777216&e.flags){var r=xu(!1);return !!r&&e.aliasSymbol===r&&1===(null===(t=e.aliasTypeArguments)||void 0===t?void 0:t.length)}return !1}function Fx(e){return 1048576&e.flags?lm(e,Fx):Nx(e)?e.aliasTypeArguments[0]:e}function Ax(t,r,n,i){var a=Px(t,r,n,i);return a&&function(t){if(to(t))return t;if(Nx(t))return t;if(x_(t)){var r=Tc(t);if(!r||3&r.flags||fp(r)||kx(r)){var n=xu(!0);if(n)return Vl(n,[Fx(t)])}}return e.Debug.assert(void 0===Cx(t),"type provided should not be a non-generic 'promise'-like."),t}(a)}function Px(t,r,n,i){if(to(t))return t;if(Nx(t))return t;var a=t;if(a.awaitedTypeOfType)return a.awaitedTypeOfType;if(1048576&t.flags){var o=r?function(e){return Px(e,r,n,i)}:Px;return a.awaitedTypeOfType=lm(t,o)}var s=Cx(t);if(s){if(t.id===s.id||gn.lastIndexOf(s.id)>=0)return void(r&&In(r,e.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method));gn.push(t.id);var c=Px(s,r,n,i);if(gn.pop(),!c)return;return a.awaitedTypeOfType=c}if(!kx(t))return a.awaitedTypeOfType=t;r&&(e.Debug.assertIsDefined(n),In(r,n,i));}function wx(t){var r=Nh(t);wh(r,t);var n=ml(r);if(!(1&n.flags)){var i,a,o=Th(t);switch(t.parent.kind){case 256:i=qu([Uo($i(t.parent)),rt]);break;case 163:i=rt,a=e.chainDiagnosticMessages(void 0,e.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);break;case 166:i=rt,a=e.chainDiagnosticMessages(void 0,e.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);break;case 168:case 171:case 172:i=qu([Su(LS(t.parent)),rt]);break;default:return e.Debug.fail()}tp(n,i,t,o,(function(){return a}));}}function Ix(t){if(t){var r=e.getFirstIdentifier(t),n=2097152|(79===t.kind?788968:1920),i=ei(r,r.escapedText,n,void 0,void 0,!0);i&&2097152&i.flags&&oa(i)&&!$S(ki(i))&&!Ai(i)&&wi(i);}}function Ox(t){var r=Mx(t);r&&e.isEntityName(r)&&Ix(r);}function Mx(e){if(e)switch(e.kind){case 187:case 186:return Lx(e.types);case 188:return Lx([e.trueType,e.falseType]);case 190:case 196:return Mx(e.type);case 177:return e.typeName}}function Lx(t){for(var r,n=0,i=t;n<i.length;n++){for(var a=i[n];190===a.kind||196===a.kind;)a=a.type;if(143!==a.kind&&(H||(195!==a.kind||104!==a.literal.kind)&&152!==a.kind)){var o=Mx(a);if(!o)return;if(r){if(!e.isIdentifier(r)||!e.isIdentifier(o)||r.escapedText!==o.escapedText)return}else r=o;}}return r}function Rx(t){var r=e.getEffectiveTypeAnnotationNode(t);return e.isRestParameter(t)?e.getRestParameterElementType(r):r}function Bx(t){if(t.decorators&&e.nodeCanBeDecorated(t,t.parent,t.parent.parent)){U.experimentalDecorators||In(t,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning);var r=t.decorators[0];if(ST(r,8),163===t.kind&&ST(r,32),U.emitDecoratorMetadata)switch(ST(r,16),t.kind){case 256:var n=e.getFirstConstructorWithBody(t);if(n)for(var i=0,a=n.parameters;i<a.length;i++)Ox(Rx(a[i]));break;case 171:case 172:var o=171===t.kind?172:171,s=e.getDeclarationOfKind($i(t),o);Ox(Io(t)||s&&Io(s));break;case 168:for(var c=0,l=t.parameters;c<l.length;c++)Ox(Rx(l[c]));Ox(e.getEffectiveReturnTypeNode(t));break;case 166:Ox(e.getEffectiveTypeAnnotationNode(t));break;case 163:Ox(Rx(t));for(var u=0,_=t.parent.parameters;u<_.length;u++)Ox(Rx(_[u]));}e.forEach(t.decorators,wx);}}function jx(e){switch(e.kind){case 79:return e;case 205:return e.name;default:return}}function Jx(t){var n;Bx(t),lx(t);var i=e.getFunctionFlags(t);if(t.name&&161===t.name.kind&&Ny(t.name),As(t)){var a=$i(t),o=t.localSymbol||a,s=null===(n=o.declarations)||void 0===n?void 0:n.find((function(e){return e.kind===t.kind&&!(131072&e.flags)}));t===s&&Dx(o),a.parent&&Dx(a);}var c=167===t.kind?void 0:t.body;if(hS(c),vb(t,yl(t)),r&&!e.getEffectiveReturnTypeNode(t)&&(e.nodeIsMissing(c)&&!bx(t)&&Uf(t,we),1&i&&e.nodeIsPresent(c)&&ml(cl(t))),e.isInJSFile(t)){var l=e.getJSDocTypeTag(t);l&&l.typeExpression&&!by(dd(l.typeExpression),t)&&In(l.typeExpression.type,e.Diagnostics.The_type_of_a_function_declaration_must_match_the_function_s_signature);}}function zx(t){if(r){var n=e.getSourceFileOfNode(t),i=Jr.get(n.path);i||(i=[],Jr.set(n.path,i)),i.push(t);}}function Ux(t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n];switch(a.kind){case 256:case 225:qx(a,r),Hx(a,r);break;case 303:case 260:case 234:case 262:case 241:case 242:case 243:Zx(a,r);break;case 170:case 212:case 255:case 213:case 168:case 171:case 172:a.body&&Zx(a,r),Hx(a,r);break;case 167:case 173:case 174:case 178:case 179:case 258:case 257:Hx(a,r);break;case 189:Wx(a,r);break;default:e.Debug.assertNever(a,"Node should not have been registered for unused identifiers check");}}}function Kx(t,r,n){var i=e.getNameOfDeclaration(t)||t,a=NS(t)?e.Diagnostics._0_is_declared_but_never_used:e.Diagnostics._0_is_declared_but_its_value_is_never_read;n(t,0,e.createDiagnosticForNode(i,a,r));}function Vx(t){return e.isIdentifier(t)&&95===e.idText(t).charCodeAt(0)}function qx(t,r){for(var n=0,i=t.members;n<i.length;n++){var a=i[n];switch(a.kind){case 168:case 166:case 171:case 172:if(172===a.kind&&32768&a.symbol.flags)break;var o=$i(a);o.isReferenced||!(e.hasEffectiveModifier(a,8)||e.isNamedDeclaration(a)&&e.isPrivateIdentifier(a.name))||8388608&a.flags||r(a,0,e.createDiagnosticForNode(a.name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,Ia(o)));break;case 170:for(var s=0,c=a.parameters;s<c.length;s++){var l=c[s];!l.symbol.isReferenced&&e.hasSyntacticModifier(l,8)&&r(l,0,e.createDiagnosticForNode(l.name,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read,e.symbolName(l.symbol)));}break;case 175:case 233:case 169:break;default:e.Debug.fail("Unexpected class member");}}}function Wx(t,r){var n=t.typeParameter;Gx(n)&&r(t,1,e.createDiagnosticForNode(t,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(n.name)));}function Hx(t,r){var n=$i(t).declarations;if(n&&e.last(n)===t)for(var i=e.getEffectiveTypeParameterDeclarations(t),a=new e.Set,o=0,s=i;o<s.length;o++){var c=s[o];if(Gx(c)){var l=e.idText(c.name),u=c.parent;if(189!==u.kind&&u.typeParameters.every(Gx)){if(e.tryAddToSet(a,u)){var _=e.getSourceFileOfNode(u),d=e.isJSDocTemplateTag(u)?e.rangeOfNode(u):e.rangeOfTypeParameters(_,u.typeParameters),p=1===u.typeParameters.length,f=p?e.Diagnostics._0_is_declared_but_its_value_is_never_read:e.Diagnostics.All_type_parameters_are_unused,g=p?l:void 0;r(c,1,e.createFileDiagnostic(_,d.pos,d.end-d.pos,f,g));}}else r(c,1,e.createDiagnosticForNode(c,e.Diagnostics._0_is_declared_but_its_value_is_never_read,l));}}}function Gx(e){return !(262144&Zi(e.symbol).isReferenced||Vx(e.name))}function Qx(e,t,r,n){var i=String(n(t)),a=e.get(i);a?a[1].push(r):e.set(i,[t,[r]]);}function Xx(t){return e.tryCast(e.getRootDeclaration(t),e.isParameter)}function Yx(t){return e.isBindingElement(t)?e.isObjectBindingPattern(t.parent)?!(!t.propertyName||!Vx(t.name)):Vx(t.name):e.isAmbientModule(t)||(e.isVariableDeclaration(t)&&e.isForInOrOfStatement(t.parent.parent)||eD(t))&&Vx(t.name)}function Zx(t,r){var n=new e.Map,i=new e.Map,a=new e.Map;t.locals.forEach((function(t){var o;if(!(262144&t.flags?!(3&t.flags)||3&t.isReferenced:t.isReferenced||t.exportSymbol)&&t.declarations)for(var s=0,c=t.declarations;s<c.length;s++){var l=c[s];if(!Yx(l))if(eD(l))Qx(n,266===(o=l).kind?o:267===o.kind?o.parent:o.parent.parent,l,O);else if(e.isBindingElement(l)&&e.isObjectBindingPattern(l.parent))l!==e.last(l.parent.elements)&&e.last(l.parent.elements).dotDotDotToken||Qx(i,l.parent,l,O);else if(e.isVariableDeclaration(l))Qx(a,l.parent,l,O);else {var u=t.valueDeclaration&&Xx(t.valueDeclaration),_=t.valueDeclaration&&e.getNameOfDeclaration(t.valueDeclaration);u&&_?e.isParameterPropertyDeclaration(u,u.parent)||e.parameterIsThisKeyword(u)||Vx(_)||(e.isBindingElement(l)&&e.isArrayBindingPattern(l.parent)?Qx(i,l.parent,l,O):r(u,1,e.createDiagnosticForNode(_,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.symbolName(t)))):Kx(l,e.symbolName(t),r);}}})),n.forEach((function(t){var n=t[0],i=t[1],a=n.parent;if((n.name?1:0)+(n.namedBindings?267===n.namedBindings.kind?1:n.namedBindings.elements.length:0)===i.length)r(a,0,1===i.length?e.createDiagnosticForNode(a,e.Diagnostics._0_is_declared_but_its_value_is_never_read,e.idText(e.first(i).name)):e.createDiagnosticForNode(a,e.Diagnostics.All_imports_in_import_declaration_are_unused));else for(var o=0,s=i;o<s.length;o++){var c=s[o];Kx(c,e.idText(c.name),r);}})),i.forEach((function(t){var n=t[0],i=t[1],o=Xx(n.parent)?1:0;if(n.elements.length===i.length)1===i.length&&253===n.parent.kind&&254===n.parent.parent.kind?Qx(a,n.parent.parent,n.parent,O):r(n,o,1===i.length?e.createDiagnosticForNode(n,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(e.first(i).name)):e.createDiagnosticForNode(n,e.Diagnostics.All_destructured_elements_are_unused));else for(var s=0,c=i;s<c.length;s++){var l=c[s];r(l,o,e.createDiagnosticForNode(l,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(l.name)));}})),a.forEach((function(t){var n=t[0],i=t[1];if(n.declarations.length===i.length)r(n,0,1===i.length?e.createDiagnosticForNode(e.first(i).name,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(e.first(i).name)):e.createDiagnosticForNode(236===n.parent.kind?n.parent:n,e.Diagnostics.All_variables_are_unused));else for(var a=0,o=i;a<o.length;a++){var s=o[a];r(s,0,e.createDiagnosticForNode(s,e.Diagnostics._0_is_declared_but_its_value_is_never_read,$x(s.name)));}}));}function $x(t){switch(t.kind){case 79:return e.idText(t);case 201:case 200:return $x(e.cast(e.first(t.elements),e.isBindingElement).name);default:return e.Debug.assertNever(t)}}function eD(e){return 266===e.kind||269===e.kind||267===e.kind}function tD(t){if(234===t.kind&&$T(t),e.isFunctionOrModuleBlock(t)){var r=Vr;e.forEach(t.statements,hS),Vr=r;}else e.forEach(t.statements,hS);t.locals&&zx(t);}function rD(t,r,n){if((null==r?void 0:r.escapedText)!==n)return !1;if(166===t.kind||165===t.kind||168===t.kind||167===t.kind||171===t.kind||172===t.kind||294===t.kind)return !1;if(8388608&t.flags)return !1;if((e.isImportClause(t)||e.isImportEqualsDeclaration(t)||e.isImportSpecifier(t))&&e.isTypeOnlyImportOrExportDeclaration(t))return !1;var i=e.getRootDeclaration(t);return !e.isParameter(i)||!e.nodeIsMissing(i.parent.body)}function nD(t){e.findAncestor(t,(function(r){return !!(4&oT(r))&&(79!==t.kind?In(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference):In(t,e.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference),!0)}));}function iD(t){e.findAncestor(t,(function(r){return !!(8&oT(r))&&(79!==t.kind?In(e.getNameOfDeclaration(t),e.Diagnostics.Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference):In(t,e.Diagnostics.Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference),!0)}));}function aD(t){67108864&oT(e.getEnclosingBlockScopeContainer(t))&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name)&&"string"==typeof t.name.escapedText,"The target of a WeakMap/WeakSet collision check should be an identifier"),Pn("noEmit",t,e.Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel,t.name.escapedText));}function oD(t){var r=!1;if(e.isClassExpression(t)){for(var n=0,i=t.members;n<i.length;n++)if(134217728&oT(i[n])){r=!0;break}}else if(e.isFunctionExpression(t))134217728&oT(t)&&(r=!0);else {var a=e.getEnclosingBlockScopeContainer(t);a&&134217728&oT(a)&&(r=!0);}r&&(e.Debug.assert(e.isNamedDeclaration(t)&&e.isIdentifier(t.name),"The target of a Reflect collision check should be an identifier"),Pn("noEmit",t,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers,e.declarationNameToString(t.name),"Reflect"));}function sD(t,r){r&&(function(t,r){if((!(V>=e.ModuleKind.ES2015)||V>=e.ModuleKind.Node12&&e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&r&&(rD(t,r,"require")||rD(t,r,"exports"))&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=$a(t);303===n.kind&&e.isExternalOrCommonJsModule(n)&&Pn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(t,r){if(r&&!(K>=4)&&rD(t,r,"Promise")&&(!e.isModuleDeclaration(t)||1===e.getModuleInstanceState(t))){var n=$a(t);303===n.kind&&e.isExternalOrCommonJsModule(n)&&2048&n.flags&&Pn("noEmit",r,e.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions,e.declarationNameToString(r),e.declarationNameToString(r));}}(t,r),function(e,t){K<=8&&(rD(e,t,"WeakMap")||rD(e,t,"WeakSet"))&&pn.push(e);}(t,r),function(e,t){t&&K>=2&&K<=8&&rD(e,t,"Reflect")&&fn.push(e);}(t,r),e.isClassLike(t)?(GD(r,e.Diagnostics.Class_name_cannot_be_0),8388608&t.flags||function(t){K>=1&&"Object"===t.escapedText&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&In(t,e.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0,e.ModuleKind[V]);}(r)):e.isEnumDeclaration(t)&&GD(r,e.Diagnostics.Enum_name_cannot_be_0));}function cD(e){return e===Ie?we:e===Kt?Ut:e}function lD(t){var r;if(Bx(t),e.isBindingElement(t)||hS(t.type),t.name){if(161===t.name.kind&&(Ny(t.name),t.initializer&&zb(t.initializer)),e.isBindingElement(t)){e.isObjectBindingPattern(t.parent)&&t.dotDotDotToken&&K<5&&ST(t,4),t.propertyName&&161===t.propertyName.kind&&Ny(t.propertyName);var n=t.parent.parent,i=no(n),a=t.propertyName||t.name;if(i&&!e.isBindingPattern(a)){var o=i_(a);if(Es(o)){var s=Jc(i,Ps(o));s&&(Iv(s,void 0,!1),tv(t,!!n.initializer&&106===n.initializer.kind,!1,i,s));}}}if(e.isBindingPattern(t.name)&&(201===t.name.kind&&K<2&&U.downlevelIteration&&ST(t,512),e.forEach(t.name.elements,hS)),t.initializer&&e.isParameterDeclaration(t)&&e.nodeIsMissing(e.getContainingFunction(t).body))In(t,e.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);else if(e.isBindingPattern(t.name)){var c=t.initializer&&242!==t.parent.parent.kind,l=0===t.name.elements.length;if(c||l){var u=Fo(t);if(c){var _=zb(t.initializer);H&&l?_v(_,t):rp(_,Fo(t),t,t.initializer);}l&&(e.isArrayBindingPattern(t.name)?hD(65,u,ze,t):H&&_v(u,t));}}else {var d=$i(t);if(2097152&d.flags&&e.isRequireVariableDeclaration(t))uS(t);else {var p=cD(Uo(d));if(t===d.valueDeclaration){var f=e.getEffectiveInitializer(t);f&&(e.isInJSFile(t)&&e.isObjectLiteralExpression(f)&&(0===f.properties.length||e.isPrototypeAccess(t.name))&&(null===(r=d.exports)||void 0===r?void 0:r.size)||242===t.parent.parent.kind||rp(zb(f),p,t,f,void 0)),d.declarations&&d.declarations.length>1&&e.some(d.declarations,(function(r){return r!==t&&e.isVariableLike(r)&&!_D(r,t)}))&&In(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}else {var g=cD(Fo(t));ro(p)||ro(g)||Wd(p,g)||67108864&d.flags||uD(d.valueDeclaration,p,t,g),t.initializer&&rp(zb(t.initializer),g,t,t.initializer,void 0),d.valueDeclaration&&!_D(t,d.valueDeclaration)&&In(t.name,e.Diagnostics.All_declarations_of_0_must_have_identical_modifiers,e.declarationNameToString(t.name));}166!==t.kind&&165!==t.kind&&(Sx(t),253!==t.kind&&202!==t.kind||function(t){if(0==(3&e.getCombinedNodeFlags(t))&&!e.isParameterDeclaration(t)&&(253!==t.kind||t.initializer)){var r=$i(t);if(1&r.flags){if(!e.isIdentifier(t.name))return e.Debug.fail();var n=ei(t,t.name.escapedText,3,void 0,void 0,!1);if(n&&n!==r&&2&n.flags&&3&$y(n)){var i=e.getAncestor(n.valueDeclaration,254),a=236===i.parent.kind&&i.parent.parent?i.parent.parent:void 0;if(!a||!(234===a.kind&&e.isFunctionLike(a.parent)||261===a.kind||260===a.kind||303===a.kind)){var o=Ia(n);In(t,e.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1,o,o);}}}}}(t),sD(t,t.name));}}}}function uD(t,r,n,i){var a=e.getNameOfDeclaration(n),o=166===n.kind||165===n.kind?e.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2:e.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2,s=e.declarationNameToString(a),c=In(a,o,s,Ma(r),Ma(i));t&&e.addRelatedInfo(c,e.createDiagnosticForNode(t,e.Diagnostics._0_was_also_declared_here,s));}function _D(t,r){return 163===t.kind&&253===r.kind||253===t.kind&&163===r.kind||e.hasQuestionToken(t)===e.hasQuestionToken(r)&&e.getSelectedEffectiveModifierFlags(t,504)===e.getSelectedEffectiveModifierFlags(r,504)}function dD(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkVariableDeclaration",{kind:t.kind,pos:t.pos,end:t.end}),function(t){if(242!==t.parent.parent.kind&&243!==t.parent.parent.kind)if(8388608&t.flags)KT(t);else if(!t.initializer){if(e.isBindingPattern(t.name)&&!e.isBindingPattern(t.parent))return YT(t,e.Diagnostics.A_destructuring_declaration_must_have_an_initializer);if(e.isVarConst(t))return YT(t,e.Diagnostics.const_declarations_must_be_initialized)}if(t.exclamationToken&&(236!==t.parent.parent.kind||!t.type||t.initializer||8388608&t.flags)){var r=t.initializer?e.Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions:t.type?e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context:e.Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations;return YT(t.exclamationToken,r)}!(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)||V===e.ModuleKind.System||8388608&t.parent.parent.flags||!e.hasSyntacticModifier(t.parent.parent,1)||VT(t.name),(e.isLet(t)||e.isVarConst(t))&&qT(t.name);}(t),lD(t),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function pD(t){CT(t)||WT(t.declarationList)||function(t){if(!HT(t.parent)){if(e.isLet(t.declarationList))return YT(t,e.Diagnostics.let_declarations_can_only_be_declared_inside_a_block);e.isVarConst(t.declarationList)&&YT(t,e.Diagnostics.const_declarations_can_only_be_declared_inside_a_block);}}(t),e.forEach(t.declarationList.declarations,hS);}function fD(t,r,n){if(H&&!vf(r)){var i=e.isBinaryExpression(t)?t.right:t;if(!e.isPropertyAccessExpression(i)||!Ub(i.expression)){var a=e.isIdentifier(i)?i:e.isPropertyAccessExpression(i)?i.name:e.isBinaryExpression(i)&&e.isIdentifier(i.right)?i.right:void 0,o=Uc(r,0),s=!!Tx(r);if(0!==o.length||s){var c=a&&MS(a);(c||s)&&(c&&e.isBinaryExpression(t.parent)&&function(t,r){for(;e.isBinaryExpression(t)&&55===t.operatorToken.kind;){if(e.forEachChild(t.right,(function t(n){if(e.isIdentifier(n)){var i=MS(n);if(i&&i===r)return !0}return e.forEachChild(n,t)})))return !0;t=t.parent;}return !1}(t.parent,c)||c&&n&&function(t,r,n,i){return !!e.forEachChild(r,(function r(a){if(e.isIdentifier(a)){var o=MS(a);if(o&&o===i){if(e.isIdentifier(t))return !0;for(var s=n.parent,c=a.parent;s&&c;){if(e.isIdentifier(s)&&e.isIdentifier(c)||108===s.kind&&108===c.kind)return MS(s)===MS(c);if(e.isPropertyAccessExpression(s)&&e.isPropertyAccessExpression(c)){if(MS(s.name)!==MS(c.name))return !1;c=c.expression,s=s.expression;}else {if(!e.isCallExpression(s)||!e.isCallExpression(c))return !1;c=c.expression,s=s.expression;}}}}return e.forEachChild(a,r)}))}(t,n,a,c)||(s?Ln(i,!0,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined,Ra(r)):In(i,e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead)));}}}}function gD(t,r){return 16384&t.flags&&In(r,e.Diagnostics.An_expression_of_type_void_cannot_be_tested_for_truthiness),t}function mD(e,t){return gD(ax(e,t),e)}function yD(e){var t=e.initializer;t.declarations.length>=1&&dD(t.declarations[0]);}function vD(e){return hD(e.awaitModifier?15:13,iv(e.expression),ze,e.expression)}function hD(e,t,r,n){return to(t)?t:bD(e,t,r,n,!0)||we}function bD(t,r,n,i,a){var o=0!=(2&t);if(r!==nt){var s=K>=2,c=!s&&U.downlevelIteration,l=U.noUncheckedIndexedAccess&&!!(128&t);if(s||c||o){var u=ED(r,t,s?i:void 0);if(a&&u){var _=8&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0:32&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0:64&t?e.Diagnostics.Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0:16&t?e.Diagnostics.Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0:void 0;_&&tp(n,u.nextType,i,_);}if(u||s)return l?Vg(u&&u.yieldType):u&&u.yieldType}var d=r,p=!1,f=!1;if(4&t){if(1048576&d.flags){var g=r.types,m=e.filter(g,(function(e){return !(402653316&e.flags)}));m!==g&&(d=qu(m,2));}else 402653316&d.flags&&(d=nt);if((f=d!==r)&&(K<1&&i&&(In(i,e.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher),p=!0),131072&d.flags))return l?Vg(He):He}if(!Qp(d)){if(i&&!p){var y=function(n,i){var a;return i?n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:[e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator,!0]:xD(t,0,r,void 0)?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators,!1]:function(e){switch(e){case"Float32Array":case"Float64Array":case"Int16Array":case"Int32Array":case"Int8Array":case"NodeList":case"Uint16Array":case"Uint32Array":case"Uint8Array":case"Uint8ClampedArray":return !0}return !1}(null===(a=r.symbol)||void 0===a?void 0:a.escapedName)?[e.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher,!0]:n?[e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type,!0]:[e.Diagnostics.Type_0_is_not_an_array_type,!0]}(!!(4&t)&&!f,c),v=y[0];Ln(i,y[1]&&!!Tx(d),v,Ma(d));}return f?l?Vg(He):He:void 0}var h=Qc(d,Ge);return f&&h?402653316&h.flags&&!U.noUncheckedIndexedAccess?He:qu(l?[h,He,ze]:[h,He],2):128&t?Vg(h):h}ID(i,r,o);}function xD(e,t,r,n){if(!to(r)){var i=ED(r,e,n);return i&&i[j(t)]}}function DD(e,t,r){if(void 0===e&&(e=nt),void 0===t&&(t=nt),void 0===r&&(r=je),67359327&e.flags&&180227&t.flags&&180227&r.flags){var n=Ml([e,t,r]),i=Pr.get(n);return i||(i={yieldType:e,returnType:t,nextType:r},Pr.set(n,i)),i}return {yieldType:e,returnType:t,nextType:r}}function SD(t){for(var r,n,i,a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s&&s!==wr){if(s===Ir)return Ir;r=e.append(r,s.yieldType),n=e.append(n,s.returnType),i=e.append(i,s.nextType);}}return r||n||i?DD(r&&qu(r),n&&qu(n),i&&$u(i)):wr}function TD(e,t){return e[t]}function CD(e,t,r){return e[t]=r}function ED(t,r,n){if(to(t))return Ir;if(!(1048576&t.flags)){var i=ND(t,r,n);return i===wr?void(n&&ID(n,t,!!(2&r))):i}var a,o=2&r?"iterationTypesOfAsyncIterable":"iterationTypesOfIterable",s=TD(t,o);if(s)return s===wr?void 0:s;for(var c=0,l=t.types;c<l.length;c++){var u=ND(l[c],r,n);if(u===wr)return n&&ID(n,t,!!(2&r)),void CD(t,o,wr);a=e.append(a,u);}var _=a?SD(a):wr;return CD(t,o,_),_===wr?void 0:_}function kD(e,t){if(e===wr)return wr;if(e===Ir)return Ir;var r=e.yieldType,n=e.returnType,i=e.nextType;return t&&xu(!0),DD(Ax(r,t)||we,Ax(n,t)||we,i)}function ND(e,t,r){if(to(e))return Ir;var n;if(2&t&&(n=FD(e,Lr)||PD(e,Lr)))return 8&t?kD(n,r):n;if(1&t&&(n=FD(e,Rr)||PD(e,Rr))){if(!(2&t))return n;if(n!==wr)return CD(e,"iterationTypesOfAsyncIterable",kD(n,r))}return 2&t&&(n=wD(e,Lr,r))!==wr?n:1&t&&(n=wD(e,Rr,r))!==wr?2&t?CD(e,"iterationTypesOfAsyncIterable",n?kD(n,r):wr):n:wr}function FD(e,t){return TD(e,t.iterableCacheKey)}function AD(e,t){var r=FD(e,t)||wD(e,t,void 0);return r===wr?Mr:r}function PD(e,t){var r;if(Vo(e,r=t.getGlobalIterableType(!1))||Vo(e,r=t.getGlobalIterableIteratorType(!1))){var n=zl(e)[0],i=AD(r,t),a=i.returnType,o=i.nextType;return CD(e,t.iterableCacheKey,DD(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}if(Vo(e,t.getGlobalGeneratorType(!1))){var s=zl(e);return n=s[0],a=s[1],o=s[2],CD(e,t.iterableCacheKey,DD(t.resolveIterationType(n,void 0)||n,t.resolveIterationType(a,void 0)||a,o))}}function wD(t,r,n){var i,a,o,s,c=Jc(t,(a=r.iteratorSymbolName,(s=(o=fu(!1))&&eo(Uo(o),e.escapeLeadingUnderscores(a)))&&Es(s)?Ps(s):"__@".concat(a))),l=!c||16777216&c.flags?void 0:Uo(c);if(to(l))return CD(t,r.iterableCacheKey,Ir);var u=l?Uc(l,0):void 0;if(!e.some(u))return CD(t,r.iterableCacheKey,wr);var _=null!==(i=OD($u(e.map(u,ml)),r,n))&&void 0!==i?i:wr;return CD(t,r.iterableCacheKey,_)}function ID(t,r,n){var i=n?e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator:e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;Ln(t,!!Tx(r),i,Ma(r));}function OD(e,t,r){if(to(e))return Ir;var n=MD(e,t)||function(e,t){var r=t.getGlobalIterableIteratorType(!1);if(Vo(e,r)){var n=zl(e)[0],i=MD(r,t)||JD(r,t,void 0),a=i===wr?Mr:i,o=a.returnType,s=a.nextType;return CD(e,t.iteratorCacheKey,DD(n,o,s))}if(Vo(e,t.getGlobalIteratorType(!1))||Vo(e,t.getGlobalGeneratorType(!1))){var c=zl(e);return n=c[0],o=c[1],s=c[2],CD(e,t.iteratorCacheKey,DD(n,o,s))}}(e,t)||JD(e,t,r);return n===wr?void 0:n}function MD(e,t){return TD(e,t.iteratorCacheKey)}function LD(e,t){var r=eo(e,"done")||Xe;return Yd(0===t?Xe:Ze,r)}function RD(e){return LD(e,0)}function BD(e){return LD(e,1)}function jD(t,r,n,i){var a,o,s,c,l=Jc(t,n);if(l||"next"===n){var u=!l||"next"===n&&16777216&l.flags?void 0:"next"===n?Uo(l):Jg(Uo(l),2097152);if(to(u))return "next"===n?Ir:Or;var _,d,p,f,g,m=u?Uc(u,0):e.emptyArray;if(0===m.length)return i&&In(i,"next"===n?r.mustHaveANextMethodDiagnostic:r.mustBeAMethodDiagnostic,n),"next"===n?Ir:void 0;if((null==u?void 0:u.symbol)&&1===m.length){var y=r.getGlobalGeneratorType(!1),v=r.getGlobalIteratorType(!1),h=(null===(o=null===(a=y.symbol)||void 0===a?void 0:a.members)||void 0===o?void 0:o.get(n))===u.symbol,b=!h&&(null===(c=null===(s=v.symbol)||void 0===s?void 0:s.members)||void 0===c?void 0:c.get(n))===u.symbol;if(h||b){var x=h?y:v,D=u.mapper;return DD(hd(x.typeParameters[0],D),hd(x.typeParameters[1],D),"next"===n?hd(x.typeParameters[2],D):void 0)}}for(var S=0,T=m;S<T.length;S++){var C=T[S];"throw"!==n&&e.some(C.parameters)&&(_=e.append(_,Qh(C,0))),d=e.append(d,ml(C));}if("throw"!==n){var E=_?qu(_):je;if("next"===n)f=E;else if("return"===n){var k=r.resolveIterationType(E,i)||we;p=e.append(p,k);}}var N=d?$u(d):nt,F=function(e){if(to(e))return Ir;var t=TD(e,"iterationTypesOfIteratorResult");if(t)return t;if(Vo(e,ir||(ir=_u("IteratorYieldResult",1,!1))||bt))return CD(e,"iterationTypesOfIteratorResult",DD(zl(e)[0],void 0,void 0));if(Vo(e,ar||(ar=_u("IteratorReturnResult",1,!1))||bt))return CD(e,"iterationTypesOfIteratorResult",DD(void 0,zl(e)[0],void 0));var r=om(e,RD),n=r!==nt?eo(r,"value"):void 0,i=om(e,BD),a=i!==nt?eo(i,"value"):void 0;return CD(e,"iterationTypesOfIteratorResult",n||a?DD(n,a||rt,void 0):wr)}(r.resolveIterationType(N,i)||we);return F===wr?(i&&In(i,r.mustHaveAValueDiagnostic,n),g=we,p=e.append(p,we)):(g=F.yieldType,p=e.append(p,F.returnType)),DD(g,qu(p),f)}}function JD(e,t,r){var n=SD([jD(e,t,"next",r),jD(e,t,"return",r),jD(e,t,"throw",r)]);return CD(e,t.iteratorCacheKey,n)}function zD(e,t,r){if(!to(t)){var n=UD(t,r);return n&&n[j(e)]}}function UD(e,t){if(to(e))return Ir;var r=t?Lr:Rr;return ED(e,t?2:1,void 0)||OD(e,r,void 0)}function KD(e,t){var r=!!(2&t);return 1&t?zD(1,e,r)||Me:r?Px(e)||Me:e}function VD(t,r){var n=KD(r,e.getFunctionFlags(t));return !!n&&Eb(n,16387)}function qD(t,r,n){var i=Hc(t);if(0!==i.length){for(var a=0,o=fc(t);a<o.length;a++){var s=o[a];n&&4194304&s.flags||WD(t,s,a_(s,8576,!0),Ko(s));}var c=r.valueDeclaration;if(c&&e.isClassLike(c))for(var l=0,u=c.members;l<u.length;l++){var _=u[l];if(!e.isStatic(_)&&!As(_)){var d=$i(_);WD(t,d,rx(_.name.expression),Ko(d));}}if(i.length>1)for(var p=0,f=i;p<f.length;p++)HD(t,f[p]);}}function WD(t,r,n,i){var a=r.valueDeclaration,o=e.getNameOfDeclaration(a);if(!o||!e.isPrivateIdentifier(o))for(var s=Xc(t,n),c=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,257):void 0,l=a&&220===a.kind||o&&161===o.kind||ea(r)===t.symbol?a:void 0,u=function(n){var a=n.declaration&&ea($i(n.declaration))===t.symbol?n.declaration:void 0,o=l||a||(c&&!e.some(is(t),(function(e){return !!gc(e,r.escapedName)&&!!Qc(e,n.keyType)}))?c:void 0);o&&!Yd(i,n.type)&&In(o,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3,Ia(r),Ma(i),Ma(n.keyType),Ma(n.type));},_=0,d=s;_<d.length;_++)u(d[_]);}function HD(t,r){for(var n=r.declaration,i=Xc(t,r.keyType),a=2&e.getObjectFlags(t)?e.getDeclarationOfKind(t.symbol,257):void 0,o=n&&ea($i(n))===t.symbol?n:void 0,s=function(n){if(n===r)return "continue";var i=n.declaration&&ea($i(n.declaration))===t.symbol?n.declaration:void 0,s=o||i||(a&&!e.some(is(t),(function(e){return !!Gc(e,r.keyType)&&!!Qc(e,n.keyType)}))?a:void 0);s&&!Yd(r.type,n.type)&&In(s,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3,Ma(r.keyType),Ma(r.type),Ma(n.keyType),Ma(n.type));},c=0,l=i;c<l.length;c++)s(l[c]);}function GD(e,t){switch(e.escapedText){case"any":case"unknown":case"never":case"number":case"bigint":case"boolean":case"string":case"symbol":case"void":case"object":In(e,t,e.escapedText);}}function QD(t){if(t)for(var n=!1,i=0;i<t.length;i++){var a=t[i];if(ox(a),r){a.default?(n=!0,s=a.default,c=t,l=i,function t(r){if(177===r.kind){var n=nu(r);if(262144&n.flags)for(var i=l;i<c.length;i++)n.symbol===$i(c[i])&&In(r,e.Diagnostics.Type_parameter_defaults_can_only_reference_previously_declared_type_parameters);}e.forEachChild(r,t);}(s)):n&&In(a,e.Diagnostics.Required_type_parameters_may_not_follow_optional_type_parameters);for(var o=0;o<i;o++)t[o].symbol===a.symbol&&In(a.name,e.Diagnostics.Duplicate_identifier_0,e.declarationNameToString(a.name));}}var s,c,l;}function XD(t){if(!t.declarations||1!==t.declarations.length){var r=Gn(t);if(!r.typeParametersChecked){r.typeParametersChecked=!0;var n=function(t){return e.filter(t.declarations,(function(e){return 256===e.kind||257===e.kind}))}(t);if(!n||n.length<=1)return;if(!function(t,r){for(var n=e.length(r),i=ol(r),a=0,o=t;a<o.length;a++){var s=o[a],c=e.getEffectiveTypeParameterDeclarations(s),l=c.length;if(l<i||l>n)return !1;for(var u=0;u<l;u++){var _=c[u],d=r[u];if(_.name.escapedText!==d.symbol.escapedName)return !1;var p=e.getEffectiveConstraintOfTypeParameter(_),f=p&&dd(p),g=hc(d);if(f&&g&&!Wd(f,g))return !1;var m=_.default&&dd(_.default),y=Fc(d);if(m&&y&&!Wd(m,y))return !1}}return !0}(n,ms(t).localTypeParameters))for(var i=Ia(t),a=0,o=n;a<o.length;a++)In(o[a].name,e.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters,i);}}}function YD(t){!function(t){var r=e.getSourceFileOfNode(t);(function(t){var r=!1,n=!1;if(!CT(t)&&t.heritageClauses)for(var i=0,a=t.heritageClauses;i<a.length;i++){var o=a[i];if(94===o.token){if(r)return QT(o,e.Diagnostics.extends_clause_already_seen);if(n)return QT(o,e.Diagnostics.extends_clause_must_precede_implements_clause);if(o.types.length>1)return QT(o.types[1],e.Diagnostics.Classes_can_only_extend_a_single_class);r=!0;}else {if(e.Debug.assert(117===o.token),n)return QT(o,e.Diagnostics.implements_clause_already_seen);n=!0;}wT(o);}})(t)||NT(t.typeParameters,r);}(t),Bx(t),sD(t,t.name),QD(e.getEffectiveTypeParameterDeclarations(t)),Sx(t);var n=$i(t),i=ms(n),a=Ls(i),o=Uo(n);XD(n),Dx(n),function(t){for(var r=new e.Map,n=new e.Map,i=new e.Map,a=0,o=t.members;a<o.length;a++){var s=o[a];if(170===s.kind)for(var c=0,l=s.parameters;c<l.length;c++){var u=l[c];e.isParameterPropertyDeclaration(u,s)&&!e.isBindingPattern(u.name)&&y(r,u.name,u.name.escapedText,3);}else {var _=e.isStatic(s),d=s.name;if(!d)continue;var p=e.isPrivateIdentifier(d),f=p&&_?16:0,g=p?i:_?n:r,m=d&&e.getPropertyNameForPropertyNameNode(d);if(m)switch(s.kind){case 171:y(g,d,m,1|f);break;case 172:y(g,d,m,2|f);break;case 166:y(g,d,m,3|f);break;case 168:y(g,d,m,8|f);}}}function y(t,r,n,i){var a=t.get(n);if(a)if((16&a)!=(16&i))In(r,e.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name,e.getTextOfNode(r));else {var o=!!(8&a),s=!!(8&i);o||s?o!==s&&In(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):a&i&-17?In(r,e.Diagnostics.Duplicate_identifier_0,e.getTextOfNode(r)):t.set(n,a|i);}else t.set(n,i);}}(t),8388608&t.flags||function(t){for(var r=0,n=t.members;r<n.length;r++){var i=n[r],a=i.name;if(e.isStatic(i)&&a){var o=e.getPropertyNameForPropertyNameNode(a);switch(o){case"name":case"length":case"caller":case"arguments":case"prototype":In(a,e.Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1,o,Wa($i(t)));}}}}(t);var s=e.getEffectiveBaseTypeNode(t);if(s){e.forEach(s.typeArguments,hS),K<2&&ST(s.parent,1);var c=e.getClassExtendsHeritageElement(t);c&&c!==s&&ax(c.expression);var l=is(i);if(l.length&&r){var u=l[0],_=rs(i),d=Ac(_);if(function(t,r){var n=Uc(t,1);if(n.length){var i=n[0].declaration;i&&e.hasEffectiveModifier(i,8)&&(PS(r,e.getClassLikeDeclarationOfSymbol(t.symbol))||In(r,e.Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private,Oi(t.symbol)));}}(d,s),hS(s.expression),e.some(s.typeArguments)){e.forEach(s.typeArguments,hS);for(var p=0,f=es(d,s.typeArguments,s);p<f.length&&mx(s,f[p].typeParameters);p++);}if(tp(a,x=Ls(u,i.thisType),void 0)?tp(o,qd(d),t.name||t,e.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1):eS(t,a,x,e.Diagnostics.Class_0_incorrectly_extends_base_class_1),8650752&_.flags&&(Yo(o)?Uc(_,1).some((function(e){return 4&e.flags}))&&!e.hasSyntacticModifier(t,128)&&In(t.name||t,e.Diagnostics.A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract):In(t.name||t,e.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any)),!(d.symbol&&32&d.symbol.flags||8650752&_.flags)){var g=ts(d,s.typeArguments,s);e.forEach(g,(function(e){return !Fh(e.declaration)&&!Wd(ml(e),u)}))&&In(s.expression,e.Diagnostics.Base_constructors_must_all_have_the_same_return_type);}!function(t,r){var n,i;e:for(var a=0,o=yc(r);a<o.length;a++){var s=o[a],c=tS(s);if(!(4194304&c.flags)){var l=gc(t,c.escapedName);if(l){var u=tS(l),_=e.getDeclarationModifierFlagsFromSymbol(c);if(e.Debug.assert(!!u,"derived should point to something, even if it is the base class' declaration."),u===c){var d=e.getClassLikeDeclarationOfSymbol(t.symbol);if(128&_&&(!d||!e.hasSyntacticModifier(d,128))){for(var p=0,f=is(t);p<f.length;p++){var g=f[p];if(g!==r){var m=gc(g,c.escapedName),y=m&&tS(m);if(y&&y!==c)continue e}}225===d.kind?In(d,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,Ia(s),Ma(r)):In(d,e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,Ma(t),Ia(s),Ma(r));}}else {var v=e.getDeclarationModifierFlagsFromSymbol(u);if(8&_||8&v)continue;var h=void 0,b=98308&c.flags,x=98308&u.flags;if(b&&x){if(128&_&&!(c.valueDeclaration&&e.isPropertyDeclaration(c.valueDeclaration)&&c.valueDeclaration.initializer)||c.valueDeclaration&&257===c.valueDeclaration.parent.kind||u.valueDeclaration&&e.isBinaryExpression(u.valueDeclaration))continue;var D=4!==b&&4===x;if(D||4===b&&4!==x){var S=D?e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property:e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,S,Ia(c),Ma(r),Ma(t));}else if(q){var T=null===(n=u.declarations)||void 0===n?void 0:n.find((function(e){return 166===e.kind&&!e.initializer}));if(T&&!(33554432&u.flags)&&!(128&_)&&!(128&v)&&!(null===(i=u.declarations)||void 0===i?void 0:i.some((function(e){return !!(8388608&e.flags)})))){var C=sa(e.getClassLikeDeclarationOfSymbol(t.symbol)),E=T.name;if(T.exclamationToken||!C||!e.isIdentifier(E)||!H||!nS(E,t,C)){var k=e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,k,Ia(c),Ma(r));}}}continue}if(ev(c)){if(ev(u)||4&u.flags)continue;e.Debug.assert(!!(98304&u.flags)),h=e.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;}else h=98304&c.flags?e.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function:e.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;In(e.getNameOfDeclaration(u.valueDeclaration)||u.valueDeclaration,h,Ma(r),Ia(c),Ma(t));}}}}}(i,u);}}!function(t,r,n,i){for(var a=e.getEffectiveBaseTypeNode(t)&&is(r),o=(null==a?void 0:a.length)?Ls(e.first(a),r.thisType):void 0,s=rs(r),c=function(a){if(e.hasAmbientModifier(a))return "continue";e.isConstructorDeclaration(a)&&e.forEach(a.parameters,(function(c){e.isParameterPropertyDeclaration(c,a)&&ZD(t,i,s,o,r,n,c,!0);})),ZD(t,i,s,o,r,n,a,!1);},l=0,u=t.members;l<u.length;l++)c(u[l]);}(t,i,a,o);var m=e.getEffectiveImplementsTypeNodes(t);if(m)for(var y=0,v=m;y<v.length;y++){var h=v[y];if(e.isEntityNameExpression(h.expression)&&!e.isOptionalChain(h.expression)||In(h.expression,e.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments),vx(h),r){var b=Mc(dd(h));if(!ro(b))if(os(b)){var x,D=b.symbol&&32&b.symbol.flags?e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass:e.Diagnostics.Class_0_incorrectly_implements_interface_1;tp(a,x=Ls(b,i.thisType),void 0)||eS(t,a,x,D);}else In(h,e.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);}}r&&(qD(i,n),qD(o,n,!0),_x(t),function(t){if(H&&X&&!(8388608&t.flags))for(var r=sa(t),n=0,i=t.members;n<i.length;n++){var a=i[n];if(!(2&e.getEffectiveModifierFlags(a))&&!e.isStatic(a)&&rS(a)){var o=a.name;if(e.isIdentifier(o)||e.isPrivateIdentifier(o)){var s=Uo($i(a));3&s.flags||32768&vf(s)||r&&nS(o,s,r)||In(a.name,e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor,e.declarationNameToString(o));}}}}(t));}function ZD(t,r,n,i,a,o,s,c,l){void 0===l&&(l=!0);var u=s.name&&MS(s.name)||MS(s);return u?$D(t,r,n,i,a,o,e.hasOverrideModifier(s),e.hasAbstractModifier(s),e.isStatic(s),c,e.symbolName(u),l?s:void 0):0}function $D(t,r,n,i,a,o,s,c,l,u,_,d){var p=e.isInJSFile(t),f=!!(8388608&t.flags);if(i&&(s||U.noImplicitOverride)){var g=e.escapeLeadingUnderscores(_),m=l?n:i,y=Jc(l?r:o,g),v=Jc(m,g),h=Ma(i);if(y&&!v&&s){if(d){var b=Ev(_,m);b?In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,h,Ia(b)):In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0,h);}return 2}if(y&&(null==v?void 0:v.declarations)&&U.noImplicitOverride&&!f){var x=e.some(v.declarations,e.hasAbstractModifier);if(s)return 0;if(!x)return d&&In(d,u?p?e.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0:p?e.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0:e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0,h),1;if(c&&x)return d&&In(d,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0,h),1}}else if(s){if(d){var D=Ma(a);In(d,p?e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class:e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class,D);}return 2}return 0}function eS(t,r,n,i){for(var a=!1,o=function(t){if(e.isStatic(t))return "continue";var i=t.name&&MS(t.name)||MS(t);if(i){var o=Jc(r,i.escapedName),s=Jc(n,i.escapedName);o&&s&&(tp(Uo(o),Uo(s),t.name||t,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2,Ia(i),Ma(r),Ma(n))}))||(a=!0));}},s=0,c=t.members;s<c.length;s++)o(c[s]);a||tp(r,n,t.name||t,i);}function tS(t){return 1&e.getCheckFlags(t)?t.target:t}function rS(t){return 166===t.kind&&!e.hasAbstractModifier(t)&&!t.exclamationToken&&!t.initializer}function nS(t,r,n){var i=e.factory.createPropertyAccessExpression(e.factory.createThis(),t);return e.setParent(i.expression,i),e.setParent(i,n),i.flowNode=n.returnFlowNode,!(32768&vf(Pm(i,r,Df(r))))}function iS(e){var t=Qn(e);if(!(16384&t.flags)){t.flags|=16384;for(var r=0,n=0,i=e.members;n<i.length;n++){var a=i[n],o=aS(a,r);Qn(a).enumMemberValue=o,r="number"==typeof o?o+1:void 0;}}}function aS(t,r){if(e.isComputedNonLiteralName(t.name))In(t.name,e.Diagnostics.Computed_property_names_are_not_allowed_in_enums);else {var n=e.getTextOfPropertyName(t.name);ky(n)&&!e.isInfinityOrNaNString(n)&&In(t.name,e.Diagnostics.An_enum_member_cannot_have_a_numeric_name);}return t.initializer?function(t){var r=_s($i(t.parent)),n=e.isEnumConst(t.parent),i=t.initializer,a=1!==r||us(t)?function r(n){switch(n.kind){case 218:var i=r(n.operand);if("number"==typeof i)switch(n.operator){case 39:return i;case 40:return -i;case 54:return ~i}break;case 220:var a=r(n.left),o=r(n.right);if("number"==typeof a&&"number"==typeof o)switch(n.operatorToken.kind){case 51:return a|o;case 50:return a&o;case 48:return a>>o;case 49:return a>>>o;case 47:return a<<o;case 52:return a^o;case 41:return a*o;case 43:return a/o;case 39:return a+o;case 40:return a-o;case 44:return a%o;case 42:return Math.pow(a,o)}else if("string"==typeof a&&"string"==typeof o&&39===n.operatorToken.kind)return a+o;break;case 10:case 14:return n.text;case 8:return eC(n),+n.text;case 211:return r(n.expression);case 79:var c=n;return e.isInfinityOrNaNString(c.escapedText)?+c.escapedText:e.nodeIsMissing(n)?0:s(n,$i(t.parent),c.escapedText);case 206:case 205:var l=n;if(oS(l)){var u=rx(l.expression);if(u.symbol&&384&u.symbol.flags){var _;return _=205===l.kind?l.name.escapedText:e.escapeLeadingUnderscores(e.cast(l.argumentExpression,e.isLiteralExpression).text),s(n,u.symbol,_)}}}}(i):void 0;if(void 0!==a)n&&"number"==typeof a&&!isFinite(a)&&In(i,isNaN(a)?e.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN:e.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);else {if(1===r)return In(i,e.Diagnostics.Computed_values_are_not_permitted_in_an_enum_with_string_valued_members),0;if(n)In(i,e.Diagnostics.const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values);else if(8388608&t.parent.flags)In(i,e.Diagnostics.In_ambient_enum_declarations_member_initializer_must_be_constant_expression);else {var o=ax(i);kb(o,296)?tp(o,ms($i(t.parent)),i,void 0):In(i,e.Diagnostics.Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead,Ma(o));}}return a;function s(r,n,i){var a=n.exports.get(i);if(a){var o=a.valueDeclaration;if(o!==t)return o&&Zn(o,t)?sT(o):(In(r,e.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums),0);In(r,e.Diagnostics.Property_0_is_used_before_being_assigned,Ia(a));}}}(t):8388608&t.parent.flags&&!e.isEnumConst(t.parent)&&0===_s($i(t.parent))?void 0:void 0!==r?r:void In(t.name,e.Diagnostics.Enum_member_must_have_initializer)}function oS(t){return 79===t.kind||205===t.kind&&oS(t.expression)||206===t.kind&&oS(t.expression)&&e.isStringLiteralLike(t.argumentExpression)}function sS(t){e.isPrivateIdentifier(t.name)&&In(t,e.Diagnostics.An_enum_member_cannot_be_named_with_a_private_identifier);}function cS(t,r){var n;switch(t.kind){case 236:for(var i=0,a=t.declarationList.declarations;i<a.length;i++)cS(a[i],r);break;case 270:case 271:QT(t,e.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations);break;case 264:case 265:QT(t,e.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);break;case 202:case 253:var o=t.name;if(e.isBindingPattern(o)){for(var s=0,c=o.elements;s<c.length;s++)cS(c[s],r);break}case 256:case 259:case 255:case 257:case 260:case 258:if(r)return;var l=$i(t);if(l){var u=!(33554432&l.flags);u||(u=!!(null===(n=l.parent)||void 0===n?void 0:n.declarations)&&e.isExternalModuleAugmentation(l.parent.declarations[0]));}}}function lS(t){var r=e.getExternalModuleName(t);if(!r||e.nodeIsMissing(r))return !1;if(!e.isStringLiteral(r))return In(r,e.Diagnostics.String_literal_expected),!1;var n=261===t.parent.kind&&e.isAmbientModule(t.parent.parent);return 303===t.parent.kind||n?!(n&&e.isExternalModuleNameRelative(r.text)&&!Ka(t)&&(In(t,e.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name),1)):(In(r,271===t.kind?e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace:e.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module),!1)}function uS(t){var r,n=$i(t),i=ki(n);if(i!==Ne){var a=(1160127&(n=Zi(n.exportSymbol||n)).flags?111551:0)|(788968&n.flags?788968:0)|(1920&n.flags?1920:0);if(i.flags&a&&In(t,274===t.kind?e.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0:e.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0,Ia(n)),U.isolatedModules&&!e.isTypeOnlyImportOrExportDeclaration(t)&&!(8388608&t.flags)){var o=Ai(n),s=!(111551&i.flags);if(s||o)switch(t.kind){case 266:case 269:case 264:U.preserveValueImports&&(e.Debug.assertIsDefined(t.name,"An ImportClause with a symbol should have a name"),ri(In(t,s?e.Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled,c=e.idText(269===t.kind&&t.propertyName||t.name)),s?void 0:o,c));break;case 274:var c;if(e.getSourceFileOfNode(o)!==e.getSourceFileOfNode(t))return void ri(In(t,s?e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type:e.Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled,c=e.idText(t.propertyName||t.name)),s?void 0:o,c)}}e.isImportSpecifier(t)&&(null===(r=i.declarations)||void 0===r?void 0:r.every((function(t){return !!(134217728&e.getCombinedNodeFlags(t))})))&&Bn(t.name,i.declarations,n.escapedName);}}function _S(t){sD(t,t.name),uS(t),269===t.kind&&"default"===e.idText(t.propertyName||t.name)&&e.getESModuleInterop(U)&&V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&ST(t,131072);}function dS(t){var r;if(t.assertClause){if(V!==e.ModuleKind.ESNext)return YT(t.assertClause,e.Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext);if(e.isImportDeclaration(t)?null===(r=t.importClause)||void 0===r?void 0:r.isTypeOnly:t.isTypeOnly)return YT(t.assertClause,e.Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports)}}function pS(e,t){var r=303===e.parent.kind||261===e.parent.kind||260===e.parent.kind;return r||QT(e,t),!r}function fS(t){return e.isImportDeclaration(t)&&t.importClause&&!t.importClause.isTypeOnly&&(r=t.importClause,e.forEachImportClauseDeclaration(r,(function(e){return !!$i(e).isReferenced})))&&!eT(t.importClause,!0)&&!function(t){return e.forEachImportClauseDeclaration(t,(function(e){return !!Gn($i(e)).constEnumReferenced}))}(t.importClause);var r;}function gS(t){return e.isImportEqualsDeclaration(t)&&e.isExternalModuleReference(t.moduleReference)&&!t.isTypeOnly&&$i(t).isReferenced&&!eT(t,!1)&&!Gn($i(t)).constEnumReferenced}function mS(t){if(uS(t),e.getEmitDeclarations(U)&&Ga(t.propertyName||t.name,!0),t.parent.parent.moduleSpecifier)e.getESModuleInterop(U)&&V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&"default"===e.idText(t.propertyName||t.name)&&ST(t,131072);else {var r=t.propertyName||t.name,n=ei(r,r.escapedText,2998271,void 0,void 0,!0);if(n&&(n===se||n===ce||n.declarations&&Xn($a(n.declarations[0]))))In(r,e.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module,e.idText(r));else {Pi(t);var i=n&&(2097152&n.flags?ki(n):n);(!i||i===Ne||111551&i.flags)&&zb(t.propertyName||t.name);}}}function yS(t){var r=$i(t),n=Gn(r);if(!n.exportsChecked){var i=r.exports.get("export=");if(i&&function(t){return e.forEachEntry(t.exports,(function(e,t){return "export="!==t}))}(r)){var a=di(i)||i.valueDeclaration;!a||Ka(a)||e.isInJSFile(a)||In(a,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);}var o=Qi(r);o&&o.forEach((function(t,r){var n=t.declarations,i=t.flags;if("__export"!==r&&!(1984&i)){var a=e.countWhere(n,F);if(!(524288&i&&a<=2)&&a>1&&!vS(n))for(var o=0,s=n;o<s.length;o++){var c=s[o];R(c)&&mn.add(e.createDiagnosticForNode(c,e.Diagnostics.Cannot_redeclare_exported_variable_0,e.unescapeLeadingUnderscores(r)));}}})),n.exportsChecked=!0;}}function vS(t){return t&&t.length>1&&t.every((function(t){return e.isInJSFile(t)&&e.isAccessExpression(t)&&(e.isExportsIdentifier(t.expression)||e.isModuleExportsAccessExpression(t.expression))}))}function hS(t){if(t){var n=_;_=t,D=0,function(t){e.isInJSFile(t)&&e.forEach(t.jsDoc,(function(t){var r=t.tags;return e.forEach(r,hS)}));var n=t.kind;if(a)switch(n){case 260:case 256:case 257:case 255:a.throwIfCancellationRequested();}switch(n>=236&&n<=252&&t.flowNode&&!Em(t.flowNode)&&Mn(!1===U.allowUnreachableCode,t,e.Diagnostics.Unreachable_code_detected),n){case 162:return ox(t);case 163:return sx(t);case 166:return dx(t);case 165:return function(t){return e.isPrivateIdentifier(t.name)&&In(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),dx(t)}(t);case 179:case 178:case 173:case 174:case 175:return lx(t);case 168:case 167:return function(t){zT(t)||OT(t.name),Jx(t),e.hasSyntacticModifier(t,128)&&168===t.kind&&t.body&&In(t,e.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract,e.declarationNameToString(t.name)),e.isPrivateIdentifier(t.name)&&!e.getContainingClass(t)&&In(t,e.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies),px(t);}(t);case 169:return function(t){CT(t),e.forEachChild(t,hS);}(t);case 170:return function(t){lx(t),function(t){var r=e.isInJSFile(t)?e.getJSDocTypeParameterDeclarations(t):void 0,n=t.typeParameters||r&&e.firstOrUndefined(r);if(n){var i=n.pos===n.end?n.pos:e.skipTrivia(e.getSourceFileOfNode(t).text,n.pos);return XT(t,i,n.end-i,e.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration)}}(t)||function(t){var r=e.getEffectiveReturnTypeNode(t);r&&YT(r,e.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration);}(t),hS(t.body);var n=$i(t);if(t===e.getDeclarationOfKind(n,t.kind)&&Dx(n),!e.nodeIsMissing(t.body)&&r){var i=t.parent;if(e.getClassExtendsHeritageElement(i)){Um(t.parent,i);var a=Vm(i),o=Km(t.body);if(o){if(a&&In(o,e.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null),(99!==e.getEmitScriptTarget(U)||!q)&&(e.some(t.parent.members,(function(t){return !!e.isPrivateIdentifierClassElementDeclaration(t)||166===t.kind&&!e.isStatic(t)&&!!t.initializer}))||e.some(t.parameters,(function(t){return e.hasSyntacticModifier(t,16476)})))){for(var s=void 0,c=0,l=t.body.statements;c<l.length;c++){var u=l[c];if(237===u.kind&&e.isSuperCall(u.expression)){s=u;break}if(!e.isPrologueDirective(u))break}s||In(t,e.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers);}}else a||In(t,e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call);}}}(t);case 171:case 172:return fx(t);case 177:return vx(t);case 176:return function(t){var r=function(e){switch(e.parent.kind){case 213:case 173:case 255:case 212:case 178:case 168:case 167:var t=e.parent;if(e===t.type)return t}}(t);if(r){var n=cl(r),i=fl(n);if(i){hS(t.type);var a=t.parameterName;if(0===i.kind||2===i.kind)ld(a);else if(i.parameterIndex>=0)J(n)&&i.parameterIndex===n.parameters.length-1?In(a,e.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter):i.type&&tp(i.type,Uo(n.parameters[i.parameterIndex]),t.type,void 0,(function(){return e.chainDiagnosticMessages(void 0,e.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type)}));else if(a){for(var o=!1,s=0,c=r.parameters;s<c.length;s++){var l=c[s].name;if(e.isBindingPattern(l)&&cx(l,a,i.parameterName)){o=!0;break}}o||In(t.parameterName,e.Diagnostics.Cannot_find_parameter_0,i.parameterName);}}}else In(t,e.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods);}(t);case 180:return function(e){au(e);}(t);case 181:return function(t){if(e.forEach(t.members,hS),r){var n=q_(t);qD(n,n.symbol),_x(t),ux(t);}}(t);case 182:return function(e){hS(e.elementType);}(t);case 183:return function(t){for(var r=t.elements,n=!1,i=!1,a=e.some(r,e.isNamedTupleMember),o=0,s=r;o<s.length;o++){var c=s[o];if(196!==c.kind&&a){YT(c,e.Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);break}var l=Cu(c);if(8&l){var u=dd(c.type);if(!Qp(u)){In(c,e.Diagnostics.A_rest_element_type_must_be_an_array_type);break}(qp(u)||_f(u)&&4&u.target.combinedFlags)&&(i=!0);}else if(4&l){if(i){YT(c,e.Diagnostics.A_rest_element_cannot_follow_another_rest_element);break}i=!0;}else if(2&l){if(i){YT(c,e.Diagnostics.An_optional_element_cannot_follow_a_rest_element);break}n=!0;}else if(n){YT(c,e.Diagnostics.A_required_element_cannot_follow_an_optional_element);break}}e.forEach(t.elements,hS),dd(t);}(t);case 186:case 187:return function(t){e.forEach(t.types,hS),dd(t);}(t);case 190:case 184:case 185:return hS(t.type);case 191:return function(e){ld(e);}(t);case 192:return function(t){!function(t){if(153===t.operator){if(150!==t.type.kind)return YT(t.type,e.Diagnostics._0_expected,e.tokenToString(150));var r=e.walkUpParenthesizedTypes(t.parent);switch(e.isInJSFile(r)&&e.isJSDocTypeExpression(r)&&(r=r.parent,e.isJSDocTypeTag(r)&&(r=r.parent.parent)),r.kind){case 253:var n=r;if(79!==n.name.kind)return YT(t,e.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name);if(!e.isVariableDeclarationInVariableStatement(n))return YT(t,e.Diagnostics.unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement);if(!(2&n.parent.flags))return YT(r.name,e.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const);break;case 166:if(!e.isStatic(r)||!e.hasEffectiveReadonlyModifier(r))return YT(r.name,e.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly);break;case 165:if(!e.hasSyntacticModifier(r,64))return YT(r.name,e.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly);break;default:YT(t,e.Diagnostics.unique_symbol_types_are_not_allowed_here);}}else 144===t.operator&&182!==t.type.kind&&183!==t.type.kind&&QT(t,e.Diagnostics.readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types,e.tokenToString(150));}(t),hS(t.type);}(t);case 188:return function(t){e.forEachChild(t,hS);}(t);case 189:return function(t){e.findAncestor(t,(function(e){return e.parent&&188===e.parent.kind&&e.parent.extendsType===e}))||YT(t,e.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type),hS(t.typeParameter),zx(t);}(t);case 197:return function(e){for(var t=0,r=e.templateSpans;t<r.length;t++){var n=r[t];hS(n.type),tp(dd(n.type),pt,n.type);}dd(e);}(t);case 199:return function(e){hS(e.argument),dd(e);}(t);case 196:return function(t){t.dotDotDotToken&&t.questionToken&&YT(t,e.Diagnostics.A_tuple_member_cannot_be_both_optional_and_rest),184===t.type.kind&&YT(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type),185===t.type.kind&&YT(t.type,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type),hS(t.type),dd(t);}(t);case 326:return function(t){var r=e.getEffectiveJSDocHost(t);if(r&&(e.isClassDeclaration(r)||e.isClassExpression(r))){var n=e.getJSDocTags(r).filter(e.isJSDocAugmentsTag);e.Debug.assert(n.length>0),n.length>1&&In(n[1],e.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag);var i=jx(t.class.expression),a=e.getClassExtendsHeritageElement(r);if(a){var o=jx(a.expression);o&&i.escapedText!==o.escapedText&&In(i,e.Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause,e.idText(t.tagName),e.idText(i),e.idText(o));}}else In(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 327:return function(t){var r=e.getEffectiveJSDocHost(t);r&&(e.isClassDeclaration(r)||e.isClassExpression(r))||In(r,e.Diagnostics.JSDoc_0_is_not_attached_to_a_class,e.idText(t.tagName));}(t);case 343:case 336:case 337:return function(t){t.typeExpression||In(t.name,e.Diagnostics.JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags),t.name&&GD(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),hS(t.typeExpression),QD(e.getEffectiveTypeParameterDeclarations(t));}(t);case 342:return function(e){hS(e.constraint);for(var t=0,r=e.typeParameters;t<r.length;t++)hS(r[t]);}(t);case 341:return function(e){hS(e.typeExpression);}(t);case 338:return function(t){if(hS(t.typeExpression),!e.getParameterSymbolFromJSDoc(t)){var r=e.getHostSignatureFromJSDoc(t);if(r){var n=e.getJSDocTags(r).filter(e.isJSDocParameterTag).indexOf(t);if(n>-1&&n<r.parameters.length&&e.isBindingPattern(r.parameters[n].name))return;ul(r)?e.findLast(e.getJSDocTags(r),e.isJSDocParameterTag)===t&&t.typeExpression&&t.typeExpression.type&&!qp(dd(t.typeExpression.type))&&In(t.name,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,e.idText(160===t.name.kind?t.name.right:t.name)):e.isQualifiedName(t.name)?In(t.name,e.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,e.entityNameToString(t.name),e.entityNameToString(t.name.left)):In(t.name,e.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,e.idText(t.name));}}}(t);case 345:return function(e){hS(e.typeExpression);}(t);case 315:!function(t){!r||t.type||e.isJSDocConstructSignature(t)||Uf(t,we),lx(t);}(t);case 313:case 312:case 310:case 311:case 320:return bS(t),void e.forEachChild(t,hS);case 316:return void function(t){bS(t),hS(t.type);var r=t.parent;if(e.isParameter(r)&&e.isJSDocFunctionType(r.parent))e.last(r.parent.parameters)!==r&&In(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);else {e.isJSDocTypeExpression(r)||In(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);var n=t.parent.parent;if(e.isJSDocParameterTag(n)){var i=e.getParameterSymbolFromJSDoc(n);if(i){var a=e.getHostSignatureFromJSDoc(n);a&&e.last(a.parameters).symbol===i||In(t,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);}}else In(t,e.Diagnostics.JSDoc_may_only_appear_in_the_last_parameter_of_a_signature);}}(t);case 307:return hS(t.type);case 331:case 333:case 332:return function(t){var r=e.getJSDocHost(t);r&&e.isPrivateIdentifierClassElementDeclaration(r)&&In(t,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);}(t);case 193:return function(e){hS(e.objectType),hS(e.indexType),hx(w_(e),e);}(t);case 194:return function(t){!function(t){var r;(null===(r=t.members)||void 0===r?void 0:r.length)&&YT(t.members[0],e.Diagnostics.A_mapped_type_may_not_declare_properties_or_methods);}(t),hS(t.typeParameter),hS(t.nameType),hS(t.type),t.type||Uf(t,we);var r=I_(t),n=ic(r);n?tp(n,_t,t.nameType):tp(nc(r),_t,e.getEffectiveConstraintOfTypeParameter(t.typeParameter));}(t);case 255:return function(e){r&&(Jx(e),MT(e),sD(e,e.name));}(t);case 234:case 261:return tD(t);case 236:return pD(t);case 237:return function(e){$T(e),ax(e.expression);}(t);case 238:return function(t){$T(t);var r=mD(t.expression);fD(t.expression,r,t.thenStatement),hS(t.thenStatement),235===t.thenStatement.kind&&In(t.thenStatement,e.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement),hS(t.elseStatement);}(t);case 239:return function(e){$T(e),hS(e.statement),mD(e.expression);}(t);case 240:return function(e){$T(e),mD(e.expression),hS(e.statement);}(t);case 241:return function(t){$T(t)||t.initializer&&254===t.initializer.kind&&WT(t.initializer),t.initializer&&(254===t.initializer.kind?e.forEach(t.initializer.declarations,dD):ax(t.initializer)),t.condition&&mD(t.condition),t.incrementor&&ax(t.incrementor),hS(t.statement),t.locals&&zx(t);}(t);case 242:return function(t){BT(t);var r,n=ov(ax(t.expression));if(254===t.initializer.kind){var i=t.initializer.declarations[0];i&&e.isBindingPattern(i.name)&&In(i.name,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern),yD(t);}else {var a=t.initializer,o=ax(a);203===a.kind||204===a.kind?In(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern):Yd(131072&(r=l_(c_(n))).flags?He:r,o)?Tb(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access):In(a,e.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);}n!==nt&&kb(n,126091264)||In(t.expression,e.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0,Ma(n)),hS(t.statement),t.locals&&zx(t);}(t);case 243:return function(t){BT(t);var r=e.getContainingFunctionOrClassStaticBlock(t);if(t.awaitModifier?r&&e.isClassStaticBlockDeclaration(r)?YT(t.awaitModifier,e.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block):2==(6&e.getFunctionFlags(r))&&K<99&&ST(t,16384):U.downlevelIteration&&K<2&&ST(t,256),254===t.initializer.kind)yD(t);else {var n=t.initializer,i=vD(t);if(203===n.kind||204===n.kind)Ib(n,i||Me);else {var a=ax(n);Tb(n,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access),i&&rp(i,a,n,t.expression);}}hS(t.statement),t.locals&&zx(t);}(t);case 244:case 245:return function(t){$T(t)||function(t){for(var r=t;r;){if(e.isFunctionLikeOrClassStaticBlockDeclaration(r))return YT(t,e.Diagnostics.Jump_target_cannot_cross_function_boundary);switch(r.kind){case 249:if(t.label&&r.label.escapedText===t.label.escapedText)return !(244!==t.kind||e.isIterationStatement(r.statement,!0))&&YT(t,e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement);break;case 248:if(245===t.kind&&!t.label)return !1;break;default:if(e.isIterationStatement(r,!1)&&!t.label)return !1}r=r.parent;}t.label?YT(t,245===t.kind?e.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement:e.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement):YT(t,245===t.kind?e.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement:e.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement);}(t);}(t);case 246:return function(t){var r;if(!$T(t)){var n=e.getContainingFunctionOrClassStaticBlock(t);if(n&&e.isClassStaticBlockDeclaration(n))QT(t,e.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block);else if(n){var i=ml(cl(n)),a=e.getFunctionFlags(n);if(H||t.expression||131072&i.flags){var o=t.expression?zb(t.expression):ze;if(172===n.kind)t.expression&&In(t,e.Diagnostics.Setters_cannot_return_a_value);else if(170===n.kind)t.expression&&!rp(o,i,t,t.expression)&&In(t,e.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);else if(yl(n)){var s=null!==(r=KD(i,a))&&void 0!==r?r:i,c=2&a?Ex(o,!1,t,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):o;s&&rp(c,s,t,t.expression);}}else 170!==n.kind&&U.noImplicitReturns&&!VD(n,i)&&In(t,e.Diagnostics.Not_all_code_paths_return_a_value);}else QT(t,e.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body);}}(t);case 247:return function(t){$T(t)||32768&t.flags&&QT(t,e.Diagnostics.with_statements_are_not_allowed_in_an_async_function_block),ax(t.expression);var r=e.getSourceFileOfNode(t);if(!GT(r)){var n=e.getSpanOfTokenAtPosition(r,t.pos).start;XT(r,n,t.statement.pos-n,e.Diagnostics.The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any);}}(t);case 248:return function(t){var n;$T(t);var i=!1,a=ax(t.expression),o=af(a);e.forEach(t.caseBlock.clauses,(function(t){if(289!==t.kind||i||(void 0===n?n=t:(YT(t,e.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement),i=!0)),r&&288===t.kind){var s=ax(t.expression),c=af(s),l=a;c&&o||(s=c?of(s):s,l=of(a)),Mb(l,s)||_p(s,l,t.expression,void 0);}e.forEach(t.statements,hS),U.noFallthroughCasesInSwitch&&t.fallthroughFlowNode&&Em(t.fallthroughFlowNode)&&In(t,e.Diagnostics.Fallthrough_case_in_switch);})),t.caseBlock.locals&&zx(t.caseBlock);}(t);case 249:return function(t){$T(t)||e.findAncestor(t.parent,(function(r){return e.isFunctionLike(r)?"quit":249===r.kind&&r.label.escapedText===t.label.escapedText&&(YT(t.label,e.Diagnostics.Duplicate_label_0,e.getTextOfNode(t.label)),!0)})),hS(t.statement);}(t);case 250:return function(t){$T(t)||e.isIdentifier(t.expression)&&!t.expression.escapedText&&function(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!GT(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);mn.add(e.createFileDiagnostic(o,e.textSpanEnd(s),0,r,void 0,void 0,void 0));}}(t,e.Diagnostics.Line_break_not_permitted_here),t.expression&&ax(t.expression);}(t);case 251:return function(t){$T(t),tD(t.tryBlock);var r=t.catchClause;if(r){if(r.variableDeclaration){var n=r.variableDeclaration,i=e.getEffectiveTypeAnnotationNode(e.getRootDeclaration(n));if(i){var a=mo(n,!1);!a||3&a.flags||QT(i,e.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);}else if(n.initializer)QT(n.initializer,e.Diagnostics.Catch_clause_variable_cannot_have_an_initializer);else {var o=r.block.locals;o&&e.forEachKey(r.locals,(function(t){var r=o.get(t);(null==r?void 0:r.valueDeclaration)&&0!=(2&r.flags)&&YT(r.valueDeclaration,e.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause,t);}));}}tD(r.block);}t.finallyBlock&&tD(t.finallyBlock);}(t);case 253:return dD(t);case 202:return function(t){return function(t){if(t.dotDotDotToken){var r=t.parent.elements;if(t!==e.last(r))return YT(t,e.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);if(kT(r,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),t.propertyName)return YT(t.name,e.Diagnostics.A_rest_element_cannot_have_a_property_name)}t.dotDotDotToken&&t.initializer&&XT(t,t.initializer.pos-1,1,e.Diagnostics.A_rest_element_cannot_have_an_initializer);}(t),lD(t)}(t);case 256:return function(t){e.some(t.decorators)&&e.some(t.members,(function(t){return e.hasStaticModifier(t)&&e.isPrivateIdentifierClassElementDeclaration(t)}))&&YT(t.decorators[0],e.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator),t.name||e.hasSyntacticModifier(t,512)||QT(t,e.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name),YD(t),e.forEach(t.members,hS),zx(t);}(t);case 257:return function(t){if(CT(t)||function(t){var r=!1;if(t.heritageClauses)for(var n=0,i=t.heritageClauses;n<i.length;n++){var a=i[n];if(94!==a.token)return e.Debug.assert(117===a.token),QT(a,e.Diagnostics.Interface_declaration_cannot_have_implements_clause);if(r)return QT(a,e.Diagnostics.extends_clause_already_seen);r=!0,wT(a);}}(t),QD(t.typeParameters),r){GD(t.name,e.Diagnostics.Interface_name_cannot_be_0),Sx(t);var n=$i(t);if(XD(n),t===e.getDeclarationOfKind(n,257)){var i=ms(n),a=Ls(i);if(function(t,r){var n=is(t);if(n.length<2)return !0;var i=new e.Map;e.forEach(Cs(t).declaredProperties,(function(e){i.set(e.escapedName,{prop:e,containingType:t});}));for(var a=!0,o=0,s=n;o<s.length;o++)for(var c=s[o],l=0,u=yc(Ls(c,t.thisType));l<u.length;l++){var _=u[l],d=i.get(_.escapedName);if(d){if(d.containingType!==t&&!zp(d.prop,_)){a=!1;var p=Ma(d.containingType),f=Ma(c),g=e.chainDiagnosticMessages(void 0,e.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical,Ia(_),p,f);g=e.chainDiagnosticMessages(g,e.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2,Ma(t),p,f),mn.add(e.createDiagnosticForNodeFromMessageChain(r,g));}}else i.set(_.escapedName,{prop:_,containingType:c});}return a}(i,t.name)){for(var o=0,s=is(i);o<s.length;o++)tp(a,Ls(s[o],i.thisType),t.name,e.Diagnostics.Interface_0_incorrectly_extends_interface_1);qD(i,n);}}ux(t);}e.forEach(e.getInterfaceBaseTypeNodes(t),(function(t){e.isEntityNameExpression(t.expression)&&!e.isOptionalChain(t.expression)||In(t.expression,e.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments),vx(t);})),e.forEach(t.members,hS),r&&(_x(t),zx(t));}(t);case 258:return function(t){CT(t),GD(t.name,e.Diagnostics.Type_alias_name_cannot_be_0),Sx(t),QD(t.typeParameters),138===t.type.kind?P.has(t.name.escapedText)&&1===e.length(t.typeParameters)||In(t.type,e.Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types):(hS(t.type),zx(t));}(t);case 259:return function(t){if(r){CT(t),sD(t,t.name),Sx(t),t.members.forEach(sS),iS(t);var n=$i(t);if(t===e.getDeclarationOfKind(n,t.kind)){if(n.declarations&&n.declarations.length>1){var i=e.isEnumConst(t);e.forEach(n.declarations,(function(t){e.isEnumDeclaration(t)&&e.isEnumConst(t)!==i&&In(e.getNameOfDeclaration(t),e.Diagnostics.Enum_declarations_must_all_be_const_or_non_const);}));}var a=!1;e.forEach(n.declarations,(function(t){if(259!==t.kind)return !1;var r=t;if(!r.members.length)return !1;var n=r.members[0];n.initializer||(a?In(n.name,e.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element):a=!0);}));}}}(t);case 260:return function(t){if(r){var n=e.isGlobalScopeAugmentation(t),i=8388608&t.flags;n&&!i&&In(t.name,e.Diagnostics.Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context);var a=e.isAmbientModule(t);if(pS(t,a?e.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file:e.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module))return;CT(t)||i||10!==t.name.kind||YT(t.name,e.Diagnostics.Only_ambient_modules_can_use_quoted_names),e.isIdentifier(t.name)&&sD(t,t.name),Sx(t);var o=$i(t);if(512&o.flags&&!i&&o.declarations&&o.declarations.length>1&&L(t,e.shouldPreserveConstEnums(U))){var s=function(t){var r=t.declarations;if(r)for(var n=0,i=r;n<i.length;n++){var a=i[n];if((256===a.kind||255===a.kind&&e.nodeIsPresent(a.body))&&!(8388608&a.flags))return a}}(o);s&&(e.getSourceFileOfNode(t)!==e.getSourceFileOfNode(s)?In(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged):t.pos<s.pos&&In(t.name,e.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged));var c=e.getDeclarationOfKind(o,256);c&&(_=t,d=c,p=e.getEnclosingBlockScopeContainer(_),f=e.getEnclosingBlockScopeContainer(d),Xn(p)?Xn(f):!Xn(f)&&p===f)&&(Qn(t).flags|=32768);}if(a)if(e.isExternalModuleAugmentation(t)){if((n||33554432&$i(t).flags)&&t.body)for(var l=0,u=t.body.statements;l<u.length;l++)cS(u[l],n);}else Xn(t.parent)?n?In(t.name,e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations):e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name))&&In(t.name,e.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name):In(t.name,n?e.Diagnostics.Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations:e.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces);}var _,d,p,f;t.body&&(hS(t.body),e.isGlobalScopeAugmentation(t)||zx(t));}(t);case 265:return function(t){if(!pS(t,e.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)){if(!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_import_declaration_cannot_have_modifiers),lS(t)){var r=t.importClause;r&&!function(t){var r;return t.isTypeOnly&&t.name&&t.namedBindings?YT(t,e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both):!(!t.isTypeOnly||268!==(null===(r=t.namedBindings)||void 0===r?void 0:r.kind))&&tC(t.namedBindings)}(r)&&(r.name&&_S(r),r.namedBindings&&(267===r.namedBindings.kind?(_S(r.namedBindings),V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&e.getESModuleInterop(U)&&ST(t,65536)):Ri(t,t.moduleSpecifier)&&e.forEach(r.namedBindings.elements,_S)));}dS(t);}}(t);case 264:return function(t){if(!pS(t,e.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)&&(CT(t),e.isInternalModuleImportEqualsDeclaration(t)||lS(t)))if(_S(t),e.hasSyntacticModifier(t,1)&&Pi(t),276!==t.moduleReference.kind){var r=ki($i(t));if(r!==Ne){if(111551&r.flags){var n=e.getFirstIdentifier(t.moduleReference);1920&Mi(n,112575).flags||In(n,e.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name,e.declarationNameToString(n));}788968&r.flags&&GD(t.name,e.Diagnostics.Import_name_cannot_be_0);}t.isTypeOnly&&YT(t,e.Diagnostics.An_import_alias_cannot_use_import_type);}else !(V>=e.ModuleKind.ES2015&&void 0===e.getSourceFileOfNode(t).impliedNodeFormat)||t.isTypeOnly||8388608&t.flags||YT(t,e.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);}(t);case 271:return function(t){if(!pS(t,e.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)){if(!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_export_declaration_cannot_have_modifiers),t.moduleSpecifier&&t.exportClause&&e.isNamedExports(t.exportClause)&&e.length(t.exportClause.elements)&&0===K&&ST(t,4194304),function(t){var r;t.isTypeOnly&&(272===(null===(r=t.exportClause)||void 0===r?void 0:r.kind)?tC(t.exportClause):YT(t,e.Diagnostics.Only_named_exports_may_use_export_type));}(t),!t.moduleSpecifier||lS(t))if(t.exportClause&&!e.isNamespaceExport(t.exportClause)){e.forEach(t.exportClause.elements,mS);var r=261===t.parent.kind&&e.isAmbientModule(t.parent.parent),n=!r&&261===t.parent.kind&&!t.moduleSpecifier&&8388608&t.flags;303===t.parent.kind||r||n||In(t,e.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace);}else {var i=Ri(t,t.moduleSpecifier);i&&Vi(i)?In(t.moduleSpecifier,e.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk,Ia(i)):t.exportClause&&uS(t.exportClause),V!==e.ModuleKind.System&&(V<e.ModuleKind.ES2015||e.getSourceFileOfNode(t).impliedNodeFormat===e.ModuleKind.CommonJS)&&(t.exportClause?e.getESModuleInterop(U)&&ST(t,65536):ST(t,32768));}dS(t);}}(t);case 270:return function(t){if(!pS(t,t.isExportEquals?e.Diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration:e.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration)){var r=303===t.parent.kind?t.parent:t.parent.parent;if(260!==r.kind||e.isAmbientModule(r)){!CT(t)&&e.hasEffectiveModifiers(t)&&QT(t,e.Diagnostics.An_export_assignment_cannot_have_modifiers);var n=e.getEffectiveTypeAnnotationNode(t);if(n&&tp(zb(t.expression),dd(n),t.expression),79===t.expression.kind){var i=t.expression,a=Mi(i,67108863,!0,!0,t);if(a){Jm(a,i);var o=2097152&a.flags?ki(a):a;(o===Ne||111551&o.flags)&&zb(t.expression);}else zb(t.expression);e.getEmitDeclarations(U)&&Ga(t.expression,!0);}else zb(t.expression);yS(r),8388608&t.flags&&!e.isEntityNameExpression(t.expression)&&YT(t.expression,e.Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context),!t.isExportEquals||8388608&t.flags||(V>=e.ModuleKind.ES2015&&e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.CommonJS?YT(t,e.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead):V===e.ModuleKind.System&&YT(t,e.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system));}else t.isExportEquals?In(t,e.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace):In(t,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);}}(t);case 235:case 252:return void $T(t);case 275:!function(e){Bx(e);}(t);}}(t),_=n;}}function bS(t){e.isInJSFile(t)||YT(t,e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);}function xS(t){var r=Qn(e.getSourceFileOfNode(t));if(!(1&r.flags)){r.deferredNodes=r.deferredNodes||new e.Map;var n=O(t);r.deferredNodes.set(n,t);}}function DS(t){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkDeferredNode",{kind:t.kind,pos:t.pos,end:t.end});var r=_;switch(_=t,D=0,t.kind){case 207:case 208:case 209:case 164:case 279:zv(t);break;case 212:case 213:case 168:case 167:!function(t){e.Debug.assert(168!==t.kind||e.isObjectLiteralMethod(t));var r=e.getFunctionFlags(t),n=yl(t);if(vb(t,n),t.body)if(e.getEffectiveReturnTypeNode(t)||ml(cl(t)),234===t.body.kind)hS(t.body);else {var i=ax(t.body),a=n&&KD(n,r);a&&rp(2==(3&r)?Ex(i,!1,t.body,e.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member):i,a,t.body,t.body);}}(t);break;case 171:case 172:fx(t);break;case 225:!function(t){e.forEach(t.members,hS),zx(t);}(t);break;case 278:!function(e){Xy(e);}(t);break;case 277:!function(e){Xy(e.openingElement),Oy(e.closingElement.tagName)?jy(e.closingElement):ax(e.closingElement.tagName),Ly(e);}(t);}_=r,null===e.tracing||void 0===e.tracing||e.tracing.pop();}function SS(r){null===e.tracing||void 0===e.tracing||e.tracing.push("check","checkSourceFile",{path:r.path},!0),e.performance.mark("beforeCheck"),function(r){var n=Qn(r);if(!(1&n.flags)){if(e.skipTypeChecking(r,U,t))return;!function(t){8388608&t.flags&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if((e.isDeclaration(i)||236===i.kind)&&ZT(i))return !0}}(t);}(r),e.clear(_n),e.clear(dn),e.clear(pn),e.clear(fn),e.forEach(r.statements,hS),hS(r.endOfFileToken),function(e){var t=Qn(e);t.deferredNodes&&t.deferredNodes.forEach(DS);}(r),e.isExternalOrCommonJsModule(r)&&zx(r),r.isDeclarationFile||!U.noUnusedLocals&&!U.noUnusedParameters||Ux(CS(r),(function(t,r,n){!e.containsParseError(t)&&TS(r,!!(8388608&t.flags))&&mn.add(n);})),2===U.importsNotUsedAsValues&&!r.isDeclarationFile&&e.isExternalModule(r)&&function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];(fS(i)||gS(i))&&In(i,e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error);}}(r),e.isExternalOrCommonJsModule(r)&&yS(r),_n.length&&(e.forEach(_n,nD),e.clear(_n)),dn.length&&(e.forEach(dn,iD),e.clear(dn)),pn.length&&(e.forEach(pn,aD),e.clear(pn)),fn.length&&(e.forEach(fn,oD),e.clear(fn)),n.flags|=1;}}(r),e.performance.mark("afterCheck"),e.performance.measure("Check","beforeCheck","afterCheck"),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function TS(t,r){if(r)return !1;switch(t){case 0:return !!U.noUnusedLocals;case 1:return !!U.noUnusedParameters;default:return e.Debug.assertNever(t)}}function CS(t){return Jr.get(t.path)||e.emptyArray}function ES(r,n){try{return a=n,function(r){if(kS(),r){var n=mn.getGlobalDiagnostics(),i=n.length;SS(r);var a=mn.getDiagnostics(r.fileName),o=mn.getGlobalDiagnostics();if(o!==n){var s=e.relativeComplement(n,o,e.compareDiagnostics);return e.concatenate(s,a)}return 0===i&&o.length>0?e.concatenate(o,a):a}return e.forEach(t.getSourceFiles(),SS),mn.getDiagnostics()}(r)}finally{a=void 0;}}function kS(){if(!r)throw new Error("Trying to get diagnostics from a type checker that does not produce them.")}function NS(e){switch(e.kind){case 162:case 256:case 257:case 258:case 259:case 343:case 336:case 337:return !0;case 266:return e.isTypeOnly;case 269:case 274:return e.parent.parent.isTypeOnly;default:return !1}}function FS(e){for(;160===e.parent.kind;)e=e.parent;return 177===e.parent.kind}function AS(t,r){for(var n;(t=e.getContainingClass(t))&&!(n=r(t)););return n}function PS(e,t){return !!AS(e,(function(e){return e===t}))}function wS(e){return void 0!==function(e){for(;160===e.parent.kind;)e=e.parent;return 264===e.parent.kind?e.parent.moduleReference===e?e.parent:void 0:270===e.parent.kind&&e.parent.expression===e?e.parent:void 0}(e)}function IS(t){if(e.isDeclarationName(t))return $i(t.parent);if(e.isInJSFile(t)&&205===t.parent.kind&&t.parent===t.parent.parent.left&&!e.isPrivateIdentifier(t)&&!e.isJSDocMemberName(t)){var r=function(t){switch(e.getAssignmentDeclarationKind(t.parent.parent)){case 1:case 3:return $i(t.parent);case 4:case 2:case 5:return $i(t.parent.parent)}}(t);if(r)return r}if(270===t.parent.kind&&e.isEntityNameExpression(t)){var n=Mi(t,2998271,!0);if(n&&n!==Ne)return n}else if(e.isEntityName(t)&&wS(t)){var i=e.getAncestor(t,264);return e.Debug.assert(void 0!==i),Ii(t,!0)}if(e.isEntityName(t)){var a=function(t){for(var r=t.parent;e.isQualifiedName(r);)t=r,r=r.parent;if(r&&199===r.kind&&r.qualifier===t)return r}(t);if(a){dd(a);var o=Qn(t).resolvedSymbol;return o===Ne?void 0:o}}for(;e.isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(t);)t=t.parent;if(function(e){for(;205===e.parent.kind;)e=e.parent;return 227===e.parent.kind}(t)){var s=0;227===t.parent.kind?(s=788968,e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)&&(s|=111551)):s=1920,s|=2097152;var c=e.isEntityNameExpression(t)?Mi(t,s):void 0;if(c)return c}if(338===t.parent.kind)return e.getParameterSymbolFromJSDoc(t.parent);if(162===t.parent.kind&&342===t.parent.parent.kind){e.Debug.assert(!e.isInJSFile(t));var l=e.getTypeParameterFromJsDoc(t.parent);return l&&l.symbol}if(e.isExpressionNode(t)){if(e.nodeIsMissing(t))return;var u=e.findAncestor(t,e.or(e.isJSDocLinkLike,e.isJSDocNameReference,e.isJSDocMemberName));if(s=u?901119:111551,79===t.kind){if(e.isJSXTagName(t)&&Oy(t))return (f=jy(t.parent))===Ne?void 0:f;var _=Mi(t,s,!1,!u,e.getHostSignatureFromJSDoc(t));if(!_&&u){var d=e.findAncestor(t,e.or(e.isClassLike,e.isInterfaceDeclaration));if(d)return OS(t,$i(d))}return _}if(e.isPrivateIdentifier(t))return mv(t);if(205===t.kind||160===t.kind){var p=Qn(t);return p.resolvedSymbol?p.resolvedSymbol:(205===t.kind?dv(t,0):pv(t,0),!p.resolvedSymbol&&u&&e.isQualifiedName(t)?OS(t):p.resolvedSymbol)}if(e.isJSDocMemberName(t))return OS(t)}else if(FS(t)){var f;return (f=Mi(t,s=177===t.parent.kind?788968:1920,!1,!0))&&f!==Ne?f:Hl(t)}return 176===t.parent.kind?Mi(t,1):void 0}function OS(t,r){if(e.isEntityName(t)){var n=901119,i=Mi(t,n,!1,!0,e.getHostSignatureFromJSDoc(t));if(!i&&e.isIdentifier(t)&&r&&(i=Zi(Yn(Gi(r),t.escapedText,n))),i)return i}var a=e.isIdentifier(t)?r:OS(t.left),o=e.isIdentifier(t)?t.escapedText:t.right.escapedText;if(a){var s=111551&a.flags&&Jc(Uo(a),"prototype");return Jc(s?Uo(s):ms(a),o)}}function MS(t,r){if(303===t.kind)return e.isExternalModule(t)?Zi(t.symbol):void 0;var n=t.parent,i=n.parent;if(!(16777216&t.flags)){if(B(t)){var a=$i(n);return e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t?Py(a):a}if(e.isLiteralComputedPropertyDeclarationName(t))return $i(n.parent);if(79===t.kind){if(wS(t))return IS(t);if(202===n.kind&&200===i.kind&&t===n.propertyName){if(o=Jc(LS(i),t.escapedText))return o}else if(e.isMetaProperty(n)){var o;if(o=Jc(LS(n),t.escapedText))return o;if(103===n.keywordToken)return Uh(n).symbol}}switch(t.kind){case 79:case 80:case 205:case 160:return IS(t);case 108:var s=e.getThisContainer(t,!1);if(e.isFunctionLike(s)){var c=cl(s);if(c.thisParameter)return c.thisParameter}if(e.isInExpressionContext(t))return ax(t).symbol;case 191:return ld(t).symbol;case 106:return ax(t).symbol;case 134:var l=t.parent;return l&&170===l.kind?l.parent.symbol:void 0;case 10:case 14:if(e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t||(265===t.parent.kind||271===t.parent.kind)&&t.parent.moduleSpecifier===t||e.isInJSFile(t)&&e.isRequireCall(t.parent,!1)||e.isImportCall(t.parent)||e.isLiteralTypeNode(t.parent)&&e.isLiteralImportTypeNode(t.parent.parent)&&t.parent.parent.argument===t.parent)return Ri(t,t,r);if(e.isCallExpression(n)&&e.isBindableObjectDefinePropertyCall(n)&&n.arguments[1]===t)return $i(n);case 8:var u=e.isElementAccessExpression(n)?n.argumentExpression===t?rx(n.expression):void 0:e.isLiteralTypeNode(n)&&e.isIndexedAccessTypeNode(i)?dd(i.objectType):void 0;return u&&Jc(u,e.escapeLeadingUnderscores(t.text));case 88:case 98:case 38:case 84:return $i(t.parent);case 199:return e.isLiteralImportTypeNode(t)?MS(t.argument.literal,r):void 0;case 93:return e.isExportAssignment(t.parent)?e.Debug.checkDefined(t.parent.symbol):void 0;case 100:case 103:return e.isMetaProperty(t.parent)?zh(t.parent).symbol:void 0;case 230:return ax(t).symbol;default:return}}}function LS(t){if(e.isSourceFile(t)&&!e.isExternalModule(t))return Me;if(16777216&t.flags)return Me;var r,n,i=e.tryGetClassImplementingOrExtendingExpressionWithTypeArguments(t),a=i&&ss($i(i.class));if(e.isPartOfTypeNode(t)){var o=dd(t);return a?Ls(o,a.thisType):o}if(e.isExpressionNode(t))return BS(t);if(a&&!i.isImplements){var s=e.firstOrUndefined(is(a));return s?Ls(s,a.thisType):Me}if(NS(t))return ms(n=$i(t));if(79===(r=t).kind&&NS(r.parent)&&e.getNameOfDeclaration(r.parent)===r)return (n=MS(t))?ms(n):Me;if(e.isDeclaration(t))return Uo(n=$i(t));if(B(t))return (n=MS(t))?Uo(n):Me;if(e.isBindingPattern(t))return mo(t.parent,!0)||Me;if(wS(t)&&(n=MS(t))){var c=ms(n);return ro(c)?Uo(n):c}return e.isMetaProperty(t.parent)&&t.parent.keywordToken===t.kind?zh(t.parent):Me}function RS(t){if(e.Debug.assert(204===t.kind||203===t.kind),243===t.parent.kind)return Ib(t,vD(t.parent)||Me);if(220===t.parent.kind)return Ib(t,rx(t.parent.right)||Me);if(294===t.parent.kind){var r=e.cast(t.parent.parent,e.isObjectLiteralExpression);return Pb(r,RS(r)||Me,e.indexOfNode(r.properties,t.parent))}var n=e.cast(t.parent,e.isArrayLiteralExpression),i=RS(n)||Me,a=hD(65,i,ze,t.parent)||Me;return wb(n,i,n.elements.indexOf(t),a)}function BS(t){return e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),rd(rx(t))}function jS(t){var r=$i(t.parent);return e.isStatic(t)?Uo(r):ms(r)}function JS(t){var r=t.name;switch(r.kind){case 79:return id(e.idText(r));case 8:case 10:return id(r.text);case 161:var n=Ny(r);return kb(n,12288)?n:He;default:return e.Debug.fail("Unsupported property name.")}}function zS(t){t=Ac(t);var r=e.createSymbolTable(yc(t)),n=Uc(t,0).length?It:Uc(t,1).length?Ot:void 0;return n&&e.forEach(yc(n),(function(e){r.has(e.escapedName)||r.set(e.escapedName,e);})),fa(r)}function US(t){return e.typeHasCallOrConstructSignatures(t,de)}function KS(t){if(e.isGeneratedIdentifier(t))return !1;var r=e.getParseTreeNode(t,e.isIdentifier);if(!r)return !1;var n=r.parent;return !(!n||(e.isPropertyAccessExpression(n)||e.isPropertyAssignment(n))&&n.name===r||mT(r)!==ue)}function VS(t){var r=Ri(t.parent,t);if(!r||e.isShorthandAmbientModuleSymbol(r))return !0;var n=Vi(r),i=Gn(r=zi(r));return void 0===i.exportsSomeValue&&(i.exportsSomeValue=n?!!(111551&r.flags):e.forEachEntry(Qi(r),(function(e){return (e=Ei(e))&&!!(111551&e.flags)}))),i.exportsSomeValue}function qS(t,r){var n,i=e.getParseTreeNode(t,e.isIdentifier);if(i){var a=mT(i,function(t){return e.isModuleOrEnumDeclaration(t.parent)&&t===t.parent.name}(i));if(a){if(1048576&a.flags){var o=Zi(a.exportSymbol);if(!r&&944&o.flags&&!(3&o.flags))return;a=o;}var s=ea(a);if(s){if(512&s.flags&&303===(null===(n=s.valueDeclaration)||void 0===n?void 0:n.kind)){var c=s.valueDeclaration;return c!==e.getSourceFileOfNode(i)?void 0:c}return e.findAncestor(i.parent,(function(t){return e.isModuleOrEnumDeclaration(t)&&$i(t)===s}))}}}}function WS(t){if(t.generatedImportReference)return t.generatedImportReference;var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(Ci(n,111551)&&!Ai(n))return di(n)}}function HS(t){if(418&t.flags&&t.valueDeclaration&&!e.isSourceFile(t.valueDeclaration)){var r=Gn(t);if(void 0===r.isDeclarationWithCollidingName){var n=e.getEnclosingBlockScopeContainer(t.valueDeclaration);if(e.isStatementWithLocals(n)||function(t){return t.valueDeclaration&&e.isBindingElement(t.valueDeclaration)&&291===e.walkUpBindingElementsAndPatterns(t.valueDeclaration).parent.kind}(t)){var i=Qn(t.valueDeclaration);if(ei(n.parent,t.escapedName,111551,void 0,void 0,!1))r.isDeclarationWithCollidingName=!0;else if(262144&i.flags){var a=524288&i.flags,o=e.isIterationStatement(n,!1),s=234===n.kind&&e.isIterationStatement(n.parent,!1);r.isDeclarationWithCollidingName=!(e.isBlockScopedContainerTopLevel(n)||a&&(o||s));}else r.isDeclarationWithCollidingName=!1;}}return r.isDeclarationWithCollidingName}return !1}function GS(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(n&&HS(n))return n.valueDeclaration}}}function QS(t){var r=e.getParseTreeNode(t,e.isDeclaration);if(r){var n=$i(r);if(n)return HS(n)}return !1}function XS(t){switch(t.kind){case 264:return ZS($i(t));case 266:case 267:case 269:case 274:var r=$i(t);return !!r&&ZS(r)&&!Ai(r);case 271:var n=t.exportClause;return !!n&&(e.isNamespaceExport(n)||e.some(n.elements,XS));case 270:return !t.expression||79!==t.expression.kind||ZS($i(t))}return !1}function YS(t){var r=e.getParseTreeNode(t,e.isImportEqualsDeclaration);return !(void 0===r||303!==r.parent.kind||!e.isInternalModuleImportEqualsDeclaration(r))&&ZS($i(r))&&r.moduleReference&&!e.nodeIsMissing(r.moduleReference)}function ZS(t){if(!t)return !1;var r=ki(t);return r===Ne||!!(111551&r.flags)&&(e.shouldPreserveConstEnums(U)||!$S(r))}function $S(e){return Ab(e)||!!e.constEnumOnlyModule}function eT(t,r){if(pi(t)){var n=$i(t),i=n&&Gn(n);if(null==i?void 0:i.referenced)return !0;var a=Gn(n).target;if(a&&1&e.getEffectiveModifierFlags(t)&&111551&a.flags&&(e.shouldPreserveConstEnums(U)||!$S(a)))return !0}return !!r&&!!e.forEachChild(t,(function(e){return eT(e,r)}))}function tT(t){if(e.nodeIsPresent(t.body)){if(e.isGetAccessor(t)||e.isSetAccessor(t))return !1;var r=_l($i(t));return r.length>1||1===r.length&&r[0].declaration!==t}return !1}function rT(t){return !(!H||nl(t)||e.isJSDocParameterTag(t)||!t.initializer||e.hasSyntacticModifier(t,16476))}function nT(t){return H&&nl(t)&&!t.initializer&&e.hasSyntacticModifier(t,16476)}function iT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return !1;var n=$i(r);return !!(n&&16&n.flags)&&!!e.forEachEntry(Gi(n),(function(t){return 111551&t.flags&&t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)}))}function aT(t){var r=e.getParseTreeNode(t,e.isFunctionDeclaration);if(!r)return e.emptyArray;var n=$i(r);return n&&yc(Uo(n))||e.emptyArray}function oT(e){var t,r=e.id||0;return r<0||r>=tn.length?0:(null===(t=tn[r])||void 0===t?void 0:t.flags)||0}function sT(e){return iS(e.parent),Qn(e).enumMemberValue}function cT(e){switch(e.kind){case 297:case 205:case 206:return !0}return !1}function lT(t){if(297===t.kind)return sT(t);var r=Qn(t).resolvedSymbol;if(r&&8&r.flags){var n=r.valueDeclaration;if(e.isEnumConst(n.parent))return sT(n)}}function uT(e){return !!(524288&e.flags)&&Uc(e,0).length>0}function _T(t,r){var n,i,a=e.getParseTreeNode(t,e.isEntityName);if(!a)return e.TypeReferenceSerializationKind.Unknown;if(r&&!(r=e.getParseTreeNode(r)))return e.TypeReferenceSerializationKind.Unknown;var o=!1;if(e.isQualifiedName(a)){var s=Mi(e.getFirstIdentifier(a),111551,!0,!0,r);o=!!(null===(n=null==s?void 0:s.declarations)||void 0===n?void 0:n.every(e.isTypeOnlyImportOrExportDeclaration));}var c=Mi(a,111551,!0,!0,r),l=c&&2097152&c.flags?ki(c):c;o||(o=!!(null===(i=null==c?void 0:c.declarations)||void 0===i?void 0:i.every(e.isTypeOnlyImportOrExportDeclaration)));var u=Mi(a,788968,!0,!1,r);if(l&&l===u){var _=vu(!1);if(_&&l===_)return e.TypeReferenceSerializationKind.Promise;var d=Uo(l);if(d&&Zo(d))return o?e.TypeReferenceSerializationKind.TypeWithCallSignature:e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue}if(!u)return o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown;var p=ms(u);return ro(p)?o?e.TypeReferenceSerializationKind.ObjectType:e.TypeReferenceSerializationKind.Unknown:3&p.flags?e.TypeReferenceSerializationKind.ObjectType:kb(p,245760)?e.TypeReferenceSerializationKind.VoidNullableOrNeverType:kb(p,528)?e.TypeReferenceSerializationKind.BooleanType:kb(p,296)?e.TypeReferenceSerializationKind.NumberLikeType:kb(p,2112)?e.TypeReferenceSerializationKind.BigIntLikeType:kb(p,402653316)?e.TypeReferenceSerializationKind.StringLikeType:_f(p)?e.TypeReferenceSerializationKind.ArrayLikeType:kb(p,12288)?e.TypeReferenceSerializationKind.ESSymbolType:uT(p)?e.TypeReferenceSerializationKind.TypeWithCallSignature:qp(p)?e.TypeReferenceSerializationKind.ArrayLikeType:e.TypeReferenceSerializationKind.ObjectType}function dT(t,r,n,i,a){var o=e.getParseTreeNode(t,e.isVariableLikeOrAccessor);if(!o)return e.factory.createToken(130);var s=$i(o),c=!s||133120&s.flags?Me:sf(Uo(s));return 8192&c.flags&&c.symbol===s&&(n|=1048576),a&&(c=Df(c)),ae.typeToTypeNode(c,r,1024|n,i)}function pT(t,r,n,i){var a=e.getParseTreeNode(t,e.isFunctionLike);if(!a)return e.factory.createToken(130);var o=cl(a);return ae.typeToTypeNode(ml(o),r,1024|n,i)}function fT(t,r,n,i){var a=e.getParseTreeNode(t,e.isExpression);if(!a)return e.factory.createToken(130);var o=jf(BS(a));return ae.typeToTypeNode(o,r,1024|n,i)}function gT(t){return oe.has(e.escapeLeadingUnderscores(t))}function mT(t,r){var n=Qn(t).resolvedSymbol;if(n)return n;var i=t;if(r){var a=t.parent;e.isDeclaration(a)&&t===a.name&&(i=$a(a));}return ei(i,t.escapedText,3257279,void 0,void 0,!0)}function yT(t){if(!e.isGeneratedIdentifier(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r){var n=mT(r);if(n)return aa(n).valueDeclaration}}}function vT(t){return !!(e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t))&&nd(Uo($i(t)))}function hT(t,r){return function(t,r,n){var i=1024&t.flags?ae.symbolToExpression(t.symbol,111551,r,void 0,n):t===Ze?e.factory.createTrue():t===Xe&&e.factory.createFalse();if(i)return i;var a=t.value;return "object"==typeof a?e.factory.createBigIntLiteral(a):"number"==typeof a?e.factory.createNumericLiteral(a):e.factory.createStringLiteral(a)}(Uo($i(t)),t,r)}function bT(t){return t?(Nn(t),e.getSourceFileOfNode(t).localJsxFactory||Dr):Dr}function xT(t){if(t){var r=e.getSourceFileOfNode(t);if(r){if(r.localJsxFragmentFactory)return r.localJsxFragmentFactory;var n=r.pragmas.get("jsxfrag"),i=e.isArray(n)?n[0]:n;if(i)return r.localJsxFragmentFactory=e.parseIsolatedEntityName(i.arguments.factory,K),r.localJsxFragmentFactory}}if(U.jsxFragmentFactory)return e.parseIsolatedEntityName(U.jsxFragmentFactory,K)}function DT(t){var r=260===t.kind?e.tryCast(t.name,e.isStringLiteral):e.getExternalModuleName(t),n=Bi(r,r,void 0);if(n)return e.getDeclarationOfKind(n,303)}function ST(t,r){if((s&r)!==r&&U.importHelpers){var n=e.getSourceFileOfNode(t);if(e.isEffectiveExternalModule(n,U)&&!(8388608&t.flags)){var i=(_=n,d=t,u||(u=ji(_,e.externalHelpersModuleNameText,e.Diagnostics.This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found,d)||Ne),u);if(i!==Ne)for(var a=r&~s,o=1;o<=4194304;o<<=1)if(a&o){var c=TT(o),l=Yn(i.exports,e.escapeLeadingUnderscores(c),111551);l?524288&o?e.some(_l(l),(function(e){return Zh(e)>3}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,4):1048576&o?e.some(_l(l),(function(e){return Zh(e)>4}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,5):1024&o&&(e.some(_l(l),(function(e){return Zh(e)>2}))||In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c,3)):In(t,e.Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0,e.externalHelpersModuleNameText,c);}s|=r;}}var _,d;}function TT(t){switch(t){case 1:return "__extends";case 2:return "__assign";case 4:return "__rest";case 8:return "__decorate";case 16:return "__metadata";case 32:return "__param";case 64:return "__awaiter";case 128:return "__generator";case 256:return "__values";case 512:return "__read";case 1024:return "__spreadArray";case 2048:return "__await";case 4096:return "__asyncGenerator";case 8192:return "__asyncDelegator";case 16384:return "__asyncValues";case 32768:return "__exportStar";case 65536:return "__importStar";case 131072:return "__importDefault";case 262144:return "__makeTemplateObject";case 524288:return "__classPrivateFieldGet";case 1048576:return "__classPrivateFieldSet";case 2097152:return "__classPrivateFieldIn";case 4194304:return "__createBinding";default:return e.Debug.fail("Unrecognized helper")}}function CT(t){return function(t){if(!t.decorators)return !1;if(!e.nodeCanBeDecorated(t,t.parent,t.parent.parent))return 168!==t.kind||e.nodeIsPresent(t.body)?QT(t,e.Diagnostics.Decorators_are_not_valid_here):QT(t,e.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload);if(171===t.kind||172===t.kind){var r=e.getAllAccessorDeclarations(t.parent.members,t);if(r.firstAccessor.decorators&&t===r.secondAccessor)return QT(t,e.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name)}return !1}(t)||function(t){var r,n,i,a,o,s=function(t){return !!t.modifiers&&(function(t){switch(t.kind){case 171:case 172:case 170:case 166:case 165:case 168:case 167:case 175:case 260:case 265:case 264:case 271:case 270:case 212:case 213:case 163:return !1;default:if(261===t.parent.kind||303===t.parent.kind)return !1;switch(t.kind){case 255:return ET(t,131);case 256:case 179:return ET(t,126);case 257:case 236:case 258:case 169:return !0;case 259:return ET(t,85);default:e.Debug.fail();}}}(t)?QT(t,e.Diagnostics.Modifiers_cannot_appear_here):void 0)}(t);if(void 0!==s)return s;for(var c=0,l=0,u=t.modifiers;l<u.length;l++){var _=u[l];if(144!==_.kind){if(165===t.kind||167===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_type_member,e.tokenToString(_.kind));if(175===t.kind&&(124!==_.kind||!e.isClassLike(t.parent)))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_an_index_signature,e.tokenToString(_.kind))}switch(_.kind){case 85:if(259!==t.kind)return YT(t,e.Diagnostics.A_class_member_cannot_have_the_0_keyword,e.tokenToString(85));break;case 158:if(16384&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"override");if(2&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"override","declare");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"override","async");c|=16384,o=_;break;case 123:case 122:case 121:var d=Ua(e.modifierToFlag(_.kind));if(28&c)return YT(_,e.Diagnostics.Accessibility_modifier_already_seen);if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"override");if(32&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"static");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"async");if(261===t.parent.kind||303===t.parent.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,d);if(128&c)return 121===_.kind?YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,d,"abstract"):YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,d,"abstract");if(e.isPrivateIdentifierClassElementDeclaration(t))return YT(_,e.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);c|=e.modifierToFlag(_.kind);break;case 124:if(32&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"static");if(64&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","readonly");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","async");if(261===t.parent.kind||303===t.parent.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element,"static");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"static");if(128&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"static","override");c|=32,r=_;break;case 144:if(64&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"readonly");if(166!==t.kind&&165!==t.kind&&175!==t.kind&&163!==t.kind)return YT(_,e.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature);c|=64,a=_;break;case 93:if(1&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"export");if(2&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","declare");if(128&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","abstract");if(256&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","async");if(e.isClassLike(t.parent))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"export");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"export");c|=1;break;case 88:var p=303===t.parent.kind?t.parent:t.parent.parent;if(260===p.kind&&!e.isAmbientModule(p))return YT(_,e.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);if(!(1&c))return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"export","default");c|=512;break;case 135:if(2&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"declare");if(256&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(16384&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"override");if(e.isClassLike(t.parent)&&!e.isPropertyDeclaration(t))return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind,"declare");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"declare");if(8388608&t.parent.flags&&261===t.parent.kind)return YT(_,e.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context);if(e.isPrivateIdentifierClassElementDeclaration(t))return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"declare");c|=2,n=_;break;case 126:if(128&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"abstract");if(256!==t.kind&&179!==t.kind){if(168!==t.kind&&166!==t.kind&&171!==t.kind&&172!==t.kind)return YT(_,e.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);if(256!==t.parent.kind||!e.hasSyntacticModifier(t.parent,128))return YT(_,e.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class);if(32&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"static","abstract");if(8&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"private","abstract");if(256&c&&i)return YT(i,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");if(16384&c)return YT(_,e.Diagnostics._0_modifier_must_precede_1_modifier,"abstract","override")}if(e.isNamedDeclaration(t)&&80===t.name.kind)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_a_private_identifier,"abstract");c|=128;break;case 131:if(256&c)return YT(_,e.Diagnostics._0_modifier_already_seen,"async");if(2&c||8388608&t.parent.flags)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context,"async");if(163===t.kind)return YT(_,e.Diagnostics._0_modifier_cannot_appear_on_a_parameter,"async");if(128&c)return YT(_,e.Diagnostics._0_modifier_cannot_be_used_with_1_modifier,"async","abstract");c|=256,i=_;}}return 170===t.kind?32&c?YT(r,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"static"):128&c?YT(r,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"abstract"):16384&c?YT(o,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"override"):256&c?YT(i,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"async"):!!(64&c)&&YT(a,e.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration,"readonly"):(265===t.kind||264===t.kind)&&2&c?YT(n,e.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration,"declare"):163===t.kind&&16476&c&&e.isBindingPattern(t.name)?YT(t,e.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern):163===t.kind&&16476&c&&t.dotDotDotToken?YT(t,e.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter):!!(256&c)&&function(t,r){switch(t.kind){case 168:case 255:case 212:case 213:return !1}return YT(r,e.Diagnostics._0_modifier_cannot_be_used_here,"async")}(t,i)}(t)}function ET(e,t){return e.modifiers.length>1||e.modifiers[0].kind!==t}function kT(t,r){return void 0===r&&(r=e.Diagnostics.Trailing_comma_not_allowed),!(!t||!t.hasTrailingComma)&&XT(t[0],t.end-",".length,",".length,r)}function NT(t,r){if(t&&0===t.length){var n=t.pos-"<".length;return XT(r,n,e.skipTrivia(r.text,t.end)+">".length-n,e.Diagnostics.Type_parameter_list_cannot_be_empty)}return !1}function FT(t){var r=e.getSourceFileOfNode(t);return CT(t)||NT(t.typeParameters,r)||function(t){for(var r=!1,n=t.length,i=0;i<n;i++){var a=t[i];if(a.dotDotDotToken){if(i!==n-1)return YT(a.dotDotDotToken,e.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list);if(8388608&a.flags||kT(t,e.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma),a.questionToken)return YT(a.questionToken,e.Diagnostics.A_rest_parameter_cannot_be_optional);if(a.initializer)return YT(a.name,e.Diagnostics.A_rest_parameter_cannot_have_an_initializer)}else if(nl(a)){if(r=!0,a.questionToken&&a.initializer)return YT(a.name,e.Diagnostics.Parameter_cannot_have_question_mark_and_initializer)}else if(r&&!a.initializer)return YT(a.name,e.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter)}}(t.parameters)||function(t,r){if(!e.isArrowFunction(t))return !1;t.typeParameters&&!(e.length(t.typeParameters)>1||t.typeParameters.hasTrailingComma||t.typeParameters[0].constraint)&&r&&e.fileExtensionIsOneOf(r.fileName,[".mts",".cts"])&&YT(t.typeParameters[0],e.Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint);var n=t.equalsGreaterThanToken;return e.getLineAndCharacterOfPosition(r,n.pos).line!==e.getLineAndCharacterOfPosition(r,n.end).line&&YT(n,e.Diagnostics.Line_terminator_not_permitted_before_arrow)}(t,r)||e.isFunctionLikeDeclaration(t)&&function(t){if(K>=3){var r=t.body&&e.isBlock(t.body)&&e.findUseStrictPrologue(t.body.statements);if(r){var i=(o=t.parameters,e.filter(o,(function(t){return !!t.initializer||e.isBindingPattern(t.name)||e.isRestParameter(t)})));if(e.length(i)){e.forEach(i,(function(t){e.addRelatedInfo(In(t,e.Diagnostics.This_parameter_is_not_allowed_with_use_strict_directive),e.createDiagnosticForNode(r,e.Diagnostics.use_strict_directive_used_here));}));var a=i.map((function(t,r){return 0===r?e.createDiagnosticForNode(t,e.Diagnostics.Non_simple_parameter_declared_here):e.createDiagnosticForNode(t,e.Diagnostics.and_here)}));return e.addRelatedInfo.apply(void 0,n$3([In(r,e.Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list)],a,!1)),!0}}}var o;return !1}(t)}function AT(t,r){return kT(r)||function(t,r){if(r&&0===r.length){var n=e.getSourceFileOfNode(t),i=r.pos-"<".length;return XT(n,i,e.skipTrivia(n.text,r.end)+">".length-i,e.Diagnostics.Type_argument_list_cannot_be_empty)}return !1}(t,r)}function PT(t){return function(t){if(t)for(var r=0,n=t;r<n.length;r++){var i=n[r];if(226===i.kind)return XT(i,i.pos,0,e.Diagnostics.Argument_expression_expected)}return !1}(t)}function wT(t){var r=t.types;if(kT(r))return !0;if(r&&0===r.length){var n=e.tokenToString(t.token);return XT(t,r.pos,0,e.Diagnostics._0_list_cannot_be_empty,n)}return e.some(r,IT)}function IT(e){return AT(e,e.typeArguments)}function OT(t){if(161!==t.kind)return !1;var r=t;return 220===r.expression.kind&&27===r.expression.operatorToken.kind&&YT(r.expression,e.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name)}function MT(t){if(t.asteriskToken){if(e.Debug.assert(255===t.kind||212===t.kind||168===t.kind),8388608&t.flags)return YT(t.asteriskToken,e.Diagnostics.Generators_are_not_allowed_in_an_ambient_context);if(!t.body)return YT(t.asteriskToken,e.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator)}}function LT(e,t){return !!e&&YT(e,t)}function RT(e,t){return !!e&&YT(e,t)}function BT(t){if($T(t))return !0;if(243===t.kind&&t.awaitModifier&&!(32768&t.flags)){var r=e.getSourceFileOfNode(t);if(e.isInTopLevelContext(t))GT(r)||(e.isEffectiveExternalModule(r,U)||mn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module)),(V!==e.ModuleKind.ES2022&&V!==e.ModuleKind.ESNext&&V!==e.ModuleKind.System&&(V!==e.ModuleKind.NodeNext||e.getSourceFileOfNode(t).impliedNodeFormat!==e.ModuleKind.ESNext)||K<4)&&mn.add(e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher)));else if(!GT(r)){var n=e.createDiagnosticForNode(t.awaitModifier,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules),i=e.getContainingFunction(t);if(i&&170!==i.kind){e.Debug.assert(0==(2&e.getFunctionFlags(i)),"Enclosing function should never be an async function.");var a=e.createDiagnosticForNode(i,e.Diagnostics.Did_you_mean_to_mark_this_function_as_async);e.addRelatedInfo(n,a);}return mn.add(n),!0}return !1}if(e.isForOfStatement(t)&&!(32768&t.flags)&&e.isIdentifier(t.initializer)&&"async"===t.initializer.escapedText)return YT(t.initializer,e.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async),!1;if(254===t.initializer.kind){var o=t.initializer;if(!WT(o)){var s=o.declarations;if(!s.length)return !1;if(s.length>1)return n=242===t.kind?e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement:e.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement,QT(o.declarations[1],n);var c=s[0];if(c.initializer){n=242===t.kind?e.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer:e.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer;return YT(c.name,n)}if(c.type)return YT(c,n=242===t.kind?e.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation:e.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation)}}return !1}function jT(t){if(t.parameters.length===(171===t.kind?1:2))return e.getThisParameter(t)}function JT(t,r){if(function(t){return e.isDynamicName(t)&&!ks(t)}(t))return YT(t,r)}function zT(t){if(FT(t))return !0;if(168===t.kind){if(204===t.parent.kind){if(t.modifiers&&(1!==t.modifiers.length||131!==e.first(t.modifiers).kind))return QT(t,e.Diagnostics.Modifiers_cannot_appear_here);if(LT(t.questionToken,e.Diagnostics.An_object_member_cannot_be_declared_optional))return !0;if(RT(t.exclamationToken,e.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context))return !0;if(void 0===t.body)return XT(t,t.end-1,";".length,e.Diagnostics._0_expected,"{")}if(MT(t))return !0}if(e.isClassLike(t.parent)){if(K<2&&e.isPrivateIdentifier(t.name))return YT(t.name,e.Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);if(8388608&t.flags)return JT(t.name,e.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(168===t.kind&&!t.body)return JT(t.name,e.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}else {if(257===t.parent.kind)return JT(t.name,e.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type);if(181===t.parent.kind)return JT(t.name,e.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)}}function UT(t){return e.isStringOrNumericLiteralLike(t)||218===t.kind&&40===t.operator&&8===t.operand.kind}function KT(t){var r,n=t.initializer;if(n){var i=!(UT(n)||function(t){if((e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)&&UT(t.argumentExpression))&&e.isEntityNameExpression(t.expression))return !!(1024&zb(t).flags)}(n)||110===n.kind||95===n.kind||(r=n,9===r.kind||218===r.kind&&40===r.operator&&9===r.operand.kind)),a=e.isDeclarationReadonly(t)||e.isVariableDeclaration(t)&&e.isVarConst(t);if(!a||t.type)return YT(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts);if(i)return YT(n,e.Diagnostics.A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference);if(!a||i)return YT(n,e.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts)}}function VT(t){if(79===t.kind){if("__esModule"===e.idText(t))return a=t,o=e.Diagnostics.Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules,!GT(e.getSourceFileOfNode(a))&&(Pn("noEmit",a,o,void 0,void 0,void 0),!0)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];if(!e.isOmittedExpression(i))return VT(i.name)}var a,o;return !1}function qT(t){if(79===t.kind){if(119===t.originalKeywordKind)return YT(t,e.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations)}else for(var r=0,n=t.elements;r<n.length;r++){var i=n[r];e.isOmittedExpression(i)||qT(i.name);}return !1}function WT(t){var r=t.declarations;return !!kT(t.declarations)||!t.declarations.length&&XT(t,r.pos,r.end-r.pos,e.Diagnostics.Variable_declaration_list_cannot_be_empty)}function HT(e){switch(e.kind){case 238:case 239:case 240:case 247:case 241:case 242:case 243:return !1;case 249:return HT(e.parent)}return !0}function GT(e){return e.parseDiagnostics.length>0}function QT(t,r,n,i,a){var o=e.getSourceFileOfNode(t);if(!GT(o)){var s=e.getSpanOfTokenAtPosition(o,t.pos);return mn.add(e.createFileDiagnostic(o,s.start,s.length,r,n,i,a)),!0}return !1}function XT(t,r,n,i,a,o,s){var c=e.getSourceFileOfNode(t);return !GT(c)&&(mn.add(e.createFileDiagnostic(c,r,n,i,a,o,s)),!0)}function YT(t,r,n,i,a){return !GT(e.getSourceFileOfNode(t))&&(mn.add(e.createDiagnosticForNode(t,r,n,i,a)),!0)}function ZT(t){return 257!==t.kind&&258!==t.kind&&265!==t.kind&&264!==t.kind&&271!==t.kind&&270!==t.kind&&263!==t.kind&&!e.hasSyntacticModifier(t,515)&&QT(t,e.Diagnostics.Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier)}function $T(t){if(8388608&t.flags){if(!Qn(t).hasReportedStatementInAmbientContext&&(e.isFunctionLike(t.parent)||e.isAccessor(t.parent)))return Qn(t).hasReportedStatementInAmbientContext=QT(t,e.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts);if(234===t.parent.kind||261===t.parent.kind||303===t.parent.kind){var r=Qn(t.parent);if(!r.hasReportedStatementInAmbientContext)return r.hasReportedStatementInAmbientContext=QT(t,e.Diagnostics.Statements_are_not_allowed_in_ambient_contexts)}}return !1}function eC(t){if(32&t.numericLiteralFlags){var r=void 0;if(K>=1?r=e.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0:e.isChildOfNodeWithKind(t,195)?r=e.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0:e.isChildOfNodeWithKind(t,297)&&(r=e.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0),r){var n=e.isPrefixUnaryExpression(t.parent)&&40===t.parent.operator,i=(n?"-":"")+"0o"+t.text;return YT(n?t.parent:t,r,i)}}return function(t){if(!(16&t.numericLiteralFlags||t.text.length<=15||-1!==t.text.indexOf("."))){var r=+e.getTextOfNode(t);r<=Math.pow(2,53)-1&&r+1>r||On(!1,e.createDiagnosticForNode(t,e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers));}}(t),!1}function tC(t){return !!e.forEach(t.elements,(function(t){if(t.isTypeOnly)return QT(t,269===t.kind?e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement:e.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement)}))}function rC(t,r,n,i){if(1048576&r.flags&&2621440&t.flags){var a=Og(r,t);if(a)return a;var o=yc(t);if(o){var s=Pg(o,r);if(s)return kp(r,e.map(s,(function(e){return [function(){return Uo(e)},e.escapedName]})),n,void 0,i)}}}},function(e){e.JSX="JSX",e.IntrinsicElements="IntrinsicElements",e.ElementClass="ElementClass",e.ElementAttributesPropertyNameContainer="ElementAttributesProperty",e.ElementChildrenAttributeNameContainer="ElementChildrenAttribute",e.Element="Element",e.IntrinsicAttributes="IntrinsicAttributes",e.IntrinsicClassAttributes="IntrinsicClassAttributes",e.LibraryManagedAttributes="LibraryManagedAttributes";}(A||(A={})),e.signatureHasRestParameter=J,e.signatureHasLiteralTypes=z;}(t),function(e){function t(t,r,n,i){if(void 0===t||void 0===r)return t;var a,o=r(t);return o===t?t:void 0!==o?(a=e.isArray(o)?(i||c)(o):o,e.Debug.assertNode(a,n),a):void 0}function r(t,r,n,i,a){if(void 0===t||void 0===r)return t;var o,s,c=t.length;(void 0===i||i<0)&&(i=0),(void 0===a||a>c-i)&&(a=c-i);var l=-1,u=-1;(i>0||a<c)&&(o=[],s=t.hasTrailingComma&&i+a===c);for(var _=0;_<a;_++){var d=t[_+i],p=void 0!==d?r(d):void 0;if((void 0!==o||void 0===p||p!==d)&&(void 0===o&&(o=t.slice(0,_),s=t.hasTrailingComma,l=t.pos,u=t.end),p))if(e.isArray(p))for(var f=0,g=p;f<g.length;f++){var m=g[f];e.Debug.assertNode(m,n),o.push(m);}else e.Debug.assertNode(p,n),o.push(p);}if(o){var y=e.factory.createNodeArray(o,s);return e.setTextRangePosEnd(y,l,u),y}return t}function n(t,n,i,a,o,s){return void 0===s&&(s=r),i.startLexicalEnvironment(),t=s(t,n,e.isStatement,a),o&&(t=i.factory.ensureUseStrict(t)),e.factory.mergeLexicalEnvironment(t,i.endLexicalEnvironment())}function i(t,n,i,o){var s;return void 0===o&&(o=r),i.startLexicalEnvironment(),t&&(i.setLexicalEnvironmentFlags(1,!0),s=o(t,n,e.isParameterDeclaration),2&i.getLexicalEnvironmentFlags()&&e.getEmitScriptTarget(i.getCompilerOptions())>=2&&(s=function(t,r){for(var n,i=0;i<t.length;i++){var o=t[i],s=a(o,r);(n||s!==o)&&(n||(n=t.slice(0,i)),n[i]=s);}return n?e.setTextRange(r.factory.createNodeArray(n,t.hasTrailingComma),t):t}(s,i)),i.setLexicalEnvironmentFlags(1,!1)),i.suspendLexicalEnvironment(),s}function a(t,r){return t.dotDotDotToken?t:e.isBindingPattern(t.name)?function(e,t){var r=t.factory;return t.addInitializationStatement(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(e.name,void 0,e.type,e.initializer?r.createConditionalExpression(r.createStrictEquality(r.getGeneratedNameForNode(e),r.createVoidZero()),void 0,e.initializer,void 0,r.getGeneratedNameForNode(e)):r.getGeneratedNameForNode(e))]))),r.updateParameterDeclaration(e,e.decorators,e.modifiers,e.dotDotDotToken,r.getGeneratedNameForNode(e),e.questionToken,e.type,void 0)}(t,r):t.initializer?function(t,r,n,i){var a=i.factory;return i.addInitializationStatement(a.createIfStatement(a.createTypeCheck(a.cloneNode(r),"undefined"),e.setEmitFlags(e.setTextRange(a.createBlock([a.createExpressionStatement(e.setEmitFlags(e.setTextRange(a.createAssignment(e.setEmitFlags(a.cloneNode(r),48),e.setEmitFlags(n,1584|e.getEmitFlags(n))),t),1536))]),t),1953))),a.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,t.type,void 0)}(t,t.name,t.initializer,r):t}function o(r,n,i,a){void 0===a&&(a=t),i.resumeLexicalEnvironment();var o=a(r,n,e.isConciseBody),s=i.endLexicalEnvironment();if(e.some(s)){if(!o)return i.factory.createBlock(s);var c=i.factory.converters.convertToFunctionBlock(o),l=e.factory.mergeLexicalEnvironment(c.statements,s);return i.factory.updateBlock(c,l)}return o}function s(r,n,i){i.startBlockScope();var a=t(r,n,e.isStatement,i.factory.liftToBlock),o=i.endBlockScope();return e.some(o)?e.isBlock(a)?(o.push.apply(o,a.statements),i.factory.updateBlock(a,o)):(o.push(a),i.factory.createBlock(o)):a}function c(t){return e.Debug.assert(t.length<=1,"Too many nodes written to output."),e.singleOrUndefined(t)}e.visitNode=t,e.visitNodes=r,e.visitLexicalEnvironment=n,e.visitParameterList=i,e.visitFunctionBody=o,e.visitIterationBody=s,e.visitEachChild=function(a,c,l,u,_,d){if(void 0===u&&(u=r),void 0===d&&(d=t),void 0!==a){var p=a.kind;if(p>0&&p<=159||191===p)return a;var f=l.factory;switch(p){case 79:return e.Debug.type(a),f.updateIdentifier(a,u(a.typeArguments,c,e.isTypeNodeOrTypeParameterDeclaration));case 160:return e.Debug.type(a),f.updateQualifiedName(a,d(a.left,c,e.isEntityName),d(a.right,c,e.isIdentifier));case 161:return e.Debug.type(a),f.updateComputedPropertyName(a,d(a.expression,c,e.isExpression));case 162:return e.Debug.type(a),f.updateTypeParameterDeclaration(a,d(a.name,c,e.isIdentifier),d(a.constraint,c,e.isTypeNode),d(a.default,c,e.isTypeNode));case 163:return e.Debug.type(a),f.updateParameterDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.dotDotDotToken,_,e.isDotDotDotToken),d(a.name,c,e.isBindingName),d(a.questionToken,_,e.isQuestionToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 164:return e.Debug.type(a),f.updateDecorator(a,d(a.expression,c,e.isExpression));case 165:return e.Debug.type(a),f.updatePropertySignature(a,u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isToken),d(a.type,c,e.isTypeNode));case 166:return e.Debug.type(a),f.updatePropertyDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken||a.exclamationToken,_,e.isQuestionOrExclamationToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 167:return e.Debug.type(a),f.updateMethodSignature(a,u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 168:return e.Debug.type(a),f.updateMethodDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isPropertyName),d(a.questionToken,_,e.isQuestionToken),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 170:return e.Debug.type(a),f.updateConstructorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),i(a.parameters,c,l,u),o(a.body,c,l,d));case 171:return e.Debug.type(a),f.updateGetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 172:return e.Debug.type(a),f.updateSetAccessorDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isPropertyName),i(a.parameters,c,l,u),o(a.body,c,l,d));case 169:return e.Debug.type(a),l.startLexicalEnvironment(),l.suspendLexicalEnvironment(),f.updateClassStaticBlockDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),o(a.body,c,l,d));case 173:return e.Debug.type(a),f.updateCallSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 174:return e.Debug.type(a),f.updateConstructSignature(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 175:return e.Debug.type(a),f.updateIndexSignature(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 176:return e.Debug.type(a),f.updateTypePredicateNode(a,d(a.assertsModifier,c,e.isAssertsKeyword),d(a.parameterName,c,e.isIdentifierOrThisTypeNode),d(a.type,c,e.isTypeNode));case 177:return e.Debug.type(a),f.updateTypeReferenceNode(a,d(a.typeName,c,e.isEntityName),u(a.typeArguments,c,e.isTypeNode));case 178:return e.Debug.type(a),f.updateFunctionTypeNode(a,u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 179:return e.Debug.type(a),f.updateConstructorTypeNode(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.parameters,c,e.isParameterDeclaration),d(a.type,c,e.isTypeNode));case 180:return e.Debug.type(a),f.updateTypeQueryNode(a,d(a.exprName,c,e.isEntityName));case 181:return e.Debug.type(a),f.updateTypeLiteralNode(a,u(a.members,c,e.isTypeElement));case 182:return e.Debug.type(a),f.updateArrayTypeNode(a,d(a.elementType,c,e.isTypeNode));case 183:return e.Debug.type(a),f.updateTupleTypeNode(a,u(a.elements,c,e.isTypeNode));case 184:return e.Debug.type(a),f.updateOptionalTypeNode(a,d(a.type,c,e.isTypeNode));case 185:return e.Debug.type(a),f.updateRestTypeNode(a,d(a.type,c,e.isTypeNode));case 186:return e.Debug.type(a),f.updateUnionTypeNode(a,u(a.types,c,e.isTypeNode));case 187:return e.Debug.type(a),f.updateIntersectionTypeNode(a,u(a.types,c,e.isTypeNode));case 188:return e.Debug.type(a),f.updateConditionalTypeNode(a,d(a.checkType,c,e.isTypeNode),d(a.extendsType,c,e.isTypeNode),d(a.trueType,c,e.isTypeNode),d(a.falseType,c,e.isTypeNode));case 189:return e.Debug.type(a),f.updateInferTypeNode(a,d(a.typeParameter,c,e.isTypeParameterDeclaration));case 199:return e.Debug.type(a),f.updateImportTypeNode(a,d(a.argument,c,e.isTypeNode),d(a.qualifier,c,e.isEntityName),r(a.typeArguments,c,e.isTypeNode),a.isTypeOf);case 196:return e.Debug.type(a),f.updateNamedTupleMember(a,t(a.dotDotDotToken,c,e.isDotDotDotToken),t(a.name,c,e.isIdentifier),t(a.questionToken,c,e.isQuestionToken),t(a.type,c,e.isTypeNode));case 190:return e.Debug.type(a),f.updateParenthesizedType(a,d(a.type,c,e.isTypeNode));case 192:return e.Debug.type(a),f.updateTypeOperatorNode(a,d(a.type,c,e.isTypeNode));case 193:return e.Debug.type(a),f.updateIndexedAccessTypeNode(a,d(a.objectType,c,e.isTypeNode),d(a.indexType,c,e.isTypeNode));case 194:return e.Debug.type(a),f.updateMappedTypeNode(a,d(a.readonlyToken,_,e.isReadonlyKeywordOrPlusOrMinusToken),d(a.typeParameter,c,e.isTypeParameterDeclaration),d(a.nameType,c,e.isTypeNode),d(a.questionToken,_,e.isQuestionOrPlusOrMinusToken),d(a.type,c,e.isTypeNode),u(a.members,c,e.isTypeElement));case 195:return e.Debug.type(a),f.updateLiteralTypeNode(a,d(a.literal,c,e.isExpression));case 197:return e.Debug.type(a),f.updateTemplateLiteralType(a,d(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateLiteralTypeSpan));case 198:return e.Debug.type(a),f.updateTemplateLiteralTypeSpan(a,d(a.type,c,e.isTypeNode),d(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 200:return e.Debug.type(a),f.updateObjectBindingPattern(a,u(a.elements,c,e.isBindingElement));case 201:return e.Debug.type(a),f.updateArrayBindingPattern(a,u(a.elements,c,e.isArrayBindingElement));case 202:return e.Debug.type(a),f.updateBindingElement(a,d(a.dotDotDotToken,_,e.isDotDotDotToken),d(a.propertyName,c,e.isPropertyName),d(a.name,c,e.isBindingName),d(a.initializer,c,e.isExpression));case 203:return e.Debug.type(a),f.updateArrayLiteralExpression(a,u(a.elements,c,e.isExpression));case 204:return e.Debug.type(a),f.updateObjectLiteralExpression(a,u(a.properties,c,e.isObjectLiteralElementLike));case 205:return 32&a.flags?(e.Debug.type(a),f.updatePropertyAccessChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),d(a.name,c,e.isMemberName))):(e.Debug.type(a),f.updatePropertyAccessExpression(a,d(a.expression,c,e.isExpression),d(a.name,c,e.isMemberName)));case 206:return 32&a.flags?(e.Debug.type(a),f.updateElementAccessChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),d(a.argumentExpression,c,e.isExpression))):(e.Debug.type(a),f.updateElementAccessExpression(a,d(a.expression,c,e.isExpression),d(a.argumentExpression,c,e.isExpression)));case 207:return 32&a.flags?(e.Debug.type(a),f.updateCallChain(a,d(a.expression,c,e.isExpression),d(a.questionDotToken,_,e.isQuestionDotToken),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression))):(e.Debug.type(a),f.updateCallExpression(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression)));case 208:return e.Debug.type(a),f.updateNewExpression(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode),u(a.arguments,c,e.isExpression));case 209:return e.Debug.type(a),f.updateTaggedTemplateExpression(a,d(a.tag,c,e.isExpression),r(a.typeArguments,c,e.isTypeNode),d(a.template,c,e.isTemplateLiteral));case 210:return e.Debug.type(a),f.updateTypeAssertion(a,d(a.type,c,e.isTypeNode),d(a.expression,c,e.isExpression));case 211:return e.Debug.type(a),f.updateParenthesizedExpression(a,d(a.expression,c,e.isExpression));case 212:return e.Debug.type(a),f.updateFunctionExpression(a,u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 213:return e.Debug.type(a),f.updateArrowFunction(a,u(a.modifiers,c,e.isModifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),d(a.equalsGreaterThanToken,_,e.isEqualsGreaterThanToken),o(a.body,c,l,d));case 214:return e.Debug.type(a),f.updateDeleteExpression(a,d(a.expression,c,e.isExpression));case 215:return e.Debug.type(a),f.updateTypeOfExpression(a,d(a.expression,c,e.isExpression));case 216:return e.Debug.type(a),f.updateVoidExpression(a,d(a.expression,c,e.isExpression));case 217:return e.Debug.type(a),f.updateAwaitExpression(a,d(a.expression,c,e.isExpression));case 218:return e.Debug.type(a),f.updatePrefixUnaryExpression(a,d(a.operand,c,e.isExpression));case 219:return e.Debug.type(a),f.updatePostfixUnaryExpression(a,d(a.operand,c,e.isExpression));case 220:return e.Debug.type(a),f.updateBinaryExpression(a,d(a.left,c,e.isExpression),d(a.operatorToken,_,e.isBinaryOperatorToken),d(a.right,c,e.isExpression));case 221:return e.Debug.type(a),f.updateConditionalExpression(a,d(a.condition,c,e.isExpression),d(a.questionToken,_,e.isQuestionToken),d(a.whenTrue,c,e.isExpression),d(a.colonToken,_,e.isColonToken),d(a.whenFalse,c,e.isExpression));case 222:return e.Debug.type(a),f.updateTemplateExpression(a,d(a.head,c,e.isTemplateHead),u(a.templateSpans,c,e.isTemplateSpan));case 223:return e.Debug.type(a),f.updateYieldExpression(a,d(a.asteriskToken,_,e.isAsteriskToken),d(a.expression,c,e.isExpression));case 224:return e.Debug.type(a),f.updateSpreadElement(a,d(a.expression,c,e.isExpression));case 225:return e.Debug.type(a),f.updateClassExpression(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 227:return e.Debug.type(a),f.updateExpressionWithTypeArguments(a,d(a.expression,c,e.isExpression),u(a.typeArguments,c,e.isTypeNode));case 228:return e.Debug.type(a),f.updateAsExpression(a,d(a.expression,c,e.isExpression),d(a.type,c,e.isTypeNode));case 229:return 32&a.flags?(e.Debug.type(a),f.updateNonNullChain(a,d(a.expression,c,e.isExpression))):(e.Debug.type(a),f.updateNonNullExpression(a,d(a.expression,c,e.isExpression)));case 230:return e.Debug.type(a),f.updateMetaProperty(a,d(a.name,c,e.isIdentifier));case 232:return e.Debug.type(a),f.updateTemplateSpan(a,d(a.expression,c,e.isExpression),d(a.literal,c,e.isTemplateMiddleOrTemplateTail));case 234:return e.Debug.type(a),f.updateBlock(a,u(a.statements,c,e.isStatement));case 236:return e.Debug.type(a),f.updateVariableStatement(a,u(a.modifiers,c,e.isModifier),d(a.declarationList,c,e.isVariableDeclarationList));case 237:return e.Debug.type(a),f.updateExpressionStatement(a,d(a.expression,c,e.isExpression));case 238:return e.Debug.type(a),f.updateIfStatement(a,d(a.expression,c,e.isExpression),d(a.thenStatement,c,e.isStatement,f.liftToBlock),d(a.elseStatement,c,e.isStatement,f.liftToBlock));case 239:return e.Debug.type(a),f.updateDoStatement(a,s(a.statement,c,l),d(a.expression,c,e.isExpression));case 240:return e.Debug.type(a),f.updateWhileStatement(a,d(a.expression,c,e.isExpression),s(a.statement,c,l));case 241:return e.Debug.type(a),f.updateForStatement(a,d(a.initializer,c,e.isForInitializer),d(a.condition,c,e.isExpression),d(a.incrementor,c,e.isExpression),s(a.statement,c,l));case 242:return e.Debug.type(a),f.updateForInStatement(a,d(a.initializer,c,e.isForInitializer),d(a.expression,c,e.isExpression),s(a.statement,c,l));case 243:return e.Debug.type(a),f.updateForOfStatement(a,d(a.awaitModifier,_,e.isAwaitKeyword),d(a.initializer,c,e.isForInitializer),d(a.expression,c,e.isExpression),s(a.statement,c,l));case 244:return e.Debug.type(a),f.updateContinueStatement(a,d(a.label,c,e.isIdentifier));case 245:return e.Debug.type(a),f.updateBreakStatement(a,d(a.label,c,e.isIdentifier));case 246:return e.Debug.type(a),f.updateReturnStatement(a,d(a.expression,c,e.isExpression));case 247:return e.Debug.type(a),f.updateWithStatement(a,d(a.expression,c,e.isExpression),d(a.statement,c,e.isStatement,f.liftToBlock));case 248:return e.Debug.type(a),f.updateSwitchStatement(a,d(a.expression,c,e.isExpression),d(a.caseBlock,c,e.isCaseBlock));case 249:return e.Debug.type(a),f.updateLabeledStatement(a,d(a.label,c,e.isIdentifier),d(a.statement,c,e.isStatement,f.liftToBlock));case 250:return e.Debug.type(a),f.updateThrowStatement(a,d(a.expression,c,e.isExpression));case 251:return e.Debug.type(a),f.updateTryStatement(a,d(a.tryBlock,c,e.isBlock),d(a.catchClause,c,e.isCatchClause),d(a.finallyBlock,c,e.isBlock));case 253:return e.Debug.type(a),f.updateVariableDeclaration(a,d(a.name,c,e.isBindingName),d(a.exclamationToken,_,e.isExclamationToken),d(a.type,c,e.isTypeNode),d(a.initializer,c,e.isExpression));case 254:return e.Debug.type(a),f.updateVariableDeclarationList(a,u(a.declarations,c,e.isVariableDeclaration));case 255:return e.Debug.type(a),f.updateFunctionDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.asteriskToken,_,e.isAsteriskToken),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),i(a.parameters,c,l,u),d(a.type,c,e.isTypeNode),o(a.body,c,l,d));case 256:return e.Debug.type(a),f.updateClassDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isClassElement));case 257:return e.Debug.type(a),f.updateInterfaceDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),u(a.heritageClauses,c,e.isHeritageClause),u(a.members,c,e.isTypeElement));case 258:return e.Debug.type(a),f.updateTypeAliasDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.typeParameters,c,e.isTypeParameterDeclaration),d(a.type,c,e.isTypeNode));case 259:return e.Debug.type(a),f.updateEnumDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isIdentifier),u(a.members,c,e.isEnumMember));case 260:return e.Debug.type(a),f.updateModuleDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.name,c,e.isModuleName),d(a.body,c,e.isModuleBody));case 261:return e.Debug.type(a),f.updateModuleBlock(a,u(a.statements,c,e.isStatement));case 262:return e.Debug.type(a),f.updateCaseBlock(a,u(a.clauses,c,e.isCaseOrDefaultClause));case 263:return e.Debug.type(a),f.updateNamespaceExportDeclaration(a,d(a.name,c,e.isIdentifier));case 264:return e.Debug.type(a),f.updateImportEqualsDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,d(a.name,c,e.isIdentifier),d(a.moduleReference,c,e.isModuleReference));case 265:return e.Debug.type(a),f.updateImportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.importClause,c,e.isImportClause),d(a.moduleSpecifier,c,e.isExpression),d(a.assertClause,c,e.isAssertClause));case 292:return e.Debug.type(a),f.updateAssertClause(a,u(a.elements,c,e.isAssertEntry),a.multiLine);case 293:return e.Debug.type(a),f.updateAssertEntry(a,d(a.name,c,e.isAssertionKey),d(a.value,c,e.isStringLiteral));case 266:return e.Debug.type(a),f.updateImportClause(a,a.isTypeOnly,d(a.name,c,e.isIdentifier),d(a.namedBindings,c,e.isNamedImportBindings));case 267:return e.Debug.type(a),f.updateNamespaceImport(a,d(a.name,c,e.isIdentifier));case 273:return e.Debug.type(a),f.updateNamespaceExport(a,d(a.name,c,e.isIdentifier));case 268:return e.Debug.type(a),f.updateNamedImports(a,u(a.elements,c,e.isImportSpecifier));case 269:return e.Debug.type(a),f.updateImportSpecifier(a,a.isTypeOnly,d(a.propertyName,c,e.isIdentifier),d(a.name,c,e.isIdentifier));case 270:return e.Debug.type(a),f.updateExportAssignment(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),d(a.expression,c,e.isExpression));case 271:return e.Debug.type(a),f.updateExportDeclaration(a,u(a.decorators,c,e.isDecorator),u(a.modifiers,c,e.isModifier),a.isTypeOnly,d(a.exportClause,c,e.isNamedExportBindings),d(a.moduleSpecifier,c,e.isExpression),d(a.assertClause,c,e.isAssertClause));case 272:return e.Debug.type(a),f.updateNamedExports(a,u(a.elements,c,e.isExportSpecifier));case 274:return e.Debug.type(a),f.updateExportSpecifier(a,a.isTypeOnly,d(a.propertyName,c,e.isIdentifier),d(a.name,c,e.isIdentifier));case 276:return e.Debug.type(a),f.updateExternalModuleReference(a,d(a.expression,c,e.isExpression));case 277:return e.Debug.type(a),f.updateJsxElement(a,d(a.openingElement,c,e.isJsxOpeningElement),u(a.children,c,e.isJsxChild),d(a.closingElement,c,e.isJsxClosingElement));case 278:return e.Debug.type(a),f.updateJsxSelfClosingElement(a,d(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),d(a.attributes,c,e.isJsxAttributes));case 279:return e.Debug.type(a),f.updateJsxOpeningElement(a,d(a.tagName,c,e.isJsxTagNameExpression),u(a.typeArguments,c,e.isTypeNode),d(a.attributes,c,e.isJsxAttributes));case 280:return e.Debug.type(a),f.updateJsxClosingElement(a,d(a.tagName,c,e.isJsxTagNameExpression));case 281:return e.Debug.type(a),f.updateJsxFragment(a,d(a.openingFragment,c,e.isJsxOpeningFragment),u(a.children,c,e.isJsxChild),d(a.closingFragment,c,e.isJsxClosingFragment));case 284:return e.Debug.type(a),f.updateJsxAttribute(a,d(a.name,c,e.isIdentifier),d(a.initializer,c,e.isStringLiteralOrJsxExpression));case 285:return e.Debug.type(a),f.updateJsxAttributes(a,u(a.properties,c,e.isJsxAttributeLike));case 286:return e.Debug.type(a),f.updateJsxSpreadAttribute(a,d(a.expression,c,e.isExpression));case 287:return e.Debug.type(a),f.updateJsxExpression(a,d(a.expression,c,e.isExpression));case 288:return e.Debug.type(a),f.updateCaseClause(a,d(a.expression,c,e.isExpression),u(a.statements,c,e.isStatement));case 289:return e.Debug.type(a),f.updateDefaultClause(a,u(a.statements,c,e.isStatement));case 290:return e.Debug.type(a),f.updateHeritageClause(a,u(a.types,c,e.isExpressionWithTypeArguments));case 291:return e.Debug.type(a),f.updateCatchClause(a,d(a.variableDeclaration,c,e.isVariableDeclaration),d(a.block,c,e.isBlock));case 294:return e.Debug.type(a),f.updatePropertyAssignment(a,d(a.name,c,e.isPropertyName),d(a.initializer,c,e.isExpression));case 295:return e.Debug.type(a),f.updateShorthandPropertyAssignment(a,d(a.name,c,e.isIdentifier),d(a.objectAssignmentInitializer,c,e.isExpression));case 296:return e.Debug.type(a),f.updateSpreadAssignment(a,d(a.expression,c,e.isExpression));case 297:return e.Debug.type(a),f.updateEnumMember(a,d(a.name,c,e.isPropertyName),d(a.initializer,c,e.isExpression));case 303:return e.Debug.type(a),f.updateSourceFile(a,n(a.statements,c,l));case 348:return e.Debug.type(a),f.updatePartiallyEmittedExpression(a,d(a.expression,c,e.isExpression));case 349:return e.Debug.type(a),f.updateCommaListExpression(a,u(a.elements,c,e.isExpression));default:return a}}};}(t),function(e){e.createSourceMapGenerator=function(t,r,n,i,o){var s,c,l=o.extendedDiagnostics?e.performance.createTimer("Source Map","beforeSourcemap","afterSourcemap"):e.performance.nullTimer,u=l.enter,_=l.exit,d=[],p=[],f=new e.Map,g=[],m=[],y="",v=0,h=0,b=0,x=0,D=0,S=0,T=!1,C=0,E=0,k=0,N=0,F=0,A=0,P=!1,w=!1,I=!1;return {getSources:function(){return d},addSource:O,setSourceContent:M,addName:L,addMapping:R,appendSourceMap:function(t,r,n,i,o,s){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),u();for(var c,l=[],d=a(n.mappings),p=d.next();!p.done;p=d.next()){var f=p.value;if(s&&(f.generatedLine>s.line||f.generatedLine===s.line&&f.generatedCharacter>s.character))break;if(!o||!(f.generatedLine<o.line||o.line===f.generatedLine&&f.generatedCharacter<o.character)){var g=void 0,m=void 0,y=void 0,v=void 0;if(void 0!==f.sourceIndex){if(void 0===(g=l[f.sourceIndex])){var h=n.sources[f.sourceIndex],b=n.sourceRoot?e.combinePaths(n.sourceRoot,h):h,x=e.combinePaths(e.getDirectoryPath(i),b);l[f.sourceIndex]=g=O(x),n.sourcesContent&&"string"==typeof n.sourcesContent[f.sourceIndex]&&M(g,n.sourcesContent[f.sourceIndex]);}m=f.sourceLine,y=f.sourceCharacter,n.names&&void 0!==f.nameIndex&&(c||(c=[]),void 0===(v=c[f.nameIndex])&&(c[f.nameIndex]=v=L(n.names[f.nameIndex])));}var D=f.generatedLine-(o?o.line:0),S=D+t,T=o&&o.line===f.generatedLine?f.generatedCharacter-o.character:f.generatedCharacter;R(S,0===D?T+r:T,g,m,y,v);}}_();},toJSON:z,toString:function(){return JSON.stringify(z())}};function O(r){u();var n=e.getRelativePathToDirectoryOrUrl(i,r,t.getCurrentDirectory(),t.getCanonicalFileName,!0),a=f.get(n);return void 0===a&&(a=p.length,p.push(n),d.push(r),f.set(n,a)),_(),a}function M(e,t){if(u(),null!==t){for(s||(s=[]);s.length<e;)s.push(null);s[e]=t;}_();}function L(t){u(),c||(c=new e.Map);var r=c.get(t);return void 0===r&&(r=g.length,g.push(t),c.set(t,r)),_(),r}function R(t,r,n,i,a,o){e.Debug.assert(t>=C,"generatedLine cannot backtrack"),e.Debug.assert(r>=0,"generatedCharacter cannot be negative"),e.Debug.assert(void 0===n||n>=0,"sourceIndex cannot be negative"),e.Debug.assert(void 0===i||i>=0,"sourceLine cannot be negative"),e.Debug.assert(void 0===a||a>=0,"sourceCharacter cannot be negative"),u(),(function(e,t){return !P||C!==e||E!==t}(t,r)||function(e,t,r){return void 0!==e&&void 0!==t&&void 0!==r&&k===e&&(N>t||N===t&&F>r)}(n,i,a))&&(j(),C=t,E=r,w=!1,I=!1,P=!0),void 0!==n&&void 0!==i&&void 0!==a&&(k=n,N=i,F=a,w=!0,void 0!==o&&(A=o,I=!0)),_();}function B(e){m.push(e),m.length>=1024&&J();}function j(){if(P&&(!T||v!==C||h!==E||b!==k||x!==N||D!==F||S!==A)){if(u(),v<C){do{B(59),v++;}while(v<C);h=0;}else e.Debug.assertEqual(v,C,"generatedLine cannot backtrack"),T&&B(44);U(E-h),h=E,w&&(U(k-b),b=k,U(N-x),x=N,U(F-D),D=F,I&&(U(A-S),S=A)),T=!0,_();}}function J(){m.length>0&&(y+=String.fromCharCode.apply(void 0,m),m.length=0);}function z(){return j(),J(),{version:3,file:r,sourceRoot:n,sources:p,names:g,mappings:y,sourcesContent:s}}function U(t){t<0?t=1+(-t<<1):t<<=1;do{var r=31&t;(t>>=5)>0&&(r|=32),B((n=r)>=0&&n<26?65+n:n>=26&&n<52?97+n-26:n>=52&&n<62?48+n-52:62===n?43:63===n?47:e.Debug.fail("".concat(n,": not a base64 value")));}while(t>0);var n;}};var t=/^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/,r=/^\s*(\/\/[@#] .*)?$/;function n(e){return "string"==typeof e||null===e}function i(t){return null!==t&&"object"==typeof t&&3===t.version&&"string"==typeof t.file&&"string"==typeof t.mappings&&e.isArray(t.sources)&&e.every(t.sources,e.isString)&&(void 0===t.sourceRoot||null===t.sourceRoot||"string"==typeof t.sourceRoot)&&(void 0===t.sourcesContent||null===t.sourcesContent||e.isArray(t.sourcesContent)&&e.every(t.sourcesContent,n))&&(void 0===t.names||null===t.names||e.isArray(t.names)&&e.every(t.names,e.isString))}function a(e){var t,r=!1,n=0,i=0,a=0,o=0,s=0,c=0,l=0;return {get pos(){return n},get error(){return t},get state(){return u(!0,!0)},next:function(){for(;!r&&n<e.length;){var t=e.charCodeAt(n);if(59!==t){if(44!==t){var d=!1,y=!1;if(a+=m(),f())return _();if(a<0)return p("Invalid generatedCharacter found");if(!g()){if(d=!0,o+=m(),f())return _();if(o<0)return p("Invalid sourceIndex found");if(g())return p("Unsupported Format: No entries after sourceIndex");if(s+=m(),f())return _();if(s<0)return p("Invalid sourceLine found");if(g())return p("Unsupported Format: No entries after sourceLine");if(c+=m(),f())return _();if(c<0)return p("Invalid sourceCharacter found");if(!g()){if(y=!0,l+=m(),f())return _();if(l<0)return p("Invalid nameIndex found");if(!g())return p("Unsupported Error Format: Entries after nameIndex")}}return {value:u(d,y),done:r}}n++;}else i++,a=0,n++;}return _()}};function u(e,t){return {generatedLine:i,generatedCharacter:a,sourceIndex:e?o:void 0,sourceLine:e?s:void 0,sourceCharacter:e?c:void 0,nameIndex:t?l:void 0}}function _(){return r=!0,{value:void 0,done:!0}}function d(e){void 0===t&&(t=e);}function p(e){return d(e),_()}function f(){return void 0!==t}function g(){return n===e.length||44===e.charCodeAt(n)||59===e.charCodeAt(n)}function m(){for(var t,r=!0,i=0,a=0;r;n++){if(n>=e.length)return d("Error in decoding base64VLQFormatDecode, past the mapping string"),-1;var o=(t=e.charCodeAt(n))>=65&&t<=90?t-65:t>=97&&t<=122?t-97+26:t>=48&&t<=57?t-48+52:43===t?62:47===t?63:-1;if(-1===o)return d("Invalid character in VLQ"),-1;r=0!=(32&o),a|=(31&o)<<i,i+=5;}return 0==(1&a)?a>>=1:a=-(a>>=1),a}}function o(e){return void 0!==e.sourceIndex&&void 0!==e.sourceLine&&void 0!==e.sourceCharacter}function s(e){return void 0!==e.sourceIndex&&void 0!==e.sourcePosition}function c(e,t){return e.generatedPosition===t.generatedPosition&&e.sourceIndex===t.sourceIndex&&e.sourcePosition===t.sourcePosition}function l(t,r){return e.Debug.assert(t.sourceIndex===r.sourceIndex),e.compareValues(t.sourcePosition,r.sourcePosition)}function u(t,r){return e.compareValues(t.generatedPosition,r.generatedPosition)}function _(e){return e.sourcePosition}function d(e){return e.generatedPosition}e.getLineInfo=function(e,t){return {getLineCount:function(){return t.length},getLineText:function(r){return e.substring(t[r],t[r+1])}}},e.tryGetSourceMappingURL=function(n){for(var i=n.getLineCount()-1;i>=0;i--){var a=n.getLineText(i),o=t.exec(a);if(o)return e.trimStringEnd(o[1]);if(!a.match(r))break}},e.isRawSourceMap=i,e.tryParseRawSourceMap=function(e){try{var t=JSON.parse(e);if(i(t))return t}catch(e){}},e.decodeMappings=a,e.sameMapping=function(e,t){return e===t||e.generatedLine===t.generatedLine&&e.generatedCharacter===t.generatedCharacter&&e.sourceIndex===t.sourceIndex&&e.sourceLine===t.sourceLine&&e.sourceCharacter===t.sourceCharacter&&e.nameIndex===t.nameIndex},e.isSourceMapping=o,e.createDocumentPositionMapper=function(t,r,n){var i,p,f,g=e.getDirectoryPath(n),m=r.sourceRoot?e.getNormalizedAbsolutePath(r.sourceRoot,g):g,y=e.getNormalizedAbsolutePath(r.file,g),v=t.getSourceFileLike(y),h=r.sources.map((function(t){return e.getNormalizedAbsolutePath(t,m)})),b=new e.Map(h.map((function(e,r){return [t.getCanonicalFileName(e),r]})));return {getSourcePosition:function(t){var r=T();if(!e.some(r))return t;var n=e.binarySearchKey(r,t.pos,d,e.compareValues);n<0&&(n=~n);var i=r[n];return void 0!==i&&s(i)?{fileName:h[i.sourceIndex],pos:i.sourcePosition}:t},getGeneratedPosition:function(r){var n=b.get(t.getCanonicalFileName(r.fileName));if(void 0===n)return r;var i=S(n);if(!e.some(i))return r;var a=e.binarySearchKey(i,r.pos,_,e.compareValues);a<0&&(a=~a);var o=i[a];return void 0===o||o.sourceIndex!==n?r:{fileName:y,pos:o.generatedPosition}}};function x(n){var i,a,s=void 0!==v?e.getPositionOfLineAndCharacter(v,n.generatedLine,n.generatedCharacter,!0):-1;if(o(n)){var c=t.getSourceFileLike(h[n.sourceIndex]);i=r.sources[n.sourceIndex],a=void 0!==c?e.getPositionOfLineAndCharacter(c,n.sourceLine,n.sourceCharacter,!0):-1;}return {generatedPosition:s,source:i,sourceIndex:n.sourceIndex,sourcePosition:a,nameIndex:n.nameIndex}}function D(){if(void 0===i){var n=a(r.mappings),o=e.arrayFrom(n,x);void 0!==n.error?(t.log&&t.log("Encountered error while decoding sourcemap: ".concat(n.error)),i=e.emptyArray):i=o;}return i}function S(t){if(void 0===f){for(var r=[],n=0,i=D();n<i.length;n++){var a=i[n];if(s(a)){var o=r[a.sourceIndex];o||(r[a.sourceIndex]=o=[]),o.push(a);}}f=r.map((function(t){return e.sortAndDeduplicate(t,l,c)}));}return f[t]}function T(){if(void 0===p){for(var t=[],r=0,n=D();r<n.length;r++){var i=n[r];t.push(i);}p=e.sortAndDeduplicate(t,u,c);}return p}},e.identitySourceMapConsumer={getSourcePosition:e.identity,getGeneratedPosition:e.identity};}(t),function(e){function t(t){return (t=e.getOriginalNode(t))?e.getNodeId(t):0}function r(e){return void 0!==e.propertyName&&"default"===e.propertyName.escapedText}function n(t){if(e.getNamespaceDeclarationNode(t))return !0;var n=t.importClause&&t.importClause.namedBindings;if(!n)return !1;if(!e.isNamedImports(n))return !1;for(var i=0,a=0,o=n.elements;a<o.length;a++)r(o[a])&&i++;return i>0&&i!==n.elements.length||!!(n.elements.length-i)&&e.isDefaultImport(t)}function i(t){return !n(t)&&(e.isDefaultImport(t)||!!t.importClause&&e.isNamedImports(t.importClause.namedBindings)&&function(t){return !!t&&!!e.isNamedImports(t)&&e.some(t.elements,r)}(t.importClause.namedBindings))}function a(t,r,n){if(e.isBindingPattern(t.name))for(var i=0,o=t.name.elements;i<o.length;i++){var s=o[i];e.isOmittedExpression(s)||(n=a(s,r,n));}else if(!e.isGeneratedIdentifier(t.name)){var c=e.idText(t.name);r.get(c)||(r.set(c,!0),n=e.append(n,t.name));}return n}function o(e,t,r){var n=e[t];return n?n.push(r):e[t]=n=[r],n}function s(t){return e.isStringLiteralLike(t)||8===t.kind||e.isKeyword(t.kind)||e.isIdentifier(t)}function c(t){return r=t,e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)||e.isClassStaticBlockDeclaration(t);var r;}e.getOriginalNodeId=t,e.chainBundle=function(t,r){return function(n){return 303===n.kind?r(n):function(n){return t.factory.createBundle(e.map(n.sourceFiles,r),n.prepends)}(n)}},e.getExportNeedsImportStarHelper=function(t){return !!e.getNamespaceDeclarationNode(t)},e.getImportNeedsImportStarHelper=n,e.getImportNeedsImportDefaultHelper=i,e.collectExternalModuleInfo=function(r,s,c,l){for(var u,_,d=[],p=e.createMultiMap(),f=[],g=new e.Map,m=!1,y=!1,v=!1,h=!1,b=0,x=s.statements;b<x.length;b++){var D=x[b];switch(D.kind){case 265:d.push(D),!v&&n(D)&&(v=!0),!h&&i(D)&&(h=!0);break;case 264:276===D.moduleReference.kind&&d.push(D);break;case 271:if(D.moduleSpecifier)if(D.exportClause)if(d.push(D),e.isNamedExports(D.exportClause))N(D);else {var S=D.exportClause.name;g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)),v=!0;}else d.push(D),y=!0;else N(D);break;case 270:D.isExportEquals&&!_&&(_=D);break;case 236:if(e.hasSyntacticModifier(D,1))for(var T=0,C=D.declarationList.declarations;T<C.length;T++){var E=C[T];u=a(E,g,u);}break;case 255:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,512)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name,g.get(e.idText(S))||(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S))));break;case 256:e.hasSyntacticModifier(D,1)&&(e.hasSyntacticModifier(D,512)?m||(o(f,t(D),r.factory.getDeclarationName(D)),m=!0):(S=D.name)&&!g.get(e.idText(S))&&(o(f,t(D),S),g.set(e.idText(S),!0),u=e.append(u,S)));}}var k=e.createExternalHelpersImportDeclarationIfNeeded(r.factory,r.getEmitHelperFactory(),s,l,y,v,h);return k&&d.unshift(k),{externalImports:d,exportSpecifiers:p,exportEquals:_,hasExportStarsToExportValues:y,exportedBindings:f,exportedNames:u,externalHelpersImportDeclaration:k};function N(r){for(var n=0,i=e.cast(r.exportClause,e.isNamedExports).elements;n<i.length;n++){var a=i[n];if(!g.get(e.idText(a.name))){var s=a.propertyName||a.name;r.moduleSpecifier||p.add(e.idText(s),a);var l=c.getReferencedImportDeclaration(s)||c.getReferencedValueDeclaration(s);l&&o(f,t(l),a.name),g.set(e.idText(a.name),!0),u=e.append(u,a.name);}}}},e.isSimpleCopiableExpression=s,e.isSimpleInlineableExpression=function(t){return !e.isIdentifier(t)&&s(t)},e.isCompoundAssignment=function(e){return e>=64&&e<=78},e.getNonAssignmentOperatorForCompoundAssignment=function(e){switch(e){case 64:return 39;case 65:return 40;case 66:return 41;case 67:return 42;case 68:return 43;case 69:return 44;case 70:return 47;case 71:return 48;case 72:return 49;case 73:return 50;case 74:return 51;case 78:return 52;case 75:return 56;case 76:return 55;case 77:return 60}},e.addPrologueDirectivesAndInitialSuperCall=function(t,r,n,i){if(r.body){var a=r.body.statements,o=t.copyPrologue(a,n,!1,i);if(o===a.length)return o;var s=e.findIndex(a,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}),o);if(s>-1){for(var c=o;c<=s;c++)n.push(e.visitNode(a[c],i,e.isStatement));return s+1}return o}return 0},e.getProperties=function(t,r,n){return e.filter(t.members,(function(t){return function(t,r,n){return e.isPropertyDeclaration(t)&&(!!t.initializer||!r)&&e.hasStaticModifier(t)===n}(t,r,n)}))},e.getStaticPropertiesAndClassStaticBlock=function(t){return e.filter(t.members,c)},e.isInitializedProperty=function(e){return 166===e.kind&&void 0!==e.initializer},e.isNonStaticMethodOrAccessorWithPrivateName=function(t){return !e.isStatic(t)&&e.isMethodOrAccessor(t)&&e.isPrivateIdentifier(t.name)};}(t),function(e){function t(r,n){var i=e.getTargetOfBindingOrAssignmentElement(r);return e.isBindingOrAssignmentPattern(i)?function(r,n){for(var i=0,a=e.getElementsOfBindingOrAssignmentPattern(r);i<a.length;i++)if(t(a[i],n))return !0;return !1}(i,n):!!e.isIdentifier(i)&&i.escapedText===n}function r(t){var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&e.isComputedPropertyName(n)&&!e.isLiteralExpression(n.expression))return !0;var i,a=e.getTargetOfBindingOrAssignmentElement(t);return !!a&&e.isBindingOrAssignmentPattern(a)&&(i=a,!!e.forEach(e.getElementsOfBindingOrAssignmentPattern(i),r))}function n(t,r,s,c,l){var u=e.getTargetOfBindingOrAssignmentElement(r);if(!l){var _=e.visitNode(e.getInitializerOfBindingOrAssignmentElement(r),t.visitor,e.isExpression);_?s?(s=function(e,t,r,n){return t=o(e,t,!0,n),e.context.factory.createConditionalExpression(e.context.factory.createTypeCheck(t,"undefined"),void 0,r,void 0,t)}(t,s,_,c),!e.isSimpleInlineableExpression(_)&&e.isBindingOrAssignmentPattern(u)&&(s=o(t,s,!0,c))):s=_:s||(s=t.context.factory.createVoidZero());}e.isObjectBindingOrAssignmentPattern(u)?function(t,r,i,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(i),d=_.length;1!==d&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0),m=t.context.getEmitHelperFactory().createRestHelper(s,_,u,i),n(t,f,m,f));else {var g=e.getPropertyNameOfBindingOrAssignmentElement(f);if(!(t.level>=1)||49152&f.transformFlags||49152&e.getTargetOfBindingOrAssignmentElement(f).transformFlags||e.isComputedPropertyName(g)){l&&(t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i),l=void 0);var m=a(t,s,g);e.isComputedPropertyName(g)&&(u=e.append(u,m.argumentExpression)),n(t,f,m,f);}else l=e.append(l,e.visitNode(f,t.visitor));}}l&&t.emitBindingOrAssignment(t.createObjectBindingOrAssignmentPattern(l),s,c,i);}(t,r,u,s,c):e.isArrayBindingOrAssignmentPattern(u)?function(t,r,a,s,c){var l,u,_=e.getElementsOfBindingOrAssignmentPattern(a),d=_.length;t.level<1&&t.downlevelIteration?s=o(t,e.setTextRange(t.context.getEmitHelperFactory().createReadHelper(s,d>0&&e.getRestIndicatorOfBindingOrAssignmentElement(_[d-1])?void 0:d),c),!1,c):(1!==d&&(t.level<1||0===d)||e.every(_,e.isOmittedExpression))&&(s=o(t,s,!e.isDeclarationBindingElement(r)||0!==d,c));for(var p=0;p<d;p++){var f=_[p];if(t.level>=1)if(32768&f.transformFlags||t.hasTransformedPriorElement&&!i(f)){t.hasTransformedPriorElement=!0;var g=t.context.factory.createTempVariable(void 0);t.hoistTempVariables&&t.context.hoistVariableDeclaration(g),u=e.append(u,[g,f]),l=e.append(l,t.createArrayBindingOrAssignmentElement(g));}else l=e.append(l,f);else {if(e.isOmittedExpression(f))continue;if(e.getRestIndicatorOfBindingOrAssignmentElement(f))p===d-1&&(m=t.context.factory.createArraySliceCall(s,p),n(t,f,m,f));else {var m=t.context.factory.createElementAccessExpression(s,p);n(t,f,m,f);}}}if(l&&t.emitBindingOrAssignment(t.createArrayBindingOrAssignmentPattern(l),s,c,a),u)for(var y=0,v=u;y<v.length;y++){var h=v[y],b=h[0];n(t,f=h[1],b,f);}}(t,r,u,s,c):t.emitBindingOrAssignment(u,s,c,r);}function i(t){var r=e.getTargetOfBindingOrAssignmentElement(t);if(!r||e.isOmittedExpression(r))return !0;var n=e.tryGetPropertyNameOfBindingOrAssignmentElement(t);if(n&&!e.isPropertyNameLiteral(n))return !1;var a=e.getInitializerOfBindingOrAssignmentElement(t);return !(a&&!e.isSimpleInlineableExpression(a))&&(e.isBindingOrAssignmentPattern(r)?e.every(e.getElementsOfBindingOrAssignmentPattern(r),i):e.isIdentifier(r))}function a(t,r,n){if(e.isComputedPropertyName(n)){var i=o(t,e.visitNode(n.expression,t.visitor),!1,n);return t.context.factory.createElementAccessExpression(r,i)}if(e.isStringOrNumericLiteralLike(n))return i=e.factory.cloneNode(n),t.context.factory.createElementAccessExpression(r,i);var a=t.context.factory.createIdentifier(e.idText(n));return t.context.factory.createPropertyAccessExpression(r,a)}function o(t,r,n,i){if(e.isIdentifier(r)&&n)return r;var a=t.context.factory.createTempVariable(void 0);return t.hoistTempVariables?(t.context.hoistVariableDeclaration(a),t.emitExpression(e.setTextRange(t.context.factory.createAssignment(a,r),i))):t.emitBindingOrAssignment(a,r,i,void 0),a}function s(e){return e}var c;(c=e.FlattenLevel||(e.FlattenLevel={}))[c.All=0]="All",c[c.ObjectRest=1]="ObjectRest",e.flattenDestructuringAssignment=function(i,a,c,l,u,_){var d,p,f=i;if(e.isDestructuringAssignment(i))for(d=i.right;e.isEmptyArrayLiteral(i.left)||e.isEmptyObjectLiteral(i.left);){if(!e.isDestructuringAssignment(d))return e.visitNode(d,a,e.isExpression);f=i=d,d=i.right;}var g={context:c,level:l,downlevelIteration:!!c.getCompilerOptions().downlevelIteration,hoistTempVariables:!0,emitExpression:m,emitBindingOrAssignment:function(t,r,n,i){e.Debug.assertNode(t,_?e.isIdentifier:e.isExpression);var o=_?_(t,r,n):e.setTextRange(c.factory.createAssignment(e.visitNode(t,a,e.isExpression),r),n);o.original=i,m(o);},createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return t.createArrayLiteralExpression(e.map(r,t.converters.convertToArrayAssignmentElement))}(c.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return t.createObjectLiteralExpression(e.map(r,t.converters.convertToObjectAssignmentElement))}(c.factory,t)},createArrayBindingOrAssignmentElement:s,visitor:a};if(d&&(d=e.visitNode(d,a,e.isExpression),e.isIdentifier(d)&&t(i,d.escapedText)||r(i)?d=o(g,d,!1,f):u?d=o(g,d,!0,f):e.nodeIsSynthesized(i)&&(f=d)),n(g,i,d,f,e.isDestructuringAssignment(i)),d&&u){if(!e.some(p))return d;p.push(d);}return c.factory.inlineExpressions(p)||c.factory.createOmittedExpression();function m(t){p=e.append(p,t);}},e.flattenDestructuringBinding=function(i,a,s,c,l,u,_){var d;void 0===u&&(u=!1);var p=[],f=[],g={context:s,level:c,downlevelIteration:!!s.getCompilerOptions().downlevelIteration,hoistTempVariables:u,emitExpression:function(t){d=e.append(d,t);},emitBindingOrAssignment:N,createArrayBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isArrayBindingElement),t.createArrayBindingPattern(r)}(s.factory,t)},createObjectBindingOrAssignmentPattern:function(t){return function(t,r){return e.Debug.assertEachNode(r,e.isBindingElement),t.createObjectBindingPattern(r)}(s.factory,t)},createArrayBindingOrAssignmentElement:function(e){return function(e,t){return e.createBindingElement(void 0,void 0,t)}(s.factory,e)},visitor:a};if(e.isVariableDeclaration(i)){var m=e.getInitializerOfBindingOrAssignmentElement(i);m&&(e.isIdentifier(m)&&t(i,m.escapedText)||r(i))&&(m=o(g,e.visitNode(m,g.visitor),!1,m),i=s.factory.updateVariableDeclaration(i,i.name,void 0,void 0,m));}if(n(g,i,l,i,_),d){var y=s.factory.createTempVariable(void 0);if(u){var v=s.factory.inlineExpressions(d);d=void 0,N(y,v,void 0,void 0);}else {s.hoistVariableDeclaration(y);var h=e.last(p);h.pendingExpressions=e.append(h.pendingExpressions,s.factory.createAssignment(y,h.value)),e.addRange(h.pendingExpressions,d),h.value=y;}}for(var b=0,x=p;b<x.length;b++){var D=x[b],S=D.pendingExpressions,T=D.name,C=(v=D.value,D.location),E=D.original,k=s.factory.createVariableDeclaration(T,void 0,void 0,S?s.factory.inlineExpressions(e.append(S,v)):v);k.original=E,e.setTextRange(k,C),f.push(k);}return f;function N(t,r,n,i){e.Debug.assertNode(t,e.isBindingName),d&&(r=s.factory.inlineExpressions(e.append(d,r)),d=void 0),p.push({pendingExpressions:d,name:t,value:r,location:n,original:i});}};}(t),function(e){var t;function r(t){return t.templateFlags?e.factory.createVoidZero():e.factory.createStringLiteral(t.text)}function n(t,r){var n=t.rawText;if(void 0===n){e.Debug.assertIsDefined(r,"Template literal node is missing 'rawText' and does not have a source file. Possibly bad transform."),n=e.getSourceTextOfNodeFromSourceFile(r,t);var i=14===t.kind||17===t.kind;n=n.substring(1,n.length-(i?1:2));}return n=n.replace(/\r\n?/g,"\n"),e.setTextRange(e.factory.createStringLiteral(n),t)}!function(e){e[e.LiftRestriction=0]="LiftRestriction",e[e.All=1]="All";}(t=e.ProcessLevel||(e.ProcessLevel={})),e.processTaggedTemplateExpression=function(i,a,o,s,c,l){var u=e.visitNode(a.tag,o,e.isExpression),_=[void 0],d=[],p=[],f=a.template;if(l===t.LiftRestriction&&!e.hasInvalidEscape(f))return e.visitEachChild(a,o,i);if(e.isNoSubstitutionTemplateLiteral(f))d.push(r(f)),p.push(n(f,s));else {d.push(r(f.head)),p.push(n(f.head,s));for(var g=0,m=f.templateSpans;g<m.length;g++){var y=m[g];d.push(r(y.literal)),p.push(n(y.literal,s)),_.push(e.visitNode(y.expression,o,e.isExpression));}}var v=i.getEmitHelperFactory().createTemplateObjectHelper(e.factory.createArrayLiteralExpression(d),e.factory.createArrayLiteralExpression(p));if(e.isExternalModule(s)){var h=e.factory.createUniqueName("templateObject");c(h),_[0]=e.factory.createLogicalOr(h,e.factory.createAssignment(h,v));}else _[0]=v;return e.factory.createCallExpression(u,void 0,_)};}(t),function(e){var t,r;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.NamespaceExports=2]="NamespaceExports",e[e.NonQualifiedEnumMembers=8]="NonQualifiedEnumMembers";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasStaticInitializedProperties=1]="HasStaticInitializedProperties",e[e.HasConstructorDecorators=2]="HasConstructorDecorators",e[e.HasMemberDecorators=4]="HasMemberDecorators",e[e.IsExportOfNamespace=8]="IsExportOfNamespace",e[e.IsNamedExternalExport=16]="IsNamedExternalExport",e[e.IsDefaultExternalExport=32]="IsDefaultExternalExport",e[e.IsDerivedClass=64]="IsDerivedClass",e[e.UseImmediatelyInvokedFunctionExpression=128]="UseImmediatelyInvokedFunctionExpression",e[e.HasAnyDecorators=6]="HasAnyDecorators",e[e.NeedsName=5]="NeedsName",e[e.MayNeedImmediatelyInvokedFunctionExpression=7]="MayNeedImmediatelyInvokedFunctionExpression",e[e.IsExported=56]="IsExported";}(r||(r={})),e.transformTypeScript=function(t){var r,n,i,a,o,s,c,l,u,_,d=t.factory,p=t.getEmitHelperFactory,f=t.startLexicalEnvironment,g=t.resumeLexicalEnvironment,m=t.endLexicalEnvironment,y=t.hoistVariableDeclaration,v=t.getEmitResolver(),h=t.getCompilerOptions(),b=e.getStrictOptionValue(h,"strictNullChecks"),x=e.getEmitScriptTarget(h),D=e.getEmitModuleKind(h),S=t.onEmitNode,T=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){var a=_,o=r;e.isSourceFile(n)&&(r=n),2&l&&function(t){return 260===e.getOriginalNode(t).kind}(n)&&(_|=2),8&l&&function(t){return 259===e.getOriginalNode(t).kind}(n)&&(_|=8),S(t,n,i),_=a,r=o;},t.onSubstituteNode=function(t,r){return r=T(t,r),1===t?function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&l&&33554432&v.getNodeCheckFlags(t)){var r=v.getReferencedValueDeclaration(t);if(r){var n=u[r.id];if(n){var i=d.cloneNode(n);return e.setSourceMapRange(i,t),e.setCommentRange(i,t),i}}}}(t)||Pe(t)||t}(t);case 205:case 206:return function(t){return function(t){var r=function(t){if(!h.isolatedModules)return e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)?v.getConstantValue(t):void 0}(t);if(void 0!==r){e.setConstantValue(t,r);var n="string"==typeof r?d.createStringLiteral(r):d.createNumericLiteral(r);if(!h.removeComments){var i=e.getOriginalNode(t,e.isAccessExpression),a=e.isPropertyAccessExpression(i)?e.declarationNameToString(i.name):e.getTextOfNode(i.argumentExpression);e.addSyntheticTrailingComment(n,3," ".concat(a," "));}return n}return t}(t)}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){if(2&l){var r=t.name,n=Pe(r);if(n){if(t.objectAssignmentInitializer){var i=d.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(d.createPropertyAssignment(r,i),t)}return e.setTextRange(d.createPropertyAssignment(r,n),t)}}return t}(r):r},t.enableSubstitution(205),t.enableSubstitution(206),function(t){return 304===t.kind?function(t){return d.createBundle(t.sourceFiles.map(C),e.mapDefined(t.prepends,(function(t){return 306===t.kind?e.createUnparsedSourceFile(t,"js"):t})))}(t):C(t)};function C(n){if(n.isDeclarationFile)return n;r=n;var i=E(n,R);return e.addEmitHelpers(i,t.readEmitHelpers()),r=void 0,i}function E(t,r){var n=a,i=o,l=s,u=c;!function(t){switch(t.kind){case 303:case 262:case 261:case 234:a=t,o=void 0,s=void 0;break;case 256:case 255:if(e.hasSyntacticModifier(t,2))break;t.name?de(t):e.Debug.assert(256===t.kind||e.hasSyntacticModifier(t,512)),e.isClassDeclaration(t)&&(o=t);}}(t);var _=r(t);return a!==n&&(s=l),a=n,o=i,c=u,_}function k(e){return E(e,N)}function N(e){return 1&e.transformFlags?L(e):e}function F(e){return E(e,A)}function A(r){switch(r.kind){case 265:case 264:case 270:case 271:return function(r){if(e.getParseTreeNode(r)!==r)return 1&r.transformFlags?e.visitEachChild(r,k,t):r;switch(r.kind){case 265:return function(t){if(!t.importClause)return t;if(!t.importClause.isTypeOnly){var r=e.visitNode(t.importClause,ye,e.isImportClause);return r||1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues?d.updateImportDeclaration(t,void 0,void 0,r,t.moduleSpecifier,t.assertClause):void 0}}(r);case 264:return xe(r);case 270:return function(r){return v.isValueAliasDeclaration(r)?e.visitEachChild(r,k,t):void 0}(r);case 271:return function(t){if(!t.isTypeOnly){if(!t.exportClause||e.isNamespaceExport(t.exportClause))return t;var r=!!t.moduleSpecifier&&(1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues),n=e.visitNode(t.exportClause,(function(t){return function(t,r){return e.isNamespaceExport(t)?function(t){return d.updateNamespaceExport(t,e.visitNode(t.name,k,e.isIdentifier))}(t):function(t,r){var n=e.visitNodes(t.elements,be,e.isExportSpecifier);return r||e.some(n)?d.updateNamedExports(t,n):void 0}(t,r)}(t,r)}),e.isNamedExportBindings);return n?d.updateExportDeclaration(t,void 0,void 0,t.isTypeOnly,n,t.moduleSpecifier,t.assertClause):void 0}}(r);default:e.Debug.fail("Unhandled ellided statement");}}(r);default:return N(r)}}function P(e){return E(e,w)}function w(t){if(271!==t.kind&&265!==t.kind&&266!==t.kind&&(264!==t.kind||276!==t.moduleReference.kind))return 1&t.transformFlags||e.hasSyntacticModifier(t,1)?L(t):t}function I(e){return E(e,O)}function O(t){switch(t.kind){case 170:return oe(t);case 166:return ae(t);case 175:case 171:case 172:case 168:case 169:return N(t);case 233:return t;default:return e.Debug.failBadSyntaxKind(t)}}function M(t){if(!(18654&e.modifierToFlag(t.kind)||n&&93===t.kind))return t}function L(o){if(e.isStatement(o)&&e.hasSyntacticModifier(o,2))return d.createNotEmittedStatement(o);switch(o.kind){case 93:case 88:return n?void 0:o;case 123:case 121:case 122:case 126:case 158:case 85:case 135:case 144:case 182:case 183:case 184:case 185:case 181:case 176:case 162:case 130:case 154:case 133:case 149:case 146:case 143:case 114:case 150:case 179:case 178:case 180:case 177:case 186:case 187:case 188:case 190:case 191:case 192:case 193:case 194:case 195:case 175:case 164:return;case 258:return d.createNotEmittedStatement(o);case 166:return ae(o);case 263:return;case 170:return oe(o);case 257:return d.createNotEmittedStatement(o);case 256:return function(i){if(!(j(i)||n&&e.hasSyntacticModifier(i,1)))return e.visitEachChild(i,k,t);var a=function(t,r){var n=0;e.some(r)&&(n|=1);var i=e.getEffectiveBaseTypeNode(t);return i&&104!==e.skipOuterExpressions(i.expression).kind&&(n|=64),e.classOrConstructorParameterIsDecorated(t)&&(n|=2),e.childIsDecorated(t)&&(n|=4),De(t)?n|=8:function(t){return Se(t)&&e.hasSyntacticModifier(t,512)}(t)?n|=32:Te(t)&&(n|=16),x<=1&&7&n&&(n|=128),n}(i,e.getProperties(i,!0,!0));128&a&&t.startLexicalEnvironment();var o=i.name||(5&a?d.getGeneratedNameForNode(i):void 0),s=2&a?function(r,n){var i=e.moveRangePastDecorators(r),a=function(r){if(16777216&v.getNodeCheckFlags(r)){0==(1&l)&&(l|=1,t.enableSubstitution(79),u=[]);var n=d.createUniqueName(r.name&&!e.isGeneratedIdentifier(r.name)?e.idText(r.name):"default");return u[e.getOriginalNodeId(r)]=n,y(n),n}}(r),o=x<=2?d.getInternalName(r,!1,!0):d.getLocalName(r,!1,!0),s=e.visitNodes(r.heritageClauses,k,e.isHeritageClause),c=J(r),_=d.createClassExpression(void 0,void 0,n,void 0,s,c);e.setOriginalNode(_,r),e.setTextRange(_,i);var p=d.createVariableStatement(void 0,d.createVariableDeclarationList([d.createVariableDeclaration(o,void 0,void 0,a?d.createAssignment(a,_):_)],1));return e.setOriginalNode(p,r),e.setTextRange(p,i),e.setCommentRange(p,r),p}(i,o):function(t,r,n){var i=128&n?void 0:e.visitNodes(t.modifiers,M,e.isModifier),a=d.createClassDeclaration(void 0,i,r,void 0,e.visitNodes(t.heritageClauses,k,e.isHeritageClause),J(t)),o=e.getEmitFlags(t);return 1&n&&(o|=32),e.setTextRange(a,t),e.setOriginalNode(a,t),e.setEmitFlags(a,o),a}(i,o,a),c=[s];if(V(c,i,!1),V(c,i,!0),function(t,r){var n=function(t){var r=K(t,t,function(t){var r=t.decorators,n=U(e.getFirstConstructorWithBody(t));if(r||n)return {decorators:r,parameters:n}}(t));if(r){var n=u&&u[e.getOriginalNodeId(t)],i=x<=2?d.getInternalName(t,!1,!0):d.getLocalName(t,!1,!0),a=p().createDecorateHelper(r,i),o=d.createAssignment(i,n?d.createAssignment(n,a):a);return e.setEmitFlags(o,1536),e.setSourceMapRange(o,e.moveRangePastDecorators(t)),o}}(r);n&&t.push(e.setOriginalNode(d.createExpressionStatement(n),r));}(c,i),128&a){var _=e.createTokenRange(e.skipTrivia(r.text,i.members.end),19),f=d.getInternalName(i),g=d.createPartiallyEmittedExpression(f);e.setTextRangeEnd(g,_.end),e.setEmitFlags(g,1536);var m=d.createReturnStatement(g);e.setTextRangePos(m,_.pos),e.setEmitFlags(m,1920),c.push(m),e.insertStatementsAfterStandardPrologue(c,t.endLexicalEnvironment());var h=d.createImmediatelyInvokedArrowFunction(c);e.setEmitFlags(h,33554432);var b=d.createVariableStatement(void 0,d.createVariableDeclarationList([d.createVariableDeclaration(d.getLocalName(i,!1,!1),void 0,void 0,h)]));e.setOriginalNode(b,i),e.setCommentRange(b,i),e.setSourceMapRange(b,e.moveRangePastDecorators(i)),e.startOnNewLine(b),c=[b];}return 8&a?Ee(c,i):(128&a||2&a)&&(32&a?c.push(d.createExportDefault(d.getLocalName(i,!1,!0))):16&a&&c.push(d.createExternalModuleExport(d.getLocalName(i,!1,!0)))),c.length>1&&(c.push(d.createEndOfDeclarationMarker(i)),e.setEmitFlags(s,4194304|e.getEmitFlags(s))),e.singleOrMany(c)}(o);case 225:return function(r){if(!j(r))return e.visitEachChild(r,k,t);var n=d.createClassExpression(void 0,void 0,r.name,void 0,e.visitNodes(r.heritageClauses,k,e.isHeritageClause),J(r));return e.setOriginalNode(n,r),e.setTextRange(n,r),n}(o);case 290:return function(r){if(117!==r.token)return e.visitEachChild(r,k,t)}(o);case 227:return function(t){return d.updateExpressionWithTypeArguments(t,e.visitNode(t.expression,k,e.isLeftHandSideExpression),void 0)}(o);case 168:return function(r){if(ie(r)){var n=d.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,ne(r),void 0,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 171:return function(r){if(ce(r)){var n=d.updateGetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),ne(r),e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([]));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 172:return function(r){if(ce(r)){var n=d.updateSetAccessorDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),ne(r),e.visitParameterList(r.parameters,k,t),e.visitFunctionBody(r.body,k,t)||d.createBlock([]));return n!==r&&(e.setCommentRange(n,r),e.setSourceMapRange(n,e.moveRangePastDecorators(r))),n}}(o);case 255:return function(r){if(!ie(r))return d.createNotEmittedStatement(r);var n=d.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([]));if(De(r)){var i=[n];return Ee(i,r),i}return n}(o);case 212:return function(r){return ie(r)?d.updateFunctionExpression(r,e.visitNodes(r.modifiers,M,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,k,t),void 0,e.visitFunctionBody(r.body,k,t)||d.createBlock([])):d.createOmittedExpression()}(o);case 213:return function(r){return d.updateArrowFunction(r,e.visitNodes(r.modifiers,M,e.isModifier),void 0,e.visitParameterList(r.parameters,k,t),void 0,r.equalsGreaterThanToken,e.visitFunctionBody(r.body,k,t))}(o);case 163:return function(t){if(!e.parameterIsThisKeyword(t)){var r=d.updateParameterDeclaration(t,void 0,void 0,t.dotDotDotToken,e.visitNode(t.name,k,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,k,e.isExpression));return r!==t&&(e.setCommentRange(r,t),e.setTextRange(r,e.moveRangePastModifiers(t)),e.setSourceMapRange(r,e.moveRangePastModifiers(t)),e.setEmitFlags(r.name,32)),r}}(o);case 211:return function(n){var i=e.skipOuterExpressions(n.expression,-7);if(e.isAssertionExpression(i)){var a=e.visitNode(n.expression,k,e.isExpression);return e.length(e.getLeadingCommentRangesOfNode(a,r))?d.updateParenthesizedExpression(n,a):d.createPartiallyEmittedExpression(a,n)}return e.visitEachChild(n,k,t)}(o);case 210:case 228:return function(t){var r=e.visitNode(t.expression,k,e.isExpression);return d.createPartiallyEmittedExpression(r,t)}(o);case 207:return function(t){return d.updateCallExpression(t,e.visitNode(t.expression,k,e.isExpression),void 0,e.visitNodes(t.arguments,k,e.isExpression))}(o);case 208:return function(t){return d.updateNewExpression(t,e.visitNode(t.expression,k,e.isExpression),void 0,e.visitNodes(t.arguments,k,e.isExpression))}(o);case 209:return function(t){return d.updateTaggedTemplateExpression(t,e.visitNode(t.tag,k,e.isExpression),void 0,e.visitNode(t.template,k,e.isExpression))}(o);case 229:return function(t){var r=e.visitNode(t.expression,k,e.isLeftHandSideExpression);return d.createPartiallyEmittedExpression(r,t)}(o);case 259:return function(t){if(!function(t){return !e.isEnumConst(t)||e.shouldPreserveConstEnums(h)}(t))return d.createNotEmittedStatement(t);var n=[],o=2,s=fe(n,t);s&&(D===e.ModuleKind.System&&a===r||(o|=512));var c=Fe(t),l=Ae(t),u=e.hasSyntacticModifier(t,1)?d.getExternalModuleOrNamespaceExportName(i,t,!1,!0):d.getLocalName(t,!1,!0),_=d.createLogicalOr(u,d.createAssignment(u,d.createObjectLiteralExpression()));if(_e(t)){var p=d.getLocalName(t,!1,!0);_=d.createAssignment(p,_);}var g=d.createExpressionStatement(d.createCallExpression(d.createFunctionExpression(void 0,void 0,void 0,void 0,[d.createParameterDeclaration(void 0,void 0,void 0,c)],void 0,function(t,r){var n=i;i=r;var a=[];f();var o=e.map(t.members,ue);return e.insertStatementsAfterStandardPrologue(a,m()),e.addRange(a,o),i=n,d.createBlock(e.setTextRange(d.createNodeArray(a),t.members),!0)}(t,l)),void 0,[_]));return e.setOriginalNode(g,t),s&&(e.setSyntheticLeadingComments(g,void 0),e.setSyntheticTrailingComments(g,void 0)),e.setTextRange(g,t),e.addEmitFlags(g,o),n.push(g),n.push(d.createEndOfDeclarationMarker(t)),n}(o);case 236:return function(r){if(De(r)){var n=e.getInitializedVariables(r.declarationList);if(0===n.length)return;return e.setTextRange(d.createExpressionStatement(d.inlineExpressions(e.map(n,le))),r)}return e.visitEachChild(r,k,t)}(o);case 253:return function(t){return d.updateVariableDeclaration(t,e.visitNode(t.name,k,e.isBindingName),void 0,void 0,e.visitNode(t.initializer,k,e.isExpression))}(o);case 260:return ge(o);case 264:return xe(o);case 278:return function(t){return d.updateJsxSelfClosingElement(t,e.visitNode(t.tagName,k,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,k,e.isJsxAttributes))}(o);case 279:return function(t){return d.updateJsxOpeningElement(t,e.visitNode(t.tagName,k,e.isJsxTagNameExpression),void 0,e.visitNode(t.attributes,k,e.isJsxAttributes))}(o);default:return e.visitEachChild(o,k,t)}}function R(r){var n=e.getStrictOptionValue(h,"alwaysStrict")&&!(e.isExternalModule(r)&&D>=e.ModuleKind.ES2015)&&!e.isJsonSourceFile(r);return d.updateSourceFile(r,e.visitLexicalEnvironment(r.statements,F,t,0,n))}function B(e){return !!(4096&e.transformFlags)}function j(t){return e.some(t.decorators)||e.some(t.typeParameters)||e.some(t.heritageClauses,B)||e.some(t.members,B)}function J(t){var r=[],n=e.getFirstConstructorWithBody(t),i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(i)for(var a=0,o=i;a<o.length;a++){var s=o[a];e.isIdentifier(s.name)&&r.push(e.setOriginalNode(d.createPropertyDeclaration(void 0,void 0,s.name,void 0,void 0,void 0),s));}return e.addRange(r,e.visitNodes(t.members,I,e.isClassElement)),e.setTextRange(d.createNodeArray(r),t.members)}function z(t,r,n){return e.nodeOrChildIsDecorated(t,n)&&r===e.isStatic(t)}function U(t){var r;if(t)for(var n=t.parameters,i=n.length>0&&e.parameterIsThisKeyword(n[0]),a=i?1:0,o=i?n.length-1:n.length,s=0;s<o;s++){var c=n[s+a];(r||c.decorators)&&(r||(r=new Array(o)),r[s]=c.decorators);}return r}function K(t,r,n){if(n){var i=[];return e.addRange(i,e.map(n.decorators,W)),e.addRange(i,e.flatMap(n.parameters,H)),function(t,r,n){!function(t,r,n){h.emitDecoratorMetadata&&(function(e){var t=e.kind;return 168===t||171===t||172===t||166===t}(t)&&n.push(p().createMetadataHelper("design:type",G(t))),function(t){switch(t.kind){case 256:case 225:return void 0!==e.getFirstConstructorWithBody(t);case 168:case 171:case 172:return !0}return !1}(t)&&n.push(p().createMetadataHelper("design:paramtypes",function(t,r){var n=e.isClassLike(t)?e.getFirstConstructorWithBody(t):e.isFunctionLike(t)&&e.nodeIsPresent(t.body)?t:void 0,i=[];if(n)for(var a=function(t,r){if(r&&171===t.kind){var n=e.getAllAccessorDeclarations(r.members,t).setAccessor;if(n)return n.parameters}return t.parameters}(n,r),o=a.length,s=0;s<o;s++){var c=a[s];0===s&&e.isIdentifier(c.name)&&"this"===c.name.escapedText||(c.dotDotDotToken?i.push(Q(e.getRestParameterElementType(c.type))):i.push(G(c)));}return d.createArrayLiteralExpression(i)}(t,r))),function(e){return 168===e.kind}(t)&&n.push(p().createMetadataHelper("design:returntype",function(t){return e.isFunctionLike(t)&&t.type?Q(t.type):e.isAsyncFunction(t)?d.createIdentifier("Promise"):d.createVoidZero()}(t))));}(t,r,n);}(t,r,i),i}}function V(t,r,n){e.addRange(t,e.map(function(t,r){for(var n,i=0,a=function(t,r){return e.filter(t.members,r?function(e){return z(e,!0,t)}:function(e){return z(e,!1,t)})}(t,r);i<a.length;i++){var o=q(t,a[i]);o&&(n?n.push(o):n=[o]);}return n}(r,n),Ce));}function q(t,r){var n=K(r,t,function(t,r){switch(r.kind){case 171:case 172:return function(t,r){if(r.body){var n=e.getAllAccessorDeclarations(t.members,r),i=n.firstAccessor,a=n.secondAccessor,o=n.setAccessor,s=i.decorators?i:a&&a.decorators?a:void 0;if(s&&r===s){var c=s.decorators,l=U(o);if(c||l)return {decorators:c,parameters:l}}}}(t,r);case 168:return function(e){if(e.body){var t=e.decorators,r=U(e);if(t||r)return {decorators:t,parameters:r}}}(r);case 166:return function(e){var t=e.decorators;if(t)return {decorators:t}}(r);default:return}}(t,r));if(n){var i=function(t,r){return e.isStatic(r)?d.getDeclarationName(t):function(e){return d.createPropertyAccessExpression(d.getDeclarationName(e),"prototype")}(t)}(t,r),a=re(r,!0),o=x>0?166===r.kind?d.createVoidZero():d.createNull():void 0,s=p().createDecorateHelper(n,i,a,o);return e.setTextRange(s,e.moveRangePastDecorators(r)),e.setEmitFlags(s,1536),s}}function W(t){return e.visitNode(t.expression,k,e.isExpression)}function H(t,r){var n;if(t){n=[];for(var i=0,a=t;i<a.length;i++){var o=a[i],s=p().createParamHelper(W(o),r);e.setTextRange(s,o.expression),e.setEmitFlags(s,1536),n.push(s);}}return n}function G(t){switch(t.kind){case 166:case 163:return Q(t.type);case 172:case 171:return Q(function(t){var r=v.getAllAccessorDeclarations(t);return r.setAccessor&&e.getSetAccessorTypeAnnotationNode(r.setAccessor)||r.getAccessor&&e.getEffectiveReturnTypeNode(r.getAccessor)}(t));case 256:case 225:case 168:return d.createIdentifier("Function");default:return d.createVoidZero()}}function Q(t){if(void 0===t)return d.createIdentifier("Object");switch(t.kind){case 114:case 152:case 143:return d.createVoidZero();case 190:return Q(t.type);case 178:case 179:return d.createIdentifier("Function");case 182:case 183:return d.createIdentifier("Array");case 176:case 133:return d.createIdentifier("Boolean");case 149:return d.createIdentifier("String");case 147:return d.createIdentifier("Object");case 195:switch(t.literal.kind){case 10:case 14:return d.createIdentifier("String");case 218:case 8:return d.createIdentifier("Number");case 9:return te();case 110:case 95:return d.createIdentifier("Boolean");case 104:return d.createVoidZero();default:return e.Debug.failBadSyntaxKind(t.literal)}case 146:return d.createIdentifier("Number");case 157:return te();case 150:return x<2?ee():d.createIdentifier("Symbol");case 177:return function(t){var r=v.getTypeReferenceSerializationKind(t.typeName,o||a);switch(r){case e.TypeReferenceSerializationKind.Unknown:if(e.findAncestor(t,(function(t){return t.parent&&e.isConditionalTypeNode(t.parent)&&(t.parent.trueType===t||t.parent.falseType===t)})))return d.createIdentifier("Object");var n=Z(t.typeName),i=d.createTempVariable(y);return d.createConditionalExpression(d.createTypeCheck(d.createAssignment(i,n),"function"),void 0,i,void 0,d.createIdentifier("Object"));case e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue:return $(t.typeName);case e.TypeReferenceSerializationKind.VoidNullableOrNeverType:return d.createVoidZero();case e.TypeReferenceSerializationKind.BigIntLikeType:return te();case e.TypeReferenceSerializationKind.BooleanType:return d.createIdentifier("Boolean");case e.TypeReferenceSerializationKind.NumberLikeType:return d.createIdentifier("Number");case e.TypeReferenceSerializationKind.StringLikeType:return d.createIdentifier("String");case e.TypeReferenceSerializationKind.ArrayLikeType:return d.createIdentifier("Array");case e.TypeReferenceSerializationKind.ESSymbolType:return x<2?ee():d.createIdentifier("Symbol");case e.TypeReferenceSerializationKind.TypeWithCallSignature:return d.createIdentifier("Function");case e.TypeReferenceSerializationKind.Promise:return d.createIdentifier("Promise");case e.TypeReferenceSerializationKind.ObjectType:return d.createIdentifier("Object");default:return e.Debug.assertNever(r)}}(t);case 187:case 186:return X(t.types);case 188:return X([t.trueType,t.falseType]);case 192:if(144===t.operator)return Q(t.type);break;case 180:case 193:case 194:case 181:case 130:case 154:case 191:case 199:break;case 310:case 311:case 315:case 316:case 317:break;case 312:case 313:case 314:return Q(t.type);default:return e.Debug.failBadSyntaxKind(t)}return d.createIdentifier("Object")}function X(t){for(var r,n=0,i=t;n<i.length;n++){for(var a=i[n];190===a.kind;)a=a.type;if(143!==a.kind&&(b||(195!==a.kind||104!==a.literal.kind)&&152!==a.kind)){var o=Q(a);if(e.isIdentifier(o)&&"Object"===o.escapedText)return o;if(r){if(!e.isIdentifier(r)||!e.isIdentifier(o)||r.escapedText!==o.escapedText)return d.createIdentifier("Object")}else r=o;}}return r||d.createVoidZero()}function Y(e,t){return d.createLogicalAnd(d.createStrictInequality(d.createTypeOfExpression(e),d.createStringLiteral("undefined")),t)}function Z(e){if(79===e.kind){var t=$(e);return Y(t,t)}if(79===e.left.kind)return Y($(e.left),$(e));var r=Z(e.left),n=d.createTempVariable(y);return d.createLogicalAnd(d.createLogicalAnd(r.left,d.createStrictInequality(d.createAssignment(n,r.right),d.createVoidZero())),d.createPropertyAccessExpression(n,e.right))}function $(t){switch(t.kind){case 79:var r=e.setParent(e.setTextRange(e.parseNodeFactory.cloneNode(t),t),t.parent);return r.original=void 0,e.setParent(r,e.getParseTreeNode(a)),r;case 160:return function(e){return d.createPropertyAccessExpression($(e.left),e.right)}(t)}}function ee(){return d.createConditionalExpression(d.createTypeCheck(d.createIdentifier("Symbol"),"function"),void 0,d.createIdentifier("Symbol"),void 0,d.createIdentifier("Object"))}function te(){return x<99?d.createConditionalExpression(d.createTypeCheck(d.createIdentifier("BigInt"),"function"),void 0,d.createIdentifier("BigInt"),void 0,d.createIdentifier("Object")):d.createIdentifier("BigInt")}function re(t,r){var n=t.name;return e.isPrivateIdentifier(n)?d.createIdentifier(""):e.isComputedPropertyName(n)?r&&!e.isSimpleInlineableExpression(n.expression)?d.getGeneratedNameForNode(n):n.expression:e.isIdentifier(n)?d.createStringLiteral(e.idText(n)):d.cloneNode(n)}function ne(t){var r=t.name;if(e.isComputedPropertyName(r)&&(!e.hasStaticModifier(t)&&c||e.some(t.decorators))){var n=e.visitNode(r.expression,k,e.isExpression),i=e.skipPartiallyEmittedExpressions(n);if(!e.isSimpleInlineableExpression(i)){var a=d.getGeneratedNameForNode(r);return y(a),d.updateComputedPropertyName(r,d.createAssignment(a,n))}}return e.visitNode(r,k,e.isPropertyName)}function ie(t){return !e.nodeIsMissing(t.body)}function ae(t){if(!(8388608&t.flags||e.hasSyntacticModifier(t,128))){var r=d.updatePropertyDeclaration(t,void 0,e.visitNodes(t.modifiers,k,e.isModifier),ne(t),void 0,void 0,e.visitNode(t.initializer,k));return r!==t&&(e.setCommentRange(r,t),e.setSourceMapRange(r,e.moveRangePastDecorators(t))),r}}function oe(r){if(ie(r))return d.updateConstructorDeclaration(r,void 0,void 0,e.visitParameterList(r.parameters,k,t),function(r,n){var i=n&&e.filter(n.parameters,(function(t){return e.isParameterPropertyDeclaration(t,n)}));if(!e.some(i))return e.visitFunctionBody(r,k,t);var a,o=[];g(),a=e.addPrologueDirectivesAndInitialSuperCall(d,n,o,k),e.addRange(o,e.map(i,se)),e.addRange(o,e.visitNodes(r.statements,k,e.isStatement,a)),o=d.mergeLexicalEnvironment(o,m());var s=d.createBlock(e.setTextRange(d.createNodeArray(o),r.statements),!0);return e.setTextRange(s,r),e.setOriginalNode(s,r),s}(r.body,r))}function se(t){var r=t.name;if(e.isIdentifier(r)){var n=e.setParent(e.setTextRange(d.cloneNode(r),r),r.parent);e.setEmitFlags(n,1584);var i=e.setParent(e.setTextRange(d.cloneNode(r),r),r.parent);return e.setEmitFlags(i,1536),e.startOnNewLine(e.removeAllComments(e.setTextRange(e.setOriginalNode(d.createExpressionStatement(d.createAssignment(e.setTextRange(d.createPropertyAccessExpression(d.createThis(),n),t.name),i)),t),e.moveRangePos(t,-1))))}}function ce(t){return !(e.nodeIsMissing(t.body)&&e.hasSyntacticModifier(t,128))}function le(r){var n=r.name;return e.isBindingPattern(n)?e.flattenDestructuringAssignment(r,k,t,0,!1,ke):e.setTextRange(d.createAssignment(Ne(n),e.visitNode(r.initializer,k,e.isExpression)),r)}function ue(r){var n=re(r,!1),a=function(r){var n=v.getConstantValue(r);return void 0!==n?"string"==typeof n?d.createStringLiteral(n):d.createNumericLiteral(n):(0==(8&l)&&(l|=8,t.enableSubstitution(79)),r.initializer?e.visitNode(r.initializer,k,e.isExpression):d.createVoidZero())}(r),o=d.createAssignment(d.createElementAccessExpression(i,n),a),s=10===a.kind?o:d.createAssignment(d.createElementAccessExpression(i,o),n);return e.setTextRange(d.createExpressionStatement(e.setTextRange(s,r)),r)}function _e(t){return De(t)||Se(t)&&D!==e.ModuleKind.ES2015&&D!==e.ModuleKind.ES2020&&D!==e.ModuleKind.ES2022&&D!==e.ModuleKind.ESNext&&D!==e.ModuleKind.System}function de(t){s||(s=new e.Map);var r=pe(t);s.has(r)||s.set(r,t);}function pe(t){return e.Debug.assertNode(t.name,e.isIdentifier),t.name.escapedText}function fe(t,r){var n=d.createVariableStatement(e.visitNodes(r.modifiers,M,e.isModifier),d.createVariableDeclarationList([d.createVariableDeclaration(d.getLocalName(r,!1,!0))],303===a.kind?0:1));if(e.setOriginalNode(n,r),de(r),function(e){if(s){var t=pe(e);return s.get(t)===e}return !0}(r))return 259===r.kind?e.setSourceMapRange(n.declarationList,r):e.setSourceMapRange(n,r),e.setCommentRange(n,r),e.addEmitFlags(n,4195328),t.push(n),!0;var i=d.createMergeDeclarationMarker(n);return e.setEmitFlags(i,4195840),t.push(i),!1}function ge(o){if(!function(t){var r=e.getParseTreeNode(t,e.isModuleDeclaration);return !r||e.isInstantiatedModule(r,e.shouldPreserveConstEnums(h))}(o))return d.createNotEmittedStatement(o);e.Debug.assertNode(o.name,e.isIdentifier,"A TypeScript namespace should have an Identifier name."),0==(2&l)&&(l|=2,t.enableSubstitution(79),t.enableSubstitution(295),t.enableEmitNotification(260));var c=[],u=2,_=fe(c,o);_&&(D===e.ModuleKind.System&&a===r||(u|=512));var p=Fe(o),g=Ae(o),y=e.hasSyntacticModifier(o,1)?d.getExternalModuleOrNamespaceExportName(i,o,!1,!0):d.getLocalName(o,!1,!0),v=d.createLogicalOr(y,d.createAssignment(y,d.createObjectLiteralExpression()));if(_e(o)){var b=d.getLocalName(o,!1,!0);v=d.createAssignment(b,v);}var x=d.createExpressionStatement(d.createCallExpression(d.createFunctionExpression(void 0,void 0,void 0,void 0,[d.createParameterDeclaration(void 0,void 0,void 0,p)],void 0,function(t,r){var a=i,o=n,c=s;i=r,n=t,s=void 0;var l,u,_=[];if(f(),t.body)if(261===t.body.kind)E(t.body,(function(t){return e.addRange(_,e.visitNodes(t.statements,P,e.isStatement))})),l=t.body.statements,u=t.body;else {var p=ge(t.body);p&&(e.isArray(p)?e.addRange(_,p):_.push(p));var g=me(t).body;l=e.moveRangePos(g.statements,-1);}e.insertStatementsAfterStandardPrologue(_,m()),i=a,n=o,s=c;var y=d.createBlock(e.setTextRange(d.createNodeArray(_),l),!0);return e.setTextRange(y,u),t.body&&261===t.body.kind||e.setEmitFlags(y,1536|e.getEmitFlags(y)),y}(o,g)),void 0,[v]));return e.setOriginalNode(x,o),_&&(e.setSyntheticLeadingComments(x,void 0),e.setSyntheticTrailingComments(x,void 0)),e.setTextRange(x,o),e.addEmitFlags(x,u),c.push(x),c.push(d.createEndOfDeclarationMarker(o)),c}function me(e){if(260===e.body.kind)return me(e.body)||e.body}function ye(t){e.Debug.assert(!t.isTypeOnly);var r=we(t)?t.name:void 0,n=e.visitNode(t.namedBindings,ve,e.isNamedImportBindings);return r||n?d.updateImportClause(t,!1,r,n):void 0}function ve(t){if(267===t.kind)return we(t)?t:void 0;var r=h.preserveValueImports&&(1===h.importsNotUsedAsValues||2===h.importsNotUsedAsValues),n=e.visitNodes(t.elements,he,e.isImportSpecifier);return r||e.some(n)?d.updateNamedImports(t,n):void 0}function he(e){return !e.isTypeOnly&&we(e)?e:void 0}function be(e){return !e.isTypeOnly&&v.isValueAliasDeclaration(e)?e:void 0}function xe(n){if(!n.isTypeOnly){if(e.isExternalModuleImportEqualsDeclaration(n)){var a=we(n);return a||1!==h.importsNotUsedAsValues?a?e.visitEachChild(n,k,t):void 0:e.setOriginalNode(e.setTextRange(d.createImportDeclaration(void 0,void 0,void 0,n.moduleReference.expression,void 0),n),n)}if(function(t){return we(t)||!e.isExternalModule(r)&&v.isTopLevelValueImportEqualsWithEntityName(t)}(n)){var o,s,c,l=e.createExpressionFromEntityName(d,n.moduleReference);return e.setEmitFlags(l,3584),Te(n)||!De(n)?e.setOriginalNode(e.setTextRange(d.createVariableStatement(e.visitNodes(n.modifiers,M,e.isModifier),d.createVariableDeclarationList([e.setOriginalNode(d.createVariableDeclaration(n.name,void 0,void 0,l),n)])),n),n):e.setOriginalNode((o=n.name,s=l,c=n,e.setTextRange(d.createExpressionStatement(d.createAssignment(d.getNamespaceMemberName(i,o,!1,!0),s)),c)),n)}}}function De(t){return void 0!==n&&e.hasSyntacticModifier(t,1)}function Se(t){return void 0===n&&e.hasSyntacticModifier(t,1)}function Te(t){return Se(t)&&!e.hasSyntacticModifier(t,512)}function Ce(e){return d.createExpressionStatement(e)}function Ee(t,r){var n=d.createAssignment(d.getExternalModuleOrNamespaceExportName(i,r,!1,!0),d.getLocalName(r));e.setSourceMapRange(n,e.createRange(r.name?r.name.pos:r.pos,r.end));var a=d.createExpressionStatement(n);e.setSourceMapRange(a,e.createRange(-1,r.end)),t.push(a);}function ke(t,r,n){return e.setTextRange(d.createAssignment(Ne(t),r),n)}function Ne(e){return d.getNamespaceMemberName(i,e,!1,!0)}function Fe(t){var r=d.getGeneratedNameForNode(t);return e.setSourceMapRange(r,t.name),r}function Ae(e){return d.getGeneratedNameForNode(e)}function Pe(t){if(l&_&&!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var r=v.getReferencedExportContainer(t,!1);if(r&&303!==r.kind&&(2&_&&260===r.kind||8&_&&259===r.kind))return e.setTextRange(d.createPropertyAccessExpression(d.getGeneratedNameForNode(r),t),t)}}function we(e){return h.preserveValueImports?v.isValueAliasDeclaration(e):v.isReferencedAliasDeclaration(e)}};}(t),function(e){var t,r,i;!function(e){e[e.ClassAliases=1]="ClassAliases",e[e.ClassStaticThisOrSuperReference=2]="ClassStaticThisOrSuperReference";}(t||(t={})),(i=e.PrivateIdentifierKind||(e.PrivateIdentifierKind={})).Field="f",i.Method="m",i.Accessor="a",function(e){e[e.None=0]="None",e[e.ClassWasDecorated=1]="ClassWasDecorated",e[e.NeedsClassConstructorReference=2]="NeedsClassConstructorReference",e[e.NeedsClassSuperReference=4]="NeedsClassSuperReference",e[e.NeedsSubstitutionForThisInClassStaticField=8]="NeedsSubstitutionForThisInClassStaticField";}(r||(r={})),e.transformClassFields=function(t){var r=t.factory,i=t.hoistVariableDeclaration,a=t.endLexicalEnvironment,o=t.startLexicalEnvironment,s=t.resumeLexicalEnvironment,c=t.addBlockScopedVariable,l=t.getEmitResolver(),u=t.getCompilerOptions(),_=e.getEmitScriptTarget(u),d=e.getUseDefineForClassFields(u),p=_<99,f=(_<=8||!d)&&_>=2,g=_<=8||!d,m=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=m(t,n),1===t?function(t){switch(t.kind){case 79:return function(t){return function(t){if(1&y&&33554432&l.getNodeCheckFlags(t)){var n=l.getReferencedValueDeclaration(t);if(n){var i=v[n.id];if(i){var a=r.cloneNode(i);return e.setSourceMapRange(a,t),e.setCommentRange(a,t),a}}}}(t)||t}(t);case 108:return function(t){if(2&y&&D){var n=D.facts,i=D.classConstructor;if(1&n)return r.createParenthesizedExpression(r.createVoidZero());if(i)return e.setTextRange(e.setOriginalNode(r.cloneNode(i),t),t)}return t}(t)}return t}(n):n};var y,v,h,b,x=t.onEmitNode;t.onEmitNode=function(t,r,n){var i=e.getOriginalNode(r);if(i.id){var a=E.get(i.id);if(a){var o=D,s=S;return D=a,S=a,x(t,r,n),D=o,void(S=s)}}switch(r.kind){case 212:if(e.isArrowFunction(i)||262144&e.getEmitFlags(r))break;case 255:case 170:return o=D,s=S,D=void 0,S=void 0,x(t,r,n),D=o,void(S=s);case 171:case 172:case 168:case 166:return o=D,s=S,S=D,D=void 0,x(t,r,n),D=o,void(S=s);case 161:return o=D,s=S,D=S,S=void 0,x(t,r,n),D=o,void(S=s)}x(t,r,n);};var D,S,T,C=[],E=new e.Map;return e.chainBundle(t,(function(r){var n=t.getCompilerOptions();if(r.isDeclarationFile||d&&99===e.getEmitScriptTarget(n))return r;var i=e.visitEachChild(r,F,t);return e.addEmitHelpers(i,t.readEmitHelpers()),i}));function k(a,o){if(8388608&a.transformFlags)switch(a.kind){case 225:case 256:return function(n){if(!e.forEach(n.members,j))return e.visitEachChild(n,F,t);var a=h;if(h=void 0,C.push(D),D=void 0,p){var o=e.getNameOfDeclaration(n);o&&e.isIdentifier(o)&&(Q().className=e.idText(o));var s=J(n);e.some(s)&&(Q().weakSetName=Z("instances",s[0].name));}var u=e.isClassDeclaration(n)?function(t){var n=z(t);n&&(G().facts=n),8&n&&W();var a,o=e.getStaticPropertiesAndClassStaticBlock(t);if(2&n){var s=r.createTempVariable(i,!0);G().classConstructor=r.cloneNode(s),a=r.createAssignment(s,r.getInternalName(t));}var c=e.getEffectiveBaseTypeNode(t),l=!(!c||104===e.skipOuterExpressions(c.expression).kind),u=[r.updateClassDeclaration(t,void 0,t.modifiers,t.name,void 0,e.visitNodes(t.heritageClauses,A,e.isHeritageClause),U(t,l))];return a&&X().unshift(a),e.some(h)&&u.push(r.createExpressionStatement(r.inlineExpressions(h))),e.some(o)&&V(u,o,r.getInternalName(t)),u}(n):function(n){var a=z(n);a&&(G().facts=a),8&a&&W();var o,s=!!(1&a),u=e.getStaticPropertiesAndClassStaticBlock(n),_=e.getEffectiveBaseTypeNode(n),d=!(!_||104===e.skipOuterExpressions(_.expression).kind),f=16777216&l.getNodeCheckFlags(n);function g(){var e=l.getNodeCheckFlags(n),t=16777216&e,a=524288&e;return r.createTempVariable(a?c:i,!!t)}2&a&&(o=g(),G().classConstructor=r.cloneNode(o));var m=r.updateClassExpression(n,e.visitNodes(n.decorators,F,e.isDecorator),n.modifiers,n.name,void 0,e.visitNodes(n.heritageClauses,A,e.isHeritageClause),U(n,d));if(e.some(u,(function(t){return e.isClassStaticBlockDeclaration(t)||!!t.initializer||p&&e.isPrivateIdentifier(t.name)}))||e.some(h)){if(s)return e.Debug.assertIsDefined(b,"Decorated classes transformed by TypeScript are expected to be within a variable declaration."),b&&h&&e.some(h)&&b.push(r.createExpressionStatement(r.inlineExpressions(h))),b&&e.some(u)&&V(b,u,r.getInternalName(n)),o?r.inlineExpressions([r.createAssignment(o,m),o]):m;var x=[];if(o||(o=g()),f){0==(1&y)&&(y|=1,t.enableSubstitution(79),v=[]);var D=r.cloneNode(o);D.autoGenerateFlags&=-9,v[e.getOriginalNodeId(n)]=D;}return e.setEmitFlags(m,65536|e.getEmitFlags(m)),x.push(e.startOnNewLine(r.createAssignment(o,m))),e.addRange(x,e.map(h,e.startOnNewLine)),e.addRange(x,function(t,r){for(var n=[],i=0,a=t;i<a.length;i++){var o=a[i],s=e.isClassStaticBlockDeclaration(o)?R(o):q(o,r);s&&(e.startOnNewLine(s),e.setSourceMapRange(s,e.moveRangePastModifiers(o)),e.setCommentRange(s,o),e.setOriginalNode(s,o),n.push(s));}return n}(u,o)),x.push(e.startOnNewLine(o)),r.inlineExpressions(x)}return m}(n);return D=C.pop(),h=a,u}(a);case 166:return I(a);case 236:return function(r){var i=b;b=[];var a=e.visitEachChild(r,F,t),o=e.some(b)?n$3([a],b,!0):a;return b=i,o}(a);case 80:return function(t){return p?e.isStatement(t.parent)?t:e.setOriginalNode(r.createIdentifier(""),t):t}(a);case 169:return function(r){if(!p)return e.visitEachChild(r,w,t)}(a)}if(8388608&a.transformFlags||33554432&a.transformFlags&&f&&T&&D)switch(a.kind){case 218:case 219:return function(n,a){if(45===n.operator||46===n.operator)if(p&&e.isPrivateIdentifierPropertyAccessExpression(n.operand)){var o;if(o=ee(n.operand.name)){var s=L(e.visitNode(n.operand.expression,F,e.isExpression)),c=s.readExpression,l=s.initializeExpression,u=O(o,c),_=e.isPrefixUnaryExpression(n)||a?void 0:r.createTempVariable(i);return u=B(o,l||c,u=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,u,i,_),63),e.setOriginalNode(u,n),e.setTextRange(u,n),_&&(u=r.createComma(u,_),e.setTextRange(u,n)),u}}else if(f&&e.isSuperProperty(n.operand)&&T&&D){var d=D.classConstructor,g=D.superClassReference;if(1&D.facts){var m=H(n.operand);return e.isPrefixUnaryExpression(n)?r.updatePrefixUnaryExpression(n,m):r.updatePostfixUnaryExpression(n,m)}if(d&&g){var y=void 0,v=void 0;if(e.isPropertyAccessExpression(n.operand)?e.isIdentifier(n.operand.name)&&(v=y=r.createStringLiteralFromNode(n.operand.name)):e.isSimpleInlineableExpression(n.operand.argumentExpression)?v=y=n.operand.argumentExpression:(v=r.createTempVariable(i),y=r.createAssignment(v,e.visitNode(n.operand.argumentExpression,F,e.isExpression))),y&&v)return u=r.createReflectGetCall(g,v,d),e.setTextRange(u,n.operand),_=a?void 0:r.createTempVariable(i),u=e.expandPreOrPostfixIncrementOrDecrementExpression(r,n,u,i,_),u=r.createReflectSetCall(g,y,u,d),e.setOriginalNode(u,n),e.setTextRange(u,n),_&&(u=r.createComma(u,_),e.setTextRange(u,n)),u}}return e.visitEachChild(n,F,t)}(a,o);case 220:return function(a,o){if(e.isDestructuringAssignment(a)){var s=h;h=void 0,a=r.updateBinaryExpression(a,e.visitNode(a.left,P),a.operatorToken,e.visitNode(a.right,F));var c=e.some(h)?r.inlineExpressions(e.compact(n$3(n$3([],h,!0),[a],!1))):a;return h=s,c}if(e.isAssignmentExpression(a))if(p&&e.isPrivateIdentifierPropertyAccessExpression(a.left)){var l=ee(a.left.name);if(l)return e.setTextRange(e.setOriginalNode(B(l,a.left.expression,a.right,a.operatorToken.kind),a),a)}else if(f&&e.isSuperProperty(a.left)&&T&&D){var u=D.classConstructor,_=D.superClassReference;if(1&D.facts)return r.updateBinaryExpression(a,H(a.left),a.operatorToken,e.visitNode(a.right,F,e.isExpression));if(u&&_){var d=e.isElementAccessExpression(a.left)?e.visitNode(a.left.argumentExpression,F,e.isExpression):e.isIdentifier(a.left.name)?r.createStringLiteralFromNode(a.left.name):void 0;if(d){var g=e.visitNode(a.right,F,e.isExpression);if(e.isCompoundAssignment(a.operatorToken.kind)){var m=d;e.isSimpleInlineableExpression(d)||(m=r.createTempVariable(i),d=r.createAssignment(m,d));var y=r.createReflectGetCall(_,m,u);e.setOriginalNode(y,a.left),e.setTextRange(y,a.left),g=r.createBinaryExpression(y,e.getNonAssignmentOperatorForCompoundAssignment(a.operatorToken.kind),g),e.setTextRange(g,a);}var v=o?void 0:r.createTempVariable(i);return v&&(g=r.createAssignment(v,g),e.setTextRange(v,a)),g=r.createReflectSetCall(_,d,g,u),e.setOriginalNode(g,a),e.setTextRange(g,a),v&&(g=r.createComma(g,v),e.setTextRange(g,a)),g}}}return 101===a.operatorToken.kind&&e.isPrivateIdentifier(a.left)?function(r){if(!p)return r;var n=r.left;e.Debug.assertNode(n,e.isPrivateIdentifier),e.Debug.assert(101===r.operatorToken.kind);var i=ee(n);if(i){var a=e.visitNode(r.right,F,e.isExpression);return e.setOriginalNode(t.getEmitHelperFactory().createClassPrivateFieldInHelper(i.brandCheckIdentifier,a),r)}return e.visitEachChild(r,F,t)}(a):e.visitEachChild(a,F,t)}(a,o);case 207:return function(a){if(p&&e.isPrivateIdentifierPropertyAccessExpression(a.expression)){var o=r.createCallBinding(a.expression,i,_),s=o.thisArg,c=o.target;return e.isCallChain(a)?r.updateCallChain(a,r.createPropertyAccessChain(e.visitNode(c,F),a.questionDotToken,"call"),void 0,void 0,n$3([e.visitNode(s,F,e.isExpression)],e.visitNodes(a.arguments,F,e.isExpression),!0)):r.updateCallExpression(a,r.createPropertyAccessExpression(e.visitNode(c,F),"call"),void 0,n$3([e.visitNode(s,F,e.isExpression)],e.visitNodes(a.arguments,F,e.isExpression),!0))}if(f&&e.isSuperProperty(a.expression)&&T&&(null==D?void 0:D.classConstructor)){var l=r.createFunctionCallCall(e.visitNode(a.expression,F,e.isExpression),D.classConstructor,e.visitNodes(a.arguments,F,e.isExpression));return e.setOriginalNode(l,a),e.setTextRange(l,a),l}return e.visitEachChild(a,F,t)}(a);case 209:return function(n){if(p&&e.isPrivateIdentifierPropertyAccessExpression(n.tag)){var a=r.createCallBinding(n.tag,i,_),o=a.thisArg,s=a.target;return r.updateTaggedTemplateExpression(n,r.createCallExpression(r.createPropertyAccessExpression(e.visitNode(s,F),"bind"),void 0,[e.visitNode(o,F,e.isExpression)]),void 0,e.visitNode(n.template,F,e.isTemplateLiteral))}if(f&&e.isSuperProperty(n.tag)&&T&&(null==D?void 0:D.classConstructor)){var c=r.createFunctionBindCall(e.visitNode(n.tag,F,e.isExpression),D.classConstructor,[]);return e.setOriginalNode(c,n),e.setTextRange(c,n),r.updateTaggedTemplateExpression(n,c,void 0,e.visitNode(n.template,F,e.isTemplateLiteral))}return e.visitEachChild(n,F,t)}(a);case 205:return function(n){if(p&&e.isPrivateIdentifier(n.name)){var i=ee(n.name);if(i)return e.setTextRange(e.setOriginalNode(O(i,n.expression),n),n)}if(f&&e.isSuperProperty(n)&&e.isIdentifier(n.name)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)return H(n);if(a&&o){var s=r.createReflectGetCall(o,r.createStringLiteralFromNode(n.name),a);return e.setOriginalNode(s,n.expression),e.setTextRange(s,n.expression),s}}return e.visitEachChild(n,F,t)}(a);case 206:return function(n){if(f&&e.isSuperProperty(n)&&T&&D){var i=D.classConstructor,a=D.superClassReference;if(1&D.facts)return H(n);if(i&&a){var o=r.createReflectGetCall(a,e.visitNode(n.argumentExpression,F,e.isExpression),i);return e.setOriginalNode(o,n.expression),e.setTextRange(o,n.expression),o}}return e.visitEachChild(n,F,t)}(a);case 237:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,N,e.isExpression))}(a);case 241:return function(n){return r.updateForStatement(n,e.visitNode(n.initializer,N,e.isForInitializer),e.visitNode(n.condition,F,e.isExpression),e.visitNode(n.incrementor,N,e.isExpression),e.visitIterationBody(n.statement,F,t))}(a);case 255:case 212:case 170:case 168:case 171:case 172:var s=T;T=void 0;var u=e.visitEachChild(a,F,t);return T=s,u}return e.visitEachChild(a,F,t)}function N(e){return k(e,!0)}function F(e){return k(e,!1)}function A(n){switch(n.kind){case 290:return e.visitEachChild(n,A,t);case 227:return function(n){if(4&((null==D?void 0:D.facts)||0)){var a=r.createTempVariable(i,!0);return G().superClassReference=a,r.updateExpressionWithTypeArguments(n,r.createAssignment(a,e.visitNode(n.expression,F,e.isExpression)),void 0)}return e.visitEachChild(n,F,t)}(n)}return F(n)}function P(t){switch(t.kind){case 204:case 203:return function(t){return e.isArrayLiteralExpression(t)?r.updateArrayLiteralExpression(t,e.visitNodes(t.elements,re,e.isExpression)):r.updateObjectLiteralExpression(t,e.visitNodes(t.properties,ne,e.isObjectLiteralElementLike))}(t);default:return F(t)}}function w(n){switch(n.kind){case 170:return;case 171:case 172:case 168:return function(n){if(e.Debug.assert(!e.some(n.decorators)),!p||!e.isPrivateIdentifier(n.name))return e.visitEachChild(n,w,t);var i=ee(n.name);if(e.Debug.assert(i,"Undeclared private name for property declaration."),!i.isValid)return n;var a=function(t){e.Debug.assert(e.isPrivateIdentifier(t.name));var r=ee(t.name);if(e.Debug.assert(r,"Undeclared private name for property declaration."),"m"===r.kind)return r.methodName;if("a"===r.kind){if(e.isGetAccessor(t))return r.getterName;if(e.isSetAccessor(t))return r.setterName}}(n);a&&X().push(r.createAssignment(a,r.createFunctionExpression(e.filter(n.modifiers,(function(t){return !e.isStaticModifier(t)})),n.asteriskToken,a,void 0,e.visitParameterList(n.parameters,w,t),void 0,e.visitFunctionBody(n.body,w,t))));}(n);case 166:return I(n);case 161:return function(n){var i=e.visitEachChild(n,F,t);if(e.some(h)){var a=h;a.push(i.expression),h=[],i=r.updateComputedPropertyName(i,r.inlineExpressions(a));}return i}(n);case 233:return n;default:return F(n)}}function I(t){if(e.Debug.assert(!e.some(t.decorators)),e.isPrivateIdentifier(t.name)){if(!p)return r.updatePropertyDeclaration(t,void 0,e.visitNodes(t.modifiers,F,e.isModifier),t.name,void 0,void 0,void 0);var n=ee(t.name);if(e.Debug.assert(n,"Undeclared private name for property declaration."),!n.isValid)return t}var a=function(t,n){if(e.isComputedPropertyName(t)){var a=e.visitNode(t.expression,F,e.isExpression),o=e.skipPartiallyEmittedExpressions(a),s=e.isSimpleInlineableExpression(o);if((!e.isAssignmentExpression(o)||!e.isGeneratedIdentifier(o.left))&&!s&&n){var u=r.getGeneratedNameForNode(t);return 524288&l.getNodeCheckFlags(t)?c(u):i(u),r.createAssignment(u,a)}return s||e.isIdentifier(o)?void 0:a}}(t.name,!!t.initializer||d);a&&!e.isSimpleInlineableExpression(a)&&X().push(a);}function O(t,r){return M(t,e.visitNode(r,F,e.isExpression))}function M(r,n){switch(e.setCommentRange(n,e.moveRangePos(n,-1)),r.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.getterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.methodName);case"f":return t.getEmitHelperFactory().createClassPrivateFieldGetHelper(n,r.brandCheckIdentifier,r.kind,r.variableName);default:e.Debug.assertNever(r,"Unknown private element type");}}function L(t){var n=e.nodeIsSynthesized(t)?t:r.cloneNode(t);if(e.isSimpleInlineableExpression(t))return {readExpression:n,initializeExpression:void 0};var a=r.createTempVariable(i);return {readExpression:a,initializeExpression:r.createAssignment(a,n)}}function R(t){if(p){D&&E.set(e.getOriginalNodeId(t),D),o();var n=T;T=t;var i=e.visitNodes(t.body.statements,F,e.isStatement);i=r.mergeLexicalEnvironment(i,a()),T=n;var s=r.createImmediatelyInvokedArrowFunction(i);return e.setOriginalNode(s,t),e.setTextRange(s,t),e.addEmitFlags(s,2),s}}function B(n,i,a,o){if(i=e.visitNode(i,F,e.isExpression),a=e.visitNode(a,F,e.isExpression),e.isCompoundAssignment(o)){var s=L(i),c=s.readExpression;i=s.initializeExpression||c,a=r.createBinaryExpression(M(n,c),e.getNonAssignmentOperatorForCompoundAssignment(o),a);}switch(e.setCommentRange(i,e.moveRangePos(i,-1)),n.kind){case"a":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.setterName);case"m":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,void 0);case"f":return t.getEmitHelperFactory().createClassPrivateFieldSetHelper(i,n.brandCheckIdentifier,a,n.kind,n.variableName);default:e.Debug.assertNever(n,"Unknown private element type");}}function j(t){return e.isPropertyDeclaration(t)||e.isClassStaticBlockDeclaration(t)||p&&t.name&&e.isPrivateIdentifier(t.name)}function J(t){return e.filter(t.members,e.isNonStaticMethodOrAccessorWithPrivateName)}function z(t){var r=0,n=e.getOriginalNode(t);e.isClassDeclaration(n)&&e.classOrConstructorParameterIsDecorated(n)&&(r|=1);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.isStatic(o)&&(o.name&&e.isPrivateIdentifier(o.name)&&p&&(r|=2),(e.isPropertyDeclaration(o)||e.isClassStaticBlockDeclaration(o))&&(g&&8192&o.transformFlags&&(1&(r|=8)||(r|=2)),f&&33554432&o.transformFlags&&(1&r||(r|=6))));}return r}function U(n,i){if(p){for(var o=0,c=n.members;o<c.length;o++){var l=c[o];e.isPrivateIdentifierClassElementDeclaration(l)&&Y(l);}e.some(J(n))&&(u=Q().weakSetName,e.Debug.assert(u,"weakSetName should be set in private identifier environment"),X().push(r.createAssignment(u,r.createNewExpression(r.createIdentifier("WeakSet"),void 0,[]))));}var u,_=[],f=function(n,i){var o=e.visitNode(e.getFirstConstructorWithBody(n),F,e.isConstructorDeclaration),c=n.members.filter(K);if(!e.some(c))return o;var l=e.visitParameterList(o?o.parameters:void 0,F,t),u=function(n,i,o){var c=e.getProperties(n,!1,!1);d||(c=e.filter(c,(function(t){return !!t.initializer||e.isPrivateIdentifier(t.name)})));var l=J(n),u=e.some(c)||e.some(l);if(!i&&!u)return e.visitFunctionBody(void 0,F,t);s();var _=0,f=[];if(!i&&o&&f.push(r.createExpressionStatement(r.createCallExpression(r.createSuper(),void 0,[r.createSpreadElement(r.createIdentifier("arguments"))]))),i&&(_=e.addPrologueDirectivesAndInitialSuperCall(r,i,f,F)),null==i?void 0:i.body){var g=e.findIndex(i.body.statements,(function(t){return !e.isParameterPropertyDeclaration(e.getOriginalNode(t),i)}),_);-1===g&&(g=i.body.statements.length),g>_&&(d||e.addRange(f,e.visitNodes(i.body.statements,F,e.isStatement,_,g-_)),_=g);}var m=r.createThis();return function(t,n,i){if(p&&e.some(n)){var a=Q().weakSetName;e.Debug.assert(a,"weakSetName should be set in private identifier environment"),t.push(r.createExpressionStatement(function(t,r){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(r,"add"),void 0,[t])}(i,a)));}}(f,l,m),V(f,c,m),i&&e.addRange(f,e.visitNodes(i.body.statements,F,e.isStatement,_)),f=r.mergeLexicalEnvironment(f,a()),e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(f),i?i.body.statements:n.members),!0),i?i.body:void 0)}(n,o,i);return u?e.startOnNewLine(e.setOriginalNode(e.setTextRange(r.createConstructorDeclaration(void 0,void 0,null!=l?l:[],u),o||n),o)):void 0}(n,i);return f&&_.push(f),e.addRange(_,e.visitNodes(n.members,w,e.isClassElement)),e.setTextRange(r.createNodeArray(_),n.members)}function K(t){return !e.isStatic(t)&&!e.hasSyntacticModifier(e.getOriginalNode(t),128)&&(d?_<99:e.isInitializedProperty(t)||p&&e.isPrivateIdentifierClassElementDeclaration(t))}function V(t,n,i){for(var a=0,o=n;a<o.length;a++){var s=o[a],c=e.isClassStaticBlockDeclaration(s)?R(s):q(s,i);if(c){var l=r.createExpressionStatement(c);e.setSourceMapRange(l,e.moveRangePastModifiers(s)),e.setCommentRange(l,s),e.setOriginalNode(l,s),t.push(l);}}}function q(t,n){var i=T,a=function(t,n){var i,a=!d,o=e.isComputedPropertyName(t.name)&&!e.isSimpleInlineableExpression(t.name.expression)?r.updateComputedPropertyName(t.name,r.getGeneratedNameForNode(t.name)):t.name;if(e.hasStaticModifier(t)&&(T=t),p&&e.isPrivateIdentifier(o)){var s=ee(o);if(s)return "f"===s.kind?s.isStatic?function(t,r){return e.factory.createAssignment(t,e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment("value",r||e.factory.createVoidZero())]))}(s.variableName,e.visitNode(t.initializer,F,e.isExpression)):function(t,r,n){return e.factory.createCallExpression(e.factory.createPropertyAccessExpression(n,"set"),void 0,[t,r||e.factory.createVoidZero()])}(n,e.visitNode(t.initializer,F,e.isExpression),s.brandCheckIdentifier):void 0;e.Debug.fail("Undeclared private name for property declaration.");}if(!e.isPrivateIdentifier(o)&&!e.hasStaticModifier(t)||t.initializer){var c=e.getOriginalNode(t);if(!e.hasSyntacticModifier(c,128)){var l=t.initializer||a?null!==(i=e.visitNode(t.initializer,F,e.isExpression))&&void 0!==i?i:r.createVoidZero():e.isParameterPropertyDeclaration(c,c.parent)&&e.isIdentifier(o)?o:r.createVoidZero();if(a||e.isPrivateIdentifier(o)){var u=e.createMemberAccessForPropertyName(r,n,o,o);return r.createAssignment(u,l)}var _=e.isComputedPropertyName(o)?o.expression:e.isIdentifier(o)?r.createStringLiteral(e.unescapeLeadingUnderscores(o.escapedText)):o,f=r.createPropertyDescriptor({value:l,configurable:!0,writable:!0,enumerable:!0});return r.createObjectDefinePropertyCall(n,_,f)}}}(t,n);return a&&e.hasStaticModifier(t)&&(null==D?void 0:D.facts)&&(e.setOriginalNode(a,t),e.addEmitFlags(a,2),E.set(e.getOriginalNodeId(a),D)),T=i,a}function W(){0==(2&y)&&(y|=2,t.enableSubstitution(108),t.enableEmitNotification(255),t.enableEmitNotification(212),t.enableEmitNotification(170),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(168),t.enableEmitNotification(166),t.enableEmitNotification(161));}function H(t){return e.isPropertyAccessExpression(t)?r.updatePropertyAccessExpression(t,r.createVoidZero(),t.name):r.updateElementAccessExpression(t,r.createVoidZero(),e.visitNode(t.argumentExpression,F,e.isExpression))}function G(){return D||(D={facts:0,classConstructor:void 0,superClassReference:void 0,privateIdentifierEnvironment:void 0})}function Q(){var t=G();return t.privateIdentifierEnvironment||(t.privateIdentifierEnvironment={className:"",identifiers:new e.Map}),t.privateIdentifierEnvironment}function X(){return h||(h=[])}function Y(t){var n,i=e.getTextOfPropertyName(t.name),a=G().classConstructor,o=Q(),s=o.weakSetName,c=[],l=t.name.escapedText,u=o.identifiers.get(l),_=!function(e){return "#constructor"===e.escapedText}(t.name)&&void 0===u;if(e.hasStaticModifier(t))if(e.Debug.assert(a,"weakSetName should be set in private identifier environment"),e.isPropertyDeclaration(t)){var d=$(i,t);o.identifiers.set(l,{kind:"f",variableName:d,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isMethodDeclaration(t)){var p=$(i,t);o.identifiers.set(l,{kind:"m",methodName:p,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isGetAccessorDeclaration(t)){var f=$(i+"_get",t);"a"===(null==u?void 0:u.kind)&&u.isStatic&&!u.getterName?u.getterName=f:o.identifiers.set(l,{kind:"a",getterName:f,setterName:void 0,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else if(e.isSetAccessorDeclaration(t)){var g=$(i+"_set",t);"a"===(null==u?void 0:u.kind)&&u.isStatic&&!u.setterName?u.setterName=g:o.identifiers.set(l,{kind:"a",getterName:void 0,setterName:g,brandCheckIdentifier:a,isStatic:!0,isValid:_});}else e.Debug.assertNever(t,"Unknown class element type.");else if(e.isPropertyDeclaration(t)){var m=$(i,t);o.identifiers.set(l,{kind:"f",brandCheckIdentifier:m,isStatic:!1,variableName:void 0,isValid:_}),c.push(r.createAssignment(m,r.createNewExpression(r.createIdentifier("WeakMap"),void 0,[])));}else e.isMethodDeclaration(t)?(e.Debug.assert(s,"weakSetName should be set in private identifier environment"),o.identifiers.set(l,{kind:"m",methodName:$(i,t),brandCheckIdentifier:s,isStatic:!1,isValid:_})):e.isAccessor(t)?(e.Debug.assert(s,"weakSetName should be set in private identifier environment"),e.isGetAccessor(t)?(f=$(i+"_get",t),"a"!==(null==u?void 0:u.kind)||u.isStatic||u.getterName?o.identifiers.set(l,{kind:"a",getterName:f,setterName:void 0,brandCheckIdentifier:s,isStatic:!1,isValid:_}):u.getterName=f):(g=$(i+"_set",t),"a"!==(null==u?void 0:u.kind)||u.isStatic||u.setterName?o.identifiers.set(l,{kind:"a",getterName:void 0,setterName:g,brandCheckIdentifier:s,isStatic:!1,isValid:_}):u.setterName=g)):e.Debug.assertNever(t,"Unknown class element type.");(n=X()).push.apply(n,c);}function Z(e,t){var n=Q().className,a=n?"_".concat(n):"",o=r.createUniqueName("".concat(a,"_").concat(e),16);return 524288&l.getNodeCheckFlags(t)?c(o):i(o),o}function $(e,t){return Z(e.substring(1),t.name)}function ee(e){var t;if((null==D?void 0:D.privateIdentifierEnvironment)&&(n=D.privateIdentifierEnvironment.identifiers.get(e.escapedText)))return n;for(var r=C.length-1;r>=0;--r){var n,i=C[r];if(i&&(n=null===(t=i.privateIdentifierEnvironment)||void 0===t?void 0:t.identifiers.get(e.escapedText)))return n}}function te(n){var a=r.getGeneratedNameForNode(n),o=ee(n.name);if(!o)return e.visitEachChild(n,F,t);var s=n.expression;return (e.isThisProperty(n)||e.isSuperProperty(n)||!e.isSimpleCopiableExpression(n.expression))&&(s=r.createTempVariable(i,!0),X().push(r.createBinaryExpression(s,63,e.visitNode(n.expression,F,e.isExpression)))),r.createAssignmentTargetWrapper(a,B(o,s,a,63))}function re(t){var n=e.getTargetOfBindingOrAssignmentElement(t);if(n){var i=void 0;if(e.isPrivateIdentifierPropertyAccessExpression(n))i=te(n);else if(f&&e.isSuperProperty(n)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)i=H(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,F,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(i)return e.isAssignmentExpression(t)?r.updateBinaryExpression(t,i,t.operatorToken,e.visitNode(t.right,F,e.isExpression)):e.isSpreadElement(t)?r.updateSpreadElement(t,i):i}return e.visitNode(t,P)}function ne(t){if(e.isObjectBindingOrAssignmentElement(t)&&!e.isShorthandPropertyAssignment(t)){var n=e.getTargetOfBindingOrAssignmentElement(t),i=void 0;if(n)if(e.isPrivateIdentifierPropertyAccessExpression(n))i=te(n);else if(f&&e.isSuperProperty(n)&&T&&D){var a=D.classConstructor,o=D.superClassReference;if(1&D.facts)i=H(n);else if(a&&o){var s=e.isElementAccessExpression(n)?e.visitNode(n.argumentExpression,F,e.isExpression):e.isIdentifier(n.name)?r.createStringLiteralFromNode(n.name):void 0;if(s){var c=r.createTempVariable(void 0);i=r.createAssignmentTargetWrapper(c,r.createReflectSetCall(o,s,c,a));}}}if(e.isPropertyAssignment(t)){var l=e.getInitializerOfBindingOrAssignmentElement(t);return r.updatePropertyAssignment(t,e.visitNode(t.name,F,e.isPropertyName),i?l?r.createAssignment(i,e.visitNode(l,F)):i:e.visitNode(t.initializer,P,e.isExpression))}if(e.isSpreadAssignment(t))return r.updateSpreadAssignment(t,i||e.visitNode(t.expression,P,e.isExpression));e.Debug.assert(void 0===i,"Should not have generated a wrapped target");}return e.visitNode(t,F)}};}(t),function(e){var t,r;function i(t,r,n,i){var a=0!=(4096&r.getNodeCheckFlags(n)),o=[];return i.forEach((function(r,n){var i=e.unescapeLeadingUnderscores(n),s=[];s.push(t.createPropertyAssignment("get",t.createArrowFunction(void 0,void 0,[],void 0,void 0,e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4)))),a&&s.push(t.createPropertyAssignment("set",t.createArrowFunction(void 0,void 0,[t.createParameterDeclaration(void 0,void 0,void 0,"v",void 0,void 0,void 0)],void 0,void 0,t.createAssignment(e.setEmitFlags(t.createPropertyAccessExpression(e.setEmitFlags(t.createSuper(),4),i),4),t.createIdentifier("v"))))),o.push(t.createPropertyAssignment(i,t.createObjectLiteralExpression(s)));})),t.createVariableStatement(void 0,t.createVariableDeclarationList([t.createVariableDeclaration(t.createUniqueName("_super",48),void 0,void 0,t.createCallExpression(t.createPropertyAccessExpression(t.createIdentifier("Object"),"create"),void 0,[t.createNull(),t.createObjectLiteralExpression(o,!0)]))],2))}!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.NonTopLevel=1]="NonTopLevel",e[e.HasLexicalThis=2]="HasLexicalThis";}(r||(r={})),e.transformES2017=function(t){var r,a,o,s,c=t.factory,l=t.getEmitHelperFactory,u=t.resumeLexicalEnvironment,_=t.endLexicalEnvironment,d=t.hoistVariableDeclaration,p=t.getEmitResolver(),f=t.getCompilerOptions(),g=e.getEmitScriptTarget(f),m=0,y=[],v=0,h=t.onEmitNode,b=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){if(1&r&&function(e){var t=e.kind;return 256===t||170===t||168===t||171===t||172===t}(n)){var a=6144&p.getNodeCheckFlags(n);if(a!==m){var o=m;return m=a,h(t,n,i),void(m=o)}}else if(r&&y[e.getNodeId(n)])return o=m,m=0,h(t,n,i),void(m=o);h(t,n,i);},t.onSubstituteNode=function(t,r){return r=b(t,r),1===t&&m?function(t){switch(t.kind){case 205:return J(t);case 206:return z(t);case 207:return function(t){var r=t.expression;if(e.isSuperProperty(r)){var i=e.isPropertyAccessExpression(r)?J(r):z(r);return c.createCallExpression(c.createPropertyAccessExpression(i,"call"),void 0,n$3([c.createThis()],t.arguments,!0))}return t}(t)}return t}(r):r},e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;x(1,!1),x(2,!e.isEffectiveStrictModeSourceFile(r,f));var n=e.visitEachChild(r,E,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function x(e,t){v=t?v|e:v&~e;}function D(e){return 0!=(v&e)}function S(){return D(2)}function T(e,t,r){var n=e&~v;if(n){x(n,!0);var i=t(r);return x(n,!1),i}return t(r)}function C(r){return e.visitEachChild(r,E,t)}function E(r){if(0==(128&r.transformFlags))return r;switch(r.kind){case 131:return;case 217:return function(r){return D(1)?e.setOriginalNode(e.setTextRange(c.createYieldExpression(void 0,e.visitNode(r.expression,E,e.isExpression)),r),r):e.visitEachChild(r,E,t)}(r);case 168:return T(3,N,r);case 255:return T(3,F,r);case 212:return T(3,A,r);case 213:return T(1,P,r);case 205:return o&&e.isPropertyAccessExpression(r)&&106===r.expression.kind&&o.add(r.name.escapedText),e.visitEachChild(r,E,t);case 206:return o&&106===r.expression.kind&&(s=!0),e.visitEachChild(r,E,t);case 171:case 172:case 170:case 256:case 225:return T(3,C,r);default:return e.visitEachChild(r,E,t)}}function k(r){if(e.isNodeWithPossibleHoistedDeclaration(r))switch(r.kind){case 236:return function(r){if(I(r.declarationList)){var n=O(r.declarationList,!1);return n?c.createExpressionStatement(n):void 0}return e.visitEachChild(r,E,t)}(r);case 241:return function(r){var n=r.initializer;return c.updateForStatement(r,I(n)?O(n,!1):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.condition,E,e.isExpression),e.visitNode(r.incrementor,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 242:return function(r){return c.updateForInStatement(r,I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 243:return function(r){return c.updateForOfStatement(r,e.visitNode(r.awaitModifier,E,e.isToken),I(r.initializer)?O(r.initializer,!0):e.visitNode(r.initializer,E,e.isForInitializer),e.visitNode(r.expression,E,e.isExpression),e.visitIterationBody(r.statement,k,t))}(r);case 291:return function(r){var n,i=new e.Set;if(w(r.variableDeclaration,i),i.forEach((function(t,r){a.has(r)&&(n||(n=new e.Set(a)),n.delete(r));})),n){var o=a;a=n;var s=e.visitEachChild(r,k,t);return a=o,s}return e.visitEachChild(r,k,t)}(r);case 234:case 248:case 262:case 288:case 289:case 251:case 239:case 240:case 238:case 247:case 249:return e.visitEachChild(r,k,t);default:return e.Debug.assertNever(r,"Unhandled node.")}return E(r)}function N(r){return c.updateMethodDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function F(r){return c.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function A(r){return c.updateFunctionExpression(r,e.visitNodes(r.modifiers,E,e.isModifier),r.asteriskToken,r.name,void 0,e.visitParameterList(r.parameters,E,t),void 0,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function P(r){return c.updateArrowFunction(r,e.visitNodes(r.modifiers,E,e.isModifier),void 0,e.visitParameterList(r.parameters,E,t),void 0,r.equalsGreaterThanToken,2&e.getFunctionFlags(r)?B(r):e.visitFunctionBody(r.body,E,t))}function w(t,r){var n=t.name;if(e.isIdentifier(n))r.add(n.escapedText);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||w(o,r);}}function I(t){return !!t&&e.isVariableDeclarationList(t)&&!(3&t.flags)&&t.declarations.some(R)}function O(t,r){!function(t){e.forEach(t.declarations,M);}(t);var n=e.getInitializedVariables(t);return 0===n.length?r?e.visitNode(c.converters.convertToAssignmentElementTarget(t.declarations[0].name),E,e.isExpression):void 0:c.inlineExpressions(e.map(n,L))}function M(t){var r=t.name;if(e.isIdentifier(r))d(r);else for(var n=0,i=r.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||M(a);}}function L(t){var r=e.setSourceMapRange(c.createAssignment(c.converters.convertToAssignmentElementTarget(t.name),t.initializer),t);return e.visitNode(r,E,e.isExpression)}function R(t){var r=t.name;if(e.isIdentifier(r))return a.has(r.escapedText);for(var n=0,i=r.elements;n<i.length;n++){var o=i[n];if(!e.isOmittedExpression(o)&&R(o))return !0}return !1}function B(n){u();var d=e.getOriginalNode(n,e.isFunctionLike).type,f=g<2?function(t){var r=t&&e.getEntityNameFromTypeNode(t);if(r&&e.isEntityName(r)){var n=p.getTypeReferenceSerializationKind(r);if(n===e.TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue||n===e.TypeReferenceSerializationKind.Unknown)return r}}(d):void 0,m=213===n.kind,v=0!=(8192&p.getNodeCheckFlags(n)),h=a;a=new e.Set;for(var b=0,x=n.parameters;b<x.length;b++)w(x[b],a);var D,T=o,C=s;if(m||(o=new e.Set,s=!1),m){var k=l().createAwaiterHelper(S(),v,f,j(n.body)),N=_();e.some(N)?(O=c.converters.convertToFunctionBlock(k),D=c.updateBlock(O,e.setTextRange(c.createNodeArray(e.concatenate(N,O.statements)),O.statements))):D=k;}else {var F=[],A=c.copyPrologue(n.body.statements,F,!1,E);F.push(c.createReturnStatement(l().createAwaiterHelper(S(),v,f,j(n.body,A)))),e.insertStatementsAfterStandardPrologue(F,_());var P=g>=2&&6144&p.getNodeCheckFlags(n);if(P&&(0==(1&r)&&(r|=1,t.enableSubstitution(207),t.enableSubstitution(205),t.enableSubstitution(206),t.enableEmitNotification(256),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(170),t.enableEmitNotification(236)),o.size)){var I=i(c,p,n,o);y[e.getNodeId(I)]=!0,e.insertStatementsAfterStandardPrologue(F,[I]);}var O=c.createBlock(F,!0);e.setTextRange(O,n.body),P&&s&&(4096&p.getNodeCheckFlags(n)?e.addEmitHelper(O,e.advancedAsyncSuperHelper):2048&p.getNodeCheckFlags(n)&&e.addEmitHelper(O,e.asyncSuperHelper)),D=O;}return a=h,m||(o=T,s=C),D}function j(t,r){return e.isBlock(t)?c.updateBlock(t,e.visitNodes(t.statements,k,e.isStatement,r)):c.converters.convertToFunctionBlock(e.visitNode(t,k,e.isConciseBody))}function J(t){return 106===t.expression.kind?e.setTextRange(c.createPropertyAccessExpression(c.createUniqueName("_super",48),t.name),t):t}function z(t){return 106===t.expression.kind?(r=t.argumentExpression,n=t,4096&m?e.setTextRange(c.createPropertyAccessExpression(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),"value"),n):e.setTextRange(c.createCallExpression(c.createUniqueName("_superIndex",48),void 0,[r]),n)):t;var r,n;}},e.createSuperAccessVariableStatement=i;}(t),function(e){var t,r;!function(e){e[e.AsyncMethodsWithSuper=1]="AsyncMethodsWithSuper";}(t||(t={})),function(e){e[e.None=0]="None",e[e.HasLexicalThis=1]="HasLexicalThis",e[e.IterationContainer=2]="IterationContainer",e[e.AncestorFactsMask=3]="AncestorFactsMask",e[e.SourceFileIncludes=1]="SourceFileIncludes",e[e.SourceFileExcludes=2]="SourceFileExcludes",e[e.StrictModeSourceFileIncludes=0]="StrictModeSourceFileIncludes",e[e.ClassOrFunctionIncludes=1]="ClassOrFunctionIncludes",e[e.ClassOrFunctionExcludes=2]="ClassOrFunctionExcludes",e[e.ArrowFunctionIncludes=0]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=2]="ArrowFunctionExcludes",e[e.IterationStatementIncludes=2]="IterationStatementIncludes",e[e.IterationStatementExcludes=0]="IterationStatementExcludes";}(r||(r={})),e.transformES2018=function(t){var r=t.factory,i=t.getEmitHelperFactory,a=t.resumeLexicalEnvironment,o=t.endLexicalEnvironment,s=t.hoistVariableDeclaration,c=t.getEmitResolver(),l=t.getCompilerOptions(),u=e.getEmitScriptTarget(l),_=t.onEmitNode;t.onEmitNode=function(t,r,n){if(1&p&&function(e){var t=e.kind;return 256===t||170===t||168===t||171===t||172===t}(r)){var i=6144&c.getNodeCheckFlags(r);if(i!==b){var a=b;return b=i,_(t,r,n),void(b=a)}}else if(p&&D[e.getNodeId(r)])return a=b,b=0,_(t,r,n),void(b=a);_(t,r,n);};var d=t.onSubstituteNode;t.onSubstituteNode=function(t,i){return i=d(t,i),1===t&&b?function(t){switch(t.kind){case 205:return W(t);case 206:return H(t);case 207:return function(t){var i=t.expression;if(e.isSuperProperty(i)){var a=e.isPropertyAccessExpression(i)?W(i):H(i);return r.createCallExpression(r.createPropertyAccessExpression(a,"call"),void 0,n$3([r.createThis()],t.arguments,!0))}return t}(t)}return t}(i):i};var p,f,g,m,y,v,h=!1,b=0,x=0,D=[];return e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;g=n;var i=function(n){var i=S(2,e.isEffectiveStrictModeSourceFile(n,l)?0:1);h=!1;var a=e.visitEachChild(n,E,t),o=e.concatenate(a.statements,m&&[r.createVariableStatement(void 0,r.createVariableDeclarationList(m))]),s=r.updateSourceFile(a,e.setTextRange(r.createNodeArray(o),n.statements));return T(i),s}(n);return e.addEmitHelpers(i,t.readEmitHelpers()),g=void 0,m=void 0,i}));function S(e,t){var r=x;return x=3&(x&~e|t),r}function T(e){x=e;}function C(t){m=e.append(m,r.createVariableDeclaration(t));}function E(e){return P(e,!1)}function k(e){return P(e,!0)}function N(e){if(131!==e.kind)return e}function F(e,t,r,n){if(function(e,t){return x!==(x&~e|t)}(r,n)){var i=S(r,n),a=e(t);return T(i),a}return e(t)}function A(r){return e.visitEachChild(r,E,t)}function P(a,o){if(0==(64&a.transformFlags))return a;switch(a.kind){case 217:return function(n){return 2&f&&1&f?e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(e.visitNode(n.expression,E,e.isExpression))),n),n):e.visitEachChild(n,E,t)}(a);case 223:return function(n){if(2&f&&1&f){if(n.asteriskToken){var a=e.visitNode(e.Debug.assertDefined(n.expression),E,e.isExpression);return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,i().createAwaitHelper(r.updateYieldExpression(n,n.asteriskToken,e.setTextRange(i().createAsyncDelegatorHelper(e.setTextRange(i().createAsyncValuesHelper(a),a)),a)))),n),n)}return e.setOriginalNode(e.setTextRange(r.createYieldExpression(void 0,M(n.expression?e.visitNode(n.expression,E,e.isExpression):r.createVoidZero())),n),n)}return e.visitEachChild(n,E,t)}(a);case 246:return function(n){return 2&f&&1&f?r.updateReturnStatement(n,M(n.expression?e.visitNode(n.expression,E,e.isExpression):r.createVoidZero())):e.visitEachChild(n,E,t)}(a);case 249:return function(n){if(2&f){var i=e.unwrapInnermostStatementOfLabel(n);return 243===i.kind&&i.awaitModifier?O(i,n):r.restoreEnclosingLabel(e.visitNode(i,E,e.isStatement,r.liftToBlock),n)}return e.visitEachChild(n,E,t)}(a);case 204:return function(n){if(32768&n.transformFlags){var a=function(t){for(var n,i=[],a=0,o=t;a<o.length;a++){var s=o[a];if(296===s.kind){n&&(i.push(r.createObjectLiteralExpression(n)),n=void 0);var c=s.expression;i.push(e.visitNode(c,E,e.isExpression));}else n=e.append(n,294===s.kind?r.createPropertyAssignment(s.name,e.visitNode(s.initializer,E,e.isExpression)):e.visitNode(s,E,e.isObjectLiteralElementLike));}return n&&i.push(r.createObjectLiteralExpression(n)),i}(n.properties);a.length&&204!==a[0].kind&&a.unshift(r.createObjectLiteralExpression());var o=a[0];if(a.length>1){for(var s=1;s<a.length;s++)o=i().createAssignHelper([o,a[s]]);return o}return i().createAssignHelper(a)}return e.visitEachChild(n,E,t)}(a);case 220:return function(n,i){return e.isDestructuringAssignment(n)&&32768&n.left.transformFlags?e.flattenDestructuringAssignment(n,E,t,1,!i):27===n.operatorToken.kind?r.updateBinaryExpression(n,e.visitNode(n.left,k,e.isExpression),n.operatorToken,e.visitNode(n.right,i?k:E,e.isExpression)):e.visitEachChild(n,E,t)}(a,o);case 349:return function(n,i){if(i)return e.visitEachChild(n,k,t);for(var a,o=0;o<n.elements.length;o++){var s=n.elements[o],c=e.visitNode(s,o<n.elements.length-1?k:E,e.isExpression);(a||c!==s)&&(a||(a=n.elements.slice(0,o)),a.push(c));}var l=a?e.setTextRange(r.createNodeArray(a),n.elements):n.elements;return r.updateCommaListExpression(n,l)}(a,o);case 291:return function(i){if(i.variableDeclaration&&e.isBindingPattern(i.variableDeclaration.name)&&32768&i.variableDeclaration.name.transformFlags){var a=r.getGeneratedNameForNode(i.variableDeclaration.name),o=r.updateVariableDeclaration(i.variableDeclaration,i.variableDeclaration.name,void 0,void 0,a),s=e.flattenDestructuringBinding(o,E,t,1),c=e.visitNode(i.block,E,e.isBlock);return e.some(s)&&(c=r.updateBlock(c,n$3([r.createVariableStatement(void 0,s)],c.statements,!0))),r.updateCatchClause(i,r.updateVariableDeclaration(i.variableDeclaration,a,void 0,void 0,void 0),c)}return e.visitEachChild(i,E,t)}(a);case 236:return function(r){if(e.hasSyntacticModifier(r,1)){var n=h;h=!0;var i=e.visitEachChild(r,E,t);return h=n,i}return e.visitEachChild(r,E,t)}(a);case 253:return function(e){if(h){var t=h;h=!1;var r=w(e,!0);return h=t,r}return w(e,!1)}(a);case 239:case 240:case 242:return F(A,a,0,2);case 243:return O(a,void 0);case 241:return F(I,a,0,2);case 216:return function(r){return e.visitEachChild(r,k,t)}(a);case 170:return F(L,a,2,1);case 168:return F(j,a,2,1);case 171:return F(R,a,2,1);case 172:return F(B,a,2,1);case 255:return F(J,a,2,1);case 212:return F(U,a,2,1);case 213:return F(z,a,2,0);case 163:return function(n){return 32768&n.transformFlags?r.updateParameterDeclaration(n,void 0,void 0,n.dotDotDotToken,r.getGeneratedNameForNode(n),void 0,void 0,e.visitNode(n.initializer,E,e.isExpression)):e.visitEachChild(n,E,t)}(a);case 237:return function(r){return e.visitEachChild(r,k,t)}(a);case 211:return function(r,n){return e.visitEachChild(r,n?k:E,t)}(a,o);case 209:return function(r){return e.processTaggedTemplateExpression(t,r,E,g,C,e.ProcessLevel.LiftRestriction)}(a);case 205:return y&&e.isPropertyAccessExpression(a)&&106===a.expression.kind&&y.add(a.name.escapedText),e.visitEachChild(a,E,t);case 206:return y&&106===a.expression.kind&&(v=!0),e.visitEachChild(a,E,t);case 256:case 225:return F(A,a,2,1);default:return e.visitEachChild(a,E,t)}}function w(r,n){return e.isBindingPattern(r.name)&&32768&r.name.transformFlags?e.flattenDestructuringBinding(r,E,t,1,void 0,n):e.visitEachChild(r,E,t)}function I(n){return r.updateForStatement(n,e.visitNode(n.initializer,k,e.isForInitializer),e.visitNode(n.condition,E,e.isExpression),e.visitNode(n.incrementor,k,e.isExpression),e.visitIterationBody(n.statement,E,t))}function O(n,a){var o=S(0,2);32768&n.initializer.transformFlags&&(n=function(t){var n=e.skipParentheses(t.initializer);if(e.isVariableDeclarationList(n)||e.isAssignmentPattern(n)){var i=void 0,a=void 0,o=r.createTempVariable(void 0),s=[e.createForOfBindingStatement(r,n,o)];return e.isBlock(t.statement)?(e.addRange(s,t.statement.statements),i=t.statement,a=t.statement.statements):t.statement&&(e.append(s,t.statement),i=t.statement,a=t.statement),r.updateForOfStatement(t,t.awaitModifier,e.setTextRange(r.createVariableDeclarationList([e.setTextRange(r.createVariableDeclaration(o),t.initializer)],1),t.initializer),t.expression,e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(s),a),!0),i))}return t}(n));var c=n.awaitModifier?function(n,a,o){var c=e.visitNode(n.expression,E,e.isExpression),l=e.isIdentifier(c)?r.getGeneratedNameForNode(c):r.createTempVariable(void 0),u=e.isIdentifier(c)?r.getGeneratedNameForNode(l):r.createTempVariable(void 0),_=r.createUniqueName("e"),d=r.getGeneratedNameForNode(_),p=r.createTempVariable(void 0),f=e.setTextRange(i().createAsyncValuesHelper(c),n.expression),g=r.createCallExpression(r.createPropertyAccessExpression(l,"next"),void 0,[]),m=r.createPropertyAccessExpression(u,"done"),y=r.createPropertyAccessExpression(u,"value"),v=r.createFunctionCallCall(p,l,[]);s(_),s(p);var h=2&o?r.inlineExpressions([r.createAssignment(_,r.createVoidZero()),f]):f,b=e.setEmitFlags(e.setTextRange(r.createForStatement(e.setEmitFlags(e.setTextRange(r.createVariableDeclarationList([e.setTextRange(r.createVariableDeclaration(l,void 0,void 0,h),n.expression),r.createVariableDeclaration(u)]),n.expression),2097152),r.createComma(r.createAssignment(u,M(g)),r.createLogicalNot(m)),void 0,function(n,i){var a,o,s=e.createForOfBindingStatement(r,n.initializer,i),c=[e.visitNode(s,E,e.isStatement)],l=e.visitIterationBody(n.statement,E,t);return e.isBlock(l)?(e.addRange(c,l.statements),a=l,o=l.statements):c.push(l),e.setEmitFlags(e.setTextRange(r.createBlock(e.setTextRange(r.createNodeArray(c),o),!0),a),432)}(n,y)),n),256);return r.createTryStatement(r.createBlock([r.restoreEnclosingLabel(b,a)]),r.createCatchClause(r.createVariableDeclaration(d),e.setEmitFlags(r.createBlock([r.createExpressionStatement(r.createAssignment(_,r.createObjectLiteralExpression([r.createPropertyAssignment("error",d)])))]),1)),r.createBlock([r.createTryStatement(r.createBlock([e.setEmitFlags(r.createIfStatement(r.createLogicalAnd(r.createLogicalAnd(u,r.createLogicalNot(m)),r.createAssignment(p,r.createPropertyAccessExpression(l,"return"))),r.createExpressionStatement(M(v))),1)]),void 0,e.setEmitFlags(r.createBlock([e.setEmitFlags(r.createIfStatement(_,r.createThrowStatement(r.createPropertyAccessExpression(_,"error"))),1)]),1))]))}(n,a,o):r.restoreEnclosingLabel(e.visitEachChild(n,E,t),a);return T(o),c}function M(e){return 1&f?r.createYieldExpression(void 0,i().createAwaitHelper(e)):r.createAwaitExpression(e)}function L(n){var i=f;f=0;var a=r.updateConstructorDeclaration(n,void 0,n.modifiers,e.visitParameterList(n.parameters,E,t),V(n));return f=i,a}function R(n){var i=f;f=0;var a=r.updateGetAccessorDeclaration(n,void 0,n.modifiers,e.visitNode(n.name,E,e.isPropertyName),e.visitParameterList(n.parameters,E,t),void 0,V(n));return f=i,a}function B(n){var i=f;f=0;var a=r.updateSetAccessorDeclaration(n,void 0,n.modifiers,e.visitNode(n.name,E,e.isPropertyName),e.visitParameterList(n.parameters,E,t),V(n));return f=i,a}function j(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateMethodDeclaration(n,void 0,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,e.visitNode(n.name,E,e.isPropertyName),e.visitNode(void 0,E,e.isToken),void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function J(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateFunctionDeclaration(n,void 0,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function z(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateArrowFunction(n,n.modifiers,void 0,e.visitParameterList(n.parameters,E,t),void 0,n.equalsGreaterThanToken,V(n));return f=i,a}function U(n){var i=f;f=e.getFunctionFlags(n);var a=r.updateFunctionExpression(n,1&f?e.visitNodes(n.modifiers,N,e.isModifier):n.modifiers,2&f?void 0:n.asteriskToken,n.name,void 0,e.visitParameterList(n.parameters,E,t),void 0,2&f&&1&f?K(n):V(n));return f=i,a}function K(n){a();var s=[],l=r.copyPrologue(n.body.statements,s,!1,E);q(s,n);var _=y,d=v;y=new e.Set,v=!1;var f=r.createReturnStatement(i().createAsyncGeneratorHelper(r.createFunctionExpression(void 0,r.createToken(41),n.name&&r.getGeneratedNameForNode(n.name),void 0,[],void 0,r.updateBlock(n.body,e.visitLexicalEnvironment(n.body.statements,E,t,l))),!!(1&x))),g=u>=2&&6144&c.getNodeCheckFlags(n);if(g){0==(1&p)&&(p|=1,t.enableSubstitution(207),t.enableSubstitution(205),t.enableSubstitution(206),t.enableEmitNotification(256),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(170),t.enableEmitNotification(236));var m=e.createSuperAccessVariableStatement(r,c,n,y);D[e.getNodeId(m)]=!0,e.insertStatementsAfterStandardPrologue(s,[m]);}s.push(f),e.insertStatementsAfterStandardPrologue(s,o());var h=r.updateBlock(n.body,s);return g&&v&&(4096&c.getNodeCheckFlags(n)?e.addEmitHelper(h,e.advancedAsyncSuperHelper):2048&c.getNodeCheckFlags(n)&&e.addEmitHelper(h,e.asyncSuperHelper)),y=_,v=d,h}function V(t){var n;a();var i=0,s=[],c=null!==(n=e.visitNode(t.body,E,e.isConciseBody))&&void 0!==n?n:r.createBlock([]);e.isBlock(c)&&(i=r.copyPrologue(c.statements,s,!1,E)),e.addRange(s,q(void 0,t));var l=o();if(i>0||e.some(s)||e.some(l)){var u=r.converters.convertToFunctionBlock(c,!0);return e.insertStatementsAfterStandardPrologue(s,l),e.addRange(s,u.statements.slice(i)),r.updateBlock(u,e.setTextRange(r.createNodeArray(s),u.statements))}return c}function q(n,i){for(var a=0,o=i.parameters;a<o.length;a++){var s=o[a];if(32768&s.transformFlags){var c=r.getGeneratedNameForNode(s),l=e.flattenDestructuringBinding(s,E,t,1,c,!1,!0);if(e.some(l)){var u=r.createVariableStatement(void 0,r.createVariableDeclarationList(l));e.setEmitFlags(u,1048576),n=e.append(n,u);}}}return n}function W(t){return 106===t.expression.kind?e.setTextRange(r.createPropertyAccessExpression(r.createUniqueName("_super",48),t.name),t):t}function H(t){return 106===t.expression.kind?(n=t.argumentExpression,i=t,4096&b?e.setTextRange(r.createPropertyAccessExpression(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),"value"),i):e.setTextRange(r.createCallExpression(r.createIdentifier("_superIndex"),void 0,[n]),i)):t;var n,i;}};}(t),function(e){e.transformES2019=function(t){var r=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,n,t)}));function n(i){if(0==(32&i.transformFlags))return i;switch(i.kind){case 291:return function(i){return i.variableDeclaration?e.visitEachChild(i,n,t):r.updateCatchClause(i,r.createVariableDeclaration(r.createTempVariable(void 0)),e.visitNode(i.block,n,e.isBlock))}(i);default:return e.visitEachChild(i,n,t)}}};}(t),function(e){e.transformES2020=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(16&a.transformFlags))return a;switch(a.kind){case 207:var u=o(a,!1);return e.Debug.assertNotNode(u,e.isSyntheticReference),u;case 205:case 206:return e.isOptionalChain(a)?(u=c(a,!1,!1),e.Debug.assertNotNode(u,e.isSyntheticReference),u):e.visitEachChild(a,i,t);case 220:return 60===a.operatorToken.kind?function(t){var a=e.visitNode(t.left,i,e.isExpression),o=a;return e.isSimpleCopiableExpression(a)||(o=r.createTempVariable(n),a=r.createAssignment(o,a)),e.setTextRange(r.createConditionalExpression(l(a,o),void 0,o,void 0,e.visitNode(t.right,i,e.isExpression)),t)}(a):e.visitEachChild(a,i,t);case 214:return function(t){return e.isOptionalChain(e.skipParentheses(t.expression))?e.setOriginalNode(s(t.expression,!1,!0),t):r.updateDeleteExpression(t,e.visitNode(t.expression,i,e.isExpression))}(a);default:return e.visitEachChild(a,i,t)}}function a(t,n,i){var a=s(t.expression,n,i);return e.isSyntheticReference(a)?r.createSyntheticReferenceExpression(r.updateParenthesizedExpression(t,a.expression),a.thisArg):r.updateParenthesizedExpression(t,a)}function o(n,o){if(e.isOptionalChain(n))return c(n,o,!1);if(e.isParenthesizedExpression(n.expression)&&e.isOptionalChain(e.skipParentheses(n.expression))){var s=a(n.expression,!0,!1),l=e.visitNodes(n.arguments,i,e.isExpression);return e.isSyntheticReference(s)?e.setTextRange(r.createFunctionCallCall(s.expression,s.thisArg,l),n):r.updateCallExpression(n,s,void 0,l)}return e.visitEachChild(n,i,t)}function s(t,s,l){switch(t.kind){case 211:return a(t,s,l);case 205:case 206:return function(t,a,o){if(e.isOptionalChain(t))return c(t,a,o);var s,l=e.visitNode(t.expression,i,e.isExpression);return e.Debug.assertNotNode(l,e.isSyntheticReference),a&&(e.isSimpleCopiableExpression(l)?s=l:(s=r.createTempVariable(n),l=r.createAssignment(s,l))),l=205===t.kind?r.updatePropertyAccessExpression(t,l,e.visitNode(t.name,i,e.isIdentifier)):r.updateElementAccessExpression(t,l,e.visitNode(t.argumentExpression,i,e.isExpression)),s?r.createSyntheticReferenceExpression(l,s):l}(t,s,l);case 207:return o(t,s);default:return e.visitNode(t,i,e.isExpression)}}function c(t,a,o){var c=function(t){e.Debug.assertNotNode(t,e.isNonNullChain);for(var r=[t];!t.questionDotToken&&!e.isTaggedTemplateExpression(t);)t=e.cast(e.skipPartiallyEmittedExpressions(t.expression),e.isOptionalChain),e.Debug.assertNotNode(t,e.isNonNullChain),r.unshift(t);return {expression:t.expression,chain:r}}(t),u=c.expression,_=c.chain,d=s(u,e.isCallChain(_[0]),!1),p=e.isSyntheticReference(d)?d.thisArg:void 0,f=e.isSyntheticReference(d)?d.expression:d,g=f;e.isSimpleCopiableExpression(f)||(g=r.createTempVariable(n),f=r.createAssignment(g,f));for(var m,y=g,v=0;v<_.length;v++){var h=_[v];switch(h.kind){case 205:case 206:v===_.length-1&&a&&(e.isSimpleCopiableExpression(y)?m=y:(m=r.createTempVariable(n),y=r.createAssignment(m,y))),y=205===h.kind?r.createPropertyAccessExpression(y,e.visitNode(h.name,i,e.isIdentifier)):r.createElementAccessExpression(y,e.visitNode(h.argumentExpression,i,e.isExpression));break;case 207:y=0===v&&p?r.createFunctionCallCall(y,106===p.kind?r.createThis():p,e.visitNodes(h.arguments,i,e.isExpression)):r.createCallExpression(y,void 0,e.visitNodes(h.arguments,i,e.isExpression));}e.setOriginalNode(y,h);}var b=o?r.createConditionalExpression(l(f,g,!0),void 0,r.createTrue(),void 0,r.createDeleteExpression(y)):r.createConditionalExpression(l(f,g,!0),void 0,r.createVoidZero(),void 0,y);return e.setTextRange(b,t),m?r.createSyntheticReferenceExpression(b,m):b}function l(e,t,n){return r.createBinaryExpression(r.createBinaryExpression(e,r.createToken(n?36:37),r.createNull()),r.createToken(n?56:55),r.createBinaryExpression(t,r.createToken(n?36:37),r.createVoidZero()))}};}(t),function(e){e.transformES2021=function(t){var r=t.hoistVariableDeclaration,n=t.factory;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(8&a.transformFlags))return a;switch(a.kind){case 220:var o=a;if(e.isLogicalOrCoalescingAssignmentExpression(o))return function(t){var a=t.operatorToken,o=e.getNonAssignmentOperatorForCompoundAssignment(a.kind),s=e.skipParentheses(e.visitNode(t.left,i,e.isLeftHandSideExpression)),c=s,l=e.skipParentheses(e.visitNode(t.right,i,e.isExpression));if(e.isAccessExpression(s)){var u=e.isSimpleCopiableExpression(s.expression),_=u?s.expression:n.createTempVariable(r),d=u?s.expression:n.createAssignment(_,s.expression);if(e.isPropertyAccessExpression(s))c=n.createPropertyAccessExpression(_,s.name),s=n.createPropertyAccessExpression(d,s.name);else {var p=e.isSimpleCopiableExpression(s.argumentExpression),f=p?s.argumentExpression:n.createTempVariable(r);c=n.createElementAccessExpression(_,f),s=n.createElementAccessExpression(d,p?s.argumentExpression:n.createAssignment(f,s.argumentExpression));}}return n.createBinaryExpression(s,o,n.createParenthesizedExpression(n.createAssignment(c,l)))}(o);default:return e.visitEachChild(a,i,t)}}};}(t),function(e){e.transformESNext=function(t){return e.chainBundle(t,(function(n){return n.isDeclarationFile?n:e.visitEachChild(n,r,t)}));function r(n){return 0==(4&n.transformFlags)?n:(e.visitEachChild(n,r,t))}};}(t),function(e){e.transformJsx=function(r){var n,i,a=r.factory,o=r.getEmitHelperFactory,s=r.getCompilerOptions();return e.chainBundle(r,(function(t){if(t.isDeclarationFile)return t;n=t,(i={}).importSpecifier=e.getJSXImplicitImportBase(s,t);var o=e.visitEachChild(t,u,r);e.addEmitHelpers(o,r.readEmitHelpers());var c=o.statements;if(i.filenameDeclaration&&(c=e.insertStatementAfterCustomPrologue(c.slice(),a.createVariableStatement(void 0,a.createVariableDeclarationList([i.filenameDeclaration],2)))),i.utilizedImplicitRuntimeImports)for(var l=0,_=e.arrayFrom(i.utilizedImplicitRuntimeImports.entries());l<_.length;l++){var d=_[l],p=d[0],f=d[1];if(e.isExternalModule(t)){var g=a.createImportDeclaration(void 0,void 0,a.createImportClause(!1,void 0,a.createNamedImports(e.arrayFrom(f.values()))),a.createStringLiteral(p),void 0);e.setParentRecursive(g,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),g);}else if(e.isExternalOrCommonJsModule(t)){var m=a.createVariableStatement(void 0,a.createVariableDeclarationList([a.createVariableDeclaration(a.createObjectBindingPattern(e.map(e.arrayFrom(f.values()),(function(e){return a.createBindingElement(void 0,e.propertyName,e.name)}))),void 0,void 0,a.createCallExpression(a.createIdentifier("require"),void 0,[a.createStringLiteral(p)]))],2));e.setParentRecursive(m,!1),c=e.insertStatementAfterCustomPrologue(c.slice(),m);}}return c!==o.statements&&(o=a.updateSourceFile(o,c)),i=void 0,o}));function c(){if(i.filenameDeclaration)return i.filenameDeclaration.name;var e=a.createVariableDeclaration(a.createUniqueName("_jsxFileName",48),void 0,void 0,a.createStringLiteral(n.fileName));return i.filenameDeclaration=e,i.filenameDeclaration.name}function l(t){var r,n,o="createElement"===t?i.importSpecifier:e.getJSXRuntimeImport(i.importSpecifier,s),c=null===(n=null===(r=i.utilizedImplicitRuntimeImports)||void 0===r?void 0:r.get(o))||void 0===n?void 0:n.get(t);if(c)return c.name;i.utilizedImplicitRuntimeImports||(i.utilizedImplicitRuntimeImports=e.createMap());var l=i.utilizedImplicitRuntimeImports.get(o);l||(l=e.createMap(),i.utilizedImplicitRuntimeImports.set(o,l));var u=a.createUniqueName("_".concat(t),112),_=a.createImportSpecifier(!1,a.createIdentifier(t),u);return u.generatedImportReference=_,l.set(t,_),u}function u(t){return 2&t.transformFlags?function(t){switch(t.kind){case 277:return p(t,!1);case 278:return f(t,!1);case 281:return g(t,!1);case 287:return F(t);default:return e.visitEachChild(t,u,r)}}(t):t}function _(t){switch(t.kind){case 11:return function(t){var r=function(t){for(var r,n=0,i=-1,a=0;a<t.length;a++){var o=t.charCodeAt(a);e.isLineBreak(o)?(-1!==n&&-1!==i&&(r=E(r,t.substr(n,i-n+1))),n=-1):e.isWhiteSpaceSingleLine(o)||(i=a,-1===n&&(n=a));}return -1!==n?E(r,t.substr(n)):r}(t.text);return void 0===r?void 0:a.createStringLiteral(r)}(t);case 287:return F(t);case 277:return p(t,!0);case 278:return f(t,!0);case 281:return g(t,!0);default:return e.Debug.failBadSyntaxKind(t)}}function d(t){return void 0===i.importSpecifier||function(t){for(var r=!1,n=0,i=t.attributes.properties;n<i.length;n++){var a=i[n];if(e.isJsxSpreadAttribute(a))r=!0;else if(r&&e.isJsxAttribute(a)&&"key"===a.name.escapedText)return !0}return !1}(t)}function p(e,t){return (d(e.openingElement)?h:y)(e.openingElement,e.children,t,e)}function f(e,t){return (d(e)?h:y)(e,void 0,t,e)}function g(e,t){return (void 0===i.importSpecifier?x:b)(e.openingFragment,e.children,t,e)}function m(t){var r=e.getSemanticJsxChildren(t);if(1===e.length(r)&&!r[0].dotDotDotToken){var n=_(r[0]);return n&&a.createPropertyAssignment("children",n)}var i=e.mapDefined(t,_);return e.length(i)?a.createPropertyAssignment("children",a.createArrayLiteralExpression(i)):void 0}function y(t,r,n,i){var o=N(t),s=r&&r.length?m(r):void 0,c=e.find(t.attributes.properties,(function(t){return !!t.name&&e.isIdentifier(t.name)&&"key"===t.name.escapedText})),l=c?e.filter(t.attributes.properties,(function(e){return e!==c})):t.attributes.properties;return v(o,e.length(l)?D(l,s):a.createObjectLiteralExpression(s?[s]:e.emptyArray),c,r||e.emptyArray,n,i)}function v(t,r,i,o,u,_){var d,p=e.getSemanticJsxChildren(o),f=e.length(p)>1||!!(null===(d=p[0])||void 0===d?void 0:d.dotDotDotToken),g=[t,r,i?C(i.initializer):a.createVoidZero()];if(5===s.jsx){var m=e.getOriginalNode(n);if(m&&e.isSourceFile(m)){g.push(f?a.createTrue():a.createFalse());var y=e.getLineAndCharacterOfPosition(m,_.pos);g.push(a.createObjectLiteralExpression([a.createPropertyAssignment("fileName",c()),a.createPropertyAssignment("lineNumber",a.createNumericLiteral(y.line+1)),a.createPropertyAssignment("columnNumber",a.createNumericLiteral(y.character+1))])),g.push(a.createThis());}}var v=e.setTextRange(a.createCallExpression(function(e){return l(function(e){return 5===s.jsx?"jsxDEV":e?"jsxs":"jsx"}(e))}(f),void 0,g),_);return u&&e.startOnNewLine(v),v}function h(t,o,c,u){var d=N(t),p=t.attributes.properties,f=e.length(p)?D(p):a.createNull(),g=void 0===i.importSpecifier?e.createJsxFactoryExpression(a,r.getEmitResolver().getJsxFactoryEntity(n),s.reactNamespace,t):l("createElement"),m=e.createExpressionForJsxElement(a,g,d,f,e.mapDefined(o,_),u);return c&&e.startOnNewLine(m),m}function b(e,t,r,n){var i;if(t&&t.length){var o=function(e){var t=m(e);return t&&a.createObjectLiteralExpression([t])}(t);o&&(i=o);}return v(l("Fragment"),i||a.createObjectLiteralExpression([]),void 0,t,r,n)}function x(t,i,o,c){var l=e.createExpressionForJsxFragment(a,r.getEmitResolver().getJsxFactoryEntity(n),r.getEmitResolver().getJsxFragmentFactoryEntity(n),s.reactNamespace,e.mapDefined(i,_),t,c);return o&&e.startOnNewLine(l),l}function D(t,r){var n=e.getEmitScriptTarget(s);return n&&n>=5?a.createObjectLiteralExpression(function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return e.map(t,(function(t){return r?(n=t,a.createSpreadAssignment(e.visitNode(n.expression,u,e.isExpression))):T(t);var n;}))})));return r&&n.push(r),n}(t,r)):function(t,r){var n=e.flatten(e.spanMap(t,e.isJsxSpreadAttribute,(function(t,r){return r?e.map(t,S):a.createObjectLiteralExpression(e.map(t,T))})));return e.isJsxSpreadAttribute(t[0])&&n.unshift(a.createObjectLiteralExpression()),r&&n.push(a.createObjectLiteralExpression([r])),e.singleOrUndefined(n)||o().createAssignHelper(n)}(t,r)}function S(t){return e.visitNode(t.expression,u,e.isExpression)}function T(t){var r=function(t){var r=t.name,n=e.idText(r);return /^[A-Za-z_]\w*$/.test(n)?r:a.createStringLiteral(n)}(t),n=C(t.initializer);return a.createPropertyAssignment(r,n)}function C(t){if(void 0===t)return a.createTrue();if(10===t.kind){var r=void 0!==t.singleQuote?t.singleQuote:!e.isStringDoubleQuoted(t,n),i=a.createStringLiteral(((s=k(o=t.text))===o?void 0:s)||t.text,r);return e.setTextRange(i,t)}return 287===t.kind?void 0===t.expression?a.createTrue():e.visitNode(t.expression,u,e.isExpression):e.Debug.failBadSyntaxKind(t);var o,s;}function E(e,t){var r=k(t);return void 0===e?r:e+" "+r}function k(r){return r.replace(/&((#((\d+)|x([\da-fA-F]+)))|(\w+));/g,(function(r,n,i,a,o,s,c){if(o)return e.utf16EncodeAsString(parseInt(o,10));if(s)return e.utf16EncodeAsString(parseInt(s,16));var l=t.get(c);return l?e.utf16EncodeAsString(l):r}))}function N(t){if(277===t.kind)return N(t.openingElement);var r=t.tagName;return e.isIdentifier(r)&&e.isIntrinsicJsxName(r.escapedText)?a.createStringLiteral(e.idText(r)):e.createExpressionFromEntityName(a,r)}function F(t){var r=e.visitNode(t.expression,u,e.isExpression);return t.dotDotDotToken?a.createSpreadElement(r):r}};var t=new e.Map(e.getEntries({quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,copy:169,ordf:170,laquo:171,not:172,shy:173,reg:174,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}));}(t),function(e){e.transformES2016=function(t){var r=t.factory,n=t.hoistVariableDeclaration;return e.chainBundle(t,(function(r){return r.isDeclarationFile?r:e.visitEachChild(r,i,t)}));function i(a){if(0==(256&a.transformFlags))return a;switch(a.kind){case 220:return function(a){switch(a.operatorToken.kind){case 67:return function(t){var a,o,s=e.visitNode(t.left,i,e.isExpression),c=e.visitNode(t.right,i,e.isExpression);if(e.isElementAccessExpression(s)){var l=r.createTempVariable(n),u=r.createTempVariable(n);a=e.setTextRange(r.createElementAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),e.setTextRange(r.createAssignment(u,s.argumentExpression),s.argumentExpression)),s),o=e.setTextRange(r.createElementAccessExpression(l,u),s);}else e.isPropertyAccessExpression(s)?(l=r.createTempVariable(n),a=e.setTextRange(r.createPropertyAccessExpression(e.setTextRange(r.createAssignment(l,s.expression),s.expression),s.name),s),o=e.setTextRange(r.createPropertyAccessExpression(l,s.name),s)):(a=s,o=s);return e.setTextRange(r.createAssignment(a,e.setTextRange(r.createGlobalMethodCall("Math","pow",[o,c]),t)),t)}(a);case 42:return function(t){var n=e.visitNode(t.left,i,e.isExpression),a=e.visitNode(t.right,i,e.isExpression);return e.setTextRange(r.createGlobalMethodCall("Math","pow",[n,a]),t)}(a);default:return e.visitEachChild(a,i,t)}}(a);default:return e.visitEachChild(a,i,t)}}};}(t),function(e){var t,r,i,a,o,s;function c(e,t){return {kind:e,expression:t}}!function(e){e[e.CapturedThis=1]="CapturedThis",e[e.BlockScopedBindings=2]="BlockScopedBindings";}(t||(t={})),function(e){e[e.Body=1]="Body",e[e.Initializer=2]="Initializer";}(r||(r={})),function(e){e[e.ToOriginal=0]="ToOriginal",e[e.ToOutParameter=1]="ToOutParameter";}(i||(i={})),function(e){e[e.Break=2]="Break",e[e.Continue=4]="Continue",e[e.Return=8]="Return";}(a||(a={})),function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.ArrowFunction=2]="ArrowFunction",e[e.AsyncFunctionBody=4]="AsyncFunctionBody",e[e.NonStaticClassElement=8]="NonStaticClassElement",e[e.CapturesThis=16]="CapturesThis",e[e.ExportedVariableStatement=32]="ExportedVariableStatement",e[e.TopLevel=64]="TopLevel",e[e.Block=128]="Block",e[e.IterationStatement=256]="IterationStatement",e[e.IterationStatementBlock=512]="IterationStatementBlock",e[e.IterationContainer=1024]="IterationContainer",e[e.ForStatement=2048]="ForStatement",e[e.ForInOrForOfStatement=4096]="ForInOrForOfStatement",e[e.ConstructorWithCapturedSuper=8192]="ConstructorWithCapturedSuper",e[e.StaticInitializer=16384]="StaticInitializer",e[e.AncestorFactsMask=32767]="AncestorFactsMask",e[e.BlockScopeIncludes=0]="BlockScopeIncludes",e[e.BlockScopeExcludes=7104]="BlockScopeExcludes",e[e.SourceFileIncludes=64]="SourceFileIncludes",e[e.SourceFileExcludes=8064]="SourceFileExcludes",e[e.FunctionIncludes=65]="FunctionIncludes",e[e.FunctionExcludes=32670]="FunctionExcludes",e[e.AsyncFunctionBodyIncludes=69]="AsyncFunctionBodyIncludes",e[e.AsyncFunctionBodyExcludes=32662]="AsyncFunctionBodyExcludes",e[e.ArrowFunctionIncludes=66]="ArrowFunctionIncludes",e[e.ArrowFunctionExcludes=15232]="ArrowFunctionExcludes",e[e.ConstructorIncludes=73]="ConstructorIncludes",e[e.ConstructorExcludes=32662]="ConstructorExcludes",e[e.DoOrWhileStatementIncludes=1280]="DoOrWhileStatementIncludes",e[e.DoOrWhileStatementExcludes=0]="DoOrWhileStatementExcludes",e[e.ForStatementIncludes=3328]="ForStatementIncludes",e[e.ForStatementExcludes=5056]="ForStatementExcludes",e[e.ForInOrForOfStatementIncludes=5376]="ForInOrForOfStatementIncludes",e[e.ForInOrForOfStatementExcludes=3008]="ForInOrForOfStatementExcludes",e[e.BlockIncludes=128]="BlockIncludes",e[e.BlockExcludes=6976]="BlockExcludes",e[e.IterationStatementBlockIncludes=512]="IterationStatementBlockIncludes",e[e.IterationStatementBlockExcludes=7104]="IterationStatementBlockExcludes",e[e.StaticInitializerIncludes=16449]="StaticInitializerIncludes",e[e.StaticInitializerExcludes=32670]="StaticInitializerExcludes",e[e.NewTarget=32768]="NewTarget",e[e.CapturedLexicalThis=65536]="CapturedLexicalThis",e[e.SubtreeFactsMask=-32768]="SubtreeFactsMask",e[e.ArrowFunctionSubtreeExcludes=0]="ArrowFunctionSubtreeExcludes",e[e.FunctionSubtreeExcludes=98304]="FunctionSubtreeExcludes";}(o||(o={})),function(e){e[e.None=0]="None",e[e.UnpackedSpread=1]="UnpackedSpread",e[e.PackedSpread=2]="PackedSpread";}(s||(s={})),e.transformES2015=function(t){var r,i,a,o,s,l,u=t.factory,_=t.getEmitHelperFactory,d=t.startLexicalEnvironment,p=t.resumeLexicalEnvironment,f=t.endLexicalEnvironment,g=t.hoistVariableDeclaration,m=t.getCompilerOptions(),y=t.getEmitResolver(),v=t.onSubstituteNode,h=t.onEmitNode;function b(t){o=e.append(o,u.createVariableDeclaration(t));}return t.onEmitNode=function(t,r,n){if(1&l&&e.isFunctionLike(r)){var i=x(32670,8&e.getEmitFlags(r)?81:65);return h(t,r,n),void D(i,0,0)}h(t,r,n);},t.onSubstituteNode=function(t,r){return r=v(t,r),1===t?function(t){switch(t.kind){case 79:return function(t){if(2&l&&!e.isInternalName(t)){var r=y.getReferencedDeclarationWithCollidingName(t);if(r&&(!e.isClassLike(r)||!function(t,r){var n=e.getParseTreeNode(r);if(!n||n===t||n.end<=t.pos||n.pos>=t.end)return !1;for(var i=e.getEnclosingBlockScopeContainer(t);n;){if(n===i||n===t)return !1;if(e.isClassElement(n)&&n.parent===t)return !0;n=n.parent;}return !1}(r,t)))return e.setTextRange(u.getGeneratedNameForNode(e.getNameOfDeclaration(r)),t)}return t}(t);case 108:return function(t){return 1&l&&16&a?e.setTextRange(u.createUniqueName("_this",48),t):t}(t)}return t}(r):e.isIdentifier(r)?function(t){if(2&l&&!e.isInternalName(t)){var r=e.getParseTreeNode(t,e.isIdentifier);if(r&&function(e){switch(e.parent.kind){case 202:case 256:case 259:case 253:return e.parent.name===e&&y.isDeclarationWithCollidingName(e.parent)}return !1}(r))return e.setTextRange(u.getGeneratedNameForNode(r),t)}return t}(r):r},e.chainBundle(t,(function(n){if(n.isDeclarationFile)return n;r=n,i=n.text;var s=function(t){var r=x(8064,64),n=[],i=[];d();var a=u.copyPrologue(t.statements,n,!1,C);return e.addRange(i,e.visitNodes(t.statements,C,e.isStatement,a)),o&&i.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(o))),u.mergeLexicalEnvironment(n,f()),z(n,t),D(r,0,0),u.updateSourceFile(t,e.setTextRange(u.createNodeArray(e.concatenate(n,i)),t.statements))}(n);return e.addEmitHelpers(s,t.readEmitHelpers()),r=void 0,i=void 0,o=void 0,a=0,s}));function x(e,t){var r=a;return a=32767&(a&~e|t),r}function D(e,t,r){a=-32768&(a&~t|r)|e;}function S(e){return 0!=(8192&a)&&246===e.kind&&!e.expression}function T(t){return 0!=(512&t.transformFlags)||void 0!==s||8192&a&&function(t){return 2097152&t.transformFlags&&(e.isReturnStatement(t)||e.isIfStatement(t)||e.isWithStatement(t)||e.isSwitchStatement(t)||e.isCaseBlock(t)||e.isCaseClause(t)||e.isDefaultClause(t)||e.isTryStatement(t)||e.isCatchClause(t)||e.isLabeledStatement(t)||e.isIterationStatement(t,!1)||e.isBlock(t))}(t)||e.isIterationStatement(t,!1)&&pe(t)||0!=(33554432&e.getEmitFlags(t))}function C(e){return T(e)?F(e,!1):e}function E(e){return T(e)?F(e,!0):e}function k(t){if(T(t)){var r=e.getOriginalNode(t);if(e.isPropertyDeclaration(r)&&e.hasStaticModifier(r)){var n=x(32670,16449),i=F(t,!1);return D(n,98304,0),i}return F(t,!1)}return t}function N(e){return 106===e.kind?we(!0):C(e)}function F(i,o){switch(i.kind){case 124:return;case 256:return function(t){var r=u.createVariableDeclaration(u.getLocalName(t,!0),void 0,void 0,w(t));e.setOriginalNode(r,t);var n=[],i=u.createVariableStatement(void 0,u.createVariableDeclarationList([r]));if(e.setOriginalNode(i,t),e.setTextRange(i,t),e.startOnNewLine(i),n.push(i),e.hasSyntacticModifier(t,1)){var a=e.hasSyntacticModifier(t,512)?u.createExportDefault(u.getLocalName(t)):u.createExternalModuleExport(u.getLocalName(t));e.setOriginalNode(a,i),n.push(a);}var o=e.getEmitFlags(t);return 0==(4194304&o)&&(n.push(u.createEndOfDeclarationMarker(t)),e.setEmitFlags(i,4194304|o)),e.singleOrMany(n)}(i);case 225:return function(e){return w(e)}(i);case 163:return function(t){return t.dotDotDotToken?void 0:e.isBindingPattern(t.name)?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,u.getGeneratedNameForNode(t),void 0,void 0,void 0),t),t):t.initializer?e.setOriginalNode(e.setTextRange(u.createParameterDeclaration(void 0,void 0,void 0,t.name,void 0,void 0,void 0),t),t):t}(i);case 255:return function(r){var n=s;s=void 0;var i=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(i,98304,0),s=n,u.updateFunctionDeclaration(r,void 0,e.visitNodes(r.modifiers,C,e.isModifier),r.asteriskToken,l,void 0,o,void 0,c)}(i);case 213:return function(r){8192&r.transformFlags&&!(16384&a)&&(a|=65536);var n=s;s=void 0;var i=x(15232,66),o=u.createFunctionExpression(void 0,void 0,void 0,void 0,e.visitParameterList(r.parameters,C,t),void 0,Q(r));return e.setTextRange(o,r),e.setOriginalNode(o,r),e.setEmitFlags(o,8),D(i,0,0),s=n,o}(i);case 212:return function(r){var n=262144&e.getEmitFlags(r)?x(32662,69):x(32670,65),i=s;s=void 0;var o=e.visitParameterList(r.parameters,C,t),c=Q(r),l=32768&a?u.getLocalName(r):r.name;return D(n,98304,0),s=i,u.updateFunctionExpression(r,void 0,r.asteriskToken,l,void 0,o,void 0,c)}(i);case 253:return Z(i);case 79:return P(i);case 254:return function(r){if(3&r.flags||262144&r.transformFlags){3&r.flags&&Ie();var n=e.flatMap(r.declarations,1&r.flags?Y:Z),i=u.createVariableDeclarationList(n);return e.setOriginalNode(i,r),e.setTextRange(i,r),e.setCommentRange(i,r),262144&r.transformFlags&&(e.isBindingPattern(r.declarations[0].name)||e.isBindingPattern(e.last(r.declarations).name))&&e.setSourceMapRange(i,function(t){for(var r=-1,n=-1,i=0,a=t;i<a.length;i++){var o=a[i];r=-1===r?o.pos:-1===o.pos?r:Math.min(r,o.pos),n=Math.max(n,o.end);}return e.createRange(r,n)}(n)),i}return e.visitEachChild(r,C,t)}(i);case 248:return function(r){if(void 0!==s){var n=s.allowedNonLabeledJumps;s.allowedNonLabeledJumps|=2;var i=e.visitEachChild(r,C,t);return s.allowedNonLabeledJumps=n,i}return e.visitEachChild(r,C,t)}(i);case 262:return function(r){var n=x(7104,0),i=e.visitEachChild(r,C,t);return D(n,0,0),i}(i);case 234:return function(r,n){var i=256&a?x(7104,512):x(6976,128),o=e.visitEachChild(r,C,t);return D(i,0,0),o}(i);case 245:case 244:return function(r){if(s){var n=245===r.kind?2:4;if(!(r.label&&s.labels&&s.labels.get(e.idText(r.label))||!r.label&&s.allowedNonLabeledJumps&n)){var i=void 0,a=r.label;a?245===r.kind?(i="break-".concat(a.escapedText),be(s,!0,e.idText(a),i)):(i="continue-".concat(a.escapedText),be(s,!1,e.idText(a),i)):245===r.kind?(s.nonLocalJumps|=2,i="break"):(s.nonLocalJumps|=4,i="continue");var o=u.createStringLiteral(i);if(s.loopOutParameters.length){for(var c=s.loopOutParameters,l=void 0,_=0;_<c.length;_++){var d=ve(c[_],1);l=0===_?d:u.createBinaryExpression(l,27,d);}o=u.createBinaryExpression(l,27,o);}return u.createReturnStatement(o)}}return e.visitEachChild(r,C,t)}(i);case 249:return function(t){s&&!s.labels&&(s.labels=new e.Map);var r=e.unwrapInnermostStatementOfLabel(t,s&&$);return e.isIterationStatement(r,!1)?function(e,t){switch(e.kind){case 239:case 240:return re(e,t);case 241:return ne(e,t);case 242:return ie(e,t);case 243:return ae(e,t)}}(r,t):u.restoreEnclosingLabel(e.visitNode(r,C,e.isStatement,u.liftToBlock),t,s&&ee)}(i);case 239:case 240:return re(i,void 0);case 241:return ne(i,void 0);case 242:return ie(i,void 0);case 243:return ae(i,void 0);case 237:return function(r){return e.visitEachChild(r,E,t)}(i);case 204:return function(r){for(var n=r.properties,i=-1,o=!1,s=0;s<n.length;s++){var c=n[s];if(524288&c.transformFlags&&4&a||(o=161===e.Debug.checkDefined(c.name).kind)){i=s;break}}if(i<0)return e.visitEachChild(r,C,t);var l=u.createTempVariable(g),_=[],d=u.createAssignment(l,e.setEmitFlags(u.createObjectLiteralExpression(e.visitNodes(n,C,e.isObjectLiteralElementLike,0,i),r.multiLine),o?65536:0));return r.multiLine&&e.startOnNewLine(d),_.push(d),function(t,r,n,i){for(var a=r.properties,o=a.length,s=i;s<o;s++){var c=a[s];switch(c.kind){case 171:case 172:var l=e.getAllAccessorDeclarations(r.properties,c);c===l.firstAccessor&&t.push(H(n,l,r,!!r.multiLine));break;case 168:t.push(Ce(c,n,r,r.multiLine));break;case 294:t.push(Se(c,n,r.multiLine));break;case 295:t.push(Te(c,n,r.multiLine));break;default:e.Debug.failBadSyntaxKind(r);}}}(_,r,l,i),_.push(r.multiLine?e.startOnNewLine(e.setParent(e.setTextRange(u.cloneNode(l),l),l.parent)):l),u.inlineExpressions(_)}(i);case 291:return function(r){var i,a,o,s,c=x(7104,0);if(e.Debug.assert(!!r.variableDeclaration,"Catch clause variable should always be present when downleveling ES2015."),e.isBindingPattern(r.variableDeclaration.name)){var l=u.createTempVariable(void 0),_=u.createVariableDeclaration(l);e.setTextRange(_,r.variableDeclaration);var d=e.flattenDestructuringBinding(r.variableDeclaration,C,t,0,l),p=u.createVariableDeclarationList(d);e.setTextRange(p,r.variableDeclaration);var f=u.createVariableStatement(void 0,p);i=u.updateCatchClause(r,_,(a=r.block,o=f,s=e.visitNodes(a.statements,C,e.isStatement),u.updateBlock(a,n$3([o],s,!0))));}else i=e.visitEachChild(r,C,t);return D(c,0,0),i}(i);case 295:return function(t){return e.setTextRange(u.createPropertyAssignment(t.name,P(u.cloneNode(t.name))),t)}(i);case 161:return function(r){return e.visitEachChild(r,C,t)}(i);case 203:return function(r){return e.some(r.elements,e.isSpreadElement)?ke(r.elements,!1,!!r.multiLine,!!r.elements.hasTrailingComma):e.visitEachChild(r,C,t)}(i);case 207:return function(t){if(33554432&e.getEmitFlags(t))return function(t){var r=e.cast(e.cast(e.skipOuterExpressions(t.expression),e.isArrowFunction).body,e.isBlock),n=function(t){return e.isVariableStatement(t)&&!!e.first(t.declarationList.declarations).initializer},i=s;s=void 0;var a=e.visitNodes(r.statements,k,e.isStatement);s=i;var o=e.filter(a,n),c=e.filter(a,(function(e){return !n(e)})),l=e.cast(e.first(o),e.isVariableStatement).declarationList.declarations[0],_=e.skipOuterExpressions(l.initializer),d=e.tryCast(_,e.isAssignmentExpression);!d&&e.isBinaryExpression(_)&&27===_.operatorToken.kind&&(d=e.tryCast(_.left,e.isAssignmentExpression));var p=e.cast(d?e.skipOuterExpressions(d.right):_,e.isCallExpression),f=e.cast(e.skipOuterExpressions(p.expression),e.isFunctionExpression),g=f.body.statements,m=0,y=-1,v=[];if(d){var h=e.tryCast(g[m],e.isExpressionStatement);h&&(v.push(h),m++),v.push(g[m]),m++,v.push(u.createExpressionStatement(u.createAssignment(d.left,e.cast(l.name,e.isIdentifier))));}for(;!e.isReturnStatement(e.elementAt(g,y));)y--;return e.addRange(v,g,m,y),y<-1&&e.addRange(v,g,y+1),e.addRange(v,c),e.addRange(v,o,1),u.restoreOuterExpressions(t.expression,u.restoreOuterExpressions(l.initializer,u.restoreOuterExpressions(d&&d.right,u.updateCallExpression(p,u.restoreOuterExpressions(p.expression,u.updateFunctionExpression(f,void 0,void 0,void 0,void 0,f.parameters,void 0,u.updateBlock(f.body,v))),void 0,p.arguments))))}(t);var r=e.skipOuterExpressions(t.expression);return 106===r.kind||e.isSuperProperty(r)||e.some(t.arguments,e.isSpreadElement)?Ee(t,!0):u.updateCallExpression(t,e.visitNode(t.expression,N,e.isExpression),void 0,e.visitNodes(t.arguments,C,e.isExpression))}(i);case 208:return function(r){if(e.some(r.arguments,e.isSpreadElement)){var i=u.createCallBinding(u.createPropertyAccessExpression(r.expression,"bind"),g),a=i.target,o=i.thisArg;return u.createNewExpression(u.createFunctionApplyCall(e.visitNode(a,C,e.isExpression),o,ke(u.createNodeArray(n$3([u.createVoidZero()],r.arguments,!0)),!0,!1,!1)),void 0,[])}return e.visitEachChild(r,C,t)}(i);case 211:return function(r,n){return e.visitEachChild(r,n?E:C,t)}(i,o);case 220:return X(i,o);case 349:return function(r,n){if(n)return e.visitEachChild(r,E,t);for(var i,a=0;a<r.elements.length;a++){var o=r.elements[a],s=e.visitNode(o,a<r.elements.length-1?E:C,e.isExpression);(i||s!==o)&&(i||(i=r.elements.slice(0,a)),i.push(s));}var c=i?e.setTextRange(u.createNodeArray(i),r.elements):r.elements;return u.updateCommaListExpression(r,c)}(i,o);case 14:case 15:case 16:case 17:return function(t){return e.setTextRange(u.createStringLiteral(t.text),t)}(i);case 10:return function(t){return t.hasExtendedUnicodeEscape?e.setTextRange(u.createStringLiteral(t.text),t):t}(i);case 8:return function(t){return 384&t.numericLiteralFlags?e.setTextRange(u.createNumericLiteral(t.text),t):t}(i);case 209:return function(n){return e.processTaggedTemplateExpression(t,n,C,r,b,e.ProcessLevel.All)}(i);case 222:return function(t){for(var r=u.createStringLiteral(t.head.text),n=0,i=t.templateSpans;n<i.length;n++){var a=i[n],o=[e.visitNode(a.expression,C,e.isExpression)];a.literal.text.length>0&&o.push(u.createStringLiteral(a.literal.text)),r=u.createCallExpression(u.createPropertyAccessExpression(r,"concat"),void 0,o);}return e.setTextRange(r,t)}(i);case 223:return function(r){return e.visitEachChild(r,C,t)}(i);case 224:return function(t){return e.visitNode(t.expression,C,e.isExpression)}(i);case 106:return we(!1);case 108:return function(e){return 2&a&&!(16384&a)&&(a|=65536),s?2&a?(s.containsLexicalThis=!0,e):s.thisName||(s.thisName=u.createUniqueName("this")):e}(i);case 230:return function(e){return 103===e.keywordToken&&"target"===e.name.escapedText?(a|=32768,u.createUniqueName("_newTarget",48)):e}(i);case 168:return function(t){e.Debug.assert(!e.isComputedPropertyName(t.name));var r=G(t,e.moveRangePos(t,-1),void 0,void 0);return e.setEmitFlags(r,512|e.getEmitFlags(r)),e.setTextRange(u.createPropertyAssignment(t.name,r),t)}(i);case 171:case 172:return function(r){e.Debug.assert(!e.isComputedPropertyName(r.name));var n=s;s=void 0;var i,a=x(32670,65),o=e.visitParameterList(r.parameters,C,t),c=Q(r);return i=171===r.kind?u.updateGetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,r.type,c):u.updateSetAccessorDeclaration(r,r.decorators,r.modifiers,r.name,o,c),D(a,98304,0),s=n,i}(i);case 236:return function(r){var n,i=x(0,e.hasSyntacticModifier(r,1)?32:0);if(s&&0==(3&r.declarationList.flags)&&!function(t){return 1===t.declarationList.declarations.length&&!!t.declarationList.declarations[0].initializer&&!!(33554432&e.getEmitFlags(t.declarationList.declarations[0].initializer))}(r)){for(var a=void 0,o=0,c=r.declarationList.declarations;o<c.length;o++){var l=c[o];if(ge(s,l),l.initializer){var _=void 0;e.isBindingPattern(l.name)?_=e.flattenDestructuringAssignment(l,C,t,0):(_=u.createBinaryExpression(l.name,63,e.visitNode(l.initializer,C,e.isExpression)),e.setTextRange(_,l)),a=e.append(a,_);}}n=a?e.setTextRange(u.createExpressionStatement(u.inlineExpressions(a)),r):void 0;}else n=e.visitEachChild(r,C,t);return D(i,0,0),n}(i);case 246:return function(r){return s?(s.nonLocalJumps|=8,S(r)&&(r=A(r)),u.createReturnStatement(u.createObjectLiteralExpression([u.createPropertyAssignment(u.createIdentifier("value"),r.expression?e.visitNode(r.expression,C,e.isExpression):u.createVoidZero())]))):S(r)?A(r):e.visitEachChild(r,C,t)}(i);case 216:return function(r){return e.visitEachChild(r,E,t)}(i);default:return e.visitEachChild(i,C,t)}}function A(t){return e.setOriginalNode(u.createReturnStatement(u.createUniqueName("_this",48)),t)}function P(e){return s&&y.isArgumentsLocalBinding(e)?s.argumentsName||(s.argumentsName=u.createUniqueName("arguments")):e}function w(n){n.name&&Ie();var o=e.getClassExtendsHeritageElement(n),c=u.createFunctionExpression(void 0,void 0,void 0,void 0,o?[u.createParameterDeclaration(void 0,void 0,void 0,u.createUniqueName("_super",48))]:[],void 0,function(n,o){var c=[],l=u.getInternalName(n),g=e.isIdentifierANonContextualKeyword(l)?u.getGeneratedNameForNode(l):l;d(),function(t,r,n){n&&t.push(e.setTextRange(u.createExpressionStatement(_().createExtendsHelper(u.getInternalName(r))),n));}(c,n,o),function(r,n,i,o){var c=s;s=void 0;var l=x(32662,73),_=e.getFirstConstructorWithBody(n),d=function(t,r){if(!t||!r)return !1;if(e.some(t.parameters))return !1;var n=e.firstOrUndefined(t.body.statements);if(!n||!e.nodeIsSynthesized(n)||237!==n.kind)return !1;var i=n.expression;if(!e.nodeIsSynthesized(i)||207!==i.kind)return !1;var a=i.expression;if(!e.nodeIsSynthesized(a)||106!==a.kind)return !1;var o=e.singleOrUndefined(i.arguments);if(!o||!e.nodeIsSynthesized(o)||224!==o.kind)return !1;var s=o.expression;return e.isIdentifier(s)&&"arguments"===s.escapedText}(_,void 0!==o),g=u.createFunctionDeclaration(void 0,void 0,void 0,i,void 0,function(r,n){return e.visitParameterList(r&&!n?r.parameters:void 0,C,t)||[]}(_,d),void 0,function(t,r,n,i){var o=!!n&&104!==e.skipOuterExpressions(n.expression).kind;if(!t)return function(t,r){var n=[];p(),u.mergeLexicalEnvironment(n,f()),r&&n.push(u.createReturnStatement(M()));var i=u.createNodeArray(n);e.setTextRange(i,t.members);var a=u.createBlock(i,!0);return e.setTextRange(a,t),e.setEmitFlags(a,1536),a}(r,o);var s=[],c=[];p();var l,_=0;if(i||(_=u.copyStandardPrologue(t.body.statements,s,!1)),R(c,t),J(c,t,i),i||(_=u.copyCustomPrologue(t.body.statements,c,_,C)),i)l=M();else if(o&&_<t.body.statements.length){var d=t.body.statements[_];e.isExpressionStatement(d)&&e.isSuperCall(d.expression)&&(l=function(e){return Ee(e,!1)}(d.expression));}if(l&&(a|=8192,_++),e.addRange(c,e.visitNodes(t.body.statements,C,e.isStatement,_)),u.mergeLexicalEnvironment(s,f()),K(s,t,!1),o)if(!l||_!==t.body.statements.length||8192&t.body.transformFlags)U(c,t,l||O()),I(t.body)||c.push(u.createReturnStatement(u.createUniqueName("_this",48)));else {var g=e.cast(e.cast(l,e.isBinaryExpression).left,e.isCallExpression),m=u.createReturnStatement(l);e.setCommentRange(m,e.getCommentRange(g)),e.setEmitFlags(g,1536),c.push(m);}else z(s,t);var y=u.createBlock(e.setTextRange(u.createNodeArray(e.concatenate(s,c)),t.body.statements),!0);return e.setTextRange(y,t.body),y}(_,n,o,d));e.setTextRange(g,_||n),o&&e.setEmitFlags(g,8),r.push(g),D(l,98304,0),s=c;}(c,n,g,o),function(t,n){for(var i=0,a=n.members;i<a.length;i++){var o=a[i];switch(o.kind){case 233:t.push(V(o));break;case 168:t.push(q(Oe(n,o),o,n));break;case 171:case 172:var s=e.getAllAccessorDeclarations(n.members,o);o===s.firstAccessor&&t.push(W(Oe(n,o),s,n));break;case 170:case 169:break;default:e.Debug.failBadSyntaxKind(o,r&&r.fileName);}}}(c,n);var m=e.createTokenRange(e.skipTrivia(i,n.members.end),19),y=u.createPartiallyEmittedExpression(g);e.setTextRangeEnd(y,m.end),e.setEmitFlags(y,1536);var v=u.createReturnStatement(y);e.setTextRangePos(v,m.pos),e.setEmitFlags(v,1920),c.push(v),e.insertStatementsAfterStandardPrologue(c,f());var h=u.createBlock(e.setTextRange(u.createNodeArray(c),n.members),!0);return e.setEmitFlags(h,1536),h}(n,o));e.setEmitFlags(c,65536&e.getEmitFlags(n)|524288);var l=u.createPartiallyEmittedExpression(c);e.setTextRangeEnd(l,n.end),e.setEmitFlags(l,1536);var g=u.createPartiallyEmittedExpression(l);e.setTextRangeEnd(g,e.skipTrivia(i,n.pos)),e.setEmitFlags(g,1536);var m=u.createParenthesizedExpression(u.createCallExpression(g,void 0,o?[e.visitNode(o.expression,C,e.isExpression)]:[]));return e.addSyntheticLeadingComment(m,3,"* @class "),m}function I(t){if(246===t.kind)return !0;if(238===t.kind){var r=t;if(r.elseStatement)return I(r.thenStatement)&&I(r.elseStatement)}else if(234===t.kind){var n=e.lastOrUndefined(t.statements);if(n&&I(n))return !0}return !1}function O(){return e.setEmitFlags(u.createThis(),4)}function M(){return u.createLogicalOr(u.createLogicalAnd(u.createStrictInequality(u.createUniqueName("_super",48),u.createNull()),u.createFunctionApplyCall(u.createUniqueName("_super",48),O(),u.createIdentifier("arguments"))),O())}function L(t){return void 0!==t.initializer||e.isBindingPattern(t.name)}function R(t,r){if(!e.some(r.parameters,L))return !1;for(var n=!1,i=0,a=r.parameters;i<a.length;i++){var o=a[i],s=o.name,c=o.initializer;o.dotDotDotToken||(e.isBindingPattern(s)?n=B(t,o,s,c)||n:c&&(j(t,o,s,c),n=!0));}return n}function B(r,n,i,a){return i.elements.length>0?(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(n,C,t,0,u.getGeneratedNameForNode(n)))),1048576)),!0):!!a&&(e.insertStatementAfterCustomPrologue(r,e.setEmitFlags(u.createExpressionStatement(u.createAssignment(u.getGeneratedNameForNode(n),e.visitNode(a,C,e.isExpression))),1048576)),!0)}function j(t,r,n,i){i=e.visitNode(i,C,e.isExpression);var a=u.createIfStatement(u.createTypeCheck(u.cloneNode(n),"undefined"),e.setEmitFlags(e.setTextRange(u.createBlock([u.createExpressionStatement(e.setEmitFlags(e.setTextRange(u.createAssignment(e.setEmitFlags(e.setParent(e.setTextRange(u.cloneNode(n),n),n.parent),48),e.setEmitFlags(i,1584|e.getEmitFlags(i))),r),1536))]),r),1953));e.startOnNewLine(a),e.setTextRange(a,r),e.setEmitFlags(a,1050528),e.insertStatementAfterCustomPrologue(t,a);}function J(r,n,i){var a=[],o=e.lastOrUndefined(n.parameters);if(!function(e,t){return !(!e||!e.dotDotDotToken||t)}(o,i))return !1;var s=79===o.name.kind?e.setParent(e.setTextRange(u.cloneNode(o.name),o.name),o.name.parent):u.createTempVariable(void 0);e.setEmitFlags(s,48);var c=79===o.name.kind?u.cloneNode(o.name):s,l=n.parameters.length-1,_=u.createLoopVariable();a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(s,void 0,void 0,u.createArrayLiteralExpression([]))])),o),1048576));var d=u.createForStatement(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(_,void 0,void 0,u.createNumericLiteral(l))]),o),e.setTextRange(u.createLessThan(_,u.createPropertyAccessExpression(u.createIdentifier("arguments"),"length")),o),e.setTextRange(u.createPostfixIncrement(_),o),u.createBlock([e.startOnNewLine(e.setTextRange(u.createExpressionStatement(u.createAssignment(u.createElementAccessExpression(c,0===l?_:u.createSubtract(_,u.createNumericLiteral(l))),u.createElementAccessExpression(u.createIdentifier("arguments"),_))),o))]));return e.setEmitFlags(d,1048576),e.startOnNewLine(d),a.push(d),79!==o.name.kind&&a.push(e.setEmitFlags(e.setTextRange(u.createVariableStatement(void 0,u.createVariableDeclarationList(e.flattenDestructuringBinding(o,C,t,0,c))),o),1048576)),e.insertStatementsAfterCustomPrologue(r,a),!0}function z(e,t){return !!(65536&a&&213!==t.kind)&&(U(e,t,u.createThis()),!0)}function U(r,n,i){0==(1&l)&&(l|=1,t.enableSubstitution(108),t.enableEmitNotification(170),t.enableEmitNotification(168),t.enableEmitNotification(171),t.enableEmitNotification(172),t.enableEmitNotification(213),t.enableEmitNotification(212),t.enableEmitNotification(255));var a=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_this",48),void 0,void 0,i)]));e.setEmitFlags(a,1050112),e.setSourceMapRange(a,n),e.insertStatementAfterCustomPrologue(r,a);}function K(t,r,n){if(32768&a){var i=void 0;switch(r.kind){case 213:return t;case 168:case 171:case 172:i=u.createVoidZero();break;case 170:i=u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor");break;case 255:case 212:i=u.createConditionalExpression(u.createLogicalAnd(e.setEmitFlags(u.createThis(),4),u.createBinaryExpression(e.setEmitFlags(u.createThis(),4),102,u.getLocalName(r))),void 0,u.createPropertyAccessExpression(e.setEmitFlags(u.createThis(),4),"constructor"),void 0,u.createVoidZero());break;default:return e.Debug.failBadSyntaxKind(r)}var o=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(u.createUniqueName("_newTarget",48),void 0,void 0,i)]));e.setEmitFlags(o,1050112),n&&(t=t.slice()),e.insertStatementAfterCustomPrologue(t,o);}return t}function V(t){return e.setTextRange(u.createEmptyStatement(),t)}function q(r,n,i){var a,o=e.getCommentRange(n),s=e.getSourceMapRange(n),c=G(n,n,void 0,i),l=e.visitNode(n.name,C,e.isPropertyName);if(!e.isPrivateIdentifier(l)&&e.getUseDefineForClassFields(t.getCompilerOptions())){var _=e.isComputedPropertyName(l)?l.expression:e.isIdentifier(l)?u.createStringLiteral(e.unescapeLeadingUnderscores(l.escapedText)):l;a=u.createObjectDefinePropertyCall(r,_,u.createPropertyDescriptor({value:c,enumerable:!1,writable:!0,configurable:!0}));}else {var d=e.createMemberAccessForPropertyName(u,r,l,n.name);a=u.createAssignment(d,c);}e.setEmitFlags(c,1536),e.setSourceMapRange(c,s);var p=e.setTextRange(u.createExpressionStatement(a),n);return e.setOriginalNode(p,n),e.setCommentRange(p,o),e.setEmitFlags(p,48),p}function W(t,r,n){var i=u.createExpressionStatement(H(t,r,n,!1));return e.setEmitFlags(i,1536),e.setSourceMapRange(i,e.getSourceMapRange(r.firstAccessor)),i}function H(t,r,n,i){var a=r.firstAccessor,o=r.getAccessor,s=r.setAccessor,c=e.setParent(e.setTextRange(u.cloneNode(t),t),t.parent);e.setEmitFlags(c,1568),e.setSourceMapRange(c,a.name);var l=e.visitNode(a.name,C,e.isPropertyName);if(e.isPrivateIdentifier(l))return e.Debug.failBadSyntaxKind(l,"Encountered unhandled private identifier while transforming ES2015.");var _=e.createExpressionForPropertyName(u,l);e.setEmitFlags(_,1552),e.setSourceMapRange(_,a.name);var d=[];if(o){var p=G(o,void 0,void 0,n);e.setSourceMapRange(p,e.getSourceMapRange(o)),e.setEmitFlags(p,512);var f=u.createPropertyAssignment("get",p);e.setCommentRange(f,e.getCommentRange(o)),d.push(f);}if(s){var g=G(s,void 0,void 0,n);e.setSourceMapRange(g,e.getSourceMapRange(s)),e.setEmitFlags(g,512);var m=u.createPropertyAssignment("set",g);e.setCommentRange(m,e.getCommentRange(s)),d.push(m);}d.push(u.createPropertyAssignment("enumerable",o||s?u.createFalse():u.createTrue()),u.createPropertyAssignment("configurable",u.createTrue()));var y=u.createCallExpression(u.createPropertyAccessExpression(u.createIdentifier("Object"),"defineProperty"),void 0,[c,_,u.createObjectLiteralExpression(d,!0)]);return i&&e.startOnNewLine(y),y}function G(r,n,i,o){var c=s;s=void 0;var l=o&&e.isClassLike(o)&&!e.isStatic(r)?x(32670,73):x(32670,65),_=e.visitParameterList(r.parameters,C,t),d=Q(r);return 32768&a&&!i&&(255===r.kind||212===r.kind)&&(i=u.getGeneratedNameForNode(r)),D(l,98304,0),s=c,e.setOriginalNode(e.setTextRange(u.createFunctionExpression(void 0,r.asteriskToken,i,void 0,_,void 0,d),n),r)}function Q(t){var n,i,a,o=!1,s=!1,c=[],l=[],_=t.body;if(p(),e.isBlock(_)&&(a=u.copyStandardPrologue(_.statements,c,!1),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedFunction),a=u.copyCustomPrologue(_.statements,l,a,C,e.isHoistedVariableStatement)),o=R(l,t)||o,o=J(l,t,!1)||o,e.isBlock(_))a=u.copyCustomPrologue(_.statements,l,a,C),n=_.statements,e.addRange(l,e.visitNodes(_.statements,C,e.isStatement,a)),!o&&_.multiLine&&(o=!0);else {e.Debug.assert(213===t.kind),n=e.moveRangeEnd(_,-1);var d=t.equalsGreaterThanToken;e.nodeIsSynthesized(d)||e.nodeIsSynthesized(_)||(e.rangeEndIsOnSameLineAsRangeStart(d,_,r)?s=!0:o=!0);var g=e.visitNode(_,C,e.isExpression),m=u.createReturnStatement(g);e.setTextRange(m,_),e.moveSyntheticComments(m,_),e.setEmitFlags(m,1440),l.push(m),i=_;}if(u.mergeLexicalEnvironment(c,f()),K(c,t,!1),z(c,t),e.some(c)&&(o=!0),l.unshift.apply(l,c),e.isBlock(_)&&e.arrayIsEqualTo(l,_.statements))return _;var y=u.createBlock(e.setTextRange(u.createNodeArray(l),n),o);return e.setTextRange(y,t.body),!o&&s&&e.setEmitFlags(y,1),i&&e.setTokenSourceMapRange(y,19,i),e.setOriginalNode(y,t.body),y}function X(r,n){return e.isDestructuringAssignment(r)?e.flattenDestructuringAssignment(r,C,t,0,!n):27===r.operatorToken.kind?u.updateBinaryExpression(r,e.visitNode(r.left,E,e.isExpression),r.operatorToken,e.visitNode(r.right,n?E:C,e.isExpression)):e.visitEachChild(r,C,t)}function Y(r){var n=r.name;return e.isBindingPattern(n)?Z(r):!r.initializer&&function(e){var t=y.getNodeCheckFlags(e),r=262144&t,n=524288&t;return !(0!=(64&a)||r&&n&&0!=(512&a))&&0==(4096&a)&&(!y.isDeclarationWithCollidingName(e)||n&&!r&&0==(6144&a))}(r)?u.updateVariableDeclaration(r,r.name,void 0,void 0,u.createVoidZero()):e.visitEachChild(r,C,t)}function Z(r){var n,i=x(32,0);return n=e.isBindingPattern(r.name)?e.flattenDestructuringBinding(r,C,t,0,void 0,0!=(32&i)):e.visitEachChild(r,C,t),D(i,0,0),n}function $(t){s.labels.set(e.idText(t.label),!0);}function ee(t){s.labels.set(e.idText(t.label),!1);}function te(r,n,i,o,c){var l=x(r,n),_=function(r,n,i,o){if(!pe(r)){var c=void 0;s&&(c=s.allowedNonLabeledJumps,s.allowedNonLabeledJumps=6);var l=o?o(r,n,void 0,i):u.restoreEnclosingLabel(e.isForStatement(r)?function(t){return u.updateForStatement(t,e.visitNode(t.initializer,E,e.isForInitializer),e.visitNode(t.condition,C,e.isExpression),e.visitNode(t.incrementor,E,e.isExpression),e.visitNode(t.statement,C,e.isStatement,u.liftToBlock))}(r):e.visitEachChild(r,C,t),n,s&&ee);return s&&(s.allowedNonLabeledJumps=c),l}var _=function(t){var r;switch(t.kind){case 241:case 242:case 243:var n=t.initializer;n&&254===n.kind&&(r=n);}var i=[],a=[];if(r&&3&e.getCombinedNodeFlags(r))for(var o=_e(t),c=0,l=r.declarations;c<l.length;c++)De(t,l[c],i,a,o);var u={loopParameters:i,loopOutParameters:a};return s&&(s.argumentsName&&(u.argumentsName=s.argumentsName),s.thisName&&(u.thisName=s.thisName),s.hoistedLocalVariables&&(u.hoistedLocalVariables=s.hoistedLocalVariables)),u}(r),p=[],g=s;s=_;var m,y,v,h,b,x=_e(r)?function(t,r){var n=u.createUniqueName("_loop_init"),i=0!=(524288&t.initializer.transformFlags),o=0;r.containsLexicalThis&&(o|=8),i&&4&a&&(o|=262144);var s=[];return s.push(u.createVariableStatement(void 0,t.initializer)),he(r.loopOutParameters,2,1,s),{functionName:n,containsYield:i,functionDeclaration:u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(n,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,i?u.createToken(41):void 0,void 0,void 0,void 0,void 0,e.visitNode(u.createBlock(s,!0),C,e.isBlock)),o))]),2097152)),part:u.createVariableDeclarationList(e.map(r.loopOutParameters,ye))}}(r,_):void 0,D=fe(r)?function(t,r,n){var i=u.createUniqueName("_loop");d();var o=e.visitNode(t.statement,C,e.isStatement,u.liftToBlock),s=f(),c=[];(de(t)||function(t){return e.isForStatement(t)&&!!t.incrementor&&ue(t.incrementor)}(t))&&(r.conditionVariable=u.createUniqueName("inc"),t.incrementor?c.push(u.createIfStatement(r.conditionVariable,u.createExpressionStatement(e.visitNode(t.incrementor,C,e.isExpression)),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))):c.push(u.createIfStatement(u.createLogicalNot(r.conditionVariable),u.createExpressionStatement(u.createAssignment(r.conditionVariable,u.createTrue())))),de(t)&&c.push(u.createIfStatement(u.createPrefixUnaryExpression(53,e.visitNode(t.condition,C,e.isExpression)),e.visitNode(u.createBreakStatement(),C,e.isStatement)))),e.isBlock(o)?e.addRange(c,o.statements):c.push(o),he(r.loopOutParameters,1,1,c),e.insertStatementsAfterStandardPrologue(c,s);var l=u.createBlock(c,!0);e.isBlock(o)&&e.setOriginalNode(l,o);var _=0!=(524288&t.statement.transformFlags),p=524288;return r.containsLexicalThis&&(p|=8),_&&0!=(4&a)&&(p|=262144),{functionName:i,containsYield:_,functionDeclaration:u.createVariableStatement(void 0,e.setEmitFlags(u.createVariableDeclarationList([u.createVariableDeclaration(i,void 0,void 0,e.setEmitFlags(u.createFunctionExpression(void 0,_?u.createToken(41):void 0,void 0,void 0,r.loopParameters,void 0,l),p))]),2097152)),part:function(t,r,n,i){var a=[],o=!(-5&r.nonLocalJumps||r.labeledNonLocalBreaks||r.labeledNonLocalContinues),s=u.createCallExpression(t,void 0,e.map(r.loopParameters,(function(e){return e.name}))),c=i?u.createYieldExpression(u.createToken(41),e.setEmitFlags(s,8388608)):s;if(o)a.push(u.createExpressionStatement(c)),he(r.loopOutParameters,1,0,a);else {var l=u.createUniqueName("state"),_=u.createVariableStatement(void 0,u.createVariableDeclarationList([u.createVariableDeclaration(l,void 0,void 0,c)]));if(a.push(_),he(r.loopOutParameters,1,0,a),8&r.nonLocalJumps){var d=void 0;n?(n.nonLocalJumps|=8,d=u.createReturnStatement(l)):d=u.createReturnStatement(u.createPropertyAccessExpression(l,"value")),a.push(u.createIfStatement(u.createTypeCheck(l,"object"),d));}if(2&r.nonLocalJumps&&a.push(u.createIfStatement(u.createStrictEquality(l,u.createStringLiteral("break")),u.createBreakStatement())),r.labeledNonLocalBreaks||r.labeledNonLocalContinues){var p=[];xe(r.labeledNonLocalBreaks,!0,l,n,p),xe(r.labeledNonLocalContinues,!1,l,n,p),a.push(u.createSwitchStatement(l,u.createCaseBlock(p)));}}return a}(i,r,n,_)}}(r,_,g):void 0;if(s=g,x&&p.push(x.functionDeclaration),D&&p.push(D.functionDeclaration),function(e,t,r){var n;if(t.argumentsName&&(r?r.argumentsName=t.argumentsName:(n||(n=[])).push(u.createVariableDeclaration(t.argumentsName,void 0,void 0,u.createIdentifier("arguments")))),t.thisName&&(r?r.thisName=t.thisName:(n||(n=[])).push(u.createVariableDeclaration(t.thisName,void 0,void 0,u.createIdentifier("this")))),t.hoistedLocalVariables)if(r)r.hoistedLocalVariables=t.hoistedLocalVariables;else {n||(n=[]);for(var i=0,a=t.hoistedLocalVariables;i<a.length;i++){var o=a[i];n.push(u.createVariableDeclaration(o));}}if(t.loopOutParameters.length){n||(n=[]);for(var s=0,c=t.loopOutParameters;s<c.length;s++){var l=c[s];n.push(u.createVariableDeclaration(l.outParamName));}}t.conditionVariable&&(n||(n=[]),n.push(u.createVariableDeclaration(t.conditionVariable,void 0,void 0,u.createFalse()))),n&&e.push(u.createVariableStatement(void 0,u.createVariableDeclarationList(n)));}(p,_,g),x&&p.push((y=x.functionName,v=x.containsYield,h=u.createCallExpression(y,void 0,[]),b=v?u.createYieldExpression(u.createToken(41),e.setEmitFlags(h,8388608)):h,u.createExpressionStatement(b))),D)if(o)m=o(r,n,D.part,i);else {var S=me(r,x,u.createBlock(D.part,!0));m=u.restoreEnclosingLabel(S,n,s&&ee);}else {var T=me(r,x,e.visitNode(r.statement,C,e.isStatement,u.liftToBlock));m=u.restoreEnclosingLabel(T,n,s&&ee);}return p.push(m),p}(i,o,l,c);return D(l,0,0),_}function re(e,t){return te(0,1280,e,t)}function ne(e,t){return te(5056,3328,e,t)}function ie(e,t){return te(3008,5376,e,t)}function ae(e,t){return te(3008,5376,e,t,m.downlevelIteration?le:ce)}function oe(r,n,i){var a=[],o=r.initializer;if(e.isVariableDeclarationList(o)){3&r.initializer.flags&&Ie();var s=e.firstOrUndefined(o.declarations);if(s&&e.isBindingPattern(s.name)){var c=e.flattenDestructuringBinding(s,C,t,0,n),l=e.setTextRange(u.createVariableDeclarationList(c),r.initializer);e.setOriginalNode(l,r.initializer),e.setSourceMapRange(l,e.createRange(c[0].pos,e.last(c).end)),a.push(u.createVariableStatement(void 0,l));}else a.push(e.setTextRange(u.createVariableStatement(void 0,e.setOriginalNode(e.setTextRange(u.createVariableDeclarationList([u.createVariableDeclaration(s?s.name:u.createTempVariable(void 0),void 0,void 0,n)]),e.moveRangePos(o,-1)),o)),e.moveRangeEnd(o,-1)));}else {var _=u.createAssignment(o,n);e.isDestructuringAssignment(_)?a.push(u.createExpressionStatement(X(_,!0))):(e.setTextRangeEnd(_,o.end),a.push(e.setTextRange(u.createExpressionStatement(e.visitNode(_,C,e.isExpression)),e.moveRangeEnd(o,-1))));}if(i)return se(e.addRange(a,i));var d=e.visitNode(r.statement,C,e.isStatement,u.liftToBlock);return e.isBlock(d)?u.updateBlock(d,e.setTextRange(u.createNodeArray(e.concatenate(a,d.statements)),d.statements)):(a.push(d),se(a))}function se(t){return e.setEmitFlags(u.createBlock(u.createNodeArray(t),!0),432)}function ce(t,r,n){var i=e.visitNode(t.expression,C,e.isExpression),a=u.createLoopVariable(),o=e.isIdentifier(i)?u.getGeneratedNameForNode(i):u.createTempVariable(void 0);e.setEmitFlags(i,48|e.getEmitFlags(i));var c=e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(a,void 0,void 0,u.createNumericLiteral(0)),e.moveRangePos(t.expression,-1)),e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,i),t.expression)]),t.expression),2097152),e.setTextRange(u.createLessThan(a,u.createPropertyAccessExpression(o,"length")),t.expression),e.setTextRange(u.createPostfixIncrement(a),t.expression),oe(t,u.createElementAccessExpression(o,a),n)),t);return e.setEmitFlags(c,256),e.setTextRange(c,t),u.restoreEnclosingLabel(c,r,s&&ee)}function le(t,r,n,i){var a=e.visitNode(t.expression,C,e.isExpression),o=e.isIdentifier(a)?u.getGeneratedNameForNode(a):u.createTempVariable(void 0),c=e.isIdentifier(a)?u.getGeneratedNameForNode(o):u.createTempVariable(void 0),l=u.createUniqueName("e"),d=u.getGeneratedNameForNode(l),p=u.createTempVariable(void 0),f=e.setTextRange(_().createValuesHelper(a),t.expression),m=u.createCallExpression(u.createPropertyAccessExpression(o,"next"),void 0,[]);g(l),g(p);var y=1024&i?u.inlineExpressions([u.createAssignment(l,u.createVoidZero()),f]):f,v=e.setEmitFlags(e.setTextRange(u.createForStatement(e.setEmitFlags(e.setTextRange(u.createVariableDeclarationList([e.setTextRange(u.createVariableDeclaration(o,void 0,void 0,y),t.expression),u.createVariableDeclaration(c,void 0,void 0,m)]),t.expression),2097152),u.createLogicalNot(u.createPropertyAccessExpression(c,"done")),u.createAssignment(c,m),oe(t,u.createPropertyAccessExpression(c,"value"),n)),t),256);return u.createTryStatement(u.createBlock([u.restoreEnclosingLabel(v,r,s&&ee)]),u.createCatchClause(u.createVariableDeclaration(d),e.setEmitFlags(u.createBlock([u.createExpressionStatement(u.createAssignment(l,u.createObjectLiteralExpression([u.createPropertyAssignment("error",d)])))]),1)),u.createBlock([u.createTryStatement(u.createBlock([e.setEmitFlags(u.createIfStatement(u.createLogicalAnd(u.createLogicalAnd(c,u.createLogicalNot(u.createPropertyAccessExpression(c,"done"))),u.createAssignment(p,u.createPropertyAccessExpression(o,"return"))),u.createExpressionStatement(u.createFunctionCallCall(p,o,[]))),1)]),void 0,e.setEmitFlags(u.createBlock([e.setEmitFlags(u.createIfStatement(l,u.createThrowStatement(u.createPropertyAccessExpression(l,"error"))),1)]),1))]))}function ue(e){return 0!=(131072&y.getNodeCheckFlags(e))}function _e(t){return e.isForStatement(t)&&!!t.initializer&&ue(t.initializer)}function de(t){return e.isForStatement(t)&&!!t.condition&&ue(t.condition)}function pe(e){return fe(e)||_e(e)}function fe(e){return 0!=(65536&y.getNodeCheckFlags(e))}function ge(t,r){t.hoistedLocalVariables||(t.hoistedLocalVariables=[]),function r(n){if(79===n.kind)t.hoistedLocalVariables.push(n);else for(var i=0,a=n.elements;i<a.length;i++){var o=a[i];e.isOmittedExpression(o)||r(o.name);}}(r.name);}function me(t,r,n){switch(t.kind){case 241:return function(t,r,n){var i=t.condition&&ue(t.condition),a=i||t.incrementor&&ue(t.incrementor);return u.updateForStatement(t,e.visitNode(r?r.part:t.initializer,E,e.isForInitializer),e.visitNode(i?void 0:t.condition,C,e.isExpression),e.visitNode(a?void 0:t.incrementor,E,e.isExpression),n)}(t,r,n);case 242:return function(t,r){return u.updateForInStatement(t,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 243:return function(t,r){return u.updateForOfStatement(t,void 0,e.visitNode(t.initializer,C,e.isForInitializer),e.visitNode(t.expression,C,e.isExpression),r)}(t,n);case 239:return function(t,r){return u.updateDoStatement(t,r,e.visitNode(t.expression,C,e.isExpression))}(t,n);case 240:return function(t,r){return u.updateWhileStatement(t,e.visitNode(t.expression,C,e.isExpression),r)}(t,n);default:return e.Debug.failBadSyntaxKind(t,"IterationStatement expected")}}function ye(e){return u.createVariableDeclaration(e.originalName,void 0,void 0,e.outParamName)}function ve(e,t){var r=0===t?e.outParamName:e.originalName,n=0===t?e.originalName:e.outParamName;return u.createBinaryExpression(n,63,r)}function he(e,t,r,n){for(var i=0,a=e;i<a.length;i++){var o=a[i];o.flags&t&&n.push(u.createExpressionStatement(ve(o,r)));}}function be(t,r,n,i){r?(t.labeledNonLocalBreaks||(t.labeledNonLocalBreaks=new e.Map),t.labeledNonLocalBreaks.set(n,i)):(t.labeledNonLocalContinues||(t.labeledNonLocalContinues=new e.Map),t.labeledNonLocalContinues.set(n,i));}function xe(e,t,r,n,i){e&&e.forEach((function(e,a){var o=[];if(!n||n.labels&&n.labels.get(a)){var s=u.createIdentifier(a);o.push(t?u.createBreakStatement(s):u.createContinueStatement(s));}else be(n,t,a,e),o.push(u.createReturnStatement(r));i.push(u.createCaseClause(u.createStringLiteral(e),o));}));}function De(t,r,n,i,a){var o=r.name;if(e.isBindingPattern(o))for(var s=0,c=o.elements;s<c.length;s++){var l=c[s];e.isOmittedExpression(l)||De(t,l,n,i,a);}else {n.push(u.createParameterDeclaration(void 0,void 0,void 0,o));var _=y.getNodeCheckFlags(r);if(4194304&_||a){var d=u.createUniqueName("out_"+e.idText(o)),p=0;4194304&_&&(p|=1),e.isForStatement(t)&&t.initializer&&y.isBindingCapturedByNode(t.initializer,r)&&(p|=2),i.push({flags:p,originalName:o,outParamName:d});}}}function Se(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),e.visitNode(t.initializer,C,e.isExpression));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Te(t,r,n){var i=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),u.cloneNode(t.name));return e.setTextRange(i,t),n&&e.startOnNewLine(i),i}function Ce(t,r,n,i){var a=u.createAssignment(e.createMemberAccessForPropertyName(u,r,e.visitNode(t.name,C,e.isPropertyName)),G(t,t,void 0,n));return e.setTextRange(a,t),i&&e.startOnNewLine(a),a}function Ee(r,n){if(16384&r.transformFlags||106===r.expression.kind||e.isSuperProperty(e.skipOuterExpressions(r.expression))){var i=u.createCallBinding(r.expression,g),a=i.target,o=i.thisArg;106===r.expression.kind&&e.setEmitFlags(o,4);var s=void 0;if(s=16384&r.transformFlags?u.createFunctionApplyCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),ke(r.arguments,!0,!1,!1)):e.setTextRange(u.createFunctionCallCall(e.visitNode(a,N,e.isExpression),106===r.expression.kind?o:e.visitNode(o,C,e.isExpression),e.visitNodes(r.arguments,C,e.isExpression)),r),106===r.expression.kind){var c=u.createLogicalOr(s,O());s=n?u.createAssignment(u.createUniqueName("_this",48),c):c;}return e.setOriginalNode(s,r)}return e.visitEachChild(r,C,t)}function ke(t,r,n,i){var a=t.length,o=e.flatten(e.spanMap(t,Ne,(function(e,t,r,o){return t(e,n,i&&o===a)})));if(1===o.length){var s=o[0];if(r&&!m.downlevelIteration||e.isPackedArrayLiteral(s.expression)||e.isCallToHelper(s.expression,"___spreadArray"))return s.expression}for(var c=_(),l=0!==o[0].kind,d=l?u.createArrayLiteralExpression():o[0].expression,p=l?0:1;p<o.length;p++){var f=o[p];d=c.createSpreadArrayHelper(d,f.expression,1===f.kind&&!r);}return d}function Ne(t){return e.isSpreadElement(t)?Fe:Pe}function Fe(t){return e.map(t,Ae)}function Ae(t){var r=e.visitNode(t.expression,C,e.isExpression),n=e.isCallToHelper(r,"___read"),i=n||e.isPackedArrayLiteral(r)?2:1;return !m.downlevelIteration||1!==i||e.isArrayLiteralExpression(r)||n||(r=_().createReadHelper(r,void 0),i=2),c(i,r)}function Pe(t,r,n){return c(0,u.createArrayLiteralExpression(e.visitNodes(u.createNodeArray(t,n),C,e.isExpression),r))}function we(e){return 8&a&&!e?u.createPropertyAccessExpression(u.createUniqueName("_super",48),"prototype"):u.createUniqueName("_super",48)}function Ie(){0==(2&l)&&(l|=2,t.enableSubstitution(79));}function Oe(t,r){return e.isStatic(r)?u.getInternalName(t):u.createPropertyAccessExpression(u.getInternalName(t),"prototype")}};}(t),function(e){e.transformES5=function(t){var r,n,i=t.factory,a=t.getCompilerOptions();1!==a.jsx&&3!==a.jsx||(r=t.onEmitNode,t.onEmitNode=function(t,i,a){switch(i.kind){case 279:case 280:case 278:var o=i.tagName;n[e.getOriginalNodeId(o)]=!0;}r(t,i,a);},t.enableEmitNotification(279),t.enableEmitNotification(280),t.enableEmitNotification(278),n=[]);var o=t.onSubstituteNode;return t.onSubstituteNode=function(t,r){return r.id&&n&&n[r.id]?o(t,r):(r=o(t,r),e.isPropertyAccessExpression(r)?function(t){if(e.isPrivateIdentifier(t.name))return t;var r=s(t.name);return r?e.setTextRange(i.createElementAccessExpression(t.expression,r),t):t}(r):e.isPropertyAssignment(r)?function(t){var r=e.isIdentifier(t.name)&&s(t.name);return r?i.updatePropertyAssignment(t,r,t.initializer):t}(r):r)},t.enableSubstitution(205),t.enableSubstitution(294),e.chainBundle(t,(function(e){return e}));function s(t){var r=t.originalKeywordKind||(e.nodeIsSynthesized(t)?e.stringToToken(e.idText(t)):void 0);if(void 0!==r&&r>=81&&r<=116)return e.setTextRange(i.createStringLiteralFromNode(t),t)}};}(t),function(e){var t,r,i,a,o;!function(e){e[e.Nop=0]="Nop",e[e.Statement=1]="Statement",e[e.Assign=2]="Assign",e[e.Break=3]="Break",e[e.BreakWhenTrue=4]="BreakWhenTrue",e[e.BreakWhenFalse=5]="BreakWhenFalse",e[e.Yield=6]="Yield",e[e.YieldStar=7]="YieldStar",e[e.Return=8]="Return",e[e.Throw=9]="Throw",e[e.Endfinally=10]="Endfinally";}(t||(t={})),function(e){e[e.Open=0]="Open",e[e.Close=1]="Close";}(r||(r={})),function(e){e[e.Exception=0]="Exception",e[e.With=1]="With",e[e.Switch=2]="Switch",e[e.Loop=3]="Loop",e[e.Labeled=4]="Labeled";}(i||(i={})),function(e){e[e.Try=0]="Try",e[e.Catch=1]="Catch",e[e.Finally=2]="Finally",e[e.Done=3]="Done";}(a||(a={})),function(e){e[e.Next=0]="Next",e[e.Throw=1]="Throw",e[e.Return=2]="Return",e[e.Break=3]="Break",e[e.Yield=4]="Yield",e[e.YieldStar=5]="YieldStar",e[e.Catch=6]="Catch",e[e.Endfinally=7]="Endfinally";}(o||(o={})),e.transformGenerators=function(t){var r,i,a,o,s,c,l,u,_,d,p=t.factory,f=t.getEmitHelperFactory,g=t.resumeLexicalEnvironment,m=t.endLexicalEnvironment,y=t.hoistFunctionDeclaration,v=t.hoistVariableDeclaration,h=t.getCompilerOptions(),b=e.getEmitScriptTarget(h),x=t.getEmitResolver(),D=t.onSubstituteNode;t.onSubstituteNode=function(t,n){return n=D(t,n),1===t?function(t){return e.isIdentifier(t)?function(t){if(!e.isGeneratedIdentifier(t)&&r&&r.has(e.idText(t))){var n=e.getOriginalNode(t);if(e.isIdentifier(n)&&n.parent){var a=x.getReferencedValueDeclaration(n);if(a){var o=i[e.getOriginalNodeId(a)];if(o){var s=e.setParent(e.setTextRange(p.cloneNode(o),o),o.parent);return e.setSourceMapRange(s,t),e.setCommentRange(s,t),s}}}}return t}(t):t}(n):n};var S,T,C,E,k,N,F,A,P,w,I,O,M=1,L=0,R=0;return e.chainBundle(t,(function(r){if(r.isDeclarationFile||0==(1024&r.transformFlags))return r;var n=e.visitEachChild(r,B,t);return e.addEmitHelpers(n,t.readEmitHelpers()),n}));function B(r){var n=r.transformFlags;return o?function(r){switch(r.kind){case 239:case 240:return function(r){return o?(oe(),r=e.visitEachChild(r,B,t),ce(),r):e.visitEachChild(r,B,t)}(r);case 248:return function(r){return o&&re({kind:2,isScript:!0,breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&le(),r}(r);case 249:return function(r){return o&&re({kind:4,isScript:!0,labelText:e.idText(r.label),breakLabel:-1}),r=e.visitEachChild(r,B,t),o&&ue(),r}(r);default:return j(r)}}(r):a?j(r):e.isFunctionLikeDeclaration(r)&&r.asteriskToken?function(t){switch(t.kind){case 255:return J(t);case 212:return z(t);default:return e.Debug.failBadSyntaxKind(t)}}(r):1024&n?e.visitEachChild(r,B,t):r}function j(r){switch(r.kind){case 255:return J(r);case 212:return z(r);case 171:case 172:return function(r){var n=a,i=o;return a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i,r}(r);case 236:return function(t){if(524288&t.transformFlags)G(t.declarationList);else {if(1048576&e.getEmitFlags(t))return t;for(var r=0,n=t.declarationList.declarations;r<n.length;r++){var i=n[r];v(i.name);}var a=e.getInitializedVariables(t.declarationList);if(0!==a.length)return e.setSourceMapRange(p.createExpressionStatement(p.inlineExpressions(e.map(a,Q))),t)}}(r);case 241:return function(r){o&&oe();var n=r.initializer;if(n&&e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}var c=e.getInitializedVariables(n);r=p.updateForStatement(r,c.length>0?p.inlineExpressions(e.map(c,Q)):void 0,e.visitNode(r.condition,B,e.isExpression),e.visitNode(r.incrementor,B,e.isExpression),e.visitIterationBody(r.statement,B,t));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 242:return function(r){o&&oe();var n=r.initializer;if(e.isVariableDeclarationList(n)){for(var i=0,a=n.declarations;i<a.length;i++){var s=a[i];v(s.name);}r=p.updateForInStatement(r,n.declarations[0].name,e.visitNode(r.expression,B,e.isExpression),e.visitNode(r.statement,B,e.isStatement,p.liftToBlock));}else r=e.visitEachChild(r,B,t);return o&&ce(),r}(r);case 245:return function(r){if(o){var n=ge(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 244:return function(r){if(o){var n=me(r.label&&e.idText(r.label));if(n>0)return he(n,r)}return e.visitEachChild(r,B,t)}(r);case 246:return function(t){return r=e.visitNode(t.expression,B,e.isExpression),n=t,e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(r?[ve(2),r]:[ve(2)])),n);var r,n;}(r);default:return 524288&r.transformFlags?function(r){switch(r.kind){case 220:return function(r){var n=e.getExpressionAssociativity(r);switch(n){case 0:return function(r){return X(r.right)?e.isLogicalOperator(r.operatorToken.kind)?function(t){var r=ee(),n=$();return De(n,e.visitNode(t.left,B,e.isExpression),t.left),55===t.operatorToken.kind?Ce(r,n,t.left):Te(r,n,t.left),De(n,e.visitNode(t.right,B,e.isExpression),t.right),te(r),n}(r):27===r.operatorToken.kind?K(r):p.updateBinaryExpression(r,Z(e.visitNode(r.left,B,e.isExpression)),r.operatorToken,e.visitNode(r.right,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 1:return function(r){var n=r.left,i=r.right;if(X(i)){var a=void 0;switch(n.kind){case 205:a=p.updatePropertyAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),n.name);break;case 206:a=p.updateElementAccessExpression(n,Z(e.visitNode(n.expression,B,e.isLeftHandSideExpression)),Z(e.visitNode(n.argumentExpression,B,e.isExpression)));break;default:a=e.visitNode(n,B,e.isExpression);}var o=r.operatorToken.kind;return e.isCompoundAssignment(o)?e.setTextRange(p.createAssignment(a,e.setTextRange(p.createBinaryExpression(Z(a),e.getNonAssignmentOperatorForCompoundAssignment(o),e.visitNode(i,B,e.isExpression)),r)),r):p.updateBinaryExpression(r,a,r.operatorToken,e.visitNode(i,B,e.isExpression))}return e.visitEachChild(r,B,t)}(r);default:return e.Debug.assertNever(n)}}(r);case 349:return function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];e.isBinaryExpression(a)&&27===a.operatorToken.kind?r.push(K(a)):(X(a)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(a,B,e.isExpression)));}return p.inlineExpressions(r)}(r);case 221:return function(r){if(X(r.whenTrue)||X(r.whenFalse)){var n=ee(),i=ee(),a=$();return Ce(n,e.visitNode(r.condition,B,e.isExpression),r.condition),De(a,e.visitNode(r.whenTrue,B,e.isExpression),r.whenTrue),Se(i),te(n),De(a,e.visitNode(r.whenFalse,B,e.isExpression),r.whenFalse),te(i),a}return e.visitEachChild(r,B,t)}(r);case 223:return function(t){var r,n=ee(),i=e.visitNode(t.expression,B,e.isExpression);return t.asteriskToken?function(e,t){Ee(7,[e],t);}(0==(8388608&e.getEmitFlags(t.expression))?e.setTextRange(f().createValuesHelper(i),t):i,t):function(e,t){Ee(6,[e],t);}(i,t),te(n),r=t,e.setTextRange(p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[]),r)}(r);case 203:return function(e){return V(e.elements,void 0,void 0,e.multiLine)}(r);case 204:return function(t){var r=t.properties,n=t.multiLine,i=Y(r),a=$();De(a,p.createObjectLiteralExpression(e.visitNodes(r,B,e.isObjectLiteralElementLike,0,i),n));var o=e.reduceLeft(r,(function(r,i){X(i)&&r.length>0&&(xe(p.createExpressionStatement(p.inlineExpressions(r))),r=[]);var o=e.createExpressionForObjectLiteralElementLike(p,t,i,a),s=e.visitNode(o,B,e.isExpression);return s&&(n&&e.startOnNewLine(s),r.push(s)),r}),[],i);return o.push(n?e.startOnNewLine(e.setParent(e.setTextRange(p.cloneNode(a),a),a.parent)):a),p.inlineExpressions(o)}(r);case 206:return function(r){return X(r.argumentExpression)?p.updateElementAccessExpression(r,Z(e.visitNode(r.expression,B,e.isLeftHandSideExpression)),e.visitNode(r.argumentExpression,B,e.isExpression)):e.visitEachChild(r,B,t)}(r);case 207:return function(r){if(!e.isImportCall(r)&&e.forEach(r.arguments,X)){var n=p.createCallBinding(r.expression,v,b,!0),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isLeftHandSideExpression)),a,V(r.arguments)),r),r)}return e.visitEachChild(r,B,t)}(r);case 208:return function(r){if(e.forEach(r.arguments,X)){var n=p.createCallBinding(p.createPropertyAccessExpression(r.expression,"bind"),v),i=n.target,a=n.thisArg;return e.setOriginalNode(e.setTextRange(p.createNewExpression(p.createFunctionApplyCall(Z(e.visitNode(i,B,e.isExpression)),a,V(r.arguments,p.createVoidZero())),void 0,[]),r),r)}return e.visitEachChild(r,B,t)}(r);default:return e.visitEachChild(r,B,t)}}(r):2098176&r.transformFlags?e.visitEachChild(r,B,t):r}}function J(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionDeclaration(void 0,r.modifiers,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return a?void y(r):r}function z(r){if(r.asteriskToken)r=e.setOriginalNode(e.setTextRange(p.createFunctionExpression(void 0,void 0,r.name,void 0,e.visitParameterList(r.parameters,B,t),void 0,U(r.body)),r),r);else {var n=a,i=o;a=!1,o=!1,r=e.visitEachChild(r,B,t),a=n,o=i;}return r}function U(t){var r=[],n=a,i=o,f=s,y=c,v=l,h=u,b=_,x=d,D=M,k=S,N=T,F=C,A=E;a=!0,o=!1,s=void 0,c=void 0,l=void 0,u=void 0,_=void 0,d=void 0,M=1,S=void 0,T=void 0,C=void 0,E=p.createTempVariable(void 0),g();var P=p.copyPrologue(t.statements,r,!1,B);q(t.statements,P);var w=ke();return e.insertStatementsAfterStandardPrologue(r,m()),r.push(p.createReturnStatement(w)),a=n,o=i,s=f,c=y,l=v,u=h,_=b,d=x,M=D,S=k,T=N,C=F,E=A,e.setTextRange(p.createBlock(r,t.multiLine),t)}function K(t){var r=[];return n(t.left),n(t.right),p.inlineExpressions(r);function n(t){e.isBinaryExpression(t)&&27===t.operatorToken.kind?(n(t.left),n(t.right)):(X(t)&&r.length>0&&(Ee(1,[p.createExpressionStatement(p.inlineExpressions(r))]),r=[]),r.push(e.visitNode(t,B,e.isExpression)));}}function V(t,r,i,a){var o,s=Y(t);if(s>0){o=$();var c=e.visitNodes(t,B,e.isExpression,0,s);De(o,p.createArrayLiteralExpression(r?n$3([r],c,!0):c)),r=void 0;}var l=e.reduceLeft(t,(function(t,i){if(X(i)&&t.length>0){var s=void 0!==o;o||(o=$()),De(o,s?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(t,a)]):p.createArrayLiteralExpression(r?n$3([r],t,!0):t,a)),r=void 0,t=[];}return t.push(e.visitNode(i,B,e.isExpression)),t}),[],s);return o?p.createArrayConcatCall(o,[p.createArrayLiteralExpression(l,a)]):e.setTextRange(p.createArrayLiteralExpression(r?n$3([r],l,!0):l,a),i)}function q(e,t){void 0===t&&(t=0);for(var r=e.length,n=t;n<r;n++)H(e[n]);}function W(t){e.isBlock(t)?q(t.statements):H(t);}function H(n){var a=o;o||(o=X(n)),function(n){switch(n.kind){case 234:return function(t){X(t)?q(t.statements):xe(e.visitNode(t,B,e.isStatement));}(n);case 237:return function(t){xe(e.visitNode(t,B,e.isStatement));}(n);case 238:return function(t){if(X(t))if(X(t.thenStatement)||X(t.elseStatement)){var r=ee(),n=t.elseStatement?ee():void 0;Ce(t.elseStatement?n:r,e.visitNode(t.expression,B,e.isExpression),t.expression),W(t.thenStatement),t.elseStatement&&(Se(r),te(n),W(t.elseStatement)),te(r);}else xe(e.visitNode(t,B,e.isStatement));else xe(e.visitNode(t,B,e.isStatement));}(n);case 239:return function(t){if(X(t)){var r=ee(),n=ee();se(r),te(n),W(t.statement),te(r),Te(n,e.visitNode(t.expression,B,e.isExpression)),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 240:return function(t){if(X(t)){var r=ee(),n=se(r);te(r),Ce(n,e.visitNode(t.expression,B,e.isExpression)),W(t.statement),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 241:return function(t){if(X(t)){var r=ee(),n=ee(),i=se(n);if(t.initializer){var a=t.initializer;e.isVariableDeclarationList(a)?G(a):xe(e.setTextRange(p.createExpressionStatement(e.visitNode(a,B,e.isExpression)),a));}te(r),t.condition&&Ce(i,e.visitNode(t.condition,B,e.isExpression)),W(t.statement),te(n),t.incrementor&&xe(e.setTextRange(p.createExpressionStatement(e.visitNode(t.incrementor,B,e.isExpression)),t.incrementor)),Se(r),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 242:return function(t){if(X(t)){var r=$(),n=$(),i=p.createLoopVariable(),a=t.initializer;v(i),De(r,p.createArrayLiteralExpression()),xe(p.createForInStatement(n,e.visitNode(t.expression,B,e.isExpression),p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(r,"push"),void 0,[n])))),De(i,p.createNumericLiteral(0));var o=ee(),s=ee(),c=se(s);te(o),Ce(c,p.createLessThan(i,p.createPropertyAccessExpression(r,"length")));var l=void 0;if(e.isVariableDeclarationList(a)){for(var u=0,_=a.declarations;u<_.length;u++){var d=_[u];v(d.name);}l=p.cloneNode(a.declarations[0].name);}else l=e.visitNode(a,B,e.isExpression),e.Debug.assert(e.isLeftHandSideExpression(l));De(l,p.createElementAccessExpression(r,i)),W(t.statement),te(s),xe(p.createExpressionStatement(p.createPostfixIncrement(i))),Se(o),ce();}else xe(e.visitNode(t,B,e.isStatement));}(n);case 244:return function(t){var r=me(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 245:return function(t){var r=ge(t.label?e.idText(t.label):void 0);r>0?Se(r,t):xe(t);}(n);case 246:return function(t){Ee(8,[e.visitNode(t.expression,B,e.isExpression)],t);}(n);case 247:return function(t){var r,n,i;X(t)?(r=Z(e.visitNode(t.expression,B,e.isExpression)),n=ee(),i=ee(),te(n),re({kind:1,expression:r,startLabel:n,endLabel:i}),W(t.statement),e.Debug.assert(1===ae()),te(ne().endLabel)):xe(e.visitNode(t,B,e.isStatement));}(n);case 248:return function(t){if(X(t.caseBlock)){for(var r=t.caseBlock,n=r.clauses.length,i=(re({kind:2,isScript:!1,breakLabel:f=ee()}),f),a=Z(e.visitNode(t.expression,B,e.isExpression)),o=[],s=-1,c=0;c<n;c++){var l=r.clauses[c];o.push(ee()),289===l.kind&&-1===s&&(s=c);}for(var u=0,_=[];u<n;){var d=0;for(c=u;c<n;c++)if(288===(l=r.clauses[c]).kind){if(X(l.expression)&&_.length>0)break;_.push(p.createCaseClause(e.visitNode(l.expression,B,e.isExpression),[he(o[c],l.expression)]));}else d++;_.length&&(xe(p.createSwitchStatement(a,p.createCaseBlock(_))),u+=_.length,_=[]),d>0&&(u+=d,d=0);}for(Se(s>=0?o[s]:i),c=0;c<n;c++)te(o[c]),q(r.clauses[c].statements);le();}else xe(e.visitNode(t,B,e.isStatement));var f;}(n);case 249:return function(t){X(t)?(re({kind:4,isScript:!1,labelText:e.idText(t.label),breakLabel:ee()}),W(t.statement),ue()):xe(e.visitNode(t,B,e.isStatement));}(n);case 250:return function(t){var r;Ee(9,[e.visitNode(null!==(r=t.expression)&&void 0!==r?r:p.createVoidZero(),B,e.isExpression)],t);}(n);case 251:return function(n){var a,o;X(n)?(a=ee(),o=ee(),te(a),re({kind:0,state:0,startLabel:a,endLabel:o}),be(),W(n.tryBlock),n.catchClause&&(function(n){var a;if(e.Debug.assert(0===ae()),e.isGeneratedIdentifier(n.name))a=n.name,v(n.name);else {var o=e.idText(n.name);a=$(o),r||(r=new e.Map,i=[],t.enableSubstitution(79)),r.set(o,!0),i[e.getOriginalNodeId(n)]=a;}var s=ie();e.Debug.assert(s.state<1),Se(s.endLabel);var c=ee();te(c),s.state=1,s.catchVariable=a,s.catchLabel=c,De(a,p.createCallExpression(p.createPropertyAccessExpression(E,"sent"),void 0,[])),be();}(n.catchClause.variableDeclaration),W(n.catchClause.block)),n.finallyBlock&&(function(){e.Debug.assert(0===ae());var t=ie();e.Debug.assert(t.state<2),Se(t.endLabel);var r=ee();te(r),t.state=2,t.finallyLabel=r;}(),W(n.finallyBlock)),function(){e.Debug.assert(0===ae());var t=ne();t.state<2?Se(t.endLabel):Ee(10),te(t.endLabel),be(),t.state=3;}()):xe(e.visitEachChild(n,B,t));}(n);default:xe(e.visitNode(n,B,e.isStatement));}}(n),o=a;}function G(t){for(var r=0,n=t.declarations;r<n.length;r++){var i=n[r],a=p.cloneNode(i.name);e.setCommentRange(a,i.name),v(a);}for(var o=e.getInitializedVariables(t),s=o.length,c=0,l=[];c<s;){for(var u=c;u<s&&!(X((i=o[u]).initializer)&&l.length>0);u++)l.push(Q(i));l.length&&(xe(p.createExpressionStatement(p.inlineExpressions(l))),c+=l.length,l=[]);}}function Q(t){return e.setSourceMapRange(p.createAssignment(e.setSourceMapRange(p.cloneNode(t.name),t.name),e.visitNode(t.initializer,B,e.isExpression)),t)}function X(e){return !!e&&0!=(524288&e.transformFlags)}function Y(e){for(var t=e.length,r=0;r<t;r++)if(X(e[r]))return r;return -1}function Z(t){if(e.isGeneratedIdentifier(t)||4096&e.getEmitFlags(t))return t;var r=p.createTempVariable(v);return De(r,t,t),r}function $(e){var t=e?p.createUniqueName(e):p.createTempVariable(void 0);return v(t),t}function ee(){_||(_=[]);var e=M;return M++,_[e]=-1,e}function te(t){e.Debug.assert(void 0!==_,"No labels were defined."),_[t]=S?S.length:0;}function re(e){s||(s=[],l=[],c=[],u=[]);var t=l.length;return l[t]=0,c[t]=S?S.length:0,s[t]=e,u.push(e),t}function ne(){var t=ie();if(void 0===t)return e.Debug.fail("beginBlock was never called.");var r=l.length;return l[r]=1,c[r]=S?S.length:0,s[r]=t,u.pop(),t}function ie(){return e.lastOrUndefined(u)}function ae(){var e=ie();return e&&e.kind}function oe(){re({kind:3,isScript:!0,breakLabel:-1,continueLabel:-1});}function se(e){var t=ee();return re({kind:3,isScript:!1,breakLabel:t,continueLabel:e}),t}function ce(){e.Debug.assert(3===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function le(){e.Debug.assert(2===ae());var t=ne(),r=t.breakLabel;t.isScript||te(r);}function ue(){e.Debug.assert(4===ae());var t=ne();t.isScript||te(t.breakLabel);}function _e(e){return 2===e.kind||3===e.kind}function de(e){return 4===e.kind}function pe(e){return 3===e.kind}function fe(e,t){for(var r=t;r>=0;r--){var n=u[r];if(!de(n))break;if(n.labelText===e)return !0}return !1}function ge(e){if(u)if(e)for(var t=u.length-1;t>=0;t--){if(de(r=u[t])&&r.labelText===e)return r.breakLabel;if(_e(r)&&fe(e,t-1))return r.breakLabel}else for(t=u.length-1;t>=0;t--){var r;if(_e(r=u[t]))return r.breakLabel}return 0}function me(e){if(u)if(e){for(var t=u.length-1;t>=0;t--)if(pe(r=u[t])&&fe(e,t-1))return r.continueLabel}else for(t=u.length-1;t>=0;t--){var r;if(pe(r=u[t]))return r.continueLabel}return 0}function ye(e){if(void 0!==e&&e>0){void 0===d&&(d=[]);var t=p.createNumericLiteral(-1);return void 0===d[e]?d[e]=[t]:d[e].push(t),t}return p.createOmittedExpression()}function ve(t){var r=p.createNumericLiteral(t);return e.addSyntheticTrailingComment(r,3,function(e){switch(e){case 2:return "return";case 3:return "break";case 4:return "yield";case 5:return "yield*";case 7:return "endfinally";default:return}}(t)),r}function he(t,r){return e.Debug.assertLessThan(0,t,"Invalid label"),e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r)}function be(){Ee(0);}function xe(e){e?Ee(1,[e]):be();}function De(e,t,r){Ee(2,[e,t],r);}function Se(e,t){Ee(3,[e],t);}function Te(e,t,r){Ee(4,[e,t],r);}function Ce(e,t,r){Ee(5,[e,t],r);}function Ee(e,t,r){void 0===S&&(S=[],T=[],C=[]),void 0===_&&te(ee());var n=S.length;S[n]=e,T[n]=t,C[n]=r;}function ke(){L=0,R=0,k=void 0,N=!1,F=!1,A=void 0,P=void 0,w=void 0,I=void 0,O=void 0;var t=function(){if(S){for(var t=0;t<S.length;t++)Pe(t);Ne(S.length);}else Ne(0);if(A){var r=p.createPropertyAccessExpression(E,"label"),n=p.createSwitchStatement(r,p.createCaseBlock(A));return [e.startOnNewLine(n)]}return P||[]}();return f().createGeneratorHelper(e.setEmitFlags(p.createFunctionExpression(void 0,void 0,void 0,void 0,[p.createParameterDeclaration(void 0,void 0,void 0,E)],void 0,p.createBlock(t,t.length>0)),524288))}function Ne(e){(function(e){if(!F)return !0;if(!_||!d)return !1;for(var t=0;t<_.length;t++)if(_[t]===e&&d[t])return !0;return !1})(e)&&(Ae(e),O=void 0,Ie(void 0,void 0)),P&&A&&Fe(!1),function(){if(void 0!==d&&void 0!==k)for(var e=0;e<k.length;e++){var t=k[e];if(void 0!==t)for(var r=0,n=t;r<n.length;r++){var i=n[r],a=d[i];if(void 0!==a)for(var o=0,s=a;o<s.length;o++)s[o].text=String(e);}}}();}function Fe(e){if(A||(A=[]),P){if(O)for(var t=O.length-1;t>=0;t--){var r=O[t];P=[p.createWithStatement(r.expression,p.createBlock(P))];}if(I){var n=I.startLabel,i=I.catchLabel,a=I.finallyLabel,o=I.endLabel;P.unshift(p.createExpressionStatement(p.createCallExpression(p.createPropertyAccessExpression(p.createPropertyAccessExpression(E,"trys"),"push"),void 0,[p.createArrayLiteralExpression([ye(n),ye(i),ye(a),ye(o)])]))),I=void 0;}e&&P.push(p.createExpressionStatement(p.createAssignment(p.createPropertyAccessExpression(E,"label"),p.createNumericLiteral(R+1))));}A.push(p.createCaseClause(p.createNumericLiteral(R),P||[])),P=void 0;}function Ae(e){if(_)for(var t=0;t<_.length;t++)_[t]===e&&(P&&(Fe(!N),N=!1,F=!1,R++),void 0===k&&(k=[]),void 0===k[R]?k[R]=[t]:k[R].push(t));}function Pe(t){if(Ae(t),function(e){if(s)for(;L<l.length&&c[L]<=e;L++){var t=s[L],r=l[L];switch(t.kind){case 0:0===r?(w||(w=[]),P||(P=[]),w.push(I),I=t):1===r&&(I=w.pop());break;case 1:0===r?(O||(O=[]),O.push(t)):1===r&&O.pop();}}}(t),!N){N=!1,F=!1;var r=S[t];if(0!==r){if(10===r)return N=!0,void we(p.createReturnStatement(p.createArrayLiteralExpression([ve(7)])));var n=T[t];if(1===r)return we(n[0]);var i,a,o,u=C[t];switch(r){case 2:return i=n[0],a=n[1],o=u,void we(e.setTextRange(p.createExpressionStatement(p.createAssignment(i,a)),o));case 3:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),r),384));}(n[0],u);case 4:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(r,e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 5:return function(t,r,n){we(e.setEmitFlags(p.createIfStatement(p.createLogicalNot(r),e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(3),ye(t)])),n),384)),1));}(n[0],n[1],u);case 6:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(4),t]:[ve(4)])),r),384));}(n[0],u);case 7:return function(t,r){N=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression([ve(5),t])),r),384));}(n[0],u);case 8:return Ie(n[0],u);case 9:return function(t,r){N=!0,F=!0,we(e.setTextRange(p.createThrowStatement(t),r));}(n[0],u)}}}}function we(e){e&&(P?P.push(e):P=[e]);}function Ie(t,r){N=!0,F=!0,we(e.setEmitFlags(e.setTextRange(p.createReturnStatement(p.createArrayLiteralExpression(t?[ve(2),t]:[ve(2)])),r),384));}};}(t),function(e){e.transformModule=function(r){var i=r.factory,a=r.getEmitHelperFactory,o=r.startLexicalEnvironment,s=r.endLexicalEnvironment,c=r.hoistVariableDeclaration,l=r.getCompilerOptions(),u=r.getEmitResolver(),_=r.getEmitHost(),d=e.getEmitScriptTarget(l),p=e.getEmitModuleKind(l),f=r.onSubstituteNode,g=r.onEmitNode;r.onSubstituteNode=function(t,r){return (r=f(t,r)).id&&x[r.id]?r:1===t?function(t){switch(t.kind){case 79:return Z(t);case 207:return function(t){if(e.isIdentifier(t.expression)){var r=Z(t.expression);if(x[e.getNodeId(r)]=!0,!e.isIdentifier(r))return e.addEmitFlags(i.updateCallExpression(t,r,void 0,t.arguments),536870912)}return t}(t);case 209:return function(t){if(e.isIdentifier(t.tag)){var r=Z(t.tag);if(x[e.getNodeId(r)]=!0,!e.isIdentifier(r))return e.addEmitFlags(i.updateTaggedTemplateExpression(t,r,void 0,t.template),536870912)}return t}(t);case 220:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=$(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++){var o=a[i];x[e.getNodeId(n)]=!0,n=X(o,n,t);}return n}}return t}(t)}return t}(r):e.isShorthandPropertyAssignment(r)?function(t){var r=t.name,n=Z(r);if(n!==r){if(t.objectAssignmentInitializer){var a=i.createAssignment(n,t.objectAssignmentInitializer);return e.setTextRange(i.createPropertyAssignment(r,a),t)}return e.setTextRange(i.createPropertyAssignment(r,n),t)}return t}(r):r},r.onEmitNode=function(t,r,n){303===r.kind?(m=r,y=h[e.getOriginalNodeId(m)],g(t,r,n),m=void 0,y=void 0):g(t,r,n);},r.enableSubstitution(207),r.enableSubstitution(209),r.enableSubstitution(79),r.enableSubstitution(220),r.enableSubstitution(295),r.enableEmitNotification(303);var m,y,v,h=[],b=[],x=[];return e.chainBundle(r,(function(t){if(t.isDeclarationFile||!(e.isEffectiveExternalModule(t,l)||4194304&t.transformFlags||e.isJsonSourceFile(t)&&e.hasJsonModuleEmitEnabled(l)&&e.outFile(l)))return t;m=t,y=e.collectExternalModuleInfo(r,t,u,l),h[e.getOriginalNodeId(t)]=y;var n=function(t){switch(t){case e.ModuleKind.AMD:return T;case e.ModuleKind.UMD:return C;default:return S}}(p)(t);return m=void 0,y=void 0,v=!1,n}));function D(){return !(y.exportEquals||!e.isExternalModule(m))}function S(t){o();var n=[],a=e.getStrictOptionValue(l,"alwaysStrict")||!l.noImplicitUseStrict&&e.isExternalModule(m),c=i.copyPrologue(t.statements,n,a&&!e.isJsonSourceFile(t),A);if(D()&&e.append(n,Q()),e.length(y.exportedNames))for(var u=0;u<y.exportedNames.length;u+=50)e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames.slice(u,u+50),(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero())));e.append(n,e.visitNode(y.externalHelpersImportDeclaration,A,e.isStatement)),e.addRange(n,e.visitNodes(t.statements,A,e.isStatement,c)),F(n,!1),e.insertStatementsAfterStandardPrologue(n,s());var _=i.updateSourceFile(t,e.setTextRange(i.createNodeArray(n),t.statements));return e.addEmitHelpers(_,r.readEmitHelpers()),_}function T(t){var a=i.createIdentifier("define"),o=e.tryGetModuleNameFromFile(i,t,_,l),s=e.isJsonSourceFile(t)&&t,c=E(t,!0),u=c.aliasedModuleNames,d=c.unaliasedModuleNames,p=c.importAliasNames,f=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(a,void 0,n$3(n$3([],o?[o]:[],!0),[i.createArrayLiteralExpression(s?e.emptyArray:n$3(n$3([i.createStringLiteral("require"),i.createStringLiteral("exports")],u,!0),d,!0)),s?s.statements.length?s.statements[0].expression:i.createObjectLiteralExpression():i.createFunctionExpression(void 0,void 0,void 0,void 0,n$3([i.createParameterDeclaration(void 0,void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,void 0,"exports")],p,!0),void 0,N(t))],!1)))]),t.statements));return e.addEmitHelpers(f,r.readEmitHelpers()),f}function C(t){var a=E(t,!1),o=a.aliasedModuleNames,s=a.unaliasedModuleNames,c=a.importAliasNames,u=e.tryGetModuleNameFromFile(i,t,_,l),d=i.createFunctionExpression(void 0,void 0,void 0,void 0,[i.createParameterDeclaration(void 0,void 0,void 0,"factory")],void 0,e.setTextRange(i.createBlock([i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("module"),"object"),i.createTypeCheck(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),"object")),i.createBlock([i.createVariableStatement(void 0,[i.createVariableDeclaration("v",void 0,void 0,i.createCallExpression(i.createIdentifier("factory"),void 0,[i.createIdentifier("require"),i.createIdentifier("exports")]))]),e.setEmitFlags(i.createIfStatement(i.createStrictInequality(i.createIdentifier("v"),i.createIdentifier("undefined")),i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),i.createIdentifier("v")))),1)]),i.createIfStatement(i.createLogicalAnd(i.createTypeCheck(i.createIdentifier("define"),"function"),i.createPropertyAccessExpression(i.createIdentifier("define"),"amd")),i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("define"),void 0,n$3(n$3([],u?[u]:[],!0),[i.createArrayLiteralExpression(n$3(n$3([i.createStringLiteral("require"),i.createStringLiteral("exports")],o,!0),s,!0)),i.createIdentifier("factory")],!1)))])))],!0),void 0)),p=i.updateSourceFile(t,e.setTextRange(i.createNodeArray([i.createExpressionStatement(i.createCallExpression(d,void 0,[i.createFunctionExpression(void 0,void 0,void 0,void 0,n$3([i.createParameterDeclaration(void 0,void 0,void 0,"require"),i.createParameterDeclaration(void 0,void 0,void 0,"exports")],c,!0),void 0,N(t))]))]),t.statements));return e.addEmitHelpers(p,r.readEmitHelpers()),p}function E(t,r){for(var n=[],a=[],o=[],s=0,c=t.amdDependencies;s<c.length;s++){var d=c[s];d.name?(n.push(i.createStringLiteral(d.path)),o.push(i.createParameterDeclaration(void 0,void 0,void 0,d.name))):a.push(i.createStringLiteral(d.path));}for(var p=0,f=y.externalImports;p<f.length;p++){var g=f[p],v=e.getExternalModuleNameLiteral(i,g,m,_,u,l),h=e.getLocalNameForExternalImport(i,g,m);v&&(r&&h?(e.setEmitFlags(h,4),n.push(v),o.push(i.createParameterDeclaration(void 0,void 0,void 0,h))):a.push(v));}return {aliasedModuleNames:n,unaliasedModuleNames:a,importAliasNames:o}}function k(t){if(!e.isImportEqualsDeclaration(t)&&!e.isExportDeclaration(t)&&e.getExternalModuleNameLiteral(i,t,m,_,u,l)){var r=e.getLocalNameForExternalImport(i,t,m),n=R(t,r);if(n!==r)return i.createExpressionStatement(i.createAssignment(r,n))}}function N(r){o();var n=[],a=i.copyPrologue(r.statements,n,!l.noImplicitUseStrict,A);D()&&e.append(n,Q()),e.length(y.exportedNames)&&e.append(n,i.createExpressionStatement(e.reduceLeft(y.exportedNames,(function(t,r){return i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.createIdentifier(e.idText(r))),t)}),i.createVoidZero()))),e.append(n,e.visitNode(y.externalHelpersImportDeclaration,A,e.isStatement)),p===e.ModuleKind.AMD&&e.addRange(n,e.mapDefined(y.externalImports,k)),e.addRange(n,e.visitNodes(r.statements,A,e.isStatement,a)),F(n,!0),e.insertStatementsAfterStandardPrologue(n,s());var c=i.createBlock(n,!0);return v&&e.addEmitHelper(c,t),c}function F(t,r){if(y.exportEquals){var n=e.visitNode(y.exportEquals.expression,w);if(n)if(r){var a=i.createReturnStatement(n);e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1920),t.push(a);}else a=i.createExpressionStatement(i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("module"),"exports"),n)),e.setTextRange(a,y.exportEquals),e.setEmitFlags(a,1536),t.push(a);}}function A(t){switch(t.kind){case 265:return function(t){var r,n=e.getNamespaceDeclarationNode(t);if(p!==e.ModuleKind.AMD){if(!t.importClause)return e.setOriginalNode(e.setTextRange(i.createExpressionStatement(B(t)),t),t);var a=[];n&&!e.isDefaultImport(t)?a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,R(t,B(t)))):(a.push(i.createVariableDeclaration(i.getGeneratedNameForNode(t),void 0,void 0,R(t,B(t)))),n&&e.isDefaultImport(t)&&a.push(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)))),r=e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList(a,d>=2?2:0)),t),t));}else n&&e.isDefaultImport(t)&&(r=e.append(r,i.createVariableStatement(void 0,i.createVariableDeclarationList([e.setOriginalNode(e.setTextRange(i.createVariableDeclaration(i.cloneNode(n.name),void 0,void 0,i.getGeneratedNameForNode(t)),t),t)],d>=2?2:0))));if(z(t)){var o=e.getOriginalNodeId(t);b[o]=U(b[o],t);}else r=U(r,t);return e.singleOrMany(r)}(t);case 264:return function(t){var r;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),p!==e.ModuleKind.AMD?r=e.hasSyntacticModifier(t,1)?e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(t.name,B(t))),t),t)):e.append(r,e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(i.cloneNode(t.name),void 0,void 0,B(t))],d>=2?2:0)),t),t)):e.hasSyntacticModifier(t,1)&&(r=e.append(r,e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(t),i.getLocalName(t))),t),t))),z(t)){var n=e.getOriginalNodeId(t);b[n]=K(b[n],t);}else r=K(r,t);return e.singleOrMany(r)}(t);case 271:return function(t){if(t.moduleSpecifier){var r=i.getGeneratedNameForNode(t);if(t.exportClause&&e.isNamedExports(t.exportClause)){var n=[];p!==e.ModuleKind.AMD&&n.push(e.setOriginalNode(e.setTextRange(i.createVariableStatement(void 0,i.createVariableDeclarationList([i.createVariableDeclaration(r,void 0,void 0,B(t))])),t),t));for(var o=0,s=t.exportClause.elements;o<s.length;o++){var c=s[o];if(0===d)n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createCreateBindingHelper(r,i.createStringLiteralFromNode(c.propertyName||c.name),c.propertyName?i.createStringLiteralFromNode(c.name):void 0)),c),c));else {var u=!(!e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)||"default"!==e.idText(c.propertyName||c.name)),_=i.createPropertyAccessExpression(u?a().createImportDefaultHelper(r):r,c.propertyName||c.name);n.push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.getExportName(c),_,void 0,!0)),c),c));}}return e.singleOrMany(n)}return t.exportClause?((n=[]).push(e.setOriginalNode(e.setTextRange(i.createExpressionStatement(X(i.cloneNode(t.exportClause.name),function(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getExportNeedsImportStarHelper(t)?a().createImportStarHelper(r):r}(t,p!==e.ModuleKind.AMD?B(t):e.isExportNamespaceAsDefaultDeclaration(t)?r:i.createIdentifier(e.idText(t.exportClause.name))))),t),t)),e.singleOrMany(n)):e.setOriginalNode(e.setTextRange(i.createExpressionStatement(a().createExportStarHelper(p!==e.ModuleKind.AMD?B(t):r)),t),t)}}(t);case 270:return function(t){if(!t.isExportEquals){var r,n=t.original;if(n&&z(n)){var a=e.getOriginalNodeId(t);b[a]=G(b[a],i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);}else r=G(r,i.createIdentifier("default"),e.visitNode(t.expression,w),t,!0);return e.singleOrMany(r)}}(t);case 236:return function(t){var n,a,o;if(e.hasSyntacticModifier(t,1)){for(var s=void 0,c=!1,l=0,u=t.declarationList.declarations;l<u.length;l++){var _=u[l];if(e.isIdentifier(_.name)&&e.isLocalName(_.name))s||(s=e.visitNodes(t.modifiers,Y,e.isModifier)),a=e.append(a,_);else if(_.initializer)if(!e.isBindingPattern(_.name)&&(e.isArrowFunction(_.initializer)||e.isFunctionExpression(_.initializer)||e.isClassExpression(_.initializer))){var d=i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),_.name),_.name),i.createIdentifier(e.getTextOfIdentifierOrLiteral(_.name))),p=i.createVariableDeclaration(_.name,_.exclamationToken,_.type,e.visitNode(_.initializer,w));a=e.append(a,p),o=e.append(o,d),c=!0;}else o=e.append(o,J(_));}if(a&&(n=e.append(n,i.updateVariableStatement(t,s,i.updateVariableDeclarationList(t.declarationList,a)))),o){var f=e.setOriginalNode(e.setTextRange(i.createExpressionStatement(i.inlineExpressions(o)),t),t);c&&e.removeAllComments(f),n=e.append(n,f);}}else n=e.append(n,e.visitEachChild(t,w,r));if(z(t)){var g=e.getOriginalNodeId(t);b[g]=V(b[g],t);}else n=V(n,t);return e.singleOrMany(n)}(t);case 255:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createFunctionDeclaration(void 0,e.visitNodes(t.modifiers,Y,e.isModifier),t.asteriskToken,i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.parameters,w),void 0,e.visitEachChild(t.body,w,r)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 256:return function(t){var n;if(n=e.hasSyntacticModifier(t,1)?e.append(n,e.setOriginalNode(e.setTextRange(i.createClassDeclaration(void 0,e.visitNodes(t.modifiers,Y,e.isModifier),i.getDeclarationName(t,!0,!0),void 0,e.visitNodes(t.heritageClauses,w),e.visitNodes(t.members,w)),t),t)):e.append(n,e.visitEachChild(t,w,r)),z(t)){var a=e.getOriginalNodeId(t);b[a]=W(b[a],t);}else n=W(n,t);return e.singleOrMany(n)}(t);case 350:return function(t){if(z(t)&&236===t.original.kind){var r=e.getOriginalNodeId(t);b[r]=V(b[r],t.original);}return t}(t);case 351:return function(t){var r=e.getOriginalNodeId(t),n=b[r];return n?(delete b[r],e.append(n,t)):t}(t);default:return w(t)}}function P(t,n){if(!(71305216&t.transformFlags))return t;switch(t.kind){case 241:return function(t){return i.updateForStatement(t,e.visitNode(t.initializer,I,e.isForInitializer),e.visitNode(t.condition,w,e.isExpression),e.visitNode(t.incrementor,I,e.isExpression),e.visitIterationBody(t.statement,w,r))}(t);case 237:return function(t){return i.updateExpressionStatement(t,e.visitNode(t.expression,I,e.isExpression))}(t);case 211:return function(t,r){return i.updateParenthesizedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 348:return function(t,r){return i.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,r?I:w,e.isExpression))}(t,n);case 207:if(e.isImportCall(t)&&void 0===m.impliedNodeFormat)return function(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=e.visitNode(e.firstOrUndefined(t.arguments),w),a=!r||n&&e.isStringLiteral(n)&&n.text===r.text?n:r,o=!!(8192&t.transformFlags);switch(l.module){case e.ModuleKind.AMD:return M(a,o);case e.ModuleKind.UMD:return function(t,r){if(v=!0,e.isSimpleCopiableExpression(t)){var n=e.isGeneratedIdentifier(t)?t:e.isStringLiteral(t)?i.createStringLiteralFromNode(t):e.setEmitFlags(e.setTextRange(i.cloneNode(t),t),1536);return i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(t,r),void 0,M(n,r))}var a=i.createTempVariable(c);return i.createComma(i.createAssignment(a,t),i.createConditionalExpression(i.createIdentifier("__syncRequire"),void 0,L(a,r),void 0,M(a,r)))}(null!=a?a:i.createVoidZero(),o);case e.ModuleKind.CommonJS:default:return L(a,o)}}(t);break;case 220:if(e.isDestructuringAssignment(t))return function(t,n){return O(t.left)?e.flattenDestructuringAssignment(t,w,r,0,!n,j):e.visitEachChild(t,w,r)}(t,n);break;case 218:case 219:return function(t,n){if((45===t.operator||46===t.operator)&&e.isIdentifier(t.operand)&&!e.isGeneratedIdentifier(t.operand)&&!e.isLocalName(t.operand)&&!e.isDeclarationNameOfEnumOrNamespace(t.operand)){var a=$(t.operand);if(a){var o=void 0,s=e.visitNode(t.operand,w,e.isExpression);e.isPrefixUnaryExpression(t)?s=i.updatePrefixUnaryExpression(t,s):(s=i.updatePostfixUnaryExpression(t,s),n||(o=i.createTempVariable(c),s=i.createAssignment(o,s),e.setTextRange(s,t)),s=i.createComma(s,i.cloneNode(t.operand)),e.setTextRange(s,t));for(var l=0,u=a;l<u.length;l++){var _=u[l];x[e.getNodeId(s)]=!0,s=X(_,s),e.setTextRange(s,t);}return o&&(x[e.getNodeId(s)]=!0,s=i.createComma(s,o),e.setTextRange(s,t)),s}}return e.visitEachChild(t,w,r)}(t,n)}return e.visitEachChild(t,w,r)}function w(e){return P(e,!1)}function I(e){return P(e,!0)}function O(t){if(e.isObjectLiteralExpression(t))for(var r=0,n=t.properties;r<n.length;r++)switch((o=n[r]).kind){case 294:if(O(o.initializer))return !0;break;case 295:if(O(o.name))return !0;break;case 296:if(O(o.expression))return !0;break;case 168:case 171:case 172:return !1;default:e.Debug.assertNever(o,"Unhandled object member kind");}else if(e.isArrayLiteralExpression(t))for(var i=0,a=t.elements;i<a.length;i++){var o=a[i];if(e.isSpreadElement(o)){if(O(o.expression))return !0}else if(O(o))return !0}else if(e.isIdentifier(t))return e.length($(t))>(e.isExportName(t)?1:0);return !1}function M(t,r){var n,o=i.createUniqueName("resolve"),s=i.createUniqueName("reject"),c=[i.createParameterDeclaration(void 0,void 0,void 0,o),i.createParameterDeclaration(void 0,void 0,void 0,s)],u=i.createBlock([i.createExpressionStatement(i.createCallExpression(i.createIdentifier("require"),void 0,[i.createArrayLiteralExpression([t||i.createOmittedExpression()]),o,s]))]);d>=2?n=i.createArrowFunction(void 0,void 0,c,void 0,void 0,u):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,c,void 0,u),r&&e.setEmitFlags(n,8));var _=i.createNewExpression(i.createIdentifier("Promise"),void 0,[n]);return e.getESModuleInterop(l)?i.createCallExpression(i.createPropertyAccessExpression(_,i.createIdentifier("then")),void 0,[a().createImportStarCallbackHelper()]):_}function L(t,r){var n,o=i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Promise"),"resolve"),void 0,[]),s=i.createCallExpression(i.createIdentifier("require"),void 0,t?[t]:[]);return e.getESModuleInterop(l)&&(s=a().createImportStarHelper(s)),d>=2?n=i.createArrowFunction(void 0,void 0,[],void 0,void 0,s):(n=i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(s)])),r&&e.setEmitFlags(n,8)),i.createCallExpression(i.createPropertyAccessExpression(o,"then"),void 0,[n])}function R(t,r){return !e.getESModuleInterop(l)||67108864&e.getEmitFlags(t)?r:e.getImportNeedsImportStarHelper(t)?a().createImportStarHelper(r):e.getImportNeedsImportDefaultHelper(t)?a().createImportDefaultHelper(r):r}function B(t){var r=e.getExternalModuleNameLiteral(i,t,m,_,u,l),n=[];return r&&n.push(r),i.createCallExpression(i.createIdentifier("require"),void 0,n)}function j(t,r,n){var a=$(t);if(a){for(var o=e.isExportName(t)?r:i.createAssignment(t,r),s=0,c=a;s<c.length;s++){var l=c[s];e.setEmitFlags(o,4),o=X(l,o,n);}return o}return i.createAssignment(t,r)}function J(t){return e.isBindingPattern(t.name)?e.flattenDestructuringAssignment(e.visitNode(t,w),void 0,r,0,!1,j):i.createAssignment(e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),t.name),t.name),t.initializer?e.visitNode(t.initializer,w):i.createVoidZero())}function z(t){return 0!=(4194304&e.getEmitFlags(t))}function U(e,t){if(y.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=H(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 267:e=H(e,n);break;case 268:for(var i=0,a=n.elements;i<a.length;i++)e=H(e,a[i],!0);}return e}function K(e,t){return y.exportEquals?e:H(e,t)}function V(e,t){if(y.exportEquals)return e;for(var r=0,n=t.declarationList.declarations;r<n.length;r++)e=q(e,n[r]);return e}function q(t,r){if(y.exportEquals)return t;if(e.isBindingPattern(r.name))for(var n=0,i=r.name.elements;n<i.length;n++){var a=i[n];e.isOmittedExpression(a)||(t=q(t,a));}else e.isGeneratedIdentifier(r.name)||(t=H(t,r));return t}function W(t,r){return y.exportEquals||(e.hasSyntacticModifier(r,1)&&(t=G(t,e.hasSyntacticModifier(r,512)?i.createIdentifier("default"):i.getDeclarationName(r),i.getLocalName(r),r)),r.name&&(t=H(t,r))),t}function H(t,r,n){var a=i.getDeclarationName(r),o=y.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];t=G(t,l.name,a,l.name,void 0,n);}return t}function G(t,r,n,a,o,s){return e.append(t,function(t,r,n,a,o){var s=e.setTextRange(i.createExpressionStatement(X(t,r,void 0,o)),n);return e.startOnNewLine(s),a||e.setEmitFlags(s,1536),s}(r,n,a,o,s))}function Q(){var t;return t=0===d?i.createExpressionStatement(X(i.createIdentifier("__esModule"),i.createTrue())):i.createExpressionStatement(i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteral("__esModule"),i.createObjectLiteralExpression([i.createPropertyAssignment("value",i.createTrue())])])),e.setEmitFlags(t,1048576),t}function X(t,r,n,a){return e.setTextRange(a&&0!==d?i.createCallExpression(i.createPropertyAccessExpression(i.createIdentifier("Object"),"defineProperty"),void 0,[i.createIdentifier("exports"),i.createStringLiteralFromNode(t),i.createObjectLiteralExpression([i.createPropertyAssignment("enumerable",i.createTrue()),i.createPropertyAssignment("get",i.createFunctionExpression(void 0,void 0,void 0,void 0,[],void 0,i.createBlock([i.createReturnStatement(r)])))])]):i.createAssignment(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),r),n)}function Y(e){switch(e.kind){case 93:case 88:return}return e}function Z(t){var r,n;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(m);return a?i.createPropertyAccessExpression(a,t):t}if((!e.isGeneratedIdentifier(t)||64&t.autoGenerateFlags)&&!e.isLocalName(t)){var o=u.getReferencedExportContainer(t,e.isExportName(t));if(o&&303===o.kind)return e.setTextRange(i.createPropertyAccessExpression(i.createIdentifier("exports"),i.cloneNode(t)),t);var s=u.getReferencedImportDeclaration(t);if(s){if(e.isImportClause(s))return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode(s.parent),i.createIdentifier("default")),t);if(e.isImportSpecifier(s)){var c=s.propertyName||s.name;return e.setTextRange(i.createPropertyAccessExpression(i.getGeneratedNameForNode((null===(n=null===(r=s.parent)||void 0===r?void 0:r.parent)||void 0===n?void 0:n.parent)||s),i.cloneNode(c)),t)}}}return t}function $(t){if(!e.isGeneratedIdentifier(t)){var r=u.getReferencedImportDeclaration(t)||u.getReferencedValueDeclaration(t);if(r)return y&&y.exportedBindings[e.getOriginalNodeId(r)]}}};var t={name:"typescript:dynamicimport-sync-require",scoped:!0,text:'\n var __syncRequire = typeof module === "object" && typeof module.exports === "object";'};}(t),function(e){e.transformSystemModule=function(t){var r=t.factory,n=t.startLexicalEnvironment,i=t.endLexicalEnvironment,a=t.hoistVariableDeclaration,o=t.getCompilerOptions(),s=t.getEmitResolver(),c=t.getEmitHost(),l=t.onSubstituteNode,u=t.onEmitNode;t.onSubstituteNode=function(t,n){return function(e){return y&&e.id&&y[e.id]}(n=l(t,n))?n:1===t?function(t){switch(t.kind){case 79:return function(t){var n,i;if(4096&e.getEmitFlags(t)){var a=e.getExternalHelpersModuleName(_);return a?r.createPropertyAccessExpression(a,t):t}if(!e.isGeneratedIdentifier(t)&&!e.isLocalName(t)){var o=s.getReferencedImportDeclaration(t);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default")),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name)),t)}}return t}(t);case 220:return function(t){if(e.isAssignmentOperator(t.operatorToken.kind)&&e.isIdentifier(t.left)&&!e.isGeneratedIdentifier(t.left)&&!e.isLocalName(t.left)&&!e.isDeclarationNameOfEnumOrNamespace(t.left)){var r=X(t.left);if(r){for(var n=t,i=0,a=r;i<a.length;i++)n=z(a[i],Y(n));return n}}return t}(t);case 230:return function(t){return e.isImportMeta(t)?r.createPropertyAccessExpression(f,r.createIdentifier("meta")):t}(t)}return t}(n):4===t?function(t){switch(t.kind){case 295:return function(t){var n,i,a=t.name;if(!e.isGeneratedIdentifier(a)&&!e.isLocalName(a)){var o=s.getReferencedImportDeclaration(a);if(o){if(e.isImportClause(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode(o.parent),r.createIdentifier("default"))),t);if(e.isImportSpecifier(o))return e.setTextRange(r.createPropertyAssignment(r.cloneNode(a),r.createPropertyAccessExpression(r.getGeneratedNameForNode((null===(i=null===(n=o.parent)||void 0===n?void 0:n.parent)||void 0===i?void 0:i.parent)||o),r.cloneNode(o.propertyName||o.name))),t)}}return t}(t)}return t}(n):n},t.onEmitNode=function(t,r,n){if(303===r.kind){var i=e.getOriginalNodeId(r);_=r,d=v[i],p=b[i],y=x[i],f=D[i],y&&delete x[i],u(t,r,n),_=void 0,d=void 0,p=void 0,f=void 0,y=void 0;}else u(t,r,n);},t.enableSubstitution(79),t.enableSubstitution(295),t.enableSubstitution(220),t.enableSubstitution(230),t.enableEmitNotification(303);var _,d,p,f,g,m,y,v=[],h=[],b=[],x=[],D=[];return e.chainBundle(t,(function(a){if(a.isDeclarationFile||!(e.isEffectiveExternalModule(a,o)||4194304&a.transformFlags))return a;var l=e.getOriginalNodeId(a);_=a,m=a,d=v[l]=e.collectExternalModuleInfo(t,a,s,o),p=r.createUniqueName("exports"),b[l]=p,f=D[l]=r.createUniqueName("context");var u=function(t){for(var n=new e.Map,i=[],a=0,l=t;a<l.length;a++){var u=l[a],d=e.getExternalModuleNameLiteral(r,u,_,c,s,o);if(d){var p=d.text,f=n.get(p);void 0!==f?i[f].externalImports.push(u):(n.set(p,i.length),i.push({name:d,externalImports:[u]}));}}return i}(d.externalImports),h=function(t,a){var s=[];n();var c=e.getStrictOptionValue(o,"alwaysStrict")||!o.noImplicitUseStrict&&e.isExternalModule(_),l=r.copyPrologue(t.statements,s,c,C);s.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration("__moduleName",void 0,void 0,r.createLogicalAnd(f,r.createPropertyAccessExpression(f,"id")))]))),e.visitNode(d.externalHelpersImportDeclaration,C,e.isStatement);var u=e.visitNodes(t.statements,C,e.isStatement,l);e.addRange(s,g),e.insertStatementsAfterStandardPrologue(s,i());var p=function(e){if(d.hasExportStarsToExportValues){if(!d.exportedNames&&0===d.exportSpecifiers.size){for(var t=!1,n=0,i=d.externalImports;n<i.length;n++){var a=i[n];if(271===a.kind&&a.exportClause){t=!0;break}}if(!t){var o=S(void 0);return e.push(o),o.name}}var s=[];if(d.exportedNames)for(var c=0,l=d.exportedNames;c<l.length;c++){var u=l[c];"default"!==u.escapedText&&s.push(r.createPropertyAssignment(r.createStringLiteralFromNode(u),r.createTrue()));}var _=r.createUniqueName("exportedNames");e.push(r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(_,void 0,void 0,r.createObjectLiteralExpression(s,!0))])));var p=S(_);return e.push(p),p.name}}(s),m=1048576&t.transformFlags?r.createModifiersFromModifierFlags(256):void 0,y=r.createObjectLiteralExpression([r.createPropertyAssignment("setters",T(p,a)),r.createPropertyAssignment("execute",r.createFunctionExpression(m,void 0,void 0,void 0,[],void 0,r.createBlock(u,!0)))],!0);return s.push(r.createReturnStatement(y)),r.createBlock(s,!0)}(a,u),E=r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,p),r.createParameterDeclaration(void 0,void 0,void 0,f)],void 0,h),k=e.tryGetModuleNameFromFile(r,a,c,o),N=r.createArrayLiteralExpression(e.map(u,(function(e){return e.name}))),F=e.setEmitFlags(r.updateSourceFile(a,e.setTextRange(r.createNodeArray([r.createExpressionStatement(r.createCallExpression(r.createPropertyAccessExpression(r.createIdentifier("System"),"register"),void 0,k?[k,N,E]:[N,E]))]),a.statements)),1024);return e.outFile(o)||e.moveEmitHelpers(F,h,(function(e){return !e.scoped})),y&&(x[l]=y,y=void 0),_=void 0,d=void 0,p=void 0,f=void 0,g=void 0,m=void 0,F}));function S(t){var n=r.createUniqueName("exportStar"),i=r.createIdentifier("m"),a=r.createIdentifier("n"),o=r.createIdentifier("exports"),s=r.createStrictInequality(a,r.createStringLiteral("default"));return t&&(s=r.createLogicalAnd(s,r.createLogicalNot(r.createCallExpression(r.createPropertyAccessExpression(t,"hasOwnProperty"),void 0,[a])))),r.createFunctionDeclaration(void 0,void 0,void 0,n,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,i)],void 0,r.createBlock([r.createVariableStatement(void 0,r.createVariableDeclarationList([r.createVariableDeclaration(o,void 0,void 0,r.createObjectLiteralExpression([]))])),r.createForInStatement(r.createVariableDeclarationList([r.createVariableDeclaration(a)]),i,r.createBlock([e.setEmitFlags(r.createIfStatement(s,r.createExpressionStatement(r.createAssignment(r.createElementAccessExpression(o,a),r.createElementAccessExpression(i,a)))),1)])),r.createExpressionStatement(r.createCallExpression(p,void 0,[o]))],!0))}function T(t,n){for(var i=[],a=0,o=n;a<o.length;a++){for(var s=o[a],c=e.forEach(s.externalImports,(function(t){return e.getLocalNameForExternalImport(r,t,_)})),l=c?r.getGeneratedNameForNode(c):r.createUniqueName(""),u=[],d=0,f=s.externalImports;d<f.length;d++){var g=f[d],m=e.getLocalNameForExternalImport(r,g,_);switch(g.kind){case 265:if(!g.importClause)break;case 264:e.Debug.assert(void 0!==m),u.push(r.createExpressionStatement(r.createAssignment(m,l)));break;case 271:if(e.Debug.assert(void 0!==m),g.exportClause)if(e.isNamedExports(g.exportClause)){for(var y=[],v=0,h=g.exportClause.elements;v<h.length;v++){var b=h[v];y.push(r.createPropertyAssignment(r.createStringLiteral(e.idText(b.name)),r.createElementAccessExpression(l,r.createStringLiteral(e.idText(b.propertyName||b.name)))));}u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createObjectLiteralExpression(y,!0)])));}else u.push(r.createExpressionStatement(r.createCallExpression(p,void 0,[r.createStringLiteral(e.idText(g.exportClause.name)),l])));else u.push(r.createExpressionStatement(r.createCallExpression(t,void 0,[l])));}}i.push(r.createFunctionExpression(void 0,void 0,void 0,void 0,[r.createParameterDeclaration(void 0,void 0,void 0,l)],void 0,r.createBlock(u,!0)));}return r.createArrayLiteralExpression(i,!0)}function C(t){switch(t.kind){case 265:return function(t){var n;if(t.importClause&&a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=I(h[i],t);}else n=I(n,t);return e.singleOrMany(n)}(t);case 264:return function(t){var n;if(e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),a(e.getLocalNameForExternalImport(r,t,_)),w(t)){var i=e.getOriginalNodeId(t);h[i]=O(h[i],t);}else n=O(n,t);return e.singleOrMany(n)}(t);case 271:return function(t){e.Debug.assertIsDefined(t);}(t);case 270:return function(t){if(!t.isExportEquals){var n=e.visitNode(t.expression,W,e.isExpression),i=t.original;if(!i||!w(i))return J(r.createIdentifier("default"),n,!0);var a=e.getOriginalNodeId(t);h[a]=j(h[a],r.createIdentifier("default"),n,!0);}}(t);default:return U(t)}}function E(t){if(e.isBindingPattern(t.name))for(var n=0,i=t.name.elements;n<i.length;n++){var o=i[n];e.isOmittedExpression(o)||E(o);}else a(r.cloneNode(t.name));}function k(t){return 0==(2097152&e.getEmitFlags(t))&&(303===m.kind||0==(3&e.getOriginalNode(t).flags))}function N(r,n){var i=n?F:A;return e.isBindingPattern(r.name)?e.flattenDestructuringAssignment(r,W,t,0,!1,i):r.initializer?i(r.name,e.visitNode(r.initializer,W,e.isExpression)):r.name}function F(e,t,r){return P(e,t,r,!0)}function A(e,t,r){return P(e,t,r,!1)}function P(t,n,i,o){return a(r.cloneNode(t)),o?z(t,Y(e.setTextRange(r.createAssignment(t,n),i))):Y(e.setTextRange(r.createAssignment(t,n),i))}function w(t){return 0!=(4194304&e.getEmitFlags(t))}function I(e,t){if(d.exportEquals)return e;var r=t.importClause;if(!r)return e;r.name&&(e=B(e,r));var n=r.namedBindings;if(n)switch(n.kind){case 267:e=B(e,n);break;case 268:for(var i=0,a=n.elements;i<a.length;i++)e=B(e,a[i]);}return e}function O(e,t){return d.exportEquals?e:B(e,t)}function M(e,t,r){if(d.exportEquals)return e;for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];(a.initializer||r)&&(e=L(e,a,r));}return e}function L(t,n,i){if(d.exportEquals)return t;if(e.isBindingPattern(n.name))for(var a=0,o=n.name.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(t=L(t,s,i));}else if(!e.isGeneratedIdentifier(n.name)){var c=void 0;i&&(t=j(t,n.name,r.getLocalName(n)),c=e.idText(n.name)),t=B(t,n,c);}return t}function R(t,n){if(d.exportEquals)return t;var i;if(e.hasSyntacticModifier(n,1)){var a=e.hasSyntacticModifier(n,512)?r.createStringLiteral("default"):n.name;t=j(t,a,r.getLocalName(n)),i=e.getTextOfIdentifierOrLiteral(a);}return n.name&&(t=B(t,n,i)),t}function B(t,n,i){if(d.exportEquals)return t;var a=r.getDeclarationName(n),o=d.exportSpecifiers.get(e.idText(a));if(o)for(var s=0,c=o;s<c.length;s++){var l=c[s];l.name.escapedText!==i&&(t=j(t,l.name,a));}return t}function j(t,r,n,i){return e.append(t,J(r,n,i))}function J(t,n,i){var a=r.createExpressionStatement(z(t,n));return e.startOnNewLine(a),i||e.setEmitFlags(a,1536),a}function z(t,n){var i=e.isIdentifier(t)?r.createStringLiteralFromNode(t):t;return e.setEmitFlags(n,1536|e.getEmitFlags(n)),e.setCommentRange(r.createCallExpression(p,void 0,[i,n]),n)}function U(n){switch(n.kind){case 236:return function(t){if(!k(t.declarationList))return e.visitNode(t,W,e.isStatement);for(var n,i,a=e.hasSyntacticModifier(t,1),o=w(t),s=0,c=t.declarationList.declarations;s<c.length;s++){var l=c[s];l.initializer?n=e.append(n,N(l,a&&!o)):E(l);}if(n&&(i=e.append(i,e.setTextRange(r.createExpressionStatement(r.inlineExpressions(n)),t))),o){var u=e.getOriginalNodeId(t);h[u]=M(h[u],t,a);}else i=M(i,t,!1);return e.singleOrMany(i)}(n);case 255:return function(n){if(g=e.hasSyntacticModifier(n,1)?e.append(g,r.updateFunctionDeclaration(n,n.decorators,e.visitNodes(n.modifiers,Q,e.isModifier),n.asteriskToken,r.getDeclarationName(n,!0,!0),void 0,e.visitNodes(n.parameters,W,e.isParameterDeclaration),void 0,e.visitNode(n.body,W,e.isBlock))):e.append(g,e.visitEachChild(n,W,t)),w(n)){var i=e.getOriginalNodeId(n);h[i]=R(h[i],n);}else g=R(g,n);}(n);case 256:return function(t){var n,i=r.getLocalName(t);if(a(i),n=e.append(n,e.setTextRange(r.createExpressionStatement(r.createAssignment(i,e.setTextRange(r.createClassExpression(e.visitNodes(t.decorators,W,e.isDecorator),void 0,t.name,void 0,e.visitNodes(t.heritageClauses,W,e.isHeritageClause),e.visitNodes(t.members,W,e.isClassElement)),t))),t)),w(t)){var o=e.getOriginalNodeId(t);h[o]=R(h[o],t);}else n=R(n,t);return e.singleOrMany(n)}(n);case 241:return K(n,!0);case 242:return function(n){var i=m;return m=n,n=r.updateForInStatement(n,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 243:return function(n){var i=m;return m=n,n=r.updateForOfStatement(n,n.awaitModifier,V(n.initializer),e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t)),m=i,n}(n);case 239:return function(n){return r.updateDoStatement(n,e.visitIterationBody(n.statement,U,t),e.visitNode(n.expression,W,e.isExpression))}(n);case 240:return function(n){return r.updateWhileStatement(n,e.visitNode(n.expression,W,e.isExpression),e.visitIterationBody(n.statement,U,t))}(n);case 249:return function(t){return r.updateLabeledStatement(t,t.label,e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 247:return function(t){return r.updateWithStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.statement,U,e.isStatement,r.liftToBlock))}(n);case 248:return function(t){return r.updateSwitchStatement(t,e.visitNode(t.expression,W,e.isExpression),e.visitNode(t.caseBlock,U,e.isCaseBlock))}(n);case 262:return function(t){var n=m;return m=t,t=r.updateCaseBlock(t,e.visitNodes(t.clauses,U,e.isCaseOrDefaultClause)),m=n,t}(n);case 288:return function(t){return r.updateCaseClause(t,e.visitNode(t.expression,W,e.isExpression),e.visitNodes(t.statements,U,e.isStatement))}(n);case 289:case 251:return function(r){return e.visitEachChild(r,U,t)}(n);case 291:return function(t){var n=m;return m=t,t=r.updateCatchClause(t,t.variableDeclaration,e.visitNode(t.block,U,e.isBlock)),m=n,t}(n);case 234:return function(r){var n=m;return m=r,r=e.visitEachChild(r,U,t),m=n,r}(n);case 350:return function(t){if(w(t)&&236===t.original.kind){var r=e.getOriginalNodeId(t),n=e.hasSyntacticModifier(t.original,1);h[r]=M(h[r],t.original,n);}return t}(n);case 351:return function(t){var r=e.getOriginalNodeId(t),n=h[r];if(n)return delete h[r],e.append(n,t);var i=e.getOriginalNode(t);return e.isModuleOrEnumDeclaration(i)?e.append(B(n,i),t):t}(n);default:return W(n)}}function K(n,i){var a=m;return m=n,n=r.updateForStatement(n,e.visitNode(n.initializer,i?V:H,e.isForInitializer),e.visitNode(n.condition,W,e.isExpression),e.visitNode(n.incrementor,H,e.isExpression),e.visitIterationBody(n.statement,i?U:W,t)),m=a,n}function V(t){if(function(t){return e.isVariableDeclarationList(t)&&k(t)}(t)){for(var n=void 0,i=0,a=t.declarations;i<a.length;i++){var o=a[i];n=e.append(n,N(o,!1)),o.initializer||E(o);}return n?r.inlineExpressions(n):r.createOmittedExpression()}return e.visitNode(t,H,e.isExpression)}function q(n,i){if(!(71305216&n.transformFlags))return n;switch(n.kind){case 241:return K(n,!1);case 237:return function(t){return r.updateExpressionStatement(t,e.visitNode(t.expression,H,e.isExpression))}(n);case 211:return function(t,n){return r.updateParenthesizedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 348:return function(t,n){return r.updatePartiallyEmittedExpression(t,e.visitNode(t.expression,n?H:W,e.isExpression))}(n,i);case 220:if(e.isDestructuringAssignment(n))return function(r,n){return G(r.left)?e.flattenDestructuringAssignment(r,W,t,0,!n):e.visitEachChild(r,W,t)}(n,i);break;case 207:if(e.isImportCall(n))return function(t){var n=e.getExternalModuleNameLiteral(r,t,_,c,s,o),i=e.visitNode(e.firstOrUndefined(t.arguments),W),a=!n||i&&e.isStringLiteral(i)&&i.text===n.text?i:n;return r.createCallExpression(r.createPropertyAccessExpression(f,r.createIdentifier("import")),void 0,a?[a]:[])}(n);break;case 218:case 219:return function(n,i){if((45===n.operator||46===n.operator)&&e.isIdentifier(n.operand)&&!e.isGeneratedIdentifier(n.operand)&&!e.isLocalName(n.operand)&&!e.isDeclarationNameOfEnumOrNamespace(n.operand)){var o=X(n.operand);if(o){var s=void 0,c=e.visitNode(n.operand,W,e.isExpression);e.isPrefixUnaryExpression(n)?c=r.updatePrefixUnaryExpression(n,c):(c=r.updatePostfixUnaryExpression(n,c),i||(s=r.createTempVariable(a),c=r.createAssignment(s,c),e.setTextRange(c,n)),c=r.createComma(c,r.cloneNode(n.operand)),e.setTextRange(c,n));for(var l=0,u=o;l<u.length;l++)c=z(u[l],Y(c));return s&&(c=r.createComma(c,s),e.setTextRange(c,n)),c}}return e.visitEachChild(n,W,t)}(n,i)}return e.visitEachChild(n,W,t)}function W(e){return q(e,!1)}function H(e){return q(e,!0)}function G(t){if(e.isAssignmentExpression(t,!0))return G(t.left);if(e.isSpreadElement(t))return G(t.expression);if(e.isObjectLiteralExpression(t))return e.some(t.properties,G);if(e.isArrayLiteralExpression(t))return e.some(t.elements,G);if(e.isShorthandPropertyAssignment(t))return G(t.name);if(e.isPropertyAssignment(t))return G(t.initializer);if(e.isIdentifier(t)){var r=s.getReferencedExportContainer(t);return void 0!==r&&303===r.kind}return !1}function Q(e){switch(e.kind){case 93:case 88:return}return e}function X(t){var n;if(!e.isGeneratedIdentifier(t)){var i=s.getReferencedImportDeclaration(t)||s.getReferencedValueDeclaration(t);if(i){var a=s.getReferencedExportContainer(t,!1);a&&303===a.kind&&(n=e.append(n,r.getDeclarationName(i))),n=e.addRange(n,d&&d.exportedBindings[e.getOriginalNodeId(i)]);}}return n}function Y(t){return void 0===y&&(y=[]),y[e.getNodeId(t)]=!0,t}};}(t),function(e){e.transformECMAScriptModule=function(t){var r,i,a,o=t.factory,s=t.getEmitHelperFactory,c=t.getEmitHost(),l=t.getEmitResolver(),u=t.getCompilerOptions(),_=e.getEmitScriptTarget(u),d=t.onEmitNode,p=t.onSubstituteNode;return t.onEmitNode=function(t,n,i){e.isSourceFile(n)?((e.isExternalModule(n)||u.isolatedModules)&&u.importHelpers&&(r=new e.Map),d(t,n,i),r=void 0):d(t,n,i);},t.onSubstituteNode=function(t,n){return n=p(t,n),r&&e.isIdentifier(n)&&4096&e.getEmitFlags(n)?function(t){var n=e.idText(t),i=r.get(n);return i||r.set(n,i=o.createUniqueName(n,48)),i}(n):n},t.enableEmitNotification(303),t.enableSubstitution(79),e.chainBundle(t,(function(r){if(r.isDeclarationFile)return r;if(e.isExternalModule(r)||u.isolatedModules){i=r,a=void 0;var c=function(r){var n=e.createExternalHelpersImportDeclarationIfNeeded(o,s(),r,u);if(n){var i=[],a=o.copyPrologue(r.statements,i);return e.append(i,n),e.addRange(i,e.visitNodes(r.statements,f,e.isStatement,a)),o.updateSourceFile(r,e.setTextRange(o.createNodeArray(i),r.statements))}return e.visitEachChild(r,f,t)}(r);return i=void 0,a&&(c=o.updateSourceFile(c,e.setTextRange(o.createNodeArray(e.insertStatementsAfterCustomPrologue(c.statements.slice(),a)),c.statements))),!e.isExternalModule(r)||e.some(c.statements,e.isExternalModuleIndicator)?c:o.updateSourceFile(c,e.setTextRange(o.createNodeArray(n$3(n$3([],c.statements,!0),[e.createEmptyExports(o)],!1)),c.statements))}return r}));function f(t){switch(t.kind){case 264:return e.getEmitScriptTarget(u)>=e.ModuleKind.ES2020?function(t){var r;return e.Debug.assert(e.isExternalModuleImportEqualsDeclaration(t),"import= for internal module references should be handled in an earlier transformer."),r=function(t,r){return e.hasSyntacticModifier(r,1)&&(t=e.append(t,o.createExportDeclaration(void 0,void 0,r.isTypeOnly,o.createNamedExports([o.createExportSpecifier(!1,void 0,e.idText(r.name))])))),t}(r=e.append(r,e.setOriginalNode(e.setTextRange(o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(o.cloneNode(t.name),void 0,void 0,g(t))],_>=2?2:0)),t),t)),t),e.singleOrMany(r)}(t):void 0;case 270:return function(e){return e.isExportEquals?void 0:e}(t);case 271:return function(t){if(void 0!==u.module&&u.module>e.ModuleKind.ES2015)return t;if(!t.exportClause||!e.isNamespaceExport(t.exportClause)||!t.moduleSpecifier)return t;var r=t.exportClause.name,n=o.getGeneratedNameForNode(r),i=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamespaceImport(n)),t.moduleSpecifier,t.assertClause);e.setOriginalNode(i,t.exportClause);var a=e.isExportNamespaceAsDefaultDeclaration(t)?o.createExportDefault(n):o.createExportDeclaration(void 0,void 0,!1,o.createNamedExports([o.createExportSpecifier(!1,n,r)]));return e.setOriginalNode(a,t),[i,a]}(t)}return t}function g(t){var r=e.getExternalModuleNameLiteral(o,t,e.Debug.checkDefined(i),c,l,u),n=[];if(r&&n.push(r),!a){var s=o.createUniqueName("_createRequire",48),d=o.createImportDeclaration(void 0,void 0,o.createImportClause(!1,void 0,o.createNamedImports([o.createImportSpecifier(!1,o.createIdentifier("createRequire"),s)])),o.createStringLiteral("module")),p=o.createUniqueName("__require",48),f=o.createVariableStatement(void 0,o.createVariableDeclarationList([o.createVariableDeclaration(p,void 0,void 0,o.createCallExpression(o.cloneNode(s),void 0,[o.createPropertyAccessExpression(o.createMetaProperty(100,o.createIdentifier("meta")),o.createIdentifier("url"))]))],_>=2?2:0));a=[d,f];}var g=a[1].declarationList.declarations[0].name;return e.Debug.assertNode(g,e.isIdentifier),o.createCallExpression(o.cloneNode(g),void 0,n)}};}(t),function(e){e.transformNodeModule=function(t){var r=t.onSubstituteNode,n=t.onEmitNode,i=e.transformECMAScriptModule(t),a=t.onSubstituteNode,o=t.onEmitNode;t.onSubstituteNode=r,t.onEmitNode=n;var s,c=e.transformModule(t),l=t.onSubstituteNode,u=t.onEmitNode;return t.onSubstituteNode=function(t,n){return e.isSourceFile(n)?(s=n,r(t,n)):s?s.impliedNodeFormat===e.ModuleKind.ESNext?a(t,n):l(t,n):r(t,n)},t.onEmitNode=function(t,r,i){return e.isSourceFile(r)&&(s=r),s?s.impliedNodeFormat===e.ModuleKind.ESNext?o(t,r,i):u(t,r,i):n(t,r,i)},t.enableSubstitution(303),t.enableEmitNotification(303),function(r){return 303===r.kind?_(r):function(r){return t.factory.createBundle(e.map(r.sourceFiles,_),r.prepends)}(r)};function _(t){if(t.isDeclarationFile)return t;s=t;var r=(t.impliedNodeFormat===e.ModuleKind.ESNext?i:c)(t);return s=void 0,e.Debug.assert(e.isSourceFile(r)),r}};}(t),function(e){function t(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isPropertyAccessExpression(t)||e.isBindingElement(t)||e.isConstructorDeclaration(t)?r:e.isSetAccessor(t)||e.isGetAccessor(t)?function(r){return {diagnosticMessage:172===t.kind?e.isStatic(t)?r.errorModuleName?e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1:e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1,errorNode:t.name,typeName:t.name}}:e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isIndexSignatureDeclaration(t)?function(r){var n;switch(t.kind){case 174:n=r.errorModuleName?e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 173:n=r.errorModuleName?e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 175:n=r.errorModuleName?e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0;break;case 168:case 167:n=e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0:256===t.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0:r.errorModuleName?e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0;break;case 255:n=r.errorModuleName?2===r.accessibility?e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1:e.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0;break;default:return e.Debug.fail("This is unknown kind for signature: "+t.kind)}return {diagnosticMessage:n,errorNode:t.name||t}}:e.isParameter(t)?e.isParameterPropertyDeclaration(t,t.parent)&&e.hasSyntacticModifier(t.parent,8)?r:function(r){var n=function(r){switch(t.parent.kind){case 170:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1;case 174:case 179:return r.errorModuleName?e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;case 173:return r.errorModuleName?e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;case 175:return r.errorModuleName?e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1;case 168:case 167:return e.isStatic(t.parent)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:256===t.parent.parent.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;case 255:case 178:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1;case 172:case 171:return r.errorModuleName?2===r.accessibility?e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;default:return e.Debug.fail("Unknown parent for parameter: ".concat(e.SyntaxKind[t.parent.kind]))}}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}:e.isTypeParameterDeclaration(t)?function(){var r;switch(t.parent.kind){case 256:r=e.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1;break;case 257:r=e.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1;break;case 194:r=e.Diagnostics.Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1;break;case 179:case 174:r=e.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 173:r=e.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1;break;case 168:case 167:r=e.isStatic(t.parent)?e.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1:256===t.parent.parent.kind?e.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1:e.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1;break;case 178:case 255:r=e.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1;break;case 258:r=e.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1;break;default:return e.Debug.fail("This is unknown parent for type parameter: "+t.parent.kind)}return {diagnosticMessage:r,errorNode:t,typeName:t.name}}:e.isExpressionWithTypeArguments(t)?function(){return {diagnosticMessage:e.isClassDeclaration(t.parent.parent)?e.isHeritageClause(t.parent)&&117===t.parent.token?e.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1:t.parent.parent.name?e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1:e.Diagnostics.extends_clause_of_exported_class_has_or_is_using_private_name_0:e.Diagnostics.extends_clause_of_exported_interface_0_has_or_is_using_private_name_1,errorNode:t,typeName:e.getNameOfDeclaration(t.parent.parent)}}:e.isImportEqualsDeclaration(t)?function(){return {diagnosticMessage:e.Diagnostics.Import_declaration_0_is_using_private_name_1,errorNode:t,typeName:t.name}}:e.isTypeAliasDeclaration(t)||e.isJSDocTypeAlias(t)?function(r){return {diagnosticMessage:r.errorModuleName?e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2:e.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1,errorNode:e.isJSDocTypeAlias(t)?e.Debug.checkDefined(t.typeExpression):t.type,typeName:e.isJSDocTypeAlias(t)?e.getNameOfDeclaration(t):t.name}}:e.Debug.assertNever(t,"Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(e.SyntaxKind[t.kind]));function r(r){var n=function(r){return 253===t.kind||202===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1:166===t.kind||205===t.kind||165===t.kind||163===t.kind&&e.hasSyntacticModifier(t.parent,8)?e.isStatic(t)?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:256===t.parent.kind||163===t.kind?r.errorModuleName?2===r.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:r.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1:void 0}(r);return void 0!==n?{diagnosticMessage:n,errorNode:t,typeName:t.name}:void 0}}e.canProduceDiagnostics=function(t){return e.isVariableDeclaration(t)||e.isPropertyDeclaration(t)||e.isPropertySignature(t)||e.isBindingElement(t)||e.isSetAccessor(t)||e.isGetAccessor(t)||e.isConstructSignatureDeclaration(t)||e.isCallSignatureDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isFunctionDeclaration(t)||e.isParameter(t)||e.isTypeParameterDeclaration(t)||e.isExpressionWithTypeArguments(t)||e.isImportEqualsDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isConstructorDeclaration(t)||e.isIndexSignatureDeclaration(t)||e.isPropertyAccessExpression(t)||e.isJSDocTypeAlias(t)},e.createGetSymbolAccessibilityDiagnosticForNodeName=function(r){return e.isSetAccessor(r)||e.isGetAccessor(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1:256===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:e.isMethodSignature(r)||e.isMethodDeclaration(r)?function(t){var n=function(t){return e.isStatic(r)?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1:256===r.parent.kind?t.errorModuleName?2===t.accessibility?e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_private_name_1:t.errorModuleName?e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2:e.Diagnostics.Method_0_of_exported_interface_has_or_is_using_private_name_1}(t);return void 0!==n?{diagnosticMessage:n,errorNode:r,typeName:r.name}:void 0}:t(r)},e.createGetSymbolAccessibilityDiagnosticForNode=t;}(t),function(e){function t(t,r){var n=r.text.substring(t.pos,t.end);return e.stringContains(n,"@internal")}function r(r,n){var i=e.getParseTreeNode(r);if(i&&163===i.kind){var a=i.parent.parameters.indexOf(i),o=a>0?i.parent.parameters[a-1]:void 0,s=n.text,c=o?e.concatenate(e.getTrailingCommentRanges(s,e.skipTrivia(s,o.end+1,!1,!0)),e.getLeadingCommentRanges(s,r.pos)):e.getTrailingCommentRanges(s,e.skipTrivia(s,r.pos,!1,!0));return c&&c.length&&t(e.last(c),n)}var l=i&&e.getLeadingCommentRangesOfNode(i,n);return !!e.forEach(l,(function(e){return t(e,n)}))}e.getDeclarationDiagnostics=function(t,r,n){var i=t.getCompilerOptions();return e.transformNodes(r,t,e.factory,i,n?[n]:e.filter(t.getSourceFiles(),e.isSourceFileNotJson),[a],!1).diagnostics},e.isInternalDeclaration=r;var i=531469;function a(t){var a,c,l,u,_,d,p,f,g,m,y,v,h=function(){return e.Debug.fail("Diagnostic emitted without context")},b=h,x=!0,D=!1,S=!1,T=!1,C=!1,E=t.factory,k=t.getEmitHost(),N={trackSymbol:function(e,t,r){if(262144&e.flags)return !1;var n=O(F.isSymbolAccessible(e,t,r,!0));return I(F.getTypeReferenceDirectivesForSymbol(e,r)),n},reportInaccessibleThisError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,M(),"this"));},reportInaccessibleUniqueSymbolError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary,M(),"unique symbol"));},reportCyclicStructureError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary,M()));},reportPrivateInBaseOfClassExpression:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.Property_0_of_exported_class_expression_may_not_be_private_or_protected,r));},reportLikelyUnsafeImportRequiredError:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary,M(),r));},reportTruncationError:function(){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed));},moduleResolverHost:k,trackReferencedAmbientModule:function(t,r){var n=F.getTypeReferenceDirectivesForSymbol(r,67108863);if(e.length(n))return I(n);var i=e.getSourceFileOfNode(t);m.set(e.getOriginalNodeId(i),i);},trackExternalModuleSymbolOfImportTypeNode:function(e){D||(d||(d=[])).push(e);},reportNonlocalAugmentation:function(r,n,i){var a,o=null===(a=n.declarations)||void 0===a?void 0:a.find((function(t){return e.getSourceFileOfNode(t)===r})),s=e.filter(i.declarations,(function(t){return e.getSourceFileOfNode(t)!==r}));if(s)for(var c=0,l=s;c<l.length;c++){var u=l[c];t.addDiagnostic(e.addRelatedInfo(e.createDiagnosticForNode(u,e.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized),e.createDiagnosticForNode(o,e.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));}},reportNonSerializableProperty:function(r){(p||f)&&t.addDiagnostic(e.createDiagnosticForNode(p||f,e.Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized,r));}},F=t.getEmitResolver(),A=t.getCompilerOptions(),P=A.noResolve,w=A.stripInternal;return function(r){if(303===r.kind&&r.isDeclarationFile)return r;if(304===r.kind){D=!0,m=new e.Map,y=new e.Map;var i=!1,o=E.createBundle(e.map(r.sourceFiles,(function(r){if(!r.isDeclarationFile){if(i=i||r.hasNoDefaultLib,g=r,a=r,l=void 0,_=!1,u=new e.Map,b=h,T=!1,C=!1,R(r,m),B(r,y),e.isExternalOrCommonJsModule(r)||e.isJsonSourceFile(r)){S=!1,x=!1;var n=e.isSourceFileJS(r)?E.createNodeArray(L(r,!0)):e.visitNodes(r.statements,te);return E.updateSourceFile(r,[E.createModuleDeclaration([],[E.createModifier(135)],E.createStringLiteral(e.getResolvedExternalModuleName(t.getEmitHost(),r)),E.createModuleBlock(e.setTextRange(E.createNodeArray($(n)),r.statements)))],!0,[],[],!1,[])}x=!0;var o=e.isSourceFileJS(r)?E.createNodeArray(L(r)):e.visitNodes(r.statements,te);return E.updateSourceFile(r,$(o),!0,[],[],!1,[])}})),e.mapDefined(r.prepends,(function(t){if(306===t.kind){var r=e.createUnparsedSourceFile(t,"dts",w);return i=i||!!r.hasNoDefaultLib,R(r,m),I(r.typeReferenceDirectives),B(r,y),r}return t})));o.syntheticFileReferences=[],o.syntheticTypeReferences=j(),o.syntheticLibReferences=M(),o.hasNoDefaultLib=i;var s=e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,k,!0).declarationFilePath)),p=z(o.syntheticFileReferences,s);return m.forEach(p),o}x=!0,T=!1,C=!1,a=r,g=r,b=h,D=!1,S=!1,_=!1,l=void 0,u=new e.Map,c=void 0,m=R(g,new e.Map),y=B(g,new e.Map);var f,N=[],F=z(N,e.getDirectoryPath(e.normalizeSlashes(e.getOutputPathsFor(r,k,!0).declarationFilePath)));if(e.isSourceFileJS(g))f=E.createNodeArray(L(r)),m.forEach(F),v=e.filter(f,e.isAnyImportSyntax);else {var P=e.visitNodes(r.statements,te);f=e.setTextRange(E.createNodeArray($(P)),r.statements),m.forEach(F),v=e.filter(f,e.isAnyImportSyntax),e.isExternalModule(r)&&(!S||T&&!C)&&(f=e.setTextRange(E.createNodeArray(n$3(n$3([],f,!0),[e.createEmptyExports(E)],!1)),f));}var O=E.updateSourceFile(r,f,!0,N,j(),r.hasNoDefaultLib,M());return O.exportedModulesFromDeclarationEmit=d,O;function M(){return e.map(e.arrayFrom(y.keys()),(function(e){return {fileName:e,pos:-1,end:-1}}))}function j(){return c?e.mapDefined(e.arrayFrom(c.keys()),J):[]}function J(t){if(v)for(var r=0,n=v;r<n.length;r++){var i=n[r];if(e.isImportEqualsDeclaration(i)&&e.isExternalModuleReference(i.moduleReference)){var a=i.moduleReference.expression;if(e.isStringLiteralLike(a)&&a.text===t)return}else if(e.isImportDeclaration(i)&&e.isStringLiteral(i.moduleSpecifier)&&i.moduleSpecifier.text===t)return}return {fileName:t,pos:-1,end:-1}}function z(t,n){return function(i){var a;if(i.isDeclarationFile)a=i.fileName;else {if(D&&e.contains(r.sourceFiles,i))return;var o=e.getOutputPathsFor(i,k,!0);a=o.declarationFilePath||o.jsFilePath||i.fileName;}if(a){var s=e.moduleSpecifiers.getModuleSpecifier(A,g,e.toPath(n,k.getCurrentDirectory(),k.getCanonicalFileName),e.toPath(a,k.getCurrentDirectory(),k.getCanonicalFileName),k);if(!e.pathIsRelative(s))return void I([s]);var c=e.getRelativePathToDirectoryOrUrl(n,a,k.getCurrentDirectory(),k.getCanonicalFileName,!1);if(e.startsWith(c,"./")&&e.hasExtension(c)&&(c=c.substring(2)),e.startsWith(c,"node_modules/")||e.pathContainsNodeModules(c))return;t.push({pos:-1,end:-1,fileName:c});}}}};function I(t){if(t){c=c||new e.Set;for(var r=0,n=t;r<n.length;r++){var i=n[r];c.add(i);}}}function O(r){if(0===r.accessibility){if(r&&r.aliasesToMakeVisible)if(l)for(var n=0,i=r.aliasesToMakeVisible;n<i.length;n++){var a=i[n];e.pushIfUnique(l,a);}else l=r.aliasesToMakeVisible;}else {var o=b(r);if(o)return o.typeName?t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,e.getTextOfNode(o.typeName),r.errorSymbolName,r.errorModuleName)):t.addDiagnostic(e.createDiagnosticForNode(r.errorNode||o.errorNode,o.diagnosticMessage,r.errorSymbolName,r.errorModuleName)),!0}return !1}function M(){return p?e.declarationNameToString(p):f&&e.getNameOfDeclaration(f)?e.declarationNameToString(e.getNameOfDeclaration(f)):f&&e.isExportAssignment(f)?f.isExportEquals?"export=":"default":"(Missing)"}function L(t,r){var n=b;b=function(r){return r.errorNode&&e.canProduceDiagnostics(r.errorNode)?e.createGetSymbolAccessibilityDiagnosticForNode(r.errorNode)(r):{diagnosticMessage:r.errorModuleName?e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit:e.Diagnostics.Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit,errorNode:r.errorNode||t}};var a=F.getDeclarationStatementsForSourceFile(t,i,N,r);return b=n,a}function R(t,r){return P||!e.isUnparsedSource(t)&&e.isSourceFileJS(t)||e.forEach(t.referencedFiles,(function(n){var i=k.getSourceFileFromReference(t,n);i&&r.set(e.getOriginalNodeId(i),i);})),r}function B(t,r){return e.forEach(t.libReferenceDirectives,(function(t){k.getLibFileFromReference(t)&&r.set(e.toFileNameLowerCase(t.fileName),!0);})),r}function j(t){return 79===t.kind?t:201===t.kind?E.updateArrayBindingPattern(t,e.visitNodes(t.elements,r)):E.updateObjectBindingPattern(t,e.visitNodes(t.elements,r));function r(e){return 226===e.kind?e:E.updateBindingElement(e,e.dotDotDotToken,e.propertyName,j(e.name),z(e)?e.initializer:void 0)}}function J(t,r,n){var i;_||(i=b,b=e.createGetSymbolAccessibilityDiagnosticForNode(t));var a=E.updateParameterDeclaration(t,void 0,function(t,r,n){return e.factory.createModifiersFromModifierFlags(o(t,r,void 0))}(t,r),t.dotDotDotToken,j(t.name),F.isOptionalParameter(t)?t.questionToken||E.createToken(57):void 0,K(t,n||t.type,!0),U(t));return _||(b=i),a}function z(t){return function(t){switch(t.kind){case 166:case 165:return !e.hasEffectiveModifier(t,8);case 163:case 253:return !0}return !1}(t)&&F.isLiteralConstDeclaration(e.getParseTreeNode(t))}function U(t){if(z(t))return F.createLiteralConstValue(e.getParseTreeNode(t),N)}function K(t,r,n){if((n||!e.hasEffectiveModifier(t,8))&&!z(t)){var o,s=163===t.kind&&(F.isRequiredInitializedParameter(t)||F.isOptionalUninitializedParameterProperty(t));return r&&!s?e.visitNode(r,ee):e.getParseTreeNode(t)?172===t.kind?E.createKeywordTypeNode(130):(p=t.name,_||(o=b,b=e.createGetSymbolAccessibilityDiagnosticForNode(t)),253===t.kind||202===t.kind?c(F.createTypeOfDeclaration(t,a,i,N)):163===t.kind||166===t.kind||165===t.kind?t.initializer?c(F.createTypeOfDeclaration(t,a,i,N,s)||F.createTypeOfExpression(t.initializer,a,i,N)):c(F.createTypeOfDeclaration(t,a,i,N,s)):c(F.createReturnTypeOfSignatureDeclaration(t,a,i,N))):r?e.visitNode(r,ee):E.createKeywordTypeNode(130)}function c(e){return p=void 0,_||(b=o),e||E.createKeywordTypeNode(130)}}function V(t){switch((t=e.getParseTreeNode(t)).kind){case 255:case 260:case 257:case 256:case 258:case 259:return !F.isDeclarationVisible(t);case 253:return !q(t);case 264:case 265:case 271:case 270:return !1;case 169:return !0}return !1}function q(t){return !e.isOmittedExpression(t)&&(e.isBindingPattern(t.name)?e.some(t.name.elements,q):F.isDeclarationVisible(t))}function W(t,r,n){if(!e.hasEffectiveModifier(t,8)){var i=e.map(r,(function(e){return J(e,n)}));if(i)return E.createNodeArray(i,r.hasTrailingComma)}}function H(t,r){var n;if(!r){var i=e.getThisParameter(t);i&&(n=[J(i)]);}if(e.isSetAccessorDeclaration(t)){var a=void 0;if(!r){var o=e.getSetAccessorValueParameter(t);o&&(a=J(o,void 0,ce(t,F.getAllAccessorDeclarations(t))));}a||(a=E.createParameterDeclaration(void 0,void 0,void 0,"value")),n=e.append(n,a);}return E.createNodeArray(n||e.emptyArray)}function G(t,r){return e.hasEffectiveModifier(t,8)?void 0:e.visitNodes(r,ee)}function Q(t){return e.isSourceFile(t)||e.isTypeAliasDeclaration(t)||e.isModuleDeclaration(t)||e.isClassDeclaration(t)||e.isInterfaceDeclaration(t)||e.isFunctionLike(t)||e.isIndexSignatureDeclaration(t)||e.isMappedTypeNode(t)}function X(e,t){O(F.isEntityNameVisible(e,t)),I(F.getTypeReferenceDirectivesForEntityName(e));}function Y(t,r){return e.hasJSDocNodes(t)&&e.hasJSDocNodes(r)&&(t.jsDoc=r.jsDoc),e.setCommentRange(t,e.getCommentRange(r))}function Z(r,n){if(n){if(S=S||260!==r.kind&&199!==r.kind,e.isStringLiteralLike(n))if(D){var i=e.getExternalModuleNameFromDeclaration(t.getEmitHost(),F,r);if(i)return E.createStringLiteral(i)}else {var a=F.getSymbolOfExternalModuleSpecifier(n);a&&(d||(d=[])).push(a);}return n}}function $(t){for(;e.length(l);){var r=l.shift();if(!e.isLateVisibilityPaintedStatement(r))return e.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(e.SyntaxKind?e.SyntaxKind[r.kind]:r.kind));var n=x;x=r.parent&&e.isSourceFile(r.parent)&&!(e.isExternalModule(r.parent)&&D);var i=ne(r);x=n,u.set(e.getOriginalNodeId(r),i);}return e.visitNodes(t,(function(t){if(e.isLateVisibilityPaintedStatement(t)){var r=e.getOriginalNodeId(t);if(u.has(r)){var n=u.get(r);return u.delete(r),n&&((e.isArray(n)?e.some(n,e.needsScopeMarker):e.needsScopeMarker(n))&&(T=!0),e.isSourceFile(t.parent)&&(e.isArray(n)?e.some(n,e.isExternalModuleIndicator):e.isExternalModuleIndicator(n))&&(S=!0)),n}}return t}))}function ee(r){if(!ae(r)){if(e.isDeclaration(r)){if(V(r))return;if(e.hasDynamicName(r)&&!F.isLateBound(e.getParseTreeNode(r)))return}if(!(e.isFunctionLike(r)&&F.isImplementationOfOverload(r)||e.isSemicolonClassElement(r))){var n;Q(r)&&(n=a,a=r);var i=b,o=e.canProduceDiagnostics(r),s=_,c=(181===r.kind||194===r.kind)&&258!==r.parent.kind;if((e.isMethodDeclaration(r)||e.isMethodSignature(r))&&e.hasEffectiveModifier(r,8)){if(r.symbol&&r.symbol.declarations&&r.symbol.declarations[0]!==r)return;return h(E.createPropertyDeclaration(void 0,se(r),r.name,void 0,void 0,void 0))}if(o&&!_&&(b=e.createGetSymbolAccessibilityDiagnosticForNode(r)),e.isTypeQueryNode(r)&&X(r.exprName,a),c&&(_=!0),function(e){switch(e.kind){case 174:case 170:case 168:case 171:case 172:case 166:case 165:case 167:case 173:case 175:case 253:case 162:case 227:case 177:case 188:case 178:case 179:case 199:return !0}return !1}(r))switch(r.kind){case 227:(e.isEntityName(r.expression)||e.isEntityNameExpression(r.expression))&&X(r.expression,a);var l=e.visitEachChild(r,ee,t);return h(E.updateExpressionWithTypeArguments(l,l.expression,l.typeArguments));case 177:return X(r.typeName,a),l=e.visitEachChild(r,ee,t),h(E.updateTypeReferenceNode(l,l.typeName,l.typeArguments));case 174:return h(E.updateConstructSignature(r,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 170:return h(E.createConstructorDeclaration(void 0,se(r),W(r,r.parameters,0),void 0));case 168:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.createMethodDeclaration(void 0,se(r),void 0,r.name,r.questionToken,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type),void 0));case 171:if(e.isPrivateIdentifier(r.name))return h(void 0);var u=ce(r,F.getAllAccessorDeclarations(r));return h(E.updateGetAccessorDeclaration(r,void 0,se(r),r.name,H(r,e.hasEffectiveModifier(r,8)),K(r,u),void 0));case 172:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updateSetAccessorDeclaration(r,void 0,se(r),r.name,H(r,e.hasEffectiveModifier(r,8)),void 0));case 166:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updatePropertyDeclaration(r,void 0,se(r),r.name,r.questionToken,K(r,r.type),U(r)));case 165:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updatePropertySignature(r,se(r),r.name,r.questionToken,K(r,r.type)));case 167:return e.isPrivateIdentifier(r.name)?h(void 0):h(E.updateMethodSignature(r,se(r),r.name,r.questionToken,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 173:return h(E.updateCallSignature(r,G(r,r.typeParameters),W(r,r.parameters),K(r,r.type)));case 175:return h(E.updateIndexSignature(r,void 0,se(r),W(r,r.parameters),e.visitNode(r.type,ee)||E.createKeywordTypeNode(130)));case 253:return e.isBindingPattern(r.name)?ie(r.name):(c=!0,_=!0,h(E.updateVariableDeclaration(r,r.name,void 0,K(r,r.type),U(r))));case 162:return function(t){return 168===t.parent.kind&&e.hasEffectiveModifier(t.parent,8)}(r)&&(r.default||r.constraint)?h(E.updateTypeParameterDeclaration(r,r.name,void 0,void 0)):h(e.visitEachChild(r,ee,t));case 188:var d=e.visitNode(r.checkType,ee),f=e.visitNode(r.extendsType,ee),m=a;a=r.trueType;var y=e.visitNode(r.trueType,ee);a=m;var v=e.visitNode(r.falseType,ee);return h(E.updateConditionalTypeNode(r,d,f,y,v));case 178:return h(E.updateFunctionTypeNode(r,e.visitNodes(r.typeParameters,ee),W(r,r.parameters),e.visitNode(r.type,ee)));case 179:return h(E.updateConstructorTypeNode(r,se(r),e.visitNodes(r.typeParameters,ee),W(r,r.parameters),e.visitNode(r.type,ee)));case 199:return e.isLiteralImportTypeNode(r)?h(E.updateImportTypeNode(r,E.updateLiteralTypeNode(r.argument,Z(r,r.argument.literal)),r.qualifier,e.visitNodes(r.typeArguments,ee,e.isTypeNode),r.isTypeOf)):h(r);default:e.Debug.assertNever(r,"Attempted to process unhandled node kind: ".concat(e.SyntaxKind[r.kind]));}return e.isTupleTypeNode(r)&&e.getLineAndCharacterOfPosition(g,r.pos).line===e.getLineAndCharacterOfPosition(g,r.end).line&&e.setEmitFlags(r,1),h(e.visitEachChild(r,ee,t))}}function h(t){return t&&o&&e.hasDynamicName(r)&&function(t){var r;_||(r=b,b=e.createGetSymbolAccessibilityDiagnosticForNodeName(t)),p=t.name,e.Debug.assert(F.isLateBound(e.getParseTreeNode(t))),X(t.name.expression,a),_||(b=r),p=void 0;}(r),Q(r)&&(a=n),o&&!_&&(b=i),c&&(_=s),t===r?t:t&&e.setOriginalNode(Y(t,r),r)}}function te(t){if(function(e){switch(e.kind){case 255:case 260:case 264:case 257:case 256:case 258:case 259:case 236:case 265:case 271:case 270:return !0}return !1}(t)&&!ae(t)){switch(t.kind){case 271:return e.isSourceFile(t.parent)&&(S=!0),C=!0,E.updateExportDeclaration(t,void 0,t.modifiers,t.isTypeOnly,t.exportClause,Z(t,t.moduleSpecifier),void 0);case 270:if(e.isSourceFile(t.parent)&&(S=!0),C=!0,79===t.expression.kind)return t;var r=E.createUniqueName("_default",16);b=function(){return {diagnosticMessage:e.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,errorNode:t}},f=t;var n=E.createVariableDeclaration(r,void 0,F.createTypeOfExpression(t.expression,t,i,N),void 0);return f=void 0,[E.createVariableStatement(x?[E.createModifier(135)]:[],E.createVariableDeclarationList([n],2)),E.updateExportAssignment(t,t.decorators,t.modifiers,r)]}var a=ne(t);return u.set(e.getOriginalNodeId(t),a),t}}function re(t){if(e.isImportEqualsDeclaration(t)||e.hasEffectiveModifier(t,512)||!e.canHaveModifiers(t))return t;var r=E.createModifiersFromModifierFlags(27646&e.getEffectiveModifierFlags(t));return E.updateModifiers(t,r)}function ne(t){if(!ae(t)){switch(t.kind){case 264:return function(t){if(F.isDeclarationVisible(t)){if(276===t.moduleReference.kind){var r=e.getExternalModuleImportEqualsDeclarationExpression(t);return E.updateImportEqualsDeclaration(t,void 0,t.modifiers,t.isTypeOnly,t.name,E.updateExternalModuleReference(t.moduleReference,Z(t,r)))}var n=b;return b=e.createGetSymbolAccessibilityDiagnosticForNode(t),X(t.moduleReference,a),b=n,t}}(t);case 265:return function(t){if(!t.importClause)return E.updateImportDeclaration(t,void 0,t.modifiers,t.importClause,Z(t,t.moduleSpecifier),void 0);var r=t.importClause&&t.importClause.name&&F.isDeclarationVisible(t.importClause)?t.importClause.name:void 0;if(!t.importClause.namedBindings)return r&&E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,void 0),Z(t,t.moduleSpecifier),void 0);if(267===t.importClause.namedBindings.kind){var n=F.isDeclarationVisible(t.importClause.namedBindings)?t.importClause.namedBindings:void 0;return r||n?E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),Z(t,t.moduleSpecifier),void 0):void 0}var i=e.mapDefined(t.importClause.namedBindings.elements,(function(e){return F.isDeclarationVisible(e)?e:void 0}));return i&&i.length||r?E.updateImportDeclaration(t,void 0,t.modifiers,E.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,i&&i.length?E.updateNamedImports(t.importClause.namedBindings,i):void 0),Z(t,t.moduleSpecifier),void 0):F.isImportRequiredByAugmentation(t)?E.updateImportDeclaration(t,void 0,t.modifiers,void 0,Z(t,t.moduleSpecifier),void 0):void 0}(t)}if(!(e.isDeclaration(t)&&V(t)||e.isFunctionLike(t)&&F.isImplementationOfOverload(t))){var r;Q(t)&&(r=a,a=t);var o=e.canProduceDiagnostics(t),s=b;o&&(b=e.createGetSymbolAccessibilityDiagnosticForNode(t));var c=x;switch(t.kind){case 258:return ge(E.updateTypeAliasDeclaration(t,void 0,se(t),t.name,e.visitNodes(t.typeParameters,ee,e.isTypeParameterDeclaration),e.visitNode(t.type,ee,e.isTypeNode)));case 257:return ge(E.updateInterfaceDeclaration(t,void 0,se(t),t.name,G(t,t.typeParameters),le(t.heritageClauses),e.visitNodes(t.members,ee)));case 255:var l=ge(E.updateFunctionDeclaration(t,void 0,se(t),void 0,t.name,G(t,t.typeParameters),W(t,t.parameters),K(t,t.type),void 0));if(l&&F.isExpandoFunctionDeclaration(t)&&function(t){var r;if(t.body)return !0;var n=null===(r=t.symbol.declarations)||void 0===r?void 0:r.filter((function(t){return e.isFunctionDeclaration(t)&&!t.body}));return !n||n.indexOf(t)===n.length-1}(t)){var _=F.getPropertiesOfContainerFunction(t),d=e.parseNodeFactory.createModuleDeclaration(void 0,void 0,l.name||E.createIdentifier("_default"),E.createModuleBlock([]),16);e.setParent(d,a),d.locals=e.createSymbolTable(_),d.symbol=_[0].parent;var g=[],m=e.mapDefined(_,(function(t){if(t.valueDeclaration&&e.isPropertyAccessExpression(t.valueDeclaration)){b=e.createGetSymbolAccessibilityDiagnosticForNode(t.valueDeclaration);var r=F.createTypeOfDeclaration(t.valueDeclaration,d,i,N);b=s;var n=e.unescapeLeadingUnderscores(t.escapedName),a=e.isStringANonContextualKeyword(n),o=a?E.getGeneratedNameForNode(t.valueDeclaration):E.createIdentifier(n);a&&g.push([o,n]);var c=E.createVariableDeclaration(o,void 0,r,void 0);return E.createVariableStatement(a?void 0:[E.createToken(93)],E.createVariableDeclarationList([c]))}}));g.length?m.push(E.createExportDeclaration(void 0,void 0,!1,E.createNamedExports(e.map(g,(function(e){var t=e[0],r=e[1];return E.createExportSpecifier(!1,t,r)}))))):m=e.mapDefined(m,(function(e){return E.updateModifiers(e,0)}));var y=E.createModuleDeclaration(void 0,se(t),t.name,E.createModuleBlock(m),16);if(!e.hasEffectiveModifier(l,512))return [l,y];var v=E.createModifiersFromModifierFlags(-514&e.getEffectiveModifierFlags(l)|2),h=E.updateFunctionDeclaration(l,void 0,v,void 0,l.name,l.typeParameters,l.parameters,l.type,void 0),D=E.updateModuleDeclaration(y,void 0,v,y.name,y.body),k=E.createExportAssignment(void 0,void 0,!1,y.name);return e.isSourceFile(t.parent)&&(S=!0),C=!0,[h,D,k]}return l;case 260:x=!1;var A=t.body;if(A&&261===A.kind){var P=T,w=C;C=!1,T=!1;var I=$(e.visitNodes(A.statements,te));8388608&t.flags&&(T=!1),e.isGlobalScopeAugmentation(t)||(fe=I,e.some(fe,oe))||C||(I=T?E.createNodeArray(n$3(n$3([],I,!0),[e.createEmptyExports(E)],!1)):e.visitNodes(I,re));var O=E.updateModuleBlock(A,I);x=c,T=P,C=w;var M=se(t);return ge(E.updateModuleDeclaration(t,void 0,M,e.isExternalModuleAugmentation(t)?Z(t,t.name):t.name,O))}x=c,M=se(t),x=!1,e.visitNode(A,te);var L=e.getOriginalNodeId(A);return O=u.get(L),u.delete(L),ge(E.updateModuleDeclaration(t,void 0,M,t.name,O));case 256:p=t.name,f=t,v=E.createNodeArray(se(t));var R=G(t,t.typeParameters),B=e.getFirstConstructorWithBody(t),j=void 0;if(B){var J=b;j=e.compact(e.flatMap(B.parameters,(function(t){if(e.hasSyntacticModifier(t,16476)&&!ae(t))return b=e.createGetSymbolAccessibilityDiagnosticForNode(t),79===t.name.kind?Y(E.createPropertyDeclaration(void 0,se(t),t.name,t.questionToken,K(t,t.type),U(t)),t):function r(n){for(var i,a=0,o=n.elements;a<o.length;a++){var s=o[a];e.isOmittedExpression(s)||(e.isBindingPattern(s.name)&&(i=e.concatenate(i,r(s.name))),(i=i||[]).push(E.createPropertyDeclaration(void 0,se(t),s.name,void 0,K(s,void 0),void 0)));}return i}(t.name)}))),b=J;}var z=e.some(t.members,(function(t){return !!t.name&&e.isPrivateIdentifier(t.name)}))?[E.createPropertyDeclaration(void 0,void 0,E.createPrivateIdentifier("#private"),void 0,void 0,void 0)]:void 0,H=e.concatenate(e.concatenate(z,j),e.visitNodes(t.members,ee)),ne=E.createNodeArray(H),ie=e.getEffectiveBaseTypeNode(t);if(ie&&!e.isEntityNameExpression(ie.expression)&&104!==ie.expression.kind){var ce=t.name?e.unescapeLeadingUnderscores(t.name.escapedText):"default",ue=E.createUniqueName("".concat(ce,"_base"),16);b=function(){return {diagnosticMessage:e.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,errorNode:ie,typeName:t.name}};var _e=E.createVariableDeclaration(ue,void 0,F.createTypeOfExpression(ie.expression,t,i,N),void 0),de=E.createVariableStatement(x?[E.createModifier(135)]:[],E.createVariableDeclarationList([_e],2)),pe=E.createNodeArray(e.map(t.heritageClauses,(function(t){if(94===t.token){var r=b;b=e.createGetSymbolAccessibilityDiagnosticForNode(t.types[0]);var n=E.updateHeritageClause(t,e.map(t.types,(function(t){return E.updateExpressionWithTypeArguments(t,ue,e.visitNodes(t.typeArguments,ee))})));return b=r,n}return E.updateHeritageClause(t,e.visitNodes(E.createNodeArray(e.filter(t.types,(function(t){return e.isEntityNameExpression(t.expression)||104===t.expression.kind}))),ee))})));return [de,ge(E.updateClassDeclaration(t,void 0,v,t.name,R,pe,ne))]}return pe=le(t.heritageClauses),ge(E.updateClassDeclaration(t,void 0,v,t.name,R,pe,ne));case 236:return ge(function(t){if(e.forEach(t.declarationList.declarations,q)){var r=e.visitNodes(t.declarationList.declarations,ee);if(e.length(r))return E.updateVariableStatement(t,E.createNodeArray(se(t)),E.updateVariableDeclarationList(t.declarationList,r))}}(t));case 259:return ge(E.updateEnumDeclaration(t,void 0,E.createNodeArray(se(t)),t.name,E.createNodeArray(e.mapDefined(t.members,(function(e){if(!ae(e)){var t=F.getConstantValue(e);return Y(E.updateEnumMember(e,e.name,void 0!==t?"string"==typeof t?E.createStringLiteral(t):E.createNumericLiteral(t):void 0),e)}})))))}return e.Debug.assertNever(t,"Unhandled top-level node in declaration emit: ".concat(e.SyntaxKind[t.kind]))}}var fe;function ge(n){return Q(t)&&(a=r),o&&(b=s),260===t.kind&&(x=c),n===t?n:(f=void 0,p=void 0,n&&e.setOriginalNode(Y(n,t),t))}}function ie(t){return e.flatten(e.mapDefined(t.elements,(function(t){return function(t){if(226!==t.kind&&t.name){if(!q(t))return;return e.isBindingPattern(t.name)?ie(t.name):E.createVariableDeclaration(t.name,void 0,K(t,void 0),void 0)}}(t)})))}function ae(e){return !!w&&!!e&&r(e,g)}function oe(t){return e.isExportAssignment(t)||e.isExportDeclaration(t)}function se(t){var r=e.getEffectiveModifierFlags(t),n=function(t){var r=11003,n=x&&!function(e){return 257===e.kind}(t)?2:0,i=303===t.parent.kind;return (!i||D&&i&&e.isExternalModule(t.parent))&&(r^=2,n=0),o(t,r,n)}(t);return r===n?t.modifiers:E.createModifiersFromModifierFlags(n)}function ce(t,r){var n=s(t);return n||t===r.firstAccessor||(n=s(r.firstAccessor),b=e.createGetSymbolAccessibilityDiagnosticForNode(r.firstAccessor)),!n&&r.secondAccessor&&t!==r.secondAccessor&&(n=s(r.secondAccessor),b=e.createGetSymbolAccessibilityDiagnosticForNode(r.secondAccessor)),n}function le(t){return E.createNodeArray(e.filter(e.map(t,(function(t){return E.updateHeritageClause(t,e.visitNodes(E.createNodeArray(e.filter(t.types,(function(r){return e.isEntityNameExpression(r.expression)||94===t.token&&104===r.expression.kind}))),ee))})),(function(e){return e.types&&!!e.types.length})))}}function o(t,r,n){void 0===r&&(r=27643),void 0===n&&(n=0);var i=e.getEffectiveModifierFlags(t)&r|n;return 512&i&&!(1&i)&&(i^=1),512&i&&2&i&&(i^=2),i}function s(e){if(e)return 171===e.kind?e.type:e.parameters.length>0?e.parameters[0].type:void 0}e.transformDeclarations=a;}(t),function(e){var t,r;function i(t,r,n){if(n)return e.emptyArray;var i=e.getEmitScriptTarget(t),a=e.getEmitModuleKind(t),o=[];return e.addRange(o,r&&e.map(r.before,s)),o.push(e.transformTypeScript),o.push(e.transformClassFields),e.getJSXTransformEnabled(t)&&o.push(e.transformJsx),i<99&&o.push(e.transformESNext),i<8&&o.push(e.transformES2021),i<7&&o.push(e.transformES2020),i<6&&o.push(e.transformES2019),i<5&&o.push(e.transformES2018),i<4&&o.push(e.transformES2017),i<3&&o.push(e.transformES2016),i<2&&(o.push(e.transformES2015),o.push(e.transformGenerators)),o.push(function(t){switch(t){case e.ModuleKind.ESNext:case e.ModuleKind.ES2022:case e.ModuleKind.ES2020:case e.ModuleKind.ES2015:return e.transformECMAScriptModule;case e.ModuleKind.System:return e.transformSystemModule;case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return e.transformNodeModule;default:return e.transformModule}}(a)),i<1&&o.push(e.transformES5),e.addRange(o,r&&e.map(r.after,s)),o}function a(t){var r=[];return r.push(e.transformDeclarations),e.addRange(r,t&&e.map(t.afterDeclarations,c)),r}function o(t,r){return function(n){var i=t(n);return "function"==typeof i?r(n,i):function(t){return function(r){return e.isBundle(r)?t.transformBundle(r):t.transformSourceFile(r)}}(i)}}function s(t){return o(t,e.chainBundle)}function c(e){return o(e,(function(e,t){return t}))}function l(e,t){return t}function u(e,t,r){r(e,t);}!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Completed=2]="Completed",e[e.Disposed=3]="Disposed";}(t||(t={})),function(e){e[e.Substitution=1]="Substitution",e[e.EmitNotifications=2]="EmitNotifications";}(r||(r={})),e.noTransformers={scriptTransformers:e.emptyArray,declarationTransformers:e.emptyArray},e.getTransformers=function(e,t,r){return {scriptTransformers:i(e,t,r),declarationTransformers:a(t)}},e.noEmitSubstitution=l,e.noEmitNotification=u,e.transformNodes=function(t,r,i,a,o,s,c){for(var _,d,p,f,g,m=new Array(353),y=0,v=[],h=[],b=[],x=[],D=0,S=!1,T=[],C=0,E=l,k=u,N=0,F=[],A={factory:i,getCompilerOptions:function(){return a},getEmitResolver:function(){return t},getEmitHost:function(){return r},getEmitHelperFactory:e.memoize((function(){return e.createEmitHelperFactory(A)})),startLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),v[D]=_,h[D]=d,b[D]=p,x[D]=y,D++,_=void 0,d=void 0,p=void 0,y=0;},suspendLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is already suspended."),S=!0;},resumeLexicalEnvironment:function(){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(S,"Lexical environment is not suspended."),S=!1;},endLexicalEnvironment:function(){var t;if(e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.Debug.assert(!S,"Lexical environment is suspended."),_||d||p){if(d&&(t=n$3([],d,!0)),_){var r=i.createVariableStatement(void 0,i.createVariableDeclarationList(_));e.setEmitFlags(r,1048576),t?t.push(r):t=[r];}p&&(t=n$3(t?n$3([],t,!0):[],p,!0));}return D--,_=v[D],d=h[D],p=b[D],y=x[D],0===D&&(v=[],h=[],b=[],x=[]),t},setLexicalEnvironmentFlags:function(e,t){y=t?y|e:y&~e;},getLexicalEnvironmentFlags:function(){return y},hoistVariableDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed.");var r=e.setEmitFlags(i.createVariableDeclaration(t),64);_?_.push(r):_=[r],1&y&&(y|=2);},hoistFunctionDeclaration:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),d?d.push(t):d=[t];},addInitializationStatement:function(t){e.Debug.assert(N>0,"Cannot modify the lexical environment during initialization."),e.Debug.assert(N<2,"Cannot modify the lexical environment after transformation has completed."),e.setEmitFlags(t,1048576),p?p.push(t):p=[t];},startBlockScope:function(){e.Debug.assert(N>0,"Cannot start a block scope during initialization."),e.Debug.assert(N<2,"Cannot start a block scope after transformation has completed."),T[C]=f,C++,f=void 0;},endBlockScope:function(){e.Debug.assert(N>0,"Cannot end a block scope during initialization."),e.Debug.assert(N<2,"Cannot end a block scope after transformation has completed.");var t=e.some(f)?[i.createVariableStatement(void 0,i.createVariableDeclarationList(f.map((function(e){return i.createVariableDeclaration(e)})),1))]:void 0;return C--,f=T[C],0===C&&(T=[]),t},addBlockScopedVariable:function(t){e.Debug.assert(C>0,"Cannot add a block scoped variable outside of an iteration body."),(f||(f=[])).push(t);},requestEmitHelper:function t(r){if(e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),e.Debug.assert(!r.scoped,"Cannot request a scoped emit helper."),r.dependencies)for(var n=0,i=r.dependencies;n<i.length;n++){t(i[n]);}g=e.append(g,r);},readEmitHelpers:function(){e.Debug.assert(N>0,"Cannot modify the transformation context during initialization."),e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed.");var t=g;return g=void 0,t},enableSubstitution:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=1;},enableEmitNotification:function(t){e.Debug.assert(N<2,"Cannot modify the transformation context after transformation has completed."),m[t]|=2;},isSubstitutionEnabled:J,isEmitNotificationEnabled:z,get onSubstituteNode(){return E},set onSubstituteNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),E=t;},get onEmitNode(){return k},set onEmitNode(t){e.Debug.assert(N<1,"Cannot modify transformation hooks after initialization has completed."),e.Debug.assert(void 0!==t,"Value must not be 'undefined'"),k=t;},addDiagnostic:function(e){F.push(e);}},P=0,w=o;P<w.length;P++){var I=w[P];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(I)));}e.performance.mark("beforeTransform");var O=s.map((function(e){return e(A)})),M=function(e){for(var t=0,r=O;t<r.length;t++)e=(0, r[t])(e);return e};N=1;for(var L=[],R=0,B=o;R<B.length;R++)I=B[R],null===e.tracing||void 0===e.tracing||e.tracing.push("emit","transformNodes",303===I.kind?{path:I.path}:{kind:I.kind,pos:I.pos,end:I.end}),L.push((c?M:j)(I)),null===e.tracing||void 0===e.tracing||e.tracing.pop();return N=2,e.performance.mark("afterTransform"),e.performance.measure("transformTime","beforeTransform","afterTransform"),{transformed:L,substituteNode:function(t,r){return e.Debug.assert(N<3,"Cannot substitute a node after the result is disposed."),r&&J(r)&&E(t,r)||r},emitNodeWithNotification:function(t,r,n){e.Debug.assert(N<3,"Cannot invoke TransformationResult callbacks after the result is disposed."),r&&(z(r)?k(t,r,n):n(t,r));},isEmitNotificationEnabled:z,dispose:function(){if(N<3){for(var t=0,r=o;t<r.length;t++){var n=r[t];e.disposeEmitNodes(e.getSourceFileOfNode(e.getParseTreeNode(n)));}_=void 0,v=void 0,d=void 0,h=void 0,E=void 0,k=void 0,g=void 0,N=3;}},diagnostics:F};function j(t){return !t||e.isSourceFile(t)&&t.isDeclarationFile?t:M(t)}function J(t){return 0!=(1&m[t.kind])&&0==(4&e.getEmitFlags(t))}function z(t){return 0!=(2&m[t.kind])||0!=(2&e.getEmitFlags(t))}},e.nullTransformationContext={factory:e.factory,getCompilerOptions:function(){return {}},getEmitResolver:e.notImplemented,getEmitHost:e.notImplemented,getEmitHelperFactory:e.notImplemented,startLexicalEnvironment:e.noop,resumeLexicalEnvironment:e.noop,suspendLexicalEnvironment:e.noop,endLexicalEnvironment:e.returnUndefined,setLexicalEnvironmentFlags:e.noop,getLexicalEnvironmentFlags:function(){return 0},hoistVariableDeclaration:e.noop,hoistFunctionDeclaration:e.noop,addInitializationStatement:e.noop,startBlockScope:e.noop,endBlockScope:e.returnUndefined,addBlockScopedVariable:e.noop,requestEmitHelper:e.noop,readEmitHelpers:e.notImplemented,enableSubstitution:e.noop,enableEmitNotification:e.noop,isSubstitutionEnabled:e.notImplemented,isEmitNotificationEnabled:e.notImplemented,onSubstituteNode:l,onEmitNode:u,addDiagnostic:e.noop};}(t),function(e){var t,r,i=function(){var e=[];return e[1024]=["{","}"],e[2048]=["(",")"],e[4096]=["<",">"],e[8192]=["[","]"],e}();function a(t,r,n,i,a,s){void 0===i&&(i=!1);var l=e.isArray(n)?n:e.getSourceFilesToEmit(t,n,i),u=t.getCompilerOptions();if(e.outFile(u)){var _=t.getPrependNodes();if(l.length||_.length){var d=e.factory.createBundle(l,_);if(g=r(c(d,t,i),d))return g}}else {if(!a)for(var p=0,f=l;p<f.length;p++){var g,m=f[p];if(g=r(c(m,t,i),m))return g}if(s){var y=o(u);if(y)return r({buildInfoPath:y},void 0)}}}function o(t){var r=t.configFilePath;if(e.isIncrementalCompilation(t)){if(t.tsBuildInfoFile)return t.tsBuildInfoFile;var n,i=e.outFile(t);if(i)n=e.removeFileExtension(i);else {if(!r)return;var a=e.removeFileExtension(r);n=t.outDir?t.rootDir?e.resolvePath(t.outDir,e.getRelativePathFromDirectory(t.rootDir,a,!0)):e.combinePaths(t.outDir,e.getBaseFileName(a)):a;}return n+".tsbuildinfo"}}function s(t,r){var n=e.outFile(t),i=t.emitDeclarationOnly?void 0:n,a=i&&l(i,t),s=r||e.getEmitDeclarations(t)?e.removeFileExtension(n)+".d.ts":void 0;return {jsFilePath:i,sourceMapFilePath:a,declarationFilePath:s,declarationMapPath:s&&e.getAreDeclarationMapsEnabled(t)?s+".map":void 0,buildInfoPath:o(t)}}function c(t,r,n){var i=r.getCompilerOptions();if(304===t.kind)return s(i,n);var a=e.getOwnEmitOutputFilePath(t.fileName,r,u(t.fileName,i)),o=e.isJsonSourceFile(t),c=o&&0===e.comparePaths(t.fileName,a,r.getCurrentDirectory(),!r.useCaseSensitiveFileNames()),_=i.emitDeclarationOnly||c?void 0:a,d=!_||e.isJsonSourceFile(t)?void 0:l(_,i),p=n||e.getEmitDeclarations(i)&&!o?e.getDeclarationEmitOutputFilePath(t.fileName,r):void 0;return {jsFilePath:_,sourceMapFilePath:d,declarationFilePath:p,declarationMapPath:p&&e.getAreDeclarationMapsEnabled(i)?p+".map":void 0,buildInfoPath:void 0}}function l(e,t){return t.sourceMap&&!t.inlineSourceMap?e+".map":void 0}function u(t,r){return e.fileExtensionIs(t,".json")?".json":1===r.jsx&&e.fileExtensionIsOneOf(t,[".jsx",".tsx"])?".jsx":e.fileExtensionIsOneOf(t,[".mts",".mjs"])?".mjs":e.fileExtensionIsOneOf(t,[".cts",".cjs"])?".cjs":".js"}function _(t,r,n,i,a){return i?e.resolvePath(i,e.getRelativePathFromDirectory(a?a():v(r,n),t,n)):t}function d(t,r,n,i){return e.changeExtension(_(t,r,n,r.options.declarationDir||r.options.outDir,i),e.getDeclarationEmitExtensionForPath(t))}function p(t,r,n,i){if(!r.options.emitDeclarationOnly){var a=e.fileExtensionIs(t,".json"),o=e.changeExtension(_(t,r,n,r.options.outDir,i),u(t,r.options));return a&&0===e.comparePaths(t,o,e.Debug.checkDefined(r.options.configFilePath),n)?void 0:o}}function f(){var t;return {addOutput:function(e){e&&(t||(t=[])).push(e);},getOutputs:function(){return t||e.emptyArray}}}function g(e,t){var r=s(e.options,!1),n=r.jsFilePath,i=r.sourceMapFilePath,a=r.declarationFilePath,o=r.declarationMapPath,c=r.buildInfoPath;t(n),t(i),t(a),t(o),t(c);}function m(t,r,n,i,a){if(!e.fileExtensionIs(r,".d.ts")){var o=p(r,t,n,a);if(i(o),!e.fileExtensionIs(r,".json")&&(o&&t.options.sourceMap&&i("".concat(o,".map")),e.getEmitDeclarations(t.options))){var s=d(r,t,n,a);i(s),t.options.declarationMap&&i("".concat(s,".map"));}}}function y(t,r,n,i,a){var o;return t.rootDir?(o=e.getNormalizedAbsolutePath(t.rootDir,n),null==a||a(t.rootDir)):t.composite&&t.configFilePath?(o=e.getDirectoryPath(e.normalizeSlashes(t.configFilePath)),null==a||a(o)):o=e.computeCommonSourceDirectoryOfFilenames(r(),n,i),o&&o[o.length-1]!==e.directorySeparator&&(o+=e.directorySeparator),o}function v(t,r){var n=t.options,i=t.fileNames;return y(n,(function(){return e.filter(i,(function(t){return !(n.noEmitForJsFiles&&e.fileExtensionIsOneOf(t,e.supportedJSExtensionsFlat)||e.fileExtensionIs(t,".d.ts"))}))}),e.getDirectoryPath(e.normalizeSlashes(e.Debug.checkDefined(n.configFilePath))),e.createGetCanonicalFileName(!r))}function h(t,r,n,i,o,s,c){var l,u,_=i.scriptTransformers,d=i.declarationTransformers,p=r.getCompilerOptions(),f=p.sourceMap||p.inlineSourceMap||e.getAreDeclarationMapsEnabled(p)?[]:void 0,g=p.listEmittedFiles?[]:void 0,m=e.createDiagnosticCollection(),y=e.getNewLineCharacter(p,(function(){return r.getNewLine()})),v=e.createTextWriter(y),h=e.performance.createTimer("printTime","beforePrint","afterPrint"),x=h.enter,S=h.exit,T=!1;return x(),a(r,(function(i,a){var s,f=i.jsFilePath,y=i.sourceMapFilePath,v=i.declarationFilePath,h=i.declarationMapPath,x=i.buildInfoPath;function S(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(s,t,r.getCanonicalFileName))}x&&a&&e.isBundle(a)&&(s=e.getDirectoryPath(e.getNormalizedAbsolutePath(x,r.getCurrentDirectory())),l={commonSourceDirectory:S(r.getCommonSourceDirectory()),sourceFiles:a.sourceFiles.map((function(t){return S(e.getNormalizedAbsolutePath(t.fileName,r.getCurrentDirectory()))}))}),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitJsFileOrBundle",{jsFilePath:f}),function(n,i,a,s){if(n&&!o&&i)if(i&&r.isEmitBlocked(i)||p.noEmit)T=!0;else {var c=e.transformNodes(t,r,e.factory,p,[n],_,!1),u=D({removeComments:p.removeComments,newLine:p.newLine,noEmitHelpers:p.noEmitHelpers,module:p.module,target:p.target,sourceMap:p.sourceMap,inlineSourceMap:p.inlineSourceMap,inlineSources:p.inlineSources,extendedDiagnostics:p.extendedDiagnostics,writeBundleFileInfo:!!l,relativeToBuildInfo:s},{hasGlobalName:t.hasGlobalName,onEmitNode:c.emitNodeWithNotification,isEmitNotificationEnabled:c.isEmitNotificationEnabled,substituteNode:c.substituteNode});e.Debug.assert(1===c.transformed.length,"Should only see one output from the transform"),E(i,a,c.transformed[0],u,p),c.dispose(),l&&(l.js=u.bundleFileInfo);}}(a,f,y,S),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitDeclarationFileOrBundle",{declarationFilePath:v}),function(n,i,a,s){if(n)if(i){var _=e.isSourceFile(n)?[n]:n.sourceFiles,f=c?_:e.filter(_,e.isSourceFileNotJson),g=e.outFile(p)?[e.factory.createBundle(f,e.isSourceFile(n)?void 0:n.prepends)]:f;o&&!e.getEmitDeclarations(p)&&f.forEach(C);var y=e.transformNodes(t,r,e.factory,p,g,d,!1);if(e.length(y.diagnostics))for(var v=0,h=y.diagnostics;v<h.length;v++){var b=h[v];m.add(b);}var x=D({removeComments:p.removeComments,newLine:p.newLine,noEmitHelpers:!0,module:p.module,target:p.target,sourceMap:p.sourceMap,inlineSourceMap:p.inlineSourceMap,extendedDiagnostics:p.extendedDiagnostics,onlyPrintJsDocStyle:!0,writeBundleFileInfo:!!l,recordInternalSection:!!l,relativeToBuildInfo:s},{hasGlobalName:t.hasGlobalName,onEmitNode:y.emitNodeWithNotification,isEmitNotificationEnabled:y.isEmitNotificationEnabled,substituteNode:y.substituteNode}),S=!!y.diagnostics&&!!y.diagnostics.length||!!r.isEmitBlocked(i)||!!p.noEmit;if(T=T||S,(!S||c)&&(e.Debug.assert(1===y.transformed.length,"Should only see one output from the decl transform"),E(i,a,y.transformed[0],x,{sourceMap:!c&&p.declarationMap,sourceRoot:p.sourceRoot,mapRoot:p.mapRoot,extendedDiagnostics:p.extendedDiagnostics}),c&&303===y.transformed[0].kind)){var k=y.transformed[0];u=k.exportedModulesFromDeclarationEmit;}y.dispose(),l&&(l.dts=x.bundleFileInfo);}else (o||p.emitDeclarationOnly)&&(T=!0);}(a,v,h,S),null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{buildInfoPath:x}),function(t,i){if(i&&!n&&!T){var a=r.getProgramBuildInfo();if(r.isEmitBlocked(i))T=!0;else {var o=e.version;e.writeFile(r,m,i,b({bundle:t,program:a,version:o}),!1);}}}(l,x),null===e.tracing||void 0===e.tracing||e.tracing.pop(),!T&&g&&(o||(f&&g.push(f),y&&g.push(y),x&&g.push(x)),v&&g.push(v),h&&g.push(h));}),e.getSourceFilesToEmit(r,n,c),c,s,!n),S(),{emitSkipped:T,diagnostics:m.getDiagnostics(),emittedFiles:g,sourceMaps:f,exportedModulesFromDeclarationEmit:u};function C(r){e.isExportAssignment(r)?79===r.expression.kind&&t.collectLinkedAliases(r.expression,!0):e.isExportSpecifier(r)?t.collectLinkedAliases(r.propertyName||r.name,!0):e.forEachChild(r,C);}function E(t,n,i,a,o){var s,c=304===i.kind?i:void 0,l=303===i.kind?i:void 0,u=c?c.sourceFiles:[l];if(function(t,r){return (t.sourceMap||t.inlineSourceMap)&&(303!==r.kind||!e.fileExtensionIs(r.fileName,".json"))}(o,i)&&(s=e.createSourceMapGenerator(r,e.getBaseFileName(e.normalizeSlashes(t)),function(t){var r=e.normalizeSlashes(t.sourceRoot||"");return r?e.ensureTrailingDirectorySeparator(r):r}(o),function(t,n,i){if(t.sourceRoot)return r.getCommonSourceDirectory();if(t.mapRoot){var a=e.normalizeSlashes(t.mapRoot);return i&&(a=e.getDirectoryPath(e.getSourceFilePathInNewDir(i.fileName,r,a))),0===e.getRootLength(a)&&(a=e.combinePaths(r.getCommonSourceDirectory(),a)),a}return e.getDirectoryPath(e.normalizePath(n))}(o,t,l),o)),c?a.writeBundle(c,v,s):a.writeFile(l,v,s),s){f&&f.push({inputSourceFileNames:s.getSources(),sourceMap:s.toJSON()});var _=function(t,n,i,a,o){if(t.inlineSourceMap){var s=n.toString(),c=e.base64encode(e.sys,s);return "data:application/json;base64,".concat(c)}var l=e.getBaseFileName(e.normalizeSlashes(e.Debug.checkDefined(a)));if(t.mapRoot){var u=e.normalizeSlashes(t.mapRoot);return o&&(u=e.getDirectoryPath(e.getSourceFilePathInNewDir(o.fileName,r,u))),0===e.getRootLength(u)?(u=e.combinePaths(r.getCommonSourceDirectory(),u),encodeURI(e.getRelativePathToDirectoryOrUrl(e.getDirectoryPath(e.normalizePath(i)),e.combinePaths(u,l),r.getCurrentDirectory(),r.getCanonicalFileName,!0))):encodeURI(e.combinePaths(u,l))}return encodeURI(l)}(o,s,t,n,l);if(_&&(v.isAtStartOfLine()||v.rawWrite(y),v.writeComment("//# ".concat("sourceMappingURL","=").concat(_))),n){var d=s.toString();e.writeFile(r,m,n,d,!1,u);}}else v.writeLine();e.writeFile(r,m,t,v.getText(),!!p.emitBOM,u),v.clear();}}function b(e){return JSON.stringify(e)}function x(e){return JSON.parse(e)}function D(t,r){void 0===t&&(t={}),void 0===r&&(r={});var n,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x,D,S=r.hasGlobalName,T=r.onEmitNode,C=void 0===T?e.noEmitNotification:T,E=r.isEmitNotificationEnabled,k=r.substituteNode,N=void 0===k?e.noEmitSubstitution:k,F=r.onBeforeEmitNode,A=r.onAfterEmitNode,P=r.onBeforeEmitNodeArray,w=r.onAfterEmitNodeArray,I=r.onBeforeEmitToken,O=r.onAfterEmitToken,M=!!t.extendedDiagnostics,L=e.getNewLineCharacter(t),R=e.getEmitModuleKind(t),B=new e.Map,j=t.preserveSourceNewlines,J=function(e){p.write(e);},z=t.writeBundleFileInfo?{sections:[]}:void 0,U=z?e.Debug.checkDefined(t.relativeToBuildInfo):void 0,K=t.recordInternalSection,V=0,q="text",W=!0,H=-1,G=-1,Q=-1,X=-1,Y=-1,Z=!1,$=!!t.removeComments,ee=e.performance.createTimerIf(M,"commentTime","beforeComment","afterComment"),te=ee.enter,re=ee.exit,ne=e.factory.parenthesizer,ie=function(){return e.createBinaryExpressionTrampoline((function(e,t){if(t){t.stackIndex++,t.preserveSourceNewlinesStack[t.stackIndex]=j,t.containerPosStack[t.stackIndex]=Q,t.containerEndStack[t.stackIndex]=X,t.declarationListContainerEndStack[t.stackIndex]=Y;var r=t.shouldEmitCommentsStack[t.stackIndex]=Ae(e),n=t.shouldEmitSourceMapsStack[t.stackIndex]=Pe(e);null==F||F(e),r&&Nr(e),n&&Qr(e),ke(e);}else t={stackIndex:0,preserveSourceNewlinesStack:[void 0],containerPosStack:[-1],containerEndStack:[-1],declarationListContainerEndStack:[-1],shouldEmitCommentsStack:[!1],shouldEmitSourceMapsStack:[!1]};return t}),(function(e,r,n){return t(e,n,"left")}),(function(e,t,r){var n=27!==e.kind,i=lr(r,r.left,e),a=lr(r,e,r.right);er(i,n),jr(e.pos),Xt(e,101===e.kind?jt:Jt),zr(e.end,!0),er(a,!0);}),(function(e,r,n){return t(e,n,"right")}),(function(e,t){if(tr(lr(e,e.left,e.operatorToken),lr(e,e.operatorToken,e.right)),t.stackIndex>0){var r=t.preserveSourceNewlinesStack[t.stackIndex],n=t.containerPosStack[t.stackIndex],i=t.containerEndStack[t.stackIndex],a=t.declarationListContainerEndStack[t.stackIndex],o=t.shouldEmitCommentsStack[t.stackIndex],s=t.shouldEmitSourceMapsStack[t.stackIndex];Ne(r),s&&Xr(e),o&&Fr(e,n,i,a),null==A||A(e),t.stackIndex--;}}),void 0);function t(t,r,n){var i="left"===n?ne.getParenthesizeLeftSideOfBinaryForOperator(r.operatorToken.kind):ne.getParenthesizeRightSideOfBinaryForOperator(r.operatorToken.kind),a=we(0,1,t);if(a===Re&&(e.Debug.assertIsDefined(x),a=Ie(1,1,t=i(e.cast(x,e.isExpression))),x=void 0),(a===kr||a===Gr||a===Me)&&e.isBinaryExpression(t))return t;D=i,a(1,t);}}();return xe(),{printNode:function(t,r,n){switch(t){case 0:e.Debug.assert(e.isSourceFile(r),"Expected a SourceFile node.");break;case 2:e.Debug.assert(e.isIdentifier(r),"Expected an Identifier node.");break;case 1:e.Debug.assert(e.isExpression(r),"Expected an Expression node.");}switch(r.kind){case 303:return oe(r);case 304:return ae(r);case 305:return i=r,a=me(),o=p,be(a,void 0),ve(4,i,void 0),xe(),p=o,ye()}var i,a,o;return se(t,r,n,me()),ye()},printList:function(e,t,r){return ce(e,t,r,me()),ye()},printFile:oe,printBundle:ae,writeNode:se,writeList:ce,writeFile:ge,writeBundle:fe,bundleFileInfo:z};function ae(e){return fe(e,me(),void 0),ye()}function oe(e){return ge(e,me(),void 0),ye()}function se(e,t,r,n){var i=p;be(n,void 0),ve(e,t,r),xe(),p=i;}function ce(e,t,r,n){var i=p;be(n,void 0),r&&he(r),wt(void 0,t,e),xe(),p=i;}function le(){return p.getTextPosWithWriteLine?p.getTextPosWithWriteLine():p.getTextPos()}function ue(t,r,n){var i=e.lastOrUndefined(z.sections);i&&i.kind===n?i.end=r:z.sections.push({pos:t,end:r,kind:n});}function _e(t){if(K&&z&&n&&(e.isDeclaration(t)||e.isVariableStatement(t))&&e.isInternalDeclaration(t,n)&&"internal"!==q){var r=q;return pe(p.getTextPos()),V=le(),q="internal",r}}function de(e){e&&(pe(p.getTextPos()),V=le(),q=e);}function pe(e){return V<e&&(ue(V,e,q),!0)}function fe(r,n,i){var a;g=!1;var o=p;be(n,i),vt(r),yt(r),Be(r),function(t){pt(!!t.hasNoDefaultLib,t.syntheticFileReferences||[],t.syntheticTypeReferences||[],t.syntheticLibReferences||[]);for(var r=0,n=t.prepends;r<n.length;r++){var i=n[r];if(e.isUnparsedSource(i)&&i.syntheticReferences)for(var a=0,o=i.syntheticReferences;a<o.length;a++)Se(o[a]),Wt();}}(r);for(var s=0,c=r.prepends;s<c.length;s++){var l=c[s];Wt();var u=p.getTextPos(),_=z&&z.sections;if(_&&(z.sections=[]),ve(4,l,void 0),z){var d=z.sections;z.sections=_,l.oldFileOfCurrentEmit?(a=z.sections).push.apply(a,d):(d.forEach((function(t){return e.Debug.assert(e.isBundleFileTextLike(t))})),z.sections.push({pos:u,end:p.getTextPos(),kind:"prepend",data:U(l.fileName),texts:d}));}}V=le();for(var f=0,m=r.sourceFiles;f<m.length;f++){var y=m[f];ve(0,y,y);}if(z&&r.sourceFiles.length&&pe(p.getTextPos())){var v=function(t){for(var r,n=new e.Set,i=0;i<t.sourceFiles.length;i++){for(var a=t.sourceFiles[i],o=void 0,s=0,c=0,l=a.statements;c<l.length;c++){var u=l[c];if(!e.isPrologueDirective(u))break;n.has(u.expression.text)||(n.add(u.expression.text),(o||(o=[])).push({pos:u.pos,end:u.end,expression:{pos:u.expression.pos,end:u.expression.end,text:u.expression.text}}),s=s<u.end?u.end:s);}o&&(r||(r=[])).push({file:i,text:a.text.substring(0,s),directives:o});}return r}(r);v&&(z.sources||(z.sources={}),z.sources.prologues=v);var h=function(r){var n;if(R!==e.ModuleKind.None&&!t.noEmitHelpers){for(var i=new e.Map,a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a],c=void 0!==e.getExternalHelpersModuleName(s),l=je(s);if(l)for(var u=0,_=l;u<_.length;u++){var d=_[u];d.scoped||c||i.get(d.name)||(i.set(d.name,!0),(n||(n=[])).push(d.name));}}return n}}(r);h&&(z.sources||(z.sources={}),z.sources.helpers=h);}xe(),p=o;}function ge(e,t,r){g=!0;var n=p;be(t,r),vt(e),yt(e),ve(0,e,e),xe(),p=n;}function me(){return f||(f=e.createTextWriter(L))}function ye(){var e=f.getText();return f.clear(),e}function ve(e,t,r){r&&he(r),Fe(e,t,void 0);}function he(e){n=e,h=void 0,b=void 0,e&&en(e);}function be(r,n){r&&t.omitTrailingSemicolon&&(r=e.getTrailingSemicolonDeferringWriter(r)),m=n,W=!(p=r)||!m;}function xe(){a=[],o=[],s=new e.Set,c=[],l=0,u=[],n=void 0,h=void 0,b=void 0,be(void 0,void 0);}function De(){return h||(h=e.getLineStarts(n))}function Se(e,t){if(void 0!==e){var r=_e(e);Fe(4,e,t),de(r);}}function Te(e){void 0!==e&&Fe(2,e,void 0);}function Ce(e,t){void 0!==e&&Fe(1,e,t);}function Ee(t){Fe(e.isStringLiteral(t)?6:4,t);}function ke(t){j&&134217728&e.getEmitFlags(t)&&(j=!1);}function Ne(e){j=e;}function Fe(e,t,r){D=r,we(0,e,t)(e,t),D=void 0;}function Ae(t){return !$&&!e.isSourceFile(t)}function Pe(t){return !(W||e.isSourceFile(t)||e.isInJsonFile(t)||e.isUnparsedSource(t)||e.isUnparsedPrepend(t))}function we(t,r,n){switch(t){case 0:if(C!==e.noEmitNotification&&(!E||E(n)))return Oe;case 1:if(N!==e.noEmitSubstitution&&(x=N(r,n)||n)!==n)return D&&(x=D(x)),Re;case 2:if(Ae(n))return kr;case 3:if(Pe(n))return Gr;case 4:return Me;default:return e.Debug.assertNever(t)}}function Ie(e,t,r){return we(e+1,t,r)}function Oe(e,t){var r=Ie(0,e,t);C(e,t,r);}function Me(e,t){if(null==F||F(t),j){var r=j;ke(t),Le(e,t),Ne(r);}else Le(e,t);null==A||A(t),D=void 0;}function Le(t,r,i){if(void 0===i&&(i=!0),i){var a=e.getSnippetElement(r);if(a)return function(e,t,r){switch(r.kind){case 1:!function(e,t,r){qt("${".concat(r.order,":")),Le(e,t,!1),qt("}");}(e,t,r);break;case 0:!function(e){qt("$".concat(e.order));}(r);}}(t,r,a)}if(0===t)return dt(e.cast(r,e.isSourceFile));if(2===t)return Ue(e.cast(r,e.isIdentifier));if(6===t)return Je(e.cast(r,e.isStringLiteral),!0);if(3===t)return function(e){Se(e.name),Kt(),jt("in"),Kt(),Se(e.constraint);}(e.cast(r,e.isTypeParameterDeclaration));if(5===t)return e.Debug.assertNode(r,e.isEmptyStatement),We(!0);if(4===t){switch(r.kind){case 15:case 16:case 17:return Je(r,!1);case 79:return Ue(r);case 80:return Ke(r);case 160:return function(e){(function(e){79===e.kind?Ce(e):Se(e);})(e.left),Rt("."),Se(e.right);}(r);case 161:return function(e){Rt("["),Ce(e.expression,ne.parenthesizeExpressionOfComputedPropertyName),Rt("]");}(r);case 162:return function(e){Se(e.name),e.constraint&&(Kt(),jt("extends"),Kt(),Se(e.constraint)),e.default&&(Kt(),Jt("="),Kt(),Se(e.default));}(r);case 163:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.dotDotDotToken),ht(e.name,zt),Se(e.questionToken),e.parent&&315===e.parent.kind&&!e.name?Se(e.type):xt(e.type),Dt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name?e.name.end:e.modifiers?e.modifiers.end:e.decorators?e.decorators.end:e.pos,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 164:return _=r,Rt("@"),void Ce(_.expression,ne.parenthesizeLeftSideOfAccess);case 165:return function(e){Et(e,e.decorators),bt(e,e.modifiers),ht(e.name,Vt),Se(e.questionToken),xt(e.type),Bt();}(r);case 166:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.name),Se(e.questionToken),Se(e.exclamationToken),xt(e.type),Dt(e.initializer,e.type?e.type.end:e.questionToken?e.questionToken.end:e.name.end,e),Bt();}(r);case 167:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),Se(e.name),Se(e.questionToken),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 168:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Se(e.asteriskToken),Se(e.name),Se(e.questionToken),Ye(e,Ze);}(r);case 169:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("static"),$e(e.body);}(r);case 170:return function(e){bt(e,e.modifiers),jt("constructor"),Ye(e,Ze);}(r);case 171:case 172:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt(171===e.kind?"get":"set"),Kt(),Se(e.name),Ye(e,Ze);}(r);case 173:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 174:return function(e){fr(e),Et(e,e.decorators),bt(e,e.modifiers),jt("new"),Kt(),Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type),Bt(),gr(e);}(r);case 175:return function(e){Et(e,e.decorators),bt(e,e.modifiers),wt(e,e.parameters,8848),xt(e.type),Bt();}(r);case 176:return function(e){e.assertsModifier&&(Se(e.assertsModifier),Kt()),Se(e.parameterName),e.type&&(Kt(),jt("is"),Kt(),Se(e.type));}(r);case 177:return function(e){Se(e.typeName),kt(e,e.typeArguments);}(r);case 178:return function(e){fr(e),Nt(e,e.typeParameters),At(e,e.parameters),Kt(),Rt("=>"),Kt(),Se(e.type),gr(e);}(r);case 179:return function(e){fr(e),bt(e,e.modifiers),jt("new"),Kt(),Nt(e,e.typeParameters),Ft(e,e.parameters),Kt(),Rt("=>"),Kt(),Se(e.type),gr(e);}(r);case 180:return function(e){jt("typeof"),Kt(),Se(e.exprName);}(r);case 181:return function(t){Rt("{");var r=1&e.getEmitFlags(t)?768:32897;wt(t,t.members,524288|r),Rt("}");}(r);case 182:return function(e){Se(e.elementType,ne.parenthesizeElementTypeOfArrayType),Rt("["),Rt("]");}(r);case 183:return function(t){Qe(22,t.pos,Rt,t);var r=1&e.getEmitFlags(t)?528:657;wt(t,t.elements,524288|r),Qe(23,t.elements.end,Rt,t);}(r);case 184:return function(e){Se(e.type,ne.parenthesizeElementTypeOfArrayType),Rt("?");}(r);case 186:return function(e){wt(e,e.types,516,ne.parenthesizeMemberOfElementType);}(r);case 187:return function(e){wt(e,e.types,520,ne.parenthesizeMemberOfElementType);}(r);case 188:return function(e){Se(e.checkType,ne.parenthesizeMemberOfConditionalType),Kt(),jt("extends"),Kt(),Se(e.extendsType,ne.parenthesizeMemberOfConditionalType),Kt(),Rt("?"),Kt(),Se(e.trueType),Kt(),Rt(":"),Kt(),Se(e.falseType);}(r);case 189:return function(e){jt("infer"),Kt(),Se(e.typeParameter);}(r);case 190:return function(e){Rt("("),Se(e.type),Rt(")");}(r);case 227:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),kt(e,e.typeArguments);}(r);case 191:return void jt("this");case 192:return function(e){Yt(e.operator,jt),Kt(),Se(e.type,ne.parenthesizeMemberOfElementType);}(r);case 193:return function(e){Se(e.objectType,ne.parenthesizeMemberOfElementType),Rt("["),Se(e.indexType),Rt("]");}(r);case 194:return function(t){var r=e.getEmitFlags(t);Rt("{"),1&r?Kt():(Wt(),Ht()),t.readonlyToken&&(Se(t.readonlyToken),144!==t.readonlyToken.kind&&jt("readonly"),Kt()),Rt("["),Fe(3,t.typeParameter),t.nameType&&(Kt(),jt("as"),Kt(),Se(t.nameType)),Rt("]"),t.questionToken&&(Se(t.questionToken),57!==t.questionToken.kind&&Rt("?")),Rt(":"),Kt(),Se(t.type),Bt(),1&r?Kt():(Wt(),Gt()),Rt("}");}(r);case 195:return function(e){Ce(e.literal);}(r);case 196:return function(e){Se(e.dotDotDotToken),Se(e.name),Se(e.questionToken),Qe(58,e.name.end,Rt,e),Kt(),Se(e.type);}(r);case 197:return function(e){Se(e.head),wt(e,e.templateSpans,262144);}(r);case 198:return function(e){Se(e.type),Se(e.literal);}(r);case 199:return function(e){e.isTypeOf&&(jt("typeof"),Kt()),jt("import"),Rt("("),Se(e.argument),Rt(")"),e.qualifier&&(Rt("."),Se(e.qualifier)),kt(e,e.typeArguments);}(r);case 200:return function(e){Rt("{"),wt(e,e.elements,525136),Rt("}");}(r);case 201:return function(e){Rt("["),wt(e,e.elements,524880),Rt("]");}(r);case 202:return function(e){Se(e.dotDotDotToken),e.propertyName&&(Se(e.propertyName),Rt(":"),Kt()),Se(e.name),Dt(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 232:return function(e){Ce(e.expression),Se(e.literal);}(r);case 233:return void Bt();case 234:return function(e){qe(e,!e.multiLine&&ur(e));}(r);case 236:return function(e){bt(e,e.modifiers),Se(e.declarationList),Bt();}(r);case 235:return We(!1);case 237:return function(t){Ce(t.expression,ne.parenthesizeExpressionOfExpressionStatement),(!e.isJsonSourceFile(n)||e.nodeIsSynthesized(t.expression))&&Bt();}(r);case 238:return function(e){var t=Qe(99,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.thenStatement),e.elseStatement&&(Zt(e,e.thenStatement,e.elseStatement),Qe(91,e.thenStatement.end,jt,e),238===e.elseStatement.kind?(Kt(),Se(e.elseStatement)):Ct(e,e.elseStatement));}(r);case 239:return function(t){Qe(90,t.pos,jt,t),Ct(t,t.statement),e.isBlock(t.statement)&&!j?Kt():Zt(t,t.statement,t.expression),He(t,t.statement.end),Bt();}(r);case 240:return function(e){He(e,e.pos),Ct(e,e.statement);}(r);case 241:return function(e){var t=Qe(97,e.pos,jt,e);Kt();var r=Qe(20,t,Rt,e);Ge(e.initializer),r=Qe(26,e.initializer?e.initializer.end:r,Rt,e),Tt(e.condition),r=Qe(26,e.condition?e.condition.end:r,Rt,e),Tt(e.incrementor),Qe(21,e.incrementor?e.incrementor.end:r,Rt,e),Ct(e,e.statement);}(r);case 242:return function(e){var t=Qe(97,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ge(e.initializer),Kt(),Qe(101,e.initializer.end,jt,e),Kt(),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 243:return function(e){var t=Qe(97,e.pos,jt,e);Kt(),function(e){e&&(Se(e),Kt());}(e.awaitModifier),Qe(20,t,Rt,e),Ge(e.initializer),Kt(),Qe(159,e.initializer.end,jt,e),Kt(),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 244:return function(e){Qe(86,e.pos,jt,e),St(e.label),Bt();}(r);case 245:return function(e){Qe(81,e.pos,jt,e),St(e.label),Bt();}(r);case 246:return function(e){Qe(105,e.pos,jt,e),Tt(e.expression),Bt();}(r);case 247:return function(e){var t=Qe(116,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Ct(e,e.statement);}(r);case 248:return function(e){var t=Qe(107,e.pos,jt,e);Kt(),Qe(20,t,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e),Kt(),Se(e.caseBlock);}(r);case 249:return function(e){Se(e.label),Qe(58,e.label.end,Rt,e),Kt(),Se(e.statement);}(r);case 250:return function(e){Qe(109,e.pos,jt,e),Tt(e.expression),Bt();}(r);case 251:return function(e){Qe(111,e.pos,jt,e),Kt(),Se(e.tryBlock),e.catchClause&&(Zt(e,e.tryBlock,e.catchClause),Se(e.catchClause)),e.finallyBlock&&(Zt(e,e.catchClause||e.tryBlock,e.finallyBlock),Qe(96,(e.catchClause||e.tryBlock).end,jt,e),Kt(),Se(e.finallyBlock));}(r);case 252:return function(e){Qt(87,e.pos,jt),Bt();}(r);case 253:return function(e){Se(e.name),Se(e.exclamationToken),xt(e.type),Dt(e.initializer,e.type?e.type.end:e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 254:return function(t){jt(e.isLet(t)?"let":e.isVarConst(t)?"const":"var"),Kt(),wt(t,t.declarations,528);}(r);case 255:return function(e){Xe(e);}(r);case 256:return function(e){rt(e);}(r);case 257:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("interface"),Kt(),Se(e.name),Nt(e,e.typeParameters),wt(e,e.heritageClauses,512),Kt(),Rt("{"),wt(e,e.members,129),Rt("}");}(r);case 258:return function(e){Et(e,e.decorators),bt(e,e.modifiers),jt("type"),Kt(),Se(e.name),Nt(e,e.typeParameters),Kt(),Rt("="),Kt(),Se(e.type),Bt();}(r);case 259:return function(e){bt(e,e.modifiers),jt("enum"),Kt(),Se(e.name),Kt(),Rt("{"),wt(e,e.members,145),Rt("}");}(r);case 260:return function(t){bt(t,t.modifiers),1024&~t.flags&&(jt(16&t.flags?"namespace":"module"),Kt()),Se(t.name);var r=t.body;if(!r)return Bt();for(;r&&e.isModuleDeclaration(r);)Rt("."),Se(r.name),r=r.body;Kt(),Se(r);}(r);case 261:return function(t){fr(t),e.forEach(t.statements,yr),qe(t,ur(t)),gr(t);}(r);case 262:return function(e){Qe(18,e.pos,Rt,e),wt(e,e.clauses,129),Qe(19,e.clauses.end,Rt,e,!0);}(r);case 263:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),t=Qe(127,t,jt,e),Kt(),t=Qe(142,t,jt,e),Kt(),Se(e.name),Bt();}(r);case 264:return function(e){bt(e,e.modifiers),Qe(100,e.modifiers?e.modifiers.end:e.pos,jt,e),Kt(),e.isTypeOnly&&(Qe(151,e.pos,jt,e),Kt()),Se(e.name),Kt(),Qe(63,e.name.end,Rt,e),Kt(),function(e){79===e.kind?Ce(e):Se(e);}(e.moduleReference),Bt();}(r);case 265:return function(e){bt(e,e.modifiers),Qe(100,e.modifiers?e.modifiers.end:e.pos,jt,e),Kt(),e.importClause&&(Se(e.importClause),Kt(),Qe(155,e.importClause.end,jt,e),Kt()),Ce(e.moduleSpecifier),e.assertClause&&St(e.assertClause),Bt();}(r);case 266:return function(e){e.isTypeOnly&&(Qe(151,e.pos,jt,e),Kt()),Se(e.name),e.name&&e.namedBindings&&(Qe(27,e.name.end,Rt,e),Kt()),Se(e.namedBindings);}(r);case 267:return function(e){var t=Qe(41,e.pos,Rt,e);Kt(),Qe(127,t,jt,e),Kt(),Se(e.name);}(r);case 273:return function(e){var t=Qe(41,e.pos,Rt,e);Kt(),Qe(127,t,jt,e),Kt(),Se(e.name);}(r);case 268:return function(e){nt(e);}(r);case 269:return function(e){it(e);}(r);case 270:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),e.isExportEquals?Qe(63,t,Jt,e):Qe(88,t,jt,e),Kt(),Ce(e.expression,e.isExportEquals?ne.getParenthesizeRightSideOfBinaryForOperator(63):ne.parenthesizeExpressionOfExportDefault),Bt();}(r);case 271:return function(e){var t=Qe(93,e.pos,jt,e);Kt(),e.isTypeOnly&&(t=Qe(151,t,jt,e),Kt()),e.exportClause?Se(e.exportClause):t=Qe(41,t,Rt,e),e.moduleSpecifier&&(Kt(),Qe(155,e.exportClause?e.exportClause.end:t,jt,e),Kt(),Ce(e.moduleSpecifier)),e.assertClause&&St(e.assertClause),Bt();}(r);case 272:return function(e){nt(e);}(r);case 274:return function(e){it(e);}(r);case 292:return function(e){Qe(129,e.pos,jt,e),Kt(),wt(e,e.elements,526226);}(r);case 293:return function(t){Se(t.name),Rt(":"),Kt();var r=t.value;0==(512&e.getEmitFlags(r))&&zr(e.getCommentRange(r).pos),Se(r);}(r);case 275:return;case 276:return function(e){jt("require"),Rt("("),Ce(e.expression),Rt(")");}(r);case 11:return function(e){p.writeLiteral(e.text);}(r);case 279:case 282:return function(t){if(Rt("<"),e.isJsxOpeningElement(t)){var r=or(t.tagName,t);at(t.tagName),kt(t,t.typeArguments),t.attributes.properties&&t.attributes.properties.length>0&&Kt(),Se(t.attributes),sr(t.attributes,t),tr(r);}Rt(">");}(r);case 280:case 283:return function(t){Rt("</"),e.isJsxClosingElement(t)&&at(t.tagName),Rt(">");}(r);case 284:return function(e){Se(e.name),function(e,t,r,n){r&&(t("="),n(r));}(0,Rt,e.initializer,Ee);}(r);case 285:return function(e){wt(e,e.properties,262656);}(r);case 286:return function(e){Rt("{..."),Ce(e.expression),Rt("}");}(r);case 287:return function(t){var r,i;if(t.expression||!$&&!e.nodeIsSynthesized(t)&&(function(t){var r=!1;return e.forEachTrailingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i=t.pos)||function(t){var r=!1;return e.forEachLeadingCommentRange((null==n?void 0:n.text)||"",t+1,(function(){return r=!0})),r}(i))){var a=n&&!e.nodeIsSynthesized(t)&&e.getLineAndCharacterOfPosition(n,t.pos).line!==e.getLineAndCharacterOfPosition(n,t.end).line;a&&p.increaseIndent();var o=Qe(18,t.pos,Rt,t);Se(t.dotDotDotToken),Ce(t.expression),Qe(19,(null===(r=t.expression)||void 0===r?void 0:r.end)||o,Rt,t),a&&p.decreaseIndent();}}(r);case 288:return function(e){Qe(82,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma),ot(e,e.statements,e.expression.end);}(r);case 289:return function(e){var t=Qe(88,e.pos,jt,e);ot(e,e.statements,t);}(r);case 290:return function(e){Kt(),Yt(e.token,jt),Kt(),wt(e,e.types,528);}(r);case 291:return function(e){var t=Qe(83,e.pos,jt,e);Kt(),e.variableDeclaration&&(Qe(20,t,Rt,e),Se(e.variableDeclaration),Qe(21,e.variableDeclaration.end,Rt,e),Kt()),Se(e.block);}(r);case 294:return function(t){Se(t.name),Rt(":"),Kt();var r=t.initializer;0==(512&e.getEmitFlags(r))&&zr(e.getCommentRange(r).pos),Ce(r,ne.parenthesizeExpressionForDisallowedComma);}(r);case 295:return function(e){Se(e.name),e.objectAssignmentInitializer&&(Kt(),Rt("="),Kt(),Ce(e.objectAssignmentInitializer,ne.parenthesizeExpressionForDisallowedComma));}(r);case 296:return function(e){e.expression&&(Qe(25,e.pos,Rt,e),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma));}(r);case 297:return function(e){Se(e.name),Dt(e.initializer,e.name.end,e,ne.parenthesizeExpressionForDisallowedComma);}(r);case 298:return ze(r);case 305:case 299:return function(e){for(var t=0,r=e.texts;t<r.length;t++){var n=r[t];Wt(),Se(n);}}(r);case 300:case 301:return l=r,u=le(),ze(l),void(z&&ue(u,p.getTextPos(),300===l.kind?"text":"internal"));case 302:return function(t){var r=le();if(ze(t),z){var n=e.clone(t.section);n.pos=r,n.end=p.getTextPos(),z.sections.push(n);}}(r);case 303:return dt(r);case 304:return e.Debug.fail("Bundles should be printed using printBundle");case 306:return e.Debug.fail("InputFiles should not be printed");case 307:return _t(r);case 308:return function(e){Kt(),Rt("{"),Se(e.name),Rt("}");}(r);case 310:return Rt("*");case 311:return Rt("?");case 312:return function(e){Rt("?"),Se(e.type);}(r);case 313:return function(e){Rt("!"),Se(e.type);}(r);case 314:return function(e){Se(e.type),Rt("=");}(r);case 315:return function(e){jt("function"),Ft(e,e.parameters),Rt(":"),Se(e.type);}(r);case 185:case 316:return function(e){Rt("..."),Se(e.type);}(r);case 317:return;case 318:return function(t){if(J("/**"),t.comment){var r=e.getTextOfJSDocComment(t.comment);if(r)for(var n=0,i=r.split(/\r\n?|\n/g);n<i.length;n++){var a=i[n];Wt(),Kt(),Rt("*"),Kt(),J(a);}}t.tags&&(1!==t.tags.length||341!==t.tags[0].kind||t.comment?wt(t,t.tags,33):(Kt(),Se(t.tags[0]))),Kt(),J("*/");}(r);case 320:return st(r);case 321:return ct(r);case 325:case 330:return lt((c=r).tagName),void ut(c.comment);case 326:case 327:return function(e){lt(e.tagName),Kt(),Rt("{"),Se(e.class),Rt("}"),ut(e.comment);}(r);case 328:case 329:return;case 331:case 332:case 333:case 334:case 335:return;case 336:return function(e){lt(e.tagName),e.name&&(Kt(),Se(e.name)),ut(e.comment),ct(e.typeExpression);}(r);case 338:case 345:return lt((s=r).tagName),_t(s.typeExpression),Kt(),s.isBracketed&&Rt("["),Se(s.name),s.isBracketed&&Rt("]"),void ut(s.comment);case 337:case 339:case 340:case 341:return function(e){lt(e.tagName),_t(e.typeExpression),ut(e.comment);}(r);case 342:return function(e){lt(e.tagName),_t(e.constraint),Kt(),wt(e,e.typeParameters,528),ut(e.comment);}(r);case 343:return function(e){lt(e.tagName),e.typeExpression&&(307===e.typeExpression.kind?_t(e.typeExpression):(Kt(),Rt("{"),J("Object"),e.typeExpression.isArrayType&&(Rt("["),Rt("]")),Rt("}"))),e.fullName&&(Kt(),Se(e.fullName)),ut(e.comment),e.typeExpression&&320===e.typeExpression.kind&&st(e.typeExpression);}(r);case 344:return function(e){lt(e.tagName),Se(e.name),ut(e.comment);}(r);case 347:case 351:case 350:return}if(e.isExpression(r)&&(t=1,N!==e.noEmitSubstitution)){var o=N(t,r)||r;o!==r&&(r=o,D&&(r=D(r)));}}var s,c,l,u,_;if(1===t)switch(r.kind){case 8:case 9:return function(e){Je(e,!1);}(r);case 10:case 13:case 14:return Je(r,!1);case 79:return Ue(r);case 80:return Ke(r);case 203:return function(e){It(e,e.elements,8914|(e.multiLine?65536:0),ne.parenthesizeExpressionForDisallowedComma);}(r);case 204:return function(t){e.forEach(t.properties,vr);var r=65536&e.getEmitFlags(t);r&&Ht();var i=t.multiLine?65536:0,a=n.languageVersion>=1&&!e.isJsonSourceFile(n)?64:0;wt(t,t.properties,526226|a|i),r&&Gt();}(r);case 205:return function(t){Ce(t.expression,ne.parenthesizeLeftSideOfAccess);var r=t.questionDotToken||e.setTextRangePosEnd(e.factory.createToken(24),t.expression.end,t.name.pos),n=lr(t,t.expression,r),i=lr(t,r,t.name);er(n,!1),28===r.kind||!function(t){if(t=e.skipPartiallyEmittedExpressions(t),e.isNumericLiteral(t)){var r=pr(t,!0,!1);return !t.numericLiteralFlags&&!e.stringContains(r,e.tokenToString(24))}if(e.isAccessExpression(t)){var n=e.getConstantValue(t);return "number"==typeof n&&isFinite(n)&&Math.floor(n)===n}}(t.expression)||p.hasTrailingComment()||p.hasTrailingWhitespace()||Rt("."),t.questionDotToken?Se(r):Qe(r.kind,t.expression.end,Rt,t),er(i,!1),Se(t.name),tr(n,i);}(r);case 206:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),Se(e.questionDotToken),Qe(22,e.expression.end,Rt,e),Ce(e.argumentExpression),Qe(23,e.argumentExpression.end,Rt,e);}(r);case 207:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Rt("("),Mt("0"),Rt(","),Kt()),Ce(t.expression,ne.parenthesizeLeftSideOfAccess),r&&Rt(")"),Se(t.questionDotToken),kt(t,t.typeArguments),It(t,t.arguments,2576,ne.parenthesizeExpressionForDisallowedComma);}(r);case 208:return function(e){Qe(103,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeExpressionOfNew),kt(e,e.typeArguments),It(e,e.arguments,18960,ne.parenthesizeExpressionForDisallowedComma);}(r);case 209:return function(t){var r=536870912&e.getEmitFlags(t);r&&(Rt("("),Mt("0"),Rt(","),Kt()),Ce(t.tag,ne.parenthesizeLeftSideOfAccess),r&&Rt(")"),kt(t,t.typeArguments),Kt(),Ce(t.template);}(r);case 210:return function(e){Rt("<"),Se(e.type),Rt(">"),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 211:return function(e){var t=Qe(20,e.pos,Rt,e),r=or(e.expression,e);Ce(e.expression,void 0),sr(e.expression,e),tr(r),Qe(21,e.expression?e.expression.end:t,Rt,e);}(r);case 212:return function(e){hr(e.name),Xe(e);}(r);case 213:return function(e){Et(e,e.decorators),bt(e,e.modifiers),Ye(e,Ve);}(r);case 214:return function(e){Qe(89,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 215:return function(e){Qe(112,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 216:return function(e){Qe(114,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 217:return function(e){Qe(132,e.pos,jt,e),Kt(),Ce(e.expression,ne.parenthesizeOperandOfPrefixUnary);}(r);case 218:return function(e){Yt(e.operator,Jt),function(e){var t=e.operand;return 218===t.kind&&(39===e.operator&&(39===t.operator||45===t.operator)||40===e.operator&&(40===t.operator||46===t.operator))}(e)&&Kt(),Ce(e.operand,ne.parenthesizeOperandOfPrefixUnary);}(r);case 219:return function(e){Ce(e.operand,ne.parenthesizeOperandOfPostfixUnary),Yt(e.operator,Jt);}(r);case 220:return ie(r);case 221:return function(e){var t=lr(e,e.condition,e.questionToken),r=lr(e,e.questionToken,e.whenTrue),n=lr(e,e.whenTrue,e.colonToken),i=lr(e,e.colonToken,e.whenFalse);Ce(e.condition,ne.parenthesizeConditionOfConditionalExpression),er(t,!0),Se(e.questionToken),er(r,!0),Ce(e.whenTrue,ne.parenthesizeBranchOfConditionalExpression),tr(t,r),er(n,!0),Se(e.colonToken),er(i,!0),Ce(e.whenFalse,ne.parenthesizeBranchOfConditionalExpression),tr(n,i);}(r);case 222:return function(e){Se(e.head),wt(e,e.templateSpans,262144);}(r);case 223:return function(e){Qe(125,e.pos,jt,e),Se(e.asteriskToken),Tt(e.expression,ne.parenthesizeExpressionForDisallowedComma);}(r);case 224:return function(e){Qe(25,e.pos,Rt,e),Ce(e.expression,ne.parenthesizeExpressionForDisallowedComma);}(r);case 225:return function(e){hr(e.name),rt(e);}(r);case 226:return;case 228:return function(e){Ce(e.expression,void 0),e.type&&(Kt(),jt("as"),Kt(),Se(e.type));}(r);case 229:return function(e){Ce(e.expression,ne.parenthesizeLeftSideOfAccess),Jt("!");}(r);case 230:return function(e){Qt(e.keywordToken,e.pos,Rt),Rt("."),Se(e.name);}(r);case 231:return e.Debug.fail("SyntheticExpression should never be printed.");case 277:return function(e){Se(e.openingElement),wt(e,e.children,262144),Se(e.closingElement);}(r);case 278:return function(e){Rt("<"),at(e.tagName),kt(e,e.typeArguments),Kt(),Se(e.attributes),Rt("/>");}(r);case 281:return function(e){Se(e.openingFragment),wt(e,e.children,262144),Se(e.closingFragment);}(r);case 346:return e.Debug.fail("SyntaxList should not be printed");case 347:return;case 348:return function(e){Ce(e.expression);}(r);case 349:return function(e){It(e,e.elements,528,void 0);}(r);case 350:case 351:return;case 352:return e.Debug.fail("SyntheticReferenceExpression should not be printed")}return e.isKeyword(r.kind)?Xt(r,jt):e.isTokenKind(r.kind)?Xt(r,Rt):void e.Debug.fail("Unhandled SyntaxKind: ".concat(e.Debug.formatSyntaxKind(r.kind),"."))}function Re(t,r){var n=Ie(1,t,r);e.Debug.assertIsDefined(x),r=x,x=void 0,n(t,r);}function Be(r){var i=!1,a=304===r.kind?r:void 0;if(!a||R!==e.ModuleKind.None){for(var o=a?a.prepends.length:0,s=a?a.sourceFiles.length+o:1,c=0;c<s;c++){var l=a?c<o?a.prepends[c]:a.sourceFiles[c-o]:r,u=e.isSourceFile(l)?l:e.isUnparsedSource(l)?void 0:n,_=t.noEmitHelpers||!!u&&e.hasRecordedExternalHelpers(u),d=(e.isSourceFile(l)||e.isUnparsedSource(l))&&!g,f=e.isUnparsedSource(l)?l.helpers:je(l);if(f)for(var m=0,y=f;m<y.length;m++){var v=y[m];if(v.scoped){if(a)continue}else {if(_)continue;if(d){if(B.get(v.name))continue;B.set(v.name,!0);}}var h=le();"string"==typeof v.text?$t(v.text):$t(v.text(Er)),z&&z.sections.push({pos:h,end:p.getTextPos(),kind:"emitHelpers",data:v.name}),i=!0;}}return i}}function je(t){var r=e.getEmitHelpers(t);return r&&e.stableSort(r,e.compareEmitHelpers)}function Je(r,n){var i,a=pr(r,t.neverAsciiEscape,n);!t.sourceMap&&!t.inlineSourceMap||10!==r.kind&&!e.isTemplateLiteralKind(r.kind)?(i=a,p.writeStringLiteral(i)):Mt(a);}function ze(e){p.rawWrite(e.parent.text.substring(e.pos,e.end));}function Ue(e){(e.symbol?Lt:J)(dr(e,!1),e.symbol),wt(e,e.typeArguments,53776);}function Ke(e){(e.symbol?Lt:J)(dr(e,!1),e.symbol);}function Ve(e){Nt(e,e.typeParameters),At(e,e.parameters),xt(e.type),Kt(),Se(e.equalsGreaterThanToken);}function qe(t,r){Qe(18,t.pos,Rt,t);var n=r||1&e.getEmitFlags(t)?768:129;wt(t,t.statements,n),Qe(19,t.statements.end,Rt,t,!!(1&n));}function We(e){e?Rt(";"):Bt();}function He(e,t){var r=Qe(115,t,jt,e);Kt(),Qe(20,r,Rt,e),Ce(e.expression),Qe(21,e.expression.end,Rt,e);}function Ge(e){void 0!==e&&(254===e.kind?Se(e):Ce(e));}function Qe(t,r,i,a,o){var s=e.getParseTreeNode(a),c=s&&s.kind===a.kind,l=r;if(c&&n&&(r=e.skipTrivia(n.text,r)),c&&a.pos!==l){var u=o&&n&&!e.positionsAreOnSameLine(l,r,n);u&&Ht(),jr(l),u&&Gt();}if(r=Yt(t,i,r),c&&a.end!==r){var _=287===a.kind;zr(r,!_,_);}return r}function Xe(e){Et(e,e.decorators),bt(e,e.modifiers),jt("function"),Se(e.asteriskToken),Kt(),Te(e.name),Ye(e,Ze);}function Ye(t,r){var n=t.body;if(n)if(e.isBlock(n)){var i=65536&e.getEmitFlags(t);i&&Ht(),fr(t),e.forEach(t.parameters,yr),yr(t.body),r(t),$e(n),gr(t),i&&Gt();}else r(t),Kt(),Ce(n,ne.parenthesizeConciseBodyOfArrowFunction);else r(t),Bt();}function Ze(e){Nt(e,e.typeParameters),Ft(e,e.parameters),xt(e.type);}function $e(t){null==F||F(t),Kt(),Rt("{"),Ht();var r=function(t){if(1&e.getEmitFlags(t))return !0;if(t.multiLine)return !1;if(!e.nodeIsSynthesized(t)&&!e.rangeIsOnSingleLine(t,n))return !1;if(rr(t,t.statements,2)||ir(t,t.statements,2))return !1;for(var r,i=0,a=t.statements;i<a.length;i++){var o=a[i];if(nr(r,o,2)>0)return !1;r=o;}return !0}(t)?et:tt;Ir?Ir(t,t.statements,r):r(t),Gt(),Qt(19,t.statements.end,Rt,t),null==A||A(t);}function et(e){tt(e,!0);}function tt(e,t){var r=gt(e.statements),n=p.getTextPos();Be(e),0===r&&n===p.getTextPos()&&t?(Gt(),wt(e,e.statements,768),Ht()):wt(e,e.statements,1,void 0,r);}function rt(t){e.forEach(t.members,vr),Et(t,t.decorators),bt(t,t.modifiers),jt("class"),t.name&&(Kt(),Te(t.name));var r=65536&e.getEmitFlags(t);r&&Ht(),Nt(t,t.typeParameters),wt(t,t.heritageClauses,0),Kt(),Rt("{"),wt(t,t.members,129),Rt("}"),r&&Gt();}function nt(e){Rt("{"),wt(e,e.elements,525136),Rt("}");}function it(e){e.isTypeOnly&&(jt("type"),Kt()),e.propertyName&&(Se(e.propertyName),Kt(),Qe(127,e.propertyName.end,jt,e),Kt()),Se(e.name);}function at(e){79===e.kind?Ce(e):Se(e);}function ot(t,r,i){var a=163969;1===r.length&&(e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r[0])||e.rangeStartPositionsAreOnSameLine(t,r[0],n))?(Qt(58,i,Rt,t),Kt(),a&=-130):Qe(58,i,Rt,t),wt(t,r,a);}function st(t){wt(t,e.factory.createNodeArray(t.jsDocPropertyTags),33);}function ct(t){t.typeParameters&&wt(t,e.factory.createNodeArray(t.typeParameters),33),t.parameters&&wt(t,e.factory.createNodeArray(t.parameters),33),t.type&&(Wt(),Kt(),Rt("*"),Kt(),Se(t.type));}function lt(e){Rt("@"),Se(e);}function ut(t){var r=e.getTextOfJSDocComment(t);r&&(Kt(),J(r));}function _t(e){e&&(Kt(),Rt("{"),Se(e.type),Rt("}"));}function dt(t){Wt();var r=t.statements;!Ir||0!==r.length&&e.isPrologueDirective(r[0])&&!e.nodeIsSynthesized(r[0])?ft(t):Ir(t,r,ft);}function pt(e,t,r,i){if(e){var a=p.getTextPos();Ut('/// <reference no-default-lib="true"/>'),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"no-default-lib"}),Wt();}if(n&&n.moduleName&&(Ut('/// <amd-module name="'.concat(n.moduleName,'" />')),Wt()),n&&n.amdDependencies)for(var o=0,s=n.amdDependencies;o<s.length;o++){var c=s[o];c.name?Ut('/// <amd-dependency name="'.concat(c.name,'" path="').concat(c.path,'" />')):Ut('/// <amd-dependency path="'.concat(c.path,'" />')),Wt();}for(var l=0,u=t;l<u.length;l++){var _=u[l];a=p.getTextPos(),Ut('/// <reference path="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"reference",data:_.fileName}),Wt();}for(var d=0,f=r;d<f.length;d++)_=f[d],a=p.getTextPos(),Ut('/// <reference types="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"type",data:_.fileName}),Wt();for(var g=0,m=i;g<m.length;g++)_=m[g],a=p.getTextPos(),Ut('/// <reference lib="'.concat(_.fileName,'" />')),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"lib",data:_.fileName}),Wt();}function ft(t){var r=t.statements;fr(t),e.forEach(t.statements,yr),Be(t);var n=e.findIndex(r,(function(t){return !e.isPrologueDirective(t)}));!function(e){e.isDeclarationFile&&pt(e.hasNoDefaultLib,e.referencedFiles,e.typeReferenceDirectives,e.libReferenceDirectives);}(t),wt(t,r,1,void 0,-1===n?r.length:n),gr(t);}function gt(t,r,n,i){for(var a=!!r,o=0;o<t.length;o++){var s=t[o];if(!e.isPrologueDirective(s))return o;if(!n||!n.has(s.expression.text)){a&&(a=!1,he(r)),Wt();var c=p.getTextPos();Se(s),i&&z&&z.sections.push({pos:c,end:p.getTextPos(),kind:"prologue",data:s.expression.text}),n&&n.add(s.expression.text);}}return t.length}function mt(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(!t.has(i.data)){Wt();var a=p.getTextPos();Se(i),z&&z.sections.push({pos:a,end:p.getTextPos(),kind:"prologue",data:i.data}),t&&t.add(i.data);}}}function yt(t){if(e.isSourceFile(t))gt(t.statements,t);else {for(var r=new e.Set,n=0,i=t.prepends;n<i.length;n++)mt(i[n].prologues,r);for(var a=0,o=t.sourceFiles;a<o.length;a++){var s=o[a];gt(s.statements,s,r,!0);}he(void 0);}}function vt(t){if(e.isSourceFile(t)||e.isUnparsedSource(t)){var r=e.getShebang(t.text);if(r)return Ut(r),Wt(),!0}else {for(var n=0,i=t.prepends;n<i.length;n++){var a=i[n];if(e.Debug.assertNode(a,e.isUnparsedSource),vt(a))return !0}for(var o=0,s=t.sourceFiles;o<s.length;o++)if(vt(s[o]))return !0}}function ht(e,t){if(e){var r=J;J=t,Se(e),J=r;}}function bt(e,t){t&&t.length&&(wt(e,t,262656),Kt());}function xt(e){e&&(Rt(":"),Kt(),Se(e));}function Dt(e,t,r,n){e&&(Kt(),Qe(63,t,Jt,r),Kt(),Ce(e,n));}function St(e){e&&(Kt(),Se(e));}function Tt(e,t){e&&(Kt(),Ce(e,t));}function Ct(t,r){e.isBlock(r)||1&e.getEmitFlags(t)?(Kt(),Se(r)):(Wt(),Ht(),e.isEmptyStatement(r)?Fe(5,r):Se(r),Gt());}function Et(e,t){wt(e,t,2146305);}function kt(e,t){wt(e,t,53776,ne.parenthesizeMemberOfElementType);}function Nt(t,r){if(e.isFunctionLike(t)&&t.typeArguments)return kt(t,t.typeArguments);wt(t,r,53776);}function Ft(e,t){wt(e,t,2576);}function At(t,r){!function(t,r){var n=e.singleOrUndefined(r);return n&&n.pos===t.pos&&e.isArrowFunction(t)&&!t.type&&!e.some(t.decorators)&&!e.some(t.modifiers)&&!e.some(t.typeParameters)&&!e.some(n.decorators)&&!e.some(n.modifiers)&&!n.dotDotDotToken&&!n.questionToken&&!n.type&&!n.initializer&&e.isIdentifier(n.name)}(t,r)?Ft(t,r):wt(t,r,528);}function Pt(e){switch(60&e){case 0:break;case 16:Rt(",");break;case 4:Kt(),Rt("|");break;case 32:Kt(),Rt("*"),Kt();break;case 8:Kt(),Rt("&");}}function wt(e,t,r,n,i,a){Ot(Se,e,t,r,n,i,a);}function It(e,t,r,n,i,a){Ot(Ce,e,t,r,n,i,a);}function Ot(t,r,a,o,s,c,l){if(void 0===c&&(c=0),void 0===l&&(l=a?a.length-c:0),!(void 0===a&&16384&o)){var u=void 0===a||c>=a.length||0===l;if(u&&32768&o)return P&&P(a),void(w&&w(a));if(15360&o&&(Rt(function(e){return i[15360&e][0]}(o)),u&&a&&zr(a.pos,!0)),P&&P(a),u)1&o&&(!j||r&&!e.rangeIsOnSingleLine(r,n))?Wt():256&o&&!(524288&o)&&Kt();else {e.Debug.type(a);var _=0==(262144&o),p=_,f=rr(r,a,o);f?(Wt(f),p=!1):256&o&&Kt(),128&o&&Ht();for(var g=void 0,m=void 0,y=!1,v=0;v<l;v++){var h=a[c+v];if(32&o)Wt(),Pt(o);else if(g){60&o&&g.end!==(r?r.end:-1)&&jr(g.end),Pt(o),de(m);var b=nr(g,h,o);b>0?(0==(131&o)&&(Ht(),y=!0),Wt(b),p=!1):g&&512&o&&Kt();}m=_e(h),p?zr&&zr(e.getCommentRange(h).pos):p=_,d=h.pos,1===t.length?t(h):t(h,s),y&&(Gt(),y=!1),g=h;}var x=g?e.getEmitFlags(g):0,D=$||!!(1024&x),S=(null==a?void 0:a.hasTrailingComma)&&64&o&&16&o;S&&(g&&!D?Qe(27,g.end,Rt,g):Rt(",")),g&&(r?r.end:-1)!==g.end&&60&o&&!D&&jr(S&&(null==a?void 0:a.end)?a.end:g.end),128&o&&Gt(),de(m);var T=ir(r,a,o);T?Wt(T):2097408&o&&Kt();}w&&w(a),15360&o&&(u&&a&&jr(a.end),Rt(function(e){return i[15360&e][1]}(o)));}}function Mt(e){p.writeLiteral(e);}function Lt(e,t){p.writeSymbol(e,t);}function Rt(e){p.writePunctuation(e);}function Bt(){p.writeTrailingSemicolon(";");}function jt(e){p.writeKeyword(e);}function Jt(e){p.writeOperator(e);}function zt(e){p.writeParameter(e);}function Ut(e){p.writeComment(e);}function Kt(){p.writeSpace(" ");}function Vt(e){p.writeProperty(e);}function qt(e){p.nonEscapingWrite?p.nonEscapingWrite(e):p.write(e);}function Wt(e){void 0===e&&(e=1);for(var t=0;t<e;t++)p.writeLine(t>0);}function Ht(){p.increaseIndent();}function Gt(){p.decreaseIndent();}function Qt(t,r,n,i){return W?Yt(t,n,r):function(t,r,n,i,a){if(W||t&&e.isInJsonFile(t))return a(r,n,i);var o=t&&t.emitNode,s=o&&o.flags||0,c=o&&o.tokenSourceMapRanges&&o.tokenSourceMapRanges[r],l=c&&c.source||y;return i=Yr(l,c?c.pos:i),0==(128&s)&&i>=0&&$r(l,i),i=a(r,n,i),c&&(i=c.end),0==(256&s)&&i>=0&&$r(l,i),i}(i,t,n,r,Yt)}function Xt(t,r){I&&I(t),r(e.tokenToString(t.kind)),O&&O(t);}function Yt(t,r,n){var i=e.tokenToString(t);return r(i),n<0?n:n+i.length}function Zt(t,r,n){if(1&e.getEmitFlags(t))Kt();else if(j){var i=lr(t,r,n);i?Wt(i):Kt();}else Wt();}function $t(t){for(var r=t.split(/\r\n?|\n/g),n=e.guessIndentation(r),i=0,a=r;i<a.length;i++){var o=a[i],s=n?o.slice(n):o;s.length&&(Wt(),J(s));}}function er(e,t){e?(Ht(),Wt(e)):t&&Kt();}function tr(e,t){e&&Gt(),t&&Gt();}function rr(t,r,i){if(2&i||j){if(65536&i)return 1;var a=r[0];if(void 0===a)return !t||e.rangeIsOnSingleLine(t,n)?0:1;if(a.pos===d)return 0;if(11===a.kind)return 0;if(t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||e.getOriginalNode(a.parent)===e.getOriginalNode(t)))return j?ar((function(r){return e.getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(a.pos,t.pos,n,r)})):e.rangeStartPositionsAreOnSameLine(t,a,n)?0:1;if(cr(a,i))return 1}return 1&i?1:0}function nr(t,r,i){if(2&i||j){if(void 0===t||void 0===r)return 0;if(11===r.kind)return 0;if(!e.nodeIsSynthesized(t)&&!e.nodeIsSynthesized(r))return j&&function(t,r){if(r.pos<t.end)return !1;t=e.getOriginalNode(t),r=e.getOriginalNode(r);var n=t.parent;if(!n||n!==r.parent)return !1;var i=e.getContainingNodeArray(t),a=null==i?void 0:i.indexOf(t);return void 0!==a&&a>-1&&i.indexOf(r)===a+1}(t,r)?ar((function(i){return e.getLinesBetweenRangeEndAndRangeStart(t,r,n,i)})):!j&&(a=t,o=r,(a=e.getOriginalNode(a)).parent&&a.parent===e.getOriginalNode(o).parent)?e.rangeEndIsOnSameLineAsRangeStart(t,r,n)?0:1:65536&i?1:0;if(cr(t,i)||cr(r,i))return 1}else if(e.getStartsOnNewLine(r))return 1;var a,o;return 1&i?1:0}function ir(t,r,i){if(2&i||j){if(65536&i)return 1;var a=e.lastOrUndefined(r);if(void 0===a)return !t||e.rangeIsOnSingleLine(t,n)?0:1;if(t&&!e.positionIsSynthesized(t.pos)&&!e.nodeIsSynthesized(a)&&(!a.parent||a.parent===t)){if(j){var o=e.isNodeArray(r)&&!e.positionIsSynthesized(r.end)?r.end:a.end;return ar((function(r){return e.getLinesBetweenPositionAndNextNonWhitespaceCharacter(o,t.end,n,r)}))}return e.rangeEndPositionsAreOnSameLine(t,a,n)?0:1}if(cr(a,i))return 1}return 1&i&&!(131072&i)?1:0}function ar(t){e.Debug.assert(!!j);var r=t(!0);return 0===r?t(!1):r}function or(e,t){var r=j&&rr(t,[e],0);return r&&er(r,!1),!!r}function sr(e,t){var r=j&&ir(t,[e],0);r&&Wt(r);}function cr(t,r){if(e.nodeIsSynthesized(t)){var n=e.getStartsOnNewLine(t);return void 0===n?0!=(65536&r):n}return 0!=(65536&r)}function lr(t,r,i){return 131072&e.getEmitFlags(t)?0:(t=_r(t),r=_r(r),i=_r(i),e.getStartsOnNewLine(i)?1:e.nodeIsSynthesized(t)||e.nodeIsSynthesized(r)||e.nodeIsSynthesized(i)?0:j?ar((function(t){return e.getLinesBetweenRangeEndAndRangeStart(r,i,n,t)})):e.rangeEndIsOnSameLineAsRangeStart(r,i,n)?0:1)}function ur(t){return 0===t.statements.length&&e.rangeEndIsOnSameLineAsRangeStart(t,t,n)}function _r(t){for(;211===t.kind&&e.nodeIsSynthesized(t);)t=t.expression;return t}function dr(t,r){return e.isGeneratedIdentifier(t)?br(t):(e.isIdentifier(t)||e.isPrivateIdentifier(t))&&(e.nodeIsSynthesized(t)||!t.parent||!n||t.parent&&n&&e.getSourceFileOfNode(t)!==e.getOriginalNode(n))?e.idText(t):10===t.kind&&t.textSourceNode?dr(t.textSourceNode,r):!e.isLiteralExpression(t)||!e.nodeIsSynthesized(t)&&t.parent?e.getSourceTextOfNodeFromSourceFile(n,t,r):t.text}function pr(r,i,a){if(10===r.kind&&r.textSourceNode){var o=r.textSourceNode;if(e.isIdentifier(o)||e.isNumericLiteral(o)){var s=e.isNumericLiteral(o)?o.text:dr(o);return a?'"'.concat(e.escapeJsxAttributeString(s),'"'):i||16777216&e.getEmitFlags(r)?'"'.concat(e.escapeString(s),'"'):'"'.concat(e.escapeNonAsciiString(s),'"')}return pr(o,i,a)}var c=(i?1:0)|(a?2:0)|(t.terminateUnterminatedLiterals?4:0)|(t.target&&99===t.target?8:0);return e.getLiteralText(r,n,c)}function fr(t){t&&524288&e.getEmitFlags(t)||(c.push(l),l=0,u.push(_));}function gr(t){t&&524288&e.getEmitFlags(t)||(l=c.pop(),_=u.pop());}function mr(t){_&&_!==e.lastOrUndefined(u)||(_=new e.Set),_.add(t);}function yr(t){if(t)switch(t.kind){case 234:e.forEach(t.statements,yr);break;case 249:case 247:case 239:case 240:yr(t.statement);break;case 238:yr(t.thenStatement),yr(t.elseStatement);break;case 241:case 243:case 242:yr(t.initializer),yr(t.statement);break;case 248:yr(t.caseBlock);break;case 262:e.forEach(t.clauses,yr);break;case 288:case 289:e.forEach(t.statements,yr);break;case 251:yr(t.tryBlock),yr(t.catchClause),yr(t.finallyBlock);break;case 291:yr(t.variableDeclaration),yr(t.block);break;case 236:yr(t.declarationList);break;case 254:e.forEach(t.declarations,yr);break;case 253:case 163:case 202:case 256:hr(t.name);break;case 255:hr(t.name),524288&e.getEmitFlags(t)&&(e.forEach(t.parameters,yr),yr(t.body));break;case 200:case 201:e.forEach(t.elements,yr);break;case 265:yr(t.importClause);break;case 266:hr(t.name),yr(t.namedBindings);break;case 267:case 273:hr(t.name);break;case 268:e.forEach(t.elements,yr);break;case 269:hr(t.propertyName||t.name);}}function vr(e){if(e)switch(e.kind){case 294:case 295:case 166:case 168:case 171:case 172:hr(e.name);}}function hr(t){t&&(e.isGeneratedIdentifier(t)?br(t):e.isBindingPattern(t)&&yr(t));}function br(t){if(4==(7&t.autoGenerateFlags))return xr(function(t){for(var r=t.autoGenerateId,n=t,i=n.original;i&&(n=i,!(e.isIdentifier(n)&&4&n.autoGenerateFlags&&n.autoGenerateId!==r));)i=n.original;return n}(t),t.autoGenerateFlags);var r=t.autoGenerateId;return o[r]||(o[r]=function(t){switch(7&t.autoGenerateFlags){case 1:return Tr(0,!!(8&t.autoGenerateFlags));case 2:return Tr(268435456,!!(8&t.autoGenerateFlags));case 3:return Cr(e.idText(t),32&t.autoGenerateFlags?Sr:Dr,!!(16&t.autoGenerateFlags),!!(8&t.autoGenerateFlags))}return e.Debug.fail("Unsupported GeneratedIdentifierKind.")}(t))}function xr(t,r){var n=e.getNodeId(t);return a[n]||(a[n]=function(t,r){switch(t.kind){case 79:return Cr(dr(t),Dr,!!(16&r),!!(8&r));case 260:case 259:return function(t){var r=dr(t.name);return function(t,r){for(var n=r;e.isNodeDescendantOf(n,r);n=n.nextContainer)if(n.locals){var i=n.locals.get(e.escapeLeadingUnderscores(t));if(i&&3257279&i.flags)return !1}return !0}(r,t)?r:Cr(r)}(t);case 265:case 271:return function(t){var r=e.getExternalModuleName(t);return Cr(e.isStringLiteral(r)?e.makeIdentifierFromModuleName(r.text):"module")}(t);case 255:case 256:case 270:return Cr("default");case 225:return Cr("class");case 168:case 171:case 172:return function(t){return e.isIdentifier(t.name)?xr(t.name):Tr(0)}(t);case 161:return Tr(0,!0);default:return Tr(0)}}(t,r))}function Dr(e){return Sr(e)&&!s.has(e)&&!(_&&_.has(e))}function Sr(t){return !n||e.isFileLevelUniqueName(n,t,S)}function Tr(e,t){if(e&&!(l&e)&&Dr(r=268435456===e?"_i":"_n"))return l|=e,t&&mr(r),r;for(;;){var r,n=268435455&l;if(l++,8!==n&&13!==n&&Dr(r=n<26?"_"+String.fromCharCode(97+n):"_"+(n-26)))return t&&mr(r),r}}function Cr(e,t,r,n){if(void 0===t&&(t=Dr),r&&t(e))return n?mr(e):s.add(e),e;95!==e.charCodeAt(e.length-1)&&(e+="_");for(var i=1;;){var a=e+i;if(t(a))return n?mr(a):s.add(a),a;i++;}}function Er(e){return Cr(e,Sr,!0)}function kr(e,t){var r=Ie(2,e,t),n=Q,i=X,a=Y;Nr(t),r(e,t),Fr(t,n,i,a);}function Nr(t){var r=e.getEmitFlags(t),n=e.getCommentRange(t);!function(t,r,n,i){te(),Z=!1;var a=n<0||0!=(512&r)||11===t.kind,o=i<0||0!=(1024&r)||11===t.kind;(n>0||i>0)&&n!==i&&(a||Or(n,347!==t.kind),(!a||n>=0&&0!=(512&r))&&(Q=n),(!o||i>=0&&0!=(1024&r))&&(X=i,254===t.kind&&(Y=i))),e.forEach(e.getSyntheticLeadingComments(t),Ar),re();}(t,r,n.pos,n.end),2048&r&&($=!0);}function Fr(t,r,n,i){var a=e.getEmitFlags(t),o=e.getCommentRange(t);2048&a&&($=!1),function(t,r,n,i,a,o,s){te();var c=i<0||0!=(1024&r)||11===t.kind;e.forEach(e.getSyntheticTrailingComments(t),Pr),(n>0||i>0)&&n!==i&&(Q=a,X=o,Y=s,c||347===t.kind||function(e){qr(e,Jr);}(i)),re();}(t,a,o.pos,o.end,r,n,i);}function Ar(e){(e.hasLeadingNewline||2===e.kind)&&p.writeLine(),wr(e),e.hasTrailingNewLine||2===e.kind?p.writeLine():p.writeSpace(" ");}function Pr(e){p.isAtStartOfLine()||p.writeSpace(" "),wr(e),e.hasTrailingNewLine&&p.writeLine();}function wr(t){var r=function(e){return 3===e.kind?"/*".concat(e.text,"*/"):"//".concat(e.text)}(t),n=3===t.kind?e.computeLineStarts(r):void 0;e.writeCommentRange(r,n,p,0,r.length,L);}function Ir(t,r,i){te();var a,o,s=r.pos,c=r.end,l=e.getEmitFlags(t),u=$||c<0||0!=(1024&l);s<0||0!=(512&l)||(a=r,(o=e.emitDetachedComments(n.text,De(),p,Wr,a,L,$))&&(b?b.push(o):b=[o])),re(),2048&l&&!$?($=!0,i(t),$=!1):i(t),te(),u||(Or(r.end,!0),Z&&!p.isAtStartOfLine()&&p.writeLine()),re();}function Or(e,t){Z=!1,t?0===e&&(null==n?void 0:n.isDeclarationFile)?Vr(e,Lr):Vr(e,Br):0===e&&Vr(e,Mr);}function Mr(e,t,r,n,i){Hr(e,t)&&Br(e,t,r,n,i);}function Lr(e,t,r,n,i){Hr(e,t)||Br(e,t,r,n,i);}function Rr(r,n){return !t.onlyPrintJsDocStyle||e.isJSDocLikeText(r,n)||e.isPinnedComment(r,n)}function Br(t,r,i,a,o){Rr(n.text,t)&&(Z||(e.emitNewLineBeforeLeadingCommentOfPosition(De(),p,o,t),Z=!0),Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a?p.writeLine():3===i&&p.writeSpace(" "));}function jr(e){$||-1===e||Or(e,!0);}function Jr(t,r,i,a){Rr(n.text,t)&&(p.isAtStartOfLine()||p.writeSpace(" "),Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a&&p.writeLine());}function zr(e,t,r){$||(te(),qr(e,t?Jr:r?Ur:Kr),re());}function Ur(t,r,i){Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),2===i&&p.writeLine();}function Kr(t,r,i,a){Zr(t),e.writeCommentRange(n.text,De(),p,t,r,L),Zr(r),a?p.writeLine():p.writeSpace(" ");}function Vr(t,r){!n||-1!==Q&&t===Q||(function(t){return void 0!==b&&e.last(b).nodePos===t}(t)?function(t){var r=e.last(b).detachedCommentEndPos;b.length-1?b.pop():b=void 0,e.forEachLeadingCommentRange(n.text,r,t,r);}(r):e.forEachLeadingCommentRange(n.text,t,r,t));}function qr(t,r){n&&(-1===X||t!==X&&t!==Y)&&e.forEachTrailingCommentRange(n.text,t,r);}function Wr(t,r,i,a,o,s){Rr(n.text,a)&&(Zr(a),e.writeCommentRange(t,r,i,a,o,s),Zr(o));}function Hr(t,r){return e.isRecognizedTripleSlashComment(n.text,t,r)}function Gr(e,t){var r=Ie(3,e,t);Qr(t),r(e,t),Xr(t);}function Qr(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);if(e.isUnparsedNode(t)){e.Debug.assertIsDefined(t.parent,"UnparsedNodes must have parent pointers");var i=function(t){return void 0===t.parsedSourceMap&&void 0!==t.sourceMapText&&(t.parsedSourceMap=e.tryParseRawSourceMap(t.sourceMapText)||!1),t.parsedSourceMap||void 0}(t.parent);i&&m&&m.appendSourceMap(p.getLine(),p.getColumn(),i,t.parent.sourceMapPath,t.parent.getLineAndCharacterOfPosition(t.pos),t.parent.getLineAndCharacterOfPosition(t.end));}else {var a=n.source||y;347!==t.kind&&0==(16&r)&&n.pos>=0&&$r(n.source||y,Yr(a,n.pos)),64&r&&(W=!0);}}function Xr(t){var r=e.getEmitFlags(t),n=e.getSourceMapRange(t);e.isUnparsedNode(t)||(64&r&&(W=!1),347!==t.kind&&0==(32&r)&&n.end>=0&&$r(n.source||y,n.end));}function Yr(t,r){return t.skipTrivia?t.skipTrivia(r):e.skipTrivia(t.text,r)}function Zr(t){if(!(W||e.positionIsSynthesized(t)||tn(y))){var r=e.getLineAndCharacterOfPosition(y,t),n=r.line,i=r.character;m.addMapping(p.getLine(),p.getColumn(),H,n,i,void 0);}}function $r(e,t){if(e!==y){var r=y,n=H;en(e),Zr(t),function(e,t){y=e,H=t;}(r,n);}else Zr(t);}function en(e){W||(y=e,e!==v?tn(e)||(H=m.addSource(e.fileName),t.inlineSources&&m.setSourceContent(H,e.text),v=e,G=H):H=G);}function tn(t){return e.fileExtensionIs(t.fileName,".json")}}e.isBuildInfoFile=function(t){return e.fileExtensionIs(t,".tsbuildinfo")},e.forEachEmittedFile=a,e.getTsBuildInfoEmitOutputFilePath=o,e.getOutputPathsForBundle=s,e.getOutputPathsFor=c,e.getOutputExtension=u,e.getOutputDeclarationFileName=d,e.getCommonSourceDirectory=y,e.getCommonSourceDirectoryOfConfig=v,e.getAllProjectOutputs=function(t,r){var n=f(),i=n.addOutput,a=n.getOutputs;if(e.outFile(t.options))g(t,i);else {for(var s=e.memoize((function(){return v(t,r)})),c=0,l=t.fileNames;c<l.length;c++){var u=l[c];m(t,u,r,i,s);}i(o(t.options));}return a()},e.getOutputFileNames=function(t,r,n){r=e.normalizePath(r),e.Debug.assert(e.contains(t.fileNames,r),"Expected fileName to be present in command line");var i=f(),a=i.addOutput,o=i.getOutputs;return e.outFile(t.options)?g(t,a):m(t,r,n,a),o()},e.getFirstProjectOutput=function(t,r){if(e.outFile(t.options)){var n=s(t.options,!1).jsFilePath;return e.Debug.checkDefined(n,"project ".concat(t.options.configFilePath," expected to have at least one output"))}for(var i=e.memoize((function(){return v(t,r)})),a=0,c=t.fileNames;a<c.length;a++){var l=c[a];if(!e.fileExtensionIs(l,".d.ts")){if(n=p(l,t,r,i))return n;if(!e.fileExtensionIs(l,".json")&&e.getEmitDeclarations(t.options))return d(l,t,r,i)}}return o(t.options)||e.Debug.fail("project ".concat(t.options.configFilePath," expected to have at least one output"))},e.emitFiles=h,e.getBuildInfoText=b,e.getBuildInfo=x,e.notImplementedResolver={hasGlobalName:e.notImplemented,getReferencedExportContainer:e.notImplemented,getReferencedImportDeclaration:e.notImplemented,getReferencedDeclarationWithCollidingName:e.notImplemented,isDeclarationWithCollidingName:e.notImplemented,isValueAliasDeclaration:e.notImplemented,isReferencedAliasDeclaration:e.notImplemented,isTopLevelValueImportEqualsWithEntityName:e.notImplemented,getNodeCheckFlags:e.notImplemented,isDeclarationVisible:e.notImplemented,isLateBound:function(e){return !1},collectLinkedAliases:e.notImplemented,isImplementationOfOverload:e.notImplemented,isRequiredInitializedParameter:e.notImplemented,isOptionalUninitializedParameterProperty:e.notImplemented,isExpandoFunctionDeclaration:e.notImplemented,getPropertiesOfContainerFunction:e.notImplemented,createTypeOfDeclaration:e.notImplemented,createReturnTypeOfSignatureDeclaration:e.notImplemented,createTypeOfExpression:e.notImplemented,createLiteralConstValue:e.notImplemented,isSymbolAccessible:e.notImplemented,isEntityNameVisible:e.notImplemented,getConstantValue:e.notImplemented,getReferencedValueDeclaration:e.notImplemented,getTypeReferenceSerializationKind:e.notImplemented,isOptionalParameter:e.notImplemented,moduleExportsSomeValue:e.notImplemented,isArgumentsLocalBinding:e.notImplemented,getExternalModuleFileFromDeclaration:e.notImplemented,getTypeReferenceDirectivesForEntityName:e.notImplemented,getTypeReferenceDirectivesForSymbol:e.notImplemented,isLiteralConstDeclaration:e.notImplemented,getJsxFactoryEntity:e.notImplemented,getJsxFragmentFactoryEntity:e.notImplemented,getAllAccessorDeclarations:e.notImplemented,getSymbolOfExternalModuleSpecifier:e.notImplemented,isBindingCapturedByNode:e.notImplemented,getDeclarationStatementsForSourceFile:e.notImplemented,isImportRequiredByAugmentation:e.notImplemented},e.emitUsingBuildInfo=function(t,r,i,a){var o=s(t.options,!1),c=o.buildInfoPath,l=o.jsFilePath,u=o.sourceMapFilePath,_=o.declarationFilePath,d=o.declarationMapPath,p=r.readFile(e.Debug.checkDefined(c));if(!p)return c;var f=r.readFile(e.Debug.checkDefined(l));if(!f)return l;var g=u&&r.readFile(u);if(u&&!g||t.options.inlineSourceMap)return u||"inline sourcemap decoding";var m=_&&r.readFile(_);if(_&&!m)return _;var y=d&&r.readFile(d);if(d&&!y||t.options.inlineSourceMap)return d||"inline sourcemap decoding";var v=x(p);if(!v.bundle||!v.bundle.js||m&&!v.bundle.dts)return c;var D=e.getDirectoryPath(e.getNormalizedAbsolutePath(c,r.getCurrentDirectory())),S=e.createInputFiles(f,m,u,g,d,y,l,_,c,v,!0),T=[],C=e.createPrependNodes(t.projectReferences,i,(function(e){return r.readFile(e)})),E=function(t,r,n){var i,a=e.Debug.checkDefined(t.js),o=(null===(i=a.sources)||void 0===i?void 0:i.prologues)&&e.arrayToMap(a.sources.prologues,(function(e){return e.file}));return t.sourceFiles.map((function(t,i){var a,s,c=null==o?void 0:o.get(i),l=null==c?void 0:c.directives.map((function(t){var r=e.setTextRange(e.factory.createStringLiteral(t.expression.text),t.expression),n=e.setTextRange(e.factory.createExpressionStatement(r),t);return e.setParent(r,n),n})),u=e.factory.createToken(1),_=e.factory.createSourceFile(null!=l?l:[],u,0);return _.fileName=e.getRelativePathFromDirectory(n.getCurrentDirectory(),e.getNormalizedAbsolutePath(t,r),!n.useCaseSensitiveFileNames()),_.text=null!==(a=null==c?void 0:c.text)&&void 0!==a?a:"",e.setTextRangePosWidth(_,0,null!==(s=null==c?void 0:c.text.length)&&void 0!==s?s:0),e.setEachParent(_.statements,_),e.setTextRangePosWidth(u,_.end,0),e.setParent(u,_),_}))}(v.bundle,D,r),k={getPrependNodes:e.memoize((function(){return n$3(n$3([],C,!0),[S],!1)})),getCanonicalFileName:r.getCanonicalFileName,getCommonSourceDirectory:function(){return e.getNormalizedAbsolutePath(v.bundle.commonSourceDirectory,D)},getCompilerOptions:function(){return t.options},getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.getNewLine()},getSourceFile:e.returnUndefined,getSourceFileByPath:e.returnUndefined,getSourceFiles:function(){return E},getLibFileFromReference:e.notImplemented,isSourceFileFromExternalLibrary:e.returnFalse,getResolvedProjectReferenceToRedirect:e.returnUndefined,getProjectReferenceRedirect:e.returnUndefined,isSourceOfProjectReferenceRedirect:e.returnFalse,writeFile:function(t,r,n){switch(t){case l:if(f===r)return;break;case u:if(g===r)return;break;case c:var i=x(r);i.program=v.program;var a=v.bundle,o=a.js,s=a.dts,p=a.sourceFiles;return i.bundle.js.sources=o.sources,s&&(i.bundle.dts.sources=s.sources),i.bundle.sourceFiles=p,void T.push({name:t,text:b(i),writeByteOrderMark:n});case _:if(m===r)return;break;case d:if(y===r)return;break;default:e.Debug.fail("Unexpected path: ".concat(t));}T.push({name:t,text:r,writeByteOrderMark:n});},isEmitBlocked:e.returnFalse,readFile:function(e){return r.readFile(e)},fileExists:function(e){return r.fileExists(e)},useCaseSensitiveFileNames:function(){return r.useCaseSensitiveFileNames()},getProgramBuildInfo:e.returnUndefined,getSourceFileFromReference:e.returnUndefined,redirectTargetsMap:e.createMultiMap(),getFileIncludeReasons:e.notImplemented};return h(e.notImplementedResolver,k,void 0,e.getTransformers(t.options,a)),T},function(e){e[e.Notification=0]="Notification",e[e.Substitution=1]="Substitution",e[e.Comments=2]="Comments",e[e.SourceMaps=3]="SourceMaps",e[e.Emit=4]="Emit";}(t||(t={})),e.createPrinter=D,function(e){e[e.Auto=0]="Auto",e[e.CountMask=268435455]="CountMask",e[e._i=268435456]="_i";}(r||(r={}));}(t),function(e){var t,r;function i(e){e.watcher.close();}e.createCachedDirectoryStructureHost=function(t,r,n){if(t.getDirectories&&t.readDirectory){var i=new e.Map,a=e.createGetCanonicalFileName(n);return {useCaseSensitiveFileNames:n,fileExists:function(e){var r=c(o(e));return r&&d(r.files,l(e))||t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:t.directoryExists&&function(r){var n=o(r);return i.has(e.ensureTrailingDirectorySeparator(n))||t.directoryExists(r)},getDirectories:function(e){var r=u(e,o(e));return r?r.directories.slice():t.getDirectories(e)},readDirectory:function(i,a,s,c,_){var d,p=o(i),g=u(i,p);return void 0!==g?e.matchFiles(i,a,s,c,n,r,_,(function(t){var r=o(t);if(r===p)return g||m(t,r);var n=u(t,r);return void 0!==n?n||m(t,r):e.emptyFileSystemEntries}),f):t.readDirectory(i,a,s,c,_);function m(r,n){if(d&&n===p)return d;var i={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||e.emptyArray,directories:t.getDirectories(r)||e.emptyArray};return n===p&&(d=i),i}},createDirectory:t.createDirectory&&function(e){var r=c(o(e)),n=l(e);r&&p(r.directories,n,!0),t.createDirectory(e);},writeFile:t.writeFile&&function(e,r,n){var i=c(o(e));return i&&g(i,l(e),!0),t.writeFile(e,r,n)},addOrDeleteFileOrDirectory:function(e,r){if(void 0===s(r)){var n=c(r);if(n){if(t.directoryExists){var i=l(e),a={fileExists:t.fileExists(r),directoryExists:t.directoryExists(r)};return a.directoryExists||d(n.directories,i)?m():g(n,i,a.fileExists),a}m();}}else m();},addOrDeleteFile:function(t,r,n){if(n!==e.FileWatcherEventKind.Changed){var i=c(r);i&&g(i,l(t),n===e.FileWatcherEventKind.Created);}},clearCache:m,realpath:t.realpath&&f}}function o(t){return e.toPath(t,r,a)}function s(t){return i.get(e.ensureTrailingDirectorySeparator(t))}function c(t){return s(e.getDirectoryPath(t))}function l(t){return e.getBaseFileName(e.normalizePath(t))}function u(r,n){var a=s(n=e.ensureTrailingDirectorySeparator(n));if(a)return a;try{return function(r,n){var a;if(!t.realpath||e.ensureTrailingDirectorySeparator(o(t.realpath(r)))===n){var s={files:e.map(t.readDirectory(r,void 0,void 0,["*.*"]),l)||[],directories:t.getDirectories(r)||[]};return i.set(e.ensureTrailingDirectorySeparator(n),s),s}if(null===(a=t.directoryExists)||void 0===a?void 0:a.call(t,r))return i.set(n,!1),!1}(r,n)}catch(t){return void e.Debug.assert(!i.has(e.ensureTrailingDirectorySeparator(n)))}}function _(e,t){return a(e)===a(t)}function d(t,r){return e.some(t,(function(e){return _(e,r)}))}function p(t,r,n){if(d(t,r)){if(!n)return e.filterMutate(t,(function(e){return !_(e,r)}))}else if(n)return t.push(r)}function f(e){return t.realpath?t.realpath(e):e}function g(e,t,r){p(e.files,t,r);}function m(){i.clear();}},(r=e.ConfigFileProgramReloadLevel||(e.ConfigFileProgramReloadLevel={}))[r.None=0]="None",r[r.Partial=1]="Partial",r[r.Full=2]="Full",e.updateSharedExtendedConfigFileWatcher=function(t,r,n,i,a){var o,s=e.arrayToMap((null===(o=null==r?void 0:r.configFile)||void 0===o?void 0:o.extendedSourceFiles)||e.emptyArray,a);n.forEach((function(e,r){s.has(r)||(e.projects.delete(t),e.close());})),s.forEach((function(r,a){var o=n.get(a);o?o.projects.add(t):n.set(a,{projects:new e.Set([t]),watcher:i(r,a),close:function(){var e=n.get(a);e&&0===e.projects.size&&(e.watcher.close(),n.delete(a));}});}));},e.clearSharedExtendedConfigFileWatcher=function(e,t){t.forEach((function(t){t.projects.delete(e)&&t.close();}));},e.cleanExtendedConfigCache=function e(t,r,n){t.delete(r)&&t.forEach((function(i,a){var o;(null===(o=i.extendedResult.extendedSourceFiles)||void 0===o?void 0:o.some((function(e){return n(e)===r})))&&e(t,a,n);}));},e.updatePackageJsonWatch=function(t,r,n){var i=new e.Map(t);e.mutateMap(r,i,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateMissingFilePathsWatch=function(t,r,n){var i=t.getMissingFilePaths(),a=e.arrayToMap(i,e.identity,e.returnTrue);e.mutateMap(r,a,{createNewValue:n,onDeleteValue:e.closeFileWatcher});},e.updateWatchingWildcardDirectories=function(t,r,n){function a(e,t){return {watcher:n(e,t),flags:t}}e.mutateMap(t,r,{createNewValue:a,onDeleteValue:i,onExistingValue:function(e,r,n){e.flags!==r&&(e.watcher.close(),t.set(n,a(n,r)));}});},e.isIgnoredFileFromWildCardWatching=function(t){var r=t.watchedDirPath,n=t.fileOrDirectory,i=t.fileOrDirectoryPath,a=t.configFileName,o=t.options,s=t.program,c=t.extraFileExtensions,l=t.currentDirectory,u=t.useCaseSensitiveFileNames,_=t.writeLog,d=t.toPath,p=e.removeIgnoredPath(i);if(!p)return _("Project: ".concat(a," Detected ignored path: ").concat(n)),!0;if((i=p)===r)return !1;if(e.hasExtension(i)&&!e.isSupportedSourceFileName(n,o,c))return _("Project: ".concat(a," Detected file add/remove of non supported extension: ").concat(n)),!0;if(e.isExcludedFile(n,o.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(a),l),u,l))return _("Project: ".concat(a," Detected excluded file: ").concat(n)),!0;if(!s)return !1;if(e.outFile(o)||o.outDir)return !1;if(e.fileExtensionIs(i,".d.ts")){if(o.declarationDir)return !1}else if(!e.fileExtensionIsOneOf(i,e.supportedJSExtensionsFlat))return !1;var f=e.removeFileExtension(i),g=e.isArray(s)?void 0:function(e){return !!e.getState}(s)?s.getProgramOrUndefined():s,m=g||e.isArray(s)?void 0:s;return !(!y(f+".ts")&&!y(f+".tsx")||(_("Project: ".concat(a," Detected output file: ").concat(n)),0));function y(t){return g?!!g.getSourceFileByPath(t):m?m.getState().fileInfos.has(t):!!e.find(s,(function(e){return d(e)===t}))}},e.isEmittedFileOfProgram=function(e,t){return !!e&&e.isEmittedFile(t)},function(e){e[e.None=0]="None",e[e.TriggerOnly=1]="TriggerOnly",e[e.Verbose=2]="Verbose";}(t=e.WatchLogLevel||(e.WatchLogLevel={})),e.getWatchFactory=function(r,i,a,o){e.setSysLog(i===t.Verbose?a:e.noop);var s={watchFile:function(e,t,n,i){return r.watchFile(e,t,n,i)},watchDirectory:function(e,t,n,i){return r.watchDirectory(e,t,0!=(1&n),i)}},c=i!==t.None?{watchFile:d("watchFile"),watchDirectory:d("watchDirectory")}:void 0,l=i===t.Verbose?{watchFile:function(e,t,r,n,i,s){a("FileWatcher:: Added:: ".concat(p(e,r,n,i,s,o)));var l=c.watchFile(e,t,r,n,i,s);return {close:function(){a("FileWatcher:: Close:: ".concat(p(e,r,n,i,s,o))),l.close();}}},watchDirectory:function(t,r,n,i,s,l){var u="DirectoryWatcher:: Added:: ".concat(p(t,n,i,s,l,o));a(u);var _=e.timestamp(),d=c.watchDirectory(t,r,n,i,s,l),f=e.timestamp()-_;return a("Elapsed:: ".concat(f,"ms ").concat(u)),{close:function(){var r="DirectoryWatcher:: Close:: ".concat(p(t,n,i,s,l,o));a(r);var c=e.timestamp();d.close();var u=e.timestamp()-c;a("Elapsed:: ".concat(u,"ms ").concat(r));}}}}:c||s,u=i===t.Verbose?function(e,t,r,n,i){return a("ExcludeWatcher:: Added:: ".concat(p(e,t,r,n,i,o))),{close:function(){return a("ExcludeWatcher:: Close:: ".concat(p(e,t,r,n,i,o)))}}}:e.returnNoopFileWatcher;return {watchFile:_("watchFile"),watchDirectory:_("watchDirectory")};function _(t){return function(n,i,a,o,s,c){var _;return e.matchesExclude(n,"watchFile"===t?null==o?void 0:o.excludeFiles:null==o?void 0:o.excludeDirectories,"boolean"==typeof r.useCaseSensitiveFileNames?r.useCaseSensitiveFileNames:r.useCaseSensitiveFileNames(),(null===(_=r.getCurrentDirectory)||void 0===_?void 0:_.call(r))||"")?u(n,a,o,s,c):l[t].call(void 0,n,i,a,o,s,c)}}function d(t){return function(r,i,c,l,u,_){return s[t].call(void 0,r,(function(){for(var s=[],d=0;d<arguments.length;d++)s[d]=arguments[d];var f="".concat("watchFile"===t?"FileWatcher":"DirectoryWatcher",":: Triggered with ").concat(s[0]," ").concat(void 0!==s[1]?s[1]:"",":: ").concat(p(r,c,l,u,_,o));a(f);var g=e.timestamp();i.call.apply(i,n$3([void 0],s,!1));var m=e.timestamp()-g;a("Elapsed:: ".concat(m,"ms ").concat(f));}),c,l,u,_)}}function p(e,t,r,n,i,a){return "WatchInfo: ".concat(e," ").concat(t," ").concat(JSON.stringify(r)," ").concat(a?a(n,i):void 0===i?n:"".concat(n," ").concat(i))}},e.getFallbackOptions=function(t){var r=null==t?void 0:t.fallbackPolling;return {watchFile:void 0!==r?r:e.WatchFileKind.PriorityPollingInterval}},e.closeFileWatcherOf=i;}(t),function(e){function t(t,r){var n=e.getDirectoryPath(r),i=e.isRootedDiskPath(t)?t:e.combinePaths(n,t);return e.normalizePath(i)}function r(e,t){return i(e,t)}function i(t,r,n){void 0===n&&(n=e.sys);var i,a=new e.Map,o=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames),s=e.maybeBind(n,n.createHash)||e.generateDjb2Hash;function c(){return e.getDirectoryPath(e.normalizePath(n.getExecutingFilePath()))}var l=e.getNewLineCharacter(t,(function(){return n.newLine})),u=n.realpath&&function(e){return n.realpath(e)},_={getSourceFile:function(t,n,i){var a;try{e.performance.mark("beforeIORead"),a=_.readFile(t),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){i&&i(e.message),a="";}return void 0!==a?e.createSourceFile(t,a,n,r):void 0},getDefaultLibLocation:c,getDefaultLibFileName:function(t){return e.combinePaths(c(),e.getDefaultLibFileName(t))},writeFile:function(r,o,c,l){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,o,c,(function(r,a,o){return function(r,a,o){if(e.isWatchSet(t)&&n.getModifiedTime){i||(i=new e.Map);var c=s(a),l=n.getModifiedTime(r);if(l){var u=i.get(r);if(u&&u.byteOrderMark===o&&u.hash===c&&u.mtime.getTime()===l.getTime())return}n.writeFile(r,a,o);var _=n.getModifiedTime(r)||e.missingFileModifiedTime;i.set(r,{hash:c,byteOrderMark:o,mtime:_});}else n.writeFile(r,a,o);}(r,a,o)}),(function(e){return (_.createDirectory||n.createDirectory)(e)}),(function(e){return t=e,!!a.has(t)||!!(_.directoryExists||n.directoryExists)(t)&&(a.set(t,!0),!0);var t;})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){l&&l(e.message);}},getCurrentDirectory:e.memoize((function(){return n.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return n.useCaseSensitiveFileNames},getCanonicalFileName:o,getNewLine:function(){return l},fileExists:function(e){return n.fileExists(e)},readFile:function(e){return n.readFile(e)},trace:function(e){return n.write(e+l)},directoryExists:function(e){return n.directoryExists(e)},getEnvironmentVariable:function(e){return n.getEnvironmentVariable?n.getEnvironmentVariable(e):""},getDirectories:function(e){return n.getDirectories(e)},realpath:u,readDirectory:function(e,t,r,i,a){return n.readDirectory(e,t,r,i,a)},createDirectory:function(e){return n.createDirectory(e)},createHash:e.maybeBind(n,n.createHash)};return _}function a(t,r){var n="".concat(e.diagnosticCategoryName(t)," TS").concat(t.code,": ").concat(f(t.messageText,r.getNewLine())).concat(r.getNewLine());if(t.file){var i=e.getLineAndCharacterOfPosition(t.file,t.start),a=i.line,o=i.character,s=t.file.fileName,c=e.convertToRelativePath(s,r.getCurrentDirectory(),(function(e){return r.getCanonicalFileName(e)}));return "".concat(c,"(").concat(a+1,",").concat(o+1,"): ")+n}return n}var o;e.findConfigFile=function(t,r,n){return void 0===n&&(n="tsconfig.json"),e.forEachAncestorDirectory(t,(function(t){var i=e.combinePaths(t,n);return r(i)?i:void 0}))},e.resolveTripleslashReference=t,e.computeCommonSourceDirectoryOfFilenames=function(t,r,n){var i;return e.forEach(t,(function(t){var a=e.getNormalizedPathComponents(t,r);if(a.pop(),i){for(var o=Math.min(i.length,a.length),s=0;s<o;s++)if(n(i[s])!==n(a[s])){if(0===s)return !0;i.length=s;break}a.length<i.length&&(i.length=a.length);}else i=a;}))?"":i?e.getPathFromPathComponents(i):r},e.createCompilerHost=r,e.createCompilerHostWorker=i,e.changeCompilerHostLikeToUseCache=function(t,r,n){var i=t.readFile,a=t.fileExists,o=t.directoryExists,s=t.createDirectory,c=t.writeFile,l=new e.Map,u=new e.Map,_=new e.Map,d=new e.Map,p=function(e,r){var n=i.call(t,r);return l.set(e,void 0!==n&&n),n};t.readFile=function(n){var a=r(n),o=l.get(a);return void 0!==o?!1!==o?o:void 0:e.fileExtensionIs(n,".json")||e.isBuildInfoFile(n)?p(a,n):i.call(t,n)};var f=n?function(t,i,a,o){var s=r(t),c=d.get(s);if(c)return c;var l=n(t,i,a,o);return l&&(e.isDeclarationFileName(t)||e.fileExtensionIs(t,".json"))&&d.set(s,l),l}:void 0;return t.fileExists=function(e){var n=r(e),i=u.get(n);if(void 0!==i)return i;var o=a.call(t,e);return u.set(n,!!o),o},c&&(t.writeFile=function(e,n,i,a,o){var s=r(e);u.delete(s);var _=l.get(s);if(void 0!==_&&_!==n)l.delete(s),d.delete(s);else if(f){var p=d.get(s);p&&p.text!==n&&d.delete(s);}c.call(t,e,n,i,a,o);}),o&&s&&(t.directoryExists=function(e){var n=r(e),i=_.get(n);if(void 0!==i)return i;var a=o.call(t,e);return _.set(n,!!a),a},t.createDirectory=function(e){var n=r(e);_.delete(n),s.call(t,e);}),{originalReadFile:i,originalFileExists:a,originalDirectoryExists:o,originalCreateDirectory:s,originalWriteFile:c,getSourceFileWithCache:f,readFileWithCache:function(e){var t=r(e),n=l.get(t);return void 0!==n?!1!==n?n:void 0:p(t,e)}}},e.getPreEmitDiagnostics=function(t,r,n){var i;return i=e.addRange(i,t.getConfigFileParsingDiagnostics()),i=e.addRange(i,t.getOptionsDiagnostics(n)),i=e.addRange(i,t.getSyntacticDiagnostics(r,n)),i=e.addRange(i,t.getGlobalDiagnostics(n)),i=e.addRange(i,t.getSemanticDiagnostics(r,n)),e.getEmitDeclarations(t.getCompilerOptions())&&(i=e.addRange(i,t.getDeclarationDiagnostics(r,n))),e.sortAndDeduplicateDiagnostics(i||e.emptyArray)},e.formatDiagnostics=function(e,t){for(var r="",n=0,i=e;n<i.length;n++)r+=a(i[n],t);return r},e.formatDiagnostic=a,function(e){e.Grey="[90m",e.Red="[91m",e.Yellow="[93m",e.Blue="[94m",e.Cyan="[96m";}(o=e.ForegroundColorEscapeSequences||(e.ForegroundColorEscapeSequences={}));var s="[7m",c="[0m",l=" ";function u(t){switch(t){case e.DiagnosticCategory.Error:return o.Red;case e.DiagnosticCategory.Warning:return o.Yellow;case e.DiagnosticCategory.Suggestion:return e.Debug.fail("Should never get an Info diagnostic on the command line.");case e.DiagnosticCategory.Message:return o.Blue}}function _(e,t){return t+e+c}function d(t,r,n,i,a,o){var l=e.getLineAndCharacterOfPosition(t,r),u=l.line,d=l.character,p=e.getLineAndCharacterOfPosition(t,r+n),f=p.line,g=p.character,m=e.getLineAndCharacterOfPosition(t,t.text.length).line,y=f-u>=4,v=(f+1+"").length;y&&(v=Math.max("...".length,v));for(var h="",b=u;b<=f;b++){h+=o.getNewLine(),y&&u+1<b&&b<f-1&&(h+=i+_(e.padLeft("...",v),s)+" "+o.getNewLine(),b=f-1);var x=e.getPositionOfLineAndCharacter(t,b,0),D=b<m?e.getPositionOfLineAndCharacter(t,b+1,0):t.text.length,S=t.text.slice(x,D);if(S=(S=e.trimStringEnd(S)).replace(/\t/g," "),h+=i+_(e.padLeft(b+1+"",v),s)+" ",h+=S+o.getNewLine(),h+=i+_(e.padLeft("",v),s)+" ",h+=a,b===u){var T=b===f?g:void 0;h+=S.slice(0,d).replace(/\S/g," "),h+=S.slice(d,T).replace(/./g,"~");}else h+=b===f?S.slice(0,g).replace(/./g,"~"):S.replace(/./g,"~");h+=c;}return h}function p(t,r,n,i){void 0===i&&(i=_);var a=e.getLineAndCharacterOfPosition(t,r),s=a.line,c=a.character,l="";return l+=i(n?e.convertToRelativePath(t.fileName,n.getCurrentDirectory(),(function(e){return n.getCanonicalFileName(e)})):t.fileName,o.Cyan),l+=":",l+=i("".concat(s+1),o.Yellow),(l+=":")+i("".concat(c+1),o.Yellow)}function f(t,r,n){if(void 0===n&&(n=0),e.isString(t))return t;if(void 0===t)return "";var i="";if(n){i+=r;for(var a=0;a<n;a++)i+=" ";}if(i+=t.messageText,n++,t.next)for(var o=0,s=t.next;o<s.length;o++)i+=f(s[o],r,n);return i}function g(t,r,n,i){if(0===t.length)return [];for(var a=[],o=new e.Map,s=0,c=t;s<c.length;s++){var l=c[s],u=void 0;o.has(l)?u=o.get(l):o.set(l,u=i(l,r,n)),a.push(u);}return a}function m(e,t){if(void 0!==e.impliedNodeFormat)return y(e,P(e,t))}function y(t,r){var n;if(void 0!==t.impliedNodeFormat){if(t.impliedNodeFormat!==e.ModuleKind.ESNext)return e.isImportCall(e.walkUpParenthesizedExpressions(r.parent))?e.ModuleKind.ESNext:e.ModuleKind.CommonJS;var i=null===(n=e.walkUpParenthesizedExpressions(r.parent))||void 0===n?void 0:n.parent;return i&&e.isImportEqualsDeclaration(i)?e.ModuleKind.CommonJS:e.ModuleKind.ESNext}}function v(t,r,n,i,a){if(0===t.length)return [];for(var o=[],s=new e.Map,c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=void 0,p=m(r,c);c++;var f=void 0!==p?"".concat(p,"|").concat(_):_;s.has(f)?d=s.get(f):s.set(f,d=a(_,p,n,i)),o.push(d);}return o}function h(t,r,n,i){var a;return function t(r,o,s){if(i){var c=i(r,s);if(c)return c}return e.forEach(o,(function(r,i){if(!r||!(null==a?void 0:a.has(r.sourceFile.path))){var o=n(r,s,i);return o||!r?o:((a||(a=new e.Set)).add(r.sourceFile.path),t(r.commandLine.projectReferences,r.references,r))}}))}(t,r,void 0)}function b(t){switch(null==t?void 0:t.kind){case e.FileIncludeKind.Import:case e.FileIncludeKind.ReferenceFile:case e.FileIncludeKind.TypeReferenceDirective:case e.FileIncludeKind.LibReferenceDirective:return !0;default:return !1}}function x(e){return void 0!==e.pos}function D(t,r){var n,i,a,o,s,c,l,u,_,d,p=e.Debug.checkDefined(t(r.file)),f=r.kind,g=r.index;switch(f){case e.FileIncludeKind.Import:var y=P(p,g);if(d=null===(s=null===(o=p.resolvedModules)||void 0===o?void 0:o.get(y.text,m(p,g)))||void 0===s?void 0:s.packageId,-1===y.pos)return {file:p,packageId:d,text:y.text};u=e.skipTrivia(p.text,y.pos),_=y.end;break;case e.FileIncludeKind.ReferenceFile:u=(n=p.referencedFiles[g]).pos,_=n.end;break;case e.FileIncludeKind.TypeReferenceDirective:u=(i=p.typeReferenceDirectives[g]).pos,_=i.end,d=null===(l=null===(c=p.resolvedTypeReferenceDirectiveNames)||void 0===c?void 0:c.get(e.toFileNameLowerCase(p.typeReferenceDirectives[g].fileName),p.impliedNodeFormat))||void 0===l?void 0:l.packageId;break;case e.FileIncludeKind.LibReferenceDirective:u=(a=p.libReferenceDirectives[g]).pos,_=a.end;break;default:return e.Debug.assertNever(f)}return {file:p,pos:u,end:_,packageId:d}}function S(t,r,n,i){switch(e.getEmitModuleResolutionKind(i)){case e.ModuleResolutionKind.Node12:case e.ModuleResolutionKind.NodeNext:return e.fileExtensionIsOneOf(t,[".d.mts",".mts",".mjs"])?e.ModuleKind.ESNext:e.fileExtensionIsOneOf(t,[".d.cts",".cts",".cjs"])?e.ModuleKind.CommonJS:e.fileExtensionIsOneOf(t,[".d.ts",".ts",".tsx",".js",".jsx"])?"module"===(null==(a=e.getPackageScopeForPath(t,r,n,i))?void 0:a.packageJsonContent.type)?e.ModuleKind.ESNext:e.ModuleKind.CommonJS:void 0;default:return}var a;}function T(t,r,i,a){var o=t.getCompilerOptions();if(o.noEmit)return t.getSemanticDiagnostics(r,a),r||e.outFile(o)?e.emitSkippedWithNoDiagnostics:t.emitBuildInfo(i,a);if(o.noEmitOnError){var s=n$3(n$3(n$3(n$3([],t.getOptionsDiagnostics(a),!0),t.getSyntacticDiagnostics(r,a),!0),t.getGlobalDiagnostics(a),!0),t.getSemanticDiagnostics(r,a),!0);if(0===s.length&&e.getEmitDeclarations(t.getCompilerOptions())&&(s=t.getDeclarationDiagnostics(void 0,a)),s.length){var c;if(!r&&!e.outFile(o)){var l=t.emitBuildInfo(i,a);l.diagnostics&&(s=n$3(n$3([],s,!0),l.diagnostics,!0)),c=l.emittedFiles;}return {diagnostics:s,sourceMaps:void 0,emittedFiles:c,emitSkipped:!0}}}}function C(t,r){return e.filter(t,(function(e){return !e.skippedOn||!r[e.skippedOn]}))}function E(t,r){return void 0===r&&(r=t),{fileExists:function(e){return r.fileExists(e)},readDirectory:function(t,n,i,a,o){return e.Debug.assertIsDefined(r.readDirectory,"'CompilerHost.readDirectory' must be implemented to correctly process 'projectReferences'"),r.readDirectory(t,n,i,a,o)},readFile:function(e){return r.readFile(e)},useCaseSensitiveFileNames:t.useCaseSensitiveFileNames(),getCurrentDirectory:function(){return t.getCurrentDirectory()},onUnRecoverableConfigFileDiagnostic:t.onUnRecoverableConfigFileDiagnostic||e.returnUndefined,trace:t.trace?function(e){return t.trace(e)}:void 0}}function k(t,r,n){if(!t)return e.emptyArray;for(var i,a=0;a<t.length;a++){var o=t[a],s=r(o,a);if(o.prepend&&s&&s.options){if(!e.outFile(s.options))continue;var c=e.getOutputPathsForBundle(s.options,!0),l=c.jsFilePath,u=c.sourceMapFilePath,_=c.declarationFilePath,d=c.declarationMapPath,p=c.buildInfoPath,f=e.createInputFiles(n,l,u,_,d,p);(i||(i=[])).push(f);}}return i||e.emptyArray}function N(t,r){var n=r||t;return e.resolveConfigFileProjectName(n.path)}function F(t,r){switch(r.extension){case".ts":case".d.ts":return;case".tsx":return n();case".jsx":return n()||i();case".js":return i();case".json":return t.resolveJsonModule?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used}function n(){return t.jsx?void 0:e.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set}function i(){return e.getAllowJSCompilerOption(t)||!e.getStrictOptionValue(t,"noImplicitAny")?void 0:e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type}}function A(e){for(var t=e.imports,r=e.moduleAugmentations,n=t.map((function(e){return e.text})),i=0,a=r;i<a.length;i++){var o=a[i];10===o.kind&&n.push(o.text);}return n}function P(t,r){var n=t.imports,i=t.moduleAugmentations;if(r<n.length)return n[r];for(var a=n.length,o=0,s=i;o<s.length;o++){var c=s[o];if(10===c.kind){if(r===a)return c;a++;}}e.Debug.fail("should never ask for module name at index higher than possible module name");}e.formatColorAndReset=_,e.formatLocation=p,e.formatDiagnosticsWithColorAndContext=function(t,r){for(var n="",i=0,a=t;i<a.length;i++){var s=a[i];if(s.file&&(n+=p(y=s.file,v=s.start,r),n+=" - "),n+=_(e.diagnosticCategoryName(s),u(s.category)),n+=_(" TS".concat(s.code,": "),o.Grey),n+=f(s.messageText,r.getNewLine()),s.file&&(n+=r.getNewLine(),n+=d(s.file,s.start,s.length,"",u(s.category),r)),s.relatedInformation){n+=r.getNewLine();for(var c=0,g=s.relatedInformation;c<g.length;c++){var m=g[c],y=m.file,v=m.start,h=m.length,b=m.messageText;y&&(n+=r.getNewLine(),n+=" "+p(y,v,r),n+=d(y,v,h,l,o.Cyan,r)),n+=r.getNewLine(),n+=l+f(b,r.getNewLine());}}n+=r.getNewLine();}return n},e.flattenDiagnosticMessageText=f,e.loadWithLocalCache=g,e.getModeForResolutionAtIndex=m,e.getModeForUsageLocation=y,e.loadWithModeAwareCache=v,e.forEachResolvedProjectReference=function(e,t){return h(void 0,e,(function(e,r){return e&&t(e,r)}))},e.inferredTypesContainingFile="__inferred type names__.ts",e.isReferencedFile=b,e.isReferenceFileLocation=x,e.getReferencedFileLocation=D,e.isProgramUptoDate=function(t,r,n,i,a,o,s,c,l){if(!t||(null==s?void 0:s()))return !1;if(!e.arrayIsEqualTo(t.getRootFileNames(),r))return !1;var u;if(!e.arrayIsEqualTo(t.getProjectReferences(),l,(function(r,n,i){return e.projectReferenceIsEqualTo(r,n)&&d(t.getResolvedProjectReferences()[i],r)})))return !1;if(t.getSourceFiles().some((function(e){return !function(e){return e.version===i(e.resolvedPath,e.fileName)}(e)||o(e.path)})))return !1;if(t.getMissingFilePaths().some(a))return !1;var _=t.getCompilerOptions();return !(!e.compareDataObjects(_,n)||_.configFile&&n.configFile&&_.configFile.text!==n.configFile.text);function d(t,r){if(t){if(e.contains(u,t))return !0;var n=N(r),i=c(n);return !!i&&t.commandLine.options.configFile===i.options.configFile&&!!e.arrayIsEqualTo(t.commandLine.fileNames,i.fileNames)&&((u||(u=[])).push(t),!e.forEach(t.references,(function(e,r){return !d(e,t.commandLine.projectReferences[r])})))}var a=N(r);return !c(a)}},e.getConfigFileParsingDiagnostics=function(e){return e.options.configFile?n$3(n$3([],e.options.configFile.parseDiagnostics,!0),e.errors,!0):e.errors},e.getImpliedNodeFormatForFile=S,e.createProgram=function(i,a,o,s,c){var l,u,_,d,p,f,y,P,w,I,O,M,L,R=e.isArray(i)?function(e,t,r,n,i){return {rootNames:e,options:t,host:r,oldProgram:n,configFileParsingDiagnostics:i}}(i,a,o,s,c):i,B=R.rootNames,j=R.options,J=R.configFileParsingDiagnostics,z=R.projectReferences,U=R.oldProgram,K=new e.Map,V=e.createMultiMap(),q={},W={},H=new e.Map,G="number"==typeof j.maxNodeModuleJsDepth?j.maxNodeModuleJsDepth:0,Q=0,X=new e.Map,Y=new e.Map;null===e.tracing||void 0===e.tracing||e.tracing.push("program","createProgram",{configFilePath:j.configFilePath,rootDir:j.rootDir},!0),e.performance.mark("beforeProgram");var Z,$,ee,te,re,ne=R.host||r(j),ie=E(ne),ae=j.noLib,oe=e.memoize((function(){return ne.getDefaultLibFileName(j)})),se=ne.getDefaultLibLocation?ne.getDefaultLibLocation():e.getDirectoryPath(oe()),ce=e.createDiagnosticCollection(),le=ne.getCurrentDirectory(),ue=e.getSupportedExtensions(j),_e=e.getSupportedExtensionsWithJsonIfResolveJsonModule(j,ue),de=new e.Map,pe=ne.hasInvalidatedResolution||e.returnFalse;if(ne.resolveModuleNames)te=function(t,r,n,i,a){return ne.resolveModuleNames(e.Debug.checkEachDefined(t),n,i,a,j,r).map((function(t){if(!t||void 0!==t.extension)return t;var r=e.clone(t);return r.extension=e.extensionFromPath(t.resolvedFileName),r}))},$=null===(l=ne.getModuleResolutionCache)||void 0===l?void 0:l.call(ne);else {$=e.createModuleResolutionCache(le,qt,j);var fe=function(t,r,n,i){return e.resolveModuleName(t,n,j,ne,$,i,r).resolvedModule};te=function(t,r,n,i,a){return v(e.Debug.checkEachDefined(t),r,n,a,fe)};}if(ne.resolveTypeReferenceDirectives)re=function(t,r,n){return ne.resolveTypeReferenceDirectives(e.Debug.checkEachDefined(t),r,n,j)};else {ee=e.createTypeReferenceDirectiveResolutionCache(le,qt,void 0,null==$?void 0:$.getPackageJsonInfoCache());var ge=function(t,r,n){return e.resolveTypeReferenceDirective(t,r,j,ne,n,ee).resolvedTypeReferenceDirective};re=function(t,r,n){return g(e.Debug.checkEachDefined(t),r,n,ge)};}var me,ye,ve,he,be,xe=new e.Map,De=new e.Map,Se=e.createMultiMap(),Te=!1,Ce=new e.Map,Ee=ne.useCaseSensitiveFileNames()?new e.Map:void 0,ke=!!(null===(u=ne.useSourceOfProjectReferenceRedirect)||void 0===u?void 0:u.call(ne))&&!j.disableSourceOfProjectReferenceRedirect,Ne=function(t){var r,n,i=t.compilerHost.fileExists,a=t.compilerHost.directoryExists,o=t.compilerHost.getDirectories,s=t.compilerHost.realpath;return t.useSourceOfProjectReferenceRedirect?(t.compilerHost.fileExists=c,a&&(n=t.compilerHost.directoryExists=function(n){return a.call(t.compilerHost,n)?(function(r){var n;if(t.getResolvedProjectReferences()&&!e.containsIgnoredPath(r)&&s&&e.stringContains(r,e.nodeModulesPathPart)){var i=t.getSymlinkCache(),a=e.ensureTrailingDirectorySeparator(t.toPath(r));if(!(null===(n=i.getSymlinkedDirectories())||void 0===n?void 0:n.has(a))){var o,c=e.normalizePath(s.call(t.compilerHost,r));c!==r&&(o=e.ensureTrailingDirectorySeparator(t.toPath(c)))!==a?i.setSymlinkedDirectory(r,{real:e.ensureTrailingDirectorySeparator(c),realPath:o}):i.setSymlinkedDirectory(a,!1);}}}(n),!0):!!t.getResolvedProjectReferences()&&(r||(r=new e.Set,t.forEachResolvedProjectReference((function(n){var i=e.outFile(n.commandLine.options);if(i)r.add(e.getDirectoryPath(t.toPath(i)));else {var a=n.commandLine.options.declarationDir||n.commandLine.options.outDir;a&&r.add(t.toPath(a));}}))),l(n,!1))}),o&&(t.compilerHost.getDirectories=function(e){return !t.getResolvedProjectReferences()||a&&a.call(t.compilerHost,e)?o.call(t.compilerHost,e):[]}),s&&(t.compilerHost.realpath=function(e){var r;return (null===(r=t.getSymlinkCache().getSymlinkedFiles())||void 0===r?void 0:r.get(t.toPath(e)))||s.call(t.compilerHost,e)}),{onProgramCreateComplete:function(){t.compilerHost.fileExists=i,t.compilerHost.directoryExists=a,t.compilerHost.getDirectories=o;},fileExists:c,directoryExists:n}):{onProgramCreateComplete:e.noop,fileExists:c};function c(r){return !!i.call(t.compilerHost,r)||!!t.getResolvedProjectReferences()&&!!e.isDeclarationFileName(r)&&l(r,!0)}function l(n,a){var o,s=a?function(r){return function(r){var n=t.getSourceOfProjectReferenceRedirect(t.toPath(r));return void 0!==n?!e.isString(n)||i.call(t.compilerHost,n):void 0}(r)}:function(n){return function(n){var i=t.toPath(n),a="".concat(i).concat(e.directorySeparator);return e.forEachKey(r,(function(t){return i===t||e.startsWith(t,a)||e.startsWith(i,"".concat(t,"/"))}))}(n)},c=s(n);if(void 0!==c)return c;var l=t.getSymlinkCache(),u=l.getSymlinkedDirectories();if(!u)return !1;var _=t.toPath(n);return !!e.stringContains(_,e.nodeModulesPathPart)&&(!(!a||!(null===(o=l.getSymlinkedFiles())||void 0===o?void 0:o.has(_)))||e.firstDefinedIterator(u.entries(),(function(r){var i=r[0],o=r[1];if(o&&e.startsWith(_,i)){var c=s(_.replace(i,o.realPath));if(a&&c){var u=e.getNormalizedAbsolutePath(n,t.compilerHost.getCurrentDirectory());l.setSymlinkedFile(_,"".concat(o.real).concat(u.replace(new RegExp(i,"i"),"")));}return c}}))||!1)}}({compilerHost:ne,getSymlinkCache:ur,useSourceOfProjectReferenceRedirect:ke,toPath:Xe,getResolvedProjectReferences:et,getSourceOfProjectReferenceRedirect:Rt,forEachResolvedProjectReference:Lt}),Fe=Ne.onProgramCreateComplete,Ae=Ne.fileExists,Pe=Ne.directoryExists,we=ne.readFile.bind(ne);null===e.tracing||void 0===e.tracing||e.tracing.push("program","shouldProgramCreateNewSourceFiles",{hasOldProgram:!!U});var Ie,Oe=function(t,r){return !!t&&e.optionsHaveChanges(t.getCompilerOptions(),r,e.sourceFileAffectingCompilerOptions)}(U,j);if(null===e.tracing||void 0===e.tracing||e.tracing.pop(),null===e.tracing||void 0===e.tracing||e.tracing.push("program","tryReuseStructureFromOldProgram",{}),Ie=function(){var t;if(!U)return 0;var r=U.getCompilerOptions();if(e.changesAffectModuleResolution(r,j))return 0;var n=U.getRootFileNames();if(!e.arrayIsEqualTo(n,B))return 0;if(h(U.getProjectReferences(),U.getResolvedProjectReferences(),(function(t,r,n){var i=Ht((r?r.commandLine.projectReferences:z)[n]);return t?!i||i.sourceFile!==t.sourceFile||!e.arrayIsEqualTo(t.commandLine.fileNames,i.commandLine.fileNames):void 0!==i}),(function(t,r){var n=r?jt(r.sourceFile.path).commandLine.projectReferences:z;return !e.arrayIsEqualTo(t,n,e.projectReferenceIsEqualTo)})))return 0;z&&(ye=z.map(Ht));var i=[],a=[];if(Ie=2,U.getMissingFilePaths().some((function(e){return ne.fileExists(e)})))return 0;var o,s=U.getSourceFiles();!function(e){e[e.Exists=0]="Exists",e[e.Modified=1]="Modified";}(o||(o={}));for(var c=new e.Map,l=0,u=s;l<u.length;l++){var _=u[l];if(!(M=ne.getSourceFileByPath?ne.getSourceFileByPath(_.fileName,_.resolvedPath,e.getEmitScriptTarget(j),void 0,Oe):ne.getSourceFile(_.fileName,e.getEmitScriptTarget(j),void 0,Oe)))return 0;e.Debug.assert(!M.redirectInfo,"Host should not return a redirect source file from `getSourceFile`");var d=void 0;if(_.redirectInfo){if(M!==_.redirectInfo.unredirected)return 0;d=!1,M=_;}else if(U.redirectTargetsMap.has(_.path)){if(M!==_)return 0;d=!1;}else d=M!==_;M.path=_.path,M.originalFileName=_.originalFileName,M.resolvedPath=_.resolvedPath,M.fileName=_.fileName;var p=U.sourceFileToPackageName.get(_.path);if(void 0!==p){var f=c.get(p),g=d?1:0;if(void 0!==f&&1===g||1===f)return 0;c.set(p,g);}d?(e.arrayIsEqualTo(_.libReferenceDirectives,M.libReferenceDirectives,xt)||(Ie=1),_.hasNoDefaultLib!==M.hasNoDefaultLib&&(Ie=1),e.arrayIsEqualTo(_.referencedFiles,M.referencedFiles,xt)||(Ie=1),Tt(M),e.arrayIsEqualTo(_.imports,M.imports,Dt)||(Ie=1),e.arrayIsEqualTo(_.moduleAugmentations,M.moduleAugmentations,Dt)||(Ie=1),(3145728&_.flags)!=(3145728&M.flags)&&(Ie=1),e.arrayIsEqualTo(_.typeReferenceDirectives,M.typeReferenceDirectives,xt)||(Ie=1),a.push({oldFile:_,newFile:M})):pe(_.path)&&(Ie=1,a.push({oldFile:_,newFile:M})),i.push(M);}if(2!==Ie)return Ie;for(var m=a.map((function(e){return e.oldFile})),v=0,b=s;v<b.length;v++){var x=b[v];if(!e.contains(m,x))for(var D=0,S=x.ambientModuleNames;D<S.length;D++){var T=S[D];K.set(T,x.fileName);}}for(var C=0,E=a;C<E.length;C++){var k=E[C],N=(_=k.oldFile,A(M=k.newFile)),F=Ze(N,M);e.hasChangesInResolutions(N,F,_.resolvedModules,_,e.moduleResolutionIsEqualTo)?(Ie=1,M.resolvedModules=e.zipToModeAwareCache(M,N,F)):M.resolvedModules=_.resolvedModules;var P=e.map(M.typeReferenceDirectives,(function(t){return e.toFileNameLowerCase(t.fileName)})),w=We(P,M);e.hasChangesInResolutions(P,w,_.resolvedTypeReferenceDirectiveNames,_,e.typeDirectiveIsEqualTo)?(Ie=1,M.resolvedTypeReferenceDirectiveNames=e.zipToModeAwareCache(M,P,w)):M.resolvedTypeReferenceDirectiveNames=_.resolvedTypeReferenceDirectiveNames;}if(2!==Ie)return Ie;if(e.changesAffectingProgramStructure(r,j)||(null===(t=ne.hasChangedAutomaticTypeDirectiveNames)||void 0===t?void 0:t.call(ne)))return 1;me=U.getMissingFilePaths(),e.Debug.assert(i.length===U.getSourceFiles().length);for(var I=0,O=i;I<O.length;I++){var M=O[I];Ce.set(M.path,M);}return U.getFilesByNameMap().forEach((function(e,t){e?e.path!==t?Ce.set(t,Ce.get(e.path)):U.isSourceFileFromExternalLibrary(e)&&Y.set(e.path,!0):Ce.set(t,e);})),y=i,V=U.getFileIncludeReasons(),L=U.getFileProcessingDiagnostics(),H=U.getResolvedTypeReferenceDirectives(),De=U.sourceFileToPackageName,Se=U.redirectTargetsMap,Te=U.usesUriStyleNodeCoreModules,2}(),null===e.tracing||void 0===e.tracing||e.tracing.pop(),2!==Ie){p=[],f=[],z&&(ye||(ye=z.map(Ht)),B.length&&(null==ye||ye.forEach((function(t,r){if(t){var n=e.outFile(t.commandLine.options);if(ke){if(n||e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var i=0,a=t.commandLine.fileNames;i<a.length;i++)kt(l=a[i],{kind:e.FileIncludeKind.SourceFromProjectReference,index:r});}else if(n)kt(e.changeExtension(n,".d.ts"),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});else if(e.getEmitModuleKind(t.commandLine.options)===e.ModuleKind.None)for(var o=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())})),s=0,c=t.commandLine.fileNames;s<c.length;s++){var l=c[s];e.fileExtensionIs(l,".d.ts")||e.fileExtensionIs(l,".json")||kt(e.getOutputDeclarationFileName(l,t.commandLine,!ne.useCaseSensitiveFileNames(),o),{kind:e.FileIncludeKind.OutputFromProjectReference,index:r});}}})))),null===e.tracing||void 0===e.tracing||e.tracing.push("program","processRootFiles",{count:B.length}),e.forEach(B,(function(t,r){return bt(t,!1,!1,{kind:e.FileIncludeKind.RootFile,index:r})})),null===e.tracing||void 0===e.tracing||e.tracing.pop();var Me=B.length?e.getAutomaticTypeDirectiveNames(j,ne):e.emptyArray;if(Me.length){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferences",{count:Me.length});for(var Le=j.configFilePath?e.getDirectoryPath(j.configFilePath):ne.getCurrentDirectory(),Re=We(Me,e.combinePaths(Le,e.inferredTypesContainingFile)),Be=0;Be<Me.length;Be++)Ut(Me[Be],Re[Be],{kind:e.FileIncludeKind.AutomaticTypeDirectiveFile,typeReference:Me[Be],packageId:null===(_=Re[Be])||void 0===_?void 0:_.packageId});null===e.tracing||void 0===e.tracing||e.tracing.pop();}if(B.length&&!ae){var je=oe();!j.lib&&je?bt(je,!0,!1,{kind:e.FileIncludeKind.LibFile}):e.forEach(j.lib,(function(t,r){bt(Kt(t),!0,!1,{kind:e.FileIncludeKind.LibFile,index:r});}));}me=e.arrayFrom(e.mapDefinedIterator(Ce.entries(),(function(e){var t=e[0];return void 0===e[1]?t:void 0}))),y=e.stableSort(p,(function(t,r){return e.compareValues(Qe(t),Qe(r))})).concat(f),p=void 0,f=void 0;}if(e.Debug.assert(!!me),U&&ne.onReleaseOldSourceFile){for(var Je=0,ze=U.getSourceFiles();Je<ze.length;Je++){var Ue=ze[Je],Ke=st(Ue.resolvedPath);(Oe||!Ke||Ue.resolvedPath===Ue.path&&Ke.resolvedPath!==Ue.path)&&ne.onReleaseOldSourceFile(Ue,U.getCompilerOptions(),!!st(Ue.path));}ne.getParsedCommandLine||U.forEachResolvedProjectReference((function(e){jt(e.sourceFile.path)||ne.onReleaseOldSourceFile(e.sourceFile,U.getCompilerOptions(),!1);}));}U&&ne.onReleaseParsedCommandLine&&h(U.getProjectReferences(),U.getResolvedProjectReferences(),(function(e,t,r){var n=N((null==t?void 0:t.commandLine.projectReferences[r])||U.getProjectReferences()[r]);(null==ve?void 0:ve.has(Xe(n)))||ne.onReleaseParsedCommandLine(n,e,U.getCompilerOptions());})),ee=void 0,U=void 0;var Ve={getRootFileNames:function(){return B},getSourceFile:ot,getSourceFileByPath:st,getSourceFiles:function(){return y},getMissingFilePaths:function(){return me},getModuleResolutionCache:function(){return $},getFilesByNameMap:function(){return Ce},getCompilerOptions:function(){return j},getSyntacticDiagnostics:function(e,t){return ct(e,ut,t)},getOptionsDiagnostics:function(){return e.sortAndDeduplicateDiagnostics(e.concatenate(ce.getGlobalDiagnostics(),function(){if(!j.configFile)return e.emptyArray;var t=ce.getDiagnostics(j.configFile.fileName);return Lt((function(r){t=e.concatenate(t,ce.getDiagnostics(r.sourceFile.fileName));})),t}()))},getGlobalDiagnostics:function(){return B.length?e.sortAndDeduplicateDiagnostics(nt().getGlobalDiagnostics().slice()):e.emptyArray},getSemanticDiagnostics:function(e,t){return ct(e,dt,t)},getCachedSemanticDiagnostics:function(e){var t;return e?null===(t=q.perFile)||void 0===t?void 0:t.get(e.path):q.allDiagnostics},getSuggestionDiagnostics:function(e,t){return _t((function(){return nt().getSuggestionDiagnostics(e,t)}))},getDeclarationDiagnostics:function(t,r){var n=Ve.getCompilerOptions();return !t||e.outFile(n)?mt(t,r):ct(t,ht,r)},getBindAndCheckDiagnostics:function(e,t){return pt(e,t)},getProgramDiagnostics:lt,getTypeChecker:it,getClassifiableNames:function(){var t;if(!M){it(),M=new e.Set;for(var r=0,n=y;r<n.length;r++){null===(t=n[r].classifiableNames)||void 0===t||t.forEach((function(e){return M.add(e)}));}}return M},getDiagnosticsProducingTypeChecker:nt,getCommonSourceDirectory:Ye,emit:function(t,r,n,i,a,o){null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emit",{path:null==t?void 0:t.path},!0);var s=_t((function(){return function(t,r,n,i,a,o,s){if(!s){var c=T(t,r,n,i);if(c)return c}var l=nt().getEmitResolver(e.outFile(j)?void 0:r,i);e.performance.mark("beforeEmit");var u=e.emitFiles(l,$e(n),r,e.getTransformers(j,o,a),a,!1,s);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),u}(Ve,t,r,n,i,a,o)}));return null===e.tracing||void 0===e.tracing||e.tracing.pop(),s},getCurrentDirectory:function(){return le},getNodeCount:function(){return nt().getNodeCount()},getIdentifierCount:function(){return nt().getIdentifierCount()},getSymbolCount:function(){return nt().getSymbolCount()},getTypeCount:function(){return nt().getTypeCount()},getInstantiationCount:function(){return nt().getInstantiationCount()},getRelationCacheSizes:function(){return nt().getRelationCacheSizes()},getFileProcessingDiagnostics:function(){return L},getResolvedTypeReferenceDirectives:function(){return H},isSourceFileFromExternalLibrary:rt,isSourceFileDefaultLibrary:function(t){if(t.hasNoDefaultLib)return !0;if(!j.noLib)return !1;var r=ne.useCaseSensitiveFileNames()?e.equateStringsCaseSensitive:e.equateStringsCaseInsensitive;return j.lib?e.some(j.lib,(function(e){return r(t.fileName,Kt(e))})):r(t.fileName,oe())},dropDiagnosticsProducingTypeChecker:function(){I=void 0;},getSourceFileFromReference:function(e,r){return Ct(t(r.fileName,e.fileName),ot)},getLibFileFromReference:function(t){var r=e.toFileNameLowerCase(t.fileName),n=e.libMap.get(r);if(n)return ot(Kt(n))},sourceFileToPackageName:De,redirectTargetsMap:Se,usesUriStyleNodeCoreModules:Te,isEmittedFile:function(t){if(j.noEmit)return !1;var r=Xe(t);if(st(r))return !1;var n=e.outFile(j);if(n)return lr(r,n)||lr(r,e.removeFileExtension(n)+".d.ts");if(j.declarationDir&&e.containsPath(j.declarationDir,r,le,!ne.useCaseSensitiveFileNames()))return !0;if(j.outDir)return e.containsPath(j.outDir,r,le,!ne.useCaseSensitiveFileNames());if(e.fileExtensionIsOneOf(r,e.supportedJSExtensionsFlat)||e.fileExtensionIs(r,".d.ts")){var i=e.removeFileExtension(r);return !!st(i+".ts")||!!st(i+".tsx")}return !1},getConfigFileParsingDiagnostics:function(){return J||e.emptyArray},getResolvedModuleWithFailedLookupLocationsFromCache:function(t,r,n){return $&&e.resolveModuleNameFromCache(t,r,$,n)},getProjectReferences:function(){return z},getResolvedProjectReferences:et,getProjectReferenceRedirect:wt,getResolvedProjectReferenceToRedirect:Mt,getResolvedProjectReferenceByPath:jt,forEachResolvedProjectReference:Lt,isSourceOfProjectReferenceRedirect:Bt,emitBuildInfo:function(t){e.Debug.assert(!e.outFile(j)),null===e.tracing||void 0===e.tracing||e.tracing.push("emit","emitBuildInfo",{},!0),e.performance.mark("beforeEmit");var r=e.emitFiles(e.notImplementedResolver,$e(t),void 0,e.noTransformers,!1,!0);return e.performance.mark("afterEmit"),e.performance.measure("Emit","beforeEmit","afterEmit"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),r},fileExists:Ae,readFile:we,directoryExists:Pe,getSymlinkCache:ur,realpath:null===(d=ne.realpath)||void 0===d?void 0:d.bind(ne),useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getFileIncludeReasons:function(){return V},structureIsReused:Ie};return Fe(),null==L||L.forEach((function(t){switch(t.kind){case 1:return ce.add(Gt(t.file&&st(t.file),t.fileProcessingReason,t.diagnostic,t.args||e.emptyArray));case 0:var r=D(st,t.reason),i=r.file,a=r.pos,o=r.end;return ce.add(e.createFileDiagnostic.apply(void 0,n$3([i,e.Debug.checkDefined(a),e.Debug.checkDefined(o)-a,t.diagnostic],t.args||e.emptyArray,!1)));default:e.Debug.assertNever(t);}})),function(){e.stringContains(e.version,"-dev")||(e.getEmitModuleKind(j)===e.ModuleKind.Node12?nr("module",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"module","node12"):e.getEmitModuleKind(j)===e.ModuleKind.NodeNext?nr("module",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"module","nodenext"):e.getEmitModuleResolutionKind(j)===e.ModuleResolutionKind.Node12?nr("moduleResolution",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"moduleResolution","node12"):e.getEmitModuleResolutionKind(j)===e.ModuleResolutionKind.NodeNext&&nr("moduleResolution",e.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next,"moduleResolution","nodenext")),j.strictPropertyInitialization&&!e.getStrictOptionValue(j,"strictNullChecks")&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"strictPropertyInitialization","strictNullChecks"),j.exactOptionalPropertyTypes&&!e.getStrictOptionValue(j,"strictNullChecks")&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"exactOptionalPropertyTypes","strictNullChecks"),j.isolatedModules&&(j.out&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","isolatedModules"),j.outFile&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"outFile","isolatedModules")),j.inlineSourceMap&&(j.sourceMap&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"sourceMap","inlineSourceMap"),j.mapRoot&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"mapRoot","inlineSourceMap")),j.composite&&(!1===j.declaration&&rr(e.Diagnostics.Composite_projects_may_not_disable_declaration_emit,"declaration"),!1===j.incremental&&rr(e.Diagnostics.Composite_projects_may_not_disable_incremental_compilation,"declaration"));var t,r=e.outFile(j);if(j.tsBuildInfoFile?e.isIncrementalCompilation(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"tsBuildInfoFile","incremental","composite"):!j.incremental||r||j.configFilePath||ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified)),t=j.suppressOutputPathCheck?void 0:e.getTsBuildInfoEmitOutputFilePath(j),h(z,ye,(function(r,n,i){var a=(n?n.commandLine.projectReferences:z)[i],o=n&&n.sourceFile;if(r){var s=r.commandLine.options;if(s.composite&&!s.noEmit||(n?n.commandLine.fileNames:B).length&&(s.composite||ir(o,i,e.Diagnostics.Referenced_project_0_must_have_setting_composite_Colon_true,a.path),s.noEmit&&ir(o,i,e.Diagnostics.Referenced_project_0_may_not_disable_emit,a.path)),a.prepend){var c=e.outFile(s);c?ne.fileExists(c)||ir(o,i,e.Diagnostics.Output_file_0_from_project_1_does_not_exist,c,a.path):ir(o,i,e.Diagnostics.Cannot_prepend_project_0_because_it_does_not_have_outFile_set,a.path);}!n&&t&&t===e.getTsBuildInfoEmitOutputFilePath(s)&&(ir(o,i,e.Diagnostics.Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1,t,a.path),de.set(Xe(t),!0));}else ir(o,i,e.Diagnostics.File_0_not_found,a.path);})),j.composite)for(var n=new e.Set(B.map(Xe)),i=0,a=y;i<a.length;i++){var o=a[i];e.sourceFileMayBeEmitted(o,Ve)&&!n.has(o.path)&&Xt(o,e.Diagnostics.File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern,[o.fileName,j.configFilePath||""]);}if(j.paths)for(var s in j.paths)if(e.hasProperty(j.paths,s))if(e.hasZeroOrOneAsteriskCharacter(s)||Zt(!0,s,e.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character,s),e.isArray(j.paths[s])){var c=j.paths[s].length;0===c&&Zt(!1,s,e.Diagnostics.Substitutions_for_pattern_0_shouldn_t_be_an_empty_array,s);for(var l=0;l<c;l++){var u=j.paths[s][l],_=typeof u;"string"===_?(e.hasZeroOrOneAsteriskCharacter(u)||Yt(s,l,e.Diagnostics.Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character,u,s),j.baseUrl||e.pathIsRelative(u)||e.pathIsAbsolute(u)||Yt(s,l,e.Diagnostics.Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash)):Yt(s,l,e.Diagnostics.Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2,u,s,_);}}else Zt(!1,s,e.Diagnostics.Substitutions_for_pattern_0_should_be_an_array,s);j.sourceMap||j.inlineSourceMap||(j.inlineSources&&rr(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"inlineSources"),j.sourceRoot&&rr(e.Diagnostics.Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided,"sourceRoot")),j.out&&j.outFile&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"out","outFile"),!j.mapRoot||j.sourceMap||j.declarationMap||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"mapRoot","sourceMap","declarationMap"),j.declarationDir&&(e.getEmitDeclarations(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationDir","declaration","composite"),r&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"declarationDir",j.out?"out":"outFile")),j.declarationMap&&!e.getEmitDeclarations(j)&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"declarationMap","declaration","composite"),j.lib&&j.noLib&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"lib","noLib"),j.noImplicitUseStrict&&e.getStrictOptionValue(j,"alwaysStrict")&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"noImplicitUseStrict","alwaysStrict");var d=e.getEmitScriptTarget(j),p=e.find(y,(function(t){return e.isExternalModule(t)&&!t.isDeclarationFile}));if(j.isolatedModules){j.module===e.ModuleKind.None&&d<2&&rr(e.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher,"isolatedModules","target"),!1===j.preserveConstEnums&&rr(e.Diagnostics.Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled,"preserveConstEnums","isolatedModules");var f=e.find(y,(function(t){return !e.isExternalModule(t)&&!e.isSourceFileJS(t)&&!t.isDeclarationFile&&6!==t.scriptKind}));if(f){var g=e.getErrorSpanForNode(f,f);ce.add(e.createFileDiagnostic(f,g.start,g.length,e.Diagnostics._0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module,e.getBaseFileName(f.fileName)));}}else p&&d<2&&j.module===e.ModuleKind.None&&(g=e.getErrorSpanForNode(p,p.externalModuleIndicator),ce.add(e.createFileDiagnostic(p,g.start,g.length,e.Diagnostics.Cannot_use_imports_exports_or_module_augmentations_when_module_is_none)));if(r&&!j.emitDeclarationOnly&&(j.module&&j.module!==e.ModuleKind.AMD&&j.module!==e.ModuleKind.System?rr(e.Diagnostics.Only_amd_and_system_modules_are_supported_alongside_0,j.out?"out":"outFile","module"):void 0===j.module&&p&&(g=e.getErrorSpanForNode(p,p.externalModuleIndicator),ce.add(e.createFileDiagnostic(p,g.start,g.length,e.Diagnostics.Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system,j.out?"out":"outFile")))),j.resolveJsonModule&&(e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.NodeJs&&e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.Node12&&e.getEmitModuleResolutionKind(j)!==e.ModuleResolutionKind.NodeNext?rr(e.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy,"resolveJsonModule"):e.hasJsonModuleEmitEnabled(j)||rr(e.Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext,"resolveJsonModule","module")),j.outDir||j.rootDir||j.sourceRoot||j.mapRoot){var m=Ye();j.outDir&&""===m&&y.some((function(t){return e.getRootLength(t.fileName)>1}))&&rr(e.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files,"outDir");}if(j.useDefineForClassFields&&0===d&&rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3,"useDefineForClassFields"),j.checkJs&&!e.getAllowJSCompilerOption(j)&&ce.add(e.createCompilerDiagnostic(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"checkJs","allowJs")),j.emitDeclarationOnly&&(e.getEmitDeclarations(j)||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2,"emitDeclarationOnly","declaration","composite"),j.noEmit&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"emitDeclarationOnly","noEmit")),j.emitDecoratorMetadata&&!j.experimentalDecorators&&rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"emitDecoratorMetadata","experimentalDecorators"),j.jsxFactory?(j.reactNamespace&&rr(e.Diagnostics.Option_0_cannot_be_specified_with_option_1,"reactNamespace","jsxFactory"),4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFactory",e.inverseJsxOptionMap.get(""+j.jsx)),e.parseIsolatedEntityName(j.jsxFactory,d)||nr("jsxFactory",e.Diagnostics.Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name,j.jsxFactory)):j.reactNamespace&&!e.isIdentifierText(j.reactNamespace,d)&&nr("reactNamespace",e.Diagnostics.Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier,j.reactNamespace),j.jsxFragmentFactory&&(j.jsxFactory||rr(e.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1,"jsxFragmentFactory","jsxFactory"),4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxFragmentFactory",e.inverseJsxOptionMap.get(""+j.jsx)),e.parseIsolatedEntityName(j.jsxFragmentFactory,d)||nr("jsxFragmentFactory",e.Diagnostics.Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name,j.jsxFragmentFactory)),j.reactNamespace&&(4!==j.jsx&&5!==j.jsx||rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"reactNamespace",e.inverseJsxOptionMap.get(""+j.jsx))),j.jsxImportSource&&2===j.jsx&&rr(e.Diagnostics.Option_0_cannot_be_specified_when_option_jsx_is_1,"jsxImportSource",e.inverseJsxOptionMap.get(""+j.jsx)),j.preserveValueImports&&e.getEmitModuleKind(j)<e.ModuleKind.ES2015&&nr("importsNotUsedAsValues",e.Diagnostics.Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later),!j.noEmit&&!j.suppressOutputPathCheck){var v=$e(),b=new e.Set;e.forEachEmittedFile(v,(function(e){j.emitDeclarationOnly||x(e.jsFilePath,b),x(e.declarationFilePath,b);}));}function x(t,r){if(t){var n=Xe(t);if(Ce.has(n)){var i=void 0;j.configFilePath||(i=e.chainDiagnosticMessages(void 0,e.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig)),i=e.chainDiagnosticMessages(i,e.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file,t),cr(t,e.createCompilerDiagnosticFromMessageChain(i));}var a=ne.useCaseSensitiveFileNames()?n:e.toFileNameLowerCase(n);r.has(a)?cr(t,e.createCompilerDiagnostic(e.Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files,t)):r.add(a);}}}(),e.performance.mark("afterProgram"),e.performance.measure("Program","beforeProgram","afterProgram"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),Ve;function qe(t,r,n){if(!t.length)return e.emptyArray;var i=e.getNormalizedAbsolutePath(r.originalFileName,le),a=He(r);null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveModuleNamesWorker",{containingFileName:i}),e.performance.mark("beforeResolveModule");var o=te(t,r,i,n,a);return e.performance.mark("afterResolveModule"),e.performance.measure("ResolveModule","beforeResolveModule","afterResolveModule"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function We(t,r){if(!t.length)return [];var n=e.isString(r)?r:e.getNormalizedAbsolutePath(r.originalFileName,le),i=e.isString(r)?void 0:He(r);null===e.tracing||void 0===e.tracing||e.tracing.push("program","resolveTypeReferenceDirectiveNamesWorker",{containingFileName:n}),e.performance.mark("beforeResolveTypeReference");var a=re(t,n,i);return e.performance.mark("afterResolveTypeReference"),e.performance.measure("ResolveTypeReference","beforeResolveTypeReference","afterResolveTypeReference"),null===e.tracing||void 0===e.tracing||e.tracing.pop(),a}function He(t){var r=Mt(t.originalFileName);if(r||!e.fileExtensionIsOneOf(t.originalFileName,[".d.ts",".d.cts",".d.mts"]))return r;var n=Ge(t.path);if(n)return n;if(ne.realpath&&j.preserveSymlinks&&e.stringContains(t.originalFileName,e.nodeModulesPathPart)){var i=Xe(ne.realpath(t.originalFileName));return i===t.path?void 0:Ge(i)}}function Ge(t){var r=Rt(t);return e.isString(r)?Mt(r):r?Lt((function(r){var n=e.outFile(r.commandLine.options);if(n)return Xe(n)===t?r:void 0})):void 0}function Qe(t){if(e.containsPath(se,t.fileName,!1)){var r=e.getBaseFileName(t.fileName);if("lib.d.ts"===r||"lib.es6.d.ts"===r)return 0;var n=e.removeSuffix(e.removePrefix(r,"lib."),".d.ts"),i=e.libs.indexOf(n);if(-1!==i)return i+1}return e.libs.length+2}function Xe(t){return e.toPath(t,le,qt)}function Ye(){if(void 0===w){var t=e.filter(y,(function(t){return e.sourceFileMayBeEmitted(t,Ve)}));w=e.getCommonSourceDirectory(j,(function(){return e.mapDefined(t,(function(e){return e.isDeclarationFile?void 0:e.fileName}))}),le,qt,(function(r){return function(t,r){for(var n=!0,i=ne.getCanonicalFileName(e.getNormalizedAbsolutePath(r,le)),a=0,o=t;a<o.length;a++){var s=o[a];s.isDeclarationFile||0!==ne.getCanonicalFileName(e.getNormalizedAbsolutePath(s.fileName,le)).indexOf(i)&&(Xt(s,e.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,[s.fileName,r]),n=!1);}return n}(t,r)}));}return w}function Ze(t,r){if(0===Ie&&!r.ambientModuleNames.length)return qe(t,r,void 0);var n,i,a,o=U&&U.getSourceFile(r.fileName);if(o!==r&&r.resolvedModules){for(var s=[],c=0,l=0,u=t;l<u.length;l++){var _=u[l],d=r.resolvedModules.get(_,m(r,c));c++,s.push(d);}return s}var p={};for(c=0;c<t.length;c++){if(_=t[c],r===o&&!pe(o.path)){var f=e.getResolvedModule(o,_,m(o,c));if(f){e.isTraceEnabled(j,ne)&&e.trace(ne,f.packageId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2,_,e.getNormalizedAbsolutePath(r.originalFileName,le),f.resolvedFileName,f.packageId&&e.packageIdToString(f.packageId)),(i||(i=new Array(t.length)))[c]=f,(a||(a=[])).push(_);continue}}var g=!1;e.contains(r.ambientModuleNames,_)?(g=!0,e.isTraceEnabled(j,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1,_,e.getNormalizedAbsolutePath(r.originalFileName,le))):g=h(_,c),g?(i||(i=new Array(t.length)))[c]=p:(n||(n=[])).push(_);}var y=n&&n.length?qe(n,r,a):e.emptyArray;if(!i)return e.Debug.assert(y.length===t.length),y;var v=0;for(c=0;c<i.length;c++)i[c]?i[c]===p&&(i[c]=void 0):(i[c]=y[v],v++);return e.Debug.assert(v===y.length),i;function h(t,r){if(r>=e.length(null==o?void 0:o.imports)+e.length(null==o?void 0:o.moduleAugmentations))return !1;var n=e.getResolvedModule(o,t,o&&m(o,r)),i=n&&U.getSourceFile(n.resolvedFileName);if(n&&i)return !1;var a=K.get(t);return !!a&&(e.isTraceEnabled(j,ne)&&e.trace(ne,e.Diagnostics.Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified,t,a),!0)}}function $e(t){return {getPrependNodes:tt,getCanonicalFileName:qt,getCommonSourceDirectory:Ve.getCommonSourceDirectory,getCompilerOptions:Ve.getCompilerOptions,getCurrentDirectory:function(){return le},getNewLine:function(){return ne.getNewLine()},getSourceFile:Ve.getSourceFile,getSourceFileByPath:Ve.getSourceFileByPath,getSourceFiles:Ve.getSourceFiles,getLibFileFromReference:Ve.getLibFileFromReference,isSourceFileFromExternalLibrary:rt,getResolvedProjectReferenceToRedirect:Mt,getProjectReferenceRedirect:wt,isSourceOfProjectReferenceRedirect:Bt,getSymlinkCache:ur,writeFile:t||function(e,t,r,n,i){return ne.writeFile(e,t,r,n,i)},isEmitBlocked:at,readFile:function(e){return ne.readFile(e)},fileExists:function(t){var r=Xe(t);return !!st(r)||!e.contains(me,r)&&ne.fileExists(t)},useCaseSensitiveFileNames:function(){return ne.useCaseSensitiveFileNames()},getProgramBuildInfo:function(){return Ve.getProgramBuildInfo&&Ve.getProgramBuildInfo()},getSourceFileFromReference:function(e,t){return Ve.getSourceFileFromReference(e,t)},redirectTargetsMap:Se,getFileIncludeReasons:Ve.getFileIncludeReasons}}function et(){return ye}function tt(){return k(z,(function(e,t){var r;return null===(r=ye[t])||void 0===r?void 0:r.commandLine}),(function(e){var t=Xe(e),r=st(t);return r?r.text:Ce.has(t)?void 0:ne.readFile(t)}))}function rt(e){return !!Y.get(e.path)}function nt(){return I||(I=e.createTypeChecker(Ve,!0))}function it(){return O||(O=e.createTypeChecker(Ve,!1))}function at(e){return de.has(Xe(e))}function ot(e){return st(Xe(e))}function st(e){return Ce.get(e)||void 0}function ct(t,r,n){return t?r(t,n):e.sortAndDeduplicateDiagnostics(e.flatMap(Ve.getSourceFiles(),(function(e){return n&&n.throwIfCancellationRequested(),r(e,n)})))}function lt(t){var r;if(e.skipTypeChecking(t,j,Ve))return e.emptyArray;var n=ce.getDiagnostics(t.fileName);return (null===(r=t.commentDirectives)||void 0===r?void 0:r.length)?gt(t,t.commentDirectives,n).diagnostics:n}function ut(t){return e.isSourceFileJS(t)?(t.additionalSyntacticDiagnostics||(t.additionalSyntacticDiagnostics=function(t){return _t((function(){var r=[];return n(t,t),e.forEachChildRecursively(t,n,(function(t,n){switch(n.decorators!==t||j.experimentalDecorators||r.push(a(n,e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning)),n.kind){case 256:case 225:case 168:case 170:case 171:case 172:case 212:case 255:case 213:if(t===n.typeParameters)return r.push(i(t,e.Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files)),"skip";case 236:if(t===n.modifiers)return function(t,n){for(var i=0,o=t;i<o.length;i++){var s=o[i];switch(s.kind){case 85:if(n)continue;case 123:case 121:case 122:case 144:case 135:case 126:case 158:r.push(a(s,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(s.kind)));}}}(n.modifiers,236===n.kind),"skip";break;case 166:if(t===n.modifiers){for(var o=0,s=t;o<s.length;o++){var c=s[o];124!==c.kind&&r.push(a(c,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,e.tokenToString(c.kind)));}return "skip"}break;case 163:if(t===n.modifiers)return r.push(i(t,e.Diagnostics.Parameter_modifiers_can_only_be_used_in_TypeScript_files)),"skip";break;case 207:case 208:case 227:case 278:case 279:case 209:if(t===n.typeArguments)return r.push(i(t,e.Diagnostics.Type_arguments_can_only_be_used_in_TypeScript_files)),"skip"}})),r;function n(t,n){switch(n.kind){case 163:case 166:case 168:if(n.questionToken===t)return r.push(a(t,e.Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files,"?")),"skip";case 167:case 170:case 171:case 172:case 212:case 255:case 213:case 253:if(n.type===t)return r.push(a(t,e.Diagnostics.Type_annotations_can_only_be_used_in_TypeScript_files)),"skip"}switch(t.kind){case 266:if(t.isTypeOnly)return r.push(a(n,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"import type")),"skip";break;case 271:if(t.isTypeOnly)return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,"export type")),"skip";break;case 264:return r.push(a(t,e.Diagnostics.import_can_only_be_used_in_TypeScript_files)),"skip";case 270:if(t.isExportEquals)return r.push(a(t,e.Diagnostics.export_can_only_be_used_in_TypeScript_files)),"skip";break;case 290:if(117===t.token)return r.push(a(t,e.Diagnostics.implements_clauses_can_only_be_used_in_TypeScript_files)),"skip";break;case 257:var i=e.tokenToString(118);return e.Debug.assertIsDefined(i),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,i)),"skip";case 260:var o=16&t.flags?e.tokenToString(142):e.tokenToString(141);return e.Debug.assertIsDefined(o),r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,o)),"skip";case 258:return r.push(a(t,e.Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files)),"skip";case 259:var s=e.Debug.checkDefined(e.tokenToString(92));return r.push(a(t,e.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files,s)),"skip";case 229:return r.push(a(t,e.Diagnostics.Non_null_assertions_can_only_be_used_in_TypeScript_files)),"skip";case 228:return r.push(a(t.type,e.Diagnostics.Type_assertion_expressions_can_only_be_used_in_TypeScript_files)),"skip";case 210:e.Debug.fail();}}function i(r,n,i,a,o){var s=r.pos;return e.createFileDiagnostic(t,s,r.end-s,n,i,a,o)}function a(r,n,i,a,o){return e.createDiagnosticForNodeInSourceFile(t,r,n,i,a,o)}}))}(t)),e.concatenate(t.additionalSyntacticDiagnostics,t.parseDiagnostics)):t.parseDiagnostics}function _t(t){try{return t()}catch(t){throw t instanceof e.OperationCanceledException&&(O=void 0,I=void 0),t}}function dt(t,r){return e.concatenate(C(pt(t,r),j),lt(t))}function pt(e,t){return vt(e,t,q,ft)}function ft(t,r){return _t((function(){if(e.skipTypeChecking(t,j,Ve))return e.emptyArray;var n=nt();e.Debug.assert(!!t.bindDiagnostics);var i=e.isCheckJsEnabledForFile(t,j),a=!(t.checkJsDirective&&!1===t.checkJsDirective.enabled)&&(3===t.scriptKind||4===t.scriptKind||5===t.scriptKind||i||7===t.scriptKind),o=a?t.bindDiagnostics:e.emptyArray,s=a?n.getDiagnostics(t,r):e.emptyArray;return function(t,r){for(var n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o=e.flatten(i);if(!r||!(null===(n=t.commentDirectives)||void 0===n?void 0:n.length))return o;for(var s=gt(t,t.commentDirectives,o),c=s.diagnostics,l=s.directives,u=0,_=l.getUnusedExpectations();u<_.length;u++){var d=_[u];c.push(e.createDiagnosticForRange(t,d.range,e.Diagnostics.Unused_ts_expect_error_directive));}return c}(t,a,o,s,i?t.jsDocDiagnostics:void 0)}))}function gt(t,r,n){var i=e.createCommentDirectivesMap(t,r);return {diagnostics:n.filter((function(t){return -1===function(t,r){var n=t.file,i=t.start;if(!n)return -1;for(var a=e.getLineStarts(n),o=e.computeLineAndCharacterOfPosition(a,i).line-1;o>=0;){if(r.markUsed(o))return o;var s=n.text.slice(a[o],a[o+1]).trim();if(""!==s&&!/^(\s*)\/\/(.*)$/.test(s))return -1;o--;}return -1}(t,i)})),directives:i}}function mt(e,t){return vt(e,t,W,yt)}function yt(t,r){return _t((function(){var n=nt().getEmitResolver(t,r);return e.getDeclarationDiagnostics($e(e.noop),n,t)||e.emptyArray}))}function vt(t,r,n,i){var a,o=t?null===(a=n.perFile)||void 0===a?void 0:a.get(t.path):n.allDiagnostics;if(o)return o;var s=i(t,r);return t?(n.perFile||(n.perFile=new e.Map)).set(t.path,s):n.allDiagnostics=s,s}function ht(e,t){return e.isDeclarationFile?[]:mt(e,t)}function bt(t,r,n,i){Et(e.normalizePath(t),r,n,void 0,i);}function xt(e,t){return e.fileName===t.fileName}function Dt(e,t){return 79===e.kind?79===t.kind&&e.escapedText===t.escapedText:10===t.kind&&e.text===t.text}function St(t,r){var n=e.factory.createStringLiteral(t),i=e.factory.createImportDeclaration(void 0,void 0,void 0,n,void 0);return e.addEmitFlags(i,67108864),e.setParent(n,i),e.setParent(i,r),n.flags&=-9,i.flags&=-9,n}function Tt(t){if(!t.imports){var r,n,i,a=e.isSourceFileJS(t),o=e.isExternalModule(t);if((j.isolatedModules||o)&&!t.isDeclarationFile){j.importHelpers&&(r=[St(e.externalHelpersModuleNameText,t)]);var s=e.getJSXRuntimeImport(e.getJSXImplicitImportBase(j,t),j);s&&(r||(r=[])).push(St(s,t));}for(var c=0,l=t.statements;c<l.length;c++)u(l[c],!1);return (1048576&t.flags||a)&&function(t){for(var n=/import|require/g;null!==n.exec(t.text);){var i=_(t,n.lastIndex);a&&e.isRequireCall(i,!0)||e.isImportCall(i)&&i.arguments.length>=1&&e.isStringLiteralLike(i.arguments[0])?(e.setParentRecursive(i,!1),r=e.append(r,i.arguments[0])):e.isLiteralImportTypeNode(i)&&(e.setParentRecursive(i,!1),r=e.append(r,i.argument.literal));}}(t),t.imports=r||e.emptyArray,t.moduleAugmentations=n||e.emptyArray,void(t.ambientModuleNames=i||e.emptyArray)}function u(a,s){if(e.isAnyImportOrReExport(a)){var c=e.getExternalModuleName(a);!(c&&e.isStringLiteral(c)&&c.text)||s&&e.isExternalModuleNameRelative(c.text)||(e.setParentRecursive(a,!1),r=e.append(r,c),Te||0!==Q||t.isDeclarationFile||(Te=e.startsWith(c.text,"node:")));}else if(e.isModuleDeclaration(a)&&e.isAmbientModule(a)&&(s||e.hasSyntacticModifier(a,2)||t.isDeclarationFile)){a.name.parent=a;var l=e.getTextOfIdentifierOrLiteral(a.name);if(o||s&&!e.isExternalModuleNameRelative(l))(n||(n=[])).push(a.name);else if(!s){t.isDeclarationFile&&(i||(i=[])).push(l);var _=a.body;if(_)for(var d=0,p=_.statements;d<p.length;d++)u(p[d],!0);}}}function _(t,r){for(var n=t,i=function(e){if(e.pos<=r&&(r<e.end||r===e.end&&1===e.kind))return e};;){var o=a&&e.hasJSDocNodes(n)&&e.forEach(n.jsDoc,i)||e.forEachChild(n,i);if(!o)return n;n=o;}}}function Ct(t,r,n,i){if(e.hasExtension(t)){var a=ne.getCanonicalFileName(t);if(!j.allowNonTsExtensions&&!e.forEach(e.flatten(_e),(function(t){return e.fileExtensionIs(a,t)})))return void(n&&(e.hasJSFileExtension(a)?n(e.Diagnostics.File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option,t):n(e.Diagnostics.File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1,t,"'"+e.flatten(ue).join("', '")+"'")));var o=r(t);if(n)if(o)b(i)&&a===ne.getCanonicalFileName(st(i.file).fileName)&&n(e.Diagnostics.A_file_cannot_have_a_reference_to_itself);else {var s=wt(t);s?n(e.Diagnostics.Output_file_0_has_not_been_built_from_source_file_1,s,t):n(e.Diagnostics.File_0_not_found,t);}return o}var c=j.allowNonTsExtensions&&r(t);if(c)return c;if(!n||!j.allowNonTsExtensions){var l=e.forEach(ue[0],(function(e){return r(t+e)}));return n&&!l&&n(e.Diagnostics.Could_not_resolve_the_path_0_with_the_extensions_Colon_1,t,"'"+e.flatten(ue).join("', '")+"'"),l}n(e.Diagnostics.File_0_not_found,t);}function Et(e,t,r,n,i){Ct(e,(function(e){return Ft(e,t,r,i,n)}),(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return Qt(void 0,i,e,t)}),i);}function kt(e,t){return Et(e,!1,!1,void 0,t)}function Nt(t,r,n){!b(n)&&e.some(V.get(r.path),b)?Qt(r,n,e.Diagnostics.Already_included_file_name_0_differs_from_file_name_1_only_in_casing,[r.fileName,t]):Qt(r,n,e.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing,[t,r.fileName]);}function Ft(t,r,n,i,a){null===e.tracing||void 0===e.tracing||e.tracing.push("program","findSourceFile",{fileName:t,isDefaultLib:r||void 0,fileIncludeKind:e.FileIncludeKind[i.kind]});var o=function(t,r,n,i,a){var o=Xe(t);if(ke){var s=Rt(o);if(!s&&ne.realpath&&j.preserveSymlinks&&e.isDeclarationFileName(t)&&e.stringContains(t,e.nodeModulesPathPart)){var c=Xe(ne.realpath(t));c!==o&&(s=Rt(c));}if(s){var l=e.isString(s)?Ft(s,r,n,i,a):void 0;return l&&Pt(l,o,void 0),l}}var u,_=t;if(Ce.has(o)){var d=Ce.get(o);if(At(d||void 0,i),d&&j.forceConsistentCasingInFileNames){var g=d.fileName;Xe(g)!==Xe(t)&&(t=wt(t)||t),e.getNormalizedAbsolutePathWithoutRoot(g,le)!==e.getNormalizedAbsolutePathWithoutRoot(t,le)&&Nt(t,d,i);}return d&&Y.get(d.path)&&0===Q?(Y.set(d.path,!1),j.noResolve||(Jt(d,r),zt(d)),j.noLib||Vt(d),X.set(d.path,!1),Wt(d)):d&&X.get(d.path)&&Q<G&&(X.set(d.path,!1),Wt(d)),d||void 0}if(b(i)&&!ke){var m=It(t);if(m){if(e.outFile(m.commandLine.options))return;var y=Ot(m,t);t=y,u=Xe(y);}}var v=ne.getSourceFile(t,e.getEmitScriptTarget(j),(function(r){return Qt(void 0,i,e.Diagnostics.Cannot_read_file_0_Colon_1,[t,r])}),Oe);if(a){var h=e.packageIdToString(a),x=xe.get(h);if(x){var D=function(e,t,r,n,i,a){var o=Object.create(e);return o.fileName=r,o.path=n,o.resolvedPath=i,o.originalFileName=a,o.redirectInfo={redirectTarget:e,unredirected:t},Y.set(n,Q>0),Object.defineProperties(o,{id:{get:function(){return this.redirectInfo.redirectTarget.id},set:function(e){this.redirectInfo.redirectTarget.id=e;}},symbol:{get:function(){return this.redirectInfo.redirectTarget.symbol},set:function(e){this.redirectInfo.redirectTarget.symbol=e;}}}),o}(x,v,t,o,Xe(t),_);return Se.add(x.path,t),Pt(D,o,u),At(D,i),De.set(o,a.name),f.push(D),D}v&&(xe.set(h,v),De.set(o,a.name));}if(Pt(v,o,u),v){if(Y.set(o,Q>0),v.fileName=t,v.path=o,v.resolvedPath=Xe(t),v.originalFileName=_,v.impliedNodeFormat=S(v.resolvedPath,null==$?void 0:$.getPackageJsonInfoCache(),ne,j),At(v,i),ne.useCaseSensitiveFileNames()){var T=e.toFileNameLowerCase(o),C=Ee.get(T);C?Nt(t,C,i):Ee.set(T,v);}ae=ae||v.hasNoDefaultLib&&!n,j.noResolve||(Jt(v,r),zt(v)),j.noLib||Vt(v),Wt(v),r?p.push(v):f.push(v);}return v}(t,r,n,i,a);return null===e.tracing||void 0===e.tracing||e.tracing.pop(),o}function At(e,t){e&&V.add(e.path,t);}function Pt(e,t,r){r?(Ce.set(r,e),Ce.set(t,e||!1)):Ce.set(t,e);}function wt(e){var t=It(e);return t&&Ot(t,e)}function It(t){if(ye&&ye.length&&!e.fileExtensionIs(t,".d.ts")&&!e.fileExtensionIs(t,".json"))return Mt(t)}function Ot(t,r){var n=e.outFile(t.commandLine.options);return n?e.changeExtension(n,".d.ts"):e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames())}function Mt(t){void 0===he&&(he=new e.Map,Lt((function(e){Xe(j.configFilePath)!==e.sourceFile.path&&e.commandLine.fileNames.forEach((function(t){return he.set(Xe(t),e.sourceFile.path)}));})));var r=he.get(Xe(t));return r&&jt(r)}function Lt(t){return e.forEachResolvedProjectReference(ye,t)}function Rt(t){if(e.isDeclarationFileName(t))return void 0===be&&(be=new e.Map,Lt((function(t){var r=e.outFile(t.commandLine.options);if(r){var n=e.changeExtension(r,".d.ts");be.set(Xe(n),!0);}else {var i=e.memoize((function(){return e.getCommonSourceDirectoryOfConfig(t.commandLine,!ne.useCaseSensitiveFileNames())}));e.forEach(t.commandLine.fileNames,(function(r){if(!e.fileExtensionIs(r,".d.ts")&&!e.fileExtensionIs(r,".json")){var n=e.getOutputDeclarationFileName(r,t.commandLine,!ne.useCaseSensitiveFileNames(),i);be.set(Xe(n),r);}}));}}))),be.get(t)}function Bt(e){return ke&&!!Mt(e)}function jt(e){if(ve)return ve.get(e)||void 0}function Jt(r,n){e.forEach(r.referencedFiles,(function(i,a){Et(t(i.fileName,r.fileName),n,!1,void 0,{kind:e.FileIncludeKind.ReferenceFile,file:r.path,index:a});}));}function zt(t){var r=e.map(t.typeReferenceDirectives,(function(t){return e.toFileNameLowerCase(t.fileName)}));if(r)for(var n=We(r,t),i=0;i<r.length;i++){var a=t.typeReferenceDirectives[i],o=n[i],s=e.toFileNameLowerCase(a.fileName);e.setResolvedTypeReferenceDirective(t,s,o),Ut(s,o,{kind:e.FileIncludeKind.TypeReferenceDirective,file:t.path,index:i});}}function Ut(t,r,n){null===e.tracing||void 0===e.tracing||e.tracing.push("program","processTypeReferenceDirective",{directive:t,hasResolved:!!Ze,refKind:n.kind,refPath:b(n)?n.file:void 0}),function(t,r,n){var i=H.get(t);if(!i||!i.primary){var a=!0;if(r){if(r.isExternalLibraryImport&&Q++,r.primary)Et(r.resolvedFileName,!1,!1,r.packageId,n);else if(i){if(r.resolvedFileName!==i.resolvedFileName){var o=ne.readFile(r.resolvedFileName),s=ot(i.resolvedFileName);o!==s.text&&Qt(s,n,e.Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict,[t,r.resolvedFileName,i.resolvedFileName]);}a=!1;}else Et(r.resolvedFileName,!1,!1,r.packageId,n);r.isExternalLibraryImport&&Q--;}else Qt(void 0,n,e.Diagnostics.Cannot_find_type_definition_file_for_0,[t]);a&&H.set(t,r);}}(t,r,n),null===e.tracing||void 0===e.tracing||e.tracing.pop();}function Kt(t){for(var r=t.split("."),n=r[1],i=2;r[i]&&"d"!==r[i];)n+=(2===i?"/":"-")+r[i],i++;var a=e.combinePaths(le,"__lib_node_modules_lookup_".concat(t,"__.ts")),o=e.resolveModuleName("@typescript/lib-"+n,a,{moduleResolution:e.ModuleResolutionKind.NodeJs},ne,$);return (null==o?void 0:o.resolvedModule)?o.resolvedModule.resolvedFileName:e.combinePaths(se,t)}function Vt(t){e.forEach(t.libReferenceDirectives,(function(r,n){var i=e.toFileNameLowerCase(r.fileName),a=e.libMap.get(i);if(a)bt(Kt(a),!0,!0,{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n});else {var o=e.removeSuffix(e.removePrefix(i,"lib."),".d.ts"),s=e.getSpellingSuggestion(o,e.libs,e.identity),c=s?e.Diagnostics.Cannot_find_lib_definition_for_0_Did_you_mean_1:e.Diagnostics.Cannot_find_lib_definition_for_0;(L||(L=[])).push({kind:0,reason:{kind:e.FileIncludeKind.LibReferenceDirective,file:t.path,index:n},diagnostic:c,args:[i,s]});}}));}function qt(e){return ne.getCanonicalFileName(e)}function Wt(t){var r;if(Tt(t),t.imports.length||t.moduleAugmentations.length){var n=A(t),i=Ze(n,t);e.Debug.assert(i.length===n.length);for(var a=(ke?null===(r=He(t))||void 0===r?void 0:r.commandLine.options:void 0)||j,o=0;o<n.length;o++){var s=i[o];if(e.setResolvedModule(t,n[o],s,m(t,o)),s){var c=s.isExternalLibraryImport,l=!e.resolutionExtensionIsTSOrJson(s.extension),u=c&&l,_=s.resolvedFileName;c&&Q++;var d=u&&Q>G,p=_&&!F(a,s)&&!a.noResolve&&o<t.imports.length&&!d&&!(l&&!e.getAllowJSCompilerOption(a))&&(e.isInJSFile(t.imports[o])||!(4194304&t.imports[o].flags));d?X.set(t.path,!0):p&&Ft(_,!1,!1,{kind:e.FileIncludeKind.Import,file:t.path,index:o},s.packageId),c&&Q--;}}}else t.resolvedModules=void 0;}function Ht(t){ve||(ve=new e.Map);var r,n,i=N(t),a=Xe(i),o=ve.get(a);if(void 0!==o)return o||void 0;if(ne.getParsedCommandLine){if(!(r=ne.getParsedCommandLine(i)))return Pt(void 0,a,void 0),void ve.set(a,!1);n=e.Debug.checkDefined(r.options.configFile),e.Debug.assert(!n.path||n.path===a),Pt(n,a,void 0);}else {var s=e.getNormalizedAbsolutePath(e.getDirectoryPath(i),ne.getCurrentDirectory());if(Pt(n=ne.getSourceFile(i,100),a,void 0),void 0===n)return void ve.set(a,!1);r=e.parseJsonSourceFileConfigFileContent(n,ie,s,void 0,i);}n.fileName=i,n.path=a,n.resolvedPath=a,n.originalFileName=i;var c={commandLine:r,sourceFile:n};return ve.set(a,c),r.projectReferences&&(c.references=r.projectReferences.map(Ht)),c}function Gt(t,r,i,a){var o,s,c,l=b(r)?r:void 0;t&&(null===(o=V.get(t.path))||void 0===o||o.forEach(f)),r&&f(r),l&&1===(null==s?void 0:s.length)&&(s=void 0);var u=l&&D(st,l),_=s&&e.chainDiagnosticMessages(s,e.Diagnostics.The_file_is_in_the_program_because_Colon),d=t&&e.explainIfFileIsRedirect(t),p=e.chainDiagnosticMessages.apply(void 0,n$3([d?_?n$3([_],d,!0):d:_,i],a||e.emptyArray,!1));return u&&x(u)?e.createFileDiagnosticFromMessageChain(u.file,u.pos,u.end-u.pos,p,c):e.createCompilerDiagnosticFromMessageChain(p,c);function f(t){(s||(s=[])).push(e.fileIncludeReasonToDiagnostics(Ve,t)),!l&&b(t)?l=t:l!==t&&(c=e.append(c,function(t){if(b(t)){var r,n=D(st,t);switch(t.kind){case e.FileIncludeKind.Import:r=e.Diagnostics.File_is_included_via_import_here;break;case e.FileIncludeKind.ReferenceFile:r=e.Diagnostics.File_is_included_via_reference_here;break;case e.FileIncludeKind.TypeReferenceDirective:r=e.Diagnostics.File_is_included_via_type_library_reference_here;break;case e.FileIncludeKind.LibReferenceDirective:r=e.Diagnostics.File_is_included_via_library_reference_here;break;default:e.Debug.assertNever(t);}return x(n)?e.createFileDiagnostic(n.file,n.pos,n.end-n.pos,r):void 0}if(j.configFile){var i,a,o,s;switch(t.kind){case e.FileIncludeKind.RootFile:if(!j.configFile.configFileSpecs)return;var c=e.getNormalizedAbsolutePath(B[t.index],le),l=e.getMatchedFileSpec(Ve,c);if(l){i=e.getTsConfigPropArrayElementValue(j.configFile,"files",l),a=e.Diagnostics.File_is_matched_by_files_list_specified_here;break}var u=e.getMatchedIncludeSpec(Ve,c);if(!u)return;i=e.getTsConfigPropArrayElementValue(j.configFile,"include",u),a=e.Diagnostics.File_is_matched_by_include_pattern_specified_here;break;case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var _=e.Debug.checkDefined(null==ye?void 0:ye[t.index]),d=h(z,ye,(function(e,t,r){return e===_?{sourceFile:(null==t?void 0:t.sourceFile)||j.configFile,index:r}:void 0}));if(!d)return;var p=d.sourceFile,f=d.index,g=e.firstDefined(e.getTsConfigPropArray(p,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));return g&&g.elements.length>f?e.createDiagnosticForNodeInSourceFile(p,g.elements[f],t.kind===e.FileIncludeKind.OutputFromProjectReference?e.Diagnostics.File_is_output_from_referenced_project_specified_here:e.Diagnostics.File_is_source_from_referenced_project_specified_here):void 0;case e.FileIncludeKind.AutomaticTypeDirectiveFile:if(!j.types)return;i=tr("types",t.typeReference),a=e.Diagnostics.File_is_entry_point_of_type_library_specified_here;break;case e.FileIncludeKind.LibFile:if(void 0!==t.index){i=tr("lib",j.lib[t.index]),a=e.Diagnostics.File_is_library_specified_here;break}var m=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(j)?r:void 0}));i=m?(o=m,(s=$t("target"))&&e.firstDefined(s,(function(t){return e.isStringLiteral(t.initializer)&&t.initializer.text===o?t.initializer:void 0}))):void 0,a=e.Diagnostics.File_is_default_library_for_target_specified_here;break;default:e.Debug.assertNever(t);}return i&&e.createDiagnosticForNodeInSourceFile(j.configFile,i,a)}}(t))),t===r&&(r=void 0);}}function Qt(e,t,r,n){(L||(L=[])).push({kind:1,file:e&&e.path,fileProcessingReason:t,diagnostic:r,args:n});}function Xt(e,t,r){ce.add(Gt(e,void 0,t,r));}function Yt(t,r,n,i,a,o){for(var s=!0,c=0,l=er();c<l.length;c++){var u=l[c];if(e.isObjectLiteralExpression(u.initializer))for(var _=0,d=e.getPropertyAssignment(u.initializer,t);_<d.length;_++){var p=d[_].initializer;e.isArrayLiteralExpression(p)&&p.elements.length>r&&(ce.add(e.createDiagnosticForNodeInSourceFile(j.configFile,p.elements[r],n,i,a,o)),s=!1);}}s&&ce.add(e.createCompilerDiagnostic(n,i,a,o));}function Zt(t,r,n,i){for(var a=!0,o=0,s=er();o<s.length;o++){var c=s[o];e.isObjectLiteralExpression(c.initializer)&&sr(c.initializer,t,r,void 0,n,i)&&(a=!1);}a&&ce.add(e.createCompilerDiagnostic(n,i));}function $t(t){var r=or();return r&&e.getPropertyAssignment(r,t)}function er(){return $t("paths")||e.emptyArray}function tr(t,r){var n=or();return n&&e.getPropertyArrayElementValue(n,t,r)}function rr(e,t,r,n){ar(!0,t,r,e,t,r,n);}function nr(e,t,r,n){ar(!1,e,void 0,t,r,n);}function ir(t,r,n,i,a){var o=e.firstDefined(e.getTsConfigPropArray(t||j.configFile,"references"),(function(t){return e.isArrayLiteralExpression(t.initializer)?t.initializer:void 0}));o&&o.elements.length>r?ce.add(e.createDiagnosticForNodeInSourceFile(t||j.configFile,o.elements[r],n,i,a)):ce.add(e.createCompilerDiagnostic(n,i,a));}function ar(t,r,n,i,a,o,s){var c=or();(!c||!sr(c,t,r,n,i,a,o,s))&&ce.add(e.createCompilerDiagnostic(i,a,o,s));}function or(){if(void 0===Z){Z=!1;var t=e.getTsConfigObjectLiteralExpression(j.configFile);if(t)for(var r=0,n=e.getPropertyAssignment(t,"compilerOptions");r<n.length;r++){var i=n[r];if(e.isObjectLiteralExpression(i.initializer)){Z=i.initializer;break}}}return Z||void 0}function sr(t,r,n,i,a,o,s,c){for(var l=e.getPropertyAssignment(t,n,i),u=0,_=l;u<_.length;u++){var d=_[u];ce.add(e.createDiagnosticForNodeInSourceFile(j.configFile,r?d.name:d.initializer,a,o,s,c));}return !!l.length}function cr(e,t){de.set(Xe(e),!0),ce.add(t);}function lr(t,r){return 0===e.comparePaths(t,r,le,!ne.useCaseSensitiveFileNames())}function ur(){return ne.getSymlinkCache?ne.getSymlinkCache():(P||(P=e.createSymlinkCache(le,qt)),y&&H&&!P.hasProcessedResolutions()&&P.setSymlinksFromResolutions(y,H),P)}},e.emitSkippedWithNoDiagnostics={diagnostics:e.emptyArray,sourceMaps:void 0,emittedFiles:void 0,emitSkipped:!0},e.handleNoEmitOptions=T,e.filterSemanticDiagnostics=C,e.parseConfigHostFromCompilerHostLike=E,e.createPrependNodes=k,e.resolveProjectReferencePath=N,e.getResolutionDiagnostic=F,e.getModuleNameStringLiteralAt=P;}(t),function(e){function t(e,t,r,n,i,a){var o=[],s=e.emit(t,(function(e,t,r){o.push({name:e,writeByteOrderMark:r,text:t});}),n,r,i,a),c=s.emitSkipped,l=s.diagnostics,u=s.exportedModulesFromDeclarationEmit;return {outputFiles:o,emitSkipped:c,diagnostics:l,exportedModulesFromDeclarationEmit:u}}e.getFileEmitOutput=t,function(r){var n=0;function i(){return function t(r,i,o){var s=0,c={id:n++,version:function(){return s},clone:function(){return t(new e.Map(r),new e.Map(i),o&&new e.Set(o))},forEach:function(e){return r.forEach(e)},getKeys:function(e){return i.get(e)},getValues:function(e){return r.get(e)},hasKey:function(e){return r.has(e)},keys:function(){return r.keys()},deletedKeys:function(){return o},deleteKey:function(t){(o||(o=new e.Set)).add(t);var n=r.get(t);return !!n&&(n.forEach((function(e){return a(i,e,t)})),r.delete(t),s++,!0)},set:function(t,n){var l=!!(null==o?void 0:o.delete(t)),u=r.get(t);return r.set(t,n),null==u||u.forEach((function(e){n.has(e)||(l=!0,a(i,e,t));})),n.forEach((function(r){(null==u?void 0:u.has(r))||(l=!0,function(t,r,n){var i=t.get(r);i||(i=new e.Set,t.set(r,i)),i.add(n);}(i,r,t));})),l&&s++,c}};return c}(new e.Map,new e.Map,void 0)}function a(e,t,r,n){void 0===n&&(n=!0);var i=e.get(t);return !!(null==i?void 0:i.delete(r))&&(n&&!i.size&&e.delete(t),!0)}function o(t){return e.mapDefined(t.declarations,(function(t){var r;return null===(r=e.getSourceFileOfNode(t))||void 0===r?void 0:r.resolvedPath}))}function s(e,t){var r=e.getSymbolAtLocation(t);return r&&o(r)}function c(t,r,n,i){return e.toPath(t.getProjectReferenceRedirect(r)||r,n,i)}function l(t,r,n){var i;if(r.imports&&r.imports.length>0)for(var a=t.getTypeChecker(),o=0,l=r.imports;o<l.length;o++){var u=s(a,l[o]);null==u||u.forEach(S);}var _=e.getDirectoryPath(r.resolvedPath);if(r.referencedFiles&&r.referencedFiles.length>0)for(var d=0,p=r.referencedFiles;d<p.length;d++){var f=p[d];S(c(t,f.fileName,_,n));}if(r.resolvedTypeReferenceDirectiveNames&&r.resolvedTypeReferenceDirectiveNames.forEach((function(e){if(e){var r=e.resolvedFileName;S(c(t,r,_,n));}})),r.moduleAugmentations.length){a=t.getTypeChecker();for(var g=0,m=r.moduleAugmentations;g<m.length;g++){var y=m[g];if(e.isStringLiteral(y)){var v=a.getSymbolAtLocation(y);v&&D(v);}}}for(var h=0,b=t.getTypeChecker().getAmbientModules();h<b.length;h++){var x=b[h];x.declarations&&x.declarations.length>1&&D(x);}return i;function D(t){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n],o=e.getSourceFileOfNode(a);o&&o!==r&&S(o.resolvedPath);}}function S(t){(i||(i=new e.Set)).add(t);}}function u(e,t){return t&&!t.referencedMap==!e}function _(e,t){t.forEach((function(t,r){return d(e,t,r)}));}function d(e,t,r){e.fileInfos.get(r).signature=t,e.hasCalledUpdateShapeSignature.add(r);}function p(r,n,i,a,s,c,l,u){if(void 0===u&&(u=r.useFileVersionAsSignature),e.Debug.assert(!!i),e.Debug.assert(!l||!!r.exportedModulesMap,"Compute visible to outside map only if visibleToOutsideReferencedMap present in the state"),r.hasCalledUpdateShapeSignature.has(i.resolvedPath)||a.has(i.resolvedPath))return !1;var _=r.fileInfos.get(i.resolvedPath);if(!_)return e.Debug.fail();var d,p=_.signature;if(!i.isDeclarationFile&&!u){var f=t(n,i,!0,s,void 0,!0),g=e.firstOrUndefined(f.outputFiles);g&&(e.Debug.assert(e.fileExtensionIsOneOf(g.name,[".d.ts",".d.mts",".d.cts"]),"File extension for signature expected to be dts",(function(){return "Found: ".concat(e.getAnyExtensionFromPath(g.name)," for ").concat(g.name,":: All output files: ").concat(JSON.stringify(f.outputFiles.map((function(e){return e.name}))))})),d=(c||e.generateDjb2Hash)(g.text),l&&d!==p&&function(t,r,n){var i;r?(r.forEach((function(t){var r;(null==(r=o(t))?void 0:r.length)&&(i||(i=new e.Set),r.forEach((function(e){return i.add(e)})));})),i?n.set(t.resolvedPath,i):n.deleteKey(t.resolvedPath)):n.deleteKey(t.resolvedPath);}(i,f.exportedModulesFromDeclarationEmit,l));}if(void 0===d&&(d=i.version,l&&d!==p)){var m=r.referencedMap?r.referencedMap.getValues(i.resolvedPath):void 0;m?l.set(i.resolvedPath,m):l.deleteKey(i.resolvedPath);}return a.set(i.resolvedPath,d),d!==p}function f(t,r){if(!t.allFileNames){var n=r.getSourceFiles();t.allFileNames=n===e.emptyArray?e.emptyArray:n.map((function(e){return e.fileName}));}return t.allFileNames}function g(t,r){var n=t.referencedMap.getKeys(r);return n?e.arrayFrom(n.keys()):[]}function m(t){return function(t){return e.some(t.moduleAugmentations,(function(t){return e.isGlobalScopeAugmentation(t.parent)}))}(t)||!e.isExternalOrCommonJsModule(t)&&!e.isJsonSourceFile(t)&&!function(t){for(var r=0,n=t.statements;r<n.length;r++){var i=n[r];if(!e.isModuleWithStringLiteralName(i))return !1}return !0}(t)}function y(t,r,n){if(t.allFilesExcludingDefaultLibraryFile)return t.allFilesExcludingDefaultLibraryFile;var i;n&&c(n);for(var a=0,o=r.getSourceFiles();a<o.length;a++){var s=o[a];s!==n&&c(s);}return t.allFilesExcludingDefaultLibraryFile=i||e.emptyArray,t.allFilesExcludingDefaultLibraryFile;function c(e){r.isSourceFileDefaultLibrary(e)||(i||(i=[])).push(e);}}function v(t,r,n){var i=r.getCompilerOptions();return i&&e.outFile(i)?[n]:y(t,r,n)}function h(t,r,n,i,a,o,s){if(m(n))return y(t,r,n);var c=r.getCompilerOptions();if(c&&(c.isolatedModules||e.outFile(c)))return [n];var l=new e.Map;l.set(n.resolvedPath,n);for(var u=g(t,n.resolvedPath);u.length>0;){var _=u.pop();if(!l.has(_)){var d=r.getSourceFileByPath(_);l.set(_,d),d&&p(t,r,d,i,a,o,s)&&u.push.apply(u,g(t,d.resolvedPath));}}return e.arrayFrom(e.mapDefinedIterator(l.values(),(function(e){return e})))}r.createManyToManyPathMap=i,r.canReuseOldState=u,r.create=function(t,r,n,a){var o=new e.Map,s=t.getCompilerOptions().module!==e.ModuleKind.None?i():void 0,c=s?i():void 0,_=new e.Set,d=u(s,n);t.getTypeChecker();for(var p=0,f=t.getSourceFiles();p<f.length;p++){var g=f[p],y=e.Debug.checkDefined(g.version,"Program intended to be used with Builder should have source files with versions set"),v=d?n.fileInfos.get(g.resolvedPath):void 0;if(s){var h=l(t,g,r);if(h&&s.set(g.resolvedPath,h),d){var b=n.exportedModulesMap.getValues(g.resolvedPath);b&&c.set(g.resolvedPath,b);}}o.set(g.resolvedPath,{version:y,signature:v&&v.signature,affectsGlobalScope:m(g)||void 0,impliedFormat:g.impliedNodeFormat});}return {fileInfos:o,referencedMap:s,exportedModulesMap:c,hasCalledUpdateShapeSignature:_,useFileVersionAsSignature:!a&&!d}},r.releaseCache=function(e){e.allFilesExcludingDefaultLibraryFile=void 0,e.allFileNames=void 0;},r.clone=function(t){var r,n;return {fileInfos:new e.Map(t.fileInfos),referencedMap:null===(r=t.referencedMap)||void 0===r?void 0:r.clone(),exportedModulesMap:null===(n=t.exportedModulesMap)||void 0===n?void 0:n.clone(),hasCalledUpdateShapeSignature:new e.Set(t.hasCalledUpdateShapeSignature),useFileVersionAsSignature:t.useFileVersionAsSignature}},r.getFilesAffectedBy=function(t,r,n,i,a,o,s){var c=o||new e.Map,l=r.getSourceFileByPath(n);if(!l)return e.emptyArray;if(!p(t,r,l,c,i,a,s))return [l];var u=(t.referencedMap?h:v)(t,r,l,c,i,a,s);return o||_(t,c),u},r.updateSignaturesFromCache=_,r.updateSignatureOfFile=d,r.updateShapeSignature=p,r.updateExportedFilesMapFromCache=function(t,r){var n;if(r){e.Debug.assert(!!t.exportedModulesMap);var i=r.id,a=r.version();if(t.previousCache){if(t.previousCache.id===i&&t.previousCache.version===a)return;t.previousCache.id=i,t.previousCache.version=a;}else t.previousCache={id:i,version:a};null===(n=r.deletedKeys())||void 0===n||n.forEach((function(e){return t.exportedModulesMap.deleteKey(e)})),r.forEach((function(e,r){return t.exportedModulesMap.set(r,e)}));}},r.getAllDependencies=function(t,r,n){var i=r.getCompilerOptions();if(e.outFile(i))return f(t,r);if(!t.referencedMap||m(n))return f(t,r);for(var a=new e.Set,o=[n.resolvedPath];o.length;){var s=o.pop();if(!a.has(s)){a.add(s);var c=t.referencedMap.getValues(s);if(c)for(var l=c.keys(),u=l.next();!u.done;u=l.next())o.push(u.value);}}return e.arrayFrom(e.mapDefinedIterator(a.keys(),(function(e){var t,n;return null!==(n=null===(t=r.getSourceFileByPath(e))||void 0===t?void 0:t.fileName)&&void 0!==n?n:e})))},r.getReferencedByPaths=g,r.getAllFilesExcludingDefaultLibraryFile=y;}(e.BuilderState||(e.BuilderState={}));}(t),function(e){var t,r;function n(e,t,r){var n=e.file;return i$1(i$1({},e),{file:n?t.getSourceFileByPath(r(n)):void 0})}function a(t,r){e.Debug.assert(!r||!t.affectedFiles||t.affectedFiles[t.affectedFilesIndex-1]!==r||!t.semanticDiagnosticsPerFile.has(r.resolvedPath));}function o(t,r,n){for(;;){var i=t.affectedFiles;if(i){for(var a=t.seenAffectedFiles,o=t.affectedFilesIndex;o<i.length;){var c=i[o];if(!a.has(c.resolvedPath))return t.affectedFilesIndex=o,s(t,c,r,n),c;o++;}t.changedFilesSet.delete(t.currentChangedFilePath),t.currentChangedFilePath=void 0,e.BuilderState.updateSignaturesFromCache(t,t.currentAffectedFilesSignatures),t.currentAffectedFilesSignatures.clear(),e.BuilderState.updateExportedFilesMapFromCache(t,t.currentAffectedFilesExportedModulesMap),t.affectedFiles=void 0;}var l=t.changedFilesSet.keys().next();if(l.done)return;var u=e.Debug.checkDefined(t.program),_=u.getCompilerOptions();if(e.outFile(_))return e.Debug.assert(!t.semanticDiagnosticsPerFile),u;t.currentAffectedFilesSignatures||(t.currentAffectedFilesSignatures=new e.Map),t.exportedModulesMap&&(t.currentAffectedFilesExportedModulesMap||(t.currentAffectedFilesExportedModulesMap=e.BuilderState.createManyToManyPathMap())),t.affectedFiles=e.BuilderState.getFilesAffectedBy(t,u,l.value,r,n,t.currentAffectedFilesSignatures,t.currentAffectedFilesExportedModulesMap),t.currentChangedFilePath=l.value,t.affectedFilesIndex=0,t.seenAffectedFiles||(t.seenAffectedFiles=new e.Set);}}function s(t,r,n,i){var a;if(c(t,r.resolvedPath),t.allFilesExcludingDefaultLibraryFile!==t.affectedFiles)e.Debug.assert(t.hasCalledUpdateShapeSignature.has(r.resolvedPath)||(null===(a=t.currentAffectedFilesSignatures)||void 0===a?void 0:a.has(r.resolvedPath)),"Signature not updated for affected file: ".concat(r.fileName)),t.compilerOptions.assumeChangesOnlyAffectDirectDependencies||function(t,r,n){var i,a;if(t.exportedModulesMap&&t.changedFilesSet.has(r.resolvedPath)&&l(t,r.resolvedPath)){if(t.compilerOptions.isolatedModules){var o=new e.Map;o.set(r.resolvedPath,!0);for(var s=e.BuilderState.getReferencedByPaths(t,r.resolvedPath);s.length>0;){var c=s.pop();if(!o.has(c)&&(o.set(c,!0),n(t,c),l(t,c))){var _=e.Debug.checkDefined(t.program).getSourceFileByPath(c);s.push.apply(s,e.BuilderState.getReferencedByPaths(t,_.resolvedPath));}}}e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap);var d=new e.Set;null===(i=t.currentAffectedFilesExportedModulesMap.getKeys(r.resolvedPath))||void 0===i||i.forEach((function(e){return u(t,e,d,n)})),null===(a=t.exportedModulesMap.getKeys(r.resolvedPath))||void 0===a||a.forEach((function(e){var r;return !t.currentAffectedFilesExportedModulesMap.hasKey(e)&&!(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))&&u(t,e,d,n)}));}}(t,r,(function(t,r){return function(t,r,n,i){if(c(t,r),!t.changedFilesSet.has(r)){var a=e.Debug.checkDefined(t.program),o=a.getSourceFileByPath(r);o&&(e.BuilderState.updateShapeSignature(t,a,o,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap,!0),e.getEmitDeclarations(t.compilerOptions)&&b(t,r,0));}}(t,r,n,i)}));else {if(!t.cleanedDiagnosticsOfLibFiles){t.cleanedDiagnosticsOfLibFiles=!0;var o=e.Debug.checkDefined(t.program),s=o.getCompilerOptions();e.forEach(o.getSourceFiles(),(function(r){return o.isSourceFileDefaultLibrary(r)&&!e.skipTypeChecking(r,s,o)&&c(t,r.resolvedPath)}));}e.BuilderState.updateShapeSignature(t,e.Debug.checkDefined(t.program),r,e.Debug.checkDefined(t.currentAffectedFilesSignatures),n,i,t.currentAffectedFilesExportedModulesMap);}}function c(e,t){return !e.semanticDiagnosticsFromOldState||(e.semanticDiagnosticsFromOldState.delete(t),e.semanticDiagnosticsPerFile.delete(t),!e.semanticDiagnosticsFromOldState.size)}function l(t,r){return e.Debug.checkDefined(t.currentAffectedFilesSignatures).get(r)!==e.Debug.checkDefined(t.fileInfos.get(r)).signature}function u(e,t,r,n){var i;null===(i=e.referencedMap.getKeys(t))||void 0===i||i.forEach((function(t){return _(e,t,r,n)}));}function _(t,r,n,i){var a,o,s;e.tryAddToSet(n,r)&&(i(t,r),e.Debug.assert(!!t.currentAffectedFilesExportedModulesMap),null===(a=t.currentAffectedFilesExportedModulesMap.getKeys(r))||void 0===a||a.forEach((function(e){return _(t,e,n,i)})),null===(o=t.exportedModulesMap.getKeys(r))||void 0===o||o.forEach((function(e){var r;return !t.currentAffectedFilesExportedModulesMap.hasKey(e)&&!(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))&&_(t,e,n,i)})),null===(s=t.referencedMap.getKeys(r))||void 0===s||s.forEach((function(e){return !n.has(e)&&i(t,e)})));}function d(t,r,n,i,a){a?t.buildInfoEmitPending=!1:r===t.program?(t.changedFilesSet.clear(),t.programEmitComplete=!0):(t.seenAffectedFiles.add(r.resolvedPath),void 0!==n&&(t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map)).set(r.resolvedPath,n),i?(t.affectedFilesPendingEmitIndex++,t.buildInfoEmitPending=!0):t.affectedFilesIndex++);}function p(e,t,r){return d(e,r),{result:t,affected:r}}function f(e,t,r,n,i,a){return d(e,r,n,i,a),{result:t,affected:r}}function g(t,r,n){return e.concatenate(function(t,r,n){var i=r.resolvedPath;if(t.semanticDiagnosticsPerFile){var a=t.semanticDiagnosticsPerFile.get(i);if(a)return e.filterSemanticDiagnostics(a,t.compilerOptions)}var o=e.Debug.checkDefined(t.program).getBindAndCheckDiagnostics(r,n);return t.semanticDiagnosticsPerFile&&t.semanticDiagnosticsPerFile.set(i,o),e.filterSemanticDiagnostics(o,t.compilerOptions)}(t,r,n),e.Debug.checkDefined(t.program).getProgramDiagnostics(r))}function m(t,r){for(var n,i=e.getOptionsNameMap().optionsNameMap,a=0,o=e.getOwnKeys(t).sort(e.compareStringsCaseSensitive);a<o.length;a++){var s=o[a],c=s.toLowerCase(),l=i.get(c);((null==l?void 0:l.affectsEmit)||(null==l?void 0:l.affectsSemanticDiagnostics)||"strict"===c||"skiplibcheck"===c||"skipdefaultlibcheck"===c)&&((n||(n={}))[s]=y(l,t[s],r));}return n}function y(e,t,r){if(e)if("list"===e.type){var n=t;if(e.element.isFilePath&&n.length)return n.map(r)}else if(e.isFilePath)return r(t);return t}function v(t,r){return e.Debug.assert(!!t.length),t.map((function(e){var t=h(e,r);t.reportsUnnecessary=e.reportsUnnecessary,t.reportDeprecated=e.reportsDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var n=e.relatedInformation;return t.relatedInformation=n?n.length?n.map((function(e){return h(e,r)})):[]:void 0,t}))}function h(e,t){var r=e.file;return i$1(i$1({},e),{file:r?t(r.resolvedPath):void 0})}function b(t,r,n){t.affectedFilesPendingEmit||(t.affectedFilesPendingEmit=[]),t.affectedFilesPendingEmitKind||(t.affectedFilesPendingEmitKind=new e.Map);var i=t.affectedFilesPendingEmitKind.get(r);t.affectedFilesPendingEmit.push(r),t.affectedFilesPendingEmitKind.set(r,i||n),void 0===t.affectedFilesPendingEmitIndex&&(t.affectedFilesPendingEmitIndex=0);}function x(t){return e.isString(t)?{version:t,signature:t,affectsGlobalScope:void 0,impliedFormat:void 0}:e.isString(t.signature)?t:{version:t.version,signature:!1===t.signature?void 0:t.version,affectsGlobalScope:t.affectsGlobalScope,impliedFormat:t.impliedFormat}}function D(t,r){return {getState:e.notImplemented,backupState:e.noop,restoreState:e.noop,getProgram:n,getProgramOrUndefined:function(){return t().program},releaseProgram:function(){return t().program=void 0},getCompilerOptions:function(){return t().compilerOptions},getSourceFile:function(e){return n().getSourceFile(e)},getSourceFiles:function(){return n().getSourceFiles()},getOptionsDiagnostics:function(e){return n().getOptionsDiagnostics(e)},getGlobalDiagnostics:function(e){return n().getGlobalDiagnostics(e)},getConfigFileParsingDiagnostics:function(){return r},getSyntacticDiagnostics:function(e,t){return n().getSyntacticDiagnostics(e,t)},getDeclarationDiagnostics:function(e,t){return n().getDeclarationDiagnostics(e,t)},getSemanticDiagnostics:function(e,t){return n().getSemanticDiagnostics(e,t)},emit:function(e,t,r,i,a){return n().emit(e,t,r,i,a)},emitBuildInfo:function(e,t){return n().emitBuildInfo(e,t)},getAllDependencies:e.notImplemented,getCurrentDirectory:function(){return n().getCurrentDirectory()},close:e.noop};function n(){return e.Debug.checkDefined(t().program)}}(r=e.BuilderFileEmit||(e.BuilderFileEmit={}))[r.DtsOnly=0]="DtsOnly",r[r.Full=1]="Full",function(e){e[e.SemanticDiagnosticsBuilderProgram=0]="SemanticDiagnosticsBuilderProgram",e[e.EmitAndSemanticDiagnosticsBuilderProgram=1]="EmitAndSemanticDiagnosticsBuilderProgram";}(t=e.BuilderProgramKind||(e.BuilderProgramKind={})),e.getBuilderCreationParameters=function(t,r,n,i,a,o){var s,c,l;return void 0===t?(e.Debug.assert(void 0===r),s=n,l=i,e.Debug.assert(!!l),c=l.getProgram()):e.isArray(t)?(l=i,c=e.createProgram({rootNames:t,options:r,host:n,oldProgram:l&&l.getProgramOrUndefined(),configFileParsingDiagnostics:a,projectReferences:o}),s=n):(c=t,s=r,l=n,a=i),{host:s,newProgram:c,oldProgram:l,configFileParsingDiagnostics:a||e.emptyArray}},e.createBuilderProgram=function(r,i){var s=i.newProgram,c=i.host,l=i.oldProgram,u=i.configFileParsingDiagnostics,_=l&&l.getState();if(_&&s===_.program&&u===s.getConfigFileParsingDiagnostics())return s=void 0,_=void 0,l;var y,h=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),x=e.maybeBind(c,c.createHash),S=function(t,r,i,a){var o=e.BuilderState.create(t,r,i,a);o.program=t;var s=t.getCompilerOptions();o.compilerOptions=s,e.outFile(s)||(o.semanticDiagnosticsPerFile=new e.Map),o.changedFilesSet=new e.Set;var c=e.BuilderState.canReuseOldState(o.referencedMap,i),l=c?i.compilerOptions:void 0,u=c&&i.semanticDiagnosticsPerFile&&!!o.semanticDiagnosticsPerFile&&!e.compilerOptionsAffectSemanticDiagnostics(s,l);if(c){if(!i.currentChangedFilePath){var _=i.currentAffectedFilesSignatures;e.Debug.assert(!(i.affectedFiles||_&&_.size),"Cannot reuse if only few affected files of currentChangedFile were iterated");}var d=i.changedFilesSet;u&&e.Debug.assert(!d||!e.forEachKey(d,(function(e){return i.semanticDiagnosticsPerFile.has(e)})),"Semantic diagnostics shouldnt be available for changed files"),null==d||d.forEach((function(e){return o.changedFilesSet.add(e)})),!e.outFile(s)&&i.affectedFilesPendingEmit&&(o.affectedFilesPendingEmit=i.affectedFilesPendingEmit.slice(),o.affectedFilesPendingEmitKind=i.affectedFilesPendingEmitKind&&new e.Map(i.affectedFilesPendingEmitKind),o.affectedFilesPendingEmitIndex=i.affectedFilesPendingEmitIndex,o.seenAffectedFiles=new e.Set);}var p=o.referencedMap,f=c?i.referencedMap:void 0,g=u&&!s.skipLibCheck==!l.skipLibCheck,m=g&&!s.skipDefaultLibCheck==!l.skipDefaultLibCheck;return o.fileInfos.forEach((function(a,s){var l,_,d,y;if(!c||!(l=i.fileInfos.get(s))||l.version!==a.version||(d=_=p&&p.getValues(s))!==(y=f&&f.getValues(s))&&(void 0===d||void 0===y||d.size!==y.size||e.forEachKey(d,(function(e){return !y.has(e)})))||_&&e.forEachKey(_,(function(e){return !o.fileInfos.has(e)&&i.fileInfos.has(e)})))o.changedFilesSet.add(s);else if(u){var v=t.getSourceFileByPath(s);if(v.isDeclarationFile&&!g)return;if(v.hasNoDefaultLib&&!m)return;var h=i.semanticDiagnosticsPerFile.get(s);h&&(o.semanticDiagnosticsPerFile.set(s,i.hasReusableDiagnostic?function(t,r,i){if(!t.length)return e.emptyArray;var a=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(r.getCompilerOptions()),r.getCurrentDirectory()));return t.map((function(e){var t=n(e,r,o);t.reportsUnnecessary=e.reportsUnnecessary,t.reportsDeprecated=e.reportDeprecated,t.source=e.source,t.skippedOn=e.skippedOn;var i=e.relatedInformation;return t.relatedInformation=i?i.length?i.map((function(e){return n(e,r,o)})):[]:void 0,t}));function o(t){return e.toPath(t,a,i)}}(h,t,r):h),o.semanticDiagnosticsFromOldState||(o.semanticDiagnosticsFromOldState=new e.Set),o.semanticDiagnosticsFromOldState.add(s));}})),c&&e.forEachEntry(i.fileInfos,(function(e,t){return e.affectsGlobalScope&&!o.fileInfos.has(t)}))?e.BuilderState.getAllFilesExcludingDefaultLibraryFile(o,t,void 0).forEach((function(e){return o.changedFilesSet.add(e.resolvedPath)})):l&&!e.outFile(s)&&e.compilerOptionsAffectEmit(s,l)&&(t.getSourceFiles().forEach((function(e){return b(o,e.resolvedPath,1)})),e.Debug.assert(!o.seenAffectedFiles||!o.seenAffectedFiles.size),o.seenAffectedFiles=o.seenAffectedFiles||new e.Set),c&&e.forEachEntry(i.fileInfos,(function(e,t){o.fileInfos.has(t)&&o.fileInfos.get(t).impliedFormat!==e.impliedFormat&&o.changedFilesSet.add(t);})),o.buildInfoEmitPending=!!o.changedFilesSet.size,o}(s,h,_,c.disableUseFileVersionAsSignature);s.getProgramBuildInfo=function(){return function(t,r){if(!e.outFile(t.compilerOptions)){var n,i,a,o,s,c,l=e.Debug.checkDefined(t.program).getCurrentDirectory(),u=e.getDirectoryPath(e.getNormalizedAbsolutePath(e.getTsBuildInfoEmitOutputFilePath(t.compilerOptions),l)),_=[],d=new e.Map,p=e.arrayFrom(t.fileInfos.entries(),(function(r){var n=r[0],i=r[1],a=C(n);e.Debug.assert(_[a-1]===T(n));var o=t.currentAffectedFilesSignatures&&t.currentAffectedFilesSignatures.get(n),s=null!=o?o:i.signature;return i.version===s?i.affectsGlobalScope?{version:i.version,signature:void 0,affectsGlobalScope:!0,impliedFormat:i.impliedFormat}:i.version:void 0!==s?void 0===o?i:{version:i.version,signature:o,affectsGlobalScope:i.affectsGlobalScope,impliedFormat:i.impliedFormat}:{version:i.version,signature:!1,affectsGlobalScope:i.affectsGlobalScope,impliedFormat:i.impliedFormat}}));if(t.referencedMap&&(a=e.arrayFrom(t.referencedMap.keys()).sort(e.compareStringsCaseSensitive).map((function(e){return [C(e),E(t.referencedMap.getValues(e))]}))),t.exportedModulesMap&&(o=e.mapDefined(e.arrayFrom(t.exportedModulesMap.keys()).sort(e.compareStringsCaseSensitive),(function(e){var r;if(t.currentAffectedFilesExportedModulesMap){if(null===(r=t.currentAffectedFilesExportedModulesMap.deletedKeys())||void 0===r?void 0:r.has(e))return;var n=t.currentAffectedFilesExportedModulesMap.getValues(e);if(n)return [C(e),E(n)]}return [C(e),E(t.exportedModulesMap.getValues(e))]}))),t.semanticDiagnosticsPerFile)for(var f=0,g=e.arrayFrom(t.semanticDiagnosticsPerFile.keys()).sort(e.compareStringsCaseSensitive);f<g.length;f++){var y=g[f],h=t.semanticDiagnosticsPerFile.get(y);(s||(s=[])).push(h.length?[C(y),t.hasReusableDiagnostic?h:v(h,T)]:C(y));}if(t.affectedFilesPendingEmit)for(var b=new e.Set,x=0,D=t.affectedFilesPendingEmit.slice(t.affectedFilesPendingEmitIndex).sort(e.compareStringsCaseSensitive);x<D.length;x++){var S=D[x];e.tryAddToSet(b,S)&&(c||(c=[])).push([C(S),t.affectedFilesPendingEmitKind.get(S)]);}return {fileNames:_,fileInfos:p,options:m(t.compilerOptions,(function(t){return T(e.getNormalizedAbsolutePath(t,l))})),fileIdsList:n,referencedMap:a,exportedModulesMap:o,semanticDiagnosticsPerFile:s,affectedFilesPendingEmit:c}}function T(t){return e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(u,t,r))}function C(e){var t=d.get(e);return void 0===t&&(_.push(T(e)),d.set(e,t=_.length)),t}function E(t){var r=e.arrayFrom(t.keys(),C).sort(e.compareValues),a=r.join(),o=null==i?void 0:i.get(a);return void 0===o&&((n||(n=[])).push(r),(i||(i=new e.Map)).set(a,o=n.length)),o}}(S,h)},s=void 0,l=void 0,_=void 0;var T=function(){return S},C=D(T,u);return C.getState=T,C.backupState=function(){e.Debug.assert(void 0===y),y=function(t){var r,n=e.BuilderState.clone(t);return n.semanticDiagnosticsPerFile=t.semanticDiagnosticsPerFile&&new e.Map(t.semanticDiagnosticsPerFile),n.changedFilesSet=new e.Set(t.changedFilesSet),n.affectedFiles=t.affectedFiles,n.affectedFilesIndex=t.affectedFilesIndex,n.currentChangedFilePath=t.currentChangedFilePath,n.currentAffectedFilesSignatures=t.currentAffectedFilesSignatures&&new e.Map(t.currentAffectedFilesSignatures),n.currentAffectedFilesExportedModulesMap=null===(r=t.currentAffectedFilesExportedModulesMap)||void 0===r?void 0:r.clone(),n.seenAffectedFiles=t.seenAffectedFiles&&new e.Set(t.seenAffectedFiles),n.cleanedDiagnosticsOfLibFiles=t.cleanedDiagnosticsOfLibFiles,n.semanticDiagnosticsFromOldState=t.semanticDiagnosticsFromOldState&&new e.Set(t.semanticDiagnosticsFromOldState),n.program=t.program,n.compilerOptions=t.compilerOptions,n.affectedFilesPendingEmit=t.affectedFilesPendingEmit&&t.affectedFilesPendingEmit.slice(),n.affectedFilesPendingEmitKind=t.affectedFilesPendingEmitKind&&new e.Map(t.affectedFilesPendingEmitKind),n.affectedFilesPendingEmitIndex=t.affectedFilesPendingEmitIndex,n.seenEmittedFiles=t.seenEmittedFiles&&new e.Map(t.seenEmittedFiles),n.programEmitComplete=t.programEmitComplete,n}(S);},C.restoreState=function(){S=e.Debug.checkDefined(y),y=void 0;},C.getAllDependencies=function(t){return e.BuilderState.getAllDependencies(S,e.Debug.checkDefined(S.program),t)},C.getSemanticDiagnostics=function(t,r){a(S,t);var n,i=e.Debug.checkDefined(S.program).getCompilerOptions();if(e.outFile(i))return e.Debug.assert(!S.semanticDiagnosticsPerFile),e.Debug.checkDefined(S.program).getSemanticDiagnostics(t,r);if(t)return g(S,t,r);for(;k(r););for(var o=0,s=e.Debug.checkDefined(S.program).getSourceFiles();o<s.length;o++){var c=s[o];n=e.addRange(n,g(S,c,r));}return n||e.emptyArray},C.emit=function(n,i,o,s,l){var u,_,d,p=!1;r===t.EmitAndSemanticDiagnosticsBuilderProgram||n||e.outFile(S.compilerOptions)||S.compilerOptions.noEmit||!S.compilerOptions.noEmitOnError||(p=!0,u=S.affectedFilesPendingEmit&&S.affectedFilesPendingEmit.slice(),_=S.affectedFilesPendingEmitKind&&new e.Map(S.affectedFilesPendingEmitKind),d=S.affectedFilesPendingEmitIndex),r===t.EmitAndSemanticDiagnosticsBuilderProgram&&a(S,n);var f=e.handleNoEmitOptions(C,n,i,o);if(f)return f;if(p&&(S.affectedFilesPendingEmit=u,S.affectedFilesPendingEmitKind=_,S.affectedFilesPendingEmitIndex=d),!n&&r===t.EmitAndSemanticDiagnosticsBuilderProgram){for(var g=[],m=!1,y=void 0,v=[],h=void 0;h=E(i,o,s,l);)m=m||h.result.emitSkipped,y=e.addRange(y,h.result.diagnostics),v=e.addRange(v,h.result.emittedFiles),g=e.addRange(g,h.result.sourceMaps);return {emitSkipped:m,diagnostics:y||e.emptyArray,emittedFiles:v,sourceMaps:g}}return e.Debug.checkDefined(S.program).emit(n,i||e.maybeBind(c,c.writeFile),o,s,l)},C.releaseProgram=function(){!function(t){e.BuilderState.releaseCache(t),t.program=void 0;}(S),y=void 0;},r===t.SemanticDiagnosticsBuilderProgram?C.getSemanticDiagnosticsOfNextAffectedFile=k:r===t.EmitAndSemanticDiagnosticsBuilderProgram?(C.getSemanticDiagnosticsOfNextAffectedFile=k,C.emitNextAffectedFile=E,C.emitBuildInfo=function(t,r){if(S.buildInfoEmitPending){var n=e.Debug.checkDefined(S.program).emitBuildInfo(t||e.maybeBind(c,c.writeFile),r);return S.buildInfoEmitPending=!1,n}return e.emitSkippedWithNoDiagnostics}):e.notImplemented(),C;function E(t,r,n,i){var a=o(S,r,x),s=1,l=!1;if(!a)if(e.outFile(S.compilerOptions)){var u=e.Debug.checkDefined(S.program);if(S.programEmitComplete)return;a=u;}else {var _=function(t){var r=t.affectedFilesPendingEmit;if(r){for(var n=t.seenEmittedFiles||(t.seenEmittedFiles=new e.Map),i=t.affectedFilesPendingEmitIndex;i<r.length;i++){var a=e.Debug.checkDefined(t.program).getSourceFileByPath(r[i]);if(a){var o=n.get(a.resolvedPath),s=e.Debug.checkDefined(e.Debug.checkDefined(t.affectedFilesPendingEmitKind).get(a.resolvedPath));if(void 0===o||o<s)return t.affectedFilesPendingEmitIndex=i,{affectedFile:a,emitKind:s}}}t.affectedFilesPendingEmit=void 0,t.affectedFilesPendingEmitKind=void 0,t.affectedFilesPendingEmitIndex=void 0;}}(S);if(!_){if(!S.buildInfoEmitPending)return;var d=e.Debug.checkDefined(S.program);return f(S,d.emitBuildInfo(t||e.maybeBind(c,c.writeFile),r),d,1,!1,!0)}a=_.affectedFile,s=_.emitKind,l=!0;}return f(S,e.Debug.checkDefined(S.program).emit(a===S.program?void 0:a,t||e.maybeBind(c,c.writeFile),r,n||0===s,i),a,s,l)}function k(e,n){for(;;){var i=o(S,e,x);if(!i)return;if(i===S.program)return p(S,S.program.getSemanticDiagnostics(void 0,e),i);if((r===t.EmitAndSemanticDiagnosticsBuilderProgram||S.compilerOptions.noEmit||S.compilerOptions.noEmitOnError)&&b(S,i.resolvedPath,1),!n||!n(i))return p(S,g(S,i,e),i);d(S,i);}}},e.toBuilderStateFileInfo=x,e.createBuildProgramUsingProgramBuildInfo=function(t,r,n){var i,a=e.getDirectoryPath(e.getNormalizedAbsolutePath(r,n.getCurrentDirectory())),o=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames()),s=t.fileNames.map((function(t){return e.toPath(t,a,o)})),c=null===(i=t.fileIdsList)||void 0===i?void 0:i.map((function(t){return new e.Set(t.map(_))})),l=new e.Map;t.fileInfos.forEach((function(e,t){return l.set(_(t+1),x(e))}));var u={fileInfos:l,compilerOptions:t.options?e.convertToOptionsWithAbsolutePaths(t.options,(function(t){return e.getNormalizedAbsolutePath(t,a)})):{},referencedMap:d(t.referencedMap),exportedModulesMap:d(t.exportedModulesMap),semanticDiagnosticsPerFile:t.semanticDiagnosticsPerFile&&e.arrayToMap(t.semanticDiagnosticsPerFile,(function(t){return _(e.isNumber(t)?t:t[0])}),(function(t){return e.isNumber(t)?e.emptyArray:t[1]})),hasReusableDiagnostic:!0,affectedFilesPendingEmit:e.map(t.affectedFilesPendingEmit,(function(e){return _(e[0])})),affectedFilesPendingEmitKind:t.affectedFilesPendingEmit&&e.arrayToMap(t.affectedFilesPendingEmit,(function(e){return _(e[0])}),(function(e){return e[1]})),affectedFilesPendingEmitIndex:t.affectedFilesPendingEmit&&0};return {getState:function(){return u},backupState:e.noop,restoreState:e.noop,getProgram:e.notImplemented,getProgramOrUndefined:e.returnUndefined,releaseProgram:e.noop,getCompilerOptions:function(){return u.compilerOptions},getSourceFile:e.notImplemented,getSourceFiles:e.notImplemented,getOptionsDiagnostics:e.notImplemented,getGlobalDiagnostics:e.notImplemented,getConfigFileParsingDiagnostics:e.notImplemented,getSyntacticDiagnostics:e.notImplemented,getDeclarationDiagnostics:e.notImplemented,getSemanticDiagnostics:e.notImplemented,emit:e.notImplemented,getAllDependencies:e.notImplemented,getCurrentDirectory:e.notImplemented,emitNextAffectedFile:e.notImplemented,getSemanticDiagnosticsOfNextAffectedFile:e.notImplemented,emitBuildInfo:e.notImplemented,close:e.noop};function _(e){return s[e-1]}function d(t){if(t){var r=e.BuilderState.createManyToManyPathMap();return t.forEach((function(e){var t=e[0],n=e[1];return r.set(_(t),c[n-1])})),r}}},e.createRedirectedBuilderProgram=D;}(t),function(e){e.createSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.SemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createEmitAndSemanticDiagnosticsBuilderProgram=function(t,r,n,i,a,o){return e.createBuilderProgram(e.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram,e.getBuilderCreationParameters(t,r,n,i,a,o))},e.createAbstractBuilder=function(t,r,n,i,a,o){var s=e.getBuilderCreationParameters(t,r,n,i,a,o),c=s.newProgram,l=s.configFileParsingDiagnostics;return e.createRedirectedBuilderProgram((function(){return {program:c,compilerOptions:c.getCompilerOptions()}}),l)};}(t),function(e){function t(t){return e.endsWith(t,"/node_modules/.staging")?e.removeSuffix(t,"/.staging"):e.some(e.ignoredPaths,(function(r){return e.stringContains(t,r)}))?void 0:t}function r(t){var r=e.getRootLength(t);if(t.length===r)return !1;var n=t.indexOf(e.directorySeparator,r);if(-1===n)return !1;var i=t.substring(r,n+1),a=r>1||47!==t.charCodeAt(0);if(a&&0!==t.search(/[a-zA-Z]:/)&&0===i.search(/[a-zA-z]\$\//)){if(-1===(n=t.indexOf(e.directorySeparator,n+1)))return !1;i=t.substring(r+i.length,n+1);}if(a&&0!==i.search(/users\//i))return !0;for(var o=n+1,s=2;s>0;s--)if(0===(o=t.indexOf(e.directorySeparator,o)+1))return !1;return !0}function n(e){var t,r;return !(!(null===(t=e.resolvedModule)||void 0===t?void 0:t.originalPath)&&!(null===(r=e.resolvedTypeReferenceDirective)||void 0===r?void 0:r.originalPath))}e.removeIgnoredPath=t,e.canWatchDirectory=r,e.createResolutionCache=function(i,a,o){var s,c,l,u,_,d,p=e.createMultiMap(),f=[],g=e.createMultiMap(),m=!1,y=e.memoize((function(){return i.getCurrentDirectory()})),v=i.getCachedDirectoryStructureHost(),h=new e.Map,b=e.createCacheWithRedirects(),x=e.createCacheWithRedirects(),D=e.createModuleResolutionCache(y(),i.getCanonicalFileName,void 0,b,x),S=new e.Map,T=e.createCacheWithRedirects(),C=e.createTypeReferenceDirectiveResolutionCache(y(),i.getCanonicalFileName,void 0,D.getPackageJsonInfoCache(),T),E=[".ts",".tsx",".js",".jsx",".json"],k=new e.Map,N=new e.Map,F=a&&e.removeTrailingDirectorySeparator(e.getNormalizedAbsolutePath(a,y())),A=F&&i.toPath(F),P=void 0!==A?A.split(e.directorySeparator).length:0,w=new e.Map;return {getModuleResolutionCache:function(){return D},startRecordingFilesWithChangedResolutions:function(){s=[];},finishRecordingFilesWithChangedResolutions:function(){var e=s;return s=void 0,e},startCachingPerDirectoryResolution:R,finishCachingPerDirectoryResolution:function(){l=void 0,R(),N.forEach((function(e,t){0===e.refCount&&(N.delete(t),e.watcher.close());})),m=!1;},resolveModuleNames:function(t,r,n,i,a){return J({names:t,containingFile:r,redirectedReference:i,cache:h,perDirectoryCacheWithRedirects:b,loader:B,getResolutionWithResolvedFileName:I,shouldRetryResolution:function(t){return !t.resolvedModule||!e.resolutionExtensionIsTSOrJson(t.resolvedModule.extension)},reusedNames:n,logChanges:o,containingSourceFile:a})},getResolvedModuleWithFailedLookupLocationsFromCache:function(e,t,r){var n=h.get(i.toPath(t));return n?n.get(e,r):void 0},resolveTypeReferenceDirectives:function(e,t,r){return J({names:e,containingFile:t,redirectedReference:r,cache:S,perDirectoryCacheWithRedirects:T,loader:j,getResolutionWithResolvedFileName:O,shouldRetryResolution:function(e){return void 0===e.resolvedTypeReferenceDirective}})},removeResolutionsFromProjectReferenceRedirects:function(t){if(e.fileExtensionIs(t,".json")){var r=i.getCurrentProgram();if(r){var n=r.getResolvedProjectReferenceByPath(t);n&&n.commandLine.fileNames.forEach((function(e){return $(i.toPath(e))}));}}},removeResolutionsOfFile:$,hasChangedAutomaticTypeDirectiveNames:function(){return m},invalidateResolutionOfFile:function(t){$(t);var r=m;ee(g.get(t),e.returnTrue)&&m&&!r&&i.onChangedAutomaticTypeDirectiveNames();},invalidateResolutionsOfFailedLookupLocations:re,setFilesWithInvalidatedNonRelativeUnresolvedImports:function(t){e.Debug.assert(l===t||void 0===l),l=t;},createHasInvalidatedResolution:function(t){if(re(),t)return c=void 0,e.returnTrue;var r=c;return c=void 0,function(e){return !!r&&r.has(e)||L(e)}},isFileWithInvalidatedNonRelativeUnresolvedImports:L,updateTypeRootsWatch:function(){var t=i.getCompilationSettings();if(t.types)ie();else {var r=e.getEffectiveTypeRoots(t,{directoryExists:oe,getCurrentDirectory:y});r?e.mutateMap(w,e.arrayToMap(r,(function(e){return i.toPath(e)})),{createNewValue:ae,onDeleteValue:e.closeFileWatcher}):ie();}},closeTypeRootsWatch:ie,clear:function(){e.clearMap(N,e.closeFileWatcherOf),k.clear(),p.clear(),ie(),h.clear(),S.clear(),g.clear(),f.length=0,u=void 0,_=void 0,d=void 0,R(),m=!1;}};function I(e){return e.resolvedModule}function O(e){return e.resolvedTypeReferenceDirective}function M(t,r){return !(void 0===t||r.length<=t.length)&&e.startsWith(r,t)&&r[t.length]===e.directorySeparator}function L(e){if(!l)return !1;var t=l.get(e);return !!t&&!!t.length}function R(){D.clear(),C.clear(),p.forEach(H),p.clear();}function B(t,r,n,a,o){var s,c=e.resolveModuleName(t,r,n,a,D,o);if(!i.getGlobalCache)return c;var l=i.getGlobalCache();if(!(void 0===l||e.isExternalModuleNameRelative(t)||c.resolvedModule&&e.extensionIsTS(c.resolvedModule.extension))){var u=e.loadModuleFromGlobalCache(e.Debug.checkDefined(i.globalCacheResolutionModuleName)(t),i.projectName,n,a,l,D),_=u.resolvedModule,d=u.failedLookupLocations;if(_)return c.resolvedModule=_,(s=c.failedLookupLocations).push.apply(s,d),c}return c}function j(t,r,n,i,a){return e.resolveTypeReferenceDirective(t,r,n,i,a,C)}function J(t){var r,a,o,c=t.names,l=t.containingFile,u=t.redirectedReference,_=t.cache,d=t.perDirectoryCacheWithRedirects,p=t.loader,f=t.getResolutionWithResolvedFileName,g=t.shouldRetryResolution,m=t.reusedNames,y=t.logChanges,v=t.containingSourceFile,h=i.toPath(l),b=_.get(h)||_.set(h,e.createModeAwareCache()).get(h),x=e.getDirectoryPath(h),D=d.getOrCreateMapOfCacheRedirects(u),S=D.get(x);S||(S=e.createModeAwareCache(),D.set(x,S));for(var T=[],C=i.getCompilationSettings(),E=y&&L(h),k=i.getCurrentProgram(),N=k&&k.getResolvedProjectReferenceToRedirect(l),F=N?!u||u.sourceFile.path!==N.sourceFile.path:!!u,A=e.createModeAwareCache(),P=0,w=0,I=c;w<I.length;w++){var O=I[w],M=v?e.getModeForResolutionAtIndex(v,P):void 0;P++;var R=b.get(O,M);if(!A.has(O,M)&&F||!R||R.isInvalidated||E&&!e.isExternalModuleNameRelative(O)&&g(R)){var j=R,J=S.get(O,M);if(J){R=J;var z=(null===(r=i.getCompilerHost)||void 0===r?void 0:r.call(i))||i;if(e.isTraceEnabled(C,z)){var U=f(R);e.trace(z,p===B?(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved:(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved,O,l,e.getDirectoryPath(l),null==U?void 0:U.resolvedFileName,(null==U?void 0:U.packagetId)&&e.packageIdToString(U.packagetId));}}else R=p(O,l,C,(null===(a=i.getCompilerHost)||void 0===a?void 0:a.call(i))||i,u,v),S.set(O,M,R),i.onDiscoveredSymlink&&n(R)&&i.onDiscoveredSymlink();b.set(O,M,R),q(O,R,h,f),j&&Q(j,h,f),y&&s&&!K(j,R)&&(s.push(h),y=!1);}else z=(null===(o=i.getCompilerHost)||void 0===o?void 0:o.call(i))||i,e.isTraceEnabled(C,z)&&!A.has(O,M)&&(U=f(R),e.trace(z,p===B?(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved:(null==U?void 0:U.resolvedFileName)?U.packagetId?e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2:e.Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,O,l,null==U?void 0:U.resolvedFileName,(null==U?void 0:U.packagetId)&&e.packageIdToString(U.packagetId)));e.Debug.assert(void 0!==R&&!R.isInvalidated),A.set(O,M,!0),T.push(f(R));}return b.forEach((function(t,r,n){A.has(r,n)||e.contains(m,r)||(Q(t,h,f),b.delete(r,n));})),T;function K(e,t){if(e===t)return !0;if(!e||!t)return !1;var r=f(e),n=f(t);return r===n||!(!r||!n)&&r.resolvedFileName===n.resolvedFileName}}function z(t){return e.endsWith(t,"/node_modules/@types")}function U(t,r){if(M(A,r)){t=e.isRootedDiskPath(t)?e.normalizePath(t):e.getNormalizedAbsolutePath(t,y());var n=r.split(e.directorySeparator),i=t.split(e.directorySeparator);return e.Debug.assert(i.length===n.length,"FailedLookup: ".concat(t," failedLookupLocationPath: ").concat(r)),n.length>P+1?{dir:i.slice(0,P+1).join(e.directorySeparator),dirPath:n.slice(0,P+1).join(e.directorySeparator)}:{dir:F,dirPath:A,nonRecursive:!1}}return K(e.getDirectoryPath(e.getNormalizedAbsolutePath(t,y())),e.getDirectoryPath(r))}function K(t,n){for(;e.pathContainsNodeModules(n);)t=e.getDirectoryPath(t),n=e.getDirectoryPath(n);if(e.isNodeModulesDirectory(n))return r(e.getDirectoryPath(n))?{dir:t,dirPath:n}:void 0;var i,a,o=!0;if(void 0!==A)for(;!M(n,A);){var s=e.getDirectoryPath(n);if(s===n)break;o=!1,i=n,a=t,n=s,t=e.getDirectoryPath(t);}return r(n)?{dir:a||t,dirPath:i||n,nonRecursive:o}:void 0}function V(t){return e.fileExtensionIsOneOf(t,E)}function q(t,r,n,a){if(r.refCount)r.refCount++,e.Debug.assertDefined(r.files);else {r.refCount=1,e.Debug.assert(0===e.length(r.files)),e.isExternalModuleNameRelative(t)?W(r):p.add(t,r);var o=a(r);o&&o.resolvedFileName&&g.add(i.toPath(o.resolvedFileName),r);}(r.files||(r.files=[])).push(n);}function W(t){e.Debug.assert(!!t.refCount);var r=t.failedLookupLocations;if(r.length){f.push(t);for(var n=!1,a=0,o=r;a<o.length;a++){var s=o[a],c=i.toPath(s),l=U(s,c);if(l){var u=l.dir,_=l.dirPath,d=l.nonRecursive;if(!V(c)){var p=k.get(c)||0;k.set(c,p+1);}_===A?(e.Debug.assert(!d),n=!0):G(u,_,d);}}n&&G(F,A,!0);}}function H(e,t){var r=i.getCurrentProgram();r&&r.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(t)||e.forEach(W);}function G(t,r,n){var i=N.get(r);i?(e.Debug.assert(!!n==!!i.nonRecursive),i.refCount++):N.set(r,{watcher:Y(t,r,n),refCount:1,nonRecursive:n});}function Q(t,r,n){if(e.unorderedRemoveItem(e.Debug.assertDefined(t.files),r),t.refCount--,!t.refCount){var a=n(t);if(a&&a.resolvedFileName&&g.remove(i.toPath(a.resolvedFileName),t),e.unorderedRemoveItem(f,t)){for(var o=!1,s=0,c=t.failedLookupLocations;s<c.length;s++){var l=c[s],u=i.toPath(l),_=U(l,u);if(_){var d=_.dirPath,p=k.get(u);p&&(1===p?k.delete(u):(e.Debug.assert(p>1),k.set(u,p-1))),d===A?o=!0:X(d);}}o&&X(A);}}}function X(e){N.get(e).refCount--;}function Y(e,t,r){return i.watchDirectoryOfFailedLookupLocation(e,(function(e){var r=i.toPath(e);v&&v.addOrDeleteFileOrDirectory(e,r),te(r,t===r);}),r?0:1)}function Z(e,t,r){var n=e.get(t);n&&(n.forEach((function(e){return Q(e,t,r)})),e.delete(t));}function $(e){Z(h,e,I),Z(S,e,O);}function ee(t,r){if(!t)return !1;for(var n=!1,i=0,a=t;i<a.length;i++){var o=a[i];if(!o.isInvalidated&&r(o)){o.isInvalidated=n=!0;for(var s=0,l=e.Debug.assertDefined(o.files);s<l.length;s++){var u=l[s];(c||(c=new e.Set)).add(u),m=m||e.endsWith(u,e.inferredTypesContainingFile);}}}return n}function te(r,n){if(n)(d||(d=[])).push(r);else {var a=t(r);if(!a)return !1;if(r=a,i.fileIsOpen(r))return !1;var o=e.getDirectoryPath(r);if(z(r)||e.isNodeModulesDirectory(r)||z(o)||e.isNodeModulesDirectory(o))(u||(u=[])).push(r),(_||(_=new e.Set)).add(r);else {if(!V(r)&&!k.has(r))return !1;if(e.isEmittedFileOfProgram(i.getCurrentProgram(),r))return !1;(u||(u=[])).push(r);var s=e.parseNodeModuleFromPath(r);s&&(_||(_=new e.Set)).add(s);}}i.scheduleInvalidateResolutionsOfFailedLookupLocations();}function re(){if(!u&&!_&&!d)return !1;var e=ee(f,ne);return u=void 0,_=void 0,d=void 0,e}function ne(t){return t.failedLookupLocations.some((function(t){var r=i.toPath(t);return e.contains(u,r)||e.firstDefinedIterator((null==_?void 0:_.keys())||e.emptyIterator,(function(t){return !!e.startsWith(r,t)||void 0}))||(null==d?void 0:d.some((function(e){return M(e,r)})))}))}function ie(){e.clearMap(w,e.closeFileWatcher);}function ae(e,t){return i.watchTypeRootsDirectory(t,(function(r){var n=i.toPath(r);v&&v.addOrDeleteFileOrDirectory(r,n),m=!0,i.onChangedAutomaticTypeDirectiveNames();var a=function(e,t){if(M(A,t))return A;var r=K(e,t);return r&&N.has(r.dirPath)?r.dirPath:void 0}(t,e);a&&te(n,a===n);}),1)}function oe(t){var n=e.getDirectoryPath(e.getDirectoryPath(t)),a=i.toPath(n);return a===A||r(a)}};}(t),function(e){!function(t){var r,a,o;function s(t,r,n,i){var a=r.importModuleSpecifierPreference,o=r.importModuleSpecifierEnding;return {relativePreference:"relative"===a?0:"non-relative"===a?1:"project-relative"===a?3:2,ending:function(){switch(o){case"minimal":return 0;case"index":return 1;case"js":return 2;default:return function(t){var r=t.imports;return e.firstDefined(r,(function(t){var r=t.text;return e.pathIsRelative(r)?e.hasJSFileExtension(r):void 0}))||!1}(i)||c(n,i.path,t)?2:e.getEmitModuleResolutionKind(n)!==e.ModuleResolutionKind.NodeJs?1:0}}()}}function c(t,r,n){return (e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeNext)&&e.getImpliedNodeFormatForFile(r,void 0,function(t){var r;return {fileExists:t.fileExists,readFile:e.Debug.checkDefined(t.readFile),directoryExists:t.directoryExists,getCurrentDirectory:t.getCurrentDirectory,realpath:t.realpath,useCaseSensitiveFileNames:null===(r=t.useCaseSensitiveFileNames)||void 0===r?void 0:r.call(t)}}(n),t)!==e.ModuleKind.CommonJS}function l(t,r,n,i,a,o){var s=d(r,i),c=v(r,n,i,o);return e.firstDefined(c,(function(e){return D(e,s,i,t)}))||p(n,s,t,i,a)}function u(t,r,n,i){var a,o=e.getSourceFileOfModule(t);if(!o)return e.emptyArray;var s=null===(a=n.getModuleSpecifierCache)||void 0===a?void 0:a.call(n),c=null==s?void 0:s.get(r.path,o.path,i);return [null==c?void 0:c.moduleSpecifiers,o,null==c?void 0:c.modulePaths,s]}function _(t,r,n,i,a,o){var c=!1,l=function(t,r){var n,i=null===(n=t.declarations)||void 0===n?void 0:n.find((function(t){return e.isNonGlobalAmbientModule(t)&&(!e.isExternalModuleAugmentation(t)||!e.isExternalModuleNameRelative(e.getTextOfIdentifierOrLiteral(t.name)))}));if(i)return i.name.text;var a=e.mapDefined(t.declarations,(function(t){var n,i,a,o;if(e.isModuleDeclaration(t)){var s=function(e){for(;4&e.flags;)e=e.parent;return e}(t);if((null===(n=null==s?void 0:s.parent)||void 0===n?void 0:n.parent)&&e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)&&e.isSourceFile(s.parent.parent.parent)){var c=null===(o=null===(a=null===(i=s.parent.parent.symbol.exports)||void 0===i?void 0:i.get("export="))||void 0===a?void 0:a.valueDeclaration)||void 0===o?void 0:o.expression;if(c){var l=r.getSymbolAtLocation(c);if(l&&(2097152&(null==l?void 0:l.flags)?r.getAliasedSymbol(l):l)===t.symbol)return s.parent.parent}}}}))[0];return a?a.name.text:void 0}(t,r);if(l)return {moduleSpecifiers:[l],computedWithoutCache:c};var _=u(t,i,a,o),f=_[0],g=_[1],m=_[2],y=_[3];if(f)return {moduleSpecifiers:f,computedWithoutCache:c};if(!g)return {moduleSpecifiers:e.emptyArray,computedWithoutCache:c};c=!0,m||(m=h(i.path,g.originalFileName,a));var v=function(t,r,n,i,a){var o=d(n.path,i),c=s(i,a,r,n),l=e.forEach(t,(function(t){return e.forEach(i.getFileIncludeReasons().get(e.toPath(t.path,i.getCurrentDirectory(),o.getCanonicalFileName)),(function(t){if(t.kind===e.FileIncludeKind.Import&&t.file===n.path){var r=e.getModuleNameStringLiteralAt(n,t.index).text;return 1===c.relativePreference&&e.pathIsRelative(r)?void 0:r}}))}));if(l)return [l];for(var u,_,f,g=e.some(t,(function(e){return e.isInNodeModules})),m=0,y=t;m<y.length;m++){var v=y[m],h=D(v,o,i,r);if(u=e.append(u,h),h&&v.isRedirect)return u;if(!h&&!v.isRedirect){var b=p(v.path,o,r,i,c);e.pathIsBareSpecifier(b)?_=e.append(_,b):g&&!v.isInNodeModules||(f=e.append(f,b));}}return (null==_?void 0:_.length)?_:(null==u?void 0:u.length)?u:e.Debug.checkDefined(f)}(m,n,i,a,o);return null==y||y.set(i.path,g.path,o,m,v),{moduleSpecifiers:v,computedWithoutCache:c}}function d(t,r){return {getCanonicalFileName:e.createGetCanonicalFileName(!r.useCaseSensitiveFileNames||r.useCaseSensitiveFileNames()),importingSourceFileName:t,sourceDirectory:e.getDirectoryPath(t)}}function p(t,r,n,i,a){var o=a.ending,s=a.relativePreference,c=n.baseUrl,l=n.paths,u=n.rootDirs,_=r.sourceDirectory,d=r.getCanonicalFileName,p=u&&function(t,r,n,i,a,o){var s=S(r,t,i);if(void 0!==s){var c=S(n,t,i),l=void 0!==c?e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(c,s,i)):s;return e.getEmitModuleResolutionKind(o)===e.ModuleResolutionKind.NodeJs?T(l,a,o):e.removeFileExtension(l)}}(u,t,_,d,o,n)||T(e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(_,t,d)),o,n);if(!c&&!l||0===s)return p;var g=k(t,e.getNormalizedAbsolutePath(e.getPathsBasePath(n,i)||c,i.getCurrentDirectory()),d);if(!g)return p;var y=T(g,o,n),v=l&&b(e.removeFileExtension(g),y,l),h=void 0===v&&void 0!==c?y:v;if(!h)return p;if(1===s)return h;if(3===s){var x=n.configFilePath?e.toPath(e.getDirectoryPath(n.configFilePath),i.getCurrentDirectory(),r.getCanonicalFileName):r.getCanonicalFileName(i.getCurrentDirectory()),D=e.toPath(t,x,d),C=e.startsWith(_,x),E=e.startsWith(D,x);if(C&&!E||!C&&E)return h;var F=m(i,e.getDirectoryPath(D));return m(i,_)!==F?h:p}return 2!==s&&e.Debug.assertNever(s),N(h)||f(p)<f(h)?p:h}function f(t){for(var r=0,n=e.startsWith(t,"./")?2:0;n<t.length;n++)47===t.charCodeAt(n)&&r++;return r}function g(t,r){return e.compareBooleans(r.isRedirect,t.isRedirect)||e.compareNumberOfDirectorySeparators(t.path,r.path)}function m(t,r){return t.getNearestAncestorDirectoryWithPackageJson?t.getNearestAncestorDirectoryWithPackageJson(r):!!e.forEachAncestorDirectory(r,(function(r){return !!t.fileExists(e.combinePaths(r,"package.json"))||void 0}))}function y(t,r,i,a,o){var s,c=e.hostGetCanonicalFileName(i),l=i.getCurrentDirectory(),u=i.isSourceOfProjectReferenceRedirect(r)?i.getProjectReferenceRedirect(r):void 0,_=e.toPath(r,l,c),d=i.redirectTargetsMap.get(_)||e.emptyArray,p=n$3(n$3(n$3([],u?[u]:e.emptyArray,!0),[r],!1),d,!0).map((function(t){return e.getNormalizedAbsolutePath(t,l)})),f=!e.every(p,e.containsIgnoredPath);if(!a){var g=e.forEach(p,(function(t){return !(f&&e.containsIgnoredPath(t))&&o(t,u===t)}));if(g)return g}var m=null===(s=i.getSymlinkCache)||void 0===s?void 0:s.call(i).getSymlinkedDirectoriesByRealpath(),y=e.getNormalizedAbsolutePath(r,l);return m&&e.forEachAncestorDirectory(e.getDirectoryPath(y),(function(r){var n=m.get(e.ensureTrailingDirectorySeparator(e.toPath(r,l,c)));if(n)return !e.startsWithDirectory(t,r,c)&&e.forEach(p,(function(t){if(e.startsWithDirectory(t,r,c))for(var i=e.getRelativePathFromDirectory(r,t,c),a=0,s=n;a<s.length;a++){var l=s[a],_=e.resolvePath(l,i),d=o(_,t===u);if(f=!0,d)return d}}))}))||(a?e.forEach(p,(function(t){return f&&e.containsIgnoredPath(t)?void 0:o(t,t===u)})):void 0)}function v(t,r,n,i,a){var o;void 0===a&&(a=e.toPath(r,n.getCurrentDirectory(),e.hostGetCanonicalFileName(n)));var s=null===(o=n.getModuleSpecifierCache)||void 0===o?void 0:o.call(n);if(s){var c=s.get(t,a,i);if(null==c?void 0:c.modulePaths)return c.modulePaths}var l=h(t,r,n);return s&&s.setModulePaths(t,a,i,l),l}function h(t,r,n){var i=e.hostGetCanonicalFileName(n),a=new e.Map,o=!1;y(t,r,n,!0,(function(t,r){var n=e.pathContainsNodeModules(t);a.set(t,{path:i(t),isRedirect:r,isInNodeModules:n}),o=o||n;}));for(var s,c=[],l=function(t){var r,n=e.ensureTrailingDirectorySeparator(t);a.forEach((function(t,i){var o=t.path,s=t.isRedirect,c=t.isInNodeModules;e.startsWith(o,n)&&((r||(r=[])).push({path:i,isRedirect:s,isInNodeModules:c}),a.delete(i));})),r&&(r.length>1&&r.sort(g),c.push.apply(c,r));var i=e.getDirectoryPath(t);if(i===t)return s=t,"break";s=t=i;},u=e.getDirectoryPath(t);0!==a.size;){var _=l(u);if(u=s,"break"===_)break}if(a.size){var d=e.arrayFrom(a.values());d.length>1&&d.sort(g),c.push.apply(c,d);}return c}function b(t,r,n){for(var i in n)for(var a=0,o=n[i];a<o.length;a++){var s=o[a],c=e.removeFileExtension(e.normalizePath(s)),l=c.indexOf("*");if(-1!==l){var u=c.substr(0,l),_=c.substr(l+1);if(r.length>=u.length+_.length&&e.startsWith(r,u)&&e.endsWith(r,_)||!_&&r===e.removeTrailingDirectorySeparator(u)){var d=r.substr(u.length,r.length-_.length-u.length);return i.replace("*",d)}}else if(c===r||c===t)return i}}function x(t,r,n,i,a,o,s){if(void 0===s&&(s=0),"string"==typeof a){var c=e.getNormalizedAbsolutePath(e.combinePaths(n,a),void 0),l=e.hasTSFileExtension(r)?e.removeFileExtension(r)+E(r,t):void 0;switch(s){case 0:if(0===e.comparePaths(r,c)||l&&0===e.comparePaths(l,c))return {moduleFileToTry:i};break;case 1:if(e.containsPath(c,r)){var u=e.getRelativePathFromDirectory(c,r,!1);return {moduleFileToTry:e.getNormalizedAbsolutePath(e.combinePaths(e.combinePaths(i,a),u),void 0)}}break;case 2:var _=c.indexOf("*"),d=c.slice(0,_),p=c.slice(_+1);if(e.startsWith(r,d)&&e.endsWith(r,p)){var f=r.slice(d.length,r.length-p.length);return {moduleFileToTry:i.replace("*",f)}}if(l&&e.startsWith(l,d)&&e.endsWith(l,p))return f=l.slice(d.length,l.length-p.length),{moduleFileToTry:i.replace("*",f)}}}else {if(Array.isArray(a))return e.forEach(a,(function(e){return x(t,r,n,i,e,o)}));if("object"==typeof a&&null!==a){if(e.allKeysStartWithDot(a))return e.forEach(e.getOwnKeys(a),(function(s){var c=e.getNormalizedAbsolutePath(e.combinePaths(i,s),void 0),l=e.endsWith(s,"/")?1:e.stringContains(s,"*")?2:0;return x(t,r,n,c,a[s],o,l)}));for(var g=0,m=e.getOwnKeys(a);g<m.length;g++){var y=m[g];if("default"===y||o.indexOf(y)>=0||e.isApplicableVersionedTypesKey(o,y)){var v=a[y],h=x(t,r,n,i,v,o);if(h)return h}}}}}function D(t,r,n,a,o){var s=t.path,c=t.isRedirect,l=r.getCanonicalFileName,u=r.sourceDirectory;if(n.fileExists&&n.readFile){var _=function(t){var r,n=0,i=0,a=0;!function(e){e[e.BeforeNodeModules=0]="BeforeNodeModules",e[e.NodeModules=1]="NodeModules",e[e.Scope=2]="Scope",e[e.PackageContent=3]="PackageContent";}(r||(r={}));for(var o=0,s=0,c=0;s>=0;)switch(o=s,s=t.indexOf("/",o+1),c){case 0:t.indexOf(e.nodeModulesPathPart,o)===o&&(n=o,i=s,c=1);break;case 1:case 2:1===c&&"@"===t.charAt(o+1)?c=2:(a=s,c=3);break;case 3:c=t.indexOf(e.nodeModulesPathPart,o)===o?1:3;}return c>1?{topLevelNodeModulesIndex:n,topLevelPackageNameIndex:i,packageRootIndex:a,fileNameIndex:o}:void 0}(s);if(_){var d=s,p=!1;if(!o)for(var f=_.packageRootIndex,g=void 0;;){var m=F(f),y=m.moduleFileToTry,v=m.packageRootPath,h=m.blockedByExports,D=m.verbatimFromExports;if(e.getEmitModuleResolutionKind(a)!==e.ModuleResolutionKind.Classic){if(h)return;if(D)return y}if(v){d=v,p=!0;break}if(g||(g=y),-1===(f=s.indexOf(e.directorySeparator,f+1))){d=A(g);break}}if(!c||p){var S=n.getGlobalTypingsCacheLocation&&n.getGlobalTypingsCacheLocation(),C=l(d.substring(0,_.topLevelNodeModulesIndex));if(e.startsWith(u,C)||S&&e.startsWith(l(S),C)){var k=d.substring(_.topLevelPackageNameIndex+1),N=e.getPackageNameFromTypesPackageName(k);return e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Classic&&N===k?void 0:N}}}}function F(t){var r=s.substring(0,t),o=e.combinePaths(r,"package.json"),c=s;if(n.fileExists(o)){var u=JSON.parse(n.readFile(o));if(e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.Node12||e.getEmitModuleResolutionKind(a)===e.ModuleResolutionKind.NodeNext){var _=u.exports&&"string"==typeof u.name?x(a,s,r,u.name,u.exports,["node","types"]):void 0;if(_){var d=e.hasTSFileExtension(_.moduleFileToTry)?{moduleFileToTry:e.removeFileExtension(_.moduleFileToTry)+E(_.moduleFileToTry,a)}:_;return i$1(i$1({},d),{verbatimFromExports:!0})}if(u.exports)return {moduleFileToTry:s,blockedByExports:!0}}var p=u.typesVersions?e.getPackageJsonTypesVersionsPaths(u.typesVersions):void 0;if(p){var f=s.slice(r.length+1),g=b(e.removeFileExtension(f),T(f,0,a),p.paths);void 0!==g&&(c=e.combinePaths(r,g));}var m=u.typings||u.types||u.main;if(e.isString(m)){var y=e.toPath(m,r,l);if(e.removeFileExtension(y)===e.removeFileExtension(l(c)))return {packageRootPath:r,moduleFileToTry:c}}}return {moduleFileToTry:c}}function A(t){var r=e.removeFileExtension(t);return "/index"!==l(r.substring(_.fileNameIndex))||function(t,r){if(t.fileExists)for(var n=0,i=e.flatten(e.getSupportedExtensions({allowJs:!0},[{extension:"node",isMixedContent:!1},{extension:"json",isMixedContent:!1,scriptKind:6}]));n<i.length;n++){var a=r+i[n];if(t.fileExists(a))return a}}(n,r.substring(0,_.fileNameIndex))?r:r.substring(0,_.fileNameIndex)}}function S(t,r,n){return e.firstDefined(r,(function(e){var r=k(t,e,n);return N(r)?void 0:r}))}function T(t,r,n){if(e.fileExtensionIsOneOf(t,[".json",".mjs",".cjs"]))return t;var i=e.removeFileExtension(t);if(e.fileExtensionIsOneOf(t,[".d.mts",".mts",".d.cts",".cts"]))return i+C(t,n);switch(r){case 0:return e.removeSuffix(i,"/index");case 1:return i;case 2:return i+C(t,n);default:return e.Debug.assertNever(r)}}function C(t,r){var n;return null!==(n=E(t,r))&&void 0!==n?n:e.Debug.fail("Extension ".concat(e.extensionFromPath(t)," is unsupported:: FileName:: ").concat(t))}function E(t,r){var n=e.tryGetExtensionFromPath(t);switch(n){case".ts":case".d.ts":return ".js";case".tsx":return 1===r.jsx?".jsx":".js";case".js":case".jsx":case".json":return n;case".d.mts":case".mts":case".mjs":return ".mjs";case".d.cts":case".cts":case".cjs":return ".cjs";default:return}}function k(t,r,n){var i=e.getRelativePathToDirectoryOrUrl(r,t,r,n,!1);return e.isRootedDiskPath(i)?void 0:i}function N(t){return e.startsWith(t,"..")}!function(e){e[e.Relative=0]="Relative",e[e.NonRelative=1]="NonRelative",e[e.Shortest=2]="Shortest",e[e.ExternalNonRelative=3]="ExternalNonRelative";}(r||(r={})),function(e){e[e.Minimal=0]="Minimal",e[e.Index=1]="Index",e[e.JsExtension=2]="JsExtension";}(a||(a={})),t.updateModuleSpecifier=function(t,r,n,i,a){var o=l(t,r,n,i,function(t,r,n,i){return {relativePreference:e.isExternalModuleNameRelative(r)?0:1,ending:e.hasJSFileExtension(r)||c(t,n,i)?2:e.getEmitModuleResolutionKind(t)!==e.ModuleResolutionKind.NodeJs||e.endsWith(r,"index")?1:0}}(t,a,r,i),{});if(o!==a)return o},t.getModuleSpecifier=function(e,t,r,n,i){return l(e,r,n,i,s(i,{},e,t),{})},t.getNodeModulesPackageName=function(t,r,n,i,a){var o=d(r,i),s=v(r,n,i,a);return e.firstDefined(s,(function(e){return D(e,o,i,t,!0)}))},t.tryGetModuleSpecifiersFromCache=function(e,t,r,n){return u(e,t,r,n)[0]},t.getModuleSpecifiers=function(e,t,r,n,i,a){return _(e,t,r,n,i,a).moduleSpecifiers},t.getModuleSpecifiersWithCacheInfo=_,t.countPathComponents=f,t.forEachFileNameOfModule=y,function(e){e[e.Exact=0]="Exact",e[e.Directory=1]="Directory",e[e.Pattern=2]="Pattern";}(o||(o={})),t.tryGetJSExtensionForFile=E;}(e.moduleSpecifiers||(e.moduleSpecifiers={}));}(t),function(e){var t=e.sys?{getCurrentDirectory:function(){return e.sys.getCurrentDirectory()},getNewLine:function(){return e.sys.newLine},getCanonicalFileName:e.createGetCanonicalFileName(e.sys.useCaseSensitiveFileNames)}:void 0;function r(r,n){var i=r===e.sys&&t?t:{getCurrentDirectory:function(){return r.getCurrentDirectory()},getNewLine:function(){return r.newLine},getCanonicalFileName:e.createGetCanonicalFileName(r.useCaseSensitiveFileNames)};if(!n)return function(t){return r.write(e.formatDiagnostic(t,i))};var a=new Array(1);return function(t){a[0]=t,r.write(e.formatDiagnosticsWithColorAndContext(a,i)+i.getNewLine()),a[0]=void 0;}}function i(t,r,n){return !(!t.clearScreen||n.preserveWatchOutput||n.extendedDiagnostics||n.diagnostics||!e.contains(e.screenStartingMessageCodes,r.code)||(t.clearScreen(),0))}function a(e){return e.now?e.now().toLocaleTimeString("en-US",{timeZone:"UTC"}):(new Date).toLocaleTimeString()}function o(t,r){return r?function(r,n,o){i(t,r,o);var s="[".concat(e.formatColorAndReset(a(t),e.ForegroundColorEscapeSequences.Grey),"] ");s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(n+n),t.write(s);}:function(r,n,o){var s="";i(t,r,o)||(s+=n),s+="".concat(a(t)," - "),s+="".concat(e.flattenDiagnosticMessageText(r.messageText,t.newLine)).concat(function(t,r){return e.contains(e.screenStartingMessageCodes,t.code)?r+r:r}(r,n)),t.write(s);}}function s(t){return e.countWhere(t,(function(t){return t.category===e.DiagnosticCategory.Error}))}function c(t){return 1===t?e.Diagnostics.Found_1_error_Watching_for_file_changes:e.Diagnostics.Found_0_errors_Watching_for_file_changes}function l(t,r){if(0===t)return "";var n=e.createCompilerDiagnostic(1===t?e.Diagnostics.Found_1_error:e.Diagnostics.Found_0_errors,t);return "".concat(r).concat(e.flattenDiagnosticMessageText(n.messageText,r)).concat(r).concat(r)}function u(e){return !!e.getState}function _(t,r){var n=t.getCompilerOptions();n.explainFiles?d(u(t)?t.getProgram():t,r):(n.listFiles||n.listFilesOnly)&&e.forEach(t.getSourceFiles(),(function(e){r(e.fileName);}));}function d(t,r){for(var n,i,a=t.getFileIncludeReasons(),o=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),s=function(r){return e.convertToRelativePath(r,t.getCurrentDirectory(),o)},c=0,l=t.getSourceFiles();c<l.length;c++){var u=l[c];r("".concat(y(u,s))),null===(n=a.get(u.path))||void 0===n||n.forEach((function(e){return r(" ".concat(m(t,e,s).messageText))})),null===(i=p(u,s))||void 0===i||i.forEach((function(e){return r(" ".concat(e.messageText))}));}}function p(t,r){var n;return t.path!==t.resolvedPath&&(n||(n=[])).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_is_output_of_project_reference_source_0,y(t.originalFileName,r))),t.redirectInfo&&(n||(n=[])).push(e.chainDiagnosticMessages(void 0,e.Diagnostics.File_redirects_to_file_0,y(t.redirectInfo.redirectTarget,r))),n}function f(t,r){var n,i=t.getCompilerOptions().configFile;if(null===(n=null==i?void 0:i.configFileSpecs)||void 0===n?void 0:n.validatedFilesSpec){var a=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),o=a(r),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(i.fileName,t.getCurrentDirectory()));return e.find(i.configFileSpecs.validatedFilesSpec,(function(t){return a(e.getNormalizedAbsolutePath(t,s))===o}))}}function g(t,r){var n,i,a=t.getCompilerOptions().configFile;if(null===(n=null==a?void 0:a.configFileSpecs)||void 0===n?void 0:n.validatedIncludeSpecs){var o=e.fileExtensionIs(r,".json"),s=e.getDirectoryPath(e.getNormalizedAbsolutePath(a.fileName,t.getCurrentDirectory())),c=t.useCaseSensitiveFileNames();return e.find(null===(i=null==a?void 0:a.configFileSpecs)||void 0===i?void 0:i.validatedIncludeSpecs,(function(t){if(o&&!e.endsWith(t,".json"))return !1;var n=e.getPatternFromSpec(t,s,"files");return !!n&&e.getRegexFromPattern("(".concat(n,")$"),c).test(r)}))}}function m(t,r,n){var i,a,o=t.getCompilerOptions();if(e.isReferencedFile(r)){var s=e.getReferencedFileLocation((function(e){return t.getSourceFileByPath(e)}),r),c=e.isReferenceFileLocation(s)?s.file.text.substring(s.pos,s.end):'"'.concat(s.text,'"'),l=void 0;switch(e.Debug.assert(e.isReferenceFileLocation(s)||r.kind===e.FileIncludeKind.Import,"Only synthetic references are imports"),r.kind){case e.FileIncludeKind.Import:l=e.isReferenceFileLocation(s)?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2:e.Diagnostics.Imported_via_0_from_file_1:s.text===e.externalHelpersModuleNameText?s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions:e.Diagnostics.Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions:s.packageId?e.Diagnostics.Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions:e.Diagnostics.Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions;break;case e.FileIncludeKind.ReferenceFile:e.Debug.assert(!s.packageId),l=e.Diagnostics.Referenced_via_0_from_file_1;break;case e.FileIncludeKind.TypeReferenceDirective:l=s.packageId?e.Diagnostics.Type_library_referenced_via_0_from_file_1_with_packageId_2:e.Diagnostics.Type_library_referenced_via_0_from_file_1;break;case e.FileIncludeKind.LibReferenceDirective:e.Debug.assert(!s.packageId),l=e.Diagnostics.Library_referenced_via_0_from_file_1;break;default:e.Debug.assertNever(r);}return e.chainDiagnosticMessages(void 0,l,c,y(s.file,n),s.packageId&&e.packageIdToString(s.packageId))}switch(r.kind){case e.FileIncludeKind.RootFile:if(!(null===(i=o.configFile)||void 0===i?void 0:i.configFileSpecs))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Root_file_specified_for_compilation);var u=e.getNormalizedAbsolutePath(t.getRootFileNames()[r.index],t.getCurrentDirectory());if(f(t,u))return e.chainDiagnosticMessages(void 0,e.Diagnostics.Part_of_files_list_in_tsconfig_json);var _=g(t,u);return _?e.chainDiagnosticMessages(void 0,e.Diagnostics.Matched_by_include_pattern_0_in_1,_,y(o.configFile,n)):e.chainDiagnosticMessages(void 0,e.Diagnostics.Root_file_specified_for_compilation);case e.FileIncludeKind.SourceFromProjectReference:case e.FileIncludeKind.OutputFromProjectReference:var d=r.kind===e.FileIncludeKind.OutputFromProjectReference,p=e.Debug.checkDefined(null===(a=t.getResolvedProjectReferences())||void 0===a?void 0:a[r.index]);return e.chainDiagnosticMessages(void 0,e.outFile(o)?d?e.Diagnostics.Output_from_referenced_project_0_included_because_1_specified:e.Diagnostics.Source_from_referenced_project_0_included_because_1_specified:d?e.Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none:e.Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none,y(p.sourceFile.fileName,n),o.outFile?"--outFile":"--out");case e.FileIncludeKind.AutomaticTypeDirectiveFile:return e.chainDiagnosticMessages(void 0,o.types?r.packageId?e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1:e.Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions:r.packageId?e.Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1:e.Diagnostics.Entry_point_for_implicit_type_library_0,r.typeReference,r.packageId&&e.packageIdToString(r.packageId));case e.FileIncludeKind.LibFile:if(void 0!==r.index)return e.chainDiagnosticMessages(void 0,e.Diagnostics.Library_0_specified_in_compilerOptions,o.lib[r.index]);var m=e.forEachEntry(e.targetOptionDeclaration.type,(function(t,r){return t===e.getEmitScriptTarget(o)?r:void 0}));return e.chainDiagnosticMessages(void 0,m?e.Diagnostics.Default_library_for_target_0:e.Diagnostics.Default_library,m);default:e.Debug.assertNever(r);}}function y(t,r){var n=e.isString(t)?t:t.fileName;return r?r(n):n}function v(t,r,n,i,a,o,c,l){var u=!!t.getCompilerOptions().listFilesOnly,d=t.getConfigFileParsingDiagnostics().slice(),p=d.length;e.addRange(d,t.getSyntacticDiagnostics(void 0,o)),d.length===p&&(e.addRange(d,t.getOptionsDiagnostics(o)),u||(e.addRange(d,t.getGlobalDiagnostics(o)),d.length===p&&e.addRange(d,t.getSemanticDiagnostics(void 0,o))));var f=u?{emitSkipped:!0,diagnostics:e.emptyArray}:t.emit(void 0,a,o,c,l),g=f.emittedFiles,m=f.diagnostics;e.addRange(d,m);var y=e.sortAndDeduplicateDiagnostics(d);if(y.forEach(r),n){var v=t.getCurrentDirectory();e.forEach(g,(function(t){var r=e.getNormalizedAbsolutePath(t,v);n("TSFILE: ".concat(r));})),_(t,n);}return i&&i(s(y)),{emitResult:f,diagnostics:y}}function h(t,r,n,i,a,o,s,c){var l=v(t,r,n,i,a,o,s,c),u=l.emitResult,_=l.diagnostics;return u.emitSkipped&&_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:_.length>0?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.Success}function b(t,r){return void 0===t&&(t=e.sys),{onWatchStatusChange:r||o(t),watchFile:e.maybeBind(t,t.watchFile)||e.returnNoopFileWatcher,watchDirectory:e.maybeBind(t,t.watchDirectory)||e.returnNoopFileWatcher,setTimeout:e.maybeBind(t,t.setTimeout)||e.noop,clearTimeout:e.maybeBind(t,t.clearTimeout)||e.noop}}function x(t,r){var n=e.memoize((function(){return e.getDirectoryPath(e.normalizePath(t.getExecutingFilePath()))}));return {useCaseSensitiveFileNames:function(){return t.useCaseSensitiveFileNames},getNewLine:function(){return t.newLine},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),getDefaultLibLocation:n,getDefaultLibFileName:function(t){return e.combinePaths(n(),e.getDefaultLibFileName(t))},fileExists:function(e){return t.fileExists(e)},readFile:function(e,r){return t.readFile(e,r)},directoryExists:function(e){return t.directoryExists(e)},getDirectories:function(e){return t.getDirectories(e)},readDirectory:function(e,r,n,i,a){return t.readDirectory(e,r,n,i,a)},realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable),trace:function(e){return t.write(e+t.newLine)},createDirectory:function(e){return t.createDirectory(e)},writeFile:function(e,r,n){return t.writeFile(e,r,n)},createHash:e.maybeBind(t,t.createHash),createProgram:r||e.createEmitAndSemanticDiagnosticsBuilderProgram,disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature}}function D(t,r,n,i){void 0===t&&(t=e.sys);var a=function(e){return t.write(e+t.newLine)},o=x(t,r);return e.copyProperties(o,b(t,i)),o.afterProgramCreate=function(r){var i=r.getCompilerOptions(),s=e.getNewLineCharacter(i,(function(){return t.newLine}));v(r,n,a,(function(t){return o.onWatchStatusChange(e.createCompilerDiagnostic(c(t),t),s,i,t)}));},o}function S(t,r,n){r(n),t.exit(e.ExitStatus.DiagnosticsPresent_OutputsSkipped);}e.createDiagnosticReporter=r,e.screenStartingMessageCodes=[e.Diagnostics.Starting_compilation_in_watch_mode.code,e.Diagnostics.File_change_detected_Starting_incremental_compilation.code],e.getLocaleTimeString=a,e.createWatchStatusReporter=o,e.parseConfigFileWithSystem=function(t,r,n,i,a,o){var s=a;s.onUnRecoverableConfigFileDiagnostic=function(e){return S(a,o,e)};var c=e.getParsedCommandLineOfConfigFile(t,r,s,n,i);return s.onUnRecoverableConfigFileDiagnostic=void 0,c},e.getErrorCountForSummary=s,e.getWatchErrorSummaryDiagnosticMessage=c,e.getErrorSummaryText=l,e.isBuilderProgram=u,e.listFiles=_,e.explainFiles=d,e.explainIfFileIsRedirect=p,e.getMatchedFileSpec=f,e.getMatchedIncludeSpec=g,e.fileIncludeReasonToDiagnostics=m,e.emitFilesAndReportErrors=v,e.emitFilesAndReportErrorsAndGetExitStatus=h,e.noopFileWatcher={close:e.noop},e.returnNoopFileWatcher=function(){return e.noopFileWatcher},e.createWatchHost=b,e.WatchType={ConfigFile:"Config file",ExtendedConfigFile:"Extended config file",SourceFile:"Source file",MissingFile:"Missing file",WildcardDirectory:"Wild card directory",FailedLookupLocations:"Failed Lookup Locations",TypeRoots:"Type roots",ConfigFileOfReferencedProject:"Config file of referened project",ExtendedConfigOfReferencedProject:"Extended config file of referenced project",WildcardDirectoryOfReferencedProject:"Wild card directory of referenced project",PackageJson:"package.json file"},e.createWatchFactory=function(t,r){var n=t.trace?r.extendedDiagnostics?e.WatchLogLevel.Verbose:r.diagnostics?e.WatchLogLevel.TriggerOnly:e.WatchLogLevel.None:e.WatchLogLevel.None,i=n!==e.WatchLogLevel.None?function(e){return t.trace(e)}:e.noop,a=e.getWatchFactory(t,n,i);return a.writeLog=i,a},e.createCompilerHostFromProgramHost=function(t,r,n){void 0===n&&(n=t);var i=t.useCaseSensitiveFileNames(),a=e.memoize((function(){return t.getNewLine()}));return {getSourceFile:function(n,i,a){var o;try{e.performance.mark("beforeIORead"),o=t.readFile(n,r().charset),e.performance.mark("afterIORead"),e.performance.measure("I/O Read","beforeIORead","afterIORead");}catch(e){a&&a(e.message),o="";}return void 0!==o?e.createSourceFile(n,o,i):void 0},getDefaultLibLocation:e.maybeBind(t,t.getDefaultLibLocation),getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:function(r,n,i,a){try{e.performance.mark("beforeIOWrite"),e.writeFileEnsuringDirectories(r,n,i,(function(e,r,n){return t.writeFile(e,r,n)}),(function(e){return t.createDirectory(e)}),(function(e){return t.directoryExists(e)})),e.performance.mark("afterIOWrite"),e.performance.measure("I/O Write","beforeIOWrite","afterIOWrite");}catch(e){a&&a(e.message);}},getCurrentDirectory:e.memoize((function(){return t.getCurrentDirectory()})),useCaseSensitiveFileNames:function(){return i},getCanonicalFileName:e.createGetCanonicalFileName(i),getNewLine:function(){return e.getNewLineCharacter(r(),a)},fileExists:function(e){return t.fileExists(e)},readFile:function(e){return t.readFile(e)},trace:e.maybeBind(t,t.trace),directoryExists:e.maybeBind(n,n.directoryExists),getDirectories:e.maybeBind(n,n.getDirectories),realpath:e.maybeBind(t,t.realpath),getEnvironmentVariable:e.maybeBind(t,t.getEnvironmentVariable)||function(){return ""},createHash:e.maybeBind(t,t.createHash),readDirectory:e.maybeBind(t,t.readDirectory),disableUseFileVersionAsSignature:t.disableUseFileVersionAsSignature}},e.setGetSourceFileAsHashVersioned=function(t,r){var i=t.getSourceFile,a=e.maybeBind(r,r.createHash)||e.generateDjb2Hash;t.getSourceFile=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var o=i.call.apply(i,n$3([t],e,!1));return o&&(o.version=a(o.text)),o};},e.createProgramHost=x,e.createWatchCompilerHostOfConfigFile=function(e){var t=e.configFileName,n=e.optionsToExtend,i=e.watchOptionsToExtend,a=e.extraFileExtensions,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=c||r(o),_=D(o,s,u,l);return _.onUnRecoverableConfigFileDiagnostic=function(e){return S(o,u,e)},_.configFileName=t,_.optionsToExtend=n,_.watchOptionsToExtend=i,_.extraFileExtensions=a,_},e.createWatchCompilerHostOfFilesAndCompilerOptions=function(e){var t=e.rootFiles,n=e.options,i=e.watchOptions,a=e.projectReferences,o=e.system,s=e.createProgram,c=e.reportDiagnostic,l=e.reportWatchStatus,u=D(o,s,c||r(o),l);return u.rootFiles=t,u.options=n,u.watchOptions=i,u.projectReferences=a,u},e.performIncrementalCompilation=function(t){var n=t.system||e.sys,i=t.host||(t.host=e.createIncrementalCompilerHost(t.options,n)),a=e.createIncrementalProgram(t),o=h(a,t.reportDiagnostic||r(n),(function(e){return i.trace&&i.trace(e)}),t.reportErrorSummary||t.options.pretty?function(e){return n.write(l(e,n.newLine))}:void 0);return t.afterProgramEmitAndDiagnostics&&t.afterProgramEmitAndDiagnostics(a),o};}(t),function(e){function t(t,r){if(!e.outFile(t)){var n=e.getTsBuildInfoEmitOutputFilePath(t);if(n){var i=r.readFile(n);if(i){var a=e.getBuildInfo(i);if(a.version===e.version&&a.program)return e.createBuildProgramUsingProgramBuildInfo(a.program,n,r)}}}}function r(t,r){void 0===r&&(r=e.sys);var n=e.createCompilerHostWorker(t,void 0,r);return n.createHash=e.maybeBind(r,r.createHash),n.disableUseFileVersionAsSignature=r.disableUseFileVersionAsSignature,e.setGetSourceFileAsHashVersioned(n,r),e.changeCompilerHostLikeToUseCache(n,(function(t){return e.toPath(t,n.getCurrentDirectory(),n.getCanonicalFileName)})),n}e.readBuilderProgram=t,e.createIncrementalCompilerHost=r,e.createIncrementalProgram=function(n){var i=n.rootNames,a=n.options,o=n.configFileParsingDiagnostics,s=n.projectReferences,c=n.host,l=n.createProgram;return c=c||r(a),(l=l||e.createEmitAndSemanticDiagnosticsBuilderProgram)(i,a,c,t(a,c),o,s)},e.createWatchCompilerHost=function(t,r,n,i,a,o,s,c){return e.isArray(t)?e.createWatchCompilerHostOfFilesAndCompilerOptions({rootFiles:t,options:r,watchOptions:c,projectReferences:s,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o}):e.createWatchCompilerHostOfConfigFile({configFileName:t,optionsToExtend:r,watchOptionsToExtend:s,extraFileExtensions:c,system:n,createProgram:i,reportDiagnostic:a,reportWatchStatus:o})},e.createWatchProgram=function(r){var a,o,s,c,l,u,_,d,p,f,g,m,y=r.extendedConfigCache,v=!1,h=new e.Map,b=!1,x=r.useCaseSensitiveFileNames(),D=r.getCurrentDirectory(),S=r.configFileName,T=r.optionsToExtend,C=void 0===T?{}:T,E=r.watchOptionsToExtend,k=r.extraFileExtensions,N=r.createProgram,F=r.rootFiles,A=r.options,P=r.watchOptions,w=r.projectReferences,I=!1,O=!1,M=void 0===S?void 0:e.createCachedDirectoryStructureHost(r,D,x),L=M||r,R=e.parseConfigHostFromCompilerHostLike(r,L),B=$();S&&r.configFileParsingResult&&(fe(r.configFileParsingResult),B=$()),oe(e.Diagnostics.Starting_compilation_in_watch_mode),S&&!r.configFileParsingResult&&(B=e.getNewLineCharacter(C,(function(){return r.getNewLine()})),e.Debug.assert(!F),pe(),B=$());var j,J=e.createWatchFactory(r,A),z=J.watchFile,U=J.watchDirectory,K=J.writeLog,V=e.createGetCanonicalFileName(x);K("Current directory: ".concat(D," CaseSensitiveFileNames: ").concat(x)),S&&(j=z(S,(function(){e.Debug.assert(!!S),o=e.ConfigFileProgramReloadLevel.Full,ue();}),e.PollingInterval.High,P,e.WatchType.ConfigFile));var q=e.createCompilerHostFromProgramHost(r,(function(){return A}),L);e.setGetSourceFileAsHashVersioned(q,r);var W=q.getSourceFile;q.getSourceFile=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ne.apply(void 0,n$3([e,ee(e)],t,!1))},q.getSourceFileByPath=ne,q.getNewLine=function(){return B},q.fileExists=re,q.onReleaseOldSourceFile=function(e,t,r){var n=h.get(e.resolvedPath);void 0!==n&&(te(n)?(f||(f=[])).push(e.path):n.sourceFile===e&&(n.fileWatcher&&n.fileWatcher.close(),h.delete(e.resolvedPath),r||H.removeResolutionsOfFile(e.path)));},q.onReleaseParsedCommandLine=function(t){var r,n=ee(t),i=null==d?void 0:d.get(n);i&&(d.delete(n),i.watchedDirectories&&e.clearMap(i.watchedDirectories,e.closeFileWatcherOf),null===(r=i.watcher)||void 0===r||r.close(),e.clearSharedExtendedConfigFileWatcher(n,p));},q.toPath=ee,q.getCompilationSettings=function(){return A},q.useSourceOfProjectReferenceRedirect=e.maybeBind(r,r.useSourceOfProjectReferenceRedirect),q.watchDirectoryOfFailedLookupLocation=function(t,r,n){return U(t,r,n,P,e.WatchType.FailedLookupLocations)},q.watchTypeRootsDirectory=function(t,r,n){return U(t,r,n,P,e.WatchType.TypeRoots)},q.getCachedDirectoryStructureHost=function(){return M},q.scheduleInvalidateResolutionsOfFailedLookupLocations=function(){if(!r.setTimeout||!r.clearTimeout)return H.invalidateResolutionsOfFailedLookupLocations();var e=ce();K("Scheduling invalidateFailedLookup".concat(e?", Cancelled earlier one":"")),_=r.setTimeout(le,250);},q.onInvalidatedResolution=ue,q.onChangedAutomaticTypeDirectiveNames=ue,q.fileIsOpen=e.returnFalse,q.getCurrentProgram=Y,q.writeLog=K,q.getParsedCommandLine=ge;var H=e.createResolutionCache(q,S?e.getDirectoryPath(e.getNormalizedAbsolutePath(S,D)):D,!1);q.resolveModuleNames=r.resolveModuleNames?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveModuleNames.apply(r,e)}:function(e,t,r,n,i,a){return H.resolveModuleNames(e,t,r,n,a)},q.resolveTypeReferenceDirectives=r.resolveTypeReferenceDirectives?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.resolveTypeReferenceDirectives.apply(r,e)}:function(e,t,r){return H.resolveTypeReferenceDirectives(e,t,r)};var G=!!r.resolveModuleNames||!!r.resolveTypeReferenceDirectives;return a=t(A,q),Z(),Se(),S&&Ce(ee(S),A,P,e.WatchType.ExtendedConfigFile),S?{getCurrentProgram:X,getProgram:de,close:Q}:{getCurrentProgram:X,getProgram:de,updateRootFileNames:function(t){e.Debug.assert(!S,"Cannot update root file names with config file watch mode"),F=t,ue();},close:Q};function Q(){ce(),H.clear(),e.clearMap(h,(function(e){e&&e.fileWatcher&&(e.fileWatcher.close(),e.fileWatcher=void 0);})),j&&(j.close(),j=void 0),null==y||y.clear(),y=void 0,p&&(e.clearMap(p,e.closeFileWatcherOf),p=void 0),l&&(e.clearMap(l,e.closeFileWatcherOf),l=void 0),s&&(e.clearMap(s,e.closeFileWatcher),s=void 0),d&&(e.clearMap(d,(function(t){var r;null===(r=t.watcher)||void 0===r||r.close(),t.watcher=void 0,t.watchedDirectories&&e.clearMap(t.watchedDirectories,e.closeFileWatcherOf),t.watchedDirectories=void 0;})),d=void 0),c&&(e.clearMap(c,e.closeFileWatcher),c=void 0);}function X(){return a}function Y(){return a&&a.getProgramOrUndefined()}function Z(){K("Synchronizing program"),ce();var t=X();b&&(B=$(),t&&(v||e.changesAffectModuleResolution(t.getCompilerOptions(),A))&&H.clear());var n=H.createHasInvalidatedResolution(G||v);return e.isProgramUptoDate(Y(),F,A,ae,re,n,se,ge,w)?O&&(a=N(void 0,void 0,q,a,m,w),O=!1):function(t){K("CreatingProgramWith::"),K(" roots: ".concat(JSON.stringify(F))),K(" options: ".concat(JSON.stringify(A))),w&&K(" projectReferences: ".concat(JSON.stringify(w)));var r=b||!Y();b=!1,O=!1,H.startCachingPerDirectoryResolution(),q.hasInvalidatedResolution=t,q.hasChangedAutomaticTypeDirectiveNames=se,a=N(F,A,q,a,m,w);var n=e.map(H.getModuleResolutionCache().getPackageJsonInfoCache().entries(),(function(e){var t=e[0],r=e[1];return [q.realpath?ee(q.realpath(t)):t,r]}));if(H.finishCachingPerDirectoryResolution(),e.updateMissingFilePathsWatch(a.getProgram(),s||(s=new e.Map),he),e.updatePackageJsonWatch(n,c||(c=new e.Map),be),r&&H.updateTypeRootsWatch(),f){for(var i=0,o=f;i<o.length;i++){var l=o[i];s.has(l)||h.delete(l);}f=void 0;}}(n),v=!1,r.afterProgramCreate&&t!==a&&r.afterProgramCreate(a),a}function $(){return e.getNewLineCharacter(A||C,(function(){return r.getNewLine()}))}function ee(t){return e.toPath(t,D,V)}function te(e){return "boolean"==typeof e}function re(e){var t=ee(e);return !te(h.get(t))&&L.fileExists(e)}function ne(t,r,n,i,a){var o=h.get(r);if(!te(o)){if(void 0===o||a||function(e){return "boolean"==typeof e.version}(o)){var s=W(t,n,i);if(o)s?(o.sourceFile=s,o.version=s.version,o.fileWatcher||(o.fileWatcher=me(r,t,ye,e.PollingInterval.Low,P,e.WatchType.SourceFile))):(o.fileWatcher&&o.fileWatcher.close(),h.set(r,!1));else if(s){var c=me(r,t,ye,e.PollingInterval.Low,P,e.WatchType.SourceFile);h.set(r,{sourceFile:s,version:s.version,fileWatcher:c});}else h.set(r,!1);return s&&(s.impliedNodeFormat=e.getImpliedNodeFormatForFile(r,H.getModuleResolutionCache().getPackageJsonInfoCache(),q,q.getCompilationSettings())),s}return o.sourceFile}}function ie(e){var t=h.get(e);void 0!==t&&(te(t)?h.set(e,{version:!1}):t.version=!1);}function ae(e){var t=h.get(e);return t&&t.version?t.version:void 0}function oe(t){r.onWatchStatusChange&&r.onWatchStatusChange(e.createCompilerDiagnostic(t),B,A||C);}function se(){return H.hasChangedAutomaticTypeDirectiveNames()}function ce(){return !!_&&(r.clearTimeout(_),_=void 0,!0)}function le(){_=void 0,H.invalidateResolutionsOfFailedLookupLocations()&&ue();}function ue(){r.setTimeout&&r.clearTimeout&&(u&&r.clearTimeout(u),K("Scheduling update"),u=r.setTimeout(_e,250));}function _e(){u=void 0,oe(e.Diagnostics.File_change_detected_Starting_incremental_compilation),de();}function de(){switch(o){case e.ConfigFileProgramReloadLevel.Partial:e.perfLogger.logStartUpdateProgram("PartialConfigReload"),K("Reloading new file names and options"),F=e.getFileNamesFromConfigSpecs(A.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(S),D),A,R,k),e.updateErrorForNoInputFiles(F,e.getNormalizedAbsolutePath(S,D),A.configFile.configFileSpecs,m,I)&&(O=!0),Z();break;case e.ConfigFileProgramReloadLevel.Full:e.perfLogger.logStartUpdateProgram("FullConfigReload"),K("Reloading config file: ".concat(S)),o=e.ConfigFileProgramReloadLevel.None,M&&M.clearCache(),pe(),b=!0,Z(),Se(),Ce(ee(S),A,P,e.WatchType.ExtendedConfigFile);break;default:e.perfLogger.logStartUpdateProgram("SynchronizeProgram"),Z();}return e.perfLogger.logStopUpdateProgram("Done"),X()}function pe(){fe(e.getParsedCommandLineOfConfigFile(S,C,R,y||(y=new e.Map),E,k));}function fe(t){F=t.fileNames,A=t.options,P=t.watchOptions,w=t.projectReferences,g=t.wildcardDirectories,m=e.getConfigFileParsingDiagnostics(t).slice(),I=e.canJsonReportNoInputFiles(t.raw),O=!0;}function ge(t){var n=ee(t),a=null==d?void 0:d.get(n);if(a){if(!a.reloadLevel)return a.parsedCommandLine;if(a.parsedCommandLine&&a.reloadLevel===e.ConfigFileProgramReloadLevel.Partial&&!r.getParsedCommandLine){K("Reloading new file names and options");var o=e.getFileNamesFromConfigSpecs(a.parsedCommandLine.options.configFile.configFileSpecs,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),D),A,R);return a.parsedCommandLine=i$1(i$1({},a.parsedCommandLine),{fileNames:o}),a.reloadLevel=void 0,a.parsedCommandLine}}K("Loading config file: ".concat(t));var s=r.getParsedCommandLine?r.getParsedCommandLine(t):function(t){var r=R.onUnRecoverableConfigFileDiagnostic;R.onUnRecoverableConfigFileDiagnostic=e.noop;var n=e.getParsedCommandLineOfConfigFile(t,void 0,R,y||(y=new e.Map),E);return R.onUnRecoverableConfigFileDiagnostic=r,n}(t);return a?(a.parsedCommandLine=s,a.reloadLevel=void 0):(d||(d=new e.Map)).set(n,a={parsedCommandLine:s}),function(t,r,n){var i,a,o,s,c;n.watcher||(n.watcher=z(t,(function(n,i){ve(t,r,i);var a=null==d?void 0:d.get(r);a&&(a.reloadLevel=e.ConfigFileProgramReloadLevel.Full),H.removeResolutionsFromProjectReferenceRedirects(r),ue();}),e.PollingInterval.High,(null===(i=n.parsedCommandLine)||void 0===i?void 0:i.watchOptions)||P,e.WatchType.ConfigFileOfReferencedProject)),(null===(a=n.parsedCommandLine)||void 0===a?void 0:a.wildcardDirectories)?e.updateWatchingWildcardDirectories(n.watchedDirectories||(n.watchedDirectories=new e.Map),new e.Map(e.getEntries(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.wildcardDirectories)),(function(i,a){var o;return U(i,(function(n){var a=ee(n);M&&M.addOrDeleteFileOrDirectory(n,a),ie(a);var o=null==d?void 0:d.get(r);(null==o?void 0:o.parsedCommandLine)&&(e.isIgnoredFileFromWildCardWatching({watchedDirPath:ee(i),fileOrDirectory:n,fileOrDirectoryPath:a,configFileName:t,options:o.parsedCommandLine.options,program:o.parsedCommandLine.fileNames,currentDirectory:D,useCaseSensitiveFileNames:x,writeLog:K,toPath:ee})||o.reloadLevel!==e.ConfigFileProgramReloadLevel.Full&&(o.reloadLevel=e.ConfigFileProgramReloadLevel.Partial,ue()));}),a,(null===(o=n.parsedCommandLine)||void 0===o?void 0:o.watchOptions)||P,e.WatchType.WildcardDirectoryOfReferencedProject)})):n.watchedDirectories&&(e.clearMap(n.watchedDirectories,e.closeFileWatcherOf),n.watchedDirectories=void 0),Ce(r,null===(s=n.parsedCommandLine)||void 0===s?void 0:s.options,(null===(c=n.parsedCommandLine)||void 0===c?void 0:c.watchOptions)||P,e.WatchType.ExtendedConfigOfReferencedProject);}(t,n,a),s}function me(e,t,r,n,i,a){return z(t,(function(t,n){return r(t,n,e)}),n,i,a)}function ye(t,r,n){ve(t,n,r),r===e.FileWatcherEventKind.Deleted&&h.has(n)&&H.invalidateResolutionOfFile(n),ie(n),ue();}function ve(e,t,r){M&&M.addOrDeleteFile(e,t,r);}function he(t){return (null==d?void 0:d.has(t))?e.noopFileWatcher:me(t,t,De,e.PollingInterval.Medium,P,e.WatchType.MissingFile)}function be(t){return h.has(t)?e.noopFileWatcher:me(t,t,xe,e.PollingInterval.High,P,e.WatchType.PackageJson)}function xe(t,r,n){ve(t,n,r),o=e.ConfigFileProgramReloadLevel.Full,v=!0,ue();}function De(t,r,n){ve(t,n,r),r===e.FileWatcherEventKind.Created&&s.has(n)&&(s.get(n).close(),s.delete(n),ie(n),ue());}function Se(){g?e.updateWatchingWildcardDirectories(l||(l=new e.Map),new e.Map(e.getEntries(g)),Te):l&&e.clearMap(l,e.closeFileWatcherOf);}function Te(t,r){return U(t,(function(r){e.Debug.assert(!!S);var n=ee(r);M&&M.addOrDeleteFileOrDirectory(r,n),ie(n),e.isIgnoredFileFromWildCardWatching({watchedDirPath:ee(t),fileOrDirectory:r,fileOrDirectoryPath:n,configFileName:S,extraFileExtensions:k,options:A,program:X()||F,currentDirectory:D,useCaseSensitiveFileNames:x,writeLog:K,toPath:ee})||o!==e.ConfigFileProgramReloadLevel.Full&&(o=e.ConfigFileProgramReloadLevel.Partial,ue());}),r,P,e.WatchType.WildcardDirectory)}function Ce(t,r,n,i){e.updateSharedExtendedConfigFileWatcher(t,r,p||(p=new e.Map),(function(t,r){return z(t,(function(n,i){var a;ve(t,r,i),y&&e.cleanExtendedConfigCache(y,r,ee);var s=null===(a=p.get(r))||void 0===a?void 0:a.projects;(null==s?void 0:s.size)&&s.forEach((function(t){if(ee(S)===t)o=e.ConfigFileProgramReloadLevel.Full;else {var r=null==d?void 0:d.get(t);r&&(r.reloadLevel=e.ConfigFileProgramReloadLevel.Full),H.removeResolutionsFromProjectReferenceRedirects(t);}ue();}));}),e.PollingInterval.High,n,i)}),ee);}};}(t),function(e){var t;(t=e.UpToDateStatusType||(e.UpToDateStatusType={}))[t.Unbuildable=0]="Unbuildable",t[t.UpToDate=1]="UpToDate",t[t.UpToDateWithUpstreamTypes=2]="UpToDateWithUpstreamTypes",t[t.OutOfDateWithPrepend=3]="OutOfDateWithPrepend",t[t.OutputMissing=4]="OutputMissing",t[t.OutOfDateWithSelf=5]="OutOfDateWithSelf",t[t.OutOfDateWithUpstream=6]="OutOfDateWithUpstream",t[t.UpstreamOutOfDate=7]="UpstreamOutOfDate",t[t.UpstreamBlocked=8]="UpstreamBlocked",t[t.ComputingUpstream=9]="ComputingUpstream",t[t.TsVersionOutputOfDate=10]="TsVersionOutputOfDate",t[t.ContainerOnly=11]="ContainerOnly",e.resolveConfigFileProjectName=function(t){return e.fileExtensionIs(t,".json")?t:e.combinePaths(t,"tsconfig.json")};}(t),function(e){var t,r,i,a=new Date(-864e13),o=new Date(864e13);function s(t,r){return function(t,r,n){var i,a=t.get(r);return a||(i=new e.Map,t.set(r,i)),a||i}(t,r)}function c(e,t){return t>e?t:e}function l(t){return e.fileExtensionIs(t,".d.ts")}function u(e){return !!e&&!!e.buildOrder}function _(e){return u(e)?e.buildOrder:e}function d(t,r){return function(n){var i=r?"[".concat(e.formatColorAndReset(e.getLocaleTimeString(t),e.ForegroundColorEscapeSequences.Grey),"] "):"".concat(e.getLocaleTimeString(t)," - ");i+="".concat(e.flattenDiagnosticMessageText(n.messageText,t.newLine)).concat(t.newLine+t.newLine),t.write(i);}}function p(t,r,n,i){var a=e.createProgramHost(t,r);return a.getModifiedTime=t.getModifiedTime?function(e){return t.getModifiedTime(e)}:e.returnUndefined,a.setModifiedTime=t.setModifiedTime?function(e,r){return t.setModifiedTime(e,r)}:e.noop,a.deleteFile=t.deleteFile?function(e){return t.deleteFile(e)}:e.noop,a.reportDiagnostic=n||e.createDiagnosticReporter(t),a.reportSolutionBuilderStatus=i||d(t),a.now=e.maybeBind(t,t.now),a}function f(t,r){return e.toPath(r,t.currentDirectory,t.getCanonicalFileName)}function g(e,t){var r=e.resolvedConfigFilePaths,n=r.get(t);if(void 0!==n)return n;var i=f(e,t);return r.set(t,i),i}function m(e){return !!e.options}function y(e,t){var r=e.configFileCache.get(t);return r&&m(r)?r:void 0}function v(t,r,n){var i,a=t.configFileCache,o=a.get(n);if(o)return m(o)?o:void 0;var s,c=t.parseConfigFileHost,l=t.baseCompilerOptions,u=t.baseWatchOptions,_=t.extendedConfigCache,d=t.host;return d.getParsedCommandLine?(s=d.getParsedCommandLine(r))||(i=e.createCompilerDiagnostic(e.Diagnostics.File_0_not_found,r)):(c.onUnRecoverableConfigFileDiagnostic=function(e){return i=e},s=e.getParsedCommandLineOfConfigFile(r,l,c,_,u),c.onUnRecoverableConfigFileDiagnostic=e.noop),a.set(n,s||i),s}function h(t,r){return e.resolveConfigFileProjectName(e.resolvePath(t.currentDirectory,r))}function b(t,r){for(var n,i,a=new e.Map,o=new e.Map,s=[],c=0,l=r;c<l.length;c++)u(l[c]);return i?{buildOrder:n||e.emptyArray,circularDiagnostics:i}:n||e.emptyArray;function u(r,c){var l=g(t,r);if(!o.has(l))if(a.has(l))c||(i||(i=[])).push(e.createCompilerDiagnostic(e.Diagnostics.Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0,s.join("\r\n")));else {a.set(l,!0),s.push(r);var _=v(t,r,l);if(_&&_.projectReferences)for(var d=0,p=_.projectReferences;d<p.length;d++){var f=p[d];u(h(t,f.path),c||f.circular);}s.pop(),o.set(l,!0),(n||(n=[])).push(r);}}}function x(t){return t.buildOrder||function(t){var r=b(t,t.rootNames.map((function(e){return h(t,e)})));t.resolvedConfigFilePaths.clear();var n=new e.Map(_(r).map((function(e){return [g(t,e),!0]}))),i={onDeleteValue:e.noop};return e.mutateMapSkippingNewValues(t.configFileCache,n,i),e.mutateMapSkippingNewValues(t.projectStatus,n,i),e.mutateMapSkippingNewValues(t.buildInfoChecked,n,i),e.mutateMapSkippingNewValues(t.builderPrograms,n,i),e.mutateMapSkippingNewValues(t.diagnostics,n,i),e.mutateMapSkippingNewValues(t.projectPendingBuild,n,i),e.mutateMapSkippingNewValues(t.projectErrorsReported,n,i),t.watch&&(e.mutateMapSkippingNewValues(t.allWatchedConfigFiles,n,{onDeleteValue:e.closeFileWatcher}),t.allWatchedExtendedConfigFiles.forEach((function(e){e.projects.forEach((function(t){n.has(t)||e.projects.delete(t);})),e.close();})),e.mutateMapSkippingNewValues(t.allWatchedWildcardDirectories,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcherOf)}}),e.mutateMapSkippingNewValues(t.allWatchedInputFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}}),e.mutateMapSkippingNewValues(t.allWatchedPackageJsonFiles,n,{onDeleteValue:function(t){return t.forEach(e.closeFileWatcher)}})),t.buildOrder=r}(t)}function D(t,r,n){var i=r&&h(t,r),a=x(t);if(u(a))return a;if(i){var o=g(t,i);if(-1===e.findIndex(a,(function(e){return g(t,e)===o})))return}var s=i?b(t,[i]):a;return e.Debug.assert(!u(s)),e.Debug.assert(!n||void 0!==i),e.Debug.assert(!n||s[s.length-1]===i),n?s.slice(0,s.length-1):s}function S(t){t.cache&&T(t);var r=t.compilerHost,i=t.host,a=t.readFileWithCache,o=r.getSourceFile,s=e.changeCompilerHostLikeToUseCache(i,(function(e){return f(t,e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.call.apply(o,n$3([r],e,!1))})),c=s.originalReadFile,l=s.originalFileExists,u=s.originalDirectoryExists,_=s.originalCreateDirectory,d=s.originalWriteFile,p=s.getSourceFileWithCache,g=s.readFileWithCache;t.readFileWithCache=g,r.getSourceFile=p,t.cache={originalReadFile:c,originalFileExists:l,originalDirectoryExists:u,originalCreateDirectory:_,originalWriteFile:d,originalReadFileWithCache:a,originalGetSourceFile:o};}function T(e){if(e.cache){var t=e.cache,r=e.host,n=e.compilerHost,i=e.extendedConfigCache,a=e.moduleResolutionCache,o=e.typeReferenceDirectiveResolutionCache;r.readFile=t.originalReadFile,r.fileExists=t.originalFileExists,r.directoryExists=t.originalDirectoryExists,r.createDirectory=t.originalCreateDirectory,r.writeFile=t.originalWriteFile,n.getSourceFile=t.originalGetSourceFile,e.readFileWithCache=t.originalReadFileWithCache,i.clear(),null==a||a.clear(),null==o||o.clear(),e.cache=void 0;}}function C(e,t){e.projectStatus.delete(t),e.diagnostics.delete(t);}function E(e,t,r){var n=e.projectPendingBuild,i=n.get(t);(void 0===i||i<r)&&n.set(t,r);}function k(t,r){t.allProjectBuildPending&&(t.allProjectBuildPending=!1,t.options.watch&&te(t,e.Diagnostics.Starting_compilation_in_watch_mode),S(t),_(x(t)).forEach((function(r){return t.projectPendingBuild.set(g(t,r),e.ConfigFileProgramReloadLevel.None)})),r&&r.throwIfCancellationRequested());}function N(t,r){return t.projectPendingBuild.delete(r),t.currentInvalidatedProject=void 0,t.diagnostics.has(r)?e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}function F(e,t,n,i,a){var o=!0;return {kind:r.UpdateOutputFileStamps,project:t,projectPath:n,buildOrder:a,getCompilerOptions:function(){return i.options},getCurrentDirectory:function(){return e.currentDirectory},updateOutputFileStatmps:function(){j(e,i,n),o=!1;},done:function(){return o&&j(e,i,n),N(e,n)}}}function A(s,u,_,d,p,m,y){var b,x,D,S=s===r.Build?i.CreateProgram:i.EmitBundle;return s===r.Build?{kind:s,project:_,projectPath:d,buildOrder:y,getCompilerOptions:function(){return m.options},getCurrentDirectory:function(){return u.currentDirectory},getBuilderProgram:function(){return C(e.identity)},getProgram:function(){return C((function(e){return e.getProgramOrUndefined()}))},getSourceFile:function(e){return C((function(t){return t.getSourceFile(e)}))},getSourceFiles:function(){return E((function(e){return e.getSourceFiles()}))},getOptionsDiagnostics:function(e){return E((function(t){return t.getOptionsDiagnostics(e)}))},getGlobalDiagnostics:function(e){return E((function(t){return t.getGlobalDiagnostics(e)}))},getConfigFileParsingDiagnostics:function(){return E((function(e){return e.getConfigFileParsingDiagnostics()}))},getSyntacticDiagnostics:function(e,t){return E((function(r){return r.getSyntacticDiagnostics(e,t)}))},getAllDependencies:function(e){return E((function(t){return t.getAllDependencies(e)}))},getSemanticDiagnostics:function(e,t){return E((function(r){return r.getSemanticDiagnostics(e,t)}))},getSemanticDiagnosticsOfNextAffectedFile:function(e,t){return C((function(r){return r.getSemanticDiagnosticsOfNextAffectedFile&&r.getSemanticDiagnosticsOfNextAffectedFile(e,t)}))},emit:function(e,t,r,n,a){return e||n?C((function(i){var o,s;return i.emit(e,t,r,n,a||(null===(s=(o=u.host).getCustomTransformers)||void 0===s?void 0:s.call(o,_)))})):(U(i.SemanticDiagnostics,r),S===i.EmitBuildInfo?R(t,r):S===i.Emit?L(t,r,a):void 0)},done:T}:{kind:s,project:_,projectPath:d,buildOrder:y,getCompilerOptions:function(){return m.options},getCurrentDirectory:function(){return u.currentDirectory},emit:function(e,t){return S!==i.EmitBundle?D:z(e,t)},done:T};function T(e,t,r){return U(i.Done,e,t,r),N(u,d)}function C(e){return U(i.CreateProgram),b&&e(b)}function E(t){return C(t)||e.emptyArray}function k(){var r,n;if(e.Debug.assert(void 0===b),u.options.dry)return ee(u,e.Diagnostics.A_non_dry_build_would_build_project_0,_),x=t.Success,void(S=i.QueueReferencingProjects);if(u.options.verbose&&ee(u,e.Diagnostics.Building_project_0,_),0===m.fileNames.length)return ne(u,d,e.getConfigFileParsingDiagnostics(m)),x=t.None,void(S=i.QueueReferencingProjects);var a=u.host,o=u.compilerHost;u.projectCompilerOptions=m.options,null===(r=u.moduleResolutionCache)||void 0===r||r.update(m.options),null===(n=u.typeReferenceDirectiveResolutionCache)||void 0===n||n.update(m.options),b=a.createProgram(m.fileNames,m.options,o,function(t,r,n){var i=t.options,a=t.builderPrograms,o=t.compilerHost;if(!i.force)return a.get(r)||e.readBuilderProgram(n.options,o)}(u,d,m),e.getConfigFileParsingDiagnostics(m),m.projectReferences),u.watch&&(u.lastCachedPackageJsonLookups.set(d,u.moduleResolutionCache&&e.map(u.moduleResolutionCache.getPackageJsonInfoCache().entries(),(function(e){var t=e[0],r=e[1];return [u.host.realpath&&r?f(u,u.host.realpath(t)):t,r]}))),u.builderPrograms.set(d,b)),S++;}function F(e,t,r){var n;e.length?(n=M(u,d,b,m,e,t,r),x=n.buildResult,S=n.step):S++;}function P(r){e.Debug.assertIsDefined(b),F(n$3(n$3(n$3(n$3([],b.getConfigFileParsingDiagnostics(),!0),b.getOptionsDiagnostics(r),!0),b.getGlobalDiagnostics(r),!0),b.getSyntacticDiagnostics(void 0,r),!0),t.SyntaxErrors,"Syntactic");}function w(r){F(e.Debug.checkDefined(b).getSemanticDiagnostics(void 0,r),t.TypeErrors,"Semantic");}function L(r,n,o){var s,p,g,y;e.Debug.assertIsDefined(b),e.Debug.assert(S===i.Emit),b.backupState();var v=[],h=e.emitFilesAndReportErrors(b,(function(e){return (y||(y=[])).push(e)}),void 0,void 0,(function(e,t,r){return v.push({name:e,text:t,writeByteOrderMark:r})}),n,!1,o||(null===(g=(p=u.host).getCustomTransformers)||void 0===g?void 0:g.call(p,_))).emitResult;if(y)return b.restoreState(),s=M(u,d,b,m,y,t.DeclarationEmitErrors,"Declaration file"),x=s.buildResult,S=s.step,{emitSkipped:!0,diagnostics:h.diagnostics};var D=u.host,T=u.compilerHost,C=t.DeclarationOutputUnchanged,E=a,k=!1,N=e.createDiagnosticCollection(),F=new e.Map;return v.forEach((function(n){var i,a=n.name,o=n.text,s=n.writeByteOrderMark;!k&&l(a)&&(D.fileExists(a)&&u.readFileWithCache(a)===o?i=D.getModifiedTime(a):(C&=~t.DeclarationOutputUnchanged,k=!0)),F.set(f(u,a),a),e.writeFile(r?{writeFile:r}:T,N,a,o,s),void 0!==i&&(E=c(i,E));})),j(N,F,E,k,v.length?v[0].name:e.getFirstProjectOutput(m,!D.useCaseSensitiveFileNames()),C),h}function R(r,a){e.Debug.assertIsDefined(b),e.Debug.assert(S===i.EmitBuildInfo);var o=b.emitBuildInfo(r,a);return o.diagnostics.length&&(re(u,o.diagnostics),u.diagnostics.set(d,n$3(n$3([],u.diagnostics.get(d),!0),o.diagnostics,!0)),x=t.EmitErrors&x),o.emittedFiles&&u.write&&o.emittedFiles.forEach((function(e){return I(u,m,e)})),O(u,b,m),S=i.QueueReferencingProjects,o}function j(r,n,a,s,c,l){var _,p=r.getDiagnostics();if(p.length)return _=M(u,d,b,m,p,t.EmitErrors,"Emit"),x=_.buildResult,S=_.step,p;u.write&&n.forEach((function(e){return I(u,m,e)}));var f=B(u,m,a,e.Diagnostics.Updating_unchanged_output_timestamps_of_project_0,n);return u.diagnostics.delete(d),u.projectStatus.set(d,{type:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:s?o:f,oldestOutputFileName:c}),O(u,b,m),S=i.QueueReferencingProjects,x=l,p}function z(n,o){var c,l;if(e.Debug.assert(s===r.UpdateBundle),u.options.dry)return ee(u,e.Diagnostics.A_non_dry_build_would_update_output_of_project_0,_),x=t.Success,void(S=i.QueueReferencingProjects);u.options.verbose&&ee(u,e.Diagnostics.Updating_output_of_project_0,_);var b=u.compilerHost;u.projectCompilerOptions=m.options;var T=e.emitUsingBuildInfo(m,b,(function(e){var t=h(u,e.path);return v(u,t,g(u,t))}),o||(null===(l=(c=u.host).getCustomTransformers)||void 0===l?void 0:l.call(c,_)));if(e.isString(T))return ee(u,e.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1,_,$(u,T)),S=i.BuildInvalidatedProjectOfBundle,D=A(r.Build,u,_,d,p,m,y);e.Debug.assert(!!T.length);var C=e.createDiagnosticCollection(),E=new e.Map;return T.forEach((function(t){var r=t.name,i=t.text,a=t.writeByteOrderMark;E.set(f(u,r),r),e.writeFile(n?{writeFile:n}:b,C,r,i,a);})),{emitSkipped:!1,diagnostics:j(C,E,a,!1,T[0].name,t.DeclarationOutputUnchanged)}}function U(t,r,n,a){for(;S<=t&&S<i.Done;){var o=S;switch(S){case i.CreateProgram:k();break;case i.SyntaxDiagnostics:P(r);break;case i.SemanticDiagnostics:w(r);break;case i.Emit:L(n,r,a);break;case i.EmitBuildInfo:R(n,r);break;case i.EmitBundle:z(n,a);break;case i.BuildInvalidatedProjectOfBundle:e.Debug.checkDefined(D).done(r,n,a),S=i.Done;break;case i.QueueReferencingProjects:J(u,_,d,p,m,y,e.Debug.checkDefined(x)),S++;break;case i.Done:default:e.assertType(S);}e.Debug.assert(S>o);}}}function P(t,r,n){var i=t.options;return !(r.type===e.UpToDateStatusType.OutOfDateWithPrepend&&!i.force&&0!==n.fileNames.length&&!e.getConfigFileParsingDiagnostics(n).length&&e.isIncrementalCompilation(n.options))}function w(t,n,i){if(t.projectPendingBuild.size&&!u(n)){if(t.currentInvalidatedProject)return e.arrayIsEqualTo(t.currentInvalidatedProject.buildOrder,n)?t.currentInvalidatedProject:void 0;for(var a=t.options,o=t.projectPendingBuild,s=0;s<n.length;s++){var c=n[s],l=g(t,c),_=t.projectPendingBuild.get(l);if(void 0!==_){i&&(i=!1,oe(t,n));var d=v(t,c,l);if(d){_===e.ConfigFileProgramReloadLevel.Full?(H(t,c,l,d),G(t,l,d),Q(t,c,l,d),X(t,c,l,d),Y(t,c,l,d)):_===e.ConfigFileProgramReloadLevel.Partial&&(d.fileNames=e.getFileNamesFromConfigSpecs(d.options.configFile.configFileSpecs,e.getDirectoryPath(c),d.options,t.parseConfigFileHost),e.updateErrorForNoInputFiles(d.fileNames,c,d.options.configFile.configFileSpecs,d.errors,e.canJsonReportNoInputFiles(d.raw)),X(t,c,l,d),Y(t,c,l,d));var p=R(t,d,l);if(se(t,c,p),!a.force){if(p.type===e.UpToDateStatusType.UpToDate){ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l),a.dry&&ee(t,e.Diagnostics.Project_0_is_up_to_date,c);continue}if(p.type===e.UpToDateStatusType.UpToDateWithUpstreamTypes)return ne(t,l,e.getConfigFileParsingDiagnostics(d)),F(t,c,l,d,n)}if(p.type!==e.UpToDateStatusType.UpstreamBlocked){if(p.type!==e.UpToDateStatusType.ContainerOnly)return A(P(t,p,d)?r.Build:r.UpdateBundle,t,c,l,s,d,n);ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l);}else ne(t,l,e.getConfigFileParsingDiagnostics(d)),o.delete(l),a.verbose&&ee(t,p.upstreamProjectBlocked?e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built:e.Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,c,p.upstreamProjectName);}else ie(t,l),o.delete(l);}}}}function I(e,t,r){var n=e.write;n&&t.options.listEmittedFiles&&n("TSFILE: ".concat(r));}function O(t,r,n){r?(r&&t.write&&e.listFiles(r,t.write),t.host.afterProgramEmitAndDiagnostics&&t.host.afterProgramEmitAndDiagnostics(r),r.releaseProgram()):t.host.afterEmitBundle&&t.host.afterEmitBundle(n),t.projectCompilerOptions=t.baseCompilerOptions;}function M(r,n,a,o,s,c,l){var u=!(c&t.SyntaxErrors)&&a&&!e.outFile(a.getCompilerOptions());return ne(r,n,s),r.projectStatus.set(n,{type:e.UpToDateStatusType.Unbuildable,reason:"".concat(l," errors")}),u?{buildResult:c,step:i.EmitBuildInfo}:(O(r,a,o),{buildResult:c,step:i.QueueReferencingProjects})}function L(t,r,n,i){if(n<e.getModifiedTime(t.host,r))return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:i,newerInputFileName:r}}function R(t,r,n){if(void 0===r)return {type:e.UpToDateStatusType.Unbuildable,reason:"File deleted mid-build"};var i=t.projectStatus.get(n);if(void 0!==i)return i;var s=function(t,r,n){for(var i=!!t.options.force,s=void 0,u=a,_=t.host,d=0,p=r.fileNames;d<p.length;d++){var f=p[d];if(!_.fileExists(f))return {type:e.UpToDateStatusType.Unbuildable,reason:"".concat(f," does not exist")};if(!i){var m=e.getModifiedTime(_,f);m>u&&(s=f,u=m);}}if(!r.fileNames.length&&!e.canJsonReportNoInputFiles(r.raw))return {type:e.UpToDateStatusType.ContainerOnly};var y,h=e.getAllProjectOutputs(r,!_.useCaseSensitiveFileNames()),b="(none)",x=o,D="(none)",S=a,T=a,C=!1;if(!i)for(var E=0,k=h;E<k.length;E++){var N=k[E];if(!_.fileExists(N)){y=N;break}var F=e.getModifiedTime(_,N);if(F<x&&(x=F,b=N),F<u){C=!0;break}F>S&&(S=F,D=N),l(N)&&(T=c(T,e.getModifiedTime(_,N)));}var A,P=!1,w=!1;if(r.projectReferences){t.projectStatus.set(n,{type:e.UpToDateStatusType.ComputingUpstream});for(var I=0,O=r.projectReferences;I<O.length;I++){var M=O[I];w=w||!!M.prepend;var B=e.resolveProjectReferencePath(M),j=g(t,B),J=R(t,v(t,B,j),j);if(J.type!==e.UpToDateStatusType.ComputingUpstream&&J.type!==e.UpToDateStatusType.ContainerOnly){if(J.type===e.UpToDateStatusType.Unbuildable||J.type===e.UpToDateStatusType.UpstreamBlocked)return {type:e.UpToDateStatusType.UpstreamBlocked,upstreamProjectName:M.path,upstreamProjectBlocked:J.type===e.UpToDateStatusType.UpstreamBlocked};if(J.type!==e.UpToDateStatusType.UpToDate)return {type:e.UpToDateStatusType.UpstreamOutOfDate,upstreamProjectName:M.path};if(!i&&!y){if(J.newestInputFileTime&&J.newestInputFileTime<=x)continue;if(J.newestDeclarationFileContentChangedTime&&J.newestDeclarationFileContentChangedTime<=x){P=!0,A=M.path;continue}return e.Debug.assert(void 0!==b,"Should have an oldest output filename here"),{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:b,newerProjectName:M.path}}}}}if(void 0!==y)return {type:e.UpToDateStatusType.OutputMissing,missingOutputFileName:y};if(C)return {type:e.UpToDateStatusType.OutOfDateWithSelf,outOfDateOutputFileName:b,newerInputFileName:s};var z=L(t,r.options.configFilePath,x,b);if(z)return z;var U=e.forEach(r.options.configFile.extendedSourceFiles||e.emptyArray,(function(e){return L(t,e,x,b)}));if(U)return U;var K=e.forEach(t.lastCachedPackageJsonLookups.get(n)||e.emptyArray,(function(e){var r=e[0];return L(t,r,x,b)}));if(K)return K;if(!i&&!t.buildInfoChecked.has(n)){t.buildInfoChecked.set(n,!0);var V=e.getTsBuildInfoEmitOutputFilePath(r.options);if(V){var q=t.readFileWithCache(V),W=q&&e.getBuildInfo(q);if(W&&(W.bundle||W.program)&&W.version!==e.version)return {type:e.UpToDateStatusType.TsVersionOutputOfDate,version:W.version}}}return w&&P?{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:b,newerProjectName:A}:{type:P?e.UpToDateStatusType.UpToDateWithUpstreamTypes:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:T,newestInputFileTime:u,newestOutputFileTime:S,newestInputFileName:s,newestOutputFileName:D,oldestOutputFileName:b}}(t,r,n);return t.projectStatus.set(n,s),s}function B(t,r,n,i,a){if(r.options.noEmit)return n;var o=t.host,s=e.getAllProjectOutputs(r,!o.useCaseSensitiveFileNames());if(!a||s.length!==a.size)for(var u=!!t.options.verbose,_=o.now?o.now():new Date,d=0,p=s;d<p.length;d++){var g=p[d];a&&a.has(f(t,g))||(u&&(u=!1,ee(t,i,r.options.configFilePath)),l(g)&&(n=c(n,e.getModifiedTime(o,g))),o.setModifiedTime(g,_));}return n}function j(t,r,n){if(t.options.dry)return ee(t,e.Diagnostics.A_non_dry_build_would_update_timestamps_for_output_of_project_0,r.options.configFilePath);var i=B(t,r,a,e.Diagnostics.Updating_output_timestamps_of_project_0);t.projectStatus.set(n,{type:e.UpToDateStatusType.UpToDate,newestDeclarationFileContentChangedTime:i,oldestOutputFileName:e.getFirstProjectOutput(r,!t.host.useCaseSensitiveFileNames())});}function J(r,n,i,a,o,s,c){if(!(c&t.AnyErrors)&&o.options.composite)for(var l=a+1;l<s.length;l++){var u=s[l],_=g(r,u);if(!r.projectPendingBuild.has(_)){var d=v(r,u,_);if(d&&d.projectReferences)for(var p=0,f=d.projectReferences;p<f.length;p++){var m=f[p];if(g(r,h(r,m.path))===i){var y=r.projectStatus.get(_);if(y)switch(y.type){case e.UpToDateStatusType.UpToDate:if(c&t.DeclarationOutputUnchanged){m.prepend?r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithPrepend,outOfDateOutputFileName:y.oldestOutputFileName,newerProjectName:n}):y.type=e.UpToDateStatusType.UpToDateWithUpstreamTypes;break}case e.UpToDateStatusType.UpToDateWithUpstreamTypes:case e.UpToDateStatusType.OutOfDateWithPrepend:c&t.DeclarationOutputUnchanged||r.projectStatus.set(_,{type:e.UpToDateStatusType.OutOfDateWithUpstream,outOfDateOutputFileName:y.type===e.UpToDateStatusType.OutOfDateWithPrepend?y.outOfDateOutputFileName:y.oldestOutputFileName,newerProjectName:n});break;case e.UpToDateStatusType.UpstreamBlocked:g(r,h(r,y.upstreamProjectName))===i&&C(r,_);}E(r,_,e.ConfigFileProgramReloadLevel.None);break}}}}}function z(t,r,n,i,a,o){var s=D(t,r,o);if(!s)return e.ExitStatus.InvalidProject_OutputsSkipped;k(t,n);for(var c=!0,l=0;;){var d=w(t,s,c);if(!d)break;c=!1,d.done(n,i,null==a?void 0:a(d.project)),t.diagnostics.has(d.projectPath)||l++;}return T(t),ae(t,s),function(e,t){if(e.watchAllProjectsPending){e.watchAllProjectsPending=!1;for(var r=0,n=_(t);r<n.length;r++){var i=n[r],a=g(e,i),o=v(e,i,a);H(e,i,a,o),G(e,a,o),o&&(Q(e,i,a,o),X(e,i,a,o),Y(e,i,a,o));}}}(t,s),u(s)?e.ExitStatus.ProjectReferenceCycle_OutputsSkipped:s.some((function(e){return t.diagnostics.has(g(t,e))}))?l?e.ExitStatus.DiagnosticsPresent_OutputsGenerated:e.ExitStatus.DiagnosticsPresent_OutputsSkipped:e.ExitStatus.Success}function U(t,r,n){var i=D(t,r,n);if(!i)return e.ExitStatus.InvalidProject_OutputsSkipped;if(u(i))return re(t,i.circularDiagnostics),e.ExitStatus.ProjectReferenceCycle_OutputsSkipped;for(var a=t.options,o=t.host,s=a.dry?[]:void 0,c=0,l=i;c<l.length;c++){var _=l[c],d=g(t,_),p=v(t,_,d);if(void 0!==p){var m=e.getAllProjectOutputs(p,!o.useCaseSensitiveFileNames());if(m.length)for(var y=new e.Set(p.fileNames.map((function(e){return f(t,e)}))),h=0,b=m;h<b.length;h++){var x=b[h];y.has(f(t,x))||o.fileExists(x)&&(s?s.push(x):(o.deleteFile(x),K(t,d,e.ConfigFileProgramReloadLevel.None)));}}else ie(t,d);}return s&&ee(t,e.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0,s.map((function(e){return "\r\n * ".concat(e)})).join("")),e.ExitStatus.Success}function K(t,r,n){t.host.getParsedCommandLine&&n===e.ConfigFileProgramReloadLevel.Partial&&(n=e.ConfigFileProgramReloadLevel.Full),n===e.ConfigFileProgramReloadLevel.Full&&(t.configFileCache.delete(r),t.buildOrder=void 0),t.needsSummary=!0,C(t,r),E(t,r,n),S(t);}function V(e,t,r){e.reportFileChangeDetected=!0,K(e,t,r),q(e);}function q(e){var t=e.hostWithWatch;t.setTimeout&&t.clearTimeout&&(e.timerToBuildInvalidatedProject&&t.clearTimeout(e.timerToBuildInvalidatedProject),e.timerToBuildInvalidatedProject=t.setTimeout(W,250,e));}function W(t){t.timerToBuildInvalidatedProject=void 0,t.reportFileChangeDetected&&(t.reportFileChangeDetected=!1,t.projectErrorsReported.clear(),te(t,e.Diagnostics.File_change_detected_Starting_incremental_compilation));var r=x(t),n=w(t,r,!1);n&&(n.done(),t.projectPendingBuild.size)?t.watch&&!t.timerToBuildInvalidatedProject&&q(t):(T(t),ae(t,r));}function H(t,r,n,i){t.watch&&!t.allWatchedConfigFiles.has(n)&&t.allWatchedConfigFiles.set(n,t.watchFile(r,(function(){V(t,n,e.ConfigFileProgramReloadLevel.Full);}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.ConfigFile,r));}function G(t,r,n){e.updateSharedExtendedConfigFileWatcher(r,null==n?void 0:n.options,t.allWatchedExtendedConfigFiles,(function(r,i){return t.watchFile(r,(function(){var r;return null===(r=t.allWatchedExtendedConfigFiles.get(i))||void 0===r?void 0:r.projects.forEach((function(r){return V(t,r,e.ConfigFileProgramReloadLevel.Full)}))}),e.PollingInterval.High,null==n?void 0:n.watchOptions,e.WatchType.ExtendedConfigFile)}),(function(e){return f(t,e)}));}function Q(t,r,n,i){t.watch&&e.updateWatchingWildcardDirectories(s(t.allWatchedWildcardDirectories,n),new e.Map(e.getEntries(i.wildcardDirectories)),(function(a,o){return t.watchDirectory(a,(function(o){var s;e.isIgnoredFileFromWildCardWatching({watchedDirPath:f(t,a),fileOrDirectory:o,fileOrDirectoryPath:f(t,o),configFileName:r,currentDirectory:t.currentDirectory,options:i.options,program:t.builderPrograms.get(n)||(null===(s=y(t,n))||void 0===s?void 0:s.fileNames),useCaseSensitiveFileNames:t.parseConfigFileHost.useCaseSensitiveFileNames,writeLog:function(e){return t.writeLog(e)},toPath:function(e){return f(t,e)}})||V(t,n,e.ConfigFileProgramReloadLevel.Partial);}),o,null==i?void 0:i.watchOptions,e.WatchType.WildcardDirectory,r)}));}function X(t,r,n,i){t.watch&&e.mutateMap(s(t.allWatchedInputFiles,n),e.arrayToMap(i.fileNames,(function(e){return f(t,e)})),{createNewValue:function(a,o){return t.watchFile(o,(function(){return V(t,n,e.ConfigFileProgramReloadLevel.None)}),e.PollingInterval.Low,null==i?void 0:i.watchOptions,e.WatchType.SourceFile,r)},onDeleteValue:e.closeFileWatcher});}function Y(t,r,n,i){t.watch&&t.lastCachedPackageJsonLookups&&e.mutateMap(s(t.allWatchedPackageJsonFiles,n),new e.Map(t.lastCachedPackageJsonLookups.get(n)),{createNewValue:function(a,o){return t.watchFile(a,(function(){return V(t,n,e.ConfigFileProgramReloadLevel.Full)}),e.PollingInterval.High,null==i?void 0:i.watchOptions,e.WatchType.PackageJson,r)},onDeleteValue:e.closeFileWatcher});}function Z(t,r,n,i,a){var o=function(t,r,n,i,a){var o,s,c=r,l=r,u=c.getCurrentDirectory(),_=e.createGetCanonicalFileName(c.useCaseSensitiveFileNames()),d=(o=i,s={},e.commonOptionsWithBuild.forEach((function(t){e.hasProperty(o,t.name)&&(s[t.name]=o[t.name]);})),s),p=e.createCompilerHostFromProgramHost(c,(function(){return T.projectCompilerOptions}));e.setGetSourceFileAsHashVersioned(p,c),p.getParsedCommandLine=function(e){return v(T,e,g(T,e))},p.resolveModuleNames=e.maybeBind(c,c.resolveModuleNames),p.resolveTypeReferenceDirectives=e.maybeBind(c,c.resolveTypeReferenceDirectives);var f=p.resolveModuleNames?void 0:e.createModuleResolutionCache(u,_),m=p.resolveTypeReferenceDirectives?void 0:e.createTypeReferenceDirectiveResolutionCache(u,_,void 0,null==f?void 0:f.getPackageJsonInfoCache());if(!p.resolveModuleNames){var y=function(t,r,n,i){return e.resolveModuleName(t,n,T.projectCompilerOptions,p,f,i,r).resolvedModule};p.resolveModuleNames=function(t,r,n,i,a,o){return e.loadWithModeAwareCache(e.Debug.checkEachDefined(t),e.Debug.checkDefined(o),r,i,y)},p.getModuleResolutionCache=function(){return f};}if(!p.resolveTypeReferenceDirectives){var h=function(t,r,n){return e.resolveTypeReferenceDirective(t,r,T.projectCompilerOptions,p,n,T.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective};p.resolveTypeReferenceDirectives=function(t,r,n){return e.loadWithLocalCache(e.Debug.checkEachDefined(t),r,n,h)};}var b=e.createWatchFactory(l,i),x=b.watchFile,D=b.watchDirectory,S=b.writeLog,T={host:c,hostWithWatch:l,currentDirectory:u,getCanonicalFileName:_,parseConfigFileHost:e.parseConfigHostFromCompilerHostLike(c),write:e.maybeBind(c,c.trace),options:i,baseCompilerOptions:d,rootNames:n,baseWatchOptions:a,resolvedConfigFilePaths:new e.Map,configFileCache:new e.Map,projectStatus:new e.Map,buildInfoChecked:new e.Map,extendedConfigCache:new e.Map,builderPrograms:new e.Map,diagnostics:new e.Map,projectPendingBuild:new e.Map,projectErrorsReported:new e.Map,compilerHost:p,moduleResolutionCache:f,typeReferenceDirectiveResolutionCache:m,buildOrder:void 0,readFileWithCache:function(e){return c.readFile(e)},projectCompilerOptions:d,cache:void 0,allProjectBuildPending:!0,needsSummary:!0,watchAllProjectsPending:t,currentInvalidatedProject:void 0,watch:t,allWatchedWildcardDirectories:new e.Map,allWatchedInputFiles:new e.Map,allWatchedConfigFiles:new e.Map,allWatchedExtendedConfigFiles:new e.Map,allWatchedPackageJsonFiles:new e.Map,lastCachedPackageJsonLookups:new e.Map,timerToBuildInvalidatedProject:void 0,reportFileChangeDetected:!1,watchFile:x,watchDirectory:D,writeLog:S};return T}(t,r,n,i,a);return {build:function(e,t,r,n){return z(o,e,t,r,n)},clean:function(e){return U(o,e)},buildReferences:function(e,t,r,n){return z(o,e,t,r,n,!0)},cleanReferences:function(e){return U(o,e,!0)},getNextInvalidatedProject:function(e){return k(o,e),w(o,x(o),!1)},getBuildOrder:function(){return x(o)},getUpToDateStatusOfProject:function(e){var t=h(o,e),r=g(o,t);return R(o,v(o,t,r),r)},invalidateProject:function(t,r){return K(o,t,r||e.ConfigFileProgramReloadLevel.None)},buildNextInvalidatedProject:function(){return W(o)},getAllParsedConfigs:function(){return e.arrayFrom(e.mapDefinedIterator(o.configFileCache.values(),(function(e){return m(e)?e:void 0})))},close:function(){return function(t){e.clearMap(t.allWatchedConfigFiles,e.closeFileWatcher),e.clearMap(t.allWatchedExtendedConfigFiles,e.closeFileWatcherOf),e.clearMap(t.allWatchedWildcardDirectories,(function(t){return e.clearMap(t,e.closeFileWatcherOf)})),e.clearMap(t.allWatchedInputFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)})),e.clearMap(t.allWatchedPackageJsonFiles,(function(t){return e.clearMap(t,e.closeFileWatcher)}));}(o)}}}function $(t,r){return e.convertToRelativePath(r,t.currentDirectory,(function(e){return t.getCanonicalFileName(e)}))}function ee(t,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];t.host.reportSolutionBuilderStatus(e.createCompilerDiagnostic.apply(void 0,n$3([r],i,!1)));}function te(t,r){for(var i,a,o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];null===(a=(i=t.hostWithWatch).onWatchStatusChange)||void 0===a||a.call(i,e.createCompilerDiagnostic.apply(void 0,n$3([r],o,!1)),t.host.getNewLine(),t.baseCompilerOptions);}function re(e,t){var r=e.host;t.forEach((function(e){return r.reportDiagnostic(e)}));}function ne(e,t,r){re(e,r),e.projectErrorsReported.set(t,!0),r.length&&e.diagnostics.set(t,r);}function ie(e,t){ne(e,t,[e.configFileCache.get(t)]);}function ae(t,r){if(t.needsSummary){t.needsSummary=!1;var n=t.watch||!!t.host.reportErrorSummary,i=t.diagnostics,a=0;u(r)?(oe(t,r.buildOrder),re(t,r.circularDiagnostics),n&&(a+=e.getErrorCountForSummary(r.circularDiagnostics))):(r.forEach((function(r){var n=g(t,r);t.projectErrorsReported.has(n)||re(t,i.get(n)||e.emptyArray);})),n&&i.forEach((function(t){return a+=e.getErrorCountForSummary(t)}))),t.watch?te(t,e.getWatchErrorSummaryDiagnosticMessage(a),a):t.host.reportErrorSummary&&t.host.reportErrorSummary(a);}}function oe(t,r){t.options.verbose&&ee(t,e.Diagnostics.Projects_in_this_build_Colon_0,r.map((function(e){return "\r\n * "+$(t,e)})).join(""));}function se(t,r,n){t.options.verbose&&function(t,r,n){if(t.options.force&&(n.type===e.UpToDateStatusType.UpToDate||n.type===e.UpToDateStatusType.UpToDateWithUpstreamTypes))return ee(t,e.Diagnostics.Project_0_is_being_forcibly_rebuilt,$(t,r));switch(n.type){case e.UpToDateStatusType.OutOfDateWithSelf:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2,$(t,r),$(t,n.outOfDateOutputFileName),$(t,n.newerInputFileName));case e.UpToDateStatusType.OutOfDateWithUpstream:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2,$(t,r),$(t,n.outOfDateOutputFileName),$(t,n.newerProjectName));case e.UpToDateStatusType.OutputMissing:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist,$(t,r),$(t,n.missingOutputFileName));case e.UpToDateStatusType.UpToDate:if(void 0!==n.newestInputFileTime)return ee(t,e.Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2,$(t,r),$(t,n.newestInputFileName||""),$(t,n.oldestOutputFileName||""));break;case e.UpToDateStatusType.OutOfDateWithPrepend:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed,$(t,r),$(t,n.newerProjectName));case e.UpToDateStatusType.UpToDateWithUpstreamTypes:return ee(t,e.Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,$(t,r));case e.UpToDateStatusType.UpstreamOutOfDate:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,$(t,r),$(t,n.upstreamProjectName));case e.UpToDateStatusType.UpstreamBlocked:return ee(t,n.upstreamProjectBlocked?e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built:e.Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,$(t,r),$(t,n.upstreamProjectName));case e.UpToDateStatusType.Unbuildable:return ee(t,e.Diagnostics.Failed_to_parse_file_0_Colon_1,$(t,r),n.reason);case e.UpToDateStatusType.TsVersionOutputOfDate:return ee(t,e.Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,$(t,r),n.version,e.version);case e.UpToDateStatusType.ContainerOnly:case e.UpToDateStatusType.ComputingUpstream:break;default:e.assertType(n);}}(t,r,n);}!function(e){e[e.None=0]="None",e[e.Success=1]="Success",e[e.DeclarationOutputUnchanged=2]="DeclarationOutputUnchanged",e[e.ConfigFileErrors=4]="ConfigFileErrors",e[e.SyntaxErrors=8]="SyntaxErrors",e[e.TypeErrors=16]="TypeErrors",e[e.DeclarationEmitErrors=32]="DeclarationEmitErrors",e[e.EmitErrors=64]="EmitErrors",e[e.AnyErrors=124]="AnyErrors";}(t||(t={})),e.isCircularBuildOrder=u,e.getBuildOrderFromAnyBuildOrder=_,e.createBuilderStatusReporter=d,e.createSolutionBuilderHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=p(t,r,n,i);return o.reportErrorSummary=a,o},e.createSolutionBuilderWithWatchHost=function(t,r,n,i,a){void 0===t&&(t=e.sys);var o=p(t,r,n,i),s=e.createWatchHost(t,a);return e.copyProperties(o,s),o},e.createSolutionBuilder=function(e,t,r){return Z(!1,e,t,r)},e.createSolutionBuilderWithWatch=function(e,t,r,n){return Z(!0,e,t,r,n)},function(e){e[e.Build=0]="Build",e[e.UpdateBundle=1]="UpdateBundle",e[e.UpdateOutputFileStamps=2]="UpdateOutputFileStamps";}(r=e.InvalidatedProjectKind||(e.InvalidatedProjectKind={})),function(e){e[e.CreateProgram=0]="CreateProgram",e[e.SyntaxDiagnostics=1]="SyntaxDiagnostics",e[e.SemanticDiagnostics=2]="SemanticDiagnostics",e[e.Emit=3]="Emit",e[e.EmitBundle=4]="EmitBundle",e[e.EmitBuildInfo=5]="EmitBuildInfo",e[e.BuildInvalidatedProjectOfBundle=6]="BuildInvalidatedProjectOfBundle",e[e.QueueReferencingProjects=7]="QueueReferencingProjects",e[e.Done=8]="Done";}(i||(i={}));}(t),function(e){var t,r;(t=e.server||(e.server={})).ActionSet="action::set",t.ActionInvalidate="action::invalidate",t.ActionPackageInstalled="action::packageInstalled",t.EventTypesRegistry="event::typesRegistry",t.EventBeginInstallTypes="event::beginInstallTypes",t.EventEndInstallTypes="event::endInstallTypes",t.EventInitializationFailed="event::initializationFailed",(r=t.Arguments||(t.Arguments={})).GlobalCacheLocation="--globalTypingsCacheLocation",r.LogFile="--logFile",r.EnableTelemetry="--enableTelemetry",r.TypingSafeListLocation="--typingSafeListLocation",r.TypesMapLocation="--typesMapLocation",r.NpmLocation="--npmLocation",r.ValidateDefaultNpmLocation="--validateDefaultNpmLocation",t.hasArgument=function(t){return e.sys.args.indexOf(t)>=0},t.findArgument=function(t){var r=e.sys.args.indexOf(t);return r>=0&&r<e.sys.args.length-1?e.sys.args[r+1]:void 0},t.nowString=function(){var t=new Date;return "".concat(e.padLeft(t.getHours().toString(),2,"0"),":").concat(e.padLeft(t.getMinutes().toString(),2,"0"),":").concat(e.padLeft(t.getSeconds().toString(),2,"0"),".").concat(e.padLeft(t.getMilliseconds().toString(),3,"0"))};}(t),function(e){!function(t){function r(t,r){return new e.Version(e.getProperty(r,"ts".concat(e.versionMajorMinor))||e.getProperty(r,"latest")).compareTo(t.version)<=0}t.isTypingUpToDate=r;var i,a=["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","https","http2","inspector","module","net","os","path","perf_hooks","process","punycode","querystring","readline","repl","stream","stream/promises","string_decoder","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"];function o(e){return t.nodeCoreModules.has(e)?"node":e}function s(e,t){if(!e)return 1;if(e.length>214)return 2;if(46===e.charCodeAt(0))return 3;if(95===e.charCodeAt(0))return 4;if(t){var r=/^@([^/]+)\/([^/]+)$/.exec(e);if(r){var n=s(r[1],!1);if(0!==n)return {name:r[1],isScopeName:!0,result:n};var i=s(r[2],!1);return 0!==i?{name:r[2],isScopeName:!1,result:i}:0}}return encodeURIComponent(e)!==e?5:0}function c(t,r,n,i){var a=i?"Scope":"Package";switch(r){case 1:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot be empty");case 2:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' should be less than ").concat(214," characters");case 3:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '.'");case 4:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' cannot start with '_'");case 5:return "'".concat(t,"':: ").concat(a," name '").concat(n,"' contains non URI safe characters");case 0:return e.Debug.fail();default:throw e.Debug.assertNever(r)}}t.prefixedNodeCoreModuleList=a.map((function(e){return "node:".concat(e)})),t.nodeCoreModuleList=n$3(n$3([],a,!0),t.prefixedNodeCoreModuleList,!0),t.nodeCoreModules=new e.Set(t.nodeCoreModuleList),t.nonRelativeModuleNameForTypingCache=o,t.loadSafeList=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));return new e.Map(e.getEntries(n.config))},t.loadTypesMap=function(t,r){var n=e.readConfigFile(r,(function(e){return t.readFile(e)}));if(n.config)return new e.Map(e.getEntries(n.config.simpleMap))},t.discoverTypings=function(t,n,i,a,s,c,l,u,_){if(!l||!l.enable)return {cachedTypingPaths:[],newTypingNames:[],filesToWatch:[]};var d=new e.Map;i=e.mapDefined(i,(function(t){var r=e.normalizePath(t);if(e.hasJSFileExtension(r))return r}));var p=[];l.include&&S(l.include,"Explicitly included types");var f=l.exclude||[],g=new e.Set(i.map(e.getDirectoryPath));g.add(a),g.forEach((function(t){T(e.combinePaths(t,"package.json"),p),T(e.combinePaths(t,"bower.json"),p),C(e.combinePaths(t,"bower_components"),p),C(e.combinePaths(t,"node_modules"),p);})),l.disableFilenameBasedTypeAcquisition||function(t){var r=e.mapDefined(t,(function(t){if(e.hasJSFileExtension(t)){var r=e.removeFileExtension(e.getBaseFileName(t.toLowerCase())),n=e.removeMinAndVersionNumbers(r);return s.get(n)}}));r.length&&S(r,"Inferred typings from file names"),e.some(t,(function(t){return e.fileExtensionIs(t,".jsx")}))&&(n&&n("Inferred 'react' typings due to presence of '.jsx' extension"),D("react"));}(i),u&&S(e.deduplicate(u.map(o),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive),"Inferred typings from unresolved imports"),c.forEach((function(e,t){var n=_.get(t);d.has(t)&&void 0===d.get(t)&&void 0!==n&&r(e,n)&&d.set(t,e.typingLocation);}));for(var m=0,y=f;m<y.length;m++){var v=y[m];d.delete(v)&&n&&n("Typing for ".concat(v," is in exclude list, will be ignored."));}var h=[],b=[];d.forEach((function(e,t){void 0!==e?b.push(e):h.push(t);}));var x={cachedTypingPaths:b,newTypingNames:h,filesToWatch:p};return n&&n("Result: ".concat(JSON.stringify(x))),x;function D(e){d.has(e)||d.set(e,void 0);}function S(t,r){n&&n("".concat(r,": ").concat(JSON.stringify(t))),e.forEach(t,D);}function T(r,n){if(t.fileExists(r)){n.push(r);var i=e.readConfigFile(r,(function(e){return t.readFile(e)})).config;S(e.flatMap([i.dependencies,i.devDependencies,i.optionalDependencies,i.peerDependencies],e.getOwnKeys),"Typing names in '".concat(r,"' dependencies"));}}function C(r,i){if(i.push(r),t.directoryExists(r)){var a=t.readDirectory(r,[".json"],void 0,void 0,2);n&&n("Searching for typing names in ".concat(r,"; all files: ").concat(JSON.stringify(a)));for(var o=[],s=0,c=a;s<c.length;s++){var l=c[s],u=e.normalizePath(l),_=e.getBaseFileName(u);if("package.json"===_||"bower.json"===_){var p=e.readConfigFile(u,(function(e){return t.readFile(e)})).config;if(("package.json"!==_||!p._requiredBy||0!==e.filter(p._requiredBy,(function(e){return "#"===e[0]||"/"===e})).length)&&p.name){var f=p.types||p.typings;if(f){var g=e.getNormalizedAbsolutePath(f,e.getDirectoryPath(u));n&&n(" Package '".concat(p.name,"' provides its own types.")),d.set(p.name,g);}else o.push(p.name);}}}S(o," Found package names");}}},(i=t.NameValidationResult||(t.NameValidationResult={}))[i.Ok=0]="Ok",i[i.EmptyName=1]="EmptyName",i[i.NameTooLong=2]="NameTooLong",i[i.NameStartsWithDot=3]="NameStartsWithDot",i[i.NameStartsWithUnderscore=4]="NameStartsWithUnderscore",i[i.NameContainsNonURISafeCharacters=5]="NameContainsNonURISafeCharacters",t.validatePackageName=function(e){return s(e,!0)},t.renderPackageNameValidationFailure=function(e,t){return "object"==typeof e?c(t,e.result,e.name,e.isScopeName):c(t,e,t,!1)};}(e.JsTyping||(e.JsTyping={}));}(t),function(e){var t,r,n,i,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b;function x(e){return {indentSize:4,tabSize:4,newLineCharacter:e||"\n",convertTabsToSpaces:!0,indentStyle:t.Smart,insertSpaceAfterConstructor:!1,insertSpaceAfterCommaDelimiter:!0,insertSpaceAfterSemicolonInForStatements:!0,insertSpaceBeforeAndAfterBinaryOperators:!0,insertSpaceAfterKeywordsInControlFlowStatements:!0,insertSpaceAfterFunctionKeywordForAnonymousFunctions:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:!0,insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:!1,insertSpaceBeforeFunctionParenthesis:!1,placeOpenBraceOnNewLineForFunctions:!1,placeOpenBraceOnNewLineForControlBlocks:!1,semicolons:r.Ignore,trimTrailingWhitespace:!0}}h=e.ScriptSnapshot||(e.ScriptSnapshot={}),b=function(){function e(e){this.text=e;}return e.prototype.getText=function(e,t){return 0===e&&t===this.text.length?this.text:this.text.substring(e,t)},e.prototype.getLength=function(){return this.text.length},e.prototype.getChangeRange=function(){},e}(),h.fromString=function(e){return new b(e)},(v=e.PackageJsonDependencyGroup||(e.PackageJsonDependencyGroup={}))[v.Dependencies=1]="Dependencies",v[v.DevDependencies=2]="DevDependencies",v[v.PeerDependencies=4]="PeerDependencies",v[v.OptionalDependencies=8]="OptionalDependencies",v[v.All=15]="All",(y=e.PackageJsonAutoImportPreference||(e.PackageJsonAutoImportPreference={}))[y.Off=0]="Off",y[y.On=1]="On",y[y.Auto=2]="Auto",(m=e.LanguageServiceMode||(e.LanguageServiceMode={}))[m.Semantic=0]="Semantic",m[m.PartialSemantic=1]="PartialSemantic",m[m.Syntactic=2]="Syntactic",e.emptyOptions={},(g=e.SemanticClassificationFormat||(e.SemanticClassificationFormat={})).Original="original",g.TwentyTwenty="2020",(f=e.CompletionTriggerKind||(e.CompletionTriggerKind={}))[f.Invoked=1]="Invoked",f[f.TriggerCharacter=2]="TriggerCharacter",f[f.TriggerForIncompleteCompletions=3]="TriggerForIncompleteCompletions",(p=e.InlayHintKind||(e.InlayHintKind={})).Type="Type",p.Parameter="Parameter",p.Enum="Enum",(d=e.HighlightSpanKind||(e.HighlightSpanKind={})).none="none",d.definition="definition",d.reference="reference",d.writtenReference="writtenReference",function(e){e[e.None=0]="None",e[e.Block=1]="Block",e[e.Smart=2]="Smart";}(t=e.IndentStyle||(e.IndentStyle={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove";}(r=e.SemicolonPreference||(e.SemicolonPreference={})),e.getDefaultFormatCodeSettings=x,e.testFormatSettings=x("\n"),(_=e.SymbolDisplayPartKind||(e.SymbolDisplayPartKind={}))[_.aliasName=0]="aliasName",_[_.className=1]="className",_[_.enumName=2]="enumName",_[_.fieldName=3]="fieldName",_[_.interfaceName=4]="interfaceName",_[_.keyword=5]="keyword",_[_.lineBreak=6]="lineBreak",_[_.numericLiteral=7]="numericLiteral",_[_.stringLiteral=8]="stringLiteral",_[_.localName=9]="localName",_[_.methodName=10]="methodName",_[_.moduleName=11]="moduleName",_[_.operator=12]="operator",_[_.parameterName=13]="parameterName",_[_.propertyName=14]="propertyName",_[_.punctuation=15]="punctuation",_[_.space=16]="space",_[_.text=17]="text",_[_.typeParameterName=18]="typeParameterName",_[_.enumMemberName=19]="enumMemberName",_[_.functionName=20]="functionName",_[_.regularExpressionLiteral=21]="regularExpressionLiteral",_[_.link=22]="link",_[_.linkName=23]="linkName",_[_.linkText=24]="linkText",(u=e.OutliningSpanKind||(e.OutliningSpanKind={})).Comment="comment",u.Region="region",u.Code="code",u.Imports="imports",(l=e.OutputFileType||(e.OutputFileType={}))[l.JavaScript=0]="JavaScript",l[l.SourceMap=1]="SourceMap",l[l.Declaration=2]="Declaration",(c=e.EndOfLineState||(e.EndOfLineState={}))[c.None=0]="None",c[c.InMultiLineCommentTrivia=1]="InMultiLineCommentTrivia",c[c.InSingleQuoteStringLiteral=2]="InSingleQuoteStringLiteral",c[c.InDoubleQuoteStringLiteral=3]="InDoubleQuoteStringLiteral",c[c.InTemplateHeadOrNoSubstitutionTemplate=4]="InTemplateHeadOrNoSubstitutionTemplate",c[c.InTemplateMiddleOrTail=5]="InTemplateMiddleOrTail",c[c.InTemplateSubstitutionPosition=6]="InTemplateSubstitutionPosition",(s=e.TokenClass||(e.TokenClass={}))[s.Punctuation=0]="Punctuation",s[s.Keyword=1]="Keyword",s[s.Operator=2]="Operator",s[s.Comment=3]="Comment",s[s.Whitespace=4]="Whitespace",s[s.Identifier=5]="Identifier",s[s.NumberLiteral=6]="NumberLiteral",s[s.BigIntLiteral=7]="BigIntLiteral",s[s.StringLiteral=8]="StringLiteral",s[s.RegExpLiteral=9]="RegExpLiteral",(o=e.ScriptElementKind||(e.ScriptElementKind={})).unknown="",o.warning="warning",o.keyword="keyword",o.scriptElement="script",o.moduleElement="module",o.classElement="class",o.localClassElement="local class",o.interfaceElement="interface",o.typeElement="type",o.enumElement="enum",o.enumMemberElement="enum member",o.variableElement="var",o.localVariableElement="local var",o.functionElement="function",o.localFunctionElement="local function",o.memberFunctionElement="method",o.memberGetAccessorElement="getter",o.memberSetAccessorElement="setter",o.memberVariableElement="property",o.constructorImplementationElement="constructor",o.callSignatureElement="call",o.indexSignatureElement="index",o.constructSignatureElement="construct",o.parameterElement="parameter",o.typeParameterElement="type parameter",o.primitiveType="primitive type",o.label="label",o.alias="alias",o.constElement="const",o.letElement="let",o.directory="directory",o.externalModuleName="external module name",o.jsxAttribute="JSX attribute",o.string="string",o.link="link",o.linkName="link name",o.linkText="link text",(a=e.ScriptElementKindModifier||(e.ScriptElementKindModifier={})).none="",a.publicMemberModifier="public",a.privateMemberModifier="private",a.protectedMemberModifier="protected",a.exportedModifier="export",a.ambientModifier="declare",a.staticModifier="static",a.abstractModifier="abstract",a.optionalModifier="optional",a.deprecatedModifier="deprecated",a.dtsModifier=".d.ts",a.tsModifier=".ts",a.tsxModifier=".tsx",a.jsModifier=".js",a.jsxModifier=".jsx",a.jsonModifier=".json",a.dmtsModifier=".d.mts",a.mtsModifier=".mts",a.mjsModifier=".mjs",a.dctsModifier=".d.cts",a.ctsModifier=".cts",a.cjsModifier=".cjs",(i=e.ClassificationTypeNames||(e.ClassificationTypeNames={})).comment="comment",i.identifier="identifier",i.keyword="keyword",i.numericLiteral="number",i.bigintLiteral="bigint",i.operator="operator",i.stringLiteral="string",i.whiteSpace="whitespace",i.text="text",i.punctuation="punctuation",i.className="class name",i.enumName="enum name",i.interfaceName="interface name",i.moduleName="module name",i.typeParameterName="type parameter name",i.typeAliasName="type alias name",i.parameterName="parameter name",i.docCommentTagName="doc comment tag name",i.jsxOpenTagName="jsx open tag name",i.jsxCloseTagName="jsx close tag name",i.jsxSelfClosingTagName="jsx self closing tag name",i.jsxAttribute="jsx attribute",i.jsxText="jsx text",i.jsxAttributeStringLiteralValue="jsx attribute string literal value",(n=e.ClassificationType||(e.ClassificationType={}))[n.comment=1]="comment",n[n.identifier=2]="identifier",n[n.keyword=3]="keyword",n[n.numericLiteral=4]="numericLiteral",n[n.operator=5]="operator",n[n.stringLiteral=6]="stringLiteral",n[n.regularExpressionLiteral=7]="regularExpressionLiteral",n[n.whiteSpace=8]="whiteSpace",n[n.text=9]="text",n[n.punctuation=10]="punctuation",n[n.className=11]="className",n[n.enumName=12]="enumName",n[n.interfaceName=13]="interfaceName",n[n.moduleName=14]="moduleName",n[n.typeParameterName=15]="typeParameterName",n[n.typeAliasName=16]="typeAliasName",n[n.parameterName=17]="parameterName",n[n.docCommentTagName=18]="docCommentTagName",n[n.jsxOpenTagName=19]="jsxOpenTagName",n[n.jsxCloseTagName=20]="jsxCloseTagName",n[n.jsxSelfClosingTagName=21]="jsxSelfClosingTagName",n[n.jsxAttribute=22]="jsxAttribute",n[n.jsxText=23]="jsxText",n[n.jsxAttributeStringLiteralValue=24]="jsxAttributeStringLiteralValue",n[n.bigintLiteral=25]="bigintLiteral";}(t),function(e){function t(t){switch(t.kind){case 253:return e.isInJSFile(t)&&e.getJSDocEnumTag(t)?7:1;case 163:case 202:case 166:case 165:case 294:case 295:case 168:case 167:case 170:case 171:case 172:case 255:case 212:case 213:case 291:case 284:return 1;case 162:case 257:case 258:case 181:return 2;case 343:return void 0===t.name?3:2;case 297:case 256:return 3;case 260:return e.isAmbientModule(t)||1===e.getModuleInstanceState(t)?5:4;case 259:case 268:case 269:case 264:case 265:case 270:case 271:return 7;case 303:return 5}return 7}function r(t){for(;160===t.parent.kind;)t=t.parent;return e.isInternalModuleImportEqualsDeclaration(t.parent)&&t.parent.moduleReference===t}function n(e){return e.expression}function a(e){return e.tag}function o(e){return e.tagName}function s(t,r,n,i,a){var o=i?l(t):c(t);return a&&(o=e.skipOuterExpressions(o)),!!o&&!!o.parent&&r(o.parent)&&n(o.parent)===o}function c(e){return d(e)?e.parent:e}function l(e){return d(e)||p(e)?e.parent:e}function u(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isBreakOrContinueStatement))||void 0===r?void 0:r.label)===t}function _(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isLabeledStatement))||void 0===r?void 0:r.label)===t}function d(t){var r;return (null===(r=e.tryCast(t.parent,e.isPropertyAccessExpression))||void 0===r?void 0:r.name)===t}function p(t){var r;return (null===(r=e.tryCast(t.parent,e.isElementAccessExpression))||void 0===r?void 0:r.argumentExpression)===t}var f;e.scanner=e.createScanner(99,!0),(f=e.SemanticMeaning||(e.SemanticMeaning={}))[f.None=0]="None",f[f.Value=1]="Value",f[f.Type=2]="Type",f[f.Namespace=4]="Namespace",f[f.All=7]="All",e.getMeaningFromDeclaration=t,e.getMeaningFromLocation=function(n){var i=(n=w(n)).parent;if(303===n.kind)return 1;if(e.isExportAssignment(i)||e.isExportSpecifier(i)||e.isExternalModuleReference(i)||e.isImportSpecifier(i)||e.isImportClause(i)||e.isImportEqualsDeclaration(i)&&n===i.name){for(var a=i;a;){if(e.isImportEqualsDeclaration(a)||e.isImportClause(a)||e.isExportDeclaration(a))return a.isTypeOnly?2:7;a=a.parent;}return 7}return r(n)?function(t){var r=160===t.kind?t:e.isQualifiedName(t.parent)&&t.parent.right===t?t.parent:void 0;return r&&264===r.parent.kind?7:4}(n):e.isDeclarationName(n)?t(i):e.isEntityName(n)&&e.findAncestor(n,e.or(e.isJSDocNameReference,e.isJSDocLinkLike,e.isJSDocMemberName))?7:function(t){switch(e.isRightSideOfQualifiedNameOrPropertyAccess(t)&&(t=t.parent),t.kind){case 108:return !e.isExpressionNode(t);case 191:return !0}switch(t.parent.kind){case 177:return !0;case 199:return !t.parent.isTypeOf;case 227:return !e.isExpressionWithTypeArgumentsInClassExtendsClause(t.parent)}return !1}(n)?2:function(e){return function(e){var t=e,r=!0;if(160===t.parent.kind){for(;t.parent&&160===t.parent.kind;)t=t.parent;r=t.right===e;}return 177===t.parent.kind&&!r}(e)||function(e){var t=e,r=!0;if(205===t.parent.kind){for(;t.parent&&205===t.parent.kind;)t=t.parent;r=t.name===e;}if(!r&&227===t.parent.kind&&290===t.parent.parent.kind){var n=t.parent.parent.parent;return 256===n.kind&&117===t.parent.parent.token||257===n.kind&&94===t.parent.parent.token}return !1}(e)}(n)?4:e.isTypeParameterDeclaration(i)?(e.Debug.assert(e.isJSDocTemplateTag(i.parent)),2):e.isLiteralTypeNode(i)?3:1},e.isInRightSideOfInternalImportEqualsDeclaration=r,e.isCallExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallExpression,n,r,i)},e.isNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isNewExpression,n,r,i)},e.isCallOrNewExpressionTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isCallOrNewExpression,n,r,i)},e.isTaggedTemplateTag=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isTaggedTemplateExpression,a,r,n)},e.isDecoratorTarget=function(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),s(t,e.isDecorator,n,r,i)},e.isJsxOpeningLikeElementTagName=function(t,r,n){return void 0===r&&(r=!1),void 0===n&&(n=!1),s(t,e.isJsxOpeningLikeElement,o,r,n)},e.climbPastPropertyAccess=c,e.climbPastPropertyOrElementAccess=l,e.getTargetLabel=function(e,t){for(;e;){if(249===e.kind&&e.label.escapedText===t)return e.label;e=e.parent;}},e.hasPropertyAccessExpressionWithName=function(t,r){return !!e.isPropertyAccessExpression(t.expression)&&t.expression.name.text===r},e.isJumpStatementTarget=u,e.isLabelOfLabeledStatement=_,e.isLabelName=function(e){return _(e)||u(e)},e.isTagName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isJSDocTag))||void 0===r?void 0:r.tagName)===t},e.isRightSideOfQualifiedName=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isQualifiedName))||void 0===r?void 0:r.right)===t},e.isRightSideOfPropertyAccess=d,e.isArgumentExpressionOfElementAccess=p,e.isNameOfModuleDeclaration=function(t){var r;return (null===(r=e.tryCast(t.parent,e.isModuleDeclaration))||void 0===r?void 0:r.name)===t},e.isNameOfFunctionDeclaration=function(t){var r;return e.isIdentifier(t)&&(null===(r=e.tryCast(t.parent,e.isFunctionLike))||void 0===r?void 0:r.name)===t},e.isLiteralNameOfPropertyDeclarationOrIndexAccess=function(t){switch(t.parent.kind){case 166:case 165:case 294:case 297:case 168:case 167:case 171:case 172:case 260:return e.getNameOfDeclaration(t.parent)===t;case 206:return t.parent.argumentExpression===t;case 161:return !0;case 195:return 193===t.parent.parent.kind;default:return !1}},e.isExpressionOfExternalModuleImportEqualsDeclaration=function(t){return e.isExternalModuleImportEqualsDeclaration(t.parent.parent)&&e.getExternalModuleImportEqualsDeclarationExpression(t.parent.parent)===t},e.getContainerNode=function(t){for(e.isJSDocTypeAlias(t)&&(t=t.parent.parent);;){if(!(t=t.parent))return;switch(t.kind){case 303:case 168:case 167:case 255:case 212:case 171:case 172:case 256:case 257:case 259:case 260:return t}}},e.getNodeKind=function t(r){switch(r.kind){case 303:return e.isExternalModule(r)?"module":"script";case 260:return "module";case 256:case 225:return "class";case 257:return "interface";case 258:case 336:case 343:return "type";case 259:return "enum";case 253:return c(r);case 202:return c(e.getRootDeclaration(r));case 213:case 255:case 212:return "function";case 171:return "getter";case 172:return "setter";case 168:case 167:return "method";case 294:var n=r.initializer;return e.isFunctionLike(n)?"method":"property";case 166:case 165:case 295:case 296:return "property";case 175:return "index";case 174:return "construct";case 173:return "call";case 170:case 169:return "constructor";case 162:return "type parameter";case 297:return "enum member";case 163:return e.hasSyntacticModifier(r,16476)?"property":"parameter";case 264:case 269:case 274:case 267:case 273:return "alias";case 220:var i=e.getAssignmentDeclarationKind(r),a=r.right;switch(i){case 7:case 8:case 9:case 0:return "";case 1:case 2:var o=t(a);return ""===o?"const":o;case 3:return e.isFunctionExpression(a)?"method":"property";case 4:return "property";case 5:return e.isFunctionExpression(a)?"method":"property";case 6:return "local class";default:return e.assertType(i),""}case 79:return e.isImportClause(r.parent)?"alias":"";case 270:var s=t(r.expression);return ""===s?"const":s;default:return ""}function c(t){return e.isVarConst(t)?"const":e.isLet(t)?"let":"var"}},e.isThis=function(t){switch(t.kind){case 108:return !0;case 79:return e.identifierIsThisKeyword(t)&&163===t.parent.kind;default:return !1}};var g,m=/^\/\/\/\s*</;function y(e,t){return h(e.pos,e.end,t)}function v(e,t){return e.pos<t&&t<e.end}function h(e,t,r){return e<=r.pos&&t>=r.end}function b(e,t,r,n){return Math.max(e,r)<Math.min(t,n)}function x(t,r){if(void 0===t||e.nodeIsMissing(t))return !1;switch(t.kind){case 256:case 257:case 259:case 204:case 200:case 181:case 234:case 261:case 262:case 268:case 272:return D(t,19,r);case 291:return x(t.block,r);case 208:if(!t.arguments)return !0;case 207:case 211:case 190:return D(t,21,r);case 178:case 179:return x(t.type,r);case 170:case 171:case 172:case 255:case 212:case 168:case 167:case 174:case 173:case 213:return t.body?x(t.body,r):t.type?x(t.type,r):S(t,21,r);case 260:return !!t.body&&x(t.body,r);case 238:return t.elseStatement?x(t.elseStatement,r):x(t.thenStatement,r);case 237:return x(t.expression,r)||S(t,26,r);case 203:case 201:case 206:case 161:case 183:return D(t,23,r);case 175:return t.type?x(t.type,r):S(t,23,r);case 288:case 289:return !1;case 241:case 242:case 243:case 240:return x(t.statement,r);case 239:return S(t,115,r)?D(t,21,r):x(t.statement,r);case 180:return x(t.exprName,r);case 215:case 214:case 216:case 223:case 224:return x(t.expression,r);case 209:return x(t.template,r);case 222:return x(e.lastOrUndefined(t.templateSpans),r);case 232:return e.nodeIsPresent(t.literal);case 271:case 265:return e.nodeIsPresent(t.moduleSpecifier);case 218:return x(t.operand,r);case 220:return x(t.right,r);case 221:return x(t.whenFalse,r);default:return !0}}function D(t,r,n){var i=t.getChildren(n);if(i.length){var a=e.last(i);if(a.kind===r)return !0;if(26===a.kind&&1!==i.length)return i[i.length-2].kind===r}return !1}function S(e,t,r){return !!T(e,t,r)}function T(t,r,n){return e.find(t.getChildren(n),(function(e){return e.kind===r}))}function C(t){var r=e.find(t.parent.getChildren(),(function(r){return e.isSyntaxList(r)&&y(r,t)}));return e.Debug.assert(!r||e.contains(r.getChildren(),t)),r}function E(e){return 88===e.kind}function k(e){return 84===e.kind}function N(e){return 98===e.kind}function F(t,r){if(t.importClause){if(t.importClause.name&&t.importClause.namedBindings)return;if(t.importClause.name)return t.importClause.name;if(t.importClause.namedBindings){if(e.isNamedImports(t.importClause.namedBindings)){var n=e.singleOrUndefined(t.importClause.namedBindings.elements);if(!n)return;return n.name}if(e.isNamespaceImport(t.importClause.namedBindings))return t.importClause.namedBindings.name}}if(!r)return t.moduleSpecifier}function A(t,r){if(t.exportClause){if(e.isNamedExports(t.exportClause)){if(!e.singleOrUndefined(t.exportClause.elements))return;return t.exportClause.elements[0].name}if(e.isNamespaceExport(t.exportClause))return t.exportClause.name}if(!r)return t.moduleSpecifier}function P(t,r){var n=t.parent;if((e.isModifier(t)&&(r||88!==t.kind)?e.contains(n.modifiers,t):84===t.kind?e.isClassDeclaration(n)||e.isClassExpression(t):98===t.kind?e.isFunctionDeclaration(n)||e.isFunctionExpression(t):118===t.kind?e.isInterfaceDeclaration(n):92===t.kind?e.isEnumDeclaration(n):151===t.kind?e.isTypeAliasDeclaration(n):142===t.kind||141===t.kind?e.isModuleDeclaration(n):100===t.kind?e.isImportEqualsDeclaration(n):136===t.kind?e.isGetAccessorDeclaration(n):148===t.kind&&e.isSetAccessorDeclaration(n))&&(a=function(t,r){if(!r)switch(t.kind){case 256:case 225:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isClassDeclaration(t)){var r=t.modifiers&&e.find(t.modifiers,E);if(r)return r}if(e.isClassExpression(t)){var n=e.find(t.getChildren(),k);if(n)return n}}(t);case 255:case 212:return function(t){if(e.isNamedDeclaration(t))return t.name;if(e.isFunctionDeclaration(t)){var r=e.find(t.modifiers,E);if(r)return r}if(e.isFunctionExpression(t)){var n=e.find(t.getChildren(),N);if(n)return n}}(t)}if(e.isNamedDeclaration(t))return t.name}(n,r)))return a;if((113===t.kind||85===t.kind||119===t.kind)&&e.isVariableDeclarationList(n)&&1===n.declarations.length){var i=n.declarations[0];if(e.isIdentifier(i.name))return i.name}if(151===t.kind){if(e.isImportClause(n)&&n.isTypeOnly&&(a=F(n.parent,r)))return a;if(e.isExportDeclaration(n)&&n.isTypeOnly&&(a=A(n,r)))return a}if(127===t.kind){if(e.isImportSpecifier(n)&&n.propertyName||e.isExportSpecifier(n)&&n.propertyName||e.isNamespaceImport(n)||e.isNamespaceExport(n))return n.name;if(e.isExportDeclaration(n)&&n.exportClause&&e.isNamespaceExport(n.exportClause))return n.exportClause.name}if(100===t.kind&&e.isImportDeclaration(n)&&(a=F(n,r)))return a;if(93===t.kind){var a;if(e.isExportDeclaration(n)&&(a=A(n,r)))return a;if(e.isExportAssignment(n))return e.skipOuterExpressions(n.expression)}if(145===t.kind&&e.isExternalModuleReference(n))return n.expression;if(155===t.kind&&(e.isImportDeclaration(n)||e.isExportDeclaration(n))&&n.moduleSpecifier)return n.moduleSpecifier;if((94===t.kind||117===t.kind)&&e.isHeritageClause(n)&&n.token===t.kind&&(a=function(e){if(1===e.types.length)return e.types[0].expression}(n)))return a;if(94===t.kind){if(e.isTypeParameterDeclaration(n)&&n.constraint&&e.isTypeReferenceNode(n.constraint))return n.constraint.typeName;if(e.isConditionalTypeNode(n)&&e.isTypeReferenceNode(n.extendsType))return n.extendsType.typeName}if(137===t.kind&&e.isInferTypeNode(n))return n.typeParameter.name;if(101===t.kind&&e.isTypeParameterDeclaration(n)&&e.isMappedTypeNode(n.parent))return n.name;if(140===t.kind&&e.isTypeOperatorNode(n)&&140===n.operator&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(144===t.kind&&e.isTypeOperatorNode(n)&&144===n.operator&&e.isArrayTypeNode(n.type)&&e.isTypeReferenceNode(n.type.elementType))return n.type.elementType.typeName;if(!r){if((103===t.kind&&e.isNewExpression(n)||114===t.kind&&e.isVoidExpression(n)||112===t.kind&&e.isTypeOfExpression(n)||132===t.kind&&e.isAwaitExpression(n)||125===t.kind&&e.isYieldExpression(n)||89===t.kind&&e.isDeleteExpression(n))&&n.expression)return e.skipOuterExpressions(n.expression);if((101===t.kind||102===t.kind)&&e.isBinaryExpression(n)&&n.operatorToken===t)return e.skipOuterExpressions(n.right);if(127===t.kind&&e.isAsExpression(n)&&e.isTypeReferenceNode(n.type))return n.type.typeName;if(101===t.kind&&e.isForInStatement(n)||159===t.kind&&e.isForOfStatement(n))return e.skipOuterExpressions(n.expression)}return t}function w(e){return P(e,!1)}function I(e,t,r){return M(e,t,!1,r,!1)}function O(e,t){return M(e,t,!0,void 0,!1)}function M(t,r,n,i,a){var o,s=t,c=function(){var a=s.getChildren(t),c=e.binarySearchKey(a,r,(function(e,t){return t}),(function(e,o){var s=n?a[e].getFullStart():a[e].getStart(t,!0);return s>r?1:u(a[e])?a[e-1]&&u(a[e-1])?1:0:i&&s===r&&a[e-1]&&a[e-1].getEnd()===r&&u(a[e-1])?1:-1}));return o?{value:o}:c>=0&&a[c]?(s=a[c],"continue-outer"):{value:s}};e:for(;;){var l=c();if("object"==typeof l)return l.value;switch(l){case"continue-outer":continue e}}function u(e){if((n?e.getFullStart():e.getStart(t,!0))>r)return !1;var s=e.getEnd();if(r<s||r===s&&(1===e.kind||a))return !0;if(i&&s===r){var c=R(r,t,e);if(c&&i(c))return o=c,!0}return !1}}function L(t,r,n){return function r(i){return e.isToken(i)&&i.pos===t.end?i:e.firstDefined(i.getChildren(n),(function(e){return (e.pos<=t.pos&&e.end>t.end||e.pos===t.end)&&H(e,n)?r(e):void 0}))}(r)}function R(t,r,n,i){var a=function a(o){if(B(o)&&1!==o.kind)return o;var s=o.getChildren(r),c=e.binarySearchKey(s,t,(function(e,t){return t}),(function(e,r){return t<s[e].end?!s[e-1]||t>=s[e-1].end?0:1:-1}));if(c>=0&&s[c]){var l=s[c];if(t<l.end){if(l.getStart(r,!i)>=t||!H(l,r)||z(l)){var u=J(s,c,r);return u&&j(u,r)}return a(l)}}e.Debug.assert(void 0!==n||303===o.kind||1===o.kind||e.isJSDocCommentContainingNode(o));var _=J(s,s.length,r);return _&&j(_,r)}(n||r);return e.Debug.assert(!(a&&z(a))),a}function B(t){return e.isToken(t)&&!z(t)}function j(e,t){if(B(e))return e;var r=e.getChildren(t);if(0===r.length)return e;var n=J(r,r.length,t);return n&&j(n,t)}function J(t,r,n){for(var i=r-1;i>=0;i--)if(z(t[i]))e.Debug.assert(i>0,"`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`");else if(H(t[i],n))return t[i]}function z(t){return e.isJsxText(t)&&t.containsOnlyTriviaWhiteSpaces}function U(t,r,n){var i=e.tokenToString(t.kind),a=e.tokenToString(r),o=t.getFullStart(),s=n.text.lastIndexOf(a,o);if(-1!==s){if(n.text.lastIndexOf(i,o-1)<s){var c=R(s+1,n);if(c&&c.kind===r)return c}for(var l=t.kind,u=0;;){var _=R(t.getFullStart(),n);if(!_)return;if((t=_).kind===r){if(0===u)return t;u--;}else t.kind===l&&u++;}}}function K(e,t,r){return t?e.getNonNullableType():r?e.getNonOptionalType():e}function V(t,r,n){var i=n.getTypeAtLocation(t);return e.isOptionalChain(t.parent)&&(i=K(i,e.isOptionalChainRoot(t.parent),!0)),(e.isNewExpression(t.parent)?i.getConstructSignatures():i.getCallSignatures()).filter((function(e){return !!e.typeParameters&&e.typeParameters.length>=r}))}function q(t,r){if(-1!==r.text.lastIndexOf("<",t?t.pos:r.text.length))for(var n=t,i=0,a=0;n;){switch(n.kind){case 29:if((n=R(n.getFullStart(),r))&&28===n.kind&&(n=R(n.getFullStart(),r)),!n||!e.isIdentifier(n))return;if(!i)return e.isDeclarationName(n)?void 0:{called:n,nTypeArguments:a};i--;break;case 49:i=3;break;case 48:i=2;break;case 31:i++;break;case 19:if(!(n=U(n,18,r)))return;break;case 21:if(!(n=U(n,20,r)))return;break;case 23:if(!(n=U(n,22,r)))return;break;case 27:a++;break;case 38:case 79:case 10:case 8:case 9:case 110:case 95:case 112:case 94:case 140:case 24:case 51:case 57:case 58:break;default:if(e.isTypeNode(n))break;return}n=R(n.getFullStart(),r);}}function W(t,r,n){return e.formatting.getRangeOfEnclosingComment(t,r,void 0,n)}function H(e,t){return 1===e.kind?!!e.jsDoc:0!==e.getWidth(t)}function G(e,t,r){var n=W(e,t,void 0);return !!n&&r===m.test(e.text.substring(n.pos,n.end))}function Q(t,r,n){return e.createTextSpanFromBounds(t.getStart(r),(n||t).getEnd())}function X(t){if(!t.isUnterminated)return e.createTextSpanFromBounds(t.getStart()+1,t.getEnd()-1)}function Y(e,t){return {span:e,newText:t}}function Z(e){return 151===e.kind}function $(t,r){return {fileExists:function(e){return t.fileExists(e)},getCurrentDirectory:function(){return r.getCurrentDirectory()},readFile:e.maybeBind(r,r.readFile),useCaseSensitiveFileNames:e.maybeBind(r,r.useCaseSensitiveFileNames),getSymlinkCache:e.maybeBind(r,r.getSymlinkCache)||t.getSymlinkCache,getModuleSpecifierCache:e.maybeBind(r,r.getModuleSpecifierCache),getGlobalTypingsCacheLocation:e.maybeBind(r,r.getGlobalTypingsCacheLocation),redirectTargetsMap:t.redirectTargetsMap,getProjectReferenceRedirect:function(e){return t.getProjectReferenceRedirect(e)},isSourceOfProjectReferenceRedirect:function(e){return t.isSourceOfProjectReferenceRedirect(e)},getNearestAncestorDirectoryWithPackageJson:e.maybeBind(r,r.getNearestAncestorDirectoryWithPackageJson),getFileIncludeReasons:function(){return t.getFileIncludeReasons()}}}function ee(e,t){return i$1(i$1({},$(e,t)),{getCommonSourceDirectory:function(){return e.getCommonSourceDirectory()}})}function te(t,r,n,i,a){return e.factory.createImportDeclaration(void 0,void 0,t||r?e.factory.createImportClause(!!a,t,r&&r.length?e.factory.createNamedImports(r):void 0):void 0,"string"==typeof n?re(n,i):n,void 0)}function re(t,r){return e.factory.createStringLiteral(t,0===r)}function ne(t,r){return e.isStringDoubleQuoted(t,r)?1:0}function ie(t,r){if(r.quotePreference&&"auto"!==r.quotePreference)return "single"===r.quotePreference?0:1;var n=t.imports&&e.find(t.imports,(function(t){return e.isStringLiteral(t)&&!e.nodeIsSynthesized(t.parent)}));return n?ne(n,t):1}function ae(t){return "default"!==t.escapedName?t.escapedName:e.firstDefined(t.declarations,(function(t){var r=e.getNameOfDeclaration(t);return r&&79===r.kind?r.escapedText:void 0}))}function oe(t,r,n){return e.textSpanContainsPosition(t,r.getStart(n))&&r.getEnd()<=e.textSpanEnd(t)}function se(e,t){return !!e&&!!t&&e.start===t.start&&e.length===t.length}function ce(t){var r=t.declarations?e.firstOrUndefined(t.declarations):void 0;return !!e.findAncestor(r,(function(t){return !!e.isParameter(t)||!(e.isBindingElement(t)||e.isObjectBindingPattern(t)||e.isArrayBindingPattern(t))&&"quit"}))}e.getLineStartPositionForPosition=function(t,r){return e.getLineStarts(r)[r.getLineAndCharacterOfPosition(t).line]},e.rangeContainsRange=y,e.rangeContainsRangeExclusive=function(e,t){return v(e,t.pos)&&v(e,t.end)},e.rangeContainsPosition=function(e,t){return e.pos<=t&&t<=e.end},e.rangeContainsPositionExclusive=v,e.startEndContainsRange=h,e.rangeContainsStartEnd=function(e,t,r){return e.pos<=t&&e.end>=r},e.rangeOverlapsWithStartEnd=function(e,t,r){return b(e.pos,e.end,t,r)},e.nodeOverlapsWithStartEnd=function(e,t,r,n){return b(e.getStart(t),e.end,r,n)},e.startEndOverlapsWithStartEnd=b,e.positionBelongsToNode=function(t,r,n){return e.Debug.assert(t.pos<=r),r<t.end||!x(t,n)},e.findListItemInfo=function(t){var r=C(t);if(r){var n=r.getChildren();return {listItemIndex:e.indexOfNode(n,t),list:r}}},e.hasChildOfKind=S,e.findChildOfKind=T,e.findContainingList=C,e.getContextualTypeFromParentOrAncestorTypeNode=function(t,r){var n=Le(t,r);if(n)return n;var i=function(t){var r;return e.findAncestor(t,(function(t){return e.isTypeNode(t)&&(r=t),!e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),r}(t);return i&&r.getTypeAtLocation(i)},e.getAdjustedReferenceLocation=w,e.getAdjustedRenameLocation=function(e){return P(e,!0)},e.getTouchingPropertyName=function(t,r){return I(t,r,(function(t){return e.isPropertyNameLiteral(t)||e.isKeyword(t.kind)||e.isPrivateIdentifier(t)}))},e.getTouchingToken=I,e.getTokenAtPosition=O,e.findFirstNonJsxWhitespaceToken=function(e,t){for(var r=O(e,t);z(r);){var n=L(r,r.parent,e);if(!n)return;r=n;}return r},e.findTokenOnLeftOfPosition=function(t,r){var n=O(t,r);return e.isToken(n)&&r>n.getStart(t)&&r<n.getEnd()?n:R(r,t)},e.findNextToken=L,e.findPrecedingToken=R,e.isInString=function(t,r,n){if(void 0===n&&(n=R(r,t)),n&&e.isStringTextContainingNode(n)){var i=n.getStart(t),a=n.getEnd();if(i<r&&r<a)return !0;if(r===a)return !!n.isUnterminated}return !1},e.isInsideJsxElementOrAttribute=function(e,t){var r=O(e,t);return !!r&&(11===r.kind||29===r.kind&&11===r.parent.kind||29===r.kind&&287===r.parent.kind||!(!r||19!==r.kind||287!==r.parent.kind)||29===r.kind&&280===r.parent.kind)},e.isInTemplateString=function(t,r){var n=O(t,r);return e.isTemplateLiteralKind(n.kind)&&r>n.getStart(t)},e.isInJSXText=function(t,r){var n=O(t,r);return !!e.isJsxText(n)||!(18!==n.kind||!e.isJsxExpression(n.parent)||!e.isJsxElement(n.parent.parent))||!(29!==n.kind||!e.isJsxOpeningLikeElement(n.parent)||!e.isJsxElement(n.parent.parent))},e.isInsideJsxElement=function(e,t){return function(r){for(;r;)if(r.kind>=278&&r.kind<=287||11===r.kind||29===r.kind||31===r.kind||79===r.kind||19===r.kind||18===r.kind||43===r.kind)r=r.parent;else {if(277!==r.kind)return !1;if(t>r.getStart(e))return !0;r=r.parent;}return !1}(O(e,t))},e.findPrecedingMatchingToken=U,e.removeOptionality=K,e.isPossiblyTypeArgumentPosition=function t(r,n,i){var a=q(r,n);return void 0!==a&&(e.isPartOfTypeNode(a.called)||0!==V(a.called,a.nTypeArguments,i).length||t(a.called,n,i))},e.getPossibleGenericSignatures=V,e.getPossibleTypeArgumentsInfo=q,e.isInComment=W,e.hasDocComment=function(t,r){var n=O(t,r);return !!e.findAncestor(n,e.isJSDoc)},e.getNodeModifiers=function(t,r){void 0===r&&(r=0);var n=[],i=e.isDeclaration(t)?e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t)&~r:0;return 8&i&&n.push("private"),16&i&&n.push("protected"),4&i&&n.push("public"),(32&i||e.isClassStaticBlockDeclaration(t))&&n.push("static"),128&i&&n.push("abstract"),1&i&&n.push("export"),8192&i&&n.push("deprecated"),8388608&t.flags&&n.push("declare"),270===t.kind&&n.push("export"),n.length>0?n.join(","):""},e.getTypeArgumentOrTypeParameterList=function(t){return 177===t.kind||207===t.kind?t.typeArguments:e.isFunctionLike(t)||256===t.kind||257===t.kind?t.typeParameters:void 0},e.isComment=function(e){return 2===e||3===e},e.isStringOrRegularExpressionOrTemplateLiteral=function(t){return !(10!==t&&13!==t&&!e.isTemplateLiteralKind(t))},e.isPunctuation=function(e){return 18<=e&&e<=78},e.isInsideTemplateLiteral=function(t,r,n){return e.isTemplateLiteralKind(t.kind)&&t.getStart(n)<r&&r<t.end||!!t.isUnterminated&&r===t.end},e.isAccessibilityModifier=function(e){switch(e){case 123:case 121:case 122:return !0}return !1},e.cloneCompilerOptions=function(t){var r=e.clone(t);return e.setConfigFileInOptions(r,t&&t.configFile),r},e.isArrayLiteralOrObjectLiteralDestructuringPattern=function e(t){if(203===t.kind||204===t.kind){if(220===t.parent.kind&&t.parent.left===t&&63===t.parent.operatorToken.kind)return !0;if(243===t.parent.kind&&t.parent.initializer===t)return !0;if(e(294===t.parent.kind?t.parent.parent:t.parent))return !0}return !1},e.isInReferenceComment=function(e,t){return G(e,t,!0)},e.isInNonReferenceComment=function(e,t){return G(e,t,!1)},e.getReplacementSpanForContextToken=function(e){if(e)switch(e.kind){case 10:case 14:return X(e);default:return Q(e)}},e.createTextSpanFromNode=Q,e.createTextSpanFromStringLiteralLikeContent=X,e.createTextRangeFromNode=function(t,r){return e.createRange(t.getStart(r),t.end)},e.createTextSpanFromRange=function(t){return e.createTextSpanFromBounds(t.pos,t.end)},e.createTextRangeFromSpan=function(t){return e.createRange(t.start,t.start+t.length)},e.createTextChangeFromStartLength=function(t,r,n){return Y(e.createTextSpan(t,r),n)},e.createTextChange=Y,e.typeKeywords=[130,128,157,133,95,137,140,143,104,146,147,144,149,150,110,114,152,153,154],e.isTypeKeyword=function(t){return e.contains(e.typeKeywords,t)},e.isTypeKeywordToken=Z,e.isTypeKeywordTokenOrIdentifier=function(t){return Z(t)||e.isIdentifier(t)&&"type"===t.text},e.isExternalModuleSymbol=function(e){return !!(1536&e.flags)&&34===e.name.charCodeAt(0)},e.nodeSeenTracker=function(){var t=[];return function(r){var n=e.getNodeId(r);return !t[n]&&(t[n]=!0)}},e.getSnapshotText=function(e){return e.getText(0,e.getLength())},e.repeatString=function(e,t){for(var r="",n=0;n<t;n++)r+=e;return r},e.skipConstraint=function(e){return e.isTypeParameter()&&e.getConstraint()||e},e.getNameFromPropertyName=function(t){return 161===t.kind?e.isStringOrNumericLiteralLike(t.expression)?t.expression.text:void 0:e.isPrivateIdentifier(t)?e.idText(t):e.getTextOfIdentifierOrLiteral(t)},e.programContainsModules=function(e){return e.getSourceFiles().some((function(t){return !(t.isDeclarationFile||e.isSourceFileFromExternalLibrary(t)||!t.externalModuleIndicator&&!t.commonJsModuleIndicator)}))},e.programContainsEsModules=function(e){return e.getSourceFiles().some((function(t){return !t.isDeclarationFile&&!e.isSourceFileFromExternalLibrary(t)&&!!t.externalModuleIndicator}))},e.compilerOptionsIndicateEsModules=function(t){return !!t.module||e.getEmitScriptTarget(t)>=2||!!t.noEmit},e.createModuleSpecifierResolutionHost=$,e.getModuleSpecifierResolverHost=ee,e.makeImportIfNecessary=function(e,t,r,n){return e||t&&t.length?te(e,t,r,n):void 0},e.makeImport=te,e.makeStringLiteral=re,(g=e.QuotePreference||(e.QuotePreference={}))[g.Single=0]="Single",g[g.Double=1]="Double",e.quotePreferenceFromString=ne,e.getQuotePreference=ie,e.getQuoteFromPreference=function(t){switch(t){case 0:return "'";case 1:return '"';default:return e.Debug.assertNever(t)}},e.symbolNameNoDefault=function(t){var r=ae(t);return void 0===r?void 0:e.unescapeLeadingUnderscores(r)},e.symbolEscapedNameNoDefault=ae,e.isModuleSpecifierLike=function(t){return e.isStringLiteralLike(t)&&(e.isExternalModuleReference(t.parent)||e.isImportDeclaration(t.parent)||e.isRequireCall(t.parent,!1)&&t.parent.arguments[0]===t||e.isImportCall(t.parent)&&t.parent.arguments[0]===t)},e.isObjectBindingElementWithoutPropertyName=function(t){return e.isBindingElement(t)&&e.isObjectBindingPattern(t.parent)&&e.isIdentifier(t.name)&&!t.propertyName},e.getPropertySymbolFromBindingElement=function(e,t){var r=e.getTypeAtLocation(t.parent);return r&&e.getPropertyOfType(r,t.name.text)},e.getParentNodeInSpan=function(t,r,n){if(t)for(;t.parent;){if(e.isSourceFile(t.parent)||!oe(n,t.parent,r))return t;t=t.parent;}},e.findModifier=function(t,r){return t.modifiers&&e.find(t.modifiers,(function(e){return e.kind===r}))},e.insertImports=function(t,r,n,i){var a=236===(e.isArray(n)?n[0]:n).kind?e.isRequireVariableStatement:e.isAnyImportSyntax,o=e.filter(r.statements,a),s=e.isArray(n)?e.stableSort(n,e.OrganizeImports.compareImportsOrRequireStatements):[n];if(o.length)if(o&&e.OrganizeImports.importsAreSorted(o))for(var c=0,l=s;c<l.length;c++){var u=l[c],_=e.OrganizeImports.getImportDeclarationInsertionIndex(o,u);if(0===_){var d=o[0]===r.statements[0]?{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude}:{};t.insertNodeBefore(r,o[0],u,!1,d);}else {var p=o[_-1];t.insertNodeAfter(r,p,u);}}else {var f=e.lastOrUndefined(o);f?t.insertNodesAfter(r,f,s):t.insertNodesAtTopOfFile(r,s,i);}else t.insertNodesAtTopOfFile(r,s,i);},e.getTypeKeywordOfTypeOnlyImport=function(t,r){return e.Debug.assert(t.isTypeOnly),e.cast(t.getChildAt(0,r),Z)},e.textSpansEqual=se,e.documentSpansEqual=function(e,t){return e.fileName===t.fileName&&se(e.textSpan,t.textSpan)},e.forEachUnique=function(e,t){if(e)for(var r=0;r<e.length;r++)if(e.indexOf(e[r])===r){var n=t(e[r],r);if(n)return n}},e.isTextWhiteSpaceLike=function(t,r,n){for(var i=r;i<n;i++)if(!e.isWhiteSpaceLike(t.charCodeAt(i)))return !1;return !0},e.isFirstDeclarationOfSymbolParameter=ce;var le=function(){var t,r,n,i,a=10*e.defaultMaximumTruncationLength;l();var o=function(t){return c(t,e.SymbolDisplayPartKind.text)};return {displayParts:function(){var r=t.length&&t[t.length-1].text;return i>a&&r&&"..."!==r&&(e.isWhiteSpaceLike(r.charCodeAt(r.length-1))||t.push(_e(" ",e.SymbolDisplayPartKind.space)),t.push(_e("...",e.SymbolDisplayPartKind.punctuation))),t},writeKeyword:function(t){return c(t,e.SymbolDisplayPartKind.keyword)},writeOperator:function(t){return c(t,e.SymbolDisplayPartKind.operator)},writePunctuation:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeTrailingSemicolon:function(t){return c(t,e.SymbolDisplayPartKind.punctuation)},writeSpace:function(t){return c(t,e.SymbolDisplayPartKind.space)},writeStringLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeParameter:function(t){return c(t,e.SymbolDisplayPartKind.parameterName)},writeProperty:function(t){return c(t,e.SymbolDisplayPartKind.propertyName)},writeLiteral:function(t){return c(t,e.SymbolDisplayPartKind.stringLiteral)},writeSymbol:function(e,r){i>a||(s(),i+=e.length,t.push(ue(e,r)));},writeLine:function(){i>a||(i+=1,t.push(ye()),r=!0);},write:o,writeComment:o,getText:function(){return ""},getTextPos:function(){return 0},getColumn:function(){return 0},getLine:function(){return 0},isAtStartOfLine:function(){return !1},hasTrailingWhitespace:function(){return !1},hasTrailingComment:function(){return !1},rawWrite:e.notImplemented,getIndent:function(){return n},increaseIndent:function(){n++;},decreaseIndent:function(){n--;},clear:l,trackSymbol:function(){return !1},reportInaccessibleThisError:e.noop,reportInaccessibleUniqueSymbolError:e.noop,reportPrivateInBaseOfClassExpression:e.noop};function s(){if(!(i>a)&&r){var o=e.getIndentString(n);o&&(i+=o.length,t.push(_e(o,e.SymbolDisplayPartKind.space))),r=!1;}}function c(e,r){i>a||(s(),i+=e.length,t.push(_e(e,r)));}function l(){t=[],r=!0,n=0,i=0;}}();function ue(t,r){return _e(t,function(t){var r=t.flags;return 3&r?ce(t)?e.SymbolDisplayPartKind.parameterName:e.SymbolDisplayPartKind.localName:4&r||32768&r||65536&r?e.SymbolDisplayPartKind.propertyName:8&r?e.SymbolDisplayPartKind.enumMemberName:16&r?e.SymbolDisplayPartKind.functionName:32&r?e.SymbolDisplayPartKind.className:64&r?e.SymbolDisplayPartKind.interfaceName:384&r?e.SymbolDisplayPartKind.enumName:1536&r?e.SymbolDisplayPartKind.moduleName:8192&r?e.SymbolDisplayPartKind.methodName:262144&r?e.SymbolDisplayPartKind.typeParameterName:524288&r||2097152&r?e.SymbolDisplayPartKind.aliasName:e.SymbolDisplayPartKind.text}(r))}function _e(t,r){return {text:t,kind:e.SymbolDisplayPartKind[r]}}function de(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.keyword)}function pe(t){return _e(t,e.SymbolDisplayPartKind.text)}function fe(t){return _e(t,e.SymbolDisplayPartKind.linkText)}function ge(t,r){return {text:t,kind:e.SymbolDisplayPartKind[e.SymbolDisplayPartKind.linkName],target:{fileName:e.getSourceFileOfNode(r).fileName,textSpan:Q(r)}}}function me(t){return _e(t,e.SymbolDisplayPartKind.link)}function ye(){return _e("\n",e.SymbolDisplayPartKind.lineBreak)}function ve(e){try{return e(le),le.displayParts()}finally{le.clear();}}function he(e){return 0!=(33554432&e.flags)}function be(e){return 0!=(2097152&e.flags)}function xe(e,t){void 0===t&&(t=!0);var r=e&&Se(e);return r&&!t&&Ee(r),r}function De(t,r,n){var i=n(t);return i?e.setOriginalNode(i,t):i=Se(t,n),i&&!r&&Ee(i),i}function Se(t,r){var n=r?function(e){return De(e,!0,r)}:xe,i=r?function(e){return e&&Ce(e,!0,r)}:function(e){return e&&Te(e)},a=e.visitEachChild(t,n,e.nullTransformationContext,i,n);if(a===t){var o=e.isStringLiteral(t)?e.setOriginalNode(e.factory.createStringLiteralFromNode(t),t):e.isNumericLiteral(t)?e.setOriginalNode(e.factory.createNumericLiteral(t.text,t.numericLiteralFlags),t):e.factory.cloneNode(t);return e.setTextRange(o,t)}return a.parent=void 0,a}function Te(t,r){return void 0===r&&(r=!0),t&&e.factory.createNodeArray(t.map((function(e){return xe(e,r)})),t.hasTrailingComma)}function Ce(t,r,n){return e.factory.createNodeArray(t.map((function(e){return De(e,r,n)})),t.hasTrailingComma)}function Ee(e){ke(e),Ne(e);}function ke(e){Fe(e,512,Ae);}function Ne(t){Fe(t,1024,e.getLastChild);}function Fe(t,r,n){e.addEmitFlags(t,r);var i=n(t);i&&Fe(i,r,n);}function Ae(e){return e.forEachChild((function(e){return e}))}function Pe(t,r,n,i,a){e.forEachLeadingCommentRange(n.text,t.pos,Oe(r,n,i,a,e.addSyntheticLeadingComment));}function we(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.end,Oe(r,n,i,a,e.addSyntheticTrailingComment));}function Ie(t,r,n,i,a){e.forEachTrailingCommentRange(n.text,t.pos,Oe(r,n,i,a,e.addSyntheticLeadingComment));}function Oe(e,t,r,n,i){return function(a,o,s,c){3===s?(a+=2,o-=2):a+=2,i(e,r||s,t.text.slice(a,o),void 0!==n?n:c);}}function Me(t,r){if(e.startsWith(t,r))return 0;var n=t.indexOf(" "+r);return -1===n&&(n=t.indexOf("."+r)),-1===n&&(n=t.indexOf('"'+r)),-1===n?-1:n+1}function Le(e,t){var r=e.parent;switch(r.kind){case 208:return t.getContextualType(r);case 220:var n=r,i=n.left,a=n.operatorToken,o=n.right;return Re(a.kind)?t.getTypeAtLocation(e===o?i:o):t.getContextualType(e);case 288:return r.expression===e?Be(r,t):void 0;default:return t.getContextualType(e)}}function Re(e){switch(e){case 36:case 34:case 37:case 35:return !0;default:return !1}}function Be(e,t){return t.getTypeAtLocation(e.parent.parent.expression)}function je(e){return 173===e||174===e||175===e||165===e||167===e}function Je(e){return 255===e||170===e||168===e||171===e||172===e}function ze(e){return 260===e}function Ue(e){return 236===e||237===e||239===e||244===e||245===e||246===e||250===e||252===e||166===e||258===e||265===e||264===e||271===e||263===e||270===e}function Ke(e,t){return qe(e,e.fileExists,t)}function Ve(e){try{return e()}catch(e){return}}function qe(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return Ve((function(){return t&&t.apply(e,r)}))}function We(t,r){if(!r.fileExists)return [];var n=[];return e.forEachAncestorDirectory(e.getDirectoryPath(t),(function(t){var i=e.combinePaths(t,"package.json");if(r.fileExists(i)){var a=He(i,r);a&&n.push(a);}})),n}function He(t,r){if(r.readFile){var n=function(e){try{return JSON.parse(e)}catch(e){return}}(r.readFile(t)||""),a={};if(n)for(var o=0,s=["dependencies","devDependencies","optionalDependencies","peerDependencies"];o<s.length;o++){var c=s[o],l=n[c];if(l){var u=new e.Map;for(var _ in l)u.set(_,l[_]);a[c]=u;}}var d=[[1,a.dependencies],[2,a.devDependencies],[8,a.optionalDependencies],[4,a.peerDependencies]];return i$1(i$1({},a),{parseable:!!n,fileName:t,get:p,has:function(e,t){return !!p(e,t)}})}function p(e,t){void 0===t&&(t=15);for(var r=0,n=d;r<n.length;r++){var i=n[r],a=i[0],o=i[1];if(o&&t&a){var s=o.get(e);if(void 0!==s)return s}}}}function Ge(t){return e.some(t.imports,(function(t){var r=t.text;return e.JsTyping.nodeCoreModules.has(r)}))}function Qe(e){return void 0!==e.file&&void 0!==e.start&&void 0!==e.length}function Xe(t){var r=t.getSourceFile();return !(!r.externalModuleIndicator&&!r.commonJsModuleIndicator)&&(e.isInJSFile(t)||!e.findAncestor(t,e.isGlobalScopeAugmentation))}e.symbolPart=ue,e.displayPart=_e,e.spacePart=function(){return _e(" ",e.SymbolDisplayPartKind.space)},e.keywordPart=de,e.punctuationPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.punctuation)},e.operatorPart=function(t){return _e(e.tokenToString(t),e.SymbolDisplayPartKind.operator)},e.parameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.parameterName)},e.propertyNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.propertyName)},e.textOrKeywordPart=function(t){var r=e.stringToToken(t);return void 0===r?pe(t):de(r)},e.textPart=pe,e.typeAliasNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.aliasName)},e.typeParameterNamePart=function(t){return _e(t,e.SymbolDisplayPartKind.typeParameterName)},e.linkTextPart=fe,e.linkNamePart=ge,e.linkPart=me,e.buildLinkParts=function(t,r){var n,i=e.isJSDocLink(t)?"link":e.isJSDocLinkCode(t)?"linkcode":"linkplain",a=[me("{@".concat(i," "))];if(t.name){var o=null==r?void 0:r.getSymbolAtLocation(t.name),s=function(e){if(0===e.indexOf("()"))return 2;if("<"!==e[0])return 0;for(var t=0,r=0;r<e.length;)if("<"===e[r]&&t++,">"===e[r]&&t--,r++,!t)return r;return 0}(t.text),c=e.getTextOfNode(t.name)+t.text.slice(0,s),l=t.text.slice(s),u=(null==o?void 0:o.valueDeclaration)||(null===(n=null==o?void 0:o.declarations)||void 0===n?void 0:n[0]);u?(a.push(ge(c,u)),l&&a.push(fe(l))):a.push(fe(c+(s?"":" ")+l));}else t.text&&a.push(fe(t.text));return a.push(me("}")),a},e.getNewLineOrDefaultFromHost=function(e,t){var r;return (null==t?void 0:t.newLineCharacter)||(null===(r=e.getNewLine)||void 0===r?void 0:r.call(e))||"\r\n"},e.lineBreakPart=ye,e.mapToDisplayParts=ve,e.typeToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),ve((function(i){e.writeType(t,r,17408|n,i);}))},e.symbolToDisplayParts=function(e,t,r,n,i){return void 0===i&&(i=0),ve((function(a){e.writeSymbol(t,r,n,8|i,a);}))},e.signatureToDisplayParts=function(e,t,r,n){return void 0===n&&(n=0),n|=25632,ve((function(i){e.writeSignature(t,r,n,void 0,i);}))},e.isImportOrExportSpecifierName=function(t){return !!t.parent&&e.isImportOrExportSpecifier(t.parent)&&t.parent.propertyName===t},e.getScriptKind=function(t,r){return e.ensureScriptKind(t,r.getScriptKind&&r.getScriptKind(t))},e.getSymbolTarget=function(t,r){for(var n=t;be(n)||he(n)&&n.target;)n=he(n)&&n.target?n.target:e.skipAlias(n,r);return n},e.getUniqueSymbolId=function(t,r){return e.getSymbolId(e.skipAlias(t,r))},e.getFirstNonSpaceCharacterPosition=function(t,r){for(;e.isWhiteSpaceLike(t.charCodeAt(r));)r+=1;return r},e.getPrecedingNonSpaceCharacterPosition=function(t,r){for(;r>-1&&e.isWhiteSpaceSingleLine(t.charCodeAt(r));)r-=1;return r+1},e.getSynthesizedDeepClone=xe,e.getSynthesizedDeepCloneWithReplacements=De,e.getSynthesizedDeepClones=Te,e.getSynthesizedDeepClonesWithReplacements=Ce,e.suppressLeadingAndTrailingTrivia=Ee,e.suppressLeadingTrivia=ke,e.suppressTrailingTrivia=Ne,e.copyComments=function(e,t){var r=e.getSourceFile();!function(e,t){for(var r=e.getFullStart(),n=e.getStart(),i=r;i<n;i++)if(10===t.charCodeAt(i))return !0;return !1}(e,r.text)?Ie(e,t,r):Pe(e,t,r),we(e,t,r);},e.getUniqueName=function(t,r){for(var n=t,i=1;!e.isFileLevelUniqueName(r,n);i++)n="".concat(t,"_").concat(i);return n},e.getRenameLocation=function(t,r,n,i){for(var a=0,o=-1,s=0,c=t;s<c.length;s++){var l=c[s],u=l.fileName,_=l.textChanges;e.Debug.assert(u===r);for(var d=0,p=_;d<p.length;d++){var f=p[d],g=f.span,m=f.newText,y=Me(m,n);if(-1!==y&&(o=g.start+a+y,!i))return o;a+=m.length-g.length;}}return e.Debug.assert(i),e.Debug.assert(o>=0),o},e.copyLeadingComments=Pe,e.copyTrailingComments=we,e.copyTrailingAsLeadingComments=Ie,e.needsParentheses=function(t){return e.isBinaryExpression(t)&&27===t.operatorToken.kind||e.isObjectLiteralExpression(t)||e.isAsExpression(t)&&e.isObjectLiteralExpression(t.expression)},e.getContextualTypeFromParent=Le,e.quote=function(t,r,n){var i=ie(t,r),a=JSON.stringify(n);return 0===i?"'".concat(e.stripQuotes(a).replace(/'/g,"\\'").replace(/\\"/g,'"'),"'"):a},e.isEqualityOperatorKind=Re,e.isStringLiteralOrTemplate=function(e){switch(e.kind){case 10:case 14:case 222:case 209:return !0;default:return !1}},e.hasIndexSignature=function(e){return !!e.getStringIndexType()||!!e.getNumberIndexType()},e.getSwitchedType=Be,e.ANONYMOUS="anonymous function",e.getTypeNodeIfAccessible=function(e,t,r,n){var i=r.getTypeChecker(),a=!0,o=function(){return a=!1},s=i.typeToTypeNode(e,t,1,{trackSymbol:function(e,t,r){return !(a=a&&0===i.isSymbolAccessible(e,t,r,!1).accessibility)},reportInaccessibleThisError:o,reportPrivateInBaseOfClassExpression:o,reportInaccessibleUniqueSymbolError:o,moduleResolverHost:ee(r,n)});return a?s:void 0},e.syntaxRequiresTrailingCommaOrSemicolonOrASI=je,e.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI=Je,e.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI=ze,e.syntaxRequiresTrailingSemicolonOrASI=Ue,e.syntaxMayBeASICandidate=e.or(je,Je,ze,Ue),e.positionIsASICandidate=function(t,r,n){var i=e.findAncestor(r,(function(r){return r.end!==t?"quit":e.syntaxMayBeASICandidate(r.kind)}));return !!i&&function(t,r){var n=t.getLastToken(r);if(n&&26===n.kind)return !1;if(je(t.kind)){if(n&&27===n.kind)return !1}else if(ze(t.kind)){if((i=e.last(t.getChildren(r)))&&e.isModuleBlock(i))return !1}else if(Je(t.kind)){var i;if((i=e.last(t.getChildren(r)))&&e.isFunctionBlock(i))return !1}else if(!Ue(t.kind))return !1;if(239===t.kind)return !0;var a=L(t,e.findAncestor(t,(function(e){return !e.parent})),r);return !a||19===a.kind||r.getLineAndCharacterOfPosition(t.getEnd()).line!==r.getLineAndCharacterOfPosition(a.getStart(r)).line}(i,n)},e.probablyUsesSemicolons=function(t){var r=0,n=0;return e.forEachChild(t,(function i(a){if(Ue(a.kind)){var o=a.getLastToken(t);o&&26===o.kind?r++:n++;}return r+n>=5||e.forEachChild(a,i)})),0===r&&n<=1||r/n>.2},e.tryGetDirectories=function(e,t){return qe(e,e.getDirectories,t)||[]},e.tryReadDirectory=function(t,r,n,i,a){return qe(t,t.readDirectory,r,n,i,a)||e.emptyArray},e.tryFileExists=Ke,e.tryDirectoryExists=function(t,r){return Ve((function(){return e.directoryProbablyExists(r,t)}))||!1},e.tryAndIgnoreErrors=Ve,e.tryIOAndConsumeErrors=qe,e.findPackageJsons=function(t,r,n){var i=[];return e.forEachAncestorDirectory(t,(function(t){if(t===n)return !0;var a=e.combinePaths(t,"package.json");Ke(r,a)&&i.push(a);})),i},e.findPackageJson=function(t,r){var n;return e.forEachAncestorDirectory(t,(function(t){return "node_modules"===t||!!(n=e.findConfigFile(t,(function(e){return Ke(r,e)}),"package.json"))||void 0})),n},e.getPackageJsonsVisibleToFile=We,e.createPackageJsonInfo=He,e.createPackageJsonImportFilter=function(t,r,n){var i,a=(n.getPackageJsonsVisibleToFile&&n.getPackageJsonsVisibleToFile(t.fileName)||We(t.fileName,n)).filter((function(e){return e.parseable}));return {allowsImportingAmbientModule:function(t,r){if(!a.length||!t.valueDeclaration)return !0;var n=c(t.valueDeclaration.getSourceFile().fileName,r);if(void 0===n)return !0;var i=e.stripQuotes(t.getName());return !!s(i)||(o(n)||o(i))},allowsImportingSourceFile:function(e,t){if(!a.length)return !0;var r=c(e.fileName,t);return !r||o(r)},allowsImportingSpecifier:function(t){return !(a.length&&!s(t))||(!(!e.pathIsRelative(t)&&!e.isRootedDiskPath(t))||o(t))}};function o(t){for(var r=l(t),n=0,i=a;n<i.length;n++){var o=i[n];if(o.has(r)||o.has(e.getTypesPackageName(r)))return !0}return !1}function s(r){return !!(e.isSourceFileJS(t)&&e.JsTyping.nodeCoreModules.has(r)&&(void 0===i&&(i=Ge(t)),i))}function c(i,a){if(e.stringContains(i,"node_modules")){var o=e.moduleSpecifiers.getNodeModulesPackageName(n.getCompilationSettings(),t.path,i,a,r);if(o)return e.pathIsRelative(o)||e.isRootedDiskPath(o)?void 0:l(o)}}function l(t){var r=e.getPathComponents(e.getPackageNameFromTypesPackageName(t)).slice(1);return e.startsWith(r[0],"@")?"".concat(r[0],"/").concat(r[1]):r[0]}},e.consumesNodeCoreModules=Ge,e.isInsideNodeModules=function(t){return e.contains(e.getPathComponents(t),"node_modules")},e.isDiagnosticWithLocation=Qe,e.findDiagnosticForNode=function(t,r){var n=Q(t),i=e.binarySearchKey(r,n,e.identity,e.compareTextSpans);if(i>=0){var a=r[i];return e.Debug.assertEqual(a.file,t.getSourceFile(),"Diagnostics proided to 'findDiagnosticForNode' must be from a single SourceFile"),e.cast(a,Qe)}},e.getDiagnosticsWithinSpan=function(t,r){var n,i=e.binarySearchKey(r,t.start,(function(e){return e.start}),e.compareValues);for(i<0&&(i=~i);(null===(n=r[i-1])||void 0===n?void 0:n.start)===t.start;)i--;for(var a=[],o=e.textSpanEnd(t);;){var s=e.tryCast(r[i],Qe);if(!s||s.start>o)break;e.textSpanContainsTextSpan(t,s)&&a.push(s),i++;}return a},e.getRefactorContextSpan=function(t){var r=t.startPosition,n=t.endPosition;return e.createTextSpanFromBounds(r,void 0===n?r:n)},e.getFixableErrorSpanExpression=function(t,r){var n=O(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":e.isExpression(n)&&se(r,Q(n,t))}))},e.mapOneOrMany=function(t,r,n){return void 0===n&&(n=e.identity),t?e.isArray(t)?n(e.map(t,r)):r(t,0):void 0},e.firstOrOnly=function(t){return e.isArray(t)?e.first(t):t},e.getNameForExportedSymbol=function(t,r){return 33554432&t.flags||"export="!==t.escapedName&&"default"!==t.escapedName?t.name:e.firstDefined(t.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:void 0}))||e.codefix.moduleSymbolToValidIdentifier(function(t){var r;return e.Debug.checkDefined(t.parent,"Symbol parent was undefined. Flags: ".concat(e.Debug.formatSymbolFlags(t.flags),". ")+"Declarations: ".concat(null===(r=t.declarations)||void 0===r?void 0:r.map((function(t){var r=e.Debug.formatSyntaxKind(t.kind),n=e.isInJSFile(t),i=t.expression;return (n?"[JS]":"")+r+(i?" (expression: ".concat(e.Debug.formatSyntaxKind(i.kind),")"):"")})).join(", "),"."))}(t),r)},e.stringContainsAt=function(e,t,r){var n=t.length;if(n+r>e.length)return !1;for(var i=0;i<n;i++)if(t.charCodeAt(i)!==e.charCodeAt(i+r))return !1;return !0},e.startsWithUnderscore=function(e){return 95===e.charCodeAt(0)},e.isGlobalDeclaration=function(e){return !Xe(e)},e.isNonGlobalDeclaration=Xe,e.isDeprecatedDeclaration=function(t){return !!(8192&e.getCombinedNodeFlagsAlwaysIncludeJSDoc(t))},e.shouldUseUriStyleNodeCoreModules=function(t,r){var n=e.firstDefined(t.imports,(function(t){if(e.JsTyping.nodeCoreModules.has(t.text))return e.startsWith(t.text,"node:")}));return null!=n?n:r.usesUriStyleNodeCoreModules},e.getNewLineKind=function(e){return "\n"===e?1:0},e.diagnosticToString=function(t){return e.isArray(t)?e.formatStringFromArgs(e.getLocaleSpecificMessage(t[0]),t.slice(1)):e.getLocaleSpecificMessage(t)};}(t),function(e){function t(t){var r,n=1,i=e.createMultiMap(),a=new e.Map,o={isUsableByFile:function(e){return e===r},isEmpty:function(){return !i.size},clear:function(){i.clear(),a.clear(),r=void 0;},add:function(t,s,c,l,u,_,d,p,f){t!==r&&(o.clear(),r=t);var g=1===_&&e.getLocalSymbolForExportDefault(s)||s,m=0===_||e.isExternalModuleSymbol(g)?e.unescapeLeadingUnderscores(c):e.getNameForExportedSymbol(g,p),y=e.stripQuotes(l.name),v=n++,h=e.skipAlias(s,f),b=33554432&s.flags?void 0:s,x=33554432&l.flags?void 0:l;b&&x||a.set(v,[s,l]),i.add(function(t,r,n,i){var a=n||"";return "".concat(t,"|").concat(e.getSymbolId(e.skipAlias(r,i)),"|").concat(a)}(m,s,e.isExternalModuleNameRelative(y)?void 0:y,f),{id:v,symbolTableKey:c,symbolName:m,moduleName:y,moduleFile:u,moduleFileName:null==u?void 0:u.fileName,exportKind:_,targetFlags:h.flags,isFromPackageJson:d,symbol:b,moduleSymbol:x});},get:function(e,t){if(e===r){var n=i.get(t);return null==n?void 0:n.map(s)}},forEach:function(e,t){e===r&&i.forEach((function(e,r){var n=function(e){var t=e.substring(0,e.indexOf("|")),r=e.substring(e.lastIndexOf("|")+1);return {symbolName:t,ambientModuleName:""===r?void 0:r}}(r),i=n.symbolName,a=n.ambientModuleName;t(e.map(s),i,!!a,r);}));},releaseSymbols:function(){a.clear();},onFileChanged:function(t,n,i){return !(c(t)&&c(n)||(r&&r!==n.path||i&&e.consumesNodeCoreModules(t)!==e.consumesNodeCoreModules(n)||!e.arrayIsEqualTo(t.moduleAugmentations,n.moduleAugmentations)||!function(t,r){if(!e.arrayIsEqualTo(t.ambientModuleNames,r.ambientModuleNames))return !1;for(var n=-1,i=-1,a=function(a){var o=function(t){return e.isNonGlobalAmbientModule(t)&&t.name.text===a};if(n=e.findIndex(t.statements,o,n+1),i=e.findIndex(r.statements,o,i+1),t.statements[n]!==r.statements[i])return {value:!1}},o=0,s=r.ambientModuleNames;o<s.length;o++){var c=a(s[o]);if("object"==typeof c)return c.value}return !0}(t,n)?(o.clear(),0):(r=n.path,1)))}};return e.Debug.isDebugging&&Object.defineProperty(o,"__cache",{get:function(){return i}}),o;function s(r){if(r.symbol&&r.moduleSymbol)return r;var n=r.id,i=r.exportKind,o=r.targetFlags,s=r.isFromPackageJson,c=r.moduleFileName,l=a.get(n)||e.emptyArray,u=l[0],_=l[1];if(u&&_)return {symbol:u,moduleSymbol:_,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s};var d=(s?t.getPackageJsonAutoImportProvider():t.getCurrentProgram()).getTypeChecker(),p=r.moduleSymbol||_||e.Debug.checkDefined(r.moduleFile?d.getMergedSymbol(r.moduleFile.symbol):d.tryFindAmbientModule(r.moduleName)),f=r.symbol||u||e.Debug.checkDefined(2===i?d.resolveExternalModuleSymbol(p):d.tryGetMemberInModuleExportsAndProperties(e.unescapeLeadingUnderscores(r.symbolTableKey),p),"Could not find symbol '".concat(r.symbolName,"' by key '").concat(r.symbolTableKey,"' in module ").concat(p.name));return a.set(n,[f,p]),{symbol:f,moduleSymbol:p,moduleFileName:c,exportKind:i,targetFlags:o,isFromPackageJson:s}}function c(e){return !(e.commonJsModuleIndicator||e.externalModuleIndicator||e.moduleAugmentations||e.ambientModuleNames)}}function r(t,r,i,a){var o,s;n(t.getTypeChecker(),t.getSourceFiles(),(function(e,r){return a(e,r,t,!1)}));var c=i&&(null===(o=r.getPackageJsonAutoImportProvider)||void 0===o?void 0:o.call(r));if(c){var l=e.timestamp();n(c.getTypeChecker(),c.getSourceFiles(),(function(e,t){return a(e,t,c,!0)})),null===(s=r.log)||void 0===s||s.call(r,"forEachExternalModuleToImportFrom autoImportProvider: ".concat(e.timestamp()-l));}}function n(t,r,n){for(var i=0,a=t.getAmbientModules();i<a.length;i++){var o=a[i];e.stringContains(o.name,"*")||n(o,void 0);}for(var s=0,c=r;s<c.length;s++){var l=c[s];e.isExternalOrCommonJsModule(l)&&n(t.getMergedSymbol(l.symbol),l);}}function a(e,t,r){var n=function(e,t){var r=t.resolveExternalModuleSymbol(e);if(r!==e)return {symbol:r,exportKind:2};var n=t.tryGetMemberInModuleExports("default",e);return n?{symbol:n,exportKind:1}:void 0}(e,t);if(n){var a=n.symbol,o=n.exportKind,c=s(a,t,r);return c&&i$1({symbol:a,exportKind:o},c)}}function o(t,r){return !(r.isUndefinedSymbol(t)||r.isUnknownSymbol(t)||e.isKnownSymbol(t)||e.isPrivateIdentifierSymbol(t))}function s(t,r,n){var i=e.getLocalSymbolForExportDefault(t);if(i)return {symbolForMeaning:i,name:i.name};var a,o=(a=t).declarations&&e.firstDefined(a.declarations,(function(t){var r;return e.isExportAssignment(t)?null===(r=e.tryCast(e.skipOuterExpressions(t.expression),e.isIdentifier))||void 0===r?void 0:r.text:e.isExportSpecifier(t)?(e.Debug.assert("default"===t.name.text,"Expected the specifier to be a default export"),t.propertyName&&t.propertyName.text):void 0}));if(void 0!==o)return {symbolForMeaning:t,name:o};if(2097152&t.flags){var c=r.getImmediateAliasedSymbol(t);if(c&&c.parent)return s(c,r,n)}return "default"!==t.escapedName&&"export="!==t.escapedName?{symbolForMeaning:t,name:t.getName()}:{symbolForMeaning:t,name:e.getNameForExportedSymbol(t,n.target)}}var c,l;(l=e.ImportKind||(e.ImportKind={}))[l.Named=0]="Named",l[l.Default=1]="Default",l[l.Namespace=2]="Namespace",l[l.CommonJS=3]="CommonJS",(c=e.ExportKind||(e.ExportKind={}))[c.Named=0]="Named",c[c.Default=1]="Default",c[c.ExportEquals=2]="ExportEquals",c[c.UMD=3]="UMD",e.createCacheableExportInfoMap=t,e.isImportableFile=function(t,r,n,i,a,o,s){var c;if(r===n)return !1;var l=null==s?void 0:s.get(r.path,n.path,i);if(void 0!==(null==l?void 0:l.isAutoImportable))return l.isAutoImportable;var u=e.hostGetCanonicalFileName(o),_=null===(c=o.getGlobalTypingsCacheLocation)||void 0===c?void 0:c.call(o),d=!!e.moduleSpecifiers.forEachFileNameOfModule(r.fileName,n.fileName,o,!1,(function(i){var a=t.getSourceFile(i);return (a===n||!a)&&function(t,r,n,i){var a=e.forEachAncestorDirectory(r,(function(t){return "node_modules"===e.getBaseFileName(t)?t:void 0})),o=a&&e.getDirectoryPath(n(a));return void 0===o||e.startsWith(n(t),o)||!!i&&e.startsWith(n(i),o)}(r.fileName,i,u,_)}));if(a){var p=d&&a.allowsImportingSourceFile(n,o);return null==s||s.setIsAutoImportable(r.path,n.path,i,p),p}return d},e.forEachExternalModuleToImportFrom=r,e.getExportInfoMap=function(n,i,s,c){var l,u,_,d,p,f=e.timestamp();null===(l=i.getPackageJsonAutoImportProvider)||void 0===l||l.call(i);var g=(null===(u=i.getCachedExportInfoMap)||void 0===u?void 0:u.call(i))||t({getCurrentProgram:function(){return s},getPackageJsonAutoImportProvider:function(){var e;return null===(e=i.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(i)}});if(g.isUsableByFile(n.path))return null===(_=i.log)||void 0===_||_.call(i,"getExportInfoMap: cache hit"),g;null===(d=i.log)||void 0===d||d.call(i,"getExportInfoMap: cache miss or empty; calculating new results");var m=s.getCompilerOptions(),y=e.getEmitScriptTarget(m),v=0;return r(s,i,!0,(function(t,r,i,s){++v%100==0&&(null==c||c.throwIfCancellationRequested());var l=new e.Map,u=i.getTypeChecker(),_=a(t,u,m);_&&o(_.symbol,u)&&g.add(n.path,_.symbol,1===_.exportKind?"default":"export=",t,r,_.exportKind,s,y,u),u.forEachExportAndPropertyOfModule(t,(function(i,a){i!==(null==_?void 0:_.symbol)&&o(i,u)&&e.addToSeen(l,a)&&g.add(n.path,i,a,t,r,0,s,y,u);}));})),null===(p=i.log)||void 0===p||p.call(i,"getExportInfoMap: done in ".concat(e.timestamp()-f," ms")),g},e.getDefaultLikeExportInfo=a;}(t),function(e){e.createClassifier=function(){var o=e.createScanner(99,!1);function s(i,s,c){var l=0,u=0,_=[],d=function(t){switch(t){case 3:return {prefix:'"\\\n'};case 2:return {prefix:"'\\\n"};case 1:return {prefix:"/*\n"};case 4:return {prefix:"`\n"};case 5:return {prefix:"}\n",pushTemplate:!0};case 6:return {prefix:"",pushTemplate:!0};case 0:return {prefix:""};default:return e.Debug.assertNever(t)}}(s),p=d.prefix,f=d.pushTemplate;i=p+i;var g=p.length;f&&_.push(15),o.setText(i);var m=0,y=[],v=0;do{l=o.scan(),e.isTrivia(l)||(x(),u=l);var h=o.getTextPos();if(n(o.getTokenPos(),h,g,a(l),y),h>=i.length){var b=r(o,l,e.lastOrUndefined(_));void 0!==b&&(m=b);}}while(1!==l);function x(){switch(l){case 43:case 68:t[u]||13!==o.reScanSlashToken()||(l=13);break;case 29:79===u&&v++;break;case 31:v>0&&v--;break;case 130:case 149:case 146:case 133:case 150:v>0&&!c&&(l=79);break;case 15:_.push(l);break;case 18:_.length>0&&_.push(l);break;case 19:if(_.length>0){var r=e.lastOrUndefined(_);15===r?17===(l=o.reScanTemplateToken(!1))?_.pop():e.Debug.assertEqual(l,16,"Should have been a template middle."):(e.Debug.assertEqual(r,18,"Should have been an open brace"),_.pop());}break;default:if(!e.isKeyword(l))break;(24===u||e.isKeyword(u)&&e.isKeyword(l)&&!function(t,r){if(!e.isAccessibilityModifier(t))return !0;switch(r){case 136:case 148:case 134:case 124:return !0;default:return !1}}(u,l))&&(l=79);}}return {endOfLineState:m,spans:y}}return {getClassificationsForLine:function(t,r,n){return function(t,r){for(var n=[],a=t.spans,o=0,s=0;s<a.length;s+=3){var c=a[s],l=a[s+1],u=a[s+2];if(o>=0){var _=c-o;_>0&&n.push({length:_,classification:e.TokenClass.Whitespace});}n.push({length:l,classification:i(u)}),o=c+l;}var d=r.length-o;return d>0&&n.push({length:d,classification:e.TokenClass.Whitespace}),{entries:n,finalLexState:t.endOfLineState}}(s(t,r,n),t)},getEncodedLexicalClassifications:s}};var t=e.arrayToNumericMap([79,10,8,9,13,108,45,46,21,23,19,110,95],(function(e){return e}),(function(){return !0}));function r(t,r,n){switch(r){case 10:if(!t.isUnterminated())return;for(var i=t.getTokenText(),a=i.length-1,o=0;92===i.charCodeAt(a-o);)o++;if(0==(1&o))return;return 34===i.charCodeAt(0)?3:2;case 3:return t.isUnterminated()?1:void 0;default:if(e.isTemplateLiteralKind(r)){if(!t.isUnterminated())return;switch(r){case 17:return 5;case 14:return 4;default:return e.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #"+r)}}return 15===n?6:void 0}}function n(e,t,r,n,i){if(8!==n){0===e&&r>0&&(e+=r);var a=t-e;a>0&&i.push(e-r,a,n);}}function i(t){switch(t){case 1:return e.TokenClass.Comment;case 3:return e.TokenClass.Keyword;case 4:return e.TokenClass.NumberLiteral;case 25:return e.TokenClass.BigIntLiteral;case 5:return e.TokenClass.Operator;case 6:return e.TokenClass.StringLiteral;case 8:return e.TokenClass.Whitespace;case 10:return e.TokenClass.Punctuation;case 2:case 11:case 12:case 13:case 14:case 15:case 16:case 9:case 17:return e.TokenClass.Identifier;default:return}}function a(t){if(e.isKeyword(t))return 3;if(function(e){switch(e){case 41:case 43:case 44:case 39:case 40:case 47:case 48:case 49:case 29:case 31:case 32:case 33:case 102:case 101:case 127:case 34:case 35:case 36:case 37:case 50:case 52:case 51:case 55:case 56:case 74:case 73:case 78:case 70:case 71:case 72:case 64:case 65:case 66:case 68:case 69:case 63:case 27:case 60:case 75:case 76:case 77:return !0;default:return !1}}(t)||function(e){switch(e){case 39:case 40:case 54:case 53:case 45:case 46:return !0;default:return !1}}(t))return 5;if(t>=18&&t<=78)return 10;switch(t){case 8:return 4;case 9:return 25;case 10:return 6;case 13:return 7;case 7:case 3:case 2:return 1;case 5:case 4:return 8;case 79:default:return e.isTemplateLiteralKind(t)?6:2}}function o(e,t){switch(t){case 260:case 256:case 257:case 255:case 225:case 212:case 213:e.throwIfCancellationRequested();}}function s(t,r,n,i,a){var s=[];return n.forEachChild((function l(u){if(u&&e.textSpanIntersectsWith(a,u.pos,u.getFullWidth())){if(o(r,u.kind),e.isIdentifier(u)&&!e.nodeIsMissing(u)&&i.has(u.escapedText)){var _=t.getSymbolAtLocation(u),d=_&&c(_,e.getMeaningFromLocation(u),t);d&&function(t,r,n){var i=r-t;e.Debug.assert(i>0,"Classification had non-positive length of ".concat(i)),s.push(t),s.push(i),s.push(n);}(u.getStart(n),u.getEnd(),d);}u.forEachChild(l);}})),{spans:s,endOfLineState:0}}function c(t,r,n){var i=t.getFlags();return 0==(2885600&i)?void 0:32&i?11:384&i?12:524288&i?16:1536&i?4&r||1&r&&function(t){return e.some(t.declarations,(function(t){return e.isModuleDeclaration(t)&&1===e.getModuleInstanceState(t)}))}(t)?14:void 0:2097152&i?c(n.getAliasedSymbol(t),r,n):2&r?64&i?13:262144&i?15:void 0:void 0}function l(e){switch(e){case 1:return "comment";case 2:return "identifier";case 3:return "keyword";case 4:return "number";case 25:return "bigint";case 5:return "operator";case 6:return "string";case 8:return "whitespace";case 9:return "text";case 10:return "punctuation";case 11:return "class name";case 12:return "enum name";case 13:return "interface name";case 14:return "module name";case 15:return "type parameter name";case 16:return "type alias name";case 17:return "parameter name";case 18:return "doc comment tag name";case 19:return "jsx open tag name";case 20:return "jsx close tag name";case 21:return "jsx self closing tag name";case 22:return "jsx attribute";case 23:return "jsx text";case 24:return "jsx attribute string literal value";default:return}}function u(t){e.Debug.assert(t.spans.length%3==0);for(var r=t.spans,n=[],i=0;i<r.length;i+=3)n.push({textSpan:e.createTextSpan(r[i],r[i+1]),classificationType:l(r[i+2])});return n}function _(t,r,n){var i=n.start,a=n.length,s=e.createScanner(99,!1,r.languageVariant,r.text),c=e.createScanner(99,!1,r.languageVariant,r.text),l=[];return v(r),{spans:l,endOfLineState:0};function u(e,t,r){l.push(e),l.push(t),l.push(r);}function _(t,n,i,a){if(3===n){var o=e.parseIsolatedJSDocComment(r.text,i,a);if(o&&o.jsDoc)return e.setParent(o.jsDoc,t),void function(e){var t,r,n,i,a,o,s,c=e.pos;if(e.tags)for(var l=0,_=e.tags;l<_.length;l++){var f=_[l];f.pos!==c&&d(c,f.pos-c),u(f.pos,1,10),u(f.tagName.pos,f.tagName.end-f.tagName.pos,18),c=f.tagName.end;var g=f.tagName.end;switch(f.kind){case 338:var m=f;b(m),g=m.isNameFirst&&(null===(t=m.typeExpression)||void 0===t?void 0:t.end)||m.name.end;break;case 345:var y=f;g=y.isNameFirst&&(null===(r=y.typeExpression)||void 0===r?void 0:r.end)||y.name.end;break;case 342:p(f),c=f.end,g=f.typeParameters.end;break;case 343:var h=f;g=307===(null===(n=h.typeExpression)||void 0===n?void 0:n.kind)&&(null===(i=h.fullName)||void 0===i?void 0:i.end)||(null===(a=h.typeExpression)||void 0===a?void 0:a.end)||g;break;case 336:g=f.typeExpression.end;break;case 341:v(f.typeExpression),c=f.end,g=f.typeExpression.end;break;case 340:case 337:g=f.typeExpression.end;break;case 339:v(f.typeExpression),c=f.end,g=(null===(o=f.typeExpression)||void 0===o?void 0:o.end)||g;break;case 344:g=(null===(s=f.name)||void 0===s?void 0:s.end)||g;break;case 326:case 327:g=f.class.end;}"object"==typeof f.comment?d(f.comment.pos,f.comment.end-f.comment.pos):"string"==typeof f.comment&&d(g,f.end-g);}return void(c!==e.end&&d(c,e.end-c));function b(e){e.isNameFirst&&(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end),e.typeExpression&&(d(c,e.typeExpression.pos-c),v(e.typeExpression),c=e.typeExpression.end),e.isNameFirst||(d(c,e.name.pos-c),u(e.name.pos,e.name.end-e.name.pos,17),c=e.name.end);}}(o.jsDoc)}else if(2===n&&function(t,n){var i=/(\s)(\S+)(\s*)(=)(\s*)('[^']+'|"[^"]+")/gim,a=r.text.substr(t,n),o=/^(\/\/\/\s*)(<)(?:(\S+)((?:[^/]|\/[^>])*)(\/>)?)?/im.exec(a);if(!o)return !1;if(!o[3]||!(o[3]in e.commentPragmas))return !1;var s=t;d(s,o[1].length),u(s+=o[1].length,o[2].length,10),u(s+=o[2].length,o[3].length,21),s+=o[3].length;for(var c=o[4],l=s;;){var _=i.exec(c);if(!_)break;var p=s+_.index+_[1].length;p>l&&(d(l,p-l),l=p),u(l,_[2].length,22),l+=_[2].length,_[3].length&&(d(l,_[3].length),l+=_[3].length),u(l,_[4].length,5),l+=_[4].length,_[5].length&&(d(l,_[5].length),l+=_[5].length),u(l,_[6].length,24),l+=_[6].length;}(s+=o[4].length)>l&&d(l,s-l),o[5]&&(u(s,o[5].length,10),s+=o[5].length);var f=t+n;return s<f&&d(s,f-s),!0}(i,a))return;d(i,a);}function d(e,t){u(e,t,1);}function p(e){for(var t=0,r=e.getChildren();t<r.length;t++)v(r[t]);}function f(t,r,n){var i;for(i=r;i<n&&!e.isLineBreak(t.charCodeAt(i));i++);for(u(r,i-r,1),c.setTextPos(i);c.getTextPos()<n;)g();}function g(){var e=c.getTextPos(),t=c.scan(),r=c.getTextPos(),n=y(t);n&&u(e,r-e,n);}function m(t){if(e.isJSDoc(t))return !0;if(e.nodeIsMissing(t))return !0;var n=function(e){switch(e.parent&&e.parent.kind){case 279:if(e.parent.tagName===e)return 19;break;case 280:if(e.parent.tagName===e)return 20;break;case 278:if(e.parent.tagName===e)return 21;break;case 284:if(e.parent.name===e)return 22}}(t);if(!e.isToken(t)&&11!==t.kind&&void 0===n)return !1;var i=11===t.kind?t.pos:function(t){for(s.setTextPos(t.pos);;){var n=s.getTextPos();if(!e.couldStartTrivia(r.text,n))return n;var i=s.scan(),a=s.getTextPos(),o=a-n;if(!e.isTrivia(i))return n;switch(i){case 4:case 5:continue;case 2:case 3:_(t,i,n,o),s.setTextPos(a);continue;case 7:var c=r.text,l=c.charCodeAt(n);if(60===l||62===l){u(n,o,1);continue}e.Debug.assert(124===l||61===l),f(c,n,a);break;case 6:break;default:e.Debug.assertNever(i);}}}(t),a=t.end-i;if(e.Debug.assert(a>=0),a>0){var o=n||y(t.kind,t);o&&u(i,a,o);}return !0}function y(t,r){if(e.isKeyword(t))return 3;if((29===t||31===t)&&r&&e.getTypeArgumentOrTypeParameterList(r.parent))return 10;if(e.isPunctuation(t)){if(r){var n=r.parent;if(63===t&&(253===n.kind||166===n.kind||163===n.kind||284===n.kind))return 5;if(220===n.kind||218===n.kind||219===n.kind||221===n.kind)return 5}return 10}if(8===t)return 4;if(9===t)return 25;if(10===t)return r&&284===r.parent.kind?24:6;if(13===t)return 6;if(e.isTemplateLiteralKind(t))return 6;if(11===t)return 23;if(79===t){if(r)switch(r.parent.kind){case 256:return r.parent.name===r?11:void 0;case 162:return r.parent.name===r?15:void 0;case 257:return r.parent.name===r?13:void 0;case 259:return r.parent.name===r?12:void 0;case 260:return r.parent.name===r?14:void 0;case 163:return r.parent.name===r?e.isThisIdentifier(r)?3:17:void 0}return 2}}function v(n){if(n&&e.decodedTextSpanIntersectsWith(i,a,n.pos,n.getFullWidth())){o(t,n.kind);for(var s=0,c=n.getChildren(r);s<c.length;s++){var l=c[s];m(l)||v(l);}}}}e.getSemanticClassifications=function(e,t,r,n,i){return u(s(e,t,r,n,i))},e.getEncodedSemanticClassifications=s,e.getSyntacticClassifications=function(e,t,r){return u(_(e,t,r))},e.getEncodedSyntacticClassifications=_;}(t),function(e){var t;(function(t){function r(e,t,r,i){return {spans:n(e,r,i,t),endOfLineState:0}}function n(t,r,n,o){var s=[];return t&&r&&function(t,r,n,o,s){var c=t.getTypeChecker(),u=!1;!function _(d){switch(d.kind){case 260:case 256:case 257:case 255:case 225:case 212:case 213:s.throwIfCancellationRequested();}if(d&&e.textSpanIntersectsWith(n,d.pos,d.getFullWidth())&&0!==d.getFullWidth()){var p=u;if((e.isJsxElement(d)||e.isJsxSelfClosingElement(d))&&(u=!0),e.isJsxExpression(d)&&(u=!1),e.isIdentifier(d)&&!u&&!function(t){var r=t.parent;return r&&(e.isImportClause(r)||e.isImportSpecifier(r)||e.isNamespaceImport(r))}(d)&&!e.isInfinityOrNaNString(d.escapedText)){var f=c.getSymbolAtLocation(d);if(f){2097152&f.flags&&(f=c.getAliasedSymbol(f));var g=function(t,r){var n=t.getFlags();if(32&n)return 0;if(384&n)return 1;if(524288&n)return 5;if(64&n){if(2&r)return 2}else if(262144&n)return 4;var a=t.valueDeclaration||t.declarations&&t.declarations[0];return a&&e.isBindingElement(a)&&(a=i(a)),a&&l.get(a.kind)}(f,e.getMeaningFromLocation(d));if(void 0!==g){var m=0;d.parent&&(e.isBindingElement(d.parent)||l.get(d.parent.kind)===g)&&d.parent.name===d&&(m=1),6===g&&a(d)&&(g=9),g=function(t,r,n){if(7===n||9===n||6===n){var i=t.getTypeAtLocation(r);if(i){var o=function(e){return e(i)||i.isUnion()&&i.types.some(e)};if(6!==n&&o((function(e){return e.getConstructSignatures().length>0})))return 0;if(o((function(e){return e.getCallSignatures().length>0}))&&!o((function(e){return e.getProperties().length>0}))||function(t){for(;a(t);)t=t.parent;return e.isCallExpression(t.parent)&&t.parent.expression===t}(r))return 9===n?11:10}}return n}(c,d,g);var y=f.valueDeclaration;if(y){var v=e.getCombinedModifierFlags(y),h=e.getCombinedNodeFlags(y);32&v&&(m|=2),256&v&&(m|=4),0!==g&&2!==g&&(64&v||2&h||8&f.getFlags())&&(m|=8),7!==g&&10!==g||!function(t,r){return e.isBindingElement(t)&&(t=i(t)),e.isVariableDeclaration(t)?(!e.isSourceFile(t.parent.parent.parent)||e.isCatchClause(t.parent))&&t.getSourceFile()===r:!!e.isFunctionDeclaration(t)&&!e.isSourceFile(t.parent)&&t.getSourceFile()===r}(y,r)||(m|=32),t.isSourceFileDefaultLibrary(y.getSourceFile())&&(m|=16);}else f.declarations&&f.declarations.some((function(e){return t.isSourceFileDefaultLibrary(e.getSourceFile())}))&&(m|=16);o(d,g,m);}}}e.forEachChild(d,_),u=p;}}(r);}(t,r,n,(function(e,t,n){s.push(e.getStart(r),e.getWidth(r),(t+1<<8)+n);}),o),s}function i(t){for(;;){if(!e.isBindingElement(t.parent.parent))return t.parent.parent;t=t.parent.parent;}}function a(t){return e.isQualifiedName(t.parent)&&t.parent.right===t||e.isPropertyAccessExpression(t.parent)&&t.parent.name===t}var o,s,c;(c=t.TokenEncodingConsts||(t.TokenEncodingConsts={}))[c.typeOffset=8]="typeOffset",c[c.modifierMask=255]="modifierMask",(s=t.TokenType||(t.TokenType={}))[s.class=0]="class",s[s.enum=1]="enum",s[s.interface=2]="interface",s[s.namespace=3]="namespace",s[s.typeParameter=4]="typeParameter",s[s.type=5]="type",s[s.parameter=6]="parameter",s[s.variable=7]="variable",s[s.enumMember=8]="enumMember",s[s.property=9]="property",s[s.function=10]="function",s[s.member=11]="member",(o=t.TokenModifier||(t.TokenModifier={}))[o.declaration=0]="declaration",o[o.static=1]="static",o[o.async=2]="async",o[o.readonly=3]="readonly",o[o.defaultLibrary=4]="defaultLibrary",o[o.local=5]="local",t.getSemanticClassifications=function(t,n,i,a){var o=r(t,n,i,a);e.Debug.assert(o.spans.length%3==0);for(var s=o.spans,c=[],l=0;l<s.length;l+=3)c.push({textSpan:e.createTextSpan(s[l],s[l+1]),classificationType:s[l+2]});return c},t.getEncodedSemanticClassifications=r;var l=new e.Map([[253,7],[163,6],[166,9],[260,3],[259,1],[297,8],[256,0],[168,11],[255,10],[212,10],[167,11],[171,9],[172,9],[165,9],[257,2],[258,5],[162,4],[294,9],[295,9]]);})((t=e.classifier||(e.classifier={})).v2020||(t.v2020={}));}(t),function(e){var t;(function(r){function i(e){return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!0,entries:e.map((function(e){var r=e.name,n=e.kind,i=e.span;return {name:r,kind:n,kindModifiers:a(e.extension),sortText:t.SortText.LocationPriority,replacementSpan:i}}))}}function a(t){switch(t){case".d.ts":return ".d.ts";case".js":return ".js";case".json":return ".json";case".jsx":return ".jsx";case".ts":return ".ts";case".tsx":return ".tsx";case".d.mts":return ".d.mts";case".mjs":return ".mjs";case".mts":return ".mts";case".d.cts":return ".d.cts";case".cjs":return ".cjs";case".cts":return ".cts";case".tsbuildinfo":return e.Debug.fail("Extension ".concat(".tsbuildinfo"," is unsupported."));case void 0:return "";default:return e.Debug.assertNever(t)}}var o,s;function c(r,n,i,a,o,s,c){var d,p,f=l(n.parent);switch(f.kind){case 195:var m=l(f.parent);switch(m.kind){case 177:var y=m,v=e.findAncestor(f,(function(e){return e.parent===y}));return v?{kind:2,types:_(a.getTypeArgumentConstraint(v)),isNewIdentifier:!1}:void 0;case 193:var h=m,b=h.indexType,x=h.objectType;if(!e.rangeContainsPosition(b,i))return;return u(a.getTypeFromTypeNode(x));case 199:return {kind:0,paths:g(r,n,o,s,a,c)};case 186:if(!e.isTypeReferenceNode(m.parent))return;var D=(d=m,p=f,e.mapDefined(d.types,(function(t){return t!==p&&e.isLiteralTypeNode(t)&&e.isStringLiteral(t.literal)?t.literal.text:void 0})));return {kind:2,types:_(a.getTypeArgumentConstraint(m)).filter((function(t){return !e.contains(D,t.value)})),isNewIdentifier:!1};default:return}case 294:return e.isObjectLiteralExpression(f.parent)&&f.name===n?function(r,n){var i=r.getContextualType(n);if(i){var a=r.getContextualType(n,4);return {kind:1,symbols:t.getPropertiesForObjectExpression(i,a,n,r),hasIndexSignature:e.hasIndexSignature(i)}}}(a,f.parent):k();case 206:var S=f,T=S.expression,C=S.argumentExpression;return n===e.skipParentheses(C)?u(a.getTypeAtLocation(T)):void 0;case 207:case 208:if(!function(t){return e.isCallExpression(t.parent)&&e.firstOrUndefined(t.parent.arguments)===t&&e.isIdentifier(t.parent.expression)&&"require"===t.parent.expression.escapedText}(n)&&!e.isImportCall(f)){var E=e.SignatureHelp.getArgumentInfoForCompletions(n,i,r);return E?function(t,r){var n=!1,i=new e.Map,a=[];return r.getResolvedSignature(t.invocation,a,t.argumentCount),{kind:2,types:e.flatMap(a,(function(a){if(e.signatureHasRestParameter(a)||!(t.argumentCount>a.parameters.length)){var o=r.getParameterType(a,t.argumentIndex);return n=n||!!(4&o.flags),_(o,i)}})),isNewIdentifier:n}}(E,a):k()}case 265:case 271:case 276:return {kind:0,paths:g(r,n,o,s,a,c)};default:return k()}function k(){return {kind:2,types:_(e.getContextualTypeFromParent(n,a)),isNewIdentifier:!1}}}function l(t){switch(t.kind){case 190:return e.walkUpParenthesizedTypes(t);case 211:return e.walkUpParenthesizedExpressions(t);default:return t}}function u(t){return t&&{kind:1,symbols:e.filter(t.getApparentProperties(),(function(t){return !(t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))})),hasIndexSignature:e.hasIndexSignature(t)}}function _(t,r){return void 0===r&&(r=new e.Map),t?(t=e.skipConstraint(t)).isUnion()?e.flatMap(t.types,(function(e){return _(e,r)})):!t.isStringLiteral()||1024&t.flags||!e.addToSeen(r,t.value)?e.emptyArray:[t]:e.emptyArray}function d(e,t,r){return {name:e,kind:t,extension:r}}function p(e){return d(e,"directory",void 0)}function f(t,r,n){var i=function(t,r){var n=Math.max(t.lastIndexOf(e.directorySeparator),t.lastIndexOf(e.altDirectorySeparator)),i=-1!==n?n+1:0,a=t.length-i;return 0===a||e.isIdentifierText(t.substr(i,a),99)?void 0:e.createTextSpan(r+i,a)}(t,r),a=0===t.length?void 0:e.createTextSpan(r,t.length);return n.map((function(t){var r=t.name,n=t.kind,o=t.extension;return -1!==Math.max(r.indexOf(e.directorySeparator),r.indexOf(e.altDirectorySeparator))?{name:r,kind:n,extension:o,span:a}:{name:r,kind:n,extension:o,span:i}}))}function g(t,r,i,a,o,s){return f(r.text,r.getStart(t)+1,function(t,r,i,a,o,s){var c,l=e.normalizeSlashes(r.text),u=t.path,_=e.getDirectoryPath(u);return function(e){if(e&&e.length>=2&&46===e.charCodeAt(0)){var t=e.length>=3&&46===e.charCodeAt(1)?2:1,r=e.charCodeAt(t);return 47===r||92===r}return !1}(l)||!i.baseUrl&&(e.isRootedDiskPath(l)||e.isUrl(l))?function(t,r,i,a,o,s){var c=m(i,s);return i.rootDirs?function(t,r,i,a,o,s,c){var l=function(t,r,i,a){t=t.map((function(t){return e.normalizePath(e.isRootedDiskPath(t)?t:e.combinePaths(r,t))}));var o=e.firstDefined(t,(function(t){return e.containsPath(t,i,r,a)?i.substr(t.length):void 0}));return e.deduplicate(n$3(n$3([],t.map((function(t){return e.combinePaths(t,o)})),!0),[i],!1),e.equateStringsCaseSensitive,e.compareStringsCaseSensitive)}(t,o.project||s.getCurrentDirectory(),i,!(s.useCaseSensitiveFileNames&&s.useCaseSensitiveFileNames()));return e.flatMap(l,(function(e){return v(r,e,a,s,c)}))}(i.rootDirs,t,r,c,i,a,o):v(t,r,c,a,o)}(l,_,i,a,u,(c=e.isStringLiteralLike(r)?e.getModeForUsageLocation(t,r):void 0,"js"===s.importModuleSpecifierEnding||c===e.ModuleKind.ESNext?2:0)):function(t,r,n,i,a){var o=n.baseUrl,s=n.paths,c=[],l=m(n);if(o){var u=n.project||i.getCurrentDirectory(),_=e.normalizePath(e.combinePaths(u,o));v(t,_,l,i,void 0,c),s&&h(c,t,_,l.extensions,s,i);}for(var p=b(t),f=0,g=function(t,r,n){var i=n.getAmbientModules().map((function(t){return e.stripQuotes(t.name)})).filter((function(r){return e.startsWith(r,t)}));if(void 0!==r){var a=e.ensureTrailingDirectorySeparator(r);return i.map((function(t){return e.removePrefix(t,a)}))}return i}(t,p,a);f<g.length;f++){var y=g[f];c.push(d(y,"external module name",void 0));}if(D(i,n,r,p,l,c),e.getEmitModuleResolutionKind(n)===e.ModuleResolutionKind.NodeJs){var x=!1;if(void 0===p)for(var S=function(e){c.some((function(t){return t.name===e}))||(x=!0,c.push(d(e,"external module name",void 0)));},C=0,E=function(t,r){if(!t.readFile||!t.fileExists)return e.emptyArray;for(var n=[],i=0,a=e.findPackageJsons(r,t);i<a.length;i++)for(var o=a[i],s=e.readJson(o,t),c=0,l=T;c<l.length;c++){var u=s[l[c]];if(u)for(var _ in u)u.hasOwnProperty(_)&&!e.startsWith(_,"@types/")&&n.push(_);}return n}(i,r);C<E.length;C++)S(E[C]);x||e.forEachAncestorDirectory(r,(function(r){var n=e.combinePaths(r,"node_modules");e.tryDirectoryExists(i,n)&&v(t,n,l,i,void 0,c);}));}return c}(l,_,i,a,o)}(t,r,i,a,o,s))}function m(t,r){return void 0===r&&(r=0),{extensions:e.flatten(y(t)),includeExtensionsOption:r}}function y(t){var r=e.getSupportedExtensions(t);return e.getEmitModuleResolutionKind(t)===e.ModuleResolutionKind.NodeJs?e.getSupportedExtensionsWithJsonIfResolveJsonModule(t,r):r}function v(t,r,n,i,a,o){var s=n.extensions,c=n.includeExtensionsOption;void 0===o&&(o=[]),void 0===t&&(t=""),t=e.normalizeSlashes(t),e.hasTrailingDirectorySeparator(t)||(t=e.getDirectoryPath(t)),""===t&&(t="."+e.directorySeparator),t=e.ensureTrailingDirectorySeparator(t);var l=e.resolvePath(r,t),u=e.hasTrailingDirectorySeparator(l)?l:e.getDirectoryPath(l),_=!(i.useCaseSensitiveFileNames&&i.useCaseSensitiveFileNames());if(!e.tryDirectoryExists(i,u))return o;var f=e.tryReadDirectory(i,u,s,void 0,["./*"]);if(f){for(var g=new e.Map,m=0,y=f;m<y.length;m++){var v=y[m];if(v=e.normalizePath(v),!a||0!==e.comparePaths(v,a,r,_)){var b=void 0,x=e.moduleSpecifiers.tryGetJSExtensionForFile(v,i.getCompilationSettings());0!==c||e.fileExtensionIsOneOf(v,[".json",".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])?(e.fileExtensionIsOneOf(v,[".mts",".cts",".d.mts",".d.cts",".mjs",".cjs"])||2===c)&&x?(b=e.changeExtension(e.getBaseFileName(v),x),g.set(b,x)):(b=e.getBaseFileName(v),g.set(b,e.tryGetExtensionFromPath(v))):(b=e.removeFileExtension(e.getBaseFileName(v)),g.set(b,e.tryGetExtensionFromPath(v)));}}g.forEach((function(e,t){o.push(d(t,"script",e));}));}var D=e.tryGetDirectories(i,u);if(D)for(var S=0,T=D;S<T.length;S++){var C=T[S],E=e.getBaseFileName(e.normalizePath(C));"@types"!==E&&o.push(p(E));}var k=e.findPackageJson(u,i);if(k){var N=e.readJson(k,i).typesVersions;if("object"==typeof N){var F=e.getPackageJsonTypesVersionsPaths(N),A=F&&F.paths,P=l.slice(e.ensureTrailingDirectorySeparator(u).length);A&&h(o,P,u,s,A,i);}}return o}function h(t,r,n,i,a,o){for(var s in a)if(e.hasProperty(a,s)){var c=a[s];if(c)for(var l=function(e,r,n){t.some((function(t){return t.name===e}))||t.push(d(e,r,n));},u=0,_=x(s,c,r,n,i,o);u<_.length;u++){var p=_[u];l(p.name,p.kind,p.extension);}}}function b(t){return C(t)?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0}function x(t,r,i,a,o,s){if(!e.endsWith(t,"*"))return e.stringContains(t,"*")?e.emptyArray:u(t);var c=t.slice(0,t.length-1),l=e.tryRemovePrefix(i,c);return void 0===l?u(c):e.flatMap(r,(function(t){return function(t,r,i,a,o){if(o.readDirectory){var s=e.tryParsePattern(i);if(void 0!==s&&!e.isString(s)){var c=e.resolvePath(s.prefix),l=e.hasTrailingDirectorySeparator(s.prefix)?c:e.getDirectoryPath(c),u=e.hasTrailingDirectorySeparator(s.prefix)?"":e.getBaseFileName(c),_=C(t),f=_?e.hasTrailingDirectorySeparator(t)?t:e.getDirectoryPath(t):void 0,g=_?e.combinePaths(l,u+f):l,m=e.normalizePath(s.suffix),y=e.normalizePath(e.combinePaths(r,g)),v=_?y:e.ensureTrailingDirectorySeparator(y)+u,h=m?"**/*":"./*",b=e.mapDefined(e.tryReadDirectory(o,y,a,void 0,[h]),(function(t){var r=e.tryGetExtensionFromPath(t),n=D(t);return void 0===n?void 0:d(e.removeFileExtension(n),"script",r)})),x=e.mapDefined(e.tryGetDirectories(o,y).map((function(t){return e.combinePaths(y,t)})),(function(e){var t=D(e);return void 0===t?void 0:p(t)}));return n$3(n$3([],b,!0),x,!0)}}function D(t){var r,n,i,a=(r=e.normalizePath(t),n=v,i=m,e.startsWith(r,n)&&e.endsWith(r,i)?r.slice(n.length,r.length-i.length):void 0);return void 0===a?void 0:function(t){return t[0]===e.directorySeparator?t.slice(1):t}(a)}}(l,a,t,o,s)}));function u(t){return e.startsWith(t,i)?[p(t)]:e.emptyArray}}function D(t,r,n,i,a,o){void 0===o&&(o=[]);for(var s=new e.Map,c=0,l=e.tryAndIgnoreErrors((function(){return e.getEffectiveTypeRoots(r,t)}))||e.emptyArray;c<l.length;c++)f(l[c]);for(var u=0,_=e.findPackageJsons(n,t);u<_.length;u++){var p=_[u];f(e.combinePaths(e.getDirectoryPath(p),"node_modules/@types"));}return o;function f(n){if(e.tryDirectoryExists(t,n))for(var c=0,l=e.tryGetDirectories(t,n);c<l.length;c++){var u=l[c],_=e.unmangleScopedPackageName(u);if(!r.types||e.contains(r.types,_))if(void 0===i)s.has(_)||(o.push(d(_,"external module name",void 0)),s.set(_,!0));else {var p=e.combinePaths(n,u),f=e.tryRemoveDirectoryPrefix(i,_,e.hostGetCanonicalFileName(t));void 0!==f&&v(f,p,a,t,void 0,o);}}}}r.getStringLiteralCompletions=function(r,n,a,o,s,l,u,_){if(e.isInReferenceComment(r,n))return (d=function(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=e.getLeadingCommentRanges(t.text,a.pos),s=o&&e.find(o,(function(e){return r>=e.pos&&r<=e.end}));if(s){var c=t.text.slice(s.pos,r),l=S.exec(c);if(l){var u=l[1],_=l[2],d=l[3],p=e.getDirectoryPath(t.path),g="path"===_?v(d,p,m(n,1),i,t.path):"types"===_?D(i,n,p,b(d),m(n)):e.Debug.fail();return f(d,s.pos+u.length,g)}}}(r,n,o,s))&&i(d);if(e.isInString(r,n,a)){if(!a||!e.isStringLiteralLike(a))return;var d;return function(r,n,a,o,s,c,l,u){if(void 0!==r){var _=e.createTextSpanFromStringLiteralLikeContent(n);switch(r.kind){case 0:return i(r.paths);case 1:var d=[];return t.getCompletionEntriesFromSymbols(r.symbols,d,n,n,a,a,o,s,99,c,4,u,l),{isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:r.hasIndexSignature,optionalReplacementSpan:_,entries:d};case 2:return d=r.types.map((function(r){return {name:r.value,kindModifiers:"",kind:"string",sortText:t.SortText.LocationPriority,replacementSpan:e.getReplacementSpanForContextToken(n)}})),{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:r.isNewIdentifier,optionalReplacementSpan:_,entries:d};default:return e.Debug.assertNever(r)}}}(d=c(r,a,n,l.getTypeChecker(),o,s,_),a,r,s,l,u,o,_)}},r.getStringLiteralCompletionDetails=function(r,n,i,o,s,l,u,_,d){if(o&&e.isStringLiteralLike(o)){var p=c(n,o,i,s,l,u,d);return p&&function(r,n,i,o,s,c){switch(i.kind){case 0:return (l=e.find(i.paths,(function(e){return e.name===r})))&&t.createCompletionDetails(r,a(l.extension),l.kind,[e.textPart(r)]);case 1:var l;return (l=e.find(i.symbols,(function(e){return e.name===r})))&&t.createCompletionDetailsForSymbol(l,s,o,n,c);case 2:return e.find(i.types,(function(e){return e.value===r}))?t.createCompletionDetails(r,"","type",[e.textPart(r)]):void 0;default:return e.Debug.assertNever(i)}}(r,o,p,n,s,_)}},function(e){e[e.Paths=0]="Paths",e[e.Properties=1]="Properties",e[e.Types=2]="Types";}(o||(o={})),function(e){e[e.Exclude=0]="Exclude",e[e.Include=1]="Include",e[e.ModuleSpecifierCompletion=2]="ModuleSpecifierCompletion";}(s||(s={}));var S=/^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/,T=["dependencies","devDependencies","peerDependencies","optionalDependencies"];function C(t){return e.stringContains(t,e.directorySeparator)}})((t=e.Completions||(e.Completions={})).StringCompletions||(t.StringCompletions={}));}(t),function(e){!function(t){var r,n,a,o,s,c,l,u;function _(e){return !!(e&&4&e.kind)}function d(e){return !(!e||32!==e.kind)}function p(e){return (_(e)||d(e))&&!!e.isFromPackageJson}function f(r,n,i,a,o,s,c){var l,u,_,d=e.timestamp(),p=!1,f=0,g=0,m=0,y=0,v=c({tryResolve:function(r,c){if(c){var l=e.codefix.getModuleSpecifierForBestExportInfo(r,a,i,n,o);return l&&f++,l}var u=s||o.allowIncompleteCompletions&&g<t.moduleSpecifierResolutionLimit,_=!u&&o.allowIncompleteCompletions&&y<t.moduleSpecifierResolutionCacheAttemptLimit,d=u||_?e.codefix.getModuleSpecifierForBestExportInfo(r,a,i,n,o,_):void 0;return (!u&&!_||_&&!d)&&(p=!0),g+=(null==d?void 0:d.computedWithoutCacheCount)||0,m+=r.length-g,_&&y++,d},resolutionLimitExceeded:function(){return p}}),h=y?" (".concat((m/y*100).toFixed(1),"% hit rate)"):"";return null===(l=n.log)||void 0===l||l.call(n,"".concat(r,": resolved ").concat(g," module specifiers, plus ").concat(f," ambient and ").concat(m," from cache").concat(h)),null===(u=n.log)||void 0===u||u.call(n,"".concat(r,": response is ").concat(p?"incomplete":"complete")),null===(_=n.log)||void 0===_||_.call(n,"".concat(r,": ").concat(e.timestamp()-d)),v}function g(e){return !!(null==e?void 0:e.moduleSpecifier)}function m(e){return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e}}function y(e,t,r){return {kind:4,keywordCompletions:K(e,t),isNewIdentifierLocation:r}}function v(t){return 79===(null==t?void 0:t.kind)?e.createTextSpanFromNode(t):void 0}function h(t,r){return e.isSourceFileJS(t)&&!e.isCheckJsEnabledForFile(t,r)}function b(e){switch(e){case 0:case 3:case 2:return !0;default:return !1}}function x(t,r,n){return "object"==typeof n?e.pseudoBigIntToString(n)+"n":e.isString(n)?e.quote(t,r,n):JSON.stringify(n)}function D(e,t,n){return {name:x(e,t,n),kind:"string",kindModifiers:"",sortText:r.LocationPriority}}function S(t,r,n,i,o,s,c,l,u,f,g,m,y,v,h,b,x,D,S){var C,k,P,w,I,O,M,L=e.getReplacementSpanForContextToken(n),R=A(g),B=l.getTypeChecker(),j=g&&function(e){return !!(16&e.kind)}(g),J=g&&function(e){return !!(2&e.kind)}(g)||f;if(g&&function(e){return !!(1&e.kind)}(g))P=f?"this".concat(j?"?.":"","[").concat(N(s,D,u),"]"):"this".concat(j?"?.":".").concat(u);else if((J||j)&&y){P=J?"[".concat(f?N(s,D,u):u,"]"):u,(j||y.questionDotToken)&&(P="?.".concat(P));var z=e.findChildOfKind(y,24,s)||e.findChildOfKind(y,28,s);if(!z)return;var U=e.startsWith(u,y.name.text)?y.name.end:z.end;L=e.createTextSpanFromBounds(z.getStart(s),U);}if(v&&(void 0===P&&(P=u),P="{".concat(P,"}"),"boolean"!=typeof v&&(L=e.createTextSpanFromNode(v,s))),g&&function(e){return !!(8&e.kind)}(g)&&y){void 0===P&&(P=u);var K=e.findPrecedingToken(y.pos,s),V="";K&&e.positionIsASICandidate(K.end,K.parent,s)&&(V=";"),V+="(await ".concat(y.expression.getText(),")"),P=f?"".concat(V).concat(P):"".concat(V).concat(j?"?.":".").concat(P),L=e.createTextSpanFromBounds(y.getStart(s),y.end);}if(d(g)&&(O=[e.textPart(g.moduleSpecifier)],h&&(P=(C=function(t,r,n,i,a,o,s){var c,l,u,_=r.getSourceFile(),d=e.createTextSpanFromNode(e.findAncestor(r,e.or(e.isImportDeclaration,e.isImportEqualsDeclaration))||r,_),p=e.quote(_,s,i.moduleSpecifier),f=i.isDefaultExport?1:"export="===i.exportName?2:0,g=s.includeCompletionsWithSnippetText?"$1":"",m=e.codefix.getImportKind(_,f,o,!0),y=(null===(l=null===(c=e.tryCast(r,e.isImportDeclaration))||void 0===c?void 0:c.importClause)||void 0===l?void 0:l.isTypeOnly)||(null===(u=e.tryCast(r,e.isImportEqualsDeclaration))||void 0===u?void 0:u.isTypeOnly),v=re(r,n),h=y?" ".concat(e.tokenToString(151)," "):" ",b=v?"".concat(e.tokenToString(151)," "):"",x=a?";":"";switch(m){case 3:return {replacementSpan:d,insertText:"import".concat(h).concat(e.escapeSnippetText(t)).concat(g," = require(").concat(p,")").concat(x)};case 1:return {replacementSpan:d,insertText:"import".concat(h).concat(e.escapeSnippetText(t)).concat(g," from ").concat(p).concat(x)};case 2:return {replacementSpan:d,insertText:"import".concat(h,"* as ").concat(e.escapeSnippetText(t)," from ").concat(p).concat(x)};case 0:return {replacementSpan:d,insertText:"import".concat(h,"{ ").concat(b).concat(e.escapeSnippetText(t)).concat(g," } from ").concat(p).concat(x)}}}(u,h,i,g,b,x,D)).insertText,L=C.replacementSpan,I=!!D.includeCompletionsWithSnippetText||void 0)),D.includeCompletionsWithClassMemberSnippets&&D.includeCompletionsWithInsertText&&3===S&&function(t,r){if(e.isInJSFile(r))return !1;return !!(106500&t.flags)&&(e.isClassLike(r)||r.parent&&r.parent.parent&&e.isClassElement(r.parent)&&r===r.parent.name&&e.isClassLike(r.parent.parent)||r.parent&&e.isSyntaxList(r)&&e.isClassLike(r.parent))}(t,o)){var q=void 0;P=(k=T(c,l,x,D,u,t,o,i)).insertText,I=k.isSnippet,(null==(q=k.importAdder)?void 0:q.hasFixes())&&(M=!0,R=a.ClassMemberSnippet);}var W=e.SymbolDisplay.getSymbolKind(B,t,o);if("JSX attribute"===W&&(29!==o.kind||o.pos!==o.parent.pos)&&D.includeCompletionsWithSnippetText&&D.jsxAttributeCompletionStyle&&"none"!==D.jsxAttributeCompletionStyle){var H="braces"===D.jsxAttributeCompletionStyle,G=B.getTypeOfSymbolAtLocation(t,o);"auto"!==D.jsxAttributeCompletionStyle||528&G.flags||1048576&G.flags&&e.find(G.types,(function(e){return !!(528&e.flags)}))||(402653316&G.flags||1048576&G.flags&&e.every(G.types,(function(e){return !!(402686084&e.flags)}))?(P="".concat(e.escapeSnippetText(u),"=").concat(e.quote(s,D,"$1")),I=!0):H=!0),H&&(P="".concat(e.escapeSnippetText(u),"={$1}"),I=!0);}if(void 0===P||D.includeCompletionsWithInsertText)return (_(g)||d(g))&&(w=E(g),M=!h),{name:u,kind:W,kindModifiers:e.SymbolDisplay.getSymbolModifiers(B,t),sortText:r,source:R,hasAction:!!M||void 0,isRecommended:F(t,m,B)||void 0,insertText:P,replacementSpan:L,sourceDisplay:O,isSnippet:I,isPackageJsonImport:p(g)||void 0,isImportStatementCompletion:!!h||void 0,data:w}}function T(t,r,n,a,o,s,c,l){var u,_=e.findAncestor(c,e.isClassLike);if(!_)return {insertText:o};var d,p=o,f=r.getTypeChecker(),g=c.getSourceFile(),m=function(t){var r=e.createPrinter(t),n=e.createTextWriter(e.getNewLineCharacter(t)),a=i$1(i$1({},n),{write:function(t){return n.write(e.escapeSnippetText(t))},nonEscapingWrite:n.write,writeLiteral:function(t){return n.writeLiteral(e.escapeSnippetText(t))},writeStringLiteral:function(t){return n.writeStringLiteral(e.escapeSnippetText(t))},writeSymbol:function(t,r){return n.writeSymbol(e.escapeSnippetText(t),r)},writeParameter:function(t){return n.writeParameter(e.escapeSnippetText(t))},writeComment:function(t){return n.writeComment(e.escapeSnippetText(t))},writeProperty:function(t){return n.writeProperty(e.escapeSnippetText(t))}});return {printSnippetList:function(e,t,n){return a.clear(),r.writeList(e,t,n,a),a.getText()}}}({removeComments:!0,module:n.module,target:n.target,omitTrailingSemicolon:!1,newLine:e.getNewLineKind(e.getNewLineCharacter(n,e.maybeBind(t,t.getNewLine)))}),y=e.codefix.createImportAdder(g,r,a,t);if(a.includeCompletionsWithSnippetText){u=!0;var v=e.factory.createExpressionStatement(e.factory.createIdentifier(""));e.setSnippetElement(v,{kind:0,order:0}),d=e.factory.createBlock([v],!0);}else d=e.factory.createBlock([],!0);var h=0,b=l&&126===C(l),x=[];return e.codefix.addNewNodeForMemberSymbol(s,_,g,{program:r,host:t},a,y,(function(t){var r=0;b&&(r|=128),e.isClassElement(t)&&1===f.getMemberOverrideModifierStatus(_,t)&&(r|=16384);var n=0;x.length||(l&&(n=function(t){var r,n=0;return (r=C(t))&&(n|=e.modifierToFlag(r)),e.isPropertyDeclaration(t.parent)&&(n|=e.modifiersToFlags(t.parent.modifiers)),n}(l)),h=t.modifierFlagsCache|r|n),t=e.factory.updateModifiers(t,h&~n),x.push(t);}),d,2,b),x.length&&(p=m.printSnippetList(131073,e.factory.createNodeArray(x),g)),{insertText:p,isSnippet:u,importAdder:y}}function C(t){return e.isModifier(t)?t.kind:e.isIdentifier(t)&&t.originalKeywordKind&&e.isModifierKind(t.originalKeywordKind)?t.originalKeywordKind:void 0}function E(t){var r=t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),n=!!t.isFromPackageJson||void 0;return d(t)?{exportName:t.exportName,moduleSpecifier:t.moduleSpecifier,ambientModuleName:r,fileName:t.fileName,isPackageJsonImport:n}:{exportName:t.exportName,exportMapKey:t.exportMapKey,fileName:t.fileName,ambientModuleName:t.fileName?void 0:e.stripQuotes(t.moduleSymbol.name),isPackageJsonImport:!!t.isFromPackageJson||void 0}}function k(e,t,r){var n="default"===e.exportName,i=!!e.isPackageJsonImport;return g(e)?{kind:32,exportName:e.exportName,moduleSpecifier:e.moduleSpecifier,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}:{kind:4,exportName:e.exportName,exportMapKey:e.exportMapKey,symbolName:t,fileName:e.fileName,moduleSymbol:r,isDefaultExport:n,isFromPackageJson:i}}function N(t,r,n){return /^\d+$/.test(n)?n:e.quote(t,r,n)}function F(e,t,r){return e===t||!!(1048576&e.flags)&&r.getExportSymbolOfSymbol(e)===t}function A(t){return _(t)?e.stripQuotes(t.moduleSymbol.name):d(t)?t.moduleSpecifier:1===(null==t?void 0:t.kind)?a.ThisProperty:void 0}function P(t,r,n,i,a,o,s,c,l,u,_,d,p,f,g,m,y,v,h,b,x){for(var D,T,C=e.timestamp(),E=(T=a,e.findAncestor(T,(function(t){return e.isFunctionBlock(t)||function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t}(t)||e.isBindingPattern(t)?"quit":e.isVariableDeclaration(t)}))),k=e.probablyUsesSemicolons(o),N=c.getTypeChecker(),F=new e.Map,A=0;A<t.length;A++){var P=t[A],w=null==b?void 0:b[A],I=J(P,l,w,_,!!m);if(I&&!F.get(I.name)&&(1!==_||!x||j(P,x))){var O=I.name,M=I.needsConvertPropertyAccess,L=null!==(D=null==x?void 0:x[e.getSymbolId(P)])&&void 0!==D?D:11,R=S(P,(oe(P,N)?8+L:L).toString(),n,i,a,o,s,c,O,M,w,h,g,y,v,k,p,d,_);if(R){var B=!(w||void 0===P.parent&&!e.some(P.declarations,(function(e){return e.getSourceFile()===a.getSourceFile()})));F.set(O,B),r.push(R);}}}return u("getCompletionsAtPosition: getCompletionEntriesFromSymbols: "+(e.timestamp()-C)),{has:function(e){return F.has(e)},add:function(e){return F.set(e,!0)}};function j(t,r){if(!e.isSourceFile(a)){if(e.isExportAssignment(a.parent))return !0;if(E&&t.valueDeclaration===E)return !1;var n=e.skipAlias(t,N);if(o.externalModuleIndicator&&!p.allowUmdGlobalAccess&&15===r[e.getSymbolId(t)]&&(16===r[e.getSymbolId(n)]||11===r[e.getSymbolId(n)]))return !1;if(t=n,e.isInRightSideOfInternalImportEqualsDeclaration(a))return !!(1920&t.flags);if(f)return ae(t,N)}return !!(111551&e.getCombinedLocalAndExportSymbolFlags(t))}}function w(t,r,n,i,o,s,c){if(o.data){var l=j(o.name,o.data,t,s);if(l){var u=B(i,n),_=u.contextToken,d=u.previousToken;return {type:"symbol",symbol:l.symbol,location:e.getTouchingPropertyName(n,i),previousToken:d,contextToken:_,isJsxInitializer:!1,isTypeOnlyLocation:!1,origin:l.origin}}}var p=t.getCompilerOptions(),f=R(t,r,n,h(n,p),i,{includeCompletionsForModuleExports:!0,includeCompletionsWithInsertText:!0},o,s);if(!f)return {type:"none"};if(0!==f.kind)return {type:"request",request:f};var g=f.symbols,m=f.literals,y=f.location,v=f.completionKind,b=f.symbolToOriginInfoMap,D=f.contextToken,S=f.previousToken,T=f.isJsxInitializer,C=f.isTypeOnlyLocation,E=e.find(m,(function(e){return x(n,c,e)===o.name}));return void 0!==E?{type:"literal",literal:E}:e.firstDefined(g,(function(t,r){var n=b[r],i=J(t,e.getEmitScriptTarget(p),n,v,f.isJsxIdentifierExpected);return i&&i.name===o.name&&(o.source===a.ClassMemberSnippet&&106500&t.flags||A(n)===o.source)?{type:"symbol",symbol:t,location:y,origin:n,contextToken:D,previousToken:S,isJsxInitializer:T,isTypeOnlyLocation:C}:void 0}))||{type:"none"}}function I(t,r,n){return M(t,"",r,[e.displayPart(t,n)])}function O(t,r,n,i,a,o,s){var c=r.runWithCancellationToken(a,(function(r){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,t,n,i,i,7)})),l=c.displayParts,u=c.documentation,_=c.symbolKind,d=c.tags;return M(t.name,e.SymbolDisplay.getSymbolModifiers(r,t),_,l,u,d,o,s)}function M(e,t,r,n,i,a,o,s){return {name:e,kindModifiers:t,kind:r,displayParts:n,documentation:i,tags:a,codeActions:o,source:s,sourceDisplay:s}}function L(t,r,n){var i=n.getAccessibleSymbolChain(t,r,67108863,!1);return i?e.first(i):t.parent&&(function(e){var t;return !!(null===(t=e.declarations)||void 0===t?void 0:t.some((function(e){return 303===e.kind})))}(t.parent)?t:L(t.parent,r,n))}function R(t,n,i,a,o,s,c,l,u){var _=t.getTypeChecker(),d=e.timestamp(),p=e.getTokenAtPosition(i,o);n("getCompletionData: Get current token: "+(e.timestamp()-d)),d=e.timestamp();var g=e.isInComment(i,o,p);n("getCompletionData: Is inside comment: "+(e.timestamp()-d));var m=!1,v=!1;if(g){if(e.hasDocComment(i,o)){if(64===i.text.charCodeAt(o-1))return {kind:1};var h=e.getLineStartPositionForPosition(o,i);if(!/[^\*|\s(/)]/.test(i.text.substring(h,o)))return {kind:2}}var b=function(t,r){var n=e.findAncestor(t,e.isJSDoc);return n&&n.tags&&(e.rangeContainsPosition(n,r)?e.findLast(n.tags,(function(e){return e.pos<r})):void 0)}(p,o);if(b){if(b.tagName.pos<=o&&o<=b.tagName.end)return {kind:1};if(function(e){switch(e.kind){case 338:case 345:case 339:case 341:case 343:return !0;default:return !1}}(b)&&b.typeExpression&&307===b.typeExpression.kind&&((p=e.getTokenAtPosition(i,o))&&(e.isDeclarationName(p)||345===p.parent.kind&&p.parent.name===p)||(m=Ne(b.typeExpression))),!m&&e.isJSDocParameterTag(b)&&(e.nodeIsMissing(b.name)||b.name.pos<=o&&o<=b.name.end))return {kind:3,tag:b}}if(!m)return void n("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.")}d=e.timestamp();var x=!m&&e.isSourceFileJS(i),D=B(o,i),S=D.previousToken,T=D.contextToken;n("getCompletionData: Get previous token: "+(e.timestamp()-d));var C,E,k,N=p,F=!1,A=!1,P=!1,w=!1,I=!1,O=!1,M=e.getTouchingPropertyName(i,o),R=0,j=!1;if(T){var J=te(T);if(j=J.isNewIdentifierLocation,J.keywordCompletion){if(J.isKeywordOnlyCompletion)return {kind:4,keywordCompletions:[(k=J.keywordCompletion,{name:e.tokenToString(k),kind:"keyword",kindModifiers:"",sortText:r.GlobalsOrKeywords})],isNewIdentifierLocation:j};R=function(t){switch(t){case 151:return 8;default:e.Debug.fail("Unknown mapping from SyntaxKind to KeywordCompletionFilters");}}(J.keywordCompletion);}if(J.replacementNode&&s.includeCompletionsForImportStatements&&s.includeCompletionsWithInsertText&&(E=J.replacementNode),!E&&function(t){var r=e.timestamp(),a=function(t){return (e.isRegularExpressionLiteral(t)||e.isStringTextContainingNode(t))&&(e.rangeContainsPositionExclusive(e.createTextRangeFromSpan(e.createTextSpanFromNode(t)),o)||o===t.end&&(!!t.isUnterminated||e.isRegularExpressionLiteral(t)))}(t)||function(t){var r=t.parent,n=r.kind;switch(t.kind){case 27:return 253===n||function(t){return 254===t.parent.kind&&!e.isPossiblyTypeArgumentPosition(t,i,_)}(t)||236===n||259===n||Te(n)||257===n||201===n||258===n||e.isClassLike(r)&&!!r.typeParameters&&r.typeParameters.end>=t.pos;case 24:return 201===n;case 58:return 202===n;case 22:return 201===n;case 20:return 291===n||Te(n);case 18:return 259===n;case 29:return 256===n||225===n||257===n||258===n||e.isFunctionLikeKind(n);case 124:return 166===n&&!e.isClassLike(r.parent);case 25:return 163===n||!!r.parent&&201===r.parent.kind;case 123:case 121:case 122:return 163===n&&!e.isConstructorDeclaration(r.parent);case 127:return 269===n||274===n||267===n;case 136:case 148:return !$(t);case 79:if(269===n&&t===r.name&&"type"===t.text)return !1;break;case 84:case 92:case 118:case 98:case 113:case 100:case 119:case 85:case 137:return !0;case 151:return 269!==n;case 41:return e.isFunctionLike(t.parent)&&!e.isMethodDeclaration(t.parent)}if(W(G(t))&&$(t))return !1;if(De(t)&&(!e.isIdentifier(t)||e.isParameterPropertyModifier(G(t))||Ne(t)))return !1;switch(G(t)){case 126:case 84:case 85:case 135:case 92:case 98:case 118:case 119:case 121:case 122:case 123:case 124:case 113:return !0;case 131:return e.isPropertyDeclaration(t.parent)}if(e.findAncestor(t.parent,e.isClassLike)&&t===S&&Se(t,o))return !1;var a=e.getAncestor(t.parent,166);if(a&&t!==S&&e.isClassLike(S.parent.parent)&&o<=S.end){if(Se(t,S.end))return !1;if(63!==t.kind&&(e.isInitializedProperty(a)||e.hasType(a)))return !0}return e.isDeclarationName(t)&&!e.isShorthandPropertyAssignment(t.parent)&&!e.isJsxAttribute(t.parent)&&!(e.isClassLike(t.parent)&&(t!==S||o>S.end))}(t)||function(e){if(8===e.kind){var t=e.getFullText();return "."===t.charAt(t.length-1)}return !1}(t)||function(e){if(11===e.kind)return !0;if(31===e.kind&&e.parent){if(279===e.parent.kind)return 279!==M.parent.kind;if(280===e.parent.kind||278===e.parent.kind)return !!e.parent.parent&&277===e.parent.parent.kind}return !1}(t)||e.isBigIntLiteral(t);return n("getCompletionsAtPosition: isCompletionListBlocker: "+(e.timestamp()-r)),a}(T))return n("Returning an empty list because completion was requested in an invalid position."),R?y(R,x,xe()):void 0;var z=T.parent;if(24===T.kind||28===T.kind)switch(F=24===T.kind,A=28===T.kind,z.kind){case 205:N=(C=z).expression;var U=e.getLeftmostAccessExpression(C);if(e.nodeIsMissing(U)||(e.isCallExpression(N)||e.isFunctionLike(N))&&N.end===T.pos&&N.getChildCount(i)&&21!==e.last(N.getChildren(i)).kind)return;break;case 160:N=z.left;break;case 260:N=z.name;break;case 199:N=z;break;case 230:N=z.getFirstToken(i),e.Debug.assert(100===N.kind||103===N.kind);break;default:return}else if(!E&&1===i.languageVariant){if(z&&205===z.kind&&(T=z,z=z.parent),p.parent===M)switch(p.kind){case 31:277!==p.parent.kind&&279!==p.parent.kind||(M=p);break;case 43:278===p.parent.kind&&(M=p);}switch(z.kind){case 280:43===T.kind&&(w=!0,M=T);break;case 220:if(!ee(z))break;case 278:case 277:case 279:O=!0,29===T.kind&&(P=!0,M=T);break;case 287:case 286:19===S.kind&&31===p.kind&&(O=!0);break;case 284:if(z.initializer===S&&S.end<o){O=!0;break}switch(S.kind){case 63:I=!0;break;case 79:O=!0,z!==S.parent&&!z.initializer&&e.findChildOfKind(z,63,i)&&(I=S);}}}}var K=e.timestamp(),V=5,H=!1,X=!1,ne=[],ie=[],oe=[],ce=new e.Map,le=m||!!E&&e.isTypeOnlyImportOrExportDeclaration(M.parent)||!function(t){return t&&(112===t.kind&&(180===t.parent.kind||e.isTypeOfExpression(t.parent))||128===t.kind&&176===t.parent.kind)}(T)&&(e.isPossiblyTypeArgumentPosition(T,i,_)||e.isPartOfTypeNode(M)||function(t){if(t){var r=t.parent.kind;switch(t.kind){case 58:return 166===r||165===r||163===r||253===r||e.isFunctionLikeKind(r);case 63:return 258===r;case 127:return 228===r;case 29:return 177===r||210===r;case 94:return 162===r}}return !1}(T)),ue=e.memoizeOne((function(r){return e.createModuleSpecifierResolutionHost(r?l.getPackageJsonAutoImportProvider():t,l)}));if(F||A)!function(){V=2;var t=e.isLiteralImportTypeNode(N),r=m||t&&!N.isTypeOf||e.isPartOfTypeNode(N.parent)||e.isPossiblyTypeArgumentPosition(T,i,_),n=e.isInRightSideOfInternalImportEqualsDeclaration(N);if(e.isEntityName(N)||t||e.isPropertyAccessExpression(N)){var a=e.isModuleDeclaration(N.parent);a&&(j=!0);var o=_.getSymbolAtLocation(N);if(o&&1920&(o=e.skipAlias(o,_)).flags){var c=_.getExportsOfModule(o);e.Debug.assertEachIsDefined(c,"getExportsOfModule() should all be defined");for(var l=function(e){return _.isValidPropertyAccess(t?N:N.parent,e.name)},u=function(e){return ae(e,_)},d=a?function(e){var t;return !!(1920&e.flags)&&!(null===(t=e.declarations)||void 0===t?void 0:t.every((function(e){return e.parent===N.parent})))}:n?function(e){return u(e)||l(e)}:r?u:l,p=0,f=c;p<f.length;p++){var g=f[p];d(g)&&ne.push(g);}if(!r&&o.declarations&&o.declarations.some((function(e){return 303!==e.kind&&260!==e.kind&&259!==e.kind}))){var y=!1;(v=_.getTypeOfSymbolAtLocation(o,N).getNonOptionalType()).isNullableType()&&((h=F&&!A&&!1!==s.includeAutomaticOptionalChainCompletions)||A)&&(v=v.getNonNullableType(),h&&(y=!0)),me(v,!!(32768&N.flags),y);}return}}if(!r){var v,h,b=e.getThisContainer(N,!1);!e.isSourceFile(b)&&b.parent&&_.getTypeAtLocation(b),y=!1,(v=_.getTypeAtLocation(N).getNonOptionalType()).isNullableType()&&((h=F&&!A&&!1!==s.includeAutomaticOptionalChainCompletions)||A)&&(v=v.getNonNullableType(),h&&(y=!0)),me(v,!!(32768&N.flags),y);}}();else if(P)ne=_.getJsxIntrinsicTagNamesAt(M),e.Debug.assertEachIsDefined(ne,"getJsxIntrinsicTagNames() should all be defined"),he(),V=1,R=0;else if(w){var _e=T.parent.parent.openingElement.tagName,de=_.getSymbolAtLocation(_e);de&&(ne=[de]),V=1,R=0;}else if(!he())return R?y(R,x,j):void 0;n("getCompletionData: Semantic work: "+(e.timestamp()-K));var pe=S&&function(t,r,n,i){var a=t.parent;switch(t.kind){case 79:return e.getContextualTypeFromParent(t,i);case 63:switch(a.kind){case 253:return i.getContextualType(a.initializer);case 220:return i.getTypeAtLocation(a.left);case 284:return i.getContextualTypeForJsxAttribute(a);default:return}case 103:return i.getContextualType(a);case 82:return e.getSwitchedType(e.cast(a,e.isCaseClause),i);case 18:return !e.isJsxExpression(a)||e.isJsxElement(a.parent)||e.isJsxFragment(a.parent)?void 0:i.getContextualTypeForJsxAttribute(a.parent);default:var o=e.SignatureHelp.getArgumentInfoForCompletions(t,r,n);return o?i.getContextualTypeForArgumentAtIndex(o.invocation,o.argumentIndex+(27===t.kind?1:0)):e.isEqualityOperatorKind(t.kind)&&e.isBinaryExpression(a)&&e.isEqualityOperatorKind(a.operatorToken.kind)?i.getTypeAtLocation(a.left):i.getContextualType(t)}}(S,o,i,_),fe=e.mapDefined(pe&&(pe.isUnion()?pe.types:[pe]),(function(e){return !e.isLiteral()||1024&e.flags?void 0:e.value})),ge=S&&pe&&function(t,r,n){return e.firstDefined(r&&(r.isUnion()?r.types:[r]),(function(r){var i=r&&r.symbol;return i&&424&i.flags&&!e.isAbstractConstructorSymbol(i)?L(i,t,n):void 0}))}(S,pe,_);return {kind:0,symbols:ne,completionKind:V,isInSnippetScope:v,propertyAccessToConvert:C,isNewIdentifierLocation:j,location:M,keywordFilters:R,literals:fe,symbolToOriginInfoMap:ie,recommendedCompletion:ge,previousToken:S,contextToken:T,isJsxInitializer:I,insideJsDocTagTypeExpression:m,symbolToSortTextIdMap:oe,isTypeOnlyLocation:le,isJsxIdentifierExpected:O,importCompletionNode:E,hasUnresolvedAutoImports:X};function me(t,r,n){j=!!t.getStringIndexType(),A&&e.some(t.getCallSignatures())&&(j=!0);var i=199===N.kind?N:N.parent;if(a)ne.push.apply(ne,e.filter(Y(t,_),(function(e){return _.isValidPropertyAccessForCompletions(i,t,e)})));else for(var o=0,c=t.getApparentProperties();o<c.length;o++){var l=c[o];_.isValidPropertyAccessForCompletions(i,t,l)&&ye(l,!1,n);}if(r&&s.includeCompletionsWithInsertText){var u=_.getPromisedTypeOfPromise(t);if(u)for(var d=0,p=u.getApparentProperties();d<p.length;d++)l=p[d],_.isValidPropertyAccessForCompletions(i,u,l)&&ye(l,!0,n);}}function ye(r,n,a){var o,c=e.firstDefined(r.declarations,(function(t){return e.tryCast(e.getNameOfDeclaration(t),e.isComputedPropertyName)}));if(c){var u=ve(c.expression),d=u&&_.getSymbolAtLocation(u),p=d&&L(d,T,_);if(p&&e.addToSeen(ce,e.getSymbolId(p))){var f=ne.length;ne.push(p);var g=p.parent;if(g&&e.isExternalModuleSymbol(g)&&_.tryGetMemberInModuleExportsAndProperties(p.name,g)===p){var m=e.isExternalModuleNameRelative(e.stripQuotes(g.name))?null===(o=e.getSourceFileOfModule(g))||void 0===o?void 0:o.fileName:void 0,y=(e.codefix.getModuleSpecifierForBestExportInfo([{exportKind:0,moduleFileName:m,isFromPackageJson:!1,moduleSymbol:g,symbol:p,targetFlags:e.skipAlias(p,_).flags}],i,t,l,s)||{}).moduleSpecifier;if(y){var v={kind:x(6),moduleSymbol:g,isDefaultExport:!1,symbolName:p.name,exportName:p.name,fileName:m,moduleSpecifier:y};ie[f]=v;}}else ie[f]={kind:x(2)};}else s.includeCompletionsWithInsertText&&(b(r),h(r),ne.push(r));}else b(r),h(r),ne.push(r);function h(t){(function(t){return !!(t.valueDeclaration&&32&e.getEffectiveModifierFlags(t.valueDeclaration)&&e.isClassLike(t.valueDeclaration.parent))})(t)&&(oe[e.getSymbolId(t)]=10);}function b(t){s.includeCompletionsWithInsertText&&(n&&e.addToSeen(ce,e.getSymbolId(t))?ie[ne.length]={kind:x(8)}:a&&(ie[ne.length]={kind:16}));}function x(e){return a?16|e:e}}function ve(t){return e.isIdentifier(t)?t:e.isPropertyAccessExpression(t)?ve(t.expression):void 0}function he(){return 1===(function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 18:if(e.isTypeLiteralNode(r))return r;break;case 26:case 27:case 79:if(165===r.kind&&e.isTypeLiteralNode(r.parent))return r.parent}}}(T);if(!t)return 0;var r=(e.isIntersectionTypeNode(t.parent)?t.parent:void 0)||t,n=Z(r,_);if(!n)return 0;var i=_.getTypeFromTypeNode(r),a=Y(n,_),o=Y(i,_),s=new e.Set;return o.forEach((function(e){return s.add(e.escapedName)})),ne=e.concatenate(ne,e.filter(a,(function(e){return !s.has(e.escapedName)}))),V=0,j=!0,1}()||function(){var t,r,n=function(t){if(t){var r=t.parent;switch(t.kind){case 18:case 27:if(e.isObjectLiteralExpression(r)||e.isObjectBindingPattern(r))return r;break;case 41:return e.isMethodDeclaration(r)?e.tryCast(r.parent,e.isObjectLiteralExpression):void 0;case 79:return "async"===t.text&&e.isShorthandPropertyAssignment(t.parent)?t.parent.parent:void 0}}}(T);if(!n)return 0;if(V=0,204===n.kind){var i=function(t,r){var n=r.getContextualType(t);return n||(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind&&t===t.parent.left?r.getTypeAtLocation(t.parent):void 0)}(n,_);if(void 0===i)return 16777216&n.flags?2:(H=!0,0);var a=_.getContextualType(n,4),o=(a||i).getStringIndexType(),s=(a||i).getNumberIndexType();if(j=!!o||!!s,t=Q(i,a,n,_),r=n.properties,0===t.length&&!s)return H=!0,0}else {e.Debug.assert(200===n.kind),j=!1;var c=e.getRootDeclaration(n.parent);if(!e.isVariableLike(c))return e.Debug.fail("Root declaration is not variable-like.");var l=e.hasInitializer(c)||e.hasType(c)||243===c.parent.parent.kind;if(l||163!==c.kind||(e.isExpression(c.parent)?l=!!_.getContextualType(c.parent):168!==c.parent.kind&&172!==c.parent.kind||(l=e.isExpression(c.parent.parent)&&!!_.getContextualType(c.parent.parent))),l){var u=_.getTypeAtLocation(n);if(!u)return 2;t=_.getPropertiesOfType(u).filter((function(e){return _.isPropertyAccessible(n,!1,!1,u,e)})),r=n.elements;}}return t&&t.length>0&&(ne=e.concatenate(ne,function(t,r){if(0===r.length)return t;for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if((294===s.kind||295===s.kind||202===s.kind||168===s.kind||171===s.kind||172===s.kind||296===s.kind)&&!Ne(s)){var c=void 0;if(e.isSpreadAssignment(s))Ce(s,n);else if(e.isBindingElement(s)&&s.propertyName)79===s.propertyName.kind&&(c=s.propertyName.escapedText);else {var l=e.getNameOfDeclaration(s);c=l&&e.isPropertyNameLiteral(l)?e.getEscapedTextOfIdentifierOrLiteral(l):void 0;}void 0!==c&&i.add(c);}}var u=t.filter((function(e){return !i.has(e.escapedName)}));return ke(n,u),u}(t,e.Debug.checkDefined(r)))),Ee(),1}()||(E?(j=!0,be(),1):0)||function(){if(!T)return 0;var t=18===T.kind||27===T.kind?e.tryCast(T.parent,e.isNamedImportsOrExports):e.isTypeKeywordTokenOrIdentifier(T)?e.tryCast(T.parent.parent,e.isNamedImportsOrExports):void 0;if(!t)return 0;e.isTypeKeywordTokenOrIdentifier(T)||(R=8);var r=(268===t.kind?t.parent.parent:t.parent).moduleSpecifier;if(!r)return j=!0,268===t.kind?2:0;var n=_.getSymbolAtLocation(r);if(!n)return j=!0,2;V=3,j=!1;var i=_.getExportsAndPropertiesOfModule(n),a=new e.Set(t.elements.filter((function(e){return !Ne(e)})).map((function(e){return (e.propertyName||e.name).escapedText}))),o=i.filter((function(e){return "default"!==e.escapedName&&!a.has(e.escapedName)}));return ne=e.concatenate(ne,o),o.length||(R=0),1}()||function(){var t,r=!T||18!==T.kind&&27!==T.kind?void 0:e.tryCast(T.parent,e.isNamedExports);if(!r)return 0;var n=e.findAncestor(r,e.or(e.isSourceFile,e.isModuleDeclaration));return V=5,j=!1,null===(t=n.locals)||void 0===t||t.forEach((function(t,r){var i,a;ne.push(t),(null===(a=null===(i=n.symbol)||void 0===i?void 0:i.exports)||void 0===a?void 0:a.has(r))&&(oe[e.getSymbolId(t)]=12);})),1}()||(function(t){if(t){var r=t.parent;switch(t.kind){case 20:case 27:return e.isConstructorDeclaration(t.parent)?t.parent:void 0;default:if(De(t))return r.parent}}}(T)?(V=5,j=!0,R=4,1):0)||function(){var t=function(t,r,n,i){switch(n.kind){case 346:return e.tryCast(n.parent,e.isObjectTypeDeclaration);case 1:var a=e.tryCast(e.lastOrUndefined(e.cast(n.parent,e.isSourceFile).statements),e.isObjectTypeDeclaration);if(a&&!e.findChildOfKind(a,19,t))return a;break;case 79:if(e.isPropertyDeclaration(n.parent)&&n.parent.initializer===n)return;if($(n))return e.findAncestor(n,e.isObjectTypeDeclaration)}if(r){if(134===n.kind||e.isIdentifier(r)&&e.isPropertyDeclaration(r.parent)&&e.isClassLike(n))return e.findAncestor(r,e.isClassLike);switch(r.kind){case 63:return;case 26:case 19:return $(n)&&n.parent.name===n?n.parent.parent:e.tryCast(n,e.isObjectTypeDeclaration);case 18:case 27:return e.tryCast(r.parent,e.isObjectTypeDeclaration);default:if(!$(r))return e.getLineAndCharacterOfPosition(t,r.getEnd()).line!==e.getLineAndCharacterOfPosition(t,i).line&&e.isObjectTypeDeclaration(n)?n:void 0;var o=e.isClassLike(r.parent.parent)?W:q;return o(r.kind)||41===r.kind||e.isIdentifier(r)&&o(e.stringToToken(r.text))?r.parent.parent:void 0}}}(i,T,M,o);if(!t)return 0;if(V=3,j=!0,R=41===T.kind?0:e.isClassLike(t)?2:3,!e.isClassLike(t))return 1;var r=26===T.kind?T.parent.parent:T.parent,n=e.isClassElement(r)?e.getEffectiveModifierFlags(r):0;if(79===T.kind&&!Ne(T))switch(T.getText()){case"private":n|=8;break;case"static":n|=32;break;case"override":n|=16384;}if(e.isClassStaticBlockDeclaration(r)&&(n|=32),!(8&n)){var a=e.isClassLike(t)&&16384&n?e.singleElementArray(e.getEffectiveBaseTypeNode(t)):e.getAllSuperTypeNodes(t),s=e.flatMap(a,(function(e){var r=_.getTypeAtLocation(e);return 32&n?(null==r?void 0:r.symbol)&&_.getPropertiesOfType(_.getTypeOfSymbolAtLocation(r.symbol,t)):r&&_.getPropertiesOfType(r)}));ne=e.concatenate(ne,function(t,r,n){for(var i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];if(!(166!==s.kind&&168!==s.kind&&171!==s.kind&&172!==s.kind||Ne(s)||e.hasEffectiveModifier(s,8)||e.isStatic(s)!==!!(32&n))){var c=e.getPropertyNameForPropertyNameNode(s.name);c&&i.add(c);}}return t.filter((function(t){return !(i.has(t.escapedName)||!t.declarations||8&e.getDeclarationModifierFlagsFromSymbol(t)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))}))}(s,t.members,n));}return 1}()||function(){var t=function(t){if(t){var r=t.parent;switch(t.kind){case 31:case 30:case 43:case 79:case 205:case 285:case 284:case 286:if(r&&(278===r.kind||279===r.kind)){if(31===t.kind){var n=e.findPrecedingToken(t.pos,i,void 0);if(!r.typeArguments||n&&43===n.kind)break}return r}if(284===r.kind)return r.parent.parent;break;case 10:if(r&&(284===r.kind||286===r.kind))return r.parent.parent;break;case 19:if(r&&287===r.kind&&r.parent&&284===r.parent.kind)return r.parent.parent.parent;if(r&&286===r.kind)return r.parent.parent}}}(T),r=t&&_.getContextualType(t.attributes);if(!r)return 0;var n=t&&_.getContextualType(t.attributes,4);return ne=e.concatenate(ne,function(t,r){for(var n=new e.Set,i=new e.Set,a=0,o=r;a<o.length;a++){var s=o[a];Ne(s)||(284===s.kind?n.add(s.name.escapedText):e.isJsxSpreadAttribute(s)&&Ce(s,i));}var c=t.filter((function(e){return !n.has(e.escapedName)}));return ke(i,c),c}(Q(r,n,t.attributes,_),t.attributes.properties)),Ee(),V=3,j=!1,1}()||(function(){R=function(t){if(t){var r,n=e.findAncestor(t.parent,(function(t){return e.isClassLike(t)?"quit":!(!e.isFunctionLikeDeclaration(t)||r!==t.body)||(r=t,!1)}));return n&&n}}(T)?5:1,V=1,j=xe(),S!==T&&e.Debug.assert(!!S,"Expected 'contextToken' to be defined when different from 'previousToken'.");var t=S!==T?S.getStart():o,r=function(t,r,n){for(var i=t;i&&!e.positionBelongsToNode(i,r,n);)i=i.parent;return i}(T,t,i)||i;v=function(t){switch(t.kind){case 303:case 222:case 287:case 234:return !0;default:return e.isStatement(t)}}(r);var n=2887656|(le?0:111551);ne=e.concatenate(ne,_.getSymbolsInScope(r,n)),e.Debug.assertEachIsDefined(ne,"getSymbolsInScope() should all be defined");for(var a=0,c=ne;a<c.length;a++){var l=c[a];_.isArgumentsSymbol(l)||e.some(l.declarations,(function(e){return e.getSourceFile()===i}))||(oe[e.getSymbolId(l)]=15);}if(s.includeCompletionsWithInsertText&&303!==r.kind){var u=_.tryGetThisTypeAt(r,!1);if(u&&!function(e,t,r){var n=r.resolveName("self",void 0,111551,!1);if(n&&r.getTypeOfSymbolAtLocation(n,t)===e)return !0;var i=r.resolveName("global",void 0,111551,!1);if(i&&r.getTypeOfSymbolAtLocation(i,t)===e)return !0;var a=r.resolveName("globalThis",void 0,111551,!1);return !(!a||r.getTypeOfSymbolAtLocation(a,t)!==e)}(u,i,_))for(var d=0,p=Y(u,_);d<p.length;d++)l=p[d],ie[ne.length]={kind:1},ne.push(l),oe[e.getSymbolId(l)]=14;}be(),le&&(R=T&&e.isAssertionExpression(T.parent)?6:7);}(),1))}function be(){var r,n;if((E||!H&&s.includeCompletionsForModuleExports&&(i.externalModuleIndicator||i.commonJsModuleIndicator||e.compilerOptionsIndicateEsModules(t.getCompilerOptions())||e.programContainsModules(t)))&&(e.Debug.assert(!(null==c?void 0:c.data),"Should not run 'collectAutoImports' when faster path is available via `data`"),!c||c.source)){var a=S===T&&E&&re(E,T)?"":S&&e.isIdentifier(S)?S.text.toLowerCase():"",o=null===(r=l.getModuleSpecifierCache)||void 0===r?void 0:r.call(l),_=e.getExportInfoMap(i,l,t,u),d=null===(n=l.getPackageJsonAutoImportProvider)||void 0===n?void 0:n.call(l),p=c?void 0:e.createPackageJsonImportFilter(i,s,l);f("collectAutoImports",l,t,i,s,!!E,(function(t){_.forEach(i.path,(function(r,n,i,o){if(e.isIdentifierText(n,e.getEmitScriptTarget(l.getCompilationSettings()))&&(c||!e.isStringANonContextualKeyword(n))&&(le||E||111551&r[0].targetFlags)&&(!le||790504&r[0].targetFlags)&&(c&&e.some(r,(function(t){return c.source===e.stripQuotes(t.moduleSymbol.name)}))||!c&&se(n,a))){var s=e.find(r,g);if(!s)return;var u=t.tryResolve(r,i)||{},_=u.exportInfo,d=void 0===_?s:_,p=u.moduleSpecifier,f=1===d.exportKind;m=f&&e.getLocalSymbolForExportDefault(d.symbol)||d.symbol,y={kind:p?32:4,moduleSpecifier:p,symbolName:n,exportMapKey:o,exportName:2===d.exportKind?"export=":d.symbol.name,fileName:d.moduleFileName,isDefaultExport:f,moduleSymbol:d.moduleSymbol,isFromPackageJson:d.isFromPackageJson},v=e.getSymbolId(m),15!==oe[v]&&(ie[ne.length]=y,oe[v]=E?11:16,ne.push(m));}var m,y,v;})),X=t.resolutionLimitExceeded();}));}function g(r){var n=e.tryCast(r.moduleSymbol.valueDeclaration,e.isSourceFile);if(!n){var a=e.stripQuotes(r.moduleSymbol.name);return (!e.JsTyping.nodeCoreModules.has(a)||e.startsWith(a,"node:")===e.shouldUseUriStyleNodeCoreModules(i,t))&&(!p||p.allowsImportingAmbientModule(r.moduleSymbol,ue(r.isFromPackageJson)))}return e.isImportableFile(r.isFromPackageJson?d:t,i,n,s,p,ue(r.isFromPackageJson),o)}}function xe(){if(T){var e=T.parent.kind,t=G(T);switch(t){case 27:return 207===e||170===e||208===e||203===e||220===e||178===e||204===e;case 20:return 207===e||170===e||208===e||211===e||190===e;case 22:return 203===e||175===e||161===e;case 141:case 142:case 100:return !0;case 24:return 260===e;case 18:return 256===e||204===e;case 63:return 253===e||220===e;case 15:return 222===e;case 16:return 232===e;case 131:return 168===e||295===e;case 41:return 168===e}if(W(t))return !0}return !1}function De(t){return !!t.parent&&e.isParameter(t.parent)&&e.isConstructorDeclaration(t.parent.parent)&&(e.isParameterPropertyModifier(t.kind)||e.isDeclarationName(t))}function Se(t,r){return 63!==t.kind&&(26===t.kind||!e.positionsAreOnSameLine(t.end,r,i))}function Te(t){return e.isFunctionLikeKind(t)&&170!==t}function Ce(e,t){var r=e.expression,n=_.getSymbolAtLocation(r),i=n&&_.getTypeOfSymbolAtLocation(n,r),a=i&&i.properties;a&&a.forEach((function(e){t.add(e.name);}));}function Ee(){ne.forEach((function(t){var r;if(16777216&t.flags){var n=e.getSymbolId(t);oe[n]=null!==(r=oe[n])&&void 0!==r?r:12;}}));}function ke(t,r){if(0!==t.size)for(var n=0,i=r;n<i.length;n++){var a=i[n];t.has(a.name)&&(oe[e.getSymbolId(a)]=13);}}function Ne(e){return e.getStart(i)<=o&&o<=e.getEnd()}}function B(t,r){var n=e.findPrecedingToken(t,r);return n&&t<=n.end&&(e.isMemberName(n)||e.isKeyword(n.kind))?{contextToken:e.findPrecedingToken(n.getFullStart(),r,void 0),previousToken:n}:{contextToken:n,previousToken:n}}function j(t,r,n,i){var a=r.isPackageJsonImport?i.getPackageJsonAutoImportProvider():n,o=a.getTypeChecker(),s=r.ambientModuleName?o.tryFindAmbientModule(r.ambientModuleName):r.fileName?o.getMergedSymbol(e.Debug.checkDefined(a.getSourceFile(r.fileName)).symbol):void 0;if(s){var c="export="===r.exportName?o.resolveExternalModuleSymbol(s):o.tryGetMemberInModuleExportsAndProperties(r.exportName,s);if(c)return {symbol:c="default"===r.exportName&&e.getLocalSymbolForExportDefault(c)||c,origin:k(r,t,s)}}}function J(t,r,n,i,a){var o=function(e){return _(e)||d(e)}(n)?n.symbolName:t.name;if(!(void 0===o||1536&t.flags&&e.isSingleOrDoubleQuote(o.charCodeAt(0))||e.isKnownSymbol(t))){var s={name:o,needsConvertPropertyAccess:!1};if(e.isIdentifierText(o,r,a?1:0)||t.valueDeclaration&&e.isPrivateIdentifierClassElementDeclaration(t.valueDeclaration))return s;switch(i){case 3:return;case 0:return {name:JSON.stringify(o),needsConvertPropertyAccess:!1};case 2:case 1:return 32===o.charCodeAt(0)?void 0:{name:o,needsConvertPropertyAccess:!0};case 5:case 4:return s;default:e.Debug.assertNever(i);}}}t.moduleSpecifierResolutionLimit=100,t.moduleSpecifierResolutionCacheAttemptLimit=1e3,function(e){e.LocalDeclarationPriority="10",e.LocationPriority="11",e.OptionalMember="12",e.MemberDeclaredBySpreadAssignment="13",e.SuggestedClassMembers="14",e.GlobalsOrKeywords="15",e.AutoImportSuggestions="16",e.JavascriptIdentifiers="17",e.DeprecatedLocalDeclarationPriority="18",e.DeprecatedLocationPriority="19",e.DeprecatedOptionalMember="20",e.DeprecatedMemberDeclaredBySpreadAssignment="21",e.DeprecatedSuggestedClassMembers="22",e.DeprecatedGlobalsOrKeywords="23",e.DeprecatedAutoImportSuggestions="24";}(r=t.SortText||(t.SortText={})),function(e){e[e.LocalDeclarationPriority=10]="LocalDeclarationPriority",e[e.LocationPriority=11]="LocationPriority",e[e.OptionalMember=12]="OptionalMember",e[e.MemberDeclaredBySpreadAssignment=13]="MemberDeclaredBySpreadAssignment",e[e.SuggestedClassMembers=14]="SuggestedClassMembers",e[e.GlobalsOrKeywords=15]="GlobalsOrKeywords",e[e.AutoImportSuggestions=16]="AutoImportSuggestions",e[e._JavaScriptIdentifiers=17]="_JavaScriptIdentifiers",e[e._DeprecatedStart=18]="_DeprecatedStart",e[e._First=10]="_First",e[e.DeprecatedOffset=8]="DeprecatedOffset";}(n||(n={})),function(e){e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/";}(a=t.CompletionSource||(t.CompletionSource={})),function(e){e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport";}(o||(o={})),function(e){e[e.None=0]="None",e[e.All=1]="All",e[e.ClassElementKeywords=2]="ClassElementKeywords",e[e.InterfaceElementKeywords=3]="InterfaceElementKeywords",e[e.ConstructorParameterKeywords=4]="ConstructorParameterKeywords",e[e.FunctionLikeBodyKeywords=5]="FunctionLikeBodyKeywords",e[e.TypeAssertionKeywords=6]="TypeAssertionKeywords",e[e.TypeKeywords=7]="TypeKeywords",e[e.TypeKeyword=8]="TypeKeyword",e[e.Last=7]="Last";}(s||(s={})),function(e){e[e.Continue=0]="Continue",e[e.Success=1]="Success",e[e.Fail=2]="Fail";}(c||(c={})),t.getCompletionsAtPosition=function(n,a,o,s,c,l,u,_,d){var p,y=B(c,s).previousToken;if(!u||e.isInString(s,c,y)||function(t,r,n,i){switch(r){case".":case"@":return !0;case'"':case"'":case"`":return !!n&&e.isStringLiteralOrTemplate(n)&&i===n.getStart(t)+1;case"#":return !!n&&e.isPrivateIdentifier(n)&&!!e.getContainingClass(n);case"<":return !!n&&29===n.kind&&(!e.isBinaryExpression(n.parent)||ee(n.parent));case"/":return !!n&&(e.isStringLiteralLike(n)?!!e.tryGetImportFromModuleSpecifier(n):43===n.kind&&e.isJsxClosingElement(n.parent));case" ":return !!n&&e.isImportKeyword(n)&&303===n.parent.kind;default:return e.Debug.assertNever(r)}}(s,u,y,c)){if(" "===u)return l.includeCompletionsForImportStatements&&l.includeCompletionsWithInsertText?{isGlobalCompletion:!0,isMemberCompletion:!1,isNewIdentifierLocation:!0,isIncomplete:!0,entries:[]}:void 0;var x=a.getCompilerOptions(),S=l.allowIncompleteCompletions?null===(p=n.getIncompleteCompletionsCache)||void 0===p?void 0:p.call(n):void 0;if(S&&3===_&&y&&e.isIdentifier(y)){var T=function(t,r,n,a,o,s,c){var l=t.get();if(l){var u=n.text.toLowerCase(),_=e.getExportInfoMap(r,o,a,c),d=f("continuePreviousIncompleteResponse",o,a,r,s,!1,(function(t){var n=e.mapDefined(l.entries,(function(n){if(!n.hasAction||!n.source||!n.data||g(n.data))return n;if(se(n.name,u)){var s=e.Debug.checkDefined(j(n.name,n.data,a,o)).origin,c=_.get(r.path,n.data.exportMapKey),l=c&&t.tryResolve(c,!e.isExternalModuleNameRelative(e.stripQuotes(s.moduleSymbol.name)));if(!l)return n;var d=i$1(i$1({},s),{kind:32,moduleSpecifier:l.moduleSpecifier});return n.data=E(d),n.source=A(d),n.sourceDisplay=[e.textPart(d.moduleSpecifier)],n}}));return t.resolutionLimitExceeded()||(l.isIncomplete=void 0),n}));return l.entries=d,l}}(S,s,y,a,n,l,d);if(T)return T}else null==S||S.clear();var C=t.StringCompletions.getStringLiteralCompletions(s,c,y,x,n,a,o,l);if(C)return C;if(y&&e.isBreakOrContinueStatement(y.parent)&&(81===y.kind||86===y.kind||79===y.kind))return function(t){var n=function(t){for(var n=[],i=new e.Map,a=t;a&&!e.isFunctionLike(a);){if(e.isLabeledStatement(a)){var o=a.label.text;i.has(o)||(i.set(o,!0),n.push({name:o,kindModifiers:"",kind:"label",sortText:r.LocationPriority}));}a=a.parent;}return n}(t);if(n.length)return {isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:n}}(y.parent);var k,N=R(a,o,s,h(s,x),c,l,void 0,n,d);if(N)switch(N.kind){case 0:var F=function(t,n,i,a,o,s,c){var l=s.symbols,u=s.contextToken,_=s.completionKind,d=s.isInSnippetScope,p=s.isNewIdentifierLocation,f=s.location,g=s.propertyAccessToConvert,m=s.keywordFilters,y=s.literals,x=s.symbolToOriginInfoMap,S=s.recommendedCompletion,T=s.isJsxInitializer,C=s.isTypeOnlyLocation,E=s.isJsxIdentifierExpected,k=s.importCompletionNode,N=s.insideJsDocTagTypeExpression,F=s.symbolToSortTextIdMap,A=s.hasUnresolvedAutoImports;if(1===e.getLanguageVariant(t.scriptKind)){var w=function(t,n){var i=e.findAncestor(t,(function(e){switch(e.kind){case 280:return !0;case 43:case 31:case 79:case 205:return !1;default:return "quit"}}));if(i){var a=!!e.findChildOfKind(i,31,n),o=i.parent.openingElement.tagName.getText(n)+(a?"":">");return {isGlobalCompletion:!1,isMemberCompletion:!0,isNewIdentifierLocation:!1,optionalReplacementSpan:e.createTextSpanFromNode(i.tagName),entries:[{name:o,kind:"class",kindModifiers:void 0,sortText:r.LocationPriority}]}}}(f,t);if(w)return w}var I=[];if(h(t,a)){var O=P(l,I,void 0,u,f,t,n,i,e.getEmitScriptTarget(a),o,_,c,a,C,g,E,T,k,S,x,F);!function(t,n,i,a,o){e.getNameTable(t).forEach((function(t,s){if(t!==n){var c=e.unescapeLeadingUnderscores(s);!i.has(c)&&e.isIdentifierText(c,a)&&(i.add(c),o.push({name:c,kind:"warning",kindModifiers:"",sortText:r.JavascriptIdentifiers,isFromUncheckedFile:!0}));}}));}(t,f.pos,O,e.getEmitScriptTarget(a),I);}else {if(!(p||l&&0!==l.length||0!==m))return;P(l,I,void 0,u,f,t,n,i,e.getEmitScriptTarget(a),o,_,c,a,C,g,E,T,k,S,x,F);}if(0!==m)for(var M=new e.Set(I.map((function(e){return e.name}))),L=0,R=K(m,!N&&e.isSourceFileJS(t));L<R.length;L++){var B=R[L];M.has(B.name)||I.push(B);}for(var j=0,J=y;j<J.length;j++){var z=J[j];I.push(D(t,c,z));}return {isGlobalCompletion:d,isIncomplete:!(!c.allowIncompleteCompletions||!A)||void 0,isMemberCompletion:b(_),isNewIdentifierLocation:p,optionalReplacementSpan:v(f),entries:I}}(s,n,a,x,o,N,l);return (null==F?void 0:F.isIncomplete)&&(null==S||S.set(F)),F;case 1:return m(e.JsDoc.getJSDocTagNameCompletions());case 2:return m(e.JsDoc.getJSDocTagCompletions());case 3:return m(e.JsDoc.getJSDocParameterNameCompletions(N.tag));case 4:return k=N.keywordCompletions,{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:N.isNewIdentifierLocation,entries:k.slice()};default:return e.Debug.assertNever(N)}}},t.getCompletionEntriesFromSymbols=P,t.getCompletionEntryDetails=function(r,n,i,o,s,c,l,u,p){var f=r.getTypeChecker(),g=r.getCompilerOptions(),m=s.name,y=s.source,v=s.data,h=e.findPrecedingToken(o,i);if(e.isInString(i,o,h))return t.StringCompletions.getStringLiteralCompletionDetails(m,i,o,h,f,g,c,p,u);var b=w(r,n,i,o,s,c,u);switch(b.type){case"request":var D=b.request;switch(D.kind){case 1:return e.JsDoc.getJSDocTagNameCompletionDetails(m);case 2:return e.JsDoc.getJSDocTagCompletionDetails(m);case 3:return e.JsDoc.getJSDocParameterNameCompletionDetails(m);case 4:return e.some(D.keywordCompletions,(function(e){return e.name===m}))?I(m,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:return e.Debug.assertNever(D)}case"symbol":var S=b.symbol,C=b.location,E=b.contextToken,k=b.origin,N=b.previousToken,F=function(t,r,n,i,o,s,c,l,u,p,f,g,m,y,v){if(null==y?void 0:y.moduleSpecifier){var h=B(p,u),b=h.contextToken,x=h.previousToken;if(x&&te(b||x).replacementNode)return {codeActions:void 0,sourceDisplay:[e.textPart(y.moduleSpecifier)]}}if(v===a.ClassMemberSnippet){var D=T(c,s,l,m,t,o,r,n).importAdder;if(D)return {sourceDisplay:void 0,codeActions:[{changes:e.textChanges.ChangeTracker.with({host:c,formatContext:g,preferences:m},D.writeFixes),description:e.diagnosticToString([e.Diagnostics.Includes_imports_of_types_referenced_by_0,t])}]}}if(!i||!_(i)&&!d(i))return {codeActions:void 0,sourceDisplay:void 0};var S=i.isFromPackageJson?c.getPackageJsonAutoImportProvider().getTypeChecker():s.getTypeChecker(),C=i.moduleSymbol,E=S.getMergedSymbol(e.skipAlias(o.exportSymbol||o,S)),k=e.codefix.getImportCompletionAction(E,C,u,e.getNameForExportedSymbol(o,e.getEmitScriptTarget(l)),c,s,g,f&&e.isIdentifier(f)?f.getStart(u):p,m),N=k.moduleSpecifier,F=k.codeAction;return e.Debug.assert(!(null==y?void 0:y.moduleSpecifier)||N===y.moduleSpecifier),{sourceDisplay:[e.textPart(N)],codeActions:[F]}}(m,C,E,k,S,r,c,g,i,o,N,l,u,v,y);return O(S,f,i,C,p,F.codeActions,F.sourceDisplay);case"literal":var A=b.literal;return I(x(i,u,A),"string","string"==typeof A?e.SymbolDisplayPartKind.stringLiteral:e.SymbolDisplayPartKind.numericLiteral);case"none":return U().some((function(e){return e.name===m}))?I(m,"keyword",e.SymbolDisplayPartKind.keyword):void 0;default:e.Debug.assertNever(b);}},t.createCompletionDetailsForSymbol=O,t.createCompletionDetails=M,t.getCompletionEntrySymbol=function(e,t,r,n,i,a,o){var s=w(e,t,r,n,i,a,o);return "symbol"===s.type?s.symbol:void 0},function(e){e[e.Data=0]="Data",e[e.JsDocTagName=1]="JsDocTagName",e[e.JsDocTag=2]="JsDocTag",e[e.JsDocParameterName=3]="JsDocParameterName",e[e.Keywords=4]="Keywords";}(l||(l={})),(u=t.CompletionKind||(t.CompletionKind={}))[u.ObjectPropertyDeclaration=0]="ObjectPropertyDeclaration",u[u.Global=1]="Global",u[u.PropertyAccess=2]="PropertyAccess",u[u.MemberLike=3]="MemberLike",u[u.String=4]="String",u[u.None=5]="None";var z=[],U=e.memoize((function(){for(var t=[],n=81;n<=159;n++)t.push({name:e.tokenToString(n),kind:"keyword",kindModifiers:"",sortText:r.GlobalsOrKeywords});return t}));function K(t,r){if(!r)return V(t);var n=t+7+1;return z[n]||(z[n]=V(t).filter((function(t){return !function(e){switch(e){case 126:case 130:case 157:case 133:case 135:case 92:case 156:case 117:case 137:case 118:case 139:case 140:case 141:case 142:case 143:case 146:case 147:case 158:case 121:case 122:case 123:case 144:case 149:case 150:case 151:case 153:case 154:return !0;default:return !1}}(e.stringToToken(t.name))})))}function V(t){return z[t]||(z[t]=U().filter((function(r){var n=e.stringToToken(r.name);switch(t){case 0:return !1;case 1:return H(n)||135===n||141===n||151===n||142===n||126===n||e.isTypeKeyword(n)&&152!==n;case 5:return H(n);case 2:return W(n);case 3:return q(n);case 4:return e.isParameterPropertyModifier(n);case 6:return e.isTypeKeyword(n)||85===n;case 7:return e.isTypeKeyword(n);case 8:return 151===n;default:return e.Debug.assertNever(t)}})))}function q(e){return 144===e}function W(t){switch(t){case 126:case 134:case 136:case 148:case 131:case 135:case 158:return !0;default:return e.isClassMemberModifier(t)}}function H(t){return 131===t||132===t||127===t||!e.isContextualKeyword(t)&&!W(t)}function G(t){return e.isIdentifier(t)?t.originalKeywordKind||0:t.kind}function Q(t,r,n,i){var a=r&&r!==t,o=!a||3&r.flags?t:i.getUnionType([t,r]),s=function(t,r,n){return t.isUnion()?n.getAllPossiblePropertiesOfTypes(e.filter(t.types,(function(t){return !(131068&t.flags||n.isArrayLikeType(t)||n.isTypeInvalidDueToUnionDiscriminant(t,r)||e.typeHasCallOrConstructSignatures(t,n)||t.isClass()&&X(t.getApparentProperties()))}))):t.getApparentProperties()}(o,n,i);return o.isClass()&&X(s)?[]:a?e.filter(s,(function(t){return e.some(t.declarations,(function(e){return e.parent!==n}))})):s}function X(t){return e.some(t,(function(t){return !!(24&e.getDeclarationModifierFlagsFromSymbol(t))}))}function Y(t,r){return t.isUnion()?e.Debug.checkEachDefined(r.getAllPossiblePropertiesOfTypes(t.types),"getAllPossiblePropertiesOfTypes() should all be defined"):e.Debug.checkEachDefined(t.getApparentProperties(),"getApparentProperties() should all be defined")}function Z(t,r){if(t){if(e.isTypeNode(t)&&e.isTypeReferenceType(t.parent))return r.getTypeArgumentConstraint(t);var n=Z(t.parent,r);if(n)switch(t.kind){case 165:return r.getTypeOfPropertyOfContextualType(n,t.symbol.escapedName);case 187:case 181:case 186:return n}}}function $(t){return t.parent&&e.isClassOrTypeElement(t.parent)&&e.isObjectTypeDeclaration(t.parent.parent)}function ee(t){var r=t.left;return e.nodeIsMissing(r)}function te(t){var r,n=!1,i=function(){var i=t.parent;if(e.isImportEqualsDeclaration(i))return r=151===t.kind?void 0:151,ie(i.moduleReference)?i:void 0;if(re(i,t)&&ne(i.parent))return i;if(!e.isNamedImports(i)&&!e.isNamespaceImport(i))return e.isImportKeyword(t)&&e.isSourceFile(i)?(r=151,t):e.isImportKeyword(t)&&e.isImportDeclaration(i)?(r=151,ie(i.moduleSpecifier)?i:void 0):void 0;if(i.parent.isTypeOnly||18!==t.kind&&100!==t.kind&&27!==t.kind||(r=151),ne(i)){if(19!==t.kind&&79!==t.kind)return i.parent.parent;n=!0,r=155;}}();return {isKeywordOnlyCompletion:n,keywordCompletion:r,isNewIdentifierLocation:!(!i&&151!==r),replacementNode:i&&e.rangeIsOnSingleLine(i,i.getSourceFile())?i:void 0}}function re(t,r){return e.isImportSpecifier(t)&&(t.isTypeOnly||r===t.name&&e.isTypeKeywordTokenOrIdentifier(r))}function ne(t){return ie(t.parent.parent.moduleSpecifier)&&(e.isNamespaceImport(t)||t.elements.length<2)&&!t.parent.name}function ie(t){var r;return !!e.nodeIsMissing(t)||!(null===(r=e.tryCast(e.isExternalModuleReference(t)?t.expression:t,e.isStringLiteralLike))||void 0===r?void 0:r.text)}function ae(t,r,n){void 0===n&&(n=new e.Map);var i=e.skipAlias(t.exportSymbol||t,r);return !!(788968&i.flags)||r.isUnknownSymbol(i)||!!(1536&i.flags)&&e.addToSeen(n,e.getSymbolId(i))&&r.getExportsOfModule(i).some((function(e){return ae(e,r,n)}))}function oe(t,r){var n=e.skipAlias(t,r).declarations;return !!e.length(n)&&e.every(n,e.isDeprecatedDeclaration)}function se(e,t){if(0===t.length)return !0;for(var r,n=!1,i=0,a=e.length,o=0;o<a;o++){var s=e.charCodeAt(o),c=t.charCodeAt(i);if((s===c||s===(97<=(l=c)&&l<=122?l-32:l))&&(n||(n=void 0===r||97<=r&&r<=122&&65<=s&&s<=90||95===r&&95!==s),n&&i++,i===t.length))return !0;r=s;}var l;return !1}t.getPropertiesForObjectExpression=Q;}(e.Completions||(e.Completions={}));}(t),function(e){!function(t){function r(t,r){return {fileName:r.fileName,textSpan:e.createTextSpanFromNode(t,r),kind:"none"}}function i(t){return e.isThrowStatement(t)?[t]:e.isTryStatement(t)?e.concatenate(t.catchClause?i(t.catchClause):t.tryBlock&&i(t.tryBlock),t.finallyBlock&&i(t.finallyBlock)):e.isFunctionLike(t)?void 0:o(t,i)}function a(t){return e.isBreakOrContinueStatement(t)?[t]:e.isFunctionLike(t)?void 0:o(t,a)}function o(t,r){var n=[];return t.forEachChild((function(t){var i=r(t);void 0!==i&&n.push.apply(n,e.toArray(i));})),n}function s(e,t){var r=c(t);return !!r&&r===e}function c(t){return e.findAncestor(t,(function(r){switch(r.kind){case 248:if(244===t.kind)return !1;case 241:case 242:case 243:case 240:case 239:return !t.label||function(t,r){return !!e.findAncestor(t.parent,(function(t){return e.isLabeledStatement(t)?t.label.escapedText===r:"quit"}))}(r,t.label.escapedText);default:return e.isFunctionLike(r)&&"quit"}}))}function l(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return !(!r||!e.contains(n,r.kind)||(t.push(r),0))}function u(t){var r=[];if(l(r,t.getFirstToken(),97,115,90)&&239===t.kind)for(var n=t.getChildren(),i=n.length-1;i>=0&&!l(r,n[i],115);i--);return e.forEach(a(t.statement),(function(e){s(t,e)&&l(r,e.getFirstToken(),81,86);})),r}function _(e){var t=c(e);if(t)switch(t.kind){case 241:case 242:case 243:case 239:case 240:return u(t);case 248:return d(t)}}function d(t){var r=[];return l(r,t.getFirstToken(),107),e.forEach(t.caseBlock.clauses,(function(n){l(r,n.getFirstToken(),82,88),e.forEach(a(n),(function(e){s(t,e)&&l(r,e.getFirstToken(),81);}));})),r}function p(t,r){var n=[];return l(n,t.getFirstToken(),111),t.catchClause&&l(n,t.catchClause.getFirstToken(),83),t.finallyBlock&&l(n,e.findChildOfKind(t,96,r),96),n}function f(t,r){var n=function(t){for(var r=t;r.parent;){var n=r.parent;if(e.isFunctionBlock(n)||303===n.kind)return n;if(e.isTryStatement(n)&&n.tryBlock===r&&n.catchClause)return r;r=n;}}(t);if(n){var a=[];return e.forEach(i(n),(function(t){a.push(e.findChildOfKind(t,109,r));})),e.isFunctionBlock(n)&&e.forEachReturnStatement(n,(function(t){a.push(e.findChildOfKind(t,105,r));})),a}}function g(t,r){var n=e.getContainingFunction(t);if(n){var a=[];return e.forEachReturnStatement(e.cast(n.body,e.isBlock),(function(t){a.push(e.findChildOfKind(t,105,r));})),e.forEach(i(n.body),(function(t){a.push(e.findChildOfKind(t,109,r));})),a}}function m(t){var r=e.getContainingFunction(t);if(r){var n=[];return r.modifiers&&r.modifiers.forEach((function(e){l(n,e,131);})),e.forEachChild(r,(function(t){y(t,(function(t){e.isAwaitExpression(t)&&l(n,t.getFirstToken(),132);}));})),n}}function y(t,r){r(t),e.isFunctionLike(t)||e.isClassLike(t)||e.isInterfaceDeclaration(t)||e.isModuleDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isTypeNode(t)||e.forEachChild(t,(function(e){return y(e,r)}));}t.getDocumentHighlights=function(t,i,a,o,s){var c=e.getTouchingPropertyName(a,o);if(c.parent&&(e.isJsxOpeningElement(c.parent)&&c.parent.tagName===c||e.isJsxClosingElement(c.parent))){var v=c.parent.parent,h=[v.openingElement,v.closingElement].map((function(e){return r(e.tagName,a)}));return [{fileName:a.fileName,highlightSpans:h}]}return function(t,r,n,i,a){var o=new e.Set(a.map((function(e){return e.fileName}))),s=e.FindAllReferences.getReferenceEntriesForNode(t,r,n,a,i,void 0,o);if(s){var c=e.arrayToMultiMap(s.map(e.FindAllReferences.toHighlightSpan),(function(e){return e.fileName}),(function(e){return e.span})),l=e.createGetCanonicalFileName(n.useCaseSensitiveFileNames());return e.mapDefined(e.arrayFrom(c.entries()),(function(t){var r=t[0],i=t[1];if(!o.has(r)){if(!n.redirectTargetsMap.has(e.toPath(r,n.getCurrentDirectory(),l)))return;var s=n.getSourceFile(r);r=e.find(a,(function(e){return !!e.redirectInfo&&e.redirectInfo.redirectTarget===s})).fileName,e.Debug.assert(o.has(r));}return {fileName:r,highlightSpans:i}}))}}(o,c,t,i,s)||function(t,i){var a=function(t,i){switch(t.kind){case 99:case 91:return e.isIfStatement(t.parent)?function(t,n){for(var i=function(t,r){for(var n=[];e.isIfStatement(t.parent)&&t.parent.elseStatement===t;)t=t.parent;for(;;){var i=t.getChildren(r);l(n,i[0],99);for(var a=i.length-1;a>=0&&!l(n,i[a],91);a--);if(!t.elseStatement||!e.isIfStatement(t.elseStatement))break;t=t.elseStatement;}return n}(t,n),a=[],o=0;o<i.length;o++){if(91===i[o].kind&&o<i.length-1){for(var s=i[o],c=i[o+1],u=!0,_=c.getStart(n)-1;_>=s.end;_--)if(!e.isWhiteSpaceSingleLine(n.text.charCodeAt(_))){u=!1;break}if(u){a.push({fileName:n.fileName,textSpan:e.createTextSpanFromBounds(s.getStart(),c.end),kind:"reference"}),o++;continue}}a.push(r(i[o],n));}return a}(t.parent,i):void 0;case 105:return c(t.parent,e.isReturnStatement,g);case 109:return c(t.parent,e.isThrowStatement,f);case 111:case 83:case 96:return c(83===t.kind?t.parent.parent:t.parent,e.isTryStatement,p);case 107:return c(t.parent,e.isSwitchStatement,d);case 82:case 88:return e.isDefaultClause(t.parent)||e.isCaseClause(t.parent)?c(t.parent.parent.parent,e.isSwitchStatement,d):void 0;case 81:case 86:return c(t.parent,e.isBreakOrContinueStatement,_);case 97:case 115:case 90:return c(t.parent,(function(t){return e.isIterationStatement(t,!0)}),u);case 134:return s(e.isConstructorDeclaration,[134]);case 136:case 148:return s(e.isAccessor,[136,148]);case 132:return c(t.parent,e.isAwaitExpression,m);case 131:return v(m(t));case 125:return v(function(t){var r=e.getContainingFunction(t);if(r){var n=[];return e.forEachChild(r,(function(t){y(t,(function(t){e.isYieldExpression(t)&&l(n,t.getFirstToken(),125);}));})),n}}(t));default:return e.isModifierKind(t.kind)&&(e.isDeclaration(t.parent)||e.isVariableStatement(t.parent))?v((a=t.kind,o=t.parent,e.mapDefined(function(t,r){var i=t.parent;switch(i.kind){case 261:case 303:case 234:case 288:case 289:return 128&r&&e.isClassDeclaration(t)?n$3(n$3([],t.members,!0),[t],!1):i.statements;case 170:case 168:case 255:return n$3(n$3([],i.parameters,!0),e.isClassLike(i.parent)?i.parent.members:[],!0);case 256:case 225:case 257:case 181:var a=i.members;if(92&r){var o=e.find(i.members,e.isConstructorDeclaration);if(o)return n$3(n$3([],a,!0),o.parameters,!0)}else if(128&r)return n$3(n$3([],a,!0),[i],!1);return a;case 204:return;default:e.Debug.assertNever(i,"Invalid container kind.");}}(o,e.modifierToFlag(a)),(function(t){return e.findModifier(t,a)})))):void 0}var a,o;function s(r,n){return c(t.parent,r,(function(t){return e.mapDefined(t.symbol.declarations,(function(t){return r(t)?e.find(t.getChildren(i),(function(t){return e.contains(n,t.kind)})):void 0}))}))}function c(e,t,r){return t(e)?v(r(e,i)):void 0}function v(e){return e&&e.map((function(e){return r(e,i)}))}}(t,i);return a&&[{fileName:i.fileName,highlightSpans:a}]}(c,a)};}(e.DocumentHighlights||(e.DocumentHighlights={}));}(t),function(e){function t(e){return !!e.sourceFile}function r(r,i,a){void 0===i&&(i="");var o=new e.Map,s=e.createGetCanonicalFileName(!!r);function c(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!0,o)}function l(e,t,r,n,i,a,o){return _(e,t,r,n,i,a,!1,o)}function u(r,n){var i=t(r)?r:r.get(e.Debug.checkDefined(n,"If there are more than one scriptKind's for same document the scriptKind should be provided"));return e.Debug.assert(void 0===n||!i||i.sourceFile.scriptKind===n,"Script kind should match provided ScriptKind:".concat(n," and sourceFile.scriptKind: ").concat(null==i?void 0:i.sourceFile.scriptKind,", !entry: ").concat(!i)),i}function _(r,n,i,s,c,l,_,d){var p=6===(d=e.ensureScriptKind(r,d))?100:e.getEmitScriptTarget(i),f=e.getOrUpdate(o,s,(function(){return new e.Map})),g=f.get(n),m=g&&u(g,d);if(!m&&a&&(y=a.getDocument(s,n))&&(e.Debug.assert(_),m={sourceFile:y,languageServiceRefCount:0},v()),m)m.sourceFile.version!==l&&(m.sourceFile=e.updateLanguageServiceSourceFile(m.sourceFile,c,l,c.getChangeRange(m.sourceFile.scriptSnapshot)),a&&a.setDocument(s,n,m.sourceFile)),_&&m.languageServiceRefCount++;else {var y=e.createLanguageServiceSourceFile(r,c,p,l,!1,d);a&&a.setDocument(s,n,y),m={sourceFile:y,languageServiceRefCount:1},v();}return e.Debug.assert(0!==m.languageServiceRefCount),m.sourceFile;function v(){if(g)if(t(g)){var r=new e.Map;r.set(g.sourceFile.scriptKind,g),r.set(d,m),f.set(n,r);}else g.set(d,m);else f.set(n,m);}}function d(r,n,i){var a=e.Debug.checkDefined(o.get(n)),s=a.get(r),c=u(s,i);c.languageServiceRefCount--,e.Debug.assert(c.languageServiceRefCount>=0),0===c.languageServiceRefCount&&(t(s)?a.delete(r):(s.delete(i),1===s.size&&a.set(r,e.firstDefinedIterator(s.values(),e.identity))));}return {acquireDocument:function(t,r,a,o,l){return c(t,e.toPath(t,i,s),r,n(r),a,o,l)},acquireDocumentWithKey:c,updateDocument:function(t,r,a,o,c){return l(t,e.toPath(t,i,s),r,n(r),a,o,c)},updateDocumentWithKey:l,releaseDocument:function(t,r,a){return d(e.toPath(t,i,s),n(r),a)},releaseDocumentWithKey:d,getLanguageServiceRefCounts:function(t,r){return e.arrayFrom(o.entries(),(function(e){var n=e[0],i=e[1].get(t),a=i&&u(i,r);return [n,a&&a.languageServiceRefCount]}))},reportStats:function(){var r=e.arrayFrom(o.keys()).filter((function(e){return e&&"_"===e.charAt(0)})).map((function(e){var r=o.get(e),n=[];return r.forEach((function(e,r){t(e)?n.push({name:r,scriptKind:e.sourceFile.scriptKind,refCount:e.languageServiceRefCount}):e.forEach((function(e,t){return n.push({name:r,scriptKind:t,refCount:e.languageServiceRefCount})}));})),n.sort((function(e,t){return t.refCount-e.refCount})),{bucket:e,sourceFiles:n}}));return JSON.stringify(r,void 0,2)},getKeyForCompilationSettings:n}}function n(t){return e.sourceFileAffectingCompilerOptions.map((function(r){return e.getCompilerOptionValue(t,r)})).join("|")}e.createDocumentRegistry=function(e,t){return r(e,t)},e.createDocumentRegistryInternal=r;}(t),function(e){!function(t){function r(t,r){return e.forEach(303===t.kind?t.statements:t.body.statements,(function(t){return r(t)||c(t)&&e.forEach(t.body&&t.body.statements,r)}))}function n(t,n){if(t.externalModuleIndicator||void 0!==t.imports)for(var i=0,a=t.imports;i<a.length;i++){var o=a[i];n(e.importFromModuleSpecifier(o),o);}else r(t,(function(t){switch(t.kind){case 271:case 265:(r=t).moduleSpecifier&&e.isStringLiteral(r.moduleSpecifier)&&n(r,r.moduleSpecifier);break;case 264:var r;l(r=t)&&n(r,r.moduleReference.expression);}}));}function a(t,r,n){var i=t.parent;if(i){var a=n.getMergedSymbol(i);return e.isExternalModuleSymbol(a)?{exportingModuleSymbol:a,exportKind:r}:void 0}}function o(e,t){return t.getMergedSymbol(s(e).symbol)}function s(t){if(207===t.kind)return t.getSourceFile();var r=t.parent;return 303===r.kind?r:(e.Debug.assert(261===r.kind),e.cast(r.parent,c))}function c(e){return 260===e.kind&&10===e.name.kind}function l(e){return 276===e.moduleReference.kind&&10===e.moduleReference.expression.kind}var u,_;t.createImportTracker=function(t,a,u,_){var d=function(t,r,i){for(var a=new e.Map,o=0,s=t;o<s.length;o++){var c=s[o];i&&i.throwIfCancellationRequested(),n(c,(function(t,n){var i=r.getSymbolAtLocation(n);if(i){var o=e.getSymbolId(i).toString(),s=a.get(o);s||a.set(o,s=[]),s.push(t);}}));}return a}(t,u,_);return function(n,p,f){var g=function(t,n,i,a,l,u){var _=a.exportingModuleSymbol,d=a.exportKind,p=e.nodeSeenTracker(),f=e.nodeSeenTracker(),g=[],m=!!_.globalExports,y=m?void 0:[];return function t(r){var n=x(r);if(n)for(var i=0,a=n;i<a.length;i++){var _=a[i];if(p(_))switch(u&&u.throwIfCancellationRequested(),_.kind){case 207:if(e.isImportCall(_)){S=_,b(e.findAncestor(S,c)||S.getSourceFile(),!!v(S,!0));break}if(!m){var f=_.parent;if(2===d&&253===f.kind){var y=f.name;if(79===y.kind){g.push(y);break}}}break;case 79:break;case 264:h(_,_.name,e.hasSyntacticModifier(_,1),!1);break;case 265:g.push(_);var D=_.importClause&&_.importClause.namedBindings;D&&267===D.kind?h(_,D.name,!1,!0):!m&&e.isDefaultImport(_)&&b(s(_));break;case 271:_.exportClause?273===_.exportClause.kind?b(s(_),!0):g.push(_):t(o(_,l));break;case 199:_.isTypeOf&&!_.qualifier&&v(_)&&b(_.getSourceFile(),!0),g.push(_);break;default:e.Debug.failBadSyntaxKind(_,"Unexpected import kind.");}}var S;}(_),{directImports:g,indirectUsers:function(){if(m)return t;if(_.declarations)for(var r=0,i=_.declarations;r<i.length;r++){var a=i[r];e.isExternalModuleAugmentation(a)&&n.has(a.getSourceFile().fileName)&&b(a);}return y.map(e.getSourceFileOfNode)}()};function v(t,r){return void 0===r&&(r=!1),e.findAncestor(t,(function(t){return r&&c(t)?"quit":e.some(t.modifiers,(function(e){return 93===e.kind}))}))}function h(t,n,i,a){if(2===d)a||g.push(t);else if(!m){var o=s(t);e.Debug.assert(303===o.kind||260===o.kind),i||function(t,n,i){var a=i.getSymbolAtLocation(n);return !!r(t,(function(t){if(e.isExportDeclaration(t)){var r=t.exportClause;return !t.moduleSpecifier&&r&&e.isNamedExports(r)&&r.elements.some((function(e){return i.getExportSpecifierLocalTargetSymbol(e)===a}))}}))}(o,n,l)?b(o,!0):b(o);}}function b(t,r){if(void 0===r&&(r=!1),e.Debug.assert(!m),f(t)&&(y.push(t),r)){var n=l.getMergedSymbol(t.symbol);if(n){e.Debug.assert(!!(1536&n.flags));var i=x(n);if(i)for(var a=0,o=i;a<o.length;a++){var c=o[a];e.isImportTypeNode(c)||b(s(c),!0);}}}}function x(t){return i.get(e.getSymbolId(t).toString())}}(t,a,d,p,u,_),m=g.directImports,y=g.indirectUsers;return i$1({indirectUsers:y},function(t,r,n,i,a){var o=[],s=[];function c(e,t){o.push([e,t]);}if(t)for(var u=0,_=t;u<_.length;u++)d(_[u]);return {importSearches:o,singleReferences:s};function d(t){if(264!==t.kind)if(79!==t.kind)if(199!==t.kind){if(10===t.moduleSpecifier.kind)if(271!==t.kind){var o=t.importClause||{name:void 0,namedBindings:void 0},u=o.name,_=o.namedBindings;if(_)switch(_.kind){case 267:p(_.name);break;case 268:0!==n&&1!==n||f(_);break;default:e.Debug.assertNever(_);}!u||1!==n&&2!==n||a&&u.escapedText!==e.symbolEscapedNameNoDefault(r)||c(u,i.getSymbolAtLocation(u));}else t.exportClause&&e.isNamedExports(t.exportClause)&&f(t.exportClause);}else if(t.qualifier){var d=e.getFirstIdentifier(t.qualifier);d.escapedText===e.symbolName(r)&&s.push(d);}else 2===n&&s.push(t.argument.literal);else p(t);else l(t)&&p(t.name);}function p(e){2!==n||a&&!g(e.escapedText)||c(e,i.getSymbolAtLocation(e));}function f(e){if(e)for(var t=0,n=e.elements;t<n.length;t++){var o=n[t],l=o.name,u=o.propertyName;g((u||l).escapedText)&&(u?(s.push(u),a&&l.escapedText!==r.escapedName||c(l,i.getSymbolAtLocation(l))):c(l,274===o.kind&&o.propertyName?i.getExportSpecifierLocalTargetSymbol(o):i.getSymbolAtLocation(l)));}}function g(e){return e===r.escapedName||0!==n&&"default"===e}}(m,n,p.exportKind,u,f))}},(_=t.ExportKind||(t.ExportKind={}))[_.Named=0]="Named",_[_.Default=1]="Default",_[_.ExportEquals=2]="ExportEquals",(u=t.ImportExport||(t.ImportExport={}))[u.Import=0]="Import",u[u.Export=1]="Export",t.findModuleReferences=function(e,t,r){for(var i=[],a=e.getTypeChecker(),o=0,s=t;o<s.length;o++){var c=s[o],l=r.valueDeclaration;if(303===(null==l?void 0:l.kind)){for(var u=0,_=c.referencedFiles;u<_.length;u++){var d=_[u];e.getSourceFileFromReference(c,d)===l&&i.push({kind:"reference",referencingFile:c,ref:d});}for(var p=0,f=c.typeReferenceDirectives;p<f.length;p++){d=f[p];var g=e.getResolvedTypeReferenceDirectives().get(d.fileName);void 0!==g&&g.resolvedFileName===l.fileName&&i.push({kind:"reference",referencingFile:c,ref:d});}}n(c,(function(e,t){a.getSymbolAtLocation(t)===r&&i.push({kind:"import",literal:t});}));}return i},t.getImportOrExportSymbol=function(t,r,n,i){return i?o():o()||function(){if(function(t){var r=t.parent;switch(r.kind){case 264:return r.name===t&&l(r);case 269:return !r.propertyName;case 266:case 267:return e.Debug.assert(r.name===t),!0;case 202:return e.isInJSFile(t)&&e.isRequireVariableDeclaration(r);default:return !1}}(t)){var i=n.getImmediateAliasedSymbol(r);if(i){"export="===(i=function(t,r){if(t.declarations)for(var n=0,i=t.declarations;n<i.length;n++){var a=i[n];if(e.isExportSpecifier(a)&&!a.propertyName&&!a.parent.parent.moduleSpecifier)return r.getExportSpecifierLocalTargetSymbol(a);if(e.isPropertyAccessExpression(a)&&e.isModuleExportsAccessExpression(a.expression)&&!e.isPrivateIdentifier(a.name))return r.getSymbolAtLocation(a);if(e.isShorthandPropertyAssignment(a)&&e.isBinaryExpression(a.parent.parent)&&2===e.getAssignmentDeclarationKind(a.parent.parent))return r.getExportSpecifierLocalTargetSymbol(a.name)}return t}(i,n)).escapedName&&(i=function(t,r){if(2097152&t.flags)return e.Debug.checkDefined(r.getImmediateAliasedSymbol(t));var n=e.Debug.checkDefined(t.valueDeclaration);return e.isExportAssignment(n)?e.Debug.checkDefined(n.expression.symbol):e.isBinaryExpression(n)?e.Debug.checkDefined(n.right.symbol):e.isSourceFile(n)?e.Debug.checkDefined(n.symbol):e.Debug.fail()}(i,n));var a=e.symbolEscapedNameNoDefault(i);return void 0===a||"default"===a||a===r.escapedName?{kind:0,symbol:i}:void 0}}}();function o(){var a,o=t.parent,l=o.parent;if(r.exportSymbol)return 205===o.kind?(null===(a=r.declarations)||void 0===a?void 0:a.some((function(e){return e===o})))&&e.isBinaryExpression(l)?d(l,!1):void 0:s(r.exportSymbol,c(o));var u=function(t,r){var n=e.isVariableDeclaration(t)?t:e.isBindingElement(t)?e.walkUpBindingElementsAndPatterns(t):void 0;return n?t.name!==r||e.isCatchClause(n.parent)?void 0:e.isVariableStatement(n.parent.parent)?n.parent.parent:void 0:t}(o,t);if(u&&e.hasSyntacticModifier(u,1)){if(e.isImportEqualsDeclaration(u)&&u.moduleReference===t){if(i)return;return {kind:0,symbol:n.getSymbolAtLocation(u.name)}}return s(r,c(u))}if(e.isNamespaceExport(o))return s(r,0);if(e.isExportAssignment(o))return _(o);if(e.isExportAssignment(l))return _(l);if(e.isBinaryExpression(o))return d(o,!0);if(e.isBinaryExpression(l))return d(l,!0);if(e.isJSDocTypedefTag(o))return s(r,0);function _(e){if(e.symbol.parent){var t=e.isExportEquals?2:1;return {kind:1,symbol:r,exportInfo:{exportingModuleSymbol:e.symbol.parent,exportKind:t}}}}function d(t,i){var a;switch(e.getAssignmentDeclarationKind(t)){case 1:a=0;break;case 2:a=2;break;default:return}var o=i?n.getSymbolAtLocation(e.getNameOfAccessExpression(e.cast(t.left,e.isAccessExpression))):r;return o&&s(o,a)}}function s(e,t){var r=a(e,t,n);return r&&{kind:1,symbol:e,exportInfo:r}}function c(t){return e.hasSyntacticModifier(t,512)?1:0}},t.getExportInfo=a;}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){var r,a,o,s;function c(e,t){return void 0===t&&(t=1),{kind:t,node:e.name||e,context:u(e)}}function l(e){return e&&void 0===e.kind}function u(t){if(e.isDeclaration(t))return _(t);if(t.parent){if(!e.isDeclaration(t.parent)&&!e.isExportAssignment(t.parent)){if(e.isInJSFile(t)){var r=e.isBinaryExpression(t.parent)?t.parent:e.isAccessExpression(t.parent)&&e.isBinaryExpression(t.parent.parent)&&t.parent.parent.left===t.parent?t.parent.parent:void 0;if(r&&0!==e.getAssignmentDeclarationKind(r))return _(r)}if(e.isJsxOpeningElement(t.parent)||e.isJsxClosingElement(t.parent))return t.parent.parent;if(e.isJsxSelfClosingElement(t.parent)||e.isLabeledStatement(t.parent)||e.isBreakOrContinueStatement(t.parent))return t.parent;if(e.isStringLiteralLike(t)){var n=e.tryGetImportFromModuleSpecifier(t);if(n){var i=e.findAncestor(n,(function(t){return e.isDeclaration(t)||e.isStatement(t)||e.isJSDocTag(t)}));return e.isDeclaration(i)?_(i):i}}var a=e.findAncestor(t,e.isComputedPropertyName);return a?_(a.parent):void 0}return t.parent.name===t||e.isConstructorDeclaration(t.parent)||e.isExportAssignment(t.parent)||(e.isImportOrExportSpecifier(t.parent)||e.isBindingElement(t.parent))&&t.parent.propertyName===t||88===t.kind&&e.hasSyntacticModifier(t.parent,513)?_(t.parent):void 0}}function _(t){if(t)switch(t.kind){case 253:return e.isVariableDeclarationList(t.parent)&&1===t.parent.declarations.length?e.isVariableStatement(t.parent.parent)?t.parent.parent:e.isForInOrOfStatement(t.parent.parent)?_(t.parent.parent):t.parent:t;case 202:return _(t.parent.parent);case 269:return t.parent.parent.parent;case 274:case 267:return t.parent.parent;case 266:case 273:return t.parent;case 220:return e.isExpressionStatement(t.parent)?t.parent:t;case 243:case 242:return {start:t.initializer,end:t.expression};case 294:case 295:return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)?_(e.findAncestor(t.parent,(function(t){return e.isBinaryExpression(t)||e.isForInOrOfStatement(t)}))):t;default:return t}}function d(e,t,r){if(r){var n=l(r)?b(r.start,t,r.end):b(r,t);return n.start!==e.start||n.length!==e.length?{contextSpan:n}:void 0}}function p(t,n,i,a,o){if(303!==a.kind){var s=t.getTypeChecker();if(295===a.parent.kind){var l=[];return r.getReferenceEntriesForShorthandPropertyAssignment(a,s,(function(e){return l.push(c(e))})),l}if(106===a.kind||e.isSuperProperty(a.parent)){var u=s.getSymbolAtLocation(a);return u.valueDeclaration&&[c(u.valueDeclaration)]}return f(o,a,t,i,n,{implementations:!0,use:1})}}function f(t,n,i,a,o,s,c){return void 0===s&&(s={}),void 0===c&&(c=new e.Set(a.map((function(e){return e.fileName})))),g(r.getReferencedSymbolsForNode(t,n,i,a,o,s,c))}function g(t){return t&&e.flatMap(t,(function(e){return e.references}))}function m(t){var r=t.getSourceFile();return {sourceFile:r,textSpan:b(e.isComputedPropertyName(t)?t.expression:t,r)}}function y(t,n,i){var a=r.getIntersectingMeaningFromDeclarations(i,t),o=t.declarations&&e.firstOrUndefined(t.declarations)||i,s=e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(n,t,o.getSourceFile(),o,o,a);return {displayParts:s.displayParts,kind:s.symbolKind}}function v(e,t){var r=h(e);if(0===e.kind)return i$1(i$1({},r),{isWriteAccess:!1,isDefinition:!1});var n=e.kind,a=e.node;return i$1(i$1({},r),{isWriteAccess:D(a),isDefinition:S(a,t),isInString:2===n||void 0})}function h(e){if(0===e.kind)return {textSpan:e.textSpan,fileName:e.fileName};var t=e.node.getSourceFile(),r=b(e.node,t);return i$1({textSpan:r,fileName:t.fileName},d(r,t,e.context))}function b(t,r,n){var i=t.getStart(r),a=(n||t).getEnd();return e.isStringLiteralLike(t)&&(e.Debug.assert(void 0===n),i+=1,a-=1),e.createTextSpanFromBounds(i,a)}function x(e){return 0===e.kind?e.textSpan:b(e.node,e.node.getSourceFile())}function D(t){var r=e.getDeclarationFromName(t);return !!r&&function(t){if(8388608&t.flags)return !0;switch(t.kind){case 220:case 202:case 256:case 225:case 88:case 259:case 297:case 274:case 266:case 264:case 269:case 257:case 336:case 343:case 284:case 260:case 263:case 267:case 273:case 163:case 295:case 258:case 162:return !0;case 294:return !e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent);case 255:case 212:case 170:case 168:case 171:case 172:return !!t.body;case 253:case 166:return !!t.initializer||e.isCatchClause(t.parent);case 167:case 165:case 345:case 338:return !1;default:return e.Debug.failBadSyntaxKind(t)}}(r)||88===t.kind||e.isWriteAccess(t)}function S(t,r){var n;if(!r)return !1;var i=e.getDeclarationFromName(t)||(88===t.kind?t.parent:e.isLiteralComputedPropertyDeclarationName(t)||134===t.kind&&e.isConstructorDeclaration(t.parent)?t.parent.parent:void 0),a=i&&e.isBinaryExpression(i)?i.left:void 0;return !(!i||!(null===(n=r.declarations)||void 0===n?void 0:n.some((function(e){return e===i||e===a}))))}(s=t.DefinitionKind||(t.DefinitionKind={}))[s.Symbol=0]="Symbol",s[s.Label=1]="Label",s[s.Keyword=2]="Keyword",s[s.This=3]="This",s[s.String=4]="String",s[s.TripleSlashReference=5]="TripleSlashReference",(o=t.EntryKind||(t.EntryKind={}))[o.Span=0]="Span",o[o.Node=1]="Node",o[o.StringLiteral=2]="StringLiteral",o[o.SearchedLocalFoundProperty=3]="SearchedLocalFoundProperty",o[o.SearchedPropertyFoundLocal=4]="SearchedPropertyFoundLocal",t.nodeEntry=c,t.isContextWithStartAndEndNode=l,t.getContextNode=_,t.toContextSpan=d,(a=t.FindReferencesUse||(t.FindReferencesUse={}))[a.Other=0]="Other",a[a.References=1]="References",a[a.Rename=2]="Rename",t.findReferencedSymbols=function(t,n,a,o,s){var c=e.getTouchingPropertyName(o,s),l=r.getReferencedSymbolsForNode(s,c,t,a,n,{use:1}),u=t.getTypeChecker(),p=u.getSymbolAtLocation(c);return l&&l.length?e.mapDefined(l,(function(t){var r=t.definition,a=t.references;return r&&{definition:u.runWithCancellationToken(n,(function(t){return function(t,r,n){var a=function(){switch(t.type){case 0:var a=y(p=t.symbol,r,n),o=a.displayParts,s=a.kind,c=o.map((function(e){return e.text})).join(""),l=p.declarations&&e.firstOrUndefined(p.declarations),u=l?e.getNameOfDeclaration(l)||l:n;return i$1(i$1({},m(u)),{name:c,kind:s,displayParts:o,context:_(l)});case 1:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"label",displayParts:[e.displayPart(u.text,e.SymbolDisplayPartKind.text)]});case 2:u=t.node;var d=e.tokenToString(u.kind);return i$1(i$1({},m(u)),{name:d,kind:"keyword",displayParts:[{text:d,kind:"keyword"}]});case 3:u=t.node;var p,f=(p=r.getSymbolAtLocation(u))&&e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(r,p,u.getSourceFile(),e.getContainerNode(u),u).displayParts||[e.textPart("this")];return i$1(i$1({},m(u)),{name:"this",kind:"var",displayParts:f});case 4:return u=t.node,i$1(i$1({},m(u)),{name:u.text,kind:"var",displayParts:[e.displayPart(e.getTextOfNode(u),e.SymbolDisplayPartKind.stringLiteral)]});case 5:return {textSpan:e.createTextSpanFromRange(t.reference),sourceFile:t.file,name:t.reference.fileName,kind:"string",displayParts:[e.displayPart('"'.concat(t.reference.fileName,'"'),e.SymbolDisplayPartKind.stringLiteral)]};default:return e.Debug.assertNever(t)}}(),o=a.sourceFile,s=a.textSpan,c=a.name,l=a.kind,u=a.displayParts,p=a.context;return i$1({containerKind:"",containerName:"",fileName:o.fileName,kind:l,name:c,textSpan:s,displayParts:u},d(s,o,p))}(r,t,c)})),references:a.map((function(e){return v(e,p)}))}})):void 0},t.getImplementationsAtPosition=function(t,r,a,o,s){var c,l=e.getTouchingPropertyName(o,s),u=p(t,r,a,l,s);if(205===l.parent.kind||202===l.parent.kind||206===l.parent.kind||106===l.kind)c=u&&n$3([],u,!0);else for(var _=u&&n$3([],u,!0),d=new e.Map;_&&_.length;){var f=_.shift();if(e.addToSeen(d,e.getNodeId(f.node))){c=e.append(c,f);var g=p(t,r,a,f.node,f.node.pos);g&&_.push.apply(_,g);}}var m=t.getTypeChecker();return e.map(c,(function(t){return function(t,r){var n=h(t);if(0!==t.kind){var a=t.node;return i$1(i$1({},n),function(t,r){var n=r.getSymbolAtLocation(e.isDeclaration(t)&&t.name?t.name:t);return n?y(n,r,t):204===t.kind?{kind:"interface",displayParts:[e.punctuationPart(20),e.textPart("object literal"),e.punctuationPart(21)]}:225===t.kind?{kind:"local class",displayParts:[e.punctuationPart(20),e.textPart("anonymous local class"),e.punctuationPart(21)]}:{kind:e.getNodeKind(t),displayParts:[]}}(a,r))}return i$1(i$1({},n),{kind:"",displayParts:[]})}(t,m)}))},t.findReferenceOrRenameEntries=function(t,n,i,a,o,s,c){return e.map(g(r.getReferencedSymbolsForNode(o,a,t,i,n,s)),(function(e){return c(e,a,t.getTypeChecker())}))},t.getReferenceEntriesForNode=f,t.toRenameLocation=function(t,r,n,a){return i$1(i$1({},h(t)),a&&function(t,r,n){if(0!==t.kind&&e.isIdentifier(r)){var i=t.node,a=t.kind,o=i.parent,s=r.text,c=e.isShorthandPropertyAssignment(o);if(c||e.isObjectBindingElementWithoutPropertyName(o)&&o.name===i&&void 0===o.dotDotDotToken){var l={prefixText:s+": "},u={suffixText:": "+s};if(3===a)return l;if(4===a)return u;if(c){var _=o.parent;return e.isObjectLiteralExpression(_)&&e.isBinaryExpression(_.parent)&&e.isModuleExportsAccessExpression(_.parent.left)?l:u}return l}if(e.isImportSpecifier(o)&&!o.propertyName){var d=e.isExportSpecifier(r.parent)?n.getExportSpecifierLocalTargetSymbol(r.parent):n.getSymbolAtLocation(r);return e.contains(d.declarations,o)?{prefixText:s+" as "}:e.emptyOptions}if(e.isExportSpecifier(o)&&!o.propertyName)return r===t.node||n.getSymbolAtLocation(r)===n.getSymbolAtLocation(t.node)?{prefixText:s+" as "}:{suffixText:" as "+s}}return e.emptyOptions}(t,r,n))},t.toReferenceEntry=v,t.toHighlightSpan=function(e){var t=h(e);if(0===e.kind)return {fileName:t.fileName,span:{textSpan:t.textSpan,kind:"reference"}};var r=D(e.node),n=i$1({textSpan:t.textSpan,kind:r?"writtenReference":"reference",isInString:2===e.kind||void 0},t.contextSpan&&{contextSpan:t.contextSpan});return {fileName:t.fileName,span:n}},t.getTextSpanOfEntry=x,function(r){function n(t,r,n){for(var i,a=0,o=r.get(t.path)||e.emptyArray;a<o.length;a++){var s=o[a];if(e.isReferencedFile(s)){var c=n.getSourceFileByPath(s.file),l=e.getReferencedFileLocation(n.getSourceFileByPath,s);e.isReferenceFileLocation(l)&&(i=e.append(i,{kind:0,fileName:c.fileName,textSpan:e.createTextSpanFromRange(l)}));}}return i}function i(t,r,n){if(t.parent&&e.isNamespaceExportDeclaration(t.parent)){var i=n.getAliasedSymbol(r),a=n.getMergedSymbol(i);if(i!==a)return a}}function a(t,r,n,i,a,s){var c=1536&t.flags&&t.declarations&&e.find(t.declarations,e.isSourceFile);if(c){var u=t.exports.get("export="),d=l(r,t,!!u,n,s);if(!u||!s.has(c.fileName))return d;var p=r.getTypeChecker();return o(r,d,_(t=e.skipAlias(u,p),void 0,n,s,p,i,a))}}function o(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];for(var a=0,o=n;a<o.length;a++){var c=o[a];if(c&&c.length)if(r)for(var l=function(n){if(!n.definition||0!==n.definition.type)return r.push(n),"continue";var i=n.definition.symbol,a=e.findIndex(r,(function(e){return !!e.definition&&0===e.definition.type&&e.definition.symbol===i}));if(-1===a)return r.push(n),"continue";var o=r[a];r[a]={definition:o.definition,references:o.references.concat(n.references).sort((function(r,n){var i=s(t,r),a=s(t,n);if(i!==a)return e.compareValues(i,a);var o=x(r),c=x(n);return o.start!==c.start?e.compareValues(o.start,c.start):e.compareValues(o.length,c.length)}))};},u=0,_=c;u<_.length;u++){var d=_[u];l(d);}else r=c;}return r}function s(e,t){var r=0===t.kind?e.getSourceFile(t.fileName):t.node.getSourceFile();return e.getSourceFiles().indexOf(r)}function l(r,n,i,a,o){e.Debug.assert(!!n.valueDeclaration);var s=e.mapDefined(t.findModuleReferences(r,a,n),(function(t){if("import"===t.kind){var r=t.literal.parent;if(e.isLiteralTypeNode(r)){var n=e.cast(r.parent,e.isImportTypeNode);if(i&&!n.qualifier)return}return c(t.literal)}return {kind:0,fileName:t.referencingFile.fileName,textSpan:e.createTextSpanFromRange(t.ref)}}));if(n.declarations)for(var l=0,u=n.declarations;l<u.length;l++)switch((f=u[l]).kind){case 303:break;case 260:o.has(f.getSourceFile().fileName)&&s.push(c(f.name));break;default:e.Debug.assert(!!(33554432&n.flags),"Expected a module symbol to be declared by a SourceFile or ModuleDeclaration.");}var _=n.exports.get("export=");if(null==_?void 0:_.declarations)for(var d=0,p=_.declarations;d<p.length;d++){var f,g=(f=p[d]).getSourceFile();if(o.has(g.fileName)){var m=e.isBinaryExpression(f)&&e.isPropertyAccessExpression(f.left)?f.left.expression:e.isExportAssignment(f)?e.Debug.checkDefined(e.findChildOfKind(f,93,g)):e.getNameOfDeclaration(f)||f;s.push(c(m));}}return s.length?[{definition:{type:0,symbol:n},references:s}]:e.emptyArray}function u(t){return 144===t.kind&&e.isTypeOperatorNode(t.parent)&&144===t.parent.operator}function _(t,r,n,i,a,o,s){var c=r&&function(t,r,n,i){var a=r.parent;return e.isExportSpecifier(a)&&i?F(r,t,a,n):e.firstDefined(t.declarations,(function(i){if(!i.parent){if(33554432&t.flags)return;e.Debug.fail("Unexpected symbol at ".concat(e.Debug.formatSyntaxKind(r.kind),": ").concat(e.Debug.formatSymbol(t)));}return e.isTypeLiteralNode(i.parent)&&e.isUnionTypeNode(i.parent.parent)?n.getPropertyOfType(n.getTypeFromTypeNode(i.parent.parent),t.name):void 0}))}(t,r,a,!U(s))||t,l=r?j(r,c):7,u=[],_=new f(n,i,r?function(t){switch(t.kind){case 170:case 134:return 1;case 79:if(e.isClassLike(t.parent))return e.Debug.assert(t.parent.name===t),2;default:return 0}}(r):0,a,o,l,s,u),p=U(s)&&c.declarations?e.find(c.declarations,e.isExportSpecifier):void 0;if(p)N(p.name,c,p,_.createSearch(r,t,void 0),_,!0,!0);else if(r&&88===r.kind&&"default"===c.escapedName&&c.parent)A(r,c,_),g(r,c,{exportingModuleSymbol:c.parent,exportKind:1},_);else {var m=_.createSearch(r,c,void 0,{allSearchSymbols:r?L(c,r,a,2===s.use,!!s.providePrefixAndSuffixTextForRename,!!s.implementations):[c]});d(c,_,m);}return u}function d(t,r,n){var i=function(t){var r=t.declarations,n=t.flags,i=t.parent,a=t.valueDeclaration;if(a&&(212===a.kind||225===a.kind))return a;if(r){if(8196&n){var o=e.find(r,(function(t){return e.hasEffectiveModifier(t,8)||e.isPrivateIdentifierClassElementDeclaration(t)}));return o?e.getAncestor(o,256):void 0}if(!r.some(e.isObjectBindingElementWithoutPropertyName)){var s,c=i&&!(262144&t.flags);if(!c||e.isExternalModuleSymbol(i)&&!i.globalExports){for(var l=0,u=r;l<u.length;l++){var _=u[l],d=e.getContainerNode(_);if(s&&s!==d)return;if(!d||303===d.kind&&!e.isExternalOrCommonJsModule(d))return;if(s=d,e.isFunctionExpression(s))for(var p=void 0;p=e.getNextJSDocCommentLocation(s);)s=p;}return c?s.getSourceFile():s}}}}(t);if(i)C(i,i.getSourceFile(),n,r,!(e.isSourceFile(i)&&!e.contains(r.sourceFiles,i)));else for(var a=0,o=r.sourceFiles;a<o.length;a++){var s=o[a];r.cancellationToken.throwIfCancellationRequested(),v(s,n,r);}}var p;r.getReferencedSymbolsForNode=function(t,r,s,d,p,f,g){var m,y;if(void 0===f&&(f={}),void 0===g&&(g=new e.Set(d.map((function(e){return e.fileName})))),1===f.use?r=e.getAdjustedReferenceLocation(r):2===f.use&&(r=e.getAdjustedRenameLocation(r)),e.isSourceFile(r)){var v=e.GoToDefinition.getReferenceAtPosition(r,t,s);if(!(null==v?void 0:v.file))return;var h=s.getTypeChecker().getMergedSymbol(v.file.symbol);if(h)return l(s,h,!1,d,g);if(!(N=s.getFileIncludeReasons()))return;return [{definition:{type:5,reference:v.reference,file:r},references:n(v.file,N,s)||e.emptyArray}]}if(!f.implementations){var x=function(t,r,n){if(e.isTypeKeyword(t.kind)){if(114===t.kind&&e.isVoidExpression(t.parent))return;if(144===t.kind&&!u(t))return;return function(t,r,n,i){var a=e.flatMap(t,(function(t){return n.throwIfCancellationRequested(),e.mapDefined(b(t,e.tokenToString(r),t),(function(e){if(e.kind===r&&(!i||i(e)))return c(e)}))}));return a.length?[{definition:{type:2,node:a[0].node},references:a}]:void 0}(r,t.kind,n,144===t.kind?u:void 0)}if(e.isStaticModifier(t)&&e.isClassStaticBlockDeclaration(t.parent))return [{definition:{type:2,node:t},references:[c(t)]}];if(e.isJumpStatementTarget(t)){var i=e.getTargetLabel(t.parent,t.text);return i&&S(i.parent,i)}return e.isLabelOfLabeledStatement(t)?S(t.parent,t):e.isThis(t)?function(t,r,n){var i=e.getThisContainer(t,!1),a=32;switch(i.kind){case 168:case 167:if(e.isObjectLiteralMethod(i)){a&=e.getSyntacticModifierFlags(i),i=i.parent;break}case 166:case 165:case 170:case 171:case 172:a&=e.getSyntacticModifierFlags(i),i=i.parent;break;case 303:if(e.isExternalModule(i)||M(t))return;case 255:case 212:break;default:return}var o=e.flatMap(303===i.kind?r:[i.getSourceFile()],(function(t){return n.throwIfCancellationRequested(),b(t,"this",e.isSourceFile(i)?t:i).filter((function(t){if(!e.isThis(t))return !1;var r=e.getThisContainer(t,!1);switch(i.kind){case 212:case 255:return i.symbol===r.symbol;case 168:case 167:return e.isObjectLiteralMethod(i)&&i.symbol===r.symbol;case 225:case 256:case 204:return r.parent&&i.symbol===r.parent.symbol&&e.isStatic(r)===!!a;case 303:return 303===r.kind&&!e.isExternalModule(r)&&!M(t)}}))})).map((function(e){return c(e)}));return [{definition:{type:3,node:e.firstDefined(o,(function(t){return e.isParameter(t.node.parent)?t.node:void 0}))||t},references:o}]}(t,r,n):106===t.kind?function(t){var r=e.getSuperContainer(t,!1);if(r){var n=32;switch(r.kind){case 166:case 165:case 168:case 167:case 170:case 171:case 172:n&=e.getSyntacticModifierFlags(r),r=r.parent;break;default:return}var i=r.getSourceFile(),a=e.mapDefined(b(i,"super",r),(function(t){if(106===t.kind){var i=e.getSuperContainer(t,!1);return i&&e.isStatic(i)===!!n&&i.parent.symbol===r.symbol?c(t):void 0}}));return [{definition:{type:0,symbol:r.symbol},references:a}]}}(t):void 0}(r,d,p);if(x)return x}var D=s.getTypeChecker(),T=D.getSymbolAtLocation(e.isConstructorDeclaration(r)&&r.parent.name||r);if(T){if("export="===T.escapedName)return l(s,T.parent,!1,d,g);var C=a(T,s,d,p,f,g);if(C&&!(33554432&T.flags))return C;var E=i(r,T,D),k=E&&a(E,s,d,p,f,g);return o(s,C,_(T,r,d,g,D,p,f),k)}if(!f.implementations&&e.isStringLiteralLike(r)){if(e.isModuleSpecifierLike(r)){var N=s.getFileIncludeReasons(),F=null===(y=null===(m=r.getSourceFile().resolvedModules)||void 0===m?void 0:m.get(r.text,e.getModeForUsageLocation(r.getSourceFile(),r)))||void 0===y?void 0:y.resolvedFileName,A=F?s.getSourceFile(F):void 0;if(A)return [{definition:{type:4,node:r},references:n(A,N,s)||e.emptyArray}]}return function(t,r,n,i){var a=e.getContextualTypeFromParentOrAncestorTypeNode(t,n),o=e.flatMap(r,(function(r){return i.throwIfCancellationRequested(),e.mapDefined(b(r,t.text),(function(r){if(e.isStringLiteralLike(r)&&r.text===t.text){if(!a)return c(r,2);var i=e.getContextualTypeFromParentOrAncestorTypeNode(r,n);if(a!==n.getStringType()&&a===i)return c(r,2)}}))}));return [{definition:{type:4,node:t},references:o}]}(r,d,D,p)}},r.getReferencesForFileName=function(t,r,i,a){var o,s;void 0===a&&(a=new e.Set(i.map((function(e){return e.fileName}))));var c=null===(o=r.getSourceFile(t))||void 0===o?void 0:o.symbol;if(c)return (null===(s=l(r,c,!1,i,a)[0])||void 0===s?void 0:s.references)||e.emptyArray;var u=r.getFileIncludeReasons(),_=r.getSourceFile(t);return _&&u&&n(_,u,r)||e.emptyArray},function(e){e[e.None=0]="None",e[e.Constructor=1]="Constructor",e[e.Class=2]="Class";}(p||(p={}));var f=function(){function r(t,r,n,i,a,o,s,c){this.sourceFiles=t,this.sourceFilesSet=r,this.specialSearchKind=n,this.checker=i,this.cancellationToken=a,this.searchMeaning=o,this.options=s,this.result=c,this.inheritsFromCache=new e.Map,this.markSeenContainingTypeReference=e.nodeSeenTracker(),this.markSeenReExportRHS=e.nodeSeenTracker(),this.symbolIdToReferences=[],this.sourceFileToSeenSymbols=[];}return r.prototype.includesSourceFile=function(e){return this.sourceFilesSet.has(e.fileName)},r.prototype.getImportSearches=function(e,r){return this.importTracker||(this.importTracker=t.createImportTracker(this.sourceFiles,this.sourceFilesSet,this.checker,this.cancellationToken)),this.importTracker(e,r,2===this.options.use)},r.prototype.createSearch=function(t,r,n,i){void 0===i&&(i={});var a=i.text,o=void 0===a?e.stripQuotes(e.symbolName(e.getLocalSymbolForExportDefault(r)||function(t){if(33555968&t.flags){var r=t.declarations&&e.find(t.declarations,(function(t){return !e.isSourceFile(t)&&!e.isModuleDeclaration(t)}));return r&&r.symbol}}(r)||r)):a,s=i.allSearchSymbols,c=void 0===s?[r]:s;return {symbol:r,comingFrom:n,text:o,escapedText:e.escapeLeadingUnderscores(o),parents:this.options.implementations&&t?function(t,r,n){var i=e.isRightSideOfPropertyAccess(t)?t.parent:void 0,a=i&&n.getTypeAtLocation(i.expression),o=e.mapDefined(a&&(a.isUnionOrIntersection()?a.types:a.symbol===r.parent?void 0:[a]),(function(e){return e.symbol&&96&e.symbol.flags?e.symbol:void 0}));return 0===o.length?void 0:o}(t,r,this.checker):void 0,allSearchSymbols:c,includes:function(t){return e.contains(c,t)}}},r.prototype.referenceAdder=function(t){var r=e.getSymbolId(t),n=this.symbolIdToReferences[r];return n||(n=this.symbolIdToReferences[r]=[],this.result.push({definition:{type:0,symbol:t},references:n})),function(e,t){return n.push(c(e,t))}},r.prototype.addStringOrCommentReference=function(e,t){this.result.push({definition:void 0,references:[{kind:0,fileName:e,textSpan:t}]});},r.prototype.markSearchedSymbols=function(t,r){for(var n=e.getNodeId(t),i=this.sourceFileToSeenSymbols[n]||(this.sourceFileToSeenSymbols[n]=new e.Set),a=!1,o=0,s=r;o<s.length;o++){var c=s[o];a=e.tryAddToSet(i,e.getSymbolId(c))||a;}return a},r}();function g(e,t,r,n){var i=n.getImportSearches(t,r),a=i.importSearches,o=i.singleReferences,s=i.indirectUsers;if(o.length)for(var c=n.referenceAdder(t),l=0,u=o;l<u.length;l++){var _=u[l];m(_,n)&&c(_);}for(var d=0,p=a;d<p.length;d++){var f=p[d],g=f[0],y=f[1];T(g.getSourceFile(),n.createSearch(g,y,1),n);}if(s.length){var h=void 0;switch(r.exportKind){case 0:h=n.createSearch(e,t,1);break;case 1:h=2===n.options.use?void 0:n.createSearch(e,t,1,{text:"default"});}if(h)for(var b=0,x=s;b<x.length;b++)v(x[b],h,n);}}function m(t,r){return !(!E(t,r)||2===r.options.use&&(!e.isIdentifier(t)||e.isImportOrExportSpecifier(t.parent)&&"default"===t.escapedText))}function y(e,t){if(e.declarations)for(var r=0,n=e.declarations;r<n.length;r++){var i=n[r],a=i.getSourceFile();T(a,t.createSearch(i,e,0),t,t.includesSourceFile(a));}}function v(t,r,n){void 0!==e.getNameTable(t).get(r.escapedText)&&T(t,r,n);}function h(t,r,n,i,a){void 0===a&&(a=n);var o=e.isParameterPropertyDeclaration(t.parent,t.parent.parent)?e.first(r.getSymbolsOfParameterPropertyDeclaration(t.parent,t.text)):r.getSymbolAtLocation(t);if(o)for(var s=0,c=b(n,o.name,a);s<c.length;s++){var l=c[s];if(e.isIdentifier(l)&&l!==t&&l.escapedText===t.escapedText){var u=r.getSymbolAtLocation(l);if(u===o||r.getShorthandAssignmentValueSymbol(l.parent)===o||e.isExportSpecifier(l.parent)&&F(l,u,l.parent,r)===o){var _=i(l);if(_)return _}}}}function b(t,r,n){return void 0===n&&(n=t),D(t,r,n).map((function(r){return e.getTouchingPropertyName(t,r)}))}function D(t,r,n){void 0===n&&(n=t);var i=[];if(!r||!r.length)return i;for(var a=t.text,o=a.length,s=r.length,c=a.indexOf(r,n.pos);c>=0&&!(c>n.end);){var l=c+s;0!==c&&e.isIdentifierPart(a.charCodeAt(c-1),99)||l!==o&&e.isIdentifierPart(a.charCodeAt(l),99)||i.push(c),c=a.indexOf(r,c+s+1);}return i}function S(t,r){var n=t.getSourceFile(),i=r.text,a=e.mapDefined(b(n,i,t),(function(t){return t===r||e.isJumpStatementTarget(t)&&e.getTargetLabel(t,i)===r?c(t):void 0}));return [{definition:{type:1,node:r},references:a}]}function T(e,t,r,n){return void 0===n&&(n=!0),r.cancellationToken.throwIfCancellationRequested(),C(e,e,t,r,n)}function C(e,t,r,n,i){if(n.markSearchedSymbols(t,r.allSearchSymbols))for(var a=0,o=D(t,r.text,e);a<o.length;a++)k(t,o[a],r,n,i);}function E(t,r){return !!(e.getMeaningFromLocation(t)&r.searchMeaning)}function k(r,n,i,a,o){var s=e.getTouchingPropertyName(r,n);if(function(t,r){switch(t.kind){case 80:if(e.isJSDocMemberName(t.parent))return !0;case 79:return t.text.length===r.length;case 14:case 10:var n=t;return (e.isLiteralNameOfPropertyDeclarationOrIndexAccess(n)||e.isNameOfModuleDeclaration(t)||e.isExpressionOfExternalModuleImportEqualsDeclaration(t)||e.isCallExpression(t.parent)&&e.isBindableObjectDefinePropertyCall(t.parent)&&t.parent.arguments[1]===t)&&n.text.length===r.length;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t)&&t.text.length===r.length;case 88:return "default".length===r.length;default:return !1}}(s,i.text)){if(E(s,a)){var c=a.checker.getSymbolAtLocation(s);if(c){var l=s.parent;if(!e.isImportSpecifier(l)||l.propertyName!==s){if(e.isExportSpecifier(l))return e.Debug.assert(79===s.kind),void N(s,c,l,i,a,o);var u=function(t,r,n,i){var a=i.checker;return R(r,n,a,!1,2!==i.options.use||!!i.options.providePrefixAndSuffixTextForRename,(function(n,i,a,o){return a&&B(r)!==B(a)&&(a=void 0),t.includes(a||i||n)?{symbol:!i||6&e.getCheckFlags(n)?n:i,kind:o}:void 0}),(function(e){return !(t.parents&&!t.parents.some((function(t){return O(e.parent,t,i.inheritsFromCache,a)})))}))}(i,c,s,a);if(u){switch(a.specialSearchKind){case 0:o&&A(s,u,a);break;case 1:!function(t,r,n,i){e.isNewExpressionTarget(t)&&A(t,n.symbol,i);var a,o=function(){return i.referenceAdder(n.symbol)};if(e.isClassLike(t.parent))e.Debug.assert(88===t.kind||t.parent.name===t),function(t,r,n){var i=P(t);if(i&&i.declarations)for(var a=0,o=i.declarations;a<o.length;a++){var s=o[a],c=e.findChildOfKind(s,134,r);e.Debug.assert(170===s.kind&&!!c),n(c);}t.exports&&t.exports.forEach((function(t){var r=t.valueDeclaration;if(r&&168===r.kind){var i=r.body;i&&z(i,108,(function(t){e.isNewExpressionTarget(t)&&n(t);}));}}));}(n.symbol,r,o());else {var s=(a=t,e.tryGetClassExtendingExpressionWithTypeArguments(e.climbPastPropertyAccess(a).parent));s&&(function(t,r){var n=P(t.symbol);if(n&&n.declarations)for(var i=0,a=n.declarations;i<a.length;i++){var o=a[i];e.Debug.assert(170===o.kind);var s=o.body;s&&z(s,106,(function(t){e.isCallExpressionTarget(t)&&r(t);}));}}(s,o()),function(e,t){if(!function(e){return !!P(e.symbol)}(e)){var r=e.symbol,n=t.createSearch(void 0,r,void 0);d(r,t,n);}}(s,i));}}(s,r,i,a);break;case 2:!function(t,r,n){A(t,r.symbol,n);var i=t.parent;if(2!==n.options.use&&e.isClassLike(i)){e.Debug.assert(i.name===t);for(var a=n.referenceAdder(r.symbol),o=0,s=i.members;o<s.length;o++){var c=s[o];e.isMethodOrAccessor(c)&&e.isStatic(c)&&c.body&&c.body.forEachChild((function t(r){108===r.kind?a(r):e.isFunctionLike(r)||e.isClassLike(r)||r.forEachChild(t);}));}}}(s,i,a);break;default:e.Debug.assertNever(a.specialSearchKind);}e.isInJSFile(s)&&202===s.parent.kind&&e.isRequireVariableDeclaration(s.parent)&&!(c=s.parent.symbol)||function(e,r,n,i){var a=t.getImportOrExportSymbol(e,r,i.checker,1===n.comingFrom);if(a){var o=a.symbol;0===a.kind?U(i.options)||y(o,i):g(e,o,a.exportInfo,i);}}(s,c,i,a);}else !function(t,r,n){var i=t.flags,a=t.valueDeclaration,o=n.checker.getShorthandAssignmentValueSymbol(a),s=a&&e.getNameOfDeclaration(a);33554432&i||!s||!r.includes(o)||A(s,o,n);}(c,i,a);}}}}else !a.options.implementations&&(a.options.findInStrings&&e.isInString(r,n)||a.options.findInComments&&e.isInNonReferenceComment(r,n))&&a.addStringOrCommentReference(r.fileName,e.createTextSpan(n,i.text.length));}function N(r,n,i,a,o,s,c){e.Debug.assert(!c||!!o.options.providePrefixAndSuffixTextForRename,"If alwaysGetReferences is true, then prefix/suffix text must be enabled");var l=i.parent,u=i.propertyName,_=i.name,d=l.parent,p=F(r,n,i,o.checker);if(c||a.includes(p)){if(u?r===u?(d.moduleSpecifier||b(),s&&2!==o.options.use&&o.markSeenReExportRHS(_)&&A(_,e.Debug.checkDefined(i.symbol),o)):o.markSeenReExportRHS(r)&&b():2===o.options.use&&"default"===_.escapedText||b(),!U(o.options)||c){var f=88===r.originalKeywordKind||88===i.name.originalKeywordKind?1:0,m=e.Debug.checkDefined(i.symbol),v=t.getExportInfo(m,f,o.checker);v&&g(r,m,v,o);}if(1!==a.comingFrom&&d.moduleSpecifier&&!u&&!U(o.options)){var h=o.checker.getExportSpecifierLocalTargetSymbol(i);h&&y(h,o);}}function b(){s&&A(r,p,o);}}function F(t,r,n,i){return function(t,r){var n=r.parent,i=r.propertyName,a=r.name;return e.Debug.assert(i===t||a===t),i?i===t:!n.parent.moduleSpecifier}(t,n)&&i.getExportSpecifierLocalTargetSymbol(n)||r}function A(t,r,n){var i="kind"in r?r:{kind:void 0,symbol:r},a=i.kind,o=i.symbol,s=n.referenceAdder(o);n.options.implementations?function(t,r,n){var i;if(!e.isDeclarationName(t)||(8388608&(i=t.parent).flags?e.isInterfaceDeclaration(i)||e.isTypeAliasDeclaration(i):!(e.isVariableLike(i)?e.hasInitializer(i):e.isFunctionLikeDeclaration(i)?i.body:e.isClassLike(i)||e.isModuleOrEnumDeclaration(i)))){if(79===t.kind){295===t.parent.kind&&J(t,n.checker,r);var a=w(t);if(a)r(a);else {var o=e.findAncestor(t,(function(t){return !e.isQualifiedName(t.parent)&&!e.isTypeNode(t.parent)&&!e.isTypeElement(t.parent)})),s=o.parent;if(e.hasType(s)&&s.type===o&&n.markSeenContainingTypeReference(s))if(e.hasInitializer(s))l(s.initializer);else if(e.isFunctionLike(s)&&s.body){var c=s.body;234===c.kind?e.forEachReturnStatement(c,(function(e){e.expression&&l(e.expression);})):l(c);}else e.isAssertionExpression(s)&&l(s.expression);}}}else r(t);function l(e){I(e)&&r(e);}}(t,s,n):s(t,a);}function P(e){return e.members&&e.members.get("__constructor")}function w(t){return e.isIdentifier(t)||e.isPropertyAccessExpression(t)?w(t.parent):e.isExpressionWithTypeArguments(t)?e.tryCast(t.parent.parent,e.isClassLike):void 0}function I(e){switch(e.kind){case 211:return I(e.expression);case 213:case 212:case 204:case 225:case 203:return !0;default:return !1}}function O(t,r,n,i){if(t===r)return !0;var a=e.getSymbolId(t)+","+e.getSymbolId(r),o=n.get(a);if(void 0!==o)return o;n.set(a,!1);var s=!!t.declarations&&t.declarations.some((function(t){return e.getAllSuperTypeNodes(t).some((function(e){var t=i.getTypeAtLocation(e);return !!t&&!!t.symbol&&O(t.symbol,r,n,i)}))}));return n.set(a,s),s}function M(e){return 79===e.kind&&163===e.parent.kind&&e.parent.name===e}function L(e,t,r,n,i,a){var o=[];return R(e,t,r,n,!(n&&i),(function(t,r,n){n&&B(e)!==B(n)&&(n=void 0),o.push(n||r||t);}),(function(){return !a})),o}function R(t,r,n,a,o,s,c){var l=e.getContainingObjectLiteralElement(r);if(l){var u=n.getShorthandAssignmentValueSymbol(r.parent);if(u&&a)return s(u,void 0,void 0,3);var _=n.getContextualType(l.parent),d=_&&e.firstDefined(e.getPropertySymbolsFromContextualType(l,n,_,!0),(function(e){return T(e,4)}));if(d)return d;var p=function(t,r){return e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent.parent)?r.getPropertySymbolOfDestructuringAssignment(t):void 0}(r,n),f=p&&s(p,void 0,void 0,4);if(f)return f;var g=u&&s(u,void 0,void 0,3);if(g)return g}var m=i(r,t,n);if(m){var y=s(m,void 0,void 0,1);if(y)return y}var v=T(t);if(v)return v;if(t.valueDeclaration&&e.isParameterPropertyDeclaration(t.valueDeclaration,t.valueDeclaration.parent)){var h=n.getSymbolsOfParameterPropertyDeclaration(e.cast(t.valueDeclaration,e.isParameter),t.name);return e.Debug.assert(2===h.length&&!!(1&h[0].flags)&&!!(4&h[1].flags)),T(1&t.flags?h[1]:h[0])}var b=e.getDeclarationOfKind(t,274);if(!a||b&&!b.propertyName){var x=b&&n.getExportSpecifierLocalTargetSymbol(b);if(x){var D=s(x,void 0,void 0,1);if(D)return D}}if(!a){var S=void 0;return (S=o?e.isObjectBindingElementWithoutPropertyName(r.parent)?e.getPropertySymbolFromBindingElement(n,r.parent):void 0:C(t,n))&&T(S,4)}if(e.Debug.assert(a),o)return (S=C(t,n))&&T(S,4);function T(t,r){return e.firstDefined(n.getRootSymbols(t),(function(i){return s(t,i,void 0,r)||(i.parent&&96&i.parent.flags&&c(i)?function(t,r,n,i){var a=new e.Map;return function t(o){if(96&o.flags&&e.addToSeen(a,e.getSymbolId(o)))return e.firstDefined(o.declarations,(function(a){return e.firstDefined(e.getAllSuperTypeNodes(a),(function(a){var o=n.getTypeAtLocation(a),s=o&&o.symbol&&n.getPropertyOfType(o,r);return o&&s&&(e.firstDefined(n.getRootSymbols(s),i)||t(o.symbol))}))}))}(t)}(i.parent,i.name,n,(function(e){return s(t,i,e,r)})):void 0)}))}function C(t,r){var n=e.getDeclarationOfKind(t,202);if(n&&e.isObjectBindingElementWithoutPropertyName(n))return e.getPropertySymbolFromBindingElement(r,n)}}function B(t){return !!t.valueDeclaration&&!!(32&e.getEffectiveModifierFlags(t.valueDeclaration))}function j(t,r){var n=e.getMeaningFromLocation(t),i=r.declarations;if(i){var a=void 0;do{a=n;for(var o=0,s=i;o<s.length;o++){var c=s[o],l=e.getMeaningFromDeclaration(c);l&n&&(n|=l);}}while(n!==a)}return n}function J(t,r,n){var i=r.getSymbolAtLocation(t),a=r.getShorthandAssignmentValueSymbol(i.valueDeclaration);if(a)for(var o=0,s=a.getDeclarations();o<s.length;o++){var c=s[o];1&e.getMeaningFromDeclaration(c)&&n(c);}}function z(t,r,n){e.forEachChild(t,(function(e){e.kind===r&&n(e),z(e,r,n);}));}function U(e){return 2===e.use&&e.providePrefixAndSuffixTextForRename}r.eachExportReference=function(r,n,i,a,o,s,c,l){for(var u=t.createImportTracker(r,new e.Set(r.map((function(e){return e.fileName}))),n,i)(a,{exportKind:c?1:0,exportingModuleSymbol:o},!1),_=u.importSearches,d=u.indirectUsers,p=0,f=_;p<f.length;p++)l(f[p][0]);for(var g=0,m=d;g<m.length;g++)for(var y=0,v=b(m[g],c?"default":s);y<v.length;y++){var h=v[y],x=n.getSymbolAtLocation(h),D=e.some(null==x?void 0:x.declarations,(function(t){return !!e.tryCast(t,e.isExportAssignment)}));!e.isIdentifier(h)||e.isImportOrExportSpecifier(h.parent)||x!==a&&!D||l(h);}},r.isSymbolReferencedInFile=function(e,t,r,n){return void 0===n&&(n=r),h(e,t,r,(function(){return !0}),n)||!1},r.eachSymbolReferenceInFile=h,r.someSignatureUsage=function(t,r,n,i){if(!t.name||!e.isIdentifier(t.name))return !1;for(var a=e.Debug.checkDefined(n.getSymbolAtLocation(t.name)),o=0,s=r;o<s.length;o++)for(var c=0,l=b(s[o],a.name);c<l.length;c++){var u=l[c];if(e.isIdentifier(u)&&u!==t.name&&u.escapedText===t.name.escapedText){var _=e.climbPastPropertyAccess(u),d=e.isCallExpression(_.parent)&&_.parent.expression===_?_.parent:void 0,p=n.getSymbolAtLocation(u);if(p&&n.getRootSymbols(p).some((function(e){return e===a}))&&i(u,d))return !0}}return !1},r.getIntersectingMeaningFromDeclarations=j,r.getReferenceEntriesForShorthandPropertyAssignment=J;}(r=t.Core||(t.Core={}));}(e.FindAllReferences||(e.FindAllReferences={}));}(t),function(e){!function(t){function r(t){return (e.isFunctionExpression(t)||e.isArrowFunction(t)||e.isClassExpression(t))&&e.isVariableDeclaration(t.parent)&&t===t.parent.initializer&&e.isIdentifier(t.parent.name)&&!!(2&e.getCombinedNodeFlags(t.parent))}function n(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isClassExpression(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)}function i(t){return e.isSourceFile(t)||e.isModuleDeclaration(t)&&e.isIdentifier(t.name)||e.isFunctionDeclaration(t)||e.isClassDeclaration(t)||e.isClassStaticBlockDeclaration(t)||e.isMethodDeclaration(t)||e.isMethodSignature(t)||e.isGetAccessorDeclaration(t)||e.isSetAccessorDeclaration(t)||function(t){return (e.isFunctionExpression(t)||e.isClassExpression(t))&&e.isNamedDeclaration(t)}(t)||r(t)}function a(t){return e.isSourceFile(t)?t:e.isNamedDeclaration(t)?t.name:r(t)?t.parent.name:e.Debug.checkDefined(t.modifiers&&e.find(t.modifiers,o))}function o(e){return 88===e.kind}function s(e,t){var r=a(t);return r&&e.getSymbolAtLocation(r)}function c(t,r){if(r.body)return r;if(e.isConstructorDeclaration(r))return e.getFirstConstructorWithBody(r.parent);if(e.isFunctionDeclaration(r)||e.isMethodDeclaration(r)){var n=s(t,r);return n&&n.valueDeclaration&&e.isFunctionLikeDeclaration(n.valueDeclaration)&&n.valueDeclaration.body?n.valueDeclaration:void 0}return r}function l(t,r){var n,a=s(t,r);if(a&&a.declarations){var o=e.indicesOf(a.declarations),c=e.map(a.declarations,(function(e){return {file:e.getSourceFile().fileName,pos:e.pos}}));o.sort((function(t,r){return e.compareStringsCaseSensitive(c[t].file,c[r].file)||c[t].pos-c[r].pos}));for(var l=void 0,u=0,_=e.map(o,(function(e){return a.declarations[e]}));u<_.length;u++){var d=_[u];i(d)&&(l&&l.parent===d.parent&&l.end===d.pos||(n=e.append(n,d)),l=d);}}return n}function u(t,r){var n,i,a;return e.isClassStaticBlockDeclaration(r)?r:e.isFunctionLikeDeclaration(r)?null!==(i=null!==(n=c(t,r))&&void 0!==n?n:l(t,r))&&void 0!==i?i:r:null!==(a=l(t,r))&&void 0!==a?a:r}function _(t,a){for(var o=t.getTypeChecker(),s=!1;;){if(i(a))return u(o,a);var c;if(n(a))return (c=e.findAncestor(a,i))&&u(o,c);if(e.isDeclarationName(a))return i(a.parent)?u(o,a.parent):n(a.parent)?(c=e.findAncestor(a.parent,i))&&u(o,c):e.isVariableDeclaration(a.parent)&&a.parent.initializer&&r(a.parent.initializer)?a.parent.initializer:void 0;if(e.isConstructorDeclaration(a))return i(a.parent)?a.parent:void 0;if(124!==a.kind||!e.isClassStaticBlockDeclaration(a.parent)){if(e.isVariableDeclaration(a)&&a.initializer&&r(a.initializer))return a.initializer;if(!s){var l=o.getSymbolAtLocation(a);if(l&&(2097152&l.flags&&(l=o.getAliasedSymbol(l)),l.valueDeclaration)){s=!0,a=l.valueDeclaration;continue}}return}a=a.parent;}}function d(t,n){var i=n.getSourceFile(),a=function(t,n){if(e.isSourceFile(n))return {text:n.fileName,pos:0,end:0};if((e.isFunctionDeclaration(n)||e.isClassDeclaration(n))&&!e.isNamedDeclaration(n)){var i=n.modifiers&&e.find(n.modifiers,o);if(i)return {text:"default",pos:i.getStart(),end:i.getEnd()}}if(e.isClassStaticBlockDeclaration(n)){var a=n.getSourceFile(),s=e.skipTrivia(a.text,e.moveRangePastModifiers(n).pos),c=s+6,l=(_=(u=t.getTypeChecker()).getSymbolAtLocation(n.parent))?"".concat(u.symbolToString(_,n.parent)," "):"";return {text:"".concat(l,"static {}"),pos:s,end:c}}var u,_,d=r(n)?n.parent.name:e.Debug.checkDefined(e.getNameOfDeclaration(n),"Expected call hierarchy item to have a name"),p=e.isIdentifier(d)?e.idText(d):e.isStringOrNumericLiteralLike(d)?d.text:e.isComputedPropertyName(d)&&e.isStringOrNumericLiteralLike(d.expression)?d.expression.text:void 0;if(void 0===p&&(_=(u=t.getTypeChecker()).getSymbolAtLocation(d))&&(p=u.symbolToString(_,n)),void 0===p){var f=e.createPrinter({removeComments:!0,omitTrailingSemicolon:!0});p=e.usingSingleLineStringWriter((function(e){return f.writeNode(4,n,n.getSourceFile(),e)}));}return {text:p,pos:d.getStart(),end:d.getEnd()}}(t,n),s=function(t){var n,i;if(r(t))return e.isModuleBlock(t.parent.parent.parent.parent)&&e.isIdentifier(t.parent.parent.parent.parent.parent.name)?t.parent.parent.parent.parent.parent.name.getText():void 0;switch(t.kind){case 171:case 172:case 168:return 204===t.parent.kind?null===(n=e.getAssignedName(t.parent))||void 0===n?void 0:n.getText():null===(i=e.getNameOfDeclaration(t.parent))||void 0===i?void 0:i.getText();case 255:case 256:case 260:if(e.isModuleBlock(t.parent)&&e.isIdentifier(t.parent.parent.name))return t.parent.parent.name.getText()}}(n),c=e.getNodeKind(n),l=e.getNodeModifiers(n),u=e.createTextSpanFromBounds(e.skipTrivia(i.text,n.getFullStart(),!1,!0),n.getEnd()),_=e.createTextSpanFromBounds(a.pos,a.end);return {file:i.fileName,kind:c,kindModifiers:l,name:a.text,containerName:s,span:u,selectionSpan:_}}function p(e){return void 0!==e}function f(t){if(1===t.kind){var r=t.node;if(e.isCallOrNewExpressionTarget(r,!0,!0)||e.isTaggedTemplateTag(r,!0,!0)||e.isDecoratorTarget(r,!0,!0)||e.isJsxOpeningLikeElementTagName(r,!0,!0)||e.isRightSideOfPropertyAccess(r)||e.isArgumentExpressionOfElementAccess(r)){var n=r.getSourceFile();return {declaration:e.findAncestor(r,i)||n,range:e.createTextRangeFromNode(r,n)}}}}function g(t){return e.getNodeId(t.declaration)}t.resolveCallHierarchyDeclaration=_,t.createCallHierarchyItem=d,t.getIncomingCalls=function(t,r,n){if(e.isSourceFile(r)||e.isModuleDeclaration(r)||e.isClassStaticBlockDeclaration(r))return [];var i=a(r),o=e.filter(e.FindAllReferences.findReferenceOrRenameEntries(t,n,t.getSourceFiles(),i,0,{use:1},f),p);return o?e.group(o,g,(function(r){return function(t,r){return {from:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)})):[]},t.getOutgoingCalls=function(t,r){return 8388608&r.flags||e.isMethodSignature(r)?[]:e.group(function(t,r){var n=[],a=function(t,r){function n(n){var i=e.isTaggedTemplateExpression(n)?n.tag:e.isJsxOpeningLikeElement(n)?n.tagName:e.isAccessExpression(n)||e.isClassStaticBlockDeclaration(n)?n:n.expression,a=_(t,i);if(a){var o=e.createTextRangeFromNode(i,n.getSourceFile());if(e.isArray(a))for(var s=0,c=a;s<c.length;s++){var l=c[s];r.push({declaration:l,range:o});}else r.push({declaration:a,range:o});}}return function t(r){if(r&&!(8388608&r.flags))if(i(r)){if(e.isClassLike(r))for(var a=0,o=r.members;a<o.length;a++){var s=o[a];s.name&&e.isComputedPropertyName(s.name)&&t(s.name.expression);}}else {switch(r.kind){case 79:case 264:case 265:case 271:case 257:case 258:return;case 169:return void n(r);case 210:case 228:return void t(r.expression);case 253:case 163:return t(r.name),void t(r.initializer);case 207:case 208:return n(r),t(r.expression),void e.forEach(r.arguments,t);case 209:return n(r),t(r.tag),void t(r.template);case 279:case 278:return n(r),t(r.tagName),void t(r.attributes);case 164:return n(r),void t(r.expression);case 205:case 206:n(r),e.forEachChild(r,t);}e.isPartOfTypeNode(r)||e.forEachChild(r,t);}}}(t,n);switch(r.kind){case 303:!function(t,r){e.forEach(t.statements,r);}(r,a);break;case 260:!function(t,r){!e.hasSyntacticModifier(t,2)&&t.body&&e.isModuleBlock(t.body)&&e.forEach(t.body.statements,r);}(r,a);break;case 255:case 212:case 213:case 168:case 171:case 172:!function(t,r,n){var i=c(t,r);i&&(e.forEach(i.parameters,n),n(i.body));}(t.getTypeChecker(),r,a);break;case 256:case 225:!function(t,r){e.forEach(t.decorators,r);var n=e.getClassExtendsHeritageElement(t);n&&r(n.expression);for(var i=0,a=t.members;i<a.length;i++){var o=a[i];e.forEach(o.decorators,r),e.isPropertyDeclaration(o)?r(o.initializer):e.isConstructorDeclaration(o)&&o.body?(e.forEach(o.parameters,r),r(o.body)):e.isClassStaticBlockDeclaration(o)&&r(o);}}(r,a);break;case 169:!function(e,t){t(e.body);}(r,a);break;default:e.Debug.assertNever(r);}return n}(t,r),g,(function(r){return function(t,r){return {to:d(t,r[0].declaration),fromSpans:e.map(r,(function(t){return e.createTextSpanFromRange(t.range)}))}}(t,r)}))};}(e.CallHierarchy||(e.CallHierarchy={}));}(t),function(e){function t(t,n,i,a){var o=i(t);return function(t){var s=a&&a.tryGetSourcePosition({fileName:t,pos:0}),c=function(t){if(i(t)===o)return n;var r=e.tryRemoveDirectoryPrefix(t,o,i);return void 0===r?void 0:n+"/"+r}(s?s.fileName:t);return s?void 0===c?void 0:function(t,n,i,a){var o=e.getRelativePathFromFile(t,n,a);return r(e.getDirectoryPath(i),o)}(s.fileName,c,t,i):c}}function r(t,r){return e.ensurePathIsNonModuleName(function(t,r){return e.normalizePath(e.combinePaths(t,r))}(t,r))}function n(t,r,n,i){if(r){if(r.resolvedModule){var a=s(r.resolvedModule.resolvedFileName);if(a)return a}return e.forEach(r.failedLookupLocations,(function(t){var r=n(t);return r&&e.find(i,(function(e){return e.fileName===r}))?o(t):void 0}))||e.pathIsRelative(t.text)&&e.forEach(r.failedLookupLocations,o)||r.resolvedModule&&{newFileName:r.resolvedModule.resolvedFileName,updated:!1}}function o(t){return e.endsWith(t,"/package.json")?void 0:s(t)}function s(e){var t=n(e);return t&&{newFileName:t,updated:!0}}}function i(t,r){return e.createRange(t.getStart(r)+1,t.end-1)}function a(t,r){if(e.isObjectLiteralExpression(t))for(var n=0,i=t.properties;n<i.length;n++){var a=i[n];e.isPropertyAssignment(a)&&e.isStringLiteral(a.name)&&r(a,a.name.text);}}e.getEditsForFileRename=function(o,s,c,l,u,_,d){var p=e.hostUsesCaseSensitiveFileNames(l),f=e.createGetCanonicalFileName(p),g=t(s,c,f,d),m=t(c,s,f,d);return e.textChanges.ChangeTracker.with({host:l,formatContext:u,preferences:_},(function(t){!function(t,n,o,s,c,l,u){var _=t.getCompilerOptions().configFile;if(_){var d=e.getDirectoryPath(_.fileName),p=e.getTsConfigObjectLiteralExpression(_);p&&a(p,(function(t,r){switch(r){case"files":case"include":case"exclude":if(f(t)||"include"!==r||!e.isArrayLiteralExpression(t.initializer))return;var i=e.mapDefined(t.initializer.elements,(function(t){return e.isStringLiteral(t)?t.text:void 0}));if(0===i.length)return;var o=e.getFileMatcherPatterns(d,[],i,u,l);return void(e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(s)&&!e.getRegexFromPattern(e.Debug.checkDefined(o.includeFilePattern),u).test(c)&&n.insertNodeAfter(_,e.last(t.initializer.elements),e.factory.createStringLiteral(m(c))));case"compilerOptions":return void a(t.initializer,(function(t,r){var n=e.getOptionFromName(r);n&&(n.isFilePath||"list"===n.type&&n.element.isFilePath)?f(t):"paths"===r&&a(t.initializer,(function(t){if(e.isArrayLiteralExpression(t.initializer))for(var r=0,n=t.initializer.elements;r<n.length;r++)g(n[r]);}));}))}}));}function f(t){for(var r=!1,n=0,i=e.isArrayLiteralExpression(t.initializer)?t.initializer.elements:[t.initializer];n<i.length;n++)r=g(i[n])||r;return r}function g(t){if(!e.isStringLiteral(t))return !1;var a=r(d,t.text),s=o(a);return void 0!==s&&(n.replaceRangeWithText(_,i(t,_),m(s)),!0)}function m(t){return e.getRelativePathFromDirectory(d,t,!u)}}(o,t,g,s,c,l.getCurrentDirectory(),p),function(t,a,o,s,c,l){for(var u=t.getSourceFiles(),_=function(_){var d=o(_.fileName),p=null!=d?d:_.fileName,f=e.getDirectoryPath(p),g=s(_.fileName),m=g||_.fileName,y=e.getDirectoryPath(m),v=void 0!==d||void 0!==g;!function(t,r,n,a){for(var o=0,s=t.referencedFiles||e.emptyArray;o<s.length;o++){var c=s[o];void 0!==(_=n(c.fileName))&&_!==t.text.slice(c.pos,c.end)&&r.replaceRangeWithText(t,c,_);}for(var l=0,u=t.imports;l<u.length;l++){var _,d=u[l];void 0!==(_=a(d))&&_!==d.text&&r.replaceRangeWithText(t,i(d,t),_);}}(_,a,(function(t){if(e.pathIsRelative(t)){var n=r(y,t),i=o(n);return void 0===i?void 0:e.ensurePathIsNonModuleName(e.getRelativePathFromDirectory(f,i,l))}}),(function(r){var i=t.getTypeChecker().getSymbolAtLocation(r);if(!(null==i?void 0:i.declarations)||!i.declarations.some((function(t){return e.isAmbientModule(t)}))){var a=void 0!==g?n(r,e.resolveModuleName(r.text,m,t.getCompilerOptions(),c),o,u):function(t,r,i,a,o,s){if(t){var c=e.find(t.declarations,e.isSourceFile).fileName,l=s(c);return void 0===l?{newFileName:c,updated:!1}:{newFileName:l,updated:!0}}var u=e.getModeForUsageLocation(i,r);return n(r,o.resolveModuleNames?o.getResolvedModuleWithFailedLookupLocationsFromCache&&o.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u):a.getResolvedModuleWithFailedLookupLocationsFromCache(r.text,i.fileName,u),s,a.getSourceFiles())}(i,r,_,t,c,o);return void 0!==a&&(a.updated||v&&e.pathIsRelative(r.text))?e.moduleSpecifiers.updateModuleSpecifier(t.getCompilerOptions(),l(p),a.newFileName,e.createModuleSpecifierResolutionHost(t,c),r.text):void 0}}));},d=0,p=u;d<p.length;d++)_(p[d]);}(o,t,g,m,l,f);}))},e.getPathUpdater=t;}(t),function(e){!function(t){function r(t,r,i){var s,d,f,g=o(r,i,t),m=g&&[(s=g.reference.fileName,d=g.fileName,f=g.unverified,{fileName:d,textSpan:e.createTextSpanFromBounds(0,0),kind:"script",name:s,containerName:void 0,containerKind:void 0,unverified:f})]||e.emptyArray;if(null==g?void 0:g.file)return m;var y=e.getTouchingPropertyName(r,i);if(y!==r){var v=y.parent,h=t.getTypeChecker();if(158===y.kind||e.isJSDocOverrideTag(y)&&e.rangeContainsPosition(y.tagName,i))return function(t,r){var n=e.findAncestor(r,e.isClassElement);if(n&&n.name){var i=e.findAncestor(n,e.isClassLike);if(i){var a=e.getEffectiveBaseTypeNode(i),o=a?t.getTypeAtLocation(a):void 0;if(o){var s=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(n.name)),c=e.hasStaticModifier(n)?t.getPropertyOfType(t.getTypeOfSymbolAtLocation(o.symbol,i),s):t.getPropertyOfType(o,s);if(c)return l(t,c,r)}}}}(h,y)||e.emptyArray;if(e.isJumpStatementTarget(y)){var b=e.getTargetLabel(y.parent,y.text);return b?[_(h,b,"label",y.text,void 0)]:void 0}if(e.isStaticModifier(y)&&e.isClassStaticBlockDeclaration(y.parent)){var x=y.parent.parent,D=c(x,h),S=e.filter(x.members,e.isClassStaticBlockDeclaration),T=D?h.symbolToString(D,x):"",C=y.getSourceFile();return e.map(S,(function(t){var r=e.moveRangePastModifiers(t).pos;return r=e.skipTrivia(C.text,r),_(h,t,"constructor","static {}",T,{start:r,length:"static".length})}))}var E=c(y,h);if(!E)return e.concatenate(m,function(t,r){return e.mapDefined(r.getIndexInfosAtLocation(t),(function(e){return e.declaration&&p(r,e.declaration)}))}(y,h));var k=function(t,r){var n=function(t){var r=e.findAncestor(t,(function(t){return !e.isRightSideOfPropertyAccess(t)})),n=null==r?void 0:r.parent;return n&&e.isCallLikeExpression(n)&&e.getInvokedExpression(n)===r?n:void 0}(r),i=n&&t.getResolvedSignature(n);return e.tryCast(i&&i.declaration,(function(t){return e.isFunctionLike(t)&&!e.isFunctionTypeNode(t)}))}(h,y);if(k&&(!e.isJsxOpeningLikeElement(y.parent)||!function(e){switch(e.kind){case 170:case 179:case 174:return !0;default:return !1}}(k))){var N=p(h,k);if(h.getRootSymbols(E).some((function(t){return function(t,r){return t===r.symbol||t===r.symbol.parent||e.isAssignmentExpression(r.parent)||!e.isCallLikeExpression(r.parent)&&t===r.parent.symbol}(t,k)})))return [N];var F=l(h,E,y,k)||e.emptyArray;return 106===y.kind?n$3([N],F,!0):n$3(n$3([],F,!0),[N],!1)}if(295===y.parent.kind){var A=h.getShorthandAssignmentValueSymbol(E.valueDeclaration),P=(null==A?void 0:A.declarations)?A.declarations.map((function(e){return u(e,h,A,y)})):e.emptyArray;return e.concatenate(P,a(h,y)||e.emptyArray)}if(e.isPropertyName(y)&&e.isBindingElement(v)&&e.isObjectBindingPattern(v.parent)&&y===(v.propertyName||v.name)){var w=e.getNameFromPropertyName(y),I=h.getTypeAtLocation(v.parent);return void 0===w?e.emptyArray:e.flatMap(I.isUnion()?I.types:[I],(function(e){var t=e.getProperty(w);return t&&l(h,t,y)}))}return e.concatenate(m,a(h,y)||l(h,E,y))}}function a(t,r){var n=e.getContainingObjectLiteralElement(r);if(n){var i=n&&t.getContextualType(n.parent);if(i)return e.flatMap(e.getPropertySymbolsFromContextualType(n,t,i,!1),(function(e){return l(t,e,r)}))}}function o(t,r,n){var i,a,o=f(t.referencedFiles,r);if(o)return (l=n.getSourceFileFromReference(t,o))&&{reference:o,fileName:l.fileName,file:l,unverified:!1};var s=f(t.typeReferenceDirectives,r);if(s){var c=n.getResolvedTypeReferenceDirectives().get(s.fileName);return (l=c&&n.getSourceFile(c.resolvedFileName))&&{reference:s,fileName:l.fileName,file:l,unverified:!1}}var l,u=f(t.libReferenceDirectives,r);if(u)return (l=n.getLibFileFromReference(u))&&{reference:u,fileName:l.fileName,file:l,unverified:!1};if(null===(i=t.resolvedModules)||void 0===i?void 0:i.size()){var _=e.getTokenAtPosition(t,r);if(e.isModuleSpecifierLike(_)&&e.isExternalModuleNameRelative(_.text)&&t.resolvedModules.has(_.text,e.getModeForUsageLocation(t,_))){var d=null===(a=t.resolvedModules.get(_.text,e.getModeForUsageLocation(t,_)))||void 0===a?void 0:a.resolvedFileName,p=d||e.resolvePath(e.getDirectoryPath(t.fileName),_.text);return {file:n.getSourceFile(p),fileName:p,reference:{pos:_.getStart(),end:_.getEnd(),fileName:_.text},unverified:!d}}}}function s(t,r,n){return e.flatMap(!t.isUnion()||32&t.flags?[t]:t.types,(function(e){return e.symbol&&l(r,e.symbol,n)}))}function c(t,r){var n=r.getSymbolAtLocation(t);if((null==n?void 0:n.declarations)&&2097152&n.flags&&function(t,r){if(79!==t.kind)return !1;if(t.parent===r)return !0;switch(r.kind){case 266:case 264:return !0;case 269:return 268===r.parent.kind;case 202:case 253:return e.isInJSFile(r)&&e.isRequireVariableDeclaration(r);default:return !1}}(t,n.declarations[0])){var i=r.getAliasedSymbol(n);if(i.declarations)return i}return n}function l(t,r,n,i){var a=e.filter(r.declarations,(function(t){return t!==i&&(!e.isAssignmentDeclaration(t)||t===r.valueDeclaration)}))||void 0;return function(){if(32&r.flags&&!(19&r.flags)&&(e.isNewExpressionTarget(n)||134===n.kind))return o((e.find(a,e.isClassLike)||e.Debug.fail("Expected declaration to have at least one class-like declaration")).members,!0)}()||(e.isCallOrNewExpressionTarget(n)||e.isNameOfFunctionDeclaration(n)?o(a,!1):void 0)||e.map(a,(function(e){return u(e,t,r,n)}));function o(i,a){if(i){var o=i.filter(a?e.isConstructorDeclaration:e.isFunctionLike),s=o.filter((function(e){return !!e.body}));return o.length?0!==s.length?s.map((function(e){return u(e,t,r,n)})):[u(e.last(o),t,r,n)]:void 0}}}function u(t,r,n,i){var a=r.symbolToString(n),o=e.SymbolDisplay.getSymbolKind(r,n,i),s=n.parent?r.symbolToString(n.parent,i):"";return _(r,t,o,a,s)}function _(t,r,n,a,o,s){var c=r.getSourceFile();if(!s){var l=e.getNameOfDeclaration(r)||r;s=e.createTextSpanFromNode(l,c);}return i$1(i$1({fileName:c.fileName,textSpan:s,kind:n,name:a,containerKind:void 0,containerName:o},e.FindAllReferences.toContextSpan(s,c,e.FindAllReferences.getContextNode(r))),{isLocal:!d(t,r)})}function d(t,r){if(t.isDeclarationVisible(r))return !0;if(!r.parent)return !1;if(e.hasInitializer(r.parent)&&r.parent.initializer===r)return d(t,r.parent);switch(r.kind){case 166:case 171:case 172:case 168:if(e.hasEffectiveModifier(r,8))return !1;case 170:case 294:case 295:case 204:case 225:case 213:case 212:return d(t,r.parent);default:return !1}}function p(e,t){return u(t,e,t.symbol,t)}function f(t,r){return e.find(t,(function(t){return e.textRangeContainsPositionInclusive(t,r)}))}t.getDefinitionAtPosition=r,t.getReferenceAtPosition=o,t.getTypeDefinitionAtPosition=function(t,r,n){var i=e.getTouchingPropertyName(r,n);if(i!==r){var a=t.getSymbolAtLocation(i);if(a){var o=t.getTypeOfSymbolAtLocation(a,i),c=function(t,r,n){if(r.symbol===t||t.valueDeclaration&&r.symbol&&e.isVariableDeclaration(t.valueDeclaration)&&t.valueDeclaration.initializer===r.symbol.valueDeclaration){var i=r.getCallSignatures();if(1===i.length)return n.getReturnTypeOfSignature(e.first(i))}}(a,o,t),l=c&&s(c,t,i);return l&&0!==l.length?l:s(o,t,i)}}},t.getDefinitionAndBoundSpan=function(t,n,i){var a=r(t,n,i);if(a&&0!==a.length){var o=f(n.referencedFiles,i)||f(n.typeReferenceDirectives,i)||f(n.libReferenceDirectives,i);if(o)return {definitions:a,textSpan:e.createTextSpanFromRange(o)};var s=e.getTouchingPropertyName(n,i);return {definitions:a,textSpan:e.createTextSpan(s.getStart(),s.getWidth())}}},t.findReferenceInPosition=f;}(e.GoToDefinition||(e.GoToDefinition={}));}(t),function(e){!function(t){var r,i,a=["abstract","access","alias","argument","async","augments","author","borrows","callback","class","classdesc","constant","constructor","constructs","copyright","default","deprecated","description","emits","enum","event","example","exports","extends","external","field","file","fileoverview","fires","function","generator","global","hideconstructor","host","ignore","implements","inheritdoc","inner","instance","interface","kind","lends","license","link","listens","member","memberof","method","mixes","module","name","namespace","override","package","param","private","property","protected","public","readonly","requires","returns","see","since","static","summary","template","this","throws","todo","tutorial","type","typedef","var","variation","version","virtual","yields"];function o(t,r){return e.arraysEqual(t,r,(function(e,t){return e.kind===t.kind&&e.text===t.text}))}function s(t,r){return "string"==typeof t?[e.textPart(t)]:e.flatMap(t,(function(t){return 319===t.kind?[e.textPart(t.text)]:e.buildLinkParts(t,r)}))}function c(t,r){var i=t.comment,a=t.kind,o=function(t){switch(t){case 338:return e.parameterNamePart;case 345:return e.propertyNamePart;case 342:return e.typeParameterNamePart;case 343:case 336:return e.typeAliasNamePart;default:return e.textPart}}(a);switch(a){case 327:case 326:return l(t.class);case 342:return u(t.typeParameters.map((function(e){return e.getText()})).join(", "));case 341:return l(t.typeExpression);case 343:case 336:case 345:case 338:case 344:var c=t.name;return c?l(c):void 0===i?void 0:s(i,r);default:return void 0===i?void 0:s(i,r)}function l(e){return u(e.getText())}function u(t){return i?t.match(/^https?$/)?n$3([e.textPart(t)],s(i,r),!0):n$3([o(t),e.spacePart()],s(i,r),!0):[e.textPart(t)]}}function l(t){return {name:t,kind:"",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}}function u(t,r){switch(t.kind){case 255:case 212:case 168:case 170:case 167:case 213:var n=t;return {commentOwner:t,parameters:n.parameters,hasReturn:_(n,r)};case 294:return u(t.initializer,r);case 256:case 257:case 165:case 259:case 297:case 258:return {commentOwner:t};case 236:var i=t.declarationList.declarations,a=1===i.length&&i[0].initializer?function(t){for(;211===t.kind;)t=t.expression;switch(t.kind){case 212:case 213:return t;case 225:return e.find(t.members,e.isConstructorDeclaration)}}(i[0].initializer):void 0;return a?{commentOwner:t,parameters:a.parameters,hasReturn:_(a,r)}:{commentOwner:t};case 303:return "quit";case 260:return 260===t.parent.kind?void 0:{commentOwner:t};case 237:return u(t.expression,r);case 220:var o=t;return 0===e.getAssignmentDeclarationKind(o)?"quit":e.isFunctionLike(o.right)?{commentOwner:t,parameters:o.right.parameters,hasReturn:_(o.right,r)}:{commentOwner:t};case 166:var s=t.initializer;if(s&&(e.isFunctionExpression(s)||e.isArrowFunction(s)))return {commentOwner:t,parameters:s.parameters,hasReturn:_(s,r)}}}function _(t,r){return !!(null==r?void 0:r.generateReturnInDocTemplate)&&(e.isArrowFunction(t)&&e.isExpression(t.body)||e.isFunctionLikeDeclaration(t)&&t.body&&e.isBlock(t.body)&&!!e.forEachReturnStatement(t.body,(function(e){return e})))}t.getJsDocCommentsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){for(var i=0,a=function(t){switch(t.kind){case 338:case 345:return [t];case 336:case 343:return [t,t.parent];default:return e.getJSDocCommentsAndTags(t)}}(t);i<a.length;i++){var c=a[i];if(!(void 0===c.comment||e.isJSDoc(c)&&343!==t.kind&&336!==t.kind&&c.tags&&c.tags.some((function(e){return 343===e.kind||336===e.kind}))&&!c.tags.some((function(e){return 338===e.kind||339===e.kind})))){var l=s(c.comment,r);e.contains(n,l,o)||n.push(l);}}})),e.flatten(e.intersperse(n,[e.lineBreakPart()]))},t.getJsDocTagsFromDeclarations=function(t,r){var n=[];return e.forEachUnique(t,(function(t){var i=e.getJSDocTags(t);if(!i.some((function(e){return 343===e.kind||336===e.kind}))||i.some((function(e){return 338===e.kind||339===e.kind})))for(var a=0,o=i;a<o.length;a++){var s=o[a];n.push({name:s.tagName.text,text:c(s,r)});}})),n},t.getJSDocTagNameCompletions=function(){return r||(r=e.map(a,(function(t){return {name:t,kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagNameCompletionDetails=l,t.getJSDocTagCompletions=function(){return i||(i=e.map(a,(function(t){return {name:"@".concat(t),kind:"keyword",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}})))},t.getJSDocTagCompletionDetails=l,t.getJSDocParameterNameCompletions=function(t){if(!e.isIdentifier(t.name))return e.emptyArray;var r=t.name.text,n=t.parent,i=n.parent;return e.isFunctionLike(i)?e.mapDefined(i.parameters,(function(i){if(e.isIdentifier(i.name)){var a=i.name.text;if(!n.tags.some((function(r){return r!==t&&e.isJSDocParameterTag(r)&&e.isIdentifier(r.name)&&r.name.escapedText===a}))&&(void 0===r||e.startsWith(a,r)))return {name:a,kind:"parameter",kindModifiers:"",sortText:e.Completions.SortText.LocationPriority}}})):[]},t.getJSDocParameterNameCompletionDetails=function(t){return {name:t,kind:"parameter",kindModifiers:"",displayParts:[e.textPart(t)],documentation:e.emptyArray,tags:void 0,codeActions:void 0}},t.getDocCommentTemplateAtPosition=function(t,r,n,i){var a=e.getTokenAtPosition(r,n),o=e.findAncestor(a,e.isJSDoc);if(!o||void 0===o.comment&&!e.length(o.tags)){var s=a.getStart(r);if(o||!(s<n)){var c=function(t,r){return e.forEachAncestor(t,(function(e){return u(e,r)}))}(a,i);if(c){var l=c.commentOwner,_=c.parameters,d=c.hasReturn;if(!(l.getStart(r)<n)){var p=function(t,r){for(var n=t.text,i=e.getLineStartPositionForPosition(r,t),a=i;a<=r&&e.isWhiteSpaceSingleLine(n.charCodeAt(a));a++);return n.slice(i,a)}(r,n),f=e.hasJSFileExtension(r.fileName),g=(_?function(e,t,r,n){return e.map((function(e,i){var a=e.name,o=e.dotDotDotToken,s=79===a.kind?a.text:"param"+i,c=t?o?"{...any} ":"{any} ":"";return "".concat(r," * @param ").concat(c).concat(s).concat(n)})).join("")}(_||[],f,p,t):"")+(d?function(e,t){return "".concat(e," * @returns").concat(t)}(p,t):"");if(g){var m="/**"+t+p+" * ";return {newText:m+t+g+p+" */"+(s===n?t+p:""),caretOffset:m.length}}return {newText:"/** */",caretOffset:3}}}}}};}(e.JsDoc||(e.JsDoc={}));}(t),function(e){!function(t){function r(e,t){switch(e.kind){case 266:case 269:case 264:var r=t.getSymbolAtLocation(e.name),n=t.getAliasedSymbol(r);return r.escapedName!==n.escapedName;default:return !0}}function n(t,r){var n=e.getNameOfDeclaration(t);return !!n&&(a(n,r)||161===n.kind&&i(n.expression,r))}function i(t,r){return a(t,r)||e.isPropertyAccessExpression(t)&&(r.push(t.name.text),!0)&&i(t.expression,r)}function a(t,r){return e.isPropertyNameLiteral(t)&&(r.push(e.getTextOfIdentifierOrLiteral(t)),!0)}function o(t){var r=[],a=e.getNameOfDeclaration(t);if(a&&161===a.kind&&!i(a.expression,r))return e.emptyArray;r.shift();for(var o=e.getContainerNode(t);o;){if(!n(o,r))return e.emptyArray;o=e.getContainerNode(o);}return r.reverse()}function s(t,r){return e.compareValues(t.matchKind,r.matchKind)||e.compareStringsCaseSensitiveUI(t.name,r.name)}function c(t){var r=t.declaration,n=e.getContainerNode(r),i=n&&e.getNameOfDeclaration(n);return {name:t.name,kind:e.getNodeKind(r),kindModifiers:e.getNodeModifiers(r),matchKind:e.PatternMatchKind[t.matchKind],isCaseSensitive:t.isCaseSensitive,fileName:t.fileName,textSpan:e.createTextSpanFromNode(r),containerName:i?i.text:"",containerKind:i?e.getNodeKind(n):""}}t.getNavigateToItems=function(t,n,i,a,l,u){var _=e.createPatternMatcher(a);if(!_)return e.emptyArray;for(var d=[],p=function(e){if(i.throwIfCancellationRequested(),u&&e.isDeclarationFile)return "continue";e.getNamedDeclarations().forEach((function(t,i){!function(e,t,n,i,a,s){var c=e.getMatchForLastSegmentOfPattern(t);if(c)for(var l=0,u=n;l<u.length;l++){var _=u[l];if(r(_,i))if(e.patternContainsDots){var d=e.getFullMatch(o(_),t);d&&s.push({name:t,fileName:a,matchKind:d.kind,isCaseSensitive:d.isCaseSensitive,declaration:_});}else s.push({name:t,fileName:a,matchKind:c.kind,isCaseSensitive:c.isCaseSensitive,declaration:_});}}(_,i,t,n,e.fileName,d);}));},f=0,g=t;f<g.length;f++)p(g[f]);return d.sort(s),(void 0===l?d:d.slice(0,l)).map(c)};}(e.NavigateTo||(e.NavigateTo={}));}(t),function(e){!function(t){var r,n,a,o,s,c=/\s+/g,l=[],u=[],_=[];function d(){a=void 0,n=void 0,l=[],o=void 0,_=[];}function p(e){return Q(e.getText(a))}function f(e){return e.node.kind}function g(e,t){e.children?e.children.push(t):e.children=[t];}function m(t){e.Debug.assert(!l.length);var r={node:t,name:void 0,additionalNodes:void 0,parent:void 0,children:void 0,indent:0};o=r;for(var n=0,i=t.statements;n<i.length;n++)k(i[n]);return S(),e.Debug.assert(!o&&!l.length),r}function y(e,t){g(o,v(e,t));}function v(t,r){return {node:t,name:r||(e.isDeclaration(t)||e.isExpression(t)?e.getNameOfDeclaration(t):void 0),additionalNodes:void 0,parent:o,children:void 0,indent:o.indent+1}}function h(t){s||(s=new e.Map),s.set(t,!0);}function b(e){for(var t=0;t<e;t++)S();}function x(t,r){for(var n=[];!e.isPropertyNameLiteral(r);){var i=e.getNameOrArgument(r),a=e.getElementOrPropertyAccessName(r);r=r.expression,"prototype"===a||e.isPrivateIdentifier(i)||n.push(i);}n.push(r);for(var o=n.length-1;o>0;o--)D(t,i=n[o]);return [n.length-1,n[0]]}function D(e,t){var r=v(e,t);g(o,r),l.push(o),u.push(s),s=void 0,o=r;}function S(){o.children&&(N(o.children,o),O(o.children)),o=l.pop(),s=u.pop();}function T(e,t,r){D(e,r),k(t),S();}function C(t){t.initializer&&function(e){switch(e.kind){case 213:case 212:case 225:return !0;default:return !1}}(t.initializer)?(D(t),e.forEachChild(t.initializer,k),S()):T(t,t.initializer);}function E(t){return !e.hasDynamicName(t)||220!==t.kind&&e.isPropertyAccessExpression(t.name.expression)&&e.isIdentifier(t.name.expression.expression)&&"Symbol"===e.idText(t.name.expression.expression)}function k(t){var r;if(n.throwIfCancellationRequested(),t&&!e.isToken(t))switch(t.kind){case 170:var i=t;T(i,i.body);for(var a=0,o=i.parameters;a<o.length;a++){var c=o[a];e.isParameterPropertyDeclaration(c,i)&&y(c);}break;case 168:case 171:case 172:case 167:E(t)&&T(t,t.body);break;case 166:E(t)&&C(t);break;case 165:E(t)&&y(t);break;case 266:var l=t;l.name&&y(l.name);var u=l.namedBindings;if(u)if(267===u.kind)y(u);else for(var _=0,d=u.elements;_<d.length;_++)y(d[_]);break;case 295:T(t,t.name);break;case 296:var p=t.expression;e.isIdentifier(p)?y(t,p):y(t);break;case 202:case 294:case 253:var f=t;e.isBindingPattern(f.name)?k(f.name):C(f);break;case 255:var g=t.name;g&&e.isIdentifier(g)&&h(g.text),T(t,t.body);break;case 213:case 212:T(t,t.body);break;case 259:D(t);for(var m=0,v=t.members;m<v.length;m++)V(A=v[m])||y(A);S();break;case 256:case 225:case 257:D(t);for(var N=0,F=t.members;N<F.length;N++){var A;k(A=F[N]);}S();break;case 260:T(t,K(t).body);break;case 270:var P=t.expression;(f=e.isObjectLiteralExpression(P)||e.isCallExpression(P)?P:e.isArrowFunction(P)||e.isFunctionExpression(P)?P.body:void 0)?(D(t),k(f),S()):y(t);break;case 274:case 264:case 175:case 173:case 174:case 258:y(t);break;case 207:case 220:var w=e.getAssignmentDeclarationKind(t);switch(w){case 1:case 2:return void T(t,t.right);case 6:case 3:var I=(J=t).left,O=3===w?I.expression:I,M=0,L=void 0;return e.isIdentifier(O.expression)?(h(O.expression.text),L=O.expression):(M=(r=x(J,O.expression))[0],L=r[1]),6===w?e.isObjectLiteralExpression(J.right)&&J.right.properties.length>0&&(D(J,L),e.forEachChild(J.right,k),S()):e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,L):(D(J,L),T(t,J.right,I.name),S()),void b(M);case 7:case 9:var R=t,B=(L=7===w?R.arguments[0]:R.arguments[0].expression,R.arguments[1]),j=x(t,L);return M=j[0],D(t,j[1]),D(t,e.setTextRange(e.factory.createIdentifier(B.text),B)),k(t.arguments[2]),S(),S(),void b(M);case 5:var J,z=(I=(J=t).left).expression;if(e.isIdentifier(z)&&"prototype"!==e.getElementOrPropertyAccessName(I)&&s&&s.has(z.text))return void(e.isFunctionExpression(J.right)||e.isArrowFunction(J.right)?T(t,J.right,z):e.isBindableStaticAccessExpression(I)&&(D(J,z),T(J.left,J.right,e.getNameOrArgument(I)),S()));break;case 4:case 0:case 8:break;default:e.Debug.assertNever(w);}default:e.hasJSDocNodes(t)&&e.forEach(t.jsDoc,(function(t){e.forEach(t.tags,(function(t){e.isJSDocTypeAlias(t)&&y(t);}));})),e.forEachChild(t,k);}}function N(t,r){var n=new e.Map;e.filterMutate(t,(function(t,i){var a=t.name||e.getNameOfDeclaration(t.node),o=a&&p(a);if(!o)return !0;var s=n.get(o);if(!s)return n.set(o,t),!0;if(s instanceof Array){for(var c=0,l=s;c<l.length;c++){var u;if(A(u=l[c],t,i,r))return !1}return s.push(t),!0}return !A(u=s,t,i,r)&&(n.set(o,[u,t]),!0)}));}t.getNavigationBarItems=function(t,r){n=r,a=t;try{return e.map((i=m(t),o=[],function e(t){if(function(e){if(e.children)return !0;switch(f(e)){case 256:case 225:case 259:case 257:case 260:case 303:case 258:case 343:case 336:return !0;case 213:case 255:case 212:return t(e);default:return !1}function t(e){if(!e.node.body)return !1;switch(f(e.parent)){case 261:case 303:case 168:case 170:return !0;default:return !1}}}(t)&&(o.push(t),t.children))for(var r=0,n=t.children;r<n.length;r++)e(n[r]);}(i),o),j)}finally{d();}var i,o;},t.getNavigationTree=function(e,t){n=t,a=e;try{return B(m(e))}finally{d();}};var F=((r={})[5]=!0,r[3]=!0,r[7]=!0,r[9]=!0,r[0]=!1,r[1]=!1,r[2]=!1,r[8]=!1,r[6]=!0,r[4]=!1,r);function A(t,r,n,a){return !!function(t,r,n,a){function o(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isVariableDeclaration(t)}var s=e.isBinaryExpression(r.node)||e.isCallExpression(r.node)?e.getAssignmentDeclarationKind(r.node):0,c=e.isBinaryExpression(t.node)||e.isCallExpression(t.node)?e.getAssignmentDeclarationKind(t.node):0;if(F[s]&&F[c]||o(t.node)&&F[s]||o(r.node)&&F[c]||e.isClassDeclaration(t.node)&&P(t.node)&&F[s]||e.isClassDeclaration(r.node)&&F[c]||e.isClassDeclaration(t.node)&&P(t.node)&&o(r.node)||e.isClassDeclaration(r.node)&&o(t.node)&&P(t.node)){var l=t.additionalNodes&&e.lastOrUndefined(t.additionalNodes)||t.node;if(!e.isClassDeclaration(t.node)&&!e.isClassDeclaration(r.node)||o(t.node)||o(r.node)){var u=o(t.node)?t.node:o(r.node)?r.node:void 0;if(void 0!==u){var _=v(e.setTextRange(e.factory.createConstructorDeclaration(void 0,void 0,[],void 0),u));_.indent=t.indent+1,_.children=t.node===u?t.children:r.children,t.children=t.node===u?e.concatenate([_],r.children||[r]):e.concatenate(t.children||[i$1({},t)],[_]);}else (t.children||r.children)&&(t.children=e.concatenate(t.children||[i$1({},t)],r.children||[r]),t.children&&(N(t.children,t),O(t.children)));l=t.node=e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),t.node);}else t.children=e.concatenate(t.children,r.children),t.children&&N(t.children,t);var d=r.node;return a.children[n-1].node.end===l.end?e.setTextRange(l,{pos:l.pos,end:d.end}):(t.additionalNodes||(t.additionalNodes=[]),t.additionalNodes.push(e.setTextRange(e.factory.createClassDeclaration(void 0,void 0,t.name||e.factory.createIdentifier("__class__"),void 0,void 0,[]),r.node))),!0}return 0!==s}(t,r,n,a)||!!function(t,r,n){if(t.kind!==r.kind||t.parent!==r.parent&&(!w(t,n)||!w(r,n)))return !1;switch(t.kind){case 166:case 168:case 171:case 172:return e.isStatic(t)===e.isStatic(r);case 260:return I(t,r)&&U(t)===U(r);default:return !0}}(t.node,r.node,a)&&(function(t,r){var n;t.additionalNodes=t.additionalNodes||[],t.additionalNodes.push(r.node),r.additionalNodes&&(n=t.additionalNodes).push.apply(n,r.additionalNodes),t.children=e.concatenate(t.children,r.children),t.children&&(N(t.children,t),O(t.children));}(t,r),!0)}function P(e){return !!(8&e.flags)}function w(t,r){var n=e.isModuleBlock(t.parent)?t.parent.parent:t.parent;return n===r.node||e.contains(r.additionalNodes,n)}function I(e,t){return e.body.kind===t.body.kind&&(260!==e.body.kind||I(e.body,t.body))}function O(e){e.sort(M);}function M(t,r){return e.compareStringsCaseSensitiveUI(L(t.node),L(r.node))||e.compareValues(f(t),f(r))}function L(t){if(260===t.kind)return z(t);var r=e.getNameOfDeclaration(t);if(r&&e.isPropertyName(r)){var n=e.getPropertyNameForPropertyNameNode(r);return n&&e.unescapeLeadingUnderscores(n)}switch(t.kind){case 212:case 213:case 225:return H(t);default:return}}function R(t,r){if(260===t.kind)return Q(z(t));if(r){var n=e.isIdentifier(r)?r.text:e.isElementAccessExpression(r)?"[".concat(p(r.argumentExpression),"]"):p(r);if(n.length>0)return Q(n)}switch(t.kind){case 303:var i=t;return e.isExternalModule(i)?'"'.concat(e.escapeString(e.getBaseFileName(e.removeFileExtension(e.normalizePath(i.fileName)))),'"'):"<global>";case 270:return e.isExportAssignment(t)&&t.isExportEquals?"export=":"default";case 213:case 255:case 212:case 256:case 225:return 512&e.getSyntacticModifierFlags(t)?"default":H(t);case 170:return "constructor";case 174:return "new()";case 173:return "()";case 175:return "[]";default:return "<unknown>"}}function B(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),nameSpan:t.name&&q(t.name),childItems:e.map(t.children,B)}}function j(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:W(t.node),spans:J(t),childItems:e.map(t.children,(function(t){return {text:R(t.node,t.name),kind:e.getNodeKind(t.node),kindModifiers:e.getNodeModifiers(t.node),spans:J(t),childItems:_,indent:0,bolded:!1,grayed:!1}}))||_,indent:t.indent,bolded:!1,grayed:!1}}function J(e){var t=[q(e.node)];if(e.additionalNodes)for(var r=0,n=e.additionalNodes;r<n.length;r++){var i=n[r];t.push(q(i));}return t}function z(t){return e.isAmbientModule(t)?e.getTextOfNode(t.name):U(t)}function U(t){for(var r=[e.getTextOfIdentifierOrLiteral(t.name)];t.body&&260===t.body.kind;)t=t.body,r.push(e.getTextOfIdentifierOrLiteral(t.name));return r.join(".")}function K(t){return t.body&&e.isModuleDeclaration(t.body)?K(t.body):t}function V(e){return !e.name||161===e.name.kind}function q(t){return 303===t.kind?e.createTextSpanFromRange(t):e.createTextSpanFromNode(t,a)}function W(t){return t.parent&&253===t.parent.kind&&(t=t.parent),e.getNodeModifiers(t)}function H(t){var r=t.parent;if(t.name&&e.getFullWidth(t.name)>0)return Q(e.declarationNameToString(t.name));if(e.isVariableDeclaration(r))return Q(e.declarationNameToString(r.name));if(e.isBinaryExpression(r)&&63===r.operatorToken.kind)return p(r.left).replace(c,"");if(e.isPropertyAssignment(r))return p(r.name);if(512&e.getSyntacticModifierFlags(t))return "default";if(e.isClassLike(t))return "<class>";if(e.isCallExpression(r)){var n=G(r.expression);if(void 0!==n){if((n=Q(n)).length>150)return "".concat(n," callback");var i=Q(e.mapDefined(r.arguments,(function(t){return e.isStringLiteralLike(t)?t.getText(a):void 0})).join(", "));return "".concat(n,"(").concat(i,") callback")}}return "<function>"}function G(t){if(e.isIdentifier(t))return t.text;if(e.isPropertyAccessExpression(t)){var r=G(t.expression),n=t.name.text;return void 0===r?n:"".concat(r,".").concat(n)}}function Q(e){return (e=e.length>150?e.substring(0,150)+"...":e).replace(/\\?(\r?\n|\r|\u2028|\u2029)/g,"")}}(e.NavigationBar||(e.NavigationBar={}));}(t),function(e){!function(t){function r(t,r){var n=e.isStringLiteral(r)&&r.text;return e.isString(n)&&e.some(t.moduleAugmentations,(function(t){return e.isStringLiteral(t)&&t.text===n}))}function n(t){return void 0!==t&&e.isStringLiteralLike(t)?t.text:void 0}function i(t){var r;if(0===t.length)return t;var n=function(t){for(var r,n={defaultImports:[],namespaceImports:[],namedImports:[]},i={defaultImports:[],namespaceImports:[],namedImports:[]},a=0,o=t;a<o.length;a++){var s=o[a];if(void 0!==s.importClause){var c=s.importClause.isTypeOnly?n:i,l=s.importClause,u=l.name,_=l.namedBindings;u&&c.defaultImports.push(s),_&&(e.isNamespaceImport(_)?c.namespaceImports.push(s):c.namedImports.push(s));}else r=r||s;}return {importWithoutClause:r,typeOnlyImports:n,regularImports:i}}(t),i=n.importWithoutClause,a=n.typeOnlyImports,c=n.regularImports,l=[];i&&l.push(i);for(var _=0,d=[c,a];_<d.length;_++){var p=d[_],f=p===a,g=p.defaultImports,m=p.namespaceImports,y=p.namedImports;if(f||1!==g.length||1!==m.length||0!==y.length){for(var v=0,h=e.stableSort(m,(function(e,t){return u(e.importClause.namedBindings.name,t.importClause.namedBindings.name)}));v<h.length;v++){var b=h[v];l.push(o(b,void 0,b.importClause.namedBindings));}if(0!==g.length||0!==y.length){var x=void 0,D=[];if(1===g.length)x=g[0].importClause.name;else for(var S=0,T=g;S<T.length;S++)N=T[S],D.push(e.factory.createImportSpecifier(!1,e.factory.createIdentifier("default"),N.importClause.name));D.push.apply(D,e.flatMap(y,(function(e){return e.importClause.namedBindings.elements})));var C=s(D),E=g.length>0?g[0]:y[0],k=0===C.length?x?void 0:e.factory.createNamedImports(e.emptyArray):0===y.length?e.factory.createNamedImports(C):e.factory.updateNamedImports(y[0].importClause.namedBindings,C);f&&x&&k?(l.push(o(E,x,void 0)),l.push(o(null!==(r=y[0])&&void 0!==r?r:E,void 0,k))):l.push(o(E,x,k));}}else {var N=g[0];l.push(o(N,N.importClause.name,m[0].importClause.namedBindings));}}return l}function a(t){if(0===t.length)return t;var r=function(e){for(var t,r=[],n=[],i=0,a=e;i<a.length;i++){var o=a[i];void 0===o.exportClause?t=t||o:o.isTypeOnly?n.push(o):r.push(o);}return {exportWithoutClause:t,namedExports:r,typeOnlyExports:n}}(t),n=r.exportWithoutClause,i=r.namedExports,a=r.typeOnlyExports,o=[];n&&o.push(n);for(var c=0,l=[i,a];c<l.length;c++){var u=l[c];if(0!==u.length){var _=[];_.push.apply(_,e.flatMap(u,(function(t){return t.exportClause&&e.isNamedExports(t.exportClause)?t.exportClause.elements:e.emptyArray})));var d=s(_),p=u[0];o.push(e.factory.updateExportDeclaration(p,p.decorators,p.modifiers,p.isTypeOnly,p.exportClause&&(e.isNamedExports(p.exportClause)?e.factory.updateNamedExports(p.exportClause,d):e.factory.updateNamespaceExport(p.exportClause,p.exportClause.name)),p.moduleSpecifier,p.assertClause));}}return o}function o(t,r,n){return e.factory.updateImportDeclaration(t,t.decorators,t.modifiers,e.factory.updateImportClause(t.importClause,t.importClause.isTypeOnly,r,n),t.moduleSpecifier,t.assertClause)}function s(t){return e.stableSort(t,c)}function c(t,r){return e.compareBooleans(t.isTypeOnly,r.isTypeOnly)||u(t.propertyName||t.name,r.propertyName||r.name)||u(t.name,r.name)}function l(t,r){var i=void 0===t?void 0:n(t),a=void 0===r?void 0:n(r);return e.compareBooleans(void 0===i,void 0===a)||e.compareBooleans(e.isExternalModuleNameRelative(i),e.isExternalModuleNameRelative(a))||e.compareStringsCaseInsensitive(i,a)}function u(t,r){return e.compareStringsCaseInsensitive(t.text,r.text)}function _(t){var r;switch(t.kind){case 264:return null===(r=e.tryCast(t.moduleReference,e.isExternalModuleReference))||void 0===r?void 0:r.expression;case 265:return t.moduleSpecifier;case 236:return t.declarationList.declarations[0].initializer.arguments[0]}}function d(t,r){return l(_(t),_(r))||function(t,r){return e.compareValues(p(t),p(r))}(t,r)}function p(e){var t;switch(e.kind){case 265:return e.importClause?e.importClause.isTypeOnly?1:267===(null===(t=e.importClause.namedBindings)||void 0===t?void 0:t.kind)?2:e.importClause.name?3:4:0;case 264:return 5;case 236:return 6}}t.organizeImports=function(t,s,c,u,_,p){var f=e.textChanges.ChangeTracker.fromContext({host:c,formatContext:s,preferences:_}),g=function(n){return e.stableSort(i(function(t,n,i,a){if(a)return t;for(var s=i.getTypeChecker(),c=s.getJsxNamespace(n),l=s.getJsxFragmentFactory(n),u=!!(2&n.transformFlags),_=[],d=0,p=t;d<p.length;d++){var f=p[d],g=f.importClause,m=f.moduleSpecifier;if(g){var y=g.name,v=g.namedBindings;if(y&&!b(y)&&(y=void 0),v)if(e.isNamespaceImport(v))b(v.name)||(v=void 0);else {var h=v.elements.filter((function(e){return b(e.name)}));h.length<v.elements.length&&(v=h.length?e.factory.updateNamedImports(v,h):void 0);}y||v?_.push(o(f,y,v)):r(n,m)&&(n.isDeclarationFile?_.push(e.factory.createImportDeclaration(f.decorators,f.modifiers,void 0,m,void 0)):_.push(f));}else _.push(f);}return _;function b(t){return u&&(t.text===c||l&&t.text===l)||e.FindAllReferences.Core.isSymbolReferencedInFile(t,s,n)}}(n,t,u,p)),(function(e,t){return d(e,t)}))};h(t.statements.filter(e.isImportDeclaration),g),h(t.statements.filter(e.isExportDeclaration),a);for(var m=0,y=t.statements.filter(e.isAmbientModule);m<y.length;m++){var v=y[m];v.body&&(h(v.body.statements.filter(e.isImportDeclaration),g),h(v.body.statements.filter(e.isExportDeclaration),a));}return f.getChanges();function h(r,i){if(0!==e.length(r)){e.suppressLeadingTrivia(r[0]);var a=e.group(r,(function(e){return n(e.moduleSpecifier)})),o=e.stableSort(a,(function(e,t){return l(e[0].moduleSpecifier,t[0].moduleSpecifier)})),u=e.flatMap(o,(function(e){return n(e[0].moduleSpecifier)?i(e):e}));if(0===u.length)f.deleteNodes(t,r,{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},!0);else {var _={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include,suffix:e.getNewLineOrDefaultFromHost(c,s.options)};f.replaceNodeWithNodes(t,r[0],u,_);var d=f.nodeHasTrailingComment(t,r[0],_);f.deleteNodes(t,r.slice(1),{trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include},d);}}}},t.coalesceImports=i,t.coalesceExports=a,t.compareImportOrExportSpecifiers=c,t.compareModuleSpecifiers=l,t.importsAreSorted=function(t){return e.arrayIsSorted(t,d)},t.importSpecifiersAreSorted=function(t){return e.arrayIsSorted(t,c)},t.getImportDeclarationInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,d);return n<0?~n:n},t.getImportSpecifierInsertionIndex=function(t,r){var n=e.binarySearch(t,r,e.identity,c);return n<0?~n:n},t.compareImportsOrRequireStatements=d;}(e.OrganizeImports||(e.OrganizeImports={}));}(t),function(e){!function(t){t.collectElements=function(t,r){var u=[];return function(t,r,i){for(var u=40,_=0,d=n$3(n$3([],t.statements,!0),[t.endOfFileToken],!1),p=d.length;_<p;){for(;_<p&&!e.isAnyImportSyntax(d[_]);)m(d[_]),_++;if(_===p)break;for(var f=_;_<p&&e.isAnyImportSyntax(d[_]);)o(d[_],t,r,i),_++;var g=_-1;g!==f&&i.push(s(e.findChildOfKind(d[f],100,t).getStart(t),d[g].getEnd(),"imports"));}function m(n){var _;if(0!==u){r.throwIfCancellationRequested(),(e.isDeclaration(n)||e.isVariableStatement(n)||e.isReturnStatement(n)||1===n.kind)&&o(n,t,r,i),e.isFunctionLike(n)&&e.isBinaryExpression(n.parent)&&e.isPropertyAccessExpression(n.parent.left)&&o(n.parent.left,t,r,i),(e.isBlock(n)||e.isModuleBlock(n))&&a(n.statements.end,t,r,i),(e.isClassLike(n)||e.isInterfaceDeclaration(n))&&a(n.members.end,t,r,i);var d=function(t,r){switch(t.kind){case 234:if(e.isFunctionLike(t.parent))return function(t,r,n){var i=function(t,r,n){if(e.isNodeArrayMultiLine(t.parameters,n)){var i=e.findChildOfKind(t,20,n);if(i)return i}return e.findChildOfKind(r,18,n)}(t,r,n),a=e.findChildOfKind(r,19,n);return i&&a&&c(i,a,t,n,213!==t.kind)}(t.parent,t,r);switch(t.parent.kind){case 239:case 242:case 243:case 241:case 238:case 240:case 247:case 291:return u(t.parent);case 251:var n=t.parent;if(n.tryBlock===t)return u(t.parent);if(n.finallyBlock===t){var i=e.findChildOfKind(n,96,r);if(i)return u(i)}default:return l(e.createTextSpanFromNode(t,r),"code")}case 261:return u(t.parent);case 256:case 225:case 257:case 259:case 262:case 181:case 200:return u(t);case 183:return u(t,!1,!e.isTupleTypeNode(t.parent),22);case 288:case 289:return (a=t.statements).length?l(e.createTextSpanFromRange(a),"code"):void 0;case 204:return o(t);case 203:return o(t,22);case 277:return function(t){var n=e.createTextSpanFromBounds(t.openingElement.getStart(r),t.closingElement.getEnd()),i=t.openingElement.tagName.getText(r);return l(n,"code",n,!1,"<"+i+">...</"+i+">")}(t);case 281:return function(t){var n=e.createTextSpanFromBounds(t.openingFragment.getStart(r),t.closingFragment.getEnd());return l(n,"code",n,!1,"<>...</>")}(t);case 278:case 279:return function(e){if(0!==e.properties.length)return s(e.getStart(r),e.getEnd(),"code")}(t.attributes);case 222:case 14:return function(e){if(14!==e.kind||0!==e.text.length)return s(e.getStart(r),e.getEnd(),"code")}(t);case 201:return u(t,!1,!e.isBindingElement(t.parent),22);case 213:return function(t){if(!e.isBlock(t.body)&&!e.positionsAreOnSameLine(t.body.getFullStart(),t.body.getEnd(),r))return l(e.createTextSpanFromBounds(t.body.getFullStart(),t.body.getEnd()),"code",e.createTextSpanFromNode(t))}(t);case 207:return function(t){if(t.arguments.length){var n=e.findChildOfKind(t,20,r),i=e.findChildOfKind(t,21,r);if(n&&i&&!e.positionsAreOnSameLine(n.pos,i.pos,r))return c(n,i,t,r,!1,!0)}}(t)}var a;function o(t,r){return void 0===r&&(r=18),u(t,!1,!e.isArrayLiteralExpression(t.parent)&&!e.isCallExpression(t.parent),r)}function u(n,i,a,o,s){void 0===i&&(i=!1),void 0===a&&(a=!0),void 0===o&&(o=18),void 0===s&&(s=18===o?19:23);var l=e.findChildOfKind(t,o,r),u=e.findChildOfKind(t,s,r);return l&&u&&c(l,u,n,r,i,a)}}(n,t);d&&i.push(d),u--,e.isCallExpression(n)?(u++,m(n.expression),u--,n.arguments.forEach(m),null===(_=n.typeArguments)||void 0===_||_.forEach(m)):e.isIfStatement(n)&&n.elseStatement&&e.isIfStatement(n.elseStatement)?(m(n.expression),m(n.thenStatement),u++,m(n.elseStatement),u--):n.forEachChild(m),u++;}}}(t,r,u),function(t,r){for(var n=[],a=0,o=t.getLineStarts();a<o.length;a++){var s=o[a],c=t.getLineEndOfPosition(s),u=i(t.text.substring(s,c));if(u&&!e.isInComment(t,s))if(u[1]){var _=n.pop();_&&(_.textSpan.length=c-_.textSpan.start,_.hintSpan.length=c-_.textSpan.start,r.push(_));}else {var d=e.createTextSpanFromBounds(t.text.indexOf("//",s),c);n.push(l(d,"region",d,!1,u[2]||"#region"));}}}(t,u),u.sort((function(e,t){return e.textSpan.start-t.textSpan.start}))};var r=/^#(end)?region(?:\s+(.*))?(?:\r)?$/;function i(t){return t=e.trimStringStart(t),e.startsWith(t,"//")?(t=e.trimString(t.slice(2)),r.exec(t)):null}function a(t,r,n,a){var o=e.getLeadingCommentRanges(r.text,t);if(o){for(var c=-1,l=-1,u=0,_=r.getFullText(),d=0,p=o;d<p.length;d++){var f=p[d],g=f.kind,m=f.pos,y=f.end;switch(n.throwIfCancellationRequested(),g){case 2:if(i(_.slice(m,y))){v(),u=0;break}0===u&&(c=m),l=y,u++;break;case 3:v(),a.push(s(m,y,"comment")),u=0;break;default:e.Debug.assertNever(g);}}v();}function v(){u>1&&a.push(s(c,l,"comment"));}}function o(t,r,n,i){e.isJsxText(t)||a(t.pos,r,n,i);}function s(t,r,n){return l(e.createTextSpanFromBounds(t,r),n)}function c(t,r,n,i,a,o){return void 0===a&&(a=!1),void 0===o&&(o=!0),l(e.createTextSpanFromBounds(o?t.getFullStart():t.getStart(i),r.getEnd()),"code",e.createTextSpanFromNode(n,i),a)}function l(e,t,r,n,i){return void 0===r&&(r=e),void 0===n&&(n=!1),void 0===i&&(i="..."),{textSpan:e,kind:t,hintSpan:r,bannerText:i,autoCollapse:n}}}(e.OutliningElementsCollector||(e.OutliningElementsCollector={}));}(t),function(e){var t;function r(e,t){return {kind:e,isCaseSensitive:t}}function n(e,t){var r=t.get(e);return r||t.set(e,r=y(e)),r}function i(i,a,o){var s=function(e,t){for(var r=e.length-t.length,n=function(r){if(T(t,(function(t,n){return d(e.charCodeAt(n+r))===t})))return {value:r}},i=0;i<=r;i++){var a=n(i);if("object"==typeof a)return a.value}return -1}(i,a.textLowerCase);if(0===s)return r(a.text.length===i.length?t.exact:t.prefix,e.startsWith(i,a.text));if(a.isLowerCase){if(-1===s)return;for(var _=0,p=n(i,o);_<p.length;_++){var f=p[_];if(c(i,f,a.text,!0))return r(t.substring,c(i,f,a.text,!1))}if(a.text.length<i.length&&u(i.charCodeAt(s)))return r(t.substring,!1)}else {if(i.indexOf(a.text)>0)return r(t.substring,!0);if(a.characterSpans.length>0){var g=n(i,o),m=!!l(i,g,a,!1)||!l(i,g,a,!0)&&void 0;if(void 0!==m)return r(t.camelCase,m)}}}function a(e,t,r){if(T(t.totalTextChunk.text,(function(e){return 32!==e&&42!==e}))){var n=i(e,t.totalTextChunk,r);if(n)return n}for(var a,s=0,c=t.subWordTextChunks;s<c.length;s++)a=o(a,i(e,c[s],r));return a}function o(t,r){return e.min(t,r,s)}function s(t,r){return void 0===t?1:void 0===r?-1:e.compareValues(t.kind,r.kind)||e.compareBooleans(!t.isCaseSensitive,!r.isCaseSensitive)}function c(e,t,r,n,i){return void 0===i&&(i={start:0,length:r.length}),i.length<=t.length&&S(0,i.length,(function(a){return function(e,t,r){return r?d(e)===d(t):e===t}(r.charCodeAt(i.start+a),e.charCodeAt(t.start+a),n)}))}function l(t,r,n,i){for(var s=n.characterSpans,l=0,_=0;;){if(_===s.length)return !0;if(l===r.length)return !1;for(var d=r[l],p=!1;_<s.length;_++){var f=s[_];if(p&&(!u(n.text.charCodeAt(s[_-1].start))||!u(n.text.charCodeAt(s[_].start))))break;if(!c(t,d,n.text,i,f))break;p=!0,d=e.createTextSpan(d.start+f.length,d.length-f.length);}l++;}}function u(t){if(t>=65&&t<=90)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toUpperCase()}function _(t){if(t>=97&&t<=122)return !0;if(t<127||!e.isUnicodeIdentifierStart(t,99))return !1;var r=String.fromCharCode(t);return r===r.toLowerCase()}function d(e){return e>=65&&e<=90?e-65+97:e<127?e:String.fromCharCode(e).toLowerCase().charCodeAt(0)}function p(e){return e>=48&&e<=57}function f(e){for(var t=[],r=0,n=0,i=0;i<e.length;i++)u(a=e.charCodeAt(i))||_(a)||p(a)||95===a||36===a?(0===n&&(r=i),n++):n>0&&(t.push(g(e.substr(r,n))),n=0);var a;return n>0&&t.push(g(e.substr(r,n))),t}function g(e){var t=e.toLowerCase();return {text:e,textLowerCase:t,isLowerCase:e===t,characterSpans:m(e)}}function m(e){return v(e,!1)}function y(e){return v(e,!0)}function v(t,r){for(var n=[],i=0,a=1;a<t.length;a++){var o=p(t.charCodeAt(a-1)),s=p(t.charCodeAt(a)),c=D(t,r,a),l=r&&x(t,a,i);(h(t.charCodeAt(a-1))||h(t.charCodeAt(a))||o!==s||c||l)&&(b(t,i,a)||n.push(e.createTextSpan(i,a-i)),i=a);}return b(t,i,t.length)||n.push(e.createTextSpan(i,t.length-i)),n}function h(e){switch(e){case 33:case 34:case 35:case 37:case 38:case 39:case 40:case 41:case 42:case 44:case 45:case 46:case 47:case 58:case 59:case 63:case 64:case 91:case 92:case 93:case 95:case 123:case 125:return !0}return !1}function b(e,t,r){return T(e,(function(e){return h(e)&&95!==e}),t,r)}function x(e,t,r){return t!==r&&t+1<e.length&&u(e.charCodeAt(t))&&_(e.charCodeAt(t+1))&&T(e,u,r,t)}function D(e,t,r){var n=u(e.charCodeAt(r-1));return u(e.charCodeAt(r))&&(!t||!n)}function S(e,t,r){for(var n=e;n<t;n++)if(!r(n))return !1;return !0}function T(e,t,r,n){return void 0===r&&(r=0),void 0===n&&(n=e.length),S(r,n,(function(r){return t(e.charCodeAt(r),r)}))}!function(e){e[e.exact=0]="exact",e[e.prefix=1]="prefix",e[e.substring=2]="substring",e[e.camelCase=3]="camelCase";}(t=e.PatternMatchKind||(e.PatternMatchKind={})),e.createPatternMatcher=function(t){var r=new e.Map,n=t.trim().split(".").map((function(e){return {totalTextChunk:g(t=e.trim()),subWordTextChunks:f(t)};var t;}));if(!n.some((function(e){return !e.subWordTextChunks.length})))return {getFullMatch:function(t,i){return function(t,r,n,i){var s;if(a(r,e.last(n),i)&&!(n.length-1>t.length)){for(var c=n.length-2,l=t.length-1;c>=0;c-=1,l-=1)s=o(s,a(t[l],n[c],i));return s}}(t,i,n,r)},getMatchForLastSegmentOfPattern:function(t){return a(t,e.last(n),r)},patternContainsDots:n.length>1}},e.breakIntoCharacterSpans=m,e.breakIntoWordSpans=y;}(t),function(e){e.preProcessFile=function(t,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i,a,o,s={languageVersion:1,pragmas:void 0,checkJsDirective:void 0,referencedFiles:[],typeReferenceDirectives:[],libReferenceDirectives:[],amdDependencies:[],hasNoDefaultLib:void 0,moduleName:void 0},c=[],l=0,u=!1;function _(){return a=o,18===(o=e.scanner.scan())?l++:19===o&&l--,o}function d(){var t=e.scanner.getTokenValue(),r=e.scanner.getTokenPos();return {fileName:t,pos:r,end:r+t.length}}function p(){c.push(d()),f();}function f(){0===l&&(u=!0);}function g(){if(24===a)return !1;var t=e.scanner.getToken();if(100===t){if(20===(t=_())){if(10===(t=_())||14===t)return p(),!0}else {if(10===t)return p(),!0;if(151===t&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 155!==t&&(41===t||18===t||79===t||e.isKeyword(t))}))&&(t=_()),79===t||e.isKeyword(t))if(155===(t=_())){if(10===(t=_()))return p(),!0}else if(63===t){if(y(!0))return !0}else {if(27!==t)return !0;t=_();}if(18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&155===(t=_())&&10===(t=_())&&p();}else 41===t&&127===(t=_())&&(79===(t=_())||e.isKeyword(t))&&155===(t=_())&&10===(t=_())&&p();}return !0}return !1}function m(){var t=e.scanner.getToken();if(93===t){if(f(),151===(t=_())&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 41===t||18===t}))&&(t=_()),18===t){for(t=_();19!==t&&1!==t;)t=_();19===t&&155===(t=_())&&10===(t=_())&&p();}else if(41===t)155===(t=_())&&10===(t=_())&&p();else if(100===t&&(151===(t=_())&&e.scanner.lookAhead((function(){var t=e.scanner.scan();return 79===t||e.isKeyword(t)}))&&(t=_()),(79===t||e.isKeyword(t))&&63===(t=_())&&y(!0)))return !0;return !0}return !1}function y(t,r){void 0===r&&(r=!1);var n=t?_():e.scanner.getToken();return 145===n&&(20===(n=_())&&(10===(n=_())||r&&14===n)&&p(),!0)}function v(){var t=e.scanner.getToken();if(79===t&&"define"===e.scanner.getTokenValue()){if(20!==(t=_()))return !0;if(10===(t=_())||14===t){if(27!==(t=_()))return !0;t=_();}if(22!==t)return !0;for(t=_();23!==t&&1!==t;)10!==t&&14!==t||p(),t=_();return !0}return !1}if(r&&function(){for(e.scanner.setText(t),_();1!==e.scanner.getToken();)135===e.scanner.getToken()&&(141===_()&&10===_()&&(i||(i=[]),i.push({ref:d(),depth:l})),1)||g()||m()||n&&(y(!1,!0)||v())||_();e.scanner.setText(void 0);}(),e.processCommentPragmas(s,t),e.processPragmasIntoFields(s,e.noop),u){if(i)for(var h=0,b=i;h<b.length;h++){var x=b[h];c.push(x.ref);}return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:void 0}}var D=void 0;if(i)for(var S=0,T=i;S<T.length;S++)0===(x=T[S]).depth?(D||(D=[]),D.push(x.ref.fileName)):c.push(x.ref);return {referencedFiles:s.referencedFiles,typeReferenceDirectives:s.typeReferenceDirectives,libReferenceDirectives:s.libReferenceDirectives,importedFiles:c,isLibFile:!!s.hasNoDefaultLib,ambientExternalModules:D}};}(t),function(e){!function(t){function r(e,t,r,n,a,o){return {canRename:!0,fileToRename:void 0,kind:r,displayName:e,fullDisplayName:t,kindModifiers:n,triggerSpan:i(a,o)}}function n(t){return {canRename:!1,localizedErrorMessage:e.getLocaleSpecificMessage(t)}}function i(t,r){var n=t.getStart(r),i=t.getWidth(r);return e.isStringLiteralLike(t)&&(n+=1,i-=2),e.createTextSpan(n,i)}function a(t){switch(t.kind){case 79:case 80:case 10:case 14:case 108:return !0;case 8:return e.isLiteralNameOfPropertyDeclarationOrIndexAccess(t);default:return !1}}t.getRenameInfo=function(t,i,o,s){var c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(i,o));if(a(c)){var l=function(t,i,a,o,s){var c=i.getSymbolAtLocation(t);if(c){var l=c.declarations;if(l&&0!==l.length){if(l.some((function(t){return function(t,r){var n=r.getSourceFile();return t.isSourceFileDefaultLibrary(n)&&e.fileExtensionIs(n.fileName,".d.ts")}(o,t)})))return n(e.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);if(!(e.isIdentifier(t)&&88===t.originalKeywordKind&&c.parent&&1536&c.parent.flags)){if(e.isStringLiteralLike(t)&&e.tryGetImportFromModuleSpecifier(t))return s&&s.allowRenameOfImportPath?function(t,r,i){if(!e.isExternalModuleNameRelative(t.text))return n(e.Diagnostics.You_cannot_rename_a_module_via_a_global_import);var a=i.declarations&&e.find(i.declarations,e.isSourceFile);if(a){var o=e.endsWith(t.text,"/index")||e.endsWith(t.text,"/index.js")?void 0:e.tryRemoveSuffix(e.removeFileExtension(a.fileName),"/index"),s=void 0===o?a.fileName:o,c=void 0===o?"module":"directory",l=t.text.lastIndexOf("/")+1;return {canRename:!0,fileToRename:s,kind:c,displayName:s,fullDisplayName:s,kindModifiers:"",triggerSpan:e.createTextSpan(t.getStart(r)+1+l,t.text.length-l)}}}(t,a,c):void 0;var u=e.SymbolDisplay.getSymbolKind(i,c,t),_=e.isImportOrExportSpecifierName(t)||e.isStringOrNumericLiteralLike(t)&&161===t.parent.kind?e.stripQuotes(e.getTextOfIdentifierOrLiteral(t)):void 0;return r(_||i.symbolToString(c),_||i.getFullyQualifiedName(c),u,e.SymbolDisplay.getSymbolModifiers(i,c),t,a)}}}else if(e.isStringLiteralLike(t)){var d=e.getContextualTypeFromParentOrAncestorTypeNode(t,i);if(d&&(128&d.flags||1048576&d.flags&&e.every(d.types,(function(e){return !!(128&e.flags)}))))return r(t.text,t.text,"string","",t,a)}else if(e.isLabelName(t)){var p=e.getTextOfNode(t);return r(p,p,"label","",t,a)}}(c,t.getTypeChecker(),i,t,s);if(l)return l}return n(e.Diagnostics.You_cannot_rename_this_element)},t.nodeIsEligibleForRename=a;}(e.Rename||(e.Rename={}));}(t),function(e){!function(t){function r(t,r,n){return e.Debug.assert(n.pos<=r),r<n.end||n.getEnd()===r&&e.getTouchingPropertyName(t,r).pos<n.end}t.getSmartSelectionRange=function(t,n){var o,s,c,_={textSpan:e.createTextSpanFromBounds(n.getFullStart(),n.getEnd())},d=n;e:for(;;){var p=a(d);if(!p.length)break;for(var f=0;f<p.length;f++){var g=p[f-1],m=p[f],y=p[f+1];if(e.getTokenPosOfNode(m,n,!0)>t)break e;var v=e.singleOrUndefined(e.getTrailingCommentRanges(n.text,m.end));if(v&&2===v.kind&&S(v.pos,v.end),r(n,t,m)){if(e.isBlock(m)||e.isTemplateSpan(m)||e.isTemplateHead(m)||e.isTemplateTail(m)||g&&e.isTemplateHead(g)||e.isVariableDeclarationList(m)&&e.isVariableStatement(d)||e.isSyntaxList(m)&&e.isVariableDeclarationList(d)||e.isVariableDeclaration(m)&&e.isSyntaxList(d)&&1===p.length||e.isJSDocTypeExpression(m)||e.isJSDocSignature(m)||e.isJSDocTypeLiteral(m)){d=m;break}e.isTemplateSpan(d)&&y&&e.isTemplateMiddleOrTemplateTail(y)&&D(m.getFullStart()-"${".length,y.getStart()+"}".length);var h=e.isSyntaxList(m)&&(18===(c=(s=g)&&s.kind)||22===c||20===c||279===c)&&l(y)&&!e.positionsAreOnSameLine(g.getStart(),y.getStart(),n),b=h?g.getEnd():m.getStart(),x=h?y.getStart():u(n,m);e.hasJSDocNodes(m)&&(null===(o=m.jsDoc)||void 0===o?void 0:o.length)&&D(e.first(m.jsDoc).getStart(),x),D(b,x),(e.isStringLiteral(m)||e.isTemplateLiteral(m))&&D(b+1,x-1),d=m;break}if(f===p.length-1)break e}}return _;function D(r,n){if(r!==n){var a=e.createTextSpanFromBounds(r,n);(!_||!e.textSpansEqual(a,_.textSpan)&&e.textSpanIntersectsWithPosition(a,t))&&(_=i$1({textSpan:a},_&&{parent:_}));}}function S(e,t){D(e,t);for(var r=e;47===n.text.charCodeAt(r);)r++;D(r,t);}};var n=e.or(e.isImportDeclaration,e.isImportEqualsDeclaration);function a(t){if(e.isSourceFile(t))return o(t.getChildAt(0).getChildren(),n);if(e.isMappedTypeNode(t)){var r=t.getChildren(),i=r[0],a=r.slice(1),l=e.Debug.checkDefined(a.pop());e.Debug.assertEqual(i.kind,18),e.Debug.assertEqual(l.kind,19);var u=o(a,(function(e){return e===t.readonlyToken||144===e.kind||e===t.questionToken||57===e.kind}));return [i,c(s(o(u,(function(e){var t=e.kind;return 22===t||162===t||23===t})),(function(e){return 58===e.kind}))),l]}if(e.isPropertySignature(t))return s(a=o(t.getChildren(),(function(r){return r===t.name||e.contains(t.modifiers,r)})),(function(e){return 58===e.kind}));if(e.isParameter(t)){var _=o(t.getChildren(),(function(e){return e===t.dotDotDotToken||e===t.name}));return s(o(_,(function(e){return e===_[0]||e===t.questionToken})),(function(e){return 63===e.kind}))}return e.isBindingElement(t)?s(t.getChildren(),(function(e){return 63===e.kind})):t.getChildren()}function o(e,t){for(var r,n=[],i=0,a=e;i<a.length;i++){var o=a[i];t(o)?(r=r||[]).push(o):(r&&(n.push(c(r)),r=void 0),n.push(o));}return r&&n.push(c(r)),n}function s(t,r,n){if(void 0===n&&(n=!0),t.length<2)return t;var i=e.findIndex(t,r);if(-1===i)return t;var a=t.slice(0,i),o=t[i],s=e.last(t),l=n&&26===s.kind,u=t.slice(i+1,l?t.length-1:void 0),_=e.compact([a.length?c(a):void 0,o,u.length?c(u):void 0]);return l?_.concat(s):_}function c(t){return e.Debug.assertGreaterThanOrEqual(t.length,1),e.setTextRangePosEnd(e.parseNodeFactory.createSyntaxList(t),t[0].pos,e.last(t).end)}function l(e){var t=e&&e.kind;return 19===t||23===t||21===t||280===t}function u(e,t){switch(t.kind){case 338:case 336:case 345:case 343:case 340:return e.getLineEndOfPosition(t.getStart());default:return t.getEnd()}}}(e.SmartSelectionRange||(e.SmartSelectionRange={}));}(t),function(e){!function(t){var r,i;function a(t,r,n){for(var i=t.getFullStart(),a=t.parent;a;){var o=e.findPrecedingToken(i,r,a,!0);if(o)return e.rangeContainsRange(n,o);a=a.parent;}return e.Debug.fail("Could not find preceding token")}function o(t,r){var n=function(t,r){if(29===t.kind||20===t.kind)return {list:p(t.parent,t,r),argumentIndex:0};var n=e.findContainingList(t);return n&&{list:n,argumentIndex:u(n,t)}}(t,r);if(n){var i=n.list,a=n.argumentIndex,o=function(t){var r=t.getChildren(),n=e.countWhere(r,(function(e){return 27!==e.kind}));return r.length>0&&27===e.last(r).kind&&n++,n}(i);return 0!==a&&e.Debug.assertLessThan(a,o),{list:i,argumentIndex:a,argumentCount:o,argumentsSpan:function(t,r){var n=t.getFullStart(),i=e.skipTrivia(r.text,t.getEnd(),!1);return e.createTextSpan(n,i-n)}(i,r)}}}function s(t,r,n){var i=t.parent;if(e.isCallOrNewExpression(i)){var a=i,s=o(t,n);if(!s)return;var c=s.list,l=s.argumentIndex,u=s.argumentCount,d=s.argumentsSpan;return {isTypeParameterList:!!i.typeArguments&&i.typeArguments.pos===c.pos,invocation:{kind:0,node:a},argumentsSpan:d,argumentIndex:l,argumentCount:u}}if(e.isNoSubstitutionTemplateLiteral(t)&&e.isTaggedTemplateExpression(i))return e.isInsideTemplateLiteral(t,r,n)?_(i,0,n):void 0;if(e.isTemplateHead(t)&&209===i.parent.kind){var p=i,f=p.parent;return e.Debug.assert(222===p.kind),_(f,l=e.isInsideTemplateLiteral(t,r,n)?0:1,n)}if(e.isTemplateSpan(i)&&e.isTaggedTemplateExpression(i.parent.parent)){var g=i;if(f=i.parent.parent,e.isTemplateTail(t)&&!e.isInsideTemplateLiteral(t,r,n))return;return _(f,l=function(t,r,n,i){return e.Debug.assert(n>=r.getStart(),"Assumed 'position' could not occur before node."),e.isTemplateLiteralToken(r)?e.isInsideTemplateLiteral(r,n,i)?0:t+2:t+1}(g.parent.templateSpans.indexOf(g),t,r,n),n)}if(e.isJsxOpeningLikeElement(i)){var m=i.attributes.pos,y=e.skipTrivia(n.text,i.attributes.end,!1);return {isTypeParameterList:!1,invocation:{kind:0,node:i},argumentsSpan:e.createTextSpan(m,y-m),argumentIndex:0,argumentCount:1}}var v=e.getPossibleTypeArgumentsInfo(t,n);if(v){var h=v.called,b=v.nTypeArguments;return {isTypeParameterList:!0,invocation:a={kind:1,called:h},argumentsSpan:d=e.createTextSpanFromBounds(h.getStart(n),t.end),argumentIndex:b,argumentCount:b+1}}}function c(t){return e.isBinaryExpression(t.parent)?c(t.parent):t}function l(t){return e.isBinaryExpression(t.left)?l(t.left)+1:2}function u(e,t){for(var r=0,n=0,i=e.getChildren();n<i.length;n++){var a=i[n];if(a===t)break;27!==a.kind&&r++;}return r}function _(t,r,n){var i=e.isNoSubstitutionTemplateLiteral(t.template)?1:t.template.templateSpans.length+1;return 0!==r&&e.Debug.assertLessThan(r,i),{isTypeParameterList:!1,invocation:{kind:0,node:t},argumentsSpan:d(t,n),argumentIndex:r,argumentCount:i}}function d(t,r){var n=t.template,i=n.getStart(),a=n.getEnd();return 222===n.kind&&0===e.last(n.templateSpans).literal.getFullWidth()&&(a=e.skipTrivia(r.text,a,!1)),e.createTextSpan(i,a-i)}function p(t,r,n){var i=t.getChildren(n),a=i.indexOf(r);return e.Debug.assert(a>=0&&i.length>a+1),i[a+1]}function f(t){return 0===t.kind?e.getInvokedExpression(t.node):t.called}function g(e){return 0===e.kind?e.node:1===e.kind?e.called:e.node}!function(e){e[e.Call=0]="Call",e[e.TypeArgs=1]="TypeArgs",e[e.Contextual=2]="Contextual";}(r||(r={})),t.getSignatureHelpItems=function(t,r,n,i,u){var _=t.getTypeChecker(),d=e.findTokenOnLeftOfPosition(r,n);if(d){var p=!!i&&"characterTyped"===i.kind;if(!p||!e.isInString(r,n,d)&&!e.isInComment(r,n)){var m=!!i&&"invoked"===i.kind,h=function(t,r,n,i,a){for(var u=function(t){e.Debug.assert(e.rangeContainsRange(t.parent,t),"Not a subspan",(function(){return "Child: ".concat(e.Debug.formatSyntaxKind(t.kind),", parent: ").concat(e.Debug.formatSyntaxKind(t.parent.kind))}));var a=function(t,r,n,i){return function(t,r,n,i){var a=function(t,r,n){if(20===t.kind||27===t.kind){var i=t.parent;switch(i.kind){case 211:case 168:case 212:case 213:var a=o(t,r);if(!a)return;var s=a.argumentIndex,u=a.argumentCount,_=a.argumentsSpan,d=e.isMethodDeclaration(i)?n.getContextualTypeForObjectLiteralElement(i):n.getContextualType(i);return d&&{contextualType:d,argumentIndex:s,argumentCount:u,argumentsSpan:_};case 220:var p=c(i),f=n.getContextualType(p),g=20===t.kind?0:l(i)-1,m=l(p);return f&&{contextualType:f,argumentIndex:g,argumentCount:m,argumentsSpan:e.createTextSpanFromNode(i)};default:return}}}(t,n,i);if(a){var s,u=a.contextualType,_=a.argumentIndex,d=a.argumentCount,p=a.argumentsSpan,f=u.getNonNullableType(),g=f.getCallSignatures();return 1!==g.length?void 0:{isTypeParameterList:!1,invocation:{kind:2,signature:e.first(g),node:t,symbol:(s=f.symbol,"__type"===s.name&&e.firstDefined(s.declarations,(function(t){return e.isFunctionTypeNode(t)?t.parent.symbol:void 0}))||s)},argumentsSpan:p,argumentIndex:_,argumentCount:d}}}(t,0,n,i)||s(t,r,n)}(t,r,n,i);if(a)return {value:a}},_=t;!e.isSourceFile(_)&&(a||!e.isBlock(_));_=_.parent){var d=u(_);if("object"==typeof d)return d.value}}(d,n,r,_,m);if(h){u.throwIfCancellationRequested();var b=function(t,r,n,i,o){var s=t.invocation,c=t.argumentCount;switch(s.kind){case 0:if(o&&!function(t,r,n){if(!e.isCallOrNewExpression(r))return !1;var i=r.getChildren(n);switch(t.kind){case 20:return e.contains(i,t);case 27:var o=e.findContainingList(t);return !!o&&e.contains(i,o);case 29:return a(t,n,r.expression);default:return !1}}(i,s.node,n))return;var l=[],u=r.getResolvedSignatureForSignatureHelp(s.node,l,c);return 0===l.length?void 0:{kind:0,candidates:l,resolvedSignature:u};case 1:var _=s.called;if(o&&!a(i,n,e.isIdentifier(_)?_.parent:_))return;if(0!==(l=e.getPossibleGenericSignatures(_,c,r)).length)return {kind:0,candidates:l,resolvedSignature:e.first(l)};var d=r.getSymbolAtLocation(_);return d&&{kind:1,symbol:d};case 2:return {kind:0,candidates:[s.signature],resolvedSignature:s.signature};default:return e.Debug.assertNever(s)}}(h,_,r,d,p);return u.throwIfCancellationRequested(),b?_.runWithCancellationToken(u,(function(e){return 0===b.kind?y(b.candidates,b.resolvedSignature,h,r,e):function(e,t,r,n){var i=t.argumentCount,a=t.argumentsSpan,o=t.invocation,s=t.argumentIndex,c=n.getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(e);return c?{items:[v(e,c,n,g(o),r)],applicableSpan:a,selectedItemIndex:0,argumentIndex:s,argumentCount:i}:void 0}(b.symbol,h,r,e)})):e.isSourceFileJS(r)?function(t,r,n){if(2!==t.invocation.kind){var i=f(t.invocation),a=e.isPropertyAccessExpression(i)?i.name.text:void 0,o=r.getTypeChecker();return void 0===a?void 0:e.firstDefined(r.getSourceFiles(),(function(r){return e.firstDefined(r.getNamedDeclarations().get(a),(function(e){var i=e.symbol&&o.getTypeOfSymbolAtLocation(e.symbol,e),a=i&&i.getCallSignatures();if(a&&a.length)return o.runWithCancellationToken(n,(function(e){return y(a,a[0],t,r,e,!0)}))}))}))}}(h,t,u):void 0}}}},function(e){e[e.Candidate=0]="Candidate",e[e.Type=1]="Type";}(i||(i={})),t.getArgumentInfoForCompletions=function(e,t,r){var n=s(e,t,r);return !n||n.isTypeParameterList||0!==n.invocation.kind?void 0:{invocation:n.invocation.node,argumentCount:n.argumentCount,argumentIndex:n.argumentIndex}};var m=70246400;function y(t,r,i,a,o,s){var c,l=i.isTypeParameterList,u=i.argumentCount,_=i.argumentsSpan,d=i.invocation,p=i.argumentIndex,m=g(d),y=2===d.kind?d.symbol:o.getSymbolAtLocation(f(d))||s&&(null===(c=r.declaration)||void 0===c?void 0:c.symbol),v=y?e.symbolToDisplayParts(o,y,s?a:void 0,void 0):e.emptyArray,D=e.map(t,(function(t){return function(t,r,i,a,o,s){var c=(i?b:x)(t,a,o,s);return e.map(c,(function(i){var s=i.isVariadic,c=i.parameters,l=i.prefix,u=i.suffix,_=n$3(n$3([],r,!0),l,!0),d=n$3(n$3([],u,!0),function(t,r,n){return e.mapToDisplayParts((function(e){e.writePunctuation(":"),e.writeSpace(" ");var i=n.getTypePredicateOfSignature(t);i?n.writeTypePredicate(i,r,void 0,e):n.writeType(n.getReturnTypeOfSignature(t),r,void 0,e);}))}(t,o,a),!0),p=t.getDocumentationComment(a),f=t.getJsDocTags();return {isVariadic:s,prefixDisplayParts:_,suffixDisplayParts:d,separatorDisplayParts:h,parameters:c,documentation:p,tags:f}}))}(t,v,l,o,m,a)}));0!==p&&e.Debug.assertLessThan(p,u);for(var S=0,T=0,C=0;C<D.length;C++){var E=D[C];if(t[C]===r&&(S=T,E.length>1))for(var k=0,N=0,F=E;N<F.length;N++){var A=F[N];if(A.isVariadic||A.parameters.length>=u){S=T+k;break}k++;}T+=E.length;}e.Debug.assert(-1!==S);var P={items:e.flatMapToMutable(D,e.identity),applicableSpan:_,selectedItemIndex:S,argumentIndex:p,argumentCount:u},w=P.items[S];if(w.isVariadic){var I=e.findIndex(w.parameters,(function(e){return !!e.isRest}));-1<I&&I<w.parameters.length-1?P.argumentIndex=w.parameters.length:P.argumentIndex=Math.min(P.argumentIndex,w.parameters.length-1);}return P}function v(t,r,i,a,o){var s=e.symbolToDisplayParts(i,t),c=e.createPrinter({removeComments:!0}),l=r.map((function(e){return D(e,i,a,o,c)})),u=t.getDocumentationComment(i),_=t.getJsDocTags(i);return {isVariadic:!1,prefixDisplayParts:n$3(n$3([],s,!0),[e.punctuationPart(29)],!1),suffixDisplayParts:[e.punctuationPart(31)],separatorDisplayParts:h,parameters:l,documentation:u,tags:_}}var h=[e.punctuationPart(27),e.spacePart()];function b(t,r,i,a){var o=(t.target||t).typeParameters,s=e.createPrinter({removeComments:!0}),c=(o||e.emptyArray).map((function(e){return D(e,r,i,a,s)})),l=t.thisParameter?[r.symbolToParameterDeclaration(t.thisParameter,i,m)]:[];return r.getExpandedParameters(t).map((function(t){var o=e.factory.createNodeArray(n$3(n$3([],l,!0),e.map(t,(function(e){return r.symbolToParameterDeclaration(e,i,m)})),!0)),u=e.mapToDisplayParts((function(e){s.writeList(2576,o,a,e);}));return {isVariadic:!1,parameters:c,prefix:[e.punctuationPart(29)],suffix:n$3([e.punctuationPart(31)],u,!0)}}))}function x(t,r,i,a){var o=e.createPrinter({removeComments:!0}),s=e.mapToDisplayParts((function(n){if(t.typeParameters&&t.typeParameters.length){var s=e.factory.createNodeArray(t.typeParameters.map((function(e){return r.typeParameterToDeclaration(e,i,m)})));o.writeList(53776,s,a,n);}})),c=r.getExpandedParameters(t),l=r.hasEffectiveRestParameter(t)?1===c.length?function(e){return !0}:function(e){return !!(e.length&&32768&e[e.length-1].checkFlags)}:function(e){return !1};return c.map((function(t){return {isVariadic:l(t),parameters:t.map((function(t){return function(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.symbolToParameterDeclaration(t,n,m);a.writeNode(4,o,i,e);})),s=r.isOptionalParameter(t.valueDeclaration),c=!!(32768&t.checkFlags);return {name:t.name,documentation:t.getDocumentationComment(r),displayParts:o,isOptional:s,isRest:c}}(t,r,i,a,o)})),prefix:n$3(n$3([],s,!0),[e.punctuationPart(20)],!1),suffix:[e.punctuationPart(21)]}}))}function D(t,r,n,i,a){var o=e.mapToDisplayParts((function(e){var o=r.typeParameterToDeclaration(t,n,m);a.writeNode(4,o,i,e);}));return {name:t.symbol.name,documentation:t.symbol.getDocumentationComment(r),displayParts:o,isOptional:!1,isRest:!1}}}(e.SignatureHelp||(e.SignatureHelp={}));}(t),function(e){!function(t){function r(e){return "literals"===e.includeInlayParameterNameHints}t.provideInlayHints=function(t){var n=t.file,i=t.program,a=t.span,o=t.cancellationToken,s=t.preferences,c=n.text,l=i.getCompilerOptions(),u=i.getTypeChecker(),_=[];return function t(i){if(i&&0!==i.getFullWidth()){switch(i.kind){case 260:case 256:case 257:case 255:case 225:case 212:case 168:case 213:o.throwIfCancellationRequested();}if(e.textSpanIntersectsWith(a,i.pos,i.getFullWidth())&&!e.isTypeNode(i))return s.includeInlayVariableTypeHints&&e.isVariableDeclaration(i)||s.includeInlayPropertyDeclarationTypeHints&&e.isPropertyDeclaration(i)?function(t){if(t.initializer&&!e.isBindingPattern(t.name)&&!e.getEffectiveTypeAnnotationNode(t)){var r=u.getTypeAtLocation(t);if(!f(r)){var n=b(r);n&&p(n,t.name.end);}}}(i):s.includeInlayEnumMemberValueHints&&e.isEnumMember(i)?function(e){if(!e.initializer){var t,r,n=u.getConstantValue(e);void 0!==n&&(t=n.toString(),r=e.end,_.push({text:"= ".concat(h(t,30)),position:r,kind:"Enum",whitespaceBefore:!0}));}}(i):function(e){return "literals"===e.includeInlayParameterNameHints||"all"===e.includeInlayParameterNameHints}(s)&&(e.isCallExpression(i)||e.isNewExpression(i))?function(t){var n=t.arguments;if(n&&n.length){var i=[],a=u.getResolvedSignatureForSignatureHelp(t,i);if(a&&i.length)for(var o=0;o<n.length;++o){var c=n[o],l=e.skipParentheses(c);if(!r(s)||y(l)){var _=u.getParameterIdentifierNameAtPosition(a,o);if(_){var p=_[0],f=_[1];if(!s.includeInlayParameterNameHintsWhenArgumentMatchesName&&g(l,p)&&!f)continue;var v=e.unescapeLeadingUnderscores(p);if(m(l,v))continue;d(v,c.getStart(),f);}}}}}(i):(s.includeInlayFunctionParameterTypeHints&&e.isFunctionLikeDeclaration(i)&&e.hasContextSensitiveParameters(i)&&function(t){var r=u.getSignatureFromDeclaration(t);if(r)for(var n=0;n<t.parameters.length&&n<r.parameters.length;++n){var i=t.parameters[n];if(!e.getEffectiveTypeAnnotationNode(i)){var a=v(r.parameters[n]);a&&p(a,i.name.end);}}}(i),s.includeInlayFunctionLikeReturnTypeHints&&function(t){return e.isArrowFunction(t)||e.isFunctionExpression(t)||e.isFunctionDeclaration(t)||e.isMethodDeclaration(t)||e.isGetAccessorDeclaration(t)}(i)&&function(t){if((!e.isArrowFunction(t)||e.findChildOfKind(t,20,n))&&!e.getEffectiveReturnTypeNode(t)&&t.body){var r=u.getSignatureFromDeclaration(t);if(r){var i=u.getReturnTypeOfSignature(r);if(!f(i)){var a=b(i);a&&p(a,function(t){var r=e.findChildOfKind(t,21,n);return r?r.end:t.parameters.end}(t));}}}}(i)),e.forEachChild(i,t)}}(n),_;function d(e,t,r){_.push({text:"".concat(r?"...":"").concat(h(e,30),":"),position:t,kind:"Parameter",whitespaceAfter:!0});}function p(e,t){_.push({text:": ".concat(h(e,30)),position:t,kind:"Type",whitespaceBefore:!0});}function f(e){return e.symbol&&1536&e.symbol.flags}function g(t,r){return e.isIdentifier(t)?t.text===r:!!e.isPropertyAccessExpression(t)&&t.name.text===r}function m(t,r){if(!e.isIdentifierText(r,l.target,e.getLanguageVariant(n.scriptKind)))return !1;var i=e.getLeadingCommentRanges(c,t.pos);if(!(null==i?void 0:i.length))return !1;var a=function(e){return new RegExp("^\\s?/\\*\\*?\\s?".concat(e,"\\s?\\*\\/\\s?$"))}(r);return e.some(i,(function(e){return a.test(c.substring(e.pos,e.end))}))}function y(t){switch(t.kind){case 218:var r=t.operand;return e.isLiteralExpression(r)||e.isIdentifier(r)&&e.isInfinityOrNaNString(r.escapedText);case 110:case 95:case 104:case 14:case 222:return !0;case 79:var n=t.escapedText;return function(e){return "undefined"===e}(n)||e.isInfinityOrNaNString(n)}return e.isLiteralExpression(t)}function v(t){var r=t.valueDeclaration;if(r&&e.isParameter(r)){var n=u.getTypeOfSymbolAtLocation(t,r);if(!f(n))return b(n)}}function h(e,t){return e.length>t?e.substr(0,t-"...".length)+"...":e}function b(t){var r=e.createPrinter({removeComments:!0});return e.usingSingleLineStringWriter((function(i){var a=u.typeToTypeNode(t,void 0,71286784,i);e.Debug.assertIsDefined(a,"should always get typenode"),r.writeNode(4,a,n,i);}))}};}(e.InlayHints||(e.InlayHints={}));}(t),function(e){var t=/^data:(?:application\/json(?:;charset=[uU][tT][fF]-8);base64,([A-Za-z0-9+\/=]+)$)?/;function r(t,r,n){var i=e.tryParseRawSourceMap(r);if(i&&i.sources&&i.file&&i.mappings&&(!i.sourcesContent||!i.sourcesContent.some(e.isString)))return e.createDocumentPositionMapper(t,i,n)}e.getSourceMapper=function(t){var r=e.createGetCanonicalFileName(t.useCaseSensitiveFileNames()),n=t.getCurrentDirectory(),i=new e.Map,a=new e.Map;return {tryGetSourcePosition:function t(r){if(e.isDeclarationFileName(r.fileName)&&c(r.fileName)){var n=s(r.fileName).getSourcePosition(r);return n&&n!==r?t(n)||n:void 0}},tryGetGeneratedPosition:function(i){if(!e.isDeclarationFileName(i.fileName)){var a=c(i.fileName);if(a){var o=t.getProgram();if(!o.isSourceOfProjectReferenceRedirect(a.fileName)){var l=o.getCompilerOptions(),u=e.outFile(l),_=u?e.removeFileExtension(u)+".d.ts":e.getDeclarationEmitOutputFilePathWorker(i.fileName,o.getCompilerOptions(),n,o.getCommonSourceDirectory(),r);if(void 0!==_){var d=s(_,i.fileName).getGeneratedPosition(i);return d===i?void 0:d}}}}},toLineColumnOffset:function(e,t){return l(e).getLineAndCharacterOfPosition(t)},clearCache:function(){i.clear(),a.clear();}};function o(t){return e.toPath(t,n,r)}function s(n,i){var s,c=o(n),u=a.get(c);if(u)return u;if(t.getDocumentPositionMapper)s=t.getDocumentPositionMapper(n,i);else if(t.readFile){var _=l(n);s=_&&e.getDocumentPositionMapper({getSourceFileLike:l,getCanonicalFileName:r,log:function(e){return t.log(e)}},n,e.getLineInfo(_.text,e.getLineStarts(_)),(function(e){return !t.fileExists||t.fileExists(e)?t.readFile(e):void 0}));}return a.set(c,s||e.identitySourceMapConsumer),s||e.identitySourceMapConsumer}function c(e){var r=t.getProgram();if(r){var n=o(e),i=r.getSourceFileByPath(n);return i&&i.resolvedPath===n?i:void 0}}function l(r){return t.getSourceFileLike?t.getSourceFileLike(r):c(r)||function(r){var n=o(r),a=i.get(n);if(void 0!==a)return a||void 0;if(t.readFile&&(!t.fileExists||t.fileExists(n))){var s=t.readFile(n),c=!!s&&function(t,r){return {text:t,lineMap:void 0,getLineAndCharacterOfPosition:function(t){return e.computeLineAndCharacterOfPosition(e.getLineStarts(this),t)}}}(s);return i.set(n,c),c||void 0}i.set(n,!1);}(r)}},e.getDocumentPositionMapper=function(n,i,a,o){var s=e.tryGetSourceMappingURL(a);if(s){var c=t.exec(s);if(c){if(c[1]){var l=c[1];return r(n,e.base64decode(e.sys,l),i)}s=void 0;}}var u=[];s&&u.push(s),u.push(i+".map");for(var _=s&&e.getNormalizedAbsolutePath(s,e.getDirectoryPath(i)),d=0,p=u;d<p.length;d++){var f=p[d],g=e.getNormalizedAbsolutePath(f,e.getDirectoryPath(i)),m=o(g,_);if(e.isString(m))return r(n,m,g);if(void 0!==m)return m||void 0}};}(t),function(e){var t=new e.Map;function r(t){return e.isPropertyAccessExpression(t)?r(t.expression):t}function n(t){switch(t.kind){case 265:var r=t.importClause,n=t.moduleSpecifier;return r&&!r.name&&r.namedBindings&&267===r.namedBindings.kind&&e.isStringLiteral(n)?r.namedBindings.name:void 0;case 264:return t.name;default:return}}function i(e,t){var r=t.getSignatureFromDeclaration(e),n=r?t.getReturnTypeOfSignature(r):void 0;return !!n&&!!t.getPromisedTypeOfPromise(n)}function a(t,r){return e.isReturnStatement(t)&&!!t.expression&&o(t.expression,r)}function o(t,r){if(!s(t)||!c(t)||!t.arguments.every((function(e){return l(e,r)})))return !1;for(var n=t.expression.expression;s(n)||e.isPropertyAccessExpression(n);)if(e.isCallExpression(n)){if(!c(n)||!n.arguments.every((function(e){return l(e,r)})))return !1;n=n.expression.expression;}else n=n.expression;return !0}function s(t){return e.isCallExpression(t)&&(e.hasPropertyAccessExpressionWithName(t,"then")||e.hasPropertyAccessExpressionWithName(t,"catch")||e.hasPropertyAccessExpressionWithName(t,"finally"))}function c(t){var r=t.expression.name.text,n="then"===r?2:"catch"===r||"finally"===r?1:0;return !(t.arguments.length>n)&&(t.arguments.length<n||1===n||e.some(t.arguments,(function(t){return 104===t.kind||e.isIdentifier(t)&&"undefined"===t.text})))}function l(r,n){switch(r.kind){case 255:case 212:if(1&e.getFunctionFlags(r))return !1;case 213:t.set(u(r),!0);case 104:return !0;case 79:case 205:var i=n.getSymbolAtLocation(r);return !!i&&(n.isUndefinedSymbol(i)||e.some(e.skipAlias(i,n).declarations,(function(t){return e.isFunctionLike(t)||e.hasInitializer(t)&&!!t.initializer&&e.isFunctionLike(t.initializer)})));default:return !1}}function u(e){return "".concat(e.pos.toString(),":").concat(e.end.toString())}function _(e){switch(e.kind){case 255:case 168:case 212:case 213:return !0;default:return !1}}e.computeSuggestionDiagnostics=function(o,s,c){s.getSemanticDiagnostics(o,c);var l,d=[],p=s.getTypeChecker();o.impliedNodeFormat!==e.ModuleKind.CommonJS&&!e.fileExtensionIsOneOf(o.fileName,[".cts",".cjs"])&&o.commonJsModuleIndicator&&(e.programContainsEsModules(s)||e.compilerOptionsIndicateEsModules(s.getCompilerOptions()))&&function(t){return t.statements.some((function(t){switch(t.kind){case 236:return t.declarationList.declarations.some((function(t){return !!t.initializer&&e.isRequireCall(r(t.initializer),!0)}));case 237:var n=t.expression;if(!e.isBinaryExpression(n))return e.isRequireCall(n,!0);var i=e.getAssignmentDeclarationKind(n);return 1===i||2===i;default:return !1}}))}(o)&&d.push(e.createDiagnosticForNode((l=o.commonJsModuleIndicator,e.isBinaryExpression(l)?l.left:l),e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));var f=e.isSourceFileJS(o);if(t.clear(),function r(n){if(f)(function(t,r){var n,i,a,o;if(212===t.kind){if(e.isVariableDeclaration(t.parent)&&(null===(n=t.symbol.members)||void 0===n?void 0:n.size))return !0;var s=r.getSymbolOfExpando(t,!1);return !(!s||!(null===(i=s.exports)||void 0===i?void 0:i.size)&&!(null===(a=s.members)||void 0===a?void 0:a.size))}return 255===t.kind&&!!(null===(o=t.symbol.members)||void 0===o?void 0:o.size)})(n,p)&&d.push(e.createDiagnosticForNode(e.isVariableDeclaration(n.parent)?n.parent.name:n,e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration));else {if(e.isVariableStatement(n)&&n.parent===o&&2&n.declarationList.flags&&1===n.declarationList.declarations.length){var s=n.declarationList.declarations[0].initializer;s&&e.isRequireCall(s,!0)&&d.push(e.createDiagnosticForNode(s,e.Diagnostics.require_call_may_be_converted_to_an_import));}e.codefix.parameterShouldGetTypeFromJSDoc(n)&&d.push(e.createDiagnosticForNode(n.name||n,e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types));}_(n)&&function(r,n,o){(function(t,r){return !e.isAsyncFunction(t)&&t.body&&e.isBlock(t.body)&&function(t,r){return !!e.forEachReturnStatement(t,(function(e){return a(e,r)}))}(t.body,r)&&i(t,r)})(r,n)&&!t.has(u(r))&&o.push(e.createDiagnosticForNode(!r.name&&e.isVariableDeclaration(r.parent)&&e.isIdentifier(r.parent.name)?r.parent.name:r,e.Diagnostics.This_may_be_converted_to_an_async_function));}(n,p,d),n.forEachChild(r);}(o),e.getAllowSyntheticDefaultImports(s.getCompilerOptions()))for(var g=0,m=o.imports;g<m.length;g++){var y=m[g],v=n(e.importFromModuleSpecifier(y));if(v){var h=e.getResolvedModule(o,y.text,e.getModeForUsageLocation(o,y)),b=h&&s.getSourceFile(h.resolvedFileName);b&&b.externalModuleIndicator&&e.isExportAssignment(b.externalModuleIndicator)&&b.externalModuleIndicator.isExportEquals&&d.push(e.createDiagnosticForNode(v,e.Diagnostics.Import_may_be_converted_to_a_default_import));}}return e.addRange(d,o.bindSuggestionDiagnostics),e.addRange(d,s.getSuggestionDiagnostics(o,c)),d.sort((function(e,t){return e.start-t.start}))},e.returnsPromise=i,e.isReturnStatementWithFixablePromiseHandler=a,e.isFixablePromiseHandler=o,e.canBeConvertedToAsync=_;}(t),function(e){!function(t){var r=70246400;function n(t,r,n){var a=i(t,r,n);if(""!==a)return a;var o=e.getCombinedLocalAndExportSymbolFlags(r);return 32&o?e.getDeclarationOfKind(r,225)?"local class":"class":384&o?"enum":524288&o?"type":64&o?"interface":262144&o?"type parameter":8&o?"enum member":2097152&o?"alias":1536&o?"module":a}function i(t,r,n){var i=t.getRootSymbols(r);if(1===i.length&&8192&e.first(i).flags&&0!==t.getTypeOfSymbolAtLocation(r,n).getNonNullableType().getCallSignatures().length)return "method";if(t.isUndefinedSymbol(r))return "var";if(t.isArgumentsSymbol(r))return "local var";if(108===n.kind&&e.isExpression(n))return "parameter";var a=e.getCombinedLocalAndExportSymbolFlags(r);if(3&a)return e.isFirstDeclarationOfSymbolParameter(r)?"parameter":r.valueDeclaration&&e.isVarConst(r.valueDeclaration)?"const":e.forEach(r.declarations,e.isLet)?"let":o(r)?"local var":"var";if(16&a)return o(r)?"local function":"function";if(32768&a)return "getter";if(65536&a)return "setter";if(8192&a)return "method";if(16384&a)return "constructor";if(4&a){if(33554432&a&&6&r.checkFlags)return e.forEach(t.getRootSymbols(r),(function(e){if(98311&e.getFlags())return "property"}))||(t.getTypeOfSymbolAtLocation(r,n).getCallSignatures().length?"method":"property");switch(n.parent&&n.parent.kind){case 279:case 277:case 278:return 79===n.kind?"property":"JSX attribute";case 284:return "JSX attribute";default:return "property"}}return ""}function a(t){if(t.declarations&&t.declarations.length){var r=t.declarations,n=r[0],i=r.slice(1),a=e.length(i)&&e.isDeprecatedDeclaration(n)&&e.some(i,(function(t){return !e.isDeprecatedDeclaration(t)}))?8192:0,o=e.getNodeModifiers(n,a);if(o)return o.split(",")}return []}function o(t){return !t.parent&&e.forEach(t.declarations,(function(t){if(212===t.kind)return !0;if(253!==t.kind&&255!==t.kind)return !1;for(var r=t.parent;!e.isFunctionBlock(r);r=r.parent)if(303===r.kind||261===r.kind)return !1;return !0}))}t.getSymbolKind=n,t.getSymbolModifiers=function(t,r){if(!r)return "";var n=new e.Set(a(r));if(2097152&r.flags){var i=t.getAliasedSymbol(r);i!==r&&e.forEach(a(i),(function(e){n.add(e);}));}return 16777216&r.flags&&n.add("optional"),n.size>0?e.arrayFrom(n.values()).join(","):""},t.getSymbolDisplayPartsDocumentationAndSymbolKind=function t(a,o,s,c,l,u,_){var d;void 0===u&&(u=e.getMeaningFromLocation(l));var p,f,g,m,y=[],v=[],h=[],b=e.getCombinedLocalAndExportSymbolFlags(o),x=1&u?i(a,o,l):"",D=!1,S=108===l.kind&&e.isInExpressionContext(l),T=!1;if(108===l.kind&&!S)return {displayParts:[e.keywordPart(108)],documentation:[],symbolKind:"primitive type",tags:void 0};if(""!==x||32&b||2097152&b){"getter"!==x&&"setter"!==x||(x="property");var C=void 0;if(p=S?a.getTypeAtLocation(l):a.getTypeOfSymbolAtLocation(o,l),l.parent&&205===l.parent.kind){var E=l.parent.name;(E===l||E&&0===E.getFullWidth())&&(l=l.parent);}var k=void 0;if(e.isCallOrNewExpression(l)?k=l:(e.isCallExpressionTarget(l)||e.isNewExpressionTarget(l)||l.parent&&(e.isJsxOpeningLikeElement(l.parent)||e.isTaggedTemplateExpression(l.parent))&&e.isFunctionLike(o.valueDeclaration))&&(k=l.parent),k){C=a.getResolvedSignature(k);var N=208===k.kind||e.isCallExpression(k)&&106===k.expression.kind,F=N?p.getConstructSignatures():p.getCallSignatures();if(!C||e.contains(F,C.target)||e.contains(F,C)||(C=F.length?F[0]:void 0),C){switch(N&&32&b?(x="constructor",Y(p.symbol,x)):2097152&b?(Z(x="alias"),y.push(e.spacePart()),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),X(o)):Y(o,x),x){case"JSX attribute":case"property":case"var":case"const":case"let":case"parameter":case"local var":y.push(e.punctuationPart(58)),y.push(e.spacePart()),16&e.getObjectFlags(p)||!p.symbol||(e.addRange(y,e.symbolToDisplayParts(a,p.symbol,c,void 0,5)),y.push(e.lineBreakPart())),N&&(4&C.flags&&(y.push(e.keywordPart(126)),y.push(e.spacePart())),y.push(e.keywordPart(103)),y.push(e.spacePart())),$(C,F,262144);break;default:$(C,F);}D=!0,T=F.length>1;}}else if(e.isNameOfFunctionDeclaration(l)&&!(98304&b)||134===l.kind&&170===l.parent.kind){var A=l.parent;o.declarations&&e.find(o.declarations,(function(e){return e===(134===l.kind?A.parent:A)}))&&(F=170===A.kind?p.getNonNullableType().getConstructSignatures():p.getNonNullableType().getCallSignatures(),C=a.isImplementationOfOverload(A)?F[0]:a.getSignatureFromDeclaration(A),170===A.kind?(x="constructor",Y(p.symbol,x)):Y(173!==A.kind||2048&p.symbol.flags||4096&p.symbol.flags?o:p.symbol,x),C&&$(C,F),D=!0,T=F.length>1);}}if(32&b&&!D&&!S&&(G(),e.getDeclarationOfKind(o,225)?Z("local class"):y.push(e.keywordPart(84)),y.push(e.spacePart()),X(o),ee(o,s)),64&b&&2&u&&(H(),y.push(e.keywordPart(118)),y.push(e.spacePart()),X(o),ee(o,s)),524288&b&&2&u&&(H(),y.push(e.keywordPart(151)),y.push(e.spacePart()),X(o),ee(o,s),y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),e.addRange(y,e.typeToDisplayParts(a,a.getDeclaredTypeOfSymbol(o),c,8388608))),384&b&&(H(),e.some(o.declarations,(function(t){return e.isEnumDeclaration(t)&&e.isEnumConst(t)}))&&(y.push(e.keywordPart(85)),y.push(e.spacePart())),y.push(e.keywordPart(92)),y.push(e.spacePart()),X(o)),1536&b&&!S){H();var P=(V=e.getDeclarationOfKind(o,260))&&V.name&&79===V.name.kind;y.push(e.keywordPart(P?142:141)),y.push(e.spacePart()),X(o);}if(262144&b&&2&u)if(H(),y.push(e.punctuationPart(20)),y.push(e.textPart("type parameter")),y.push(e.punctuationPart(21)),y.push(e.spacePart()),X(o),o.parent)Q(),X(o.parent,c),ee(o.parent,c);else {var w=e.getDeclarationOfKind(o,162);if(void 0===w)return e.Debug.fail();(V=w.parent)&&(e.isFunctionLikeKind(V.kind)?(Q(),C=a.getSignatureFromDeclaration(V),174===V.kind?(y.push(e.keywordPart(103)),y.push(e.spacePart())):173!==V.kind&&V.name&&X(V.symbol),e.addRange(y,e.signatureToDisplayParts(a,C,s,32))):258===V.kind&&(Q(),y.push(e.keywordPart(151)),y.push(e.spacePart()),X(V.symbol),ee(V.symbol,s)));}if(8&b&&(x="enum member",Y(o,"enum member"),297===(null==(V=null===(d=o.declarations)||void 0===d?void 0:d[0])?void 0:V.kind))){var I=a.getConstantValue(V);void 0!==I&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.displayPart(e.getTextOfConstantValue(I),"number"==typeof I?e.SymbolDisplayPartKind.numericLiteral:e.SymbolDisplayPartKind.stringLiteral)));}if(2097152&o.flags){if(H(),!D){var O=a.getAliasedSymbol(o);if(O!==o&&O.declarations&&O.declarations.length>0){var M=O.declarations[0],L=e.getNameOfDeclaration(M);if(L){var R=e.isModuleWithStringLiteralName(M)&&e.hasSyntacticModifier(M,2),B="default"!==o.name&&!R,j=t(a,O,e.getSourceFileOfNode(M),M,L,u,B?o:O);y.push.apply(y,j.displayParts),y.push(e.lineBreakPart()),g=j.documentation,m=j.tags;}else g=O.getContextualDocumentationComment(M,a),m=O.getJsDocTags(a);}}if(o.declarations)switch(o.declarations[0].kind){case 263:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(142));break;case 270:y.push(e.keywordPart(93)),y.push(e.spacePart()),y.push(e.keywordPart(o.declarations[0].isExportEquals?63:88));break;case 274:y.push(e.keywordPart(93));break;default:y.push(e.keywordPart(100));}y.push(e.spacePart()),X(o),e.forEach(o.declarations,(function(t){if(264===t.kind){var r=t;if(e.isExternalModuleImportEqualsDeclaration(r))y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),y.push(e.keywordPart(145)),y.push(e.punctuationPart(20)),y.push(e.displayPart(e.getTextOfNode(e.getExternalModuleImportEqualsDeclarationExpression(r)),e.SymbolDisplayPartKind.stringLiteral)),y.push(e.punctuationPart(21));else {var n=a.getSymbolAtLocation(r.moduleReference);n&&(y.push(e.spacePart()),y.push(e.operatorPart(63)),y.push(e.spacePart()),X(n,c));}return !0}}));}if(!D)if(""!==x){if(p)if(S?(H(),y.push(e.keywordPart(108))):Y(o,x),"property"===x||"JSX attribute"===x||3&b||"local var"===x||S){if(y.push(e.punctuationPart(58)),y.push(e.spacePart()),p.symbol&&262144&p.symbol.flags){var J=e.mapToDisplayParts((function(t){var n=a.typeParameterToDeclaration(p,c,r);W().writeNode(4,n,e.getSourceFileOfNode(e.getParseTreeNode(c)),t);}));e.addRange(y,J);}else e.addRange(y,e.typeToDisplayParts(a,p,c));if(o.target&&o.target.tupleLabelDeclaration){var z=o.target.tupleLabelDeclaration;e.Debug.assertNode(z.name,e.isIdentifier),y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.textPart(e.idText(z.name))),y.push(e.punctuationPart(21));}}else (16&b||8192&b||16384&b||131072&b||98304&b||"method"===x)&&(F=p.getNonNullableType().getCallSignatures()).length&&($(F[0],F),T=F.length>1);}else x=n(a,o,l);if(0!==v.length||T||(v=o.getContextualDocumentationComment(c,a)),0===v.length&&4&b&&o.parent&&o.declarations&&e.forEach(o.parent.declarations,(function(e){return 303===e.kind})))for(var U=0,K=o.declarations;U<K.length;U++){var V;if((V=K[U]).parent&&220===V.parent.kind){var q=a.getSymbolAtLocation(V.parent.right);if(q&&(v=q.getDocumentationComment(a),h=q.getJsDocTags(a),v.length>0))break}}return 0!==h.length||T||(h=o.getJsDocTags(a)),0===v.length&&g&&(v=g),0===h.length&&m&&(h=m),{displayParts:y,documentation:v,symbolKind:x,tags:0===h.length?void 0:h};function W(){return f||(f=e.createPrinter({removeComments:!0})),f}function H(){y.length&&y.push(e.lineBreakPart()),G();}function G(){_&&(Z("alias"),y.push(e.spacePart()));}function Q(){y.push(e.spacePart()),y.push(e.keywordPart(101)),y.push(e.spacePart());}function X(t,r){_&&t===o&&(t=_);var n=e.symbolToDisplayParts(a,t,r||s,void 0,7);e.addRange(y,n),16777216&o.flags&&y.push(e.punctuationPart(57));}function Y(t,r){H(),r&&(Z(r),t&&!e.some(t.declarations,(function(t){return e.isArrowFunction(t)||(e.isFunctionExpression(t)||e.isClassExpression(t))&&!t.name}))&&(y.push(e.spacePart()),X(t)));}function Z(t){switch(t){case"var":case"function":case"let":case"const":case"constructor":return void y.push(e.textOrKeywordPart(t));default:return y.push(e.punctuationPart(20)),y.push(e.textOrKeywordPart(t)),void y.push(e.punctuationPart(21))}}function $(t,r,n){void 0===n&&(n=0),e.addRange(y,e.signatureToDisplayParts(a,t,c,32|n)),r.length>1&&(y.push(e.spacePart()),y.push(e.punctuationPart(20)),y.push(e.operatorPart(39)),y.push(e.displayPart((r.length-1).toString(),e.SymbolDisplayPartKind.numericLiteral)),y.push(e.spacePart()),y.push(e.textPart(2===r.length?"overload":"overloads")),y.push(e.punctuationPart(21))),v=t.getDocumentationComment(a),h=t.getJsDocTags(),r.length>1&&0===v.length&&0===h.length&&(v=r[0].getDocumentationComment(a),h=r[0].getJsDocTags());}function ee(t,n){var i=e.mapToDisplayParts((function(i){var o=a.symbolToTypeParameterDeclarations(t,n,r);W().writeList(53776,o,e.getSourceFileOfNode(e.getParseTreeNode(n)),i);}));e.addRange(y,i);}};}(e.SymbolDisplay||(e.SymbolDisplay={}));}(t),function(e){function t(t,r){var i=[],a=r.compilerOptions?n(r.compilerOptions,i):{},o=e.getDefaultCompilerOptions();for(var s in o)e.hasProperty(o,s)&&void 0===a[s]&&(a[s]=o[s]);for(var c=0,l=e.transpileOptionValueCompilerOptions;c<l.length;c++){var u=l[c];a[u.name]=u.transpileOptionValue;}a.suppressOutputPathCheck=!0,a.allowNonTsExtensions=!0;var _=r.fileName||(r.compilerOptions&&r.compilerOptions.jsx?"module.tsx":"module.ts"),d=e.createSourceFile(_,t,e.getEmitScriptTarget(a));r.moduleName&&(d.moduleName=r.moduleName),r.renamedDependencies&&(d.renamedDependencies=new e.Map(e.getEntries(r.renamedDependencies)));var p,f,g=e.getNewLineCharacter(a),m={getSourceFile:function(t){return t===e.normalizePath(_)?d:void 0},writeFile:function(t,r){e.fileExtensionIs(t,".map")?(e.Debug.assertEqual(f,void 0,"Unexpected multiple source map outputs, file:",t),f=r):(e.Debug.assertEqual(p,void 0,"Unexpected multiple outputs, file:",t),p=r);},getDefaultLibFileName:function(){return "lib.d.ts"},useCaseSensitiveFileNames:function(){return !1},getCanonicalFileName:function(e){return e},getCurrentDirectory:function(){return ""},getNewLine:function(){return g},fileExists:function(e){return e===_},readFile:function(){return ""},directoryExists:function(){return !0},getDirectories:function(){return []}},y=e.createProgram([_],a,m);return r.reportDiagnostics&&(e.addRange(i,y.getSyntacticDiagnostics(d)),e.addRange(i,y.getOptionsDiagnostics())),y.emit(void 0,void 0,void 0,void 0,r.transformers),void 0===p?e.Debug.fail("Output generation failed"):{outputText:p,diagnostics:i,sourceMapText:f}}var r;function n(t,n){r=r||e.filter(e.optionDeclarations,(function(t){return "object"==typeof t.type&&!e.forEachEntry(t.type,(function(e){return "number"!=typeof e}))})),t=e.cloneCompilerOptions(t);for(var i=function(r){if(!e.hasProperty(t,r.name))return "continue";var i=t[r.name];e.isString(i)?t[r.name]=e.parseCustomTypeOption(r,i,n):e.forEachEntry(r.type,(function(e){return e===i}))||n.push(e.createCompilerDiagnosticForInvalidCustomType(r));},a=0,o=r;a<o.length;a++)i(o[a]);return t}e.transpileModule=t,e.transpile=function(r,n,i,a,o){var s=t(r,{compilerOptions:n,fileName:i,reportDiagnostics:!!a,moduleName:o});return e.addRange(a,s.diagnostics),s.outputText},e.fixupCompilerOptions=n;}(t),function(e){!function(t){var r;(r=t.FormattingRequestKind||(t.FormattingRequestKind={}))[r.FormatDocument=0]="FormatDocument",r[r.FormatSelection=1]="FormatSelection",r[r.FormatOnEnter=2]="FormatOnEnter",r[r.FormatOnSemicolon=3]="FormatOnSemicolon",r[r.FormatOnOpeningCurlyBrace=4]="FormatOnOpeningCurlyBrace",r[r.FormatOnClosingCurlyBrace=5]="FormatOnClosingCurlyBrace";var n=function(){function t(e,t,r){this.sourceFile=e,this.formattingRequestKind=t,this.options=r;}return t.prototype.updateContext=function(t,r,n,i,a){this.currentTokenSpan=e.Debug.checkDefined(t),this.currentTokenParent=e.Debug.checkDefined(r),this.nextTokenSpan=e.Debug.checkDefined(n),this.nextTokenParent=e.Debug.checkDefined(i),this.contextNode=e.Debug.checkDefined(a),this.contextNodeAllOnSameLine=void 0,this.nextNodeAllOnSameLine=void 0,this.tokensAreOnSameLine=void 0,this.contextNodeBlockIsOnOneLine=void 0,this.nextNodeBlockIsOnOneLine=void 0;},t.prototype.ContextNodeAllOnSameLine=function(){return void 0===this.contextNodeAllOnSameLine&&(this.contextNodeAllOnSameLine=this.NodeIsOnOneLine(this.contextNode)),this.contextNodeAllOnSameLine},t.prototype.NextNodeAllOnSameLine=function(){return void 0===this.nextNodeAllOnSameLine&&(this.nextNodeAllOnSameLine=this.NodeIsOnOneLine(this.nextTokenParent)),this.nextNodeAllOnSameLine},t.prototype.TokensAreOnSameLine=function(){if(void 0===this.tokensAreOnSameLine){var e=this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line,t=this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line;this.tokensAreOnSameLine=e===t;}return this.tokensAreOnSameLine},t.prototype.ContextNodeBlockIsOnOneLine=function(){return void 0===this.contextNodeBlockIsOnOneLine&&(this.contextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.contextNode)),this.contextNodeBlockIsOnOneLine},t.prototype.NextNodeBlockIsOnOneLine=function(){return void 0===this.nextNodeBlockIsOnOneLine&&(this.nextNodeBlockIsOnOneLine=this.BlockIsOnOneLine(this.nextTokenParent)),this.nextNodeBlockIsOnOneLine},t.prototype.NodeIsOnOneLine=function(e){return this.sourceFile.getLineAndCharacterOfPosition(e.getStart(this.sourceFile)).line===this.sourceFile.getLineAndCharacterOfPosition(e.getEnd()).line},t.prototype.BlockIsOnOneLine=function(t){var r=e.findChildOfKind(t,18,this.sourceFile),n=e.findChildOfKind(t,19,this.sourceFile);return !(!r||!n)&&this.sourceFile.getLineAndCharacterOfPosition(r.getEnd()).line===this.sourceFile.getLineAndCharacterOfPosition(n.getStart(this.sourceFile)).line},t}();t.FormattingContext=n;}(e.formatting||(e.formatting={}));}(t),function(e){var t,r,n,i;t=e.formatting||(e.formatting={}),n=e.createScanner(99,!1,0),i=e.createScanner(99,!1,1),function(e){e[e.Scan=0]="Scan",e[e.RescanGreaterThanToken=1]="RescanGreaterThanToken",e[e.RescanSlashToken=2]="RescanSlashToken",e[e.RescanTemplateToken=3]="RescanTemplateToken",e[e.RescanJsxIdentifier=4]="RescanJsxIdentifier",e[e.RescanJsxText=5]="RescanJsxText",e[e.RescanJsxAttributeValue=6]="RescanJsxAttributeValue";}(r||(r={})),t.getFormattingScanner=function(r,a,o,s,c){var l=1===a?i:n;l.setText(r),l.setTextPos(o);var u,_,d,p,f,g=!0,m=c({advance:function(){f=void 0,l.getStartPos()!==o?g=!!_&&4===e.last(_).kind:l.scan(),u=void 0,_=void 0;for(var t=l.getStartPos();t<s;){var r=l.getToken();if(!e.isTrivia(r))break;l.scan();var n={pos:t,end:l.getStartPos(),kind:r};t=l.getStartPos(),u=e.append(u,n);}d=l.getStartPos();},readTokenInfo:function(r){e.Debug.assert(y());var n,i=function(e){switch(e.kind){case 33:case 71:case 72:case 49:case 48:return !0}return !1}(r)?1:13===r.kind?2:function(e){return 16===e.kind||17===e.kind}(r)?3:function(t){if(t.parent)switch(t.parent.kind){case 284:case 279:case 280:case 278:return e.isKeyword(t.kind)||79===t.kind}return !1}(r)?4:(n=r,e.isJsxText(n)?5:function(t){return t.parent&&e.isJsxAttribute(t.parent)&&t.parent.initializer===t}(r)?6:0);if(f&&i===p)return h(f,r);l.getStartPos()!==d&&(e.Debug.assert(void 0!==f),l.setTextPos(d),l.scan());var a=function(t,r){var n,i=l.getToken();switch(p=0,r){case 1:if(31===i){p=1;var a=l.reScanGreaterToken();return e.Debug.assert(t.kind===a),a}break;case 2:if(43===(n=i)||68===n)return p=2,a=l.reScanSlashToken(),e.Debug.assert(t.kind===a),a;break;case 3:if(19===i)return p=3,l.reScanTemplateToken(!1);break;case 4:return p=4,l.scanJsxIdentifier();case 5:return p=5,l.reScanJsxToken(!1);case 6:return p=6,l.reScanJsxAttributeValue();case 0:break;default:e.Debug.assertNever(r);}return i}(r,i),o=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);for(_&&(_=void 0);l.getStartPos()<s&&(a=l.scan(),e.isTrivia(a));){var c=t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),a);if(_||(_=[]),_.push(c),4===a){l.scan();break}}return h(f={leadingTrivia:u,trailingTrivia:_,token:o},r)},readEOFTokenRange:function(){return e.Debug.assert(v()),t.createTextRangeWithKind(l.getStartPos(),l.getTextPos(),1)},isOnToken:y,isOnEOF:v,getCurrentLeadingTrivia:function(){return u},lastTrailingTriviaWasNewLine:function(){return g},skipToEndOf:function(e){l.setTextPos(e.end),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;},skipToStartOf:function(e){l.setTextPos(e.pos),d=l.getStartPos(),p=void 0,f=void 0,g=!1,u=void 0,_=void 0;}});return f=void 0,l.setText(void 0),m;function y(){var t=f?f.token.kind:l.getToken();return (f?f.token.pos:l.getStartPos())<s&&1!==t&&!e.isTrivia(t)}function v(){return 1===(f?f.token.kind:l.getToken())}function h(t,r){return e.isToken(r)&&t.token.kind!==r.kind&&(t.token.kind=r.kind),t}};}(t),function(e){var t,r,n;(t=e.formatting||(e.formatting={})).anyContext=e.emptyArray,(n=t.RuleAction||(t.RuleAction={}))[n.StopProcessingSpaceActions=1]="StopProcessingSpaceActions",n[n.StopProcessingTokenActions=2]="StopProcessingTokenActions",n[n.InsertSpace=4]="InsertSpace",n[n.InsertNewLine=8]="InsertNewLine",n[n.DeleteSpace=16]="DeleteSpace",n[n.DeleteToken=32]="DeleteToken",n[n.InsertTrailingSemicolon=64]="InsertTrailingSemicolon",n[n.StopAction=3]="StopAction",n[n.ModifySpaceAction=28]="ModifySpaceAction",n[n.ModifyTokenAction=96]="ModifyTokenAction",(r=t.RuleFlags||(t.RuleFlags={}))[r.None=0]="None",r[r.CanDeleteNewLines=1]="CanDeleteNewLines";}(t),function(e){!function(t){function r(e,t,r,n,i,o){return void 0===o&&(o=0),{leftTokenRange:a(t),rightTokenRange:a(r),rule:{debugName:e,context:n,action:i,flags:o}}}function i(e){return {tokens:e,isSpecific:!0}}function a(t){return "number"==typeof t?i([t]):e.isArray(t)?i(t):t}function o(t,r,n){void 0===n&&(n=[]);for(var a=[],o=t;o<=r;o++)e.contains(n,o)||a.push(o);return i(a)}function s(e,t){return function(r){return r.options&&r.options[e]===t}}function c(e){return function(t){return t.options&&t.options.hasOwnProperty(e)&&!!t.options[e]}}function l(e){return function(t){return t.options&&t.options.hasOwnProperty(e)&&!t.options[e]}}function u(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!t.options[e]}}function _(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!t.options[e]||t.TokensAreOnSameLine()}}function d(e){return function(t){return !t.options||!t.options.hasOwnProperty(e)||!!t.options[e]}}function p(e){return 241===e.contextNode.kind}function f(e){return !p(e)}function g(e){switch(e.contextNode.kind){case 220:return 27!==e.contextNode.operatorToken.kind;case 221:case 188:case 228:case 274:case 269:case 176:case 186:case 187:return !0;case 202:case 258:case 264:case 270:case 253:case 163:case 297:case 166:case 165:return 63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 242:case 162:return 101===e.currentTokenSpan.kind||101===e.nextTokenSpan.kind||63===e.currentTokenSpan.kind||63===e.nextTokenSpan.kind;case 243:return 159===e.currentTokenSpan.kind||159===e.nextTokenSpan.kind}return !1}function m(e){return !g(e)}function y(e){return !v(e)}function v(t){var r=t.contextNode.kind;return 166===r||165===r||163===r||253===r||e.isFunctionLikeKind(r)}function h(e){return 221===e.contextNode.kind||188===e.contextNode.kind}function b(e){return e.TokensAreOnSameLine()||C(e)}function x(e){return 200===e.contextNode.kind||194===e.contextNode.kind||function(e){return T(e)&&(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}(e)}function D(e){return C(e)&&!(e.NextNodeAllOnSameLine()||e.NextNodeBlockIsOnOneLine())}function S(e){return T(e)&&!(e.ContextNodeAllOnSameLine()||e.ContextNodeBlockIsOnOneLine())}function T(e){return E(e.contextNode)}function C(e){return E(e.nextTokenParent)}function E(e){if(P(e))return !0;switch(e.kind){case 234:case 262:case 204:case 261:return !0}return !1}function k(e){switch(e.contextNode.kind){case 255:case 168:case 167:case 171:case 172:case 173:case 212:case 170:case 213:case 257:return !0}return !1}function N(e){return !k(e)}function F(e){return 255===e.contextNode.kind||212===e.contextNode.kind}function A(e){return P(e.contextNode)}function P(e){switch(e.kind){case 256:case 225:case 257:case 259:case 181:case 260:case 271:case 272:case 265:case 268:return !0}return !1}function w(e){switch(e.currentTokenParent.kind){case 256:case 260:case 259:case 291:case 261:case 248:return !0;case 234:var t=e.currentTokenParent.parent;if(!t||213!==t.kind&&212!==t.kind)return !0}return !1}function I(e){switch(e.contextNode.kind){case 238:case 248:case 241:case 242:case 243:case 240:case 251:case 239:case 247:case 291:return !0;default:return !1}}function O(e){return 204===e.contextNode.kind}function M(e){return function(e){return 207===e.contextNode.kind}(e)||function(e){return 208===e.contextNode.kind}(e)}function L(e){return 27!==e.currentTokenSpan.kind}function R(e){return 23!==e.nextTokenSpan.kind}function B(e){return 21!==e.nextTokenSpan.kind}function j(e){return 213===e.contextNode.kind}function J(e){return 199===e.contextNode.kind}function z(e){return e.TokensAreOnSameLine()&&11!==e.contextNode.kind}function U(e){return 11!==e.contextNode.kind}function K(e){return 277!==e.contextNode.kind&&281!==e.contextNode.kind}function V(e){return 287===e.contextNode.kind||286===e.contextNode.kind}function q(e){return 284===e.nextTokenParent.kind}function W(e){return 284===e.contextNode.kind}function H(e){return 278===e.contextNode.kind}function G(e){return !k(e)&&!C(e)}function Q(e){return e.TokensAreOnSameLine()&&!!e.contextNode.decorators&&X(e.currentTokenParent)&&!X(e.nextTokenParent)}function X(t){for(;e.isExpressionNode(t);)t=t.parent;return 164===t.kind}function Y(e){return 254===e.currentTokenParent.kind&&e.currentTokenParent.getStart(e.sourceFile)===e.currentTokenSpan.pos}function Z(e){return 2!==e.formattingRequestKind}function $(e){return 260===e.contextNode.kind}function ee(e){return 181===e.contextNode.kind}function te(e){return 174===e.contextNode.kind}function re(e,t){if(29!==e.kind&&31!==e.kind)return !1;switch(t.kind){case 177:case 210:case 258:case 256:case 225:case 257:case 255:case 212:case 213:case 168:case 167:case 173:case 174:case 207:case 208:case 227:return !0;default:return !1}}function ne(e){return re(e.currentTokenSpan,e.currentTokenParent)||re(e.nextTokenSpan,e.nextTokenParent)}function ie(e){return 210===e.contextNode.kind}function ae(e){return 114===e.currentTokenSpan.kind&&216===e.currentTokenParent.kind}function oe(e){return 223===e.contextNode.kind&&void 0!==e.contextNode.expression}function se(e){return 229===e.contextNode.kind}function ce(e){return !function(e){switch(e.contextNode.kind){case 238:case 241:case 242:case 243:case 239:case 240:return !0;default:return !1}}(e)}function le(t){var r=t.nextTokenSpan.kind,n=t.nextTokenSpan.pos;if(e.isTrivia(r)){var i=t.nextTokenParent===t.currentTokenParent?e.findNextToken(t.currentTokenParent,e.findAncestor(t.currentTokenParent,(function(e){return !e.parent})),t.sourceFile):t.nextTokenParent.getFirstToken(t.sourceFile);if(!i)return !0;r=i.kind,n=i.getStart(t.sourceFile);}return t.sourceFile.getLineAndCharacterOfPosition(t.currentTokenSpan.pos).line===t.sourceFile.getLineAndCharacterOfPosition(n).line?19===r||1===r:233!==r&&26!==r&&(257===t.contextNode.kind||258===t.contextNode.kind?!e.isPropertySignature(t.currentTokenParent)||!!t.currentTokenParent.type||20!==r:e.isPropertyDeclaration(t.currentTokenParent)?!t.currentTokenParent.initializer:241!==t.currentTokenParent.kind&&235!==t.currentTokenParent.kind&&233!==t.currentTokenParent.kind&&22!==r&&20!==r&&39!==r&&40!==r&&43!==r&&13!==r&&27!==r&&222!==r&&15!==r&&14!==r&&24!==r)}function ue(t){return e.positionIsASICandidate(t.currentTokenSpan.end,t.currentTokenParent,t.sourceFile)}t.getAllRules=function(){for(var a=[],T=0;T<=159;T++)1!==T&&a.push(T);function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return {tokens:a.filter((function(t){return !e.some((function(e){return e===t}))})),isSpecific:!1}}var P={tokens:a,isSpecific:!1},X=i(n$3(n$3([],a,!0),[3],!1)),re=i(n$3(n$3([],a,!0),[1],!1)),_e=o(81,159),de=o(29,78),pe=[101,102,159,127,139],fe=n$3([79],e.typeKeywords,!0),ge=X,me=i([79,3,84,93,100]),ye=i([21,3,90,111,96,91]),ve=[r("IgnoreBeforeComment",P,[2,3],t.anyContext,1),r("IgnoreAfterLineComment",2,P,t.anyContext,1),r("NotSpaceBeforeColon",P,58,[z,m,y],16),r("SpaceAfterColon",58,P,[z,m],4),r("NoSpaceBeforeQuestionMark",P,57,[z,m,y],16),r("SpaceAfterQuestionMarkInConditionalOperator",57,P,[z,h],4),r("NoSpaceAfterQuestionMark",57,P,[z],16),r("NoSpaceBeforeDot",P,[24,28],[z],16),r("NoSpaceAfterDot",[24,28],P,[z],16),r("NoSpaceBetweenImportParenInImportType",100,20,[z,J],16),r("NoSpaceAfterUnaryPrefixOperator",[45,46,54,53],[8,9,79,20,22,18,108,103],[z,m],16),r("NoSpaceAfterUnaryPreincrementOperator",45,[79,20,108,103],[z],16),r("NoSpaceAfterUnaryPredecrementOperator",46,[79,20,108,103],[z],16),r("NoSpaceBeforeUnaryPostincrementOperator",[79,21,23,103],45,[z,ce],16),r("NoSpaceBeforeUnaryPostdecrementOperator",[79,21,23,103],46,[z,ce],16),r("SpaceAfterPostincrementWhenFollowedByAdd",45,39,[z,g],4),r("SpaceAfterAddWhenFollowedByUnaryPlus",39,39,[z,g],4),r("SpaceAfterAddWhenFollowedByPreincrement",39,45,[z,g],4),r("SpaceAfterPostdecrementWhenFollowedBySubtract",46,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByUnaryMinus",40,40,[z,g],4),r("SpaceAfterSubtractWhenFollowedByPredecrement",40,46,[z,g],4),r("NoSpaceAfterCloseBrace",19,[27,26],[z],16),r("NewLineBeforeCloseBraceInBlockContext",X,19,[S],8),r("SpaceAfterCloseBrace",19,E(21),[z,w],4),r("SpaceBetweenCloseBraceAndElse",19,91,[z],4),r("SpaceBetweenCloseBraceAndWhile",19,115,[z],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("SpaceAfterConditionalClosingParen",21,22,[I],4),r("NoSpaceBetweenFunctionKeywordAndStar",98,41,[F],16),r("SpaceAfterStarInGeneratorDeclaration",41,79,[F],4),r("SpaceAfterFunctionInFuncDecl",98,P,[k],4),r("NewLineAfterOpenBraceInBlockContext",18,P,[S],8),r("SpaceAfterGetSetInMember",[136,148],79,[k],4),r("NoSpaceBetweenYieldKeywordAndStar",125,41,[z,oe],16),r("SpaceBetweenYieldOrYieldStarAndOperand",[125,41],P,[z,oe],4),r("NoSpaceBetweenReturnAndSemicolon",105,26,[z],16),r("SpaceAfterCertainKeywords",[113,109,103,89,105,112,132],P,[z],4),r("SpaceAfterLetConstInVariableDeclaration",[119,85],P,[z,Y],4),r("NoSpaceBeforeOpenParenInFuncCall",P,20,[z,M,L],16),r("SpaceBeforeBinaryKeywordOperator",P,pe,[z,g],4),r("SpaceAfterBinaryKeywordOperator",pe,P,[z,g],4),r("SpaceAfterVoidOperator",114,P,[z,ae],4),r("SpaceBetweenAsyncAndOpenParen",131,20,[j,z],4),r("SpaceBetweenAsyncAndFunctionKeyword",131,[98,79],[z],4),r("NoSpaceBetweenTagAndTemplateString",[79,21],[14,15],[z],16),r("SpaceBeforeJsxAttribute",P,79,[q,z],4),r("SpaceBeforeSlashInJsxOpeningElement",P,43,[H,z],4),r("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement",43,31,[H,z],16),r("NoSpaceBeforeEqualInJsxAttribute",P,63,[W,z],16),r("NoSpaceAfterEqualInJsxAttribute",63,P,[W,z],16),r("NoSpaceAfterModuleImport",[141,145],20,[z],16),r("SpaceAfterCertainTypeScriptKeywords",[126,84,135,88,92,93,94,136,117,100,118,141,142,121,123,122,144,148,124,151,155,140,137],P,[z],4),r("SpaceBeforeCertainTypeScriptKeywords",P,[94,117,155],[z],4),r("SpaceAfterModuleName",10,18,[$],4),r("SpaceBeforeArrow",P,38,[z],4),r("SpaceAfterArrow",38,P,[z],4),r("NoSpaceAfterEllipsis",25,79,[z],16),r("NoSpaceAfterOptionalParameters",57,[21,27],[z,m],16),r("NoSpaceBetweenEmptyInterfaceBraceBrackets",18,19,[z,ee],16),r("NoSpaceBeforeOpenAngularBracket",fe,29,[z,ne],16),r("NoSpaceBetweenCloseParenAndAngularBracket",21,29,[z,ne],16),r("NoSpaceAfterOpenAngularBracket",29,P,[z,ne],16),r("NoSpaceBeforeCloseAngularBracket",P,31,[z,ne],16),r("NoSpaceAfterCloseAngularBracket",31,[20,22,31,27],[z,ne,N],16),r("SpaceBeforeAt",[21,79],59,[z],4),r("NoSpaceAfterAt",59,P,[z],16),r("SpaceAfterDecorator",P,[126,79,93,88,84,124,123,121,122,136,148,22,41],[Q],4),r("NoSpaceBeforeNonNullAssertionOperator",P,53,[z,se],16),r("NoSpaceAfterNewKeywordOnConstructorSignature",103,20,[z,te],16),r("SpaceLessThanAndNonJSXTypeAnnotation",29,29,[z],4)],he=[r("SpaceAfterConstructor",134,20,[c("insertSpaceAfterConstructor"),z],4),r("NoSpaceAfterConstructor",134,20,[u("insertSpaceAfterConstructor"),z],16),r("SpaceAfterComma",27,P,[c("insertSpaceAfterCommaDelimiter"),z,K,R,B],4),r("NoSpaceAfterComma",27,P,[u("insertSpaceAfterCommaDelimiter"),z,K],16),r("SpaceAfterAnonymousFunctionKeyword",[98,41],20,[c("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],4),r("NoSpaceAfterAnonymousFunctionKeyword",[98,41],20,[u("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),k],16),r("SpaceAfterKeywordInControl",_e,20,[c("insertSpaceAfterKeywordsInControlFlowStatements"),I],4),r("NoSpaceAfterKeywordInControl",_e,20,[u("insertSpaceAfterKeywordsInControlFlowStatements"),I],16),r("SpaceAfterOpenParen",20,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBeforeCloseParen",P,21,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("SpaceBetweenOpenParens",20,20,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],4),r("NoSpaceBetweenParens",20,21,[z],16),r("NoSpaceAfterOpenParen",20,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("NoSpaceBeforeCloseParen",P,21,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),z],16),r("SpaceAfterOpenBracket",22,P,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("SpaceBeforeCloseBracket",P,23,[c("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],4),r("NoSpaceBetweenBrackets",22,23,[z],16),r("NoSpaceAfterOpenBracket",22,P,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("NoSpaceBeforeCloseBracket",P,23,[u("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),z],16),r("SpaceAfterOpenBrace",18,P,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("SpaceBeforeCloseBrace",P,19,[d("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),x],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[z,O],16),r("NoSpaceAfterOpenBrace",18,P,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("NoSpaceBeforeCloseBrace",P,19,[l("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),z],16),r("SpaceBetweenEmptyBraceBrackets",18,19,[c("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces")],4),r("NoSpaceBetweenEmptyBraceBrackets",18,19,[l("insertSpaceAfterOpeningAndBeforeClosingEmptyBraces"),z],16),r("SpaceAfterTemplateHeadAndMiddle",[15,16],P,[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],4,1),r("SpaceBeforeTemplateMiddleAndTail",P,[16,17],[c("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],4),r("NoSpaceAfterTemplateHeadAndMiddle",[15,16],P,[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),U],16,1),r("NoSpaceBeforeTemplateMiddleAndTail",P,[16,17],[u("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),z],16),r("SpaceAfterOpenBraceInJsxExpression",18,P,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("SpaceBeforeCloseBraceInJsxExpression",P,19,[c("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],4),r("NoSpaceAfterOpenBraceInJsxExpression",18,P,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("NoSpaceBeforeCloseBraceInJsxExpression",P,19,[u("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),z,V],16),r("SpaceAfterSemicolonInFor",26,P,[c("insertSpaceAfterSemicolonInForStatements"),z,p],4),r("NoSpaceAfterSemicolonInFor",26,P,[u("insertSpaceAfterSemicolonInForStatements"),z,p],16),r("SpaceBeforeBinaryOperator",P,de,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("SpaceAfterBinaryOperator",de,P,[c("insertSpaceBeforeAndAfterBinaryOperators"),z,g],4),r("NoSpaceBeforeBinaryOperator",P,de,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("NoSpaceAfterBinaryOperator",de,P,[u("insertSpaceBeforeAndAfterBinaryOperators"),z,g],16),r("SpaceBeforeOpenParenInFuncDecl",P,20,[c("insertSpaceBeforeFunctionParenthesis"),z,k],4),r("NoSpaceBeforeOpenParenInFuncDecl",P,20,[u("insertSpaceBeforeFunctionParenthesis"),z,k],16),r("NewLineBeforeOpenBraceInControl",ye,18,[c("placeOpenBraceOnNewLineForControlBlocks"),I,D],8,1),r("NewLineBeforeOpenBraceInFunction",ge,18,[c("placeOpenBraceOnNewLineForFunctions"),k,D],8,1),r("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock",me,18,[c("placeOpenBraceOnNewLineForFunctions"),A,D],8,1),r("SpaceAfterTypeAssertion",31,P,[c("insertSpaceAfterTypeAssertion"),z,ie],4),r("NoSpaceAfterTypeAssertion",31,P,[u("insertSpaceAfterTypeAssertion"),z,ie],16),r("SpaceBeforeTypeAnnotation",P,[57,58],[c("insertSpaceBeforeTypeAnnotation"),z,v],4),r("NoSpaceBeforeTypeAnnotation",P,[57,58],[u("insertSpaceBeforeTypeAnnotation"),z,v],16),r("NoOptionalSemicolon",26,re,[s("semicolons",e.SemicolonPreference.Remove),le],32),r("OptionalSemicolon",P,re,[s("semicolons",e.SemicolonPreference.Insert),ue],64)],be=[r("NoSpaceBeforeSemicolon",P,26,[z],16),r("SpaceBeforeOpenBraceInControl",ye,18,[_("placeOpenBraceOnNewLineForControlBlocks"),I,Z,b],4,1),r("SpaceBeforeOpenBraceInFunction",ge,18,[_("placeOpenBraceOnNewLineForFunctions"),k,C,Z,b],4,1),r("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock",me,18,[_("placeOpenBraceOnNewLineForFunctions"),A,Z,b],4,1),r("NoSpaceBeforeComma",P,27,[z],16),r("NoSpaceBeforeOpenBracket",E(131,82),22,[z],16),r("NoSpaceAfterCloseBracket",23,P,[z,G],16),r("SpaceAfterSemicolon",26,P,[z],4),r("SpaceBetweenForAndAwaitKeyword",97,132,[z],4),r("SpaceBetweenStatements",[21,90,91,82],P,[z,K,f],4),r("SpaceAfterTryCatchFinally",[111,83,96],18,[z],4)];return n$3(n$3(n$3([],ve,!0),he,!0),be,!0)};}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r;function n(e){var t=0;return 1&e&&(t|=28),2&e&&(t|=96),28&e&&(t|=28),96&e&&(t|=96),t}function i(t,r){return e.Debug.assert(t<=159&&r<=159,"Must compute formatting context from tokens"),t*o+r}t.getFormatContext=function(a,c){return {options:a,getRules:(void 0===r&&(l=t.getAllRules(),u=function(e){for(var t=new Array(o*o),r=new Array(t.length),n=0,a=e;n<a.length;n++)for(var c=a[n],l=c.leftTokenRange.isSpecific&&c.rightTokenRange.isSpecific,u=0,_=c.leftTokenRange.tokens;u<_.length;u++)for(var d=_[u],p=0,f=c.rightTokenRange.tokens;p<f.length;p++){var g=i(d,f[p]),m=t[g];void 0===m&&(m=t[g]=[]),s(m,c.rule,l,r,g);}return t}(l),r=function(t){var r=u[i(t.currentTokenSpan.kind,t.nextTokenSpan.kind)];if(r){for(var a=[],o=0,s=0,c=r;s<c.length;s++){var l=c[s],_=~n(o);l.action&_&&e.every(l.context,(function(e){return e(t)}))&&(a.push(l),o|=l.action);}if(a.length)return a}}),r),host:c};var l,u;};var a,o=160;function s(r,n,i,o,s){var c,l,u,_=3&n.action?i?a.StopRulesSpecific:a.StopRulesAny:n.context!==t.anyContext?i?a.ContextRulesSpecific:a.ContextRulesAny:i?a.NoContextRulesSpecific:a.NoContextRulesAny,d=o[s]||0;r.splice(function(e,t){for(var r=0,n=0;n<=t;n+=5)r+=31&e,e>>=5;return r}(d,_),0,n),o[s]=(u=1+((c=d)>>(l=_)&31),e.Debug.assert((31&u)===u,"Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."),c&~(31<<l)|u<<l);}!function(e){e[e.StopRulesSpecific=0]="StopRulesSpecific",e[e.StopRulesAny=5]="StopRulesAny",e[e.ContextRulesSpecific=10]="ContextRulesSpecific",e[e.ContextRulesAny=15]="ContextRulesAny",e[e.NoContextRulesSpecific=20]="NoContextRulesSpecific",e[e.NoContextRulesAny=25]="NoContextRulesAny";}(a||(a={}));}(e.formatting||(e.formatting={}));}(t),function(e){!function(t){var r,n,i,a,o;function s(t,r,n){var i=e.findPrecedingToken(t,n);return i&&i.kind===r&&t===i.getEnd()?i:void 0}function c(e){for(var t=e;t&&t.parent&&t.parent.end===e.end&&!l(t.parent,t);)t=t.parent;return t}function l(t,r){switch(t.kind){case 256:case 257:return e.rangeContainsRange(t.members,r);case 260:var n=t.body;return !!n&&261===n.kind&&e.rangeContainsRange(n.statements,r);case 303:case 234:case 261:return e.rangeContainsRange(t.statements,r);case 291:return e.rangeContainsRange(t.block.statements,r)}return !1}function u(t,r,n,i){return t?_({pos:e.getLineStartPositionForPosition(t.getStart(r),r),end:t.end},r,n,i):[]}function _(r,n,i,a){var o=function(t,r){return function n(i){var a=e.forEachChild(i,(function(n){return e.startEndContainsRange(n.getStart(r),n.end,t)&&n}));if(a){var o=n(a);if(o)return o}return i}(r)}(r,n);return t.getFormattingScanner(n.text,n.languageVariant,function(t,r,n){var i=t.getStart(n);if(i===r.pos&&t.end===r.end)return i;var a=e.findPrecedingToken(r.pos,n);return a?a.end>=r.pos?t.pos:a.end:t.pos}(o,r,n),r.end,(function(s){return d(r,o,t.SmartIndenter.getIndentationForNode(o,r,n,i.options),function(e,r,n){for(var i,a=-1;e;){var o=n.getLineAndCharacterOfPosition(e.getStart(n)).line;if(-1!==a&&o!==a)break;if(t.SmartIndenter.shouldIndentChildNode(r,e,i,n))return r.indentSize;a=o,i=e,e=e.parent;}return 0}(o,i.options,n),s,i,a,function(t,r){if(!t.length)return a;var n=t.filter((function(t){return e.rangeOverlapsWithStartEnd(r,t.start,t.start+t.length)})).sort((function(e,t){return e.start-t.start}));if(!n.length)return a;var i=0;return function(t){for(;;){if(i>=n.length)return !1;var r=n[i];if(t.end<=r.start)return !1;if(e.startEndOverlapsWithStartEnd(t.pos,t.end,r.start,r.start+r.length))return !0;i++;}};function a(){return !1}}(n.parseDiagnostics,r),n)}))}function d(r,n,i,a,o,s,c,l,u){var _,d,f,g,m=s.options,y=s.getRules,v=s.host,h=new t.FormattingContext(u,c,m),b=-1,x=[];if(o.advance(),o.isOnToken()){var D=u.getLineAndCharacterOfPosition(n.getStart(u)).line,S=D;n.decorators&&(S=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(n,u)).line),function n(i,a,s,c,p,y){if(e.rangeOverlapsWithStartEnd(r,i.getStart(u),i.getEnd())){var v=E(i,s,p,y),h=a;for(e.forEachChild(i,(function(e){S(e,-1,i,v,s,c,!1);}),(function(r){!function(r,n,a,s){e.Debug.assert(e.isNodeArray(r));var c=function(e,t){switch(e.kind){case 170:case 255:case 212:case 168:case 167:case 213:if(e.typeParameters===t)return 29;if(e.parameters===t)return 20;break;case 207:case 208:if(e.typeArguments===t)return 29;if(e.arguments===t)return 20;break;case 177:if(e.typeArguments===t)return 29;break;case 181:return 18}return 0}(n,r),l=s,_=a;if(0!==c)for(;o.isOnToken()&&!((v=o.readTokenInfo(n)).token.end>r.pos);)if(v.token.kind===c){_=u.getLineAndCharacterOfPosition(v.token.pos).line,T(v,n,s,n);var d=void 0;if(-1!==b)d=b;else {var p=e.getLineStartPositionForPosition(v.token.pos,u);d=t.SmartIndenter.findFirstNonWhitespaceColumn(p,v.token.pos,u,m);}l=E(n,a,d,m.indentSize);}else T(v,n,s,n);for(var f=-1,g=0;g<r.length;g++)f=S(r[g],f,i,l,_,_,!0,0===g);var y=function(e){switch(e){case 20:return 21;case 29:return 31;case 18:return 19}return 0}(c);if(0!==y&&o.isOnToken()){var v;27===(v=o.readTokenInfo(n)).token.kind&&e.isCallLikeExpression(n)&&_!==u.getLineAndCharacterOfPosition(v.token.pos).line&&(o.advance(),v=o.isOnToken()?o.readTokenInfo(n):void 0),v&&v.token.kind===y&&e.rangeContainsRange(n,v.token)&&T(v,n,l,n,!0);}}(r,i,s,v);}));o.isOnToken();){var x=o.readTokenInfo(i);if(x.token.end>i.end)break;T(x,i,v,i);}if(!i.parent&&o.isOnEOF()){var D=o.readEOFTokenRange();D.end<=i.end&&_&&A(D,u.getLineAndCharacterOfPosition(D.pos).line,i,_,f,d,a,v);}}function S(a,s,c,l,_,d,p,f){var y=a.getStart(u),v=u.getLineAndCharacterOfPosition(y).line,x=v;a.decorators&&(x=u.getLineAndCharacterOfPosition(e.getNonDecoratorTokenPosOfNode(a,u)).line);var D=-1;if(p&&e.rangeContainsRange(r,c)&&-1!==(D=function(r,n,i,a,o){if(e.rangeOverlapsWithStartEnd(a,r,n)||e.rangeContainsStartEnd(a,r,n)){if(-1!==o)return o}else {var s=u.getLineAndCharacterOfPosition(r).line,c=e.getLineStartPositionForPosition(r,u),l=t.SmartIndenter.findFirstNonWhitespaceColumn(c,r,u,m);if(s!==i||r===l){var _=t.SmartIndenter.getBaseIndentation(m);return _>l?_:l}}return -1}(y,a.end,_,r,s))&&(s=D),!e.rangeOverlapsWithStartEnd(r,a.pos,a.end))return a.end<r.pos&&o.skipToEndOf(a),s;if(0===a.getFullWidth())return s;for(;o.isOnToken();){if((S=o.readTokenInfo(i)).token.end>y){S.token.pos>y&&o.skipToStartOf(a);break}T(S,i,l,i);}if(!o.isOnToken())return s;if(e.isToken(a)){var S=o.readTokenInfo(a);if(11!==a.kind)return e.Debug.assert(S.token.end===a.end,"Token end is child end"),T(S,i,l,a),s}var C=164===a.kind?v:d,E=function(e,r,n,i,a,o){var s=t.SmartIndenter.shouldIndentChildNode(m,e)?m.indentSize:0;return o===r?{indentation:r===g?b:a.getIndentation(),delta:Math.min(m.indentSize,a.getDelta(e)+s)}:-1===n?20===e.kind&&r===g?{indentation:b,delta:a.getDelta(e)}:t.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(i,e,r,u)||t.SmartIndenter.childIsUnindentedBranchOfConditionalExpression(i,e,r,u)||t.SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(i,e,r,u)?{indentation:a.getIndentation(),delta:s}:{indentation:a.getIndentation()+a.getDelta(e),delta:s}:{indentation:n,delta:s}}(a,v,D,i,l,C);return n(a,h,v,x,E.indentation,E.delta),h=i,f&&203===c.kind&&-1===s&&(s=E.indentation),s}function T(t,n,i,a,s){e.Debug.assert(e.rangeContainsRange(n,t.token));var c=o.lastTrailingTriviaWasNewLine(),d=!1;t.leadingTrivia&&N(t.leadingTrivia,n,h,i);var p=0,f=e.rangeContainsRange(r,t.token),m=u.getLineAndCharacterOfPosition(t.token.pos);if(f){var y=l(t.token),v=_;if(p=F(t.token,m,n,h,i),!y)if(0===p){var x=v&&u.getLineAndCharacterOfPosition(v.end).line;d=c&&m.line!==x;}else d=1===p;}if(t.trailingTrivia&&N(t.trailingTrivia,n,h,i),d){var D=f&&!l(t.token)?i.getIndentationForToken(m.line,t.token.kind,a,!!s):-1,S=!0;if(t.leadingTrivia){var T=i.getIndentationForComment(t.token.kind,D,a);S=k(t.leadingTrivia,T,S,(function(e){return P(e.pos,T,!1)}));}-1!==D&&S&&(P(t.token.pos,D,1===p),g=m.line,b=D);}o.advance(),h=n;}}(n,n,D,S,i,a);}if(!o.isOnToken()){var T=t.SmartIndenter.nodeWillIndentChild(m,n,void 0,u,!1)?i+m.indentSize:i,C=o.getCurrentLeadingTrivia();C&&(k(C,T,!1,(function(e){return F(e,u.getLineAndCharacterOfPosition(e.pos),n,n,void 0)})),!1!==m.trimTrailingWhitespace&&function(t){for(var n=_?_.end:r.pos,i=0,a=t;i<a.length;i++){var o=a[i];e.isComment(o.kind)&&(n<o.pos&&M(n,o.pos-1,_),n=o.end+1);}n<r.end&&M(n,r.end,_);}(C));}return x;function E(r,n,i,a){return {getIndentationForComment:function(e,t,r){switch(e){case 19:case 23:case 21:return i+o(r)}return -1!==t?t:i},getIndentationForToken:function(t,a,s,c){return !c&&function(t,i,a){switch(i){case 18:case 19:case 21:case 91:case 115:case 59:return !1;case 43:case 31:switch(a.kind){case 279:case 280:case 278:case 227:return !1}break;case 22:case 23:if(194!==a.kind)return !1}return n!==t&&!(r.decorators&&i===function(t){if(t.modifiers&&t.modifiers.length)return t.modifiers[0].kind;switch(t.kind){case 256:return 84;case 257:return 118;case 255:return 98;case 259:return 259;case 171:return 136;case 172:return 148;case 168:if(t.asteriskToken)return 41;case 166:case 163:var r=e.getNameOfDeclaration(t);if(r)return r.kind}}(r))}(t,a,s)?i+o(s):i},getIndentation:function(){return i},getDelta:o,recomputeIndentation:function(e,n){t.SmartIndenter.shouldIndentChildNode(m,n,r,u)&&(i+=e?m.indentSize:-m.indentSize,a=t.SmartIndenter.shouldIndentChildNode(m,r)?m.indentSize:0);}};function o(e){return t.SmartIndenter.nodeWillIndentChild(m,r,e,u,!0)?a:0}}function k(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o],l=e.rangeContainsRange(r,c);switch(c.kind){case 3:l&&w(c,n,!i),i=!1;break;case 2:i&&l&&a(c),i=!1;break;case 4:i=!0;}}return i}function N(t,n,i,a){for(var o=0,s=t;o<s.length;o++){var c=s[o];e.isComment(c.kind)&&e.rangeContainsRange(r,c)&&F(c,u.getLineAndCharacterOfPosition(c.pos),n,i,a);}}function F(e,t,n,i,a){var o=0;return l(e)||(_?o=A(e,t.line,n,_,f,d,i,a):I(u.getLineAndCharacterOfPosition(r.pos).line,t.line)),_=e,d=n,f=t.line,o}function A(t,r,n,i,a,o,s,c){h.updateContext(i,o,t,n,s);var l=y(h),_=!1!==h.options.trimTrailingWhitespace,d=0;return l?e.forEachRight(l,(function(o){switch(d=function(t,r,n,i,a){var o,s=a!==n;switch(t.action){case 1:return 0;case 16:if(r.end!==i.pos)return L(r.end,i.pos-r.end),s?2:0;break;case 32:L(r.pos,r.end-r.pos);break;case 8:if(1!==t.flags&&n!==a)return 0;if(1!=a-n)return R(r.end,i.pos-r.end,e.getNewLineOrDefaultFromHost(v,m)),s?0:1;break;case 4:if(1!==t.flags&&n!==a)return 0;if(1!=i.pos-r.end||32!==u.text.charCodeAt(r.end))return R(r.end,i.pos-r.end," "),s?2:0;break;case 64:o=r.end,x.push(e.createTextChangeFromStartLength(o,0,";"));}return 0}(o,i,a,t,r)){case 2:n.getStart(u)===t.pos&&c.recomputeIndentation(!1,s);break;case 1:n.getStart(u)===t.pos&&c.recomputeIndentation(!0,s);break;default:e.Debug.assert(0===d);}_=_&&!(16&o.action)&&1!==o.flags;})):_=_&&1!==t.kind,r!==a&&_&&I(a,r,i),d}function P(t,r,n){var i=p(r,m);if(n)R(t,0,i);else {var a=u.getLineAndCharacterOfPosition(t),o=e.getStartPositionOfLine(a.line,u);(r!==function(e,t){for(var r=0,n=0;n<t;n++)9===u.text.charCodeAt(e+n)?r+=m.tabSize-r%m.tabSize:r++;return r}(o,a.character)||function(e,t){return e!==u.text.substr(t,e.length)}(i,o))&&R(o,a.character,i);}}function w(r,n,i,a){void 0===a&&(a=!0);var o=u.getLineAndCharacterOfPosition(r.pos).line,s=u.getLineAndCharacterOfPosition(r.end).line;if(o!==s){for(var c=[],l=r.pos,_=o;_<s;_++){var d=e.getEndLinePosition(_,u);c.push({pos:l,end:d}),l=e.getStartPositionOfLine(_+1,u);}if(a&&c.push({pos:l,end:r.end}),0!==c.length){var f=e.getStartPositionOfLine(o,u),g=t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(f,c[0].pos,u,m),y=0;i&&(y=1,o++);for(var v=n-g.column,h=y;h<c.length;h++,o++){var b=e.getStartPositionOfLine(o,u),x=0===h?g:t.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(c[h].pos,c[h].end,u,m),D=x.column+v;if(D>0){var S=p(D,m);R(b,x.character,S);}else L(b,x.character);}}}else i||P(r.pos,n,!1);}function I(t,r,n){for(var i=t;i<r;i++){var a=e.getStartPositionOfLine(i,u),o=e.getEndLinePosition(i,u);if(!(n&&(e.isComment(n.kind)||e.isStringOrRegularExpressionOrTemplateLiteral(n.kind))&&n.pos<=o&&n.end>o)){var s=O(a,o);-1!==s&&(e.Debug.assert(s===a||!e.isWhiteSpaceSingleLine(u.text.charCodeAt(s-1))),L(s,o+1-s));}}}function O(t,r){for(var n=r;n>=t&&e.isWhiteSpaceSingleLine(u.text.charCodeAt(n));)n--;return n!==r?n+1:-1}function M(e,t,r){I(u.getLineAndCharacterOfPosition(e).line,u.getLineAndCharacterOfPosition(t).line+1,r);}function L(t,r){r&&x.push(e.createTextChangeFromStartLength(t,r,""));}function R(t,r,n){(r||n)&&x.push(e.createTextChangeFromStartLength(t,r,n));}}function p(t,r){if((!i||i.tabSize!==r.tabSize||i.indentSize!==r.indentSize)&&(i={tabSize:r.tabSize,indentSize:r.indentSize},a=o=void 0),r.convertTabsToSpaces){var n=void 0,s=Math.floor(t/r.indentSize),c=t%r.indentSize;return o||(o=[]),void 0===o[s]?(n=e.repeatString(" ",r.indentSize*s),o[s]=n):n=o[s],c?n+e.repeatString(" ",c):n}var l=Math.floor(t/r.tabSize),u=t-l*r.tabSize,_=void 0;return a||(a=[]),void 0===a[l]?a[l]=_=e.repeatString("\t",l):_=a[l],u?_+e.repeatString(" ",u):_}t.createTextRangeWithKind=function(t,r,n){var i={pos:t,end:r,kind:n};return e.Debug.isDebugging&&Object.defineProperty(i,"__debugKind",{get:function(){return e.Debug.formatSyntaxKind(n)}}),i},function(e){e[e.Unknown=-1]="Unknown";}(r||(r={})),t.formatOnEnter=function(t,r,n){var i=r.getLineAndCharacterOfPosition(t).line;if(0===i)return [];for(var a=e.getEndLinePosition(i,r);e.isWhiteSpaceSingleLine(r.text.charCodeAt(a));)a--;return e.isLineBreak(r.text.charCodeAt(a))&&a--,_({pos:e.getStartPositionOfLine(i-1,r),end:a+1},r,n,2)},t.formatOnSemicolon=function(e,t,r){return u(c(s(e,26,t)),t,r,3)},t.formatOnOpeningCurly=function(t,r,n){var i=s(t,18,r);if(!i)return [];var a=c(i.parent);return _({pos:e.getLineStartPositionForPosition(a.getStart(r),r),end:t},r,n,4)},t.formatOnClosingCurly=function(e,t,r){return u(c(s(e,19,t)),t,r,5)},t.formatDocument=function(e,t){return _({pos:0,end:e.text.length},e,t,0)},t.formatSelection=function(t,r,n,i){return _({pos:e.getLineStartPositionForPosition(t,n),end:r},n,i,1)},t.formatNodeGivenIndentation=function(e,r,n,i,a,o){var s={pos:0,end:r.text.length};return t.getFormattingScanner(r.text,n,s.pos,s.end,(function(t){return d(s,e,i,a,t,o,1,(function(e){return !1}),r)}))},function(e){e[e.None=0]="None",e[e.LineAdded=1]="LineAdded",e[e.LineRemoved=2]="LineRemoved";}(n||(n={})),t.getRangeOfEnclosingComment=function(t,r,n,i){void 0===i&&(i=e.getTokenAtPosition(t,r));var a=e.findAncestor(i,e.isJSDoc);if(a&&(i=a.parent),!(i.getStart(t)<=r&&r<i.getEnd())){var o=(n=null===n?void 0:void 0===n?e.findPrecedingToken(r,t):n)&&e.getTrailingCommentRanges(t.text,n.end),s=e.getLeadingCommentRangesOfNode(i,t),c=e.concatenate(o,s);return c&&e.find(c,(function(n){return e.rangeContainsPositionExclusive(n,r)||r===n.end&&(2===n.kind||r===t.getFullWidth())}))}},t.getIndentationString=p;}(e.formatting||(e.formatting={}));}(t),function(e){var t;(function(r){var n,i;function a(e){return e.baseIndentSize||0}function o(e,t,r,n,i,o,l){for(var f,g=e.parent;g;){var y=!0;if(r){var v=e.getStart(i);y=v<r.pos||v>r.end;}var h=s(g,e,i),b=h.line===t.line||d(g,e,t.line,i);if(y){var x=null===(f=p(e,i))||void 0===f?void 0:f[0],S=m(e,i,l,!!x&&u(x,i).line>h.line);if(-1!==S)return S+n;if(-1!==(S=c(e,g,t,b,i,l)))return S+n}D(l,g,e,i,o)&&!b&&(n+=l.indentSize);var T=_(g,e,t.line,i);g=(e=g).parent,t=T?i.getLineAndCharacterOfPosition(e.getStart(i)):h;}return n+a(l)}function s(e,t,r){var n=p(t,r),i=n?n.pos:e.getStart(r);return r.getLineAndCharacterOfPosition(i)}function c(t,r,n,i,a,o){return !e.isDeclaration(t)&&!e.isStatementButNotDeclaration(t)||303!==r.kind&&i?-1:v(n,a,o)}function l(t,r,n,i){var a=e.findNextToken(t,r,i);return a?18===a.kind?1:19===a.kind&&n===u(a,i).line?2:0:0}function u(e,t){return t.getLineAndCharacterOfPosition(e.getStart(t))}function _(t,r,n,i){if(!e.isCallExpression(t)||!e.contains(t.arguments,r))return !1;var a=t.expression.getEnd();return e.getLineAndCharacterOfPosition(i,a).line===n}function d(t,r,n,i){if(238===t.kind&&t.elseStatement===r){var a=e.findChildOfKind(t,91,i);return e.Debug.assert(void 0!==a),u(a,i).line===n}return !1}function p(e,t){return e.parent&&f(e.getStart(t),e.getEnd(),e.parent,t)}function f(t,r,n,i){switch(n.kind){case 177:return a(n.typeArguments);case 204:return a(n.properties);case 203:return a(n.elements);case 181:return a(n.members);case 255:case 212:case 213:case 168:case 167:case 173:case 170:case 179:case 174:return a(n.typeParameters)||a(n.parameters);case 256:case 225:case 257:case 258:case 342:return a(n.typeParameters);case 208:case 207:return a(n.typeArguments)||a(n.arguments);case 254:return a(n.declarations);case 268:case 272:return a(n.elements);case 200:case 201:return a(n.elements)}function a(a){return a&&e.rangeContainsStartEnd(function(e,t,r){for(var n=e.getChildren(r),i=1;i<n.length-1;i++)if(n[i].pos===t.pos&&n[i].end===t.end)return {pos:n[i-1].end,end:n[i+1].getStart(r)};return t}(n,a,i),t,r)?a:void 0}}function g(e,t,r){return e?v(t.getLineAndCharacterOfPosition(e.pos),t,r):-1}function m(e,t,r,n){if(e.parent&&254===e.parent.kind)return -1;var i=p(e,t);if(i){var a=i.indexOf(e);if(-1!==a){var o=y(i,a,t,r);if(-1!==o)return o}return g(i,t,r)+(n?r.indentSize:0)}return -1}function y(t,r,n,i){e.Debug.assert(r>=0&&r<t.length);for(var a=u(t[r],n),o=r-1;o>=0;o--)if(27!==t[o].kind){if(n.getLineAndCharacterOfPosition(t[o].end).line!==a.line)return v(a,n,i);a=u(t[o],n);}return -1}function v(e,t,r){var n=t.getPositionOfLineAndCharacter(e.line,0);return b(n,n+e.character,t,r)}function h(t,r,n,i){for(var a=0,o=0,s=t;s<r;s++){var c=n.text.charCodeAt(s);if(!e.isWhiteSpaceSingleLine(c))break;9===c?o+=i.tabSize+o%i.tabSize:o++,a++;}return {column:o,character:a}}function b(e,t,r,n){return h(e,t,r,n).column}function x(t,r,n,i,a){var o=n?n.kind:0;switch(r.kind){case 237:case 256:case 225:case 257:case 259:case 258:case 203:case 234:case 261:case 204:case 181:case 194:case 183:case 262:case 289:case 288:case 211:case 205:case 207:case 208:case 236:case 270:case 246:case 221:case 201:case 200:case 279:case 282:case 278:case 287:case 167:case 173:case 174:case 163:case 178:case 179:case 190:case 209:case 217:case 272:case 268:case 274:case 269:case 166:return !0;case 253:case 294:case 220:if(!t.indentMultiLineObjectLiteralBeginningOnBlankLine&&i&&204===o)return S(i,n);if(220===r.kind&&i&&n&&277===o)return i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,r.pos)).line!==i.getLineAndCharacterOfPosition(e.skipTrivia(i.text,n.pos)).line;if(220!==r.kind)return !0;break;case 239:case 240:case 242:case 243:case 241:case 238:case 255:case 212:case 168:case 170:case 171:case 172:return 234!==o;case 213:return i&&211===o?S(i,n):234!==o;case 271:return 272!==o;case 265:return 266!==o||!!n.namedBindings&&268!==n.namedBindings.kind;case 277:return 280!==o;case 281:return 283!==o;case 187:case 186:if(181===o||183===o)return !1}return a}function D(e,t,r,n,i){return void 0===i&&(i=!1),x(e,t,r,n,!1)&&!(i&&r&&function(e,t){switch(e){case 246:case 250:case 244:case 245:return 234!==t.kind;default:return !1}}(r.kind,t))}function S(t,r){var n=e.skipTrivia(t.text,r.pos);return t.getLineAndCharacterOfPosition(n).line===t.getLineAndCharacterOfPosition(r.end).line}!function(e){e[e.Unknown=-1]="Unknown";}(n||(n={})),r.getIndentation=function(r,n,i,s){if(void 0===s&&(s=!1),r>n.text.length)return a(i);if(i.indentStyle===e.IndentStyle.None)return 0;var c=e.findPrecedingToken(r,n,void 0,!0),_=t.getRangeOfEnclosingComment(n,r,c||null);if(_&&3===_.kind)return function(t,r,n,i){var a=e.getLineAndCharacterOfPosition(t,r).line-1,o=e.getLineAndCharacterOfPosition(t,i.pos).line;if(e.Debug.assert(o>=0),a<=o)return b(e.getStartPositionOfLine(o,t),r,t,n);var s=e.getStartPositionOfLine(a,t),c=h(s,r,t,n),l=c.column,u=c.character;return 0===l?l:42===t.text.charCodeAt(s+u)?l-1:l}(n,r,i,_);if(!c)return a(i);if(e.isStringOrRegularExpressionOrTemplateLiteral(c.kind)&&c.getStart(n)<=r&&r<c.end)return 0;var d=n.getLineAndCharacterOfPosition(r).line;if(i.indentStyle===e.IndentStyle.Block)return function(t,r,n){for(var i=r;i>0;){var a=t.text.charCodeAt(i);if(!e.isWhiteSpaceLike(a))break;i--;}return b(e.getLineStartPositionForPosition(i,t),i,t,n)}(n,r,i);if(27===c.kind&&220!==c.parent.kind){var p=function(t,r,n){var i=e.findListItemInfo(t);return i&&i.listItemIndex>0?y(i.list.getChildren(),i.listItemIndex-1,r,n):-1}(c,n,i);if(-1!==p)return p}var v=function(e,t,r){return t&&f(e,e,t,r)}(r,c.parent,n);return v&&!e.rangeContainsRange(v,c)?g(v,n,i)+i.indentSize:function(t,r,n,i,s,c){for(var _,d=n;d;){if(e.positionBelongsToNode(d,r,t)&&D(c,d,_,t,!0)){var p=u(d,t),f=l(n,d,i,t);return o(d,p,void 0,0!==f?s&&2===f?c.indentSize:0:i!==p.line?c.indentSize:0,t,!0,c)}var g=m(d,t,c,!0);if(-1!==g)return g;_=d,d=d.parent;}return a(c)}(n,r,c,d,s,i)},r.getIndentationForNode=function(e,t,r,n){var i=r.getLineAndCharacterOfPosition(e.getStart(r));return o(e,i,t,0,r,!1,n)},r.getBaseIndentation=a,function(e){e[e.Unknown=0]="Unknown",e[e.OpenBrace=1]="OpenBrace",e[e.CloseBrace=2]="CloseBrace";}(i||(i={})),r.isArgumentAndStartLineOverlapsExpressionBeingCalled=_,r.childStartsOnTheSameLineWithElseInIfStatement=d,r.childIsUnindentedBranchOfConditionalExpression=function(t,r,n,i){if(e.isConditionalExpression(t)&&(r===t.whenTrue||r===t.whenFalse)){var a=e.getLineAndCharacterOfPosition(i,t.condition.end).line;if(r===t.whenTrue)return n===a;var o=u(t.whenTrue,i).line,s=e.getLineAndCharacterOfPosition(i,t.whenTrue.end).line;return a===o&&s===n}return !1},r.argumentStartsOnSameLineAsPreviousArgument=function(t,r,n,i){if(e.isCallOrNewExpression(t)){if(!t.arguments)return !1;var a=e.find(t.arguments,(function(e){return e.pos===r.pos}));if(!a)return !1;var o=t.arguments.indexOf(a);if(0===o)return !1;var s=t.arguments[o-1];if(n===e.getLineAndCharacterOfPosition(i,s.getEnd()).line)return !0}return !1},r.getContainingList=p,r.findFirstNonWhitespaceCharacterAndColumn=h,r.findFirstNonWhitespaceColumn=b,r.nodeWillIndentChild=x,r.shouldIndentChildNode=D;})((t=e.formatting||(e.formatting={})).SmartIndenter||(t.SmartIndenter={}));}(t),function(e){!function(t){function r(t){var r=t.__pos;return e.Debug.assert("number"==typeof r),r}function a(t,r){e.Debug.assert("number"==typeof r),t.__pos=r;}function o(t){var r=t.__end;return e.Debug.assert("number"==typeof r),r}function s(t,r){e.Debug.assert("number"==typeof r),t.__end=r;}var c,l;function u(t,r){return e.skipTrivia(t,r,!1,!0)}!function(e){e[e.Exclude=0]="Exclude",e[e.IncludeAll=1]="IncludeAll",e[e.JSDoc=2]="JSDoc",e[e.StartLine=3]="StartLine";}(c=t.LeadingTriviaOption||(t.LeadingTriviaOption={})),function(e){e[e.Exclude=0]="Exclude",e[e.ExcludeWhitespace=1]="ExcludeWhitespace",e[e.Include=2]="Include";}(l=t.TrailingTriviaOption||(t.TrailingTriviaOption={}));var _,d={leadingTriviaOption:c.Exclude,trailingTriviaOption:l.Exclude};function p(e,t,r,n){return {pos:f(e,t,n),end:m(e,r,n)}}function f(t,r,n,i){var a,o;void 0===i&&(i=!1);var s=n.leadingTriviaOption;if(s===c.Exclude)return r.getStart(t);if(s===c.StartLine){var l=r.getStart(t),_=e.getLineStartPositionForPosition(l,t);return e.rangeContainsPosition(r,_)?_:l}if(s===c.JSDoc){var d=e.getJSDocCommentRanges(r,t.text);if(null==d?void 0:d.length)return e.getLineStartPositionForPosition(d[0].pos,t)}var p=r.getFullStart(),f=r.getStart(t);if(p===f)return f;var g=e.getLineStartPositionForPosition(p,t);if(e.getLineStartPositionForPosition(f,t)===g)return s===c.IncludeAll?p:f;if(i){var m=(null===(a=e.getLeadingCommentRanges(t.text,p))||void 0===a?void 0:a[0])||(null===(o=e.getTrailingCommentRanges(t.text,p))||void 0===o?void 0:o[0]);if(m)return e.skipTrivia(t.text,m.end,!0,!0)}var y=p>0?1:0,v=e.getStartPositionOfLine(e.getLineOfLocalPosition(t,g)+y,t);return v=u(t.text,v),e.getStartPositionOfLine(e.getLineOfLocalPosition(t,v),t)}function g(t,r,n){var i=r.end;if(n.trailingTriviaOption===l.Include){var a=e.getTrailingCommentRanges(t.text,i);if(a)for(var o=e.getLineOfLocalPosition(t,r.end),s=0,c=a;s<c.length;s++){var u=c[s];if(2===u.kind||e.getLineOfLocalPosition(t,u.pos)>o)break;if(e.getLineOfLocalPosition(t,u.end)>o)return e.skipTrivia(t.text,u.end,!0,!0)}}}function m(t,r,n){var i,a=r.end,o=n.trailingTriviaOption;if(o===l.Exclude)return a;if(o===l.ExcludeWhitespace){var s=e.concatenate(e.getTrailingCommentRanges(t.text,a),e.getLeadingCommentRanges(t.text,a));return (null===(i=null==s?void 0:s[s.length-1])||void 0===i?void 0:i.end)||a}var c=g(t,r,n);if(c)return c;var u=e.skipTrivia(t.text,a,!0);return u===a||o!==l.Include&&!e.isLineBreak(t.text.charCodeAt(u-1))?a:u}function y(e,t){return !!t&&!!e.parent&&(27===t.kind||26===t.kind&&204===e.parent.kind)}!function(e){e[e.Remove=0]="Remove",e[e.ReplaceWithSingleNode=1]="ReplaceWithSingleNode",e[e.ReplaceWithMultipleNodes=2]="ReplaceWithMultipleNodes",e[e.Text=3]="Text";}(_||(_={})),t.isThisTypeAnnotatable=function(t){return e.isFunctionExpression(t)||e.isFunctionDeclaration(t)};var v,h,b=function(){function t(t,r){this.newLineCharacter=t,this.formatContext=r,this.changes=[],this.newFiles=[],this.classesWithNodesInsertedAtStart=new e.Map,this.deletedNodes=[];}return t.fromContext=function(r){return new t(e.getNewLineOrDefaultFromHost(r.host,r.formatContext.options),r.formatContext)},t.with=function(e,r){var n=t.fromContext(e);return r(n),n.getChanges()},t.prototype.pushRaw=function(t,r){e.Debug.assertEqual(t.fileName,r.fileName);for(var n=0,i=r.textChanges;n<i.length;n++){var a=i[n];this.changes.push({kind:_.Text,sourceFile:t,text:a.newText,range:e.createTextRangeFromSpan(a.span)});}},t.prototype.deleteRange=function(e,t){this.changes.push({kind:_.Remove,sourceFile:e,range:t});},t.prototype.delete=function(e,t){this.deletedNodes.push({sourceFile:e,node:t});},t.prototype.deleteNode=function(e,t,r){void 0===r&&(r={leadingTriviaOption:c.IncludeAll}),this.deleteRange(e,p(e,t,t,r));},t.prototype.deleteNodes=function(e,t,r,n){void 0===r&&(r={leadingTriviaOption:c.IncludeAll});for(var i=0,a=t;i<a.length;i++){var o=a[i],s=f(e,o,r,n),l=m(e,o,r);this.deleteRange(e,{pos:s,end:l}),n=!!g(e,o,r);}},t.prototype.deleteModifier=function(t,r){this.deleteRange(t,{pos:r.getStart(t),end:e.skipTrivia(t.text,r.end,!0)});},t.prototype.deleteNodeRange=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=m(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.deleteNodeRangeExcludingEnd=function(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(e,t,n),a=void 0===r?e.text.length:f(e,r,n);this.deleteRange(e,{pos:i,end:a});},t.prototype.replaceRange=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithSingleNode,sourceFile:e,range:t,options:n,node:r});},t.prototype.replaceNode=function(e,t,r,n){void 0===n&&(n=d),this.replaceRange(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeRange=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRange(e,p(e,t,r,i),n,i);},t.prototype.replaceRangeWithNodes=function(e,t,r,n){void 0===n&&(n={}),this.changes.push({kind:_.ReplaceWithMultipleNodes,sourceFile:e,range:t,options:n,nodes:r});},t.prototype.replaceNodeWithNodes=function(e,t,r,n){void 0===n&&(n=d),this.replaceRangeWithNodes(e,p(e,t,t,n),r,n);},t.prototype.replaceNodeWithText=function(e,t,r){this.replaceRangeWithText(e,p(e,t,t,d),r);},t.prototype.replaceNodeRangeWithNodes=function(e,t,r,n,i){void 0===i&&(i=d),this.replaceRangeWithNodes(e,p(e,t,r,i),n,i);},t.prototype.nodeHasTrailingComment=function(e,t,r){return void 0===r&&(r=d),!!g(e,t,r)},t.prototype.nextCommaToken=function(t,r){var n=e.findNextToken(r,r.parent,t);return n&&27===n.kind?n:void 0},t.prototype.replacePropertyAssignment=function(e,t,r){var n=this.nextCommaToken(e,t)?"":","+this.newLineCharacter;this.replaceNode(e,t,r,{suffix:n});},t.prototype.insertNodeAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRange(t,e.createRange(r),n,i);},t.prototype.insertNodesAt=function(t,r,n,i){void 0===i&&(i={}),this.replaceRangeWithNodes(t,e.createRange(r),n,i);},t.prototype.insertNodeAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertNodesAtTopOfFile=function(e,t,r){this.insertAtTopOfFile(e,t,r);},t.prototype.insertAtTopOfFile=function(t,r,n){var i=function(t){for(var r,n=0,i=t.statements;n<i.length;n++){var a=i[n];if(!e.isPrologueDirective(a))break;r=a;}var o=0,s=t.text;if(r)return o=r.end,g(),o;var c=e.getShebang(s);void 0!==c&&(o=c.length,g());var l,u,_=e.getLeadingCommentRanges(s,o);if(!_)return o;for(var d=0,p=_;d<p.length;d++){var f=p[d];if(3===f.kind){if(e.isPinnedComment(s,f.pos)){l={range:f,pinnedOrTripleSlash:!0};continue}}else if(e.isRecognizedTripleSlashComment(s,f.pos,f.end)){l={range:f,pinnedOrTripleSlash:!0};continue}if(l){if(l.pinnedOrTripleSlash)break;if(t.getLineAndCharacterOfPosition(f.pos).line>=t.getLineAndCharacterOfPosition(l.range.end).line+2)break}if(t.statements.length&&(void 0===u&&(u=t.getLineAndCharacterOfPosition(t.statements[0].getStart()).line),u<t.getLineAndCharacterOfPosition(f.end).line+2))break;l={range:f,pinnedOrTripleSlash:!1};}return l&&(o=l.range.end,g()),o;function g(){if(o<s.length){var t=s.charCodeAt(o);e.isLineBreak(t)&&++o<s.length&&13===t&&10===s.charCodeAt(o)&&o++;}}}(t),a={prefix:0===i?void 0:this.newLineCharacter,suffix:(e.isLineBreak(t.text.charCodeAt(i))?"":this.newLineCharacter)+(n?this.newLineCharacter:"")};e.isArray(r)?this.insertNodesAt(t,i,r,a):this.insertNodeAt(t,i,r,a);},t.prototype.insertFirstParameter=function(t,r,n){var i=e.firstOrUndefined(r);i?this.insertNodeBefore(t,i,n):this.insertNodeAt(t,r.pos,n);},t.prototype.insertNodeBefore=function(e,t,r,n,i){void 0===n&&(n=!1),void 0===i&&(i={}),this.insertNodeAt(e,f(e,t,i),r,this.getOptionsForInsertNodeBefore(t,r,n));},t.prototype.insertModifierAt=function(t,r,n,i){void 0===i&&(i={}),this.insertNodeAt(t,r,e.factory.createToken(n),i);},t.prototype.insertModifierBefore=function(e,t,r){return this.insertModifierAt(e,r.getStart(e),t,{suffix:" "})},t.prototype.insertCommentBeforeLine=function(t,r,n,i){var a=e.getStartPositionOfLine(r,t),o=e.getFirstNonSpaceCharacterPosition(t.text,a),s=E(t,o),c=e.getTouchingToken(t,s?o:n),l=t.text.slice(a,o),u="".concat(s?"":this.newLineCharacter,"//").concat(i).concat(this.newLineCharacter).concat(l);this.insertText(t,c.getStart(t),u);},t.prototype.insertJsdocCommentBefore=function(t,r,n){var i=r.getStart(t);if(r.jsDoc)for(var a=0,o=r.jsDoc;a<o.length;a++){var s=o[a];this.deleteRange(t,{pos:e.getLineStartPositionForPosition(s.getStart(t),t),end:m(t,s,{})});}var c=e.getPrecedingNonSpaceCharacterPosition(t.text,i-1),l=t.text.slice(c,i);this.insertNodeAt(t,i,n,{preserveLeadingWhitespace:!1,suffix:this.newLineCharacter+l});},t.prototype.replaceRangeWithText=function(e,t,r){this.changes.push({kind:_.Text,sourceFile:e,range:t,text:r});},t.prototype.insertText=function(t,r,n){this.replaceRangeWithText(t,e.createRange(r),n);},t.prototype.tryInsertTypeAnnotation=function(t,r,n){var i,a;if(e.isFunctionLike(r)){if(!(a=e.findChildOfKind(r,21,t))){if(!e.isArrowFunction(r))return !1;a=e.first(r.parameters);}}else a=null!==(i=253===r.kind?r.exclamationToken:r.questionToken)&&void 0!==i?i:r.name;return this.insertNodeAt(t,a.end,n,{prefix:": "}),!0},t.prototype.tryInsertThisTypeAnnotation=function(t,r,n){var i=e.findChildOfKind(r,20,t).getStart(t)+1,a=r.parameters.length?", ":"";this.insertNodeAt(t,i,n,{prefix:"this: ",suffix:a});},t.prototype.insertTypeParameters=function(t,r,n){var i=(e.findChildOfKind(r,20,t)||e.first(r.parameters)).getStart(t);this.insertNodesAt(t,i,n,{prefix:"<",suffix:">",joiner:", "});},t.prototype.getOptionsForInsertNodeBefore=function(t,r,n){return e.isStatement(t)||e.isClassElement(t)?{suffix:n?this.newLineCharacter+this.newLineCharacter:this.newLineCharacter}:e.isVariableDeclaration(t)?{suffix:", "}:e.isParameter(t)?e.isParameter(r)?{suffix:", "}:{}:e.isStringLiteral(t)&&e.isImportDeclaration(t.parent)||e.isNamedImports(t)?{suffix:", "}:e.isImportSpecifier(t)?{suffix:","+(n?this.newLineCharacter:" ")}:e.Debug.failBadSyntaxKind(t)},t.prototype.insertNodeAtConstructorStart=function(t,r,i){var a=e.firstOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeBefore(t,a,i):this.replaceConstructorBody(t,r,n$3([i],r.body.statements,!0));},t.prototype.insertNodeAtConstructorStartAfterSuperCall=function(t,r,i){var a=e.find(r.body.statements,(function(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)}));a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$3(n$3([],r.body.statements,!0),[i],!1));},t.prototype.insertNodeAtConstructorEnd=function(t,r,i){var a=e.lastOrUndefined(r.body.statements);a&&r.body.multiLine?this.insertNodeAfter(t,a,i):this.replaceConstructorBody(t,r,n$3(n$3([],r.body.statements,!0),[i],!1));},t.prototype.replaceConstructorBody=function(t,r,n){this.replaceNode(t,r.body,e.factory.createBlock(n,!0));},t.prototype.insertNodeAtEndOfScope=function(t,r,n){var i=f(t,r.getLastToken(),{});this.insertNodeAt(t,i,n,{prefix:e.isLineBreak(t.text.charCodeAt(r.getLastToken().pos))?this.newLineCharacter:this.newLineCharacter+this.newLineCharacter,suffix:this.newLineCharacter});},t.prototype.insertNodeAtClassStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtObjectStart=function(e,t,r){this.insertNodeAtStartWorker(e,t,r);},t.prototype.insertNodeAtStartWorker=function(e,t,r){var n,i=null!==(n=this.guessIndentationFromExistingMembers(e,t))&&void 0!==n?n:this.computeIndentationForNewMember(e,t);this.insertNodeAt(e,D(t).pos,r,this.getInsertNodeAtStartInsertOptions(e,t,i));},t.prototype.guessIndentationFromExistingMembers=function(t,r){for(var n,i=r,a=0,o=D(r);a<o.length;a++){var s=o[a];if(e.rangeStartPositionsAreOnSameLine(i,s,t))return;var c=s.getStart(t),l=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(c,t),c,t,this.formatContext.options);if(void 0===n)n=l;else if(l!==n)return;i=s;}return n},t.prototype.computeIndentationForNewMember=function(t,r){var n,i=r.getStart(t);return e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(e.getLineStartPositionForPosition(i,t),i,t,this.formatContext.options)+(null!==(n=this.formatContext.options.indentSize)&&void 0!==n?n:4)},t.prototype.getInsertNodeAtStartInsertOptions=function(t,r,n){var i=0===D(r).length,a=e.addToSeen(this.classesWithNodesInsertedAtStart,e.getNodeId(r),{node:r,sourceFile:t}),o=e.isObjectLiteralExpression(r)&&(!e.isJsonSourceFile(t)||!i);return {indentation:n,prefix:(e.isObjectLiteralExpression(r)&&e.isJsonSourceFile(t)&&i&&!a?",":"")+this.newLineCharacter,suffix:o?",":""}},t.prototype.insertNodeAfterComma=function(e,t,r){var n=this.insertNodeAfterWorker(e,this.nextCommaToken(e,t)||t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAfter=function(e,t,r){var n=this.insertNodeAfterWorker(e,t,r);this.insertNodeAt(e,n,r,this.getInsertNodeAfterOptions(e,t));},t.prototype.insertNodeAtEndOfList=function(e,t,r){this.insertNodeAt(e,t.end,r,{prefix:", "});},t.prototype.insertNodesAfter=function(t,r,n){var i=this.insertNodeAfterWorker(t,r,e.first(n));this.insertNodesAt(t,i,n,this.getInsertNodeAfterOptions(t,r));},t.prototype.insertNodeAfterWorker=function(t,r,n){var i,a;return i=r,a=n,((e.isPropertySignature(i)||e.isPropertyDeclaration(i))&&e.isClassOrTypeElement(a)&&161===a.name.kind||e.isStatementButNotDeclaration(i)&&e.isStatementButNotDeclaration(a))&&59!==t.text.charCodeAt(r.end-1)&&this.replaceRange(t,e.createRange(r.end),e.factory.createToken(26)),m(t,r,{})},t.prototype.getInsertNodeAfterOptions=function(t,r){var n=this.getInsertNodeAfterOptionsWorker(r);return i$1(i$1({},n),{prefix:r.end===t.end&&e.isStatement(r)?n.prefix?"\n".concat(n.prefix):"\n":n.prefix})},t.prototype.getInsertNodeAfterOptionsWorker=function(t){switch(t.kind){case 256:case 260:return {prefix:this.newLineCharacter,suffix:this.newLineCharacter};case 253:case 10:case 79:return {prefix:", "};case 294:return {suffix:","+this.newLineCharacter};case 93:return {prefix:" "};case 163:return {};default:return e.Debug.assert(e.isStatement(t)||e.isClassOrTypeElement(t)),{suffix:this.newLineCharacter}}},t.prototype.insertName=function(t,r,n){if(e.Debug.assert(!r.name),213===r.kind){var i=e.findChildOfKind(r,38,t),a=e.findChildOfKind(r,20,t);a?(this.insertNodesAt(t,a.getStart(t),[e.factory.createToken(98),e.factory.createIdentifier(n)],{joiner:" "}),k(this,t,i)):(this.insertText(t,e.first(r.parameters).getStart(t),"function ".concat(n,"(")),this.replaceRange(t,i,e.factory.createToken(21))),234!==r.body.kind&&(this.insertNodesAt(t,r.body.getStart(t),[e.factory.createToken(18),e.factory.createToken(105)],{joiner:" ",suffix:" "}),this.insertNodesAt(t,r.body.end,[e.factory.createToken(26),e.factory.createToken(19)],{joiner:" "}));}else {var o=e.findChildOfKind(r,212===r.kind?98:84,t).end;this.insertNodeAt(t,o,e.factory.createIdentifier(n),{prefix:" "});}},t.prototype.insertExportModifier=function(e,t){this.insertText(e,t.getStart(e),"export ");},t.prototype.insertNodeInListAfter=function(t,r,n,i){if(void 0===i&&(i=e.formatting.SmartIndenter.getContainingList(r,t)),i){var a=e.indexOfNode(i,r);if(!(a<0)){var o=r.getEnd();if(a!==i.length-1){var s=e.getTokenAtPosition(t,r.end);if(s&&y(r,s)){var c=i[a+1],l=u(t.text,c.getFullStart()),_="".concat(e.tokenToString(s.kind)).concat(t.text.substring(s.end,l));this.insertNodesAt(t,l,[n],{suffix:_});}}else {var d=r.getStart(t),p=e.getLineStartPositionForPosition(d,t),f=void 0,g=!1;if(1===i.length)f=27;else {var m=e.findPrecedingToken(r.pos,t);f=y(r,m)?m.kind:27,g=e.getLineStartPositionForPosition(i[a-1].getStart(t),t)!==p;}if(function(t,r){for(var n=r;n<t.length;){var i=t.charCodeAt(n);if(!e.isWhiteSpaceSingleLine(i))return 47===i;n++;}return !1}(t.text,r.end)&&(g=!0),g){this.replaceRange(t,e.createRange(o),e.factory.createToken(f));for(var v=e.formatting.SmartIndenter.findFirstNonWhitespaceColumn(p,d,t,this.formatContext.options),h=e.skipTrivia(t.text,o,!0,!1);h!==o&&e.isLineBreak(t.text.charCodeAt(h-1));)h--;this.replaceRange(t,e.createRange(h),n,{indentation:v,prefix:this.newLineCharacter});}else this.replaceRange(t,e.createRange(o),n,{prefix:"".concat(e.tokenToString(f)," ")});}}}else e.Debug.fail("node is not a list element");},t.prototype.parenthesizeExpression=function(t,r){this.replaceRange(t,e.rangeOfNode(r),e.factory.createParenthesizedExpression(r));},t.prototype.finishClassesWithNodesInsertedAtStart=function(){var t=this;this.classesWithNodesInsertedAtStart.forEach((function(r){var n=r.node,i=r.sourceFile,a=function(t,r){var n=e.findChildOfKind(t,18,r),i=e.findChildOfKind(t,19,r);return [null==n?void 0:n.end,null==i?void 0:i.end]}(n,i),o=a[0],s=a[1];if(void 0!==o&&void 0!==s){var c=0===D(n).length,l=e.positionsAreOnSameLine(o,s,i);c&&l&&o!==s-1&&t.deleteRange(i,e.createRange(o,s-1)),l&&t.insertText(i,s-1,t.newLineCharacter);}}));},t.prototype.finishDeleteDeclarations=function(){for(var t=this,r=new e.Set,n=function(t,n){i.deletedNodes.some((function(r){return r.sourceFile===t&&e.rangeContainsRangeExclusive(r.node,n)}))||(e.isArray(n)?i.deleteRange(t,e.rangeOfTypeParameters(t,n)):h.deleteDeclaration(i,r,t,n));},i=this,a=0,o=this.deletedNodes;a<o.length;a++){var s=o[a];n(s.sourceFile,s.node);}r.forEach((function(n){var i=n.getSourceFile(),a=e.formatting.SmartIndenter.getContainingList(n,i);if(n===e.last(a)){var o=e.findLastIndex(a,(function(e){return !r.has(e)}),a.length-2);-1!==o&&t.deleteRange(i,{pos:a[o].end,end:x(i,a[o+1])});}}));},t.prototype.getChanges=function(e){this.finishDeleteDeclarations(),this.finishClassesWithNodesInsertedAtStart();for(var t=v.getTextChangesFromChanges(this.changes,this.newLineCharacter,this.formatContext,e),r=0,n=this.newFiles;r<n.length;r++){var i=n[r],a=i.oldFile,o=i.fileName,s=i.statements;t.push(v.newFileChanges(a,o,s,this.newLineCharacter,this.formatContext));}return t},t.prototype.createNewFile=function(e,t,r){this.newFiles.push({oldFile:e,fileName:t,statements:r});},t}();function x(t,r){return e.skipTrivia(t.text,f(t,r,{leadingTriviaOption:c.IncludeAll}),!1,!0)}function D(t){return e.isObjectLiteralExpression(t)?t.properties:t.members}function S(t,r){for(var n=r.length-1;n>=0;n--){var i=r[n],a=i.span,o=i.newText;t="".concat(t.substring(0,a.start)).concat(o).concat(t.substring(e.textSpanEnd(a)));}return t}function T(t){var n=e.visitEachChild(t,T,e.nullTransformationContext,C,T),i=e.nodeIsSynthesized(n)?n:Object.create(n);return e.setTextRangePosEnd(i,r(t),o(t)),i}function C(t,n,i,a,s){var c=e.visitNodes(t,n,i,a,s);if(!c)return c;var l=c===t?e.factory.createNodeArray(c.slice(0)):c;return e.setTextRangePosEnd(l,r(t),o(t)),l}function E(t,r){return !(e.isInComment(t,r)||e.isInString(t,r)||e.isInTemplateString(t,r)||e.isInJSXText(t,r))}function k(e,t,r,n){void 0===n&&(n={leadingTriviaOption:c.IncludeAll});var i=f(t,r,n),a=m(t,r,n);e.deleteRange(t,{pos:i,end:a});}function N(t,r,n,i){var a=e.Debug.checkDefined(e.formatting.SmartIndenter.getContainingList(i,n)),o=e.indexOfNode(a,i);e.Debug.assert(-1!==o),1!==a.length?(e.Debug.assert(!r.has(i),"Deleting a node twice"),r.add(i),t.deleteRange(n,{pos:x(n,i),end:o===a.length-1?m(n,i,{}):x(n,a[o+1])})):k(t,n,i);}t.ChangeTracker=b,t.getNewFileText=function(e,t,r,n){return v.newFileChangesWorker(void 0,t,e,r,n)},function(t){function r(t,r,i,a,o){var s=i.map((function(e){return 4===e?"":n(e,t,a).text})).join(a),c=e.createSourceFile("any file name",s,99,!0,r);return S(s,e.formatting.formatDocument(c,o))+a}function n(t,r,n){var i=function(t){var r=0,n=e.createTextWriter(t);function i(t,i){if(i||!function(t){return e.skipTrivia(t,0)===t.length}(t)){r=n.getTextPos();for(var a=0;e.isWhiteSpaceLike(t.charCodeAt(t.length-a-1));)a++;r-=a;}}return {onBeforeEmitNode:function(e){e&&a(e,r);},onAfterEmitNode:function(e){e&&s(e,r);},onBeforeEmitNodeArray:function(e){e&&a(e,r);},onAfterEmitNodeArray:function(e){e&&s(e,r);},onBeforeEmitToken:function(e){e&&a(e,r);},onAfterEmitToken:function(e){e&&s(e,r);},write:function(e){n.write(e),i(e,!1);},writeComment:function(e){n.writeComment(e);},writeKeyword:function(e){n.writeKeyword(e),i(e,!1);},writeOperator:function(e){n.writeOperator(e),i(e,!1);},writePunctuation:function(e){n.writePunctuation(e),i(e,!1);},writeTrailingSemicolon:function(e){n.writeTrailingSemicolon(e),i(e,!1);},writeParameter:function(e){n.writeParameter(e),i(e,!1);},writeProperty:function(e){n.writeProperty(e),i(e,!1);},writeSpace:function(e){n.writeSpace(e),i(e,!1);},writeStringLiteral:function(e){n.writeStringLiteral(e),i(e,!1);},writeSymbol:function(e,t){n.writeSymbol(e,t),i(e,!1);},writeLine:function(e){n.writeLine(e);},increaseIndent:function(){n.increaseIndent();},decreaseIndent:function(){n.decreaseIndent();},getText:function(){return n.getText()},rawWrite:function(e){n.rawWrite(e),i(e,!1);},writeLiteral:function(e){n.writeLiteral(e),i(e,!0);},getTextPos:function(){return n.getTextPos()},getLine:function(){return n.getLine()},getColumn:function(){return n.getColumn()},getIndent:function(){return n.getIndent()},isAtStartOfLine:function(){return n.isAtStartOfLine()},hasTrailingComment:function(){return n.hasTrailingComment()},hasTrailingWhitespace:function(){return n.hasTrailingWhitespace()},clear:function(){n.clear(),r=0;}}}(n),o=e.getNewLineKind(n);return e.createPrinter({newLine:o,neverAsciiEscape:!0,preserveSourceNewlines:!0,terminateUnterminatedLiterals:!0},i).writeNode(4,t,r,i),{text:i.getText(),node:T(t)}}t.getTextChangesFromChanges=function(t,r,a,o){return e.mapDefined(e.group(t,(function(e){return e.sourceFile.path})),(function(t){for(var s=t[0].sourceFile,c=e.stableSort(t,(function(e,t){return e.range.pos-t.range.pos||e.range.end-t.range.end})),l=function(t){e.Debug.assert(c[t].range.end<=c[t+1].range.pos,"Changes overlap",(function(){return "".concat(JSON.stringify(c[t].range)," and ").concat(JSON.stringify(c[t+1].range))}));},u=0;u<c.length-1;u++)l(u);var d=e.mapDefined(c,(function(t){var c=e.createTextSpanFromRange(t.range),l=function(t,r,a,o,s){var c;if(t.kind===_.Remove)return "";if(t.kind===_.Text)return t.text;var l=t.options,u=void 0===l?{}:l,d=t.range.pos,p=function(t){return function(t,r,a,o,s,c,l){var u=o.indentation,_=o.prefix,d=o.delta,p=n(t,r,s),f=p.node,g=p.text;l&&l(f,g);var m=function(t,r){var n=t.options,a=!n.semicolons||n.semicolons===e.SemicolonPreference.Ignore,o=n.semicolons===e.SemicolonPreference.Remove||a&&!e.probablyUsesSemicolons(r);return i$1(i$1({},n),{semicolons:o?e.SemicolonPreference.Remove:e.SemicolonPreference.Ignore})}(c,r),y=void 0!==u?u:e.formatting.SmartIndenter.getIndentation(a,r,m,_===s||e.getLineStartPositionForPosition(a,r)===a);void 0===d&&(d=e.formatting.SmartIndenter.shouldIndentChildNode(m,t)&&m.indentSize||0);var v={text:g,getLineAndCharacterOfPosition:function(t){return e.getLineAndCharacterOfPosition(this,t)}};return S(g,e.formatting.formatNodeGivenIndentation(f,v,r.languageVariant,y,d,i$1(i$1({},c),{options:m})))}(t,r,d,u,a,o,s)},f=t.kind===_.ReplaceWithMultipleNodes?t.nodes.map((function(t){return e.removeSuffix(p(t),a)})).join((null===(c=t.options)||void 0===c?void 0:c.joiner)||a):p(t.node),g=u.preserveLeadingWhitespace||void 0!==u.indentation||e.getLineStartPositionForPosition(d,r)===d?f:f.replace(/^\s+/,"");return (u.prefix||"")+g+(!u.suffix||e.endsWith(g,u.suffix)?"":u.suffix)}(t,s,r,a,o);if(c.length!==l.length||!e.stringContainsAt(s.text,l,c.start))return e.createTextChange(c,l)}));return d.length>0?{fileName:s.fileName,textChanges:d}:void 0}))},t.newFileChanges=function(t,n,i,a,o){var s=r(t,e.getScriptKindFromFileName(n),i,a,o);return {fileName:n,textChanges:[e.createTextChange(e.createTextSpan(0,0),s)],isNewFile:!0}},t.newFileChangesWorker=r,t.getNonformattedText=n;}(v||(v={})),t.applyChanges=S,t.isValidLocationToAddComment=E,function(t){function r(t,r,n){if(n.parent.name){var i=e.Debug.checkDefined(e.getTokenAtPosition(r,n.pos-1));t.deleteRange(r,{pos:i.getStart(r),end:n.end});}else k(t,r,e.getAncestor(n,265));}t.deleteDeclaration=function(t,n,i,a){switch(a.kind){case 163:var o=a.parent;e.isArrowFunction(o)&&1===o.parameters.length&&!e.findChildOfKind(o,20,i)?t.replaceNodeWithText(i,a,"()"):N(t,n,i,a);break;case 265:case 264:k(t,i,a,{leadingTriviaOption:i.imports.length&&a===e.first(i.imports).parent||a===e.find(i.statements,e.isAnyImportSyntax)?c.Exclude:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;case 202:var s=a.parent;201===s.kind&&a!==e.last(s.elements)?k(t,i,a):N(t,n,i,a);break;case 253:!function(t,r,n,i){var a=i.parent;if(291!==a.kind)if(1===a.declarations.length){var o=a.parent;switch(o.kind){case 243:case 242:t.replaceNode(n,i,e.factory.createObjectLiteralExpression());break;case 241:k(t,n,a);break;case 236:k(t,n,o,{leadingTriviaOption:e.hasJSDocNodes(o)?c.JSDoc:c.StartLine});break;default:e.Debug.assertNever(o);}}else N(t,r,n,i);else t.deleteNodeRange(n,e.findChildOfKind(a,20,n),e.findChildOfKind(a,21,n));}(t,n,i,a);break;case 162:N(t,n,i,a);break;case 269:var u=a.parent;1===u.elements.length?r(t,i,u):N(t,n,i,a);break;case 267:r(t,i,a);break;case 26:k(t,i,a,{trailingTriviaOption:l.Exclude});break;case 98:k(t,i,a,{leadingTriviaOption:c.Exclude});break;case 256:case 255:k(t,i,a,{leadingTriviaOption:e.hasJSDocNodes(a)?c.JSDoc:c.StartLine});break;default:a.parent?e.isImportClause(a.parent)&&a.parent.name===a?function(t,r,n){if(n.namedBindings){var i=n.name.getStart(r),a=e.getTokenAtPosition(r,n.name.end);if(a&&27===a.kind){var o=e.skipTrivia(r.text,a.end,!1,!0);t.deleteRange(r,{pos:i,end:o});}else k(t,r,n.name);}else k(t,r,n.parent);}(t,i,a.parent):e.isCallExpression(a.parent)&&e.contains(a.parent.arguments,a)?N(t,n,i,a):k(t,i,a):k(t,i,a);}};}(h||(h={})),t.deleteNode=k;}(e.textChanges||(e.textChanges={}));}(t),function(e){!function(t){var r=e.createMultiMap(),a=new e.Map;function o(e,t,r,n,i,a){return {fixName:e,description:t,changes:r,fixId:n,fixAllDescription:i,commands:a?[a]:void 0}}function c(e,t){return {changes:e,commands:t}}function l(t,r,n){for(var i=0,a=u(t);i<a.length;i++){var o=a[i];e.contains(r,o.code)&&n(o);}}function u(t){var r=t.program,i=t.sourceFile,a=t.cancellationToken;return n$3(n$3(n$3([],r.getSemanticDiagnostics(i,a),!0),r.getSyntacticDiagnostics(i,a),!0),e.computeSuggestionDiagnostics(i,r,a),!0)}t.createCodeFixActionWithoutFixAll=function(t,r,n){return o(t,e.diagnosticToString(n),r,void 0,void 0)},t.createCodeFixAction=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,e.diagnosticToString(a),s)},t.createCodeFixActionMaybeFixAll=function(t,r,n,i,a,s){return o(t,e.diagnosticToString(n),r,i,a&&e.diagnosticToString(a),s)},t.registerCodeFix=function(t){for(var n=0,i=t.errorCodes;n<i.length;n++){var o=i[n];r.add(String(o),t);}if(t.fixIds)for(var s=0,c=t.fixIds;s<c.length;s++){var l=c[s];e.Debug.assert(!a.has(l)),a.set(l,t);}},t.getSupportedErrorCodes=function(){return e.arrayFrom(r.keys())},t.getFixes=function(t){var n=u(t),a=r.get(String(t.errorCode));return e.flatMap(a,(function(r){return e.map(r.getCodeActions(t),function(t,r){for(var n=t.errorCodes,a=0,o=0,c=r;o<c.length;o++){var l=c[o];if(e.contains(n,l.code)&&a++,a>1)break}var u=a<2;return function(e){var t=e.fixId,r=e.fixAllDescription,n=s(e,["fixId","fixAllDescription"]);return u?n:i$1(i$1({},n),{fixId:t,fixAllDescription:r})}}(r,n))}))},t.getAllFixes=function(t){return a.get(e.cast(t.fixId,e.isString)).getAllCodeActions(t)},t.createCombinedCodeActions=c,t.createFileTextChanges=function(e,t){return {fileName:e,textChanges:t}},t.codeFixAll=function(t,r,n){var i=[];return c(e.textChanges.ChangeTracker.with(t,(function(e){return l(t,r,(function(t){return n(e,t,i)}))})),0===i.length?void 0:i)},t.eachDiagnostic=l;}(e.codefix||(e.codefix={}));}(t),function(e){var t,r;t=e.refactor||(e.refactor={}),r=new e.Map,t.registerRefactor=function(e,t){r.set(e,t);},t.getApplicableRefactors=function(n){return e.arrayFrom(e.flatMapIterator(r.values(),(function(e){var r;return n.cancellationToken&&n.cancellationToken.isCancellationRequested()||!(null===(r=e.kinds)||void 0===r?void 0:r.some((function(e){return t.refactorKindBeginsWith(e,n.kind)})))?void 0:e.getAvailableActions(n)})))},t.getEditsForRefactor=function(e,t,n){var i=r.get(t);return i&&i.getEditsForAction(e,n)};}(t),function(e){!function(t){var r="addConvertToUnknownForNonOverlappingTypes",n=[e.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.Debug.checkDefined(e.findAncestor(i,(function(t){return e.isAsExpression(t)||e.isTypeAssertionExpression(t)})),"Expected to find an assertion expression"),o=e.isAsExpression(a)?e.factory.createAsExpression(a.expression,e.factory.createKeywordTypeNode(154)):e.factory.createTypeAssertion(e.factory.createKeywordTypeNode(154),a.expression);t.replaceNode(r,a.expression,o);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Add_unknown_conversion_for_non_overlapping_types,r,e.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,e.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(r){var n=r.sourceFile,i=e.textChanges.ChangeTracker.with(r,(function(t){var r=e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([]),void 0);t.insertNodeAtEndOfScope(n,n,r);}));return [t.createCodeFixActionWithoutFixAll("addEmptyExportDeclaration",i,e.Diagnostics.Add_export_to_make_this_file_into_a_module)]}});}(t),function(e){!function(t){var r="addMissingAsync",n=[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_comparable_to_type_1.code];function i(n,i,a,o){var s=a((function(t){return function(t,r,n,i){if(!i||!i.has(e.getNodeId(n))){null==i||i.add(e.getNodeId(n));var a=e.factory.updateModifiers(e.getSynthesizedDeepClone(n,!0),e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(256|e.getSyntacticModifierFlags(n))));t.replaceNode(r,n,a);}}(t,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)}function a(t,r){if(r){var n=e.getTokenAtPosition(t,r.start);return e.findAncestor(n,(function(n){return n.getStart(t)<r.start||n.getEnd()>e.textSpanEnd(r)?"quit":(e.isArrowFunction(n)||e.isMethodDeclaration(n)||e.isFunctionExpression(n)||e.isFunctionDeclaration(n))&&e.textSpansEqual(r,e.createTextSpanFromNode(n,t))}))}}t.registerCodeFix({fixIds:[r],errorCodes:n,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,o=t.cancellationToken,s=t.program,c=t.span,l=e.find(s.getDiagnosticsProducingTypeChecker().getDiagnostics(r,o),function(t,r){return function(n){var i=n.start,a=n.length,o=n.relatedInformation,s=n.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},t)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code}))}}(c,n)),u=a(r,l&&l.relatedInformation&&e.find(l.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})));if(u)return [i(t,u,(function(r){return e.textChanges.ChangeTracker.with(t,r)}))]},getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Set;return t.codeFixAll(r,n,(function(t,n){var c=n.relatedInformation&&e.find(n.relatedInformation,(function(t){return t.code===e.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code})),l=a(o,c);if(l)return i(r,l,(function(e){return e(t),[]}),s)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingAwait",i=e.Diagnostics.Property_0_does_not_exist_on_type_1.code,a=[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],o=n$3([e.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,e.Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,e.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,e.Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,e.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,e.Diagnostics.Type_0_is_not_an_array_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code,e.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,e.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,i],a,!0);function s(t,r,n,i,a){var o=e.getFixableErrorSpanExpression(t,n);return o&&function(t,r,n,i,a){var o=a.getDiagnosticsProducingTypeChecker().getDiagnostics(t,i);return e.some(o,(function(t){var i=t.start,a=t.length,o=t.relatedInformation,s=t.code;return e.isNumber(i)&&e.isNumber(a)&&e.textSpansEqual({start:i,length:a},n)&&s===r&&!!o&&e.some(o,(function(t){return t.code===e.Diagnostics.Did_you_forget_to_use_await.code}))}))}(t,r,n,i,a)&&u(o)?o:void 0}function c(r,n,i,a,s,c){var l=r.sourceFile,d=r.program,p=r.cancellationToken,f=function(t,r,n,i,a){var s=function(t,r){if(e.isPropertyAccessExpression(t.parent)&&e.isIdentifier(t.parent.expression))return {identifiers:[t.parent.expression],isCompleteFix:!0};if(e.isIdentifier(t))return {identifiers:[t],isCompleteFix:!0};if(e.isBinaryExpression(t)){for(var n=void 0,i=!0,a=0,o=[t.left,t.right];a<o.length;a++){var s=o[a],c=r.getTypeAtLocation(s);if(r.getPromisedTypeOfPromise(c)){if(!e.isIdentifier(s)){i=!1;continue}(n||(n=[])).push(s);}}return n&&{identifiers:n,isCompleteFix:i}}}(t,a);if(s){for(var c,l=s.isCompleteFix,_=function(t){var s=a.getSymbolAtLocation(t);if(!s)return "continue";var _=e.tryCast(s.valueDeclaration,e.isVariableDeclaration),d=_&&e.tryCast(_.name,e.isIdentifier),p=e.getAncestor(_,236);if(!_||!p||_.type||!_.initializer||p.getSourceFile()!==r||e.hasSyntacticModifier(p,1)||!d||!u(_.initializer))return l=!1,"continue";var f=i.getSemanticDiagnostics(r,n);if(e.FindAllReferences.Core.eachSymbolReferenceInFile(d,a,r,(function(n){return t!==n&&!function(t,r,n,i){var a=e.isPropertyAccessExpression(t.parent)?t.parent.name:e.isBinaryExpression(t.parent)?t.parent:t,s=e.find(r,(function(e){return e.start===a.getStart(n)&&e.start+e.length===a.getEnd()}));return s&&e.contains(o,s.code)||1&i.getTypeAtLocation(a).flags}(n,f,r,a)})))return l=!1,"continue";(c||(c=[])).push({expression:_.initializer,declarationSymbol:s});},d=0,p=s.identifiers;d<p.length;d++)_(p[d]);return c&&{initializers:c,needsSecondPassForFixAll:!l}}}(n,l,p,d,a);if(f){var g=s((function(t){e.forEach(f.initializers,(function(e){var r=e.expression;return _(t,i,l,a,r,c)})),c&&f.needsSecondPassForFixAll&&_(t,i,l,a,n,c);}));return t.createCodeFixActionWithoutFixAll("addMissingAwaitToInitializer",g,1===f.initializers.length?[e.Diagnostics.Add_await_to_initializer_for_0,f.initializers[0].declarationSymbol.name]:e.Diagnostics.Add_await_to_initializers)}}function l(n,i,a,o,s,c){var l=s((function(e){return _(e,a,n.sourceFile,o,i,c)}));return t.createCodeFixAction(r,l,e.Diagnostics.Add_await,r,e.Diagnostics.Fix_all_expressions_possibly_missing_await)}function u(t){return 32768&t.kind||!!e.findAncestor(t,(function(t){return t.parent&&e.isArrowFunction(t.parent)&&t.parent.body===t||e.isBlock(t)&&(255===t.parent.kind||212===t.parent.kind||213===t.parent.kind||168===t.parent.kind)}))}function _(t,r,n,o,s,c){if(e.isBinaryExpression(s))for(var l=0,u=[s.left,s.right];l<u.length;l++){var _=u[l];if(!(c&&e.isIdentifier(_)&&(g=o.getSymbolAtLocation(_))&&c.has(e.getSymbolId(g)))){var p=o.getTypeAtLocation(_),f=o.getPromisedTypeOfPromise(p)?e.factory.createAwaitExpression(_):_;t.replaceNode(n,_,f);}}else if(r===i&&e.isPropertyAccessExpression(s.parent)){if(c&&e.isIdentifier(s.parent.expression)&&(g=o.getSymbolAtLocation(s.parent.expression))&&c.has(e.getSymbolId(g)))return;t.replaceNode(n,s.parent.expression,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s.parent.expression))),d(t,s.parent.expression,n);}else if(e.contains(a,r)&&e.isCallOrNewExpression(s.parent)){if(c&&e.isIdentifier(s)&&(g=o.getSymbolAtLocation(s))&&c.has(e.getSymbolId(g)))return;t.replaceNode(n,s,e.factory.createParenthesizedExpression(e.factory.createAwaitExpression(s))),d(t,s,n);}else {var g;if(c&&e.isVariableDeclaration(s.parent)&&e.isIdentifier(s.parent.name)&&(g=o.getSymbolAtLocation(s.parent.name))&&!e.tryAddToSet(c,e.getSymbolId(g)))return;t.replaceNode(n,s,e.factory.createAwaitExpression(s));}}function d(t,r,n){var i=e.findPrecedingToken(r.pos,n);i&&e.positionIsASICandidate(i.end,i.parent,n)&&t.insertText(n,r.getStart(n),";");}t.registerCodeFix({fixIds:[r],errorCodes:o,getCodeActions:function(t){var r=t.sourceFile,n=t.errorCode,i=s(r,n,t.span,t.cancellationToken,t.program);if(i){var a=t.program.getTypeChecker(),o=function(r){return e.textChanges.ChangeTracker.with(t,r)};return e.compact([c(t,i,n,a,o),l(t,i,n,a,o)])}},getAllCodeActions:function(r){var n=r.sourceFile,i=r.program,a=r.cancellationToken,u=r.program.getTypeChecker(),_=new e.Set;return t.codeFixAll(r,o,(function(e,t){var o=s(n,t.code,t,a,i);if(o){var d=function(t){return t(e),[]};return c(r,o,t.code,u,d,_)||l(r,o,t.code,u,d,_)}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingConst",n=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function i(t,r,n,i,s){var c=e.getTokenAtPosition(r,n),l=e.findAncestor(c,(function(t){return e.isForInOrOfStatement(t.parent)?t.parent.initializer===t:!function(e){switch(e.kind){case 79:case 203:case 204:case 294:case 295:return !0;default:return !1}}(t)&&"quit"}));if(l)return a(t,l,r,s);var u=c.parent;if(e.isBinaryExpression(u)&&63===u.operatorToken.kind&&e.isExpressionStatement(u.parent))return a(t,c,r,s);if(e.isArrayLiteralExpression(u)){var _=i.getTypeChecker();if(!e.every(u.elements,(function(t){return r=t,n=_,!!(i=e.isIdentifier(r)?r:e.isAssignmentExpression(r,!0)&&e.isIdentifier(r.left)?r.left:void 0)&&!n.getSymbolAtLocation(i);var r,n,i;})))return;return a(t,u,r,s)}var d=e.findAncestor(c,(function(t){return !!e.isExpressionStatement(t.parent)||!function(e){switch(e.kind){case 79:case 220:case 27:return !0;default:return !1}}(t)&&"quit"}));if(d){if(!o(d,i.getTypeChecker()))return;return a(t,d,r,s)}}function a(t,r,n,i){i&&!e.tryAddToSet(i,r)||t.insertModifierBefore(n,85,r);}function o(t,r){return !!e.isBinaryExpression(t)&&(27===t.operatorToken.kind?e.every([t.left,t.right],(function(e){return o(e,r)})):63===t.operatorToken.kind&&e.isIdentifier(t.left)&&!r.getSymbolAtLocation(t.left))}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Add_const_to_unresolved_variable,r,e.Diagnostics.Add_const_to_all_unresolved_variables)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,r.program,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingDeclareProperty",n=[e.Diagnostics.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(e.isIdentifier(a)){var o=a.parent;166!==o.kind||i&&!e.tryAddToSet(i,o)||t.insertModifierBefore(r,135,o);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Prefix_with_declare,r,e.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[r],getAllCodeActions:function(r){var a=new e.Set;return t.codeFixAll(r,n,(function(e,t){return i(e,t.file,t.start,a)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingInvocationForDecorator",n=[e.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.findAncestor(i,e.isDecorator);e.Debug.assert(!!a,"Expected position to be owned by a decorator.");var o=e.factory.createCallExpression(a.expression,void 0,void 0);t.replaceNode(r,a.expression,o);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Call_decorator_expression,r,e.Diagnostics.Add_to_all_uncalled_decorators)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addNameToNamelessParameter",n=[e.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=i.parent;if(!e.isParameter(a))return e.Debug.fail("Tried to add a parameter name to a non-parameter: "+e.Debug.formatSyntaxKind(i.kind));var o=a.parent.parameters.indexOf(a);e.Debug.assert(!a.type,"Tried to add a parameter name to a parameter that already had one."),e.Debug.assert(o>-1,"Parameter not found in parent parameter list.");var s=e.factory.createTypeReferenceNode(a.name,void 0),c=e.factory.createParameterDeclaration(void 0,a.modifiers,a.dotDotDotToken,"arg"+o,a.questionToken,a.dotDotDotToken?e.factory.createArrayTypeNode(s):s,a.initializer);t.replaceNode(r,a,c);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Add_parameter_name,r,e.Diagnostics.Add_names_to_all_parameters_without_names)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addOptionalPropertyUndefined",i=[e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];function a(t,r){var n;if(t){if(e.isBinaryExpression(t.parent)&&63===t.parent.operatorToken.kind)return {source:t.parent.right,target:t.parent.left};if(e.isVariableDeclaration(t.parent)&&t.parent.initializer)return {source:t.parent.initializer,target:t.parent.name};if(e.isCallExpression(t.parent)){var i=r.getSymbolAtLocation(t.parent.expression);if(!(null==i?void 0:i.valueDeclaration)||!e.isFunctionLikeKind(i.valueDeclaration.kind))return;if(!e.isExpression(t))return;var o=t.parent.arguments.indexOf(t);if(-1===o)return;var s=i.valueDeclaration.parameters[o].name;if(e.isIdentifier(s))return {source:t,target:s}}else if(e.isPropertyAssignment(t.parent)&&e.isIdentifier(t.parent.name)||e.isShorthandPropertyAssignment(t.parent)){var c=a(t.parent.parent,r);if(!c)return;var l=r.getPropertyOfType(r.getTypeAtLocation(c.target),t.parent.name.text),u=null===(n=null==l?void 0:l.declarations)||void 0===n?void 0:n[0];if(!u)return;return {source:e.isPropertyAssignment(t.parent)?t.parent.initializer:t.parent.name,target:u}}}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.program.getTypeChecker(),s=function(t,r,n){var i,o,s=a(e.getFixableErrorSpanExpression(t,r),n);if(!s)return e.emptyArray;var c=s.source,l=s.target,u=function(t,r,n){return e.isPropertyAccessExpression(r)&&!!n.getExactOptionalProperties(n.getTypeAtLocation(r.expression)).length&&n.getTypeAtLocation(t)===n.getUndefinedType()}(c,l,n)?n.getTypeAtLocation(l.expression):n.getTypeAtLocation(l);return (null===(o=null===(i=u.symbol)||void 0===i?void 0:i.declarations)||void 0===o?void 0:o.some((function(t){return e.getSourceFileOfNode(t).fileName.match(/\.d\.ts$/)})))?e.emptyArray:n.getExactOptionalProperties(u)}(i.sourceFile,i.span,o);if(s.length){var c=e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r){for(var i=0,a=r;i<a.length;i++){var o=a[i].valueDeclaration;if(o&&(e.isPropertySignature(o)||e.isPropertyDeclaration(o))&&o.type){var s=e.factory.createUnionTypeNode(n$3(n$3([],186===o.type.kind?o.type.types:[o.type],!0),[e.factory.createTypeReferenceNode("undefined")],!1));t.replaceNode(o.getSourceFile(),o.type,s);}}}(t,s)}));return [t.createCodeFixActionWithoutFixAll(r,c,e.Diagnostics.Add_undefined_to_optional_property_type)]}},fixIds:[r]});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="annotateWithTypeFromJSDoc",n=[e.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.tryCast(e.isParameter(n.parent)?n.parent.parent:n.parent,a)}function a(t){return function(t){return e.isFunctionLikeDeclaration(t)||253===t.kind||165===t.kind||166===t.kind}(t)&&o(t)}function o(t){return e.isFunctionLikeDeclaration(t)?t.parameters.some(o)||!t.type&&!!e.getJSDocReturnType(t):!t.type&&!!e.getJSDocType(t)}function s(t,r,n){if(e.isFunctionLikeDeclaration(n)&&(e.getJSDocReturnType(n)||n.parameters.some((function(t){return !!e.getJSDocType(t)})))){if(!n.typeParameters){var i=e.getJSDocTypeParameterDeclarations(n);i.length&&t.insertTypeParameters(r,n,i);}var a=e.isArrowFunction(n)&&!e.findChildOfKind(n,20,r);a&&t.insertNodeBefore(r,e.first(n.parameters),e.factory.createToken(20));for(var o=0,s=n.parameters;o<s.length;o++){var l=s[o];if(!l.type){var u=e.getJSDocType(l);u&&t.tryInsertTypeAnnotation(r,l,c(u));}}if(a&&t.insertNodeAfter(r,e.last(n.parameters),e.factory.createToken(21)),!n.type){var _=e.getJSDocReturnType(n);_&&t.tryInsertTypeAnnotation(r,n,c(_));}}else {var d=e.Debug.checkDefined(e.getJSDocType(n),"A JSDocType for this declaration should exist");e.Debug.assert(!n.type,"The JSDocType decl should have a type"),t.tryInsertTypeAnnotation(r,n,c(d));}}function c(t){switch(t.kind){case 310:case 311:return e.factory.createTypeReferenceNode("any",e.emptyArray);case 314:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("undefined",e.emptyArray)])}(t);case 313:return c(t.type);case 312:return function(t){return e.factory.createUnionTypeNode([e.visitNode(t.type,c),e.factory.createTypeReferenceNode("null",e.emptyArray)])}(t);case 316:return function(t){return e.factory.createArrayTypeNode(e.visitNode(t.type,c))}(t);case 315:return function(t){var r;return e.factory.createFunctionTypeNode(e.emptyArray,t.parameters.map(l),null!==(r=t.type)&&void 0!==r?r:e.factory.createKeywordTypeNode(130))}(t);case 177:return function(t){var r=t.typeName,n=t.typeArguments;if(e.isIdentifier(t.typeName)){if(e.isJSDocIndexSignature(t))return function(t){var r=e.factory.createParameterDeclaration(void 0,void 0,void 0,146===t.typeArguments[0].kind?"n":"s",void 0,e.factory.createTypeReferenceNode(146===t.typeArguments[0].kind?"number":"string",[]),void 0),n=e.factory.createTypeLiteralNode([e.factory.createIndexSignature(void 0,void 0,[r],t.typeArguments[1])]);return e.setEmitFlags(n,1),n}(t);var i=t.typeName.text;switch(t.typeName.text){case"String":case"Boolean":case"Object":case"Number":i=i.toLowerCase();break;case"array":case"date":case"promise":i=i[0].toUpperCase()+i.slice(1);}r=e.factory.createIdentifier(i),n="Array"!==i&&"Promise"!==i||t.typeArguments?e.visitNodes(t.typeArguments,c):e.factory.createNodeArray([e.factory.createTypeReferenceNode("any",e.emptyArray)]);}return e.factory.createTypeReferenceNode(r,n)}(t);default:var r=e.visitEachChild(t,c,e.nullTransformationContext);return e.setEmitFlags(r,1),r}}function l(t){var r=t.parent.parameters.indexOf(t),n=316===t.type.kind&&r===t.parent.parameters.length-1,i=t.name||(n?"rest":"arg"+r),a=n?e.factory.createToken(25):t.dotDotDotToken;return e.factory.createParameterDeclaration(t.decorators,t.modifiers,a,i,t.questionToken,e.visitNode(t.type,c),t.initializer)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=i(n.sourceFile,n.span.start);if(a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return s(e,n.sourceFile,a)}));return [t.createCodeFixAction(r,o,e.Diagnostics.Annotate_with_type_from_JSDoc,r,e.Diagnostics.Annotate_everything_with_types_from_JSDoc)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&s(e,t.file,r);}))}}),t.parameterShouldGetTypeFromJSDoc=a;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertFunctionToEs6Class",n=[e.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code];function i(t,r,n,i,s,c){var l=i.getSymbolAtLocation(e.getTokenAtPosition(r,n));if(l&&l.valueDeclaration&&19&l.flags){var u=l.valueDeclaration;if(e.isFunctionDeclaration(u))t.replaceNode(r,u,function(t){var r=p(l);t.body&&r.unshift(e.factory.createConstructorDeclaration(void 0,void 0,t.parameters,t.body));var n=a(t,93);return e.factory.createClassDeclaration(void 0,n,t.name,void 0,void 0,r)}(u));else if(e.isVariableDeclaration(u)){var _=function(t){var r=t.initializer;if(r&&e.isFunctionExpression(r)&&e.isIdentifier(t.name)){var n=p(t.symbol);r.body&&n.unshift(e.factory.createConstructorDeclaration(void 0,void 0,r.parameters,r.body));var i=a(t.parent.parent,93);return e.factory.createClassDeclaration(void 0,i,t.name,void 0,void 0,n)}}(u);if(!_)return;var d=u.parent.parent;e.isVariableDeclarationList(u.parent)&&u.parent.declarations.length>1?(t.delete(r,u),t.insertNodeAfter(r,d,_)):t.replaceNode(r,d,_);}}function p(n){var i=[];return n.members&&n.members.forEach((function(e,n){if("constructor"===n&&e.valueDeclaration)t.delete(r,e.valueDeclaration.parent);else {var a=l(e,void 0);a&&i.push.apply(i,a);}})),n.exports&&n.exports.forEach((function(t){if("prototype"===t.name&&t.declarations){var r=t.declarations[0];1===t.declarations.length&&e.isPropertyAccessExpression(r)&&e.isBinaryExpression(r.parent)&&63===r.parent.operatorToken.kind&&e.isObjectLiteralExpression(r.parent.right)&&(n=l(r.parent.right.symbol,void 0))&&i.push.apply(i,n);}else {var n;(n=l(t,[e.factory.createToken(124)]))&&i.push.apply(i,n);}})),i;function l(n,i){var l=[];if(!(8192&n.flags||4096&n.flags))return l;var u,_,d=n.valueDeclaration,p=d.parent,f=p.right;if(u=d,_=f,!(e.isAccessExpression(u)?e.isPropertyAccessExpression(u)&&o(u)||e.isFunctionLike(_):e.every(u.properties,(function(t){return !!(e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)||e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)&&t.name||o(t))}))))return l;var g=p.parent&&237===p.parent.kind?p.parent:p;if(t.delete(r,g),!f)return l.push(e.factory.createPropertyDeclaration([],i,n.name,void 0,void 0,void 0)),l;if(e.isAccessExpression(d)&&(e.isFunctionExpression(f)||e.isArrowFunction(f))){var m=e.getQuotePreference(r,s),y=function(t,r,n){if(e.isPropertyAccessExpression(t))return t.name;var i=t.argumentExpression;return e.isNumericLiteral(i)?i:e.isStringLiteralLike(i)?e.isIdentifierText(i.text,e.getEmitScriptTarget(r))?e.factory.createIdentifier(i.text):e.isNoSubstitutionTemplateLiteral(i)?e.factory.createStringLiteral(i.text,0===n):i:void 0}(d,c,m);return y?h(l,f,y):l}if(e.isObjectLiteralExpression(f))return e.flatMap(f.properties,(function(t){return e.isMethodDeclaration(t)||e.isGetOrSetAccessorDeclaration(t)?l.concat(t):e.isPropertyAssignment(t)&&e.isFunctionExpression(t.initializer)?h(l,t.initializer,t.name):o(t)?l:[]}));if(e.isSourceFileJS(r))return l;if(!e.isPropertyAccessExpression(d))return l;var v=e.factory.createPropertyDeclaration(void 0,i,d.name,void 0,void 0,f);return e.copyLeadingComments(p.parent,v,r),l.push(v),l;function h(t,n,o){return e.isFunctionExpression(n)?function(t,n,o){var s=e.concatenate(i,a(n,131)),c=e.factory.createMethodDeclaration(void 0,s,void 0,o,void 0,void 0,n.parameters,void 0,n.body);return e.copyLeadingComments(p,c,r),t.concat(c)}(t,n,o):function(t,n,o){var s,c=n.body;s=234===c.kind?c:e.factory.createBlock([e.factory.createReturnStatement(c)]);var l=e.concatenate(i,a(n,131)),u=e.factory.createMethodDeclaration(void 0,l,void 0,o,void 0,void 0,n.parameters,void 0,s);return e.copyLeadingComments(p,u,r),t.concat(u)}(t,n,o)}}}}function a(t,r){return e.filter(t.modifiers,(function(e){return e.kind===r}))}function o(t){return !!t.name&&!(!e.isIdentifier(t.name)||"constructor"!==t.name.text)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.program.getTypeChecker(),n.preferences,n.program.getCompilerOptions())}));return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_function_to_an_ES2015_class,r,e.Diagnostics.Convert_all_constructor_functions_to_classes)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions())}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="convertToAsyncFunction",a=[e.Diagnostics.This_may_be_converted_to_an_async_function.code],o=!0;function s(t,r,n,i){var a,o=e.getTokenAtPosition(r,n);if(a=e.isIdentifier(o)&&e.isVariableDeclaration(o.parent)&&o.parent.initializer&&e.isFunctionLikeDeclaration(o.parent.initializer)?o.parent.initializer:e.tryCast(e.getContainingFunction(e.getTokenAtPosition(r,n)),e.canBeConvertedToAsync)){var s=new e.Map,l=e.isInJSFile(a),u=function(t,r){if(!t.body)return new e.Set;var n=new e.Set;return e.forEachChild(t.body,(function t(i){c(i,r,"then")?(n.add(e.getNodeId(i)),e.forEach(i.arguments,t)):c(i,r,"catch")||c(i,r,"finally")?(n.add(e.getNodeId(i)),e.forEachChild(i,t)):_(i,r)?n.add(e.getNodeId(i)):e.forEachChild(i,t);})),n}(a,i),f=function(t,r,n){var i=new e.Map,a=e.createMultiMap();return e.forEachChild(t,(function t(o){if(e.isIdentifier(o)){var s=r.getSymbolAtLocation(o);if(s){var c=T(r.getTypeAtLocation(o),r),l=e.getSymbolId(s).toString();if(!c||e.isParameter(o.parent)||e.isFunctionLikeDeclaration(o.parent)||n.has(l)){if(o.parent&&(e.isParameter(o.parent)||e.isVariableDeclaration(o.parent)||e.isBindingElement(o.parent))){var u=o.text,_=a.get(u);if(_&&_.some((function(e){return e!==s}))){var p=d(o,a);i.set(l,p.identifier),n.set(l,p),a.add(u,s);}else {var f=e.getSynthesizedDeepClone(o);n.set(l,N(f)),a.add(u,s);}}}else {var g=e.firstOrUndefined(c.parameters),m=(null==g?void 0:g.valueDeclaration)&&e.isParameter(g.valueDeclaration)&&e.tryCast(g.valueDeclaration.name,e.isIdentifier)||e.factory.createUniqueName("result",16),y=d(m,a);n.set(l,y),a.add(m.text,s);}}}else e.forEachChild(o,t);})),e.getSynthesizedDeepCloneWithReplacements(t,!0,(function(t){if(e.isBindingElement(t)&&e.isIdentifier(t.name)&&e.isObjectBindingPattern(t.parent)){if((a=(n=r.getSymbolAtLocation(t.name))&&i.get(String(e.getSymbolId(n))))&&a.text!==(t.name||t.propertyName).getText())return e.factory.createBindingElement(t.dotDotDotToken,t.propertyName||t.name,a,t.initializer)}else if(e.isIdentifier(t)){var n,a;if(a=(n=r.getSymbolAtLocation(t))&&i.get(String(e.getSymbolId(n))))return e.factory.createIdentifier(a.text)}}))}(a,i,s);if(e.returnsPromise(f,i)){var m=f.body&&e.isBlock(f.body)?function(t,r){var n=[];return e.forEachReturnStatement(t,(function(t){e.isReturnStatementWithFixablePromiseHandler(t,r)&&n.push(t);})),n}(f.body,i):e.emptyArray,y={checker:i,synthNamesMap:s,setOfExpressionsToReturn:u,isInJSFile:l};if(m.length){var v=a.modifiers?a.modifiers.end:a.decorators?e.skipTrivia(r.text,a.decorators.end):a.getStart(r),h=a.modifiers?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,v,131,h);for(var b=function(n){if(e.forEachChild(n,(function i(a){if(e.isCallExpression(a)){var o=g(a,a,y,!1);if(p())return !0;t.replaceNodeWithNodes(r,n,o);}else if(!e.isFunctionLike(a)&&(e.forEachChild(a,i),p()))return !0})),p())return {value:void 0}},x=0,D=m;x<D.length;x++){var S=b(D[x]);if("object"==typeof S)return S.value}}}}}function c(t,r,n){if(!e.isCallExpression(t))return !1;var i=e.hasPropertyAccessExpressionWithName(t,n)&&r.getTypeAtLocation(t);return !(!i||!r.getPromisedTypeOfPromise(i))}function l(t,r){return 0!=(4&e.getObjectFlags(t))&&t.target===r}function u(t,r,n){if("finally"!==t.expression.name.escapedText){var i=n.getTypeAtLocation(t.expression.expression);if(l(i,n.getPromiseType())||l(i,n.getPromiseLikeType())){if("then"!==t.expression.name.escapedText)return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,0))return e.elementAt(t.typeArguments,0);if(r===e.elementAt(t.arguments,1))return e.elementAt(t.typeArguments,1)}}}function _(t,r){return !!e.isExpression(t)&&!!r.getPromisedTypeOfPromise(r.getTypeAtLocation(t))}function d(t,r){var n=(r.get(t.text)||e.emptyArray).length;return N(0===n?t:e.factory.createIdentifier(t.text+"_"+n))}function p(){return !o}function f(){return o=!1,e.emptyArray}function g(t,r,n,i,a){if(c(r,n.checker,"then"))return function(t,r,n,i,a,o){if(!r||m(i,r))return h(t,n,i,a,o);if(n&&!m(i,n))return f();var s=E(r,i),c=g(t.expression.expression,t.expression.expression,i,!0,s);if(p())return f();var l=D(r,a,o,s,t,i);return p()?f():e.concatenate(c,l)}(r,e.elementAt(r.arguments,0),e.elementAt(r.arguments,1),n,i,a);if(c(r,n.checker,"catch"))return h(r,e.elementAt(r.arguments,0),n,i,a);if(c(r,n.checker,"finally"))return function(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=y(t,n,a),s=g(t,t.expression.expression,n,!0,o);if(p())return f();var c=D(r,i,void 0,void 0,t,n);if(p())return f();var l=e.factory.createBlock(s),u=e.factory.createBlock(c);return v(t,n,e.factory.createTryStatement(l,void 0,u),o,a)}(r,e.elementAt(r.arguments,0),n,i,a);if(e.isPropertyAccessExpression(r))return g(t,r.expression,n,i,a);var o=n.checker.getTypeAtLocation(r);return o&&n.checker.getPromisedTypeOfPromise(o)?(e.Debug.assertNode(e.getOriginalNode(r).parent,e.isPropertyAccessExpression),function(t,r,n,i,a){if(O(t,n)){var o=e.getSynthesizedDeepClone(r);return i&&(o=e.factory.createAwaitExpression(o)),[e.factory.createReturnStatement(o)]}return b(a,e.factory.createAwaitExpression(r),void 0)}(t,r,n,i,a)):f()}function m(t,r){var n=t.checker;if(104===r.kind)return !0;if(e.isIdentifier(r)&&!e.isGeneratedIdentifier(r)&&"undefined"===e.idText(r)){var i=n.getSymbolAtLocation(r);return !i||n.isUndefinedSymbol(i)}return !1}function y(t,r,n){var i;return n&&!O(t,r)&&(I(n)?(i=n,r.synthNamesMap.forEach((function(t,i){if(t.identifier.text===n.identifier.text){var a=(o=n,N(e.factory.createUniqueName(o.identifier.text,16)));r.synthNamesMap.set(i,a);}var o;}))):i=N(e.factory.createUniqueName("result",16),n.types),w(i)),i}function v(t,r,n,i,a){var o,s=[];if(i&&!O(t,r)){o=e.getSynthesizedDeepClone(w(i));var c=i.types,l=r.checker.getUnionType(c,2),u=r.isInJSFile?void 0:r.checker.typeToTypeNode(l,void 0,void 0),_=[e.factory.createVariableDeclaration(o,void 0,u)],d=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList(_,1));s.push(d);}return s.push(n),a&&o&&1===a.kind&&s.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(P(a)),void 0,void 0,o)],2))),s}function h(t,r,n,i,a){if(!r||m(n,r))return g(t,t.expression.expression,n,i,a);var o=E(r,n),s=y(t,n,a),c=g(t,t.expression.expression,n,!0,s);if(p())return f();var l=D(r,i,s,o,t,n);if(p())return f();var u=e.factory.createBlock(c),_=e.factory.createCatchClause(o&&e.getSynthesizedDeepClone(A(o)),e.factory.createBlock(l));return v(t,n,e.factory.createTryStatement(u,_,void 0),s,a)}function b(t,r,n){return !t||k(t)?[e.factory.createExpressionStatement(r)]:I(t)&&t.hasBeenDeclared?[e.factory.createExpressionStatement(e.factory.createAssignment(e.getSynthesizedDeepClone(F(t)),r))]:[e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(A(t)),void 0,n,r)],2))]}function x(t,r){if(r&&t){var i=e.factory.createUniqueName("result",16);return n$3(n$3([],b(N(i),t,r),!0),[e.factory.createReturnStatement(i)],!1)}return [e.factory.createReturnStatement(t)]}function D(t,r,n,i,a,o){var s;switch(t.kind){case 104:break;case 205:case 79:if(!i)break;var c=e.factory.createCallExpression(e.getSynthesizedDeepClone(t),void 0,I(i)?[F(i)]:[]);if(O(a,o))return x(c,u(a,t,o.checker));var l=o.checker.getTypeAtLocation(t),d=o.checker.getSignaturesOfType(l,0);if(!d.length)return f();var p=d[0].getReturnType(),g=b(n,e.factory.createAwaitExpression(c),u(a,t,o.checker));return n&&n.types.push(o.checker.getAwaitedType(p)||p),g;case 212:case 213:var m=t.body,y=null===(s=T(o.checker.getTypeAtLocation(t),o.checker))||void 0===s?void 0:s.getReturnType();if(e.isBlock(m)){for(var v=[],h=!1,D=0,E=m.statements;D<E.length;D++){var k=E[D];if(e.isReturnStatement(k))if(h=!0,e.isReturnStatementWithFixablePromiseHandler(k,o.checker))v=v.concat(C(o,k,r,n));else {var N=y&&k.expression?S(o.checker,y,k.expression):k.expression;v.push.apply(v,x(N,u(a,t,o.checker)));}else {if(r&&e.forEachReturnStatement(k,e.returnTrue))return f();v.push(k);}}return O(a,o)?v.map((function(t){return e.getSynthesizedDeepClone(t)})):function(t,r,n,i){for(var a=[],o=0,s=t;o<s.length;o++){var c=s[o];if(e.isReturnStatement(c)){if(c.expression){var l=_(c.expression,n.checker)?e.factory.createAwaitExpression(c.expression):c.expression;void 0===r?a.push(e.factory.createExpressionStatement(l)):I(r)&&r.hasBeenDeclared?a.push(e.factory.createExpressionStatement(e.factory.createAssignment(F(r),l))):a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(A(r),void 0,void 0,l)],2)));}}else a.push(e.getSynthesizedDeepClone(c));}return i||void 0===r||a.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(A(r),void 0,void 0,e.factory.createIdentifier("undefined"))],2))),a}(v,n,o,h)}var P=e.isFixablePromiseHandler(m,o.checker)?C(o,e.factory.createReturnStatement(m),r,n):e.emptyArray;if(P.length>0)return P;if(y){if(N=S(o.checker,y,m),O(a,o))return x(N,u(a,t,o.checker));var w=b(n,N,void 0);return n&&n.types.push(o.checker.getAwaitedType(y)||y),w}return f();default:return f()}return e.emptyArray}function S(t,r,n){var i=e.getSynthesizedDeepClone(n);return t.getPromisedTypeOfPromise(r)?e.factory.createAwaitExpression(i):i}function T(t,r){var n=r.getSignaturesOfType(t,0);return e.lastOrUndefined(n)}function C(t,r,n,i){var a=[];return e.forEachChild(r,(function r(o){if(e.isCallExpression(o)){var s=g(o,o,t,n,i);if((a=a.concat(s)).length>0)return}else e.isFunctionLike(o)||e.forEachChild(o,r);})),a}function E(t,r){var n,i=[];if(e.isFunctionLikeDeclaration(t)?t.parameters.length>0&&(n=function t(r){return e.isIdentifier(r)?a(r):function(t,r,n){return void 0===r&&(r=e.emptyArray),void 0===n&&(n=[]),{kind:1,bindingPattern:t,elements:r,types:n}}(r,e.flatMap(r.elements,(function(r){return e.isOmittedExpression(r)?[]:[t(r.name)]})))}(t.parameters[0].name)):e.isIdentifier(t)?n=a(t):e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)&&(n=a(t.name)),n&&(!("identifier"in n)||"undefined"!==n.identifier.text))return n;function a(t){var n,a=function(e){return e.symbol?e.symbol:r.checker.getSymbolAtLocation(e)}((n=t).original?n.original:n);return a&&r.synthNamesMap.get(e.getSymbolId(a).toString())||N(t,i)}}function k(t){return !t||(I(t)?!t.identifier.text:e.every(t.elements,k))}function N(e,t){return void 0===t&&(t=[]),{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function F(e){return e.hasBeenReferenced=!0,e.identifier}function A(e){return I(e)?w(e):P(e)}function P(e){for(var t=0,r=e.elements;t<r.length;t++)A(r[t]);return e.bindingPattern}function w(e){return e.hasBeenDeclared=!0,e.identifier}function I(e){return 0===e.kind}function O(t,r){return !!t.original&&r.setOfExpressionsToReturn.has(e.getNodeId(t.original))}t.registerCodeFix({errorCodes:a,getCodeActions:function(r){o=!0;var n=e.textChanges.ChangeTracker.with(r,(function(e){return s(e,r.sourceFile,r.span.start,r.program.getTypeChecker())}));return o?[t.createCodeFixAction(i,n,e.Diagnostics.Convert_to_async_function,i,e.Diagnostics.Convert_all_to_async_functions)]:[]},fixIds:[i],getAllCodeActions:function(e){return t.codeFixAll(e,a,(function(t,r){return s(t,r.file,r.start,e.program.getTypeChecker())}))}}),function(e){e[e.Identifier=0]="Identifier",e[e.BindingPattern=1]="BindingPattern";}(r||(r={}));}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t,r,n,i){for(var a=0,o=t.imports;a<o.length;a++){var s=o[a],c=e.getResolvedModule(t,s.text,e.getModeForUsageLocation(t,s));if(c&&c.resolvedFileName===r.fileName){var l=e.importFromModuleSpecifier(s);switch(l.kind){case 264:n.replaceNode(t,l,e.makeImport(l.name,void 0,s,i));break;case 207:e.isRequireCall(l,!1)&&n.replaceNode(t,l,e.factory.createPropertyAccessExpression(e.getSynthesizedDeepClone(l),"default"));}}}}function n(t,r){t.forEachChild((function n(i){if(e.isPropertyAccessExpression(i)&&e.isExportsOrModuleExportsOrAlias(t,i.expression)&&e.isIdentifier(i.name)){var a=i.parent;r(i,e.isBinaryExpression(a)&&a.left===i&&63===a.operatorToken.kind);}i.forEachChild(n);}));}function i(t,r,n,i,l,u,_,p,f){switch(r.kind){case 236:return a(t,r,i,n,l,u,f),!1;case 237:var y=r.expression;switch(y.kind){case 207:return e.isRequireCall(y,!0)&&i.replaceNode(t,r,e.makeImport(void 0,void 0,y.arguments[0],f)),!1;case 220:return 63===y.operatorToken.kind&&function(t,r,n,i,a,l){var u=n.left,_=n.right;if(!e.isPropertyAccessExpression(u))return !1;if(e.isExportsOrModuleExportsOrAlias(t,u)){if(!e.isExportsOrModuleExportsOrAlias(t,_)){var p=e.isObjectLiteralExpression(_)?function(t,r){var n=e.mapAllOrFail(t.properties,(function(t){switch(t.kind){case 171:case 172:case 295:case 296:return;case 294:return e.isIdentifier(t.name)?function(t,r,n){var i=[e.factory.createToken(93)];switch(r.kind){case 212:var a=r.name;if(a&&a.text!==t)return o();case 213:return d(t,i,r,n);case 225:return function(t,r,n,i){return e.factory.createClassDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.heritageClauses),c(n.members,i))}(t,i,r,n);default:return o()}function o(){return g(i,e.factory.createIdentifier(t),c(r,n))}}(t.name.text,t.initializer,r):void 0;case 168:return e.isIdentifier(t.name)?d(t.name.text,[e.factory.createToken(93)],t,r):void 0;default:e.Debug.assertNever(t,"Convert to ES6 got invalid prop kind ".concat(t.kind));}}));return n&&[n,!1]}(_,l):e.isRequireCall(_,!0)?function(t,r){var n=t.text,i=r.getSymbolAtLocation(t),a=i?i.exports:e.emptyMap;return a.has("export=")?[[s(n)],!0]:a.has("default")?a.size>1?[[o(n),s(n)],!0]:[[s(n)],!0]:[[o(n)],!1]}(_.arguments[0],r):void 0;return p?(i.replaceNodeWithNodes(t,n.parent,p[0]),p[1]):(i.replaceRangeWithText(t,e.createRange(u.getStart(t),_.pos),"export default"),!0)}i.delete(t,n.parent);}else e.isExportsOrModuleExportsOrAlias(t,u.expression)&&function(t,r,n,i){var a=r.left.name.text,o=i.get(a);if(void 0!==o){var s=[g(void 0,o,r.right),m([e.factory.createExportSpecifier(!1,o,a)])];n.replaceNodeWithNodes(t,r.parent,s);}else !function(t,r,n){var i=t.left,a=t.right,o=t.parent,s=i.name.text;if(!(e.isFunctionExpression(a)||e.isArrowFunction(a)||e.isClassExpression(a))||a.name&&a.name.text!==s)n.replaceNodeRangeWithNodes(r,i.expression,e.findChildOfKind(i,24,r),[e.factory.createToken(93),e.factory.createToken(85)],{joiner:" ",suffix:" "});else {n.replaceRange(r,{pos:i.getStart(r),end:a.getStart(r)},e.factory.createToken(93),{suffix:" "}),a.name||n.insertName(r,a,s);var c=e.findChildOfKind(o,26,r);c&&n.delete(r,c);}}(r,t,n);}(t,n,i,a);return !1}(t,n,y,i,_,p)}default:return !1}}function a(r,n,i,a,o,s,c){var u,_=n.declarationList,d=!1,m=e.map(_.declarations,(function(n){var i=n.name,u=n.initializer;if(u){if(e.isExportsOrModuleExportsOrAlias(r,u))return d=!0,y([]);if(e.isRequireCall(u,!0))return d=!0,function(r,n,i,a,o,s){switch(r.kind){case 200:var c=e.mapAllOrFail(r.elements,(function(t){return t.dotDotDotToken||t.initializer||t.propertyName&&!e.isIdentifier(t.propertyName)||!e.isIdentifier(t.name)?void 0:f(t.propertyName&&t.propertyName.text,t.name.text)}));if(c)return y([e.makeImport(void 0,c,n,s)]);case 201:var u=l(t.moduleSpecifierToValidIdentifier(n.text,o),a);return y([e.makeImport(e.factory.createIdentifier(u),void 0,n,s),g(void 0,e.getSynthesizedDeepClone(r),e.factory.createIdentifier(u))]);case 79:return function(t,r,n,i,a){for(var o,s=n.getSymbolAtLocation(t),c=new e.Map,u=!1,_=0,d=i.original.get(t.text);_<d.length;_++){var p=d[_];if(n.getSymbolAtLocation(p)===s&&p!==t){var f=p.parent;if(e.isPropertyAccessExpression(f)){var g=f.name.text;if("default"===g){u=!0;var m=p.getText();(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(m));}else {e.Debug.assert(f.expression===p,"Didn't expect expression === use");var v=c.get(g);void 0===v&&(v=l(g,i),c.set(g,v)),(null!=o?o:o=new e.Map).set(f,e.factory.createIdentifier(v));}}else u=!0;}}var h=0===c.size?void 0:e.arrayFrom(e.mapIterator(c.entries(),(function(t){var r=t[0],n=t[1];return e.factory.createImportSpecifier(!1,r===n?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(n))})));return h||(u=!0),y([e.makeImport(u?e.getSynthesizedDeepClone(t):void 0,h,r,a)],o)}(r,n,i,a,s);default:return e.Debug.assertNever(r,"Convert to ES module got invalid name kind ".concat(r.kind))}}(i,u.arguments[0],a,o,s,c);if(e.isPropertyAccessExpression(u)&&e.isRequireCall(u.expression,!0))return d=!0,function(t,r,n,i,a){switch(t.kind){case 200:case 201:var o=l(r,i);return y([p(o,r,n,a),g(void 0,t,e.factory.createIdentifier(o))]);case 79:return y([p(t.text,r,n,a)]);default:return e.Debug.assertNever(t,"Convert to ES module got invalid syntax form ".concat(t.kind))}}(i,u.name.text,u.expression.arguments[0],o,c)}return y([e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([n],_.flags))])}));if(d)return i.replaceNodeWithNodes(r,n,e.flatMap(m,(function(e){return e.newImports}))),e.forEach(m,(function(t){t.useSitesToUnqualify&&e.copyEntries(t.useSitesToUnqualify,null!=u?u:u=new e.Map);})),u}function o(e){return m(void 0,e)}function s(t){return m([e.factory.createExportSpecifier(!1,void 0,"default")],t)}function c(t,r){return r&&e.some(e.arrayFrom(r.keys()),(function(r){return e.rangeContainsRange(t,r)}))?e.isArray(t)?e.getSynthesizedDeepClonesWithReplacements(t,!0,n):e.getSynthesizedDeepCloneWithReplacements(t,!0,n):t;function n(e){if(205===e.kind){var t=r.get(e);return r.delete(e),t}}}function l(e,t){for(;t.original.has(e)||t.additional.has(e);)e="_".concat(e);return t.additional.add(e),e}function u(t){var r=e.createMultiMap();return _(t,(function(e){return r.add(e.text,e)})),r}function _(t,r){e.isIdentifier(t)&&function(e){var t=e.parent;switch(t.kind){case 205:return t.name!==e;case 202:case 269:return t.propertyName!==e;default:return !0}}(t)&&r(t),t.forEachChild((function(e){return _(e,r)}));}function d(t,r,n,i){return e.factory.createFunctionDeclaration(e.getSynthesizedDeepClones(n.decorators),e.concatenate(r,e.getSynthesizedDeepClones(n.modifiers)),e.getSynthesizedDeepClone(n.asteriskToken),t,e.getSynthesizedDeepClones(n.typeParameters),e.getSynthesizedDeepClones(n.parameters),e.getSynthesizedDeepClone(n.type),e.factory.converters.convertToFunctionBlock(c(n.body,i)))}function p(t,r,n,i){return "default"===r?e.makeImport(e.factory.createIdentifier(t),void 0,n,i):e.makeImport(void 0,[f(r,t)],n,i)}function f(t,r){return e.factory.createImportSpecifier(!1,void 0!==t&&t!==r?e.factory.createIdentifier(t):void 0,e.factory.createIdentifier(r))}function g(t,r,n){return e.factory.createVariableStatement(t,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(r,void 0,void 0,n)],2))}function m(t,r){return e.factory.createExportDeclaration(void 0,void 0,!1,t&&e.factory.createNamedExports(t),void 0===r?void 0:e.factory.createStringLiteral(r))}function y(e,t){return {newImports:e,useSitesToUnqualify:t}}t.registerCodeFix({errorCodes:[e.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions:function(o){var s=o.sourceFile,c=o.program,_=o.preferences,d=e.textChanges.ChangeTracker.with(o,(function(t){if(function(t,r,o,s,c){var _={original:u(t),additional:new e.Set},d=function(t,r,i){var a=new e.Map;return n(t,(function(t){var n=t.name,o=n.text,s=n.originalKeywordKind;!a.has(o)&&(void 0!==s&&e.isNonContextualKeyword(s)||r.resolveName(o,t,111551,!0))&&a.set(o,l("_".concat(o),i));})),a}(t,r,_);!function(t,r,i){n(t,(function(n,a){if(!a){var o=n.name.text;i.replaceNode(t,n,e.factory.createIdentifier(r.get(o)||o));}}));}(t,d,o);for(var p,f=!1,g=0,m=e.filter(t.statements,e.isVariableStatement);g<m.length;g++){var y=m[g],v=a(t,y,o,r,_,s,c);v&&e.copyEntries(v,null!=p?p:p=new e.Map);}for(var h=0,b=e.filter(t.statements,(function(t){return !e.isVariableStatement(t)}));h<b.length;h++){y=b[h];var x=i(t,y,r,o,_,s,d,p,c);f=f||x;}return null==p||p.forEach((function(e,r){o.replaceNode(t,r,e);})),f}(s,c.getTypeChecker(),t,e.getEmitScriptTarget(c.getCompilerOptions()),e.getQuotePreference(s,_)))for(var o=0,d=c.getSourceFiles();o<d.length;o++){var p=d[o];r(p,s,t,e.getQuotePreference(p,_));}}));return [t.createCodeFixActionWithoutFixAll("convertToEsModule",d,e.Diagnostics.Convert_to_ES_module)]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="correctQualifiedNameToIndexedAccessType",n=[e.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];function i(t,r){var n=e.findAncestor(e.getTokenAtPosition(t,r),e.isQualifiedName);return e.Debug.assert(!!n,"Expected position to be owned by a qualified name."),e.isIdentifier(n.left)?n:void 0}function a(t,r,n){var i=n.right.text,a=e.factory.createIndexedAccessTypeNode(e.factory.createTypeReferenceNode(n.left,void 0),e.factory.createLiteralTypeNode(e.factory.createStringLiteral(i)));t.replaceNode(r,n,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=i(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,n.sourceFile,o)})),c="".concat(o.left.text,'["').concat(o.right.text,'"]');return [t.createCodeFixAction(r,s,[e.Diagnostics.Rewrite_as_the_indexed_access_type_0,c],r,e.Diagnostics.Rewrite_all_as_indexed_access_types)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type.code],n="convertToTypeOnlyExport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isExportSpecifier)}function a(t,n,i){if(n){var a=n.parent,o=a.parent,s=function(t,n){var i=t.parent;if(1===i.elements.length)return i.elements;var a=e.getDiagnosticsWithinSpan(e.createTextSpanFromNode(i),n.program.getSemanticDiagnostics(n.sourceFile,n.cancellationToken));return e.filter(i.elements,(function(n){var i;return n===t||(null===(i=e.findDiagnosticForNode(n,a))||void 0===i?void 0:i.code)===r[0]}))}(n,i);if(s.length===a.elements.length)t.insertModifierBefore(i.sourceFile,151,a);else {var c=e.factory.updateExportDeclaration(o,o.decorators,o.modifiers,!1,e.factory.updateNamedExports(a,e.filter(a.elements,(function(t){return !e.contains(s,t)}))),o.moduleSpecifier,void 0),l=e.factory.createExportDeclaration(void 0,void 0,!0,e.factory.createNamedExports(s),o.moduleSpecifier,void 0);t.replaceNode(i.sourceFile,o,c,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude}),t.insertNodeAfter(i.sourceFile,o,l);}}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.span,r.sourceFile),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_export,n,e.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r,n.sourceFile);s&&e.addToSeen(o,e.getNodeId(s.parent.parent))&&a(t,s,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error.code],n="convertToTypeOnlyImport";function i(t,r){return e.tryCast(e.getTokenAtPosition(r,t.start).parent,e.isImportDeclaration)}function a(t,r,n){if(null==r?void 0:r.importClause){var i=r.importClause;t.insertText(n.sourceFile,r.getStart()+"import".length," type"),i.name&&i.namedBindings&&(t.deleteNodeRangeExcludingEnd(n.sourceFile,i.name,r.importClause.namedBindings),t.insertNodeBefore(n.sourceFile,r,e.factory.updateImportDeclaration(r,void 0,void 0,e.factory.createImportClause(!0,i.name,void 0),r.moduleSpecifier,void 0)));}}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){a(e,i(r.span,r.sourceFile),r);}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Convert_to_type_only_import,n,e.Diagnostics.Convert_all_imports_not_used_as_a_value_to_type_only_imports)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(r,e.sourceFile),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="convertLiteralTypeToMappedType",n=[e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=e.cast(n.parent.parent,e.isPropertySignature),a=n.getText(t);return {container:e.cast(i.parent,e.isTypeLiteralNode),typeNode:i.type,constraint:a,name:"K"===a?"P":"K"}}}function a(t,r,n){var i=n.container,a=n.typeNode,o=n.constraint,s=n.name;t.replaceNode(r,i,e.factory.createMappedTypeNode(void 0,e.factory.createTypeParameterDeclaration(s,e.factory.createTypeReferenceNode(o)),void 0,void 0,a,void 0));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=c.name,u=c.constraint,_=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,_,[e.Diagnostics.Convert_0_to_1_in_0,u,l],r,e.Diagnostics.Convert_all_type_literals_to_mapped_type)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Class_0_incorrectly_implements_interface_1.code,e.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],n="fixClassIncorrectlyImplementsInterface";function i(t,r){return e.Debug.checkDefined(e.getContainingClass(e.getTokenAtPosition(t,r)),"There should be a containing class")}function a(t){return !(t.valueDeclaration&&8&e.getEffectiveModifierFlags(t.valueDeclaration))}function o(r,n,i,o,s,c){var l=r.program.getTypeChecker(),u=function(t,r){var n=e.getEffectiveBaseTypeNode(t);if(!n)return e.createSymbolTable();var i=r.getTypeAtLocation(n),o=r.getPropertiesOfType(i);return e.createSymbolTable(o.filter(a))}(o,l),_=l.getTypeAtLocation(n),d=l.getPropertiesOfType(_).filter(e.and(a,(function(e){return !u.has(e.escapedName)}))),p=l.getTypeAtLocation(o),f=e.find(o.members,(function(t){return e.isConstructorDeclaration(t)}));p.getNumberIndexType()||m(_,1),p.getStringIndexType()||m(_,0);var g=t.createImportAdder(i,r.program,c,r.host);function m(e,n){var a=l.getIndexInfoOfType(e,n);a&&y(i,o,l.indexInfoToIndexSignatureDeclaration(a,o,void 0,t.getNoopSymbolTrackerWithResolver(r)));}function y(e,t,r){f?s.insertNodeAfter(e,f,r):s.insertNodeAtClassStart(e,t,r);}t.createMissingMemberNodes(o,d,i,r,c,g,(function(e){return y(i,o,e)})),g.writeFixes(s);}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=r.sourceFile,s=r.span,c=i(a,s.start);return e.mapDefined(e.getEffectiveImplementsTypeNodes(c),(function(i){var s=e.textChanges.ChangeTracker.with(r,(function(e){return o(r,i,a,c,e,r.preferences)}));return 0===s.length?void 0:t.createCodeFixAction(n,s,[e.Diagnostics.Implement_interface_0,i.getText(a)],n,e.Diagnostics.Implement_all_unimplemented_interfaces)}))},fixIds:[n],getAllCodeActions:function(n){var a=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);if(e.addToSeen(a,e.getNodeId(s)))for(var c=0,l=e.getEffectiveImplementsTypeNodes(s);c<l.length;c++){var u=l[c];o(n,u,r.file,s,t,n.preferences);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){t.importFixName="import";var r,a,o="fixMissingImport",s=[e.Diagnostics.Cannot_find_name_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics.Cannot_find_namespace_0.code,e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,e.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,e.Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];function c(t,r,n,i,a){var o=r.getCompilerOptions(),s=[],c=[],u=new e.Map,d=new e.Map;return {addImportFromDiagnostic:function(e,t){var r=m(t,e.code,e.start,n);r&&r.fixes.length&&p(r);},addImportFromExportedSymbol:function(s,c){var u=e.Debug.checkDefined(s.parent),d=e.getNameForExportedSymbol(s,e.getEmitScriptTarget(o)),g=r.getTypeChecker(),m=g.getMergedSymbol(e.skipAlias(s,g)),y=_(t,m,u,d,a,r,i,n),v=f(t,r),h=l(t,y,u,d,r,void 0,!!c,v,a,i);h&&p({fixes:[h],symbolName:d});},writeFixes:function(r){for(var n,a=e.getQuotePreference(t,i),l=0,_=s;l<_.length;l++){var p=_[l];D(r,t,p);}for(var f=0,g=c;f<g.length;f++)p=g[f],S(r,t,p,a);u.forEach((function(n){var i=n.importClauseOrBindingPattern,a=n.defaultImport,s=n.namedImports;x(r,t,i,a,e.arrayFrom(s.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),o);})),d.forEach((function(t,r){var i=t.useRequire,o=t.defaultImport,s=t.namedImports,c=t.namespaceLikeImport,l=(i?k:E)(r.slice(2),a,o,s&&e.arrayFrom(s.entries(),(function(e){var t=e[0];return {addAsTypeOnly:e[1],name:t}})),c);n=e.combine(n,l);})),n&&e.insertImports(r,t,n,!0);},hasFixes:function(){return s.length>0||c.length>0||u.size>0||d.size>0}};function p(t){var r,n,i=t.fixes,a=t.symbolName,o=e.first(i);switch(o.kind){case 0:s.push(o);break;case 1:c.push(o);break;case 2:var l=o.importClauseOrBindingPattern,_=o.importKind,p=o.addAsTypeOnly,f=String(e.getNodeId(l));if((v=u.get(f))||u.set(f,v={importClauseOrBindingPattern:l,defaultImport:void 0,namedImports:new e.Map}),0===_){var g=null==v?void 0:v.namedImports.get(a);v.namedImports.set(a,h(g,p));}else e.Debug.assert(void 0===v.defaultImport||v.defaultImport.name===a,"(Add to Existing) Default import should be missing or match symbolName"),v.defaultImport={name:a,addAsTypeOnly:h(null===(r=v.defaultImport)||void 0===r?void 0:r.addAsTypeOnly,p)};break;case 3:var m=o.moduleSpecifier,y=(_=o.importKind,o.useRequire),v=function(e,t,r,n){var i=b(e,!0),a=b(e,!1),o=d.get(i),s=d.get(a),c={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:r};return 1===t&&2===n?o||(d.set(i,c),c):1===n&&(o||s)?o||s:s||(d.set(a,c),c)}(m,_,y,p=o.addAsTypeOnly);switch(e.Debug.assert(v.useRequire===y,"(Add new) Tried to add an `import` and a `require` for the same module"),_){case 1:e.Debug.assert(void 0===v.defaultImport||v.defaultImport.name===a,"(Add new) Default import should be missing or match symbolName"),v.defaultImport={name:a,addAsTypeOnly:h(null===(n=v.defaultImport)||void 0===n?void 0:n.addAsTypeOnly,p)};break;case 0:g=(v.namedImports||(v.namedImports=new e.Map)).get(a),v.namedImports.set(a,h(g,p));break;case 3:case 2:e.Debug.assert(void 0===v.namespaceLikeImport||v.namespaceLikeImport.name===a,"Namespacelike import shoudl be missing or match symbolName"),v.namespaceLikeImport={importKind:_,name:a,addAsTypeOnly:p};}break;default:e.Debug.assertNever(o,"fix wasn't never - got kind ".concat(o.kind));}function h(e,t){return Math.max(null!=e?e:0,t)}function b(e,t){return "".concat(t?1:0,"|").concat(e)}}}function l(t,r,n,i,a,o,s,c,l,u){return e.Debug.assert(r.some((function(e){return e.moduleSymbol===n||e.symbol.parent===n})),"Some exportInfo should match the specified moduleSymbol"),y(d(r,i,o,s,c,a,t,l,u),t,a,l,u)}function u(t,r,n,i){var a,o,s=n.getCompilerOptions(),c=u(n.getTypeChecker(),!1);if(c)return c;var l=null===(o=null===(a=i.getPackageJsonAutoImportProvider)||void 0===a?void 0:a.call(i))||void 0===o?void 0:o.getTypeChecker();return e.Debug.checkDefined(l&&u(l,!0),"Could not find symbol in specified module for code actions");function u(n,i){var a=e.getDefaultLikeExportInfo(r,n,s);if(a&&e.skipAlias(a.symbol,n)===t)return {symbol:a.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:a.exportKind,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i};var o=n.tryGetMemberInModuleExportsAndProperties(t.name,r);return o&&e.skipAlias(o,n)===t?{symbol:o,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:e.skipAlias(t,n).flags,isFromPackageJson:i}:void 0}}function _(t,r,n,i,a,o,s,c){var l=[],u=o.getCompilerOptions(),_=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?a.getPackageJsonAutoImportProvider():o,a)}));return e.forEachExternalModuleToImportFrom(o,a,c,(function(a,o,s,c){var _=s.getTypeChecker();if(!o||a===n||!e.startsWith(t.fileName,e.getDirectoryPath(o.fileName))){var p=e.getDefaultLikeExportInfo(a,_,u);p&&(p.name===i||A(a,e.getEmitScriptTarget(u))===i)&&e.skipAlias(p.symbol,_)===r&&d(s,o,c)&&l.push({symbol:p.symbol,moduleSymbol:a,moduleFileName:null==o?void 0:o.fileName,exportKind:p.exportKind,targetFlags:e.skipAlias(p.symbol,_).flags,isFromPackageJson:c});for(var f=0,g=_.getExportsAndPropertiesOfModule(a);f<g.length;f++){var m=g[f];m.name===i&&_.getMergedSymbol(e.skipAlias(m,_))===r&&d(s,o,c)&&l.push({symbol:m,moduleSymbol:a,moduleFileName:null==o?void 0:o.fileName,exportKind:0,targetFlags:e.skipAlias(m,_).flags,isFromPackageJson:c});}}})),l;function d(r,n,i){var o;return !n||e.isImportableFile(r,t,n,s,void 0,_(i),null===(o=a.getModuleSpecifierCache)||void 0===o?void 0:o.call(a))}}function d(t,r,i,a,o,s,c,l,u){var _=s.getTypeChecker(),d=e.flatMap(t,(function(t){return function(t,r,n,i){var a=t.moduleSymbol,o=t.exportKind,s=t.targetFlags,c=t.symbol;if(!(111551&s)&&e.isSourceFileJS(n))return e.emptyArray;var l=h(n,o,i);return e.mapDefined(n.imports,(function(t){var n=e.importFromModuleSpecifier(t);return e.isRequireVariableDeclaration(n.parent)?r.resolveExternalModuleName(t)===a?{declaration:n.parent,importKind:l,symbol:c,targetFlags:s}:void 0:265!==n.kind&&264!==n.kind||r.getSymbolAtLocation(t)!==a?void 0:{declaration:n,importKind:l,symbol:c,targetFlags:s}}))}(t,_,c,s.getCompilerOptions())})),f=void 0===i?void 0:function(t,r,n,i){return e.firstDefined(t,(function(t){var a=t.declaration,o=function(t){var r,n,i;switch(t.kind){case 253:return null===(r=e.tryCast(t.name,e.isIdentifier))||void 0===r?void 0:r.text;case 264:return t.name.text;case 265:return null===(i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport))||void 0===i?void 0:i.name.text;default:return e.Debug.assertNever(t)}}(a),s=e.tryGetModuleSpecifierFromDeclaration(a);if(o&&s){var c=function(t,r){var n;switch(t.kind){case 253:return r.resolveExternalModuleName(t.initializer.arguments[0]);case 264:return r.getAliasedSymbol(t.symbol);case 265:var i=e.tryCast(null===(n=t.importClause)||void 0===n?void 0:n.namedBindings,e.isNamespaceImport);return i&&r.getAliasedSymbol(i.symbol);default:return e.Debug.assertNever(t)}}(a,i);if(c&&c.exports.has(e.escapeLeadingUnderscores(r)))return {kind:0,namespacePrefix:o,position:n,moduleSpecifier:s}}}))}(d,r,i,_),m=function(t,r,n,i){return e.firstDefined(t,(function(t){var a=t.declaration,o=t.importKind,s=t.symbol,c=t.targetFlags;if(3!==o&&2!==o&&264!==a.kind){if(253===a.kind)return 0!==o&&1!==o||200!==a.name.kind?void 0:{kind:2,importClauseOrBindingPattern:a.name,importKind:o,moduleSpecifier:a.initializer.arguments[0].text,addAsTypeOnly:4};var l=a.importClause;if(l&&e.isStringLiteralLike(a.moduleSpecifier)){var u=l.name,_=l.namedBindings;if(!l.isTypeOnly||0===o&&_){var d=p(r,!1,s,c,n,i);if(!(1===o&&(u||2===d&&_)||0===o&&267===(null==_?void 0:_.kind)))return {kind:2,importClauseOrBindingPattern:l,importKind:o,moduleSpecifier:a.moduleSpecifier.text,addAsTypeOnly:d}}}}}))}(d,a,_,s.getCompilerOptions()),y=m?[m]:function(t,r,n,i,a,o,s,c,l){var u=e.firstDefined(r,(function(t){return function(t,r,n,i,a){var o=t.declaration,s=t.importKind,c=t.symbol,l=t.targetFlags,u=e.tryGetModuleSpecifierFromDeclaration(o);if(u)return {kind:3,moduleSpecifier:u,importKind:s,addAsTypeOnly:n?4:p(r,!0,c,l,i,a),useRequire:n}}(t,o,s,n.getTypeChecker(),n.getCompilerOptions())}));return u?[u]:g(n,i,a,o,s,t,c,l).fixes}(t,d,s,c,i,a,o,l,u);return n$3(n$3([],f?[f]:e.emptyArray,!0),y,!0)}function p(e,t,r,n,i,a){return e?t&&2===a.importsNotUsedAsValues?2:!a.isolatedModules||!a.preserveValueImports||111551&n&&!i.getTypeOnlyAliasDeclaration(r)?1:2:4}function f(t,r){if(!e.isSourceFileJS(t))return !1;if(t.commonJsModuleIndicator&&!t.externalModuleIndicator)return !0;if(t.externalModuleIndicator&&!t.commonJsModuleIndicator)return !1;var n=r.getCompilerOptions();if(n.configFile)return e.getEmitModuleKind(n)<e.ModuleKind.ES2015;for(var i=0,a=r.getSourceFiles();i<a.length;i++){var o=a[i];if(o!==t&&e.isSourceFileJS(o)&&!r.isSourceFileFromExternalLibrary(o)){if(o.commonJsModuleIndicator&&!o.externalModuleIndicator)return !0;if(o.externalModuleIndicator&&!o.commonJsModuleIndicator)return !1}}return !0}function g(t,r,n,i,a,o,s,c,l){var u=e.isSourceFileJS(r),_=t.getCompilerOptions(),d=e.createModuleSpecifierResolutionHost(t,s),f=e.memoizeOne((function(e){return e?s.getPackageJsonAutoImportProvider().getTypeChecker():t.getTypeChecker()})),g=l?function(t){return {moduleSpecifiers:e.moduleSpecifiers.tryGetModuleSpecifiersFromCache(t,r,d,c),computedWithoutCache:!1}}:function(t,n){return e.moduleSpecifiers.getModuleSpecifiersWithCacheInfo(t,n,_,r,d,c)},m=0,y=e.flatMap(o,(function(e){var t=f(e.isFromPackageJson),o=g(e.moduleSymbol,t),s=o.computedWithoutCache,c=o.moduleSpecifiers,l=!!(111551&e.targetFlags),d=p(i,!0,e.symbol,e.targetFlags,t,_);return m+=s?1:0,null==c?void 0:c.map((function(t){return !l&&u&&void 0!==n?{kind:1,moduleSpecifier:t,position:n,exportInfo:e}:{kind:3,moduleSpecifier:t,importKind:h(r,e.exportKind,_),useRequire:a,addAsTypeOnly:d,exportInfo:e}}))}));return {computedWithoutCacheCount:m,fixes:y}}function m(t,r,n,a){var o,s,c,l,u,_,p=e.getTokenAtPosition(t.sourceFile,n),g=r===e.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code?function(t,r){var n=t.sourceFile,i=t.program,a=t.host,o=t.preferences,s=i.getTypeChecker(),c=function(t,r){var n=e.isIdentifier(t)?r.getSymbolAtLocation(t):void 0;if(e.isUMDExportSymbol(n))return n;var i=t.parent;return e.isJsxOpeningLikeElement(i)&&i.tagName===t||e.isJsxOpeningFragment(i)?e.tryCast(r.resolveName(r.getJsxNamespace(i),e.isJsxOpeningLikeElement(i)?t:i,111551,!1),e.isUMDExportSymbol):void 0}(r,s);if(c){var l=s.getAliasedSymbol(c),u=c.name,_=[{symbol:c,moduleSymbol:l,moduleFileName:void 0,exportKind:3,targetFlags:l.flags,isFromPackageJson:!1}],p=f(n,i);return {fixes:d(_,u,e.isIdentifier(r)?r.getStart(n):void 0,!1,p,i,n,a,o),symbolName:u}}}(t,p):e.isIdentifier(p)?function(t,r,n){var i=t.sourceFile,a=t.program,o=t.cancellationToken,s=t.host,c=t.preferences,l=a.getTypeChecker(),u=a.getCompilerOptions(),_=function(t,r,n,i){var a,o=n.parent;if((e.isJsxOpeningLikeElement(o)||e.isJsxClosingElement(o))&&o.tagName===n&&(2===(a=i.jsx)||3===a)){var s=r.getJsxNamespace(t);if(e.isIntrinsicJsxName(n.text)||!r.resolveName(s,o,111551,!0))return s}return n.text}(i,l,r,u);e.Debug.assert("default"!==_,"'default' isn't a legal identifier and couldn't occur here");var p=e.isValidTypeOnlyAliasUseSite(r),g=f(i,a),m=function(t,r,n,i,a,o,s,c){var l,u=e.createMultiMap(),_=e.createPackageJsonImportFilter(i,c,s),d=null===(l=s.getModuleSpecifierCache)||void 0===l?void 0:l.call(s),p=e.memoizeOne((function(t){return e.createModuleSpecifierResolutionHost(t?s.getPackageJsonAutoImportProvider():a,s)}));function f(t,r,n,a,o,s){var l=p(s);if(r&&e.isImportableFile(o,i,r,c,_,l,d)||!r&&_.allowsImportingAmbientModule(t,l)){var f=o.getTypeChecker();u.add(e.getUniqueSymbolId(n,f).toString(),{symbol:n,moduleSymbol:t,moduleFileName:null==r?void 0:r.fileName,exportKind:a,targetFlags:e.skipAlias(n,f).flags,isFromPackageJson:s});}}return e.forEachExternalModuleToImportFrom(a,s,o,(function(i,a,o,s){var c=o.getTypeChecker();n.throwIfCancellationRequested();var l=o.getCompilerOptions(),u=e.getDefaultLikeExportInfo(i,c,l);u&&(u.name===t||A(i,e.getEmitScriptTarget(l))===t)&&F(u.symbolForMeaning,r)&&f(i,a,u.symbol,u.exportKind,o,s);var _=c.tryGetMemberInModuleExportsAndProperties(t,i);_&&F(_,r)&&f(i,a,_,0,o,s);})),u}(_,e.getMeaningFromLocation(r),o,i,a,n,s,c);return {fixes:e.arrayFrom(e.flatMapIterator(m.entries(),(function(e){return d(e[1],_,r.getStart(i),p,g,a,i,s,c)}))),symbolName:_}}(t,p,a):void 0;return g&&i$1(i$1({},g),{fixes:(o=g.fixes,s=t.sourceFile,c=t.program,l=t.host,u=t.preferences,_=e.createPackageJsonImportFilter(s,u,l).allowsImportingSpecifier,e.sort(o,(function(t,r){return e.compareValues(t.kind,r.kind)||v(t,r,s,c,_)})))})}function y(t,r,n,i,a){if(e.some(t)){if(0===t[0].kind||2===t[0].kind)return t[0];var o=e.createPackageJsonImportFilter(r,a,i).allowsImportingSpecifier;return t.reduce((function(e,t){return -1===v(t,e,r,n,o)?t:e}))}}function v(t,r,n,i,a){return 0!==t.kind&&0!==r.kind?e.compareBooleans(a(r.moduleSpecifier),a(t.moduleSpecifier))||function(t,r,n,i){return e.startsWith(t,"node:")&&!e.startsWith(r,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?-1:1:e.startsWith(r,"node:")&&!e.startsWith(t,"node:")?e.shouldUseUriStyleNodeCoreModules(n,i)?1:-1:0}(t.moduleSpecifier,r.moduleSpecifier,n,i)||e.compareNumberOfDirectorySeparators(t.moduleSpecifier,r.moduleSpecifier):0}function h(t,r,n,i){switch(r){case 0:return 0;case 1:return 1;case 2:return function(t,r,n){var i=e.getAllowSyntheticDefaultImports(r),a=e.isInJSFile(t);if(!a&&e.getEmitModuleKind(r)>=e.ModuleKind.ES2015)return i?1:2;if(a)return e.isExternalModule(t)||n?i?1:2:3;for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];if(e.isImportEqualsDeclaration(c)&&!e.nodeIsMissing(c.moduleReference))return 3}return i?1:3}(t,n,!!i);case 3:return function(t,r,n){if(e.getAllowSyntheticDefaultImports(r))return 1;var i=e.getEmitModuleKind(r);switch(i){case e.ModuleKind.AMD:case e.ModuleKind.CommonJS:case e.ModuleKind.UMD:return e.isInJSFile(t)&&(e.isExternalModule(t)||n)?2:3;case e.ModuleKind.System:case e.ModuleKind.ES2015:case e.ModuleKind.ES2020:case e.ModuleKind.ES2022:case e.ModuleKind.ESNext:case e.ModuleKind.None:return 2;case e.ModuleKind.Node12:case e.ModuleKind.NodeNext:return t.impliedNodeFormat===e.ModuleKind.ESNext?2:3;default:return e.Debug.assertNever(i,"Unexpected moduleKind ".concat(i))}}(t,n,!!i);default:return e.Debug.assertNever(r)}}function b(r,n,i,a,s,c){var l,u=e.textChanges.ChangeTracker.with(r,(function(t){l=function(t,r,n,i,a,o){switch(i.kind){case 0:return D(t,r,i),[e.Diagnostics.Change_0_to_1,n,"".concat(i.namespacePrefix,".").concat(n)];case 1:return S(t,r,i,a),[e.Diagnostics.Change_0_to_1,n,T(i.moduleSpecifier,a)+n];case 2:var s=i.importClauseOrBindingPattern,c=i.importKind,l=i.addAsTypeOnly,u=i.moduleSpecifier;x(t,r,s,1===c?{name:n,addAsTypeOnly:l}:void 0,0===c?[{name:n,addAsTypeOnly:l}]:e.emptyArray,o);var _=e.stripQuotes(u);return [1===c?e.Diagnostics.Add_default_import_0_to_existing_import_declaration_from_1:e.Diagnostics.Add_0_to_existing_import_declaration_from_1,n,_];case 3:c=i.importKind,u=i.moduleSpecifier,l=i.addAsTypeOnly;var d=i.useRequire?k:E,p=1===c?{name:n,addAsTypeOnly:l}:void 0,f=0===c?[{name:n,addAsTypeOnly:l}]:void 0,g=2===c||3===c?{importKind:c,name:n,addAsTypeOnly:l}:void 0;return e.insertImports(t,r,d(u,a,p,f,g),!0),[1===c?e.Diagnostics.Import_default_0_from_module_1:e.Diagnostics.Import_0_from_module_1,n,u];default:return e.Debug.assertNever(i,"Unexpected fix kind ".concat(i.kind))}}(t,n,i,a,s,c);}));return t.createCodeFixAction(t.importFixName,u,l,o,e.Diagnostics.Add_all_missing_imports)}function x(t,r,i,a,o,s){var c;if(200!==i.kind){var l=i.isTypeOnly&&e.some(n$3([a],o,!0),(function(e){return 4===(null==e?void 0:e.addAsTypeOnly)})),u=i.namedBindings&&(null===(c=e.tryCast(i.namedBindings,e.isNamedImports))||void 0===c?void 0:c.elements),_=l&&s.preserveValueImports&&s.isolatedModules;if(a&&(e.Debug.assert(!i.name,"Cannot add a default import to an import clause that already has one"),t.insertNodeAt(r,i.getStart(r),e.factory.createIdentifier(a.name),{suffix:", "})),o.length){var d=e.stableSort(o.map((function(t){return e.factory.createImportSpecifier((!i.isTypeOnly||l)&&C(t),void 0,e.factory.createIdentifier(t.name))})),e.OrganizeImports.compareImportOrExportSpecifiers);if((null==u?void 0:u.length)&&e.OrganizeImports.importSpecifiersAreSorted(u))for(var p=0,f=d;p<f.length;p++){var g=f[p],m=_&&!g.isTypeOnly?0:e.OrganizeImports.getImportSpecifierInsertionIndex(u,g),y=i.namedBindings.elements[m-1];y?t.insertNodeInListAfter(r,y,g):t.insertNodeBefore(r,u[0],g,!e.positionsAreOnSameLine(u[0].getStart(),i.parent.getStart(),r));}else if(null==u?void 0:u.length)for(var v=0,h=d;v<h.length;v++)g=h[v],t.insertNodeInListAfter(r,e.last(u),g,u);else if(d.length){var b=e.factory.createNamedImports(d);i.namedBindings?t.replaceNode(r,i.namedBindings,b):t.insertNodeAfter(r,e.Debug.checkDefined(i.name,"Import clause must have either named imports or a default import"),b);}}if(l&&(t.delete(r,e.getTypeKeywordOfTypeOnlyImport(i,r)),_&&u))for(var x=0,D=u;x<D.length;x++)E=D[x],t.insertModifierBefore(r,151,E);}else {a&&k(i,a.name,"default");for(var S=0,T=o;S<T.length;S++){var E=T[S];k(i,E.name,void 0);}}function k(n,i,a){var o=e.factory.createBindingElement(void 0,a,i);n.elements.length?t.insertNodeInListAfter(r,e.last(n.elements),o):t.replaceNode(r,n,e.factory.createObjectBindingPattern([o]));}}function D(e,t,r){var n=r.namespacePrefix,i=r.position;e.insertText(t,i,n+".");}function S(e,t,r,n){var i=r.moduleSpecifier,a=r.position;e.insertText(t,a,T(i,n));}function T(t,r){var n=e.getQuoteFromPreference(r);return "import(".concat(n).concat(t).concat(n,").")}function C(e){return 2===e.addAsTypeOnly}function E(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(void 0!==n||(null==i?void 0:i.length)){var c=(!n||C(n))&&e.every(i,C);o=e.combine(o,e.makeImport(n&&e.factory.createIdentifier(n.name),null==i?void 0:i.map((function(t){var r=t.addAsTypeOnly,n=t.name;return e.factory.createImportSpecifier(!c&&2===r,void 0,e.factory.createIdentifier(n))})),t,r,c));}if(a){var l=3===a.importKind?e.factory.createImportEqualsDeclaration(void 0,void 0,C(a),e.factory.createIdentifier(a.name),e.factory.createExternalModuleReference(s)):e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(C(a),void 0,e.factory.createNamespaceImport(e.factory.createIdentifier(a.name))),s,void 0);o=e.combine(o,l);}return e.Debug.checkDefined(o)}function k(t,r,n,i,a){var o,s=e.makeStringLiteral(t,r);if(n||(null==i?void 0:i.length)){var c=(null==i?void 0:i.map((function(t){var r=t.name;return e.factory.createBindingElement(void 0,void 0,r)})))||[];n&&c.unshift(e.factory.createBindingElement(void 0,"default",n.name));var l=N(e.factory.createObjectBindingPattern(c),s);o=e.combine(o,l);}return a&&(l=N(a.name,s),o=e.combine(o,l)),e.Debug.checkDefined(o)}function N(t,r){return e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration("string"==typeof t?e.factory.createIdentifier(t):t,void 0,void 0,e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[r]))],2))}function F(t,r){var n=t.declarations;return e.some(n,(function(t){return !!(e.getMeaningFromDeclaration(t)&r)}))}function A(t,r){return P(e.removeFileExtension(e.stripQuotes(t.name)),r)}function P(t,r){var n=e.getBaseFileName(e.removeSuffix(t,"/index")),i="",a=!0,o=n.charCodeAt(0);e.isIdentifierStart(o,r)?i+=String.fromCharCode(o):a=!1;for(var s=1;s<n.length;s++){var c=n.charCodeAt(s),l=e.isIdentifierPart(c,r);if(l){var u=String.fromCharCode(c);a||(u=u.toUpperCase()),i+=u;}a=l;}return e.isStringANonContextualKeyword(i)?"_".concat(i):i||"_"}t.registerCodeFix({errorCodes:s,getCodeActions:function(t){var r=t.errorCode,n=t.preferences,i=t.sourceFile,a=t.span,o=t.program,s=m(t,r,a.start,!0);if(s){var c=s.fixes,l=s.symbolName,u=e.getQuotePreference(i,n);return c.map((function(e){return b(t,i,l,e,u,o.getCompilerOptions())}))}},fixIds:[o],getAllCodeActions:function(r){var n=c(r.sourceFile,r.program,!0,r.preferences,r.host);return t.eachDiagnostic(r,s,(function(e){return n.addImportFromDiagnostic(e,r)})),t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,n.writeFixes))}}),t.createImportAdder=function(e,t,r,n){return c(e,t,!1,r,n)},function(e){e[e.UseNamespace=0]="UseNamespace",e[e.JsdocTypeImport=1]="JsdocTypeImport",e[e.AddToExisting=2]="AddToExisting",e[e.AddNew=3]="AddNew";}(r||(r={})),function(e){e[e.Allowed=1]="Allowed",e[e.Required=2]="Required",e[e.NotAllowed=4]="NotAllowed";}(a||(a={})),t.getImportCompletionAction=function(t,r,n,i,a,o,s,c,d){var p,g,m,y,v=o.getCompilerOptions(),h=e.pathIsBareSpecifier(e.stripQuotes(r.name))?[u(t,r,o,a)]:_(n,t,r,i,a,o,d,!0),x=f(n,o),D=e.isValidTypeOnlyAliasUseSite(e.getTokenAtPosition(n,c)),S=e.Debug.checkDefined(l(n,h,r,i,o,c,D,x,a,d));return {moduleSpecifier:S.moduleSpecifier,codeAction:(p=b({host:a,formatContext:s,preferences:d},n,i,S,e.getQuotePreference(n,d),v),g=p.description,m=p.changes,y=p.commands,{description:g,changes:m,commands:y})}},t.getModuleSpecifierForBestExportInfo=function(e,t,r,n,a,o){var s=g(r,t,void 0,!1,!1,e,n,a,o),c=s.fixes,l=s.computedWithoutCacheCount,u=y(c,t,r,n,a);return u&&i$1(i$1({},u),{computedWithoutCacheCount:l})},t.getImportKind=h,t.moduleSymbolToValidIdentifier=A,t.moduleSpecifierToValidIdentifier=P;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="fixOverrideModifier",i="fixAddOverrideModifier",a="fixRemoveOverrideModifier",o=[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code],s=((r={})[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Add_all_missing_override_modifiers],r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]=[e.Diagnostics.Remove_override_modifier,a,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r[e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Add_all_missing_override_modifiers],r[e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]=[e.Diagnostics.Add_override_modifier,i,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r[e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]=[e.Diagnostics.Remove_override_modifier,a,e.Diagnostics.Remove_all_unnecessary_override_modifiers],r);function c(t,r,n,i){switch(n){case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case e.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case e.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:return function(t,r,n){var i=u(r,n),a=i.modifiers||e.emptyArray,o=e.find(a,e.isStaticModifier),s=e.find(a,e.isAbstractModifier),c=e.find(a,(function(t){return e.isAccessibilityModifier(t.kind)})),l=s?s.end:o?o.end:c?c.end:i.decorators?e.skipTrivia(r.text,i.decorators.end):i.getStart(r),_=c||o||s?{prefix:" "}:{suffix:" "};t.insertModifierAt(r,l,158,_);}(t,r.sourceFile,i);case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case e.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:return function(t,r,n){var i=u(r,n),a=i.modifiers&&e.find(i.modifiers,(function(e){return 158===e.kind}));e.Debug.assertIsDefined(a),t.deleteModifier(r,a);}(t,r.sourceFile,i);default:e.Debug.fail("Unexpected error code: "+n);}}function l(t){switch(t.kind){case 170:case 166:case 168:case 171:case 172:return !0;case 163:return e.isParameterPropertyDeclaration(t,t.parent);default:return !1}}function u(t,r){var n=e.getTokenAtPosition(t,r),i=e.findAncestor(n,(function(t){return e.isClassLike(t)?"quit":l(t)}));return e.Debug.assert(i&&l(i)),i}t.registerCodeFix({errorCodes:o,getCodeActions:function(r){var i=r.errorCode,a=r.span,o=r.sourceFile,l=s[i];if(!l)return e.emptyArray;var u=l[0],_=l[1],d=l[2];if(e.isSourceFileJS(o))return e.emptyArray;var p=e.textChanges.ChangeTracker.with(r,(function(e){return c(e,r,i,a.start)}));return [t.createCodeFixActionMaybeFixAll(n,p,u,_,d)]},fixIds:[n,i,a],getAllCodeActions:function(r){return t.codeFixAll(r,o,(function(t,n){var i=n.code,a=n.start,o=n.file,l=s[i];l&&l[1]===r.fixId&&!e.isSourceFileJS(o)&&c(t,r,i,a);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixNoPropertyAccessFromIndexSignature",n=[e.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];function i(t,r,n,i){var a=e.getQuotePreference(r,i),o=e.factory.createStringLiteral(n.name.text,0===a);t.replaceNode(r,n,e.isPropertyAccessChain(n)?e.factory.createElementAccessChain(n.expression,n.questionDotToken,o):e.factory.createElementAccessExpression(n.expression,o));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isPropertyAccessExpression)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=n.preferences,l=a(o,s.start),u=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,l,c)}));return [t.createCodeFixAction(r,u,[e.Diagnostics.Use_element_access_for_0,l.name.text],r,e.Diagnostics.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,r.file,a(r.file,r.start),e.preferences)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixImplicitThis",n=[e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function i(t,r,n,i){var a=e.getTokenAtPosition(r,n);e.Debug.assert(108===a.kind);var o=e.getThisContainer(a,!1);if((e.isFunctionDeclaration(o)||e.isFunctionExpression(o))&&!e.isSourceFile(e.getThisContainer(o,!1))){var s=e.Debug.assertDefined(e.findChildOfKind(o,98,r)),c=o.name,l=e.Debug.assertDefined(o.body);if(e.isFunctionExpression(o)){if(c&&e.FindAllReferences.Core.isSymbolReferencedInFile(c,i,r,l))return;return t.delete(r,s),c&&t.delete(r,c),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_expression_0_to_arrow_function,c?c.text:e.ANONYMOUS]}return t.replaceNode(r,s,e.factory.createToken(85)),t.insertText(r,c.end," = "),t.insertText(r,l.pos," =>"),[e.Diagnostics.Convert_function_declaration_0_to_arrow_function,c.text]}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a,o=n.sourceFile,s=n.program,c=n.span,l=e.textChanges.ChangeTracker.with(n,(function(e){a=i(e,o,c.start,s.getTypeChecker());}));return a?[t.createCodeFixAction(r,l,a,r,e.Diagnostics.Fix_all_implicit_this_errors)]:e.emptyArray},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){i(t,r.file,r.start,e.program.getTypeChecker());}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixIncorrectNamedTupleSyntax",n=[e.Diagnostics.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,e.Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=function(t,r){var n=e.getTokenAtPosition(t,r);return e.findAncestor(n,(function(e){return 196===e.kind}))}(i,a.start),s=e.textChanges.ChangeTracker.with(n,(function(t){return function(t,r,n){if(n){for(var i=n.type,a=!1,o=!1;184===i.kind||185===i.kind||190===i.kind;)184===i.kind?a=!0:185===i.kind&&(o=!0),i=i.type;var s=e.factory.updateNamedTupleMember(n,n.dotDotDotToken||(o?e.factory.createToken(25):void 0),n.name,n.questionToken||(a?e.factory.createToken(57):void 0),i);s!==n&&t.replaceNode(r,n,s);}}(t,i,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels,r,e.Diagnostics.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[r]});}(t),function(e){!function(t){var r="fixSpelling",n=[e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code,e.Diagnostics.Could_not_find_name_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_namespace_0_Did_you_mean_1.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,e.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,e.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,e.Diagnostics.No_overload_matches_this_call.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code];function i(t,r,n,i){var a=e.getTokenAtPosition(t,r),o=a.parent;if(i!==e.Diagnostics.No_overload_matches_this_call.code&&i!==e.Diagnostics.Type_0_is_not_assignable_to_type_1.code||e.isJsxAttribute(o)){var s,c=n.program.getTypeChecker();if(e.isPropertyAccessExpression(o)&&o.name===a){e.Debug.assert(e.isMemberName(a),"Expected an identifier for spelling (property access)");var l=c.getTypeAtLocation(o.expression);32&o.flags&&(l=c.getNonNullableType(l)),s=c.getSuggestedSymbolForNonexistentProperty(a,l);}else if(e.isBinaryExpression(o)&&101===o.operatorToken.kind&&o.left===a&&e.isPrivateIdentifier(a)){var u=c.getTypeAtLocation(o.right);s=c.getSuggestedSymbolForNonexistentProperty(a,u);}else if(e.isQualifiedName(o)&&o.right===a){var _=c.getSymbolAtLocation(o.left);_&&1536&_.flags&&(s=c.getSuggestedSymbolForNonexistentModule(o.right,_));}else if(e.isImportSpecifier(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for spelling (import)");var d=function(t,r,n){if(n&&e.isStringLiteralLike(n.moduleSpecifier)){var i=e.getResolvedModule(t,n.moduleSpecifier.text,e.getModeForUsageLocation(t,n.moduleSpecifier));return i?r.program.getSourceFile(i.resolvedFileName):void 0}}(t,n,e.findAncestor(a,e.isImportDeclaration));d&&d.symbol&&(s=c.getSuggestedSymbolForNonexistentModule(a,d.symbol));}else if(e.isJsxAttribute(o)&&o.name===a){e.Debug.assertNode(a,e.isIdentifier,"Expected an identifier for JSX attribute");var p=e.findAncestor(a,e.isJsxOpeningLikeElement),f=c.getContextualTypeForArgumentAtIndex(p,0);s=c.getSuggestedSymbolForNonexistentJSXAttribute(a,f);}else if(e.hasSyntacticModifier(o,16384)&&e.isClassElement(o)&&o.name===a){var g=e.findAncestor(a,e.isClassLike),m=g?e.getEffectiveBaseTypeNode(g):void 0,y=m?c.getTypeAtLocation(m):void 0;y&&(s=c.getSuggestedSymbolForNonexistentClassMember(e.getTextOfNode(a),y));}else {var v=e.getMeaningFromLocation(a),h=e.getTextOfNode(a);e.Debug.assert(void 0!==h,"name should be defined"),s=c.getSuggestedSymbolForNonexistentSymbol(a,h,function(e){var t=0;return 4&e&&(t|=1920),2&e&&(t|=788968),1&e&&(t|=111551),t}(v));}return void 0===s?void 0:{node:a,suggestedSymbol:s}}}function a(t,r,n,i,a){var o=e.symbolName(i);if(!e.isIdentifierText(o,a)&&e.isPropertyAccessExpression(n.parent)){var s=i.valueDeclaration;s&&e.isNamedDeclaration(s)&&e.isPrivateIdentifier(s.name)?t.replaceNode(r,n,e.factory.createIdentifier(o)):t.replaceNode(r,n.parent,e.factory.createElementAccessExpression(n.parent.expression,e.factory.createStringLiteral(o)));}else t.replaceNode(r,n,e.factory.createIdentifier(o));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.errorCode,c=i(o,n.span.start,n,s);if(c){var l=c.node,u=c.suggestedSymbol,_=e.getEmitScriptTarget(n.host.getCompilationSettings()),d=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,l,u,_)}));return [t.createCodeFixAction("spelling",d,[e.Diagnostics.Change_spelling_to_0,e.symbolName(u)],r,e.Diagnostics.Fix_all_detected_spelling_errors)]}},fixIds:[r],getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){var o=i(n.file,n.start,r,n.code),s=e.getEmitScriptTarget(r.host.getCompilationSettings());o&&a(t,r.sourceFile,o.node,o.suggestedSymbol,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,n="returnValueCorrect",i="fixAddReturnStatement",a="fixRemoveBracesFromArrowFunctionBody",o="fixWrapTheBlockWithParen",s=[e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];function c(t,r,n){var i=t.createSymbol(4,r.escapedText);i.type=t.getTypeAtLocation(n);var a=e.createSymbolTable([i]);return t.createAnonymousType(void 0,a,[],[],[])}function l(t,n,i,a){if(n.body&&e.isBlock(n.body)&&1===e.length(n.body.statements)){var o=e.first(n.body.statements);if(e.isExpressionStatement(o)&&u(t,n,t.getTypeAtLocation(o.expression),i,a))return {declaration:n,kind:r.MissingReturnStatement,expression:o.expression,statement:o,commentSource:o.expression};if(e.isLabeledStatement(o)&&e.isExpressionStatement(o.statement)){var s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(o.label,o.statement.expression)]);if(u(t,n,c(t,o.label,o.statement.expression),i,a))return e.isArrowFunction(n)?{declaration:n,kind:r.MissingParentheses,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:o.statement.expression}}else if(e.isBlock(o)&&1===e.length(o.statements)){var l=e.first(o.statements);if(e.isLabeledStatement(l)&&e.isExpressionStatement(l.statement)&&(s=e.factory.createObjectLiteralExpression([e.factory.createPropertyAssignment(l.label,l.statement.expression)]),u(t,n,c(t,l.label,l.statement.expression),i,a)))return {declaration:n,kind:r.MissingReturnStatement,expression:s,statement:o,commentSource:l}}}}function u(t,r,n,i,a){if(a){var o=t.getSignatureFromDeclaration(r);if(o){e.hasSyntacticModifier(r,256)&&(n=t.createPromiseType(n));var s=t.createSignature(r,o.typeParameters,o.thisParameter,o.parameters,n,void 0,o.minArgumentCount,o.flags);n=t.createAnonymousType(void 0,e.createSymbolTable(),[s],[],[]);}else n=t.getAnyType();}return t.isTypeAssignableTo(n,i)}function _(t,r,n,i){var a=e.getTokenAtPosition(r,n);if(a.parent){var o=e.findAncestor(a.parent,e.isFunctionLikeDeclaration);switch(i){case e.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code:if(!(o&&o.body&&o.type&&e.rangeContainsRange(o.type,a)))return;return l(t,o,t.getTypeFromTypeNode(o.type),!1);case e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!o||!e.isCallExpression(o.parent)||!o.body)return;var s=o.parent.arguments.indexOf(o),c=t.getContextualTypeForArgumentAtIndex(o.parent,s);if(!c)return;return l(t,o,c,!0);case e.Diagnostics.Type_0_is_not_assignable_to_type_1.code:if(!e.isDeclarationName(a)||!e.isVariableLike(a.parent)&&!e.isJsxAttribute(a.parent))return;var u=function(t){switch(t.kind){case 253:case 163:case 202:case 166:case 294:return t.initializer;case 284:return t.initializer&&(e.isJsxExpression(t.initializer)?t.initializer.expression:void 0);case 295:case 165:case 297:case 345:case 338:return}}(a.parent);if(!u||!e.isFunctionLikeDeclaration(u)||!u.body)return;return l(t,u,t.getTypeAtLocation(a.parent),!0)}}}function d(t,r,n,i){e.suppressLeadingAndTrailingTrivia(n);var a=e.probablyUsesSemicolons(r);t.replaceNode(r,i,e.factory.createReturnStatement(n),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,suffix:a?";":void 0});}function p(t,r,n,i,a,o){var s=o||e.needsParentheses(i)?e.factory.createParenthesizedExpression(i):i;e.suppressLeadingAndTrailingTrivia(a),e.copyComments(a,s),t.replaceNode(r,n.body,s);}function f(t,r,n,i){t.replaceNode(r,n.body,e.factory.createParenthesizedExpression(i));}function g(r,a,o){var s=e.textChanges.ChangeTracker.with(r,(function(e){return d(e,r.sourceFile,a,o)}));return t.createCodeFixAction(n,s,e.Diagnostics.Add_a_return_statement,i,e.Diagnostics.Add_all_missing_return_statement)}function m(r,i,a){var s=e.textChanges.ChangeTracker.with(r,(function(e){return f(e,r.sourceFile,i,a)}));return t.createCodeFixAction(n,s,e.Diagnostics.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,o,e.Diagnostics.Wrap_all_object_literal_with_parentheses)}!function(e){e[e.MissingReturnStatement=0]="MissingReturnStatement",e[e.MissingParentheses=1]="MissingParentheses";}(r||(r={})),t.registerCodeFix({errorCodes:s,fixIds:[i,a,o],getCodeActions:function(i){var o=i.program,s=i.sourceFile,c=i.span.start,l=i.errorCode,u=_(o.getTypeChecker(),s,c,l);if(u)return u.kind===r.MissingReturnStatement?e.append([g(i,u.expression,u.statement)],e.isArrowFunction(u.declaration)?function(r,i,o,s){var c=e.textChanges.ChangeTracker.with(r,(function(e){return p(e,r.sourceFile,i,o,s,!1)}));return t.createCodeFixAction(n,c,e.Diagnostics.Remove_braces_from_arrow_function_body,a,e.Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}(i,u.declaration,u.expression,u.commentSource):void 0):[m(i,u.declaration,u.expression)]},getAllCodeActions:function(r){return t.codeFixAll(r,s,(function(t,n){var s=_(r.program.getTypeChecker(),n.file,n.start,n.code);if(s)switch(r.fixId){case i:d(t,n.file,s.expression,s.statement);break;case a:if(!e.isArrowFunction(s.declaration))return;p(t,n.file,s.declaration,s.expression,s.commentSource,!1);break;case o:if(!e.isArrowFunction(s.declaration))return;f(t,n.file,s.declaration,s.expression);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r,i="fixMissingMember",a="fixMissingProperties",o="fixMissingAttributes",s="fixMissingFunctionDeclaration",c=[e.Diagnostics.Property_0_does_not_exist_on_type_1.code,e.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,e.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,e.Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Cannot_find_name_0.code];function l(t,r,n,i,a){var o=e.getTokenAtPosition(t,r),s=o.parent;if(n===e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(18!==o.kind||!e.isObjectLiteralExpression(s)||!e.isCallExpression(s.parent))return;var c=e.findIndex(s.parent.arguments,(function(e){return e===s}));if(c<0)return;var l=e.singleOrUndefined(i.getSignaturesOfType(i.getTypeAtLocation(s.parent.expression),0));if(!(l&&l.declaration&&l.parameters[c]))return;var _=l.parameters[c].valueDeclaration;if(!(_&&e.isParameter(_)&&e.isIdentifier(_.name)))return;var d=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s),i.getTypeAtLocation(_),!1,!1));if(!e.length(d))return;return {kind:3,token:_.name,properties:d,indentation:0,parentDeclaration:s}}if(e.isMemberName(o)){if(e.isIdentifier(o)&&e.hasInitializer(s)&&s.initializer&&e.isObjectLiteralExpression(s.initializer)){if(d=e.arrayFrom(i.getUnmatchedProperties(i.getTypeAtLocation(s.initializer),i.getTypeAtLocation(o),!1,!1)),!e.length(d))return;return {kind:3,token:o,properties:d,indentation:void 0,parentDeclaration:s.initializer}}if(e.isIdentifier(o)&&e.isJsxOpeningLikeElement(o.parent)){var p=function(t,r){var n=t.getContextualType(r.attributes);if(void 0===n)return e.emptyArray;var i=n.getProperties();if(!e.length(i))return e.emptyArray;for(var a=new e.Set,o=0,s=r.attributes.properties;o<s.length;o++){var c=s[o];if(e.isJsxAttribute(c)&&a.add(c.name.escapedText),e.isJsxSpreadAttribute(c))for(var l=0,u=t.getTypeAtLocation(c.expression).getProperties();l<u.length;l++){var _=u[l];a.add(_.escapedName);}}return e.filter(i,(function(t){return !(16777216&t.flags||48&e.getCheckFlags(t)||a.has(t.escapedName))}))}(i,o.parent);if(!e.length(p))return;return {kind:4,token:o,attributes:p,parentDeclaration:o.parent}}if(e.isIdentifier(o)&&e.isCallExpression(s))return {kind:2,token:o,call:s,sourceFile:t,modifierFlags:0,parentDeclaration:t};if(e.isPropertyAccessExpression(s)){var f=e.skipConstraint(i.getTypeAtLocation(s.expression)),g=f.symbol;if(g&&g.declarations){if(e.isIdentifier(o)&&e.isCallExpression(s.parent)){var m=e.find(g.declarations,e.isModuleDeclaration),y=null==m?void 0:m.getSourceFile();if(m&&y&&!u(a,y))return {kind:2,token:o,call:s.parent,sourceFile:t,modifierFlags:1,parentDeclaration:m};var v=e.find(g.declarations,e.isSourceFile);if(t.commonJsModuleIndicator)return;if(v&&!u(a,v))return {kind:2,token:o,call:s.parent,sourceFile:v,modifierFlags:1,parentDeclaration:v}}var h=e.find(g.declarations,e.isClassLike);if(h||!e.isPrivateIdentifier(o)){var b=h||e.find(g.declarations,e.isInterfaceDeclaration);if(b&&!u(a,b.getSourceFile())){var x=(f.target||f)!==i.getDeclaredTypeOfSymbol(g);if(x&&(e.isPrivateIdentifier(o)||e.isInterfaceDeclaration(b)))return;var D=b.getSourceFile(),S=(x?32:0)|(e.startsWithUnderscore(o.text)?8:0),T=e.isSourceFileJS(D);return {kind:1,token:o,call:e.tryCast(s.parent,e.isCallExpression),modifierFlags:S,parentDeclaration:b,declSourceFile:D,isJSFile:T}}var C=e.find(g.declarations,e.isEnumDeclaration);return !C||e.isPrivateIdentifier(o)||u(a,C.getSourceFile())?void 0:{kind:0,token:o,parentDeclaration:C}}}}}}function u(e,t){return e.isSourceFileFromExternalLibrary(t)||e.isSourceFileDefaultLibrary(t)}function _(t,r,n,i,a){var o=i.text;if(a){if(225===n.kind)return;var s=n.name.getText(),c=d(e.factory.createIdentifier(s),o);t.insertNodeAfter(r,n,c);}else if(e.isPrivateIdentifier(i)){var l=e.factory.createPropertyDeclaration(void 0,void 0,o,void 0,void 0,void 0),u=g(n);u?t.insertNodeAfter(r,u,l):t.insertNodeAtClassStart(r,n,l);}else {var _=e.getFirstConstructorWithBody(n);if(!_)return;var p=d(e.factory.createThis(),o);t.insertNodeAtConstructorEnd(r,_,p);}}function d(t,r){return e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createPropertyAccessExpression(t,r),D()))}function p(t,r,n){var i;if(220===n.parent.parent.kind){var a=n.parent.parent,o=n.parent===a.left?a.right:a.left,s=t.getWidenedType(t.getBaseTypeOfLiteralType(t.getTypeAtLocation(o)));i=t.typeToTypeNode(s,r,1);}else {var c=t.getContextualType(n.parent);i=c?t.typeToTypeNode(c,void 0,1):void 0;}return i||e.factory.createKeywordTypeNode(130)}function f(t,r,n,i,a,o){var s=e.factory.createPropertyDeclaration(void 0,o?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(o)):void 0,i,void 0,a,void 0),c=g(n);c?t.insertNodeAfter(r,c,s):t.insertNodeAtClassStart(r,n,s);}function g(t){for(var r,n=0,i=t.members;n<i.length;n++){var a=i[n];if(!e.isPropertyDeclaration(a))break;r=a;}return r}function m(r,n,i,a,o,s,c){var l=t.createImportAdder(c,r.program,r.preferences,r.host),u=t.createSignatureDeclarationFromCallExpression(168,r,l,i,a,o,s),_=e.findAncestor(i,(function(t){return e.isMethodDeclaration(t)||e.isConstructorDeclaration(t)}));_&&_.parent===s?n.insertNodeAfter(c,_,u):n.insertNodeAtClassStart(c,s,u),l.writeFixes(n);}function y(t,r,n){var i=n.token,a=n.parentDeclaration,o=e.some(a.members,(function(e){var t=r.getTypeAtLocation(e);return !!(t&&402653316&t.flags)})),s=e.factory.createEnumMember(i,o?e.factory.createStringLiteral(i.text):void 0);t.replaceNode(a.getSourceFile(),a,e.factory.updateEnumDeclaration(a,a.decorators,a.modifiers,a.name,e.concatenate(a.members,e.singleElementArray(s))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude});}function v(r,n,i){var a=t.createImportAdder(n.sourceFile,n.program,n.preferences,n.host),o=t.createSignatureDeclarationFromCallExpression(255,n,a,i.call,e.idText(i.token),i.modifierFlags,i.parentDeclaration);r.insertNodeAtEndOfScope(i.sourceFile,i.parentDeclaration,o);}function h(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=i.program.getTypeChecker(),l=a.parentDeclaration.attributes,u=e.some(l.properties,e.isJsxSpreadAttribute),_=e.map(a.attributes,(function(t){var r=t.valueDeclaration?x(i,c,o,s,c.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createJsxAttribute(e.factory.createIdentifier(t.name),e.factory.createJsxExpression(void 0,r))})),d=e.factory.createJsxAttributes(u?n$3(n$3([],_,!0),l.properties,!0):n$3(n$3([],l.properties,!0),_,!0)),p={prefix:l.pos===l.end?" ":void 0};r.replaceNode(i.sourceFile,l,d,p);}function b(r,i,a){var o=t.createImportAdder(i.sourceFile,i.program,i.preferences,i.host),s=e.getQuotePreference(i.sourceFile,i.preferences),c=i.program.getTypeChecker(),l=e.map(a.properties,(function(t){var r=t.valueDeclaration?x(i,c,o,s,c.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createPropertyAssignment(t.name,r)})),u={leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Exclude,indentation:a.indentation};r.replaceNode(i.sourceFile,a.parentDeclaration,e.factory.createObjectLiteralExpression(n$3(n$3([],a.parentDeclaration.properties,!0),l,!0),!0),u);}function x(r,n,i,a,o){if(3&o.flags)return D();if(134217732&o.flags)return e.factory.createStringLiteral("",0===a);if(8&o.flags)return e.factory.createNumericLiteral(0);if(64&o.flags)return e.factory.createBigIntLiteral("0n");if(16&o.flags)return e.factory.createFalse();if(1056&o.flags){var s=o.symbol.exports?e.firstOrUndefined(e.arrayFrom(o.symbol.exports.values())):o.symbol,c=n.symbolToExpression(o.symbol.parent?o.symbol.parent:o.symbol,111551,void 0,void 0);return void 0===s||void 0===c?e.factory.createNumericLiteral(0):e.factory.createPropertyAccessExpression(c,n.symbolToString(s))}if(256&o.flags)return e.factory.createNumericLiteral(o.value);if(2048&o.flags)return e.factory.createBigIntLiteral(o.value);if(128&o.flags)return e.factory.createStringLiteral(o.value,0===a);if(512&o.flags)return o===n.getFalseType()||o===n.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(65536&o.flags)return e.factory.createNull();if(1048576&o.flags){var l=e.firstDefined(o.types,(function(e){return x(r,n,i,a,e)}));return null!=l?l:D()}if(n.isArrayLikeType(o))return e.factory.createArrayLiteralExpression();if(function(t){return 524288&t.flags&&(128&e.getObjectFlags(t)||t.symbol&&e.tryCast(e.singleOrUndefined(t.symbol.declarations),e.isTypeLiteralNode))}(o)){var u=e.map(n.getPropertiesOfType(o),(function(t){var o=t.valueDeclaration?x(r,n,i,a,n.getTypeAtLocation(t.valueDeclaration)):D();return e.factory.createPropertyAssignment(t.name,o)}));return e.factory.createObjectLiteralExpression(u,!0)}if(16&e.getObjectFlags(o)){if(void 0===e.find(o.symbol.declarations||e.emptyArray,e.or(e.isFunctionTypeNode,e.isMethodSignature,e.isMethodDeclaration)))return D();var _=n.getSignaturesOfType(o,0);if(void 0===_)return D();var d=t.createSignatureDeclarationFromSignature(212,r,a,_[0],t.createStubbedBody(e.Diagnostics.Function_not_implemented.message,a),void 0,void 0,void 0,void 0,i);return null!=d?d:D()}if(1&e.getObjectFlags(o)){var p=e.getClassLikeDeclarationOfSymbol(o.symbol);if(void 0===p||e.hasAbstractModifier(p))return D();var f=e.getFirstConstructorWithBody(p);return f&&e.length(f.parameters)?D():e.factory.createNewExpression(e.factory.createIdentifier(o.symbol.name),void 0,void 0)}return D()}function D(){return e.factory.createIdentifier("undefined")}t.registerCodeFix({errorCodes:c,getCodeActions:function(r){var n=r.program.getTypeChecker(),c=l(r.sourceFile,r.span.start,r.errorCode,n,r.program);if(c){if(3===c.kind){var u=e.textChanges.ChangeTracker.with(r,(function(e){return b(e,r,c)}));return [t.createCodeFixAction(a,u,e.Diagnostics.Add_missing_properties,a,e.Diagnostics.Add_all_missing_properties)]}return 4===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return h(e,r,c)})),[t.createCodeFixAction(o,u,e.Diagnostics.Add_missing_attributes,o,e.Diagnostics.Add_all_missing_attributes)]):2===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return v(e,r,c)})),[t.createCodeFixAction(s,u,[e.Diagnostics.Add_missing_function_declaration_0,c.token.text],s,e.Diagnostics.Add_all_missing_function_declarations)]):0===c.kind?(u=e.textChanges.ChangeTracker.with(r,(function(e){return y(e,r.program.getTypeChecker(),c)})),[t.createCodeFixAction(i,u,[e.Diagnostics.Add_missing_enum_member_0,c.token.text],i,e.Diagnostics.Add_all_missing_members)]):e.concatenate(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=n.call;if(void 0!==l&&!e.isPrivateIdentifier(c)){var u=c.text,_=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return m(r,e,l,c,t,a,o)}))},d=[t.createCodeFixAction(i,_(32&s),[32&s?e.Diagnostics.Declare_static_method_0:e.Diagnostics.Declare_method_0,u],i,e.Diagnostics.Add_all_missing_members)];return 8&s&&d.unshift(t.createCodeFixActionWithoutFixAll(i,_(8),[e.Diagnostics.Declare_private_method_0,u])),d}}(r,c),function(r,n){return n.isJSFile?e.singleElementArray(function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token;if(!e.isInterfaceDeclaration(a)){var l=e.textChanges.ChangeTracker.with(r,(function(e){return _(e,o,a,c,!!(32&s))}));if(0!==l.length){var u=32&s?e.Diagnostics.Initialize_static_property_0:e.isPrivateIdentifier(c)?e.Diagnostics.Declare_a_private_field_named_0:e.Diagnostics.Initialize_property_0_in_the_constructor;return t.createCodeFixAction(i,l,[u,c.text],i,e.Diagnostics.Add_all_missing_members)}}}(r,n)):function(r,n){var a=n.parentDeclaration,o=n.declSourceFile,s=n.modifierFlags,c=n.token,l=c.text,u=32&s,_=p(r.program.getTypeChecker(),a,c),d=function(t){return e.textChanges.ChangeTracker.with(r,(function(e){return f(e,o,a,l,_,t)}))},g=[t.createCodeFixAction(i,d(32&s),[u?e.Diagnostics.Declare_static_property_0:e.Diagnostics.Declare_property_0,l],i,e.Diagnostics.Add_all_missing_members)];return u||e.isPrivateIdentifier(c)||(8&s&&g.unshift(t.createCodeFixActionWithoutFixAll(i,d(8),[e.Diagnostics.Declare_private_property_0,l])),g.push(function(r,n,a,o,s){var c=e.factory.createKeywordTypeNode(149),l=e.factory.createParameterDeclaration(void 0,void 0,void 0,"x",void 0,c,void 0),u=e.factory.createIndexSignature(void 0,void 0,[l],s),_=e.textChanges.ChangeTracker.with(r,(function(e){return e.insertNodeAtClassStart(n,a,u)}));return t.createCodeFixActionWithoutFixAll(i,_,[e.Diagnostics.Add_index_signature_for_property_0,o])}(r,o,a,c.text,_))),g}(r,n)}(r,c))}},fixIds:[i,s,a,o],getAllCodeActions:function(r){var n=r.program,i=r.fixId,u=n.getTypeChecker(),d=new e.Map,g=new e.Map;return t.createCombinedCodeActions(e.textChanges.ChangeTracker.with(r,(function(x){t.eachDiagnostic(r,c,(function(t){var n=l(t.file,t.start,t.code,u,r.program);if(n&&e.addToSeen(d,e.getNodeId(n.parentDeclaration)+"#"+n.token.text))if(i===s&&2===n.kind)v(x,r,n);else if(i===a&&3===n.kind)b(x,r,n);else if(i===o&&4===n.kind)h(x,r,n);else if(0===n.kind&&y(x,u,n),1===n.kind){var c=n.parentDeclaration,_=n.token,p=e.getOrUpdate(g,c,(function(){return []}));p.some((function(e){return e.token.text===_.text}))||p.push(n);}})),g.forEach((function(i,a){for(var o=t.getAllSupers(a,u),s=function(t){if(o.some((function(e){var r=g.get(e);return !!r&&r.some((function(e){return e.token.text===t.token.text}))})))return "continue";var i=t.parentDeclaration,a=t.declSourceFile,s=t.modifierFlags,c=t.token,l=t.call,u=t.isJSFile;if(l&&!e.isPrivateIdentifier(c))m(r,x,l,c,32&s,i,a);else if(u&&!e.isInterfaceDeclaration(i))_(x,a,i,c,!!(32&s));else {var d=p(n.getTypeChecker(),i,c);f(x,a,i,c.text,d,32&s);}},c=0,l=i;c<l.length;c++)s(l[c]);}));})))}}),function(e){e[e.Enum=0]="Enum",e[e.ClassOrInterface=1]="ClassOrInterface",e[e.Function=2]="Function",e[e.ObjectLiteral=3]="ObjectLiteral",e[e.JsxAttributes=4]="JsxAttributes";}(r||(r={}));}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addMissingNewOperator",n=[e.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];function i(t,r,n){var i=e.cast(function(t,r){for(var n=e.getTokenAtPosition(t,r.start),i=e.textSpanEnd(r);n.end<i;)n=n.parent;return n}(r,n),e.isCallExpression),a=e.factory.createNewExpression(i.expression,i.typeArguments,i.arguments);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.sourceFile,o=n.span,s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_new_operator_to_call,r,e.Diagnostics.Add_missing_new_operator_to_all_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return i(t,e.sourceFile,r)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="installTypesPackage",n=e.Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations.code,i=[n,e.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code];function a(e,t){return {type:"install package",file:e,packageName:t}}function o(t,r){var n=e.tryCast(e.getTokenAtPosition(t,r),e.isStringLiteral);if(n){var i=n.text,a=e.parsePackageName(i).packageName;return e.isExternalModuleNameRelative(a)?void 0:a}}function s(t,r,i){var a;return i===n?e.JsTyping.nodeCoreModules.has(t)?"@types/node":void 0:(null===(a=r.isKnownTypesPackageName)||void 0===a?void 0:a.call(r,t))?e.getTypesPackageName(t):void 0}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.host,c=n.sourceFile,l=o(c,n.span.start);if(void 0!==l){var u=s(l,i,n.errorCode);return void 0===u?[]:[t.createCodeFixAction("fixCannotFindModule",[],[e.Diagnostics.Install_0,u],r,e.Diagnostics.Install_all_missing_types_packages,a(c.fileName,u))]}},fixIds:[r],getAllCodeActions:function(n){return t.codeFixAll(n,i,(function(t,i,c){var l=o(i.file,i.start);if(void 0!==l)switch(n.fixId){case r:var u=s(l,n.host,i.code);u&&c.push(a(i.file.fileName,u));break;default:e.Debug.fail("Bad fixId: ".concat(n.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,e.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code],n="fixClassDoesntImplementInheritedAbstractMember";function i(t,r){var n=e.getTokenAtPosition(t,r);return e.cast(n.parent,e.isClassLike)}function a(r,n,i,a,s){var c=e.getEffectiveBaseTypeNode(r),l=i.program.getTypeChecker(),u=l.getTypeAtLocation(c),_=l.getPropertiesOfType(u).filter(o),d=t.createImportAdder(n,i.program,s,i.host);t.createMissingMemberNodes(r,_,n,i,s,d,(function(e){return a.insertNodeAtClassStart(n,r,e)})),d.writeFixes(a);}function o(t){var r=e.getSyntacticModifierFlags(e.first(t.getDeclarations()));return !(8&r||!(128&r))}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var o=r.sourceFile,s=r.span,c=e.textChanges.ChangeTracker.with(r,(function(e){return a(i(o,s.start),o,r,e,r.preferences)}));return 0===c.length?void 0:[t.createCodeFixAction(n,c,e.Diagnostics.Implement_inherited_abstract_class,n,e.Diagnostics.Implement_all_inherited_abstract_classes)]},fixIds:[n],getAllCodeActions:function(n){var o=new e.Map;return t.codeFixAll(n,r,(function(t,r){var s=i(r.file,r.start);e.addToSeen(o,e.getNodeId(s))&&a(s,n.sourceFile,n,t,n.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="classSuperMustPrecedeThisAccess",n=[e.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];function i(e,t,r,n){e.insertNodeAtConstructorStart(t,r,n),e.delete(t,n);}function a(t,r){var n=e.getTokenAtPosition(t,r);if(108===n.kind){var i=e.getContainingFunction(n),a=o(i.body);return a&&!a.expression.arguments.some((function(t){return e.isPropertyAccessExpression(t)&&t.expression===n}))?{constructor:i,superCall:a}:void 0}}function o(t){return e.isExpressionStatement(t)&&e.isSuperCall(t.expression)?t:e.isFunctionLike(t)?void 0:e.forEachChild(t,o)}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=a(o,s.start);if(c){var l=c.constructor,u=c.superCall,_=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,o,l,u)}));return [t.createCodeFixAction(r,_,e.Diagnostics.Make_super_call_the_first_statement_in_the_constructor,r,e.Diagnostics.Make_all_super_calls_the_first_statement_in_their_constructor)]}},fixIds:[r],getAllCodeActions:function(r){var o=r.sourceFile,s=new e.Map;return t.codeFixAll(r,n,(function(t,r){var n=a(r.file,r.start);if(n){var c=n.constructor,l=n.superCall;e.addToSeen(s,e.getNodeId(c.parent))&&i(t,o,c,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="constructorForDerivedNeedSuperCall",n=[e.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(e.isConstructorDeclaration(n.parent),"token should be at the constructor declaration"),n.parent}function a(t,r,n){var i=e.factory.createExpressionStatement(e.factory.createCallExpression(e.factory.createSuper(),void 0,e.emptyArray));t.insertNodeAtConstructorStart(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_super_call,r,e.Diagnostics.Add_all_missing_super_calls)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="enableExperimentalDecorators",n=[e.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"experimentalDecorators",e.factory.createTrue());}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_experimentalDecorators_option_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixEnableJsxFlag",n=[e.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];function i(r,n){t.setJsonCompilerOptionValue(r,n,"jsx",e.factory.createStringLiteral("react"));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=n.program.getCompilerOptions().configFile;if(void 0!==a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,a)}));return [t.createCodeFixActionWithoutFixAll(r,o,e.Diagnostics.Enable_the_jsx_flag_in_your_configuration_file)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t){var r=e.program.getCompilerOptions().configFile;void 0!==r&&i(t,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t;(t=e.codefix||(e.codefix={})).registerCodeFix({errorCodes:[e.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,e.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(r){var n=r.program.getCompilerOptions(),i=n.configFile;if(void 0!==i){var a=[],o=e.getEmitModuleKind(n);if(o>=e.ModuleKind.ES2015&&o<e.ModuleKind.ESNext){var s=e.textChanges.ChangeTracker.with(r,(function(r){t.setJsonCompilerOptionValue(r,i,"module",e.factory.createStringLiteral("esnext"));}));a.push(t.createCodeFixActionWithoutFixAll("fixModuleOption",s,[e.Diagnostics.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]));}var c=e.getEmitScriptTarget(n);return (c<4||c>99)&&(s=e.textChanges.ChangeTracker.with(r,(function(r){if(e.getTsConfigObjectLiteralExpression(i)){var n=[["target",e.factory.createStringLiteral("es2017")]];o===e.ModuleKind.CommonJS&&n.push(["module",e.factory.createStringLiteral("commonjs")]),t.setJsonCompilerOptionValues(r,i,n);}})),a.push(t.createCodeFixActionWithoutFixAll("fixTargetOption",s,[e.Diagnostics.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))),a.length?a:void 0}}});}(t),function(e){!function(t){var r="fixPropertyAssignment",n=[e.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];function i(t,r,n){t.replaceNode(r,n,e.factory.createPropertyAssignment(n.name,n.objectAssignmentInitializer));}function a(t,r){return e.cast(e.getTokenAtPosition(t,r).parent,e.isShorthandPropertyAssignment)}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start),s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,[e.Diagnostics.Change_0_to_1,"=",":"],r,[e.Diagnostics.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,a(t.file,t.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="extendsInterfaceBecomesImplements",n=[e.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingClass(n).heritageClauses,a=i[0].getFirstToken();return 94===a.kind?{extendsToken:a,heritageClauses:i}:void 0}function a(t,r,n,i){if(t.replaceNode(r,n,e.factory.createToken(117)),2===i.length&&94===i[0].token&&117===i[1].token){var a=i[1].getFirstToken(),o=a.getFullStart();t.replaceRange(r,{pos:o,end:o},e.factory.createToken(27));for(var s=r.text,c=a.end;c<s.length&&e.isWhiteSpaceSingleLine(s.charCodeAt(c));)c++;t.deleteRange(r,{pos:a.getStart(),end:c});}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=s.extendsToken,l=s.heritageClauses,u=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,l)}));return [t.createCodeFixAction(r,u,e.Diagnostics.Change_extends_to_implements,r,e.Diagnostics.Change_all_extended_interfaces_to_implements)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=i(t.file,t.start);r&&a(e,t.file,r.extendsToken,r.heritageClauses);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="forgottenThisPropertyAccess",n=e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,i=[e.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,e.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,n];function a(t,r,i){var a=e.getTokenAtPosition(t,r);if(e.isIdentifier(a)||e.isPrivateIdentifier(a))return {node:a,className:i===n?e.getContainingClass(a).name.text:void 0}}function o(t,r,n){var i=n.node,a=n.className;e.suppressLeadingAndTrailingTrivia(i),t.replaceNode(r,i,e.factory.createPropertyAccessExpression(a?e.factory.createIdentifier(a):e.factory.createThis(),i));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=a(i,n.span.start,n.errorCode);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Add_0_to_unresolved_variable,s.className||"this"],r,e.Diagnostics.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){var n=a(r.file,r.start,r.code);n&&o(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixInvalidJsxCharacters_expression",n="fixInvalidJsxCharacters_htmlEntity",i=[e.Diagnostics.Unexpected_token_Did_you_mean_or_gt.code,e.Diagnostics.Unexpected_token_Did_you_mean_or_rbrace.code];t.registerCodeFix({errorCodes:i,fixIds:[r,n],getCodeActions:function(i){var a=i.sourceFile,s=i.preferences,c=i.span,l=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!1)})),u=e.textChanges.ChangeTracker.with(i,(function(e){return o(e,s,a,c.start,!0)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_invalid_character_in_an_expression_container,r,e.Diagnostics.Wrap_all_invalid_characters_in_an_expression_container),t.createCodeFixAction(n,u,e.Diagnostics.Convert_invalid_character_to_its_html_entity_code,n,e.Diagnostics.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(t,r){return o(t,e.preferences,r.file,r.start,e.fixId===n)}))}});var a={">":">","}":"}"};function o(t,r,n,i,o){var s=n.getText()[i];if(function(t){return e.hasProperty(a,t)}(s)){var c=o?a[s]:"{".concat(e.quote(n,r,s),"}");t.replaceRangeWithText(n,{pos:i,end:i+1},c);}}}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="unusedIdentifier",n="unusedIdentifier_prefix",i="unusedIdentifier_delete",a="unusedIdentifier_deleteImports",o="unusedIdentifier_infer",s=[e.Diagnostics._0_is_declared_but_its_value_is_never_read.code,e.Diagnostics._0_is_declared_but_never_used.code,e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code,e.Diagnostics.All_imports_in_import_declaration_are_unused.code,e.Diagnostics.All_destructured_elements_are_unused.code,e.Diagnostics.All_variables_are_unused.code,e.Diagnostics.All_type_parameters_are_unused.code];function c(t,r,n){t.replaceNode(r,n.parent,e.factory.createKeywordTypeNode(154));}function l(n,a){return t.createCodeFixAction(r,n,a,i,e.Diagnostics.Delete_all_unused_declarations)}function u(t,r,n){t.delete(r,e.Debug.checkDefined(e.cast(n.parent,e.isDeclarationWithTypeParameterChildren).typeParameters,"The type parameter to delete should exist"));}function _(e){return 100===e.kind||79===e.kind&&(269===e.parent.kind||266===e.parent.kind)}function d(t){return 100===t.kind?e.tryCast(t.parent,e.isImportDeclaration):void 0}function p(t,r){return e.isVariableDeclarationList(r.parent)&&e.first(r.parent.getChildren(t))===r}function f(e,t,r){e.delete(t,236===r.parent.kind?r.parent:r);}function g(t,r,n,i){r!==e.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code&&(137===i.kind&&(i=e.cast(i.parent,e.isInferTypeNode).typeParameter.name),e.isIdentifier(i)&&function(e){switch(e.parent.kind){case 163:case 162:return !0;case 253:switch(e.parent.parent.parent.kind){case 243:case 242:return !0}}return !1}(i)&&(t.replaceNode(n,i,e.factory.createIdentifier("_".concat(i.text))),e.isParameter(i.parent)&&e.getJSDocParameterTags(i.parent).forEach((function(r){e.isIdentifier(r.name)&&t.replaceNode(n,r.name,e.factory.createIdentifier("_".concat(r.name.text)));}))));}function m(t,r,n,i,a,o,s,c){!function(t,r,n,i,a,o,s,c){var l=t.parent;if(e.isParameter(l))!function(t,r,n,i,a,o,s,c){void 0===c&&(c=!1),function(t,r,n,i,a,o,s){var c=n.parent;switch(c.kind){case 168:case 170:var l=c.parameters.indexOf(n),u=e.isMethodDeclaration(c)?c.name:c,_=e.FindAllReferences.Core.getReferencedSymbolsForNode(c.pos,u,a,i,o);if(_)for(var d=0,p=_;d<p.length;d++)for(var f=0,g=p[d].references;f<g.length;f++){var m=g[f];if(1===m.kind){var y=e.isSuperKeyword(m.node)&&e.isCallExpression(m.node.parent)&&m.node.parent.arguments.length>l,h=e.isPropertyAccessExpression(m.node.parent)&&e.isSuperKeyword(m.node.parent.expression)&&e.isCallExpression(m.node.parent.parent)&&m.node.parent.parent.arguments.length>l,b=(e.isMethodDeclaration(m.node.parent)||e.isMethodSignature(m.node.parent))&&m.node.parent!==n.parent&&m.node.parent.parameters.length>l;if(y||h||b)return !1}}return !0;case 255:return !c.name||!function(t,r,n){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(n,t,r,(function(t){return e.isIdentifier(t)&&e.isCallExpression(t.parent)&&t.parent.arguments.indexOf(t)>=0}))}(t,r,c.name)||v(c,n,s);case 212:case 213:return v(c,n,s);case 172:return !1;default:return e.Debug.failBadSyntaxKind(c)}}(i,r,n,a,o,s,c)&&(n.modifiers&&n.modifiers.length>0&&(!e.isIdentifier(n.name)||e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,i,r))?n.modifiers.forEach((function(e){return t.deleteModifier(r,e)})):!n.initializer&&y(n,i,a)&&t.delete(r,n));}(r,n,l,i,a,o,s,c);else if(!(c&&e.isIdentifier(t)&&e.FindAllReferences.Core.isSymbolReferencedInFile(t,i,n))){var u=e.isImportClause(l)?t:e.isComputedPropertyName(l)?l.parent:l;e.Debug.assert(u!==n,"should not delete whole source file"),r.delete(n,u);}}(r,n,t,i,a,o,s,c),e.isIdentifier(r)&&e.FindAllReferences.Core.eachSymbolReferenceInFile(r,i,t,(function(r){var i;e.isPropertyAccessExpression(r.parent)&&r.parent.name===r&&(r=r.parent),!c&&(i=r,(e.isBinaryExpression(i.parent)&&i.parent.left===i||(e.isPostfixUnaryExpression(i.parent)||e.isPrefixUnaryExpression(i.parent))&&i.parent.operand===i)&&e.isExpressionStatement(i.parent.parent))&&n.delete(t,r.parent.parent);}));}function y(t,r,n){var i=t.parent.parameters.indexOf(t);return !e.FindAllReferences.Core.someSignatureUsage(t.parent,n,r,(function(e,t){return !t||t.arguments.length>i}))}function v(t,r,n){var i=t.parameters,a=i.indexOf(r);return e.Debug.assert(-1!==a,"The parameter should already be in the list"),n?i.slice(a+1).every((function(t){return e.isIdentifier(t.name)&&!t.symbol.isReferenced})):a===i.length-1}t.registerCodeFix({errorCodes:s,getCodeActions:function(i){var s=i.errorCode,y=i.sourceFile,v=i.program,h=i.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles(),D=e.getTokenAtPosition(y,i.span.start);if(e.isJSDocTemplateTag(D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D)})),e.Diagnostics.Remove_template_tag)];if(29===D.kind)return [l(T=e.textChanges.ChangeTracker.with(i,(function(e){return u(e,y,D)})),e.Diagnostics.Remove_type_parameters)];var S=d(D);if(S){var T=e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,S)}));return [t.createCodeFixAction(r,T,[e.Diagnostics.Remove_import_from_0,e.showModuleSpecifier(S)],a,e.Diagnostics.Delete_all_unused_imports)]}if(_(D)&&(F=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length)return [t.createCodeFixAction(r,F,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,D.getText(y)],a,e.Diagnostics.Delete_all_unused_imports)];if(e.isObjectBindingPattern(D.parent)||e.isArrayBindingPattern(D.parent)){if(e.isParameter(D.parent.parent)){var C=D.parent.elements,E=[C.length>1?e.Diagnostics.Remove_unused_declarations_for_Colon_0:e.Diagnostics.Remove_unused_declaration_for_Colon_0,e.map(C,(function(e){return e.getText(y)})).join(", ")];return [l(e.textChanges.ChangeTracker.with(i,(function(t){return function(t,r,n){e.forEach(n.elements,(function(e){return t.delete(r,e)}));}(t,y,D.parent)})),E)]}return [l(e.textChanges.ChangeTracker.with(i,(function(e){return e.delete(y,D.parent.parent)})),e.Diagnostics.Remove_unused_destructuring_declaration)]}if(p(y,D))return [l(e.textChanges.ChangeTracker.with(i,(function(e){return f(e,y,D.parent)})),e.Diagnostics.Remove_variable_statement)];var k=[];if(137===D.kind){T=e.textChanges.ChangeTracker.with(i,(function(e){return c(e,y,D)}));var N=e.cast(D.parent,e.isInferTypeNode).typeParameter.name.text;k.push(t.createCodeFixAction(r,T,[e.Diagnostics.Replace_infer_0_with_unknown,N],o,e.Diagnostics.Replace_all_unused_infer_with_unknown));}else {var F;(F=e.textChanges.ChangeTracker.with(i,(function(e){return m(y,D,e,b,x,v,h,!1)}))).length&&(N=e.isComputedPropertyName(D.parent)?D.parent:D,k.push(l(F,[e.Diagnostics.Remove_unused_declaration_for_Colon_0,N.getText(y)])));}var A=e.textChanges.ChangeTracker.with(i,(function(e){return g(e,s,y,D)}));return A.length&&k.push(t.createCodeFixAction(r,A,[e.Diagnostics.Prefix_0_with_an_underscore,D.getText(y)],n,e.Diagnostics.Prefix_all_unused_declarations_with_where_possible)),k},fixIds:[n,i,a,o],getAllCodeActions:function(r){var l=r.sourceFile,v=r.program,h=r.cancellationToken,b=v.getTypeChecker(),x=v.getSourceFiles();return t.codeFixAll(r,s,(function(t,s){var D=e.getTokenAtPosition(l,s.start);switch(r.fixId){case n:g(t,s.code,l,D);break;case a:var S=d(D);S?t.delete(l,S):_(D)&&m(l,D,t,b,x,v,h,!0);break;case i:if(137===D.kind||_(D))break;if(e.isJSDocTemplateTag(D))t.delete(l,D);else if(29===D.kind)u(t,l,D);else if(e.isObjectBindingPattern(D.parent)){if(D.parent.parent.initializer)break;e.isParameter(D.parent.parent)&&!y(D.parent.parent,b,x)||t.delete(l,D.parent.parent);}else {if(e.isArrayBindingPattern(D.parent.parent)&&D.parent.parent.parent.initializer)break;p(l,D)?f(t,l,D.parent):m(l,D,t,b,x,v,h,!0);}break;case o:137===D.kind&&c(t,l,D);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnreachableCode",n=[e.Diagnostics.Unreachable_code_detected.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n),s=e.findAncestor(o,e.isStatement);if(s.getStart(r)!==o.getStart(r)){var c=JSON.stringify({statementKind:e.Debug.formatSyntaxKind(s.kind),tokenKind:e.Debug.formatSyntaxKind(o.kind),errorCode:a,start:n,length:i});e.Debug.fail("Token and statement should start at the same point. "+c);}var l=(e.isBlock(s.parent)?s.parent:s).parent;if(!e.isBlock(s.parent)||s===e.first(s.parent.statements))switch(l.kind){case 238:if(l.elseStatement){if(e.isBlock(s.parent))break;return void t.replaceNode(r,s,e.factory.createBlock(e.emptyArray))}case 240:case 241:return void t.delete(r,l)}if(e.isBlock(s.parent)){var u=n+i,_=e.Debug.checkDefined(function(e,t){for(var r,n=0,i=e;n<i.length;n++){var a=i[n];if(!(a.pos<u))break;r=a;}return r}(e.sliceAfter(s.parent.statements,s)),"Some statement should be last");t.deleteNodeRange(r,s,_);}else t.delete(r,s);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start,n.span.length,n.errorCode)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unreachable_code,r,e.Diagnostics.Remove_all_unreachable_code)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start,t.length,t.code)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixUnusedLabel",n=[e.Diagnostics.Unused_label.code];function i(t,r,n){var i=e.getTokenAtPosition(r,n),a=e.cast(i.parent,e.isLabeledStatement),o=i.getStart(r),s=a.statement.getStart(r),c=e.positionsAreOnSameLine(o,s,r)?s:e.skipTrivia(r.text,e.findChildOfKind(a,58,r).end,!0);t.deleteRange(r,{pos:o,end:c});}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span.start)}));return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unused_label,r,e.Diagnostics.Remove_all_unused_labels)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t.start)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixJSDocTypes_plain",n="fixJSDocTypes_nullable",i=[e.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code];function a(e,t,r,n,i){e.replaceNode(t,r,i.typeToTypeNode(n,r,void 0));}function o(t,r,n){var i=e.findAncestor(e.getTokenAtPosition(t,r),s),a=i&&i.type;return a&&{typeNode:a,type:n.getTypeFromTypeNode(a)}}function s(e){switch(e.kind){case 228:case 173:case 174:case 255:case 171:case 175:case 194:case 168:case 167:case 163:case 166:case 165:case 172:case 258:case 210:case 253:return !0;default:return !1}}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var s=i.sourceFile,c=i.program.getTypeChecker(),l=o(s,i.span.start,c);if(l){var u=l.typeNode,_=l.type,d=u.getText(s),p=[f(_,r,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript)];return 312===u.kind&&p.push(f(c.getNullableType(_,32768),n,e.Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),p}function f(r,n,o){var l=e.textChanges.ChangeTracker.with(i,(function(e){return a(e,s,u,r,c)}));return t.createCodeFixAction("jdocTypes",l,[e.Diagnostics.Change_0_to_1,d,c.typeToString(r)],n,o)}},fixIds:[r,n],getAllCodeActions:function(e){var r=e.fixId,s=e.program,c=e.sourceFile,l=s.getTypeChecker();return t.codeFixAll(e,i,(function(e,t){var i=o(t.file,t.start,l);if(i){var s=i.typeNode,u=i.type,_=312===s.kind&&r===n?l.getNullableType(u,32768):u;a(e,c,s,_,l);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixMissingCallParentheses",n=[e.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];function i(e,t,r){e.replaceNodeWithText(t,r,"".concat(r.text,"()"));}function a(t,r){var n=e.getTokenAtPosition(t,r);if(e.isPropertyAccessExpression(n.parent)){for(var i=n.parent;e.isPropertyAccessExpression(i.parent);)i=i.parent;return i.name}if(e.isIdentifier(n))return n}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=a(n.sourceFile,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Add_missing_call_parentheses,r,e.Diagnostics.Add_all_missing_call_parentheses)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){var r=a(t.file,t.start);r&&i(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAwaitInSyncFunction",n=[e.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,e.Diagnostics.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code];function i(t,r){var n=e.getTokenAtPosition(t,r),i=e.getContainingFunction(n);if(i){var a,o;switch(i.kind){case 168:a=i.name;break;case 255:case 212:a=e.findChildOfKind(i,98,t);break;case 213:var s=i.typeParameters?29:20;a=e.findChildOfKind(i,s,t)||e.first(i.parameters);break;default:return}return a&&{insertBefore:a,returnType:(o=i,o.type?o.type:e.isVariableDeclaration(o.parent)&&o.parent.type&&e.isFunctionTypeNode(o.parent.type)?o.parent.type.type:void 0)}}}function a(t,r,n){var i=n.insertBefore,a=n.returnType;if(a){var o=e.getEntityNameFromTypeNode(a);o&&79===o.kind&&"Promise"===o.text||t.replaceNode(r,a,e.factory.createTypeReferenceNode("Promise",e.factory.createNodeArray([a])));}t.insertModifierBefore(r,131,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_async_modifier_to_containing_function,r,e.Diagnostics.Add_all_missing_async_modifiers)]}},fixIds:[r],getAllCodeActions:function(r){var o=new e.Map;return t.codeFixAll(r,n,(function(t,n){var s=i(n.file,n.start);s&&e.addToSeen(o,e.getNodeId(s.insertBefore))&&a(t,r.sourceFile,s);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],n="fixPropertyOverrideAccessor";function i(r,n,i,a,o){var s,c;if(a===e.Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)s=n,c=n+i;else if(a===e.Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){var l=o.program.getTypeChecker(),u=e.getTokenAtPosition(r,n).parent;e.Debug.assert(e.isAccessor(u),"error span of fixPropertyOverrideAccessor should only be on an accessor");var _=u.parent;e.Debug.assert(e.isClassLike(_),"erroneous accessors should only be inside classes");var d=e.singleOrUndefined(t.getAllSupers(_,l));if(!d)return [];var p=e.unescapeLeadingUnderscores(e.getTextOfPropertyName(u.name)),f=l.getPropertyOfType(l.getTypeAtLocation(d),p);if(!f||!f.valueDeclaration)return [];s=f.valueDeclaration.pos,c=f.valueDeclaration.end,r=e.getSourceFileOfNode(f.valueDeclaration);}else e.Debug.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+a);return t.generateAccessorFromProperty(r,o.program,s,c,o,e.Diagnostics.Generate_get_and_set_accessors.message)}t.registerCodeFix({errorCodes:r,getCodeActions:function(r){var a=i(r.sourceFile,r.span.start,r.span.length,r.errorCode,r);if(a)return [t.createCodeFixAction(n,a,e.Diagnostics.Generate_get_and_set_accessors,n,e.Diagnostics.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[n],getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){var n=i(r.file,r.start,r.length,r.code,e);if(n)for(var a=0,o=n;a<o.length;a++){var s=o[a];t.pushRaw(e.sourceFile,s);}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="inferFromUsage",i=[e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,e.Diagnostics.Member_0_implicitly_has_an_1_type.code,e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];function a(t,r){switch(t){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.isSetAccessorDeclaration(e.getContainingFunction(r))?e.Diagnostics.Infer_type_of_0_from_usage:e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Infer_parameter_types_from_usage;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return e.Diagnostics.Infer_this_type_of_0_from_usage;default:return e.Diagnostics.Infer_type_of_0_from_usage}}function o(r,n,i,a,o,d,m,y,v){if(e.isParameterPropertyModifier(i.kind)||79===i.kind||25===i.kind||108===i.kind){var h=i.parent,b=t.createImportAdder(n,o,v,y);switch(a=function(t){switch(t){case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case e.Diagnostics.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Variable_0_implicitly_has_an_1_type.code;case e.Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code;case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case e.Diagnostics._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case e.Diagnostics.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case e.Diagnostics.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return e.Diagnostics.Member_0_implicitly_has_an_1_type.code}return t}(a)){case e.Diagnostics.Member_0_implicitly_has_an_1_type.code:case e.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(e.isVariableDeclaration(h)&&m(h)||e.isPropertyDeclaration(h)||e.isPropertySignature(h))return s(r,b,n,h,o,y,d),b.writeFixes(r),h;if(e.isPropertyAccessExpression(h)){var x=p(h.name,o,d),D=e.getTypeNodeIfAccessible(x,h,o,y);if(D){var S=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(D),void 0);_(r,n,e.cast(h.parent.parent,e.isExpressionStatement),[S]);}return b.writeFixes(r),h}return;case e.Diagnostics.Variable_0_implicitly_has_an_1_type.code:var T=o.getTypeChecker().getSymbolAtLocation(i);return T&&T.valueDeclaration&&e.isVariableDeclaration(T.valueDeclaration)&&m(T.valueDeclaration)?(s(r,b,n,T.valueDeclaration,o,y,d),b.writeFixes(r),T.valueDeclaration):void 0}var C=e.getContainingFunction(i);if(void 0!==C){var E;switch(a){case e.Diagnostics.Parameter_0_implicitly_has_an_1_type.code:if(e.isSetAccessorDeclaration(C)){c(r,b,n,C,o,y,d),E=C;break}case e.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code:if(m(C)){var k=e.cast(h,e.isParameter);!function(t,r,n,i,a,o,s,c){if(e.isIdentifier(i.name)){var _=function(t,r,n,i){var a=f(t,r,n,i);return a&&g(n,a,i).parameters(t)||t.parameters.map((function(t){return {declaration:t,type:e.isIdentifier(t.name)?p(t.name,n,i):n.getTypeChecker().getAnyType()}}))}(a,n,o,c);if(e.Debug.assert(a.parameters.length===_.length,"Parameter count and inference count should match"),e.isInJSFile(a))u(t,n,_,o,s);else {var d=e.isArrowFunction(a)&&!e.findChildOfKind(a,20,n);d&&t.insertNodeBefore(n,e.first(a.parameters),e.factory.createToken(20));for(var m=0,y=_;m<y.length;m++){var v=y[m],h=v.declaration,b=v.type;!h||h.type||h.initializer||l(t,r,n,h,b,o,s);}d&&t.insertNodeAfter(n,e.last(a.parameters),e.factory.createToken(21));}}}(r,b,n,k,C,o,y,d),E=k;}break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case e.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:e.isGetAccessorDeclaration(C)&&e.isIdentifier(C.name)&&(l(r,b,n,C,p(C.name,o,d),o,y),E=C);break;case e.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:e.isSetAccessorDeclaration(C)&&(c(r,b,n,C,o,y,d),E=C);break;case e.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:e.textChanges.isThisTypeAnnotatable(C)&&m(C)&&(function(t,r,n,i,a,o){var s=f(n,r,i,o);if(s&&s.length){var c=g(i,s,o).thisParameter(),l=e.getTypeNodeIfAccessible(c,n,i,a);l&&(e.isInJSFile(n)?function(t,r,n,i){_(t,r,n,[e.factory.createJSDocThisTag(void 0,e.factory.createJSDocTypeExpression(i))]);}(t,r,n,l):t.tryInsertThisTypeAnnotation(r,n,l));}}(r,n,C,o,y,d),E=C);break;default:return e.Debug.fail(String(a))}return b.writeFixes(r),E}}}function s(t,r,n,i,a,o,s){e.isIdentifier(i.name)&&l(t,r,n,i,p(i.name,a,s),a,o);}function c(t,r,n,i,a,o,s){var c=e.firstOrUndefined(i.parameters);if(c&&e.isIdentifier(i.name)&&e.isIdentifier(c.name)){var _=p(i.name,a,s);_===a.getTypeChecker().getAnyType()&&(_=p(c.name,a,s)),e.isInJSFile(i)?u(t,n,[{declaration:c,type:_}],a,o):l(t,r,n,c,_,a,o);}}function l(r,n,i,a,o,s,c){var l=e.getTypeNodeIfAccessible(o,a,s,c);if(l)if(e.isInJSFile(i)&&165!==a.kind){var u=e.isVariableDeclaration(a)?e.tryCast(a.parent.parent,e.isVariableStatement):a;if(!u)return;var d=e.factory.createJSDocTypeExpression(l);_(r,i,u,[e.isGetAccessorDeclaration(a)?e.factory.createJSDocReturnTag(void 0,d,void 0):e.factory.createJSDocTypeTag(void 0,d,void 0)]);}else (function(r,n,i,a,o,s){var c=t.tryGetAutoImportableReferenceFromTypeNode(r,s);return !(!c||!a.tryInsertTypeAnnotation(i,n,c.typeNode))&&(e.forEach(c.symbols,(function(e){return o.addImportFromExportedSymbol(e,!0)})),!0)})(l,a,i,r,n,e.getEmitScriptTarget(s.getCompilerOptions()))||r.tryInsertTypeAnnotation(i,a,l);}function u(t,r,n,i,a){var o=n.length&&n[0].declaration.parent;if(o){var s=e.mapDefined(n,(function(t){var r=t.declaration;if(!r.initializer&&!e.getJSDocType(r)&&e.isIdentifier(r.name)){var n=t.type&&e.getTypeNodeIfAccessible(t.type,r,i,a);if(n){var o=e.factory.cloneNode(r.name);return e.setEmitFlags(o,3584),{name:e.factory.cloneNode(r.name),param:r,isOptional:!!t.isOptional,typeNode:n}}}}));if(s.length)if(e.isArrowFunction(o)||e.isFunctionExpression(o)){var c=e.isArrowFunction(o)&&!e.findChildOfKind(o,20,r);c&&t.insertNodeBefore(r,e.first(o.parameters),e.factory.createToken(20)),e.forEach(s,(function(n){var i=n.typeNode,a=n.param,o=e.factory.createJSDocTypeTag(void 0,e.factory.createJSDocTypeExpression(i)),s=e.factory.createJSDocComment(void 0,[o]);t.insertNodeAt(r,a.getStart(r),s,{suffix:" "});})),c&&t.insertNodeAfter(r,e.last(o.parameters),e.factory.createToken(21));}else {var l=e.map(s,(function(t){var r=t.name,n=t.typeNode,i=t.isOptional;return e.factory.createJSDocParameterTag(void 0,r,!!i,e.factory.createJSDocTypeExpression(n),!1,void 0)}));_(t,r,o,l);}}}function _(t,r,i,a){var o,s=e.flatMap(i.jsDoc,(function(t){return "string"==typeof t.comment?e.factory.createJSDocText(t.comment):t.comment})),c=e.flatMapToMutable(i.jsDoc,(function(e){return e.tags})),l=a.filter((function(t){return !c||!c.some((function(r,n){var i=function(t,r){if(t.kind===r.kind)switch(t.kind){case 338:var n=t,i=r;return e.isIdentifier(n.name)&&e.isIdentifier(i.name)&&n.name.escapedText===i.name.escapedText?e.factory.createJSDocParameterTag(void 0,i.name,!1,i.typeExpression,i.isNameFirst,n.comment):void 0;case 339:return e.factory.createJSDocReturnTag(void 0,r.typeExpression,t.comment)}}(r,t);return i&&(c[n]=i),!!i}))})),u=e.factory.createJSDocComment(e.factory.createNodeArray(e.intersperse(s,e.factory.createJSDocText("\n"))),e.factory.createNodeArray(n$3(n$3([],c||e.emptyArray,!0),l,!0))),_=213===i.kind?166===(o=i).parent.kind?o.parent:o.parent.parent:i;_.jsDoc=i.jsDoc,_.jsDocCache=i.jsDocCache,t.insertJsdocCommentBefore(r,_,u);}function d(t,r,n){return e.mapDefined(e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),n),(function(t){return 0!==t.kind?e.tryCast(t.node,e.isIdentifier):void 0}))}function p(e,t,r){return g(t,d(e,t,r),r).single()}function f(t,r,n,i){var a;switch(t.kind){case 170:a=e.findChildOfKind(t,134,r);break;case 213:case 212:var o=t.parent;a=(e.isVariableDeclaration(o)||e.isPropertyDeclaration(o))&&e.isIdentifier(o.name)?o.name:t.name;break;case 255:case 168:case 167:a=t.name;}if(a)return d(a,n,i)}function g(t,r,i){var a=t.getTypeChecker(),o={string:function(){return a.getStringType()},number:function(){return a.getNumberType()},Array:function(e){return a.createArrayType(e)},Promise:function(e){return a.createPromiseType(e)}},s=[a.getStringType(),a.getNumberType(),a.createArrayType(a.getAnyType()),a.createPromiseType(a.getAnyType())];return {single:function(){return f(l(r))},parameters:function(o){if(0!==r.length&&o.parameters){for(var s={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},c=0,_=r;c<_.length;c++){var p=_[c];i.throwIfCancellationRequested(),u(p,s);}var g=n$3(n$3([],s.constructs||[],!0),s.calls||[],!0);return o.parameters.map((function(r,n){for(var s=[],c=e.isRestParameter(r),u=!1,_=0,p=g;_<p.length;_++){var m=p[_];if(m.argumentTypes.length<=n)u=e.isInJSFile(o),s.push(a.getUndefinedType());else if(c)for(var y=n;y<m.argumentTypes.length;y++)s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[y]));else s.push(a.getBaseTypeOfLiteralType(m.argumentTypes[n]));}if(e.isIdentifier(r.name)){var v=l(d(r.name,t,i));s.push.apply(s,c?e.mapDefined(v,a.getElementTypeOfArrayType):v);}var h=f(s);return {type:c?a.createArrayType(h):h,isOptional:u&&!c,declaration:r}}))}},thisParameter:function(){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},n=0,a=r;n<a.length;n++){var o=a[n];i.throwIfCancellationRequested(),u(o,t);}return f(t.candidateThisTypes||e.emptyArray)}};function c(t){for(var r=new e.Map,n=0,i=t;n<i.length;n++){var a=i[n];a.properties&&a.properties.forEach((function(e,t){r.has(t)||r.set(t,[]),r.get(t).push(e);}));}var o=new e.Map;return r.forEach((function(e,t){o.set(t,c(e));})),{isNumber:t.some((function(e){return e.isNumber})),isString:t.some((function(e){return e.isString})),isNumberOrString:t.some((function(e){return e.isNumberOrString})),candidateTypes:e.flatMap(t,(function(e){return e.candidateTypes})),properties:o,calls:e.flatMap(t,(function(e){return e.calls})),constructs:e.flatMap(t,(function(e){return e.constructs})),numberIndex:e.forEach(t,(function(e){return e.numberIndex})),stringIndex:e.forEach(t,(function(e){return e.stringIndex})),candidateThisTypes:e.flatMap(t,(function(e){return e.candidateThisTypes})),inferredTypes:void 0}}function l(e){for(var t={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0},r=0,n=e;r<n.length;r++){var a=n[r];i.throwIfCancellationRequested(),u(a,t);}return g(t)}function u(t,r){for(;e.isRightSideOfQualifiedNameOrPropertyAccess(t);)t=t.parent;switch(t.parent.kind){case 237:!function(t,r){v(r,e.isCallExpression(t)?a.getVoidType():a.getAnyType());}(t,r);break;case 219:r.isNumber=!0;break;case 218:!function(e,t){switch(e.operator){case 45:case 46:case 40:case 54:t.isNumber=!0;break;case 39:t.isNumberOrString=!0;}}(t.parent,r);break;case 220:!function(t,r,n){switch(r.operatorToken.kind){case 42:case 41:case 43:case 44:case 47:case 48:case 49:case 50:case 51:case 52:case 65:case 67:case 66:case 68:case 69:case 73:case 74:case 78:case 70:case 72:case 71:case 40:case 29:case 32:case 31:case 33:var i=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&i.flags?v(n,i):n.isNumber=!0;break;case 64:case 39:var o=a.getTypeAtLocation(r.left===t?r.right:r.left);1056&o.flags?v(n,o):296&o.flags?n.isNumber=!0:402653316&o.flags?n.isString=!0:1&o.flags||(n.isNumberOrString=!0);break;case 63:case 34:case 36:case 37:case 35:v(n,a.getTypeAtLocation(r.left===t?r.right:r.left));break;case 101:t===r.left&&(n.isString=!0);break;case 56:case 60:t!==r.left||253!==t.parent.parent.kind&&!e.isAssignmentExpression(t.parent.parent,!0)||v(n,a.getTypeAtLocation(r.right));}}(t,t.parent,r);break;case 288:case 289:!function(e,t){v(t,a.getTypeAtLocation(e.parent.parent.expression));}(t.parent,r);break;case 207:case 208:t.parent.expression===t?function(e,t){var r={argumentTypes:[],return_:{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}};if(e.arguments)for(var n=0,i=e.arguments;n<i.length;n++){var o=i[n];r.argumentTypes.push(a.getTypeAtLocation(o));}u(e,r.return_),207===e.kind?(t.calls||(t.calls=[])).push(r):(t.constructs||(t.constructs=[])).push(r);}(t.parent,r):_(t,r);break;case 205:!function(t,r){var n=e.escapeLeadingUnderscores(t.name.text);r.properties||(r.properties=new e.Map);var i=r.properties.get(n)||{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(t,i),r.properties.set(n,i);}(t.parent,r);break;case 206:!function(e,t,r){if(t!==e.argumentExpression){var n=a.getTypeAtLocation(e.argumentExpression),i={isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0};u(e,i),296&n.flags?r.numberIndex=i:r.stringIndex=i;}else r.isNumberOrString=!0;}(t.parent,t,r);break;case 294:case 295:!function(t,r){var n=e.isVariableDeclaration(t.parent.parent)?t.parent.parent:t.parent;h(r,a.getTypeAtLocation(n));}(t.parent,r);break;case 166:!function(e,t){h(t,a.getTypeAtLocation(e.parent));}(t.parent,r);break;case 253:var n=t.parent,i=n.name,o=n.initializer;if(t===i){o&&v(r,a.getTypeAtLocation(o));break}default:return _(t,r)}}function _(t,r){e.isExpressionNode(t)&&v(r,a.getContextualType(t));}function p(e){return f(g(e))}function f(t){if(!t.length)return a.getAnyType();var r=a.getUnionType([a.getStringType(),a.getNumberType()]),n=function(t,r){for(var n=[],i=0,a=t;i<a.length;i++)for(var o=a[i],s=0,c=r;s<c.length;s++){var l=c[s],u=l.high,_=l.low;u(o)&&(e.Debug.assert(!_(o),"Priority can't have both low and high"),n.push(_));}return t.filter((function(e){return n.every((function(t){return !t(e)}))}))}(t,[{high:function(e){return e===a.getStringType()||e===a.getNumberType()},low:function(e){return e===r}},{high:function(e){return !(16385&e.flags)},low:function(e){return !!(16385&e.flags)}},{high:function(t){return !(114689&t.flags||16&e.getObjectFlags(t))},low:function(t){return !!(16&e.getObjectFlags(t))}}]),i=n.filter((function(t){return 16&e.getObjectFlags(t)}));return i.length&&(n=n.filter((function(t){return !(16&e.getObjectFlags(t))}))).push(function(t){if(1===t.length)return t[0];for(var r=[],n=[],i=[],o=[],s=!1,c=!1,l=e.createMultiMap(),u=0,_=t;u<_.length;u++){for(var d=_[u],p=0,f=a.getPropertiesOfType(d);p<f.length;p++){var g=f[p];l.add(g.name,g.valueDeclaration?a.getTypeOfSymbolAtLocation(g,g.valueDeclaration):a.getAnyType());}r.push.apply(r,a.getSignaturesOfType(d,0)),n.push.apply(n,a.getSignaturesOfType(d,1));var m=a.getIndexInfoOfType(d,0);m&&(i.push(m.type),s=s||m.isReadonly);var y=a.getIndexInfoOfType(d,1);y&&(o.push(y.type),c=c||y.isReadonly);}var v=e.mapEntries(l,(function(e,r){var n=r.length<t.length?16777216:0,i=a.createSymbol(4|n,e);return i.type=a.getUnionType(r),[e,i]})),h=[];return i.length&&h.push(a.createIndexInfo(a.getStringType(),a.getUnionType(i),s)),o.length&&h.push(a.createIndexInfo(a.getNumberType(),a.getUnionType(o),c)),a.createAnonymousType(t[0].symbol,v,r,n,h)}(i)),a.getWidenedType(a.getUnionType(n.map(a.getBaseTypeOfLiteralType),2))}function g(t){var r,n,i,c=[];return t.isNumber&&c.push(a.getNumberType()),t.isString&&c.push(a.getStringType()),t.isNumberOrString&&c.push(a.getUnionType([a.getStringType(),a.getNumberType()])),t.numberIndex&&c.push(a.createArrayType(p(t.numberIndex))),((null===(r=t.properties)||void 0===r?void 0:r.size)||(null===(n=t.calls)||void 0===n?void 0:n.length)||(null===(i=t.constructs)||void 0===i?void 0:i.length)||t.stringIndex)&&c.push(function(t){var r=new e.Map;t.properties&&t.properties.forEach((function(e,t){var n=a.createSymbol(4,t);n.type=p(e),r.set(t,n);}));var n=t.calls?[y(t.calls)]:[],i=t.constructs?[y(t.constructs)]:[],o=t.stringIndex?[a.createIndexInfo(a.getStringType(),p(t.stringIndex),!1)]:[];return a.createAnonymousType(void 0,r,n,i,o)}(t)),c.push.apply(c,(t.candidateTypes||[]).map((function(e){return a.getBaseTypeOfLiteralType(e)}))),c.push.apply(c,function(t){if(!t.properties||!t.properties.size)return [];var r=s.filter((function(r){return function(t,r){return !!r.properties&&!e.forEachEntry(r.properties,(function(r,n){var i,o=a.getTypeOfPropertyOfType(t,n);return !(o&&(r.calls?a.getSignaturesOfType(o,0).length&&a.isTypeAssignableTo(o,(i=r.calls,a.createAnonymousType(void 0,e.createSymbolTable(),[y(i)],e.emptyArray,e.emptyArray))):a.isTypeAssignableTo(o,p(r))))}))}(r,t)}));return 0<r.length&&r.length<3?r.map((function(r){return function(t,r){if(!(4&e.getObjectFlags(t)&&r.properties))return t;var n=t.target,i=e.singleOrUndefined(n.typeParameters);if(!i)return t;var s=[];return r.properties.forEach((function(t,r){var o=a.getTypeOfPropertyOfType(n,r);e.Debug.assert(!!o,"generic should have all the properties of its reference."),s.push.apply(s,m(o,p(t),i));})),o[t.symbol.escapedName](f(s))}(r,t)})):[]}(t)),c}function m(t,r,n){if(t===n)return [r];if(3145728&t.flags)return e.flatMap(t.types,(function(e){return m(e,r,n)}));if(4&e.getObjectFlags(t)&&4&e.getObjectFlags(r)){var i=a.getTypeArguments(t),o=a.getTypeArguments(r),s=[];if(i&&o)for(var c=0;c<i.length;c++)o[c]&&s.push.apply(s,m(i[c],o[c],n));return s}var l=a.getSignaturesOfType(t,0),u=a.getSignaturesOfType(r,0);return 1===l.length&&1===u.length?function(t,r,n){for(var i=[],o=0;o<t.parameters.length;o++){var s=t.parameters[o],c=r.parameters[o],l=t.declaration&&e.isRestParameter(t.declaration.parameters[o]);if(!c)break;var u=s.valueDeclaration?a.getTypeOfSymbolAtLocation(s,s.valueDeclaration):a.getAnyType(),_=l&&a.getElementTypeOfArrayType(u);_&&(u=_);var d=c.type||(c.valueDeclaration?a.getTypeOfSymbolAtLocation(c,c.valueDeclaration):a.getAnyType());i.push.apply(i,m(u,d,n));}var p=a.getReturnTypeOfSignature(t),f=a.getReturnTypeOfSignature(r);return i.push.apply(i,m(p,f,n)),i}(l[0],u[0],n):[]}function y(t){for(var r=[],n=Math.max.apply(Math,t.map((function(e){return e.argumentTypes.length}))),i=function(n){var i=a.createSymbol(1,e.escapeLeadingUnderscores("arg".concat(n)));i.type=f(t.map((function(e){return e.argumentTypes[n]||a.getUndefinedType()}))),t.some((function(e){return void 0===e.argumentTypes[n]}))&&(i.flags|=16777216),r.push(i);},o=0;o<n;o++)i(o);var s=p(c(t.map((function(e){return e.return_}))));return a.createSignature(void 0,void 0,void 0,r,s,void 0,n,0)}function v(e,t){!t||1&t.flags||131072&t.flags||(e.candidateTypes||(e.candidateTypes=[])).push(t);}function h(e,t){!t||1&t.flags||131072&t.flags||(e.candidateThisTypes||(e.candidateThisTypes=[])).push(t);}}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i,s=n.sourceFile,c=n.program,l=n.span.start,u=n.errorCode,_=n.cancellationToken,d=n.host,p=n.preferences,f=e.getTokenAtPosition(s,l),g=e.textChanges.ChangeTracker.with(n,(function(t){i=o(t,s,f,u,c,_,e.returnTrue,d,p);})),m=i&&e.getNameOfDeclaration(i);return m&&0!==g.length?[t.createCodeFixAction(r,g,[a(u,f),m.getText(s)],r,e.Diagnostics.Infer_all_types_from_usage)]:void 0},fixIds:[r],getAllCodeActions:function(r){var n=r.sourceFile,a=r.program,s=r.cancellationToken,c=r.host,l=r.preferences,u=e.nodeSeenTracker();return t.codeFixAll(r,i,(function(t,r){o(t,n,e.getTokenAtPosition(r.file,r.start),r.code,a,s,u,c,l);}))}}),t.addJSDocTags=_;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixReturnTypeInAsyncFunction",n=[e.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];function i(t,r,n){if(!e.isInJSFile(t)){var i=e.getTokenAtPosition(t,n),a=e.findAncestor(i,e.isFunctionLikeDeclaration),o=null==a?void 0:a.type;if(o){var s=r.getTypeFromTypeNode(o),c=r.getAwaitedType(s)||r.getVoidType(),l=r.typeToTypeNode(c,o,void 0);return l?{returnTypeNode:o,returnType:s,promisedTypeNode:l,promisedType:c}:void 0}}}function a(t,r,n,i){t.replaceNode(r,n,e.factory.createTypeReferenceNode("Promise",[i]));}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var o=n.sourceFile,s=n.program,c=n.span,l=s.getTypeChecker(),u=i(o,s.getTypeChecker(),c.start);if(u){var _=u.returnTypeNode,d=u.returnType,p=u.promisedTypeNode,f=u.promisedType,g=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,_,p)}));return [t.createCodeFixAction(r,g,[e.Diagnostics.Replace_0_with_Promise_1,l.typeToString(d),l.typeToString(f)],r,e.Diagnostics.Fix_all_incorrect_return_type_of_an_async_functions)]}},getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,e.program.getTypeChecker(),r.start);n&&a(t,r.file,n.returnTypeNode,n.promisedTypeNode);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="disableJsDiagnostics",n="disableJsDiagnostics",i=e.mapDefined(Object.keys(e.Diagnostics),(function(t){var r=e.Diagnostics[t];return r.category===e.DiagnosticCategory.Error?r.code:void 0}));function a(t,r,n,i){var a=e.getLineAndCharacterOfPosition(r,n).line;i&&!e.tryAddToSet(i,a)||t.insertCommentBeforeLine(r,a,n," @ts-ignore");}t.registerCodeFix({errorCodes:i,getCodeActions:function(i){var o=i.sourceFile,s=i.program,c=i.span,l=i.host,u=i.formatContext;if(e.isInJSFile(o)&&e.isCheckJsEnabledForFile(o,s.getCompilerOptions())){var _=o.checkJsDirective?"":e.getNewLineOrDefaultFromHost(l,u.options),d=[t.createCodeFixActionWithoutFixAll(r,[t.createFileTextChanges(o.fileName,[e.createTextChange(o.checkJsDirective?e.createTextSpanFromBounds(o.checkJsDirective.pos,o.checkJsDirective.end):e.createTextSpan(0,0),"// @ts-nocheck".concat(_))])],e.Diagnostics.Disable_checking_for_this_file)];return e.textChanges.isValidLocationToAddComment(o,c.start)&&d.unshift(t.createCodeFixAction(r,e.textChanges.ChangeTracker.with(i,(function(e){return a(e,o,c.start)})),e.Diagnostics.Ignore_this_error_message,n,e.Diagnostics.Add_ts_ignore_to_all_error_messages)),d}},fixIds:[n],getAllCodeActions:function(r){var n=new e.Set;return t.codeFixAll(r,i,(function(t,r){e.textChanges.isValidLocationToAddComment(r.file,r.start)&&a(t,r.file,r.start,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return {trackSymbol:function(){return !1},moduleResolverHost:e.getModuleSpecifierResolverHost(t.program,t.host)}}function n(t,n,a,c,l,u,_,p,g,m){void 0===g&&(g=3),void 0===m&&(m=!1);var y=t.getDeclarations();if(y&&y.length){var v=c.program.getTypeChecker(),h=e.getEmitScriptTarget(c.program.getCompilerOptions()),b=y[0],x=e.getSynthesizedDeepClone(e.getNameOfDeclaration(b),!1),D=function(t){return 4&t?e.factory.createToken(123):16&t?e.factory.createToken(122):void 0}(e.getEffectiveModifierFlags(b)),S=D?e.factory.createNodeArray([D]):void 0,T=v.getWidenedType(v.getTypeOfSymbolAtLocation(t,n)),C=!!(16777216&t.flags),E=!!(8388608&n.flags)||m,k=e.getQuotePreference(a,l);switch(b.kind){case 165:case 166:var N=0===k?268435456:void 0,F=v.typeToTypeNode(T,n,N,r(c));u&&(A=d(F,h))&&(F=A.typeNode,f(u,A.symbols)),_(e.factory.createPropertyDeclaration(void 0,S,x,C&&2&g?e.factory.createToken(57):void 0,F,void 0));break;case 171:case 172:var A,P=v.typeToTypeNode(T,n,void 0,r(c)),w=e.getAllAccessorDeclarations(y,b),I=w.secondAccessor?[w.firstAccessor,w.secondAccessor]:[w.firstAccessor];u&&(A=d(P,h))&&(P=A.typeNode,f(u,A.symbols));for(var O=0,M=I;O<M.length;O++){var L=M[O];if(e.isGetAccessorDeclaration(L))_(e.factory.createGetAccessorDeclaration(void 0,S,x,e.emptyArray,P,E?void 0:p||s(k)));else {e.Debug.assertNode(L,e.isSetAccessorDeclaration,"The counterpart to a getter should be a setter");var R=e.getSetAccessorValueParameter(L),B=R&&e.isIdentifier(R.name)?e.idText(R.name):void 0;_(e.factory.createSetAccessorDeclaration(void 0,S,x,o(1,[B],[P],1,!1),E?void 0:p||s(k)));}}break;case 167:case 168:var j=v.getSignaturesOfType(T,0);if(!e.some(j))break;if(1===y.length){e.Debug.assert(1===j.length,"One declaration implies one signature"),U(k,j[0],S,x,E?void 0:p||s(k));break}for(var J=0,z=j;J<z.length;J++)U(k,z[J],e.getSynthesizedDeepClones(S,!1),e.getSynthesizedDeepClone(x,!1));E||(y.length>j.length?U(k,v.getSignatureFromDeclaration(y[y.length-1]),S,x,p||s(k)):(e.Debug.assert(y.length===j.length,"Declarations and signatures should match count"),_(function(t,n,i,a,c,l,u,_,d){for(var p=a[0],f=a[0].minArgumentCount,g=!1,m=0,y=a;m<y.length;m++){var v=y[m];f=Math.min(v.minArgumentCount,f),e.signatureHasRestParameter(v)&&(g=!0),v.parameters.length>=p.parameters.length&&(!e.signatureHasRestParameter(v)||e.signatureHasRestParameter(p))&&(p=v);}var h=p.parameters.length-(e.signatureHasRestParameter(p)?1:0),b=p.parameters.map((function(e){return e.name})),x=o(h,b,void 0,f,!1);if(g){var D=e.factory.createArrayTypeNode(e.factory.createKeywordTypeNode(130)),S=e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),b[h]||"rest",h>=f?e.factory.createToken(57):void 0,D,void 0);x.push(S);}return function(t,r,n,i,a,o,c,l){return e.factory.createMethodDeclaration(void 0,t,void 0,r,n?e.factory.createToken(57):void 0,void 0,a,o,l||s(c))}(u,c,l,0,x,function(t,n,i,a){if(e.length(t)){var o=n.getUnionType(e.map(t,n.getReturnTypeOfSignature));return n.typeToTypeNode(o,a,void 0,r(i))}}(a,t,n,i),_,d)}(v,c,n,j,x,C&&!!(1&g),S,k,p))));}}function U(e,t,r,a,o){var s=i(168,c,e,t,o,a,r,C&&!!(1&g),n,u);s&&_(s);}}function i(t,n,i,a,o,s,c,l,u,_){var p=n.program,g=p.getTypeChecker(),m=e.getEmitScriptTarget(p.getCompilerOptions()),y=1073742081|(0===i?268435456:0),v=g.signatureToSignatureDeclaration(a,t,u,y,r(n));if(v){var h=v.typeParameters,b=v.parameters,x=v.type;if(_){if(h){var D=e.sameMap(h,(function(t){var r,n=t.constraint,i=t.default;return n&&(r=d(n,m))&&(n=r.typeNode,f(_,r.symbols)),i&&(r=d(i,m))&&(i=r.typeNode,f(_,r.symbols)),e.factory.updateTypeParameterDeclaration(t,t.name,n,i)}));h!==D&&(h=e.setTextRange(e.factory.createNodeArray(D,h.hasTrailingComma),h));}var S=e.sameMap(b,(function(t){var r=d(t.type,m),n=t.type;return r&&(n=r.typeNode,f(_,r.symbols)),e.factory.updateParameterDeclaration(t,t.decorators,t.modifiers,t.dotDotDotToken,t.name,t.questionToken,n,t.initializer)}));if(b!==S&&(b=e.setTextRange(e.factory.createNodeArray(S,b.hasTrailingComma),b)),x){var T=d(x,m);T&&(x=T.typeNode,f(_,T.symbols));}}var C=l?e.factory.createToken(57):void 0,E=v.asteriskToken;return e.isFunctionExpression(v)?e.factory.updateFunctionExpression(v,c,v.asteriskToken,e.tryCast(s,e.isIdentifier),h,b,x,null!=o?o:v.body):e.isArrowFunction(v)?e.factory.updateArrowFunction(v,c,h,b,x,v.equalsGreaterThanToken,null!=o?o:v.body):e.isMethodDeclaration(v)?e.factory.updateMethodDeclaration(v,void 0,c,E,null!=s?s:e.factory.createIdentifier(""),C,h,b,x,o):void 0}}function a(t,r,n,i,a,o,s){var c=t.typeToTypeNode(n,i,o,s);if(c&&e.isImportTypeNode(c)){var l=d(c,a);l&&(f(r,l.symbols),c=l.typeNode);}return e.getSynthesizedDeepClone(c)}function o(t,r,n,i,a){for(var o=[],s=0;s<t;s++){var c=e.factory.createParameterDeclaration(void 0,void 0,void 0,r&&r[s]||"arg".concat(s),void 0!==i&&s>=i?e.factory.createToken(57):void 0,a?void 0:n&&n[s]||e.factory.createKeywordTypeNode(130),void 0);o.push(c);}return o}function s(t){return c(e.Diagnostics.Method_not_implemented.message,t)}function c(t,r){return e.factory.createBlock([e.factory.createThrowStatement(e.factory.createNewExpression(e.factory.createIdentifier("Error"),void 0,[e.factory.createStringLiteral(t,0===r)]))],!0)}function l(t,r,n){var i=e.getTsConfigObjectLiteralExpression(r);if(i){var a=_(i,"compilerOptions");if(void 0!==a){var o=a.initializer;if(e.isObjectLiteralExpression(o))for(var s=0,c=n;s<c.length;s++){var l=c[s],d=l[0],p=l[1],f=_(o,d);void 0===f?t.insertNodeAtObjectStart(r,o,u(d,p)):t.replaceNode(r,f.initializer,p);}}else t.insertNodeAtObjectStart(r,i,u("compilerOptions",e.factory.createObjectLiteralExpression(n.map((function(e){return u(e[0],e[1])})),!0)));}}function u(t,r){return e.factory.createPropertyAssignment(e.factory.createStringLiteral(t),r)}function _(t,r){return e.find(t.properties,(function(t){return e.isPropertyAssignment(t)&&!!t.name&&e.isStringLiteral(t.name)&&t.name.text===r}))}function d(t,r){var n,i=e.visitNode(t,(function t(i){var a;if(e.isLiteralImportTypeNode(i)&&i.qualifier){var o=e.getFirstIdentifier(i.qualifier),s=e.getNameForExportedSymbol(o.symbol,r),c=s!==o.text?p(i.qualifier,e.factory.createIdentifier(s)):i.qualifier;n=e.append(n,o.symbol);var l=null===(a=i.typeArguments)||void 0===a?void 0:a.map(t);return e.factory.createTypeReferenceNode(c,l)}return e.visitEachChild(i,t,e.nullTransformationContext)}));if(n&&i)return {typeNode:i,symbols:n}}function p(t,r){return 79===t.kind?r:e.factory.createQualifiedName(p(t.left,r),t.right)}function f(e,t){t.forEach((function(t){return e.addImportFromExportedSymbol(t,!0)}));}var g;t.createMissingMemberNodes=function(e,t,r,i,a,o,s){for(var c=e.symbol.members,l=0,u=t;l<u.length;l++){var _=u[l];c.has(_.escapedName)||n(_,e,r,i,a,o,s,void 0);}},t.getNoopSymbolTrackerWithResolver=r,(g=t.PreserveOptionalFlags||(t.PreserveOptionalFlags={}))[g.Method=1]="Method",g[g.Property=2]="Property",g[g.All=3]="All",t.addNewNodeForMemberSymbol=n,t.createSignatureDeclarationFromSignature=i,t.createSignatureDeclarationFromCallExpression=function(t,n,i,l,u,_,d){var p=e.getQuotePreference(n.sourceFile,n.preferences),f=e.getEmitScriptTarget(n.program.getCompilerOptions()),g=r(n),m=n.program.getTypeChecker(),y=e.isInJSFile(d),v=l.typeArguments,h=l.arguments,b=l.parent,x=y?void 0:m.getContextualType(l),D=e.map(h,(function(t){return e.isIdentifier(t)?t.text:e.isPropertyAccessExpression(t)&&e.isIdentifier(t.name)?t.name.text:void 0})),S=y?[]:e.map(h,(function(e){return a(m,i,m.getBaseTypeOfLiteralType(m.getTypeAtLocation(e)),d,f,void 0,g)})),T=_?e.factory.createNodeArray(e.factory.createModifiersFromModifierFlags(_)):void 0,C=e.isYieldExpression(b)?e.factory.createToken(41):void 0,E=y||void 0===v?void 0:e.map(v,(function(t,r){return e.factory.createTypeParameterDeclaration(84+v.length-1<=90?String.fromCharCode(84+r):"T".concat(r))})),k=o(h.length,D,S,void 0,y),N=y||void 0===x?void 0:m.typeToTypeNode(x,d,void 0,g);return 168===t?e.factory.createMethodDeclaration(void 0,T,C,u,void 0,E,k,N,e.isInterfaceDeclaration(d)?void 0:s(p)):e.factory.createFunctionDeclaration(void 0,T,C,u,E,k,N,c(e.Diagnostics.Function_not_implemented.message,p))},t.typeToAutoImportableTypeNode=a,t.createStubbedBody=c,t.setJsonCompilerOptionValues=l,t.setJsonCompilerOptionValue=function(e,t,r,n){l(e,t,[[r,n]]);},t.createJsonPropertyAssignment=u,t.findJsonProperty=_,t.tryGetAutoImportableReferenceFromTypeNode=d,t.importSymbols=f;}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){function r(t){return e.isParameterPropertyDeclaration(t,t.parent)||e.isPropertyDeclaration(t)||e.isPropertyAssignment(t)}function i(t,r){return e.isIdentifier(r)?e.factory.createIdentifier(t):e.factory.createStringLiteral(t)}function a(t,r,n){var i=r?n.name:e.factory.createThis();return e.isIdentifier(t)?e.factory.createPropertyAccessExpression(i,t):e.factory.createElementAccessExpression(i,e.factory.createStringLiteralFromNode(t))}function o(t,n,a,o,s){void 0===s&&(s=!0);var l=e.getTokenAtPosition(t,a),u=a===o&&s,_=e.findAncestor(l.parent,r);if(!_||!e.nodeOverlapsWithStartEnd(_.name,t,a,o)&&!u)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_property_for_which_to_generate_accessor)};if(!function(t){return e.isIdentifier(t)||e.isStringLiteral(t)}(_.name))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Name_is_not_valid)};if(124!=(124|e.getEffectiveModifierFlags(_)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_property_with_modifier)};var d=_.name.text,p=e.startsWithUnderscore(d),f=i(p?d:e.getUniqueName("_".concat(d),t),_.name),g=i(p?e.getUniqueName(d.substring(1),t):d,_.name);return {isStatic:e.hasStaticModifier(_),isReadonly:e.hasEffectiveReadonlyModifier(_),type:c(_,n),container:163===_.kind?_.parent.parent:_.parent,originalName:_.name.text,declaration:_,fieldName:f,accessorName:g,renameAccessor:p}}function s(t,r,n,i,a){e.isParameterPropertyDeclaration(i,i.parent)?t.insertNodeAtClassStart(r,a,n):e.isPropertyAssignment(i)?t.insertNodeAfterComma(r,i,n):t.insertNodeAfter(r,i,n);}function c(t,r){var i=e.getTypeAnnotationNode(t);if(e.isPropertyDeclaration(t)&&i&&t.questionToken){var a=r.getTypeChecker(),o=a.getTypeFromTypeNode(i);if(!a.isTypeAssignableTo(a.getUndefinedType(),o)){var s=e.isUnionTypeNode(i)?i.types:[i];return e.factory.createUnionTypeNode(n$3(n$3([],s,!0),[e.factory.createKeywordTypeNode(152)],!1))}}return i}t.generateAccessorFromProperty=function(t,r,n,i,c,l){var u=o(t,r,n,i);if(u&&!e.refactor.isRefactorErrorInfo(u)){var _,d,p=e.textChanges.ChangeTracker.fromContext(c),f=u.isStatic,g=u.isReadonly,m=u.fieldName,y=u.accessorName,v=u.originalName,h=u.type,b=u.container,x=u.declaration;if(e.suppressLeadingAndTrailingTrivia(m),e.suppressLeadingAndTrailingTrivia(y),e.suppressLeadingAndTrailingTrivia(x),e.suppressLeadingAndTrailingTrivia(b),e.isClassLike(b)){var D=e.getEffectiveModifierFlags(x);if(e.isSourceFileJS(t)){var S=e.createModifiers(D);_=S,d=S;}else _=e.createModifiers(function(e){return e&=-65,16&(e&=-9)||(e|=4),e}(D)),d=e.createModifiers(function(e){return e&=-5,8|(e&=-17)}(D));}!function(t,r,n,i,a,o){e.isPropertyDeclaration(n)?function(t,r,n,i,a,o){var s=e.factory.updatePropertyDeclaration(n,n.decorators,o,a,n.questionToken||n.exclamationToken,i,n.initializer);t.replaceNode(r,n,s);}(t,r,n,i,a,o):e.isPropertyAssignment(n)?function(t,r,n,i){var a=e.factory.updatePropertyAssignment(n,i,n.initializer);t.replacePropertyAssignment(r,n,a);}(t,r,n,a):t.replaceNode(r,n,e.factory.updateParameterDeclaration(n,n.decorators,o,n.dotDotDotToken,e.cast(a,e.isIdentifier),n.questionToken,n.type,n.initializer));}(p,t,x,h,m,d);var T=function(t,r,n,i,o,s){return e.factory.createGetAccessorDeclaration(void 0,i,r,void 0,n,e.factory.createBlock([e.factory.createReturnStatement(a(t,o,s))],!0))}(m,y,h,_,f,b);if(e.suppressLeadingAndTrailingTrivia(T),s(p,t,T,x,b),g){var C=e.getFirstConstructorWithBody(b);C&&function(t,r,n,i,a){n.body&&n.body.forEachChild((function n(o){e.isElementAccessExpression(o)&&108===o.expression.kind&&e.isStringLiteral(o.argumentExpression)&&o.argumentExpression.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.argumentExpression,e.factory.createStringLiteral(i)),e.isPropertyAccessExpression(o)&&108===o.expression.kind&&o.name.text===a&&e.isWriteAccess(o)&&t.replaceNode(r,o.name,e.factory.createIdentifier(i)),e.isFunctionLike(o)||e.isClassLike(o)||o.forEachChild(n);}));}(p,t,C,m.text,v);}else {var E=function(t,r,n,i,o,s){return e.factory.createSetAccessorDeclaration(void 0,i,r,[e.factory.createParameterDeclaration(void 0,void 0,void 0,e.factory.createIdentifier("value"),void 0,n)],e.factory.createBlock([e.factory.createExpressionStatement(e.factory.createAssignment(a(t,o,s),e.factory.createIdentifier("value")))],!0))}(m,y,h,_,f,b);e.suppressLeadingAndTrailingTrivia(E),s(p,t,E,x,b);}return p.getChanges()}},t.getAccessorConvertiblePropertyAtPosition=o,t.getAllSupers=function(t,r){for(var n=[];t;){var i=e.getClassExtendsHeritageElement(t),a=i&&r.getSymbolAtLocation(i.expression);if(!a)break;var o=2097152&a.flags?r.getAliasedSymbol(a):a,s=o.declarations&&e.find(o.declarations,e.isClassLike);if(!s)break;n.push(s),t=s;}return n};}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="invalidImportSyntax";function n(n,i,a,o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return e.replaceNode(i,a,o)}));return t.createCodeFixActionWithoutFixAll(r,s,[e.Diagnostics.Replace_import_with_0,s[0].textChanges[0].newText])}function i(i,a){var o=i.program.getTypeChecker().getTypeAtLocation(a);if(!o.symbol||!o.symbol.originatingImport)return [];var s=[],c=o.symbol.originatingImport;if(e.isImportCall(c)||e.addRange(s,function(t,r){var i=e.getSourceFileOfNode(r),a=e.getNamespaceDeclarationNode(r),o=t.program.getCompilerOptions(),s=[];return s.push(n(t,i,r,e.makeImport(a.name,void 0,r.moduleSpecifier,e.getQuotePreference(i,t.preferences)))),e.getEmitModuleKind(o)===e.ModuleKind.CommonJS&&s.push(n(t,i,r,e.factory.createImportEqualsDeclaration(void 0,void 0,!1,a.name,e.factory.createExternalModuleReference(r.moduleSpecifier)))),s}(i,c)),e.isExpression(a)&&(!e.isNamedDeclaration(a.parent)||a.parent.name!==a)){var l=i.sourceFile,u=e.textChanges.ChangeTracker.with(i,(function(t){return t.replaceNode(l,a,e.factory.createPropertyAccessExpression(a,"default"),{})}));s.push(t.createCodeFixActionWithoutFixAll(r,u,e.Diagnostics.Use_synthetic_default_member));}return s}t.registerCodeFix({errorCodes:[e.Diagnostics.This_expression_is_not_callable.code,e.Diagnostics.This_expression_is_not_constructable.code],getCodeActions:function(t){var r=t.sourceFile,n=e.Diagnostics.This_expression_is_not_callable.code===t.errorCode?207:208,a=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.kind===n}));return a?i(t,a.expression):[]}}),t.registerCodeFix({errorCodes:[e.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,e.Diagnostics.Type_0_does_not_satisfy_the_constraint_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1.code,e.Diagnostics.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,e.Diagnostics.Type_predicate_0_is_not_assignable_to_1.code,e.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,e.Diagnostics.Property_0_in_type_1_is_not_assignable_to_type_2.code,e.Diagnostics.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,e.Diagnostics.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:function(t){var r=t.sourceFile,n=e.findAncestor(e.getTokenAtPosition(r,t.span.start),(function(e){return e.getStart()===t.span.start&&e.getEnd()===t.span.start+t.span.length}));return n?i(t,n):[]}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="strictClassInitialization",n="addMissingPropertyDefiniteAssignmentAssertions",i="addMissingPropertyUndefinedType",a="addMissingPropertyInitializer",o=[e.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];function s(t,r){var n=e.getTokenAtPosition(t,r);return e.isIdentifier(n)?e.cast(n.parent,e.isPropertyDeclaration):void 0}function c(i,a){var o=e.textChanges.ChangeTracker.with(i,(function(e){return l(e,i.sourceFile,a)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_definite_assignment_assertion_to_property_0,a.getText()],n,e.Diagnostics.Add_definite_assignment_assertions_to_all_uninitialized_properties)}function l(t,r,n){var i=e.factory.updatePropertyDeclaration(n,n.decorators,n.modifiers,n.name,e.factory.createToken(53),n.type,n.initializer);t.replaceNode(r,n,i);}function u(n,a){var o=e.textChanges.ChangeTracker.with(n,(function(e){return _(e,n.sourceFile,a)}));return t.createCodeFixAction(r,o,[e.Diagnostics.Add_undefined_type_to_property_0,a.name.getText()],i,e.Diagnostics.Add_undefined_type_to_all_uninitialized_properties)}function _(t,r,n){var i=e.factory.createKeywordTypeNode(152),a=n.type,o=e.isUnionTypeNode(a)?a.types.concat(i):[a,i];t.replaceNode(r,a,e.factory.createUnionTypeNode(o));}function d(t,r,n,i){var a=e.factory.updatePropertyDeclaration(n,n.decorators,n.modifiers,n.name,n.questionToken,n.type,i);t.replaceNode(r,n,a);}function p(e,t){return f(e,e.getTypeFromTypeNode(t.type))}function f(t,r){if(512&r.flags)return r===t.getFalseType()||r===t.getFalseType(!0)?e.factory.createFalse():e.factory.createTrue();if(r.isStringLiteral())return e.factory.createStringLiteral(r.value);if(r.isNumberLiteral())return e.factory.createNumericLiteral(r.value);if(2048&r.flags)return e.factory.createBigIntLiteral(r.value);if(r.isUnion())return e.firstDefined(r.types,(function(e){return f(t,e)}));if(r.isClass()){var n=e.getClassLikeDeclarationOfSymbol(r.symbol);if(!n||e.hasSyntacticModifier(n,128))return;var i=e.getFirstConstructorWithBody(n);if(i&&i.parameters.length)return;return e.factory.createNewExpression(e.factory.createIdentifier(r.symbol.name),void 0,void 0)}return t.isArrayLikeType(r)?e.factory.createArrayLiteralExpression():void 0}t.registerCodeFix({errorCodes:o,getCodeActions:function(n){var i=s(n.sourceFile,n.span.start);if(i){var o=[u(n,i),c(n,i)];return e.append(o,function(n,i){var o=p(n.program.getTypeChecker(),i);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return d(e,n.sourceFile,i,o)}));return t.createCodeFixAction(r,s,[e.Diagnostics.Add_initializer_to_property_0,i.name.getText()],a,e.Diagnostics.Add_initializers_to_all_uninitialized_properties)}}(n,i)),o}},fixIds:[n,i,a],getAllCodeActions:function(r){return t.codeFixAll(r,o,(function(t,o){var c=s(o.file,o.start);if(c)switch(r.fixId){case n:l(t,o.file,c);break;case i:_(t,o.file,c);break;case a:var u=p(r.program.getTypeChecker(),c);if(!u)return;d(t,o.file,c,u);break;default:e.Debug.fail(JSON.stringify(r.fixId));}}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="requireInTs",n=[e.Diagnostics.require_call_may_be_converted_to_an_import.code];function i(t,r,n){var i=n.allowSyntheticDefaults,a=n.defaultImportName,o=n.namedImports,s=n.statement,c=n.required;t.replaceNode(r,s,a&&!i?e.factory.createImportEqualsDeclaration(void 0,void 0,!1,a,e.factory.createExternalModuleReference(c)):e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,a,o),c,void 0));}function a(t,r,n){var i=e.getTokenAtPosition(t,n).parent;if(!e.isRequireCall(i,!0))throw e.Debug.failBadSyntaxKind(i);var a=e.cast(i.parent,e.isVariableDeclaration),o=e.tryCast(a.name,e.isIdentifier),s=e.isObjectBindingPattern(a.name)?function(t){for(var r=[],n=0,i=t.elements;n<i.length;n++){var a=i[n];if(!e.isIdentifier(a.name)||a.initializer)return;r.push(e.factory.createImportSpecifier(!1,e.tryCast(a.propertyName,e.isIdentifier),a.name));}if(r.length)return e.factory.createNamedImports(r)}(a.name):void 0;if(o||s)return {allowSyntheticDefaults:e.getAllowSyntheticDefaultImports(r.getCompilerOptions()),defaultImportName:o,namedImports:s,statement:e.cast(a.parent.parent,e.isVariableStatement),required:e.first(i.arguments)}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=a(n.sourceFile,n.program,n.span.start);if(o){var s=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,o)}));return [t.createCodeFixAction(r,s,e.Diagnostics.Convert_require_to_import,r,e.Diagnostics.Convert_all_require_to_import)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=a(r.file,e.program,r.start);n&&i(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useDefaultImport",n=[e.Diagnostics.Import_may_be_converted_to_a_default_import.code];function i(t,r){var n=e.getTokenAtPosition(t,r);if(e.isIdentifier(n)){var i=n.parent;if(e.isImportEqualsDeclaration(i)&&e.isExternalModuleReference(i.moduleReference))return {importNode:i,name:n,moduleSpecifier:i.moduleReference.expression};if(e.isNamespaceImport(i)){var a=i.parent.parent;return {importNode:a,name:n,moduleSpecifier:a.moduleSpecifier}}}}function a(t,r,n,i){t.replaceNode(r,n.importNode,e.makeImport(n.name,void 0,n.moduleSpecifier,e.getQuotePreference(r,i)));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span.start,c=i(o,s);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c,n.preferences)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Convert_to_default_import,r,e.Diagnostics.Convert_all_to_default_imports)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,r.file,n,e.preferences);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="useBigintLiteral",n=[e.Diagnostics.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),e.isNumericLiteral);if(i){var a=i.getText(r)+"n";t.replaceNode(r,i,e.factory.createBigIntLiteral(a));}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Convert_to_a_bigint_numeric_literal,r,e.Diagnostics.Convert_all_to_bigint_numeric_literals)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixAddModuleReferTypeMissingTypeof",n=[e.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];function i(t,r){var n=e.getTokenAtPosition(t,r);return e.Debug.assert(100===n.kind,"This token should be an ImportKeyword"),e.Debug.assert(199===n.parent.kind,"Token parent should be an ImportType"),n.parent}function a(t,r,n){var i=e.factory.updateImportTypeNode(n,n.argument,n.qualifier,n.typeArguments,!0);t.replaceNode(r,n,i);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start),l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Add_missing_typeof,r,e.Diagnostics.Add_missing_typeof)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){return a(t,e.sourceFile,i(r.file,r.start))}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="wrapJsxInFragment",n=[e.Diagnostics.JSX_expressions_must_have_one_parent_element.code];function i(t,r){var n=e.getTokenAtPosition(t,r).parent.parent;if((e.isBinaryExpression(n)||(n=n.parent,e.isBinaryExpression(n)))&&e.nodeIsMissing(n.operatorToken))return n}function a(t,r,n){var i=function(t){for(var r=[],n=t;;){if(e.isBinaryExpression(n)&&e.nodeIsMissing(n.operatorToken)&&27===n.operatorToken.kind){if(r.push(n.left),e.isJsxChild(n.right))return r.push(n.right),r;if(e.isBinaryExpression(n.right)){n=n.right;continue}return}return}}(n);i&&t.replaceNode(r,n,e.factory.createJsxFragment(e.factory.createJsxOpeningFragment(),i,e.factory.createJsxJsxClosingFragment()));}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=n.span,c=i(o,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,c)}));return [t.createCodeFixAction(r,l,e.Diagnostics.Wrap_in_JSX_fragment,r,e.Diagnostics.Wrap_all_unparented_JSX_in_JSX_fragment)]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(e.sourceFile,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="fixConvertToMappedObjectType",i=[e.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];function a(t,r){var n=e.getTokenAtPosition(t,r),i=e.cast(n.parent.parent,e.isIndexSignatureDeclaration);if(!e.isClassDeclaration(i.parent))return {indexSignature:i,container:e.isInterfaceDeclaration(i.parent)?i.parent:e.cast(i.parent.parent,e.isTypeAliasDeclaration)}}function o(t,r,i){var a,o,s=i.indexSignature,c=i.container,l=(e.isInterfaceDeclaration(c)?c.members:c.type.members).filter((function(t){return !e.isIndexSignatureDeclaration(t)})),u=e.first(s.parameters),_=e.factory.createTypeParameterDeclaration(e.cast(u.name,e.isIdentifier),u.type),d=e.factory.createMappedTypeNode(e.hasEffectiveReadonlyModifier(s)?e.factory.createModifier(144):void 0,_,void 0,s.questionToken,s.type,void 0),p=e.factory.createIntersectionTypeNode(n$3(n$3(n$3([],e.getAllSuperTypeNodes(c),!0),[d],!1),l.length?[e.factory.createTypeLiteralNode(l)]:e.emptyArray,!0));t.replaceNode(r,c,(a=c,o=p,e.factory.createTypeAliasDeclaration(a.decorators,a.modifiers,a.name,a.typeParameters,o)));}t.registerCodeFix({errorCodes:i,getCodeActions:function(n){var i=n.sourceFile,s=n.span,c=a(i,s.start);if(c){var l=e.textChanges.ChangeTracker.with(n,(function(e){return o(e,i,c)})),u=e.idText(c.container.name);return [t.createCodeFixAction(r,l,[e.Diagnostics.Convert_0_to_mapped_object_type,u],r,[e.Diagnostics.Convert_0_to_mapped_object_type,u])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,i,(function(e,t){var r=a(t.file,t.start);r&&o(e,t.file,r);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="removeAccidentalCallParentheses",n=[e.Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=e.findAncestor(e.getTokenAtPosition(n.sourceFile,n.span.start),e.isCallExpression);if(i){var a=e.textChanges.ChangeTracker.with(n,(function(e){e.deleteRange(n.sourceFile,{pos:i.expression.end,end:i.end});}));return [t.createCodeFixActionWithoutFixAll(r,a,e.Diagnostics.Remove_parentheses)]}},fixIds:[r]});}(t),function(e){!function(t){var r="removeUnnecessaryAwait",n=[e.Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code];function i(t,r,n){var i=e.tryCast(e.getTokenAtPosition(r,n.start),(function(e){return 132===e.kind})),a=i&&e.tryCast(i.parent,e.isAwaitExpression);if(a){var o=a;if(e.isParenthesizedExpression(a.parent)){var s=e.getLeftmostExpression(a.expression,!1);if(e.isIdentifier(s)){var c=e.findPrecedingToken(a.parent.pos,r);c&&103!==c.kind&&(o=a.parent);}}t.replaceNode(r,o,a.expression);}}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span)}));if(a.length>0)return [t.createCodeFixAction(r,a,e.Diagnostics.Remove_unnecessary_await,r,e.Diagnostics.Remove_all_unnecessary_uses_of_await)]},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(e,t){return i(e,t.file,t)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r=[e.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],n="splitTypeOnlyImport";function i(t,r){return e.findAncestor(e.getTokenAtPosition(t,r.start),e.isImportDeclaration)}function a(t,r,n){if(r){var i=e.Debug.checkDefined(r.importClause);t.replaceNode(n.sourceFile,r,e.factory.updateImportDeclaration(r,r.decorators,r.modifiers,e.factory.updateImportClause(i,i.isTypeOnly,i.name,void 0),r.moduleSpecifier,r.assertClause)),t.insertNodeAfter(n.sourceFile,r,e.factory.createImportDeclaration(void 0,void 0,e.factory.updateImportClause(i,i.isTypeOnly,void 0,i.namedBindings),r.moduleSpecifier,r.assertClause));}}t.registerCodeFix({errorCodes:r,fixIds:[n],getCodeActions:function(r){var o=e.textChanges.ChangeTracker.with(r,(function(e){return a(e,i(r.sourceFile,r.span),r)}));if(o.length)return [t.createCodeFixAction(n,o,e.Diagnostics.Split_into_two_separate_import_declarations,n,e.Diagnostics.Split_all_invalid_type_only_imports)]},getAllCodeActions:function(e){return t.codeFixAll(e,r,(function(t,r){a(t,i(e.sourceFile,r),e);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){var t,r,n;t=e.codefix||(e.codefix={}),r="fixConvertConstToLet",n=[e.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code],t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var i=n.sourceFile,a=n.span,o=n.program,s=function(t,r,n){var i,a=n.getTypeChecker().getSymbolAtLocation(e.getTokenAtPosition(t,r)),o=e.tryCast(null===(i=null==a?void 0:a.valueDeclaration)||void 0===i?void 0:i.parent,e.isVariableDeclarationList);if(void 0!==o){var s=e.findChildOfKind(o,85,t);if(void 0!==s)return e.createRange(s.pos,s.end)}}(i,a.start,o);if(void 0!==s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return function(e,t,r){e.replaceRangeWithText(t,r,"let");}(e,i,s)}));return [t.createCodeFixAction(r,c,e.Diagnostics.Convert_const_to_let,r,e.Diagnostics.Convert_const_to_let)]}},fixIds:[r]});}(t),function(e){!function(t){var r="fixExpectedComma",n=[e.Diagnostics._0_expected.code];function i(t,r,n){var i=e.getTokenAtPosition(t,r);return 26===i.kind&&i.parent&&(e.isObjectLiteralExpression(i.parent)||e.isArrayLiteralExpression(i.parent))?{node:i}:void 0}function a(t,r,n){var i=n.node,a=e.factory.createToken(27);t.replaceNode(r,i,a);}t.registerCodeFix({errorCodes:n,getCodeActions:function(n){var o=n.sourceFile,s=i(o,n.span.start);if(s){var c=e.textChanges.ChangeTracker.with(n,(function(e){return a(e,o,s)}));return [t.createCodeFixAction(r,c,[e.Diagnostics.Change_0_to_1,";",","],r,[e.Diagnostics.Change_0_to_1,";",","])]}},fixIds:[r],getAllCodeActions:function(e){return t.codeFixAll(e,n,(function(t,r){var n=i(r.file,r.start);n&&a(t,e.sourceFile,n);}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="addVoidToPromise",n=[e.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];function i(t,r,n,i,a){var o=e.getTokenAtPosition(r,n.start);if(e.isIdentifier(o)&&e.isCallExpression(o.parent)&&o.parent.expression===o&&0===o.parent.arguments.length){var s=i.getTypeChecker(),c=s.getSymbolAtLocation(o),l=null==c?void 0:c.valueDeclaration;if(l&&e.isParameter(l)&&e.isNewExpression(l.parent.parent)&&!(null==a?void 0:a.has(l))){null==a||a.add(l);var u=function(t){var r;if(!e.isInJSFile(t))return t.typeArguments;if(e.isParenthesizedExpression(t.parent)){var n=null===(r=e.getJSDocTypeTag(t.parent))||void 0===r?void 0:r.typeExpression.type;if(n&&e.isTypeReferenceNode(n)&&e.isIdentifier(n.typeName)&&"Promise"===e.idText(n.typeName))return n.typeArguments}}(l.parent.parent);if(e.some(u)){var _=u[0],d=!e.isUnionTypeNode(_)&&!e.isParenthesizedTypeNode(_)&&e.isParenthesizedTypeNode(e.factory.createUnionTypeNode([_,e.factory.createKeywordTypeNode(114)]).types[0]);d&&t.insertText(r,_.pos,"("),t.insertText(r,_.end,d?") | void":" | void");}else {var p=s.getResolvedSignature(o.parent),f=null==p?void 0:p.parameters[0],g=f&&s.getTypeOfSymbolAtLocation(f,l.parent.parent);e.isInJSFile(l)?(!g||3&g.flags)&&(t.insertText(r,l.parent.parent.end,")"),t.insertText(r,e.skipTrivia(r.text,l.parent.parent.pos),"/** @type {Promise<void>} */(")):(!g||2&g.flags)&&t.insertText(r,l.parent.parent.expression.end,"<void>");}}}}t.registerCodeFix({errorCodes:n,fixIds:[r],getCodeActions:function(n){var a=e.textChanges.ChangeTracker.with(n,(function(e){return i(e,n.sourceFile,n.span,n.program)}));if(a.length>0)return [t.createCodeFixAction("addVoidToPromise",a,e.Diagnostics.Add_void_to_Promise_resolved_without_a_value,r,e.Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions:function(r){return t.codeFixAll(r,n,(function(t,n){return i(t,n.file,n,r.program,new e.Set)}))}});}(e.codefix||(e.codefix={}));}(t),function(e){!function(t){var r="Convert export",n={name:"Convert default export to named export",description:e.Diagnostics.Convert_default_export_to_named_export.message,kind:"refactor.rewrite.export.named"},a={name:"Convert named export to default export",description:e.Diagnostics.Convert_named_export_to_default_export.message,kind:"refactor.rewrite.export.default"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=e.getTokenAtPosition(n,a.start),s=o.parent&&1&e.getSyntacticModifierFlags(o.parent)&&r?o.parent:e.getParentNodeInSpan(o,n,a);if(!s||!(e.isSourceFile(s.parent)||e.isModuleBlock(s.parent)&&e.isAmbientModule(s.parent.parent)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_export_statement)};var c=e.isSourceFile(s.parent)?s.parent.symbol:s.parent.parent.symbol,l=e.getSyntacticModifierFlags(s)||(e.isExportAssignment(s)&&!s.isExportEquals?513:0),u=!!(512&l);if(!(1&l)||!u&&c.exports.has("default"))return {error:e.getLocaleSpecificMessage(e.Diagnostics.This_file_already_has_a_default_export)};var _=i.getTypeChecker(),d=function(t){return e.isIdentifier(t)&&_.getSymbolAtLocation(t)?void 0:{error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_named_export)}};switch(s.kind){case 255:case 256:case 257:case 259:case 258:case 260:if(!(g=s).name)return;return d(g.name)||{exportNode:g,exportName:g.name,wasDefault:u,exportingModuleSymbol:c};case 236:var p=s;if(!(2&p.declarationList.flags)||1!==p.declarationList.declarations.length)return;var f=e.first(p.declarationList.declarations);if(!f.initializer)return;return e.Debug.assert(!u,"Can't have a default flag here"),d(f.name)||{exportNode:p,exportName:f.name,wasDefault:u,exportingModuleSymbol:c};case 270:var g;if((g=s).isExportEquals)return;return d(g.expression)||{exportNode:g,exportName:g.expression,wasDefault:u,exportingModuleSymbol:c};default:return}}function s(t,r){return e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}function c(t,r){return e.factory.createExportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(t),e.factory.createIdentifier(r))}t.registerRefactor(r,{kinds:[n.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=c.wasDefault?n:a;return [{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.Diagnostics.Convert_default_export_to_named_export.message,actions:[i$1(i$1({},n),{notApplicableReason:c.error}),i$1(i$1({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,i){e.Debug.assert(i===n.name||i===a.name,"Unexpected action name");var l=o(r);return e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){(function(t,r,n,i){var a=r.wasDefault,o=r.exportNode,s=r.exportName;if(a)if(e.isExportAssignment(o)&&!o.isExportEquals){var l=o.expression,u=c(l.text,l.text);n.replaceNode(t,o,e.factory.createExportDeclaration(void 0,void 0,!1,e.factory.createNamedExports([u])));}else n.delete(t,e.Debug.checkDefined(e.findModifier(o,88),"Should find a default keyword in modifier list"));else {var _=e.Debug.checkDefined(e.findModifier(o,93),"Should find an export keyword in modifier list");switch(o.kind){case 255:case 256:case 257:n.insertNodeAfter(t,_,e.factory.createToken(88));break;case 236:var d=e.first(o.declarationList.declarations);if(!e.FindAllReferences.Core.isSymbolReferencedInFile(s,i,t)&&!d.type){n.replaceNode(t,o,e.factory.createExportDefault(e.Debug.checkDefined(d.initializer,"Initializer was previously known to be present")));break}case 259:case 258:case 260:n.deleteModifier(t,_),n.insertNodeAfter(t,o,e.factory.createExportDefault(e.factory.createIdentifier(s.text)));break;default:e.Debug.fail("Unexpected exportNode kind ".concat(o.kind));}}})(t,n,i,r.getTypeChecker()),function(t,r,n,i){var a=r.wasDefault,o=r.exportName,l=r.exportingModuleSymbol,u=t.getTypeChecker(),_=e.Debug.checkDefined(u.getSymbolAtLocation(o),"Export name should resolve to a symbol");e.FindAllReferences.Core.eachExportReference(t.getSourceFiles(),u,i,_,l,o.text,a,(function(t){var r=t.getSourceFile();a?function(t,r,n,i){var a=r.parent;switch(a.kind){case 205:n.replaceNode(t,r,e.factory.createIdentifier(i));break;case 269:case 274:var o=a;n.replaceNode(t,o,s(i,o.name.text));break;case 266:var c=a;e.Debug.assert(c.name===r,"Import clause name should match provided ref"),o=s(i,r.text);var l=c.namedBindings;if(l)if(267===l.kind){n.deleteRange(t,{pos:r.getStart(t),end:l.getStart(t)});var u=e.isStringLiteral(c.parent.moduleSpecifier)?e.quotePreferenceFromString(c.parent.moduleSpecifier,t):1,_=e.makeImport(void 0,[s(i,r.text)],c.parent.moduleSpecifier,u);n.insertNodeAfter(t,c.parent,_);}else n.delete(t,r),n.insertNodeAtEndOfList(t,l.elements,o);else n.replaceNode(t,r,e.factory.createNamedImports([o]));break;default:e.Debug.failBadSyntaxKind(a);}}(r,t,n,o.text):function(t,r,n){var i=r.parent;switch(i.kind){case 205:n.replaceNode(t,r,e.factory.createIdentifier("default"));break;case 269:var a=e.factory.createIdentifier(i.name.text);1===i.parent.elements.length?n.replaceNode(t,i.parent,a):(n.delete(t,i),n.insertNodeBefore(t,i.parent,a));break;case 274:n.replaceNode(t,i,c("default",i.name.text));break;default:e.Debug.assertNever(i,"Unexpected parent kind ".concat(i.kind));}}(r,t,n);}));}(r,n,i,a);}(r.file,r.program,l,t,r.cancellationToken)})),renameFilename:void 0,renameLocation:void 0}}});}(e.refactor||(e.refactor={}));}(t),function(e){!function(t){var r="Convert import",n={name:"Convert namespace import to named imports",description:e.Diagnostics.Convert_namespace_import_to_named_imports.message,kind:"refactor.rewrite.import.named"},a={name:"Convert named imports to namespace import",description:e.Diagnostics.Convert_named_imports_to_namespace_import.message,kind:"refactor.rewrite.import.namespace"};function o(t,r){void 0===r&&(r=!0);var n=t.file,i=e.getRefactorContextSpan(t),a=e.getTokenAtPosition(n,i.start),o=r?e.findAncestor(a,e.isImportDeclaration):e.getParentNodeInSpan(a,n,i);if(!o||!e.isImportDeclaration(o))return {error:"Selection is not an import declaration."};var s=i.start+i.length,c=e.findNextToken(o,o.parent,n);if(!(c&&s>c.getStart())){var l=o.importClause;return l?l.namedBindings?l.namedBindings:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_namespace_import_or_named_imports)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_import_clause)}}}function s(t){return e.isPropertyAccessExpression(t)?t.name:t.right}function c(t,r,n){return e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,r,n&&n.length?e.factory.createNamedImports(n):void 0),t.moduleSpecifier,void 0)}t.registerRefactor(r,{kinds:[n.kind,a.kind],getAvailableActions:function(s){var c=o(s,"invoked"===s.triggerReason);if(!c)return e.emptyArray;if(!t.isRefactorErrorInfo(c)){var l=267===c.kind?n:a;return [{name:r,description:l.description,actions:[l]}]}return s.preferences.provideRefactorNotApplicableReason?[{name:r,description:n.description,actions:[i$1(i$1({},n),{notApplicableReason:c.error})]},{name:r,description:a.description,actions:[i$1(i$1({},a),{notApplicableReason:c.error})]}]:e.emptyArray},getEditsForAction:function(r,i){e.Debug.assert(i===n.name||i===a.name,"Unexpected action name");var l=o(r);return e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return n=r.file,i=r.program,a=t,o=l,u=i.getTypeChecker(),void(267===o.kind?function(t,r,n,i,a){var o=!1,l=[],u=new e.Map;e.FindAllReferences.Core.eachSymbolReferenceInFile(i.name,r,t,(function(t){if(e.isPropertyAccessOrQualifiedName(t.parent)){var n=s(t.parent).text;r.resolveName(n,t,67108863,!0)&&u.set(n,!0),e.Debug.assert(function(t){return e.isPropertyAccessExpression(t)?t.expression:t.left}(t.parent)===t,"Parent expression should match id"),l.push(t.parent);}else o=!0;}));for(var _=new e.Map,d=0,p=l;d<p.length;d++){var f=p[d],g=s(f).text,m=_.get(g);void 0===m&&_.set(g,m=u.has(g)?e.getUniqueName(g,t):g),n.replaceNode(t,f,e.factory.createIdentifier(m));}var y=[];_.forEach((function(t,r){y.push(e.factory.createImportSpecifier(!1,t===r?void 0:e.factory.createIdentifier(r),e.factory.createIdentifier(t)));}));var v=i.parent.parent;o&&!a?n.insertNodeAfter(t,v,c(v,void 0,y)):n.replaceNode(t,v,c(v,o?e.factory.createIdentifier(i.name.text):void 0,y));}(n,u,a,o,e.getAllowSyntheticDefaultImports(i.getCompilerOptions())):function(t,r,n,i){var a=i.parent.parent,o=a.moduleSpecifier,s=new e.Set;i.elements.forEach((function(e){var t=r.getSymbolAtLocation(e.name);t&&s.add(t);}));var l=o&&e.isStringLiteral(o)?e.codefix.moduleSpecifierToValidIdentifier(o.text,99):"module";for(var u=i.elements.some((function(n){return !!e.FindAllReferences.Core.eachSymbolReferenceInFile(n.name,r,t,(function(t){var n=r.resolveName(l,t,67108863,!0);return !!n&&(!s.has(n)||e.isExportSpecifier(t.parent))}))}))?e.getUniqueName(l,t):l,_=new e.Set,d=function(i){var a=(i.propertyName||i.name).text;e.FindAllReferences.Core.eachSymbolReferenceInFile(i.name,r,t,(function(r){var o=e.factory.createPropertyAccessExpression(e.factory.createIdentifier(u),a);e.isShorthandPropertyAssignment(r.parent)?n.replaceNode(t,r.parent,e.factory.createPropertyAssignment(r.text,o)):e.isExportSpecifier(r.parent)?_.add(i):n.replaceNode(t,r,o);}));},p=0,f=i.elements;p<f.length;p++)d(f[p]);if(n.replaceNode(t,i,e.factory.createNamespaceImport(e.factory.createIdentifier(u))),_.size){var g=e.arrayFrom(_.values()).map((function(t){return e.factory.createImportSpecifier(t.isTypeOnly,t.propertyName&&e.factory.createIdentifier(t.propertyName.text),e.factory.createIdentifier(t.name.text))}));n.insertNodeAfter(t,i.parent.parent,c(a,void 0,g));}}(n,u,a,o));var n,i,a,o,u;})),renameFilename:void 0,renameLocation:void 0}}});}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Convert to optional chain expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_optional_chain_expression),o={name:n,description:a,kind:"refactor.rewrite.expression.optionalChain"};function s(t){return e.isBinaryExpression(t)||e.isConditionalExpression(t)}function c(t){return s(t)||function(t){return e.isExpressionStatement(t)||e.isReturnStatement(t)||e.isVariableStatement(t)}(t)}function l(t,r){void 0===r&&(r=!0);var n=t.file,i=t.program,a=e.getRefactorContextSpan(t),o=0===a.length;if(!o||r){var l=e.getTokenAtPosition(n,a.start),d=e.findTokenOnLeftOfPosition(n,a.start+a.length),f=e.createTextSpanFromBounds(l.pos,d&&d.end>=l.pos?d.getEnd():l.getEnd()),g=o?function(e){for(;e.parent;){if(c(e)&&!c(e.parent))return e;e=e.parent;}}(l):function(e,t){for(;e.parent;){if(c(e)&&0!==t.length&&e.end>=t.start+t.length)return e;e=e.parent;}}(l,f),m=g&&c(g)?function(t){if(s(t))return t;if(e.isVariableStatement(t)){var r=e.getSingleVariableOfVariableStatement(t),n=null==r?void 0:r.initializer;return n&&s(n)?n:void 0}return t.expression&&s(t.expression)?t.expression:void 0}(g):void 0;if(!m)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var y=i.getTypeChecker();return e.isConditionalExpression(m)?function(t,r){var n=t.condition,i=p(t.whenTrue);if(!i||r.isNullableType(r.getTypeAtLocation(i)))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};if((e.isPropertyAccessExpression(n)||e.isIdentifier(n))&&_(n,i.expression))return {finalExpression:i,occurrences:[n],expression:t};if(e.isBinaryExpression(n)){var a=u(i.expression,n);return a?{finalExpression:i,occurrences:a,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}}(m,y):function(t){if(55!==t.operatorToken.kind)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_logical_AND_access_chains)};var r=p(t.right);if(!r)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_convertible_access_expression)};var n=u(r.expression,t.left);return n?{finalExpression:r,occurrences:n,expression:t}:{error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_matching_access_expressions)}}(m)}}function u(t,r){for(var n=[];e.isBinaryExpression(r)&&55===r.operatorToken.kind;){var i=_(e.skipParentheses(t),e.skipParentheses(r.right));if(!i)break;n.push(i),t=i,r=r.left;}var a=_(t,r);return a&&n.push(a),n.length>0?n:void 0}function _(t,r){if(e.isIdentifier(r)||e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r))return function(t,r){for(;(e.isCallExpression(t)||e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t))&&d(t)!==d(r);)t=t.expression;for(;e.isPropertyAccessExpression(t)&&e.isPropertyAccessExpression(r)||e.isElementAccessExpression(t)&&e.isElementAccessExpression(r);){if(d(t)!==d(r))return !1;t=t.expression,r=r.expression;}return e.isIdentifier(t)&&e.isIdentifier(r)&&t.getText()===r.getText()}(t,r)?r:void 0}function d(t){return e.isIdentifier(t)||e.isStringOrNumericLiteralLike(t)?t.getText():e.isPropertyAccessExpression(t)?d(t.name):e.isElementAccessExpression(t)?d(t.argumentExpression):void 0}function p(t){return t=e.skipParentheses(t),e.isBinaryExpression(t)?p(t.left):(e.isPropertyAccessExpression(t)||e.isElementAccessExpression(t)||e.isCallExpression(t))&&!e.isOptionalChain(t)?t:void 0}function f(t,r,n){if(e.isPropertyAccessExpression(r)||e.isElementAccessExpression(r)||e.isCallExpression(r)){var i=f(t,r.expression,n),a=n.length>0?n[n.length-1]:void 0,o=(null==a?void 0:a.getText())===r.expression.getText();if(o&&n.pop(),e.isCallExpression(r))return o?e.factory.createCallChain(i,e.factory.createToken(28),r.typeArguments,r.arguments):e.factory.createCallChain(i,r.questionDotToken,r.typeArguments,r.arguments);if(e.isPropertyAccessExpression(r))return o?e.factory.createPropertyAccessChain(i,e.factory.createToken(28),r.name):e.factory.createPropertyAccessChain(i,r.questionDotToken,r.name);if(e.isElementAccessExpression(r))return o?e.factory.createElementAccessChain(i,e.factory.createToken(28),r.argumentExpression):e.factory.createElementAccessChain(i,r.questionDotToken,r.argumentExpression)}return r}t.registerRefactor(n,{kinds:[o.kind],getAvailableActions:function(r){var s=l(r,"invoked"===r.triggerReason);return s?t.isRefactorErrorInfo(s)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray},getEditsForAction:function(r,n){var i=l(r);return e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info"),{edits:e.textChanges.ChangeTracker.with(r,(function(t){return function(t,r,n,i,a){var o=i.finalExpression,s=i.occurrences,c=i.expression,l=s[s.length-1],u=f(r,o,s);u&&(e.isPropertyAccessExpression(u)||e.isElementAccessExpression(u)||e.isCallExpression(u))&&(e.isBinaryExpression(c)?n.replaceNodeRange(t,l,o,u):e.isConditionalExpression(c)&&n.replaceNode(t,c,e.factory.createBinaryExpression(u,e.factory.createToken(60),c.whenFalse)));}(r.file,r.program.getTypeChecker(),t,i)})),renameFilename:void 0,renameLocation:void 0}}});})((t=e.refactor||(e.refactor={})).convertToOptionalChainExpression||(t.convertToOptionalChainExpression={}));}(t),function(e){var t;(function(r){var n="Convert overload list to single signature",i=e.Diagnostics.Convert_overload_list_to_single_signature.message,a={name:n,description:i,kind:"refactor.rewrite.function.overloadList"};function o(e){switch(e.kind){case 167:case 168:case 173:case 170:case 174:case 255:return !0}return !1}function s(t,r,n){var i=e.getTokenAtPosition(t,r),a=e.findAncestor(i,o);if(a){var s=n.getTypeChecker(),c=a.symbol;if(c){var l=c.declarations;if(!(e.length(l)<=1)&&e.every(l,(function(r){return e.getSourceFileOfNode(r)===t}))&&o(l[0])){var u=l[0].kind;if(e.every(l,(function(e){return e.kind===u}))){var _=l;if(!e.some(_,(function(t){return !!t.typeParameters||e.some(t.parameters,(function(t){return !!t.decorators||!!t.modifiers||!e.isIdentifier(t.name)}))}))){var d=e.mapDefined(_,(function(e){return s.getSignatureFromDeclaration(e)}));if(e.length(d)===e.length(l)){var p=s.getReturnTypeOfSignature(d[0]);if(e.every(d,(function(e){return s.getReturnTypeOfSignature(e)===p})))return _}}}}}}}t.registerRefactor(n,{kinds:[a.kind],getEditsForAction:function(t){var r=t.file,n=t.startPosition,i=t.program,a=s(r,n,i);if(a){var o=i.getTypeChecker(),c=a[a.length-1],l=c;switch(c.kind){case 167:l=e.factory.updateMethodSignature(c,c.modifiers,c.name,c.questionToken,c.typeParameters,u(a),c.type);break;case 168:l=e.factory.updateMethodDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.questionToken,c.typeParameters,u(a),c.type,c.body);break;case 173:l=e.factory.updateCallSignature(c,c.typeParameters,u(a),c.type);break;case 170:l=e.factory.updateConstructorDeclaration(c,c.decorators,c.modifiers,u(a),c.body);break;case 174:l=e.factory.updateConstructSignature(c,c.typeParameters,u(a),c.type);break;case 255:l=e.factory.updateFunctionDeclaration(c,c.decorators,c.modifiers,c.asteriskToken,c.name,c.typeParameters,u(a),c.type,c.body);break;default:return e.Debug.failBadSyntaxKind(c,"Unhandled signature kind in overload list conversion refactoring")}if(l!==c)return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(t,(function(e){e.replaceNodeRange(r,a[0],a[a.length-1],l);}))}}function u(t){var r=t[t.length-1];return e.isFunctionLikeDeclaration(r)&&r.body&&(t=t.slice(0,t.length-1)),e.factory.createNodeArray([e.factory.createParameterDeclaration(void 0,void 0,e.factory.createToken(25),"args",void 0,e.factory.createUnionTypeNode(e.map(t,_)))])}function _(t){var r=e.map(t.parameters,d);return e.setEmitFlags(e.factory.createTupleTypeNode(r),e.some(r,(function(t){return !!e.length(e.getSyntheticLeadingComments(t))}))?0:1)}function d(t){e.Debug.assert(e.isIdentifier(t.name));var r=e.setTextRange(e.factory.createNamedTupleMember(t.dotDotDotToken,t.name,t.questionToken,t.type||e.factory.createKeywordTypeNode(130)),t),n=t.symbol&&t.symbol.getDocumentationComment(o);if(n){var i=e.displayPartsToString(n);i.length&&e.setSyntheticLeadingComments(r,[{text:"*\n".concat(i.split("\n").map((function(e){return " * ".concat(e)})).join("\n"),"\n "),kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}]);}return r}},getAvailableActions:function(t){return s(t.file,t.startPosition,t.program)?[{name:n,description:i,actions:[a]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var n,a,o,s,c="Extract Symbol",l={name:"Extract Constant",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),kind:"refactor.extract.constant"},u={name:"Extract Function",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),kind:"refactor.extract.function"};function _(r){var n=r.kind,a=p(r.file,e.getRefactorContextSpan(r),"invoked"===r.triggerReason),o=a.targetRange;if(void 0===o){if(!a.errors||0===a.errors.length||!r.preferences.provideRefactorNotApplicableReason)return e.emptyArray;var s=[];return t.refactorKindBeginsWith(u.kind,n)&&s.push({name:c,description:u.description,actions:[i$1(i$1({},u),{notApplicableReason:F(a.errors)})]}),t.refactorKindBeginsWith(l.kind,n)&&s.push({name:c,description:l.description,actions:[i$1(i$1({},l),{notApplicableReason:F(a.errors)})]}),s}var _=function(t,r){var n=m(t,r),i=n.scopes,a=n.readsAndWrites,o=a.functionErrorsPerScope,s=a.constantErrorsPerScope;return i.map((function(t,r){var n,i,a=function(t){return e.isFunctionLikeDeclaration(t)?"inner function":e.isClassLike(t)?"method":"function"}(t),c=function(t){return e.isClassLike(t)?"readonly field":"constant"}(t),l=e.isFunctionLikeDeclaration(t)?function(t){switch(t.kind){case 170:return "constructor";case 212:case 255:return t.name?"function '".concat(t.name.text,"'"):e.ANONYMOUS;case 213:return "arrow function";case 168:return "method '".concat(t.name.getText(),"'");case 171:return "'get ".concat(t.name.getText(),"'");case 172:return "'set ".concat(t.name.getText(),"'");default:throw e.Debug.assertNever(t,"Unexpected scope kind ".concat(t.kind))}}(t):e.isClassLike(t)?function(e){return 256===e.kind?e.name?"class '".concat(e.name.text,"'"):"anonymous class declaration":e.name?"class expression '".concat(e.name.text,"'"):"anonymous class expression"}(t):function(e){return 261===e.kind?"namespace '".concat(e.parent.name.getText(),"'"):e.externalModuleIndicator?0:1}(t);return 1===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"global"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"global"])):0===l?(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[a,"module"]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1_scope),[c,"module"])):(n=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[a,l]),i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_1),[c,l])),0!==r||e.isClassLike(t)||(i=e.formatStringFromArgs(e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_0_in_enclosing_scope),[c])),{functionExtraction:{description:n,errors:o[r]},constantExtraction:{description:i,errors:s[r]}}}))}(o,r);if(void 0===_)return e.emptyArray;for(var d,f,g=[],y=new e.Map,v=[],h=new e.Map,b=0,x=0,D=_;x<D.length;x++){var S=D[x],T=S.functionExtraction,C=S.constantExtraction,E=T.description;if(t.refactorKindBeginsWith(u.kind,n)&&(0===T.errors.length?y.has(E)||(y.set(E,!0),g.push({description:E,name:"function_scope_".concat(b),kind:u.kind})):d||(d={description:E,name:"function_scope_".concat(b),notApplicableReason:F(T.errors),kind:u.kind})),t.refactorKindBeginsWith(l.kind,n))if(0===C.errors.length){var k=C.description;h.has(k)||(h.set(k,!0),v.push({description:k,name:"constant_scope_".concat(b),kind:l.kind}));}else f||(f={description:E,name:"constant_scope_".concat(b),notApplicableReason:F(C.errors),kind:l.kind});b++;}var N=[];return g.length?N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:g}):r.preferences.provideRefactorNotApplicableReason&&d&&N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_function),actions:[d]}),v.length?N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:v}):r.preferences.provideRefactorNotApplicableReason&&f&&N.push({name:c,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_constant),actions:[f]}),N.length?N:e.emptyArray;function F(e){var t=e[0].messageText;return "string"!=typeof t&&(t=t.messageText),t}}function d(t,r){var n=p(t.file,e.getRefactorContextSpan(t)).targetRange,i=/^function_scope_(\d+)$/.exec(r);if(i){var o=+i[1];return e.Debug.assert(isFinite(o),"Expected to parse a finite number from the function scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.functionErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o,s){var c,l,u=n.usages,_=n.typeParameterUsages,d=n.substitutions,p=s.program.getTypeChecker(),f=e.getEmitScriptTarget(s.program.getCompilerOptions()),g=e.codefix.createImportAdder(s.file,s.program,s.preferences,s.host),m=r.getSourceFile(),x=e.getUniqueName(e.isClassLike(r)?"newMethod":"newFunction",m),D=e.isInJSFile(r),T=e.factory.createIdentifier(x),C=[],E=[];u.forEach((function(t,n){var i;if(!D){var a=p.getTypeOfSymbolAtLocation(t.symbol,t.node);a=p.getBaseTypeOfLiteralType(a),i=e.codefix.typeToAutoImportableTypeNode(p,g,a,r,f,1);}var o=e.factory.createParameterDeclaration(void 0,void 0,void 0,n,void 0,i);C.push(o),2===t.usage&&(l||(l=[])).push(t),E.push(e.factory.createIdentifier(n));}));var k=e.arrayFrom(_.values()).map((function(e){return {type:e,declaration:y(e)}})).sort(v),N=0===k.length?void 0:k.map((function(e){return e.declaration})),F=void 0!==N?N.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)})):void 0;if(e.isExpression(t)&&!D){var A=p.getContextualType(t);c=p.typeToTypeNode(A,r,1);}var P,w=function(t,r,n,i,a){var o,s=void 0!==n||r.length>0;if(e.isBlock(t)&&!s&&0===i.size)return {body:e.factory.createBlock(t.statements,!0),returnValueProperty:void 0};var c=!1,l=e.factory.createNodeArray(e.isBlock(t)?t.statements.slice(0):[e.isStatement(t)?t:e.factory.createReturnStatement(e.skipParentheses(t))]);if(s||i.size){var u=e.visitNodes(l,(function t(a){if(!c&&e.isReturnStatement(a)&&s){var l=h(r,n);return a.expression&&(o||(o="__return"),l.unshift(e.factory.createPropertyAssignment(o,e.visitNode(a.expression,t)))),1===l.length?e.factory.createReturnStatement(l[0].name):e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(l))}var u=c;c=c||e.isFunctionLikeDeclaration(a)||e.isClassLike(a);var _=i.get(e.getNodeId(a).toString()),d=_?e.getSynthesizedDeepClone(_):e.visitEachChild(a,t,e.nullTransformationContext);return c=u,d})).slice();if(s&&!a&&e.isStatement(t)){var _=h(r,n);1===_.length?u.push(e.factory.createReturnStatement(_[0].name)):u.push(e.factory.createReturnStatement(e.factory.createObjectLiteralExpression(_)));}return {body:e.factory.createBlock(u,!0),returnValueProperty:o}}return {body:e.factory.createBlock(l,!0),returnValueProperty:void 0}}(t,i,l,d,!!(o.facts&a.HasReturn)),I=w.body,O=w.returnValueProperty;if(e.suppressLeadingAndTrailingTrivia(I),e.isClassLike(r)){var M=D?[]:[e.factory.createModifier(121)];o.facts&a.InStaticRegion&&M.push(e.factory.createModifier(124)),o.facts&a.IsAsyncFunction&&M.push(e.factory.createModifier(131)),P=e.factory.createMethodDeclaration(void 0,M.length?M:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,void 0,N,C,c,I);}else P=e.factory.createFunctionDeclaration(void 0,o.facts&a.IsAsyncFunction?[e.factory.createToken(131)]:void 0,o.facts&a.IsGenerator?e.factory.createToken(41):void 0,T,N,C,c,I);var L=e.textChanges.ChangeTracker.fromContext(s),R=function(t,r){return e.find(function(t){if(e.isFunctionLikeDeclaration(t)){var r=t.body;if(e.isBlock(r))return r.statements}else {if(e.isModuleBlock(t)||e.isSourceFile(t))return t.statements;if(e.isClassLike(t))return t.members;e.assertType(t);}return e.emptyArray}(r),(function(r){return r.pos>=t&&e.isFunctionLikeDeclaration(r)&&!e.isConstructorDeclaration(r)}))}((b(o.range)?e.last(o.range):o.range).end,r);R?L.insertNodeBefore(s.file,R,P,!0):L.insertNodeAtEndOfScope(s.file,r,P),g.writeFixes(L);var B=[],j=function(t,r,n){var i=e.factory.createIdentifier(n);if(e.isClassLike(t)){var o=r.facts&a.InStaticRegion?e.factory.createIdentifier(t.name.text):e.factory.createThis();return e.factory.createPropertyAccessExpression(o,i)}return i}(r,o,x),J=e.factory.createCallExpression(j,F,E);if(o.facts&a.IsGenerator&&(J=e.factory.createYieldExpression(e.factory.createToken(41),J)),o.facts&a.IsAsyncFunction&&(J=e.factory.createAwaitExpression(J)),S(t)&&(J=e.factory.createJsxExpression(void 0,J)),i.length&&!l)if(e.Debug.assert(!O,"Expected no returnValueProperty"),e.Debug.assert(!(o.facts&a.HasReturn),"Expected RangeFacts.HasReturn flag to be unset"),1===i.length){var z=i[0];B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.getSynthesizedDeepClone(z.name),void 0,e.getSynthesizedDeepClone(z.type),J)],z.parent.flags)));}else {for(var U=[],K=[],V=i[0].parent.flags,q=!1,W=0,H=i;W<H.length;W++){z=H[W],U.push(e.factory.createBindingElement(void 0,void 0,e.getSynthesizedDeepClone(z.name)));var G=p.typeToTypeNode(p.getBaseTypeOfLiteralType(p.getTypeAtLocation(z)),r,1);K.push(e.factory.createPropertySignature(void 0,z.symbol.name,void 0,G)),q=q||void 0!==z.type,V&=z.parent.flags;}var Q=q?e.factory.createTypeLiteralNode(K):void 0;Q&&e.setEmitFlags(Q,1),B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(e.factory.createObjectBindingPattern(U),void 0,Q,J)],V)));}else if(i.length||l){if(i.length)for(var X=0,Y=i;X<Y.length;X++){var Z=(z=Y[X]).parent.flags;2&Z&&(Z=-3&Z|1),B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(z.symbol.name,void 0,re(z.type))],Z)));}O&&B.push(e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(O,void 0,re(c))],1)));var $=h(i,l);O&&$.unshift(e.factory.createShorthandPropertyAssignment(O)),1===$.length?(e.Debug.assert(!O,"Shouldn't have returnValueProperty here"),B.push(e.factory.createExpressionStatement(e.factory.createAssignment($[0].name,J))),o.facts&a.HasReturn&&B.push(e.factory.createReturnStatement())):(B.push(e.factory.createExpressionStatement(e.factory.createAssignment(e.factory.createObjectLiteralExpression($),J))),O&&B.push(e.factory.createReturnStatement(e.factory.createIdentifier(O))));}else o.facts&a.HasReturn?B.push(e.factory.createReturnStatement(J)):b(o.range)?B.push(e.factory.createExpressionStatement(J)):B.push(J);b(o.range)?L.replaceNodeRangeWithNodes(s.file,e.first(o.range),e.last(o.range),B):L.replaceNodeWithNodes(s.file,o.range,B);var ee=L.getChanges(),te=(b(o.range)?e.first(o.range):o.range).getSourceFile().fileName;return {renameFilename:te,renameLocation:e.getRenameLocation(ee,te,x,!1),edits:ee};function re(t){if(void 0!==t){for(var r=e.getSynthesizedDeepClone(t),n=r;e.isParenthesizedTypeNode(n);)n=n.type;return e.isUnionTypeNode(n)&&e.find(n.types,(function(e){return 152===e.kind}))?r:e.factory.createUnionTypeNode([r,e.factory.createKeywordTypeNode(152)])}}}(c,o[n],l[n],_,t,r)}(n,t,o)}var s=/^constant_scope_(\d+)$/.exec(r);if(s)return o=+s[1],e.Debug.assert(isFinite(o),"Expected to parse a finite number from the constant scope index"),function(t,r,n){var i=m(t,r),o=i.scopes,s=i.readsAndWrites,c=s.target,l=s.usagesPerScope,u=s.constantErrorsPerScope,_=s.exposedVariableDeclarations;return e.Debug.assert(!u[n].length,"The extraction went missing? How?"),e.Debug.assert(0===_.length,"Extract constant accepted a range containing a variable declaration?"),r.cancellationToken.throwIfCancellationRequested(),function(t,r,n,i,o){var s,c=n.substitutions,l=o.program.getTypeChecker(),u=r.getSourceFile(),_=e.getUniqueName(e.isClassLike(r)?"newProperty":"newLocal",u),d=e.isInJSFile(r),p=d||!l.isContextSensitive(t)?void 0:l.typeToTypeNode(l.getContextualType(t),r,1),f=function(t,r){return r.size?function t(n){var i=r.get(e.getNodeId(n).toString());return i?e.getSynthesizedDeepClone(i):e.visitEachChild(n,t,e.nullTransformationContext)}(t):t}(e.skipParentheses(t),c);s=function(n,i){if(void 0===n)return {variableType:n,initializer:i};if(!e.isFunctionExpression(i)&&!e.isArrowFunction(i)||i.typeParameters)return {variableType:n,initializer:i};var a=l.getTypeAtLocation(t),o=e.singleOrUndefined(l.getSignaturesOfType(a,0));if(!o)return {variableType:n,initializer:i};if(o.getTypeParameters())return {variableType:n,initializer:i};for(var s=[],c=!1,u=0,_=i.parameters;u<_.length;u++){var d=_[u];if(d.type)s.push(d);else {var p=l.getTypeAtLocation(d);p===l.getAnyType()&&(c=!0),s.push(e.factory.updateParameterDeclaration(d,d.decorators,d.modifiers,d.dotDotDotToken,d.name,d.questionToken,d.type||l.typeToTypeNode(p,r,1),d.initializer));}}if(c)return {variableType:n,initializer:i};if(n=void 0,e.isArrowFunction(i))i=e.factory.updateArrowFunction(i,t.modifiers,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.equalsGreaterThanToken,i.body);else {if(o&&o.thisParameter){var f=e.firstOrUndefined(s);if(!f||e.isIdentifier(f.name)&&"this"!==f.name.escapedText){var g=l.getTypeOfSymbolAtLocation(o.thisParameter,t);s.splice(0,0,e.factory.createParameterDeclaration(void 0,void 0,void 0,"this",void 0,l.typeToTypeNode(g,r,1)));}}i=e.factory.updateFunctionExpression(i,t.modifiers,i.asteriskToken,i.name,i.typeParameters,s,i.type||l.typeToTypeNode(o.getReturnType(),r,1),i.body);}return {variableType:n,initializer:i}}(p,f),p=s.variableType,f=s.initializer,e.suppressLeadingAndTrailingTrivia(f);var m=e.textChanges.ChangeTracker.fromContext(o);if(e.isClassLike(r)){e.Debug.assert(!d,"Cannot extract to a JS class");var y=[];y.push(e.factory.createModifier(121)),i&a.InStaticRegion&&y.push(e.factory.createModifier(124)),y.push(e.factory.createModifier(144));var v=e.factory.createPropertyDeclaration(void 0,y,_,void 0,p,f),h=e.factory.createPropertyAccessExpression(i&a.InStaticRegion?e.factory.createIdentifier(r.name.getText()):e.factory.createThis(),e.factory.createIdentifier(_));S(t)&&(h=e.factory.createJsxExpression(void 0,h));var b=function(t,r){var n,i=r.members;e.Debug.assert(i.length>0,"Found no members");for(var a=!0,o=0,s=i;o<s.length;o++){var c=s[o];if(c.pos>t)return n||i[0];if(a&&!e.isPropertyDeclaration(c)){if(void 0!==n)return c;a=!1;}n=c;}return void 0===n?e.Debug.fail():n}(t.pos,r);m.insertNodeBefore(o.file,b,v,!0),m.replaceNode(o.file,t,h);}else {var x=e.factory.createVariableDeclaration(_,void 0,p,f),T=function(t,r){for(var n;void 0!==t&&t!==r;){if(e.isVariableDeclaration(t)&&t.initializer===n&&e.isVariableDeclarationList(t.parent)&&t.parent.declarations.length>1)return t;n=t,t=t.parent;}}(t,r);if(T)m.insertNodeBefore(o.file,T,x),h=e.factory.createIdentifier(_),m.replaceNode(o.file,t,h);else if(237===t.parent.kind&&r===e.findAncestor(t,g)){var C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2));m.replaceNode(o.file,t.parent,C);}else C=e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([x],2)),0===(b=function(t,r){var n;e.Debug.assert(!e.isClassLike(r));for(var i=t;i!==r;i=i.parent)g(i)&&(n=i);for(i=(n||t).parent;;i=i.parent){if(D(i)){for(var a=void 0,o=0,s=i.statements;o<s.length;o++){var c=s[o];if(c.pos>t.pos)break;a=c;}return !a&&e.isCaseClause(i)?(e.Debug.assert(e.isSwitchStatement(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):e.Debug.checkDefined(a,"prevStatement failed to get set")}e.Debug.assert(i!==r,"Didn't encounter a block-like before encountering scope");}}(t,r)).pos?m.insertNodeAtTopOfFile(o.file,C,!1):m.insertNodeBefore(o.file,b,C,!1),237===t.parent.kind?m.delete(o.file,t.parent):(h=e.factory.createIdentifier(_),S(t)&&(h=e.factory.createJsxExpression(void 0,h)),m.replaceNode(o.file,t,h));}var E=m.getChanges(),k=t.getSourceFile().fileName;return {renameFilename:k,renameLocation:e.getRenameLocation(E,k,_,!0),edits:E}}(e.isExpression(c)?c:c.statements[0].expression,o[n],l[n],t.facts,r)}(n,t,o);e.Debug.fail("Unrecognized action name");}function p(t,r,i){void 0===i&&(i=!0);var o=r.length;if(0===o&&!i)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractEmpty)]};var s=0===o&&i,c=e.findFirstNonJsxWhitespaceToken(t,r.start),l=e.findTokenOnLeftOfPosition(t,e.textSpanEnd(r)),u=c&&l&&i?function(e,t,r){var n=e.getStart(r),i=t.getEnd();return 59===r.text.charCodeAt(i)&&i++,{start:n,length:i-n}}(c,l,t):r,_=s?function(t){return e.findAncestor(t,(function(t){return t.parent&&x(t)&&!e.isBinaryExpression(t.parent)}))}(c):e.getParentNodeInSpan(c,t,u),d=s?_:e.getParentNodeInSpan(l,t,u),p=[],g=a.None;if(!_||!d)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(e.isJSDoc(_))return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractJSDoc)]};if(_.parent!==d.parent)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};if(_!==d){if(!D(_.parent))return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};for(var m=[],y=0,v=_.parent.statements;y<v.length;y++){var h=v[y];if(h===_||m.length){var b=C(h);if(b)return {errors:b};m.push(h);}if(h===d)break}return m.length?{targetRange:{range:m,facts:g,declarations:p}}:{errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]}}if(e.isReturnStatement(_)&&!_.expression)return {errors:[e.createFileDiagnostic(t,r.start,o,n.cannotExtractRange)]};var S=function(t){if(e.isReturnStatement(t)){if(t.expression)return t.expression}else if(e.isVariableStatement(t)){for(var r=0,n=void 0,i=0,a=t.declarationList.declarations;i<a.length;i++){var o=a[i];o.initializer&&(r++,n=o.initializer);}if(1===r)return n}else if(e.isVariableDeclaration(t)&&t.initializer)return t.initializer;return t}(_),T=function(t){if(e.isIdentifier(e.isExpressionStatement(t)?t.expression:t))return [e.createDiagnosticForNode(t,n.cannotExtractIdentifier)]}(S)||C(S);return T?{errors:T}:{targetRange:{range:f(S),facts:g,declarations:p}};function C(t){var i;if(function(e){e[e.None=0]="None",e[e.Break=1]="Break",e[e.Continue=2]="Continue",e[e.Return=4]="Return";}(i||(i={})),e.Debug.assert(t.pos<=t.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),e.Debug.assert(!e.positionIsSynthesized(t.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!(e.isStatement(t)||e.isExpressionNode(t)&&x(t)))return [e.createDiagnosticForNode(t,n.statementOrExpressionExpected)];if(8388608&t.flags)return [e.createDiagnosticForNode(t,n.cannotExtractAmbientBlock)];var o,s=e.getContainingClass(t);s&&function(t,r){for(var n=t;n!==r;){if(166===n.kind){e.isStatic(n)&&(g|=a.InStaticRegion);break}if(163===n.kind){170===e.getContainingFunction(n).kind&&(g|=a.InStaticRegion);break}168===n.kind&&e.isStatic(n)&&(g|=a.InStaticRegion),n=n.parent;}}(t,s);var c,l=4;return function t(i){if(o)return !0;if(e.isDeclaration(i)){var s=253===i.kind?i.parent.parent:i;if(e.hasSyntacticModifier(s,1))return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0;p.push(i.symbol);}switch(i.kind){case 265:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractImport)),!0;case 270:return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractExportedEntity)),!0;case 106:if(207===i.parent.kind){var u=e.getContainingClass(i);if(u.pos<r.start||u.end>=r.start+r.length)return (o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractSuper)),!0}else g|=a.UsesThis;break;case 213:e.forEachChild(i,(function t(r){if(e.isThis(r))g|=a.UsesThis;else {if(e.isClassLike(r)||e.isFunctionLike(r)&&!e.isArrowFunction(r))return !1;e.forEachChild(r,t);}}));case 256:case 255:e.isSourceFile(i.parent)&&void 0===i.parent.externalModuleIndicator&&(o||(o=[])).push(e.createDiagnosticForNode(i,n.functionWillNotBeVisibleInTheNewScope));case 225:case 212:case 168:case 170:case 171:case 172:return !1}var _=l;switch(i.kind){case 238:case 251:l=0;break;case 234:i.parent&&251===i.parent.kind&&i.parent.finallyBlock===i&&(l=4);break;case 289:case 288:l|=1;break;default:e.isIterationStatement(i,!1)&&(l|=3);}switch(i.kind){case 191:case 108:g|=a.UsesThis;break;case 249:var d=i.label;(c||(c=[])).push(d.escapedText),e.forEachChild(i,t),c.pop();break;case 245:case 244:(d=i.label)?e.contains(c,d.escapedText)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):l&(245===i.kind?1:2)||(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break;case 217:g|=a.IsAsyncFunction;break;case 223:g|=a.IsGenerator;break;case 246:4&l?g|=a.HasReturn:(o||(o=[])).push(e.createDiagnosticForNode(i,n.cannotExtractRangeContainingConditionalReturnStatement));break;default:e.forEachChild(i,t);}l=_;}(t),o}}function f(t){return e.isStatement(t)?[t]:e.isExpressionNode(t)?e.isExpressionStatement(t.parent)?[t.parent]:t:void 0}function g(t){return e.isFunctionLikeDeclaration(t)||e.isSourceFile(t)||e.isModuleBlock(t)||e.isClassLike(t)}function m(t,r){var i=r.file,o=function(t){var r=b(t.range)?e.first(t.range):t.range;if(t.facts&a.UsesThis){var n=e.getContainingClass(r);if(n){var i=e.findAncestor(r,e.isFunctionLikeDeclaration);return i?[i,n]:[n]}}for(var o=[];;)if(163===(r=r.parent).kind&&(r=e.findAncestor(r,(function(t){return e.isFunctionLikeDeclaration(t)})).parent),g(r)&&(o.push(r),303===r.kind))return o}(t);return {scopes:o,readsAndWrites:function(t,r,i,o,s,c){var l,u,_=new e.Map,d=[],p=[],f=[],g=[],m=[],y=new e.Map,v=[],h=b(t.range)?1===t.range.length&&e.isExpressionStatement(t.range[0])?t.range[0].expression:void 0:t.range;if(void 0===h){var x=t.range,D=e.first(x).getStart(),S=e.last(x).end;u=e.createFileDiagnostic(o,D,S-D,n.expressionExpected);}else 147456&s.getTypeAtLocation(h).flags&&(u=e.createDiagnosticForNode(h,n.uselessConstantType));for(var T=0,C=r;T<C.length;T++){var E=C[T];d.push({usages:new e.Map,typeParameterUsages:new e.Map,substitutions:new e.Map}),p.push(new e.Map),f.push([]);var k=[];u&&k.push(u),e.isClassLike(E)&&e.isInJSFile(E)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToJSClass)),e.isArrowFunction(E)&&!e.isBlock(E.body)&&k.push(e.createDiagnosticForNode(E,n.cannotExtractToExpressionArrowFunction)),g.push(k);}var N,F=new e.Map,A=b(t.range)?e.factory.createBlock(t.range):t.range,P=b(t.range)?e.first(t.range):t.range,w=(N=P,!!e.findAncestor(N,(function(t){return e.isDeclarationWithTypeParameters(t)&&0!==e.getEffectiveTypeParameterDeclarations(t).length})));if(function c(l,u){if(void 0===u&&(u=1),w&&K(s.getTypeAtLocation(l)),e.isDeclaration(l)&&l.symbol&&m.push(l),e.isAssignmentExpression(l))c(l.left,2),c(l.right);else if(e.isUnaryExpressionWithWrite(l))c(l.operand,2);else if(e.isPropertyAccessExpression(l)||e.isElementAccessExpression(l))e.forEachChild(l,c);else if(e.isIdentifier(l)){if(!l.parent)return;if(e.isQualifiedName(l.parent)&&l!==l.parent.left)return;if(e.isPropertyAccessExpression(l.parent)&&l!==l.parent.expression)return;!function(c,l,u){var _=function(c,l,u){var _=V(c);if(_){var m=e.getSymbolId(_).toString(),y=F.get(m);if(y&&y>=l)return m;if(F.set(m,l),y){for(var v=0,h=d;v<h.length;v++){var b=h[v];b.usages.get(c.text)&&b.usages.set(c.text,{usage:l,symbol:_,node:c});}return m}var x=_.getDeclarations(),D=x&&e.find(x,(function(e){return e.getSourceFile()===o}));if(D&&!e.rangeContainsStartEnd(i,D.getStart(),D.end)){if(t.facts&a.IsGenerator&&2===l){for(var S=e.createDiagnosticForNode(c,n.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators),T=0,C=f;T<C.length;T++)C[T].push(S);for(var E=0,k=g;E<k.length;E++)k[E].push(S);}for(var N=0;N<r.length;N++){var A=r[N];if(s.resolveName(_.name,A,_.flags,!1)!==_&&!p[N].has(m)){var P=q(_.exportSymbol||_,A,u);P?p[N].set(m,P):u?262144&_.flags||(S=e.createDiagnosticForNode(c,n.typeWillNotBeVisibleInTheNewScope),f[N].push(S),g[N].push(S)):d[N].usages.set(c.text,{usage:l,symbol:_,node:c});}}return m}}}(c,l,u);if(_)for(var m=0;m<r.length;m++){var y=p[m].get(_);y&&d[m].substitutions.set(e.getNodeId(c).toString(),y);}}(l,u,e.isPartOfTypeNode(l));}else e.forEachChild(l,c);}(A),w&&!b(t.range)&&K(s.getContextualType(t.range)),_.size>0){for(var I=new e.Map,O=0,M=P;void 0!==M&&O<r.length;M=M.parent)if(M===r[O]&&(I.forEach((function(e,t){d[O].typeParameterUsages.set(t,e);})),O++),e.isDeclarationWithTypeParameters(M))for(var L=0,R=e.getEffectiveTypeParameterDeclarations(M);L<R.length;L++){var B=R[L],j=s.getTypeAtLocation(B);_.has(j.id.toString())&&I.set(j.id.toString(),j);}e.Debug.assert(O===r.length,"Should have iterated all scopes");}if(m.length){var J=e.isBlockScope(r[0],r[0].parent)?r[0]:e.getEnclosingBlockScopeContainer(r[0]);e.forEachChild(J,(function r(n){if(!(n===t.range||b(t.range)&&t.range.indexOf(n)>=0)){var i=e.isIdentifier(n)?V(n):s.getSymbolAtLocation(n);if(i){var a=e.find(m,(function(e){return e.symbol===i}));if(a)if(e.isVariableDeclaration(a)){var o=a.symbol.id.toString();y.has(o)||(v.push(a),y.set(o,!0));}else l=l||a;}e.forEachChild(n,r);}}));}for(var z=function(r){var i=d[r];if(r>0&&(i.usages.size>0||i.typeParameterUsages.size>0)){var a=b(t.range)?t.range[0]:t.range;g[r].push(e.createDiagnosticForNode(a,n.cannotAccessVariablesFromNestedScopes));}var o,s=!1;if(d[r].usages.forEach((function(t){2===t.usage&&(s=!0,106500&t.symbol.flags&&t.symbol.valueDeclaration&&e.hasEffectiveModifier(t.symbol.valueDeclaration,64)&&(o=t.symbol.valueDeclaration));})),e.Debug.assert(b(t.range)||0===v.length,"No variable declarations expected if something was extracted"),s&&!b(t.range)){var c=e.createDiagnosticForNode(t.range,n.cannotWriteInExpression);f[r].push(c),g[r].push(c);}else o&&r>0?(c=e.createDiagnosticForNode(o,n.cannotExtractReadonlyPropertyInitializerOutsideConstructor),f[r].push(c),g[r].push(c)):l&&(c=e.createDiagnosticForNode(l,n.cannotExtractExportedEntity),f[r].push(c),g[r].push(c));},U=0;U<r.length;U++)z(U);return {target:A,usagesPerScope:d,functionErrorsPerScope:f,constantErrorsPerScope:g,exposedVariableDeclarations:v};function K(e){for(var t=0,r=s.getSymbolWalker((function(){return c.throwIfCancellationRequested(),!0})).walkType(e).visitedTypes;t<r.length;t++){var n=r[t];n.isTypeParameter()&&_.set(n.id.toString(),n);}}function V(t){return t.parent&&e.isShorthandPropertyAssignment(t.parent)&&t.parent.name===t?s.getShorthandAssignmentValueSymbol(t.parent):s.getSymbolAtLocation(t)}function q(t,r,n){if(t){var i=t.getDeclarations();if(i&&i.some((function(e){return e.parent===r})))return e.factory.createIdentifier(t.name);var a=q(t.parent,r,n);if(void 0!==a)return n?e.factory.createQualifiedName(a,e.factory.createIdentifier(t.name)):e.factory.createPropertyAccessExpression(a,t.name)}}}(t,o,function(t,r){return b(t.range)?{pos:e.first(t.range).getStart(r),end:e.last(t.range).getEnd()}:t.range}(t,i),i,r.program.getTypeChecker(),r.cancellationToken)}}function y(e){var t,r=e.symbol;if(r&&r.declarations)for(var n=0,i=r.declarations;n<i.length;n++){var a=i[n];(void 0===t||a.pos<t.pos)&&(t=a);}return t}function v(t,r){var n=t.type,i=t.declaration,a=r.type,o=r.declaration;return e.compareProperties(i,o,"pos",e.compareValues)||e.compareStringsCaseSensitive(n.symbol?n.symbol.getName():"",a.symbol?a.symbol.getName():"")||e.compareValues(n.id,a.id)}function h(t,r){var n=e.map(t,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)})),i=e.map(r,(function(t){return e.factory.createShorthandPropertyAssignment(t.symbol.name)}));return void 0===n?i:void 0===i?n:n.concat(i)}function b(t){return e.isArray(t)}function x(e){var t=e.parent;switch(t.kind){case 297:return !1}switch(e.kind){case 10:return 265!==t.kind&&269!==t.kind;case 224:case 200:case 202:return !1;case 79:return 202!==t.kind&&269!==t.kind&&274!==t.kind}return !0}function D(e){switch(e.kind){case 234:case 303:case 261:case 288:return !0;default:return !1}}function S(t){return (e.isJsxElement(t)||e.isJsxSelfClosingElement(t)||e.isJsxFragment(t))&&(e.isJsxElement(t.parent)||e.isJsxFragment(t.parent))}t.registerRefactor(c,{kinds:[l.kind,u.kind],getAvailableActions:_,getEditsForAction:d}),r.getAvailableActions=_,r.getEditsForAction=d,function(t){function r(t){return {message:t,code:0,category:e.DiagnosticCategory.Message,key:t}}t.cannotExtractRange=r("Cannot extract range."),t.cannotExtractImport=r("Cannot extract import statement."),t.cannotExtractSuper=r("Cannot extract super call."),t.cannotExtractJSDoc=r("Cannot extract JSDoc."),t.cannotExtractEmpty=r("Cannot extract empty range."),t.expressionExpected=r("expression expected."),t.uselessConstantType=r("No reason to extract constant of type."),t.statementOrExpressionExpected=r("Statement or expression expected."),t.cannotExtractRangeContainingConditionalBreakOrContinueStatements=r("Cannot extract range containing conditional break or continue statements."),t.cannotExtractRangeContainingConditionalReturnStatement=r("Cannot extract range containing conditional return statement."),t.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=r("Cannot extract range containing labeled break or continue with target outside of the range."),t.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=r("Cannot extract range containing writes to references located outside of the target range in generators."),t.typeWillNotBeVisibleInTheNewScope=r("Type will not visible in the new scope."),t.functionWillNotBeVisibleInTheNewScope=r("Function will not visible in the new scope."),t.cannotExtractIdentifier=r("Select more than a single identifier."),t.cannotExtractExportedEntity=r("Cannot extract exported declaration"),t.cannotWriteInExpression=r("Cannot write back side-effects when extracting an expression"),t.cannotExtractReadonlyPropertyInitializerOutsideConstructor=r("Cannot move initialization of read-only class property outside of the constructor"),t.cannotExtractAmbientBlock=r("Cannot extract code from ambient contexts"),t.cannotAccessVariablesFromNestedScopes=r("Cannot access variables from nested scopes"),t.cannotExtractToJSClass=r("Cannot extract constant to a class scope in JS"),t.cannotExtractToExpressionArrowFunction=r("Cannot extract constant to an arrow function without a block");}(n=r.Messages||(r.Messages={})),function(e){e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.InStaticRegion=16]="InStaticRegion";}(a||(a={})),r.getRangeToExtract=p,function(e){e[e.Module=0]="Module",e[e.Global=1]="Global";}(o||(o={})),function(e){e[e.Read=1]="Read",e[e.Write=2]="Write";}(s||(s={}));})((t=e.refactor||(e.refactor={})).extractSymbol||(t.extractSymbol={}));}(t),function(e){!function(t){var r="Extract type",n={name:"Extract to type alias",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_type_alias),kind:"refactor.extract.type"},a={name:"Extract to interface",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_interface),kind:"refactor.extract.interface"},o={name:"Extract to typedef",description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_to_typedef),kind:"refactor.extract.typedef"};function s(t,r){void 0===r&&(r=!0);var n=t.file,i=t.startPosition,a=e.isSourceFileJS(n),o=e.getTokenAtPosition(n,i),s=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),u=s.pos===s.end&&r,_=e.findAncestor(o,(function(t){return t.parent&&e.isTypeNode(t)&&!l(s,t.parent,n)&&(u||e.nodeOverlapsWithStartEnd(o,n,s.pos,s.end))}));if(!_||!e.isTypeNode(_))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_type_node)};var d=t.program.getTypeChecker(),p=e.Debug.checkDefined(e.findAncestor(_,e.isStatement),"Should find a statement"),f=function(t,r,n,i){var a=[];return function o(s){if(e.isTypeReferenceNode(s)){if(e.isIdentifier(s.typeName)&&(null==(d=t.resolveName(s.typeName.text,s.typeName,262144,!0))?void 0:d.declarations)){var c=e.cast(e.first(d.declarations),e.isTypeParameterDeclaration);l(n,c,i)&&!l(r,c,i)&&e.pushIfUnique(a,c);}}else if(e.isInferTypeNode(s)){var u=e.findAncestor(s,(function(t){return e.isConditionalTypeNode(t)&&l(t.extendsType,s,i)}));if(!u||!l(r,u,i))return !0}else if(e.isTypePredicateNode(s)||e.isThisTypeNode(s)){var _=e.findAncestor(s.parent,e.isFunctionLike);if(_&&_.type&&l(_.type,s,i)&&!l(r,_,i))return !0}else if(e.isTypeQueryNode(s)){var d;if(e.isIdentifier(s.exprName)){if((null==(d=t.resolveName(s.exprName.text,s.exprName,111551,!1))?void 0:d.valueDeclaration)&&l(n,d.valueDeclaration,i)&&!l(r,d.valueDeclaration,i))return !0}else if(e.isThisIdentifier(s.exprName.left)&&!l(r,s.parent,i))return !0}return i&&e.isTupleTypeNode(s)&&e.getLineAndCharacterOfPosition(i,s.pos).line===e.getLineAndCharacterOfPosition(i,s.end).line&&e.setEmitFlags(s,1),e.forEachChild(s,o)}(r)?void 0:a}(d,_,p,n);return f?{isJS:a,selection:_,firstStatement:p,typeParameters:f,typeElements:c(d,_)}:{error:e.getLocaleSpecificMessage(e.Diagnostics.No_type_could_be_extracted_from_this_type_node)}}function c(t,r){if(r){if(e.isIntersectionTypeNode(r)){for(var n=[],i=new e.Map,a=0,o=r.types;a<o.length;a++){var s=c(t,o[a]);if(!s||!s.every((function(t){return t.name&&e.addToSeen(i,e.getNameFromPropertyName(t.name))})))return;e.addRange(n,s);}return n}return e.isParenthesizedTypeNode(r)?c(t,r.type):e.isTypeLiteralNode(r)?r.members:void 0}}function l(t,r,n){return e.rangeContainsStartEnd(t,e.skipTrivia(n.text,r.pos),r.end)}t.registerRefactor(r,{kinds:[n.kind,a.kind,o.kind],getAvailableActions:function(c){var l=s(c,"invoked"===c.triggerReason);return l?t.isRefactorErrorInfo(l)?c.preferences.provideRefactorNotApplicableReason?[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},n),{notApplicableReason:l.error}),i$1(i$1({},a),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:r,description:e.getLocaleSpecificMessage(e.Diagnostics.Extract_type),actions:l.isJS?[o]:e.append([n],l.typeElements&&a)}]:e.emptyArray},getEditsForAction:function(r,i){var c=r.file,l=s(r);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected to find a range to extract");var u=e.getUniqueName("NewType",c),_=e.textChanges.ChangeTracker.with(r,(function(t){switch(i){case n.name:return e.Debug.assert(!l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters,c=e.factory.createTypeAliasDeclaration(void 0,void 0,n,s.map((function(t){return e.factory.updateTypeParameterDeclaration(t,t.name,t.constraint,void 0)})),o);t.insertNodeBefore(r,a,e.ignoreSourceNewlines(c),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);case o.name:return e.Debug.assert(l.isJS,"Invalid actionName/JS combo"),function(t,r,n,i){var a=i.firstStatement,o=i.selection,s=i.typeParameters,c=e.factory.createJSDocTypedefTag(e.factory.createIdentifier("typedef"),e.factory.createJSDocTypeExpression(o),e.factory.createIdentifier(n)),l=[];e.forEach(s,(function(t){var r=e.getEffectiveConstraintOfTypeParameter(t),n=e.factory.createTypeParameterDeclaration(t.name),i=e.factory.createJSDocTemplateTag(e.factory.createIdentifier("template"),r&&e.cast(r,e.isJSDocTypeExpression),[n]);l.push(i);})),t.insertNodeBefore(r,a,e.factory.createJSDocComment(void 0,e.factory.createNodeArray(e.concatenate(l,[c]))),!0),t.replaceNode(r,o,e.factory.createTypeReferenceNode(n,s.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))));}(t,c,u,l);case a.name:return e.Debug.assert(!l.isJS&&!!l.typeElements,"Invalid actionName/JS combo"),function(t,r,n,i){var a,o=i.firstStatement,s=i.selection,c=i.typeParameters,l=i.typeElements,u=e.factory.createInterfaceDeclaration(void 0,void 0,n,c,void 0,l);e.setTextRange(u,null===(a=l[0])||void 0===a?void 0:a.parent),t.insertNodeBefore(r,o,e.ignoreSourceNewlines(u),!0),t.replaceNode(r,s,e.factory.createTypeReferenceNode(n,c.map((function(t){return e.factory.createTypeReferenceNode(t.name,void 0)}))),{leadingTriviaOption:e.textChanges.LeadingTriviaOption.Exclude,trailingTriviaOption:e.textChanges.TrailingTriviaOption.ExcludeWhitespace});}(t,c,u,l);default:e.Debug.fail("Unexpected action name");}})),d=c.fileName;return {edits:_,renameFilename:d,renameLocation:e.getRenameLocation(_,d,u,!1)}}});}(e.refactor||(e.refactor={}));}(t),function(e){var t,r,n,a;(t=e.refactor||(e.refactor={})).generateGetAccessorAndSetAccessor||(t.generateGetAccessorAndSetAccessor={}),r="Generate 'get' and 'set' accessors",n=e.Diagnostics.Generate_get_and_set_accessors.message,a={name:r,description:n,kind:"refactor.rewrite.property.generateAccessors"},t.registerRefactor(r,{kinds:[a.kind],getEditsForAction:function(r,n){if(r.endPosition){var i=e.codefix.getAccessorConvertiblePropertyAtPosition(r.file,r.program,r.startPosition,r.endPosition);e.Debug.assert(i&&!t.isRefactorErrorInfo(i),"Expected applicable refactor info");var a=e.codefix.generateAccessorFromProperty(r.file,r.program,r.startPosition,r.endPosition,r,n);if(a){var o=r.file.fileName,s=i.renameAccessor?i.accessorName:i.fieldName;return {renameFilename:o,renameLocation:(e.isIdentifier(s)?0:-1)+e.getRenameLocation(a,o,s.text,e.isParameter(i.declaration)),edits:a}}}},getAvailableActions:function(o){if(!o.endPosition)return e.emptyArray;var s=e.codefix.getAccessorConvertiblePropertyAtPosition(o.file,o.program,o.startPosition,o.endPosition,"invoked"===o.triggerReason);return s?t.isRefactorErrorInfo(s)?o.preferences.provideRefactorNotApplicableReason?[{name:r,description:n,actions:[i$1(i$1({},a),{notApplicableReason:s.error})]}]:e.emptyArray:[{name:r,description:n,actions:[a]}]:e.emptyArray}});}(t),function(e){var t;(t=e.refactor||(e.refactor={})).isRefactorErrorInfo=function(e){return void 0!==e.error},t.refactorKindBeginsWith=function(e,t){return !t||e.substr(0,t.length)===t};}(t),function(e){!function(t){var r="Move to a new file",a=e.getLocaleSpecificMessage(e.Diagnostics.Move_to_a_new_file),o={name:r,description:a,kind:"refactor.move.newFile"};function s(t){var r=function(t){var r=t.file,n=e.createTextRangeFromSpan(e.getRefactorContextSpan(t)),i=r.statements,a=e.findIndex(i,(function(e){return e.end>n.pos}));if(-1!==a){var o=i[a];if(e.isNamedDeclaration(o)&&o.name&&e.rangeContainsRange(o.name,n))return {toMove:[i[a]],afterLast:i[a+1]};if(!(n.pos>o.getStart(r))){var s=e.findIndex(i,(function(e){return e.end>n.end}),a);if(-1===s||!(0===s||i[s].getStart(r)<n.end))return {toMove:i.slice(a,-1===s?i.length:s),afterLast:-1===s?void 0:i[s]}}}}(t);if(void 0!==r){var n=[],i=[],a=r.toMove,o=r.afterLast;return e.getRangesWhere(a,c,(function(e,t){for(var r=e;r<t;r++)n.push(a[r]);i.push({first:a[e],afterLast:o});})),0===n.length?void 0:{all:n,ranges:i}}}function c(t){return !function(t){switch(t.kind){case 265:return !0;case 264:return !e.hasSyntacticModifier(t,1);case 236:return t.declarationList.declarations.every((function(t){return !!t.initializer&&e.isRequireCall(t.initializer,!0)}));default:return !1}}(t)&&!e.isPrologueDirective(t)}function l(e,t,r){for(var n=0,i=t;n<i.length;n++){var a=i[n],o=a.first,s=a.afterLast;r.deleteNodeRangeExcludingEnd(e,o,s);}}function u(e){return 265===e.kind?e.moduleSpecifier:264===e.kind?e.moduleReference.expression:e.initializer.arguments[0]}function _(t,r){if(e.isImportDeclaration(t))e.isStringLiteral(t.moduleSpecifier)&&r(t);else if(e.isImportEqualsDeclaration(t))e.isExternalModuleReference(t.moduleReference)&&e.isStringLiteralLike(t.moduleReference.expression)&&r(t);else if(e.isVariableStatement(t))for(var n=0,i=t.declarationList.declarations;n<i.length;n++){var a=i[n];a.initializer&&e.isRequireCall(a.initializer,!0)&&r(a);}}function d(t,r,n,i,a){if(n=e.ensurePathIsNonModuleName(n),i){var o=r.map((function(t){return e.factory.createImportSpecifier(!1,void 0,e.factory.createIdentifier(t))}));return e.makeImportIfNecessary(t,o,n,a)}e.Debug.assert(!t,"No default import should exist");var s=r.map((function(t){return e.factory.createBindingElement(void 0,void 0,t)}));return s.length?p(e.factory.createObjectBindingPattern(s),void 0,f(e.factory.createStringLiteral(n))):void 0}function p(t,r,n,i){return void 0===i&&(i=2),e.factory.createVariableStatement(void 0,e.factory.createVariableDeclarationList([e.factory.createVariableDeclaration(t,void 0,r,n)],i))}function f(t){return e.factory.createCallExpression(e.factory.createIdentifier("require"),void 0,[t])}function g(t,r,n,i){switch(r.kind){case 265:!function(t,r,n,i){if(r.importClause){var a=r.importClause,o=a.name,s=a.namedBindings,c=!o||i(o),l=!s||(267===s.kind?i(s.name):0!==s.elements.length&&s.elements.every((function(e){return i(e.name)})));if(c&&l)n.delete(t,r);else if(o&&c&&n.delete(t,o),s)if(l)n.replaceNode(t,r.importClause,e.factory.updateImportClause(r.importClause,r.importClause.isTypeOnly,o,void 0));else if(268===s.kind)for(var u=0,_=s.elements;u<_.length;u++){var d=_[u];i(d.name)&&n.delete(t,d);}}}(t,r,n,i);break;case 264:i(r.name)&&n.delete(t,r);break;case 253:!function(t,r,n,i){var a=r.name;switch(a.kind){case 79:i(a)&&n.delete(t,a);break;case 201:break;case 200:if(a.elements.every((function(t){return e.isIdentifier(t.name)&&i(t.name)})))n.delete(t,e.isVariableDeclarationList(r.parent)&&1===r.parent.declarations.length?r.parent.parent:r);else for(var o=0,s=a.elements;o<s.length;o++){var c=s[o];e.isIdentifier(c.name)&&i(c.name)&&n.delete(t,c.name);}}}(t,r,n,i);break;default:e.Debug.assertNever(r,"Unexpected import decl kind ".concat(r.kind));}}function m(t){switch(t.kind){case 264:case 269:case 266:case 267:return !0;case 253:return y(t);case 202:return e.isVariableDeclaration(t.parent.parent)&&y(t.parent.parent);default:return !1}}function y(t){return e.isSourceFile(t.parent.parent.parent)&&!!t.initializer&&e.isRequireCall(t.initializer,!0)}function v(t,r,n){switch(t.kind){case 265:var i=t.importClause;if(!i)return;var a=i.name&&n(i.name)?i.name:void 0,o=i.namedBindings&&function(t,r){if(267===t.kind)return r(t.name)?t:void 0;var n=t.elements.filter((function(e){return r(e.name)}));return n.length?e.factory.createNamedImports(n):void 0}(i.namedBindings,n);return a||o?e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,a,o),r,void 0):void 0;case 264:return n(t.name)?t:void 0;case 253:var s=function(t,r){switch(t.kind){case 79:return r(t)?t:void 0;case 201:return t;case 200:var n=t.elements.filter((function(t){return t.propertyName||!e.isIdentifier(t.name)||r(t.name)}));return n.length?e.factory.createObjectBindingPattern(n):void 0}}(t.name,n);return s?p(s,t.type,f(r),t.parent.flags):void 0;default:return e.Debug.assertNever(t,"Unexpected import kind ".concat(t.kind))}}function h(t,r,n){t.forEachChild((function t(i){if(e.isIdentifier(i)&&!e.isDeclarationName(i)){var a=r.getSymbolAtLocation(i);a&&n(a);}else i.forEachChild(t);}));}t.registerRefactor(r,{kinds:[o.kind],getAvailableActions:function(t){var n=s(t);return t.preferences.allowTextChangesInNewFiles&&n?[{name:r,description:a,actions:[o]}]:t.preferences.provideRefactorNotApplicableReason?[{name:r,description:a,actions:[i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Selection_is_not_a_valid_statement_or_statements)})]}]:e.emptyArray},getEditsForAction:function(t,i){e.Debug.assert(i===r,"Wrong refactor invoked");var a=e.Debug.checkDefined(s(t));return {edits:e.textChanges.ChangeTracker.with(t,(function(r){return i=t.file,o=t.program,s=a,c=r,p=t.host,y=t.preferences,T=o.getTypeChecker(),P=function(t,r,n){var i=new b,a=new b,o=new b,s=function(t){if(void 0!==t){var r=n.getJsxNamespace(t),i=n.resolveName(r,t,1920,!0);return i&&e.some(i.declarations,m)?i:void 0}}(e.find(r,(function(e){return !!(2&e.transformFlags)})));s&&a.add(s);for(var c=0,l=r;c<l.length;c++)S(y=l[c],(function(t){i.add(e.Debug.checkDefined(e.isExpressionStatement(t)?n.getSymbolAtLocation(t.expression.left):t.symbol,"Need a symbol here"));}));for(var u=0,_=r;u<_.length;u++)h(y=_[u],n,(function(r){if(r.declarations)for(var n=0,s=r.declarations;n<s.length;n++){var c=s[n];m(c)?a.add(r):x(c)&&(l=c,(e.isVariableDeclaration(l)?l.parent.parent.parent:l.parent)===t)&&!i.has(r)&&o.add(r);}var l;}));for(var d=a.clone(),p=new b,f=0,g=t.statements;f<g.length;f++){var y=g[f];e.contains(r,y)||(s&&2&y.transformFlags&&d.delete(s),h(y,n,(function(e){i.has(e)&&p.add(e),d.delete(e);})));}return {movedSymbols:i,newFileImportsFromOldFile:o,oldFileImportsFromNewFile:p,oldImportsNeededByNewFile:a,unusedImportsFromOldFile:d}}(i,s.all,T),w=e.getDirectoryPath(i.fileName),I=e.extensionFromPath(i.fileName),M=(O=function(t,r,n,i){for(var a=t,o=1;;o++){var s=e.combinePaths(n,a+r);if(!i.fileExists(s))return a;a="".concat(t,".").concat(o);}}(P.movedSymbols.forEachEntry(e.symbolNameNoDefault)||"newFile",I,w,p))+I,c.createNewFile(i,e.combinePaths(w,M),function(t,r,i,a,o,s,c){var p=o.getTypeChecker(),m=e.takeWhile(t.statements,e.isPrologueDirective);if(!t.externalModuleIndicator&&!t.commonJsModuleIndicator)return l(t,a.ranges,i),n$3(n$3([],m,!0),a.all,!0);var y=!!t.externalModuleIndicator,h=e.getQuotePreference(t,c),b=function(t,r,n,i){var a,o=[];return t.forEach((function(t){"default"===t.escapedName?a=e.factory.createIdentifier(e.symbolNameNoDefault(t)):o.push(t.name);})),d(a,o,r,n,i)}(r.oldFileImportsFromNewFile,s,y,h);b&&e.insertImports(i,t,b,!0),function(t,r,n,i,a){for(var o=0,s=t.statements;o<s.length;o++){var c=s[o];e.contains(r,c)||_(c,(function(e){return g(t,e,n,(function(e){return i.has(a.getSymbolAtLocation(e))}))}));}}(t,a.all,i,r.unusedImportsFromOldFile,p),l(t,a.ranges,i),function(t,r,n,i,a){for(var o=r.getTypeChecker(),s=function(r){if(r===n)return "continue";for(var s=function(s){_(s,(function(c){if(o.getSymbolAtLocation(u(c))===n.symbol){var l=function(t){var r=e.isBindingElement(t.parent)?e.getPropertySymbolFromBindingElement(o,t.parent):e.skipAlias(o.getSymbolAtLocation(t),o);return !!r&&i.has(r)};g(r,c,t,l);var _=e.combinePaths(e.getDirectoryPath(u(c).text),a),d=v(c,e.factory.createStringLiteral(_),l);d&&t.insertNodeAfter(r,s,d);var p=function(t){switch(t.kind){case 265:return t.importClause&&t.importClause.namedBindings&&267===t.importClause.namedBindings.kind?t.importClause.namedBindings.name:void 0;case 264:return t.name;case 253:return e.tryCast(t.name,e.isIdentifier);default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c);p&&function(t,r,n,i,a,o,s,c){var l=e.codefix.moduleSpecifierToValidIdentifier(a,99),u=!1,_=[];if(e.FindAllReferences.Core.eachSymbolReferenceInFile(s,n,r,(function(t){e.isPropertyAccessExpression(t.parent)&&(u=u||!!n.resolveName(l,t,67108863,!0),i.has(n.getSymbolAtLocation(t.parent.name))&&_.push(t));})),_.length){for(var d=u?e.getUniqueName(l,r):l,p=0,g=_;p<g.length;p++){var m=g[p];t.replaceNode(r,m,e.factory.createIdentifier(d));}t.insertNodeAfter(r,c,function(t,r,n){var i=e.factory.createIdentifier(r),a=e.factory.createStringLiteral(n);switch(t.kind){case 265:return e.factory.createImportDeclaration(void 0,void 0,e.factory.createImportClause(!1,void 0,e.factory.createNamespaceImport(i)),a,void 0);case 264:return e.factory.createImportEqualsDeclaration(void 0,void 0,!1,i,e.factory.createExternalModuleReference(a));case 253:return e.factory.createVariableDeclaration(i,void 0,void 0,f(a));default:return e.Debug.assertNever(t,"Unexpected node kind ".concat(t.kind))}}(c,a,o));}}(t,r,o,i,a,_,p,c);}}));},c=0,l=r.statements;c<l.length;c++)s(l[c]);},c=0,l=r.getSourceFiles();c<l.length;c++)s(l[c]);}(i,o,t,r.movedSymbols,s);var T=function(t,r,n,i,a,o,s){for(var c,l=[],p=0,f=t.statements;p<f.length;p++)_(f[p],(function(t){e.append(l,v(t,u(t),(function(e){return r.has(a.getSymbolAtLocation(e))})));}));var g=[],m=e.nodeSeenTracker();return n.forEach((function(r){if(r.declarations)for(var n=0,a=r.declarations;n<a.length;n++){var s=a[n];if(x(s)){var l=(_=s,e.isExpressionStatement(_)?e.tryCast(_.expression.left.name,e.isIdentifier):e.tryCast(_.name,e.isIdentifier));if(l){var u=C(s);m(u)&&E(t,u,l,i,o),e.hasSyntacticModifier(s,512)?c=l:g.push(l.text);}}}var _;})),e.append(l,d(c,g,e.removeFileExtension(e.getBaseFileName(t.fileName)),o,s)),l}(t,r.oldImportsNeededByNewFile,r.newFileImportsFromOldFile,i,p,y,h),P=function(t,r,i,a){return e.flatMap(r,(function(r){if(s=r,e.Debug.assert(e.isSourceFile(s.parent),"Node parent should be a SourceFile"),(D(s)||e.isVariableStatement(s))&&!k(t,r,a)&&S(r,(function(t){return i.has(e.Debug.checkDefined(t.symbol))}))){var o=function(e,t){return t?[N(e)]:function(e){return n$3([e],F(e).map(A),!0)}(e)}(r,a);if(o)return o}var s;return r}))}(t,a.all,r.oldFileImportsFromNewFile,y);return T.length&&P.length?n$3(n$3(n$3(n$3([],m,!0),T,!0),[4],!1),P,!0):n$3(n$3(n$3([],m,!0),T,!0),P,!0)}(i,P,c,s,o,O,y)),void function(t,r,n,i,a){var o=t.getCompilerOptions().configFile;if(o){var s=e.normalizePath(e.combinePaths(n,"..",i)),c=e.getRelativePathFromFile(o.fileName,s,a),l=o.statements[0]&&e.tryCast(o.statements[0].expression,e.isObjectLiteralExpression),u=l&&e.find(l.properties,(function(t){return e.isPropertyAssignment(t)&&e.isStringLiteral(t.name)&&"files"===t.name.text}));u&&e.isArrayLiteralExpression(u.initializer)&&r.insertNodeInListAfter(o,e.last(u.initializer.elements),e.factory.createStringLiteral(c),u.initializer.elements);}}(o,c,i.fileName,M,e.hostGetCanonicalFileName(p));var i,o,s,c,p,y,T,P,w,I,O,M;})),renameFilename:void 0,renameLocation:void 0}}});var b=function(){function t(){this.map=new e.Map;}return t.prototype.add=function(t){this.map.set(String(e.getSymbolId(t)),t);},t.prototype.has=function(t){return this.map.has(String(e.getSymbolId(t)))},t.prototype.delete=function(t){this.map.delete(String(e.getSymbolId(t)));},t.prototype.forEach=function(e){this.map.forEach(e);},t.prototype.forEachEntry=function(t){return e.forEachEntry(this.map,t)},t.prototype.clone=function(){var r=new t;return e.copyEntries(this.map,r.map),r},t}();function x(t){return D(t)&&e.isSourceFile(t.parent)||e.isVariableDeclaration(t)&&e.isSourceFile(t.parent.parent.parent)}function D(e){switch(e.kind){case 255:case 256:case 260:case 259:case 258:case 257:case 264:return !0;default:return !1}}function S(t,r){switch(t.kind){case 255:case 256:case 260:case 259:case 258:case 257:case 264:return r(t);case 236:return e.firstDefined(t.declarationList.declarations,(function(e){return T(e.name,r)}));case 237:var n=t.expression;return e.isBinaryExpression(n)&&1===e.getAssignmentDeclarationKind(n)?r(t):void 0}}function T(t,r){switch(t.kind){case 79:return r(e.cast(t.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));case 201:case 200:return e.firstDefined(t.elements,(function(t){return e.isOmittedExpression(t)?void 0:T(t.name,r)}));default:return e.Debug.assertNever(t,"Unexpected name kind ".concat(t.kind))}}function C(t){switch(t.kind){case 253:return t.parent.parent;case 202:return C(e.cast(t.parent.parent,(function(t){return e.isVariableDeclaration(t)||e.isBindingElement(t)})));default:return t}}function E(t,r,n,i,a){if(!k(t,r,a,n))if(a)e.isExpressionStatement(r)||i.insertExportModifier(t,r);else {var o=F(r);0!==o.length&&i.insertNodesAfter(t,r,o.map(A));}}function k(t,r,n,i){var a;return n?!e.isExpressionStatement(r)&&e.hasSyntacticModifier(r,1)||!(!i||!(null===(a=t.symbol.exports)||void 0===a?void 0:a.has(i.escapedText))):F(r).some((function(r){return t.symbol.exports.has(e.escapeLeadingUnderscores(r))}))}function N(t){var r=e.concatenate([e.factory.createModifier(93)],t.modifiers);switch(t.kind){case 255:return e.factory.updateFunctionDeclaration(t,t.decorators,r,t.asteriskToken,t.name,t.typeParameters,t.parameters,t.type,t.body);case 256:return e.factory.updateClassDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members);case 236:return e.factory.updateVariableStatement(t,r,t.declarationList);case 260:return e.factory.updateModuleDeclaration(t,t.decorators,r,t.name,t.body);case 259:return e.factory.updateEnumDeclaration(t,t.decorators,r,t.name,t.members);case 258:return e.factory.updateTypeAliasDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.type);case 257:return e.factory.updateInterfaceDeclaration(t,t.decorators,r,t.name,t.typeParameters,t.heritageClauses,t.members);case 264:return e.factory.updateImportEqualsDeclaration(t,t.decorators,r,t.isTypeOnly,t.name,t.moduleReference);case 237:return e.Debug.fail();default:return e.Debug.assertNever(t,"Unexpected declaration kind ".concat(t.kind))}}function F(t){switch(t.kind){case 255:case 256:return [t.name.text];case 236:return e.mapDefined(t.declarationList.declarations,(function(t){return e.isIdentifier(t.name)?t.name.text:void 0}));case 260:case 259:case 258:case 257:case 264:return e.emptyArray;case 237:return e.Debug.fail("Can't export an ExpressionStatement");default:return e.Debug.assertNever(t,"Unexpected decl kind ".concat(t.kind))}}function A(t){return e.factory.createExpressionStatement(e.factory.createBinaryExpression(e.factory.createPropertyAccessExpression(e.factory.createIdentifier("exports"),e.factory.createIdentifier(t)),63,e.factory.createIdentifier(t)))}}(e.refactor||(e.refactor={}));}(t),function(e){var t;(function(r){var n="Add or remove braces in an arrow function",a=e.Diagnostics.Add_or_remove_braces_in_an_arrow_function.message,o={name:"Add braces to arrow function",description:e.Diagnostics.Add_braces_to_arrow_function.message,kind:"refactor.rewrite.arrow.braces.add"},s={name:"Remove braces from arrow function",description:e.Diagnostics.Remove_braces_from_arrow_function.message,kind:"refactor.rewrite.arrow.braces.remove"};function c(r,n,i,a){void 0===i&&(i=!0);var c=e.getTokenAtPosition(r,n),l=e.getContainingFunction(c);if(!l)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_find_a_containing_arrow_function)};if(!e.isArrowFunction(l))return {error:e.getLocaleSpecificMessage(e.Diagnostics.Containing_function_is_not_an_arrow_function)};if(e.rangeContainsRange(l,c)&&(!e.rangeContainsRange(l.body,c)||i)){if(t.refactorKindBeginsWith(o.kind,a)&&e.isExpression(l.body))return {func:l,addBraces:!0,expression:l.body};if(t.refactorKindBeginsWith(s.kind,a)&&e.isBlock(l.body)&&1===l.body.statements.length){var u=e.first(l.body.statements);if(e.isReturnStatement(u))return {func:l,addBraces:!1,expression:u.expression,returnStatement:u}}}}t.registerRefactor(n,{kinds:[s.kind],getEditsForAction:function(r,n){var i=r.file,a=r.startPosition,l=c(i,a);e.Debug.assert(l&&!t.isRefactorErrorInfo(l),"Expected applicable refactor info");var u,_=l.expression,d=l.returnStatement,p=l.func;if(n===o.name){var f=e.factory.createReturnStatement(_);u=e.factory.createBlock([f],!0),e.copyLeadingComments(_,f,i,3,!0);}else if(n===s.name&&d){var g=_||e.factory.createVoidZero();u=e.needsParentheses(g)?e.factory.createParenthesizedExpression(g):g,e.copyTrailingAsLeadingComments(d,u,i,3,!1),e.copyLeadingComments(d,u,i,3,!1),e.copyTrailingComments(d,u,i,3,!1);}else e.Debug.fail("invalid action");return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(e){e.replaceNode(i,p.body,u);}))}},getAvailableActions:function(r){var l=c(r.file,r.startPosition,"invoked"===r.triggerReason);return l?t.isRefactorErrorInfo(l)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:l.error}),i$1(i$1({},s),{notApplicableReason:l.error})]}]:e.emptyArray:[{name:n,description:a,actions:[l.addBraces?o:s]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).addOrRemoveBracesToArrowFunction||(t.addOrRemoveBracesToArrowFunction={}));}(t),function(e){var t;(function(r){var i="Convert parameters to destructured object",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_parameters_to_destructured_object),o={name:i,description:a,kind:"refactor.rewrite.parameters.toDestructured"};function s(t,r){var n=e.getContainingObjectLiteralElement(t);if(n){var i=r.getContextualTypeForObjectLiteralElement(n),a=null==i?void 0:i.getSymbol();if(a&&!(6&e.getCheckFlags(a)))return a}}function c(t){var r=t.node;return e.isImportSpecifier(r.parent)||e.isImportClause(r.parent)||e.isImportEqualsDeclaration(r.parent)||e.isNamespaceImport(r.parent)||e.isExportSpecifier(r.parent)||e.isExportAssignment(r.parent)?r:void 0}function l(t){if(e.isDeclaration(t.node.parent))return t.node}function u(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 207:case 208:var i=e.tryCast(n,e.isCallOrNewExpression);if(i&&i.expression===r)return i;break;case 205:var a=e.tryCast(n,e.isPropertyAccessExpression);if(a&&a.parent&&a.name===r){var o=e.tryCast(a.parent,e.isCallOrNewExpression);if(o&&o.expression===a)return o}break;case 206:var s=e.tryCast(n,e.isElementAccessExpression);if(s&&s.parent&&s.argumentExpression===r){var c=e.tryCast(s.parent,e.isCallOrNewExpression);if(c&&c.expression===s)return c}}}}function _(t){if(t.node.parent){var r=t.node,n=r.parent;switch(n.kind){case 205:var i=e.tryCast(n,e.isPropertyAccessExpression);if(i&&i.expression===r)return i;break;case 206:var a=e.tryCast(n,e.isElementAccessExpression);if(a&&a.expression===r)return a}}}function d(t){var r=t.node;if(2===e.getMeaningFromLocation(r)||e.isExpressionWithTypeArgumentsInClassExtendsClause(r.parent))return r}function p(t,r,n){var i=e.getTouchingToken(t,r),a=e.getContainingFunctionDeclaration(i);if(!function(t){var r=e.findAncestor(t,e.isJSDocNode);if(r){var n=e.findAncestor(r,(function(t){return !e.isJSDocNode(t)}));return !!n&&e.isFunctionLikeDeclaration(n)}return !1}(i))return !(a&&function(t,r){var n;if(!function(t,r){return function(e){return y(e)?e.length-1:e.length}(t)>=2&&e.every(t,(function(t){return function(t,r){if(e.isRestParameter(t)){var n=r.getTypeAtLocation(t);if(!r.isArrayType(n)&&!r.isTupleType(n))return !1}return !t.modifiers&&!t.decorators&&e.isIdentifier(t.name)}(t,r)}))}(t.parameters,r))return !1;switch(t.kind){case 255:return g(t)&&f(t,r);case 168:if(e.isObjectLiteralExpression(t.parent)){var i=s(t.name,r);return 1===(null===(n=null==i?void 0:i.declarations)||void 0===n?void 0:n.length)&&f(t,r)}return f(t,r);case 170:return e.isClassDeclaration(t.parent)?g(t.parent)&&f(t,r):m(t.parent.parent)&&f(t,r);case 212:case 213:return m(t.parent)}return !1}(a,n)&&e.rangeContainsRange(a,i))||a.body&&e.rangeContainsRange(a.body,i)?void 0:a}function f(e,t){return !!e.body&&!t.isImplementationOfOverload(e)}function g(t){return !!t.name||!!e.findModifier(t,88)}function m(t){return e.isVariableDeclaration(t)&&e.isVarConst(t)&&e.isIdentifier(t.name)&&!t.type}function y(t){return t.length>0&&e.isThis(t[0].name)}function v(t){return y(t)&&(t=e.factory.createNodeArray(t.slice(1),t.hasTrailingComma)),t}function h(t,r){var n=v(t.parameters),i=e.isRestParameter(e.last(n)),a=i?r.slice(0,n.length-1):r,o=e.map(a,(function(t,r){var i,a,o=(i=x(n[r]),a=t,e.isIdentifier(a)&&e.getTextOfIdentifierOrLiteral(a)===i?e.factory.createShorthandPropertyAssignment(i):e.factory.createPropertyAssignment(i,a));return e.suppressLeadingAndTrailingTrivia(o.name),e.isPropertyAssignment(o)&&e.suppressLeadingAndTrailingTrivia(o.initializer),e.copyComments(t,o),o}));if(i&&r.length>=n.length){var s=r.slice(n.length-1),c=e.factory.createPropertyAssignment(x(e.last(n)),e.factory.createArrayLiteralExpression(s));o.push(c);}return e.factory.createObjectLiteralExpression(o,!1)}function b(t,r,n){var i,a,o,s=r.getTypeChecker(),c=v(t.parameters),l=e.map(c,(function(t){var r=e.factory.createBindingElement(void 0,void 0,x(t),e.isRestParameter(t)&&g(t)?e.factory.createArrayLiteralExpression():t.initializer);return e.suppressLeadingAndTrailingTrivia(r),t.initializer&&r.initializer&&e.copyComments(t.initializer,r.initializer),r})),u=e.factory.createObjectBindingPattern(l),_=(i=c,a=e.map(i,(function(t){var i,a,o=t.type;o||!t.initializer&&!e.isRestParameter(t)||(i=t,a=s.getTypeAtLocation(i),o=e.getTypeNodeIfAccessible(a,i,r,n));var c=e.factory.createPropertySignature(void 0,x(t),g(t)?e.factory.createToken(57):t.questionToken,o);return e.suppressLeadingAndTrailingTrivia(c),e.copyComments(t.name,c.name),t.type&&c.type&&e.copyComments(t.type,c.type),c})),e.addEmitFlags(e.factory.createTypeLiteralNode(a),1));e.every(c,g)&&(o=e.factory.createObjectLiteralExpression());var d=e.factory.createParameterDeclaration(void 0,void 0,void 0,u,void 0,_,o);if(y(t.parameters)){var p=t.parameters[0],f=e.factory.createParameterDeclaration(void 0,void 0,void 0,p.name,void 0,p.type);return e.suppressLeadingAndTrailingTrivia(f.name),e.copyComments(p.name,f.name),p.type&&(e.suppressLeadingAndTrailingTrivia(f.type),e.copyComments(p.type,f.type)),e.factory.createNodeArray([f,d])}return e.factory.createNodeArray([d]);function g(t){if(e.isRestParameter(t)){var r=s.getTypeAtLocation(t);return !s.isTupleType(r)}return s.isOptionalParameter(t)}}function x(t){return e.getTextOfIdentifierOrLiteral(t.name)}t.registerRefactor(i,{kinds:[o.kind],getEditsForAction:function(t,r){e.Debug.assert(r===i,"Unexpected action name");var a=t.file,o=t.startPosition,f=t.program,g=t.cancellationToken,m=t.host,y=p(a,o,f.getTypeChecker());if(y&&g){var v=function(t,r,i){var a=function(t){switch(t.kind){case 255:return t.name?[t.name]:[e.Debug.checkDefined(e.findModifier(t,88),"Nameless function declaration should be a default export")];case 168:return [t.name];case 170:var r=e.Debug.checkDefined(e.findChildOfKind(t,134,t.getSourceFile()),"Constructor declaration should have constructor keyword");return 225===t.parent.kind?[t.parent.parent.name,r]:[r];case 213:return [t.parent.name];case 212:return t.name?[t.name,t.parent.name]:[t.parent.name];default:return e.Debug.assertNever(t,"Unexpected function declaration kind ".concat(t.kind))}}(t),o=e.isConstructorDeclaration(t)?function(t){switch(t.parent.kind){case 256:var r=t.parent;return r.name?[r.name]:[e.Debug.checkDefined(e.findModifier(r,88),"Nameless class declaration should be a default export")];case 225:var n=t.parent,i=t.parent.parent,a=n.name;return a?[a,i.name]:[i.name]}}(t):[],p=e.deduplicate(n$3(n$3([],a,!0),o,!0),e.equateValues),f=r.getTypeChecker(),g=function(r){for(var n={accessExpressions:[],typeUsages:[]},i={functionCalls:[],declarations:[],classReferences:n,valid:!0},p=e.map(a,m),g=e.map(o,m),y=e.isConstructorDeclaration(t),v=e.map(a,(function(e){return s(e,f)})),h=0,b=r;h<b.length;h++){var x=b[h];if(0!==x.kind){if(e.contains(v,m(x.node))){if(k=x.node.parent,e.isMethodSignature(k)&&(e.isInterfaceDeclaration(k.parent)||e.isTypeLiteralNode(k.parent))){i.signature=x.node.parent;continue}if(S=u(x)){i.functionCalls.push(S);continue}}var D=s(x.node,f);if(D&&e.contains(v,D)&&(T=l(x))){i.declarations.push(T);continue}if(e.contains(p,m(x.node))||e.isNewExpressionTarget(x.node)){var S;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}if(S=u(x)){i.functionCalls.push(S);continue}}if(y&&e.contains(g,m(x.node))){var T;if(c(x))continue;if(T=l(x)){i.declarations.push(T);continue}var C=_(x);if(C){n.accessExpressions.push(C);continue}if(e.isClassDeclaration(t.parent)){var E=d(x);if(E){n.typeUsages.push(E);continue}}}i.valid=!1;}else i.valid=!1;}var k;return i}(e.flatMap(p,(function(t){return e.FindAllReferences.getReferenceEntriesForNode(-1,t,r,r.getSourceFiles(),i)})));return e.every(g.declarations,(function(t){return e.contains(p,t)}))||(g.valid=!1),g;function m(t){var r=f.getSymbolAtLocation(t);return r&&e.getSymbolTarget(r,f)}}(y,f,g);return v.valid?{renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(t,(function(t){return function(t,r,n,i,a,o){var s=o.signature,c=e.map(b(a,r,n),(function(t){return e.getSynthesizedDeepClone(t)}));s&&p(s,e.map(b(s,r,n),(function(t){return e.getSynthesizedDeepClone(t)}))),p(a,c);for(var l=0,u=e.sortAndDeduplicate(o.functionCalls,(function(t,r){return e.compareValues(t.pos,r.pos)}));l<u.length;l++){var _=u[l];if(_.arguments&&_.arguments.length){var d=e.getSynthesizedDeepClone(h(a,_.arguments),!0);i.replaceNodeRange(e.getSourceFileOfNode(_),e.first(_.arguments),e.last(_.arguments),d,{leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}function p(r,n){i.replaceNodeRangeWithNodes(t,e.first(r.parameters),e.last(r.parameters),n,{joiner:", ",indentation:0,leadingTriviaOption:e.textChanges.LeadingTriviaOption.IncludeAll,trailingTriviaOption:e.textChanges.TrailingTriviaOption.Include});}}(a,f,m,t,y,v)}))}:{edits:[]}}},getAvailableActions:function(t){var r=t.file,n=t.startPosition;return e.isSourceFileJS(r)?e.emptyArray:p(r,n,t.program.getTypeChecker())?[{name:i,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertParamsToDestructuredObject||(t.convertParamsToDestructuredObject={}));}(t),function(e){var t;(function(r){var n="Convert to template string",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_template_string),o={name:n,description:a,kind:"refactor.rewrite.string"};function s(t,r){var n=e.getTokenAtPosition(t,r),i=l(n);return !u(i).isValidConcatenation&&e.isParenthesizedExpression(i.parent)&&e.isBinaryExpression(i.parent.parent)?i.parent.parent:n}function c(t,r){var n=l(r),i=t.file,a=function(t,r){var n=t.nodes,i=function(t,r){return function(n,i){n<t.length&&e.copyTrailingComments(t[n],i,r,3,!1);}}(t.operators,r),a=function(t,r,n){return function(i,a){for(;i.length>0;){var o=i.shift();e.copyTrailingComments(t[o],a,r,3,!1),n(o,a);}}}(n,r,i),o=d(0,n),s=o[0],c=o[1],l=o[2],u=o[3];if(s===n.length){var f=e.factory.createNoSubstitutionTemplateLiteral(c,l);return a(u,f),f}var g=[],m=e.factory.createTemplateHead(c,l);a(u,m);for(var y,v=function(t){var r=function(t){return e.isParenthesizedExpression(t)&&(p(t),t=t.expression),t}(n[t]);i(t,r);var o=d(t+1,n),s=o[0],c=o[1],l=o[2],u=o[3],f=(t=s-1)==n.length-1;if(e.isTemplateExpression(r)){var m=e.map(r.templateSpans,(function(t,n){p(t);var i=n===r.templateSpans.length-1,a=t.literal.text+(i?c:""),o=_(t.literal)+(i?l:"");return e.factory.createTemplateSpan(t.expression,f?e.factory.createTemplateTail(a,o):e.factory.createTemplateMiddle(a,o))}));g.push.apply(g,m);}else {var v=f?e.factory.createTemplateTail(c,l):e.factory.createTemplateMiddle(c,l);a(u,v),g.push(e.factory.createTemplateSpan(r,v));}y=t;},h=s;h<n.length;h++)v(h),h=y;return e.factory.createTemplateExpression(m,g)}(u(n),i),o=e.getTrailingCommentRanges(i.text,n.end);if(o){var s=o[o.length-1],c={pos:o[0].pos,end:s.end};return e.textChanges.ChangeTracker.with(t,(function(e){e.deleteRange(i,c),e.replaceNode(i,n,a);}))}return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,n,a)}))}function l(t){return e.findAncestor(t.parent,(function(t){switch(t.kind){case 205:case 206:return !1;case 222:case 220:return !(e.isBinaryExpression(t.parent)&&(r=t.parent,63!==r.operatorToken.kind));default:return "quit"}var r;}))||t}function u(t){var r=function(t){if(!e.isBinaryExpression(t))return {nodes:[t],operators:[],validOperators:!0,hasString:e.isStringLiteral(t)||e.isNoSubstitutionTemplateLiteral(t)};var n=r(t.left),i=n.nodes,a=n.operators,o=n.hasString,s=n.validOperators;if(!(o||e.isStringLiteral(t.right)||e.isTemplateExpression(t.right)))return {nodes:[t],operators:[],hasString:!1,validOperators:!0};var c=39===t.operatorToken.kind,l=s&&c;return i.push(t.right),a.push(t.operatorToken),{nodes:i,operators:a,hasString:!0,validOperators:l}},n=r(t),i=n.nodes,a=n.operators,o=n.validOperators,s=n.hasString;return {nodes:i,operators:a,isValidConcatenation:o&&s}}function _(t){var r=e.isTemplateHead(t)||e.isTemplateMiddle(t)?-2:-1;return e.getTextOfNode(t).slice(1,r)}function d(t,r){for(var n=[],i="",a="";t<r.length;){var o=r[t];if(!e.isStringLiteralLike(o)){if(e.isTemplateExpression(o)){i+=o.head.text,a+=_(o.head);break}break}i+=o.text,a+=e.getTextOfNode(o).slice(1,-1).replace(/\\.|[$`]/g,(function(e){return "\\"===e[0]?e:"\\"+e})),n.push(t),t++;}return [t,i,a,n]}function p(t){var r=t.getSourceFile();e.copyTrailingComments(t,t.expression,r,3,!1),e.copyTrailingAsLeadingComments(t.expression,t.expression,r,3,!1);}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(t,r){var n=s(t.file,t.startPosition);switch(r){case a:return {edits:c(t,n)};default:return e.Debug.fail("invalid action")}},getAvailableActions:function(t){var r=l(s(t.file,t.startPosition)),c={name:n,description:a,actions:[]};return e.isBinaryExpression(r)&&u(r).isValidConcatenation?(c.actions.push(o),[c]):t.preferences.provideRefactorNotApplicableReason?(c.actions.push(i$1(i$1({},o),{notApplicableReason:e.getLocaleSpecificMessage(e.Diagnostics.Can_only_convert_string_concatenation)})),[c]):e.emptyArray}});})((t=e.refactor||(e.refactor={})).convertStringOrTemplateLiteral||(t.convertStringOrTemplateLiteral={}));}(t),function(e){var t;(function(r){var n="Convert arrow function or function expression",a=e.getLocaleSpecificMessage(e.Diagnostics.Convert_arrow_function_or_function_expression),o={name:"Convert to anonymous function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},s={name:"Convert to named function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_named_function),kind:"refactor.rewrite.function.named"},c={name:"Convert to arrow function",description:e.getLocaleSpecificMessage(e.Diagnostics.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};function l(t){var r=!1;return t.forEachChild((function t(n){e.isThis(n)?r=!0:e.isClassLike(n)||e.isFunctionDeclaration(n)||e.isFunctionExpression(n)||e.forEachChild(n,t);})),r}function u(t,r,n){var i=e.getTokenAtPosition(t,r),a=n.getTypeChecker(),o=function(t,r,n){if(function(t){return e.isVariableDeclaration(t)||e.isVariableDeclarationList(t)&&1===t.declarations.length}(n)){var i=(e.isVariableDeclaration(n)?n:e.first(n.declarations)).initializer;return i&&(e.isArrowFunction(i)||e.isFunctionExpression(i)&&!d(t,r,i))?i:void 0}}(t,a,i.parent);if(o&&!l(o.body)&&!a.containsArgumentsReference(o))return {selectedVariableDeclaration:!0,func:o};var s=e.getContainingFunction(i);if(s&&(e.isFunctionExpression(s)||e.isArrowFunction(s))&&!e.rangeContainsRange(s.body,i)&&!l(s.body)&&!a.containsArgumentsReference(s)){if(e.isFunctionExpression(s)&&d(t,a,s))return;return {selectedVariableDeclaration:!1,func:s}}}function _(t){if(e.isExpression(t)){var r=e.factory.createReturnStatement(t),n=t.getSourceFile();return e.suppressLeadingAndTrailingTrivia(r),e.copyTrailingAsLeadingComments(t,r,n,void 0,!0),e.factory.createBlock([r],!0)}return t}function d(t,r,n){return !!n.name&&e.FindAllReferences.Core.isSymbolReferencedInFile(n.name,r,t)}t.registerRefactor(n,{kinds:[o.kind,s.kind,c.kind],getEditsForAction:function(t,r){var n=u(t.file,t.startPosition,t.program);if(n){var i=n.func,a=[];switch(r){case o.name:a.push.apply(a,function(t,r){var n=t.file,i=_(r.body),a=e.factory.createFunctionExpression(r.modifiers,r.asteriskToken,void 0,r.typeParameters,r.parameters,r.type,i);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(n,r,a)}))}(t,i));break;case s.name:var l=function(t){var r=t.parent;if(e.isVariableDeclaration(r)&&e.isVariableDeclarationInVariableStatement(r)){var n=r.parent,i=n.parent;return e.isVariableDeclarationList(n)&&e.isVariableStatement(i)&&e.isIdentifier(r.name)?{variableDeclaration:r,variableDeclarationList:n,statement:i,name:r.name}:void 0}}(i);if(!l)return;a.push.apply(a,function(t,r,n){var i=t.file,a=_(r.body),o=n.variableDeclaration,s=n.variableDeclarationList,c=n.statement,l=n.name;e.suppressLeadingTrivia(c);var u=1&e.getCombinedModifierFlags(o)|e.getEffectiveModifierFlags(r),d=e.factory.createModifiersFromModifierFlags(u),p=e.factory.createFunctionDeclaration(r.decorators,e.length(d)?d:void 0,r.asteriskToken,l,r.typeParameters,r.parameters,r.type,a);return 1===s.declarations.length?e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,c,p)})):e.textChanges.ChangeTracker.with(t,(function(e){e.delete(i,o),e.insertNodeAfter(i,c,p);}))}(t,i,l));break;case c.name:if(!e.isFunctionExpression(i))return;a.push.apply(a,function(t,r){var n,i=t.file,a=r.body.statements[0];!function(t,r){return 1===t.statements.length&&e.isReturnStatement(r)&&!!r.expression}(r.body,a)?n=r.body:(n=a.expression,e.suppressLeadingAndTrailingTrivia(n),e.copyComments(a,n));var o=e.factory.createArrowFunction(r.modifiers,r.typeParameters,r.parameters,r.type,e.factory.createToken(38),n);return e.textChanges.ChangeTracker.with(t,(function(e){return e.replaceNode(i,r,o)}))}(t,i));break;default:return e.Debug.fail("invalid action")}return {renameFilename:void 0,renameLocation:void 0,edits:a}}},getAvailableActions:function(r){var l=r.file,_=r.startPosition,d=r.program,p=r.kind,f=u(l,_,d);if(!f)return e.emptyArray;var g,m=f.selectedVariableDeclaration,y=f.func,v=[],h=[];return t.refactorKindBeginsWith(s.kind,p)&&((g=m||e.isArrowFunction(y)&&e.isVariableDeclaration(y.parent)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_named_function))?h.push(i$1(i$1({},s),{notApplicableReason:g})):v.push(s)),t.refactorKindBeginsWith(o.kind,p)&&((g=!m&&e.isArrowFunction(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_anonymous_function))?h.push(i$1(i$1({},o),{notApplicableReason:g})):v.push(o)),t.refactorKindBeginsWith(c.kind,p)&&((g=e.isFunctionExpression(y)?void 0:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_convert_to_arrow_function))?h.push(i$1(i$1({},c),{notApplicableReason:g})):v.push(c)),[{name:n,description:a,actions:0===v.length&&r.preferences.provideRefactorNotApplicableReason?h:v}]}});})((t=e.refactor||(e.refactor={})).convertArrowFunctionOrFunctionExpression||(t.convertArrowFunctionOrFunctionExpression={}));}(t),function(e){var t;(function(r){var n="Infer function return type",a=e.Diagnostics.Infer_function_return_type.message,o={name:n,description:a,kind:"refactor.rewrite.function.returnType"};function s(r){if(!e.isInJSFile(r.file)&&t.refactorKindBeginsWith(o.kind,r.kind)){var n=e.getTokenAtPosition(r.file,r.startPosition),i=e.findAncestor(n,(function(t){return e.isBlock(t)||t.parent&&e.isArrowFunction(t.parent)&&(38===t.kind||t.parent.body===t)?"quit":function(e){switch(e.kind){case 255:case 212:case 213:case 168:return !0;default:return !1}}(t)}));if(!i||!i.body||i.type)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Return_type_must_be_inferred_from_a_function)};var a=r.program.getTypeChecker(),s=function(t,r){if(t.isImplementationOfOverload(r)){var n=t.getTypeAtLocation(r).getCallSignatures();if(n.length>1)return t.getUnionType(e.mapDefined(n,(function(e){return e.getReturnType()})))}var i=t.getSignatureFromDeclaration(r);if(i)return t.getReturnTypeOfSignature(i)}(a,i);if(!s)return {error:e.getLocaleSpecificMessage(e.Diagnostics.Could_not_determine_function_return_type)};var c=a.typeToTypeNode(s,i,1);return c?{declaration:i,returnTypeNode:c}:void 0}}t.registerRefactor(n,{kinds:[o.kind],getEditsForAction:function(r){var n=s(r);if(n&&!t.isRefactorErrorInfo(n))return {renameFilename:void 0,renameLocation:void 0,edits:e.textChanges.ChangeTracker.with(r,(function(t){return i=r.file,a=t,o=n.declaration,s=n.returnTypeNode,c=e.findChildOfKind(o,21,i),void((u=(l=e.isArrowFunction(o)&&void 0===c)?e.first(o.parameters):c)&&(l&&(a.insertNodeBefore(i,u,e.factory.createToken(20)),a.insertNodeAfter(i,u,e.factory.createToken(21))),a.insertNodeAt(i,u.end,s,{prefix:": "})));var i,a,o,s,c,l,u;}))}},getAvailableActions:function(r){var c=s(r);return c?t.isRefactorErrorInfo(c)?r.preferences.provideRefactorNotApplicableReason?[{name:n,description:a,actions:[i$1(i$1({},o),{notApplicableReason:c.error})]}]:e.emptyArray:[{name:n,description:a,actions:[o]}]:e.emptyArray}});})((t=e.refactor||(e.refactor={})).inferFunctionReturnType||(t.inferFunctionReturnType={}));}(t),function(e){function t(t,n,i,a){var o=e.isNodeKind(t)?new r(t,n,i):79===t?new u(79,n,i):80===t?new _(80,n,i):new l(t,n,i);return o.parent=a,o.flags=25358336&a.flags,o}e.servicesVersion="0.8";var r=function(){function r(e,t,r){this.pos=t,this.end=r,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.kind=e;}return r.prototype.assertHasRealPosition=function(t){e.Debug.assert(!e.positionIsSynthesized(this.pos)&&!e.positionIsSynthesized(this.end),t||"Node must have a real position for this operation");},r.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},r.prototype.getStart=function(t,r){return this.assertHasRealPosition(),e.getTokenPosOfNode(this,t,r)},r.prototype.getFullStart=function(){return this.assertHasRealPosition(),this.pos},r.prototype.getEnd=function(){return this.assertHasRealPosition(),this.end},r.prototype.getWidth=function(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)},r.prototype.getFullWidth=function(){return this.assertHasRealPosition(),this.end-this.pos},r.prototype.getLeadingTriviaWidth=function(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos},r.prototype.getFullText=function(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)},r.prototype.getText=function(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},r.prototype.getChildCount=function(e){return this.getChildren(e).length},r.prototype.getChildAt=function(e,t){return this.getChildren(t)[e]},r.prototype.getChildren=function(r){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),this._children||(this._children=function(r,n){if(!e.isNodeKind(r.kind))return e.emptyArray;var i=[];if(e.isJSDocCommentContainingNode(r))return r.forEachChild((function(e){i.push(e);})),i;e.scanner.setText((n||r.getSourceFile()).text);var o=r.pos,s=function(e){a(i,o,e.pos,r),i.push(e),o=e.end;};return e.forEach(r.jsDoc,s),o=r.pos,r.forEachChild(s,(function(e){a(i,o,e.pos,r),i.push(function(e,r){var n=t(346,e.pos,e.end,r);n._children=[];for(var i=e.pos,o=0,s=e;o<s.length;o++){var c=s[o];a(n._children,i,c.pos,r),n._children.push(c),i=c.end;}return a(n._children,i,e.end,r),n}(e,r)),o=e.end;})),a(i,o,r.end,r),e.scanner.setText(void 0),i}(this,r))},r.prototype.getFirstToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t);if(r.length){var n=e.find(r,(function(e){return e.kind<307||e.kind>345}));return n.kind<160?n:n.getFirstToken(t)}},r.prototype.getLastToken=function(t){this.assertHasRealPosition();var r=this.getChildren(t),n=e.lastOrUndefined(r);if(n)return n.kind<160?n:n.getLastToken(t)},r.prototype.forEachChild=function(t,r){return e.forEachChild(this,t,r)},r}();function a(r,n,i,a){for(e.scanner.setTextPos(n);n<i;){var o=e.scanner.scan(),s=e.scanner.getTextPos();if(s<=i&&(79===o&&e.Debug.fail("Did not expect ".concat(e.Debug.formatSyntaxKind(a.kind)," to have an Identifier in its trivia")),r.push(t(o,n,s,a))),n=s,1===o)break}}var o=function(){function t(e,t){this.pos=e,this.end=t,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0;}return t.prototype.getSourceFile=function(){return e.getSourceFileOfNode(this)},t.prototype.getStart=function(t,r){return e.getTokenPosOfNode(this,t,r)},t.prototype.getFullStart=function(){return this.pos},t.prototype.getEnd=function(){return this.end},t.prototype.getWidth=function(e){return this.getEnd()-this.getStart(e)},t.prototype.getFullWidth=function(){return this.end-this.pos},t.prototype.getLeadingTriviaWidth=function(e){return this.getStart(e)-this.pos},t.prototype.getFullText=function(e){return (e||this.getSourceFile()).text.substring(this.pos,this.end)},t.prototype.getText=function(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())},t.prototype.getChildCount=function(){return this.getChildren().length},t.prototype.getChildAt=function(e){return this.getChildren()[e]},t.prototype.getChildren=function(){return 1===this.kind&&this.jsDoc||e.emptyArray},t.prototype.getFirstToken=function(){},t.prototype.getLastToken=function(){},t.prototype.forEachChild=function(){},t}(),s=function(){function t(e,t){this.flags=e,this.escapedName=t;}return t.prototype.getFlags=function(){return this.flags},Object.defineProperty(t.prototype,"name",{get:function(){return e.symbolName(this)},enumerable:!1,configurable:!0}),t.prototype.getEscapedName=function(){return this.escapedName},t.prototype.getName=function(){return this.name},t.prototype.getDeclarations=function(){return this.declarations},t.prototype.getDocumentationComment=function(t){if(!this.documentationComment)if(this.documentationComment=e.emptyArray,!this.declarations&&this.target&&this.target.tupleLabelDeclaration){var r=this.target.tupleLabelDeclaration;this.documentationComment=g([r],t);}else this.documentationComment=g(this.declarations,t);return this.documentationComment},t.prototype.getContextualDocumentationComment=function(t,r){switch(null==t?void 0:t.kind){case 171:return this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=e.emptyArray,this.contextualGetAccessorDocumentationComment=g(e.filter(this.declarations,e.isGetAccessor),r)),this.contextualGetAccessorDocumentationComment;case 172:return this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=e.emptyArray,this.contextualSetAccessorDocumentationComment=g(e.filter(this.declarations,e.isSetAccessor),r)),this.contextualSetAccessorDocumentationComment;default:return this.getDocumentationComment(r)}},t.prototype.getJsDocTags=function(t){return void 0===this.tags&&(this.tags=e.JsDoc.getJsDocTagsFromDeclarations(this.declarations,t)),this.tags},t}(),l=function(e){function t(t,r,n){var i=e.call(this,r,n)||this;return i.kind=t,i}return c(t,e),t}(o),u=function(t){function r(e,r,n){var i=t.call(this,r,n)||this;return i.kind=79,i}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);u.prototype.kind=79;var _=function(t){function r(e,r,n){return t.call(this,r,n)||this}return c(r,t),Object.defineProperty(r.prototype,"text",{get:function(){return e.idText(this)},enumerable:!1,configurable:!0}),r}(o);_.prototype.kind=80;var d=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getFlags=function(){return this.flags},t.prototype.getSymbol=function(){return this.symbol},t.prototype.getProperties=function(){return this.checker.getPropertiesOfType(this)},t.prototype.getProperty=function(e){return this.checker.getPropertyOfType(this,e)},t.prototype.getApparentProperties=function(){return this.checker.getAugmentedPropertiesOfType(this)},t.prototype.getCallSignatures=function(){return this.checker.getSignaturesOfType(this,0)},t.prototype.getConstructSignatures=function(){return this.checker.getSignaturesOfType(this,1)},t.prototype.getStringIndexType=function(){return this.checker.getIndexTypeOfType(this,0)},t.prototype.getNumberIndexType=function(){return this.checker.getIndexTypeOfType(this,1)},t.prototype.getBaseTypes=function(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0},t.prototype.isNullableType=function(){return this.checker.isNullableType(this)},t.prototype.getNonNullableType=function(){return this.checker.getNonNullableType(this)},t.prototype.getNonOptionalType=function(){return this.checker.getNonOptionalType(this)},t.prototype.getConstraint=function(){return this.checker.getBaseConstraintOfType(this)},t.prototype.getDefault=function(){return this.checker.getDefaultFromTypeParameter(this)},t.prototype.isUnion=function(){return !!(1048576&this.flags)},t.prototype.isIntersection=function(){return !!(2097152&this.flags)},t.prototype.isUnionOrIntersection=function(){return !!(3145728&this.flags)},t.prototype.isLiteral=function(){return !!(384&this.flags)},t.prototype.isStringLiteral=function(){return !!(128&this.flags)},t.prototype.isNumberLiteral=function(){return !!(256&this.flags)},t.prototype.isTypeParameter=function(){return !!(262144&this.flags)},t.prototype.isClassOrInterface=function(){return !!(3&e.getObjectFlags(this))},t.prototype.isClass=function(){return !!(1&e.getObjectFlags(this))},Object.defineProperty(t.prototype,"typeArguments",{get:function(){if(4&e.getObjectFlags(this))return this.checker.getTypeArguments(this)},enumerable:!1,configurable:!0}),t}(),p=function(){function t(e,t){this.checker=e,this.flags=t;}return t.prototype.getDeclaration=function(){return this.declaration},t.prototype.getTypeParameters=function(){return this.typeParameters},t.prototype.getParameters=function(){return this.parameters},t.prototype.getReturnType=function(){return this.checker.getReturnTypeOfSignature(this)},t.prototype.getDocumentationComment=function(){return this.documentationComment||(this.documentationComment=g(e.singleElementArray(this.declaration),this.checker))},t.prototype.getJsDocTags=function(){return void 0===this.jsDocTags&&(this.jsDocTags=this.declaration?function(t,r){var i=e.JsDoc.getJsDocTagsFromDeclarations([t],r);if(0===i.length||f(t)){var a=m(r,t,(function(e){var t;return 1===(null===(t=e.declarations)||void 0===t?void 0:t.length)?e.getJsDocTags():void 0}));a&&(i=n$3(n$3([],a,!0),i,!0));}return i}(this.declaration,this.checker):[]),this.jsDocTags},t}();function f(t){return e.getJSDocTags(t).some((function(e){return "inheritDoc"===e.tagName.text}))}function g(t,r){if(!t)return e.emptyArray;var n=e.JsDoc.getJsDocCommentsFromDeclarations(t,r);if(r&&(0===n.length||t.some(f)))for(var i=new e.Set,a=0,o=t;a<o.length;a++){var s=o[a],c=m(r,s,(function(e){if(!i.has(e))return i.add(e),e.getDocumentationComment(r)}));c&&(n=0===n.length?c.slice():c.concat(e.lineBreakPart(),n));}return n}function m(t,r,n){var i,a=170===(null===(i=r.parent)||void 0===i?void 0:i.kind)?r.parent.parent:r.parent;if(a)return e.firstDefined(e.getAllSuperTypeNodes(a),(function(e){var i=t.getPropertyOfType(t.getTypeAtLocation(e),r.symbol.name);return i?n(i):void 0}))}var y=function(t){function r(e,r,n){var i=t.call(this,e,r,n)||this;return i.kind=303,i}return c(r,t),r.prototype.update=function(t,r){return e.updateSourceFile(this,t,r)},r.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},r.prototype.getLineStarts=function(){return e.getLineStarts(this)},r.prototype.getPositionOfLineAndCharacter=function(t,r,n){return e.computePositionOfLineAndCharacter(e.getLineStarts(this),t,r,this.text,n)},r.prototype.getLineEndOfPosition=function(e){var t,r=this.getLineAndCharacterOfPosition(e).line,n=this.getLineStarts();r+1>=n.length&&(t=this.getEnd()),t||(t=n[r+1]-1);var i=this.getFullText();return "\n"===i[t]&&"\r"===i[t-1]?t-1:t},r.prototype.getNamedDeclarations=function(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations},r.prototype.computeNamedDeclarations=function(){var t=e.createMultiMap();return this.forEachChild((function i(a){switch(a.kind){case 255:case 212:case 168:case 167:var o=a,s=n(o);if(s){var c=function(e){var r=t.get(e);return r||t.set(e,r=[]),r}(s),l=e.lastOrUndefined(c);l&&o.parent===l.parent&&o.symbol===l.symbol?o.body&&!l.body&&(c[c.length-1]=o):c.push(o);}e.forEachChild(a,i);break;case 256:case 225:case 257:case 258:case 259:case 260:case 264:case 274:case 269:case 266:case 267:case 171:case 172:case 181:r(a),e.forEachChild(a,i);break;case 163:if(!e.hasSyntacticModifier(a,16476))break;case 253:case 202:var u=a;if(e.isBindingPattern(u.name)){e.forEachChild(u.name,i);break}u.initializer&&i(u.initializer);case 297:case 166:case 165:r(a);break;case 271:var _=a;_.exportClause&&(e.isNamedExports(_.exportClause)?e.forEach(_.exportClause.elements,i):i(_.exportClause.name));break;case 265:var d=a.importClause;d&&(d.name&&r(d.name),d.namedBindings&&(267===d.namedBindings.kind?r(d.namedBindings):e.forEach(d.namedBindings.elements,i)));break;case 220:0!==e.getAssignmentDeclarationKind(a)&&r(a);default:e.forEachChild(a,i);}})),t;function r(e){var r=n(e);r&&t.add(r,e);}function n(t){var r=e.getNonAssignedNameOfDeclaration(t);return r&&(e.isComputedPropertyName(r)&&e.isPropertyAccessExpression(r.expression)?r.expression.name.text:e.isPropertyName(r)?e.getNameFromPropertyName(r):void 0)}},r}(r),v=function(){function t(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r;}return t.prototype.getLineAndCharacterOfPosition=function(t){return e.getLineAndCharacterOfPosition(this,t)},t}();function h(t){var r=!0;for(var n in t)if(e.hasProperty(t,n)&&!b(n)){r=!1;break}if(r)return t;var i={};for(var n in t)e.hasProperty(t,n)&&(i[b(n)?n:n.charAt(0).toLowerCase()+n.substr(1)]=t[n]);return i}function b(e){return !e.length||e.charAt(0)===e.charAt(0).toLowerCase()}e.toEditorSettings=h,e.displayPartsToString=function(t){return t?e.map(t,(function(e){return e.text})).join(""):""},e.getDefaultCompilerOptions=function(){return {target:1,jsx:1}},e.getSupportedCodeFixes=function(){return e.codefix.getSupportedErrorCodes()};var x=function(){function t(t,r){this.host=t,this.currentDirectory=t.getCurrentDirectory(),this.fileNameToEntry=new e.Map;for(var n=0,i=t.getScriptFileNames();n<i.length;n++){var a=i[n];this.createEntry(a,e.toPath(a,this.currentDirectory,r));}}return t.prototype.createEntry=function(t,r){var n,i=this.host.getScriptSnapshot(t);return n=i?{hostFileName:t,version:this.host.getScriptVersion(t),scriptSnapshot:i,scriptKind:e.getScriptKind(t,this.host)}:t,this.fileNameToEntry.set(r,n),n},t.prototype.getEntryByPath=function(e){return this.fileNameToEntry.get(e)},t.prototype.getHostFileInformation=function(t){var r=this.fileNameToEntry.get(t);return e.isString(r)?void 0:r},t.prototype.getOrCreateEntryByPath=function(t,r){var n=this.getEntryByPath(r)||this.createEntry(t,r);return e.isString(n)?void 0:n},t.prototype.getRootFileNames=function(){var t=[];return this.fileNameToEntry.forEach((function(r){e.isString(r)?t.push(r):t.push(r.hostFileName);})),t},t.prototype.getScriptSnapshot=function(e){var t=this.getHostFileInformation(e);return t&&t.scriptSnapshot},t}(),D=function(){function t(e){this.host=e;}return t.prototype.getCurrentSourceFile=function(t){var r=this.host.getScriptSnapshot(t);if(!r)throw new Error("Could not find file: '"+t+"'.");var n,i=e.getScriptKind(t,this.host),a=this.host.getScriptVersion(t);if(this.currentFileName!==t)n=T(t,r,99,a,!0,i);else if(this.currentFileVersion!==a){var o=r.getChangeRange(this.currentFileScriptSnapshot);n=C(this.currentSourceFile,r,a,o);}return n&&(this.currentFileVersion=a,this.currentFileName=t,this.currentFileScriptSnapshot=r,this.currentSourceFile=n),this.currentSourceFile},t}();function S(e,t,r){e.version=r,e.scriptSnapshot=t;}function T(t,r,n,i,a,o){var s=e.createSourceFile(t,e.getSnapshotText(r),n,a,o);return S(s,r,i),s}function C(t,r,n,i,a){if(i&&n!==t.version){var o=void 0,s=0!==i.span.start?t.text.substr(0,i.span.start):"",c=e.textSpanEnd(i.span)!==t.text.length?t.text.substr(e.textSpanEnd(i.span)):"";if(0===i.newLength)o=s&&c?s+c:s||c;else {var l=r.getText(i.span.start,i.span.start+i.newLength);o=s&&c?s+l+c:s?s+l:l+c;}var u=e.updateSourceFile(t,o,i,a);return S(u,r,n),u.nameTable=void 0,t!==u&&t.scriptSnapshot&&(t.scriptSnapshot.dispose&&t.scriptSnapshot.dispose(),t.scriptSnapshot=void 0),u}return T(t.fileName,r,t.languageVersion,n,!0,t.scriptKind)}e.createLanguageServiceSourceFile=T,e.updateLanguageServiceSourceFile=C;var E={isCancellationRequested:e.returnFalse,throwIfCancellationRequested:e.noop},k=function(){function t(e){this.cancellationToken=e;}return t.prototype.isCancellationRequested=function(){return this.cancellationToken.isCancellationRequested()},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"CancellationTokenObject"}),new e.OperationCanceledException},t}(),N=function(){function t(e,t){void 0===t&&(t=20),this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0;}return t.prototype.isCancellationRequested=function(){var t=e.timestamp();return Math.abs(t-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds&&(this.lastCancellationCheckTime=t,this.hostCancellationToken.isCancellationRequested())},t.prototype.throwIfCancellationRequested=function(){if(this.isCancellationRequested())throw null===e.tracing||void 0===e.tracing||e.tracing.instant("session","cancellationThrown",{kind:"ThrottledCancellationToken"}),new e.OperationCanceledException},t}();e.ThrottledCancellationToken=N;var F=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints"],A=n$3(n$3([],F,!0),["getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getOccurrencesAtPosition","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors"],!1);function P(t){var r=function(t){switch(t.kind){case 10:case 14:case 8:if(161===t.parent.kind)return e.isObjectLiteralElement(t.parent.parent)?t.parent.parent:void 0;case 79:return !e.isObjectLiteralElement(t.parent)||204!==t.parent.parent.kind&&285!==t.parent.parent.kind||t.parent.name!==t?void 0:t.parent}}(t);return r&&(e.isObjectLiteralExpression(r.parent)||e.isJsxAttributes(r.parent))?r:void 0}function w(t,r,n,i){var a=e.getNameFromPropertyName(t.name);if(!a)return e.emptyArray;if(!n.isUnion())return (o=n.getProperty(a))?[o]:e.emptyArray;var o,s=e.mapDefined(n.types,(function(n){return (e.isObjectLiteralExpression(t.parent)||e.isJsxAttributes(t.parent))&&r.isTypeInvalidDueToUnionDiscriminant(n,t.parent)?void 0:n.getProperty(a)}));return i&&(0===s.length||s.length===n.types.length)&&(o=n.getProperty(a))?[o]:0===s.length?e.mapDefined(n.types,(function(e){return e.getProperty(a)})):s}e.createLanguageService=function(t,r,a){var o,s;void 0===r&&(r=e.createDocumentRegistry(t.useCaseSensitiveFileNames&&t.useCaseSensitiveFileNames(),t.getCurrentDirectory())),s=void 0===a?e.LanguageServiceMode.Semantic:"boolean"==typeof a?a?e.LanguageServiceMode.Syntactic:e.LanguageServiceMode.Semantic:a;var c,l,u=new D(t),_=0,d=t.getCancellationToken?new k(t.getCancellationToken()):E,p=t.getCurrentDirectory();function f(e){t.log&&t.log(e);}!e.localizedDiagnosticMessages&&t.getLocalizedDiagnosticMessages&&e.setLocalizedDiagnosticMessages(t.getLocalizedDiagnosticMessages());var g=e.hostUsesCaseSensitiveFileNames(t),m=e.createGetCanonicalFileName(g),y=e.getSourceMapper({useCaseSensitiveFileNames:function(){return g},getCurrentDirectory:function(){return p},getProgram:S,fileExists:e.maybeBind(t,t.fileExists),readFile:e.maybeBind(t,t.readFile),getDocumentPositionMapper:e.maybeBind(t,t.getDocumentPositionMapper),getSourceFileLike:e.maybeBind(t,t.getSourceFileLike),log:f});function v(e){var t=c.getSourceFile(e);if(!t){var r=new Error("Could not find source file: '".concat(e,"'."));throw r.ProgramFiles=c.getSourceFiles().map((function(e){return e.fileName})),r}return t}function b(){var n,i,a;if(e.Debug.assert(s!==e.LanguageServiceMode.Syntactic),t.getProjectVersion){var o=t.getProjectVersion();if(o){if(l===o&&!(null===(n=t.hasChangedAutomaticTypeDirectiveNames)||void 0===n?void 0:n.call(t)))return;l=o;}}var u=t.getTypeRootsVersion?t.getTypeRootsVersion():0;_!==u&&(f("TypeRoots version has changed; provide new program"),c=void 0,_=u);var v,h=new x(t,m),b=h.getRootFileNames(),D=t.getCompilationSettings()||{target:1,jsx:1},S=t.hasInvalidatedResolution||e.returnFalse,T=e.maybeBind(t,t.hasChangedAutomaticTypeDirectiveNames),C=null===(i=t.getProjectReferences)||void 0===i?void 0:i.call(t),E={useCaseSensitiveFileNames:g,fileExists:P,readFile:w,readDirectory:I,trace:e.maybeBind(t,t.trace),getCurrentDirectory:function(){return p},onUnRecoverableConfigFileDiagnostic:e.noop};if(!e.isProgramUptoDate(c,b,D,(function(e,r){return t.getScriptVersion(r)}),P,S,T,A,C)){var k={getSourceFile:M,getSourceFileByPath:L,getCancellationToken:function(){return d},getCanonicalFileName:m,useCaseSensitiveFileNames:function(){return g},getNewLine:function(){return e.getNewLineCharacter(D,(function(){return e.getNewLineOrDefaultFromHost(t)}))},getDefaultLibFileName:function(e){return t.getDefaultLibFileName(e)},writeFile:e.noop,getCurrentDirectory:function(){return p},fileExists:P,readFile:w,getSymlinkCache:e.maybeBind(t,t.getSymlinkCache),realpath:e.maybeBind(t,t.realpath),directoryExists:function(r){return e.directoryProbablyExists(r,t)},getDirectories:function(e){return t.getDirectories?t.getDirectories(e):[]},readDirectory:I,onReleaseOldSourceFile:O,onReleaseParsedCommandLine:function(e,r,n){var i;t.getParsedCommandLine?null===(i=t.onReleaseParsedCommandLine)||void 0===i||i.call(t,e,r,n):r&&O(r.sourceFile,n);},hasInvalidatedResolution:S,hasChangedAutomaticTypeDirectiveNames:T,trace:E.trace,resolveModuleNames:e.maybeBind(t,t.resolveModuleNames),resolveTypeReferenceDirectives:e.maybeBind(t,t.resolveTypeReferenceDirectives),useSourceOfProjectReferenceRedirect:e.maybeBind(t,t.useSourceOfProjectReferenceRedirect),getParsedCommandLine:A};null===(a=t.setCompilerHost)||void 0===a||a.call(t,k);var N=r.getKeyForCompilationSettings(D),F={rootNames:b,options:D,host:k,oldProgram:c,projectReferences:C};return c=e.createProgram(F),h=void 0,v=void 0,y.clearCache(),void c.getTypeChecker()}function A(r){var n=e.toPath(r,p,m),i=null==v?void 0:v.get(n);if(void 0!==i)return i||void 0;var a=t.getParsedCommandLine?t.getParsedCommandLine(r):function(t){var r=M(t);return r?(r.path=e.toPath(t,p,m),r.resolvedPath=r.path,r.originalFileName=r.fileName,e.parseJsonSourceFileConfigFileContent(r,E,e.getNormalizedAbsolutePath(e.getDirectoryPath(t),p),void 0,e.getNormalizedAbsolutePath(t,p))):void 0}(r);return (v||(v=new e.Map)).set(n,a||!1),a}function P(r){var n=e.toPath(r,p,m),i=h&&h.getEntryByPath(n);return i?!e.isString(i):!!t.fileExists&&t.fileExists(r)}function w(r){var n=e.toPath(r,p,m),i=h&&h.getEntryByPath(n);return i?e.isString(i)?void 0:e.getSnapshotText(i.scriptSnapshot):t.readFile&&t.readFile(r)}function I(r,n,i,a,o){return e.Debug.checkDefined(t.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),t.readDirectory(r,n,i,a,o)}function O(e,t){var n=r.getKeyForCompilationSettings(t);r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind);}function M(t,r,n,i){return L(t,e.toPath(t,p,m),0,0,i)}function L(t,n,i,a,o){e.Debug.assert(void 0!==h,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");var s=h&&h.getOrCreateEntryByPath(t,n);if(s){if(!o){var l=c&&c.getSourceFileByPath(n);if(l){if(s.scriptKind===l.scriptKind)return r.updateDocumentWithKey(t,n,D,N,s.scriptSnapshot,s.version,s.scriptKind);r.releaseDocumentWithKey(l.resolvedPath,r.getKeyForCompilationSettings(c.getCompilerOptions()),l.scriptKind);}}return r.acquireDocumentWithKey(t,n,D,N,s.scriptSnapshot,s.version,s.scriptKind)}}}function S(){if(s!==e.LanguageServiceMode.Syntactic)return b(),c;e.Debug.assert(void 0===c);}function T(t,r,n){var i=e.normalizePath(t);e.Debug.assert(n.some((function(t){return e.normalizePath(t)===i}))),b();var a=e.mapDefined(n,(function(e){return c.getSourceFile(e)})),o=v(t);return e.DocumentHighlights.getDocumentHighlights(c,d,o,r,a)}function C(t,r,n,i){b();var a=n&&2===n.use?c.getSourceFiles().filter((function(e){return !c.isSourceFileDefaultLibrary(e)})):c.getSourceFiles();return e.FindAllReferences.findReferenceOrRenameEntries(c,d,a,t,r,n,i)}var N=new e.Map(e.getEntries(((o={})[18]=19,o[20]=21,o[22]=23,o[31]=29,o)));function I(r){var n;return e.Debug.assertEqual(r.type,"install package"),t.installPackage?t.installPackage({fileName:(n=r.file,e.toPath(n,p,m)),packageName:r.packageName}):Promise.reject("Host does not implement `installPackage`")}function O(e,t){return {lineStarts:e.getLineStarts(),firstLine:e.getLineAndCharacterOfPosition(t.pos).line,lastLine:e.getLineAndCharacterOfPosition(t.end).line}}function M(t,r,n){for(var i=u.getCurrentSourceFile(t),a=[],o=O(i,r),s=o.lineStarts,c=o.firstLine,l=o.lastLine,_=n||!1,d=Number.MAX_VALUE,p=new e.Map,f=new RegExp(/\S/),g=e.isInsideJsxElement(i,s[c]),m=g?"{/*":"//",y=c;y<=l;y++){var v=i.text.substring(s[y],i.getLineEndOfPosition(s[y])),h=f.exec(v);h&&(d=Math.min(d,h.index),p.set(y.toString(),h.index),v.substr(h.index,m.length)!==m&&(_=void 0===n||n));}for(y=c;y<=l;y++)if(c===l||s[y]!==r.end){var b=p.get(y.toString());void 0!==b&&(g?a.push.apply(a,L(t,{pos:s[y]+d,end:i.getLineEndOfPosition(s[y])},_,g)):_?a.push({newText:m,span:{length:0,start:s[y]+d}}):i.text.substr(s[y]+b,m.length)===m&&a.push({newText:"",span:{length:m.length,start:s[y]+b}}));}return a}function L(t,r,n,i){for(var a,o=u.getCurrentSourceFile(t),s=[],c=o.text,l=!1,_=n||!1,d=[],p=r.pos,f=void 0!==i?i:e.isInsideJsxElement(o,p),g=f?"{/*":"/*",m=f?"*/}":"*/",y=f?"\\{\\/\\*":"\\/\\*",v=f?"\\*\\/\\}":"\\*\\/";p<=r.end;){var h=c.substr(p,g.length)===g?g.length:0,b=e.isInComment(o,p+h);if(b)f&&(b.pos--,b.end++),d.push(b.pos),3===b.kind&&d.push(b.end),l=!0,p=b.end+1;else {var x=c.substring(p,r.end).search("(".concat(y,")|(").concat(v,")"));_=void 0!==n?n:_||!e.isTextWhiteSpaceLike(c,p,-1===x?r.end:p+x),p=-1===x?r.end+1:p+x+m.length;}}if(_||!l){2!==(null===(a=e.isInComment(o,r.pos))||void 0===a?void 0:a.kind)&&e.insertSorted(d,r.pos,e.compareValues),e.insertSorted(d,r.end,e.compareValues);var D=d[0];c.substr(D,g.length)!==g&&s.push({newText:g,span:{length:0,start:D}});for(var S=1;S<d.length-1;S++)c.substr(d[S]-m.length,m.length)!==m&&s.push({newText:m,span:{length:0,start:d[S]}}),c.substr(d[S],g.length)!==g&&s.push({newText:g,span:{length:0,start:d[S]}});s.length%2!=0&&s.push({newText:m,span:{length:0,start:d[d.length-1]}});}else for(var T=0,C=d;T<C.length;T++){var E=C[T],k=E-m.length>0?E-m.length:0;h=c.substr(k,m.length)===m?m.length:0,s.push({newText:"",span:{length:g.length,start:E-h}});}return s}function R(t){var r=t.openingElement,n=t.closingElement,i=t.parent;return !e.tagNamesAreEquivalent(r.tagName,n.tagName)||e.isJsxElement(i)&&e.tagNamesAreEquivalent(r.tagName,i.openingElement.tagName)&&R(i)}function B(t){var r=t.closingFragment,n=t.parent;return !!(65536&r.flags)||e.isJsxFragment(n)&&B(n)}function j(r,n,i,a,o,s){var c="number"==typeof n?[n,void 0]:[n.pos,n.end];return {file:r,startPosition:c[0],endPosition:c[1],program:S(),host:t,formatContext:e.formatting.getFormatContext(a,t),cancellationToken:d,preferences:i,triggerReason:o,kind:s}}N.forEach((function(e,t){return N.set(e.toString(),Number(t))}));var J={dispose:function(){if(c){var n=r.getKeyForCompilationSettings(c.getCompilerOptions());e.forEach(c.getSourceFiles(),(function(e){return r.releaseDocumentWithKey(e.resolvedPath,n,e.scriptKind)})),c=void 0;}t=void 0;},cleanupSemanticCache:function(){c=void 0;},getSyntacticDiagnostics:function(e){return b(),c.getSyntacticDiagnostics(v(e),d).slice()},getSemanticDiagnostics:function(t){b();var r=v(t),i=c.getSemanticDiagnostics(r,d);if(!e.getEmitDeclarations(c.getCompilerOptions()))return i.slice();var a=c.getDeclarationDiagnostics(r,d);return n$3(n$3([],i,!0),a,!0)},getSuggestionDiagnostics:function(t){return b(),e.computeSuggestionDiagnostics(v(t),c,d)},getCompilerOptionsDiagnostics:function(){return b(),n$3(n$3([],c.getOptionsDiagnostics(d),!0),c.getGlobalDiagnostics(d),!0)},getSyntacticClassifications:function(t,r){return e.getSyntacticClassifications(d,u.getCurrentSourceFile(t),r)},getSemanticClassifications:function(t,r,n){return b(),"2020"===(n||"original")?e.classifier.v2020.getSemanticClassifications(c,d,v(t),r):e.getSemanticClassifications(c.getTypeChecker(),d,v(t),c.getClassifiableNames(),r)},getEncodedSyntacticClassifications:function(t,r){return e.getEncodedSyntacticClassifications(d,u.getCurrentSourceFile(t),r)},getEncodedSemanticClassifications:function(t,r,n){return b(),"original"===(n||"original")?e.getEncodedSemanticClassifications(c.getTypeChecker(),d,v(t),c.getClassifiableNames(),r):e.classifier.v2020.getEncodedSemanticClassifications(c,d,v(t),r)},getCompletionsAtPosition:function(r,n,a){void 0===a&&(a=e.emptyOptions);var o=i$1(i$1({},e.identity(a)),{includeCompletionsForModuleExports:a.includeCompletionsForModuleExports||a.includeExternalModuleExports,includeCompletionsWithInsertText:a.includeCompletionsWithInsertText||a.includeInsertTextCompletions});return b(),e.Completions.getCompletionsAtPosition(t,c,f,v(r),n,o,a.triggerCharacter,a.triggerKind,d)},getCompletionEntryDetails:function(r,n,i,a,o,s,l){return void 0===s&&(s=e.emptyOptions),b(),e.Completions.getCompletionEntryDetails(c,f,v(r),n,{name:i,source:o,data:l},t,a&&e.formatting.getFormatContext(a,t),s,d)},getCompletionEntrySymbol:function(r,n,i,a,o){return void 0===o&&(o=e.emptyOptions),b(),e.Completions.getCompletionEntrySymbol(c,f,v(r),n,{name:i,source:a},t,o)},getSignatureHelpItems:function(t,r,n){var i=(void 0===n?e.emptyOptions:n).triggerReason;b();var a=v(t);return e.SignatureHelp.getSignatureHelpItems(c,a,r,i,d)},getQuickInfoAtPosition:function(t,r){b();var n=v(t),i=e.getTouchingPropertyName(n,r);if(i!==n){var a=c.getTypeChecker(),o=function(t){return e.isNewExpression(t.parent)&&t.pos===t.parent.pos?t.parent.expression:e.isNamedTupleMember(t.parent)&&t.pos===t.parent.pos?t.parent:t}(i),s=function(t,r){var n=P(t);if(n){var i=r.getContextualType(n.parent),a=i&&w(n,r,i,!1);if(a&&1===a.length)return e.first(a)}return r.getSymbolAtLocation(t)}(o,a);if(!s||a.isUnknownSymbol(s)){var l=function(t,r,n){switch(r.kind){case 79:return !e.isLabelName(r)&&!e.isTagName(r)&&!e.isConstTypeReference(r.parent);case 205:case 160:return !e.isInComment(t,n);case 108:case 191:case 106:case 196:return !0;default:return !1}}(n,o,r)?a.getTypeAtLocation(o):void 0;return l&&{kind:"",kindModifiers:"",textSpan:e.createTextSpanFromNode(o,n),displayParts:a.runWithCancellationToken(d,(function(t){return e.typeToDisplayParts(t,l,e.getContainerNode(o))})),documentation:l.symbol?l.symbol.getDocumentationComment(a):void 0,tags:l.symbol?l.symbol.getJsDocTags(a):void 0}}var u=a.runWithCancellationToken(d,(function(t){return e.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(t,s,n,e.getContainerNode(o),o)})),_=u.symbolKind,p=u.displayParts,f=u.documentation,g=u.tags;return {kind:_,kindModifiers:e.SymbolDisplay.getSymbolModifiers(a,s),textSpan:e.createTextSpanFromNode(o,n),displayParts:p,documentation:f,tags:g}}},getDefinitionAtPosition:function(t,r){return b(),e.GoToDefinition.getDefinitionAtPosition(c,v(t),r)},getDefinitionAndBoundSpan:function(t,r){return b(),e.GoToDefinition.getDefinitionAndBoundSpan(c,v(t),r)},getImplementationAtPosition:function(t,r){return b(),e.FindAllReferences.getImplementationsAtPosition(c,d,c.getSourceFiles(),v(t),r)},getTypeDefinitionAtPosition:function(t,r){return b(),e.GoToDefinition.getTypeDefinitionAtPosition(c.getTypeChecker(),v(t),r)},getReferencesAtPosition:function(t,r){return b(),C(e.getTouchingPropertyName(v(t),r),r,{use:1},(function(t,r,n){return e.FindAllReferences.toReferenceEntry(t,n.getSymbolAtLocation(r))}))},findReferences:function(t,r){return b(),e.FindAllReferences.findReferencedSymbols(c,d,c.getSourceFiles(),v(t),r)},getFileReferences:function(t){var r;b();var n=null===(r=c.getSourceFile(t))||void 0===r?void 0:r.symbol;return e.FindAllReferences.Core.getReferencesForFileName(t,c,c.getSourceFiles()).map((function(t){return e.FindAllReferences.toReferenceEntry(t,n)}))},getOccurrencesAtPosition:function(t,r){return e.flatMap(T(t,r,[t]),(function(e){return e.highlightSpans.map((function(t){return i$1(i$1({fileName:e.fileName,textSpan:t.textSpan,isWriteAccess:"writtenReference"===t.kind,isDefinition:!1},t.isInString&&{isInString:!0}),t.contextSpan&&{contextSpan:t.contextSpan})}))}))},getDocumentHighlights:T,getNameOrDottedNameSpan:function(t,r,n){var i=u.getCurrentSourceFile(t),a=e.getTouchingPropertyName(i,r);if(a!==i){switch(a.kind){case 205:case 160:case 10:case 95:case 110:case 104:case 106:case 108:case 191:case 79:break;default:return}for(var o=a;;)if(e.isRightSideOfPropertyAccess(o)||e.isRightSideOfQualifiedName(o))o=o.parent;else {if(!e.isNameOfModuleDeclaration(o))break;if(260!==o.parent.parent.kind||o.parent.parent.body!==o.parent)break;o=o.parent.parent.name;}return e.createTextSpanFromBounds(o.getStart(),a.getEnd())}},getBreakpointStatementAtPosition:function(t,r){var n=u.getCurrentSourceFile(t);return e.BreakpointResolver.spanInSourceFileAtLocation(n,r)},getNavigateToItems:function(t,r,n,i){void 0===i&&(i=!1),b();var a=n?[v(n)]:c.getSourceFiles();return e.NavigateTo.getNavigateToItems(a,c.getTypeChecker(),d,t,r,i)},getRenameInfo:function(t,r,n){return b(),e.Rename.getRenameInfo(c,v(t),r,n)},getSmartSelectionRange:function(t,r){return e.SmartSelectionRange.getSmartSelectionRange(r,u.getCurrentSourceFile(t))},findRenameLocations:function(t,r,n,a,o){b();var s=v(t),c=e.getAdjustedRenameLocation(e.getTouchingPropertyName(s,r));if(e.Rename.nodeIsEligibleForRename(c)){if(e.isIdentifier(c)&&(e.isJsxOpeningElement(c.parent)||e.isJsxClosingElement(c.parent))&&e.isIntrinsicJsxName(c.escapedText)){var l=c.parent.parent;return [l.openingElement,l.closingElement].map((function(t){var r=e.createTextSpanFromNode(t.tagName,s);return i$1({fileName:s.fileName,textSpan:r},e.FindAllReferences.toContextSpan(r,s,t.parent))}))}return C(c,r,{findInStrings:n,findInComments:a,providePrefixAndSuffixTextForRename:o,use:2},(function(t,r,n){return e.FindAllReferences.toRenameLocation(t,r,n,o||!1)}))}},getNavigationBarItems:function(t){return e.NavigationBar.getNavigationBarItems(u.getCurrentSourceFile(t),d)},getNavigationTree:function(t){return e.NavigationBar.getNavigationTree(u.getCurrentSourceFile(t),d)},getOutliningSpans:function(t){var r=u.getCurrentSourceFile(t);return e.OutliningElementsCollector.collectElements(r,d)},getTodoComments:function(t,r){b();var n=v(t);d.throwIfCancellationRequested();var i,a,o=n.text,s=[];if(r.length>0&&(a=n.fileName,!e.stringContains(a,"/node_modules/")))for(var c=function(){var t="("+/(?:^(?:\s|\*)*)/.source+"|"+/(?:\/\/+\s*)/.source+"|"+/(?:\/\*+\s*)/.source+")",n="(?:"+e.map(r,(function(e){return "("+e.text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+")"})).join("|")+")";return new RegExp(t+"("+n+/(?:.*?)/.source+")"+/(?:$|\*\/)/.source,"gim")}(),l=void 0;l=c.exec(o);){d.throwIfCancellationRequested(),e.Debug.assert(l.length===r.length+3);var u=l[1],_=l.index+u.length;if(e.isInComment(n,_)){for(var p=void 0,f=0;f<r.length;f++)l[f+3]&&(p=r[f]);if(void 0===p)return e.Debug.fail();if(!((i=o.charCodeAt(_+p.text.length))>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)){var g=l[2];s.push({descriptor:p,message:g,position:_});}}}return s},getBraceMatchingAtPosition:function(t,r){var n=u.getCurrentSourceFile(t),i=e.getTouchingToken(n,r),a=i.getStart(n)===r?N.get(i.kind.toString()):void 0,o=a&&e.findChildOfKind(i.parent,a,n);return o?[e.createTextSpanFromNode(i,n),e.createTextSpanFromNode(o,n)].sort((function(e,t){return e.start-t.start})):e.emptyArray},getIndentationAtPosition:function(t,r,n){var i=e.timestamp(),a=h(n),o=u.getCurrentSourceFile(t);f("getIndentationAtPosition: getCurrentSourceFile: "+(e.timestamp()-i)),i=e.timestamp();var s=e.formatting.SmartIndenter.getIndentation(r,o,a);return f("getIndentationAtPosition: computeIndentation : "+(e.timestamp()-i)),s},getFormattingEditsForRange:function(r,n,i,a){var o=u.getCurrentSourceFile(r);return e.formatting.formatSelection(n,i,o,e.formatting.getFormatContext(h(a),t))},getFormattingEditsForDocument:function(r,n){return e.formatting.formatDocument(u.getCurrentSourceFile(r),e.formatting.getFormatContext(h(n),t))},getFormattingEditsAfterKeystroke:function(r,n,i,a){var o=u.getCurrentSourceFile(r),s=e.formatting.getFormatContext(h(a),t);if(!e.isInComment(o,n))switch(i){case"{":return e.formatting.formatOnOpeningCurly(n,o,s);case"}":return e.formatting.formatOnClosingCurly(n,o,s);case";":return e.formatting.formatOnSemicolon(n,o,s);case"\n":return e.formatting.formatOnEnter(n,o,s)}return []},getDocCommentTemplateAtPosition:function(r,n,i){return e.JsDoc.getDocCommentTemplateAtPosition(e.getNewLineOrDefaultFromHost(t),u.getCurrentSourceFile(r),n,i)},isValidBraceCompletionAtPosition:function(t,r,n){if(60===n)return !1;var i=u.getCurrentSourceFile(t);if(e.isInString(i,r))return !1;if(e.isInsideJsxElementOrAttribute(i,r))return 123===n;if(e.isInTemplateString(i,r))return !1;switch(n){case 39:case 34:case 96:return !e.isInComment(i,r)}return !0},getJsxClosingTagAtPosition:function(t,r){var n=u.getCurrentSourceFile(t),i=e.findPrecedingToken(r,n);if(i){var a=31===i.kind&&e.isJsxOpeningElement(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxElement(i.parent)?i.parent:void 0;if(a&&R(a))return {newText:"</".concat(a.openingElement.tagName.getText(n),">")};var o=31===i.kind&&e.isJsxOpeningFragment(i.parent)?i.parent.parent:e.isJsxText(i)&&e.isJsxFragment(i.parent)?i.parent:void 0;return o&&B(o)?{newText:"</>"}:void 0}},getSpanOfEnclosingComment:function(t,r,n){var i=u.getCurrentSourceFile(t),a=e.formatting.getRangeOfEnclosingComment(i,r);return !a||n&&3!==a.kind?void 0:e.createTextSpanFromRange(a)},getCodeFixesAtPosition:function(r,n,i,a,o,s){void 0===s&&(s=e.emptyOptions),b();var l=v(r),u=e.createTextSpanFromBounds(n,i),_=e.formatting.getFormatContext(o,t);return e.flatMap(e.deduplicate(a,e.equateValues,e.compareValues),(function(r){return d.throwIfCancellationRequested(),e.codefix.getFixes({errorCode:r,sourceFile:l,span:u,program:c,host:t,cancellationToken:d,formatContext:_,preferences:s})}))},getCombinedCodeFix:function(r,n,i,a){void 0===a&&(a=e.emptyOptions),b(),e.Debug.assert("file"===r.type);var o=v(r.fileName),s=e.formatting.getFormatContext(i,t);return e.codefix.getAllFixes({fixId:n,sourceFile:o,program:c,host:t,cancellationToken:d,formatContext:s,preferences:a})},applyCodeActionCommand:function(t,r){var n="string"==typeof t?r:t;return e.isArray(n)?Promise.all(n.map((function(e){return I(e)}))):I(n)},organizeImports:function(r,n,i){void 0===i&&(i=e.emptyOptions),b(),e.Debug.assert("file"===r.type);var a=v(r.fileName),o=e.formatting.getFormatContext(n,t);return e.OrganizeImports.organizeImports(a,o,t,c,i,r.skipDestructiveCodeActions)},getEditsForFileRename:function(r,n,i,a){return void 0===a&&(a=e.emptyOptions),e.getEditsForFileRename(S(),r,n,t,e.formatting.getFormatContext(i,t),a,y)},getEmitOutput:function(r,n,i){b();var a=v(r),o=t.getCustomTransformers&&t.getCustomTransformers();return e.getFileEmitOutput(c,a,!!n,d,o,i)},getNonBoundSourceFile:function(e){return u.getCurrentSourceFile(e)},getProgram:S,getAutoImportProvider:function(){var e;return null===(e=t.getPackageJsonAutoImportProvider)||void 0===e?void 0:e.call(t)},getApplicableRefactors:function(t,r,n,i,a){void 0===n&&(n=e.emptyOptions),b();var o=v(t);return e.refactor.getApplicableRefactors(j(o,r,n,e.emptyOptions,i,a))},getEditsForRefactor:function(t,r,n,i,a,o){void 0===o&&(o=e.emptyOptions),b();var s=v(t);return e.refactor.getEditsForRefactor(j(s,n,o,r),i,a)},toLineColumnOffset:function(e,t){return 0===t?{line:0,character:0}:y.toLineColumnOffset(e,t)},getSourceMapper:function(){return y},clearSourceMapperCache:function(){return y.clearCache()},prepareCallHierarchy:function(t,r){b();var n=e.CallHierarchy.resolveCallHierarchyDeclaration(c,e.getTouchingPropertyName(v(t),r));return n&&e.mapOneOrMany(n,(function(t){return e.CallHierarchy.createCallHierarchyItem(c,t)}))},provideCallHierarchyIncomingCalls:function(t,r){b();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(c,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getIncomingCalls(c,i,d):[]},provideCallHierarchyOutgoingCalls:function(t,r){b();var n=v(t),i=e.firstOrOnly(e.CallHierarchy.resolveCallHierarchyDeclaration(c,0===r?n:e.getTouchingPropertyName(n,r)));return i?e.CallHierarchy.getOutgoingCalls(c,i):[]},toggleLineComment:M,toggleMultilineComment:L,commentSelection:function(e,t){var r=O(u.getCurrentSourceFile(e),t);return r.firstLine===r.lastLine&&t.pos!==t.end?L(e,t,!0):M(e,t,!0)},uncommentSelection:function(t,r){var n=u.getCurrentSourceFile(t),i=[],a=r.pos,o=r.end;a===o&&(o+=e.isInsideJsxElement(n,a)?2:1);for(var s=a;s<=o;s++){var c=e.isInComment(n,s);if(c){switch(c.kind){case 2:i.push.apply(i,M(t,{end:c.end,pos:c.pos+1},!1));break;case 3:i.push.apply(i,L(t,{end:c.end,pos:c.pos+1},!1));}s=c.end+1;}}return i},provideInlayHints:function(r,n,i){void 0===i&&(i=e.emptyOptions),b();var a=v(r);return e.InlayHints.provideInlayHints(function(e,r,n){return {file:e,program:S(),host:t,span:r,preferences:n,cancellationToken:d}}(a,n,i))}};switch(s){case e.LanguageServiceMode.Semantic:break;case e.LanguageServiceMode.PartialSemantic:F.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.PartialSemantic"))}}));break;case e.LanguageServiceMode.Syntactic:A.forEach((function(e){return J[e]=function(){throw new Error("LanguageService Operation: ".concat(e," not allowed in LanguageServiceMode.Syntactic"))}}));break;default:e.Debug.assertNever(s);}return J},e.getNameTable=function(t){return t.nameTable||function(t){var r=t.nameTable=new e.Map;t.forEachChild((function t(n){if(e.isIdentifier(n)&&!e.isTagName(n)&&n.escapedText||e.isStringOrNumericLiteralLike(n)&&function(t){return e.isDeclarationName(t)||276===t.parent.kind||function(e){return e&&e.parent&&206===e.parent.kind&&e.parent.argumentExpression===e}(t)||e.isLiteralComputedPropertyDeclarationName(t)}(n)){var i=e.getEscapedTextOfIdentifierOrLiteral(n);r.set(i,void 0===r.get(i)?n.pos:-1);}else e.isPrivateIdentifier(n)&&(i=n.escapedText,r.set(i,void 0===r.get(i)?n.pos:-1));if(e.forEachChild(n,t),e.hasJSDocNodes(n))for(var a=0,o=n.jsDoc;a<o.length;a++){var s=o[a];e.forEachChild(s,t);}}));}(t),t.nameTable},e.getContainingObjectLiteralElement=P,e.getPropertySymbolsFromContextualType=w,e.setObjectAllocator({getNodeConstructor:function(){return r},getTokenConstructor:function(){return l},getIdentifierConstructor:function(){return u},getPrivateIdentifierConstructor:function(){return _},getSourceFileConstructor:function(){return y},getSymbolConstructor:function(){return s},getTypeConstructor:function(){return d},getSignatureConstructor:function(){return p},getSourceMapSourceConstructor:function(){return v}});}(t),function(e){(e.BreakpointResolver||(e.BreakpointResolver={})).spanInSourceFileAtLocation=function(t,r){if(!t.isDeclarationFile){var n=e.getTokenAtPosition(t,r),i=t.getLineAndCharacterOfPosition(r).line;if(t.getLineAndCharacterOfPosition(n.getStart(t)).line>i){var a=e.findPrecedingToken(n.pos,t);if(!a||t.getLineAndCharacterOfPosition(a.getEnd()).line!==i)return;n=a;}if(!(8388608&n.flags))return _(n)}function o(r,n){var i=r.decorators?e.skipTrivia(t.text,r.decorators.end):r.getStart(t);return e.createTextSpanFromBounds(i,(n||r).getEnd())}function s(r,n){return o(r,e.findNextToken(n,n.parent,t))}function c(e,r){return e&&i===t.getLineAndCharacterOfPosition(e.getStart(t)).line?_(e):_(r)}function l(r){return _(e.findPrecedingToken(r.pos,t))}function u(r){return _(e.findNextToken(r,r.parent,t))}function _(r){if(r){var n=r.parent;switch(r.kind){case 236:return x(r.declarationList.declarations[0]);case 253:case 166:case 165:return x(r);case 163:return function t(r){if(e.isBindingPattern(r.name))return C(r.name);if(function(t){return !!t.initializer||void 0!==t.dotDotDotToken||e.hasSyntacticModifier(t,12)}(r))return o(r);var n=r.parent,i=n.parameters.indexOf(r);return e.Debug.assert(-1!==i),0!==i?t(n.parameters[i-1]):_(n.body)}(r);case 255:case 168:case 167:case 171:case 172:case 170:case 212:case 213:return function(e){if(e.body)return D(e)?o(e):_(e.body)}(r);case 234:if(e.isFunctionBlock(r))return v=(y=r).statements.length?y.statements[0]:y.getLastToken(),D(y.parent)?c(y.parent,v):_(v);case 261:return S(r);case 291:return S(r.block);case 237:return o(r.expression);case 246:return o(r.getChildAt(0),r.expression);case 240:return s(r,r.expression);case 239:return _(r.statement);case 252:return o(r.getChildAt(0));case 238:return s(r,r.expression);case 249:return _(r.statement);case 245:case 244:return o(r.getChildAt(0),r.label);case 241:return (m=r).initializer?T(m):m.condition?o(m.condition):m.incrementor?o(m.incrementor):void 0;case 242:return s(r,r.expression);case 243:return T(r);case 248:return s(r,r.expression);case 288:case 289:return _(r.statements[0]);case 251:return S(r.tryBlock);case 250:case 270:return o(r,r.expression);case 264:return o(r,r.moduleReference);case 265:case 271:return o(r,r.moduleSpecifier);case 260:if(1!==e.getModuleInstanceState(r))return;case 256:case 259:case 297:case 202:return o(r);case 247:return _(r.statement);case 164:return h=n.decorators,e.createTextSpanFromBounds(e.skipTrivia(t.text,h.pos),h.end);case 200:case 201:return C(r);case 257:case 258:return;case 26:case 1:return c(e.findPrecedingToken(r.pos,t));case 27:return l(r);case 18:return function(r){switch(r.parent.kind){case 259:var n=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),n.members.length?n.members[0]:n.getLastToken(t));case 256:var i=r.parent;return c(e.findPrecedingToken(r.pos,t,r.parent),i.members.length?i.members[0]:i.getLastToken(t));case 262:return c(r.parent.parent,r.parent.clauses[0])}return _(r.parent)}(r);case 19:return function(t){switch(t.parent.kind){case 261:if(1!==e.getModuleInstanceState(t.parent.parent))return;case 259:case 256:return o(t);case 234:if(e.isFunctionBlock(t.parent))return o(t);case 291:return _(e.lastOrUndefined(t.parent.statements));case 262:var r=t.parent,n=e.lastOrUndefined(r.clauses);return n?_(e.lastOrUndefined(n.statements)):void 0;case 200:var i=t.parent;return _(e.lastOrUndefined(i.elements)||i);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var a=t.parent;return o(e.lastOrUndefined(a.properties)||a)}return _(t.parent)}}(r);case 23:return function(t){switch(t.parent.kind){case 201:var r=t.parent;return o(e.lastOrUndefined(r.elements)||r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(t.parent)){var n=t.parent;return o(e.lastOrUndefined(n.elements)||n)}return _(t.parent)}}(r);case 20:return function(e){return 239===e.parent.kind||207===e.parent.kind||208===e.parent.kind?l(e):211===e.parent.kind?u(e):_(e.parent)}(r);case 21:return function(e){switch(e.parent.kind){case 212:case 255:case 213:case 168:case 167:case 171:case 172:case 170:case 240:case 239:case 241:case 243:case 207:case 208:case 211:return l(e);default:return _(e.parent)}}(r);case 58:return function(t){return e.isFunctionLike(t.parent)||294===t.parent.kind||163===t.parent.kind?l(t):_(t.parent)}(r);case 31:case 29:return function(e){return 210===e.parent.kind?u(e):_(e.parent)}(r);case 115:return function(e){return 239===e.parent.kind?s(e,e.parent.expression):_(e.parent)}(r);case 91:case 83:case 96:return u(r);case 159:return function(e){return 243===e.parent.kind?u(e):_(e.parent)}(r);default:if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(r))return E(r);if((79===r.kind||224===r.kind||294===r.kind||295===r.kind)&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(n))return o(r);if(220===r.kind){var i=r,a=i.left,d=i.operatorToken;if(e.isArrayLiteralOrObjectLiteralDestructuringPattern(a))return E(a);if(63===d.kind&&e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent))return o(r);if(27===d.kind)return _(a)}if(e.isExpressionNode(r))switch(n.kind){case 239:return l(r);case 164:return _(r.parent);case 241:case 243:return o(r);case 220:if(27===r.parent.operatorToken.kind)return o(r);break;case 213:if(r.parent.body===r)return o(r)}switch(r.parent.kind){case 294:if(r.parent.name===r&&!e.isArrayLiteralOrObjectLiteralDestructuringPattern(r.parent.parent))return _(r.parent.initializer);break;case 210:if(r.parent.type===r)return u(r.parent.type);break;case 253:case 163:var p=r.parent,f=p.initializer,g=p.type;if(f===r||g===r||e.isAssignmentOperator(r.kind))return l(r);break;case 220:if(a=r.parent.left,e.isArrayLiteralOrObjectLiteralDestructuringPattern(a)&&r!==a)return l(r);break;default:if(e.isFunctionLike(r.parent)&&r.parent.type===r)return l(r)}return _(r.parent)}}var m,y,v,h;function b(r){return e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]===r?o(e.findPrecedingToken(r.pos,t,r.parent),r):o(r)}function x(r){if(242===r.parent.parent.kind)return _(r.parent.parent);var n=r.parent;return e.isBindingPattern(r.name)?C(r.name):r.initializer||e.hasSyntacticModifier(r,1)||243===n.parent.kind?b(r):e.isVariableDeclarationList(r.parent)&&r.parent.declarations[0]!==r?_(e.findPrecedingToken(r.pos,t,r.parent)):void 0}function D(t){return e.hasSyntacticModifier(t,1)||256===t.parent.kind&&170!==t.kind}function S(r){switch(r.parent.kind){case 260:if(1!==e.getModuleInstanceState(r.parent))return;case 240:case 238:case 242:return c(r.parent,r.statements[0]);case 241:case 243:return c(e.findPrecedingToken(r.pos,t,r.parent),r.statements[0])}return _(r.statements[0])}function T(e){if(254!==e.initializer.kind)return _(e.initializer);var t=e.initializer;return t.declarations.length>0?_(t.declarations[0]):void 0}function C(t){var r=e.forEach(t.elements,(function(e){return 226!==e.kind?e:void 0}));return r?_(r):202===t.parent.kind?o(t.parent):b(t.parent)}function E(t){e.Debug.assert(201!==t.kind&&200!==t.kind);var r=203===t.kind?t.elements:t.properties,n=e.forEach(r,(function(e){return 226!==e.kind?e:void 0}));return n?_(n):o(220===t.parent.kind?t.parent:t)}}};}(t),function(e){e.transform=function(t,r,n){var i=[];n=e.fixupCompilerOptions(n,i);var a=e.isArray(t)?t:[t],o=e.transformNodes(void 0,void 0,e.factory,n,a,r,!0);return o.diagnostics=e.concatenate(o.diagnostics,i),o};}(t);var l=function(){return this}();!function(e){function t(e,t){e&&e.log("*INTERNAL ERROR* - Exception in typescript services: "+t.message);}var r=function(){function t(e){this.scriptSnapshotShim=e;}return t.prototype.getText=function(e,t){return this.scriptSnapshotShim.getText(e,t)},t.prototype.getLength=function(){return this.scriptSnapshotShim.getLength()},t.prototype.getChangeRange=function(t){var r=t,n=this.scriptSnapshotShim.getChangeRange(r.scriptSnapshotShim);if(null===n)return null;var i=JSON.parse(n);return e.createTextChangeRange(e.createTextSpan(i.span.start,i.span.length),i.newLength)},t.prototype.dispose=function(){"dispose"in this.scriptSnapshotShim&&this.scriptSnapshotShim.dispose();},t}(),a=function(){function t(t){var r=this;this.shimHost=t,this.loggingEnabled=!1,this.tracingEnabled=!1,"getModuleResolutionsForFile"in this.shimHost&&(this.resolveModuleNames=function(t,n){var i=JSON.parse(r.shimHost.getModuleResolutionsForFile(n));return e.map(t,(function(t){var r=e.getProperty(i,t);return r?{resolvedFileName:r,extension:e.extensionFromPath(r),isExternalLibraryImport:!1}:void 0}))}),"directoryExists"in this.shimHost&&(this.directoryExists=function(e){return r.shimHost.directoryExists(e)}),"getTypeReferenceDirectiveResolutionsForFile"in this.shimHost&&(this.resolveTypeReferenceDirectives=function(t,n){var i=JSON.parse(r.shimHost.getTypeReferenceDirectiveResolutionsForFile(n));return e.map(t,(function(t){return e.getProperty(i,t)}))});}return t.prototype.log=function(e){this.loggingEnabled&&this.shimHost.log(e);},t.prototype.trace=function(e){this.tracingEnabled&&this.shimHost.trace(e);},t.prototype.error=function(e){this.shimHost.error(e);},t.prototype.getProjectVersion=function(){if(this.shimHost.getProjectVersion)return this.shimHost.getProjectVersion()},t.prototype.getTypeRootsVersion=function(){return this.shimHost.getTypeRootsVersion?this.shimHost.getTypeRootsVersion():0},t.prototype.useCaseSensitiveFileNames=function(){return !!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames()},t.prototype.getCompilationSettings=function(){var e=this.shimHost.getCompilationSettings();if(null===e||""===e)throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");var t=JSON.parse(e);return t.allowNonTsExtensions=!0,t},t.prototype.getScriptFileNames=function(){var e=this.shimHost.getScriptFileNames();return JSON.parse(e)},t.prototype.getScriptSnapshot=function(e){var t=this.shimHost.getScriptSnapshot(e);return t&&new r(t)},t.prototype.getScriptKind=function(e){return "getScriptKind"in this.shimHost?this.shimHost.getScriptKind(e):0},t.prototype.getScriptVersion=function(e){return this.shimHost.getScriptVersion(e)},t.prototype.getLocalizedDiagnosticMessages=function(){var e=this.shimHost.getLocalizedDiagnosticMessages();if(null===e||""===e)return null;try{return JSON.parse(e)}catch(e){return this.log(e.description||"diagnosticMessages.generated.json has invalid JSON format"),null}},t.prototype.getCancellationToken=function(){var t=this.shimHost.getCancellationToken();return new e.ThrottledCancellationToken(t)},t.prototype.getCurrentDirectory=function(){return this.shimHost.getCurrentDirectory()},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t.prototype.getDefaultLibFileName=function(e){return this.shimHost.getDefaultLibFileName(JSON.stringify(e))},t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.readFile=function(e,t){return this.shimHost.readFile(e,t)},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t}();e.LanguageServiceShimHostAdapter=a;var o=function(){function t(e){var t=this;this.shimHost=e,this.useCaseSensitiveFileNames=!!this.shimHost.useCaseSensitiveFileNames&&this.shimHost.useCaseSensitiveFileNames(),"directoryExists"in this.shimHost?this.directoryExists=function(e){return t.shimHost.directoryExists(e)}:this.directoryExists=void 0,"realpath"in this.shimHost?this.realpath=function(e){return t.shimHost.realpath(e)}:this.realpath=void 0;}return t.prototype.readDirectory=function(t,r,n,i,a){var o=e.getFileMatcherPatterns(t,n,i,this.shimHost.useCaseSensitiveFileNames(),this.shimHost.getCurrentDirectory());return JSON.parse(this.shimHost.readDirectory(t,JSON.stringify(r),JSON.stringify(o.basePaths),o.excludePattern,o.includeFilePattern,o.includeDirectoryPattern,a))},t.prototype.fileExists=function(e){return this.shimHost.fileExists(e)},t.prototype.readFile=function(e){return this.shimHost.readFile(e)},t.prototype.getDirectories=function(e){return JSON.parse(this.shimHost.getDirectories(e))},t}();function u(e,t,r,n){return _(e,t,!0,r,n)}function _(r,n,i,a,o){try{var s=function(t,r,n,i){var a;i&&(t.log(r),a=e.timestamp());var o=n();if(i){var s=e.timestamp();if(t.log("".concat(r," completed in ").concat(s-a," msec")),e.isString(o)){var c=o;c.length>128&&(c=c.substring(0,128)+"..."),t.log(" result.length=".concat(c.length,", result='").concat(JSON.stringify(c),"'"));}}return o}(r,n,a,o);return i?JSON.stringify({result:s}):s}catch(i){return i instanceof e.OperationCanceledException?JSON.stringify({canceled:!0}):(t(r,i),i.description=n,JSON.stringify({error:i}))}}e.CoreServicesShimHostAdapter=o;var d=function(){function e(e){this.factory=e,e.registerShim(this);}return e.prototype.dispose=function(e){this.factory.unregisterShim(this);},e}();function p(t,r){return t.map((function(t){return function(t,r){return {message:e.flattenDiagnosticMessageText(t.messageText,r),start:t.start,length:t.length,category:e.diagnosticCategoryName(t),code:t.code,reportsUnnecessary:t.reportsUnnecessary,reportsDeprecated:t.reportsDeprecated}}(t,r)}))}e.realizeDiagnostics=p;var f=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.host=r,i.languageService=n,i.logPerformance=!1,i.logger=i.host,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.dispose=function(e){this.logger.log("dispose()"),this.languageService.dispose(),this.languageService=null,l&&l.CollectGarbage&&(l.CollectGarbage(),this.logger.log("CollectGarbage()")),this.logger=null,t.prototype.dispose.call(this,e);},r.prototype.refresh=function(e){this.forwardJSONCall("refresh(".concat(e,")"),(function(){return null}));},r.prototype.cleanupSemanticCache=function(){var e=this;this.forwardJSONCall("cleanupSemanticCache()",(function(){return e.languageService.cleanupSemanticCache(),null}));},r.prototype.realizeDiagnostics=function(t){return p(t,e.getNewLineOrDefaultFromHost(this.host))},r.prototype.getSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSyntacticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return i.languageService.getSemanticClassifications(t,e.createTextSpan(r,n))}))},r.prototype.getEncodedSyntacticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSyntacticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getEncodedSemanticClassifications=function(t,r,n){var i=this;return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(t,"', ").concat(r,", ").concat(n,")"),(function(){return g(i.languageService.getEncodedSemanticClassifications(t,e.createTextSpan(r,n)))}))},r.prototype.getSyntacticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSyntacticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSyntacticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSemanticDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSemanticDiagnostics('".concat(e,"')"),(function(){var r=t.languageService.getSemanticDiagnostics(e);return t.realizeDiagnostics(r)}))},r.prototype.getSuggestionDiagnostics=function(e){var t=this;return this.forwardJSONCall("getSuggestionDiagnostics('".concat(e,"')"),(function(){return t.realizeDiagnostics(t.languageService.getSuggestionDiagnostics(e))}))},r.prototype.getCompilerOptionsDiagnostics=function(){var e=this;return this.forwardJSONCall("getCompilerOptionsDiagnostics()",(function(){var t=e.languageService.getCompilerOptionsDiagnostics();return e.realizeDiagnostics(t)}))},r.prototype.getQuickInfoAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getQuickInfoAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getQuickInfoAtPosition(e,t)}))},r.prototype.getNameOrDottedNameSpan=function(e,t,r){var n=this;return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNameOrDottedNameSpan(e,t,r)}))},r.prototype.getBreakpointStatementAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBreakpointStatementAtPosition(e,t)}))},r.prototype.getSignatureHelpItems=function(e,t,r){var n=this;return this.forwardJSONCall("getSignatureHelpItems('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSignatureHelpItems(e,t,r)}))},r.prototype.getDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAtPosition(e,t)}))},r.prototype.getDefinitionAndBoundSpan=function(e,t){var r=this;return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getDefinitionAndBoundSpan(e,t)}))},r.prototype.getTypeDefinitionAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getTypeDefinitionAtPosition(e,t)}))},r.prototype.getImplementationAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getImplementationAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getImplementationAtPosition(e,t)}))},r.prototype.getRenameInfo=function(e,t,r){var n=this;return this.forwardJSONCall("getRenameInfo('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getRenameInfo(e,t,r)}))},r.prototype.getSmartSelectionRange=function(e,t){var r=this;return this.forwardJSONCall("getSmartSelectionRange('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getSmartSelectionRange(e,t)}))},r.prototype.findRenameLocations=function(e,t,r,n,i){var a=this;return this.forwardJSONCall("findRenameLocations('".concat(e,"', ").concat(t,", ").concat(r,", ").concat(n,", ").concat(i,")"),(function(){return a.languageService.findRenameLocations(e,t,r,n,i)}))},r.prototype.getBraceMatchingAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getBraceMatchingAtPosition(e,t)}))},r.prototype.isValidBraceCompletionAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.isValidBraceCompletionAtPosition(e,t,r)}))},r.prototype.getSpanOfEnclosingComment=function(e,t,r){var n=this;return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getSpanOfEnclosingComment(e,t,r)}))},r.prototype.getIndentationAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getIndentationAtPosition('".concat(e,"', ").concat(t,")"),(function(){var i=JSON.parse(r);return n.languageService.getIndentationAtPosition(e,t,i)}))},r.prototype.getReferencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getReferencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getReferencesAtPosition(e,t)}))},r.prototype.findReferences=function(e,t){var r=this;return this.forwardJSONCall("findReferences('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.findReferences(e,t)}))},r.prototype.getFileReferences=function(e){var t=this;return this.forwardJSONCall("getFileReferences('".concat(e,")"),(function(){return t.languageService.getFileReferences(e)}))},r.prototype.getOccurrencesAtPosition=function(e,t){var r=this;return this.forwardJSONCall("getOccurrencesAtPosition('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.getOccurrencesAtPosition(e,t)}))},r.prototype.getDocumentHighlights=function(t,r,n){var i=this;return this.forwardJSONCall("getDocumentHighlights('".concat(t,"', ").concat(r,")"),(function(){var a=i.languageService.getDocumentHighlights(t,r,JSON.parse(n)),o=e.toFileNameLowerCase(e.normalizeSlashes(t));return e.filter(a,(function(t){return e.toFileNameLowerCase(e.normalizeSlashes(t.fileName))===o}))}))},r.prototype.getCompletionsAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getCompletionsAtPosition('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getCompletionsAtPosition(e,t,r)}))},r.prototype.getCompletionEntryDetails=function(e,t,r,n,i,a,o){var s=this;return this.forwardJSONCall("getCompletionEntryDetails('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var c=void 0===n?void 0:JSON.parse(n);return s.languageService.getCompletionEntryDetails(e,t,r,c,i,a,o)}))},r.prototype.getFormattingEditsForRange=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsForRange('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsForRange(e,t,r,a)}))},r.prototype.getFormattingEditsForDocument=function(e,t){var r=this;return this.forwardJSONCall("getFormattingEditsForDocument('".concat(e,"')"),(function(){var n=JSON.parse(t);return r.languageService.getFormattingEditsForDocument(e,n)}))},r.prototype.getFormattingEditsAfterKeystroke=function(e,t,r,n){var i=this;return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(e,"', ").concat(t,", '").concat(r,"')"),(function(){var a=JSON.parse(n);return i.languageService.getFormattingEditsAfterKeystroke(e,t,r,a)}))},r.prototype.getDocCommentTemplateAtPosition=function(e,t,r){var n=this;return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(e,"', ").concat(t,")"),(function(){return n.languageService.getDocCommentTemplateAtPosition(e,t,r)}))},r.prototype.getNavigateToItems=function(e,t,r){var n=this;return this.forwardJSONCall("getNavigateToItems('".concat(e,"', ").concat(t,", ").concat(r,")"),(function(){return n.languageService.getNavigateToItems(e,t,r)}))},r.prototype.getNavigationBarItems=function(e){var t=this;return this.forwardJSONCall("getNavigationBarItems('".concat(e,"')"),(function(){return t.languageService.getNavigationBarItems(e)}))},r.prototype.getNavigationTree=function(e){var t=this;return this.forwardJSONCall("getNavigationTree('".concat(e,"')"),(function(){return t.languageService.getNavigationTree(e)}))},r.prototype.getOutliningSpans=function(e){var t=this;return this.forwardJSONCall("getOutliningSpans('".concat(e,"')"),(function(){return t.languageService.getOutliningSpans(e)}))},r.prototype.getTodoComments=function(e,t){var r=this;return this.forwardJSONCall("getTodoComments('".concat(e,"')"),(function(){return r.languageService.getTodoComments(e,JSON.parse(t))}))},r.prototype.prepareCallHierarchy=function(e,t){var r=this;return this.forwardJSONCall("prepareCallHierarchy('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.prepareCallHierarchy(e,t)}))},r.prototype.provideCallHierarchyIncomingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyIncomingCalls(e,t)}))},r.prototype.provideCallHierarchyOutgoingCalls=function(e,t){var r=this;return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(e,"', ").concat(t,")"),(function(){return r.languageService.provideCallHierarchyOutgoingCalls(e,t)}))},r.prototype.provideInlayHints=function(e,t,r){var n=this;return this.forwardJSONCall("provideInlayHints('".concat(e,"', '").concat(JSON.stringify(t),"', ").concat(JSON.stringify(r),")"),(function(){return n.languageService.provideInlayHints(e,t,r)}))},r.prototype.getEmitOutput=function(e){var t=this;return this.forwardJSONCall("getEmitOutput('".concat(e,"')"),(function(){var r=t.languageService.getEmitOutput(e),n=r.diagnostics,a=s(r,["diagnostics"]);return i$1(i$1({},a),{diagnostics:t.realizeDiagnostics(n)})}))},r.prototype.getEmitOutputObject=function(e){var t=this;return _(this.logger,"getEmitOutput('".concat(e,"')"),!1,(function(){return t.languageService.getEmitOutput(e)}),this.logPerformance)},r.prototype.toggleLineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleLineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleLineComment(e,t)}))},r.prototype.toggleMultilineComment=function(e,t){var r=this;return this.forwardJSONCall("toggleMultilineComment('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.toggleMultilineComment(e,t)}))},r.prototype.commentSelection=function(e,t){var r=this;return this.forwardJSONCall("commentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.commentSelection(e,t)}))},r.prototype.uncommentSelection=function(e,t){var r=this;return this.forwardJSONCall("uncommentSelection('".concat(e,"', '").concat(JSON.stringify(t),"')"),(function(){return r.languageService.uncommentSelection(e,t)}))},r}(d);function g(e){return {spans:e.spans.join(","),endOfLineState:e.endOfLineState}}var m=function(t){function r(r,n){var i=t.call(this,r)||this;return i.logger=n,i.logPerformance=!1,i.classifier=e.createClassifier(),i}return c(r,t),r.prototype.getEncodedLexicalClassifications=function(e,t,r){var n=this;return void 0===r&&(r=!1),u(this.logger,"getEncodedLexicalClassifications",(function(){return g(n.classifier.getEncodedLexicalClassifications(e,t,r))}),this.logPerformance)},r.prototype.getClassificationsForLine=function(e,t,r){void 0===r&&(r=!1);for(var n=this.classifier.getClassificationsForLine(e,t,r),i="",a=0,o=n.entries;a<o.length;a++){var s=o[a];i+=s.length+"\n",i+=s.classification+"\n";}return i+n.finalLexState},r}(d),y=function(t){function r(e,r,n){var i=t.call(this,e)||this;return i.logger=r,i.host=n,i.logPerformance=!1,i}return c(r,t),r.prototype.forwardJSONCall=function(e,t){return u(this.logger,e,t,this.logPerformance)},r.prototype.resolveModuleName=function(t,r,n){var i=this;return this.forwardJSONCall("resolveModuleName('".concat(t,"')"),(function(){var a=JSON.parse(n),o=e.resolveModuleName(r,e.normalizeSlashes(t),a,i.host),s=o.resolvedModule?o.resolvedModule.resolvedFileName:void 0;return o.resolvedModule&&".ts"!==o.resolvedModule.extension&&".tsx"!==o.resolvedModule.extension&&".d.ts"!==o.resolvedModule.extension&&(s=void 0),{resolvedFileName:s,failedLookupLocations:o.failedLookupLocations}}))},r.prototype.resolveTypeReferenceDirective=function(t,r,n){var i=this;return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(t,")"),(function(){var a=JSON.parse(n),o=e.resolveTypeReferenceDirective(r,e.normalizeSlashes(t),a,i.host);return {resolvedFileName:o.resolvedTypeReferenceDirective?o.resolvedTypeReferenceDirective.resolvedFileName:void 0,primary:!o.resolvedTypeReferenceDirective||o.resolvedTypeReferenceDirective.primary,failedLookupLocations:o.failedLookupLocations}}))},r.prototype.getPreProcessedFileInfo=function(t,r){var n=this;return this.forwardJSONCall("getPreProcessedFileInfo('".concat(t,"')"),(function(){var t=e.preProcessFile(e.getSnapshotText(r),!0,!0);return {referencedFiles:n.convertFileReferences(t.referencedFiles),importedFiles:n.convertFileReferences(t.importedFiles),ambientExternalModules:t.ambientExternalModules,isLibFile:t.isLibFile,typeReferenceDirectives:n.convertFileReferences(t.typeReferenceDirectives),libReferenceDirectives:n.convertFileReferences(t.libReferenceDirectives)}}))},r.prototype.getAutomaticTypeDirectiveNames=function(t){var r=this;return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(t,"')"),(function(){var n=JSON.parse(t);return e.getAutomaticTypeDirectiveNames(n,r.host)}))},r.prototype.convertFileReferences=function(t){if(t){for(var r=[],n=0,i=t;n<i.length;n++){var a=i[n];r.push({path:e.normalizeSlashes(a.fileName),position:a.pos,length:a.end-a.pos});}return r}},r.prototype.getTSConfigFileInfo=function(t,r){var i=this;return this.forwardJSONCall("getTSConfigFileInfo('".concat(t,"')"),(function(){var a=e.parseJsonText(t,e.getSnapshotText(r)),o=e.normalizeSlashes(t),s=e.parseJsonSourceFileConfigFileContent(a,i.host,e.getDirectoryPath(o),{},o);return {options:s.options,typeAcquisition:s.typeAcquisition,files:s.fileNames,raw:s.raw,errors:p(n$3(n$3([],a.parseDiagnostics,!0),s.errors,!0),"\r\n")}}))},r.prototype.getDefaultCompilationSettings=function(){return this.forwardJSONCall("getDefaultCompilationSettings()",(function(){return e.getDefaultCompilerOptions()}))},r.prototype.discoverTypings=function(t){var r=this,n=e.createGetCanonicalFileName(!1);return this.forwardJSONCall("discoverTypings()",(function(){var i=JSON.parse(t);return void 0===r.safeList&&(r.safeList=e.JsTyping.loadSafeList(r.host,e.toPath(i.safeListPath,i.safeListPath,n))),e.JsTyping.discoverTypings(r.host,(function(e){return r.logger.log(e)}),i.fileNames,e.toPath(i.projectRootPath,i.projectRootPath,n),r.safeList,i.packageNameToTypingLocation,i.typeAcquisition,i.unresolvedImports,i.typesRegistry)}))},r}(d),v=function(){function r(){this._shims=[];}return r.prototype.getServicesVersion=function(){return e.servicesVersion},r.prototype.createLanguageServiceShim=function(r){try{void 0===this.documentRegistry&&(this.documentRegistry=e.createDocumentRegistry(r.useCaseSensitiveFileNames&&r.useCaseSensitiveFileNames(),r.getCurrentDirectory()));var n=new a(r),i=e.createLanguageService(n,this.documentRegistry,!1);return new f(this,r,i)}catch(e){throw t(r,e),e}},r.prototype.createClassifierShim=function(e){try{return new m(this,e)}catch(r){throw t(e,r),r}},r.prototype.createCoreServicesShim=function(e){try{var r=new o(e);return new y(this,e,r)}catch(r){throw t(e,r),r}},r.prototype.close=function(){e.clear(this._shims),this.documentRegistry=void 0;},r.prototype.registerShim=function(e){this._shims.push(e);},r.prototype.unregisterShim=function(e){for(var t=0;t<this._shims.length;t++)if(this._shims[t]===e)return void delete this._shims[t];throw new Error("Invalid operation")},r}();e.TypeScriptServicesFactory=v;}(t),function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,"undefined"==typeof globalThis&&(window.globalThis=window),delete Object.prototype.__magic__;}catch(e){window.globalThis=window;}}(),("undefined"==typeof process||process.browser)&&(globalThis.TypeScript=globalThis.TypeScript||{},globalThis.TypeScript.Services=globalThis.TypeScript.Services||{},globalThis.TypeScript.Services.TypeScriptServicesFactory=t.TypeScriptServicesFactory,globalThis.toolsVersion=t.versionMajorMinor),"undefined"!=typeof module&&module.exports&&(module.exports=t),function(e){var t={since:"4.0",warnAfter:"4.1",message:"Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead."};e.createNodeArray=e.Debug.deprecate(e.factory.createNodeArray,t),e.createNumericLiteral=e.Debug.deprecate(e.factory.createNumericLiteral,t),e.createBigIntLiteral=e.Debug.deprecate(e.factory.createBigIntLiteral,t),e.createStringLiteral=e.Debug.deprecate(e.factory.createStringLiteral,t),e.createStringLiteralFromNode=e.Debug.deprecate(e.factory.createStringLiteralFromNode,t),e.createRegularExpressionLiteral=e.Debug.deprecate(e.factory.createRegularExpressionLiteral,t),e.createLoopVariable=e.Debug.deprecate(e.factory.createLoopVariable,t),e.createUniqueName=e.Debug.deprecate(e.factory.createUniqueName,t),e.createPrivateIdentifier=e.Debug.deprecate(e.factory.createPrivateIdentifier,t),e.createSuper=e.Debug.deprecate(e.factory.createSuper,t),e.createThis=e.Debug.deprecate(e.factory.createThis,t),e.createNull=e.Debug.deprecate(e.factory.createNull,t),e.createTrue=e.Debug.deprecate(e.factory.createTrue,t),e.createFalse=e.Debug.deprecate(e.factory.createFalse,t),e.createModifier=e.Debug.deprecate(e.factory.createModifier,t),e.createModifiersFromModifierFlags=e.Debug.deprecate(e.factory.createModifiersFromModifierFlags,t),e.createQualifiedName=e.Debug.deprecate(e.factory.createQualifiedName,t),e.updateQualifiedName=e.Debug.deprecate(e.factory.updateQualifiedName,t),e.createComputedPropertyName=e.Debug.deprecate(e.factory.createComputedPropertyName,t),e.updateComputedPropertyName=e.Debug.deprecate(e.factory.updateComputedPropertyName,t),e.createTypeParameterDeclaration=e.Debug.deprecate(e.factory.createTypeParameterDeclaration,t),e.updateTypeParameterDeclaration=e.Debug.deprecate(e.factory.updateTypeParameterDeclaration,t),e.createParameter=e.Debug.deprecate(e.factory.createParameterDeclaration,t),e.updateParameter=e.Debug.deprecate(e.factory.updateParameterDeclaration,t),e.createDecorator=e.Debug.deprecate(e.factory.createDecorator,t),e.updateDecorator=e.Debug.deprecate(e.factory.updateDecorator,t),e.createProperty=e.Debug.deprecate(e.factory.createPropertyDeclaration,t),e.updateProperty=e.Debug.deprecate(e.factory.updatePropertyDeclaration,t),e.createMethod=e.Debug.deprecate(e.factory.createMethodDeclaration,t),e.updateMethod=e.Debug.deprecate(e.factory.updateMethodDeclaration,t),e.createConstructor=e.Debug.deprecate(e.factory.createConstructorDeclaration,t),e.updateConstructor=e.Debug.deprecate(e.factory.updateConstructorDeclaration,t),e.createGetAccessor=e.Debug.deprecate(e.factory.createGetAccessorDeclaration,t),e.updateGetAccessor=e.Debug.deprecate(e.factory.updateGetAccessorDeclaration,t),e.createSetAccessor=e.Debug.deprecate(e.factory.createSetAccessorDeclaration,t),e.updateSetAccessor=e.Debug.deprecate(e.factory.updateSetAccessorDeclaration,t),e.createCallSignature=e.Debug.deprecate(e.factory.createCallSignature,t),e.updateCallSignature=e.Debug.deprecate(e.factory.updateCallSignature,t),e.createConstructSignature=e.Debug.deprecate(e.factory.createConstructSignature,t),e.updateConstructSignature=e.Debug.deprecate(e.factory.updateConstructSignature,t),e.updateIndexSignature=e.Debug.deprecate(e.factory.updateIndexSignature,t),e.createKeywordTypeNode=e.Debug.deprecate(e.factory.createKeywordTypeNode,t),e.createTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.createTypePredicateNode,t),e.updateTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.updateTypePredicateNode,t),e.createTypeReferenceNode=e.Debug.deprecate(e.factory.createTypeReferenceNode,t),e.updateTypeReferenceNode=e.Debug.deprecate(e.factory.updateTypeReferenceNode,t),e.createFunctionTypeNode=e.Debug.deprecate(e.factory.createFunctionTypeNode,t),e.updateFunctionTypeNode=e.Debug.deprecate(e.factory.updateFunctionTypeNode,t),e.createConstructorTypeNode=e.Debug.deprecate((function(t,r,n){return e.factory.createConstructorTypeNode(void 0,t,r,n)}),t),e.updateConstructorTypeNode=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateConstructorTypeNode(t,t.modifiers,r,n,i)}),t),e.createTypeQueryNode=e.Debug.deprecate(e.factory.createTypeQueryNode,t),e.updateTypeQueryNode=e.Debug.deprecate(e.factory.updateTypeQueryNode,t),e.createTypeLiteralNode=e.Debug.deprecate(e.factory.createTypeLiteralNode,t),e.updateTypeLiteralNode=e.Debug.deprecate(e.factory.updateTypeLiteralNode,t),e.createArrayTypeNode=e.Debug.deprecate(e.factory.createArrayTypeNode,t),e.updateArrayTypeNode=e.Debug.deprecate(e.factory.updateArrayTypeNode,t),e.createTupleTypeNode=e.Debug.deprecate(e.factory.createTupleTypeNode,t),e.updateTupleTypeNode=e.Debug.deprecate(e.factory.updateTupleTypeNode,t),e.createOptionalTypeNode=e.Debug.deprecate(e.factory.createOptionalTypeNode,t),e.updateOptionalTypeNode=e.Debug.deprecate(e.factory.updateOptionalTypeNode,t),e.createRestTypeNode=e.Debug.deprecate(e.factory.createRestTypeNode,t),e.updateRestTypeNode=e.Debug.deprecate(e.factory.updateRestTypeNode,t),e.createUnionTypeNode=e.Debug.deprecate(e.factory.createUnionTypeNode,t),e.updateUnionTypeNode=e.Debug.deprecate(e.factory.updateUnionTypeNode,t),e.createIntersectionTypeNode=e.Debug.deprecate(e.factory.createIntersectionTypeNode,t),e.updateIntersectionTypeNode=e.Debug.deprecate(e.factory.updateIntersectionTypeNode,t),e.createConditionalTypeNode=e.Debug.deprecate(e.factory.createConditionalTypeNode,t),e.updateConditionalTypeNode=e.Debug.deprecate(e.factory.updateConditionalTypeNode,t),e.createInferTypeNode=e.Debug.deprecate(e.factory.createInferTypeNode,t),e.updateInferTypeNode=e.Debug.deprecate(e.factory.updateInferTypeNode,t),e.createImportTypeNode=e.Debug.deprecate(e.factory.createImportTypeNode,t),e.updateImportTypeNode=e.Debug.deprecate(e.factory.updateImportTypeNode,t),e.createParenthesizedType=e.Debug.deprecate(e.factory.createParenthesizedType,t),e.updateParenthesizedType=e.Debug.deprecate(e.factory.updateParenthesizedType,t),e.createThisTypeNode=e.Debug.deprecate(e.factory.createThisTypeNode,t),e.updateTypeOperatorNode=e.Debug.deprecate(e.factory.updateTypeOperatorNode,t),e.createIndexedAccessTypeNode=e.Debug.deprecate(e.factory.createIndexedAccessTypeNode,t),e.updateIndexedAccessTypeNode=e.Debug.deprecate(e.factory.updateIndexedAccessTypeNode,t),e.createMappedTypeNode=e.Debug.deprecate(e.factory.createMappedTypeNode,t),e.updateMappedTypeNode=e.Debug.deprecate(e.factory.updateMappedTypeNode,t),e.createLiteralTypeNode=e.Debug.deprecate(e.factory.createLiteralTypeNode,t),e.updateLiteralTypeNode=e.Debug.deprecate(e.factory.updateLiteralTypeNode,t),e.createObjectBindingPattern=e.Debug.deprecate(e.factory.createObjectBindingPattern,t),e.updateObjectBindingPattern=e.Debug.deprecate(e.factory.updateObjectBindingPattern,t),e.createArrayBindingPattern=e.Debug.deprecate(e.factory.createArrayBindingPattern,t),e.updateArrayBindingPattern=e.Debug.deprecate(e.factory.updateArrayBindingPattern,t),e.createBindingElement=e.Debug.deprecate(e.factory.createBindingElement,t),e.updateBindingElement=e.Debug.deprecate(e.factory.updateBindingElement,t),e.createArrayLiteral=e.Debug.deprecate(e.factory.createArrayLiteralExpression,t),e.updateArrayLiteral=e.Debug.deprecate(e.factory.updateArrayLiteralExpression,t),e.createObjectLiteral=e.Debug.deprecate(e.factory.createObjectLiteralExpression,t),e.updateObjectLiteral=e.Debug.deprecate(e.factory.updateObjectLiteralExpression,t),e.createPropertyAccess=e.Debug.deprecate(e.factory.createPropertyAccessExpression,t),e.updatePropertyAccess=e.Debug.deprecate(e.factory.updatePropertyAccessExpression,t),e.createPropertyAccessChain=e.Debug.deprecate(e.factory.createPropertyAccessChain,t),e.updatePropertyAccessChain=e.Debug.deprecate(e.factory.updatePropertyAccessChain,t),e.createElementAccess=e.Debug.deprecate(e.factory.createElementAccessExpression,t),e.updateElementAccess=e.Debug.deprecate(e.factory.updateElementAccessExpression,t),e.createElementAccessChain=e.Debug.deprecate(e.factory.createElementAccessChain,t),e.updateElementAccessChain=e.Debug.deprecate(e.factory.updateElementAccessChain,t),e.createCall=e.Debug.deprecate(e.factory.createCallExpression,t),e.updateCall=e.Debug.deprecate(e.factory.updateCallExpression,t),e.createCallChain=e.Debug.deprecate(e.factory.createCallChain,t),e.updateCallChain=e.Debug.deprecate(e.factory.updateCallChain,t),e.createNew=e.Debug.deprecate(e.factory.createNewExpression,t),e.updateNew=e.Debug.deprecate(e.factory.updateNewExpression,t),e.createTypeAssertion=e.Debug.deprecate(e.factory.createTypeAssertion,t),e.updateTypeAssertion=e.Debug.deprecate(e.factory.updateTypeAssertion,t),e.createParen=e.Debug.deprecate(e.factory.createParenthesizedExpression,t),e.updateParen=e.Debug.deprecate(e.factory.updateParenthesizedExpression,t),e.createFunctionExpression=e.Debug.deprecate(e.factory.createFunctionExpression,t),e.updateFunctionExpression=e.Debug.deprecate(e.factory.updateFunctionExpression,t),e.createDelete=e.Debug.deprecate(e.factory.createDeleteExpression,t),e.updateDelete=e.Debug.deprecate(e.factory.updateDeleteExpression,t),e.createTypeOf=e.Debug.deprecate(e.factory.createTypeOfExpression,t),e.updateTypeOf=e.Debug.deprecate(e.factory.updateTypeOfExpression,t),e.createVoid=e.Debug.deprecate(e.factory.createVoidExpression,t),e.updateVoid=e.Debug.deprecate(e.factory.updateVoidExpression,t),e.createAwait=e.Debug.deprecate(e.factory.createAwaitExpression,t),e.updateAwait=e.Debug.deprecate(e.factory.updateAwaitExpression,t),e.createPrefix=e.Debug.deprecate(e.factory.createPrefixUnaryExpression,t),e.updatePrefix=e.Debug.deprecate(e.factory.updatePrefixUnaryExpression,t),e.createPostfix=e.Debug.deprecate(e.factory.createPostfixUnaryExpression,t),e.updatePostfix=e.Debug.deprecate(e.factory.updatePostfixUnaryExpression,t),e.createBinary=e.Debug.deprecate(e.factory.createBinaryExpression,t),e.updateConditional=e.Debug.deprecate(e.factory.updateConditionalExpression,t),e.createTemplateExpression=e.Debug.deprecate(e.factory.createTemplateExpression,t),e.updateTemplateExpression=e.Debug.deprecate(e.factory.updateTemplateExpression,t),e.createTemplateHead=e.Debug.deprecate(e.factory.createTemplateHead,t),e.createTemplateMiddle=e.Debug.deprecate(e.factory.createTemplateMiddle,t),e.createTemplateTail=e.Debug.deprecate(e.factory.createTemplateTail,t),e.createNoSubstitutionTemplateLiteral=e.Debug.deprecate(e.factory.createNoSubstitutionTemplateLiteral,t),e.updateYield=e.Debug.deprecate(e.factory.updateYieldExpression,t),e.createSpread=e.Debug.deprecate(e.factory.createSpreadElement,t),e.updateSpread=e.Debug.deprecate(e.factory.updateSpreadElement,t),e.createOmittedExpression=e.Debug.deprecate(e.factory.createOmittedExpression,t),e.createAsExpression=e.Debug.deprecate(e.factory.createAsExpression,t),e.updateAsExpression=e.Debug.deprecate(e.factory.updateAsExpression,t),e.createNonNullExpression=e.Debug.deprecate(e.factory.createNonNullExpression,t),e.updateNonNullExpression=e.Debug.deprecate(e.factory.updateNonNullExpression,t),e.createNonNullChain=e.Debug.deprecate(e.factory.createNonNullChain,t),e.updateNonNullChain=e.Debug.deprecate(e.factory.updateNonNullChain,t),e.createMetaProperty=e.Debug.deprecate(e.factory.createMetaProperty,t),e.updateMetaProperty=e.Debug.deprecate(e.factory.updateMetaProperty,t),e.createTemplateSpan=e.Debug.deprecate(e.factory.createTemplateSpan,t),e.updateTemplateSpan=e.Debug.deprecate(e.factory.updateTemplateSpan,t),e.createSemicolonClassElement=e.Debug.deprecate(e.factory.createSemicolonClassElement,t),e.createBlock=e.Debug.deprecate(e.factory.createBlock,t),e.updateBlock=e.Debug.deprecate(e.factory.updateBlock,t),e.createVariableStatement=e.Debug.deprecate(e.factory.createVariableStatement,t),e.updateVariableStatement=e.Debug.deprecate(e.factory.updateVariableStatement,t),e.createEmptyStatement=e.Debug.deprecate(e.factory.createEmptyStatement,t),e.createExpressionStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateExpressionStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createStatement=e.Debug.deprecate(e.factory.createExpressionStatement,t),e.updateStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,t),e.createIf=e.Debug.deprecate(e.factory.createIfStatement,t),e.updateIf=e.Debug.deprecate(e.factory.updateIfStatement,t),e.createDo=e.Debug.deprecate(e.factory.createDoStatement,t),e.updateDo=e.Debug.deprecate(e.factory.updateDoStatement,t),e.createWhile=e.Debug.deprecate(e.factory.createWhileStatement,t),e.updateWhile=e.Debug.deprecate(e.factory.updateWhileStatement,t),e.createFor=e.Debug.deprecate(e.factory.createForStatement,t),e.updateFor=e.Debug.deprecate(e.factory.updateForStatement,t),e.createForIn=e.Debug.deprecate(e.factory.createForInStatement,t),e.updateForIn=e.Debug.deprecate(e.factory.updateForInStatement,t),e.createForOf=e.Debug.deprecate(e.factory.createForOfStatement,t),e.updateForOf=e.Debug.deprecate(e.factory.updateForOfStatement,t),e.createContinue=e.Debug.deprecate(e.factory.createContinueStatement,t),e.updateContinue=e.Debug.deprecate(e.factory.updateContinueStatement,t),e.createBreak=e.Debug.deprecate(e.factory.createBreakStatement,t),e.updateBreak=e.Debug.deprecate(e.factory.updateBreakStatement,t),e.createReturn=e.Debug.deprecate(e.factory.createReturnStatement,t),e.updateReturn=e.Debug.deprecate(e.factory.updateReturnStatement,t),e.createWith=e.Debug.deprecate(e.factory.createWithStatement,t),e.updateWith=e.Debug.deprecate(e.factory.updateWithStatement,t),e.createSwitch=e.Debug.deprecate(e.factory.createSwitchStatement,t),e.updateSwitch=e.Debug.deprecate(e.factory.updateSwitchStatement,t),e.createLabel=e.Debug.deprecate(e.factory.createLabeledStatement,t),e.updateLabel=e.Debug.deprecate(e.factory.updateLabeledStatement,t),e.createThrow=e.Debug.deprecate(e.factory.createThrowStatement,t),e.updateThrow=e.Debug.deprecate(e.factory.updateThrowStatement,t),e.createTry=e.Debug.deprecate(e.factory.createTryStatement,t),e.updateTry=e.Debug.deprecate(e.factory.updateTryStatement,t),e.createDebuggerStatement=e.Debug.deprecate(e.factory.createDebuggerStatement,t),e.createVariableDeclarationList=e.Debug.deprecate(e.factory.createVariableDeclarationList,t),e.updateVariableDeclarationList=e.Debug.deprecate(e.factory.updateVariableDeclarationList,t),e.createFunctionDeclaration=e.Debug.deprecate(e.factory.createFunctionDeclaration,t),e.updateFunctionDeclaration=e.Debug.deprecate(e.factory.updateFunctionDeclaration,t),e.createClassDeclaration=e.Debug.deprecate(e.factory.createClassDeclaration,t),e.updateClassDeclaration=e.Debug.deprecate(e.factory.updateClassDeclaration,t),e.createInterfaceDeclaration=e.Debug.deprecate(e.factory.createInterfaceDeclaration,t),e.updateInterfaceDeclaration=e.Debug.deprecate(e.factory.updateInterfaceDeclaration,t),e.createTypeAliasDeclaration=e.Debug.deprecate(e.factory.createTypeAliasDeclaration,t),e.updateTypeAliasDeclaration=e.Debug.deprecate(e.factory.updateTypeAliasDeclaration,t),e.createEnumDeclaration=e.Debug.deprecate(e.factory.createEnumDeclaration,t),e.updateEnumDeclaration=e.Debug.deprecate(e.factory.updateEnumDeclaration,t),e.createModuleDeclaration=e.Debug.deprecate(e.factory.createModuleDeclaration,t),e.updateModuleDeclaration=e.Debug.deprecate(e.factory.updateModuleDeclaration,t),e.createModuleBlock=e.Debug.deprecate(e.factory.createModuleBlock,t),e.updateModuleBlock=e.Debug.deprecate(e.factory.updateModuleBlock,t),e.createCaseBlock=e.Debug.deprecate(e.factory.createCaseBlock,t),e.updateCaseBlock=e.Debug.deprecate(e.factory.updateCaseBlock,t),e.createNamespaceExportDeclaration=e.Debug.deprecate(e.factory.createNamespaceExportDeclaration,t),e.updateNamespaceExportDeclaration=e.Debug.deprecate(e.factory.updateNamespaceExportDeclaration,t),e.createImportEqualsDeclaration=e.Debug.deprecate(e.factory.createImportEqualsDeclaration,t),e.updateImportEqualsDeclaration=e.Debug.deprecate(e.factory.updateImportEqualsDeclaration,t),e.createImportDeclaration=e.Debug.deprecate(e.factory.createImportDeclaration,t),e.updateImportDeclaration=e.Debug.deprecate(e.factory.updateImportDeclaration,t),e.createNamespaceImport=e.Debug.deprecate(e.factory.createNamespaceImport,t),e.updateNamespaceImport=e.Debug.deprecate(e.factory.updateNamespaceImport,t),e.createNamedImports=e.Debug.deprecate(e.factory.createNamedImports,t),e.updateNamedImports=e.Debug.deprecate(e.factory.updateNamedImports,t),e.createImportSpecifier=e.Debug.deprecate(e.factory.createImportSpecifier,t),e.updateImportSpecifier=e.Debug.deprecate(e.factory.updateImportSpecifier,t),e.createExportAssignment=e.Debug.deprecate(e.factory.createExportAssignment,t),e.updateExportAssignment=e.Debug.deprecate(e.factory.updateExportAssignment,t),e.createNamedExports=e.Debug.deprecate(e.factory.createNamedExports,t),e.updateNamedExports=e.Debug.deprecate(e.factory.updateNamedExports,t),e.createExportSpecifier=e.Debug.deprecate(e.factory.createExportSpecifier,t),e.updateExportSpecifier=e.Debug.deprecate(e.factory.updateExportSpecifier,t),e.createExternalModuleReference=e.Debug.deprecate(e.factory.createExternalModuleReference,t),e.updateExternalModuleReference=e.Debug.deprecate(e.factory.updateExternalModuleReference,t),e.createJSDocTypeExpression=e.Debug.deprecate(e.factory.createJSDocTypeExpression,t),e.createJSDocTypeTag=e.Debug.deprecate(e.factory.createJSDocTypeTag,t),e.createJSDocReturnTag=e.Debug.deprecate(e.factory.createJSDocReturnTag,t),e.createJSDocThisTag=e.Debug.deprecate(e.factory.createJSDocThisTag,t),e.createJSDocComment=e.Debug.deprecate(e.factory.createJSDocComment,t),e.createJSDocParameterTag=e.Debug.deprecate(e.factory.createJSDocParameterTag,t),e.createJSDocClassTag=e.Debug.deprecate(e.factory.createJSDocClassTag,t),e.createJSDocAugmentsTag=e.Debug.deprecate(e.factory.createJSDocAugmentsTag,t),e.createJSDocEnumTag=e.Debug.deprecate(e.factory.createJSDocEnumTag,t),e.createJSDocTemplateTag=e.Debug.deprecate(e.factory.createJSDocTemplateTag,t),e.createJSDocTypedefTag=e.Debug.deprecate(e.factory.createJSDocTypedefTag,t),e.createJSDocCallbackTag=e.Debug.deprecate(e.factory.createJSDocCallbackTag,t),e.createJSDocSignature=e.Debug.deprecate(e.factory.createJSDocSignature,t),e.createJSDocPropertyTag=e.Debug.deprecate(e.factory.createJSDocPropertyTag,t),e.createJSDocTypeLiteral=e.Debug.deprecate(e.factory.createJSDocTypeLiteral,t),e.createJSDocImplementsTag=e.Debug.deprecate(e.factory.createJSDocImplementsTag,t),e.createJSDocAuthorTag=e.Debug.deprecate(e.factory.createJSDocAuthorTag,t),e.createJSDocPublicTag=e.Debug.deprecate(e.factory.createJSDocPublicTag,t),e.createJSDocPrivateTag=e.Debug.deprecate(e.factory.createJSDocPrivateTag,t),e.createJSDocProtectedTag=e.Debug.deprecate(e.factory.createJSDocProtectedTag,t),e.createJSDocReadonlyTag=e.Debug.deprecate(e.factory.createJSDocReadonlyTag,t),e.createJSDocTag=e.Debug.deprecate(e.factory.createJSDocUnknownTag,t),e.createJsxElement=e.Debug.deprecate(e.factory.createJsxElement,t),e.updateJsxElement=e.Debug.deprecate(e.factory.updateJsxElement,t),e.createJsxSelfClosingElement=e.Debug.deprecate(e.factory.createJsxSelfClosingElement,t),e.updateJsxSelfClosingElement=e.Debug.deprecate(e.factory.updateJsxSelfClosingElement,t),e.createJsxOpeningElement=e.Debug.deprecate(e.factory.createJsxOpeningElement,t),e.updateJsxOpeningElement=e.Debug.deprecate(e.factory.updateJsxOpeningElement,t),e.createJsxClosingElement=e.Debug.deprecate(e.factory.createJsxClosingElement,t),e.updateJsxClosingElement=e.Debug.deprecate(e.factory.updateJsxClosingElement,t),e.createJsxFragment=e.Debug.deprecate(e.factory.createJsxFragment,t),e.createJsxText=e.Debug.deprecate(e.factory.createJsxText,t),e.updateJsxText=e.Debug.deprecate(e.factory.updateJsxText,t),e.createJsxOpeningFragment=e.Debug.deprecate(e.factory.createJsxOpeningFragment,t),e.createJsxJsxClosingFragment=e.Debug.deprecate(e.factory.createJsxJsxClosingFragment,t),e.updateJsxFragment=e.Debug.deprecate(e.factory.updateJsxFragment,t),e.createJsxAttribute=e.Debug.deprecate(e.factory.createJsxAttribute,t),e.updateJsxAttribute=e.Debug.deprecate(e.factory.updateJsxAttribute,t),e.createJsxAttributes=e.Debug.deprecate(e.factory.createJsxAttributes,t),e.updateJsxAttributes=e.Debug.deprecate(e.factory.updateJsxAttributes,t),e.createJsxSpreadAttribute=e.Debug.deprecate(e.factory.createJsxSpreadAttribute,t),e.updateJsxSpreadAttribute=e.Debug.deprecate(e.factory.updateJsxSpreadAttribute,t),e.createJsxExpression=e.Debug.deprecate(e.factory.createJsxExpression,t),e.updateJsxExpression=e.Debug.deprecate(e.factory.updateJsxExpression,t),e.createCaseClause=e.Debug.deprecate(e.factory.createCaseClause,t),e.updateCaseClause=e.Debug.deprecate(e.factory.updateCaseClause,t),e.createDefaultClause=e.Debug.deprecate(e.factory.createDefaultClause,t),e.updateDefaultClause=e.Debug.deprecate(e.factory.updateDefaultClause,t),e.createHeritageClause=e.Debug.deprecate(e.factory.createHeritageClause,t),e.updateHeritageClause=e.Debug.deprecate(e.factory.updateHeritageClause,t),e.createCatchClause=e.Debug.deprecate(e.factory.createCatchClause,t),e.updateCatchClause=e.Debug.deprecate(e.factory.updateCatchClause,t),e.createPropertyAssignment=e.Debug.deprecate(e.factory.createPropertyAssignment,t),e.updatePropertyAssignment=e.Debug.deprecate(e.factory.updatePropertyAssignment,t),e.createShorthandPropertyAssignment=e.Debug.deprecate(e.factory.createShorthandPropertyAssignment,t),e.updateShorthandPropertyAssignment=e.Debug.deprecate(e.factory.updateShorthandPropertyAssignment,t),e.createSpreadAssignment=e.Debug.deprecate(e.factory.createSpreadAssignment,t),e.updateSpreadAssignment=e.Debug.deprecate(e.factory.updateSpreadAssignment,t),e.createEnumMember=e.Debug.deprecate(e.factory.createEnumMember,t),e.updateEnumMember=e.Debug.deprecate(e.factory.updateEnumMember,t),e.updateSourceFileNode=e.Debug.deprecate(e.factory.updateSourceFile,t),e.createNotEmittedStatement=e.Debug.deprecate(e.factory.createNotEmittedStatement,t),e.createPartiallyEmittedExpression=e.Debug.deprecate(e.factory.createPartiallyEmittedExpression,t),e.updatePartiallyEmittedExpression=e.Debug.deprecate(e.factory.updatePartiallyEmittedExpression,t),e.createCommaList=e.Debug.deprecate(e.factory.createCommaListExpression,t),e.updateCommaList=e.Debug.deprecate(e.factory.updateCommaListExpression,t),e.createBundle=e.Debug.deprecate(e.factory.createBundle,t),e.updateBundle=e.Debug.deprecate(e.factory.updateBundle,t),e.createImmediatelyInvokedFunctionExpression=e.Debug.deprecate(e.factory.createImmediatelyInvokedFunctionExpression,t),e.createImmediatelyInvokedArrowFunction=e.Debug.deprecate(e.factory.createImmediatelyInvokedArrowFunction,t),e.createVoidZero=e.Debug.deprecate(e.factory.createVoidZero,t),e.createExportDefault=e.Debug.deprecate(e.factory.createExportDefault,t),e.createExternalModuleExport=e.Debug.deprecate(e.factory.createExternalModuleExport,t),e.createNamespaceExport=e.Debug.deprecate(e.factory.createNamespaceExport,t),e.updateNamespaceExport=e.Debug.deprecate(e.factory.updateNamespaceExport,t),e.createToken=e.Debug.deprecate((function(t){return e.factory.createToken(t)}),t),e.createIdentifier=e.Debug.deprecate((function(t){return e.factory.createIdentifier(t,void 0,void 0)}),t),e.createTempVariable=e.Debug.deprecate((function(t){return e.factory.createTempVariable(t,void 0)}),t),e.getGeneratedNameForNode=e.Debug.deprecate((function(t){return e.factory.getGeneratedNameForNode(t,void 0)}),t),e.createOptimisticUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,16)}),t),e.createFileLevelUniqueName=e.Debug.deprecate((function(t){return e.factory.createUniqueName(t,48)}),t),e.createIndexSignature=e.Debug.deprecate((function(t,r,n,i){return e.factory.createIndexSignature(t,r,n,i)}),t),e.createTypePredicateNode=e.Debug.deprecate((function(t,r){return e.factory.createTypePredicateNode(void 0,t,r)}),t),e.updateTypePredicateNode=e.Debug.deprecate((function(t,r,n){return e.factory.updateTypePredicateNode(t,void 0,r,n)}),t),e.createLiteral=e.Debug.deprecate((function(t){return "number"==typeof t?e.factory.createNumericLiteral(t):"object"==typeof t&&"base10Value"in t?e.factory.createBigIntLiteral(t):"boolean"==typeof t?t?e.factory.createTrue():e.factory.createFalse():"string"==typeof t?e.factory.createStringLiteral(t,void 0):e.factory.createStringLiteralFromNode(t)}),{since:"4.0",warnAfter:"4.1",message:"Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead."}),e.createMethodSignature=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createMethodSignature(void 0,i,a,t,r,n)}),t),e.updateMethodSignature=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateMethodSignature(t,t.modifiers,a,o,r,n,i)}),t),e.createTypeOperatorNode=e.Debug.deprecate((function(t,r){var n;return r?n=t:(r=t,n=140),e.factory.createTypeOperatorNode(n,r)}),t),e.createTaggedTemplate=e.Debug.deprecate((function(t,r,n){var i;return n?i=r:n=r,e.factory.createTaggedTemplateExpression(t,i,n)}),t),e.updateTaggedTemplate=e.Debug.deprecate((function(t,r,n,i){var a;return i?a=n:i=n,e.factory.updateTaggedTemplateExpression(t,r,a,i)}),t),e.updateBinary=e.Debug.deprecate((function(t,r,n,i){return void 0===i&&(i=t.operatorToken),"number"==typeof i&&(i=i===t.operatorToken.kind?t.operatorToken:e.factory.createToken(i)),e.factory.updateBinaryExpression(t,r,i,n)}),t),e.createConditional=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.createConditionalExpression(t,r,n,i,a):3===arguments.length?e.factory.createConditionalExpression(t,e.factory.createToken(57),r,e.factory.createToken(58),n):e.Debug.fail("Argument count mismatch")}),t),e.createYield=e.Debug.deprecate((function(t,r){var n;return r?n=t:r=t,e.factory.createYieldExpression(n,r)}),t),e.createClassExpression=e.Debug.deprecate((function(t,r,n,i,a){return e.factory.createClassExpression(void 0,t,r,n,i,a)}),t),e.updateClassExpression=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateClassExpression(t,void 0,r,n,i,a,o)}),t),e.createPropertySignature=e.Debug.deprecate((function(t,r,n,i,a){var o=e.factory.createPropertySignature(t,r,n,i);return o.initializer=a,o}),t),e.updatePropertySignature=e.Debug.deprecate((function(t,r,n,i,a,o){var s=e.factory.updatePropertySignature(t,r,n,i,a);return t.initializer!==o&&(s===t&&(s=e.factory.cloneNode(t)),s.initializer=o),s}),t),e.createExpressionWithTypeArguments=e.Debug.deprecate((function(t,r){return e.factory.createExpressionWithTypeArguments(r,t)}),t),e.updateExpressionWithTypeArguments=e.Debug.deprecate((function(t,r,n){return e.factory.updateExpressionWithTypeArguments(t,n,r)}),t),e.createArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o){return 6===arguments.length?e.factory.createArrowFunction(t,r,n,i,a,o):5===arguments.length?e.factory.createArrowFunction(t,r,n,i,void 0,a):e.Debug.fail("Argument count mismatch")}),t),e.updateArrowFunction=e.Debug.deprecate((function(t,r,n,i,a,o,s){return 7===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,o,s):6===arguments.length?e.factory.updateArrowFunction(t,r,n,i,a,t.equalsGreaterThanToken,o):e.Debug.fail("Argument count mismatch")}),t),e.createVariableDeclaration=e.Debug.deprecate((function(t,r,n,i){return 4===arguments.length?e.factory.createVariableDeclaration(t,r,n,i):arguments.length>=1&&arguments.length<=3?e.factory.createVariableDeclaration(t,void 0,r,n):e.Debug.fail("Argument count mismatch")}),t),e.updateVariableDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return 5===arguments.length?e.factory.updateVariableDeclaration(t,r,n,i,a):4===arguments.length?e.factory.updateVariableDeclaration(t,r,t.exclamationToken,n,i):e.Debug.fail("Argument count mismatch")}),t),e.createImportClause=e.Debug.deprecate((function(t,r,n){return void 0===n&&(n=!1),e.factory.createImportClause(n,t,r)}),t),e.updateImportClause=e.Debug.deprecate((function(t,r,n,i){return e.factory.updateImportClause(t,i,r,n)}),t),e.createExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a){return void 0===a&&(a=!1),e.factory.createExportDeclaration(t,r,a,n,i)}),t),e.updateExportDeclaration=e.Debug.deprecate((function(t,r,n,i,a,o){return e.factory.updateExportDeclaration(t,r,n,o,i,a,t.assertClause)}),t),e.createJSDocParamTag=e.Debug.deprecate((function(t,r,n,i){return e.factory.createJSDocParameterTag(void 0,t,r,n,!1,i?e.factory.createNodeArray([e.factory.createJSDocText(i)]):void 0)}),t),e.createComma=e.Debug.deprecate((function(t,r){return e.factory.createComma(t,r)}),t),e.createLessThan=e.Debug.deprecate((function(t,r){return e.factory.createLessThan(t,r)}),t),e.createAssignment=e.Debug.deprecate((function(t,r){return e.factory.createAssignment(t,r)}),t),e.createStrictEquality=e.Debug.deprecate((function(t,r){return e.factory.createStrictEquality(t,r)}),t),e.createStrictInequality=e.Debug.deprecate((function(t,r){return e.factory.createStrictInequality(t,r)}),t),e.createAdd=e.Debug.deprecate((function(t,r){return e.factory.createAdd(t,r)}),t),e.createSubtract=e.Debug.deprecate((function(t,r){return e.factory.createSubtract(t,r)}),t),e.createLogicalAnd=e.Debug.deprecate((function(t,r){return e.factory.createLogicalAnd(t,r)}),t),e.createLogicalOr=e.Debug.deprecate((function(t,r){return e.factory.createLogicalOr(t,r)}),t),e.createPostfixIncrement=e.Debug.deprecate((function(t){return e.factory.createPostfixIncrement(t)}),t),e.createLogicalNot=e.Debug.deprecate((function(t){return e.factory.createLogicalNot(t)}),t),e.createNode=e.Debug.deprecate((function(t,r,n){return void 0===r&&(r=0),void 0===n&&(n=0),e.setTextRangePosEnd(303===t?e.parseBaseNodeFactory.createBaseSourceFileNode(t):79===t?e.parseBaseNodeFactory.createBaseIdentifierNode(t):80===t?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(t):e.isNodeKind(t)?e.parseBaseNodeFactory.createBaseNode(t):e.parseBaseNodeFactory.createBaseTokenNode(t),r,n)}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate((function(t){var r=e.factory.cloneNode(t);return e.setTextRange(r,t),e.setParent(r,t.parent),r}),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."}),e.isTypeAssertion=e.Debug.deprecate((function(e){return 210===e.kind}),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."}),e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate((function(t){return e.isMemberName(t)}),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."});}(t);
- /**
- * Begins the process of minifying a user's JavaScript
- * @param config the Stencil configuration file that was provided as a part of the build step
- * @param compilerCtx the current compiler context
- * @param opts minification options that specify how the JavaScript ought to be minified
- * @returns the minified JavaScript result
- */
- const optimizeModule = async (config, compilerCtx, opts) => {
- if ((!opts.minify && opts.sourceTarget !== 'es5') || opts.input === '') {
- return {
- output: opts.input,
- diagnostics: [],
- sourceMap: opts.sourceMap,
- };
- }
- const isDebug = config.logLevel === 'debug';
- const cacheKey = await compilerCtx.cache.createKey('optimizeModule', minfyJsId, opts, isDebug);
- const cachedContent = await compilerCtx.cache.get(cacheKey);
- if (cachedContent != null) {
- const cachedMap = await compilerCtx.cache.get(cacheKey + 'Map');
- return {
- output: cachedContent,
- diagnostics: [],
- sourceMap: cachedMap ? JSON.parse(cachedMap) : null,
- };
- }
- let minifyOpts;
- let code = opts.input;
- if (opts.isCore) {
- // IS_ESM_BUILD is replaced at build time so systemjs and esm builds have diff values
- // not using the BUILD conditional since rollup would input the same value
- code = code.replace(/\/\* IS_ESM_BUILD \*\//g, '&& false /* IS_SYSTEM_JS_BUILD */');
- }
- if (opts.sourceTarget === 'es5' || opts.minify) {
- minifyOpts = getTerserOptions(config, opts.sourceTarget, isDebug);
- if (config.sourceMap) {
- minifyOpts.sourceMap = { content: opts.sourceMap };
- }
- const compressOpts = minifyOpts.compress;
- const mangleOptions = minifyOpts.mangle;
- if (opts.sourceTarget !== 'es5' && opts.isCore) {
- if (!isDebug) {
- compressOpts.passes = 2;
- compressOpts.global_defs = {
- supportsListenerOptions: true,
- 'plt.$cssShim$': false,
- };
- compressOpts.pure_funcs = compressOpts.pure_funcs || [];
- compressOpts.pure_funcs = ['getHostRef', ...compressOpts.pure_funcs];
- }
- mangleOptions.properties = {
- regex: '^\\$.+\\$$',
- debug: isDebug,
- };
- compressOpts.inline = 1;
- compressOpts.unsafe = true;
- compressOpts.unsafe_undefined = true;
- }
- }
- const shouldTranspile = opts.sourceTarget === 'es5';
- const results = await compilerCtx.worker.prepareModule(code, minifyOpts, shouldTranspile, opts.inlineHelpers);
- if (results != null &&
- typeof results.output === 'string' &&
- results.diagnostics.length === 0 &&
- compilerCtx != null) {
- if (opts.isCore) {
- results.output = results.output.replace(/disconnectedCallback\(\)\{\},/g, '');
- }
- await compilerCtx.cache.put(cacheKey, results.output);
- if (results.sourceMap) {
- await compilerCtx.cache.put(cacheKey + 'Map', JSON.stringify(results.sourceMap));
- }
- }
- return results;
- };
- /**
- * Builds a configuration object to be used by Terser for the purposes of minifying a user's JavaScript
- * @param config the Stencil configuration file that was provided as a part of the build step
- * @param sourceTarget the version of JavaScript being targeted (e.g. ES2017)
- * @param prettyOutput if true, set the necessary flags to beautify the output of terser
- * @returns the minification options
- */
- const getTerserOptions = (config, sourceTarget, prettyOutput) => {
- const opts = {
- ie8: false,
- safari10: !!config.extras.safari10,
- format: {},
- sourceMap: config.sourceMap,
- };
- if (sourceTarget === 'es5') {
- opts.ecma = opts.format.ecma = 5;
- opts.compress = false;
- opts.mangle = true;
- }
- else {
- opts.mangle = {
- properties: {
- regex: '^\\$.+\\$$',
- },
- };
- opts.compress = {
- pure_getters: true,
- keep_fargs: false,
- passes: 2,
- };
- opts.ecma = opts.format.ecma = opts.compress.ecma = 2018;
- opts.toplevel = true;
- opts.module = true;
- opts.mangle.toplevel = true;
- opts.compress.arrows = true;
- opts.compress.module = true;
- opts.compress.toplevel = true;
- }
- if (prettyOutput) {
- opts.mangle = { keep_fnames: true };
- opts.compress = {};
- opts.compress.drop_console = false;
- opts.compress.drop_debugger = false;
- opts.compress.pure_funcs = [];
- opts.format.beautify = true;
- opts.format.indent_level = 2;
- opts.format.comments = 'all';
- }
- return opts;
- };
- /**
- * This method is likely to be called by a worker on the compiler context, rather than directly.
- * @param input the source code to minify
- * @param minifyOpts options to be used by the minifier
- * @param transpileToEs5 if true, use the TypeScript compiler to transpile the input to ES5 prior to minification
- * @param inlineHelpers when true, emits less terse JavaScript by allowing global helpers created by the TypeScript
- * compiler to be added directly to the transpiled source. Used only if `transpileToEs5` is true.
- * @returns minified input, as JavaScript
- */
- const prepareModule = async (input, minifyOpts, transpileToEs5, inlineHelpers) => {
- var _a;
- const results = {
- output: input,
- diagnostics: [],
- sourceMap: null,
- };
- if (transpileToEs5) {
- const tsResults = t.transpileModule(input, {
- fileName: 'module.ts',
- compilerOptions: {
- sourceMap: !!minifyOpts.sourceMap,
- allowJs: true,
- target: t.ScriptTarget.ES5,
- module: t.ModuleKind.ESNext,
- removeComments: false,
- isolatedModules: true,
- skipLibCheck: true,
- noEmitHelpers: !inlineHelpers,
- importHelpers: !inlineHelpers,
- },
- reportDiagnostics: false,
- });
- results.output = tsResults.outputText;
- if (tsResults.sourceMapText) {
- // need to merge sourcemaps at this point
- const mergeMap = mergeSourceMap((_a = minifyOpts.sourceMap) === null || _a === void 0 ? void 0 : _a.content, JSON.parse(tsResults.sourceMapText));
- minifyOpts.sourceMap = { content: mergeMap };
- }
- }
- if (minifyOpts) {
- return minifyJs(results.output, minifyOpts);
- }
- return results;
- };
- const getScopeId = (tagName, mode) => {
- return 'sc-' + tagName + (mode && mode !== DEFAULT_STYLE_MODE ? '-' + mode : '');
- };
- const getAbsoluteBuildDir = (outputTarget) => {
- const relativeBuildDir = relative$1(outputTarget.dir, outputTarget.buildDir);
- return join('/', relativeBuildDir) + '/';
- };
- const optimizeCriticalPath = (doc, criticalBundlers, outputTarget) => {
- const buildDir = getAbsoluteBuildDir(outputTarget);
- const paths = criticalBundlers.map((path) => join(buildDir, path));
- injectModulePreloads(doc, paths);
- };
- const injectModulePreloads = (doc, paths) => {
- const existingLinks = Array.from(doc.querySelectorAll('link[rel=modulepreload]')).map((link) => link.getAttribute('href'));
- const addLinks = paths.filter((path) => !existingLinks.includes(path)).map((path) => createModulePreload(doc, path));
- const head = doc.head;
- const firstScript = head.querySelector('script');
- if (firstScript) {
- for (const link of addLinks) {
- head.insertBefore(link, firstScript);
- }
- }
- else {
- for (const link of addLinks) {
- head.appendChild(link);
- }
- }
- };
- const createModulePreload = (doc, href) => {
- const link = doc.createElement('link');
- link.setAttribute('rel', 'modulepreload');
- link.setAttribute('href', href);
- return link;
- };
- const optimizeJs = async (inputOpts) => {
- const result = {
- output: inputOpts.input,
- diagnostics: [],
- sourceMap: null,
- };
- try {
- const prettyOutput = !!inputOpts.pretty;
- const config = {
- extras: {
- safari10: true,
- },
- };
- const sourceTarget = inputOpts.target === 'es5' ? 'es5' : 'latest';
- const minifyOpts = getTerserOptions(config, sourceTarget, prettyOutput);
- const minifyResults = await minifyJs(inputOpts.input, minifyOpts);
- if (minifyResults.diagnostics.length > 0) {
- result.diagnostics.push(...minifyResults.diagnostics);
- }
- else {
- result.output = minifyResults.output;
- result.sourceMap = minifyResults.sourceMap;
- }
- }
- catch (e) {
- catchError(result.diagnostics, e);
- }
- return result;
- };
- const inlineExternalStyleSheets = async (sys, appDir, doc) => {
- const documentLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
- if (documentLinks.length === 0) {
- return;
- }
- await Promise.all(documentLinks.map(async (link) => {
- const href = link.getAttribute('href');
- if (!href.startsWith('/') || link.getAttribute('media') !== null) {
- return;
- }
- const fsPath = join(appDir, href);
- try {
- let styles = await sys.readFile(fsPath);
- const optimizeResults = await optimizeCss$1({
- input: styles,
- });
- styles = optimizeResults.output;
- // insert inline <style>
- const inlinedStyles = doc.createElement('style');
- inlinedStyles.innerHTML = styles;
- link.parentNode.insertBefore(inlinedStyles, link);
- link.remove();
- // mark inlinedStyle as treeshakable
- inlinedStyles.setAttribute('data-styles', '');
- // since it's no longer a critical resource
- link.setAttribute('media', '(max-width: 0px)');
- link.setAttribute('importance', 'low');
- link.setAttribute('onload', `this.media=''`);
- // move <link rel="stylesheet"> to the end of <body>
- doc.body.appendChild(link);
- }
- catch (e) { }
- }));
- };
- const minifyScriptElements = async (doc, addMinifiedAttr) => {
- const scriptElms = Array.from(doc.querySelectorAll('script')).filter((scriptElm) => {
- if (scriptElm.hasAttribute('src') || scriptElm.hasAttribute(dataMinifiedAttr)) {
- return false;
- }
- const scriptType = scriptElm.getAttribute('type');
- if (typeof scriptType === 'string' && scriptType !== 'module' && scriptType !== 'text/javascript') {
- return false;
- }
- return true;
- });
- if (scriptElms.length === 0) {
- return;
- }
- await Promise.all(scriptElms.map(async (scriptElm) => {
- const content = scriptElm.innerHTML.trim();
- if (content.length > 0) {
- const opts = {
- input: content,
- sourceMap: false,
- target: 'latest',
- };
- if (scriptElm.getAttribute('type') !== 'module') {
- opts.target = 'es5';
- }
- const optimizeResults = await optimizeJs(opts);
- if (optimizeResults.diagnostics.length === 0) {
- scriptElm.innerHTML = optimizeResults.output;
- }
- if (addMinifiedAttr) {
- scriptElm.setAttribute(dataMinifiedAttr, '');
- }
- }
- }));
- };
- const minifyStyleElements = async (sys, appDir, doc, currentUrl, addMinifiedAttr) => {
- const styleElms = Array.from(doc.querySelectorAll('style')).filter((styleElm) => {
- if (styleElm.hasAttribute(dataMinifiedAttr)) {
- return false;
- }
- return true;
- });
- await Promise.all(styleElms.map(async (styleElm) => {
- const content = styleElm.innerHTML.trim();
- if (content.length > 0) {
- const optimizeResults = await optimizeCss$1({
- input: content,
- minify: true,
- async resolveUrl(urlProp) {
- const assetUrl = new URL(urlProp, currentUrl);
- const hash = await getAssetFileHash(sys, appDir, assetUrl);
- assetUrl.searchParams.append('v', hash);
- return assetUrl.pathname + assetUrl.search;
- },
- });
- if (optimizeResults.diagnostics.length === 0) {
- styleElm.innerHTML = optimizeResults.output;
- }
- if (addMinifiedAttr) {
- styleElm.setAttribute(dataMinifiedAttr, '');
- }
- }
- }));
- };
- const excludeStaticComponents = (doc, hydrateOpts, hydrateResults) => {
- const staticComponents = hydrateOpts.staticComponents.filter((tag) => {
- return hydrateResults.components.some((cmp) => cmp.tag === tag);
- });
- if (staticComponents.length > 0) {
- const stencilScriptElm = doc.querySelector('script[data-stencil-namespace]');
- if (stencilScriptElm) {
- const namespace = stencilScriptElm.getAttribute('data-stencil-namespace');
- let scriptContent = excludeComponentScript.replace('__NAMESPACE__', namespace);
- scriptContent = scriptContent.replace('__EXCLUDE__', JSON.stringify(staticComponents));
- const dataOptsScript = doc.createElement('script');
- dataOptsScript.innerHTML = scriptContent;
- dataOptsScript.setAttribute(dataMinifiedAttr, '');
- stencilScriptElm.parentNode.insertBefore(dataOptsScript, stencilScriptElm.nextSibling);
- }
- }
- };
- const excludeComponentScript = `
- (function(){
- var s=document.querySelector('[data-stencil-namespace="__NAMESPACE__"]');
- s&&((s['data-opts']=s['data-opts']||{}).exclude=__EXCLUDE__);
- })();
- `
- .replace(/\n/g, '')
- .trim();
- const addModulePreloads = (doc, hydrateOpts, hydrateResults, componentGraph) => {
- if (!componentGraph) {
- return false;
- }
- const staticComponents = hydrateOpts.staticComponents || [];
- const cmpTags = hydrateResults.components.filter((cmp) => !staticComponents.includes(cmp.tag));
- const modulePreloads = unique(flatOne(cmpTags.map((cmp) => getScopeId(cmp.tag, cmp.mode)).map((scopeId) => componentGraph.get(scopeId) || [])));
- injectModulePreloads(doc, modulePreloads);
- return true;
- };
- const removeModulePreloads = (doc) => {
- const links = doc.querySelectorAll('link[rel="modulepreload"]');
- for (let i = links.length - 1; i >= 0; i--) {
- const href = links[i].getAttribute('href');
- if (href && href.includes('/p-')) {
- links[i].remove();
- }
- }
- };
- const removeStencilScripts = (doc) => {
- const stencilScripts = doc.querySelectorAll('script[data-stencil]');
- for (let i = stencilScripts.length - 1; i >= 0; i--) {
- stencilScripts[i].remove();
- }
- };
- const hasStencilScript = (doc) => {
- return !!doc.querySelector('script[data-stencil]');
- };
- const hashAssets = async (sys, prerenderCtx, diagnostics, hydrateOpts, appDir, doc, currentUrl) => {
- // do one at a time to prevent too many opened files and memory usage issues
- // hash id is cached in each worker, so shouldn't have to do this for every page
- // update the stylesheet content first so the hash url()s are apart of the file's hash too
- const links = Array.from(doc.querySelectorAll('link[rel=stylesheet][href]'));
- for (const link of links) {
- const href = link.getAttribute('href');
- if (isString$1(href) && href.length > 0) {
- const stylesheetUrl = new URL(href, currentUrl);
- if (currentUrl.host === stylesheetUrl.host) {
- try {
- const filePath = join(appDir, stylesheetUrl.pathname);
- if (prerenderCtx.hashedFile.has(filePath)) {
- continue;
- }
- prerenderCtx.hashedFile.add(filePath);
- let css = await sys.readFile(filePath);
- if (isString$1(css) && css.length > 0) {
- css = await minifyCss({
- css,
- async resolveUrl(urlProp) {
- const assetUrl = new URL(urlProp, stylesheetUrl);
- const hash = await getAssetFileHash(sys, appDir, assetUrl);
- assetUrl.searchParams.append('v', hash);
- return assetUrl.pathname + assetUrl.search;
- },
- });
- sys.writeFileSync(filePath, css);
- }
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- }
- }
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="stylesheet"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="prefetch"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="preload"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="modulepreload"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="icon"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="apple-touch-icon"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'link[rel="manifest"]', ['href']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'script', ['src']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'img', ['src', 'srcset']);
- await hashAsset(sys, hydrateOpts, appDir, doc, currentUrl, 'picture > source', ['srcset']);
- const pageStates = Array.from(doc.querySelectorAll('script[data-stencil-static="page.state"][type="application/json"]'));
- if (pageStates.length > 0) {
- await Promise.all(pageStates.map(async (pageStateScript) => {
- const pageState = JSON.parse(pageStateScript.textContent);
- if (pageState && Array.isArray(pageState.ast)) {
- for (const node of pageState.ast) {
- if (Array.isArray(node)) {
- await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node);
- }
- }
- pageStateScript.textContent = JSON.stringify(pageState);
- }
- }));
- }
- };
- const hashAsset = async (sys, hydrateOpts, appDir, doc, currentUrl, selector, srcAttrs) => {
- const elms = Array.from(doc.querySelectorAll(selector));
- // do one at a time to prevent too many opened files and memory usage issues
- for (const elm of elms) {
- for (const attrName of srcAttrs) {
- const srcValues = getAttrUrls(attrName, elm.getAttribute(attrName));
- for (const srcValue of srcValues) {
- const assetUrl = new URL(srcValue.src, currentUrl);
- if (assetUrl.hostname === currentUrl.hostname) {
- if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
- try {
- const hash = await getAssetFileHash(sys, appDir, assetUrl);
- if (isString$1(hash)) {
- assetUrl.searchParams.append('v', hash);
- const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
- elm.setAttribute(attrName, attrValue);
- }
- }
- catch (e) { }
- }
- }
- }
- }
- }
- };
- const hashPageStateAstAssets = async (sys, hydrateOpts, appDir, currentUrl, pageStateScript, node) => {
- const tagName = node[0];
- const attrs = node[1];
- if (isString$1(tagName)) {
- if (attrs) {
- if (tagName === 'img' || tagName === 'source') {
- for (const attrName of ['src', 'srcset']) {
- const srcValues = getAttrUrls(attrName, attrs[attrName]);
- for (const srcValue of srcValues) {
- const assetUrl = new URL(srcValue.src, currentUrl);
- if (assetUrl.hostname === currentUrl.hostname) {
- if (hydrateOpts.hashAssets === 'querystring' && !assetUrl.searchParams.has('v')) {
- try {
- const hash = await getAssetFileHash(sys, appDir, assetUrl);
- if (isString$1(hash)) {
- assetUrl.searchParams.append('v', hash);
- const attrValue = setAttrUrls(assetUrl, srcValue.descriptor);
- attrs[attrName] = attrValue;
- }
- }
- catch (e) { }
- }
- }
- }
- }
- }
- }
- for (let i = 2, l = node.length; i < l; i++) {
- if (Array.isArray(node[i])) {
- await hashPageStateAstAssets(sys, hydrateOpts, appDir, currentUrl, pageStateScript, node[i]);
- }
- }
- }
- };
- const getAttrUrls = (attrName, attrValue) => {
- const srcValues = [];
- if (isString$1(attrValue)) {
- if (attrName.toLowerCase() === 'srcset') {
- attrValue
- .split(',')
- .map((a) => a.trim())
- .filter((a) => a.length > 0)
- .forEach((src) => {
- const spaceSplt = src.split(' ');
- if (spaceSplt[0].length > 0) {
- srcValues.push({ src: spaceSplt[0], descriptor: spaceSplt[1] });
- }
- });
- }
- else {
- srcValues.push({ src: attrValue });
- }
- }
- return srcValues;
- };
- const setAttrUrls = (url, descriptor) => {
- let src = url.pathname + url.search;
- if (isString$1(descriptor)) {
- src += ' ' + descriptor;
- }
- return src;
- };
- const hashedAssets = new Map();
- const getAssetFileHash = async (sys, appDir, assetUrl) => {
- let p = hashedAssets.get(assetUrl.pathname);
- if (!p) {
- const assetFilePath = join(appDir, assetUrl.pathname);
- p = sys.generateFileHash(assetFilePath, 10);
- hashedAssets.set(assetUrl.pathname, p);
- }
- return p;
- };
- const dataMinifiedAttr = 'data-m';
- const crawlAnchorsForNextUrls = (prerenderConfig, diagnostics, baseUrl, currentUrl, parsedAnchors) => {
- if (!Array.isArray(parsedAnchors) || parsedAnchors.length === 0) {
- return [];
- }
- const basePathParts = baseUrl.pathname.split('/');
- // filterAnchor(): filter which anchors to actually crawl
- // normalizeUrl(): normalize href strings into URL objects
- // filterUrl(): filter which urls to actually crawl
- // normalizeHref(): normalize URL objects into href strings
- return parsedAnchors
- .filter((anchor) => {
- // filter which anchors to actually crawl
- if (typeof prerenderConfig.filterAnchor === 'function') {
- // user filterAnchor()
- try {
- const userFilterAnchor = prerenderConfig.filterAnchor(anchor, currentUrl);
- if (userFilterAnchor === false) {
- return false;
- }
- }
- catch (e) {
- // user filterAnchor() error
- catchError(diagnostics, e);
- return false;
- }
- }
- // standard filterAnchor()
- return standardFilterAnchor(diagnostics, anchor);
- })
- .map((anchor) => {
- // normalize href strings into URL objects
- if (typeof prerenderConfig.normalizeUrl === 'function') {
- try {
- // user normalizeUrl()
- const userNormalizedUrl = prerenderConfig.normalizeUrl(anchor.href, currentUrl);
- // standard normalizeUrl(), after user normalized
- return standardNormalizeUrl(diagnostics, userNormalizedUrl.href, currentUrl);
- }
- catch (e) {
- // user normalizeUrl() error
- catchError(diagnostics, e);
- }
- }
- // standard normalizeUrl(), no user normalized
- return standardNormalizeUrl(diagnostics, anchor.href, currentUrl);
- })
- .filter((url) => {
- // filter which urls to actually crawl
- if (typeof prerenderConfig.filterUrl === 'function') {
- // user filterUrl()
- try {
- const userFilterUrl = prerenderConfig.filterUrl(url, currentUrl);
- if (userFilterUrl === false) {
- return false;
- }
- }
- catch (e) {
- // user filterUrl() error
- catchError(diagnostics, e);
- return false;
- }
- }
- // standard filterUrl()
- return standardFilterUrl(diagnostics, url, currentUrl, basePathParts);
- })
- .map((url) => {
- // standard normalize href
- // normalize URL objects into href strings
- return standardNormalizeHref(prerenderConfig, diagnostics, url);
- })
- .reduce((hrefs, href) => {
- // remove any duplicate hrefs from the array
- if (!hrefs.includes(href)) {
- hrefs.push(href);
- }
- return hrefs;
- }, [])
- .sort((a, b) => {
- // sort the hrefs so the urls with the least amount
- // of directories are first, then by alphabetical
- const partsA = a.split('/').length;
- const partsB = b.split('/').length;
- if (partsA < partsB)
- return -1;
- if (partsA > partsB)
- return 1;
- if (a < b)
- return -1;
- if (a > b)
- return 1;
- return 0;
- });
- };
- const standardFilterAnchor = (diagnostics, attrs, _base) => {
- try {
- let href = attrs.href;
- if (typeof attrs.download === 'string') {
- return false;
- }
- if (typeof href === 'string') {
- href = href.trim();
- if (href !== '' && !href.startsWith('#') && !href.startsWith('?')) {
- const target = attrs.target;
- if (typeof target === 'string' && attrs.target.trim().toLowerCase() !== '_self') {
- return false;
- }
- return true;
- }
- }
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- return false;
- };
- const standardNormalizeUrl = (diagnostics, href, currentUrl) => {
- if (typeof href === 'string') {
- try {
- const outputUrl = new URL(href, currentUrl.href);
- outputUrl.protocol = currentUrl.href;
- outputUrl.hash = '';
- outputUrl.search = '';
- const parts = outputUrl.pathname.split('/');
- const lastPart = parts[parts.length - 1];
- if (lastPart === 'index.html' || lastPart === 'index.htm') {
- parts.pop();
- outputUrl.pathname = parts.join('/');
- }
- return outputUrl;
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- return null;
- };
- const standardFilterUrl = (diagnostics, url, currentUrl, basePathParts) => {
- try {
- if (url.hostname != null && currentUrl.hostname != null && url.hostname !== currentUrl.hostname) {
- return false;
- }
- if (shouldSkipExtension(url.pathname)) {
- return false;
- }
- const inputPathParts = url.pathname.split('/');
- if (inputPathParts.length < basePathParts.length) {
- return false;
- }
- for (let i = 0; i < basePathParts.length; i++) {
- const basePathPart = basePathParts[i];
- const inputPathPart = inputPathParts[i];
- if (basePathParts.length - 1 === i && basePathPart === '') {
- break;
- }
- if (basePathPart !== inputPathPart) {
- return false;
- }
- }
- return true;
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- return false;
- };
- const standardNormalizeHref = (prerenderConfig, diagnostics, url) => {
- try {
- if (url != null && typeof url.href === 'string') {
- let href = url.href.trim();
- if (prerenderConfig.trailingSlash) {
- // url should have a trailing slash
- if (!href.endsWith('/')) {
- const parts = url.pathname.split('/');
- const lastPart = parts[parts.length - 1];
- if (!lastPart.includes('.')) {
- // does not end with a slash and last part does not have a dot
- href += '/';
- }
- }
- }
- else {
- // url should NOT have a trailing slash
- if (href.endsWith('/') && url.pathname !== '/') {
- // this has a trailing slash and it's not the root path
- href = href.slice(0, -1);
- }
- }
- return href;
- }
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- return null;
- };
- const shouldSkipExtension = (filename) => SKIP_EXT.has(extname(filename).toLowerCase());
- const extname = (str) => {
- const parts = str.split('.');
- return parts[parts.length - 1].toLowerCase();
- };
- const SKIP_EXT = new Set(['zip', 'rar', 'tar', 'gz', 'bz2', 'png', 'jpeg', 'jpg', 'gif', 'pdf', 'tiff', 'psd']);
- const prerenderCtx = {
- buildId: null,
- componentGraph: null,
- prerenderConfig: null,
- ensuredDirs: null,
- templateHtml: null,
- hashedFile: null,
- };
- const getPrerenderCtx = (prerenderRequest) => {
- if (prerenderRequest.buildId !== prerenderCtx.buildId) {
- prerenderCtx.buildId = prerenderRequest.buildId;
- prerenderCtx.componentGraph = null;
- prerenderCtx.prerenderConfig = null;
- prerenderCtx.ensuredDirs = new Set();
- prerenderCtx.templateHtml = null;
- prerenderCtx.hashedFile = new Set();
- }
- return prerenderCtx;
- };
- const getHydrateOptions = (prerenderConfig, url, diagnostics) => {
- const prerenderUrl = url.href;
- const opts = {
- url: prerenderUrl,
- addModulePreloads: true,
- approximateLineWidth: 100,
- hashAssets: 'querystring',
- inlineExternalStyleSheets: false,
- minifyScriptElements: true,
- minifyStyleElements: true,
- removeAttributeQuotes: true,
- removeBooleanAttributeQuotes: true,
- removeEmptyAttributes: true,
- removeHtmlComments: true,
- };
- if (prerenderConfig.canonicalUrl === null || prerenderConfig.canonicalUrl === false) {
- opts.canonicalUrl = null;
- }
- else if (typeof prerenderConfig.canonicalUrl === 'function') {
- try {
- opts.canonicalUrl = prerenderConfig.canonicalUrl(url);
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- else {
- opts.canonicalUrl = prerenderUrl;
- }
- if (typeof prerenderConfig.hydrateOptions === 'function') {
- try {
- const userOpts = prerenderConfig.hydrateOptions(url);
- if (userOpts != null) {
- if (userOpts.prettyHtml && typeof userOpts.removeAttributeQuotes !== 'boolean') {
- opts.removeAttributeQuotes = false;
- }
- Object.assign(opts, userOpts);
- }
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- return opts;
- };
- const nodeRequire = (id) => {
- const results = {
- module: undefined,
- id,
- diagnostics: [],
- };
- if (IS_NODE_ENV) {
- try {
- const fs = require('fs');
- const path = require('path');
- results.id = path.resolve(id);
- // ensure we cleared out node's internal require() cache for this file
- delete require.cache[results.id];
- // let's override node's require for a second
- // don't worry, we'll revert this when we're done
- require.extensions['.ts'] = (module, fileName) => {
- let sourceText = fs.readFileSync(fileName, 'utf8');
- if (fileName.endsWith('.ts')) {
- // looks like we've got a typed config file
- // let's transpile it to .js quick
- const tsResults = t.transpileModule(sourceText, {
- fileName,
- compilerOptions: {
- module: t.ModuleKind.CommonJS,
- moduleResolution: t.ModuleResolutionKind.NodeJs,
- esModuleInterop: true,
- target: t.ScriptTarget.ES2017,
- allowJs: true,
- },
- });
- sourceText = tsResults.outputText;
- results.diagnostics.push(...tsResults.diagnostics.map(loadTypeScriptDiagnostic));
- }
- else {
- // quick hack to turn a modern es module
- // into and old school commonjs module
- sourceText = sourceText.replace(/export\s+\w+\s+(\w+)/gm, 'exports.$1');
- }
- try {
- module._compile(sourceText, fileName);
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- };
- // let's do this!
- results.module = require(results.id);
- // all set, let's go ahead and reset the require back to the default
- require.extensions['.ts'] = undefined;
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- }
- return results;
- };
- const getPrerenderConfig = (diagnostics, prerenderConfigPath) => {
- const prerenderConfig = {};
- if (isString$1(prerenderConfigPath)) {
- const results = nodeRequire(prerenderConfigPath);
- diagnostics.push(...results.diagnostics);
- if (results.module != null && typeof results.module === 'object') {
- if (results.module.config != null && typeof results.module.config === 'object') {
- Object.assign(prerenderConfig, results.module.config);
- }
- else {
- Object.assign(prerenderConfig, results.module);
- }
- }
- }
- return prerenderConfig;
- };
- const prerenderWorker = async (sys, prerenderRequest) => {
- // worker thread!
- const results = {
- diagnostics: [],
- anchorUrls: [],
- filePath: prerenderRequest.writeToFilePath,
- };
- try {
- const prerenderCtx = getPrerenderCtx(prerenderRequest);
- const url = new URL(prerenderRequest.url, prerenderRequest.devServerHostUrl);
- const baseUrl = new URL(prerenderRequest.baseUrl);
- const componentGraph = getComponentGraph(sys, prerenderCtx, prerenderRequest.componentGraphPath);
- // webpack work-around/hack
- const hydrateApp = requireFunc(prerenderRequest.hydrateAppFilePath);
- if (prerenderCtx.templateHtml == null) {
- // cache template html in this process
- prerenderCtx.templateHtml = sys.readFileSync(prerenderRequest.templateId);
- }
- // create a new window by cloning the cached parsed window
- const win = hydrateApp.createWindowFromHtml(prerenderCtx.templateHtml, prerenderRequest.templateId);
- const doc = win.document;
- win.location.href = url.href;
- // patch this new window
- if (isFunction(sys.applyPrerenderGlobalPatch)) {
- sys.applyPrerenderGlobalPatch({
- devServerHostUrl: prerenderRequest.devServerHostUrl,
- window: win,
- });
- }
- if (prerenderCtx.prerenderConfig == null) {
- prerenderCtx.prerenderConfig = getPrerenderConfig(results.diagnostics, prerenderRequest.prerenderConfigPath);
- }
- const prerenderConfig = prerenderCtx.prerenderConfig;
- const hydrateOpts = getHydrateOptions(prerenderConfig, url, results.diagnostics);
- if (prerenderRequest.staticSite || hydrateOpts.staticDocument) {
- hydrateOpts.addModulePreloads = false;
- hydrateOpts.clientHydrateAnnotations = false;
- }
- if (typeof hydrateOpts.buildId !== 'string') {
- hydrateOpts.buildId = prerenderRequest.buildId;
- }
- if (typeof prerenderConfig.beforeHydrate === 'function') {
- try {
- const rtn = prerenderConfig.beforeHydrate(doc, url);
- if (isPromise(rtn)) {
- await rtn;
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- }
- // parse the html to dom nodes, hydrate the components, then
- // serialize the hydrated dom nodes back to into html
- const hydrateResults = (await hydrateApp.hydrateDocument(doc, hydrateOpts));
- results.diagnostics.push(...hydrateResults.diagnostics);
- if (typeof prerenderConfig.filePath === 'function') {
- try {
- const userWriteToFilePath = prerenderConfig.filePath(url, results.filePath);
- if (typeof userWriteToFilePath === 'string') {
- results.filePath = userWriteToFilePath;
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- }
- if (hydrateOpts.staticDocument) {
- removeStencilScripts(doc);
- removeModulePreloads(doc);
- }
- else {
- if (Array.isArray(hydrateOpts.staticComponents)) {
- excludeStaticComponents(doc, hydrateOpts, hydrateResults);
- }
- if (hydrateOpts.addModulePreloads) {
- if (!prerenderRequest.isDebug) {
- addModulePreloads(doc, hydrateOpts, hydrateResults, componentGraph);
- }
- }
- else {
- // remove module preloads
- removeModulePreloads(doc);
- }
- }
- const docPromises = [];
- if (hydrateOpts.minifyStyleElements && !prerenderRequest.isDebug) {
- docPromises.push(minifyStyleElements(sys, prerenderRequest.appDir, doc, url, false));
- }
- if (hydrateOpts.minifyScriptElements && !prerenderRequest.isDebug) {
- docPromises.push(minifyScriptElements(doc, false));
- }
- if (hydrateOpts.hashAssets && !prerenderRequest.isDebug) {
- try {
- docPromises.push(hashAssets(sys, prerenderCtx, results.diagnostics, hydrateOpts, prerenderRequest.appDir, doc, url));
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- }
- if (docPromises.length > 0) {
- await Promise.all(docPromises);
- }
- if (prerenderConfig.crawlUrls !== false) {
- results.anchorUrls = crawlAnchorsForNextUrls(prerenderConfig, results.diagnostics, baseUrl, url, hydrateResults.anchors);
- }
- if (typeof prerenderConfig.afterHydrate === 'function') {
- try {
- const rtn = prerenderConfig.afterHydrate(doc, url, results);
- if (isPromise(rtn)) {
- await rtn;
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- }
- if (typeof hydrateResults.httpStatus === 'number' && hydrateResults.httpStatus >= 400) {
- try {
- win.close();
- }
- catch (e) { }
- return results;
- }
- const html = hydrateApp.serializeDocumentToString(doc, hydrateOpts);
- prerenderEnsureDir(sys, prerenderCtx, results.filePath);
- const writePromise = sys.writeFile(results.filePath, html);
- if (Array.isArray(hydrateResults.staticData) && hydrateResults.staticData.length > 0) {
- const pageDir = dirname(results.filePath);
- await Promise.all(hydrateResults.staticData.map(async (s) => {
- if (s.type === 'application/json') {
- const data = {
- [s.id]: JSON.parse(s.content),
- components: hydrateResults.components.map((c) => c.tag),
- };
- const dataFileName = `${s.id}.json`;
- const dataFilePath = join(pageDir, dataFileName);
- await sys.writeFile(dataFilePath, JSON.stringify(data));
- }
- else {
- const contentFileName = `${s.id}.txt`;
- const contentFilePath = join(pageDir, contentFileName);
- await sys.writeFile(contentFilePath, s.content);
- }
- }));
- }
- await writePromise;
- try {
- win.close();
- }
- catch (e) { }
- }
- catch (e) {
- // ahh man! what happened!
- catchError(results.diagnostics, e);
- }
- return results;
- };
- const getComponentGraph = (sys, prerenderCtx, componentGraphPath) => {
- if (componentGraphPath == null) {
- return undefined;
- }
- if (prerenderCtx.componentGraph == null) {
- const componentGraphJson = JSON.parse(sys.readFileSync(componentGraphPath));
- prerenderCtx.componentGraph = new Map(Object.entries(componentGraphJson));
- }
- return prerenderCtx.componentGraph;
- };
- const prerenderEnsureDir = (sys, prerenderCtx, p) => {
- const allDirs = [];
- while (true) {
- p = normalizePath$1(sys.platformPath.dirname(p));
- if (typeof p === 'string' && p.length > 0 && !isRootPath(p)) {
- allDirs.push(p);
- }
- else {
- break;
- }
- }
- allDirs.reverse();
- for (let i = 0; i < allDirs.length; i++) {
- const dir = allDirs[i];
- if (!prerenderCtx.ensuredDirs.has(dir)) {
- prerenderCtx.ensuredDirs.add(dir);
- sys.createDirSync(dir);
- }
- }
- };
- var chars$3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
- function encode$2(decoded) {
- var sourceFileIndex = 0; // second field
- var sourceCodeLine = 0; // third field
- var sourceCodeColumn = 0; // fourth field
- var nameIndex = 0; // fifth field
- var mappings = '';
- for (var i = 0; i < decoded.length; i++) {
- var line = decoded[i];
- if (i > 0)
- mappings += ';';
- if (line.length === 0)
- continue;
- var generatedCodeColumn = 0; // first field
- var lineMappings = [];
- for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
- var segment = line_1[_i];
- var segmentMappings = encodeInteger$2(segment[0] - generatedCodeColumn);
- generatedCodeColumn = segment[0];
- if (segment.length > 1) {
- segmentMappings +=
- encodeInteger$2(segment[1] - sourceFileIndex) +
- encodeInteger$2(segment[2] - sourceCodeLine) +
- encodeInteger$2(segment[3] - sourceCodeColumn);
- sourceFileIndex = segment[1];
- sourceCodeLine = segment[2];
- sourceCodeColumn = segment[3];
- }
- if (segment.length === 5) {
- segmentMappings += encodeInteger$2(segment[4] - nameIndex);
- nameIndex = segment[4];
- }
- lineMappings.push(segmentMappings);
- }
- mappings += lineMappings.join(',');
- }
- return mappings;
- }
- function encodeInteger$2(num) {
- var result = '';
- num = num < 0 ? (-num << 1) | 1 : num << 1;
- do {
- var clamped = num & 31;
- num >>>= 5;
- if (num > 0) {
- clamped |= 32;
- }
- result += chars$3[clamped];
- } while (num > 0);
- return result;
- }
- var BitSet$2 = function BitSet(arg) {
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
- };
- BitSet$2.prototype.add = function add (n) {
- this.bits[n >> 5] |= 1 << (n & 31);
- };
- BitSet$2.prototype.has = function has (n) {
- return !!(this.bits[n >> 5] & (1 << (n & 31)));
- };
- var Chunk$3 = function Chunk(start, end, content) {
- this.start = start;
- this.end = end;
- this.original = content;
- this.intro = '';
- this.outro = '';
- this.content = content;
- this.storeName = false;
- this.edited = false;
- // we make these non-enumerable, for sanity while debugging
- Object.defineProperties(this, {
- previous: { writable: true, value: null },
- next: { writable: true, value: null }
- });
- };
- Chunk$3.prototype.appendLeft = function appendLeft (content) {
- this.outro += content;
- };
- Chunk$3.prototype.appendRight = function appendRight (content) {
- this.intro = this.intro + content;
- };
- Chunk$3.prototype.clone = function clone () {
- var chunk = new Chunk$3(this.start, this.end, this.original);
- chunk.intro = this.intro;
- chunk.outro = this.outro;
- chunk.content = this.content;
- chunk.storeName = this.storeName;
- chunk.edited = this.edited;
- return chunk;
- };
- Chunk$3.prototype.contains = function contains (index) {
- return this.start < index && index < this.end;
- };
- Chunk$3.prototype.eachNext = function eachNext (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.next;
- }
- };
- Chunk$3.prototype.eachPrevious = function eachPrevious (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.previous;
- }
- };
- Chunk$3.prototype.edit = function edit (content, storeName, contentOnly) {
- this.content = content;
- if (!contentOnly) {
- this.intro = '';
- this.outro = '';
- }
- this.storeName = storeName;
- this.edited = true;
- return this;
- };
- Chunk$3.prototype.prependLeft = function prependLeft (content) {
- this.outro = content + this.outro;
- };
- Chunk$3.prototype.prependRight = function prependRight (content) {
- this.intro = content + this.intro;
- };
- Chunk$3.prototype.split = function split (index) {
- var sliceIndex = index - this.start;
- var originalBefore = this.original.slice(0, sliceIndex);
- var originalAfter = this.original.slice(sliceIndex);
- this.original = originalBefore;
- var newChunk = new Chunk$3(index, this.end, originalAfter);
- newChunk.outro = this.outro;
- this.outro = '';
- this.end = index;
- if (this.edited) {
- // TODO is this block necessary?...
- newChunk.edit('', false);
- this.content = '';
- } else {
- this.content = originalBefore;
- }
- newChunk.next = this.next;
- if (newChunk.next) { newChunk.next.previous = newChunk; }
- newChunk.previous = this;
- this.next = newChunk;
- return newChunk;
- };
- Chunk$3.prototype.toString = function toString () {
- return this.intro + this.content + this.outro;
- };
- Chunk$3.prototype.trimEnd = function trimEnd (rx) {
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.start + trimmed.length).edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- }
- };
- Chunk$3.prototype.trimStart = function trimStart (rx) {
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.end - trimmed.length);
- this.edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- }
- };
- var btoa$3 = function () {
- throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
- };
- if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
- btoa$3 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
- } else if (typeof Buffer === 'function') {
- btoa$3 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
- }
- var SourceMap$2 = function SourceMap(properties) {
- this.version = 3;
- this.file = properties.file;
- this.sources = properties.sources;
- this.sourcesContent = properties.sourcesContent;
- this.names = properties.names;
- this.mappings = encode$2(properties.mappings);
- };
- SourceMap$2.prototype.toString = function toString () {
- return JSON.stringify(this);
- };
- SourceMap$2.prototype.toUrl = function toUrl () {
- return 'data:application/json;charset=utf-8;base64,' + btoa$3(this.toString());
- };
- function guessIndent$2(code) {
- var lines = code.split('\n');
- var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
- var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
- if (tabbed.length === 0 && spaced.length === 0) {
- return null;
- }
- // More lines tabbed than spaced? Assume tabs, and
- // default to tabs in the case of a tie (or nothing
- // to go on)
- if (tabbed.length >= spaced.length) {
- return '\t';
- }
- // Otherwise, we need to guess the multiple
- var min = spaced.reduce(function (previous, current) {
- var numSpaces = /^ +/.exec(current)[0].length;
- return Math.min(numSpaces, previous);
- }, Infinity);
- return new Array(min + 1).join(' ');
- }
- function getRelativePath$2(from, to) {
- var fromParts = from.split(/[/\\]/);
- var toParts = to.split(/[/\\]/);
- fromParts.pop(); // get dirname
- while (fromParts[0] === toParts[0]) {
- fromParts.shift();
- toParts.shift();
- }
- if (fromParts.length) {
- var i = fromParts.length;
- while (i--) { fromParts[i] = '..'; }
- }
- return fromParts.concat(toParts).join('/');
- }
- var toString$3 = Object.prototype.toString;
- function isObject$3(thing) {
- return toString$3.call(thing) === '[object Object]';
- }
- function getLocator$3(source) {
- var originalLines = source.split('\n');
- var lineOffsets = [];
- for (var i = 0, pos = 0; i < originalLines.length; i++) {
- lineOffsets.push(pos);
- pos += originalLines[i].length + 1;
- }
- return function locate(index) {
- var i = 0;
- var j = lineOffsets.length;
- while (i < j) {
- var m = (i + j) >> 1;
- if (index < lineOffsets[m]) {
- j = m;
- } else {
- i = m + 1;
- }
- }
- var line = i - 1;
- var column = index - lineOffsets[line];
- return { line: line, column: column };
- };
- }
- var Mappings$2 = function Mappings(hires) {
- this.hires = hires;
- this.generatedCodeLine = 0;
- this.generatedCodeColumn = 0;
- this.raw = [];
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
- this.pending = null;
- };
- Mappings$2.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
- if (content.length) {
- var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
- if (nameIndex >= 0) {
- segment.push(nameIndex);
- }
- this.rawSegments.push(segment);
- } else if (this.pending) {
- this.rawSegments.push(this.pending);
- }
- this.advance(content);
- this.pending = null;
- };
- Mappings$2.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
- var originalCharIndex = chunk.start;
- var first = true;
- while (originalCharIndex < chunk.end) {
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
- this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
- }
- if (original[originalCharIndex] === '\n') {
- loc.line += 1;
- loc.column = 0;
- this.generatedCodeLine += 1;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- this.generatedCodeColumn = 0;
- first = true;
- } else {
- loc.column += 1;
- this.generatedCodeColumn += 1;
- first = false;
- }
- originalCharIndex += 1;
- }
- this.pending = null;
- };
- Mappings$2.prototype.advance = function advance (str) {
- if (!str) { return; }
- var lines = str.split('\n');
- if (lines.length > 1) {
- for (var i = 0; i < lines.length - 1; i++) {
- this.generatedCodeLine++;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- }
- this.generatedCodeColumn = 0;
- }
- this.generatedCodeColumn += lines[lines.length - 1].length;
- };
- var n$2 = '\n';
- var warned$2 = {
- insertLeft: false,
- insertRight: false,
- storeName: false
- };
- var MagicString$2 = function MagicString(string, options) {
- if ( options === void 0 ) options = {};
- var chunk = new Chunk$3(0, string.length, string);
- Object.defineProperties(this, {
- original: { writable: true, value: string },
- outro: { writable: true, value: '' },
- intro: { writable: true, value: '' },
- firstChunk: { writable: true, value: chunk },
- lastChunk: { writable: true, value: chunk },
- lastSearchedChunk: { writable: true, value: chunk },
- byStart: { writable: true, value: {} },
- byEnd: { writable: true, value: {} },
- filename: { writable: true, value: options.filename },
- indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
- sourcemapLocations: { writable: true, value: new BitSet$2() },
- storedNames: { writable: true, value: {} },
- indentStr: { writable: true, value: guessIndent$2(string) }
- });
- this.byStart[0] = chunk;
- this.byEnd[string.length] = chunk;
- };
- MagicString$2.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
- this.sourcemapLocations.add(char);
- };
- MagicString$2.prototype.append = function append (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.outro += content;
- return this;
- };
- MagicString$2.prototype.appendLeft = function appendLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.appendLeft(content);
- } else {
- this.intro += content;
- }
- return this;
- };
- MagicString$2.prototype.appendRight = function appendRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.appendRight(content);
- } else {
- this.outro += content;
- }
- return this;
- };
- MagicString$2.prototype.clone = function clone () {
- var cloned = new MagicString$2(this.original, { filename: this.filename });
- var originalChunk = this.firstChunk;
- var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
- while (originalChunk) {
- cloned.byStart[clonedChunk.start] = clonedChunk;
- cloned.byEnd[clonedChunk.end] = clonedChunk;
- var nextOriginalChunk = originalChunk.next;
- var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
- if (nextClonedChunk) {
- clonedChunk.next = nextClonedChunk;
- nextClonedChunk.previous = clonedChunk;
- clonedChunk = nextClonedChunk;
- }
- originalChunk = nextOriginalChunk;
- }
- cloned.lastChunk = clonedChunk;
- if (this.indentExclusionRanges) {
- cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
- }
- cloned.sourcemapLocations = new BitSet$2(this.sourcemapLocations);
- cloned.intro = this.intro;
- cloned.outro = this.outro;
- return cloned;
- };
- MagicString$2.prototype.generateDecodedMap = function generateDecodedMap (options) {
- var this$1 = this;
- options = options || {};
- var sourceIndex = 0;
- var names = Object.keys(this.storedNames);
- var mappings = new Mappings$2(options.hires);
- var locate = getLocator$3(this.original);
- if (this.intro) {
- mappings.advance(this.intro);
- }
- this.firstChunk.eachNext(function (chunk) {
- var loc = locate(chunk.start);
- if (chunk.intro.length) { mappings.advance(chunk.intro); }
- if (chunk.edited) {
- mappings.addEdit(
- sourceIndex,
- chunk.content,
- loc,
- chunk.storeName ? names.indexOf(chunk.original) : -1
- );
- } else {
- mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
- }
- if (chunk.outro.length) { mappings.advance(chunk.outro); }
- });
- return {
- file: options.file ? options.file.split(/[/\\]/).pop() : null,
- sources: [options.source ? getRelativePath$2(options.file || '', options.source) : null],
- sourcesContent: options.includeContent ? [this.original] : [null],
- names: names,
- mappings: mappings.raw
- };
- };
- MagicString$2.prototype.generateMap = function generateMap (options) {
- return new SourceMap$2(this.generateDecodedMap(options));
- };
- MagicString$2.prototype.getIndentString = function getIndentString () {
- return this.indentStr === null ? '\t' : this.indentStr;
- };
- MagicString$2.prototype.indent = function indent (indentStr, options) {
- var pattern = /^[^\r\n]/gm;
- if (isObject$3(indentStr)) {
- options = indentStr;
- indentStr = undefined;
- }
- indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
- if (indentStr === '') { return this; } // noop
- options = options || {};
- // Process exclusion ranges
- var isExcluded = {};
- if (options.exclude) {
- var exclusions =
- typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
- exclusions.forEach(function (exclusion) {
- for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
- isExcluded[i] = true;
- }
- });
- }
- var shouldIndentNextCharacter = options.indentStart !== false;
- var replacer = function (match) {
- if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
- shouldIndentNextCharacter = true;
- return match;
- };
- this.intro = this.intro.replace(pattern, replacer);
- var charIndex = 0;
- var chunk = this.firstChunk;
- while (chunk) {
- var end = chunk.end;
- if (chunk.edited) {
- if (!isExcluded[charIndex]) {
- chunk.content = chunk.content.replace(pattern, replacer);
- if (chunk.content.length) {
- shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
- }
- }
- } else {
- charIndex = chunk.start;
- while (charIndex < end) {
- if (!isExcluded[charIndex]) {
- var char = this.original[charIndex];
- if (char === '\n') {
- shouldIndentNextCharacter = true;
- } else if (char !== '\r' && shouldIndentNextCharacter) {
- shouldIndentNextCharacter = false;
- if (charIndex === chunk.start) {
- chunk.prependRight(indentStr);
- } else {
- this._splitChunk(chunk, charIndex);
- chunk = chunk.next;
- chunk.prependRight(indentStr);
- }
- }
- }
- charIndex += 1;
- }
- }
- charIndex = chunk.end;
- chunk = chunk.next;
- }
- this.outro = this.outro.replace(pattern, replacer);
- return this;
- };
- MagicString$2.prototype.insert = function insert () {
- throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
- };
- MagicString$2.prototype.insertLeft = function insertLeft (index, content) {
- if (!warned$2.insertLeft) {
- console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
- warned$2.insertLeft = true;
- }
- return this.appendLeft(index, content);
- };
- MagicString$2.prototype.insertRight = function insertRight (index, content) {
- if (!warned$2.insertRight) {
- console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
- warned$2.insertRight = true;
- }
- return this.prependRight(index, content);
- };
- MagicString$2.prototype.move = function move (start, end, index) {
- if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
- this._split(start);
- this._split(end);
- this._split(index);
- var first = this.byStart[start];
- var last = this.byEnd[end];
- var oldLeft = first.previous;
- var oldRight = last.next;
- var newRight = this.byStart[index];
- if (!newRight && last === this.lastChunk) { return this; }
- var newLeft = newRight ? newRight.previous : this.lastChunk;
- if (oldLeft) { oldLeft.next = oldRight; }
- if (oldRight) { oldRight.previous = oldLeft; }
- if (newLeft) { newLeft.next = first; }
- if (newRight) { newRight.previous = last; }
- if (!first.previous) { this.firstChunk = last.next; }
- if (!last.next) {
- this.lastChunk = first.previous;
- this.lastChunk.next = null;
- }
- first.previous = newLeft;
- last.next = newRight || null;
- if (!newLeft) { this.firstChunk = first; }
- if (!newRight) { this.lastChunk = last; }
- return this;
- };
- MagicString$2.prototype.overwrite = function overwrite (start, end, content, options) {
- if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (end > this.original.length) { throw new Error('end is out of bounds'); }
- if (start === end)
- { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
- this._split(start);
- this._split(end);
- if (options === true) {
- if (!warned$2.storeName) {
- console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
- warned$2.storeName = true;
- }
- options = { storeName: true };
- }
- var storeName = options !== undefined ? options.storeName : false;
- var contentOnly = options !== undefined ? options.contentOnly : false;
- if (storeName) {
- var original = this.original.slice(start, end);
- this.storedNames[original] = true;
- }
- var first = this.byStart[start];
- var last = this.byEnd[end];
- if (first) {
- if (end > first.end && first.next !== this.byStart[first.end]) {
- throw new Error('Cannot overwrite across a split point');
- }
- first.edit(content, storeName, contentOnly);
- if (first !== last) {
- var chunk = first.next;
- while (chunk !== last) {
- chunk.edit('', false);
- chunk = chunk.next;
- }
- chunk.edit('', false);
- }
- } else {
- // must be inserting at the end
- var newChunk = new Chunk$3(start, end, '').edit(content, storeName);
- // TODO last chunk in the array may not be the last chunk, if it's moved...
- last.next = newChunk;
- newChunk.previous = last;
- }
- return this;
- };
- MagicString$2.prototype.prepend = function prepend (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.intro = content + this.intro;
- return this;
- };
- MagicString$2.prototype.prependLeft = function prependLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.prependLeft(content);
- } else {
- this.intro = content + this.intro;
- }
- return this;
- };
- MagicString$2.prototype.prependRight = function prependRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.prependRight(content);
- } else {
- this.outro = content + this.outro;
- }
- return this;
- };
- MagicString$2.prototype.remove = function remove (start, end) {
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (start === end) { return this; }
- if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
- if (start > end) { throw new Error('end must be greater than start'); }
- this._split(start);
- this._split(end);
- var chunk = this.byStart[start];
- while (chunk) {
- chunk.intro = '';
- chunk.outro = '';
- chunk.edit('');
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
- }
- return this;
- };
- MagicString$2.prototype.lastChar = function lastChar () {
- if (this.outro.length)
- { return this.outro[this.outro.length - 1]; }
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length)
- { return chunk.outro[chunk.outro.length - 1]; }
- if (chunk.content.length)
- { return chunk.content[chunk.content.length - 1]; }
- if (chunk.intro.length)
- { return chunk.intro[chunk.intro.length - 1]; }
- } while (chunk = chunk.previous);
- if (this.intro.length)
- { return this.intro[this.intro.length - 1]; }
- return '';
- };
- MagicString$2.prototype.lastLine = function lastLine () {
- var lineIndex = this.outro.lastIndexOf(n$2);
- if (lineIndex !== -1)
- { return this.outro.substr(lineIndex + 1); }
- var lineStr = this.outro;
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length > 0) {
- lineIndex = chunk.outro.lastIndexOf(n$2);
- if (lineIndex !== -1)
- { return chunk.outro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.outro + lineStr;
- }
- if (chunk.content.length > 0) {
- lineIndex = chunk.content.lastIndexOf(n$2);
- if (lineIndex !== -1)
- { return chunk.content.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.content + lineStr;
- }
- if (chunk.intro.length > 0) {
- lineIndex = chunk.intro.lastIndexOf(n$2);
- if (lineIndex !== -1)
- { return chunk.intro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.intro + lineStr;
- }
- } while (chunk = chunk.previous);
- lineIndex = this.intro.lastIndexOf(n$2);
- if (lineIndex !== -1)
- { return this.intro.substr(lineIndex + 1) + lineStr; }
- return this.intro + lineStr;
- };
- MagicString$2.prototype.slice = function slice (start, end) {
- if ( start === void 0 ) start = 0;
- if ( end === void 0 ) end = this.original.length;
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- var result = '';
- // find start chunk
- var chunk = this.firstChunk;
- while (chunk && (chunk.start > start || chunk.end <= start)) {
- // found end chunk before start
- if (chunk.start < end && chunk.end >= end) {
- return result;
- }
- chunk = chunk.next;
- }
- if (chunk && chunk.edited && chunk.start !== start)
- { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
- var startChunk = chunk;
- while (chunk) {
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
- result += chunk.intro;
- }
- var containsEnd = chunk.start < end && chunk.end >= end;
- if (containsEnd && chunk.edited && chunk.end !== end)
- { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
- var sliceStart = startChunk === chunk ? start - chunk.start : 0;
- var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
- result += chunk.content.slice(sliceStart, sliceEnd);
- if (chunk.outro && (!containsEnd || chunk.end === end)) {
- result += chunk.outro;
- }
- if (containsEnd) {
- break;
- }
- chunk = chunk.next;
- }
- return result;
- };
- // TODO deprecate this? not really very useful
- MagicString$2.prototype.snip = function snip (start, end) {
- var clone = this.clone();
- clone.remove(0, start);
- clone.remove(end, clone.original.length);
- return clone;
- };
- MagicString$2.prototype._split = function _split (index) {
- if (this.byStart[index] || this.byEnd[index]) { return; }
- var chunk = this.lastSearchedChunk;
- var searchForward = index > chunk.end;
- while (chunk) {
- if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
- }
- };
- MagicString$2.prototype._splitChunk = function _splitChunk (chunk, index) {
- if (chunk.edited && chunk.content.length) {
- // zero-length edited chunks are a special case (overlapping replacements)
- var loc = getLocator$3(this.original)(index);
- throw new Error(
- ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
- );
- }
- var newChunk = chunk.split(index);
- this.byEnd[index] = chunk;
- this.byStart[index] = newChunk;
- this.byEnd[newChunk.end] = newChunk;
- if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
- this.lastSearchedChunk = chunk;
- return true;
- };
- MagicString$2.prototype.toString = function toString () {
- var str = this.intro;
- var chunk = this.firstChunk;
- while (chunk) {
- str += chunk.toString();
- chunk = chunk.next;
- }
- return str + this.outro;
- };
- MagicString$2.prototype.isEmpty = function isEmpty () {
- var chunk = this.firstChunk;
- do {
- if (chunk.intro.length && chunk.intro.trim() ||
- chunk.content.length && chunk.content.trim() ||
- chunk.outro.length && chunk.outro.trim())
- { return false; }
- } while (chunk = chunk.next);
- return true;
- };
- MagicString$2.prototype.length = function length () {
- var chunk = this.firstChunk;
- var length = 0;
- do {
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
- } while (chunk = chunk.next);
- return length;
- };
- MagicString$2.prototype.trimLines = function trimLines () {
- return this.trim('[\\r\\n]');
- };
- MagicString$2.prototype.trim = function trim (charType) {
- return this.trimStart(charType).trimEnd(charType);
- };
- MagicString$2.prototype.trimEndAborted = function trimEndAborted (charType) {
- var rx = new RegExp((charType || '\\s') + '+$');
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var chunk = this.lastChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimEnd(rx);
- // if chunk was trimmed, we have a new lastChunk
- if (chunk.end !== end) {
- if (this.lastChunk === chunk) {
- this.lastChunk = chunk.next;
- }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.previous;
- } while (chunk);
- return false;
- };
- MagicString$2.prototype.trimEnd = function trimEnd (charType) {
- this.trimEndAborted(charType);
- return this;
- };
- MagicString$2.prototype.trimStartAborted = function trimStartAborted (charType) {
- var rx = new RegExp('^' + (charType || '\\s') + '+');
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var chunk = this.firstChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimStart(rx);
- if (chunk.end !== end) {
- // special case...
- if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.next;
- } while (chunk);
- return false;
- };
- MagicString$2.prototype.trimStart = function trimStart (charType) {
- this.trimStartAborted(charType);
- return this;
- };
- function parseStyleDocs(styleDocs, styleText) {
- if (typeof styleText !== 'string') {
- return;
- }
- let startIndex;
- while ((startIndex = styleText.indexOf(CSS_DOC_START)) > -1) {
- styleText = styleText.substring(startIndex + CSS_DOC_START.length);
- const endIndex = styleText.indexOf(CSS_DOC_END);
- if (endIndex === -1) {
- break;
- }
- const comment = styleText.substring(0, endIndex);
- parseCssComment(styleDocs, comment);
- styleText = styleText.substring(endIndex + CSS_DOC_END.length);
- }
- }
- function parseCssComment(styleDocs, comment) {
- /**
- * @prop --max-width: Max width of the alert
- */
- const lines = comment.split(/\r?\n/).map((line) => {
- line = line.trim();
- while (line.startsWith('*')) {
- line = line.substring(1).trim();
- }
- return line;
- });
- comment = lines.join(' ').replace(/\t/g, ' ').trim();
- while (comment.includes(' ')) {
- comment = comment.replace(' ', ' ');
- }
- const docs = comment.split(CSS_PROP_ANNOTATION);
- docs.forEach((d) => {
- const doc = d.trim();
- if (!doc.startsWith(`--`)) {
- return;
- }
- const splt = doc.split(`:`);
- const cssDoc = {
- name: splt[0].trim(),
- docs: (splt.shift() && splt.join(`:`)).trim(),
- annotation: 'prop',
- };
- if (!styleDocs.some((c) => c.name === cssDoc.name && c.annotation === 'prop')) {
- styleDocs.push(cssDoc);
- }
- });
- return styleDocs;
- }
- const CSS_DOC_START = `/**`;
- const CSS_DOC_END = `*/`;
- const CSS_PROP_ANNOTATION = `@prop`;
- /**
- * @license
- * Copyright Google Inc. All Rights Reserved.
- *
- * Use of this source code is governed by an MIT-style license that can be
- * found in the LICENSE file at https://angular.io/license
- *
- * This file is a port of shadowCSS from webcomponents.js to TypeScript.
- * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
- * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
- */
- const safeSelector = (selector) => {
- const placeholders = [];
- let index = 0;
- let content;
- // Replaces attribute selectors with placeholders.
- // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator.
- selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
- const replaceBy = `__ph-${index}__`;
- placeholders.push(keep);
- index++;
- return replaceBy;
- });
- // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.
- // WS and "+" would otherwise be interpreted as selector separators.
- content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
- const replaceBy = `__ph-${index}__`;
- placeholders.push(exp);
- index++;
- return pseudo + replaceBy;
- });
- const ss = {
- content,
- placeholders,
- };
- return ss;
- };
- const restoreSafeSelector = (placeholders, content) => {
- return content.replace(/__ph-(\d+)__/g, (_, index) => placeholders[+index]);
- };
- const _polyfillHost = '-shadowcsshost';
- const _polyfillSlotted = '-shadowcssslotted';
- // note: :host-context pre-processed to -shadowcsshostcontext.
- const _polyfillHostContext = '-shadowcsscontext';
- const _parenSuffix = ')(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))?([^,{]*)';
- const _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');
- const _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');
- const _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');
- const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
- const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
- const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
- const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$';
- const _polyfillHostRe = /-shadowcsshost/gim;
- const _colonHostRe = /:host/gim;
- const _colonSlottedRe = /::slotted/gim;
- const _colonHostContextRe = /:host-context/gim;
- const _commentRe = /\/\*\s*[\s\S]*?\*\//g;
- const stripComments = (input) => {
- return input.replace(_commentRe, '');
- };
- const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
- const extractCommentsWithHash = (input) => {
- return input.match(_commentWithHashRe) || [];
- };
- const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
- const _curlyRe = /([{}])/g;
- const _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
- const OPEN_CURLY = '{';
- const CLOSE_CURLY = '}';
- const BLOCK_PLACEHOLDER = '%BLOCK%';
- const processRules = (input, ruleCallback) => {
- const inputWithEscapedBlocks = escapeBlocks(input);
- let nextBlockIndex = 0;
- return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
- const selector = m[2];
- let content = '';
- let suffix = m[4];
- let contentPrefix = '';
- if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {
- content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
- suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
- contentPrefix = '{';
- }
- const cssRule = {
- selector,
- content,
- };
- const rule = ruleCallback(cssRule);
- return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
- });
- };
- const escapeBlocks = (input) => {
- const inputParts = input.split(_curlyRe);
- const resultParts = [];
- const escapedBlocks = [];
- let bracketCount = 0;
- let currentBlockParts = [];
- for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
- const part = inputParts[partIndex];
- if (part === CLOSE_CURLY) {
- bracketCount--;
- }
- if (bracketCount > 0) {
- currentBlockParts.push(part);
- }
- else {
- if (currentBlockParts.length > 0) {
- escapedBlocks.push(currentBlockParts.join(''));
- resultParts.push(BLOCK_PLACEHOLDER);
- currentBlockParts = [];
- }
- resultParts.push(part);
- }
- if (part === OPEN_CURLY) {
- bracketCount++;
- }
- }
- if (currentBlockParts.length > 0) {
- escapedBlocks.push(currentBlockParts.join(''));
- resultParts.push(BLOCK_PLACEHOLDER);
- }
- const strEscapedBlocks = {
- escapedString: resultParts.join(''),
- blocks: escapedBlocks,
- };
- return strEscapedBlocks;
- };
- const insertPolyfillHostInCssText = (selector) => {
- selector = selector
- .replace(_colonHostContextRe, _polyfillHostContext)
- .replace(_colonHostRe, _polyfillHost)
- .replace(_colonSlottedRe, _polyfillSlotted);
- return selector;
- };
- const convertColonRule = (cssText, regExp, partReplacer) => {
- // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule
- return cssText.replace(regExp, (...m) => {
- if (m[2]) {
- const parts = m[2].split(',');
- const r = [];
- for (let i = 0; i < parts.length; i++) {
- const p = parts[i].trim();
- if (!p)
- break;
- r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
- }
- return r.join(',');
- }
- else {
- return _polyfillHostNoCombinator + m[3];
- }
- });
- };
- const colonHostPartReplacer = (host, part, suffix) => {
- return host + part.replace(_polyfillHost, '') + suffix;
- };
- const convertColonHost = (cssText) => {
- return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
- };
- const colonHostContextPartReplacer = (host, part, suffix) => {
- if (part.indexOf(_polyfillHost) > -1) {
- return colonHostPartReplacer(host, part, suffix);
- }
- else {
- return host + part + suffix + ', ' + part + ' ' + host + suffix;
- }
- };
- const convertColonSlotted = (cssText, slotScopeId) => {
- const slotClass = '.' + slotScopeId + ' > ';
- const selectors = [];
- cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
- if (m[2]) {
- const compound = m[2].trim();
- const suffix = m[3];
- const slottedSelector = slotClass + compound + suffix;
- let prefixSelector = '';
- for (let i = m[4] - 1; i >= 0; i--) {
- const char = m[5][i];
- if (char === '}' || char === ',') {
- break;
- }
- prefixSelector = char + prefixSelector;
- }
- const orgSelector = prefixSelector + slottedSelector;
- const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;
- if (orgSelector.trim() !== addedSelector.trim()) {
- const updatedSelector = `${addedSelector}, ${orgSelector}`;
- selectors.push({
- orgSelector,
- updatedSelector,
- });
- }
- return slottedSelector;
- }
- else {
- return _polyfillHostNoCombinator + m[3];
- }
- });
- return {
- selectors,
- cssText,
- };
- };
- const convertColonHostContext = (cssText) => {
- return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
- };
- const convertShadowDOMSelectors = (cssText) => {
- return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);
- };
- const makeScopeMatcher = (scopeSelector) => {
- const lre = /\[/g;
- const rre = /\]/g;
- scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
- return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
- };
- const selectorNeedsScoping = (selector, scopeSelector) => {
- const re = makeScopeMatcher(scopeSelector);
- return !re.test(selector);
- };
- const injectScopingSelector = (selector, scopingSelector) => {
- return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {
- return before + scopingSelector + colon + after;
- });
- };
- const applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {
- // In Android browser, the lastIndex is not reset when the regex is used in String.replace()
- _polyfillHostRe.lastIndex = 0;
- if (_polyfillHostRe.test(selector)) {
- const replaceBy = `.${hostSelector}`;
- return selector
- .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))
- .replace(_polyfillHostRe, replaceBy + ' ');
- }
- return scopeSelector + ' ' + selector;
- };
- const applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {
- const isRe = /\[is=([^\]]*)\]/g;
- scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
- const className = '.' + scopeSelector;
- const _scopeSelectorPart = (p) => {
- let scopedP = p.trim();
- if (!scopedP) {
- return '';
- }
- if (p.indexOf(_polyfillHostNoCombinator) > -1) {
- scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);
- }
- else {
- // remove :host since it should be unnecessary
- const t = p.replace(_polyfillHostRe, '');
- if (t.length > 0) {
- scopedP = injectScopingSelector(t, className);
- }
- }
- return scopedP;
- };
- const safeContent = safeSelector(selector);
- selector = safeContent.content;
- let scopedSelector = '';
- let startIndex = 0;
- let res;
- const sep = /( |>|\+|~(?!=))\s*/g;
- // If a selector appears before :host it should not be shimmed as it
- // matches on ancestor elements and not on elements in the host's shadow
- // `:host-context(div)` is transformed to
- // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`
- // the `div` is not part of the component in the 2nd selectors and should not be scoped.
- // Historically `component-tag:host` was matching the component so we also want to preserve
- // this behavior to avoid breaking legacy apps (it should not match).
- // The behavior should be:
- // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
- // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
- // `:host-context(tag)`)
- const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
- // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
- let shouldScope = !hasHost;
- while ((res = sep.exec(selector)) !== null) {
- const separator = res[1];
- const part = selector.slice(startIndex, res.index).trim();
- shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
- const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
- scopedSelector += `${scopedPart} ${separator} `;
- startIndex = sep.lastIndex;
- }
- const part = selector.substring(startIndex);
- shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
- scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
- // replace the placeholders with their original values
- return restoreSafeSelector(safeContent.placeholders, scopedSelector);
- };
- const scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
- return selector
- .split(',')
- .map((shallowPart) => {
- if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {
- return shallowPart.trim();
- }
- if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
- return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
- }
- else {
- return shallowPart.trim();
- }
- })
- .join(', ');
- };
- const scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
- return processRules(cssText, (rule) => {
- let selector = rule.selector;
- let content = rule.content;
- if (rule.selector[0] !== '@') {
- selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
- }
- else if (rule.selector.startsWith('@media') ||
- rule.selector.startsWith('@supports') ||
- rule.selector.startsWith('@page') ||
- rule.selector.startsWith('@document')) {
- content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);
- }
- const cssRule = {
- selector: selector.replace(/\s{2,}/g, ' ').trim(),
- content,
- };
- return cssRule;
- });
- };
- const scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
- cssText = insertPolyfillHostInCssText(cssText);
- cssText = convertColonHost(cssText);
- cssText = convertColonHostContext(cssText);
- const slotted = convertColonSlotted(cssText, slotScopeId);
- cssText = slotted.cssText;
- cssText = convertShadowDOMSelectors(cssText);
- if (scopeId) {
- cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);
- }
- cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
- cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, ' $1 ');
- return {
- cssText: cssText.trim(),
- slottedSelectors: slotted.selectors,
- };
- };
- const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
- const hostScopeId = scopeId + '-h';
- const slotScopeId = scopeId + '-s';
- const commentsWithHash = extractCommentsWithHash(cssText);
- cssText = stripComments(cssText);
- const orgSelectors = [];
- if (commentOriginalSelector) {
- const processCommentedSelector = (rule) => {
- const placeholder = `/*!@___${orgSelectors.length}___*/`;
- const comment = `/*!@${rule.selector}*/`;
- orgSelectors.push({ placeholder, comment });
- rule.selector = placeholder + rule.selector;
- return rule;
- };
- cssText = processRules(cssText, (rule) => {
- if (rule.selector[0] !== '@') {
- return processCommentedSelector(rule);
- }
- else if (rule.selector.startsWith('@media') ||
- rule.selector.startsWith('@supports') ||
- rule.selector.startsWith('@page') ||
- rule.selector.startsWith('@document')) {
- rule.content = processRules(rule.content, processCommentedSelector);
- return rule;
- }
- return rule;
- });
- }
- const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);
- cssText = [scoped.cssText, ...commentsWithHash].join('\n');
- if (commentOriginalSelector) {
- orgSelectors.forEach(({ placeholder, comment }) => {
- cssText = cssText.replace(placeholder, comment);
- });
- }
- scoped.slottedSelectors.forEach((slottedSelector) => {
- cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);
- });
- return cssText;
- };
- const serializeImportPath = (data, styleImportData) => {
- let p = data.importeePath;
- if (isString$1(p)) {
- if (isString$1(data.importerPath) && isAbsolute$1(data.importeePath)) {
- p = relative$1(dirname(data.importerPath), data.importeePath);
- }
- p = normalizePath$1(p);
- if (!p.startsWith('.')) {
- p = './' + p;
- }
- if (styleImportData === 'queryparams' || styleImportData === undefined) {
- const paramData = {};
- if (isString$1(data.tag)) {
- paramData.tag = data.tag;
- }
- if (isString$1(data.mode) && data.mode !== DEFAULT_STYLE_MODE) {
- paramData.mode = data.mode;
- }
- if (isString$1(data.encapsulation) && data.encapsulation !== 'none') {
- paramData.encapsulation = data.encapsulation;
- }
- const paramEntries = Object.entries(paramData);
- if (paramEntries.length > 0) {
- const params = new URLSearchParams(paramEntries);
- p += '?' + params.toString();
- }
- }
- }
- return p;
- };
- const parseImportPath = (importPath) => {
- const parsedPath = {
- importPath,
- basename: null,
- ext: null,
- data: null,
- };
- if (isString$1(importPath)) {
- const pathParts = importPath.split('?');
- parsedPath.basename = basename(pathParts[0].trim());
- const extParts = parsedPath.basename.toLowerCase().split('.');
- if (extParts.length > 1) {
- parsedPath.ext = extParts[extParts.length - 1];
- if (parsedPath.ext === 'ts' && extParts[extParts.length - 2] === 'd') {
- parsedPath.ext = 'd.ts';
- }
- }
- if (pathParts.length > 1) {
- const params = pathParts[1];
- const urlParams = new URLSearchParams(params);
- const tag = urlParams.get('tag');
- if (tag != null) {
- parsedPath.data = {
- tag,
- encapsulation: urlParams.get('encapsulation') || 'none',
- mode: urlParams.get('mode') || DEFAULT_STYLE_MODE,
- };
- }
- }
- else if (parsedPath.basename.endsWith('.css')) {
- parsedPath.data = {
- encapsulation: 'none',
- };
- }
- }
- return parsedPath;
- };
- const stripCssComments = (input) => {
- let isInsideString = null;
- let currentCharacter = '';
- let returnValue = '';
- for (let i = 0; i < input.length; i++) {
- currentCharacter = input[i];
- if (input[i - 1] !== '\\') {
- if (currentCharacter === '"' || currentCharacter === "'") {
- if (isInsideString === currentCharacter) {
- isInsideString = null;
- }
- else if (!isInsideString) {
- isInsideString = currentCharacter;
- }
- }
- }
- // Find beginning of /* type comment
- if (!isInsideString && currentCharacter === '/' && input[i + 1] === '*') {
- // Ignore important comment when configured to preserve comments using important syntax: /*!
- let j = i + 2;
- // Iterate over comment
- for (; j < input.length; j++) {
- // Find end of comment
- if (input[j] === '*' && input[j + 1] === '/') {
- break;
- }
- }
- // Resume iteration over CSS string from the end of the comment
- i = j + 1;
- continue;
- }
- returnValue += currentCharacter;
- }
- return returnValue;
- };
- const transformCssToEsm = async (input) => {
- const results = transformCssToEsmModule(input);
- const optimizeResults = await optimizeCss$1({
- autoprefixer: input.autoprefixer,
- input: results.styleText,
- filePath: input.file,
- minify: true,
- sourceMap: input.sourceMap,
- });
- results.diagnostics.push(...optimizeResults.diagnostics);
- if (hasError(optimizeResults.diagnostics)) {
- return results;
- }
- results.styleText = optimizeResults.output;
- return generateTransformCssToEsm(input, results);
- };
- const transformCssToEsmSync = (input) => {
- const results = transformCssToEsmModule(input);
- return generateTransformCssToEsm(input, results);
- };
- const transformCssToEsmModule = (input) => {
- const results = {
- styleText: input.input,
- output: '',
- map: null,
- diagnostics: [],
- imports: [],
- defaultVarName: createCssVarName(input.file, input.mode),
- styleDocs: [],
- };
- if (input.docs) {
- parseStyleDocs(results.styleDocs, input.input);
- }
- try {
- const varNames = new Set([results.defaultVarName]);
- if (isString$1(input.tag)) {
- if (input.encapsulation === 'scoped' || (input.encapsulation === 'shadow' && input.commentOriginalSelector)) {
- const scopeId = getScopeId(input.tag, input.mode);
- results.styleText = scopeCss(results.styleText, scopeId, input.commentOriginalSelector);
- }
- }
- const cssImports = getCssToEsmImports(varNames, results.styleText, input.file, input.mode);
- cssImports.forEach((cssImport) => {
- // remove the original css @imports
- results.styleText = results.styleText.replace(cssImport.srcImportText, '');
- const importPath = serializeImportPath({
- importeePath: cssImport.filePath,
- importerPath: input.file,
- tag: input.tag,
- encapsulation: input.encapsulation,
- mode: input.mode,
- }, input.styleImportData);
- // str.append(`import ${cssImport.varName} from '${importPath}';\n`);
- results.imports.push({
- varName: cssImport.varName,
- importPath,
- });
- });
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- return results;
- };
- const generateTransformCssToEsm = (input, results) => {
- const s = new MagicString$2('');
- if (input.module === 'cjs') {
- // CommonJS
- results.imports.forEach((cssImport) => {
- s.append(`const ${cssImport.varName} = require('${cssImport.importPath}');\n`);
- });
- s.append(`const ${results.defaultVarName} = `);
- results.imports.forEach((cssImport) => {
- s.append(`${cssImport.varName} + `);
- });
- s.append(`${JSON.stringify(results.styleText)};\n`);
- s.append(`module.exports = ${results.defaultVarName};`);
- }
- else {
- // ESM
- results.imports.forEach((cssImport) => {
- s.append(`import ${cssImport.varName} from '${cssImport.importPath}';\n`);
- });
- s.append(`const ${results.defaultVarName} = `);
- results.imports.forEach((cssImport) => {
- s.append(`${cssImport.varName} + `);
- });
- s.append(`${JSON.stringify(results.styleText)};\n`);
- s.append(`export default ${results.defaultVarName};`);
- }
- results.output = s.toString();
- return results;
- };
- const getCssToEsmImports = (varNames, cssText, filePath, modeName) => {
- const cssImports = [];
- if (!cssText.includes('@import')) {
- // no @import at all, so don't bother
- return cssImports;
- }
- cssText = stripCssComments(cssText);
- const dir = path$5.dirname(filePath);
- let r;
- while ((r = CSS_IMPORT_RE.exec(cssText))) {
- const cssImportData = {
- srcImportText: r[0],
- url: r[4].replace(/[\"\'\)]/g, ''),
- filePath: null,
- varName: null,
- };
- if (!isLocalCssImport$1(cssImportData.srcImportText)) {
- // do nothing for @import url(http://external.css)
- continue;
- }
- else if (isCssNodeModule$1(cssImportData.url)) {
- // do not resolve this path cuz it starts with node resolve id ~
- continue;
- }
- else if (path$5.isAbsolute(cssImportData.url)) {
- // absolute path already
- cssImportData.filePath = normalizePath$1(cssImportData.url);
- }
- else {
- // relative path
- cssImportData.filePath = normalizePath$1(path$5.resolve(dir, cssImportData.url));
- }
- cssImportData.varName = createCssVarName(cssImportData.filePath, modeName);
- if (varNames.has(cssImportData.varName)) {
- cssImportData.varName += varNames.size;
- }
- varNames.add(cssImportData.varName);
- cssImports.push(cssImportData);
- }
- return cssImports;
- };
- const CSS_IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
- const isCssNodeModule$1 = (url) => {
- return url.startsWith('~');
- };
- const isLocalCssImport$1 = (srcImport) => {
- srcImport = srcImport.toLowerCase();
- if (srcImport.includes('url(')) {
- srcImport = srcImport.replace(/\"/g, '');
- srcImport = srcImport.replace(/\'/g, '');
- srcImport = srcImport.replace(/\s/g, '');
- if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
- return false;
- }
- }
- return true;
- };
- const createCssVarName = (filePath, modeName) => {
- let varName = path$5.basename(filePath);
- if (modeName && modeName !== DEFAULT_STYLE_MODE && !varName.includes(modeName)) {
- varName = modeName + '-' + varName;
- }
- return createJsVarName(varName);
- };
- const createWorkerContext = (sys) => ({
- transformCssToEsm,
- prepareModule,
- optimizeCss: optimizeCss$1,
- prerenderWorker: (prerenderRequest) => prerenderWorker(sys, prerenderRequest),
- });
- const createWorkerMessageHandler = (sys) => {
- const workerCtx = createWorkerContext(sys);
- return (msgToWorker) => {
- const fnName = msgToWorker.args[0];
- const fnArgs = msgToWorker.args.slice(1);
- const fn = workerCtx[fnName];
- if (typeof fn === 'function') {
- return fn.apply(null, fnArgs);
- }
- };
- };
- const initWebWorkerThread = (msgHandler) => {
- let isQueued = false;
- const tick = Promise.resolve();
- const msgsFromWorkerQueue = [];
- const drainMsgQueueFromWorkerToMain = () => {
- isQueued = false;
- self.postMessage(msgsFromWorkerQueue);
- msgsFromWorkerQueue.length = 0;
- };
- const queueMsgFromWorkerToMain = (msgFromWorkerToMain) => {
- msgsFromWorkerQueue.push(msgFromWorkerToMain);
- if (!isQueued) {
- isQueued = true;
- tick.then(drainMsgQueueFromWorkerToMain);
- }
- };
- const error = (stencilMsgId, err) => {
- const errMsgFromWorkerToMain = {
- stencilId: stencilMsgId,
- stencilRtnValue: null,
- stencilRtnError: 'Error',
- };
- if (isString$1(err)) {
- errMsgFromWorkerToMain.stencilRtnError += ': ' + err;
- }
- else if (err) {
- if (err.stack) {
- errMsgFromWorkerToMain.stencilRtnError += ': ' + err.stack;
- }
- else if (err.message) {
- errMsgFromWorkerToMain.stencilRtnError += ': ' + err.message;
- }
- }
- queueMsgFromWorkerToMain(errMsgFromWorkerToMain);
- };
- const receiveMsgFromMainToWorker = async (msgToWorker) => {
- if (msgToWorker && isNumber$1(msgToWorker.stencilId)) {
- try {
- // run the handler to get the data
- const msgFromWorkerToMain = {
- stencilId: msgToWorker.stencilId,
- stencilRtnValue: await msgHandler(msgToWorker),
- stencilRtnError: null,
- };
- queueMsgFromWorkerToMain(msgFromWorkerToMain);
- }
- catch (e) {
- // error occurred while running the task
- error(msgToWorker.stencilId, e);
- }
- }
- };
- self.onmessage = (ev) => {
- // message from the main thread
- const msgsFromMainToWorker = ev.data;
- if (Array.isArray(msgsFromMainToWorker)) {
- for (const msgFromMainToWorker of msgsFromMainToWorker) {
- receiveMsgFromMainToWorker(msgFromMainToWorker);
- }
- }
- };
- self.onerror = (e) => {
- // uncaught error occurred on the worker thread
- error(-1, e);
- };
- };
- class Cache {
- constructor(config, cacheFs) {
- this.config = config;
- this.cacheFs = cacheFs;
- this.failed = 0;
- this.skip = false;
- this.sys = config.sys;
- this.logger = config.logger;
- }
- async initCacheDir() {
- if (this.config._isTesting || !this.config.cacheDir) {
- return;
- }
- if (!this.config.enableCache || !this.cacheFs) {
- this.config.logger.info(`cache optimizations disabled`);
- this.clearDiskCache();
- return;
- }
- this.config.logger.debug(`cache enabled, cacheDir: ${this.config.cacheDir}`);
- try {
- const readmeFilePath = join(this.config.cacheDir, '_README.log');
- await this.cacheFs.writeFile(readmeFilePath, CACHE_DIR_README);
- }
- catch (e) {
- this.logger.error(`Cache, initCacheDir: ${e}`);
- this.config.enableCache = false;
- }
- }
- async get(key) {
- if (!this.config.enableCache || this.skip) {
- return null;
- }
- if (this.failed >= MAX_FAILED) {
- if (!this.skip) {
- this.skip = true;
- this.logger.debug(`cache had ${this.failed} failed ops, skip disk ops for remander of build`);
- }
- return null;
- }
- let result;
- try {
- result = await this.cacheFs.readFile(this.getCacheFilePath(key));
- this.failed = 0;
- this.skip = false;
- }
- catch (e) {
- this.failed++;
- result = null;
- }
- return result;
- }
- async put(key, value) {
- if (!this.config.enableCache) {
- return false;
- }
- let result;
- try {
- await this.cacheFs.writeFile(this.getCacheFilePath(key), value);
- result = true;
- }
- catch (e) {
- this.failed++;
- result = false;
- }
- return result;
- }
- async has(key) {
- const val = await this.get(key);
- return typeof val === 'string';
- }
- async createKey(domain, ...args) {
- if (!this.config.enableCache) {
- return domain + Math.random() * 9999999;
- }
- const hash = await this.sys.generateContentHash(JSON.stringify(args), 32);
- return domain + '_' + hash;
- }
- async commit() {
- if (this.config.enableCache) {
- this.skip = false;
- this.failed = 0;
- await this.cacheFs.commit();
- await this.clearExpiredCache();
- }
- }
- clear() {
- if (this.cacheFs != null) {
- this.cacheFs.clearCache();
- }
- }
- async clearExpiredCache() {
- if (this.cacheFs == null || this.sys.cacheStorage == null) {
- return;
- }
- const now = Date.now();
- const lastClear = (await this.sys.cacheStorage.get(EXP_STORAGE_KEY));
- if (lastClear != null) {
- const diff = now - lastClear;
- if (diff < ONE_DAY) {
- return;
- }
- const fs = this.cacheFs.sys;
- const cachedFileNames = await fs.readDir(this.config.cacheDir);
- const cachedFilePaths = cachedFileNames.map((f) => join(this.config.cacheDir, f));
- let totalCleared = 0;
- const promises = cachedFilePaths.map(async (filePath) => {
- const stat = await fs.stat(filePath);
- const lastModified = stat.mtimeMs;
- const diff = now - lastModified;
- if (diff > ONE_WEEK) {
- await fs.removeFile(filePath);
- totalCleared++;
- }
- });
- await Promise.all(promises);
- this.logger.debug(`clearExpiredCache, cachedFileNames: ${cachedFileNames.length}, totalCleared: ${totalCleared}`);
- }
- this.logger.debug(`clearExpiredCache, set last clear`);
- await this.sys.cacheStorage.set(EXP_STORAGE_KEY, now);
- }
- async clearDiskCache() {
- if (this.cacheFs != null) {
- const hasAccess = await this.cacheFs.access(this.config.cacheDir);
- if (hasAccess) {
- await this.cacheFs.remove(this.config.cacheDir);
- await this.cacheFs.commit();
- }
- }
- }
- getCacheFilePath(key) {
- return join(this.config.cacheDir, key) + '.log';
- }
- getMemoryStats() {
- if (this.cacheFs != null) {
- return this.cacheFs.getMemoryStats();
- }
- return null;
- }
- }
- const MAX_FAILED = 100;
- const ONE_DAY = 1000 * 60 * 60 * 24;
- const ONE_WEEK = ONE_DAY * 7;
- const EXP_STORAGE_KEY = `last_clear_expired_cache`;
- const CACHE_DIR_README = `# Stencil Cache Directory
- This directory contains files which the compiler has
- cached for faster builds. To disable caching, please set
- "enableCache: false" within the stencil config.
- To change the cache directory, please update the
- "cacheDir" property within the stencil config.
- `;
- /**
- * The CompilerCtx is a persistent object that's reused throughout
- * all builds and rebuilds. The data within this object is used
- * for in-memory caching, and can be reset, but the object itself
- * is always the same.
- */
- class CompilerContext {
- constructor() {
- this.version = 2;
- this.activeBuildId = -1;
- this.activeFilesAdded = [];
- this.activeFilesDeleted = [];
- this.activeFilesUpdated = [];
- this.activeDirsAdded = [];
- this.activeDirsDeleted = [];
- this.addWatchDir = noop$1;
- this.addWatchFile = noop$1;
- this.cssModuleImports = new Map();
- this.changedFiles = new Set();
- this.changedModules = new Set();
- this.collections = [];
- this.compilerOptions = null;
- this.events = buildEvents();
- this.hasSuccessfulBuild = false;
- this.isActivelyBuilding = false;
- this.lastBuildResults = null;
- this.moduleMap = new Map();
- this.nodeMap = new WeakMap();
- this.resolvedCollections = new Set();
- this.rollupCache = new Map();
- this.rollupCacheHydrate = null;
- this.rollupCacheLazy = null;
- this.rollupCacheNative = null;
- this.styleModeNames = new Set();
- this.worker = null;
- }
- reset() {
- this.cache.clear();
- this.cssModuleImports.clear();
- this.cachedGlobalStyle = null;
- this.collections.length = 0;
- this.compilerOptions = null;
- this.hasSuccessfulBuild = false;
- this.rollupCacheHydrate = null;
- this.rollupCacheLazy = null;
- this.rollupCacheNative = null;
- this.moduleMap.clear();
- this.resolvedCollections.clear();
- if (this.fs != null) {
- this.fs.clearCache();
- }
- }
- }
- const getModuleLegacy = (_config, compilerCtx, sourceFilePath) => {
- sourceFilePath = normalizePath$1(sourceFilePath);
- const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
- if (moduleFile != null) {
- return moduleFile;
- }
- else {
- const sourceFileDir = dirname(sourceFilePath);
- const sourceFileExt = extname$1(sourceFilePath);
- const sourceFileName = basename(sourceFilePath, sourceFileExt);
- const jsFilePath = join(sourceFileDir, sourceFileName + '.js');
- const moduleFile = {
- sourceFilePath: sourceFilePath,
- jsFilePath: jsFilePath,
- cmps: [],
- coreRuntimeApis: [],
- collectionName: null,
- dtsFilePath: null,
- excludeFromCollection: false,
- externalImports: [],
- hasVdomAttribute: false,
- hasVdomXlink: false,
- hasVdomClass: false,
- hasVdomFunctional: false,
- hasVdomKey: false,
- hasVdomListener: false,
- hasVdomPropOrAttr: false,
- hasVdomRef: false,
- hasVdomRender: false,
- hasVdomStyle: false,
- hasVdomText: false,
- htmlAttrNames: [],
- htmlTagNames: [],
- htmlParts: [],
- isCollectionDependency: false,
- isLegacy: false,
- localImports: [],
- originalCollectionComponentPath: null,
- originalImports: [],
- potentialCmpRefs: [],
- staticSourceFile: null,
- staticSourceFileText: '',
- sourceMapPath: null,
- sourceMapFileText: null,
- };
- compilerCtx.moduleMap.set(sourceFilePath, moduleFile);
- return moduleFile;
- }
- };
- const resetModuleLegacy = (moduleFile) => {
- moduleFile.cmps.length = 0;
- moduleFile.coreRuntimeApis.length = 0;
- moduleFile.collectionName = null;
- moduleFile.dtsFilePath = null;
- moduleFile.excludeFromCollection = false;
- moduleFile.externalImports.length = 0;
- moduleFile.isCollectionDependency = false;
- moduleFile.localImports.length = 0;
- moduleFile.originalCollectionComponentPath = null;
- moduleFile.originalImports.length = 0;
- moduleFile.hasVdomXlink = false;
- moduleFile.hasVdomAttribute = false;
- moduleFile.hasVdomClass = false;
- moduleFile.hasVdomFunctional = false;
- moduleFile.hasVdomKey = false;
- moduleFile.hasVdomListener = false;
- moduleFile.hasVdomRef = false;
- moduleFile.hasVdomRender = false;
- moduleFile.hasVdomStyle = false;
- moduleFile.hasVdomText = false;
- moduleFile.htmlAttrNames.length = 0;
- moduleFile.htmlTagNames.length = 0;
- moduleFile.potentialCmpRefs.length = 0;
- };
- const relativeImport = (pathFrom, pathTo, ext, addPrefix = true) => {
- let relativePath = relative$1(dirname(pathFrom), dirname(pathTo));
- if (addPrefix) {
- if (relativePath === '') {
- relativePath = '.';
- }
- else if (relativePath[0] !== '.') {
- relativePath = './' + relativePath;
- }
- }
- return normalizePath$1(`${relativePath}/${basename(pathTo, ext)}`);
- };
- const getComponentsDtsSrcFilePath = (config) => join(config.srcDir, GENERATED_DTS$1);
- const getComponentsDtsTypesFilePath = (outputTarget) => join(outputTarget.typesDir, GENERATED_DTS$1);
- const isOutputTargetDist = (o) => o.type === DIST;
- const isOutputTargetDistCollection = (o) => o.type === DIST_COLLECTION;
- const isOutputTargetDistCustomElements = (o) => o.type === DIST_CUSTOM_ELEMENTS;
- const isOutputTargetDistCustomElementsBundle = (o) => o.type === DIST_CUSTOM_ELEMENTS_BUNDLE;
- const isOutputTargetCopy = (o) => o.type === COPY;
- const isOutputTargetDistLazy = (o) => o.type === DIST_LAZY;
- const isOutputTargetAngular = (o) => o.type === ANGULAR;
- const isOutputTargetDistLazyLoader = (o) => o.type === DIST_LAZY_LOADER;
- const isOutputTargetDistGlobalStyles = (o) => o.type === DIST_GLOBAL_STYLES;
- const isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
- const isOutputTargetCustom = (o) => o.type === CUSTOM;
- const isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;
- const isOutputTargetDocsReadme = (o) => o.type === DOCS_README;
- const isOutputTargetDocsJson = (o) => o.type === DOCS_JSON;
- const isOutputTargetDocsCustom = (o) => o.type === DOCS_CUSTOM;
- const isOutputTargetDocsVscode = (o) => o.type === DOCS_VSCODE;
- const isOutputTargetWww = (o) => o.type === WWW;
- const isOutputTargetStats = (o) => o.type === STATS;
- const isOutputTargetDistTypes = (o) => o.type === DIST_TYPES;
- const getComponentsFromModules = (moduleFiles) => sortBy(flatOne(moduleFiles.map((m) => m.cmps)), (c) => c.tagName);
- const ANGULAR = `angular`;
- const COPY = 'copy';
- const CUSTOM = `custom`;
- const DIST = `dist`;
- const DIST_COLLECTION = `dist-collection`;
- const DIST_CUSTOM_ELEMENTS = `dist-custom-elements`;
- const DIST_CUSTOM_ELEMENTS_BUNDLE = `dist-custom-elements-bundle`;
- const DIST_TYPES = `dist-types`;
- const DIST_HYDRATE_SCRIPT = `dist-hydrate-script`;
- const DIST_LAZY = `dist-lazy`;
- const DIST_LAZY_LOADER = `dist-lazy-loader`;
- const DIST_GLOBAL_STYLES = 'dist-global-styles';
- const DOCS_CUSTOM = 'docs-custom';
- const DOCS_JSON = `docs-json`;
- const DOCS_README = `docs-readme`;
- const DOCS_VSCODE = `docs-vscode`;
- const STATS = `stats`;
- const WWW = `www`;
- const VALID_TYPES = [
- // DIST
- WWW,
- DIST,
- DIST_COLLECTION,
- DIST_CUSTOM_ELEMENTS,
- DIST_CUSTOM_ELEMENTS_BUNDLE,
- DIST_LAZY,
- DIST_HYDRATE_SCRIPT,
- // DOCS
- DOCS_JSON,
- DOCS_README,
- DOCS_VSCODE,
- DOCS_CUSTOM,
- // MISC
- ANGULAR,
- COPY,
- CUSTOM,
- STATS,
- ];
- const GENERATED_DTS$1 = 'components.d.ts';
- var concatMap$1 = function (xs, fn) {
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- var x = fn(xs[i], i);
- if (isArray$7(x)) res.push.apply(res, x);
- else res.push(x);
- }
- return res;
- };
- var isArray$7 = Array.isArray || function (xs) {
- return Object.prototype.toString.call(xs) === '[object Array]';
- };
- var balancedMatch$1 = balanced$1;
- function balanced$1(a, b, str) {
- if (a instanceof RegExp) a = maybeMatch$1(a, str);
- if (b instanceof RegExp) b = maybeMatch$1(b, str);
- var r = range$1(a, b, str);
- return r && {
- start: r[0],
- end: r[1],
- pre: str.slice(0, r[0]),
- body: str.slice(r[0] + a.length, r[1]),
- post: str.slice(r[1] + b.length)
- };
- }
- function maybeMatch$1(reg, str) {
- var m = str.match(reg);
- return m ? m[0] : null;
- }
- balanced$1.range = range$1;
- function range$1(a, b, str) {
- var begs, beg, left, right, result;
- var ai = str.indexOf(a);
- var bi = str.indexOf(b, ai + 1);
- var i = ai;
- if (ai >= 0 && bi > 0) {
- begs = [];
- left = str.length;
- while (i >= 0 && !result) {
- if (i == ai) {
- begs.push(i);
- ai = str.indexOf(a, i + 1);
- } else if (begs.length == 1) {
- result = [ begs.pop(), bi ];
- } else {
- beg = begs.pop();
- if (beg < left) {
- left = beg;
- right = bi;
- }
- bi = str.indexOf(b, i + 1);
- }
- i = ai < bi && ai >= 0 ? ai : bi;
- }
- if (begs.length) {
- result = [ left, right ];
- }
- }
- return result;
- }
- var braceExpansion$1 = expandTop$1;
- var escSlash$1 = '\0SLASH'+Math.random()+'\0';
- var escOpen$1 = '\0OPEN'+Math.random()+'\0';
- var escClose$1 = '\0CLOSE'+Math.random()+'\0';
- var escComma$1 = '\0COMMA'+Math.random()+'\0';
- var escPeriod$1 = '\0PERIOD'+Math.random()+'\0';
- function numeric$1(str) {
- return parseInt(str, 10) == str
- ? parseInt(str, 10)
- : str.charCodeAt(0);
- }
- function escapeBraces$1(str) {
- return str.split('\\\\').join(escSlash$1)
- .split('\\{').join(escOpen$1)
- .split('\\}').join(escClose$1)
- .split('\\,').join(escComma$1)
- .split('\\.').join(escPeriod$1);
- }
- function unescapeBraces$1(str) {
- return str.split(escSlash$1).join('\\')
- .split(escOpen$1).join('{')
- .split(escClose$1).join('}')
- .split(escComma$1).join(',')
- .split(escPeriod$1).join('.');
- }
- // Basically just str.split(","), but handling cases
- // where we have nested braced sections, which should be
- // treated as individual members, like {a,{b,c},d}
- function parseCommaParts$1(str) {
- if (!str)
- return [''];
- var parts = [];
- var m = balancedMatch$1('{', '}', str);
- if (!m)
- return str.split(',');
- var pre = m.pre;
- var body = m.body;
- var post = m.post;
- var p = pre.split(',');
- p[p.length-1] += '{' + body + '}';
- var postParts = parseCommaParts$1(post);
- if (post.length) {
- p[p.length-1] += postParts.shift();
- p.push.apply(p, postParts);
- }
- parts.push.apply(parts, p);
- return parts;
- }
- function expandTop$1(str) {
- if (!str)
- return [];
- // I don't know why Bash 4.3 does this, but it does.
- // Anything starting with {} will have the first two bytes preserved
- // but *only* at the top level, so {},a}b will not expand to anything,
- // but a{},b}c will be expanded to [a}c,abc].
- // One could argue that this is a bug in Bash, but since the goal of
- // this module is to match Bash's rules, we escape a leading {}
- if (str.substr(0, 2) === '{}') {
- str = '\\{\\}' + str.substr(2);
- }
- return expand$1(escapeBraces$1(str), true).map(unescapeBraces$1);
- }
- function embrace$1(str) {
- return '{' + str + '}';
- }
- function isPadded$1(el) {
- return /^-?0\d/.test(el);
- }
- function lte$1(i, y) {
- return i <= y;
- }
- function gte$1(i, y) {
- return i >= y;
- }
- function expand$1(str, isTop) {
- var expansions = [];
- var m = balancedMatch$1('{', '}', str);
- if (!m || /\$$/.test(m.pre)) return [str];
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
- var isSequence = isNumericSequence || isAlphaSequence;
- var isOptions = m.body.indexOf(',') >= 0;
- if (!isSequence && !isOptions) {
- // {a},b}
- if (m.post.match(/,.*\}/)) {
- str = m.pre + '{' + m.body + escClose$1 + m.post;
- return expand$1(str);
- }
- return [str];
- }
- var n;
- if (isSequence) {
- n = m.body.split(/\.\./);
- } else {
- n = parseCommaParts$1(m.body);
- if (n.length === 1) {
- // x{{a,b}}y ==> x{a}y x{b}y
- n = expand$1(n[0], false).map(embrace$1);
- if (n.length === 1) {
- var post = m.post.length
- ? expand$1(m.post, false)
- : [''];
- return post.map(function(p) {
- return m.pre + n[0] + p;
- });
- }
- }
- }
- // at this point, n is the parts, and we know it's not a comma set
- // with a single entry.
- // no need to expand pre, since it is guaranteed to be free of brace-sets
- var pre = m.pre;
- var post = m.post.length
- ? expand$1(m.post, false)
- : [''];
- var N;
- if (isSequence) {
- var x = numeric$1(n[0]);
- var y = numeric$1(n[1]);
- var width = Math.max(n[0].length, n[1].length);
- var incr = n.length == 3
- ? Math.abs(numeric$1(n[2]))
- : 1;
- var test = lte$1;
- var reverse = y < x;
- if (reverse) {
- incr *= -1;
- test = gte$1;
- }
- var pad = n.some(isPadded$1);
- N = [];
- for (var i = x; test(i, y); i += incr) {
- var c;
- if (isAlphaSequence) {
- c = String.fromCharCode(i);
- if (c === '\\')
- c = '';
- } else {
- c = String(i);
- if (pad) {
- var need = width - c.length;
- if (need > 0) {
- var z = new Array(need + 1).join('0');
- if (i < 0)
- c = '-' + z + c.slice(1);
- else
- c = z + c;
- }
- }
- }
- N.push(c);
- }
- } else {
- N = concatMap$1(n, function(el) { return expand$1(el, false) });
- }
- for (var j = 0; j < N.length; j++) {
- for (var k = 0; k < post.length; k++) {
- var expansion = pre + N[j] + post[k];
- if (!isTop || isSequence || expansion)
- expansions.push(expansion);
- }
- }
- return expansions;
- }
- var minimatch_1$1 = minimatch$1;
- minimatch$1.Minimatch = Minimatch$2;
- var path$1 = { sep: '/' };
- try {
- path$1 = path$4;
- } catch (er) {}
- var GLOBSTAR$1 = minimatch$1.GLOBSTAR = Minimatch$2.GLOBSTAR = {};
- var plTypes$1 = {
- '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
- '?': { open: '(?:', close: ')?' },
- '+': { open: '(?:', close: ')+' },
- '*': { open: '(?:', close: ')*' },
- '@': { open: '(?:', close: ')' }
- };
- // any single thing other than /
- // don't need to escape / when using new RegExp()
- var qmark$1 = '[^/]';
- // * => any number of characters
- var star$1 = qmark$1 + '*?';
- // ** when dots are allowed. Anything goes, except .. and .
- // not (^ or / followed by one or two dots followed by $ or /),
- // followed by anything, any number of times.
- var twoStarDot$1 = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
- // not a ^ or / followed by a dot,
- // followed by anything, any number of times.
- var twoStarNoDot$1 = '(?:(?!(?:\\\/|^)\\.).)*?';
- // characters that need to be escaped in RegExp.
- var reSpecials$1 = charSet$1('().*{}+?[]^$\\!');
- // "abc" -> { a:true, b:true, c:true }
- function charSet$1 (s) {
- return s.split('').reduce(function (set, c) {
- set[c] = true;
- return set
- }, {})
- }
- // normalizes slashes.
- var slashSplit$1 = /\/+/;
- minimatch$1.filter = filter$1;
- function filter$1 (pattern, options) {
- options = options || {};
- return function (p, i, list) {
- return minimatch$1(p, pattern, options)
- }
- }
- function ext$1 (a, b) {
- a = a || {};
- b = b || {};
- var t = {};
- Object.keys(b).forEach(function (k) {
- t[k] = b[k];
- });
- Object.keys(a).forEach(function (k) {
- t[k] = a[k];
- });
- return t
- }
- minimatch$1.defaults = function (def) {
- if (!def || !Object.keys(def).length) return minimatch$1
- var orig = minimatch$1;
- var m = function minimatch (p, pattern, options) {
- return orig.minimatch(p, pattern, ext$1(def, options))
- };
- m.Minimatch = function Minimatch (pattern, options) {
- return new orig.Minimatch(pattern, ext$1(def, options))
- };
- return m
- };
- Minimatch$2.defaults = function (def) {
- if (!def || !Object.keys(def).length) return Minimatch$2
- return minimatch$1.defaults(def).Minimatch
- };
- function minimatch$1 (p, pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('glob pattern string required')
- }
- if (!options) options = {};
- // shortcut: comments match nothing.
- if (!options.nocomment && pattern.charAt(0) === '#') {
- return false
- }
- // "" only matches ""
- if (pattern.trim() === '') return p === ''
- return new Minimatch$2(pattern, options).match(p)
- }
- function Minimatch$2 (pattern, options) {
- if (!(this instanceof Minimatch$2)) {
- return new Minimatch$2(pattern, options)
- }
- if (typeof pattern !== 'string') {
- throw new TypeError('glob pattern string required')
- }
- if (!options) options = {};
- pattern = pattern.trim();
- // windows support: need to use /, not \
- if (path$1.sep !== '/') {
- pattern = pattern.split(path$1.sep).join('/');
- }
- this.options = options;
- this.set = [];
- this.pattern = pattern;
- this.regexp = null;
- this.negate = false;
- this.comment = false;
- this.empty = false;
- // make the set of regexps etc.
- this.make();
- }
- Minimatch$2.prototype.debug = function () {};
- Minimatch$2.prototype.make = make$1;
- function make$1 () {
- // don't do it more than once.
- if (this._made) return
- var pattern = this.pattern;
- var options = this.options;
- // empty patterns and comments match nothing.
- if (!options.nocomment && pattern.charAt(0) === '#') {
- this.comment = true;
- return
- }
- if (!pattern) {
- this.empty = true;
- return
- }
- // step 1: figure out negation, etc.
- this.parseNegate();
- // step 2: expand braces
- var set = this.globSet = this.braceExpand();
- if (options.debug) this.debug = console.error;
- this.debug(this.pattern, set);
- // step 3: now we have a set, so turn each one into a series of path-portion
- // matching patterns.
- // These will be regexps, except in the case of "**", which is
- // set to the GLOBSTAR object for globstar behavior,
- // and will not contain any / characters
- set = this.globParts = set.map(function (s) {
- return s.split(slashSplit$1)
- });
- this.debug(this.pattern, set);
- // glob --> regexps
- set = set.map(function (s, si, set) {
- return s.map(this.parse, this)
- }, this);
- this.debug(this.pattern, set);
- // filter out everything that didn't compile properly.
- set = set.filter(function (s) {
- return s.indexOf(false) === -1
- });
- this.debug(this.pattern, set);
- this.set = set;
- }
- Minimatch$2.prototype.parseNegate = parseNegate$1;
- function parseNegate$1 () {
- var pattern = this.pattern;
- var negate = false;
- var options = this.options;
- var negateOffset = 0;
- if (options.nonegate) return
- for (var i = 0, l = pattern.length
- ; i < l && pattern.charAt(i) === '!'
- ; i++) {
- negate = !negate;
- negateOffset++;
- }
- if (negateOffset) this.pattern = pattern.substr(negateOffset);
- this.negate = negate;
- }
- // Brace expansion:
- // a{b,c}d -> abd acd
- // a{b,}c -> abc ac
- // a{0..3}d -> a0d a1d a2d a3d
- // a{b,c{d,e}f}g -> abg acdfg acefg
- // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
- //
- // Invalid sets are not expanded.
- // a{2..}b -> a{2..}b
- // a{b}c -> a{b}c
- minimatch$1.braceExpand = function (pattern, options) {
- return braceExpand$1(pattern, options)
- };
- Minimatch$2.prototype.braceExpand = braceExpand$1;
- function braceExpand$1 (pattern, options) {
- if (!options) {
- if (this instanceof Minimatch$2) {
- options = this.options;
- } else {
- options = {};
- }
- }
- pattern = typeof pattern === 'undefined'
- ? this.pattern : pattern;
- if (typeof pattern === 'undefined') {
- throw new TypeError('undefined pattern')
- }
- if (options.nobrace ||
- !pattern.match(/\{.*\}/)) {
- // shortcut. no need to expand.
- return [pattern]
- }
- return braceExpansion$1(pattern)
- }
- // parse a component of the expanded set.
- // At this point, no pattern may contain "/" in it
- // so we're going to return a 2d array, where each entry is the full
- // pattern, split on '/', and then turned into a regular expression.
- // A regexp is made at the end which joins each array with an
- // escaped /, and another full one which joins each regexp with |.
- //
- // Following the lead of Bash 4.1, note that "**" only has special meaning
- // when it is the *only* thing in a path portion. Otherwise, any series
- // of * is equivalent to a single *. Globstar behavior is enabled by
- // default, and can be disabled by setting options.noglobstar.
- Minimatch$2.prototype.parse = parse$4;
- var SUBPARSE$1 = {};
- function parse$4 (pattern, isSub) {
- if (pattern.length > 1024 * 64) {
- throw new TypeError('pattern is too long')
- }
- var options = this.options;
- // shortcuts
- if (!options.noglobstar && pattern === '**') return GLOBSTAR$1
- if (pattern === '') return ''
- var re = '';
- var hasMagic = !!options.nocase;
- var escaping = false;
- // ? => one single character
- var patternListStack = [];
- var negativeLists = [];
- var stateChar;
- var inClass = false;
- var reClassStart = -1;
- var classStart = -1;
- // . and .. never match anything that doesn't start with .,
- // even when options.dot is set.
- var patternStart = pattern.charAt(0) === '.' ? '' // anything
- // not (start or / followed by . or .. followed by / or end)
- : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
- : '(?!\\.)';
- var self = this;
- function clearStateChar () {
- if (stateChar) {
- // we had some state-tracking character
- // that wasn't consumed by this pass.
- switch (stateChar) {
- case '*':
- re += star$1;
- hasMagic = true;
- break
- case '?':
- re += qmark$1;
- hasMagic = true;
- break
- default:
- re += '\\' + stateChar;
- break
- }
- self.debug('clearStateChar %j %j', stateChar, re);
- stateChar = false;
- }
- }
- for (var i = 0, len = pattern.length, c
- ; (i < len) && (c = pattern.charAt(i))
- ; i++) {
- this.debug('%s\t%s %s %j', pattern, i, re, c);
- // skip over any that are escaped.
- if (escaping && reSpecials$1[c]) {
- re += '\\' + c;
- escaping = false;
- continue
- }
- switch (c) {
- case '/':
- // completely not allowed, even escaped.
- // Should already be path-split by now.
- return false
- case '\\':
- clearStateChar();
- escaping = true;
- continue
- // the various stateChar values
- // for the "extglob" stuff.
- case '?':
- case '*':
- case '+':
- case '@':
- case '!':
- this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
- // all of those are literals inside a class, except that
- // the glob [!a] means [^a] in regexp
- if (inClass) {
- this.debug(' in class');
- if (c === '!' && i === classStart + 1) c = '^';
- re += c;
- continue
- }
- // if we already have a stateChar, then it means
- // that there was something like ** or +? in there.
- // Handle the stateChar, then proceed with this one.
- self.debug('call clearStateChar %j', stateChar);
- clearStateChar();
- stateChar = c;
- // if extglob is disabled, then +(asdf|foo) isn't a thing.
- // just clear the statechar *now*, rather than even diving into
- // the patternList stuff.
- if (options.noext) clearStateChar();
- continue
- case '(':
- if (inClass) {
- re += '(';
- continue
- }
- if (!stateChar) {
- re += '\\(';
- continue
- }
- patternListStack.push({
- type: stateChar,
- start: i - 1,
- reStart: re.length,
- open: plTypes$1[stateChar].open,
- close: plTypes$1[stateChar].close
- });
- // negation is (?:(?!js)[^/]*)
- re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
- this.debug('plType %j %j', stateChar, re);
- stateChar = false;
- continue
- case ')':
- if (inClass || !patternListStack.length) {
- re += '\\)';
- continue
- }
- clearStateChar();
- hasMagic = true;
- var pl = patternListStack.pop();
- // negation is (?:(?!js)[^/]*)
- // The others are (?:<pattern>)<type>
- re += pl.close;
- if (pl.type === '!') {
- negativeLists.push(pl);
- }
- pl.reEnd = re.length;
- continue
- case '|':
- if (inClass || !patternListStack.length || escaping) {
- re += '\\|';
- escaping = false;
- continue
- }
- clearStateChar();
- re += '|';
- continue
- // these are mostly the same in regexp and glob
- case '[':
- // swallow any state-tracking char before the [
- clearStateChar();
- if (inClass) {
- re += '\\' + c;
- continue
- }
- inClass = true;
- classStart = i;
- reClassStart = re.length;
- re += c;
- continue
- case ']':
- // a right bracket shall lose its special
- // meaning and represent itself in
- // a bracket expression if it occurs
- // first in the list. -- POSIX.2 2.8.3.2
- if (i === classStart + 1 || !inClass) {
- re += '\\' + c;
- escaping = false;
- continue
- }
- // handle the case where we left a class open.
- // "[z-a]" is valid, equivalent to "\[z-a\]"
- if (inClass) {
- // split where the last [ was, make sure we don't have
- // an invalid re. if so, re-walk the contents of the
- // would-be class to re-translate any characters that
- // were passed through as-is
- // TODO: It would probably be faster to determine this
- // without a try/catch and a new RegExp, but it's tricky
- // to do safely. For now, this is safe and works.
- var cs = pattern.substring(classStart + 1, i);
- try {
- RegExp('[' + cs + ']');
- } catch (er) {
- // not a valid class!
- var sp = this.parse(cs, SUBPARSE$1);
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
- hasMagic = hasMagic || sp[1];
- inClass = false;
- continue
- }
- }
- // finish up the class.
- hasMagic = true;
- inClass = false;
- re += c;
- continue
- default:
- // swallow any state char that wasn't consumed
- clearStateChar();
- if (escaping) {
- // no need
- escaping = false;
- } else if (reSpecials$1[c]
- && !(c === '^' && inClass)) {
- re += '\\';
- }
- re += c;
- } // switch
- } // for
- // handle the case where we left a class open.
- // "[abc" is valid, equivalent to "\[abc"
- if (inClass) {
- // split where the last [ was, and escape it
- // this is a huge pita. We now have to re-walk
- // the contents of the would-be class to re-translate
- // any characters that were passed through as-is
- cs = pattern.substr(classStart + 1);
- sp = this.parse(cs, SUBPARSE$1);
- re = re.substr(0, reClassStart) + '\\[' + sp[0];
- hasMagic = hasMagic || sp[1];
- }
- // handle the case where we had a +( thing at the *end*
- // of the pattern.
- // each pattern list stack adds 3 chars, and we need to go through
- // and escape any | chars that were passed through as-is for the regexp.
- // Go through and escape them, taking care not to double-escape any
- // | chars that were already escaped.
- for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
- var tail = re.slice(pl.reStart + pl.open.length);
- this.debug('setting tail', re, pl);
- // maybe some even number of \, then maybe 1 \, followed by a |
- tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
- if (!$2) {
- // the | isn't already escaped, so escape it.
- $2 = '\\';
- }
- // need to escape all those slashes *again*, without escaping the
- // one that we need for escaping the | character. As it works out,
- // escaping an even number of slashes can be done by simply repeating
- // it exactly after itself. That's why this trick works.
- //
- // I am sorry that you have to see this.
- return $1 + $1 + $2 + '|'
- });
- this.debug('tail=%j\n %s', tail, tail, pl, re);
- var t = pl.type === '*' ? star$1
- : pl.type === '?' ? qmark$1
- : '\\' + pl.type;
- hasMagic = true;
- re = re.slice(0, pl.reStart) + t + '\\(' + tail;
- }
- // handle trailing things that only matter at the very end.
- clearStateChar();
- if (escaping) {
- // trailing \\
- re += '\\\\';
- }
- // only need to apply the nodot start if the re starts with
- // something that could conceivably capture a dot
- var addPatternStart = false;
- switch (re.charAt(0)) {
- case '.':
- case '[':
- case '(': addPatternStart = true;
- }
- // Hack to work around lack of negative lookbehind in JS
- // A pattern like: *.!(x).!(y|z) needs to ensure that a name
- // like 'a.xyz.yz' doesn't match. So, the first negative
- // lookahead, has to look ALL the way ahead, to the end of
- // the pattern.
- for (var n = negativeLists.length - 1; n > -1; n--) {
- var nl = negativeLists[n];
- var nlBefore = re.slice(0, nl.reStart);
- var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
- var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
- var nlAfter = re.slice(nl.reEnd);
- nlLast += nlAfter;
- // Handle nested stuff like *(*.js|!(*.json)), where open parens
- // mean that we should *not* include the ) in the bit that is considered
- // "after" the negated section.
- var openParensBefore = nlBefore.split('(').length - 1;
- var cleanAfter = nlAfter;
- for (i = 0; i < openParensBefore; i++) {
- cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
- }
- nlAfter = cleanAfter;
- var dollar = '';
- if (nlAfter === '' && isSub !== SUBPARSE$1) {
- dollar = '$';
- }
- var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
- re = newRe;
- }
- // if the re is not "" at this point, then we need to make sure
- // it doesn't match against an empty path part.
- // Otherwise a/* will match a/, which it should not.
- if (re !== '' && hasMagic) {
- re = '(?=.)' + re;
- }
- if (addPatternStart) {
- re = patternStart + re;
- }
- // parsing just a piece of a larger pattern.
- if (isSub === SUBPARSE$1) {
- return [re, hasMagic]
- }
- // skip the regexp for non-magical patterns
- // unescape anything in it, though, so that it'll be
- // an exact match against a file etc.
- if (!hasMagic) {
- return globUnescape$1(pattern)
- }
- var flags = options.nocase ? 'i' : '';
- try {
- var regExp = new RegExp('^' + re + '$', flags);
- } catch (er) {
- // If it was an invalid regular expression, then it can't match
- // anything. This trick looks for a character after the end of
- // the string, which is of course impossible, except in multi-line
- // mode, but it's not a /m regex.
- return new RegExp('$.')
- }
- regExp._glob = pattern;
- regExp._src = re;
- return regExp
- }
- minimatch$1.makeRe = function (pattern, options) {
- return new Minimatch$2(pattern, options || {}).makeRe()
- };
- Minimatch$2.prototype.makeRe = makeRe$1;
- function makeRe$1 () {
- if (this.regexp || this.regexp === false) return this.regexp
- // at this point, this.set is a 2d array of partial
- // pattern strings, or "**".
- //
- // It's better to use .match(). This function shouldn't
- // be used, really, but it's pretty convenient sometimes,
- // when you just want to work with a regex.
- var set = this.set;
- if (!set.length) {
- this.regexp = false;
- return this.regexp
- }
- var options = this.options;
- var twoStar = options.noglobstar ? star$1
- : options.dot ? twoStarDot$1
- : twoStarNoDot$1;
- var flags = options.nocase ? 'i' : '';
- var re = set.map(function (pattern) {
- return pattern.map(function (p) {
- return (p === GLOBSTAR$1) ? twoStar
- : (typeof p === 'string') ? regExpEscape$1(p)
- : p._src
- }).join('\\\/')
- }).join('|');
- // must match entire pattern
- // ending in a * or ** will make it less strict.
- re = '^(?:' + re + ')$';
- // can match anything, as long as it's not this.
- if (this.negate) re = '^(?!' + re + ').*$';
- try {
- this.regexp = new RegExp(re, flags);
- } catch (ex) {
- this.regexp = false;
- }
- return this.regexp
- }
- minimatch$1.match = function (list, pattern, options) {
- options = options || {};
- var mm = new Minimatch$2(pattern, options);
- list = list.filter(function (f) {
- return mm.match(f)
- });
- if (mm.options.nonull && !list.length) {
- list.push(pattern);
- }
- return list
- };
- Minimatch$2.prototype.match = match$1;
- function match$1 (f, partial) {
- this.debug('match', f, this.pattern);
- // short-circuit in the case of busted things.
- // comments, etc.
- if (this.comment) return false
- if (this.empty) return f === ''
- if (f === '/' && partial) return true
- var options = this.options;
- // windows: need to use /, not \
- if (path$1.sep !== '/') {
- f = f.split(path$1.sep).join('/');
- }
- // treat the test path as a set of pathparts.
- f = f.split(slashSplit$1);
- this.debug(this.pattern, 'split', f);
- // just ONE of the pattern sets in this.set needs to match
- // in order for it to be valid. If negating, then just one
- // match means that we have failed.
- // Either way, return on the first hit.
- var set = this.set;
- this.debug(this.pattern, 'set', set);
- // Find the basename of the path by looking for the last non-empty segment
- var filename;
- var i;
- for (i = f.length - 1; i >= 0; i--) {
- filename = f[i];
- if (filename) break
- }
- for (i = 0; i < set.length; i++) {
- var pattern = set[i];
- var file = f;
- if (options.matchBase && pattern.length === 1) {
- file = [filename];
- }
- var hit = this.matchOne(file, pattern, partial);
- if (hit) {
- if (options.flipNegate) return true
- return !this.negate
- }
- }
- // didn't get any hits. this is success if it's a negative
- // pattern, failure otherwise.
- if (options.flipNegate) return false
- return this.negate
- }
- // set partial to true to test if, for example,
- // "/a/b" matches the start of "/*/b/*/d"
- // Partial means, if you run out of file before you run
- // out of pattern, then that's fine, as long as all
- // the parts match.
- Minimatch$2.prototype.matchOne = function (file, pattern, partial) {
- var options = this.options;
- this.debug('matchOne',
- { 'this': this, file: file, pattern: pattern });
- this.debug('matchOne', file.length, pattern.length);
- for (var fi = 0,
- pi = 0,
- fl = file.length,
- pl = pattern.length
- ; (fi < fl) && (pi < pl)
- ; fi++, pi++) {
- this.debug('matchOne loop');
- var p = pattern[pi];
- var f = file[fi];
- this.debug(pattern, p, f);
- // should be impossible.
- // some invalid regexp stuff in the set.
- if (p === false) return false
- if (p === GLOBSTAR$1) {
- this.debug('GLOBSTAR', [pattern, p, f]);
- // "**"
- // a/**/b/**/c would match the following:
- // a/b/x/y/z/c
- // a/x/y/z/b/c
- // a/b/x/b/x/c
- // a/b/c
- // To do this, take the rest of the pattern after
- // the **, and see if it would match the file remainder.
- // If so, return success.
- // If not, the ** "swallows" a segment, and try again.
- // This is recursively awful.
- //
- // a/**/b/**/c matching a/b/x/y/z/c
- // - a matches a
- // - doublestar
- // - matchOne(b/x/y/z/c, b/**/c)
- // - b matches b
- // - doublestar
- // - matchOne(x/y/z/c, c) -> no
- // - matchOne(y/z/c, c) -> no
- // - matchOne(z/c, c) -> no
- // - matchOne(c, c) yes, hit
- var fr = fi;
- var pr = pi + 1;
- if (pr === pl) {
- this.debug('** at the end');
- // a ** at the end will just swallow the rest.
- // We have found a match.
- // however, it will not swallow /.x, unless
- // options.dot is set.
- // . and .. are *never* matched by **, for explosively
- // exponential reasons.
- for (; fi < fl; fi++) {
- if (file[fi] === '.' || file[fi] === '..' ||
- (!options.dot && file[fi].charAt(0) === '.')) return false
- }
- return true
- }
- // ok, let's see if we can swallow whatever we can.
- while (fr < fl) {
- var swallowee = file[fr];
- this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
- // XXX remove this slice. Just pass the start index.
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
- this.debug('globstar found match!', fr, fl, swallowee);
- // found a match.
- return true
- } else {
- // can't swallow "." or ".." ever.
- // can only swallow ".foo" when explicitly asked.
- if (swallowee === '.' || swallowee === '..' ||
- (!options.dot && swallowee.charAt(0) === '.')) {
- this.debug('dot detected!', file, fr, pattern, pr);
- break
- }
- // ** swallows a segment, and continue.
- this.debug('globstar swallow a segment, and continue');
- fr++;
- }
- }
- // no match was found.
- // However, in partial mode, we can't say this is necessarily over.
- // If there's more *pattern* left, then
- if (partial) {
- // ran out of file
- this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
- if (fr === fl) return true
- }
- return false
- }
- // something other than **
- // non-magic patterns just have to match exactly
- // patterns with magic have been turned into regexps.
- var hit;
- if (typeof p === 'string') {
- if (options.nocase) {
- hit = f.toLowerCase() === p.toLowerCase();
- } else {
- hit = f === p;
- }
- this.debug('string match', p, f, hit);
- } else {
- hit = f.match(p);
- this.debug('pattern match', p, f, hit);
- }
- if (!hit) return false
- }
- // Note: ending in / means that we'll get a final ""
- // at the end of the pattern. This can only match a
- // corresponding "" at the end of the file.
- // If the file ends in /, then it can only match a
- // a pattern that ends in /, unless the pattern just
- // doesn't have any more for it. But, a/b/ should *not*
- // match "a/b/*", even though "" matches against the
- // [^/]*? pattern, except in partial mode, where it might
- // simply not be reached yet.
- // However, a/b/ should still satisfy a/*
- // now either we fell off the end of the pattern, or we're done.
- if (fi === fl && pi === pl) {
- // ran out of pattern and filename at the same time.
- // an exact hit!
- return true
- } else if (fi === fl) {
- // ran out of file, but still had pattern left.
- // this is ok if we're doing the match as part of
- // a glob fs traversal.
- return partial
- } else if (pi === pl) {
- // ran out of pattern, still have file left.
- // this is only acceptable if we're on the very last
- // empty segment of a file with a trailing slash.
- // a/* should match a/b/
- var emptyFileEnd = (fi === fl - 1) && (file[fi] === '');
- return emptyFileEnd
- }
- // should be unreachable.
- throw new Error('wtf?')
- };
- // replace stuff like \* with *
- function globUnescape$1 (s) {
- return s.replace(/\\(.)/g, '$1')
- }
- function regExpEscape$1 (s) {
- return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
- }
- const generateHmr = (config, compilerCtx, buildCtx) => {
- if (config.devServer == null || config.devServer.reloadStrategy == null) {
- return null;
- }
- const hmr = {
- reloadStrategy: config.devServer.reloadStrategy,
- versionId: Date.now().toString().substring(6) + '' + Math.round(Math.random() * 89999 + 10000),
- };
- if (buildCtx.scriptsAdded.length > 0) {
- hmr.scriptsAdded = buildCtx.scriptsAdded.slice();
- }
- if (buildCtx.scriptsDeleted.length > 0) {
- hmr.scriptsDeleted = buildCtx.scriptsDeleted.slice();
- }
- const excludeHmr = excludeHmrFiles(config, config.devServer.excludeHmr, buildCtx.filesChanged);
- if (excludeHmr.length > 0) {
- hmr.excludeHmr = excludeHmr.slice();
- }
- if (buildCtx.hasHtmlChanges) {
- hmr.indexHtmlUpdated = true;
- }
- if (buildCtx.hasServiceWorkerChanges) {
- hmr.serviceWorkerUpdated = true;
- }
- const outputTargetsWww = config.outputTargets.filter(isOutputTargetWww);
- const componentsUpdated = getComponentsUpdated(compilerCtx, buildCtx);
- if (componentsUpdated) {
- hmr.componentsUpdated = componentsUpdated;
- }
- if (Object.keys(buildCtx.stylesUpdated).length > 0) {
- hmr.inlineStylesUpdated = sortBy(buildCtx.stylesUpdated.map((s) => {
- return {
- styleId: getScopeId(s.styleTag, s.styleMode),
- styleTag: s.styleTag,
- styleText: s.styleText,
- };
- }), (s) => s.styleId);
- }
- const externalStylesUpdated = getExternalStylesUpdated(buildCtx, outputTargetsWww);
- if (externalStylesUpdated) {
- hmr.externalStylesUpdated = externalStylesUpdated;
- }
- const externalImagesUpdated = getImagesUpdated(buildCtx, outputTargetsWww);
- if (externalImagesUpdated) {
- hmr.imagesUpdated = externalImagesUpdated;
- }
- return hmr;
- };
- const getComponentsUpdated = (compilerCtx, buildCtx) => {
- // find all of the components that would be affected from the file changes
- if (!buildCtx.filesChanged) {
- return null;
- }
- const filesToLookForImporters = buildCtx.filesChanged.filter((f) => {
- return f.endsWith('.ts') || f.endsWith('.tsx') || f.endsWith('.js') || f.endsWith('.jsx');
- });
- if (filesToLookForImporters.length === 0) {
- return null;
- }
- const changedScriptFiles = [];
- const checkedFiles = new Set();
- const allModuleFiles = buildCtx.moduleFiles.filter((m) => m.localImports && m.localImports.length > 0);
- while (filesToLookForImporters.length > 0) {
- const scriptFile = filesToLookForImporters.shift();
- addTsFileImporters(allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile);
- }
- const tags = changedScriptFiles.reduce((tags, changedTsFile) => {
- const moduleFile = compilerCtx.moduleMap.get(changedTsFile);
- if (moduleFile != null) {
- moduleFile.cmps.forEach((cmp) => {
- if (typeof cmp.tagName === 'string') {
- if (!tags.includes(cmp.tagName)) {
- tags.push(cmp.tagName);
- }
- }
- });
- }
- return tags;
- }, []);
- if (tags.length === 0) {
- return null;
- }
- return tags.sort();
- };
- const addTsFileImporters = (allModuleFiles, filesToLookForImporters, checkedFiles, changedScriptFiles, scriptFile) => {
- if (!changedScriptFiles.includes(scriptFile)) {
- // add it to our list of files to transpile
- changedScriptFiles.push(scriptFile);
- }
- if (checkedFiles.has(scriptFile)) {
- // already checked this file
- return;
- }
- checkedFiles.add(scriptFile);
- // get all the ts files that import this ts file
- const tsFilesThatImportsThisTsFile = allModuleFiles.reduce((arr, moduleFile) => {
- moduleFile.localImports.forEach((localImport) => {
- let checkFile = localImport;
- if (checkFile === scriptFile) {
- arr.push(moduleFile.sourceFilePath);
- return;
- }
- checkFile = localImport + '.tsx';
- if (checkFile === scriptFile) {
- arr.push(moduleFile.sourceFilePath);
- return;
- }
- checkFile = localImport + '.ts';
- if (checkFile === scriptFile) {
- arr.push(moduleFile.sourceFilePath);
- return;
- }
- checkFile = localImport + '.js';
- if (checkFile === scriptFile) {
- arr.push(moduleFile.sourceFilePath);
- return;
- }
- });
- return arr;
- }, []);
- // add all the files that import this ts file to the list of ts files we need to look through
- tsFilesThatImportsThisTsFile.forEach((tsFileThatImportsThisTsFile) => {
- // if we add to this array, then the while look will keep working until it's empty
- filesToLookForImporters.push(tsFileThatImportsThisTsFile);
- });
- };
- const getExternalStylesUpdated = (buildCtx, outputTargetsWww) => {
- if (!buildCtx.isRebuild || outputTargetsWww.length === 0) {
- return null;
- }
- const cssFiles = buildCtx.filesWritten.filter((f) => f.endsWith('.css'));
- if (cssFiles.length === 0) {
- return null;
- }
- return cssFiles.map((cssFile) => basename(cssFile)).sort();
- };
- const getImagesUpdated = (buildCtx, outputTargetsWww) => {
- if (outputTargetsWww.length === 0) {
- return null;
- }
- const imageFiles = buildCtx.filesChanged.reduce((arr, filePath) => {
- if (IMAGE_EXT.some((ext) => filePath.toLowerCase().endsWith(ext))) {
- const fileName = basename(filePath);
- if (!arr.includes(fileName)) {
- arr.push(fileName);
- }
- }
- return arr;
- }, []);
- if (imageFiles.length === 0) {
- return null;
- }
- return imageFiles.sort();
- };
- const excludeHmrFiles = (config, excludeHmr, filesChanged) => {
- const excludeFiles = [];
- if (!excludeHmr || excludeHmr.length === 0) {
- return excludeFiles;
- }
- excludeHmr.forEach((excludeHmr) => {
- return filesChanged
- .map((fileChanged) => {
- let shouldExclude = false;
- if (isGlob(excludeHmr)) {
- shouldExclude = minimatch_1$1(fileChanged, excludeHmr);
- }
- else {
- shouldExclude = normalizePath$1(excludeHmr) === normalizePath$1(fileChanged);
- }
- if (shouldExclude) {
- config.logger.debug(`excludeHmr: ${fileChanged}`);
- excludeFiles.push(basename(fileChanged));
- }
- return shouldExclude;
- })
- .some((r) => r);
- });
- return excludeFiles.sort();
- };
- const IMAGE_EXT = ['.png', '.jpg', '.jpeg', '.gif', '.webp', '.ico', '.svg'];
- /**
- * A new BuildCtx object is created for every build
- * and rebuild.
- */
- class BuildContext {
- constructor(config, compilerCtx) {
- this.buildId = -1;
- this.buildMessages = [];
- this.buildResults = null;
- this.bundleBuildCount = 0;
- this.collections = [];
- this.completedTasks = [];
- this.components = [];
- this.componentGraph = new Map();
- this.data = {};
- this.buildStats = undefined;
- this.diagnostics = [];
- this.dirsAdded = [];
- this.dirsDeleted = [];
- this.entryModules = [];
- this.filesAdded = [];
- this.filesChanged = [];
- this.filesDeleted = [];
- this.filesUpdated = [];
- this.filesWritten = [];
- this.globalStyle = undefined;
- this.hasConfigChanges = false;
- this.hasFinished = false;
- this.hasHtmlChanges = false;
- this.hasPrintedResults = false;
- this.hasServiceWorkerChanges = false;
- this.hasScriptChanges = true;
- this.hasStyleChanges = true;
- this.hydrateAppFilePath = null;
- this.indexBuildCount = 0;
- this.indexDoc = undefined;
- this.isRebuild = false;
- this.moduleFiles = [];
- this.outputs = [];
- this.packageJson = {};
- this.packageJsonFilePath = null;
- this.pendingCopyTasks = [];
- this.requiresFullBuild = true;
- this.scriptsAdded = [];
- this.scriptsDeleted = [];
- this.startTime = Date.now();
- this.styleBuildCount = 0;
- this.stylesPromise = null;
- this.stylesUpdated = [];
- this.timeSpan = null;
- this.transpileBuildCount = 0;
- this.config = config;
- this.compilerCtx = compilerCtx;
- this.buildId = ++this.compilerCtx.activeBuildId;
- this.debug = config.logger.debug.bind(config.logger);
- }
- start() {
- // get the build id from the incremented activeBuildId
- // print out a good message
- const msg = `${this.isRebuild ? 'rebuild' : 'build'}, ${this.config.fsNamespace}, ${this.config.devMode ? 'dev' : 'prod'} mode, started`;
- const buildLog = {
- buildId: this.buildId,
- messages: [],
- progress: 0,
- };
- this.compilerCtx.events.emit('buildLog', buildLog);
- // create a timespan for this build
- this.timeSpan = this.createTimeSpan(msg);
- // create a build timestamp for this build
- this.timestamp = getBuildTimestamp();
- // debug log our new build
- this.debug(`start build, ${this.timestamp}`);
- const buildStart = {
- buildId: this.buildId,
- timestamp: this.timestamp,
- };
- this.compilerCtx.events.emit('buildStart', buildStart);
- }
- createTimeSpan(msg, debug) {
- if (!this.hasFinished || debug) {
- if (debug) {
- if (this.config.watch) {
- msg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${msg}`;
- }
- }
- const timeSpan = this.config.logger.createTimeSpan(msg, debug, this.buildMessages);
- if (!debug && this.compilerCtx.events) {
- const buildLog = {
- buildId: this.buildId,
- messages: this.buildMessages,
- progress: getProgress(this.completedTasks),
- };
- this.compilerCtx.events.emit('buildLog', buildLog);
- }
- return {
- duration: () => {
- return timeSpan.duration();
- },
- finish: (finishedMsg, color, bold, newLineSuffix) => {
- if (!this.hasFinished || debug) {
- if (debug) {
- if (this.config.watch) {
- finishedMsg = `${this.config.logger.cyan('[' + this.buildId + ']')} ${finishedMsg}`;
- }
- }
- timeSpan.finish(finishedMsg, color, bold, newLineSuffix);
- if (!debug) {
- const buildLog = {
- buildId: this.buildId,
- messages: this.buildMessages.slice(),
- progress: getProgress(this.completedTasks),
- };
- this.compilerCtx.events.emit('buildLog', buildLog);
- }
- }
- return timeSpan.duration();
- },
- };
- }
- return {
- duration() {
- return 0;
- },
- finish() {
- return 0;
- },
- };
- }
- debug(msg) {
- this.config.logger.debug(msg);
- }
- get hasError() {
- return hasError(this.diagnostics);
- }
- get hasWarning() {
- return hasWarning(this.diagnostics);
- }
- progress(t) {
- this.completedTasks.push(t);
- }
- async validateTypesBuild() {
- if (this.hasError) {
- // no need to wait on this one since
- // we already aborted this build
- return;
- }
- if (!this.validateTypesPromise) {
- // there is no pending validate types promise
- // so it probably already finished
- // so no need to wait on anything
- return;
- }
- if (!this.config.watch) {
- // this is not a watch build, so we need to make
- // sure that the type validation has finished
- this.debug(`build, non-watch, waiting on validateTypes`);
- await this.validateTypesPromise;
- this.debug(`build, non-watch, finished waiting on validateTypes`);
- }
- }
- }
- const getBuildTimestamp = () => {
- const d = new Date();
- // YYYY-MM-DDThh:mm:ss
- let timestamp = d.getUTCFullYear() + '-';
- timestamp += ('0' + (d.getUTCMonth() + 1)).slice(-2) + '-';
- timestamp += ('0' + d.getUTCDate()).slice(-2) + 'T';
- timestamp += ('0' + d.getUTCHours()).slice(-2) + ':';
- timestamp += ('0' + d.getUTCMinutes()).slice(-2) + ':';
- timestamp += ('0' + d.getUTCSeconds()).slice(-2);
- return timestamp;
- };
- const getProgress = (completedTasks) => {
- let progressIndex = 0;
- const taskKeys = Object.keys(ProgressTask);
- taskKeys.forEach((taskKey, index) => {
- if (completedTasks.includes(ProgressTask[taskKey])) {
- progressIndex = index;
- }
- });
- return (progressIndex + 1) / taskKeys.length;
- };
- const ProgressTask = {
- emptyOutputTargets: {},
- transpileApp: {},
- generateStyles: {},
- generateOutputTargets: {},
- validateTypesBuild: {},
- writeBuildFiles: {},
- };
- const generateBuildResults = (config, compilerCtx, buildCtx) => {
- const componentGraph = buildCtx.componentGraph ? fromEntries(buildCtx.componentGraph.entries()) : undefined;
- const buildResults = {
- buildId: buildCtx.buildId,
- diagnostics: normalizeDiagnostics(compilerCtx, buildCtx.diagnostics),
- dirsAdded: buildCtx.dirsAdded.slice().sort(),
- dirsDeleted: buildCtx.dirsDeleted.slice().sort(),
- duration: Date.now() - buildCtx.startTime,
- filesAdded: buildCtx.filesAdded.slice().sort(),
- filesChanged: buildCtx.filesChanged.slice().sort(),
- filesDeleted: buildCtx.filesDeleted.slice().sort(),
- filesUpdated: buildCtx.filesUpdated.slice().sort(),
- hasError: hasError(buildCtx.diagnostics),
- hasSuccessfulBuild: compilerCtx.hasSuccessfulBuild,
- isRebuild: buildCtx.isRebuild,
- namespace: config.namespace,
- outputs: compilerCtx.fs.getBuildOutputs(),
- rootDir: config.rootDir,
- srcDir: config.srcDir,
- timestamp: getBuildTimestamp(),
- componentGraph,
- };
- const hmr = generateHmr(config, compilerCtx, buildCtx);
- if (hmr != null) {
- buildResults.hmr = hmr;
- }
- if (isString$1(buildCtx.hydrateAppFilePath)) {
- buildResults.hydrateAppFilePath = buildCtx.hydrateAppFilePath;
- }
- compilerCtx.lastBuildResults = Object.assign({}, buildResults);
- return buildResults;
- };
- /**
- * Generates the Build Stats from the buildCtx. Writes any files to the file system.
- * @param config the project build configuration
- * @param buildCtx An instance of the build which holds the details about the build
- * @returns CompilerBuildStats or an Object including diagnostics.
- */
- function generateBuildStats(config, buildCtx) {
- const buildResults = buildCtx.buildResults;
- let jsonData;
- try {
- if (buildResults.hasError) {
- jsonData = {
- diagnostics: buildResults.diagnostics,
- };
- }
- else {
- const stats = {
- timestamp: buildResults.timestamp,
- compiler: {
- name: config.sys.name,
- version: config.sys.version,
- },
- app: {
- namespace: config.namespace,
- fsNamespace: config.fsNamespace,
- components: Object.keys(buildResults.componentGraph).length,
- entries: Object.keys(buildResults.componentGraph).length,
- bundles: buildResults.outputs.reduce((total, en) => total + en.files.length, 0),
- outputs: getAppOutputs(config, buildResults),
- },
- options: {
- minifyJs: config.minifyJs,
- minifyCss: config.minifyCss,
- hashFileNames: config.hashFileNames,
- hashedFileNameLength: config.hashedFileNameLength,
- buildEs5: config.buildEs5,
- },
- formats: {
- esmBrowser: sanitizeBundlesForStats(buildCtx.esmBrowserComponentBundle),
- esm: sanitizeBundlesForStats(buildCtx.esmComponentBundle),
- es5: sanitizeBundlesForStats(buildCtx.es5ComponentBundle),
- system: sanitizeBundlesForStats(buildCtx.systemComponentBundle),
- commonjs: sanitizeBundlesForStats(buildCtx.commonJsComponentBundle),
- },
- components: getComponentsFileMap(config, buildCtx),
- entries: buildCtx.entryModules,
- componentGraph: buildResults.componentGraph,
- sourceGraph: getSourceGraph(config, buildCtx),
- rollupResults: buildCtx.rollupResults,
- collections: getCollections(config, buildCtx),
- };
- jsonData = stats;
- }
- }
- catch (e) {
- const diagnostic = {
- messageText: `Generate Build Stats Error: ` + e,
- level: `error`,
- type: `build`,
- };
- jsonData = {
- diagnostics: [diagnostic],
- };
- }
- return jsonData;
- }
- /**
- * Writes the files from the stats config to the file system
- * @param config the project build configuration
- * @param buildCtx An instance of the build which holds the details about the build
- * @returns
- */
- async function writeBuildStats(config, data) {
- const statsTargets = config.outputTargets.filter(isOutputTargetStats);
- await Promise.all(statsTargets.map(async (outputTarget) => {
- const result = await config.sys.writeFile(outputTarget.file, JSON.stringify(data, null, 2));
- if (result.error) {
- config.logger.warn([`Stats failed to write file to ${outputTarget.file}`]);
- }
- }));
- }
- function sanitizeBundlesForStats(bundleArray) {
- if (!bundleArray) {
- return [];
- }
- return bundleArray.map((bundle) => {
- return {
- key: bundle.entryKey,
- components: bundle.cmps.map((c) => c.tagName),
- bundleId: bundle.output.bundleId,
- fileName: bundle.output.fileName,
- imports: bundle.rollupResult.imports,
- // code: bundle.rollupResult.code, // (use this to debug)
- // Currently, this number is inaccurate vs what seems to be on disk.
- originalByteSize: byteSize(bundle.rollupResult.code),
- };
- });
- }
- function getSourceGraph(config, buildCtx) {
- let sourceGraph = {};
- sortBy(buildCtx.moduleFiles, (m) => m.sourceFilePath).forEach((moduleFile) => {
- const key = relativePath$1(config, moduleFile.sourceFilePath);
- sourceGraph[key] = moduleFile.localImports.map((localImport) => relativePath$1(config, localImport)).sort();
- });
- return sourceGraph;
- }
- function getAppOutputs(config, buildResults) {
- return buildResults.outputs.map((output) => {
- return {
- name: output.type,
- files: output.files.length,
- generatedFiles: output.files.map((file) => relativePath$1(config, file)),
- };
- });
- }
- function getComponentsFileMap(config, buildCtx) {
- return buildCtx.components.map((component) => {
- return {
- tag: component.tagName,
- path: relativePath$1(config, component.jsFilePath),
- source: relativePath$1(config, component.sourceFilePath),
- elementRef: component.elementRef,
- componentClassName: component.componentClassName,
- assetsDirs: component.assetsDirs,
- dependencies: component.dependencies,
- dependents: component.dependents,
- directDependencies: component.directDependencies,
- directDependents: component.directDependents,
- docs: component.docs,
- encapsulation: component.encapsulation,
- excludeFromCollection: component.excludeFromCollection,
- events: component.events,
- internal: component.internal,
- legacyConnect: component.legacyConnect,
- legacyContext: component.legacyContext,
- listeners: component.listeners,
- methods: component.methods,
- potentialCmpRefs: component.potentialCmpRefs,
- properties: component.properties,
- shadowDelegatesFocus: component.shadowDelegatesFocus,
- states: component.states,
- };
- });
- }
- function getCollections(config, buildCtx) {
- return buildCtx.collections
- .map((c) => {
- return {
- name: c.collectionName,
- source: relativePath$1(config, c.moduleDir),
- tags: c.moduleFiles.map((m) => m.cmps.map((cmp) => cmp.tagName)).sort(),
- };
- })
- .sort((a, b) => {
- if (a.name < b.name)
- return -1;
- if (a.name > b.name)
- return 1;
- return 0;
- });
- }
- function relativePath$1(config, file) {
- return config.sys.normalizePath(config.sys.platformPath.relative(config.rootDir, file));
- }
- /**
- * Finish a build as having completed successfully
- * @param buildCtx the build context for the build being aborted
- * @returns the build results
- */
- const buildFinish = async (buildCtx) => {
- const results = await buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, false);
- const buildLog = {
- buildId: buildCtx.buildId,
- messages: buildCtx.buildMessages.slice(),
- progress: 1,
- };
- buildCtx.compilerCtx.events.emit('buildLog', buildLog);
- return results;
- };
- /**
- * Finish a build early due to failure. During the build process, a fatal error has occurred where the compiler cannot
- * continue further
- * @param buildCtx the build context for the build being aborted
- * @returns the build results
- */
- const buildAbort = (buildCtx) => {
- return buildDone(buildCtx.config, buildCtx.compilerCtx, buildCtx, true);
- };
- /**
- * Mark a build as done
- * @param config the Stencil configuration used for the build
- * @param compilerCtx the compiler context associated with the build
- * @param buildCtx the build context associated with the build to mark as done
- * @param aborted true if the build ended early due to failure, false otherwise
- * @returns the build results
- */
- const buildDone = async (config, compilerCtx, buildCtx, aborted) => {
- if (buildCtx.hasFinished && buildCtx.buildResults) {
- // we've already marked this build as finished and
- // already created the build results, just return these
- return buildCtx.buildResults;
- }
- // create the build results data
- buildCtx.buildResults = generateBuildResults(config, compilerCtx, buildCtx);
- // After the build results are available on the buildCtx, call the stats and set it.
- // We will use this later to write the files.
- buildCtx.buildStats = generateBuildStats(config, buildCtx);
- await writeBuildStats(config, buildCtx.buildStats);
- buildCtx.debug(`${aborted ? 'aborted' : 'finished'} build, ${buildCtx.buildResults.duration}ms`);
- // log any errors/warnings
- if (!buildCtx.hasFinished) {
- // haven't set this build as finished yet
- if (!buildCtx.hasPrintedResults) {
- cleanDiagnosticsRelativePath(config, buildCtx.buildResults.diagnostics);
- config.logger.printDiagnostics(buildCtx.buildResults.diagnostics);
- }
- const hasChanges = buildCtx.hasScriptChanges || buildCtx.hasStyleChanges;
- if (buildCtx.isRebuild && hasChanges && buildCtx.buildResults.hmr && !aborted) {
- // this is a rebuild, and we've got hmr data
- // and this build hasn't been aborted
- logHmr(config.logger, buildCtx);
- }
- // create a nice pretty message stating what happened
- const buildText = buildCtx.isRebuild ? 'rebuild' : 'build';
- const watchText = config.watch ? ', watching for changes...' : '';
- let buildStatus = 'finished';
- let statusColor = 'green';
- if (buildCtx.hasError) {
- // gosh darn, build had errors
- // ಥ_ಥ
- buildStatus = 'failed';
- statusColor = 'red';
- }
- else {
- // successful build!
- // ┏(°.°)┛ ┗(°.°)┓ ┗(°.°)┛ ┏(°.°)┓
- compilerCtx.changedFiles.clear();
- compilerCtx.hasSuccessfulBuild = true;
- buildCtx.buildResults.hasSuccessfulBuild = true;
- }
- // print out the time it took to build
- // and add the duration to the build results
- if (!buildCtx.hasPrintedResults) {
- buildCtx.timeSpan.finish(`${buildText} ${buildStatus}${watchText}`, statusColor, true, true);
- buildCtx.hasPrintedResults = true;
- }
- // emit a buildFinish event for anyone who cares
- compilerCtx.events.emit('buildFinish', buildCtx.buildResults);
- // write all of our logs to disk if config'd to do so
- // do this even if there are errors or not the active build
- if (isFunction(config.logger.writeLogs)) {
- config.logger.writeLogs(buildCtx.isRebuild);
- }
- }
- // it's official, this build has finished
- buildCtx.hasFinished = true;
- if (!config.watch) {
- compilerCtx.reset();
- if (IS_NODE_ENV && global.gc) {
- buildCtx.debug(`triggering forced gc`);
- global.gc();
- buildCtx.debug(`forced gc finished`);
- }
- }
- return buildCtx.buildResults;
- };
- const logHmr = (logger, buildCtx) => {
- // this is a rebuild, and we've got hmr data
- // and this build hasn't been aborted
- const hmr = buildCtx.buildResults.hmr;
- if (hmr.componentsUpdated) {
- cleanupUpdateMsg(logger, `updated component`, hmr.componentsUpdated);
- }
- if (hmr.inlineStylesUpdated) {
- const inlineStyles = hmr.inlineStylesUpdated
- .map((s) => s.styleTag)
- .reduce((arr, v) => {
- if (!arr.includes(v)) {
- arr.push(v);
- }
- return arr;
- }, []);
- cleanupUpdateMsg(logger, `updated style`, inlineStyles);
- }
- if (hmr.externalStylesUpdated) {
- cleanupUpdateMsg(logger, `updated stylesheet`, hmr.externalStylesUpdated);
- }
- if (hmr.imagesUpdated) {
- cleanupUpdateMsg(logger, `updated image`, hmr.imagesUpdated);
- }
- };
- const cleanupUpdateMsg = (logger, msg, fileNames) => {
- if (fileNames.length > 0) {
- let fileMsg = '';
- if (fileNames.length > 7) {
- const remaining = fileNames.length - 6;
- fileNames = fileNames.slice(0, 6);
- fileMsg = fileNames.join(', ') + `, +${remaining} others`;
- }
- else {
- fileMsg = fileNames.join(', ');
- }
- if (fileNames.length > 1) {
- msg += 's';
- }
- logger.info(`${msg}: ${logger.cyan(fileMsg)}`);
- }
- };
- /**
- * Update the relative file path for diagnostics. The updates are done in place.
- * @param config the Stencil configuration associated with the current build
- * @param diagnostics the diagnostics to update
- */
- const cleanDiagnosticsRelativePath = (config, diagnostics) => {
- diagnostics.forEach((diagnostic) => {
- if (!diagnostic.relFilePath && !isRemoteUrl(diagnostic.absFilePath) && diagnostic.absFilePath && config.rootDir) {
- diagnostic.relFilePath = relative$1(config.rootDir, diagnostic.absFilePath);
- }
- });
- };
- const CONTENT_REF_ID = 'r';
- const ORG_LOCATION_ID = 'o';
- const SLOT_NODE_ID = 's';
- const TEXT_NODE_ID = 't';
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
- const attrHandler = {
- get(obj, prop) {
- if (prop in obj) {
- return obj[prop];
- }
- if (typeof prop !== 'symbol' && !isNaN(prop)) {
- return obj.__items[prop];
- }
- return undefined;
- },
- };
- const createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
- class MockAttributeMap {
- constructor(caseInsensitive = false) {
- this.caseInsensitive = caseInsensitive;
- this.__items = [];
- }
- get length() {
- return this.__items.length;
- }
- item(index) {
- return this.__items[index] || null;
- }
- setNamedItem(attr) {
- attr.namespaceURI = null;
- this.setNamedItemNS(attr);
- }
- setNamedItemNS(attr) {
- if (attr != null && attr.value != null) {
- attr.value = String(attr.value);
- }
- const existingAttr = this.__items.find((a) => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
- if (existingAttr != null) {
- existingAttr.value = attr.value;
- }
- else {
- this.__items.push(attr);
- }
- }
- getNamedItem(attrName) {
- if (this.caseInsensitive) {
- attrName = attrName.toLowerCase();
- }
- return this.getNamedItemNS(null, attrName);
- }
- getNamedItemNS(namespaceURI, attrName) {
- namespaceURI = getNamespaceURI(namespaceURI);
- return (this.__items.find((attr) => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null);
- }
- removeNamedItem(attr) {
- this.removeNamedItemNS(attr);
- }
- removeNamedItemNS(attr) {
- for (let i = 0, ii = this.__items.length; i < ii; i++) {
- if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
- this.__items.splice(i, 1);
- break;
- }
- }
- }
- [Symbol.iterator]() {
- let i = 0;
- return {
- next: () => ({
- done: i === this.length,
- value: this.item(i++),
- }),
- };
- }
- get [Symbol.toStringTag]() {
- return 'MockAttributeMap';
- }
- }
- function getNamespaceURI(namespaceURI) {
- return namespaceURI === XLINK_NS ? null : namespaceURI;
- }
- function cloneAttributes(srcAttrs, sortByName = false) {
- const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
- if (srcAttrs != null) {
- const attrLen = srcAttrs.length;
- if (sortByName && attrLen > 1) {
- const sortedAttrs = [];
- for (let i = 0; i < attrLen; i++) {
- const srcAttr = srcAttrs.item(i);
- const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
- sortedAttrs.push(dstAttr);
- }
- sortedAttrs.sort(sortAttributes).forEach((attr) => {
- dstAttrs.setNamedItemNS(attr);
- });
- }
- else {
- for (let i = 0; i < attrLen; i++) {
- const srcAttr = srcAttrs.item(i);
- const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
- dstAttrs.setNamedItemNS(dstAttr);
- }
- }
- }
- return dstAttrs;
- }
- function sortAttributes(a, b) {
- if (a.name < b.name)
- return -1;
- if (a.name > b.name)
- return 1;
- return 0;
- }
- class MockAttr {
- constructor(attrName, attrValue, namespaceURI = null) {
- this._name = attrName;
- this._value = String(attrValue);
- this._namespaceURI = namespaceURI;
- }
- get name() {
- return this._name;
- }
- set name(value) {
- this._name = value;
- }
- get value() {
- return this._value;
- }
- set value(value) {
- this._value = String(value);
- }
- get nodeName() {
- return this._name;
- }
- set nodeName(value) {
- this._name = value;
- }
- get nodeValue() {
- return this._value;
- }
- set nodeValue(value) {
- this._value = String(value);
- }
- get namespaceURI() {
- return this._namespaceURI;
- }
- set namespaceURI(namespaceURI) {
- this._namespaceURI = namespaceURI;
- }
- }
- class MockCustomElementRegistry {
- constructor(win) {
- this.win = win;
- }
- define(tagName, cstr, options) {
- if (tagName.toLowerCase() !== tagName) {
- throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`);
- }
- if (this.__registry == null) {
- this.__registry = new Map();
- }
- this.__registry.set(tagName, { cstr, options });
- if (this.__whenDefined != null) {
- const whenDefinedResolveFns = this.__whenDefined.get(tagName);
- if (whenDefinedResolveFns != null) {
- whenDefinedResolveFns.forEach((whenDefinedResolveFn) => {
- whenDefinedResolveFn();
- });
- whenDefinedResolveFns.length = 0;
- this.__whenDefined.delete(tagName);
- }
- }
- const doc = this.win.document;
- if (doc != null) {
- const hosts = doc.querySelectorAll(tagName);
- hosts.forEach((host) => {
- if (upgradedElements.has(host) === false) {
- tempDisableCallbacks.add(doc);
- const upgradedCmp = createCustomElement(this, doc, tagName);
- for (let i = 0; i < host.childNodes.length; i++) {
- const childNode = host.childNodes[i];
- childNode.remove();
- upgradedCmp.appendChild(childNode);
- }
- tempDisableCallbacks.delete(doc);
- if (proxyElements.has(host)) {
- proxyElements.set(host, upgradedCmp);
- }
- }
- fireConnectedCallback(host);
- });
- }
- }
- get(tagName) {
- if (this.__registry != null) {
- const def = this.__registry.get(tagName.toLowerCase());
- if (def != null) {
- return def.cstr;
- }
- }
- return undefined;
- }
- upgrade(_rootNode) {
- //
- }
- clear() {
- if (this.__registry != null) {
- this.__registry.clear();
- }
- if (this.__whenDefined != null) {
- this.__whenDefined.clear();
- }
- }
- whenDefined(tagName) {
- tagName = tagName.toLowerCase();
- if (this.__registry != null && this.__registry.has(tagName) === true) {
- return Promise.resolve(this.__registry.get(tagName).cstr);
- }
- return new Promise((resolve) => {
- if (this.__whenDefined == null) {
- this.__whenDefined = new Map();
- }
- let whenDefinedResolveFns = this.__whenDefined.get(tagName);
- if (whenDefinedResolveFns == null) {
- whenDefinedResolveFns = [];
- this.__whenDefined.set(tagName, whenDefinedResolveFns);
- }
- whenDefinedResolveFns.push(resolve);
- });
- }
- }
- function createCustomElement(customElements, ownerDocument, tagName) {
- const Cstr = customElements.get(tagName);
- if (Cstr != null) {
- const cmp = new Cstr(ownerDocument);
- cmp.nodeName = tagName.toUpperCase();
- upgradedElements.add(cmp);
- return cmp;
- }
- const host = new Proxy({}, {
- get(obj, prop) {
- const elm = proxyElements.get(host);
- if (elm != null) {
- return elm[prop];
- }
- return obj[prop];
- },
- set(obj, prop, val) {
- const elm = proxyElements.get(host);
- if (elm != null) {
- elm[prop] = val;
- }
- else {
- obj[prop] = val;
- }
- return true;
- },
- has(obj, prop) {
- const elm = proxyElements.get(host);
- if (prop in elm) {
- return true;
- }
- if (prop in obj) {
- return true;
- }
- return false;
- },
- });
- const elm = new MockHTMLElement(ownerDocument, tagName);
- proxyElements.set(host, elm);
- return host;
- }
- const proxyElements = new WeakMap();
- const upgradedElements = new WeakSet();
- function connectNode(ownerDocument, node) {
- node.ownerDocument = ownerDocument;
- if (node.nodeType === 1 /* ELEMENT_NODE */) {
- if (ownerDocument != null && node.nodeName.includes('-')) {
- const win = ownerDocument.defaultView;
- if (win != null && typeof node.connectedCallback === 'function' && node.isConnected) {
- fireConnectedCallback(node);
- }
- const shadowRoot = node.shadowRoot;
- if (shadowRoot != null) {
- shadowRoot.childNodes.forEach((childNode) => {
- connectNode(ownerDocument, childNode);
- });
- }
- }
- node.childNodes.forEach((childNode) => {
- connectNode(ownerDocument, childNode);
- });
- }
- else {
- node.childNodes.forEach((childNode) => {
- childNode.ownerDocument = ownerDocument;
- });
- }
- }
- function fireConnectedCallback(node) {
- if (typeof node.connectedCallback === 'function') {
- if (tempDisableCallbacks.has(node.ownerDocument) === false) {
- try {
- node.connectedCallback();
- }
- catch (e) {
- console.error(e);
- }
- }
- }
- }
- function disconnectNode(node) {
- if (node.nodeType === 1 /* ELEMENT_NODE */) {
- if (node.nodeName.includes('-') === true && typeof node.disconnectedCallback === 'function') {
- if (tempDisableCallbacks.has(node.ownerDocument) === false) {
- try {
- node.disconnectedCallback();
- }
- catch (e) {
- console.error(e);
- }
- }
- }
- node.childNodes.forEach(disconnectNode);
- }
- }
- function attributeChanged(node, attrName, oldValue, newValue) {
- attrName = attrName.toLowerCase();
- const observedAttributes = node.constructor.observedAttributes;
- if (Array.isArray(observedAttributes) === true &&
- observedAttributes.some((obs) => obs.toLowerCase() === attrName) === true) {
- try {
- node.attributeChangedCallback(attrName, oldValue, newValue);
- }
- catch (e) {
- console.error(e);
- }
- }
- }
- function checkAttributeChanged(node) {
- return node.nodeName.includes('-') === true && typeof node.attributeChangedCallback === 'function';
- }
- const tempDisableCallbacks = new Set();
- function dataset(elm) {
- const ds = {};
- const attributes = elm.attributes;
- const attrLen = attributes.length;
- for (let i = 0; i < attrLen; i++) {
- const attr = attributes.item(i);
- const nodeName = attr.nodeName;
- if (nodeName.startsWith('data-')) {
- ds[dashToPascalCase(nodeName)] = attr.nodeValue;
- }
- }
- return new Proxy(ds, {
- get(_obj, camelCaseProp) {
- return ds[camelCaseProp];
- },
- set(_obj, camelCaseProp, value) {
- const dataAttr = toDataAttribute(camelCaseProp);
- elm.setAttribute(dataAttr, value);
- return true;
- },
- });
- }
- function toDataAttribute(str) {
- return ('data-' +
- String(str)
- .replace(/([A-Z0-9])/g, (g) => ' ' + g[0])
- .trim()
- .replace(/ /g, '-')
- .toLowerCase());
- }
- function dashToPascalCase(str) {
- str = String(str).slice(5);
- return str
- .split('-')
- .map((segment, index) => {
- if (index === 0) {
- return segment.charAt(0).toLowerCase() + segment.slice(1);
- }
- return segment.charAt(0).toUpperCase() + segment.slice(1);
- })
- .join('');
- }
- // Sizzle 2.3.6
- const Sizzle = (function() {
- const window = {
- document: {
- createElement() {
- return {};
- },
- nodeType: 9,
- documentElement: {
- nodeType: 1,
- nodeName: 'HTML'
- }
- }
- };
- const module = { exports: {} };
- /*! Sizzle v2.3.6 | (c) JS Foundation and other contributors | js.foundation */
- !function(e){var t,n,r,i,o,u,l,a,c,s,d,f,p,h,g,m,y,v,w,b="sizzle"+1*new Date,N=e.document,C=0,x=0,E=ae(),A=ae(),S=ae(),D=ae(),T=function(e,t){return e===t&&(d=!0),0},L={}.hasOwnProperty,q=[],I=q.pop,B=q.push,R=q.push,$=q.slice,k=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",O=new RegExp(M+"+","g"),j=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),G=new RegExp("^"+M+"*,"+M+"*"),U=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),V=new RegExp(M+"|>"),X=new RegExp(F),J=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,W=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f();},ue=ve(function(e){return !0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(q=$.call(N.childNodes),N.childNodes),q[N.childNodes.length].nodeType;}catch(e){R={apply:q.length?function(e,t){B.apply(e,$.call(t));}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1;}};}function le(e,t,r,i){var o,l,c,s,d,h,y,v=t&&t.ownerDocument,N=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==N&&9!==N&&11!==N)return r;if(!i&&(f(t),t=t||p,g)){if(11!==N&&(d=_.exec(e)))if(o=d[1]){if(9===N){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(v&&(c=v.getElementById(o))&&w(t,c)&&c.id===o)return r.push(c),r}else {if(d[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!m||!m.test(e))&&(1!==N||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===N&&(V.test(e)||U.test(e))){(v=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((s=t.getAttribute("id"))?s=s.replace(re,ie):t.setAttribute("id",s=b)),l=(h=u(e)).length;while(l--)h[l]=(s?"#"+s:":scope")+" "+ye(h[l]);y=h.join(",");}try{return R.apply(r,v.querySelectorAll(y)),r}catch(t){D(e,!0);}finally{s===b&&t.removeAttribute("id");}}}return a(e.replace(j,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function ce(e){return e[b]=!0,e}function se(e){var t=p.createElement("fieldset");try{return !!e(t)}catch(e){return !1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null;}}function de(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t;}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return -1;return e?1:-1}function pe(e){return function(t){return "form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ce(function(t){return t=+t,ce(function(n,r){var i,o=e([],n.length,t),u=o.length;while(u--)n[i=o[u]]&&(n[i]=!(r[i]=n[i]));})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return !Q.test(t||n&&n.nodeName||"HTML")},f=le.setDocument=function(e){var t,i,u=e?e.ownerDocument||e:N;return u!=p&&9===u.nodeType&&u.documentElement?(p=u,h=p.documentElement,g=!o(p),N!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=se(function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=se(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=se(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=se(function(e){return h.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return [o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return [o]}return []}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(se(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+M+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]");}),se(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:");})),(n.matchesSelector=Z.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&se(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F);}),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(h.compareDocumentPosition),w=t||Z.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return !0;return !1},T=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==N&&w(N,e)?-1:t==p||t.ownerDocument==N&&w(N,t)?1:s?k(s,e)-k(s,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,u=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:s?k(s,e)-k(s,t):0;if(i===o)return fe(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)l.unshift(n);while(u[r]===l[r])r++;return r?fe(u[r],l[r]):u[r]==N?-1:l[r]==N?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&g&&!D[t+" "]&&(!y||!y.test(t))&&(!m||!m.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0);}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return (e.ownerDocument||e)!=p&&f(e),w(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return (e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,s=!n.sortStable&&e.slice(0),e.sort(T),d){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1);}return s=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e);}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ce,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(O," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return !!e.parentNode}:function(t,n,a){var c,s,d,f,p,h,g=o!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l,w=!1;if(m){if(o){while(g){f=t;while(f=f[g])if(l?f.nodeName.toLowerCase()===y:1===f.nodeType)return !1;h=g="only"===e&&!h&&"nextSibling";}return !0}if(h=[u?m.firstChild:m.lastChild],u&&v){w=(p=(c=(s=(d=(f=m)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1])&&c[2],f=p&&m.childNodes[p];while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if(1===f.nodeType&&++w&&f===t){s[e]=[C,p,w];break}}else if(v&&(w=p=(c=(s=(d=(f=t)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1]),!1===w)while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if((l?f.nodeName.toLowerCase()===y:1===f.nodeType)&&++w&&(v&&((s=(d=f[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[C,w]),f===t))break;return (w-=i)===r||w%r==0&&w/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,n){var r,o=i(e,t),u=o.length;while(u--)e[r=k(e,o[u])]=!(n[r]=o[u]);}):function(e){return i(e,0,n)}):i}},pseudos:{not:ce(function(e){var t=[],n=[],r=l(e.replace(j,"$1"));return r[b]?ce(function(e,t,n,i){var o,u=r(e,null,i,[]),l=e.length;while(l--)(o=u[l])&&(e[l]=!(t[l]=o));}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ce(function(e){return function(t){return le(e,t).length>0}}),contains:ce(function(e){return e=e.replace(te,ne),function(t){return (t.textContent||i(t)).indexOf(e)>-1}}),lang:ce(function(e){return J.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return !0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return [0]}),last:he(function(e,t){return [t-1]}),eq:he(function(e,t,n){return [n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(t);for(t in {submit:!0,reset:!0})r.pseudos[t]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(t);function me(){}me.prototype=r.filters=r.pseudos,r.setFilters=new me,u=le.tokenize=function(e,t){var n,i,o,u,l,a,c,s=A[e+" "];if(s)return t?0:s.slice(0);l=e,a=[],c=r.preFilter;while(l){n&&!(i=G.exec(l))||(i&&(l=l.slice(i[0].length)||l),a.push(o=[])),n=!1,(i=U.exec(l))&&(n=i.shift(),o.push({value:n,type:i[0].replace(j," ")}),l=l.slice(n.length));for(u in r.filter)!(i=K[u].exec(l))||c[u]&&!(i=c[u](i))||(n=i.shift(),o.push({value:n,type:u,matches:i}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):A(e,a).slice(0)};function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=t.next,o=i||r,u=n&&"parentNode"===o,l=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||u)return e(t,n,i);return !1}:function(t,n,a){var c,s,d,f=[C,l];if(a){while(t=t[r])if((1===t.nodeType||u)&&e(t,n,a))return !0}else while(t=t[r])if(1===t.nodeType||u)if(d=t[b]||(t[b]={}),s=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else {if((c=s[o])&&c[0]===C&&c[1]===l)return f[2]=c[2];if(s[o]=f,f[2]=e(t,n,a))return !0}return !1}}function we(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return !1;return !0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)le(e,t[r],n);return n}function Ne(e,t,n,r,i){for(var o,u=[],l=0,a=e.length,c=null!=t;l<a;l++)(o=e[l])&&(n&&!n(o,r,i)||(u.push(o),c&&t.push(l)));return u}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),ce(function(o,u,l,a){var c,s,d,f=[],p=[],h=u.length,g=o||be(t||"*",l.nodeType?[l]:l,[]),m=!e||!o&&t?g:Ne(g,f,e,l,a),y=n?i||(o?e:h||r)?[]:u:m;if(n&&n(m,y,l,a),r){c=Ne(y,p),r(c,[],l,a),s=c.length;while(s--)(d=c[s])&&(y[p[s]]=!(m[p[s]]=d));}if(o){if(i||e){if(i){c=[],s=y.length;while(s--)(d=y[s])&&c.push(m[s]=d);i(null,y=[],c,a);}s=y.length;while(s--)(d=y[s])&&(c=i?k(o,d):f[s])>-1&&(o[c]=!(u[c]=d));}}else y=Ne(y===u?y.splice(h,y.length):y),i?i(null,u,y,a):R.apply(u,y);})}function xe(e){for(var t,n,i,o=e.length,u=r.relative[e[0].type],l=u||r.relative[" "],a=u?1:0,s=ve(function(e){return e===t},l,!0),d=ve(function(e){return k(t,e)>-1},l,!0),f=[function(e,n,r){var i=!u&&(r||n!==c)||((t=n).nodeType?s(e,n,r):d(e,n,r));return t=null,i}];a<o;a++)if(n=r.relative[e[a].type])f=[ve(we(f),n)];else {if((n=r.filter[e[a].type].apply(null,e[a].matches))[b]){for(i=++a;i<o;i++)if(r.relative[e[i].type])break;return Ce(a>1&&we(f),a>1&&ye(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(j,"$1"),n,a<i&&xe(e.slice(a,i)),i<o&&xe(e=e.slice(i)),i<o&&ye(e))}f.push(n);}return we(f)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,u,l,a,s){var d,h,m,y=0,v="0",w=o&&[],b=[],N=c,x=o||i&&r.find.TAG("*",s),E=C+=null==N?1:Math.random()||.1,A=x.length;for(s&&(c=u==p||u||s);v!==A&&null!=(d=x[v]);v++){if(i&&d){h=0,u||d.ownerDocument==p||(f(d),l=!g);while(m=e[h++])if(m(d,u||p,l)){a.push(d);break}s&&(C=E);}n&&((d=!m&&d)&&y--,o&&w.push(d));}if(y+=v,n&&v!==y){h=0;while(m=t[h++])m(w,b,u,l);if(o){if(y>0)while(v--)w[v]||b[v]||(b[v]=I.call(a));b=Ne(b);}R.apply(a,b),s&&!o&&b.length>0&&y+t.length>1&&le.uniqueSort(a);}return s&&(C=E,c=N),w};return n?ce(o):o}l=le.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=u(e)),n=t.length;while(n--)(o=xe(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e;}return o},a=le.select=function(e,t,n,i){var o,a,c,s,d,f="function"==typeof e&&e,p=!i&&u(e=f.selector||e);if(n=n||[],1===p.length){if((a=p[0]=p[0].slice(0)).length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&g&&r.relative[a[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(a.shift().value.length);}o=K.needsContext.test(e)?0:a.length;while(o--){if(c=a[o],r.relative[s=c.type])break;if((d=r.find[s])&&(i=d(c.matches[0].replace(te,ne),ee.test(a[0].type)&&ge(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&ye(a)))return R.apply(n,i),n;break}}}return (f||l(e,p))(i,t,!g,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(T).join("")===b,n.detectDuplicates=!!d,f(),n.sortDetached=se(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),se(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&se(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),se(function(e){return null==e.getAttribute("disabled")})||de(H,function(e,t,n){var r;if(!n)return !0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ae=e.Sizzle;le.noConflict=function(){return e.Sizzle===le&&(e.Sizzle=Ae),le},"function"==typeof define&&define.amd?define(function(){return le}):"undefined"!=typeof module&&module.exports?module.exports=le:e.Sizzle=le;}(window);
- //# sourceMappingURL=sizzle.min.map
- return module.exports;
- })();
- function matches(selector, elm) {
- const r = Sizzle.matches(selector, [elm]);
- return r.length > 0;
- }
- function selectOne(selector, elm) {
- const r = Sizzle(selector, elm);
- return r[0] || null;
- }
- function selectAll(selector, elm) {
- return Sizzle(selector, elm);
- }
- class MockClassList {
- constructor(elm) {
- this.elm = elm;
- }
- add(...classNames) {
- const clsNames = getItems(this.elm);
- let updated = false;
- classNames.forEach((className) => {
- className = String(className);
- validateClass(className);
- if (clsNames.includes(className) === false) {
- clsNames.push(className);
- updated = true;
- }
- });
- if (updated) {
- this.elm.setAttributeNS(null, 'class', clsNames.join(' '));
- }
- }
- remove(...classNames) {
- const clsNames = getItems(this.elm);
- let updated = false;
- classNames.forEach((className) => {
- className = String(className);
- validateClass(className);
- const index = clsNames.indexOf(className);
- if (index > -1) {
- clsNames.splice(index, 1);
- updated = true;
- }
- });
- if (updated) {
- this.elm.setAttributeNS(null, 'class', clsNames.filter((c) => c.length > 0).join(' '));
- }
- }
- contains(className) {
- className = String(className);
- return getItems(this.elm).includes(className);
- }
- toggle(className) {
- className = String(className);
- if (this.contains(className) === true) {
- this.remove(className);
- }
- else {
- this.add(className);
- }
- }
- get length() {
- return getItems(this.elm).length;
- }
- item(index) {
- return getItems(this.elm)[index];
- }
- toString() {
- return getItems(this.elm).join(' ');
- }
- }
- function validateClass(className) {
- if (className === '') {
- throw new Error('The token provided must not be empty.');
- }
- if (/\s/.test(className)) {
- throw new Error(`The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`);
- }
- }
- function getItems(elm) {
- const className = elm.getAttribute('class');
- if (typeof className === 'string' && className.length > 0) {
- return className
- .trim()
- .split(' ')
- .filter((c) => c.length > 0);
- }
- return [];
- }
- class MockCSSStyleDeclaration {
- constructor() {
- this._styles = new Map();
- }
- setProperty(prop, value) {
- prop = jsCaseToCssCase(prop);
- if (value == null || value === '') {
- this._styles.delete(prop);
- }
- else {
- this._styles.set(prop, String(value));
- }
- }
- getPropertyValue(prop) {
- prop = jsCaseToCssCase(prop);
- return String(this._styles.get(prop) || '');
- }
- removeProperty(prop) {
- prop = jsCaseToCssCase(prop);
- this._styles.delete(prop);
- }
- get length() {
- return this._styles.size;
- }
- get cssText() {
- const cssText = [];
- this._styles.forEach((value, prop) => {
- cssText.push(`${prop}: ${value};`);
- });
- return cssText.join(' ').trim();
- }
- set cssText(cssText) {
- if (cssText == null || cssText === '') {
- this._styles.clear();
- return;
- }
- cssText.split(';').forEach((rule) => {
- rule = rule.trim();
- if (rule.length > 0) {
- const splt = rule.split(':');
- if (splt.length > 1) {
- const prop = splt[0].trim();
- const value = splt.slice(1).join(':').trim();
- if (prop !== '' && value !== '') {
- this._styles.set(jsCaseToCssCase(prop), value);
- }
- }
- }
- });
- }
- }
- function createCSSStyleDeclaration() {
- return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
- }
- const cssProxyHandler = {
- get(cssStyle, prop) {
- if (prop in cssStyle) {
- return cssStyle[prop];
- }
- prop = cssCaseToJsCase(prop);
- return cssStyle.getPropertyValue(prop);
- },
- set(cssStyle, prop, value) {
- if (prop in cssStyle) {
- cssStyle[prop] = value;
- }
- else {
- cssStyle.setProperty(prop, value);
- }
- return true;
- },
- };
- function cssCaseToJsCase(str) {
- // font-size to fontSize
- if (str.length > 1 && str.includes('-') === true) {
- str = str
- .toLowerCase()
- .split('-')
- .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
- .join('');
- str = str.slice(0, 1).toLowerCase() + str.slice(1);
- }
- return str;
- }
- function jsCaseToCssCase(str) {
- // fontSize to font-size
- if (str.length > 1 && str.includes('-') === false && /[A-Z]/.test(str) === true) {
- str = str
- .replace(/([A-Z])/g, (g) => ' ' + g[0])
- .trim()
- .replace(/ /g, '-')
- .toLowerCase();
- }
- return str;
- }
- class MockEvent {
- constructor(type, eventInitDict) {
- this.bubbles = false;
- this.cancelBubble = false;
- this.cancelable = false;
- this.composed = false;
- this.currentTarget = null;
- this.defaultPrevented = false;
- this.srcElement = null;
- this.target = null;
- if (typeof type !== 'string') {
- throw new Error(`Event type required`);
- }
- this.type = type;
- this.timeStamp = Date.now();
- if (eventInitDict != null) {
- Object.assign(this, eventInitDict);
- }
- }
- preventDefault() {
- this.defaultPrevented = true;
- }
- stopPropagation() {
- this.cancelBubble = true;
- }
- stopImmediatePropagation() {
- this.cancelBubble = true;
- }
- composedPath() {
- const composedPath = [];
- let currentElement = this.target;
- while (currentElement) {
- composedPath.push(currentElement);
- if (!currentElement.parentElement && currentElement.nodeName === "#document" /* DOCUMENT_NODE */) {
- // the current element doesn't have a parent, but we've detected it's our root document node. push the window
- // object associated with the document onto the path
- composedPath.push(currentElement.defaultView);
- break;
- }
- currentElement = currentElement.parentElement;
- }
- return composedPath;
- }
- }
- class MockCustomEvent extends MockEvent {
- constructor(type, customEventInitDic) {
- super(type);
- this.detail = null;
- if (customEventInitDic != null) {
- Object.assign(this, customEventInitDic);
- }
- }
- }
- class MockKeyboardEvent extends MockEvent {
- constructor(type, keyboardEventInitDic) {
- super(type);
- this.code = '';
- this.key = '';
- this.altKey = false;
- this.ctrlKey = false;
- this.metaKey = false;
- this.shiftKey = false;
- this.location = 0;
- this.repeat = false;
- if (keyboardEventInitDic != null) {
- Object.assign(this, keyboardEventInitDic);
- }
- }
- }
- class MockMouseEvent extends MockEvent {
- constructor(type, mouseEventInitDic) {
- super(type);
- this.screenX = 0;
- this.screenY = 0;
- this.clientX = 0;
- this.clientY = 0;
- this.ctrlKey = false;
- this.shiftKey = false;
- this.altKey = false;
- this.metaKey = false;
- this.button = 0;
- this.buttons = 0;
- this.relatedTarget = null;
- if (mouseEventInitDic != null) {
- Object.assign(this, mouseEventInitDic);
- }
- }
- }
- class MockEventListener {
- constructor(type, handler) {
- this.type = type;
- this.handler = handler;
- }
- }
- function addEventListener(elm, type, handler) {
- const target = elm;
- if (target.__listeners == null) {
- target.__listeners = [];
- }
- target.__listeners.push(new MockEventListener(type, handler));
- }
- function removeEventListener(elm, type, handler) {
- const target = elm;
- if (target != null && Array.isArray(target.__listeners) === true) {
- const elmListener = target.__listeners.find((e) => e.type === type && e.handler === handler);
- if (elmListener != null) {
- const index = target.__listeners.indexOf(elmListener);
- target.__listeners.splice(index, 1);
- }
- }
- }
- function resetEventListeners(target) {
- if (target != null && target.__listeners != null) {
- target.__listeners = null;
- }
- }
- function triggerEventListener(elm, ev) {
- if (elm == null || ev.cancelBubble === true) {
- return;
- }
- const target = elm;
- ev.currentTarget = elm;
- if (Array.isArray(target.__listeners) === true) {
- const listeners = target.__listeners.filter((e) => e.type === ev.type);
- listeners.forEach((listener) => {
- try {
- listener.handler.call(target, ev);
- }
- catch (err) {
- console.error(err);
- }
- });
- }
- if (ev.bubbles === false) {
- return;
- }
- if (elm.nodeName === "#document" /* DOCUMENT_NODE */) {
- triggerEventListener(elm.defaultView, ev);
- }
- else {
- triggerEventListener(elm.parentElement, ev);
- }
- }
- function dispatchEvent(currentTarget, ev) {
- ev.target = currentTarget;
- triggerEventListener(currentTarget, ev);
- return true;
- }
- function serializeNodeToHtml(elm, opts = {}) {
- const output = {
- currentLineWidth: 0,
- indent: 0,
- isWithinBody: false,
- text: [],
- };
- if (opts.prettyHtml) {
- if (typeof opts.indentSpaces !== 'number') {
- opts.indentSpaces = 2;
- }
- if (typeof opts.newLines !== 'boolean') {
- opts.newLines = true;
- }
- opts.approximateLineWidth = -1;
- }
- else {
- opts.prettyHtml = false;
- if (typeof opts.newLines !== 'boolean') {
- opts.newLines = false;
- }
- if (typeof opts.indentSpaces !== 'number') {
- opts.indentSpaces = 0;
- }
- }
- if (typeof opts.approximateLineWidth !== 'number') {
- opts.approximateLineWidth = -1;
- }
- if (typeof opts.removeEmptyAttributes !== 'boolean') {
- opts.removeEmptyAttributes = true;
- }
- if (typeof opts.removeAttributeQuotes !== 'boolean') {
- opts.removeAttributeQuotes = false;
- }
- if (typeof opts.removeBooleanAttributeQuotes !== 'boolean') {
- opts.removeBooleanAttributeQuotes = false;
- }
- if (typeof opts.removeHtmlComments !== 'boolean') {
- opts.removeHtmlComments = false;
- }
- if (typeof opts.serializeShadowRoot !== 'boolean') {
- opts.serializeShadowRoot = false;
- }
- if (opts.outerHtml) {
- serializeToHtml(elm, opts, output, false);
- }
- else {
- for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
- serializeToHtml(elm.childNodes[i], opts, output, false);
- }
- }
- if (output.text[0] === '\n') {
- output.text.shift();
- }
- if (output.text[output.text.length - 1] === '\n') {
- output.text.pop();
- }
- return output.text.join('');
- }
- function serializeToHtml(node, opts, output, isShadowRoot) {
- if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
- const tagName = isShadowRoot ? 'mock:shadow-root' : getTagName(node);
- if (tagName === 'body') {
- output.isWithinBody = true;
- }
- const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
- if (ignoreTag === false) {
- const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
- if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
- for (let i = 0; i < output.indent; i++) {
- output.text.push(' ');
- }
- output.currentLineWidth += output.indent;
- }
- output.text.push('<' + tagName);
- output.currentLineWidth += tagName.length + 1;
- const attrsLength = node.attributes.length;
- const attributes = opts.prettyHtml && attrsLength > 1
- ? cloneAttributes(node.attributes, true)
- : node.attributes;
- for (let i = 0; i < attrsLength; i++) {
- const attr = attributes.item(i);
- const attrName = attr.name;
- if (attrName === 'style') {
- continue;
- }
- let attrValue = attr.value;
- if (opts.removeEmptyAttributes && attrValue === '' && REMOVE_EMPTY_ATTR.has(attrName)) {
- continue;
- }
- const attrNamespaceURI = attr.namespaceURI;
- if (attrNamespaceURI == null) {
- output.currentLineWidth += attrName.length + 1;
- if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
- output.text.push('\n' + attrName);
- output.currentLineWidth = 0;
- }
- else {
- output.text.push(' ' + attrName);
- }
- }
- else if (attrNamespaceURI === 'http://www.w3.org/XML/1998/namespace') {
- output.text.push(' xml:' + attrName);
- output.currentLineWidth += attrName.length + 5;
- }
- else if (attrNamespaceURI === 'http://www.w3.org/2000/xmlns/') {
- if (attrName !== 'xmlns') {
- output.text.push(' xmlns:' + attrName);
- output.currentLineWidth += attrName.length + 7;
- }
- else {
- output.text.push(' ' + attrName);
- output.currentLineWidth += attrName.length + 1;
- }
- }
- else if (attrNamespaceURI === XLINK_NS) {
- output.text.push(' xlink:' + attrName);
- output.currentLineWidth += attrName.length + 7;
- }
- else {
- output.text.push(' ' + attrNamespaceURI + ':' + attrName);
- output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
- }
- if (opts.prettyHtml && attrName === 'class') {
- attrValue = attr.value = attrValue
- .split(' ')
- .filter((t) => t !== '')
- .sort()
- .join(' ')
- .trim();
- }
- if (attrValue === '') {
- if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
- continue;
- }
- if (opts.removeEmptyAttributes && attrName.startsWith('data-')) {
- continue;
- }
- }
- if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
- output.text.push('=' + escapeString(attrValue, true));
- output.currentLineWidth += attrValue.length + 1;
- }
- else {
- output.text.push('="' + escapeString(attrValue, true) + '"');
- output.currentLineWidth += attrValue.length + 3;
- }
- }
- if (node.hasAttribute('style')) {
- const cssText = node.style.cssText;
- if (opts.approximateLineWidth > 0 &&
- output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
- output.text.push(`\nstyle="${cssText}">`);
- output.currentLineWidth = 0;
- }
- else {
- output.text.push(` style="${cssText}">`);
- output.currentLineWidth += cssText.length + 10;
- }
- }
- else {
- output.text.push('>');
- output.currentLineWidth += 1;
- }
- }
- if (EMPTY_ELEMENTS.has(tagName) === false) {
- if (opts.serializeShadowRoot && node.shadowRoot != null) {
- output.indent = output.indent + opts.indentSpaces;
- serializeToHtml(node.shadowRoot, opts, output, true);
- output.indent = output.indent - opts.indentSpaces;
- if (opts.newLines &&
- (node.childNodes.length === 0 ||
- (node.childNodes.length === 1 &&
- node.childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
- node.childNodes[0].nodeValue.trim() === ''))) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- for (let i = 0; i < output.indent; i++) {
- output.text.push(' ');
- }
- output.currentLineWidth += output.indent;
- }
- }
- if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
- const childNodes = tagName === 'template' ? node.content.childNodes : node.childNodes;
- const childNodeLength = childNodes.length;
- if (childNodeLength > 0) {
- if (childNodeLength === 1 &&
- childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
- (typeof childNodes[0].nodeValue !== 'string' || childNodes[0].nodeValue.trim() === '')) ;
- else {
- const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
- if (!isWithinWhitespaceSensitiveNode && opts.indentSpaces > 0 && ignoreTag === false) {
- output.indent = output.indent + opts.indentSpaces;
- }
- for (let i = 0; i < childNodeLength; i++) {
- serializeToHtml(childNodes[i], opts, output, false);
- }
- if (ignoreTag === false) {
- if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
- output.indent = output.indent - opts.indentSpaces;
- for (let i = 0; i < output.indent; i++) {
- output.text.push(' ');
- }
- output.currentLineWidth += output.indent;
- }
- }
- }
- }
- if (ignoreTag === false) {
- output.text.push('</' + tagName + '>');
- output.currentLineWidth += tagName.length + 3;
- }
- }
- }
- if (opts.approximateLineWidth > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- if (tagName === 'body') {
- output.isWithinBody = false;
- }
- }
- else if (node.nodeType === 3 /* TEXT_NODE */) {
- let textContent = node.nodeValue;
- if (typeof textContent === 'string') {
- const trimmedTextContent = textContent.trim();
- if (trimmedTextContent === '') {
- // this text node is whitespace only
- if (isWithinWhitespaceSensitive(node)) {
- // whitespace matters within this element
- // just add the exact text we were given
- output.text.push(textContent);
- output.currentLineWidth += textContent.length;
- }
- else if (opts.approximateLineWidth > 0 && !output.isWithinBody) ;
- else if (!opts.prettyHtml) {
- // this text node is only whitespace, and it's not
- // within a whitespace sensitive element like <pre> or <code>
- // so replace the entire white space with a single new line
- output.currentLineWidth += 1;
- if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
- // good enough for a new line
- // for perf these are all just estimates
- // we don't care to ensure exact line lengths
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- else {
- // let's keep it all on the same line yet
- output.text.push(' ');
- }
- }
- }
- else {
- // this text node has text content
- const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
- if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
- for (let i = 0; i < output.indent; i++) {
- output.text.push(' ');
- }
- output.currentLineWidth += output.indent;
- }
- let textContentLength = textContent.length;
- if (textContentLength > 0) {
- // this text node has text content
- const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */
- ? node.parentNode.nodeName
- : null;
- if (NON_ESCAPABLE_CONTENT.has(parentTagName)) {
- // this text node cannot have its content escaped since it's going
- // into an element like <style> or <script>
- if (isWithinWhitespaceSensitive(node)) {
- output.text.push(textContent);
- }
- else {
- output.text.push(trimmedTextContent);
- textContentLength = trimmedTextContent.length;
- }
- output.currentLineWidth += textContentLength;
- }
- else {
- // this text node is going into a normal element and html can be escaped
- if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
- // pretty print the text node
- output.text.push(escapeString(textContent.replace(/\s\s+/g, ' ').trim(), false));
- output.currentLineWidth += textContentLength;
- }
- else {
- // not pretty printing the text node
- if (isWithinWhitespaceSensitive(node)) {
- output.currentLineWidth += textContentLength;
- }
- else {
- // this element is not a whitespace sensitive one, like <pre> or <code> so
- // any whitespace at the start and end can be cleaned up to just be one space
- if (/\s/.test(textContent.charAt(0))) {
- textContent = ' ' + textContent.trimLeft();
- }
- textContentLength = textContent.length;
- if (textContentLength > 1) {
- if (/\s/.test(textContent.charAt(textContentLength - 1))) {
- if (opts.approximateLineWidth > 0 &&
- output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
- textContent = textContent.trimRight() + '\n';
- output.currentLineWidth = 0;
- }
- else {
- textContent = textContent.trimRight() + ' ';
- }
- }
- }
- output.currentLineWidth += textContentLength;
- }
- output.text.push(escapeString(textContent, false));
- }
- }
- }
- }
- }
- }
- else if (node.nodeType === 8 /* COMMENT_NODE */) {
- const nodeValue = node.nodeValue;
- if (opts.removeHtmlComments) {
- const isHydrateAnnotation = nodeValue.startsWith(CONTENT_REF_ID + '.') ||
- nodeValue.startsWith(ORG_LOCATION_ID + '.') ||
- nodeValue.startsWith(SLOT_NODE_ID + '.') ||
- nodeValue.startsWith(TEXT_NODE_ID + '.');
- if (!isHydrateAnnotation) {
- return;
- }
- }
- const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
- if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
- output.text.push('\n');
- output.currentLineWidth = 0;
- }
- if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
- for (let i = 0; i < output.indent; i++) {
- output.text.push(' ');
- }
- output.currentLineWidth += output.indent;
- }
- output.text.push('<!--' + nodeValue + '-->');
- output.currentLineWidth += nodeValue.length + 7;
- }
- else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
- output.text.push('<!doctype html>');
- }
- }
- const AMP_REGEX = /&/g;
- const NBSP_REGEX = /\u00a0/g;
- const DOUBLE_QUOTE_REGEX = /"/g;
- const LT_REGEX = /</g;
- const GT_REGEX = />/g;
- const CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
- function getTagName(element) {
- if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
- return element.nodeName.toLowerCase();
- }
- else {
- return element.nodeName;
- }
- }
- function escapeString(str, attrMode) {
- str = str.replace(AMP_REGEX, '&').replace(NBSP_REGEX, ' ');
- if (attrMode) {
- return str.replace(DOUBLE_QUOTE_REGEX, '"');
- }
- return str.replace(LT_REGEX, '<').replace(GT_REGEX, '>');
- }
- function isWithinWhitespaceSensitive(node) {
- while (node != null) {
- if (WHITESPACE_SENSITIVE.has(node.nodeName)) {
- return true;
- }
- node = node.parentNode;
- }
- return false;
- }
- /*@__PURE__*/ const NON_ESCAPABLE_CONTENT = new Set([
- 'STYLE',
- 'SCRIPT',
- 'IFRAME',
- 'NOSCRIPT',
- 'XMP',
- 'NOEMBED',
- 'NOFRAMES',
- 'PLAINTEXT',
- ]);
- /*@__PURE__*/ const WHITESPACE_SENSITIVE = new Set([
- 'CODE',
- 'OUTPUT',
- 'PLAINTEXT',
- 'PRE',
- 'SCRIPT',
- 'TEMPLATE',
- 'TEXTAREA',
- ]);
- /*@__PURE__*/ const EMPTY_ELEMENTS = new Set([
- 'area',
- 'base',
- 'basefont',
- 'bgsound',
- 'br',
- 'col',
- 'embed',
- 'frame',
- 'hr',
- 'img',
- 'input',
- 'keygen',
- 'link',
- 'meta',
- 'param',
- 'source',
- 'trace',
- 'wbr',
- ]);
- /*@__PURE__*/ const REMOVE_EMPTY_ATTR = new Set(['class', 'dir', 'id', 'lang', 'name', 'title']);
- /*@__PURE__*/ const BOOLEAN_ATTR = new Set([
- 'allowfullscreen',
- 'async',
- 'autofocus',
- 'autoplay',
- 'checked',
- 'compact',
- 'controls',
- 'declare',
- 'default',
- 'defaultchecked',
- 'defaultmuted',
- 'defaultselected',
- 'defer',
- 'disabled',
- 'enabled',
- 'formnovalidate',
- 'hidden',
- 'indeterminate',
- 'inert',
- 'ismap',
- 'itemscope',
- 'loop',
- 'multiple',
- 'muted',
- 'nohref',
- 'nomodule',
- 'noresize',
- 'noshade',
- 'novalidate',
- 'nowrap',
- 'open',
- 'pauseonexit',
- 'readonly',
- 'required',
- 'reversed',
- 'scoped',
- 'seamless',
- 'selected',
- 'sortable',
- 'truespeed',
- 'typemustmatch',
- 'visible',
- ]);
- /*@__PURE__*/ const STRUCTURE_ELEMENTS = new Set([
- 'html',
- 'body',
- 'head',
- 'iframe',
- 'meta',
- 'link',
- 'base',
- 'title',
- 'script',
- 'style',
- ]);
- // Parse5 6.0.1
- const e=function(e){const t=[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];var n="�",s={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},r=function(e){return e>=55296&&e<=57343},i=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},o=function(e){return e>=64976&&e<=65007||t.indexOf(e)>-1},a="unexpected-null-character",T="invalid-first-character-of-tag-name",E="missing-semicolon-after-character-reference",h="eof-before-tag-name",c="eof-in-tag",_="missing-whitespace-after-doctype-public-keyword",l="missing-whitespace-between-doctype-public-and-system-identifiers",m="missing-whitespace-after-doctype-system-keyword",p="missing-quote-before-doctype-public-identifier",A="missing-quote-before-doctype-system-identifier",u="missing-doctype-public-identifier",N="missing-doctype-system-identifier",d="abrupt-doctype-public-identifier",C="abrupt-doctype-system-identifier",O="eof-in-script-html-comment-like-text",f="eof-in-doctype",S="abrupt-closing-of-empty-comment",R="eof-in-comment",I="absence-of-digits-in-numeric-character-reference",L="end-tag-without-matching-open-element",k="misplaced-start-tag-for-head-element";const M=s;var g=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204]);const P=s,H={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},D={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},F="DATA_STATE",U="RCDATA_STATE",G="RAWTEXT_STATE",B="SCRIPT_DATA_STATE",K="PLAINTEXT_STATE",b="TAG_OPEN_STATE",x="END_TAG_OPEN_STATE",y="TAG_NAME_STATE",v="RCDATA_LESS_THAN_SIGN_STATE",Y="RCDATA_END_TAG_OPEN_STATE",w="RCDATA_END_TAG_NAME_STATE",Q="RAWTEXT_LESS_THAN_SIGN_STATE",X="RAWTEXT_END_TAG_OPEN_STATE",W="RAWTEXT_END_TAG_NAME_STATE",V="SCRIPT_DATA_LESS_THAN_SIGN_STATE",j="SCRIPT_DATA_END_TAG_OPEN_STATE",z="SCRIPT_DATA_END_TAG_NAME_STATE",q="SCRIPT_DATA_ESCAPE_START_STATE",J="SCRIPT_DATA_ESCAPE_START_DASH_STATE",Z="SCRIPT_DATA_ESCAPED_STATE",$="SCRIPT_DATA_ESCAPED_DASH_STATE",ee="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",te="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",ne="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",se="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",re="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",ie="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",oe="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",ae="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",Te="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",Ee="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",he="BEFORE_ATTRIBUTE_NAME_STATE",ce="ATTRIBUTE_NAME_STATE",_e="AFTER_ATTRIBUTE_NAME_STATE",le="BEFORE_ATTRIBUTE_VALUE_STATE",me="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",pe="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",Ae="ATTRIBUTE_VALUE_UNQUOTED_STATE",ue="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",Ne="SELF_CLOSING_START_TAG_STATE",de="BOGUS_COMMENT_STATE",Ce="MARKUP_DECLARATION_OPEN_STATE",Oe="COMMENT_START_STATE",fe="COMMENT_START_DASH_STATE",Se="COMMENT_STATE",Re="COMMENT_LESS_THAN_SIGN_STATE",Ie="COMMENT_LESS_THAN_SIGN_BANG_STATE",Le="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ke="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",Me="COMMENT_END_DASH_STATE",ge="COMMENT_END_STATE",Pe="COMMENT_END_BANG_STATE",He="DOCTYPE_STATE",De="BEFORE_DOCTYPE_NAME_STATE",Fe="DOCTYPE_NAME_STATE",Ue="AFTER_DOCTYPE_NAME_STATE",Ge="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",Be="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",Ke="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",be="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",xe="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",ye="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",ve="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",Ye="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",we="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",Qe="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",Xe="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",We="BOGUS_DOCTYPE_STATE",Ve="CDATA_SECTION_STATE",je="CDATA_SECTION_BRACKET_STATE",ze="CDATA_SECTION_END_STATE",qe="CHARACTER_REFERENCE_STATE",Je="NAMED_CHARACTER_REFERENCE_STATE",Ze="AMBIGUOS_AMPERSAND_STATE",$e="NUMERIC_CHARACTER_REFERENCE_STATE",et="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",tt="DECIMAL_CHARACTER_REFERENCE_START_STATE",nt="HEXADEMICAL_CHARACTER_REFERENCE_STATE",st="DECIMAL_CHARACTER_REFERENCE_STATE",rt="NUMERIC_CHARACTER_REFERENCE_END_STATE";function it(e){return e===P.SPACE||e===P.LINE_FEED||e===P.TABULATION||e===P.FORM_FEED}function ot(e){return e>=P.DIGIT_0&&e<=P.DIGIT_9}function at(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_Z}function Tt(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_Z}function Et(e){return Tt(e)||at(e)}function ht(e){return Et(e)||ot(e)}function ct(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_F}function _t(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_F}function lt(e){return e+32}function mt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function pt(e){return String.fromCharCode(lt(e))}function At(e,t){const n=g[++e];let s=++e,r=s+n-1;for(;s<=r;){const e=s+r>>>1,i=g[e];if(i<t)s=e+1;else {if(!(i>t))return g[e+n];r=e-1;}}return -1}class ut{constructor(){this.preprocessor=new class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536;}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos;}_processSurrogate(e){if(this.pos!==this.lastCharPos){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,M.EOF;return this._err("surrogate-in-input-stream"),e}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[]);}write(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t;}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1;}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,M.EOF;let e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===M.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===M.CARRIAGE_RETURN?(this.skipNextNewLine=!0,M.LINE_FEED):(this.skipNextNewLine=!1,r(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===M.LINE_FEED||e===M.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){i(e)?this._err("control-character-in-input-stream"):o(e)&&this._err("noncharacter-in-input-stream");}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--;}},this.tokenQueue=[],this.allowCDATA=!1,this.state=F,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null;}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume();}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e);}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t);}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e);}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:ut.HIBERNATION_TOKEN}),!0}return !1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat();}_reconsumeInState(e){this.state=e,this._unconsume();}_consumeSequenceIfMatch(e,t,n){let s=0,r=!0;const i=e.length;let o,a=0,T=t;for(;a<i;a++){if(a>0&&(T=this._consume(),s++),T===P.EOF){r=!1;break}if(o=e[a],T!==o&&(n||T!==lt(o))){r=!1;break}}if(!r)for(;s--;)this._unconsume();return r}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==H.SCRIPT_STRING.length)return !1;for(let e=0;e<this.tempBuff.length;e++)if(this.tempBuff[e]!==H.SCRIPT_STRING[e])return !1;return !0}_createStartTagToken(){this.currentToken={type:ut.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]};}_createEndTagToken(){this.currentToken={type:ut.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]};}_createCommentToken(){this.currentToken={type:ut.COMMENT_TOKEN,data:""};}_createDoctypeToken(e){this.currentToken={type:ut.DOCTYPE_TOKEN,name:e,forceQuirks:!1,publicId:null,systemId:null};}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t};}_createEOFToken(){this.currentToken={type:ut.EOF_TOKEN};}_createAttr(e){this.currentAttr={name:e,value:""};}_leaveAttrName(e){null===ut.getTokenAttr(this.currentToken,this.currentAttr.name)?this.currentToken.attrs.push(this.currentAttr):this._err("duplicate-attribute"),this.state=e;}_leaveAttrValue(e){this.state=e;}_emitCurrentToken(){this._emitCurrentCharacterToken();const e=this.currentToken;this.currentToken=null,e.type===ut.START_TAG_TOKEN?this.lastStartTagName=e.tagName:e.type===ut.END_TAG_TOKEN&&(e.attrs.length>0&&this._err("end-tag-with-attributes"),e.selfClosing&&this._err("end-tag-with-trailing-solidus")),this.tokenQueue.push(e);}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null);}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken();}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t);}_emitCodePoint(e){let t=ut.CHARACTER_TOKEN;it(e)?t=ut.WHITESPACE_CHARACTER_TOKEN:e===P.NULL&&(t=ut.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,mt(e));}_emitSeveralCodePoints(e){for(let t=0;t<e.length;t++)this._emitCodePoint(e[t]);}_emitChars(e){this._appendCharToCurrentCharacterToken(ut.CHARACTER_TOKEN,e);}_matchNamedCharacterReference(e){let t=null,n=1,s=At(0,e);for(this.tempBuff.push(e);s>-1;){const e=g[s],r=e<7;r&&1&e&&(t=2&e?[g[++s],g[++s]]:[g[++s]],n=0);const i=this._consume();if(this.tempBuff.push(i),n++,i===P.EOF)break;s=r?4&e?At(s,i):-1:i===e?++s:-1;}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return this.returnState===me||this.returnState===pe||this.returnState===Ae}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===P.EQUALS_SIGN||ht(e)}return !1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e<this.tempBuff.length;e++)this.currentAttr.value+=mt(this.tempBuff[e]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[];}[F](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=b:e===P.AMPERSAND?(this.returnState=F,this.state=qe):e===P.NULL?(this._err(a),this._emitCodePoint(e)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[U](e){this.preprocessor.dropParsedChunk(),e===P.AMPERSAND?(this.returnState=U,this.state=qe):e===P.LESS_THAN_SIGN?this.state=v:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[G](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=Q:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[B](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=V:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[K](e){this.preprocessor.dropParsedChunk(),e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[b](e){e===P.EXCLAMATION_MARK?this.state=Ce:e===P.SOLIDUS?this.state=x:Et(e)?(this._createStartTagToken(),this._reconsumeInState(y)):e===P.QUESTION_MARK?(this._err("unexpected-question-mark-instead-of-tag-name"),this._createCommentToken(),this._reconsumeInState(de)):e===P.EOF?(this._err(h),this._emitChars("<"),this._emitEOFToken()):(this._err(T),this._emitChars("<"),this._reconsumeInState(F));}[x](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(y)):e===P.GREATER_THAN_SIGN?(this._err("missing-end-tag-name"),this.state=F):e===P.EOF?(this._err(h),this._emitChars("</"),this._emitEOFToken()):(this._err(T),this._createCommentToken(),this._reconsumeInState(de));}[y](e){it(e)?this.state=he:e===P.SOLIDUS?this.state=Ne:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.tagName+=pt(e):e===P.NULL?(this._err(a),this.currentToken.tagName+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentToken.tagName+=mt(e);}[v](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Y):(this._emitChars("<"),this._reconsumeInState(U));}[Y](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(w)):(this._emitChars("</"),this._reconsumeInState(U));}[w](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this.state=F,void this._emitCurrentToken()}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(U);}}[Q](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=X):(this._emitChars("<"),this._reconsumeInState(G));}[X](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(W)):(this._emitChars("</"),this._reconsumeInState(G));}[W](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(G);}}[V](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=j):e===P.EXCLAMATION_MARK?(this.state=q,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(B));}[j](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(z)):(this._emitChars("</"),this._reconsumeInState(B));}[z](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(B);}}[q](e){e===P.HYPHEN_MINUS?(this.state=J,this._emitChars("-")):this._reconsumeInState(B);}[J](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):this._reconsumeInState(B);}[Z](e){e===P.HYPHEN_MINUS?(this.state=$,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[$](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[ee](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?this.state=te:e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=ne):Et(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(re)):(this._emitChars("<"),this._reconsumeInState(Z));}[ne](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(se)):(this._emitChars("</"),this._reconsumeInState(Z));}[se](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(Z);}}[re](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?ie:Z,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(Z);}[ie](e){e===P.HYPHEN_MINUS?(this.state=oe,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[oe](e){e===P.HYPHEN_MINUS?(this.state=ae,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[ae](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[Te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Ee,this._emitChars("/")):this._reconsumeInState(ie);}[Ee](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?Z:ie,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(ie);}[he](e){it(e)||(e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?this._reconsumeInState(_e):e===P.EQUALS_SIGN?(this._err("unexpected-equals-sign-before-attribute-name"),this._createAttr("="),this.state=ce):(this._createAttr(""),this._reconsumeInState(ce)));}[ce](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?(this._leaveAttrName(_e),this._unconsume()):e===P.EQUALS_SIGN?this._leaveAttrName(le):at(e)?this.currentAttr.name+=pt(e):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN?(this._err("unexpected-character-in-attribute-name"),this.currentAttr.name+=mt(e)):e===P.NULL?(this._err(a),this.currentAttr.name+=n):this.currentAttr.name+=mt(e);}[_e](e){it(e)||(e===P.SOLIDUS?this.state=Ne:e===P.EQUALS_SIGN?this.state=le:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(ce)));}[le](e){it(e)||(e===P.QUOTATION_MARK?this.state=me:e===P.APOSTROPHE?this.state=pe:e===P.GREATER_THAN_SIGN?(this._err("missing-attribute-value"),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Ae));}[me](e){e===P.QUOTATION_MARK?this.state=ue:e===P.AMPERSAND?(this.returnState=me,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[pe](e){e===P.APOSTROPHE?this.state=ue:e===P.AMPERSAND?(this.returnState=pe,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[Ae](e){it(e)?this._leaveAttrValue(he):e===P.AMPERSAND?(this.returnState=Ae,this.state=qe):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN||e===P.EQUALS_SIGN||e===P.GRAVE_ACCENT?(this._err("unexpected-character-in-unquoted-attribute-value"),this.currentAttr.value+=mt(e)):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[ue](e){it(e)?this._leaveAttrValue(he):e===P.SOLIDUS?this._leaveAttrValue(Ne):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("missing-whitespace-between-attributes"),this._reconsumeInState(he));}[Ne](e){e===P.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("unexpected-solidus-in-tag"),this._reconsumeInState(he));}[de](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===P.NULL?(this._err(a),this.currentToken.data+=n):this.currentToken.data+=mt(e);}[Ce](e){this._consumeSequenceIfMatch(H.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=Oe):this._consumeSequenceIfMatch(H.DOCTYPE_STRING,e,!1)?this.state=He:this._consumeSequenceIfMatch(H.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=Ve:(this._err("cdata-in-html-content"),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=de):this._ensureHibernation()||(this._err("incorrectly-opened-comment"),this._createCommentToken(),this._reconsumeInState(de));}[Oe](e){e===P.HYPHEN_MINUS?this.state=fe:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Se);}[fe](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[Se](e){e===P.HYPHEN_MINUS?this.state=Me:e===P.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=Re):e===P.NULL?(this._err(a),this.currentToken.data+=n):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=mt(e);}[Re](e){e===P.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=Ie):e===P.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(Se);}[Ie](e){e===P.HYPHEN_MINUS?this.state=Le:this._reconsumeInState(Se);}[Le](e){e===P.HYPHEN_MINUS?this.state=ke:this._reconsumeInState(Me);}[ke](e){e!==P.GREATER_THAN_SIGN&&e!==P.EOF&&this._err("nested-comment"),this._reconsumeInState(ge);}[Me](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[ge](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EXCLAMATION_MARK?this.state=Pe:e===P.HYPHEN_MINUS?this.currentToken.data+="-":e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(Se));}[Pe](e){e===P.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=Me):e===P.GREATER_THAN_SIGN?(this._err("incorrectly-closed-comment"),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(Se));}[He](e){it(e)?this.state=De:e===P.GREATER_THAN_SIGN?this._reconsumeInState(De):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("missing-whitespace-before-doctype-name"),this._reconsumeInState(De));}[De](e){it(e)||(at(e)?(this._createDoctypeToken(pt(e)),this.state=Fe):e===P.NULL?(this._err(a),this._createDoctypeToken(n),this.state=Fe):e===P.GREATER_THAN_SIGN?(this._err("missing-doctype-name"),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(mt(e)),this.state=Fe));}[Fe](e){it(e)?this.state=Ue:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.name+=pt(e):e===P.NULL?(this._err(a),this.currentToken.name+=n):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=mt(e);}[Ue](e){it(e)||(e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(H.PUBLIC_STRING,e,!1)?this.state=Ge:this._consumeSequenceIfMatch(H.SYSTEM_STRING,e,!1)?this.state=ve:this._ensureHibernation()||(this._err("invalid-character-sequence-after-doctype-name"),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ge](e){it(e)?this.state=Be:e===P.QUOTATION_MARK?(this._err(_),this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this._err(_),this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Be](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ke](e){e===P.QUOTATION_MARK?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[be](e){e===P.APOSTROPHE?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[xe](e){it(e)?this.state=ye:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.QUOTATION_MARK?(this._err(l),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(l),this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[ye](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[ve](e){it(e)?this.state=Ye:e===P.QUOTATION_MARK?(this._err(m),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(m),this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Ye](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[we](e){e===P.QUOTATION_MARK?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Qe](e){e===P.APOSTROPHE?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Xe](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("unexpected-character-after-doctype-system-identifier"),this._reconsumeInState(We)));}[We](e){e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.NULL?this._err(a):e===P.EOF&&(this._emitCurrentToken(),this._emitEOFToken());}[Ve](e){e===P.RIGHT_SQUARE_BRACKET?this.state=je:e===P.EOF?(this._err("eof-in-cdata"),this._emitEOFToken()):this._emitCodePoint(e);}[je](e){e===P.RIGHT_SQUARE_BRACKET?this.state=ze:(this._emitChars("]"),this._reconsumeInState(Ve));}[ze](e){e===P.GREATER_THAN_SIGN?this.state=F:e===P.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(Ve));}[qe](e){this.tempBuff=[P.AMPERSAND],e===P.NUMBER_SIGN?(this.tempBuff.push(e),this.state=$e):ht(e)?this._reconsumeInState(Je):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[Je](e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[P.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===P.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(E),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState;}else this._flushCodePointsConsumedAsCharacterReference(),this.state=Ze;}[Ze](e){ht(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=mt(e):this._emitCodePoint(e):(e===P.SEMICOLON&&this._err("unknown-named-character-reference"),this._reconsumeInState(this.returnState));}[$e](e){this.charRefCode=0,e===P.LATIN_SMALL_X||e===P.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=et):this._reconsumeInState(tt);}[et](e){!function(e){return ot(e)||ct(e)||_t(e)}(e)?(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(nt);}[tt](e){ot(e)?this._reconsumeInState(st):(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[nt](e){ct(e)?this.charRefCode=16*this.charRefCode+e-55:_t(e)?this.charRefCode=16*this.charRefCode+e-87:ot(e)?this.charRefCode=16*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[st](e){ot(e)?this.charRefCode=10*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[rt](){if(this.charRefCode===P.NULL)this._err("null-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err("character-reference-outside-unicode-range"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(r(this.charRefCode))this._err("surrogate-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(o(this.charRefCode))this._err("noncharacter-character-reference");else if(i(this.charRefCode)||this.charRefCode===P.CARRIAGE_RETURN){this._err("control-character-reference");const e=D[this.charRefCode];e&&(this.charRefCode=e);}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState);}}ut.CHARACTER_TOKEN="CHARACTER_TOKEN",ut.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",ut.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",ut.START_TAG_TOKEN="START_TAG_TOKEN",ut.END_TAG_TOKEN="END_TAG_TOKEN",ut.COMMENT_TOKEN="COMMENT_TOKEN",ut.DOCTYPE_TOKEN="DOCTYPE_TOKEN",ut.EOF_TOKEN="EOF_TOKEN",ut.HIBERNATION_TOKEN="HIBERNATION_TOKEN",ut.MODE={DATA:F,RCDATA:U,RAWTEXT:G,SCRIPT_DATA:B,PLAINTEXT:K},ut.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null};var Nt=ut;function dt(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var Ct=dt((function(e,t){const n=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const s=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[n.HTML]:{[s.ADDRESS]:!0,[s.APPLET]:!0,[s.AREA]:!0,[s.ARTICLE]:!0,[s.ASIDE]:!0,[s.BASE]:!0,[s.BASEFONT]:!0,[s.BGSOUND]:!0,[s.BLOCKQUOTE]:!0,[s.BODY]:!0,[s.BR]:!0,[s.BUTTON]:!0,[s.CAPTION]:!0,[s.CENTER]:!0,[s.COL]:!0,[s.COLGROUP]:!0,[s.DD]:!0,[s.DETAILS]:!0,[s.DIR]:!0,[s.DIV]:!0,[s.DL]:!0,[s.DT]:!0,[s.EMBED]:!0,[s.FIELDSET]:!0,[s.FIGCAPTION]:!0,[s.FIGURE]:!0,[s.FOOTER]:!0,[s.FORM]:!0,[s.FRAME]:!0,[s.FRAMESET]:!0,[s.H1]:!0,[s.H2]:!0,[s.H3]:!0,[s.H4]:!0,[s.H5]:!0,[s.H6]:!0,[s.HEAD]:!0,[s.HEADER]:!0,[s.HGROUP]:!0,[s.HR]:!0,[s.HTML]:!0,[s.IFRAME]:!0,[s.IMG]:!0,[s.INPUT]:!0,[s.LI]:!0,[s.LINK]:!0,[s.LISTING]:!0,[s.MAIN]:!0,[s.MARQUEE]:!0,[s.MENU]:!0,[s.META]:!0,[s.NAV]:!0,[s.NOEMBED]:!0,[s.NOFRAMES]:!0,[s.NOSCRIPT]:!0,[s.OBJECT]:!0,[s.OL]:!0,[s.P]:!0,[s.PARAM]:!0,[s.PLAINTEXT]:!0,[s.PRE]:!0,[s.SCRIPT]:!0,[s.SECTION]:!0,[s.SELECT]:!0,[s.SOURCE]:!0,[s.STYLE]:!0,[s.SUMMARY]:!0,[s.TABLE]:!0,[s.TBODY]:!0,[s.TD]:!0,[s.TEMPLATE]:!0,[s.TEXTAREA]:!0,[s.TFOOT]:!0,[s.TH]:!0,[s.THEAD]:!0,[s.TITLE]:!0,[s.TR]:!0,[s.TRACK]:!0,[s.UL]:!0,[s.WBR]:!0,[s.XMP]:!0},[n.MATHML]:{[s.MI]:!0,[s.MO]:!0,[s.MN]:!0,[s.MS]:!0,[s.MTEXT]:!0,[s.ANNOTATION_XML]:!0},[n.SVG]:{[s.TITLE]:!0,[s.FOREIGN_OBJECT]:!0,[s.DESC]:!0}};}));const Ot=Ct.TAG_NAMES,ft=Ct.NAMESPACES;function St(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI;case 3:return e===Ot.RTC;case 6:return e===Ot.OPTION;case 8:return e===Ot.OPTGROUP}return !1}function Rt(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI||e===Ot.TD||e===Ot.TH||e===Ot.TR;case 3:return e===Ot.RTC;case 5:return e===Ot.TBODY||e===Ot.TFOOT||e===Ot.THEAD;case 6:return e===Ot.OPTION;case 7:return e===Ot.CAPTION;case 8:return e===Ot.OPTGROUP||e===Ot.COLGROUP}return !1}function It(e,t){switch(e.length){case 2:if(e===Ot.TD||e===Ot.TH)return t===ft.HTML;if(e===Ot.MI||e===Ot.MO||e===Ot.MN||e===Ot.MS)return t===ft.MATHML;break;case 4:if(e===Ot.HTML)return t===ft.HTML;if(e===Ot.DESC)return t===ft.SVG;break;case 5:if(e===Ot.TABLE)return t===ft.HTML;if(e===Ot.MTEXT)return t===ft.MATHML;if(e===Ot.TITLE)return t===ft.SVG;break;case 6:return (e===Ot.APPLET||e===Ot.OBJECT)&&t===ft.HTML;case 7:return (e===Ot.CAPTION||e===Ot.MARQUEE)&&t===ft.HTML;case 8:return e===Ot.TEMPLATE&&t===ft.HTML;case 13:return e===Ot.FOREIGN_OBJECT&&t===ft.SVG;case 14:return e===Ot.ANNOTATION_XML&&t===ft.MATHML}return !1}class Lt{constructor(e){this.length=0,this.entries=[],this.treeAdapter=e,this.bookmark=null;}_getNoahArkConditionCandidates(e){const t=[];if(this.length>=3){const n=this.treeAdapter.getAttrList(e).length,s=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e);for(let e=this.length-1;e>=0;e--){const i=this.entries[e];if(i.type===Lt.MARKER_ENTRY)break;const o=i.element,a=this.treeAdapter.getAttrList(o);this.treeAdapter.getTagName(o)===s&&this.treeAdapter.getNamespaceURI(o)===r&&a.length===n&&t.push({idx:e,attrs:a});}}return t.length<3?[]:t}_ensureNoahArkCondition(e){const t=this._getNoahArkConditionCandidates(e);let n=t.length;if(n){const s=this.treeAdapter.getAttrList(e),r=s.length,i=Object.create(null);for(let e=0;e<r;e++){const t=s[e];i[t.name]=t.value;}for(let e=0;e<r;e++)for(let s=0;s<n;s++){const r=t[s].attrs[e];if(i[r.name]!==r.value&&(t.splice(s,1),n--),t.length<3)return}for(let e=n-1;e>=2;e--)this.entries.splice(t[e].idx,1),this.length--;}}insertMarker(){this.entries.push({type:Lt.MARKER_ENTRY}),this.length++;}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.push({type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}insertElementAfterBookmark(e,t){let n=this.length-1;for(;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}removeEntry(e){for(let t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}clearToLastMarker(){for(;this.length;){const e=this.entries.pop();if(this.length--,e.type===Lt.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(n.element)===e)return n}return null}getElementEntry(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.ELEMENT_ENTRY&&n.element===e)return n}return null}}Lt.MARKER_ENTRY="MARKER_ENTRY",Lt.ELEMENT_ENTRY="ELEMENT_ENTRY";var kt=Lt;class Mt{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const s of Object.keys(n))"function"==typeof n[s]&&(t[s]=e[s],e[s]=n[s]);}_getOverriddenMethods(){throw new Error("Not implemented")}}Mt.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n<e.__mixins.length;n++)if(e.__mixins[n].constructor===t)return e.__mixins[n];const s=new t(e,n);return e.__mixins.push(s),s};var gt=Mt,Pt=class extends gt{constructor(e){super(e),this.preprocessor=e,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1;}_getOverriddenMethods(e,t){return {advance(){const n=this.pos+1,s=this.html[n];return e.isEol&&(e.isEol=!1,e.line++,e.lineStartPos=n),("\n"===s||"\r"===s&&"\n"!==this.html[n+1])&&(e.isEol=!0),e.col=n-e.lineStartPos+1,e.offset=e.droppedBufferSize+n,t.advance.call(this)},retreat(){t.retreat.call(this),e.isEol=!1,e.col=this.pos-e.lineStartPos+1;},dropParsedChunk(){const n=this.pos;t.dropParsedChunk.call(this);const s=n-this.pos;e.lineStartPos-=s,e.droppedBufferSize+=s,e.offset=e.droppedBufferSize+this.pos;}}}},Ht=class extends gt{constructor(e){super(e),this.tokenizer=e,this.posTracker=gt.install(e.preprocessor,Pt),this.currentAttrLocation=null,this.ctLoc=null;}_getCurrentLocation(){return {startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;const e=this.tokenizer.currentToken,t=this.tokenizer.currentAttr;e.location.attrs||(e.location.attrs=Object.create(null)),e.location.attrs[t.name]=this.currentAttrLocation;}_getOverriddenMethods(e,t){const n={_createStartTagToken(){t._createStartTagToken.call(this),this.currentToken.location=e.ctLoc;},_createEndTagToken(){t._createEndTagToken.call(this),this.currentToken.location=e.ctLoc;},_createCommentToken(){t._createCommentToken.call(this),this.currentToken.location=e.ctLoc;},_createDoctypeToken(n){t._createDoctypeToken.call(this,n),this.currentToken.location=e.ctLoc;},_createCharacterToken(n,s){t._createCharacterToken.call(this,n,s),this.currentCharacterToken.location=e.ctLoc;},_createEOFToken(){t._createEOFToken.call(this),this.currentToken.location=e._getCurrentLocation();},_createAttr(n){t._createAttr.call(this,n),e.currentAttrLocation=e._getCurrentLocation();},_leaveAttrName(n){t._leaveAttrName.call(this,n),e._attachCurrentAttrLocationInfo();},_leaveAttrValue(n){t._leaveAttrValue.call(this,n),e._attachCurrentAttrLocationInfo();},_emitCurrentToken(){const n=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=n.startLine,this.currentCharacterToken.location.endCol=n.startCol,this.currentCharacterToken.location.endOffset=n.startOffset),this.currentToken.type===Nt.EOF_TOKEN?(n.endLine=n.startLine,n.endCol=n.startCol,n.endOffset=n.startOffset):(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col+1,n.endOffset=e.posTracker.offset+1),t._emitCurrentToken.call(this);},_emitCurrentCharacterToken(){const n=this.currentCharacterToken&&this.currentCharacterToken.location;n&&-1===n.endOffset&&(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col,n.endOffset=e.posTracker.offset),t._emitCurrentCharacterToken.call(this);}};return Object.keys(Nt.MODE).forEach((s=>{const r=Nt.MODE[s];n[r]=function(n){e.ctLoc=e._getCurrentLocation(),t[r].call(this,n);};})),n}},Dt=class extends gt{constructor(e,t){super(e),this.onItemPop=t.onItemPop;}_getOverriddenMethods(e,t){return {pop(){e.onItemPop(this.current),t.pop.call(this);},popAllUpToHtmlElement(){for(let t=this.stackTop;t>0;t--)e.onItemPop(this.items[t]);t.popAllUpToHtmlElement.call(this);},remove(n){e.onItemPop(this.current),t.remove.call(this,n);}}}};const Ft=Ct.TAG_NAMES;var Ut=class extends gt{constructor(e){super(e),this.parser=e,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null;}_setStartLocation(e){let t=null;this.lastStartTagToken&&(t=Object.assign({},this.lastStartTagToken.location),t.startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t);}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,s=this.treeAdapter.getTagName(e),r={};t.type===Nt.END_TAG_TOKEN&&s===t.tagName?(r.endTag=Object.assign({},n),r.endLine=n.endLine,r.endCol=n.endCol,r.endOffset=n.endOffset):(r.endLine=n.startLine,r.endCol=n.startCol,r.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,r);}}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;const r=gt.install(this.tokenizer,Ht);e.posTracker=r.posTracker,gt.install(this.openElements,Dt,{onItemPop:function(t){e._setEndLocation(t,e.currentToken);}});},_runParsingLoop(n){t._runParsingLoop.call(this,n);for(let t=this.openElements.stackTop;t>=0;t--)e._setEndLocation(this.openElements.items[t],e.currentToken);},_processTokenInForeignContent(n){e.currentToken=n,t._processTokenInForeignContent.call(this,n);},_processToken(n){if(e.currentToken=n,t._processToken.call(this,n),n.type===Nt.END_TAG_TOKEN&&(n.tagName===Ft.HTML||n.tagName===Ft.BODY&&this.openElements.hasInScope(Ft.BODY)))for(let t=this.openElements.stackTop;t>=0;t--){const s=this.openElements.items[t];if(this.treeAdapter.getTagName(s)===n.tagName){e._setEndLocation(s,n);break}}},_setDocumentType(e){t._setDocumentType.call(this,e);const n=this.treeAdapter.getChildNodes(this.document),s=n.length;for(let t=0;t<s;t++){const s=n[t];if(this.treeAdapter.isDocumentTypeNode(s)){this.treeAdapter.setNodeSourceCodeLocation(s,e.location);break}}},_attachElementToTree(n){e._setStartLocation(n),e.lastStartTagToken=null,t._attachElementToTree.call(this,n);},_appendElement(n,s){e.lastStartTagToken=n,t._appendElement.call(this,n,s);},_insertElement(n,s){e.lastStartTagToken=n,t._insertElement.call(this,n,s);},_insertTemplate(n){e.lastStartTagToken=n,t._insertTemplate.call(this,n);const s=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(s,null);},_insertFakeRootElement(){t._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null);},_appendCommentNode(e,n){t._appendCommentNode.call(this,e,n);const s=this.treeAdapter.getChildNodes(n),r=s[s.length-1];this.treeAdapter.setNodeSourceCodeLocation(r,e.location);},_findFosterParentingLocation(){return e.lastFosterParentingLocation=t._findFosterParentingLocation.call(this),e.lastFosterParentingLocation},_insertCharacters(n){t._insertCharacters.call(this,n);const s=this._shouldFosterParentOnInsertion(),r=s&&e.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,i=this.treeAdapter.getChildNodes(r),o=s&&e.lastFosterParentingLocation.beforeElement?i.indexOf(e.lastFosterParentingLocation.beforeElement)-1:i.length-1,a=i[o];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:e,endCol:t,endOffset:s}=n.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:e,endCol:t,endOffset:s});}else this.treeAdapter.setNodeSourceCodeLocation(a,n.location);}}}},Gt=class extends gt{constructor(e,t){super(e),this.posTracker=null,this.onParseError=t.onParseError;}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset;}_reportError(e){const t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t);}_getOverriddenMethods(e){return {_err(t){e._reportError(t);}}}},Bt=class extends Gt{constructor(e,t){super(e,t),this.posTracker=gt.install(e,Pt),this.lastErrOffset=-1;}_reportError(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(e));}},Kt=class extends Gt{constructor(e,t){super(e,t);const n=gt.install(e.preprocessor,Bt,t);this.posTracker=n.posTracker;}},bt=class extends Gt{constructor(e,t){super(e,t),this.opts=t,this.ctLoc=null,this.locBeforeToken=!1;}_setErrorLocation(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset);}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),gt.install(this.tokenizer,Kt,e.opts),gt.install(this.tokenizer,Ht);},_processInputToken(n){e.ctLoc=n.location,t._processInputToken.call(this,n);},_err(t,n){e.locBeforeToken=n&&n.beforeToken,e._reportError(t);}}}},xt=dt((function(e,t){const{DOCUMENT_MODE:n}=Ct;t.createDocument=function(){return {nodeName:"#document",mode:n.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return {nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,n){return {nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return {nodeName:"#comment",data:e,parentNode:null}};const s=function(e){return {nodeName:"#text",value:e,parentNode:null}},r=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e;},i=t.insertBefore=function(e,t,n){const s=e.childNodes.indexOf(n);e.childNodes.splice(s,0,t),t.parentNode=e;};t.setTemplateContent=function(e,t){e.content=t;},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,n,s){let i=null;for(let t=0;t<e.childNodes.length;t++)if("#documentType"===e.childNodes[t].nodeName){i=e.childNodes[t];break}i?(i.name=t,i.publicId=n,i.systemId=s):r(e,{nodeName:"#documentType",name:t,publicId:n,systemId:s});},t.setDocumentMode=function(e,t){e.mode=t;},t.getDocumentMode=function(e){return e.mode},t.detachNode=function(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null;}},t.insertText=function(e,t){if(e.childNodes.length){const n=e.childNodes[e.childNodes.length-1];if("#text"===n.nodeName)return void(n.value+=t)}r(e,s(t));},t.insertTextBefore=function(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&"#text"===r.nodeName?r.value+=t:i(e,s(t),n);},t.adoptAttributes=function(e,t){const n=[];for(let t=0;t<e.attrs.length;t++)n.push(e.attrs[t].name);for(let s=0;s<t.length;s++)-1===n.indexOf(t[s].name)&&e.attrs.push(t[s]);},t.getFirstChild=function(e){return e.childNodes[0]},t.getChildNodes=function(e){return e.childNodes},t.getParentNode=function(e){return e.parentNode},t.getAttrList=function(e){return e.attrs},t.getTagName=function(e){return e.tagName},t.getNamespaceURI=function(e){return e.namespaceURI},t.getTextNodeContent=function(e){return e.value},t.getCommentNodeContent=function(e){return e.data},t.getDocumentTypeNodeName=function(e){return e.name},t.getDocumentTypeNodePublicId=function(e){return e.publicId},t.getDocumentTypeNodeSystemId=function(e){return e.systemId},t.isTextNode=function(e){return "#text"===e.nodeName},t.isCommentNode=function(e){return "#comment"===e.nodeName},t.isDocumentTypeNode=function(e){return "#documentType"===e.nodeName},t.isElementNode=function(e){return !!e.tagName},t.setNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=t;},t.getNodeSourceCodeLocation=function(e){return e.sourceCodeLocation},t.updateNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=Object.assign(e.sourceCodeLocation,t);};}));const{DOCUMENT_MODE:yt}=Ct,vt="html",Yt=["+//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//"],wt=Yt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),Qt=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],Xt=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Wt=Xt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function Vt(e,t){for(let n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return !0;return !1}var jt=dt((function(e,t){const n=Ct.TAG_NAMES,s=Ct.NAMESPACES,r=Ct.ATTRS,i={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},o={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:s.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:s.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:s.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:s.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:s.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:s.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:s.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:s.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:s.XML},"xml:space":{prefix:"xml",name:"space",namespace:s.XML},xmlns:{prefix:"",name:"xmlns",namespace:s.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:s.XMLNS}},a=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},T={[n.B]:!0,[n.BIG]:!0,[n.BLOCKQUOTE]:!0,[n.BODY]:!0,[n.BR]:!0,[n.CENTER]:!0,[n.CODE]:!0,[n.DD]:!0,[n.DIV]:!0,[n.DL]:!0,[n.DT]:!0,[n.EM]:!0,[n.EMBED]:!0,[n.H1]:!0,[n.H2]:!0,[n.H3]:!0,[n.H4]:!0,[n.H5]:!0,[n.H6]:!0,[n.HEAD]:!0,[n.HR]:!0,[n.I]:!0,[n.IMG]:!0,[n.LI]:!0,[n.LISTING]:!0,[n.MENU]:!0,[n.META]:!0,[n.NOBR]:!0,[n.OL]:!0,[n.P]:!0,[n.PRE]:!0,[n.RUBY]:!0,[n.S]:!0,[n.SMALL]:!0,[n.SPAN]:!0,[n.STRONG]:!0,[n.STRIKE]:!0,[n.SUB]:!0,[n.SUP]:!0,[n.TABLE]:!0,[n.TT]:!0,[n.U]:!0,[n.UL]:!0,[n.VAR]:!0};t.causesExit=function(e){const t=e.tagName;return !(t!==n.FONT||null===Nt.getTokenAttr(e,r.COLOR)&&null===Nt.getTokenAttr(e,r.SIZE)&&null===Nt.getTokenAttr(e,r.FACE))||T[t]},t.adjustTokenMathMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}},t.adjustTokenSVGAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=i[e.attrs[t].name];n&&(e.attrs[t].name=n);}},t.adjustTokenXMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=o[e.attrs[t].name];n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace);}},t.adjustTokenSVGTagName=function(e){const t=a[e.tagName];t&&(e.tagName=t);},t.isIntegrationPoint=function(e,t,i,o){return !(o&&o!==s.HTML||!function(e,t,i){if(t===s.MATHML&&e===n.ANNOTATION_XML)for(let e=0;e<i.length;e++)if(i[e].name===r.ENCODING){const t=i[e].value.toLowerCase();return "text/html"===t||"application/xhtml+xml"===t}return t===s.SVG&&(e===n.FOREIGN_OBJECT||e===n.DESC||e===n.TITLE)}(e,t,i))||!(o&&o!==s.MATHML||!function(e,t){return t===s.MATHML&&(e===n.MI||e===n.MO||e===n.MN||e===n.MS||e===n.MTEXT)}(e,t))};}));const zt=Ct.TAG_NAMES,qt=Ct.NAMESPACES,Jt=Ct.ATTRS,Zt={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:xt},$t="hidden",en="INITIAL_MODE",tn="BEFORE_HTML_MODE",nn="BEFORE_HEAD_MODE",sn="IN_HEAD_MODE",rn="IN_HEAD_NO_SCRIPT_MODE",on="AFTER_HEAD_MODE",an="IN_BODY_MODE",Tn="TEXT_MODE",En="IN_TABLE_MODE",hn="IN_TABLE_TEXT_MODE",cn="IN_CAPTION_MODE",_n="IN_COLUMN_GROUP_MODE",ln="IN_TABLE_BODY_MODE",mn="IN_ROW_MODE",pn="IN_CELL_MODE",An="IN_SELECT_MODE",un="IN_SELECT_IN_TABLE_MODE",Nn="IN_TEMPLATE_MODE",dn="AFTER_BODY_MODE",Cn="IN_FRAMESET_MODE",On="AFTER_FRAMESET_MODE",fn="AFTER_AFTER_BODY_MODE",Sn="AFTER_AFTER_FRAMESET_MODE",Rn={[zt.TR]:mn,[zt.TBODY]:ln,[zt.THEAD]:ln,[zt.TFOOT]:ln,[zt.CAPTION]:cn,[zt.COLGROUP]:_n,[zt.TABLE]:En,[zt.BODY]:an,[zt.FRAMESET]:Cn},In={[zt.CAPTION]:En,[zt.COLGROUP]:En,[zt.TBODY]:En,[zt.TFOOT]:En,[zt.THEAD]:En,[zt.COL]:_n,[zt.TR]:ln,[zt.TD]:mn,[zt.TH]:mn},Ln={[en]:{[Nt.CHARACTER_TOKEN]:vn,[Nt.NULL_CHARACTER_TOKEN]:vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:function(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ct.DOCUMENT_MODE.QUIRKS:function(e){if(e.name!==vt)return yt.QUIRKS;const t=e.systemId;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return yt.QUIRKS;let n=e.publicId;if(null!==n){if(n=n.toLowerCase(),Qt.indexOf(n)>-1)return yt.QUIRKS;let e=null===t?wt:Yt;if(Vt(n,e))return yt.QUIRKS;if(e=null===t?Xt:Wt,Vt(n,e))return yt.LIMITED_QUIRKS}return yt.NO_QUIRKS}(t);(function(e){return e.name===vt&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err("non-conforming-doctype"),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=tn;},[Nt.START_TAG_TOKEN]:vn,[Nt.END_TAG_TOKEN]:vn,[Nt.EOF_TOKEN]:vn},[tn]:{[Nt.CHARACTER_TOKEN]:Yn,[Nt.NULL_CHARACTER_TOKEN]:Yn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?(e._insertElement(t,qt.HTML),e.insertionMode=nn):Yn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n!==zt.HTML&&n!==zt.HEAD&&n!==zt.BODY&&n!==zt.BR||Yn(e,t);},[Nt.EOF_TOKEN]:Yn},[nn]:{[Nt.CHARACTER_TOKEN]:wn,[Nt.NULL_CHARACTER_TOKEN]:wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.HEAD?(e._insertElement(t,qt.HTML),e.headElement=e.openElements.current,e.insertionMode=sn):wn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HEAD||n===zt.BODY||n===zt.HTML||n===zt.BR?wn(e,t):e._err(L);},[Nt.EOF_TOKEN]:wn},[sn]:{[Nt.CHARACTER_TOKEN]:Wn,[Nt.NULL_CHARACTER_TOKEN]:Wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:Qn,[Nt.END_TAG_TOKEN]:Xn,[Nt.EOF_TOKEN]:Wn},[rn]:{[Nt.CHARACTER_TOKEN]:Vn,[Nt.NULL_CHARACTER_TOKEN]:Vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASEFONT||n===zt.BGSOUND||n===zt.HEAD||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.STYLE?Qn(e,t):n===zt.NOSCRIPT?e._err("nested-noscript-in-head"):Vn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.NOSCRIPT?(e.openElements.pop(),e.insertionMode=sn):n===zt.BR?Vn(e,t):e._err(L);},[Nt.EOF_TOKEN]:Vn},[on]:{[Nt.CHARACTER_TOKEN]:jn,[Nt.NULL_CHARACTER_TOKEN]:jn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BODY?(e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=an):n===zt.FRAMESET?(e._insertElement(t,qt.HTML),e.insertionMode=Cn):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE?(e._err("abandoned-head-element-child"),e.openElements.push(e.headElement),Qn(e,t),e.openElements.remove(e.headElement)):n===zt.HEAD?e._err(k):jn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.BODY||n===zt.HTML||n===zt.BR?jn(e,t):n===zt.TEMPLATE?Xn(e,t):e._err(L);},[Nt.EOF_TOKEN]:jn},[an]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:as,[Nt.END_TAG_TOKEN]:cs,[Nt.EOF_TOKEN]:_s},[Tn]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:xn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Gn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:Gn,[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.SCRIPT&&(e.pendingScript=e.openElements.current),e.openElements.pop(),e.insertionMode=e.originalInsertionMode;},[Nt.EOF_TOKEN]:function(e,t){e._err("eof-in-element-that-can-contain-only-text"),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t);}},[En]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ms,[Nt.END_TAG_TOKEN]:ps,[Nt.EOF_TOKEN]:_s},[hn]:{[Nt.CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0;},[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t);},[Nt.COMMENT_TOKEN]:us,[Nt.DOCTYPE_TOKEN]:us,[Nt.START_TAG_TOKEN]:us,[Nt.END_TAG_TOKEN]:us,[Nt.EOF_TOKEN]:us},[cn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,n===zt.TABLE&&e._processToken(t)):n!==zt.BODY&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[_n]:{[Nt.CHARACTER_TOKEN]:Ns,[Nt.NULL_CHARACTER_TOKEN]:Ns,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.COL?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TEMPLATE?Qn(e,t):Ns(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.COLGROUP?e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En):n===zt.TEMPLATE?Xn(e,t):n!==zt.COL&&Ns(e,t);},[Nt.EOF_TOKEN]:_s},[ln]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,qt.HTML),e.insertionMode=mn):n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(zt.TR),e.insertionMode=mn,e._processToken(t)):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En):n===zt.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH&&n!==zt.TR)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[mn]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,qt.HTML),e.insertionMode=pn,e.activeFormattingElements.insertMarker()):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln):n===zt.TABLE?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?(e.openElements.hasInTableScope(n)||e.openElements.hasInTableScope(zt.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[pn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?(e.openElements.hasInTableScope(zt.TD)||e.openElements.hasInTableScope(zt.TH))&&(e._closeTableCell(),e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=mn):n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(n)&&(e._closeTableCell(),e._processToken(t)):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[An]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ds,[Nt.END_TAG_TOKEN]:Cs,[Nt.EOF_TOKEN]:_s},[un]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):ds(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):Cs(e,t);},[Nt.EOF_TOKEN]:_s},[Nn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;if(n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE)Qn(e,t);else {const s=In[n]||an;e._popTmplInsertionMode(),e._pushTmplInsertionMode(s),e.insertionMode=s,e._processToken(t);}},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.TEMPLATE&&Xn(e,t);},[Nt.EOF_TOKEN]:Os},[dn]:{[Nt.CHARACTER_TOKEN]:fs,[Nt.NULL_CHARACTER_TOKEN]:fs,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:function(e,t){e._appendCommentNode(t,e.openElements.items[0]);},[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):fs(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?e.fragmentContext||(e.insertionMode=fn):fs(e,t);},[Nt.EOF_TOKEN]:yn},[Cn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.FRAMESET?e._insertElement(t,qt.HTML):n===zt.FRAME?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName!==zt.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===zt.FRAMESET||(e.insertionMode=On));},[Nt.EOF_TOKEN]:yn},[On]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML&&(e.insertionMode=Sn);},[Nt.EOF_TOKEN]:yn},[fn]:{[Nt.CHARACTER_TOKEN]:Ss,[Nt.NULL_CHARACTER_TOKEN]:Ss,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):Ss(e,t);},[Nt.END_TAG_TOKEN]:Ss,[Nt.EOF_TOKEN]:yn},[Sn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:Gn,[Nt.EOF_TOKEN]:yn}};var kn=class{constructor(e){this.options=function(e,t){return [e,t=t||Object.create(null)].reduce(((e,t)=>(Object.keys(t).forEach((n=>{e[n]=t[n];})),e)),Object.create(null))}(Zt,e),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&>.install(this,Ut),this.options.onParseError&>.install(this,bt,{onParseError:this.options.onParseError});}parse(e){const t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}parseFragment(e,t){t||(t=this.treeAdapter.createElement(zt.TEMPLATE,qt.HTML,[]));const n=this.treeAdapter.createElement("documentmock",qt.HTML,[]);this._bootstrap(n,t),this.treeAdapter.getTagName(t)===zt.TEMPLATE&&this._pushTmplInsertionMode(Nn),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);const s=this.treeAdapter.getFirstChild(n),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,r),r}_bootstrap(e,t){this.tokenizer=new Nt(this.options),this.stopped=!1,this.insertionMode=en,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new class{constructor(e,t){this.stackTop=-1,this.items=[],this.current=e,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=t;}_indexOf(e){let t=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===e){t=n;break}return t}_isInTemplate(){return this.currentTagName===Ot.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ft.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null;}push(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++;}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement();}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&this._updateCurrentElement();}insertAfter(e,t){const n=this._indexOf(e)+1;this.items.splice(n,0,t),n===++this.stackTop&&this._updateCurrentElement();}popUntilTagNamePopped(e){for(;this.stackTop>-1;){const t=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&n===ft.HTML)break}}popUntilElementPopped(e){for(;this.stackTop>-1;){const t=this.current;if(this.pop(),t===e)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.H1||e===Ot.H2||e===Ot.H3||e===Ot.H4||e===Ot.H5||e===Ot.H6&&t===ft.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.TD||e===Ot.TH&&t===ft.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement();}clearBackToTableContext(){for(;this.currentTagName!==Ot.TABLE&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableBodyContext(){for(;this.currentTagName!==Ot.TBODY&&this.currentTagName!==Ot.TFOOT&&this.currentTagName!==Ot.THEAD&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableRowContext(){for(;this.currentTagName!==Ot.TR&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}remove(e){for(let t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){const e=this.items[1];return e&&this.treeAdapter.getTagName(e)===Ot.BODY?e:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e);return --t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.currentTagName===Ot.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(It(n,s))return !1}return !0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===Ot.H1||t===Ot.H2||t===Ot.H3||t===Ot.H4||t===Ot.H5||t===Ot.H6)&&n===ft.HTML)return !0;if(It(t,n))return !1}return !0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if((n===Ot.UL||n===Ot.OL)&&s===ft.HTML||It(n,s))return !1}return !0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(n===Ot.BUTTON&&s===ft.HTML||It(n,s))return !1}return !0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n===Ot.TABLE||n===Ot.TEMPLATE||n===Ot.HTML)return !1}}return !0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===ft.HTML){if(t===Ot.TBODY||t===Ot.THEAD||t===Ot.TFOOT)return !0;if(t===Ot.TABLE||t===Ot.HTML)return !1}}return !0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n!==Ot.OPTION&&n!==Ot.OPTGROUP)return !1}}return !0}generateImpliedEndTags(){for(;St(this.currentTagName);)this.pop();}generateImpliedEndTagsThoroughly(){for(;Rt(this.currentTagName);)this.pop();}generateImpliedEndTagsWithExclusion(e){for(;St(this.currentTagName)&&this.currentTagName!==e;)this.pop();}}(this.document,this.treeAdapter),this.activeFormattingElements=new kt(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1;}_err(){}_runParsingLoop(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();const t=this.tokenizer.getNextToken();if(t.type===Nt.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===Nt.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1);}if(this._processInputToken(t),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){const e=this.pendingScript;return this.pendingScript=null,void t(e)}e&&e();}_setupTokenizerCDATAMode(){const e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==qt.HTML&&!this._isIntegrationPoint(e);}_switchToTextParsing(e,t){this._insertElement(e,qt.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Tn;}switchToPlaintextParsing(){this.insertionMode=Tn,this.originalInsertionMode=an,this.tokenizer.state=Nt.MODE.PLAINTEXT;}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===zt.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e);}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===qt.HTML){const e=this.treeAdapter.getTagName(this.fragmentContext);e===zt.TITLE||e===zt.TEXTAREA?this.tokenizer.state=Nt.MODE.RCDATA:e===zt.STYLE||e===zt.XMP||e===zt.IFRAME||e===zt.NOEMBED||e===zt.NOFRAMES||e===zt.NOSCRIPT?this.tokenizer.state=Nt.MODE.RAWTEXT:e===zt.SCRIPT?this.tokenizer.state=Nt.MODE.SCRIPT_DATA:e===zt.PLAINTEXT&&(this.tokenizer.state=Nt.MODE.PLAINTEXT);}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",s=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,n,s);}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e);}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n);}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n),this.openElements.push(n);}_insertFakeElement(e){const t=this.treeAdapter.createElement(e,qt.HTML,[]);this._attachElementToTree(t),this.openElements.push(t);}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,qt.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t),this.openElements.push(t);}_insertFakeRootElement(){const e=this.treeAdapter.createElement(zt.HTML,qt.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e);}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n);}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars);}}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n);}_shouldProcessTokenInForeignContent(e){const t=this._getAdjustedCurrentElement();if(!t||t===this.document)return !1;const n=this.treeAdapter.getNamespaceURI(t);if(n===qt.HTML)return !1;if(this.treeAdapter.getTagName(t)===zt.ANNOTATION_XML&&n===qt.MATHML&&e.type===Nt.START_TAG_TOKEN&&e.tagName===zt.SVG)return !1;const s=e.type===Nt.CHARACTER_TOKEN||e.type===Nt.NULL_CHARACTER_TOKEN||e.type===Nt.WHITESPACE_CHARACTER_TOKEN;return !((e.type===Nt.START_TAG_TOKEN&&e.tagName!==zt.MGLYPH&&e.tagName!==zt.MALIGNMARK||s)&&this._isIntegrationPoint(t,qt.MATHML)||(e.type===Nt.START_TAG_TOKEN||s)&&this._isIntegrationPoint(t,qt.HTML)||e.type===Nt.EOF_TOKEN)}_processToken(e){Ln[this.insertionMode][e.type](this,e);}_processTokenInBodyMode(e){Ln.IN_BODY_MODE[e.type](this,e);}_processTokenInForeignContent(e){e.type===Nt.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1;}(this,e):e.type===Nt.NULL_CHARACTER_TOKEN?function(e,t){t.chars=n,e._insertCharacters(t);}(this,e):e.type===Nt.WHITESPACE_CHARACTER_TOKEN?xn(this,e):e.type===Nt.COMMENT_TOKEN?Kn(this,e):e.type===Nt.START_TAG_TOKEN?function(e,t){if(jt.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==qt.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t);}else {const n=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(n);s===qt.MATHML?jt.adjustTokenMathMLAttrs(t):s===qt.SVG&&(jt.adjustTokenSVGTagName(t),jt.adjustTokenSVGAttrs(t)),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0;}}(this,e):e.type===Nt.END_TAG_TOKEN&&function(e,t){for(let n=e.openElements.stackTop;n>0;n--){const s=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(s)===qt.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(s).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(s);break}}}(this,e);}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===Nt.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err("non-void-html-element-start-tag-with-trailing-solidus");}_isIntegrationPoint(e,t){const n=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e),r=this.treeAdapter.getAttrList(e);return jt.isIntegrationPoint(n,s,r,t)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.length;if(e){let t=e,n=null;do{if(t--,n=this.activeFormattingElements.entries[t],n.type===kt.MARKER_ENTRY||this.openElements.contains(n.element)){t++;break}}while(t>0);for(let s=t;s<e;s++)n=this.activeFormattingElements.entries[s],this._insertElement(n.token,this.treeAdapter.getNamespaceURI(n.element)),n.element=this.openElements.current;}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=mn;}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(zt.P),this.openElements.popUntilTagNamePopped(zt.P);}_resetInsertionMode(){for(let e=this.openElements.stackTop,t=!1;e>=0;e--){let n=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(n=this.fragmentContext));const s=this.treeAdapter.getTagName(n),r=Rn[s];if(r){this.insertionMode=r;break}if(!(t||s!==zt.TD&&s!==zt.TH)){this.insertionMode=pn;break}if(!t&&s===zt.HEAD){this.insertionMode=sn;break}if(s===zt.SELECT){this._resetInsertionModeForSelect(e);break}if(s===zt.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(s===zt.HTML){this.insertionMode=this.headElement?on:nn;break}if(t){this.insertionMode=an;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.items[t],n=this.treeAdapter.getTagName(e);if(n===zt.TEMPLATE)break;if(n===zt.TABLE)return void(this.insertionMode=un)}this.insertionMode=An;}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e;}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop];}_isElementCausesFosterParenting(e){const t=this.treeAdapter.getTagName(e);return t===zt.TABLE||t===zt.TBODY||t===zt.TFOOT||t===zt.THEAD||t===zt.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){const e={parent:null,beforeElement:null};for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t],s=this.treeAdapter.getTagName(n),r=this.treeAdapter.getNamespaceURI(n);if(s===zt.TEMPLATE&&r===qt.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}if(s===zt.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e);}_fosterParentText(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e);}_isSpecialElement(e){const t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return Ct.SPECIAL_ELEMENTS[n][t]}};function Mn(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagName)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hs(e,t),n}function gn(e,t){let n=null;for(let s=e.openElements.stackTop;s>=0;s--){const r=e.openElements.items[s];if(r===t.element)break;e._isSpecialElement(r)&&(n=r);}return n||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),n}function Pn(e,t,n){let s=t,r=e.openElements.getCommonAncestor(t);for(let i=0,o=r;o!==n;i++,o=r){r=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),a=n&&i>=3;!n||a?(a&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Hn(e,n),s===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(o,s),s=o);}return s}function Hn(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function Dn(e,t,n){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(n);else {const s=e.treeAdapter.getTagName(t),r=e.treeAdapter.getNamespaceURI(t);s===zt.TEMPLATE&&r===qt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n);}}function Fn(e,t,n){const s=e.treeAdapter.getNamespaceURI(n.element),r=n.token,i=e.treeAdapter.createElement(r.tagName,s,r.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,n.token),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i);}function Un(e,t){let n;for(let s=0;s<8&&(n=Mn(e,t),n);s++){const t=gn(e,n);if(!t)break;e.activeFormattingElements.bookmark=n;const s=Pn(e,t,n.element),r=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(s),Dn(e,r,s),Fn(e,t,n);}}function Gn(){}function Bn(e){e._err("misplaced-doctype");}function Kn(e,t){e._appendCommentNode(t,e.openElements.currentTmplContent||e.openElements.current);}function bn(e,t){e._appendCommentNode(t,e.document);}function xn(e,t){e._insertCharacters(t);}function yn(e){e.stopped=!0;}function vn(e,t){e._err("missing-doctype",{beforeToken:!0}),e.treeAdapter.setDocumentMode(e.document,Ct.DOCUMENT_MODE.QUIRKS),e.insertionMode=tn,e._processToken(t);}function Yn(e,t){e._insertFakeRootElement(),e.insertionMode=nn,e._processToken(t);}function wn(e,t){e._insertFakeElement(zt.HEAD),e.headElement=e.openElements.current,e.insertionMode=sn,e._processToken(t);}function Qn(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TITLE?e._switchToTextParsing(t,Nt.MODE.RCDATA):n===zt.NOSCRIPT?e.options.scriptingEnabled?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):(e._insertElement(t,qt.HTML),e.insertionMode=rn):n===zt.NOFRAMES||n===zt.STYLE?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):n===zt.SCRIPT?e._switchToTextParsing(t,Nt.MODE.SCRIPT_DATA):n===zt.TEMPLATE?(e._insertTemplate(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Nn,e._pushTmplInsertionMode(Nn)):n===zt.HEAD?e._err(k):Wn(e,t);}function Xn(e,t){const n=t.tagName;n===zt.HEAD?(e.openElements.pop(),e.insertionMode=on):n===zt.BODY||n===zt.BR||n===zt.HTML?Wn(e,t):n===zt.TEMPLATE&&e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==zt.TEMPLATE&&e._err("closing-of-element-with-open-child-elements"),e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(L);}function Wn(e,t){e.openElements.pop(),e.insertionMode=on,e._processToken(t);}function Vn(e,t){const n=t.type===Nt.EOF_TOKEN?"open-elements-left-after-eof":"disallowed-content-in-noscript-in-head";e._err(n),e.openElements.pop(),e.insertionMode=sn,e._processToken(t);}function jn(e,t){e._insertFakeElement(zt.BODY),e.insertionMode=an,e._processToken(t);}function zn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t);}function qn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1;}function Jn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}function Zn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1;}function $n(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}function es(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1;}function ts(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}function ns(e,t){e._appendElement(t,qt.HTML),t.ackSelfClosing=!0;}function ss(e,t){e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}function rs(e,t){e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function is(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,qt.HTML);}function os(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function as(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.I||n===zt.S||n===zt.B||n===zt.U?$n(e,t):n===zt.P?Jn(e,t):n===zt.A?function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(zt.A);n&&(Un(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):os(e,t);break;case 2:n===zt.DL||n===zt.OL||n===zt.UL?Jn(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement();const n=e.openElements.currentTagName;n!==zt.H1&&n!==zt.H2&&n!==zt.H3&&n!==zt.H4&&n!==zt.H5&&n!==zt.H6||e.openElements.pop(),e._insertElement(t,qt.HTML);}(e,t):n===zt.LI||n===zt.DD||n===zt.DT?function(e,t){e.framesetOk=!1;const n=t.tagName;for(let t=e.openElements.stackTop;t>=0;t--){const s=e.openElements.items[t],r=e.treeAdapter.getTagName(s);let i=null;if(n===zt.LI&&r===zt.LI?i=zt.LI:n!==zt.DD&&n!==zt.DT||r!==zt.DD&&r!==zt.DT||(i=r),i){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(r!==zt.ADDRESS&&r!==zt.DIV&&r!==zt.P&&e._isSpecialElement(s))break}e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n===zt.EM||n===zt.TT?$n(e,t):n===zt.BR?ts(e,t):n===zt.HR?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}(e,t):n===zt.RB?is(e,t):n===zt.RT||n===zt.RP?function(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(zt.RTC),e._insertElement(t,qt.HTML);}(e,t):n!==zt.TH&&n!==zt.TD&&n!==zt.TR&&os(e,t);break;case 3:n===zt.DIV||n===zt.DIR||n===zt.NAV?Jn(e,t):n===zt.PRE?Zn(e,t):n===zt.BIG?$n(e,t):n===zt.IMG||n===zt.WBR?ts(e,t):n===zt.XMP?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SVG?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenSVGAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.SVG):e._insertElement(t,qt.SVG),t.ackSelfClosing=!0;}(e,t):n===zt.RTC?is(e,t):n!==zt.COL&&os(e,t);break;case 4:n===zt.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs);}(e,t):n===zt.BASE||n===zt.LINK||n===zt.META?Qn(e,t):n===zt.BODY?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs));}(e,t):n===zt.MAIN||n===zt.MENU?Jn(e,t):n===zt.FORM?function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),n||(e.formElement=e.openElements.current));}(e,t):n===zt.CODE||n===zt.FONT?$n(e,t):n===zt.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(zt.NOBR)&&(Un(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):n===zt.AREA?ts(e,t):n===zt.MATH?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenMathMLAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.MATHML):e._insertElement(t,qt.MATHML),t.ackSelfClosing=!0;}(e,t):n===zt.MENU?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n!==zt.HEAD&&os(e,t);break;case 5:n===zt.STYLE||n===zt.TITLE?Qn(e,t):n===zt.ASIDE?Jn(e,t):n===zt.SMALL?$n(e,t):n===zt.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ct.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=En;}(e,t):n===zt.EMBED?ts(e,t):n===zt.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML);const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t||(e.framesetOk=!1),t.ackSelfClosing=!0;}(e,t):n===zt.PARAM||n===zt.TRACK?ns(e,t):n===zt.IMAGE?function(e,t){t.tagName=zt.IMG,ts(e,t);}(e,t):n!==zt.FRAME&&n!==zt.TBODY&&n!==zt.TFOOT&&n!==zt.THEAD&&os(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Jn(e,t):n===zt.BUTTON?function(e,t){e.openElements.hasInScope(zt.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1;}(e,t):n===zt.STRIKE||n===zt.STRONG?$n(e,t):n===zt.APPLET||n===zt.OBJECT?es(e,t):n===zt.KEYGEN?ts(e,t):n===zt.SOURCE?ns(e,t):n===zt.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode===En||e.insertionMode===cn||e.insertionMode===ln||e.insertionMode===mn||e.insertionMode===pn?e.insertionMode=un:e.insertionMode=An;}(e,t):n===zt.OPTION?rs(e,t):os(e,t);break;case 7:n===zt.BGSOUND?Qn(e,t):n===zt.DETAILS||n===zt.ADDRESS||n===zt.ARTICLE||n===zt.SECTION||n===zt.SUMMARY?Jn(e,t):n===zt.LISTING?Zn(e,t):n===zt.MARQUEE?es(e,t):n===zt.NOEMBED?ss(e,t):n!==zt.CAPTION&&os(e,t);break;case 8:n===zt.BASEFONT?Qn(e,t):n===zt.FRAMESET?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,qt.HTML),e.insertionMode=Cn);}(e,t):n===zt.FIELDSET?Jn(e,t):n===zt.TEXTAREA?function(e,t){e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Nt.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Tn;}(e,t):n===zt.TEMPLATE?Qn(e,t):n===zt.NOSCRIPT?e.options.scriptingEnabled?ss(e,t):os(e,t):n===zt.OPTGROUP?rs(e,t):n!==zt.COLGROUP&&os(e,t);break;case 9:n===zt.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.tokenizer.state=Nt.MODE.PLAINTEXT;}(e,t):os(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Jn(e,t):os(e,t);break;default:os(e,t);}}function Ts(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n));}function Es(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker());}function hs(e,t){const n=t.tagName;for(let t=e.openElements.stackTop;t>0;t--){const s=e.openElements.items[t];if(e.treeAdapter.getTagName(s)===n){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilElementPopped(s);break}if(e._isSpecialElement(s))break}}function cs(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.A||n===zt.B||n===zt.I||n===zt.S||n===zt.U?Un(e,t):n===zt.P?function(e){e.openElements.hasInButtonScope(zt.P)||e._insertFakeElement(zt.P),e._closePElement();}(e):hs(e,t);break;case 2:n===zt.DL||n===zt.UL||n===zt.OL?Ts(e,t):n===zt.LI?function(e){e.openElements.hasInListItemScope(zt.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(zt.LI),e.openElements.popUntilTagNamePopped(zt.LI));}(e):n===zt.DD||n===zt.DT?function(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n));}(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped());}(e):n===zt.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(zt.BR),e.openElements.pop(),e.framesetOk=!1;}(e):n===zt.EM||n===zt.TT?Un(e,t):hs(e,t);break;case 3:n===zt.BIG?Un(e,t):n===zt.DIR||n===zt.DIV||n===zt.NAV||n===zt.PRE?Ts(e,t):hs(e,t);break;case 4:n===zt.BODY?function(e){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn);}(e):n===zt.HTML?function(e,t){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn,e._processToken(t));}(e,t):n===zt.FORM?function(e){const t=e.openElements.tmplCount>0,n=e.formElement;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(zt.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(zt.FORM):e.openElements.remove(n));}(e):n===zt.CODE||n===zt.FONT||n===zt.NOBR?Un(e,t):n===zt.MAIN||n===zt.MENU?Ts(e,t):hs(e,t);break;case 5:n===zt.ASIDE?Ts(e,t):n===zt.SMALL?Un(e,t):hs(e,t);break;case 6:n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Ts(e,t):n===zt.APPLET||n===zt.OBJECT?Es(e,t):n===zt.STRIKE||n===zt.STRONG?Un(e,t):hs(e,t);break;case 7:n===zt.ADDRESS||n===zt.ARTICLE||n===zt.DETAILS||n===zt.SECTION||n===zt.SUMMARY||n===zt.LISTING?Ts(e,t):n===zt.MARQUEE?Es(e,t):hs(e,t);break;case 8:n===zt.FIELDSET?Ts(e,t):n===zt.TEMPLATE?Xn(e,t):hs(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Ts(e,t):hs(e,t);break;default:hs(e,t);}}function _s(e,t){e.tmplInsertionModeStackTop>-1?Os(e,t):e.stopped=!0;}function ls(e,t){const n=e.openElements.currentTagName;n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=hn,e._processToken(t)):As(e,t);}function ms(e,t){const n=t.tagName;switch(n.length){case 2:n===zt.TD||n===zt.TH||n===zt.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.TBODY),e.insertionMode=ln,e._processToken(t);}(e,t):As(e,t);break;case 3:n===zt.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.COLGROUP),e.insertionMode=_n,e._processToken(t);}(e,t):As(e,t);break;case 4:n===zt.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,qt.HTML),e.formElement=e.openElements.current,e.openElements.pop());}(e,t):As(e,t);break;case 5:n===zt.TABLE?function(e,t){e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode(),e._processToken(t));}(e,t):n===zt.STYLE?Qn(e,t):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=ln;}(e,t):n===zt.INPUT?function(e,t){const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t?e._appendElement(t,qt.HTML):As(e,t),t.ackSelfClosing=!0;}(e,t):As(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):As(e,t);break;case 7:n===zt.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,qt.HTML),e.insertionMode=cn;}(e,t):As(e,t);break;case 8:n===zt.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=_n;}(e,t):n===zt.TEMPLATE?Qn(e,t):As(e,t);break;default:As(e,t);}}function ps(e,t){const n=t.tagName;n===zt.TABLE?e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode()):n===zt.TEMPLATE?Xn(e,t):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&As(e,t);}function As(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=n;}function us(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)As(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t);}function Ns(e,t){e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En,e._processToken(t));}function ds(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.OPTION?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.OPTGROUP?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.INPUT||n===zt.KEYGEN||n===zt.TEXTAREA||n===zt.SELECT?e.openElements.hasInSelectScope(zt.SELECT)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),n!==zt.SELECT&&e._processToken(t)):n!==zt.SCRIPT&&n!==zt.TEMPLATE||Qn(e,t);}function Cs(e,t){const n=t.tagName;if(n===zt.OPTGROUP){const t=e.openElements.items[e.openElements.stackTop-1],n=t&&e.treeAdapter.getTagName(t);e.openElements.currentTagName===zt.OPTION&&n===zt.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop();}else n===zt.OPTION?e.openElements.currentTagName===zt.OPTION&&e.openElements.pop():n===zt.SELECT&&e.openElements.hasInSelectScope(zt.SELECT)?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode()):n===zt.TEMPLATE&&Xn(e,t);}function Os(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0;}function fs(e,t){e.insertionMode=an,e._processToken(t);}function Ss(e,t){e.insertionMode=an,e._processToken(t);}return e.parse=function(e,t){return new kn(t).parse(e)},e.parseFragment=function(e,t,n){return "string"==typeof e&&(n=t,t=e,e=null),new kn(n).parseFragment(t,e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});const parse$3=e.parse;const parseFragment=e.parseFragment;
- const docParser = new WeakMap();
- function parseDocumentUtil(ownerDocument, html) {
- const doc = parse$3(html.trim(), getParser(ownerDocument));
- doc.documentElement = doc.firstElementChild;
- doc.head = doc.documentElement.firstElementChild;
- doc.body = doc.head.nextElementSibling;
- return doc;
- }
- function parseFragmentUtil(ownerDocument, html) {
- if (typeof html === 'string') {
- html = html.trim();
- }
- else {
- html = '';
- }
- const frag = parseFragment(html, getParser(ownerDocument));
- return frag;
- }
- function getParser(ownerDocument) {
- let parseOptions = docParser.get(ownerDocument);
- if (parseOptions != null) {
- return parseOptions;
- }
- const treeAdapter = {
- createDocument() {
- const doc = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
- doc['x-mode'] = 'no-quirks';
- return doc;
- },
- setNodeSourceCodeLocation(node, location) {
- node.sourceCodeLocation = location;
- },
- getNodeSourceCodeLocation(node) {
- return node.sourceCodeLocation;
- },
- createDocumentFragment() {
- return ownerDocument.createDocumentFragment();
- },
- createElement(tagName, namespaceURI, attrs) {
- const elm = ownerDocument.createElementNS(namespaceURI, tagName);
- for (let i = 0; i < attrs.length; i++) {
- const attr = attrs[i];
- if (attr.namespace == null || attr.namespace === 'http://www.w3.org/1999/xhtml') {
- elm.setAttribute(attr.name, attr.value);
- }
- else {
- elm.setAttributeNS(attr.namespace, attr.name, attr.value);
- }
- }
- return elm;
- },
- createCommentNode(data) {
- return ownerDocument.createComment(data);
- },
- appendChild(parentNode, newNode) {
- parentNode.appendChild(newNode);
- },
- insertBefore(parentNode, newNode, referenceNode) {
- parentNode.insertBefore(newNode, referenceNode);
- },
- setTemplateContent(templateElement, contentElement) {
- templateElement.content = contentElement;
- },
- getTemplateContent(templateElement) {
- return templateElement.content;
- },
- setDocumentType(doc, name, publicId, systemId) {
- let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
- if (doctypeNode == null) {
- doctypeNode = ownerDocument.createDocumentTypeNode();
- doc.insertBefore(doctypeNode, doc.firstChild);
- }
- doctypeNode.nodeValue = '!DOCTYPE';
- doctypeNode['x-name'] = name;
- doctypeNode['x-publicId'] = publicId;
- doctypeNode['x-systemId'] = systemId;
- },
- setDocumentMode(doc, mode) {
- doc['x-mode'] = mode;
- },
- getDocumentMode(doc) {
- return doc['x-mode'];
- },
- detachNode(node) {
- node.remove();
- },
- insertText(parentNode, text) {
- const lastChild = parentNode.lastChild;
- if (lastChild != null && lastChild.nodeType === 3 /* TEXT_NODE */) {
- lastChild.nodeValue += text;
- }
- else {
- parentNode.appendChild(ownerDocument.createTextNode(text));
- }
- },
- insertTextBefore(parentNode, text, referenceNode) {
- const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
- if (prevNode != null && prevNode.nodeType === 3 /* TEXT_NODE */) {
- prevNode.nodeValue += text;
- }
- else {
- parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
- }
- },
- adoptAttributes(recipient, attrs) {
- for (let i = 0; i < attrs.length; i++) {
- const attr = attrs[i];
- if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
- recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
- }
- }
- },
- getFirstChild(node) {
- return node.childNodes[0];
- },
- getChildNodes(node) {
- return node.childNodes;
- },
- getParentNode(node) {
- return node.parentNode;
- },
- getAttrList(element) {
- const attrs = element.attributes.__items.map((attr) => {
- return {
- name: attr.name,
- value: attr.value,
- namespace: attr.namespaceURI,
- prefix: null,
- };
- });
- return attrs;
- },
- getTagName(element) {
- if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
- return element.nodeName.toLowerCase();
- }
- else {
- return element.nodeName;
- }
- },
- getNamespaceURI(element) {
- return element.namespaceURI;
- },
- getTextNodeContent(textNode) {
- return textNode.nodeValue;
- },
- getCommentNodeContent(commentNode) {
- return commentNode.nodeValue;
- },
- getDocumentTypeNodeName(doctypeNode) {
- return doctypeNode['x-name'];
- },
- getDocumentTypeNodePublicId(doctypeNode) {
- return doctypeNode['x-publicId'];
- },
- getDocumentTypeNodeSystemId(doctypeNode) {
- return doctypeNode['x-systemId'];
- },
- isTextNode(node) {
- return node.nodeType === 3 /* TEXT_NODE */;
- },
- isCommentNode(node) {
- return node.nodeType === 8 /* COMMENT_NODE */;
- },
- isDocumentTypeNode(node) {
- return node.nodeType === 10 /* DOCUMENT_TYPE_NODE */;
- },
- isElementNode(node) {
- return node.nodeType === 1 /* ELEMENT_NODE */;
- },
- };
- parseOptions = {
- treeAdapter: treeAdapter,
- };
- docParser.set(ownerDocument, parseOptions);
- return parseOptions;
- }
- class MockNode {
- constructor(ownerDocument, nodeType, nodeName, nodeValue) {
- this.ownerDocument = ownerDocument;
- this.nodeType = nodeType;
- this.nodeName = nodeName;
- this._nodeValue = nodeValue;
- this.parentNode = null;
- this.childNodes = [];
- }
- appendChild(newNode) {
- if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
- const nodes = newNode.childNodes.slice();
- for (const child of nodes) {
- this.appendChild(child);
- }
- }
- else {
- newNode.remove();
- newNode.parentNode = this;
- this.childNodes.push(newNode);
- connectNode(this.ownerDocument, newNode);
- }
- return newNode;
- }
- append(...items) {
- items.forEach((item) => {
- const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
- this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
- });
- }
- prepend(...items) {
- const firstChild = this.firstChild;
- items.forEach((item) => {
- const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
- this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
- });
- }
- cloneNode(deep) {
- throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
- }
- compareDocumentPosition(_other) {
- // unimplemented
- // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
- return -1;
- }
- get firstChild() {
- return this.childNodes[0] || null;
- }
- insertBefore(newNode, referenceNode) {
- if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
- for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
- insertBefore(this, newNode.childNodes[i], referenceNode);
- }
- }
- else {
- insertBefore(this, newNode, referenceNode);
- }
- return newNode;
- }
- get isConnected() {
- let node = this;
- while (node != null) {
- if (node.nodeType === 9 /* DOCUMENT_NODE */) {
- return true;
- }
- node = node.parentNode;
- if (node != null && node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
- node = node.host;
- }
- }
- return false;
- }
- isSameNode(node) {
- return this === node;
- }
- get lastChild() {
- return this.childNodes[this.childNodes.length - 1] || null;
- }
- get nextSibling() {
- if (this.parentNode != null) {
- const index = this.parentNode.childNodes.indexOf(this) + 1;
- return this.parentNode.childNodes[index] || null;
- }
- return null;
- }
- get nodeValue() {
- return this._nodeValue;
- }
- set nodeValue(value) {
- this._nodeValue = value;
- }
- get parentElement() {
- return this.parentNode || null;
- }
- set parentElement(value) {
- this.parentNode = value;
- }
- get previousSibling() {
- if (this.parentNode != null) {
- const index = this.parentNode.childNodes.indexOf(this) - 1;
- return this.parentNode.childNodes[index] || null;
- }
- return null;
- }
- contains(otherNode) {
- if (otherNode === this) {
- return true;
- }
- return this.childNodes.includes(otherNode);
- }
- removeChild(childNode) {
- const index = this.childNodes.indexOf(childNode);
- if (index > -1) {
- this.childNodes.splice(index, 1);
- if (this.nodeType === 1 /* ELEMENT_NODE */) {
- const wasConnected = this.isConnected;
- childNode.parentNode = null;
- if (wasConnected === true) {
- disconnectNode(childNode);
- }
- }
- else {
- childNode.parentNode = null;
- }
- }
- else {
- throw new Error(`node not found within childNodes during removeChild`);
- }
- return childNode;
- }
- remove() {
- if (this.parentNode != null) {
- this.parentNode.removeChild(this);
- }
- }
- replaceChild(newChild, oldChild) {
- if (oldChild.parentNode === this) {
- this.insertBefore(newChild, oldChild);
- oldChild.remove();
- return newChild;
- }
- return null;
- }
- get textContent() {
- return this._nodeValue;
- }
- set textContent(value) {
- this._nodeValue = String(value);
- }
- }
- MockNode.ELEMENT_NODE = 1;
- MockNode.TEXT_NODE = 3;
- MockNode.PROCESSING_INSTRUCTION_NODE = 7;
- MockNode.COMMENT_NODE = 8;
- MockNode.DOCUMENT_NODE = 9;
- MockNode.DOCUMENT_TYPE_NODE = 10;
- MockNode.DOCUMENT_FRAGMENT_NODE = 11;
- class MockNodeList {
- constructor(ownerDocument, childNodes, length) {
- this.ownerDocument = ownerDocument;
- this.childNodes = childNodes;
- this.length = length;
- }
- }
- class MockElement extends MockNode {
- constructor(ownerDocument, nodeName) {
- super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === 'string' ? nodeName : null, null);
- this.namespaceURI = null;
- }
- addEventListener(type, handler) {
- addEventListener(this, type, handler);
- }
- attachShadow(_opts) {
- const shadowRoot = this.ownerDocument.createDocumentFragment();
- this.shadowRoot = shadowRoot;
- return shadowRoot;
- }
- get shadowRoot() {
- return this.__shadowRoot || null;
- }
- set shadowRoot(shadowRoot) {
- if (shadowRoot != null) {
- shadowRoot.host = this;
- this.__shadowRoot = shadowRoot;
- }
- else {
- delete this.__shadowRoot;
- }
- }
- get attributes() {
- if (this.__attributeMap == null) {
- this.__attributeMap = createAttributeProxy(false);
- }
- return this.__attributeMap;
- }
- set attributes(attrs) {
- this.__attributeMap = attrs;
- }
- get children() {
- return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */);
- }
- get childElementCount() {
- return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */).length;
- }
- get className() {
- return this.getAttributeNS(null, 'class') || '';
- }
- set className(value) {
- this.setAttributeNS(null, 'class', value);
- }
- get classList() {
- return new MockClassList(this);
- }
- click() {
- dispatchEvent(this, new MockEvent('click', { bubbles: true, cancelable: true, composed: true }));
- }
- cloneNode(_deep) {
- // implemented on MockElement.prototype from within element.ts
- return null;
- }
- closest(selector) {
- let elm = this;
- while (elm != null) {
- if (elm.matches(selector)) {
- return elm;
- }
- elm = elm.parentNode;
- }
- return null;
- }
- get dataset() {
- return dataset(this);
- }
- get dir() {
- return this.getAttributeNS(null, 'dir') || '';
- }
- set dir(value) {
- this.setAttributeNS(null, 'dir', value);
- }
- dispatchEvent(ev) {
- return dispatchEvent(this, ev);
- }
- get firstElementChild() {
- return this.children[0] || null;
- }
- getAttribute(attrName) {
- if (attrName === 'style') {
- if (this.__style != null && this.__style.length > 0) {
- return this.style.cssText;
- }
- return null;
- }
- const attr = this.attributes.getNamedItem(attrName);
- if (attr != null) {
- return attr.value;
- }
- return null;
- }
- getAttributeNS(namespaceURI, attrName) {
- const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
- if (attr != null) {
- return attr.value;
- }
- return null;
- }
- getBoundingClientRect() {
- return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
- }
- getRootNode(opts) {
- const isComposed = opts != null && opts.composed === true;
- let node = this;
- while (node.parentNode != null) {
- node = node.parentNode;
- if (isComposed === true && node.parentNode == null && node.host != null) {
- node = node.host;
- }
- }
- return node;
- }
- get draggable() {
- return this.getAttributeNS(null, 'draggable') === 'true';
- }
- set draggable(value) {
- this.setAttributeNS(null, 'draggable', value);
- }
- hasChildNodes() {
- return this.childNodes.length > 0;
- }
- get id() {
- return this.getAttributeNS(null, 'id') || '';
- }
- set id(value) {
- this.setAttributeNS(null, 'id', value);
- }
- get innerHTML() {
- if (this.childNodes.length === 0) {
- return '';
- }
- return serializeNodeToHtml(this, {
- newLines: false,
- indentSpaces: 0,
- });
- }
- set innerHTML(html) {
- if (NON_ESCAPABLE_CONTENT.has(this.nodeName) === true) {
- setTextContent(this, html);
- }
- else {
- for (let i = this.childNodes.length - 1; i >= 0; i--) {
- this.removeChild(this.childNodes[i]);
- }
- if (typeof html === 'string') {
- const frag = parseFragmentUtil(this.ownerDocument, html);
- while (frag.childNodes.length > 0) {
- this.appendChild(frag.childNodes[0]);
- }
- }
- }
- }
- get innerText() {
- const text = [];
- getTextContent(this.childNodes, text);
- return text.join('');
- }
- set innerText(value) {
- setTextContent(this, value);
- }
- insertAdjacentElement(position, elm) {
- if (position === 'beforebegin') {
- insertBefore(this.parentNode, elm, this);
- }
- else if (position === 'afterbegin') {
- this.prepend(elm);
- }
- else if (position === 'beforeend') {
- this.appendChild(elm);
- }
- else if (position === 'afterend') {
- insertBefore(this.parentNode, elm, this.nextSibling);
- }
- return elm;
- }
- insertAdjacentHTML(position, html) {
- const frag = parseFragmentUtil(this.ownerDocument, html);
- if (position === 'beforebegin') {
- while (frag.childNodes.length > 0) {
- insertBefore(this.parentNode, frag.childNodes[0], this);
- }
- }
- else if (position === 'afterbegin') {
- while (frag.childNodes.length > 0) {
- this.prepend(frag.childNodes[frag.childNodes.length - 1]);
- }
- }
- else if (position === 'beforeend') {
- while (frag.childNodes.length > 0) {
- this.appendChild(frag.childNodes[0]);
- }
- }
- else if (position === 'afterend') {
- while (frag.childNodes.length > 0) {
- insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
- }
- }
- }
- insertAdjacentText(position, text) {
- const elm = this.ownerDocument.createTextNode(text);
- if (position === 'beforebegin') {
- insertBefore(this.parentNode, elm, this);
- }
- else if (position === 'afterbegin') {
- this.prepend(elm);
- }
- else if (position === 'beforeend') {
- this.appendChild(elm);
- }
- else if (position === 'afterend') {
- insertBefore(this.parentNode, elm, this.nextSibling);
- }
- }
- hasAttribute(attrName) {
- if (attrName === 'style') {
- return this.__style != null && this.__style.length > 0;
- }
- return this.getAttribute(attrName) !== null;
- }
- hasAttributeNS(namespaceURI, name) {
- return this.getAttributeNS(namespaceURI, name) !== null;
- }
- get hidden() {
- return this.hasAttributeNS(null, 'hidden');
- }
- set hidden(isHidden) {
- if (isHidden === true) {
- this.setAttributeNS(null, 'hidden', '');
- }
- else {
- this.removeAttributeNS(null, 'hidden');
- }
- }
- get lang() {
- return this.getAttributeNS(null, 'lang') || '';
- }
- set lang(value) {
- this.setAttributeNS(null, 'lang', value);
- }
- get lastElementChild() {
- const children = this.children;
- return children[children.length - 1] || null;
- }
- matches(selector) {
- return matches(selector, this);
- }
- get nextElementSibling() {
- const parentElement = this.parentElement;
- if (parentElement != null &&
- (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
- parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
- parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
- const children = parentElement.children;
- const index = children.indexOf(this) + 1;
- return parentElement.children[index] || null;
- }
- return null;
- }
- get outerHTML() {
- return serializeNodeToHtml(this, {
- newLines: false,
- outerHtml: true,
- indentSpaces: 0,
- });
- }
- get previousElementSibling() {
- const parentElement = this.parentElement;
- if (parentElement != null &&
- (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
- parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
- parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
- const children = parentElement.children;
- const index = children.indexOf(this) - 1;
- return parentElement.children[index] || null;
- }
- return null;
- }
- getElementsByClassName(classNames) {
- const classes = classNames
- .trim()
- .split(' ')
- .filter((c) => c.length > 0);
- const results = [];
- getElementsByClassName(this, classes, results);
- return results;
- }
- getElementsByTagName(tagName) {
- const results = [];
- getElementsByTagName(this, tagName.toLowerCase(), results);
- return results;
- }
- querySelector(selector) {
- return selectOne(selector, this);
- }
- querySelectorAll(selector) {
- return selectAll(selector, this);
- }
- removeAttribute(attrName) {
- if (attrName === 'style') {
- delete this.__style;
- }
- else {
- const attr = this.attributes.getNamedItem(attrName);
- if (attr != null) {
- this.attributes.removeNamedItemNS(attr);
- if (checkAttributeChanged(this) === true) {
- attributeChanged(this, attrName, attr.value, null);
- }
- }
- }
- }
- removeAttributeNS(namespaceURI, attrName) {
- const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
- if (attr != null) {
- this.attributes.removeNamedItemNS(attr);
- if (checkAttributeChanged(this) === true) {
- attributeChanged(this, attrName, attr.value, null);
- }
- }
- }
- removeEventListener(type, handler) {
- removeEventListener(this, type, handler);
- }
- setAttribute(attrName, value) {
- if (attrName === 'style') {
- this.style = value;
- }
- else {
- const attributes = this.attributes;
- let attr = attributes.getNamedItem(attrName);
- const checkAttrChanged = checkAttributeChanged(this);
- if (attr != null) {
- if (checkAttrChanged === true) {
- const oldValue = attr.value;
- attr.value = value;
- if (oldValue !== attr.value) {
- attributeChanged(this, attr.name, oldValue, attr.value);
- }
- }
- else {
- attr.value = value;
- }
- }
- else {
- if (attributes.caseInsensitive) {
- attrName = attrName.toLowerCase();
- }
- attr = new MockAttr(attrName, value);
- attributes.__items.push(attr);
- if (checkAttrChanged === true) {
- attributeChanged(this, attrName, null, attr.value);
- }
- }
- }
- }
- setAttributeNS(namespaceURI, attrName, value) {
- const attributes = this.attributes;
- let attr = attributes.getNamedItemNS(namespaceURI, attrName);
- const checkAttrChanged = checkAttributeChanged(this);
- if (attr != null) {
- if (checkAttrChanged === true) {
- const oldValue = attr.value;
- attr.value = value;
- if (oldValue !== attr.value) {
- attributeChanged(this, attr.name, oldValue, attr.value);
- }
- }
- else {
- attr.value = value;
- }
- }
- else {
- attr = new MockAttr(attrName, value, namespaceURI);
- attributes.__items.push(attr);
- if (checkAttrChanged === true) {
- attributeChanged(this, attrName, null, attr.value);
- }
- }
- }
- get style() {
- if (this.__style == null) {
- this.__style = createCSSStyleDeclaration();
- }
- return this.__style;
- }
- set style(val) {
- if (typeof val === 'string') {
- if (this.__style == null) {
- this.__style = createCSSStyleDeclaration();
- }
- this.__style.cssText = val;
- }
- else {
- this.__style = val;
- }
- }
- get tabIndex() {
- return parseInt(this.getAttributeNS(null, 'tabindex') || '-1', 10);
- }
- set tabIndex(value) {
- this.setAttributeNS(null, 'tabindex', value);
- }
- get tagName() {
- return this.nodeName;
- }
- set tagName(value) {
- this.nodeName = value;
- }
- get textContent() {
- const text = [];
- getTextContent(this.childNodes, text);
- return text.join('');
- }
- set textContent(value) {
- setTextContent(this, value);
- }
- get title() {
- return this.getAttributeNS(null, 'title') || '';
- }
- set title(value) {
- this.setAttributeNS(null, 'title', value);
- }
- onanimationstart() {
- /**/
- }
- onanimationend() {
- /**/
- }
- onanimationiteration() {
- /**/
- }
- onabort() {
- /**/
- }
- onauxclick() {
- /**/
- }
- onbeforecopy() {
- /**/
- }
- onbeforecut() {
- /**/
- }
- onbeforepaste() {
- /**/
- }
- onblur() {
- /**/
- }
- oncancel() {
- /**/
- }
- oncanplay() {
- /**/
- }
- oncanplaythrough() {
- /**/
- }
- onchange() {
- /**/
- }
- onclick() {
- /**/
- }
- onclose() {
- /**/
- }
- oncontextmenu() {
- /**/
- }
- oncopy() {
- /**/
- }
- oncuechange() {
- /**/
- }
- oncut() {
- /**/
- }
- ondblclick() {
- /**/
- }
- ondrag() {
- /**/
- }
- ondragend() {
- /**/
- }
- ondragenter() {
- /**/
- }
- ondragleave() {
- /**/
- }
- ondragover() {
- /**/
- }
- ondragstart() {
- /**/
- }
- ondrop() {
- /**/
- }
- ondurationchange() {
- /**/
- }
- onemptied() {
- /**/
- }
- onended() {
- /**/
- }
- onerror() {
- /**/
- }
- onfocus() {
- /**/
- }
- onfocusin() {
- /**/
- }
- onfocusout() {
- /**/
- }
- onformdata() {
- /**/
- }
- onfullscreenchange() {
- /**/
- }
- onfullscreenerror() {
- /**/
- }
- ongotpointercapture() {
- /**/
- }
- oninput() {
- /**/
- }
- oninvalid() {
- /**/
- }
- onkeydown() {
- /**/
- }
- onkeypress() {
- /**/
- }
- onkeyup() {
- /**/
- }
- onload() {
- /**/
- }
- onloadeddata() {
- /**/
- }
- onloadedmetadata() {
- /**/
- }
- onloadstart() {
- /**/
- }
- onlostpointercapture() {
- /**/
- }
- onmousedown() {
- /**/
- }
- onmouseenter() {
- /**/
- }
- onmouseleave() {
- /**/
- }
- onmousemove() {
- /**/
- }
- onmouseout() {
- /**/
- }
- onmouseover() {
- /**/
- }
- onmouseup() {
- /**/
- }
- onmousewheel() {
- /**/
- }
- onpaste() {
- /**/
- }
- onpause() {
- /**/
- }
- onplay() {
- /**/
- }
- onplaying() {
- /**/
- }
- onpointercancel() {
- /**/
- }
- onpointerdown() {
- /**/
- }
- onpointerenter() {
- /**/
- }
- onpointerleave() {
- /**/
- }
- onpointermove() {
- /**/
- }
- onpointerout() {
- /**/
- }
- onpointerover() {
- /**/
- }
- onpointerup() {
- /**/
- }
- onprogress() {
- /**/
- }
- onratechange() {
- /**/
- }
- onreset() {
- /**/
- }
- onresize() {
- /**/
- }
- onscroll() {
- /**/
- }
- onsearch() {
- /**/
- }
- onseeked() {
- /**/
- }
- onseeking() {
- /**/
- }
- onselect() {
- /**/
- }
- onselectstart() {
- /**/
- }
- onstalled() {
- /**/
- }
- onsubmit() {
- /**/
- }
- onsuspend() {
- /**/
- }
- ontimeupdate() {
- /**/
- }
- ontoggle() {
- /**/
- }
- onvolumechange() {
- /**/
- }
- onwaiting() {
- /**/
- }
- onwebkitfullscreenchange() {
- /**/
- }
- onwebkitfullscreenerror() {
- /**/
- }
- onwheel() {
- /**/
- }
- toString(opts) {
- return serializeNodeToHtml(this, opts);
- }
- }
- function getElementsByClassName(elm, classNames, foundElms) {
- const children = elm.children;
- for (let i = 0, ii = children.length; i < ii; i++) {
- const childElm = children[i];
- for (let j = 0, jj = classNames.length; j < jj; j++) {
- if (childElm.classList.contains(classNames[j])) {
- foundElms.push(childElm);
- }
- }
- getElementsByClassName(childElm, classNames, foundElms);
- }
- }
- function getElementsByTagName(elm, tagName, foundElms) {
- const children = elm.children;
- for (let i = 0, ii = children.length; i < ii; i++) {
- const childElm = children[i];
- if (tagName === '*' || childElm.nodeName.toLowerCase() === tagName) {
- foundElms.push(childElm);
- }
- getElementsByTagName(childElm, tagName, foundElms);
- }
- }
- function resetElement(elm) {
- resetEventListeners(elm);
- delete elm.__attributeMap;
- delete elm.__shadowRoot;
- delete elm.__style;
- }
- function insertBefore(parentNode, newNode, referenceNode) {
- if (newNode !== referenceNode) {
- newNode.remove();
- newNode.parentNode = parentNode;
- newNode.ownerDocument = parentNode.ownerDocument;
- if (referenceNode != null) {
- const index = parentNode.childNodes.indexOf(referenceNode);
- if (index > -1) {
- parentNode.childNodes.splice(index, 0, newNode);
- }
- else {
- throw new Error(`referenceNode not found in parentNode.childNodes`);
- }
- }
- else {
- parentNode.childNodes.push(newNode);
- }
- connectNode(parentNode.ownerDocument, newNode);
- }
- return newNode;
- }
- class MockHTMLElement extends MockElement {
- constructor(ownerDocument, nodeName) {
- super(ownerDocument, typeof nodeName === 'string' ? nodeName.toUpperCase() : null);
- this.namespaceURI = 'http://www.w3.org/1999/xhtml';
- }
- get tagName() {
- return this.nodeName;
- }
- set tagName(value) {
- this.nodeName = value;
- }
- get attributes() {
- if (this.__attributeMap == null) {
- this.__attributeMap = createAttributeProxy(true);
- }
- return this.__attributeMap;
- }
- set attributes(attrs) {
- this.__attributeMap = attrs;
- }
- }
- class MockTextNode extends MockNode {
- constructor(ownerDocument, text) {
- super(ownerDocument, 3 /* TEXT_NODE */, "#text" /* TEXT_NODE */, text);
- }
- cloneNode(_deep) {
- return new MockTextNode(null, this.nodeValue);
- }
- get textContent() {
- return this.nodeValue;
- }
- set textContent(text) {
- this.nodeValue = text;
- }
- get data() {
- return this.nodeValue;
- }
- set data(text) {
- this.nodeValue = text;
- }
- get wholeText() {
- if (this.parentNode != null) {
- const text = [];
- for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
- const childNode = this.parentNode.childNodes[i];
- if (childNode.nodeType === 3 /* TEXT_NODE */) {
- text.push(childNode.nodeValue);
- }
- }
- return text.join('');
- }
- return this.nodeValue;
- }
- }
- function getTextContent(childNodes, text) {
- for (let i = 0, ii = childNodes.length; i < ii; i++) {
- const childNode = childNodes[i];
- if (childNode.nodeType === 3 /* TEXT_NODE */) {
- text.push(childNode.nodeValue);
- }
- else if (childNode.nodeType === 1 /* ELEMENT_NODE */) {
- getTextContent(childNode.childNodes, text);
- }
- }
- }
- function setTextContent(elm, text) {
- for (let i = elm.childNodes.length - 1; i >= 0; i--) {
- elm.removeChild(elm.childNodes[i]);
- }
- const textNode = new MockTextNode(elm.ownerDocument, text);
- elm.appendChild(textNode);
- }
- class MockComment extends MockNode {
- constructor(ownerDocument, data) {
- super(ownerDocument, 8 /* COMMENT_NODE */, "#comment" /* COMMENT_NODE */, data);
- }
- cloneNode(_deep) {
- return new MockComment(null, this.nodeValue);
- }
- get textContent() {
- return this.nodeValue;
- }
- set textContent(text) {
- this.nodeValue = text;
- }
- }
- class MockDocumentFragment extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, null);
- this.nodeName = "#document-fragment" /* DOCUMENT_FRAGMENT_NODE */;
- this.nodeType = 11 /* DOCUMENT_FRAGMENT_NODE */;
- }
- getElementById(id) {
- return getElementById(this, id);
- }
- cloneNode(deep) {
- const cloned = new MockDocumentFragment(null);
- if (deep) {
- for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
- const childNode = this.childNodes[i];
- if (childNode.nodeType === 1 /* ELEMENT_NODE */ ||
- childNode.nodeType === 3 /* TEXT_NODE */ ||
- childNode.nodeType === 8 /* COMMENT_NODE */) {
- const clonedChildNode = this.childNodes[i].cloneNode(true);
- cloned.appendChild(clonedChildNode);
- }
- }
- }
- return cloned;
- }
- }
- class MockDocumentTypeNode extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, '!DOCTYPE');
- this.nodeType = 10 /* DOCUMENT_TYPE_NODE */;
- this.setAttribute('html', '');
- }
- }
- class MockCSSRule {
- constructor(parentStyleSheet) {
- this.parentStyleSheet = parentStyleSheet;
- this.cssText = '';
- this.type = 0;
- }
- }
- class MockCSSStyleSheet {
- constructor(ownerNode) {
- this.type = 'text/css';
- this.parentStyleSheet = null;
- this.cssRules = [];
- this.ownerNode = ownerNode;
- }
- get rules() {
- return this.cssRules;
- }
- set rules(rules) {
- this.cssRules = rules;
- }
- deleteRule(index) {
- if (index >= 0 && index < this.cssRules.length) {
- this.cssRules.splice(index, 1);
- updateStyleTextNode(this.ownerNode);
- }
- }
- insertRule(rule, index = 0) {
- if (typeof index !== 'number') {
- index = 0;
- }
- if (index < 0) {
- index = 0;
- }
- if (index > this.cssRules.length) {
- index = this.cssRules.length;
- }
- const cssRule = new MockCSSRule(this);
- cssRule.cssText = rule;
- this.cssRules.splice(index, 0, cssRule);
- updateStyleTextNode(this.ownerNode);
- return index;
- }
- }
- function getStyleElementText(styleElm) {
- const output = [];
- for (let i = 0; i < styleElm.childNodes.length; i++) {
- output.push(styleElm.childNodes[i].nodeValue);
- }
- return output.join('');
- }
- function setStyleElementText(styleElm, text) {
- // keeping the innerHTML and the sheet.cssRules connected
- // is not technically correct, but since we're doing
- // SSR we'll need to turn any assigned cssRules into
- // real text, not just properties that aren't rendered
- const sheet = styleElm.sheet;
- sheet.cssRules.length = 0;
- sheet.insertRule(text);
- updateStyleTextNode(styleElm);
- }
- function updateStyleTextNode(styleElm) {
- const childNodeLen = styleElm.childNodes.length;
- if (childNodeLen > 1) {
- for (let i = childNodeLen - 1; i >= 1; i--) {
- styleElm.removeChild(styleElm.childNodes[i]);
- }
- }
- else if (childNodeLen < 1) {
- styleElm.appendChild(styleElm.ownerDocument.createTextNode(''));
- }
- const textNode = styleElm.childNodes[0];
- textNode.nodeValue = styleElm.sheet.cssRules.map((r) => r.cssText).join('\n');
- }
- function createElement(ownerDocument, tagName) {
- if (typeof tagName !== 'string' || tagName === '' || !/^[a-z0-9-_:]+$/i.test(tagName)) {
- throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
- }
- tagName = tagName.toLowerCase();
- switch (tagName) {
- case 'a':
- return new MockAnchorElement(ownerDocument);
- case 'base':
- return new MockBaseElement(ownerDocument);
- case 'button':
- return new MockButtonElement(ownerDocument);
- case 'canvas':
- return new MockCanvasElement(ownerDocument);
- case 'form':
- return new MockFormElement(ownerDocument);
- case 'img':
- return new MockImageElement(ownerDocument);
- case 'input':
- return new MockInputElement(ownerDocument);
- case 'link':
- return new MockLinkElement(ownerDocument);
- case 'meta':
- return new MockMetaElement(ownerDocument);
- case 'script':
- return new MockScriptElement(ownerDocument);
- case 'style':
- return new MockStyleElement(ownerDocument);
- case 'template':
- return new MockTemplateElement(ownerDocument);
- case 'title':
- return new MockTitleElement(ownerDocument);
- }
- if (ownerDocument != null && tagName.includes('-')) {
- const win = ownerDocument.defaultView;
- if (win != null && win.customElements != null) {
- return createCustomElement(win.customElements, ownerDocument, tagName);
- }
- }
- return new MockHTMLElement(ownerDocument, tagName);
- }
- function createElementNS(ownerDocument, namespaceURI, tagName) {
- if (namespaceURI === 'http://www.w3.org/1999/xhtml') {
- return createElement(ownerDocument, tagName);
- }
- else if (namespaceURI === 'http://www.w3.org/2000/svg') {
- return new MockSVGElement(ownerDocument, tagName);
- }
- else {
- return new MockElement(ownerDocument, tagName);
- }
- }
- class MockAnchorElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'a');
- }
- get href() {
- return fullUrl(this, 'href');
- }
- set href(value) {
- this.setAttribute('href', value);
- }
- get pathname() {
- return new URL(this.href).pathname;
- }
- }
- class MockButtonElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'button');
- }
- }
- patchPropAttributes(MockButtonElement.prototype, {
- type: String,
- }, {
- type: 'submit',
- });
- class MockImageElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'img');
- }
- get draggable() {
- return this.getAttributeNS(null, 'draggable') !== 'false';
- }
- set draggable(value) {
- this.setAttributeNS(null, 'draggable', value);
- }
- get src() {
- return fullUrl(this, 'src');
- }
- set src(value) {
- this.setAttribute('src', value);
- }
- }
- patchPropAttributes(MockImageElement.prototype, {
- height: Number,
- width: Number,
- });
- class MockInputElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'input');
- }
- get list() {
- const listId = this.getAttribute('list');
- if (listId) {
- return this.ownerDocument.getElementById(listId);
- }
- return null;
- }
- }
- patchPropAttributes(MockInputElement.prototype, {
- accept: String,
- autocomplete: String,
- autofocus: Boolean,
- capture: String,
- checked: Boolean,
- disabled: Boolean,
- form: String,
- formaction: String,
- formenctype: String,
- formmethod: String,
- formnovalidate: String,
- formtarget: String,
- height: Number,
- inputmode: String,
- max: String,
- maxLength: Number,
- min: String,
- minLength: Number,
- multiple: Boolean,
- name: String,
- pattern: String,
- placeholder: String,
- required: Boolean,
- readOnly: Boolean,
- size: Number,
- spellCheck: Boolean,
- src: String,
- step: String,
- type: String,
- value: String,
- width: Number,
- }, {
- type: 'text',
- });
- class MockFormElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'form');
- }
- }
- patchPropAttributes(MockFormElement.prototype, {
- name: String,
- });
- class MockLinkElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'link');
- }
- get href() {
- return fullUrl(this, 'href');
- }
- set href(value) {
- this.setAttribute('href', value);
- }
- }
- patchPropAttributes(MockLinkElement.prototype, {
- crossorigin: String,
- media: String,
- rel: String,
- type: String,
- });
- class MockMetaElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'meta');
- }
- }
- patchPropAttributes(MockMetaElement.prototype, {
- charset: String,
- content: String,
- name: String,
- });
- class MockScriptElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'script');
- }
- get src() {
- return fullUrl(this, 'src');
- }
- set src(value) {
- this.setAttribute('src', value);
- }
- }
- patchPropAttributes(MockScriptElement.prototype, {
- type: String,
- });
- class MockStyleElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'style');
- this.sheet = new MockCSSStyleSheet(this);
- }
- get innerHTML() {
- return getStyleElementText(this);
- }
- set innerHTML(value) {
- setStyleElementText(this, value);
- }
- get innerText() {
- return getStyleElementText(this);
- }
- set innerText(value) {
- setStyleElementText(this, value);
- }
- get textContent() {
- return getStyleElementText(this);
- }
- set textContent(value) {
- setStyleElementText(this, value);
- }
- }
- class MockSVGElement extends MockElement {
- // SVGElement properties and methods
- get ownerSVGElement() {
- return null;
- }
- get viewportElement() {
- return null;
- }
- focus() {
- /**/
- }
- onunload() {
- /**/
- }
- // SVGGeometryElement properties and methods
- get pathLength() {
- return 0;
- }
- isPointInFill(_pt) {
- return false;
- }
- isPointInStroke(_pt) {
- return false;
- }
- getTotalLength() {
- return 0;
- }
- }
- class MockBaseElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'base');
- }
- get href() {
- return fullUrl(this, 'href');
- }
- set href(value) {
- this.setAttribute('href', value);
- }
- }
- class MockTemplateElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'template');
- this.content = new MockDocumentFragment(ownerDocument);
- }
- get innerHTML() {
- return this.content.innerHTML;
- }
- set innerHTML(html) {
- this.content.innerHTML = html;
- }
- cloneNode(deep) {
- const cloned = new MockTemplateElement(null);
- cloned.attributes = cloneAttributes(this.attributes);
- const styleCssText = this.getAttribute('style');
- if (styleCssText != null && styleCssText.length > 0) {
- cloned.setAttribute('style', styleCssText);
- }
- cloned.content = this.content.cloneNode(deep);
- if (deep) {
- for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
- const clonedChildNode = this.childNodes[i].cloneNode(true);
- cloned.appendChild(clonedChildNode);
- }
- }
- return cloned;
- }
- }
- class MockTitleElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'title');
- }
- get text() {
- return this.textContent;
- }
- set text(value) {
- this.textContent = value;
- }
- }
- class MockCanvasElement extends MockHTMLElement {
- constructor(ownerDocument) {
- super(ownerDocument, 'canvas');
- }
- getContext() {
- return {
- fillRect() {
- return;
- },
- clearRect() { },
- getImageData: function (_, __, w, h) {
- return {
- data: new Array(w * h * 4),
- };
- },
- putImageData() { },
- createImageData: function () {
- return [];
- },
- setTransform() { },
- drawImage() { },
- save() { },
- fillText() { },
- restore() { },
- beginPath() { },
- moveTo() { },
- lineTo() { },
- closePath() { },
- stroke() { },
- translate() { },
- scale() { },
- rotate() { },
- arc() { },
- fill() { },
- measureText() {
- return { width: 0 };
- },
- transform() { },
- rect() { },
- clip() { },
- };
- }
- }
- function fullUrl(elm, attrName) {
- const val = elm.getAttribute(attrName) || '';
- if (elm.ownerDocument != null) {
- const win = elm.ownerDocument.defaultView;
- if (win != null) {
- const loc = win.location;
- if (loc != null) {
- try {
- const url = new URL(val, loc.href);
- return url.href;
- }
- catch (e) { }
- }
- }
- }
- return val.replace(/\'|\"/g, '').trim();
- }
- function patchPropAttributes(prototype, attrs, defaults = {}) {
- Object.keys(attrs).forEach((propName) => {
- const attr = attrs[propName];
- const defaultValue = defaults[propName];
- if (attr === Boolean) {
- Object.defineProperty(prototype, propName, {
- get() {
- return this.hasAttribute(propName);
- },
- set(value) {
- if (value) {
- this.setAttribute(propName, '');
- }
- else {
- this.removeAttribute(propName);
- }
- },
- });
- }
- else if (attr === Number) {
- Object.defineProperty(prototype, propName, {
- get() {
- const value = this.getAttribute(propName);
- return value ? parseInt(value, 10) : defaultValue === undefined ? 0 : defaultValue;
- },
- set(value) {
- this.setAttribute(propName, value);
- },
- });
- }
- else {
- Object.defineProperty(prototype, propName, {
- get() {
- return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || '';
- },
- set(value) {
- this.setAttribute(propName, value);
- },
- });
- }
- });
- }
- MockElement.prototype.cloneNode = function (deep) {
- // because we're creating elements, which extending specific HTML base classes there
- // is a MockElement circular reference that bundling has trouble dealing with so
- // the fix is to add cloneNode() to MockElement's prototype after the HTML classes
- const cloned = createElement(this.ownerDocument, this.nodeName);
- cloned.attributes = cloneAttributes(this.attributes);
- const styleCssText = this.getAttribute('style');
- if (styleCssText != null && styleCssText.length > 0) {
- cloned.setAttribute('style', styleCssText);
- }
- if (deep) {
- for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
- const clonedChildNode = this.childNodes[i].cloneNode(true);
- cloned.appendChild(clonedChildNode);
- }
- }
- return cloned;
- };
- let sharedDocument;
- function parseHtmlToDocument(html, ownerDocument = null) {
- if (ownerDocument == null) {
- if (sharedDocument == null) {
- sharedDocument = new MockDocument();
- }
- ownerDocument = sharedDocument;
- }
- return parseDocumentUtil(ownerDocument, html);
- }
- class MockHeaders {
- constructor(init) {
- this._values = [];
- if (typeof init === 'object') {
- if (typeof init[Symbol.iterator] === 'function') {
- const kvs = [];
- for (const kv of init) {
- if (typeof kv[Symbol.iterator] === 'function') {
- kvs.push([...kv]);
- }
- }
- for (const kv of kvs) {
- this.append(kv[0], kv[1]);
- }
- }
- else {
- for (const key in init) {
- this.append(key, init[key]);
- }
- }
- }
- }
- append(key, value) {
- this._values.push([key, value + '']);
- }
- delete(key) {
- key = key.toLowerCase();
- for (let i = this._values.length - 1; i >= 0; i--) {
- if (this._values[i][0].toLowerCase() === key) {
- this._values.splice(i, 1);
- }
- }
- }
- entries() {
- const entries = [];
- for (const kv of this.keys()) {
- entries.push([kv, this.get(kv)]);
- }
- let index = -1;
- return {
- next() {
- index++;
- return {
- value: entries[index],
- done: !entries[index],
- };
- },
- [Symbol.iterator]() {
- return this;
- },
- };
- }
- forEach(cb) {
- for (const kv of this.entries()) {
- cb(kv[1], kv[0]);
- }
- }
- get(key) {
- const rtn = [];
- key = key.toLowerCase();
- for (const kv of this._values) {
- if (kv[0].toLowerCase() === key) {
- rtn.push(kv[1]);
- }
- }
- return rtn.length > 0 ? rtn.join(', ') : null;
- }
- has(key) {
- key = key.toLowerCase();
- for (const kv of this._values) {
- if (kv[0].toLowerCase() === key) {
- return true;
- }
- }
- return false;
- }
- keys() {
- const keys = [];
- for (const kv of this._values) {
- const key = kv[0].toLowerCase();
- if (!keys.includes(key)) {
- keys.push(key);
- }
- }
- let index = -1;
- return {
- next() {
- index++;
- return {
- value: keys[index],
- done: !keys[index],
- };
- },
- [Symbol.iterator]() {
- return this;
- },
- };
- }
- set(key, value) {
- for (const kv of this._values) {
- if (kv[0].toLowerCase() === key.toLowerCase()) {
- kv[1] = value + '';
- return;
- }
- }
- this.append(key, value);
- }
- values() {
- const values = this._values;
- let index = -1;
- return {
- next() {
- index++;
- const done = !values[index];
- return {
- value: done ? undefined : values[index][1],
- done,
- };
- },
- [Symbol.iterator]() {
- return this;
- },
- };
- }
- [Symbol.iterator]() {
- return this.entries();
- }
- }
- class MockRequest {
- constructor(input, init = {}) {
- this._method = 'GET';
- this._url = '/';
- this.bodyUsed = false;
- this.cache = 'default';
- this.credentials = 'same-origin';
- this.integrity = '';
- this.keepalive = false;
- this.mode = 'cors';
- this.redirect = 'follow';
- this.referrer = 'about:client';
- this.referrerPolicy = '';
- if (typeof input === 'string') {
- this.url = input;
- }
- else if (input) {
- Object.assign(this, input);
- this.headers = new MockHeaders(input.headers);
- }
- Object.assign(this, init);
- if (init.headers) {
- this.headers = new MockHeaders(init.headers);
- }
- if (!this.headers) {
- this.headers = new MockHeaders();
- }
- }
- get url() {
- if (typeof this._url === 'string') {
- return new URL(this._url, location.href).href;
- }
- return new URL('/', location.href).href;
- }
- set url(value) {
- this._url = value;
- }
- get method() {
- if (typeof this._method === 'string') {
- return this._method.toUpperCase();
- }
- return 'GET';
- }
- set method(value) {
- this._method = value;
- }
- clone() {
- const clone = { ...this };
- clone.headers = new MockHeaders(this.headers);
- return new MockRequest(clone);
- }
- }
- class MockResponse {
- constructor(body, init = {}) {
- this.ok = true;
- this.status = 200;
- this.statusText = '';
- this.type = 'default';
- this.url = '';
- this._body = body;
- if (init) {
- Object.assign(this, init);
- }
- this.headers = new MockHeaders(init.headers);
- }
- async json() {
- return JSON.parse(this._body);
- }
- async text() {
- return this._body;
- }
- clone() {
- const initClone = { ...this };
- initClone.headers = new MockHeaders(this.headers);
- return new MockResponse(this._body, initClone);
- }
- }
- class MockDOMParser {
- parseFromString(htmlToParse, mimeType) {
- if (mimeType !== 'text/html') {
- console.error('XML parsing not implemented yet, continuing as html');
- }
- return parseHtmlToDocument(htmlToParse);
- }
- }
- function addGlobalsToWindowPrototype(mockWinPrototype) {
- GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
- Object.defineProperty(mockWinPrototype, cstrName, {
- get() {
- return this['__' + cstrName] || Cstr;
- },
- set(cstr) {
- this['__' + cstrName] = cstr;
- },
- configurable: true,
- enumerable: true,
- });
- });
- }
- const GLOBAL_CONSTRUCTORS = [
- ['CustomEvent', MockCustomEvent],
- ['Event', MockEvent],
- ['Headers', MockHeaders],
- ['KeyboardEvent', MockKeyboardEvent],
- ['MouseEvent', MockMouseEvent],
- ['Request', MockRequest],
- ['Response', MockResponse],
- ['DOMParser', MockDOMParser],
- ['HTMLAnchorElement', MockAnchorElement],
- ['HTMLBaseElement', MockBaseElement],
- ['HTMLButtonElement', MockButtonElement],
- ['HTMLCanvasElement', MockCanvasElement],
- ['HTMLFormElement', MockFormElement],
- ['HTMLImageElement', MockImageElement],
- ['HTMLInputElement', MockInputElement],
- ['HTMLLinkElement', MockLinkElement],
- ['HTMLMetaElement', MockMetaElement],
- ['HTMLScriptElement', MockScriptElement],
- ['HTMLStyleElement', MockStyleElement],
- ['HTMLTemplateElement', MockTemplateElement],
- ['HTMLTitleElement', MockTitleElement],
- ];
- const consoleNoop = () => {
- /**/
- };
- function createConsole() {
- return {
- debug: consoleNoop,
- error: consoleNoop,
- info: consoleNoop,
- log: consoleNoop,
- warn: consoleNoop,
- dir: consoleNoop,
- dirxml: consoleNoop,
- table: consoleNoop,
- trace: consoleNoop,
- group: consoleNoop,
- groupCollapsed: consoleNoop,
- groupEnd: consoleNoop,
- clear: consoleNoop,
- count: consoleNoop,
- countReset: consoleNoop,
- assert: consoleNoop,
- profile: consoleNoop,
- profileEnd: consoleNoop,
- time: consoleNoop,
- timeLog: consoleNoop,
- timeEnd: consoleNoop,
- timeStamp: consoleNoop,
- context: consoleNoop,
- memory: consoleNoop,
- };
- }
- class MockHistory {
- constructor() {
- this.items = [];
- }
- get length() {
- return this.items.length;
- }
- back() {
- this.go(-1);
- }
- forward() {
- this.go(1);
- }
- go(_value) {
- //
- }
- pushState(_state, _title, _url) {
- //
- }
- replaceState(_state, _title, _url) {
- //
- }
- }
- class MockIntersectionObserver {
- constructor() {
- /**/
- }
- disconnect() {
- /**/
- }
- observe() {
- /**/
- }
- takeRecords() {
- return [];
- }
- unobserve() {
- /**/
- }
- }
- class MockLocation {
- constructor() {
- this.ancestorOrigins = null;
- this.protocol = '';
- this.host = '';
- this.hostname = '';
- this.port = '';
- this.pathname = '';
- this.search = '';
- this.hash = '';
- this.username = '';
- this.password = '';
- this.origin = '';
- this._href = '';
- }
- get href() {
- return this._href;
- }
- set href(value) {
- const url = new URL(value, 'http://mockdoc.stenciljs.com');
- this._href = url.href;
- this.protocol = url.protocol;
- this.host = url.host;
- this.hostname = url.hostname;
- this.port = url.port;
- this.pathname = url.pathname;
- this.search = url.search;
- this.hash = url.hash;
- this.username = url.username;
- this.password = url.password;
- this.origin = url.origin;
- }
- assign(_url) {
- //
- }
- reload(_forcedReload) {
- //
- }
- replace(_url) {
- //
- }
- toString() {
- return this.href;
- }
- }
- class MockNavigator {
- constructor() {
- this.appCodeName = 'MockNavigator';
- this.appName = 'MockNavigator';
- this.appVersion = 'MockNavigator';
- this.platform = 'MockNavigator';
- this.userAgent = 'MockNavigator';
- }
- }
- /**
- * https://developer.mozilla.org/en-US/docs/Web/API/Performance
- */
- class MockPerformance {
- constructor() {
- this.timeOrigin = Date.now();
- }
- addEventListener() {
- //
- }
- clearMarks() {
- //
- }
- clearMeasures() {
- //
- }
- clearResourceTimings() {
- //
- }
- dispatchEvent() {
- return true;
- }
- getEntries() {
- return [];
- }
- getEntriesByName() {
- return [];
- }
- getEntriesByType() {
- return [];
- }
- // Stencil's implementation of `mark` is non-compliant with the `Performance` interface. Because Stencil will
- // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
- // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
- // associated errors returned by the type checker)
- // @ts-ignore
- mark() {
- //
- }
- // Stencil's implementation of `measure` is non-compliant with the `Performance` interface. Because Stencil will
- // instantiate an instance of this class and may attempt to assign it to a variable of type `Performance`, the return
- // type must match the `Performance` interface (rather than typing this function as returning `void` and ignoring the
- // associated errors returned by the type checker)
- // @ts-ignore
- measure() {
- //
- }
- get navigation() {
- return {};
- }
- now() {
- return Date.now() - this.timeOrigin;
- }
- get onresourcetimingbufferfull() {
- return null;
- }
- removeEventListener() {
- //
- }
- setResourceTimingBufferSize() {
- //
- }
- get timing() {
- return {};
- }
- toJSON() {
- //
- }
- }
- function resetPerformance(perf) {
- if (perf != null) {
- try {
- perf.timeOrigin = Date.now();
- }
- catch (e) { }
- }
- }
- class MockStorage {
- constructor() {
- this.items = new Map();
- }
- key(_value) {
- //
- }
- getItem(key) {
- key = String(key);
- if (this.items.has(key)) {
- return this.items.get(key);
- }
- return null;
- }
- setItem(key, value) {
- if (value == null) {
- value = 'null';
- }
- this.items.set(String(key), String(value));
- }
- removeItem(key) {
- this.items.delete(String(key));
- }
- clear() {
- this.items.clear();
- }
- }
- const nativeClearInterval = clearInterval;
- const nativeClearTimeout = clearTimeout;
- const nativeSetInterval = setInterval;
- const nativeSetTimeout = setTimeout;
- const nativeURL = URL;
- class MockWindow {
- constructor(html = null) {
- if (html !== false) {
- this.document = new MockDocument(html, this);
- }
- else {
- this.document = null;
- }
- this.performance = new MockPerformance();
- this.customElements = new MockCustomElementRegistry(this);
- this.console = createConsole();
- resetWindowDefaults(this);
- resetWindowDimensions(this);
- }
- addEventListener(type, handler) {
- addEventListener(this, type, handler);
- }
- alert(msg) {
- if (this.console) {
- this.console.debug(msg);
- }
- else {
- console.debug(msg);
- }
- }
- blur() {
- /**/
- }
- cancelAnimationFrame(id) {
- this.__clearTimeout(id);
- }
- cancelIdleCallback(id) {
- this.__clearTimeout(id);
- }
- get CharacterData() {
- if (this.__charDataCstr == null) {
- const ownerDocument = this.document;
- this.__charDataCstr = class extends MockNode {
- constructor() {
- super(ownerDocument, 0, 'test', '');
- throw new Error('Illegal constructor: cannot construct CharacterData');
- }
- };
- }
- return this.__charDataCstr;
- }
- set CharacterData(charDataCstr) {
- this.__charDataCstr = charDataCstr;
- }
- clearInterval(id) {
- this.__clearInterval(id);
- }
- clearTimeout(id) {
- this.__clearTimeout(id);
- }
- close() {
- resetWindow(this);
- }
- confirm() {
- return false;
- }
- get CSS() {
- return {
- supports: () => true,
- };
- }
- get Document() {
- if (this.__docCstr == null) {
- const win = this;
- this.__docCstr = class extends MockDocument {
- constructor() {
- super(false, win);
- throw new Error('Illegal constructor: cannot construct Document');
- }
- };
- }
- return this.__docCstr;
- }
- set Document(docCstr) {
- this.__docCstr = docCstr;
- }
- get DocumentFragment() {
- if (this.__docFragCstr == null) {
- const ownerDocument = this.document;
- this.__docFragCstr = class extends MockDocumentFragment {
- constructor() {
- super(ownerDocument);
- throw new Error('Illegal constructor: cannot construct DocumentFragment');
- }
- };
- }
- return this.__docFragCstr;
- }
- set DocumentFragment(docFragCstr) {
- this.__docFragCstr = docFragCstr;
- }
- get DocumentType() {
- if (this.__docTypeCstr == null) {
- const ownerDocument = this.document;
- this.__docTypeCstr = class extends MockNode {
- constructor() {
- super(ownerDocument, 0, 'test', '');
- throw new Error('Illegal constructor: cannot construct DocumentType');
- }
- };
- }
- return this.__docTypeCstr;
- }
- set DocumentType(docTypeCstr) {
- this.__docTypeCstr = docTypeCstr;
- }
- get DOMTokenList() {
- if (this.__domTokenListCstr == null) {
- this.__domTokenListCstr = class MockDOMTokenList {
- };
- }
- return this.__domTokenListCstr;
- }
- set DOMTokenList(domTokenListCstr) {
- this.__domTokenListCstr = domTokenListCstr;
- }
- dispatchEvent(ev) {
- return dispatchEvent(this, ev);
- }
- get Element() {
- if (this.__elementCstr == null) {
- const ownerDocument = this.document;
- this.__elementCstr = class extends MockElement {
- constructor() {
- super(ownerDocument, '');
- throw new Error('Illegal constructor: cannot construct Element');
- }
- };
- }
- return this.__elementCstr;
- }
- fetch(input, init) {
- if (typeof fetch === 'function') {
- return fetch(input, init);
- }
- throw new Error(`fetch() not implemented`);
- }
- focus() {
- /**/
- }
- getComputedStyle(_) {
- return {
- cssText: '',
- length: 0,
- parentRule: null,
- getPropertyPriority() {
- return null;
- },
- getPropertyValue() {
- return '';
- },
- item() {
- return null;
- },
- removeProperty() {
- return null;
- },
- setProperty() {
- return null;
- },
- };
- }
- get globalThis() {
- return this;
- }
- get history() {
- if (this.__history == null) {
- this.__history = new MockHistory();
- }
- return this.__history;
- }
- set history(hsty) {
- this.__history = hsty;
- }
- get JSON() {
- return JSON;
- }
- get HTMLElement() {
- if (this.__htmlElementCstr == null) {
- const ownerDocument = this.document;
- this.__htmlElementCstr = class extends MockHTMLElement {
- constructor() {
- super(ownerDocument, '');
- const observedAttributes = this.constructor.observedAttributes;
- if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === 'function') {
- observedAttributes.forEach((attrName) => {
- const attrValue = this.getAttribute(attrName);
- if (attrValue != null) {
- this.attributeChangedCallback(attrName, null, attrValue);
- }
- });
- }
- }
- };
- }
- return this.__htmlElementCstr;
- }
- set HTMLElement(htmlElementCstr) {
- this.__htmlElementCstr = htmlElementCstr;
- }
- get IntersectionObserver() {
- return MockIntersectionObserver;
- }
- get localStorage() {
- if (this.__localStorage == null) {
- this.__localStorage = new MockStorage();
- }
- return this.__localStorage;
- }
- set localStorage(locStorage) {
- this.__localStorage = locStorage;
- }
- get location() {
- if (this.__location == null) {
- this.__location = new MockLocation();
- }
- return this.__location;
- }
- set location(val) {
- if (typeof val === 'string') {
- if (this.__location == null) {
- this.__location = new MockLocation();
- }
- this.__location.href = val;
- }
- else {
- this.__location = val;
- }
- }
- matchMedia() {
- return {
- matches: false,
- };
- }
- get Node() {
- if (this.__nodeCstr == null) {
- const ownerDocument = this.document;
- this.__nodeCstr = class extends MockNode {
- constructor() {
- super(ownerDocument, 0, 'test', '');
- throw new Error('Illegal constructor: cannot construct Node');
- }
- };
- }
- return this.__nodeCstr;
- }
- get NodeList() {
- if (this.__nodeListCstr == null) {
- const ownerDocument = this.document;
- this.__nodeListCstr = class extends MockNodeList {
- constructor() {
- super(ownerDocument, [], 0);
- throw new Error('Illegal constructor: cannot construct NodeList');
- }
- };
- }
- return this.__nodeListCstr;
- }
- get navigator() {
- if (this.__navigator == null) {
- this.__navigator = new MockNavigator();
- }
- return this.__navigator;
- }
- set navigator(nav) {
- this.__navigator = nav;
- }
- get parent() {
- return null;
- }
- prompt() {
- return '';
- }
- open() {
- return null;
- }
- get origin() {
- return this.location.origin;
- }
- removeEventListener(type, handler) {
- removeEventListener(this, type, handler);
- }
- requestAnimationFrame(callback) {
- return this.setTimeout(() => {
- callback(Date.now());
- }, 0);
- }
- requestIdleCallback(callback) {
- return this.setTimeout(() => {
- callback({
- didTimeout: false,
- timeRemaining: () => 0,
- });
- }, 0);
- }
- scroll(_x, _y) {
- /**/
- }
- scrollBy(_x, _y) {
- /**/
- }
- scrollTo(_x, _y) {
- /**/
- }
- get self() {
- return this;
- }
- get sessionStorage() {
- if (this.__sessionStorage == null) {
- this.__sessionStorage = new MockStorage();
- }
- return this.__sessionStorage;
- }
- set sessionStorage(locStorage) {
- this.__sessionStorage = locStorage;
- }
- setInterval(callback, ms, ...args) {
- if (this.__timeouts == null) {
- this.__timeouts = new Set();
- }
- ms = Math.min(ms, this.__maxTimeout);
- if (this.__allowInterval) {
- const intervalId = this.__setInterval(() => {
- if (this.__timeouts) {
- this.__timeouts.delete(intervalId);
- try {
- callback(...args);
- }
- catch (e) {
- if (this.console) {
- this.console.error(e);
- }
- else {
- console.error(e);
- }
- }
- }
- }, ms);
- if (this.__timeouts) {
- this.__timeouts.add(intervalId);
- }
- return intervalId;
- }
- const timeoutId = this.__setTimeout(() => {
- if (this.__timeouts) {
- this.__timeouts.delete(timeoutId);
- try {
- callback(...args);
- }
- catch (e) {
- if (this.console) {
- this.console.error(e);
- }
- else {
- console.error(e);
- }
- }
- }
- }, ms);
- if (this.__timeouts) {
- this.__timeouts.add(timeoutId);
- }
- return timeoutId;
- }
- setTimeout(callback, ms, ...args) {
- if (this.__timeouts == null) {
- this.__timeouts = new Set();
- }
- ms = Math.min(ms, this.__maxTimeout);
- const timeoutId = this.__setTimeout(() => {
- if (this.__timeouts) {
- this.__timeouts.delete(timeoutId);
- try {
- callback(...args);
- }
- catch (e) {
- if (this.console) {
- this.console.error(e);
- }
- else {
- console.error(e);
- }
- }
- }
- }, ms);
- if (this.__timeouts) {
- this.__timeouts.add(timeoutId);
- }
- return timeoutId;
- }
- get top() {
- return this;
- }
- get window() {
- return this;
- }
- onanimationstart() {
- /**/
- }
- onanimationend() {
- /**/
- }
- onanimationiteration() {
- /**/
- }
- onabort() {
- /**/
- }
- onauxclick() {
- /**/
- }
- onbeforecopy() {
- /**/
- }
- onbeforecut() {
- /**/
- }
- onbeforepaste() {
- /**/
- }
- onblur() {
- /**/
- }
- oncancel() {
- /**/
- }
- oncanplay() {
- /**/
- }
- oncanplaythrough() {
- /**/
- }
- onchange() {
- /**/
- }
- onclick() {
- /**/
- }
- onclose() {
- /**/
- }
- oncontextmenu() {
- /**/
- }
- oncopy() {
- /**/
- }
- oncuechange() {
- /**/
- }
- oncut() {
- /**/
- }
- ondblclick() {
- /**/
- }
- ondrag() {
- /**/
- }
- ondragend() {
- /**/
- }
- ondragenter() {
- /**/
- }
- ondragleave() {
- /**/
- }
- ondragover() {
- /**/
- }
- ondragstart() {
- /**/
- }
- ondrop() {
- /**/
- }
- ondurationchange() {
- /**/
- }
- onemptied() {
- /**/
- }
- onended() {
- /**/
- }
- onerror() {
- /**/
- }
- onfocus() {
- /**/
- }
- onfocusin() {
- /**/
- }
- onfocusout() {
- /**/
- }
- onformdata() {
- /**/
- }
- onfullscreenchange() {
- /**/
- }
- onfullscreenerror() {
- /**/
- }
- ongotpointercapture() {
- /**/
- }
- oninput() {
- /**/
- }
- oninvalid() {
- /**/
- }
- onkeydown() {
- /**/
- }
- onkeypress() {
- /**/
- }
- onkeyup() {
- /**/
- }
- onload() {
- /**/
- }
- onloadeddata() {
- /**/
- }
- onloadedmetadata() {
- /**/
- }
- onloadstart() {
- /**/
- }
- onlostpointercapture() {
- /**/
- }
- onmousedown() {
- /**/
- }
- onmouseenter() {
- /**/
- }
- onmouseleave() {
- /**/
- }
- onmousemove() {
- /**/
- }
- onmouseout() {
- /**/
- }
- onmouseover() {
- /**/
- }
- onmouseup() {
- /**/
- }
- onmousewheel() {
- /**/
- }
- onpaste() {
- /**/
- }
- onpause() {
- /**/
- }
- onplay() {
- /**/
- }
- onplaying() {
- /**/
- }
- onpointercancel() {
- /**/
- }
- onpointerdown() {
- /**/
- }
- onpointerenter() {
- /**/
- }
- onpointerleave() {
- /**/
- }
- onpointermove() {
- /**/
- }
- onpointerout() {
- /**/
- }
- onpointerover() {
- /**/
- }
- onpointerup() {
- /**/
- }
- onprogress() {
- /**/
- }
- onratechange() {
- /**/
- }
- onreset() {
- /**/
- }
- onresize() {
- /**/
- }
- onscroll() {
- /**/
- }
- onsearch() {
- /**/
- }
- onseeked() {
- /**/
- }
- onseeking() {
- /**/
- }
- onselect() {
- /**/
- }
- onselectstart() {
- /**/
- }
- onstalled() {
- /**/
- }
- onsubmit() {
- /**/
- }
- onsuspend() {
- /**/
- }
- ontimeupdate() {
- /**/
- }
- ontoggle() {
- /**/
- }
- onvolumechange() {
- /**/
- }
- onwaiting() {
- /**/
- }
- onwebkitfullscreenchange() {
- /**/
- }
- onwebkitfullscreenerror() {
- /**/
- }
- onwheel() {
- /**/
- }
- }
- addGlobalsToWindowPrototype(MockWindow.prototype);
- function resetWindowDefaults(win) {
- win.__clearInterval = nativeClearInterval;
- win.__clearTimeout = nativeClearTimeout;
- win.__setInterval = nativeSetInterval;
- win.__setTimeout = nativeSetTimeout;
- win.__maxTimeout = 30000;
- win.__allowInterval = true;
- win.URL = nativeURL;
- }
- function cloneWindow(srcWin, opts = {}) {
- if (srcWin == null) {
- return null;
- }
- const clonedWin = new MockWindow(false);
- if (!opts.customElementProxy) {
- // TODO(STENCIL-345) - Evaluate reconciling MockWindow, Window differences
- // @ts-ignore
- srcWin.customElements = null;
- }
- if (srcWin.document != null) {
- const clonedDoc = new MockDocument(false, clonedWin);
- clonedWin.document = clonedDoc;
- clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
- }
- else {
- clonedWin.document = new MockDocument(null, clonedWin);
- }
- return clonedWin;
- }
- function cloneDocument(srcDoc) {
- if (srcDoc == null) {
- return null;
- }
- const dstWin = cloneWindow(srcDoc.defaultView);
- return dstWin.document;
- }
- function resetWindow(win) {
- if (win != null) {
- if (win.__timeouts) {
- win.__timeouts.forEach((timeoutId) => {
- nativeClearInterval(timeoutId);
- nativeClearTimeout(timeoutId);
- });
- win.__timeouts.clear();
- }
- if (win.customElements && win.customElements.clear) {
- win.customElements.clear();
- }
- resetDocument(win.document);
- resetPerformance(win.performance);
- for (const key in win) {
- if (win.hasOwnProperty(key) && key !== 'document' && key !== 'performance' && key !== 'customElements') {
- delete win[key];
- }
- }
- resetWindowDefaults(win);
- resetWindowDimensions(win);
- resetEventListeners(win);
- if (win.document != null) {
- try {
- win.document.defaultView = win;
- }
- catch (e) { }
- }
- // ensure we don't hold onto nodeFetch values
- win.fetch = null;
- win.Headers = null;
- win.Request = null;
- win.Response = null;
- win.FetchError = null;
- }
- }
- function resetWindowDimensions(win) {
- try {
- win.devicePixelRatio = 1;
- win.innerHeight = 768;
- win.innerWidth = 1366;
- win.pageXOffset = 0;
- win.pageYOffset = 0;
- win.screenLeft = 0;
- win.screenTop = 0;
- win.screenX = 0;
- win.screenY = 0;
- win.scrollX = 0;
- win.scrollY = 0;
- win.screen = {
- availHeight: win.innerHeight,
- availLeft: 0,
- availTop: 0,
- availWidth: win.innerWidth,
- colorDepth: 24,
- height: win.innerHeight,
- keepAwake: false,
- orientation: {
- angle: 0,
- type: 'portrait-primary',
- },
- pixelDepth: 24,
- width: win.innerWidth,
- };
- }
- catch (e) { }
- }
- class MockDocument extends MockHTMLElement {
- constructor(html = null, win = null) {
- super(null, null);
- this.nodeName = "#document" /* DOCUMENT_NODE */;
- this.nodeType = 9 /* DOCUMENT_NODE */;
- this.defaultView = win;
- this.cookie = '';
- this.referrer = '';
- this.appendChild(this.createDocumentTypeNode());
- if (typeof html === 'string') {
- const parsedDoc = parseDocumentUtil(this, html);
- const documentElement = parsedDoc.children.find((elm) => elm.nodeName === 'HTML');
- if (documentElement != null) {
- this.appendChild(documentElement);
- setOwnerDocument(documentElement, this);
- }
- }
- else if (html !== false) {
- const documentElement = new MockHTMLElement(this, 'html');
- this.appendChild(documentElement);
- documentElement.appendChild(new MockHTMLElement(this, 'head'));
- documentElement.appendChild(new MockHTMLElement(this, 'body'));
- }
- }
- get dir() {
- return this.documentElement.dir;
- }
- set dir(value) {
- this.documentElement.dir = value;
- }
- get location() {
- if (this.defaultView != null) {
- return this.defaultView.location;
- }
- return null;
- }
- set location(val) {
- if (this.defaultView != null) {
- this.defaultView.location = val;
- }
- }
- get baseURI() {
- const baseNode = this.head.childNodes.find((node) => node.nodeName === 'BASE');
- if (baseNode) {
- return baseNode.href;
- }
- return this.URL;
- }
- get URL() {
- return this.location.href;
- }
- get styleSheets() {
- return this.querySelectorAll('style');
- }
- get scripts() {
- return this.querySelectorAll('script');
- }
- get forms() {
- return this.querySelectorAll('form');
- }
- get images() {
- return this.querySelectorAll('img');
- }
- get scrollingElement() {
- return this.documentElement;
- }
- get documentElement() {
- for (let i = this.childNodes.length - 1; i >= 0; i--) {
- if (this.childNodes[i].nodeName === 'HTML') {
- return this.childNodes[i];
- }
- }
- const documentElement = new MockHTMLElement(this, 'html');
- this.appendChild(documentElement);
- return documentElement;
- }
- set documentElement(documentElement) {
- for (let i = this.childNodes.length - 1; i >= 0; i--) {
- if (this.childNodes[i].nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {
- this.childNodes[i].remove();
- }
- }
- if (documentElement != null) {
- this.appendChild(documentElement);
- setOwnerDocument(documentElement, this);
- }
- }
- get head() {
- const documentElement = this.documentElement;
- for (let i = 0; i < documentElement.childNodes.length; i++) {
- if (documentElement.childNodes[i].nodeName === 'HEAD') {
- return documentElement.childNodes[i];
- }
- }
- const head = new MockHTMLElement(this, 'head');
- documentElement.insertBefore(head, documentElement.firstChild);
- return head;
- }
- set head(head) {
- const documentElement = this.documentElement;
- for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
- if (documentElement.childNodes[i].nodeName === 'HEAD') {
- documentElement.childNodes[i].remove();
- }
- }
- if (head != null) {
- documentElement.insertBefore(head, documentElement.firstChild);
- setOwnerDocument(head, this);
- }
- }
- get body() {
- const documentElement = this.documentElement;
- for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
- if (documentElement.childNodes[i].nodeName === 'BODY') {
- return documentElement.childNodes[i];
- }
- }
- const body = new MockHTMLElement(this, 'body');
- documentElement.appendChild(body);
- return body;
- }
- set body(body) {
- const documentElement = this.documentElement;
- for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
- if (documentElement.childNodes[i].nodeName === 'BODY') {
- documentElement.childNodes[i].remove();
- }
- }
- if (body != null) {
- documentElement.appendChild(body);
- setOwnerDocument(body, this);
- }
- }
- appendChild(newNode) {
- newNode.remove();
- newNode.parentNode = this;
- this.childNodes.push(newNode);
- return newNode;
- }
- createComment(data) {
- return new MockComment(this, data);
- }
- createAttribute(attrName) {
- return new MockAttr(attrName.toLowerCase(), '');
- }
- createAttributeNS(namespaceURI, attrName) {
- return new MockAttr(attrName, '', namespaceURI);
- }
- createElement(tagName) {
- if (tagName === "#document" /* DOCUMENT_NODE */) {
- const doc = new MockDocument(false);
- doc.nodeName = tagName;
- doc.parentNode = null;
- return doc;
- }
- return createElement(this, tagName);
- }
- createElementNS(namespaceURI, tagName) {
- const elmNs = createElementNS(this, namespaceURI, tagName);
- elmNs.namespaceURI = namespaceURI;
- return elmNs;
- }
- createTextNode(text) {
- return new MockTextNode(this, text);
- }
- createDocumentFragment() {
- return new MockDocumentFragment(this);
- }
- createDocumentTypeNode() {
- return new MockDocumentTypeNode(this);
- }
- getElementById(id) {
- return getElementById(this, id);
- }
- getElementsByName(elmName) {
- return getElementsByName(this, elmName.toLowerCase());
- }
- get title() {
- const title = this.head.childNodes.find((elm) => elm.nodeName === 'TITLE');
- if (title != null && typeof title.textContent === 'string') {
- return title.textContent.trim();
- }
- return '';
- }
- set title(value) {
- const head = this.head;
- let title = head.childNodes.find((elm) => elm.nodeName === 'TITLE');
- if (title == null) {
- title = this.createElement('title');
- head.appendChild(title);
- }
- title.textContent = value;
- }
- }
- function createDocument(html = null) {
- return new MockWindow(html).document;
- }
- function resetDocument(doc) {
- if (doc != null) {
- resetEventListeners(doc);
- const documentElement = doc.documentElement;
- if (documentElement != null) {
- resetElement(documentElement);
- for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
- const childNode = documentElement.childNodes[i];
- resetElement(childNode);
- childNode.childNodes.length = 0;
- }
- }
- for (const key in doc) {
- if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
- delete doc[key];
- }
- }
- try {
- doc.nodeName = "#document" /* DOCUMENT_NODE */;
- }
- catch (e) { }
- try {
- doc.nodeType = 9 /* DOCUMENT_NODE */;
- }
- catch (e) { }
- try {
- doc.cookie = '';
- }
- catch (e) { }
- try {
- doc.referrer = '';
- }
- catch (e) { }
- }
- }
- const DOC_KEY_KEEPERS = new Set([
- 'nodeName',
- 'nodeType',
- 'nodeValue',
- 'ownerDocument',
- 'parentNode',
- 'childNodes',
- '_shadowRoot',
- ]);
- function getElementById(elm, id) {
- const children = elm.children;
- for (let i = 0, ii = children.length; i < ii; i++) {
- const childElm = children[i];
- if (childElm.id === id) {
- return childElm;
- }
- const childElmFound = getElementById(childElm, id);
- if (childElmFound != null) {
- return childElmFound;
- }
- }
- return null;
- }
- function getElementsByName(elm, elmName, foundElms = []) {
- const children = elm.children;
- for (let i = 0, ii = children.length; i < ii; i++) {
- const childElm = children[i];
- if (childElm.name && childElm.name.toLowerCase() === elmName) {
- foundElms.push(childElm);
- }
- getElementsByName(childElm, elmName, foundElms);
- }
- return foundElms;
- }
- function setOwnerDocument(elm, ownerDocument) {
- for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
- elm.childNodes[i].ownerDocument = ownerDocument;
- if (elm.childNodes[i].nodeType === 1 /* ELEMENT_NODE */) {
- setOwnerDocument(elm.childNodes[i], ownerDocument);
- }
- }
- }
- const isEmptable = (o) => isOutputTargetDist(o) ||
- isOutputTargetDistCustomElements(o) ||
- isOutputTargetDistCustomElementsBundle(o) ||
- isOutputTargetWww(o) ||
- isOutputTargetDistLazy(o) ||
- isOutputTargetDistLazyLoader(o) ||
- isOutputTargetHydrate(o);
- const emptyOutputTargets = async (config, compilerCtx, buildCtx) => {
- if (buildCtx.isRebuild) {
- return;
- }
- const cleanDirs = config.outputTargets
- .filter(isEmptable)
- .filter((o) => o.empty === true)
- .map((o) => o.dir || o.esmDir)
- .filter(isString$1);
- if (cleanDirs.length === 0) {
- return;
- }
- const timeSpan = buildCtx.createTimeSpan(`cleaning ${cleanDirs.length} dirs`, true);
- await compilerCtx.fs.emptyDirs(cleanDirs);
- timeSpan.finish('cleaning dirs finished');
- };
- const parseCssImports = async (config, compilerCtx, buildCtx, srcFilePath, resolvedFilePath, styleText, styleDocs) => {
- const isCssEntry = resolvedFilePath.toLowerCase().endsWith('.css');
- const allCssImports = [];
- const concatStyleText = await updateCssImports(config, compilerCtx, buildCtx, isCssEntry, srcFilePath, resolvedFilePath, styleText, allCssImports, new Set(), styleDocs);
- return {
- imports: allCssImports,
- styleText: concatStyleText,
- };
- };
- const updateCssImports = async (config, compilerCtx, buildCtx, isCssEntry, srcFilePath, resolvedFilePath, styleText, allCssImports, noLoop, styleDocs) => {
- if (noLoop.has(resolvedFilePath)) {
- return styleText;
- }
- noLoop.add(resolvedFilePath);
- if (styleDocs != null) {
- parseStyleDocs(styleDocs, styleText);
- }
- const cssImports = await getCssImports(config, compilerCtx, buildCtx, resolvedFilePath, styleText);
- if (cssImports.length === 0) {
- return styleText;
- }
- for (const cssImport of cssImports) {
- if (!allCssImports.includes(cssImport.filePath)) {
- allCssImports.push(cssImport.filePath);
- }
- }
- await Promise.all(cssImports.map(async (cssImportData) => {
- await concatCssImport(config, compilerCtx, buildCtx, isCssEntry, srcFilePath, cssImportData, allCssImports, noLoop, styleDocs);
- }));
- return replaceImportDeclarations(styleText, cssImports, isCssEntry);
- };
- const concatCssImport = async (config, compilerCtx, buildCtx, isCssEntry, srcFilePath, cssImportData, allCssImports, noLoop, styleDocs) => {
- cssImportData.styleText = await loadStyleText(compilerCtx, cssImportData);
- if (typeof cssImportData.styleText === 'string') {
- cssImportData.styleText = await updateCssImports(config, compilerCtx, buildCtx, isCssEntry, cssImportData.filePath, cssImportData.filePath, cssImportData.styleText, allCssImports, noLoop, styleDocs);
- }
- else {
- const err = buildError(buildCtx.diagnostics);
- err.messageText = `Unable to read css import: ${cssImportData.srcImport}`;
- err.absFilePath = srcFilePath;
- }
- };
- const loadStyleText = async (compilerCtx, cssImportData) => {
- let styleText = null;
- try {
- styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
- }
- catch (e) {
- if (cssImportData.altFilePath) {
- try {
- styleText = await compilerCtx.fs.readFile(cssImportData.filePath);
- }
- catch (e) { }
- }
- }
- return styleText;
- };
- const getCssImports = async (config, compilerCtx, buildCtx, filePath, styleText) => {
- const imports = [];
- if (!styleText.includes('@import')) {
- // no @import at all, so don't bother
- return imports;
- }
- styleText = stripCssComments(styleText);
- const dir = dirname(filePath);
- const importeeExt = filePath.split('.').pop().toLowerCase();
- let r;
- const IMPORT_RE = /(@import)\s+(url\()?\s?(.*?)\s?\)?([^;]*);?/gi;
- while ((r = IMPORT_RE.exec(styleText))) {
- const cssImportData = {
- srcImport: r[0],
- url: r[4].replace(/[\"\'\)]/g, ''),
- };
- if (!isLocalCssImport(cssImportData.srcImport)) {
- // do nothing for @import url(http://external.css)
- config.logger.debug(`did not resolve external css @import: ${cssImportData.srcImport}`);
- continue;
- }
- if (isCssNodeModule(cssImportData.url)) {
- // node resolve this path cuz it starts with ~
- await resolveCssNodeModule(config, compilerCtx, buildCtx.diagnostics, filePath, cssImportData);
- }
- else if (isAbsolute$1(cssImportData.url)) {
- // absolute path already
- cssImportData.filePath = normalizePath$1(cssImportData.url);
- }
- else {
- // relative path
- cssImportData.filePath = normalizePath$1(join(dir, cssImportData.url));
- }
- if (importeeExt !== 'css' && !cssImportData.filePath.toLowerCase().endsWith('.css')) {
- cssImportData.filePath += `.${importeeExt}`;
- if (importeeExt === 'scss') {
- const fileName = '_' + basename(cssImportData.filePath);
- const dirPath = dirname(cssImportData.filePath);
- cssImportData.altFilePath = normalizePath$1(join(dirPath, fileName));
- }
- }
- if (typeof cssImportData.filePath === 'string') {
- imports.push(cssImportData);
- }
- }
- return imports;
- };
- const isCssNodeModule = (url) => url.startsWith('~');
- const resolveCssNodeModule = async (config, compilerCtx, diagnostics, filePath, cssImportData) => {
- try {
- const m = getModuleId(cssImportData.url);
- const resolved = await resolveModuleIdAsync(config.sys, compilerCtx.fs, {
- moduleId: m.moduleId,
- containingFile: filePath,
- exts: [],
- packageFilter: (pkg) => {
- if (m.filePath !== '') {
- pkg.main = m.filePath;
- }
- return pkg;
- },
- });
- cssImportData.filePath = resolved.resolveId;
- cssImportData.updatedImport = `@import "${cssImportData.filePath}";`;
- }
- catch (e) {
- const d = buildError(diagnostics);
- d.messageText = `Unable to resolve node module for CSS @import: ${cssImportData.url}`;
- d.absFilePath = filePath;
- }
- };
- const isLocalCssImport = (srcImport) => {
- srcImport = srcImport.toLowerCase();
- if (srcImport.includes('url(')) {
- srcImport = srcImport.replace(/\"/g, '');
- srcImport = srcImport.replace(/\'/g, '');
- srcImport = srcImport.replace(/\s/g, '');
- if (srcImport.includes('url(http') || srcImport.includes('url(//')) {
- return false;
- }
- }
- return true;
- };
- const replaceImportDeclarations = (styleText, cssImports, isCssEntry) => {
- for (const cssImport of cssImports) {
- if (isCssEntry) {
- if (typeof cssImport.styleText === 'string') {
- styleText = styleText.replace(cssImport.srcImport, cssImport.styleText);
- }
- }
- else if (typeof cssImport.updatedImport === 'string') {
- styleText = styleText.replace(cssImport.srcImport, cssImport.updatedImport);
- }
- }
- return styleText;
- };
- const optimizeCss = async (config, compilerCtx, diagnostics, styleText, filePath) => {
- if (typeof styleText !== 'string' || !styleText.length) {
- // don't bother with invalid data
- return styleText;
- }
- if ((config.autoprefixCss === false || config.autoprefixCss === null) && !config.minifyCss) {
- // don't wanna autoprefix or minify, so just skip this
- return styleText;
- }
- if (typeof filePath === 'string') {
- filePath = normalizePath$1(filePath);
- }
- const opts = {
- input: styleText,
- filePath: filePath,
- autoprefixer: config.autoprefixCss,
- minify: config.minifyCss,
- };
- const cacheKey = await compilerCtx.cache.createKey('optimizeCss', optimizeCssId, opts);
- const cachedContent = await compilerCtx.cache.get(cacheKey);
- if (cachedContent != null) {
- // let's use the cached data we already figured out
- return cachedContent;
- }
- const minifyResults = await compilerCtx.worker.optimizeCss(opts);
- minifyResults.diagnostics.forEach((d) => {
- // collect up any diagnostics from minifying
- diagnostics.push(d);
- });
- if (typeof minifyResults.output === 'string' && !hasError(diagnostics)) {
- // cool, we got valid minified output
- // only cache if we got a cache key, if not it probably has an @import
- await compilerCtx.cache.put(cacheKey, minifyResults.output);
- return minifyResults.output;
- }
- return styleText;
- };
- const runPluginResolveId = async (pluginCtx, importee) => {
- for (const plugin of pluginCtx.config.plugins) {
- if (isFunction(plugin.resolveId)) {
- try {
- const results = plugin.resolveId(importee, null, pluginCtx);
- if (results != null) {
- if (isFunction(results.then)) {
- const promiseResults = await results;
- if (promiseResults != null) {
- return promiseResults;
- }
- }
- else if (isString$1(results)) {
- return results;
- }
- }
- }
- catch (e) {
- catchError(pluginCtx.diagnostics, e);
- }
- }
- }
- // default resolvedId
- return importee;
- };
- const runPluginLoad = async (pluginCtx, id) => {
- for (const plugin of pluginCtx.config.plugins) {
- if (isFunction(plugin.load)) {
- try {
- const results = plugin.load(id, pluginCtx);
- if (results != null) {
- if (isFunction(results.then)) {
- const promiseResults = await results;
- if (promiseResults != null) {
- return promiseResults;
- }
- }
- else if (isString$1(results)) {
- return results;
- }
- }
- }
- catch (e) {
- catchError(pluginCtx.diagnostics, e);
- }
- }
- }
- // default load()
- return pluginCtx.fs.readFile(id);
- };
- const runPluginTransforms = async (config, compilerCtx, buildCtx, id, cmp) => {
- const pluginCtx = {
- config: config,
- sys: config.sys,
- fs: compilerCtx.fs,
- cache: compilerCtx.cache,
- diagnostics: [],
- };
- const resolvedId = await runPluginResolveId(pluginCtx, id);
- const sourceText = await runPluginLoad(pluginCtx, resolvedId);
- if (!isString$1(sourceText)) {
- const diagnostic = buildError(buildCtx.diagnostics);
- diagnostic.header = `Unable to find "${basename(id)}"`;
- diagnostic.messageText = `The file "${relative$1(config.rootDir, id)}" was unable to load.`;
- return null;
- }
- const transformResults = {
- code: sourceText,
- id: id,
- };
- const isRawCssFile = transformResults.id.toLowerCase().endsWith('.css');
- const shouldParseCssDocs = cmp != null && config.outputTargets.some(isOutputTargetDocs);
- if (isRawCssFile) {
- // concat all css @imports into one file
- // when the entry file is a .css file (not .scss)
- // do this BEFORE transformations on css files
- if (shouldParseCssDocs && cmp != null) {
- cmp.styleDocs = cmp.styleDocs || [];
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code, cmp.styleDocs);
- transformResults.code = cssParseResults.styleText;
- transformResults.dependencies = cssParseResults.imports;
- }
- else {
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
- transformResults.code = cssParseResults.styleText;
- transformResults.dependencies = cssParseResults.imports;
- }
- }
- for (const plugin of pluginCtx.config.plugins) {
- if (isFunction(plugin.transform)) {
- try {
- let pluginTransformResults;
- const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
- if (results != null) {
- if (isFunction(results.then)) {
- pluginTransformResults = await results;
- }
- else {
- pluginTransformResults = results;
- }
- if (pluginTransformResults != null) {
- if (isString$1(pluginTransformResults)) {
- transformResults.code = pluginTransformResults;
- }
- else {
- if (isString$1(pluginTransformResults.code)) {
- transformResults.code = pluginTransformResults.code;
- }
- if (isString$1(pluginTransformResults.id)) {
- transformResults.id = pluginTransformResults.id;
- }
- }
- }
- }
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- }
- }
- buildCtx.diagnostics.push(...pluginCtx.diagnostics);
- if (!isRawCssFile) {
- // sass precompiler just ran and converted @import "my.css" into @import url("my.css")
- // because of the ".css" extension. Sass did NOT concat the ".css" files into the output
- // but only updated it to use url() instead. Let's go ahead and concat the url() css
- // files into one file like we did for raw .css files.
- // do this AFTER transformations on non-css files
- if (shouldParseCssDocs && cmp != null) {
- cmp.styleDocs = cmp.styleDocs || [];
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code, cmp.styleDocs);
- transformResults.code = cssParseResults.styleText;
- transformResults.dependencies = cssParseResults.imports;
- }
- else {
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
- transformResults.code = cssParseResults.styleText;
- transformResults.dependencies = cssParseResults.imports;
- }
- }
- return transformResults;
- };
- const runPluginTransformsEsmImports = async (config, compilerCtx, buildCtx, code, id) => {
- const pluginCtx = {
- config: config,
- sys: config.sys,
- fs: compilerCtx.fs,
- cache: compilerCtx.cache,
- diagnostics: [],
- };
- const transformResults = {
- code,
- id,
- map: null,
- diagnostics: [],
- dependencies: [],
- };
- const isRawCssFile = id.toLowerCase().endsWith('.css');
- if (isRawCssFile) {
- // concat all css @imports into one file
- // when the entry file is a .css file (not .scss)
- // do this BEFORE transformations on css files
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, id, transformResults.code);
- transformResults.code = cssParseResults.styleText;
- if (Array.isArray(cssParseResults.imports)) {
- transformResults.dependencies.push(...cssParseResults.imports);
- }
- }
- for (const plugin of pluginCtx.config.plugins) {
- if (isFunction(plugin.transform)) {
- try {
- let pluginTransformResults;
- const results = plugin.transform(transformResults.code, transformResults.id, pluginCtx);
- if (results != null) {
- if (isFunction(results.then)) {
- pluginTransformResults = await results;
- }
- else {
- pluginTransformResults = results;
- }
- if (pluginTransformResults != null) {
- if (isString$1(pluginTransformResults)) {
- transformResults.code = pluginTransformResults;
- }
- else {
- if (isString$1(pluginTransformResults.code)) {
- transformResults.code = pluginTransformResults.code;
- }
- if (isString$1(pluginTransformResults.id)) {
- transformResults.id = pluginTransformResults.id;
- }
- if (Array.isArray(pluginTransformResults.dependencies)) {
- const imports = pluginTransformResults.dependencies.filter((f) => !transformResults.dependencies.includes(f));
- transformResults.dependencies.push(...imports);
- }
- }
- }
- }
- }
- catch (e) {
- catchError(transformResults.diagnostics, e);
- }
- }
- }
- transformResults.diagnostics.push(...pluginCtx.diagnostics);
- if (!isRawCssFile) {
- // precompilers just ran and converted @import "my.css" into @import url("my.css")
- // because of the ".css" extension. Precompilers did NOT concat the ".css" files into
- // the output but only updated it to use url() instead. Let's go ahead and concat
- // the url() css files into one file like we did for raw .css files. Do this
- // AFTER transformations on non-css files
- const cssParseResults = await parseCssImports(config, compilerCtx, buildCtx, id, transformResults.id, transformResults.code);
- transformResults.code = cssParseResults.styleText;
- if (Array.isArray(cssParseResults.imports)) {
- const imports = cssParseResults.imports.filter((f) => !transformResults.dependencies.includes(f));
- transformResults.dependencies.push(...imports);
- }
- }
- return transformResults;
- };
- const generateGlobalStyles = async (config, compilerCtx, buildCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistGlobalStyles);
- if (outputTargets.length === 0) {
- return;
- }
- const globalStyles = await buildGlobalStyles(config, compilerCtx, buildCtx);
- if (globalStyles) {
- await Promise.all(outputTargets.map((o) => compilerCtx.fs.writeFile(o.file, globalStyles)));
- }
- };
- const buildGlobalStyles = async (config, compilerCtx, buildCtx) => {
- let globalStylePath = config.globalStyle;
- if (!globalStylePath) {
- return null;
- }
- const canSkip = await canSkipGlobalStyles(config, compilerCtx, buildCtx);
- if (canSkip) {
- return compilerCtx.cachedGlobalStyle;
- }
- try {
- globalStylePath = normalizePath$1(globalStylePath);
- compilerCtx.addWatchFile(globalStylePath);
- const transformResults = await runPluginTransforms(config, compilerCtx, buildCtx, globalStylePath);
- if (transformResults) {
- const optimizedCss = await optimizeCss(config, compilerCtx, buildCtx.diagnostics, transformResults.code, globalStylePath);
- compilerCtx.cachedGlobalStyle = optimizedCss;
- if (Array.isArray(transformResults.dependencies)) {
- const cssModuleImports = compilerCtx.cssModuleImports.get(globalStylePath) || [];
- transformResults.dependencies.forEach((dep) => {
- compilerCtx.addWatchFile(dep);
- if (!cssModuleImports.includes(dep)) {
- cssModuleImports.push(dep);
- }
- });
- compilerCtx.cssModuleImports.set(globalStylePath, cssModuleImports);
- }
- return optimizedCss;
- }
- }
- catch (e) {
- const d = catchError(buildCtx.diagnostics, e);
- d.absFilePath = globalStylePath;
- }
- compilerCtx.cachedGlobalStyle = null;
- return null;
- };
- const canSkipGlobalStyles = async (config, compilerCtx, buildCtx) => {
- if (!compilerCtx.cachedGlobalStyle) {
- return false;
- }
- if (buildCtx.requiresFullBuild) {
- return false;
- }
- if (buildCtx.isRebuild && !buildCtx.hasStyleChanges) {
- return true;
- }
- if (buildCtx.filesChanged.includes(config.globalStyle)) {
- // changed file IS the global entry style
- return false;
- }
- const cssModuleImports = compilerCtx.cssModuleImports.get(config.globalStyle);
- if (cssModuleImports && buildCtx.filesChanged.some((f) => cssModuleImports.includes(f))) {
- return false;
- }
- const hasChangedImports = await hasChangedImportFile(config, compilerCtx, buildCtx, config.globalStyle, compilerCtx.cachedGlobalStyle, []);
- if (hasChangedImports) {
- return false;
- }
- return true;
- };
- const hasChangedImportFile = async (config, compilerCtx, buildCtx, filePath, content, noLoop) => {
- if (noLoop.includes(filePath)) {
- return false;
- }
- noLoop.push(filePath);
- return hasChangedImportContent(config, compilerCtx, buildCtx, filePath, content, noLoop);
- };
- const hasChangedImportContent = async (config, compilerCtx, buildCtx, filePath, content, checkedFiles) => {
- const cssImports = await getCssImports(config, compilerCtx, buildCtx, filePath, content);
- if (cssImports.length === 0) {
- // don't bother
- return false;
- }
- const isChangedImport = buildCtx.filesChanged.some((changedFilePath) => {
- return cssImports.some((c) => c.filePath === changedFilePath);
- });
- if (isChangedImport) {
- // one of the changed files is an import of this file
- return true;
- }
- // keep diggin'
- const promises = cssImports.map(async (cssImportData) => {
- try {
- const content = await compilerCtx.fs.readFile(cssImportData.filePath);
- return hasChangedImportFile(config, compilerCtx, buildCtx, cssImportData.filePath, content, checkedFiles);
- }
- catch (e) {
- return false;
- }
- });
- const results = await Promise.all(promises);
- return results.includes(true);
- };
- const outputAngular = async (config, compilerCtx, buildCtx) => {
- if (!config.buildDist) {
- return;
- }
- const angularOutputTargets = config.outputTargets.filter(isOutputTargetAngular);
- if (angularOutputTargets.length === 0) {
- return;
- }
- const timespan = buildCtx.createTimeSpan(`generate angular proxies started`, true);
- await Promise.all(angularOutputTargets.map((outputTarget) => angularDirectiveProxyOutput(config, compilerCtx, buildCtx, outputTarget)));
- timespan.finish(`generate angular proxies finished`);
- };
- const angularDirectiveProxyOutput = (config, compilerCtx, buildCtx, outputTarget) => {
- const filteredComponents = getFilteredComponents(outputTarget.excludeComponents, buildCtx.components);
- return Promise.all([
- generateProxies(config, compilerCtx, buildCtx, filteredComponents, outputTarget),
- generateAngularArray(compilerCtx, filteredComponents, outputTarget),
- generateAngularUtils(compilerCtx, outputTarget),
- ]);
- };
- const getFilteredComponents = (excludeComponents = [], cmps) => {
- return sortBy(cmps, (cmp) => cmp.tagName).filter((c) => !excludeComponents.includes(c.tagName) && !c.internal);
- };
- const generateProxies = async (config, compilerCtx, buildCtx, components, outputTarget) => {
- const proxies = getProxies(components);
- const distTypesDir = dirname(buildCtx.packageJson.types);
- const dtsFilePath = join(config.rootDir, distTypesDir, GENERATED_DTS);
- const componentsTypeFile = relativeImport(outputTarget.directivesProxyFile, dtsFilePath, '.d.ts');
- const imports = `/* eslint-disable */
- /* tslint:disable */
- /* auto-generated angular directive proxies */
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, NgZone } from '@angular/core';`;
- const sourceImports = !outputTarget.componentCorePackage
- ? `import { Components } from '${componentsTypeFile}';`
- : `import { Components } from '${outputTarget.componentCorePackage}';`;
- const final = [imports, getProxyUtils(outputTarget), sourceImports, proxies];
- const finalText = final.join('\n') + '\n';
- const tsSourceFile = t.createSourceFile(GENERATED_DTS, finalText, t.ScriptTarget.Latest, false);
- const tsPrinter = t.createPrinter({
- newLine: t.NewLineKind.LineFeed,
- });
- const formattedCode = tsPrinter.printFile(tsSourceFile);
- return compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, formattedCode);
- };
- const getProxies = (components) => {
- return components.map(getProxy).join('\n');
- };
- const getProxyCmp = (inputs, methods) => {
- const hasInputs = inputs.length > 0;
- const hasMethods = methods.length > 0;
- const proxMeta = [];
- if (!hasInputs && !hasMethods) {
- return '';
- }
- if (hasInputs)
- proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
- if (hasMethods)
- proxMeta.push(`'methods': ['${methods.join(`', '`)}']`);
- return `@ProxyCmp({${proxMeta.join(', ')}})`;
- };
- const getProxy = (cmpMeta) => {
- // Collect component meta
- const inputs = getInputs(cmpMeta);
- const outputs = getOutputs(cmpMeta);
- const methods = getMethods(cmpMeta);
- const hasOutputs = outputs.length > 0;
- // Generate Angular @Directive
- const directiveOpts = [
- `selector: \'${cmpMeta.tagName}\'`,
- `changeDetection: ChangeDetectionStrategy.OnPush`,
- `template: '<ng-content></ng-content>'`,
- ];
- if (inputs.length > 0) {
- directiveOpts.push(`inputs: ['${inputs.join(`', '`)}']`);
- }
- const tagNameAsPascal = dashToPascalCase$1(cmpMeta.tagName);
- const lines = [
- `
- export declare interface ${tagNameAsPascal} extends Components.${tagNameAsPascal} {}
- ${getProxyCmp(inputs, methods)}
- @Component({ ${directiveOpts.join(', ')} })
- export class ${tagNameAsPascal} {`,
- ];
- // Generate outputs
- outputs.forEach((output) => {
- lines.push(` ${output}!: EventEmitter<CustomEvent>;`);
- });
- lines.push(' protected el: HTMLElement;');
- lines.push(` constructor(c: ChangeDetectorRef, r: ElementRef, protected z: NgZone) {
- c.detach();
- this.el = r.nativeElement;`);
- if (hasOutputs) {
- lines.push(` proxyOutputs(this, this.el, ['${outputs.join(`', '`)}']);`);
- }
- lines.push(` }`);
- lines.push(`}`);
- return lines.join('\n');
- };
- const getInputs = (cmpMeta) => {
- return [
- ...cmpMeta.properties.filter((prop) => !prop.internal).map((prop) => prop.name),
- ...cmpMeta.virtualProperties.map((prop) => prop.name),
- ].sort();
- };
- const getOutputs = (cmpMeta) => {
- return cmpMeta.events.filter((ev) => !ev.internal).map((prop) => prop.name);
- };
- const getMethods = (cmpMeta) => {
- return cmpMeta.methods.filter((method) => !method.internal).map((prop) => prop.name);
- };
- const getProxyUtils = (outputTarget) => {
- if (!outputTarget.directivesUtilsFile) {
- return PROXY_UTILS.replace(/export function/g, 'function');
- }
- else {
- const utilsPath = relativeImport(outputTarget.directivesProxyFile, outputTarget.directivesUtilsFile, '.ts');
- return `import { ProxyCmp, proxyOutputs } from '${utilsPath}';\n`;
- }
- };
- const generateAngularArray = (compilerCtx, components, outputTarget) => {
- if (!outputTarget.directivesArrayFile) {
- return Promise.resolve();
- }
- const proxyPath = relativeImport(outputTarget.directivesArrayFile, outputTarget.directivesProxyFile, '.ts');
- const directives = components
- .map((cmpMeta) => dashToPascalCase$1(cmpMeta.tagName))
- .map((className) => ` d.${className}`)
- .join(',\n');
- const c = `
- import type * as d from '${proxyPath}';
- export const DIRECTIVES = [
- ${directives}
- ];
- `;
- return compilerCtx.fs.writeFile(outputTarget.directivesArrayFile, c);
- };
- const generateAngularUtils = async (compilerCtx, outputTarget) => {
- if (outputTarget.directivesUtilsFile) {
- await compilerCtx.fs.writeFile(outputTarget.directivesUtilsFile, '/* eslint-disable */\n/* tslint:disable */\n' + PROXY_UTILS);
- }
- };
- const PROXY_UTILS = `import { fromEvent } from 'rxjs';
- export const proxyInputs = (Cmp: any, inputs: string[]) => {
- const Prototype = Cmp.prototype;
- inputs.forEach(item => {
- Object.defineProperty(Prototype, item, {
- get() {
- return this.el[item];
- },
- set(val: any) {
- this.z.runOutsideAngular(() => (this.el[item] = val));
- }
- });
- });
- };
- export const proxyMethods = (Cmp: any, methods: string[]) => {
- const Prototype = Cmp.prototype;
- methods.forEach(methodName => {
- Prototype[methodName] = function () {
- const args = arguments;
- return this.z.runOutsideAngular(() =>
- this.el[methodName].apply(this.el, args)
- );
- };
- });
- };
- export const proxyOutputs = (instance: any, el: any, events: string[]) => {
- events.forEach(eventName => instance[eventName] = fromEvent(el, eventName));
- }
- export function ProxyCmp(opts: { inputs?: any; methods?: any }) {
- const decorator = function(cls: any){
- if (opts.inputs) {
- proxyInputs(cls, opts.inputs);
- }
- if (opts.methods) {
- proxyMethods(cls, opts.methods);
- }
- return cls;
- };
- return decorator;
- }
- `;
- const GENERATED_DTS = 'components.d.ts';
- const getComponentAssetsCopyTasks = (config, buildCtx, dest, collectionsPath) => {
- if (!dest) {
- return [];
- }
- // get a list of all the directories to copy
- // these paths should be absolute
- const copyTasks = [];
- const cmps = buildCtx.components;
- cmps
- .filter((cmp) => cmp.assetsDirs != null && cmp.assetsDirs.length > 0)
- .forEach((cmp) => {
- if (!collectionsPath) {
- cmp.assetsDirs.forEach((assetsMeta) => {
- copyTasks.push({
- src: assetsMeta.absolutePath,
- dest: join(dest, assetsMeta.cmpRelativePath),
- warn: false,
- keepDirStructure: false,
- });
- });
- }
- else if (!cmp.excludeFromCollection && !cmp.isCollectionDependency) {
- cmp.assetsDirs.forEach((assetsMeta) => {
- const collectionDirDestination = join(dest, relative$1(config.srcDir, assetsMeta.absolutePath));
- copyTasks.push({
- src: assetsMeta.absolutePath,
- dest: collectionDirDestination,
- warn: false,
- keepDirStructure: false,
- });
- });
- }
- });
- buildCtx.debug(`getComponentAssetsCopyTasks: ${copyTasks.length}`);
- return copyTasks;
- };
- const canSkipAssetsCopy = (compilerCtx, entryModules, filesChanged) => {
- if (!compilerCtx.hasSuccessfulBuild) {
- // always copy assets if we haven't had a successful build yet
- // cannot skip build
- return false;
- }
- // assume we want to skip copying assets again
- let shouldSkipAssetsCopy = true;
- // loop through each of the changed files
- filesChanged.forEach((changedFile) => {
- // get the directory of where the changed file is in
- const changedFileDirPath = normalizePath$1(dirname(changedFile));
- // loop through all the possible asset directories
- entryModules.forEach((entryModule) => {
- entryModule.cmps.forEach((cmp) => {
- if (cmp.assetsDirs != null) {
- // loop through each of the asset directories of each component
- cmp.assetsDirs.forEach((assetsDir) => {
- // get the absolute of the asset directory
- const assetDirPath = normalizePath$1(assetsDir.absolutePath);
- // if the changed file directory is this asset directory
- // then we should recopy everything over again
- if (changedFileDirPath === assetDirPath) {
- shouldSkipAssetsCopy = false;
- return;
- }
- });
- }
- });
- });
- });
- return shouldSkipAssetsCopy;
- };
- const getSrcAbsPath = (config, src) => {
- if (isAbsolute$1(src)) {
- return src;
- }
- return join(config.srcDir, src);
- };
- const getDestAbsPath = (src, destAbsPath, destRelPath) => {
- if (destRelPath) {
- if (isAbsolute$1(destRelPath)) {
- return destRelPath;
- }
- else {
- return join(destAbsPath, destRelPath);
- }
- }
- if (isAbsolute$1(src)) {
- throw new Error(`copy task, "dest" property must exist if "src" property is an absolute path: ${src}`);
- }
- return destAbsPath;
- };
- const outputCopy = async (config, compilerCtx, buildCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetCopy);
- if (outputTargets.length === 0) {
- return;
- }
- const changedFiles = [...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.dirsAdded];
- const copyTasks = [];
- const needsCopyAssets = !canSkipAssetsCopy(compilerCtx, buildCtx.entryModules, buildCtx.filesChanged);
- outputTargets.forEach((o) => {
- if (needsCopyAssets && o.copyAssets) {
- copyTasks.push(...getComponentAssetsCopyTasks(config, buildCtx, o.dir, o.copyAssets === 'collection'));
- }
- copyTasks.push(...getCopyTasks(config, buildCtx, o, changedFiles));
- });
- if (copyTasks.length > 0) {
- const timespan = buildCtx.createTimeSpan(`copy started`);
- let copiedFiles = 0;
- try {
- const copyResults = await config.sys.copy(copyTasks, config.srcDir);
- if (copyResults != null) {
- buildCtx.diagnostics.push(...copyResults.diagnostics);
- compilerCtx.fs.cancelDeleteDirectoriesFromDisk(copyResults.dirPaths);
- compilerCtx.fs.cancelDeleteFilesFromDisk(copyResults.filePaths);
- copiedFiles = copyResults.filePaths.length;
- }
- }
- catch (e) {
- const err = buildError(buildCtx.diagnostics);
- if (e instanceof Error) {
- err.messageText = e.message;
- }
- }
- timespan.finish(`copy finished (${copiedFiles} file${copiedFiles === 1 ? '' : 's'})`);
- }
- };
- const getCopyTasks = (config, buildCtx, o, changedFiles) => {
- if (!Array.isArray(o.copy)) {
- return [];
- }
- const copyTasks = !buildCtx.isRebuild || buildCtx.requiresFullBuild ? o.copy : filterCopyTasks(config, o.copy, changedFiles);
- return copyTasks.map((t) => transformToAbs(t, o.dir));
- };
- const filterCopyTasks = (config, tasks, changedFiles) => {
- if (Array.isArray(tasks)) {
- return tasks.filter((copy) => {
- let copySrc = copy.src;
- if (isGlob(copySrc)) {
- // test the glob
- copySrc = join(config.srcDir, copySrc);
- if (changedFiles.some(minimatch_1$1.filter(copySrc))) {
- return true;
- }
- }
- else {
- copySrc = normalizePath$1(getSrcAbsPath(config, copySrc + '/'));
- if (changedFiles.some((f) => f.startsWith(copySrc))) {
- return true;
- }
- }
- return false;
- });
- }
- return [];
- };
- const transformToAbs = (copyTask, dest) => {
- return {
- src: copyTask.src,
- dest: getDestAbsPath(copyTask.src, dest, copyTask.dest),
- keepDirStructure: typeof copyTask.keepDirStructure === 'boolean' ? copyTask.keepDirStructure : copyTask.dest == null,
- warn: copyTask.warn !== false,
- };
- };
- const removeCollectionImports = (compilerCtx) => {
- /*
- // remove side effect collection imports like:
- import 'ionicons';
-
- // do not remove collection imports with importClauses:
- import * as asdf 'ionicons';
- import { asdf } '@ionic/core';
- */
- return () => {
- return (tsSourceFile) => {
- let madeUpdates = false;
- const statements = tsSourceFile.statements.slice();
- for (let i = statements.length - 1; i >= 0; i--) {
- const n = statements[i];
- if (t.isImportDeclaration(n)) {
- if (!n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
- // must not have an import clause
- // must have a module specifier and
- // the module specifier must be a string literal
- const importPath = n.moduleSpecifier.text;
- // test if this side effect import is a collection
- const isCollectionImport = compilerCtx.collections.some((c) => {
- return c.collectionName === importPath || c.moduleId === importPath;
- });
- if (isCollectionImport) {
- // turns out this is a side effect import is a collection,
- // we actually don't want to include this in the JS output
- // we've already gather the types we needed, kthxbai
- madeUpdates = true;
- statements.splice(i, 1);
- }
- }
- }
- }
- if (madeUpdates) {
- return t.updateSourceFileNode(tsSourceFile, statements);
- }
- return tsSourceFile;
- };
- };
- };
- const STENCIL_CORE_ID = '@stencil/core';
- const STENCIL_INTERNAL_ID = '@stencil/core/internal';
- const STENCIL_APP_DATA_ID = '@stencil/core/internal/app-data';
- const STENCIL_APP_GLOBALS_ID = '@stencil/core/internal/app-globals';
- const STENCIL_HYDRATE_FACTORY_ID = '@stencil/core/hydrate-factory';
- const STENCIL_INTERNAL_CLIENT_ID = '@stencil/core/internal/client';
- const STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID = '@stencil/core/internal/client/patch-browser';
- const STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID = '@stencil/core/internal/client/patch-esm';
- const STENCIL_INTERNAL_HYDRATE_ID = '@stencil/core/internal/hydrate';
- const STENCIL_MOCK_DOC_ID = '@stencil/core/mock-doc';
- const APP_DATA_CONDITIONAL = '?app-data=conditional';
- const LAZY_BROWSER_ENTRY_ID = '@lazy-browser-entrypoint' + APP_DATA_CONDITIONAL;
- const LAZY_EXTERNAL_ENTRY_ID = '@lazy-external-entrypoint' + APP_DATA_CONDITIONAL;
- const USER_INDEX_ENTRY_ID = '@user-index-entrypoint';
- const appDataPlugin = (config, compilerCtx, buildCtx, build, platform) => {
- if (!platform) {
- return {
- name: 'appDataPlugin',
- };
- }
- const globalScripts = getGlobalScriptData(config, compilerCtx);
- return {
- name: 'appDataPlugin',
- resolveId(id, importer) {
- if (id === STENCIL_APP_DATA_ID || id === STENCIL_APP_GLOBALS_ID) {
- if (platform === 'worker') {
- this.error('@stencil/core packages cannot be imported from a worker.');
- }
- if (platform === 'hydrate' || STENCIL_APP_GLOBALS_ID) {
- // hydrate will always bundle app-data and runtime
- // and the load() fn will build a custom globals import
- return id;
- }
- else if (platform === 'client' && importer && importer.endsWith(APP_DATA_CONDITIONAL)) {
- // since the importer ends with ?app-data=conditional we know that
- // we need to build custom app-data based off of component metadata
- // return the same "id" so that the "load()" method knows to
- // build custom app-data
- return id;
- }
- // for a client build that does not have ?app-data=conditional at the end then we
- // do not want to create custom app-data, but should use the default
- }
- return null;
- },
- load(id) {
- if (id === STENCIL_APP_GLOBALS_ID) {
- const s = new MagicString$2(``);
- appendGlobalScripts(globalScripts, s);
- return s.toString();
- }
- if (id === STENCIL_APP_DATA_ID) {
- // build custom app-data based off of component metadata
- const s = new MagicString$2(``);
- appendNamespace(config, s);
- appendBuildConditionals(config, build, s);
- appendEnv(config, s);
- return s.toString();
- }
- if (id !== config.globalScript) {
- return null;
- }
- const module = compilerCtx.moduleMap.get(config.globalScript);
- if (!module) {
- return null;
- }
- else if (!module.sourceMapFileText) {
- return {
- code: module.staticSourceFileText,
- map: null,
- };
- }
- const sourceMap = JSON.parse(module.sourceMapFileText);
- sourceMap.sources = sourceMap.sources.map((src) => basename(src));
- return { code: module.staticSourceFileText, map: sourceMap };
- },
- transform(code, id) {
- id = normalizePath$1(id);
- if (globalScripts.some((s) => s.path === id)) {
- const program = this.parse(code, {});
- const needsDefault = !program.body.some((s) => s.type === 'ExportDefaultDeclaration');
- const defaultExport = needsDefault ? '\nexport const globalFn = () => {};\nexport default globalFn;' : '';
- code = getContextImport(platform) + code + defaultExport;
- const compilerOptions = { ...config.tsCompilerOptions };
- compilerOptions.module = t.ModuleKind.ESNext;
- const results = t.transpileModule(code, {
- compilerOptions,
- fileName: id,
- transformers: {
- after: [removeCollectionImports(compilerCtx)],
- },
- });
- buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(results.diagnostics));
- if (config.sourceMap) {
- // generate the sourcemap for global script
- const codeMs = new MagicString$2(code);
- const codeMap = codeMs.generateMap({
- source: id,
- // this is the name of the sourcemap, not to be confused with the `file` field in a generated sourcemap
- file: id + '.map',
- includeContent: true,
- hires: true,
- });
- return { code: results.outputText, map: codeMap };
- }
- return { code: results.outputText };
- }
- return null;
- },
- };
- };
- const getGlobalScriptData = (config, compilerCtx) => {
- const globalScripts = [];
- if (isString$1(config.globalScript)) {
- const mod = compilerCtx.moduleMap.get(config.globalScript);
- const globalScript = compilerCtx.version === 2 ? config.globalScript : mod && mod.jsFilePath;
- if (globalScript) {
- globalScripts.push({
- defaultName: createJsVarName(config.namespace + 'GlobalScript'),
- path: normalizePath$1(globalScript),
- });
- }
- }
- compilerCtx.collections.forEach((collection) => {
- if (collection.global != null && isString$1(collection.global.sourceFilePath)) {
- let defaultName = createJsVarName(collection.collectionName + 'GlobalScript');
- if (globalScripts.some((s) => s.defaultName === defaultName)) {
- defaultName += globalScripts.length;
- }
- globalScripts.push({
- defaultName,
- path: normalizePath$1(collection.global.sourceFilePath),
- });
- }
- });
- return globalScripts;
- };
- const appendGlobalScripts = (globalScripts, s) => {
- if (globalScripts.length === 1) {
- s.prepend(`import appGlobalScript from '${globalScripts[0].path}';\n`);
- s.append(`export const globalScripts = appGlobalScript;\n`);
- }
- else if (globalScripts.length > 1) {
- globalScripts.forEach((globalScript) => {
- s.prepend(`import ${globalScript.defaultName} from '${globalScript.path}';\n`);
- });
- s.append(`export const globalScripts = () => {\n`);
- globalScripts.forEach((globalScript) => {
- s.append(` ${globalScript.defaultName}();\n`);
- });
- s.append(`};\n`);
- }
- else {
- s.append(`export const globalScripts = () => {};\n`);
- }
- };
- const appendBuildConditionals = (config, build, s) => {
- const buildData = Object.keys(build)
- .sort()
- .map((key) => key + ': ' + (build[key] ? 'true' : 'false'))
- .join(', ');
- s.append(`export const BUILD = /* ${config.fsNamespace} */ { ${buildData} };\n`);
- };
- const appendEnv = (config, s) => {
- s.append(`export const Env = /* ${config.fsNamespace} */ ${JSON.stringify(config.env)};\n`);
- };
- const appendNamespace = (config, s) => {
- s.append(`export const NAMESPACE = '${config.fsNamespace}';\n`);
- };
- const getContextImport = (platform) => {
- return `import { Context } from '${platform === 'hydrate' ? STENCIL_INTERNAL_HYDRATE_ID : STENCIL_CORE_ID}';\n`;
- };
- const coreResolvePlugin = (config, compilerCtx, platform, externalRuntime) => {
- const compilerExe = config.sys.getCompilerExecutingPath();
- const internalClient = getStencilInternalModule(config, compilerExe, 'client/index.js');
- const internalClientPatchBrowser = getStencilInternalModule(config, compilerExe, 'client/patch-browser.js');
- const internalClientPatchEsm = getStencilInternalModule(config, compilerExe, 'client/patch-esm.js');
- const internalHydrate = getStencilInternalModule(config, compilerExe, 'hydrate/index.js');
- return {
- name: 'coreResolvePlugin',
- resolveId(id) {
- if (id === STENCIL_CORE_ID || id === STENCIL_INTERNAL_ID) {
- if (platform === 'client') {
- if (externalRuntime) {
- return {
- id: STENCIL_INTERNAL_CLIENT_ID,
- external: true,
- };
- }
- // adding ?app-data=conditional as an identifier to ensure we don't
- // use the default app-data, but build a custom one based on component meta
- return internalClient + APP_DATA_CONDITIONAL;
- }
- if (platform === 'hydrate') {
- return internalHydrate;
- }
- }
- if (id === STENCIL_INTERNAL_CLIENT_ID) {
- if (externalRuntime) {
- // not bunding the client runtime and the user's component together this
- // must be the custom elements build, where @stencil/core/internal/client
- // is an import, rather than bundling
- return {
- id: STENCIL_INTERNAL_CLIENT_ID,
- external: true,
- };
- }
- // importing @stencil/core/internal/client directly, so it shouldn't get
- // the custom app-data conditionals
- return internalClient;
- }
- if (id === STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID) {
- if (externalRuntime) {
- return {
- id: STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID,
- external: true,
- };
- }
- return internalClientPatchBrowser;
- }
- if (id === STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID) {
- if (externalRuntime) {
- return {
- id: STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID,
- external: true,
- };
- }
- return internalClientPatchEsm;
- }
- if (id === STENCIL_INTERNAL_HYDRATE_ID) {
- return internalHydrate;
- }
- return null;
- },
- async load(filePath) {
- if (filePath && !filePath.startsWith('\0')) {
- filePath = normalizeFsPath(filePath);
- if (filePath === internalClient || filePath === internalHydrate) {
- if (platform === 'worker') {
- return `
- export const Build = {
- isDev: ${config.devMode},
- isBrowser: true,
- isServer: false,
- isTesting: false,
- };`;
- }
- let code = await compilerCtx.fs.readFile(filePath);
- if (typeof code !== 'string' && isRemoteUrl(compilerExe)) {
- const url = getStencilModuleUrl(compilerExe, filePath);
- code = await fetchModuleAsync(config.sys, compilerCtx.fs, packageVersions, url, filePath);
- }
- if (typeof code === 'string') {
- const hydratedFlag = config.hydratedFlag;
- if (hydratedFlag) {
- const hydratedFlagHead = getHydratedFlagHead(hydratedFlag);
- if (HYDRATED_CSS !== hydratedFlagHead) {
- code = code.replace(HYDRATED_CSS, hydratedFlagHead);
- if (hydratedFlag.name !== 'hydrated') {
- code = code.replace(`.classList.add("hydrated")`, `.classList.add("${hydratedFlag.name}")`);
- code = code.replace(`.classList.add('hydrated')`, `.classList.add('${hydratedFlag.name}')`);
- code = code.replace(`.setAttribute("hydrated",`, `.setAttribute("${hydratedFlag.name}",`);
- code = code.replace(`.setAttribute('hydrated',`, `.setAttribute('${hydratedFlag.name}',`);
- }
- }
- }
- else {
- code = code.replace(HYDRATED_CSS, '{}');
- }
- }
- return code;
- }
- }
- return null;
- },
- resolveImportMeta(prop, { format }) {
- if (config.extras.dynamicImportShim && prop === 'url' && format === 'es') {
- return '""';
- }
- return null;
- },
- };
- };
- const getStencilInternalModule = (config, compilerExe, internalModule) => {
- if (isRemoteUrl(compilerExe)) {
- return normalizePath$1(config.sys.getLocalModulePath({
- rootDir: config.rootDir,
- moduleId: '@stencil/core',
- path: 'internal/' + internalModule,
- }));
- }
- const compilerExeDir = dirname(compilerExe);
- return normalizePath$1(join(compilerExeDir, '..', 'internal', internalModule));
- };
- const getHydratedFlagHead = (h) => {
- // {visibility:hidden}.hydrated{visibility:inherit}
- let initial;
- let hydrated;
- if (!String(h.initialValue) || h.initialValue === '' || h.initialValue == null) {
- initial = '';
- }
- else {
- initial = `{${h.property}:${h.initialValue}}`;
- }
- const selector = h.selector === 'attribute' ? `[${h.name}]` : `.${h.name}`;
- if (!String(h.hydratedValue) || h.hydratedValue === '' || h.hydratedValue == null) {
- hydrated = '';
- }
- else {
- hydrated = `${selector}{${h.property}:${h.hydratedValue}}`;
- }
- return initial + hydrated;
- };
- var minimalisticAssert = assert;
- function assert(val, msg) {
- if (!val)
- throw new Error(msg || 'Assertion failed');
- }
- assert.equal = function assertEqual(l, r, msg) {
- if (l != r)
- throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));
- };
- var inherits_browser$1 = createCommonjsModule$1(function (module) {
- if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- }
- };
- } else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function () {};
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- }
- };
- }
- });
- const require$$0 = /*@__PURE__*/getAugmentedNamespace$1(util$4);
- var inherits$2 = createCommonjsModule$1(function (module) {
- try {
- var util = require$$0;
- /* istanbul ignore next */
- if (typeof util.inherits !== 'function') throw '';
- module.exports = util.inherits;
- } catch (e) {
- /* istanbul ignore next */
- module.exports = inherits_browser$1;
- }
- });
- var inherits_1 = inherits$2;
- function isSurrogatePair(msg, i) {
- if ((msg.charCodeAt(i) & 0xFC00) !== 0xD800) {
- return false;
- }
- if (i < 0 || i + 1 >= msg.length) {
- return false;
- }
- return (msg.charCodeAt(i + 1) & 0xFC00) === 0xDC00;
- }
- function toArray(msg, enc) {
- if (Array.isArray(msg))
- return msg.slice();
- if (!msg)
- return [];
- var res = [];
- if (typeof msg === 'string') {
- if (!enc) {
- // Inspired by stringToUtf8ByteArray() in closure-library by Google
- // https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
- // Apache License 2.0
- // https://github.com/google/closure-library/blob/master/LICENSE
- var p = 0;
- for (var i = 0; i < msg.length; i++) {
- var c = msg.charCodeAt(i);
- if (c < 128) {
- res[p++] = c;
- } else if (c < 2048) {
- res[p++] = (c >> 6) | 192;
- res[p++] = (c & 63) | 128;
- } else if (isSurrogatePair(msg, i)) {
- c = 0x10000 + ((c & 0x03FF) << 10) + (msg.charCodeAt(++i) & 0x03FF);
- res[p++] = (c >> 18) | 240;
- res[p++] = ((c >> 12) & 63) | 128;
- res[p++] = ((c >> 6) & 63) | 128;
- res[p++] = (c & 63) | 128;
- } else {
- res[p++] = (c >> 12) | 224;
- res[p++] = ((c >> 6) & 63) | 128;
- res[p++] = (c & 63) | 128;
- }
- }
- } else if (enc === 'hex') {
- msg = msg.replace(/[^a-z0-9]+/ig, '');
- if (msg.length % 2 !== 0)
- msg = '0' + msg;
- for (i = 0; i < msg.length; i += 2)
- res.push(parseInt(msg[i] + msg[i + 1], 16));
- }
- } else {
- for (i = 0; i < msg.length; i++)
- res[i] = msg[i] | 0;
- }
- return res;
- }
- var toArray_1 = toArray;
- function toHex(msg) {
- var res = '';
- for (var i = 0; i < msg.length; i++)
- res += zero2(msg[i].toString(16));
- return res;
- }
- var toHex_1 = toHex;
- function htonl(w) {
- var res = (w >>> 24) |
- ((w >>> 8) & 0xff00) |
- ((w << 8) & 0xff0000) |
- ((w & 0xff) << 24);
- return res >>> 0;
- }
- var htonl_1 = htonl;
- function toHex32(msg, endian) {
- var res = '';
- for (var i = 0; i < msg.length; i++) {
- var w = msg[i];
- if (endian === 'little')
- w = htonl(w);
- res += zero8(w.toString(16));
- }
- return res;
- }
- var toHex32_1 = toHex32;
- function zero2(word) {
- if (word.length === 1)
- return '0' + word;
- else
- return word;
- }
- var zero2_1 = zero2;
- function zero8(word) {
- if (word.length === 7)
- return '0' + word;
- else if (word.length === 6)
- return '00' + word;
- else if (word.length === 5)
- return '000' + word;
- else if (word.length === 4)
- return '0000' + word;
- else if (word.length === 3)
- return '00000' + word;
- else if (word.length === 2)
- return '000000' + word;
- else if (word.length === 1)
- return '0000000' + word;
- else
- return word;
- }
- var zero8_1 = zero8;
- function join32(msg, start, end, endian) {
- var len = end - start;
- minimalisticAssert(len % 4 === 0);
- var res = new Array(len / 4);
- for (var i = 0, k = start; i < res.length; i++, k += 4) {
- var w;
- if (endian === 'big')
- w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];
- else
- w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];
- res[i] = w >>> 0;
- }
- return res;
- }
- var join32_1 = join32;
- function split32(msg, endian) {
- var res = new Array(msg.length * 4);
- for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
- var m = msg[i];
- if (endian === 'big') {
- res[k] = m >>> 24;
- res[k + 1] = (m >>> 16) & 0xff;
- res[k + 2] = (m >>> 8) & 0xff;
- res[k + 3] = m & 0xff;
- } else {
- res[k + 3] = m >>> 24;
- res[k + 2] = (m >>> 16) & 0xff;
- res[k + 1] = (m >>> 8) & 0xff;
- res[k] = m & 0xff;
- }
- }
- return res;
- }
- var split32_1 = split32;
- function rotr32$1(w, b) {
- return (w >>> b) | (w << (32 - b));
- }
- var rotr32_1 = rotr32$1;
- function rotl32(w, b) {
- return (w << b) | (w >>> (32 - b));
- }
- var rotl32_1 = rotl32;
- function sum32$1(a, b) {
- return (a + b) >>> 0;
- }
- var sum32_1 = sum32$1;
- function sum32_3(a, b, c) {
- return (a + b + c) >>> 0;
- }
- var sum32_3_1 = sum32_3;
- function sum32_4$1(a, b, c, d) {
- return (a + b + c + d) >>> 0;
- }
- var sum32_4_1 = sum32_4$1;
- function sum32_5$1(a, b, c, d, e) {
- return (a + b + c + d + e) >>> 0;
- }
- var sum32_5_1 = sum32_5$1;
- function sum64(buf, pos, ah, al) {
- var bh = buf[pos];
- var bl = buf[pos + 1];
- var lo = (al + bl) >>> 0;
- var hi = (lo < al ? 1 : 0) + ah + bh;
- buf[pos] = hi >>> 0;
- buf[pos + 1] = lo;
- }
- var sum64_1 = sum64;
- function sum64_hi(ah, al, bh, bl) {
- var lo = (al + bl) >>> 0;
- var hi = (lo < al ? 1 : 0) + ah + bh;
- return hi >>> 0;
- }
- var sum64_hi_1 = sum64_hi;
- function sum64_lo(ah, al, bh, bl) {
- var lo = al + bl;
- return lo >>> 0;
- }
- var sum64_lo_1 = sum64_lo;
- function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
- var carry = 0;
- var lo = al;
- lo = (lo + bl) >>> 0;
- carry += lo < al ? 1 : 0;
- lo = (lo + cl) >>> 0;
- carry += lo < cl ? 1 : 0;
- lo = (lo + dl) >>> 0;
- carry += lo < dl ? 1 : 0;
- var hi = ah + bh + ch + dh + carry;
- return hi >>> 0;
- }
- var sum64_4_hi_1 = sum64_4_hi;
- function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
- var lo = al + bl + cl + dl;
- return lo >>> 0;
- }
- var sum64_4_lo_1 = sum64_4_lo;
- function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
- var carry = 0;
- var lo = al;
- lo = (lo + bl) >>> 0;
- carry += lo < al ? 1 : 0;
- lo = (lo + cl) >>> 0;
- carry += lo < cl ? 1 : 0;
- lo = (lo + dl) >>> 0;
- carry += lo < dl ? 1 : 0;
- lo = (lo + el) >>> 0;
- carry += lo < el ? 1 : 0;
- var hi = ah + bh + ch + dh + eh + carry;
- return hi >>> 0;
- }
- var sum64_5_hi_1 = sum64_5_hi;
- function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
- var lo = al + bl + cl + dl + el;
- return lo >>> 0;
- }
- var sum64_5_lo_1 = sum64_5_lo;
- function rotr64_hi(ah, al, num) {
- var r = (al << (32 - num)) | (ah >>> num);
- return r >>> 0;
- }
- var rotr64_hi_1 = rotr64_hi;
- function rotr64_lo(ah, al, num) {
- var r = (ah << (32 - num)) | (al >>> num);
- return r >>> 0;
- }
- var rotr64_lo_1 = rotr64_lo;
- function shr64_hi(ah, al, num) {
- return ah >>> num;
- }
- var shr64_hi_1 = shr64_hi;
- function shr64_lo(ah, al, num) {
- var r = (ah << (32 - num)) | (al >>> num);
- return r >>> 0;
- }
- var shr64_lo_1 = shr64_lo;
- var utils$1 = {
- inherits: inherits_1,
- toArray: toArray_1,
- toHex: toHex_1,
- htonl: htonl_1,
- toHex32: toHex32_1,
- zero2: zero2_1,
- zero8: zero8_1,
- join32: join32_1,
- split32: split32_1,
- rotr32: rotr32_1,
- rotl32: rotl32_1,
- sum32: sum32_1,
- sum32_3: sum32_3_1,
- sum32_4: sum32_4_1,
- sum32_5: sum32_5_1,
- sum64: sum64_1,
- sum64_hi: sum64_hi_1,
- sum64_lo: sum64_lo_1,
- sum64_4_hi: sum64_4_hi_1,
- sum64_4_lo: sum64_4_lo_1,
- sum64_5_hi: sum64_5_hi_1,
- sum64_5_lo: sum64_5_lo_1,
- rotr64_hi: rotr64_hi_1,
- rotr64_lo: rotr64_lo_1,
- shr64_hi: shr64_hi_1,
- shr64_lo: shr64_lo_1
- };
- function BlockHash$1() {
- this.pending = null;
- this.pendingTotal = 0;
- this.blockSize = this.constructor.blockSize;
- this.outSize = this.constructor.outSize;
- this.hmacStrength = this.constructor.hmacStrength;
- this.padLength = this.constructor.padLength / 8;
- this.endian = 'big';
- this._delta8 = this.blockSize / 8;
- this._delta32 = this.blockSize / 32;
- }
- var BlockHash_1 = BlockHash$1;
- BlockHash$1.prototype.update = function update(msg, enc) {
- // Convert message to array, pad it, and join into 32bit blocks
- msg = utils$1.toArray(msg, enc);
- if (!this.pending)
- this.pending = msg;
- else
- this.pending = this.pending.concat(msg);
- this.pendingTotal += msg.length;
- // Enough data, try updating
- if (this.pending.length >= this._delta8) {
- msg = this.pending;
- // Process pending data in blocks
- var r = msg.length % this._delta8;
- this.pending = msg.slice(msg.length - r, msg.length);
- if (this.pending.length === 0)
- this.pending = null;
- msg = utils$1.join32(msg, 0, msg.length - r, this.endian);
- for (var i = 0; i < msg.length; i += this._delta32)
- this._update(msg, i, i + this._delta32);
- }
- return this;
- };
- BlockHash$1.prototype.digest = function digest(enc) {
- this.update(this._pad());
- minimalisticAssert(this.pending === null);
- return this._digest(enc);
- };
- BlockHash$1.prototype._pad = function pad() {
- var len = this.pendingTotal;
- var bytes = this._delta8;
- var k = bytes - ((len + this.padLength) % bytes);
- var res = new Array(k + this.padLength);
- res[0] = 0x80;
- for (var i = 1; i < k; i++)
- res[i] = 0;
- // Append length
- len <<= 3;
- if (this.endian === 'big') {
- for (var t = 8; t < this.padLength; t++)
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = (len >>> 24) & 0xff;
- res[i++] = (len >>> 16) & 0xff;
- res[i++] = (len >>> 8) & 0xff;
- res[i++] = len & 0xff;
- } else {
- res[i++] = len & 0xff;
- res[i++] = (len >>> 8) & 0xff;
- res[i++] = (len >>> 16) & 0xff;
- res[i++] = (len >>> 24) & 0xff;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- res[i++] = 0;
- for (t = 8; t < this.padLength; t++)
- res[i++] = 0;
- }
- return res;
- };
- var common$2 = {
- BlockHash: BlockHash_1
- };
- var rotr32 = utils$1.rotr32;
- function ft_1(s, x, y, z) {
- if (s === 0)
- return ch32$1(x, y, z);
- if (s === 1 || s === 3)
- return p32(x, y, z);
- if (s === 2)
- return maj32$1(x, y, z);
- }
- var ft_1_1 = ft_1;
- function ch32$1(x, y, z) {
- return (x & y) ^ ((~x) & z);
- }
- var ch32_1 = ch32$1;
- function maj32$1(x, y, z) {
- return (x & y) ^ (x & z) ^ (y & z);
- }
- var maj32_1 = maj32$1;
- function p32(x, y, z) {
- return x ^ y ^ z;
- }
- var p32_1 = p32;
- function s0_256$1(x) {
- return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
- }
- var s0_256_1 = s0_256$1;
- function s1_256$1(x) {
- return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
- }
- var s1_256_1 = s1_256$1;
- function g0_256$1(x) {
- return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);
- }
- var g0_256_1 = g0_256$1;
- function g1_256$1(x) {
- return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);
- }
- var g1_256_1 = g1_256$1;
- var common$1 = {
- ft_1: ft_1_1,
- ch32: ch32_1,
- maj32: maj32_1,
- p32: p32_1,
- s0_256: s0_256_1,
- s1_256: s1_256_1,
- g0_256: g0_256_1,
- g1_256: g1_256_1
- };
- var sum32 = utils$1.sum32;
- var sum32_4 = utils$1.sum32_4;
- var sum32_5 = utils$1.sum32_5;
- var ch32 = common$1.ch32;
- var maj32 = common$1.maj32;
- var s0_256 = common$1.s0_256;
- var s1_256 = common$1.s1_256;
- var g0_256 = common$1.g0_256;
- var g1_256 = common$1.g1_256;
- var BlockHash = common$2.BlockHash;
- var sha256_K = [
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
- 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
- 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
- 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
- 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
- 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
- 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
- 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
- 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
- ];
- function SHA256() {
- if (!(this instanceof SHA256))
- return new SHA256();
- BlockHash.call(this);
- this.h = [
- 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
- 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
- ];
- this.k = sha256_K;
- this.W = new Array(64);
- }
- utils$1.inherits(SHA256, BlockHash);
- var _256 = SHA256;
- SHA256.blockSize = 512;
- SHA256.outSize = 256;
- SHA256.hmacStrength = 192;
- SHA256.padLength = 64;
- SHA256.prototype._update = function _update(msg, start) {
- var W = this.W;
- for (var i = 0; i < 16; i++)
- W[i] = msg[start + i];
- for (; i < W.length; i++)
- W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
- var a = this.h[0];
- var b = this.h[1];
- var c = this.h[2];
- var d = this.h[3];
- var e = this.h[4];
- var f = this.h[5];
- var g = this.h[6];
- var h = this.h[7];
- minimalisticAssert(this.k.length === W.length);
- for (i = 0; i < W.length; i++) {
- var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
- var T2 = sum32(s0_256(a), maj32(a, b, c));
- h = g;
- g = f;
- f = e;
- e = sum32(d, T1);
- d = c;
- c = b;
- b = a;
- a = sum32(T1, T2);
- }
- this.h[0] = sum32(this.h[0], a);
- this.h[1] = sum32(this.h[1], b);
- this.h[2] = sum32(this.h[2], c);
- this.h[3] = sum32(this.h[3], d);
- this.h[4] = sum32(this.h[4], e);
- this.h[5] = sum32(this.h[5], f);
- this.h[6] = sum32(this.h[6], g);
- this.h[7] = sum32(this.h[7], h);
- };
- SHA256.prototype._digest = function digest(enc) {
- if (enc === 'hex')
- return utils$1.toHex32(this.h, 'big');
- else
- return utils$1.split32(this.h, 'big');
- };
- //@ts-ignore
- const createHash$1 = () => _256();
- /*
- @license
- Rollup.js v2.42.3
- Mon, 22 Mar 2021 14:48:44 GMT - commit f67e6c9b2cb4066f2ddcdb6d45308f840b2ac62f
- https://github.com/rollup/rollup
- Released under the MIT License.
- */
- var version$1 = "2.42.3";
- var charToInteger = {};
- var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
- for (var i = 0; i < chars$1.length; i++) {
- charToInteger[chars$1.charCodeAt(i)] = i;
- }
- function decode(mappings) {
- var decoded = [];
- var line = [];
- var segment = [
- 0,
- 0,
- 0,
- 0,
- 0,
- ];
- var j = 0;
- for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {
- var c = mappings.charCodeAt(i);
- if (c === 44) { // ","
- segmentify(line, segment, j);
- j = 0;
- }
- else if (c === 59) { // ";"
- segmentify(line, segment, j);
- j = 0;
- decoded.push(line);
- line = [];
- segment[0] = 0;
- }
- else {
- var integer = charToInteger[c];
- if (integer === undefined) {
- throw new Error('Invalid character (' + String.fromCharCode(c) + ')');
- }
- var hasContinuationBit = integer & 32;
- integer &= 31;
- value += integer << shift;
- if (hasContinuationBit) {
- shift += 5;
- }
- else {
- var shouldNegate = value & 1;
- value >>>= 1;
- if (shouldNegate) {
- value = value === 0 ? -0x80000000 : -value;
- }
- segment[j] += value;
- j++;
- value = shift = 0; // reset
- }
- }
- }
- segmentify(line, segment, j);
- decoded.push(line);
- return decoded;
- }
- function segmentify(line, segment, j) {
- // This looks ugly, but we're creating specialized arrays with a specific
- // length. This is much faster than creating a new array (which v8 expands to
- // a capacity of 17 after pushing the first item), or slicing out a subarray
- // (which is slow). Length 4 is assumed to be the most frequent, followed by
- // length 5 (since not everything will have an associated name), followed by
- // length 1 (it's probably rare for a source substring to not have an
- // associated segment data).
- if (j === 4)
- line.push([segment[0], segment[1], segment[2], segment[3]]);
- else if (j === 5)
- line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);
- else if (j === 1)
- line.push([segment[0]]);
- }
- function encode$1(decoded) {
- var sourceFileIndex = 0; // second field
- var sourceCodeLine = 0; // third field
- var sourceCodeColumn = 0; // fourth field
- var nameIndex = 0; // fifth field
- var mappings = '';
- for (var i = 0; i < decoded.length; i++) {
- var line = decoded[i];
- if (i > 0)
- mappings += ';';
- if (line.length === 0)
- continue;
- var generatedCodeColumn = 0; // first field
- var lineMappings = [];
- for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
- var segment = line_1[_i];
- var segmentMappings = encodeInteger$1(segment[0] - generatedCodeColumn);
- generatedCodeColumn = segment[0];
- if (segment.length > 1) {
- segmentMappings +=
- encodeInteger$1(segment[1] - sourceFileIndex) +
- encodeInteger$1(segment[2] - sourceCodeLine) +
- encodeInteger$1(segment[3] - sourceCodeColumn);
- sourceFileIndex = segment[1];
- sourceCodeLine = segment[2];
- sourceCodeColumn = segment[3];
- }
- if (segment.length === 5) {
- segmentMappings += encodeInteger$1(segment[4] - nameIndex);
- nameIndex = segment[4];
- }
- lineMappings.push(segmentMappings);
- }
- mappings += lineMappings.join(',');
- }
- return mappings;
- }
- function encodeInteger$1(num) {
- var result = '';
- num = num < 0 ? (-num << 1) | 1 : num << 1;
- do {
- var clamped = num & 31;
- num >>>= 5;
- if (num > 0) {
- clamped |= 32;
- }
- result += chars$1[clamped];
- } while (num > 0);
- return result;
- }
- var BitSet$1 = function BitSet(arg) {
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
- };
- BitSet$1.prototype.add = function add (n) {
- this.bits[n >> 5] |= 1 << (n & 31);
- };
- BitSet$1.prototype.has = function has (n) {
- return !!(this.bits[n >> 5] & (1 << (n & 31)));
- };
- var Chunk$1 = function Chunk(start, end, content) {
- this.start = start;
- this.end = end;
- this.original = content;
- this.intro = '';
- this.outro = '';
- this.content = content;
- this.storeName = false;
- this.edited = false;
- // we make these non-enumerable, for sanity while debugging
- Object.defineProperties(this, {
- previous: { writable: true, value: null },
- next: { writable: true, value: null }
- });
- };
- Chunk$1.prototype.appendLeft = function appendLeft (content) {
- this.outro += content;
- };
- Chunk$1.prototype.appendRight = function appendRight (content) {
- this.intro = this.intro + content;
- };
- Chunk$1.prototype.clone = function clone () {
- var chunk = new Chunk$1(this.start, this.end, this.original);
- chunk.intro = this.intro;
- chunk.outro = this.outro;
- chunk.content = this.content;
- chunk.storeName = this.storeName;
- chunk.edited = this.edited;
- return chunk;
- };
- Chunk$1.prototype.contains = function contains (index) {
- return this.start < index && index < this.end;
- };
- Chunk$1.prototype.eachNext = function eachNext (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.next;
- }
- };
- Chunk$1.prototype.eachPrevious = function eachPrevious (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.previous;
- }
- };
- Chunk$1.prototype.edit = function edit (content, storeName, contentOnly) {
- this.content = content;
- if (!contentOnly) {
- this.intro = '';
- this.outro = '';
- }
- this.storeName = storeName;
- this.edited = true;
- return this;
- };
- Chunk$1.prototype.prependLeft = function prependLeft (content) {
- this.outro = content + this.outro;
- };
- Chunk$1.prototype.prependRight = function prependRight (content) {
- this.intro = content + this.intro;
- };
- Chunk$1.prototype.split = function split (index) {
- var sliceIndex = index - this.start;
- var originalBefore = this.original.slice(0, sliceIndex);
- var originalAfter = this.original.slice(sliceIndex);
- this.original = originalBefore;
- var newChunk = new Chunk$1(index, this.end, originalAfter);
- newChunk.outro = this.outro;
- this.outro = '';
- this.end = index;
- if (this.edited) {
- // TODO is this block necessary?...
- newChunk.edit('', false);
- this.content = '';
- } else {
- this.content = originalBefore;
- }
- newChunk.next = this.next;
- if (newChunk.next) { newChunk.next.previous = newChunk; }
- newChunk.previous = this;
- this.next = newChunk;
- return newChunk;
- };
- Chunk$1.prototype.toString = function toString () {
- return this.intro + this.content + this.outro;
- };
- Chunk$1.prototype.trimEnd = function trimEnd (rx) {
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.start + trimmed.length).edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- }
- };
- Chunk$1.prototype.trimStart = function trimStart (rx) {
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.end - trimmed.length);
- this.edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- }
- };
- var btoa$2 = function () {
- throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
- };
- if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
- btoa$2 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
- } else if (typeof Buffer === 'function') {
- btoa$2 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
- }
- var SourceMap$1 = function SourceMap(properties) {
- this.version = 3;
- this.file = properties.file;
- this.sources = properties.sources;
- this.sourcesContent = properties.sourcesContent;
- this.names = properties.names;
- this.mappings = encode$1(properties.mappings);
- };
- SourceMap$1.prototype.toString = function toString () {
- return JSON.stringify(this);
- };
- SourceMap$1.prototype.toUrl = function toUrl () {
- return 'data:application/json;charset=utf-8;base64,' + btoa$2(this.toString());
- };
- function guessIndent$1(code) {
- var lines = code.split('\n');
- var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
- var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
- if (tabbed.length === 0 && spaced.length === 0) {
- return null;
- }
- // More lines tabbed than spaced? Assume tabs, and
- // default to tabs in the case of a tie (or nothing
- // to go on)
- if (tabbed.length >= spaced.length) {
- return '\t';
- }
- // Otherwise, we need to guess the multiple
- var min = spaced.reduce(function (previous, current) {
- var numSpaces = /^ +/.exec(current)[0].length;
- return Math.min(numSpaces, previous);
- }, Infinity);
- return new Array(min + 1).join(' ');
- }
- function getRelativePath$1(from, to) {
- var fromParts = from.split(/[/\\]/);
- var toParts = to.split(/[/\\]/);
- fromParts.pop(); // get dirname
- while (fromParts[0] === toParts[0]) {
- fromParts.shift();
- toParts.shift();
- }
- if (fromParts.length) {
- var i = fromParts.length;
- while (i--) { fromParts[i] = '..'; }
- }
- return fromParts.concat(toParts).join('/');
- }
- var toString$1 = Object.prototype.toString;
- function isObject$2(thing) {
- return toString$1.call(thing) === '[object Object]';
- }
- function getLocator$1(source) {
- var originalLines = source.split('\n');
- var lineOffsets = [];
- for (var i = 0, pos = 0; i < originalLines.length; i++) {
- lineOffsets.push(pos);
- pos += originalLines[i].length + 1;
- }
- return function locate(index) {
- var i = 0;
- var j = lineOffsets.length;
- while (i < j) {
- var m = (i + j) >> 1;
- if (index < lineOffsets[m]) {
- j = m;
- } else {
- i = m + 1;
- }
- }
- var line = i - 1;
- var column = index - lineOffsets[line];
- return { line: line, column: column };
- };
- }
- var Mappings$1 = function Mappings(hires) {
- this.hires = hires;
- this.generatedCodeLine = 0;
- this.generatedCodeColumn = 0;
- this.raw = [];
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
- this.pending = null;
- };
- Mappings$1.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
- if (content.length) {
- var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
- if (nameIndex >= 0) {
- segment.push(nameIndex);
- }
- this.rawSegments.push(segment);
- } else if (this.pending) {
- this.rawSegments.push(this.pending);
- }
- this.advance(content);
- this.pending = null;
- };
- Mappings$1.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
- var originalCharIndex = chunk.start;
- var first = true;
- while (originalCharIndex < chunk.end) {
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
- this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
- }
- if (original[originalCharIndex] === '\n') {
- loc.line += 1;
- loc.column = 0;
- this.generatedCodeLine += 1;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- this.generatedCodeColumn = 0;
- first = true;
- } else {
- loc.column += 1;
- this.generatedCodeColumn += 1;
- first = false;
- }
- originalCharIndex += 1;
- }
- this.pending = null;
- };
- Mappings$1.prototype.advance = function advance (str) {
- if (!str) { return; }
- var lines = str.split('\n');
- if (lines.length > 1) {
- for (var i = 0; i < lines.length - 1; i++) {
- this.generatedCodeLine++;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- }
- this.generatedCodeColumn = 0;
- }
- this.generatedCodeColumn += lines[lines.length - 1].length;
- };
- var n$1 = '\n';
- var warned$1 = {
- insertLeft: false,
- insertRight: false,
- storeName: false
- };
- var MagicString$1 = function MagicString(string, options) {
- if ( options === void 0 ) options = {};
- var chunk = new Chunk$1(0, string.length, string);
- Object.defineProperties(this, {
- original: { writable: true, value: string },
- outro: { writable: true, value: '' },
- intro: { writable: true, value: '' },
- firstChunk: { writable: true, value: chunk },
- lastChunk: { writable: true, value: chunk },
- lastSearchedChunk: { writable: true, value: chunk },
- byStart: { writable: true, value: {} },
- byEnd: { writable: true, value: {} },
- filename: { writable: true, value: options.filename },
- indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
- sourcemapLocations: { writable: true, value: new BitSet$1() },
- storedNames: { writable: true, value: {} },
- indentStr: { writable: true, value: guessIndent$1(string) }
- });
- this.byStart[0] = chunk;
- this.byEnd[string.length] = chunk;
- };
- MagicString$1.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
- this.sourcemapLocations.add(char);
- };
- MagicString$1.prototype.append = function append (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.outro += content;
- return this;
- };
- MagicString$1.prototype.appendLeft = function appendLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.appendLeft(content);
- } else {
- this.intro += content;
- }
- return this;
- };
- MagicString$1.prototype.appendRight = function appendRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.appendRight(content);
- } else {
- this.outro += content;
- }
- return this;
- };
- MagicString$1.prototype.clone = function clone () {
- var cloned = new MagicString$1(this.original, { filename: this.filename });
- var originalChunk = this.firstChunk;
- var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
- while (originalChunk) {
- cloned.byStart[clonedChunk.start] = clonedChunk;
- cloned.byEnd[clonedChunk.end] = clonedChunk;
- var nextOriginalChunk = originalChunk.next;
- var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
- if (nextClonedChunk) {
- clonedChunk.next = nextClonedChunk;
- nextClonedChunk.previous = clonedChunk;
- clonedChunk = nextClonedChunk;
- }
- originalChunk = nextOriginalChunk;
- }
- cloned.lastChunk = clonedChunk;
- if (this.indentExclusionRanges) {
- cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
- }
- cloned.sourcemapLocations = new BitSet$1(this.sourcemapLocations);
- cloned.intro = this.intro;
- cloned.outro = this.outro;
- return cloned;
- };
- MagicString$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
- var this$1 = this;
- options = options || {};
- var sourceIndex = 0;
- var names = Object.keys(this.storedNames);
- var mappings = new Mappings$1(options.hires);
- var locate = getLocator$1(this.original);
- if (this.intro) {
- mappings.advance(this.intro);
- }
- this.firstChunk.eachNext(function (chunk) {
- var loc = locate(chunk.start);
- if (chunk.intro.length) { mappings.advance(chunk.intro); }
- if (chunk.edited) {
- mappings.addEdit(
- sourceIndex,
- chunk.content,
- loc,
- chunk.storeName ? names.indexOf(chunk.original) : -1
- );
- } else {
- mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
- }
- if (chunk.outro.length) { mappings.advance(chunk.outro); }
- });
- return {
- file: options.file ? options.file.split(/[/\\]/).pop() : null,
- sources: [options.source ? getRelativePath$1(options.file || '', options.source) : null],
- sourcesContent: options.includeContent ? [this.original] : [null],
- names: names,
- mappings: mappings.raw
- };
- };
- MagicString$1.prototype.generateMap = function generateMap (options) {
- return new SourceMap$1(this.generateDecodedMap(options));
- };
- MagicString$1.prototype.getIndentString = function getIndentString () {
- return this.indentStr === null ? '\t' : this.indentStr;
- };
- MagicString$1.prototype.indent = function indent (indentStr, options) {
- var pattern = /^[^\r\n]/gm;
- if (isObject$2(indentStr)) {
- options = indentStr;
- indentStr = undefined;
- }
- indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
- if (indentStr === '') { return this; } // noop
- options = options || {};
- // Process exclusion ranges
- var isExcluded = {};
- if (options.exclude) {
- var exclusions =
- typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
- exclusions.forEach(function (exclusion) {
- for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
- isExcluded[i] = true;
- }
- });
- }
- var shouldIndentNextCharacter = options.indentStart !== false;
- var replacer = function (match) {
- if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
- shouldIndentNextCharacter = true;
- return match;
- };
- this.intro = this.intro.replace(pattern, replacer);
- var charIndex = 0;
- var chunk = this.firstChunk;
- while (chunk) {
- var end = chunk.end;
- if (chunk.edited) {
- if (!isExcluded[charIndex]) {
- chunk.content = chunk.content.replace(pattern, replacer);
- if (chunk.content.length) {
- shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
- }
- }
- } else {
- charIndex = chunk.start;
- while (charIndex < end) {
- if (!isExcluded[charIndex]) {
- var char = this.original[charIndex];
- if (char === '\n') {
- shouldIndentNextCharacter = true;
- } else if (char !== '\r' && shouldIndentNextCharacter) {
- shouldIndentNextCharacter = false;
- if (charIndex === chunk.start) {
- chunk.prependRight(indentStr);
- } else {
- this._splitChunk(chunk, charIndex);
- chunk = chunk.next;
- chunk.prependRight(indentStr);
- }
- }
- }
- charIndex += 1;
- }
- }
- charIndex = chunk.end;
- chunk = chunk.next;
- }
- this.outro = this.outro.replace(pattern, replacer);
- return this;
- };
- MagicString$1.prototype.insert = function insert () {
- throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
- };
- MagicString$1.prototype.insertLeft = function insertLeft (index, content) {
- if (!warned$1.insertLeft) {
- console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
- warned$1.insertLeft = true;
- }
- return this.appendLeft(index, content);
- };
- MagicString$1.prototype.insertRight = function insertRight (index, content) {
- if (!warned$1.insertRight) {
- console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
- warned$1.insertRight = true;
- }
- return this.prependRight(index, content);
- };
- MagicString$1.prototype.move = function move (start, end, index) {
- if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
- this._split(start);
- this._split(end);
- this._split(index);
- var first = this.byStart[start];
- var last = this.byEnd[end];
- var oldLeft = first.previous;
- var oldRight = last.next;
- var newRight = this.byStart[index];
- if (!newRight && last === this.lastChunk) { return this; }
- var newLeft = newRight ? newRight.previous : this.lastChunk;
- if (oldLeft) { oldLeft.next = oldRight; }
- if (oldRight) { oldRight.previous = oldLeft; }
- if (newLeft) { newLeft.next = first; }
- if (newRight) { newRight.previous = last; }
- if (!first.previous) { this.firstChunk = last.next; }
- if (!last.next) {
- this.lastChunk = first.previous;
- this.lastChunk.next = null;
- }
- first.previous = newLeft;
- last.next = newRight || null;
- if (!newLeft) { this.firstChunk = first; }
- if (!newRight) { this.lastChunk = last; }
- return this;
- };
- MagicString$1.prototype.overwrite = function overwrite (start, end, content, options) {
- if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (end > this.original.length) { throw new Error('end is out of bounds'); }
- if (start === end)
- { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
- this._split(start);
- this._split(end);
- if (options === true) {
- if (!warned$1.storeName) {
- console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
- warned$1.storeName = true;
- }
- options = { storeName: true };
- }
- var storeName = options !== undefined ? options.storeName : false;
- var contentOnly = options !== undefined ? options.contentOnly : false;
- if (storeName) {
- var original = this.original.slice(start, end);
- this.storedNames[original] = true;
- }
- var first = this.byStart[start];
- var last = this.byEnd[end];
- if (first) {
- if (end > first.end && first.next !== this.byStart[first.end]) {
- throw new Error('Cannot overwrite across a split point');
- }
- first.edit(content, storeName, contentOnly);
- if (first !== last) {
- var chunk = first.next;
- while (chunk !== last) {
- chunk.edit('', false);
- chunk = chunk.next;
- }
- chunk.edit('', false);
- }
- } else {
- // must be inserting at the end
- var newChunk = new Chunk$1(start, end, '').edit(content, storeName);
- // TODO last chunk in the array may not be the last chunk, if it's moved...
- last.next = newChunk;
- newChunk.previous = last;
- }
- return this;
- };
- MagicString$1.prototype.prepend = function prepend (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.intro = content + this.intro;
- return this;
- };
- MagicString$1.prototype.prependLeft = function prependLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.prependLeft(content);
- } else {
- this.intro = content + this.intro;
- }
- return this;
- };
- MagicString$1.prototype.prependRight = function prependRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.prependRight(content);
- } else {
- this.outro = content + this.outro;
- }
- return this;
- };
- MagicString$1.prototype.remove = function remove (start, end) {
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (start === end) { return this; }
- if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
- if (start > end) { throw new Error('end must be greater than start'); }
- this._split(start);
- this._split(end);
- var chunk = this.byStart[start];
- while (chunk) {
- chunk.intro = '';
- chunk.outro = '';
- chunk.edit('');
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
- }
- return this;
- };
- MagicString$1.prototype.lastChar = function lastChar () {
- if (this.outro.length)
- { return this.outro[this.outro.length - 1]; }
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length)
- { return chunk.outro[chunk.outro.length - 1]; }
- if (chunk.content.length)
- { return chunk.content[chunk.content.length - 1]; }
- if (chunk.intro.length)
- { return chunk.intro[chunk.intro.length - 1]; }
- } while (chunk = chunk.previous);
- if (this.intro.length)
- { return this.intro[this.intro.length - 1]; }
- return '';
- };
- MagicString$1.prototype.lastLine = function lastLine () {
- var lineIndex = this.outro.lastIndexOf(n$1);
- if (lineIndex !== -1)
- { return this.outro.substr(lineIndex + 1); }
- var lineStr = this.outro;
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length > 0) {
- lineIndex = chunk.outro.lastIndexOf(n$1);
- if (lineIndex !== -1)
- { return chunk.outro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.outro + lineStr;
- }
- if (chunk.content.length > 0) {
- lineIndex = chunk.content.lastIndexOf(n$1);
- if (lineIndex !== -1)
- { return chunk.content.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.content + lineStr;
- }
- if (chunk.intro.length > 0) {
- lineIndex = chunk.intro.lastIndexOf(n$1);
- if (lineIndex !== -1)
- { return chunk.intro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.intro + lineStr;
- }
- } while (chunk = chunk.previous);
- lineIndex = this.intro.lastIndexOf(n$1);
- if (lineIndex !== -1)
- { return this.intro.substr(lineIndex + 1) + lineStr; }
- return this.intro + lineStr;
- };
- MagicString$1.prototype.slice = function slice (start, end) {
- if ( start === void 0 ) start = 0;
- if ( end === void 0 ) end = this.original.length;
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- var result = '';
- // find start chunk
- var chunk = this.firstChunk;
- while (chunk && (chunk.start > start || chunk.end <= start)) {
- // found end chunk before start
- if (chunk.start < end && chunk.end >= end) {
- return result;
- }
- chunk = chunk.next;
- }
- if (chunk && chunk.edited && chunk.start !== start)
- { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
- var startChunk = chunk;
- while (chunk) {
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
- result += chunk.intro;
- }
- var containsEnd = chunk.start < end && chunk.end >= end;
- if (containsEnd && chunk.edited && chunk.end !== end)
- { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
- var sliceStart = startChunk === chunk ? start - chunk.start : 0;
- var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
- result += chunk.content.slice(sliceStart, sliceEnd);
- if (chunk.outro && (!containsEnd || chunk.end === end)) {
- result += chunk.outro;
- }
- if (containsEnd) {
- break;
- }
- chunk = chunk.next;
- }
- return result;
- };
- // TODO deprecate this? not really very useful
- MagicString$1.prototype.snip = function snip (start, end) {
- var clone = this.clone();
- clone.remove(0, start);
- clone.remove(end, clone.original.length);
- return clone;
- };
- MagicString$1.prototype._split = function _split (index) {
- if (this.byStart[index] || this.byEnd[index]) { return; }
- var chunk = this.lastSearchedChunk;
- var searchForward = index > chunk.end;
- while (chunk) {
- if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
- }
- };
- MagicString$1.prototype._splitChunk = function _splitChunk (chunk, index) {
- if (chunk.edited && chunk.content.length) {
- // zero-length edited chunks are a special case (overlapping replacements)
- var loc = getLocator$1(this.original)(index);
- throw new Error(
- ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
- );
- }
- var newChunk = chunk.split(index);
- this.byEnd[index] = chunk;
- this.byStart[index] = newChunk;
- this.byEnd[newChunk.end] = newChunk;
- if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
- this.lastSearchedChunk = chunk;
- return true;
- };
- MagicString$1.prototype.toString = function toString () {
- var str = this.intro;
- var chunk = this.firstChunk;
- while (chunk) {
- str += chunk.toString();
- chunk = chunk.next;
- }
- return str + this.outro;
- };
- MagicString$1.prototype.isEmpty = function isEmpty () {
- var chunk = this.firstChunk;
- do {
- if (chunk.intro.length && chunk.intro.trim() ||
- chunk.content.length && chunk.content.trim() ||
- chunk.outro.length && chunk.outro.trim())
- { return false; }
- } while (chunk = chunk.next);
- return true;
- };
- MagicString$1.prototype.length = function length () {
- var chunk = this.firstChunk;
- var length = 0;
- do {
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
- } while (chunk = chunk.next);
- return length;
- };
- MagicString$1.prototype.trimLines = function trimLines () {
- return this.trim('[\\r\\n]');
- };
- MagicString$1.prototype.trim = function trim (charType) {
- return this.trimStart(charType).trimEnd(charType);
- };
- MagicString$1.prototype.trimEndAborted = function trimEndAborted (charType) {
- var rx = new RegExp((charType || '\\s') + '+$');
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var chunk = this.lastChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimEnd(rx);
- // if chunk was trimmed, we have a new lastChunk
- if (chunk.end !== end) {
- if (this.lastChunk === chunk) {
- this.lastChunk = chunk.next;
- }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.previous;
- } while (chunk);
- return false;
- };
- MagicString$1.prototype.trimEnd = function trimEnd (charType) {
- this.trimEndAborted(charType);
- return this;
- };
- MagicString$1.prototype.trimStartAborted = function trimStartAborted (charType) {
- var rx = new RegExp('^' + (charType || '\\s') + '+');
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var chunk = this.firstChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimStart(rx);
- if (chunk.end !== end) {
- // special case...
- if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.next;
- } while (chunk);
- return false;
- };
- MagicString$1.prototype.trimStart = function trimStart (charType) {
- this.trimStartAborted(charType);
- return this;
- };
- var hasOwnProp = Object.prototype.hasOwnProperty;
- var Bundle$1 = function Bundle(options) {
- if ( options === void 0 ) options = {};
- this.intro = options.intro || '';
- this.separator = options.separator !== undefined ? options.separator : '\n';
- this.sources = [];
- this.uniqueSources = [];
- this.uniqueSourceIndexByFilename = {};
- };
- Bundle$1.prototype.addSource = function addSource (source) {
- if (source instanceof MagicString$1) {
- return this.addSource({
- content: source,
- filename: source.filename,
- separator: this.separator
- });
- }
- if (!isObject$2(source) || !source.content) {
- throw new Error('bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`');
- }
- ['filename', 'indentExclusionRanges', 'separator'].forEach(function (option) {
- if (!hasOwnProp.call(source, option)) { source[option] = source.content[option]; }
- });
- if (source.separator === undefined) {
- // TODO there's a bunch of this sort of thing, needs cleaning up
- source.separator = this.separator;
- }
- if (source.filename) {
- if (!hasOwnProp.call(this.uniqueSourceIndexByFilename, source.filename)) {
- this.uniqueSourceIndexByFilename[source.filename] = this.uniqueSources.length;
- this.uniqueSources.push({ filename: source.filename, content: source.content.original });
- } else {
- var uniqueSource = this.uniqueSources[this.uniqueSourceIndexByFilename[source.filename]];
- if (source.content.original !== uniqueSource.content) {
- throw new Error(("Illegal source: same filename (" + (source.filename) + "), different contents"));
- }
- }
- }
- this.sources.push(source);
- return this;
- };
- Bundle$1.prototype.append = function append (str, options) {
- this.addSource({
- content: new MagicString$1(str),
- separator: (options && options.separator) || ''
- });
- return this;
- };
- Bundle$1.prototype.clone = function clone () {
- var bundle = new Bundle$1({
- intro: this.intro,
- separator: this.separator
- });
- this.sources.forEach(function (source) {
- bundle.addSource({
- filename: source.filename,
- content: source.content.clone(),
- separator: source.separator
- });
- });
- return bundle;
- };
- Bundle$1.prototype.generateDecodedMap = function generateDecodedMap (options) {
- var this$1 = this;
- if ( options === void 0 ) options = {};
- var names = [];
- this.sources.forEach(function (source) {
- Object.keys(source.content.storedNames).forEach(function (name) {
- if (!~names.indexOf(name)) { names.push(name); }
- });
- });
- var mappings = new Mappings$1(options.hires);
- if (this.intro) {
- mappings.advance(this.intro);
- }
- this.sources.forEach(function (source, i) {
- if (i > 0) {
- mappings.advance(this$1.separator);
- }
- var sourceIndex = source.filename ? this$1.uniqueSourceIndexByFilename[source.filename] : -1;
- var magicString = source.content;
- var locate = getLocator$1(magicString.original);
- if (magicString.intro) {
- mappings.advance(magicString.intro);
- }
- magicString.firstChunk.eachNext(function (chunk) {
- var loc = locate(chunk.start);
- if (chunk.intro.length) { mappings.advance(chunk.intro); }
- if (source.filename) {
- if (chunk.edited) {
- mappings.addEdit(
- sourceIndex,
- chunk.content,
- loc,
- chunk.storeName ? names.indexOf(chunk.original) : -1
- );
- } else {
- mappings.addUneditedChunk(
- sourceIndex,
- chunk,
- magicString.original,
- loc,
- magicString.sourcemapLocations
- );
- }
- } else {
- mappings.advance(chunk.content);
- }
- if (chunk.outro.length) { mappings.advance(chunk.outro); }
- });
- if (magicString.outro) {
- mappings.advance(magicString.outro);
- }
- });
- return {
- file: options.file ? options.file.split(/[/\\]/).pop() : null,
- sources: this.uniqueSources.map(function (source) {
- return options.file ? getRelativePath$1(options.file, source.filename) : source.filename;
- }),
- sourcesContent: this.uniqueSources.map(function (source) {
- return options.includeContent ? source.content : null;
- }),
- names: names,
- mappings: mappings.raw
- };
- };
- Bundle$1.prototype.generateMap = function generateMap (options) {
- return new SourceMap$1(this.generateDecodedMap(options));
- };
- Bundle$1.prototype.getIndentString = function getIndentString () {
- var indentStringCounts = {};
- this.sources.forEach(function (source) {
- var indentStr = source.content.indentStr;
- if (indentStr === null) { return; }
- if (!indentStringCounts[indentStr]) { indentStringCounts[indentStr] = 0; }
- indentStringCounts[indentStr] += 1;
- });
- return (
- Object.keys(indentStringCounts).sort(function (a, b) {
- return indentStringCounts[a] - indentStringCounts[b];
- })[0] || '\t'
- );
- };
- Bundle$1.prototype.indent = function indent (indentStr) {
- var this$1 = this;
- if (!arguments.length) {
- indentStr = this.getIndentString();
- }
- if (indentStr === '') { return this; } // noop
- var trailingNewline = !this.intro || this.intro.slice(-1) === '\n';
- this.sources.forEach(function (source, i) {
- var separator = source.separator !== undefined ? source.separator : this$1.separator;
- var indentStart = trailingNewline || (i > 0 && /\r?\n$/.test(separator));
- source.content.indent(indentStr, {
- exclude: source.indentExclusionRanges,
- indentStart: indentStart //: trailingNewline || /\r?\n$/.test( separator ) //true///\r?\n/.test( separator )
- });
- trailingNewline = source.content.lastChar() === '\n';
- });
- if (this.intro) {
- this.intro =
- indentStr +
- this.intro.replace(/^[^\n]/gm, function (match, index) {
- return index > 0 ? indentStr + match : match;
- });
- }
- return this;
- };
- Bundle$1.prototype.prepend = function prepend (str) {
- this.intro = str + this.intro;
- return this;
- };
- Bundle$1.prototype.toString = function toString () {
- var this$1 = this;
- var body = this.sources
- .map(function (source, i) {
- var separator = source.separator !== undefined ? source.separator : this$1.separator;
- var str = (i > 0 ? separator : '') + source.content.toString();
- return str;
- })
- .join('');
- return this.intro + body;
- };
- Bundle$1.prototype.isEmpty = function isEmpty () {
- if (this.intro.length && this.intro.trim())
- { return false; }
- if (this.sources.some(function (source) { return !source.content.isEmpty(); }))
- { return false; }
- return true;
- };
- Bundle$1.prototype.length = function length () {
- return this.sources.reduce(function (length, source) { return length + source.content.length(); }, this.intro.length);
- };
- Bundle$1.prototype.trimLines = function trimLines () {
- return this.trim('[\\r\\n]');
- };
- Bundle$1.prototype.trim = function trim (charType) {
- return this.trimStart(charType).trimEnd(charType);
- };
- Bundle$1.prototype.trimStart = function trimStart (charType) {
- var rx = new RegExp('^' + (charType || '\\s') + '+');
- this.intro = this.intro.replace(rx, '');
- if (!this.intro) {
- var source;
- var i = 0;
- do {
- source = this.sources[i++];
- if (!source) {
- break;
- }
- } while (!source.content.trimStartAborted(charType));
- }
- return this;
- };
- Bundle$1.prototype.trimEnd = function trimEnd (charType) {
- var rx = new RegExp((charType || '\\s') + '+$');
- var source;
- var i = this.sources.length - 1;
- do {
- source = this.sources[i--];
- if (!source) {
- this.intro = this.intro.replace(rx, '');
- break;
- }
- } while (!source.content.trimEndAborted(charType));
- return this;
- };
- function relative(from, to) {
- const fromParts = from.split(/[/\\]/).filter(Boolean);
- const toParts = to.split(/[/\\]/).filter(Boolean);
- if (fromParts[0] === '.')
- fromParts.shift();
- if (toParts[0] === '.')
- toParts.shift();
- while (fromParts[0] && toParts[0] && fromParts[0] === toParts[0]) {
- fromParts.shift();
- toParts.shift();
- }
- while (toParts[0] === '..' && fromParts.length > 0) {
- toParts.shift();
- fromParts.pop();
- }
- while (fromParts.pop()) {
- toParts.unshift('..');
- }
- return toParts.join('/');
- }
- const ArrowFunctionExpression$1 = 'ArrowFunctionExpression';
- const BlockStatement$1 = 'BlockStatement';
- const CallExpression$1 = 'CallExpression';
- const ChainExpression$1 = 'ChainExpression';
- const ExpressionStatement$1 = 'ExpressionStatement';
- const Identifier$1 = 'Identifier';
- const ImportDefaultSpecifier$1 = 'ImportDefaultSpecifier';
- const ImportNamespaceSpecifier$1 = 'ImportNamespaceSpecifier';
- const NewExpression$1 = 'NewExpression';
- const Program$1 = 'Program';
- const Property$1 = 'Property';
- const ReturnStatement$1 = 'ReturnStatement';
- function treeshakeNode(node, code, start, end) {
- code.remove(start, end);
- if (node.annotations) {
- for (const annotation of node.annotations) {
- if (!annotation.comment) {
- continue;
- }
- if (annotation.comment.start < start) {
- code.remove(annotation.comment.start, annotation.comment.end);
- }
- else {
- return;
- }
- }
- }
- }
- function removeAnnotations(node, code) {
- if (!node.annotations && node.parent.type === ExpressionStatement$1) {
- node = node.parent;
- }
- if (node.annotations) {
- for (const annotation of node.annotations.filter((a) => a.comment)) {
- code.remove(annotation.comment.start, annotation.comment.end);
- }
- }
- }
- const NO_SEMICOLON = { isNoStatement: true };
- // This assumes there are only white-space and comments between start and the string we are looking for
- function findFirstOccurrenceOutsideComment(code, searchString, start = 0) {
- let searchPos, charCodeAfterSlash;
- searchPos = code.indexOf(searchString, start);
- while (true) {
- start = code.indexOf('/', start);
- if (start === -1 || start >= searchPos)
- return searchPos;
- charCodeAfterSlash = code.charCodeAt(++start);
- ++start;
- // With our assumption, '/' always starts a comment. Determine comment type:
- start =
- charCodeAfterSlash === 47 /*"/"*/
- ? code.indexOf('\n', start) + 1
- : code.indexOf('*/', start) + 2;
- if (start > searchPos) {
- searchPos = code.indexOf(searchString, start);
- }
- }
- }
- const NON_WHITESPACE = /\S/g;
- function findNonWhiteSpace(code, index) {
- NON_WHITESPACE.lastIndex = index;
- const result = NON_WHITESPACE.exec(code);
- return result.index;
- }
- // This assumes "code" only contains white-space and comments
- // Returns position of line-comment if applicable
- function findFirstLineBreakOutsideComment(code) {
- let lineBreakPos, charCodeAfterSlash, start = 0;
- lineBreakPos = code.indexOf('\n', start);
- while (true) {
- start = code.indexOf('/', start);
- if (start === -1 || start > lineBreakPos)
- return [lineBreakPos, lineBreakPos + 1];
- // With our assumption, '/' always starts a comment. Determine comment type:
- charCodeAfterSlash = code.charCodeAt(start + 1);
- if (charCodeAfterSlash === 47 /*"/"*/)
- return [start, lineBreakPos + 1];
- start = code.indexOf('*/', start + 3) + 2;
- if (start > lineBreakPos) {
- lineBreakPos = code.indexOf('\n', start);
- }
- }
- }
- function renderStatementList(statements, code, start, end, options) {
- let currentNode, currentNodeStart, currentNodeNeedsBoundaries, nextNodeStart;
- let nextNode = statements[0];
- let nextNodeNeedsBoundaries = !nextNode.included || nextNode.needsBoundaries;
- if (nextNodeNeedsBoundaries) {
- nextNodeStart =
- start + findFirstLineBreakOutsideComment(code.original.slice(start, nextNode.start))[1];
- }
- for (let nextIndex = 1; nextIndex <= statements.length; nextIndex++) {
- currentNode = nextNode;
- currentNodeStart = nextNodeStart;
- currentNodeNeedsBoundaries = nextNodeNeedsBoundaries;
- nextNode = statements[nextIndex];
- nextNodeNeedsBoundaries =
- nextNode === undefined ? false : !nextNode.included || nextNode.needsBoundaries;
- if (currentNodeNeedsBoundaries || nextNodeNeedsBoundaries) {
- nextNodeStart =
- currentNode.end +
- findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
- if (currentNode.included) {
- currentNodeNeedsBoundaries
- ? currentNode.render(code, options, {
- end: nextNodeStart,
- start: currentNodeStart
- })
- : currentNode.render(code, options);
- }
- else {
- treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
- }
- }
- else {
- currentNode.render(code, options);
- }
- }
- }
- // This assumes that the first character is not part of the first node
- function getCommaSeparatedNodesWithBoundaries(nodes, code, start, end) {
- const splitUpNodes = [];
- let node, nextNode, nextNodeStart, contentEnd, char;
- let separator = start - 1;
- for (let nextIndex = 0; nextIndex < nodes.length; nextIndex++) {
- nextNode = nodes[nextIndex];
- if (node !== undefined) {
- separator =
- node.end +
- findFirstOccurrenceOutsideComment(code.original.slice(node.end, nextNode.start), ',');
- }
- nextNodeStart = contentEnd =
- separator +
- 1 +
- findFirstLineBreakOutsideComment(code.original.slice(separator + 1, nextNode.start))[1];
- while (((char = code.original.charCodeAt(nextNodeStart)),
- char === 32 /*" "*/ || char === 9 /*"\t"*/ || char === 10 /*"\n"*/ || char === 13) /*"\r"*/)
- nextNodeStart++;
- if (node !== undefined) {
- splitUpNodes.push({
- contentEnd,
- end: nextNodeStart,
- node,
- separator,
- start
- });
- }
- node = nextNode;
- start = nextNodeStart;
- }
- splitUpNodes.push({
- contentEnd: end,
- end,
- node: node,
- separator: null,
- start
- });
- return splitUpNodes;
- }
- // This assumes there are only white-space and comments between start and end
- function removeLineBreaks(code, start, end) {
- while (true) {
- const [removeStart, removeEnd] = findFirstLineBreakOutsideComment(code.original.slice(start, end));
- if (removeStart === -1) {
- break;
- }
- code.remove(start + removeStart, (start += removeEnd));
- }
- }
- function getSystemExportStatement(exportedVariables, options) {
- const _ = options.compact ? '' : ' ';
- if (exportedVariables.length === 1 &&
- options.exportNamesByVariable.get(exportedVariables[0]).length === 1) {
- const variable = exportedVariables[0];
- return `exports('${options.exportNamesByVariable.get(variable)}',${_}${variable.getName()})`;
- }
- else {
- return `exports({${_}${exportedVariables
- .map(variable => {
- return options.exportNamesByVariable
- .get(variable)
- .map(exportName => `${exportName}:${_}${variable.getName()}`)
- .join(`,${_}`);
- })
- .join(`,${_}`)}${_}})`;
- }
- }
- function getSystemExportFunctionLeft(exportedVariables, setFromExpression, options) {
- const _ = options.compact ? '' : ' ';
- const s = options.compact ? '' : ';';
- return `function${_}(v)${_}{${_}return exports({${_}${exportedVariables
- .map(variable => {
- return options.exportNamesByVariable
- .get(variable)
- .map(exportName => `${exportName}:${_}${setFromExpression ? variable.getName() : 'v'}`)
- .join(`,${_}`);
- })
- .join(`,${_}`)}${_}}),${_}v${s}${_}}(`;
- }
- const chars$2 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
- const base$1 = 64;
- function toBase64(num) {
- let outStr = '';
- do {
- const curDigit = num % base$1;
- num = Math.floor(num / base$1);
- outStr = chars$2[curDigit] + outStr;
- } while (num !== 0);
- return outStr;
- }
- const RESERVED_NAMES = {
- // @ts-ignore
- __proto__: null,
- await: true,
- break: true,
- case: true,
- catch: true,
- class: true,
- const: true,
- continue: true,
- debugger: true,
- default: true,
- delete: true,
- do: true,
- else: true,
- enum: true,
- eval: true,
- export: true,
- extends: true,
- false: true,
- finally: true,
- for: true,
- function: true,
- if: true,
- implements: true,
- import: true,
- in: true,
- instanceof: true,
- interface: true,
- let: true,
- new: true,
- null: true,
- package: true,
- private: true,
- protected: true,
- public: true,
- return: true,
- static: true,
- super: true,
- switch: true,
- this: true,
- throw: true,
- true: true,
- try: true,
- typeof: true,
- undefined: true,
- var: true,
- void: true,
- while: true,
- with: true,
- yield: true
- };
- function getSafeName(baseName, usedNames) {
- let safeName = baseName;
- let count = 1;
- while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) {
- safeName = `${baseName}$${toBase64(count++)}`;
- }
- usedNames.add(safeName);
- return safeName;
- }
- const NO_ARGS = [];
- function getOrCreate(map, key, init) {
- const existing = map.get(key);
- if (existing) {
- return existing;
- }
- const value = init();
- map.set(key, value);
- return value;
- }
- const UnknownKey = Symbol('Unknown Key');
- const EMPTY_PATH = [];
- const UNKNOWN_PATH = [UnknownKey];
- const EntitiesKey = Symbol('Entities');
- class PathTracker {
- constructor() {
- this.entityPaths = Object.create(null, { [EntitiesKey]: { value: new Set() } });
- }
- getEntities(path) {
- let currentPaths = this.entityPaths;
- for (const pathSegment of path) {
- currentPaths = currentPaths[pathSegment] =
- currentPaths[pathSegment] ||
- Object.create(null, { [EntitiesKey]: { value: new Set() } });
- }
- return currentPaths[EntitiesKey];
- }
- }
- const SHARED_RECURSION_TRACKER = new PathTracker();
- class DiscriminatedPathTracker {
- constructor() {
- this.entityPaths = Object.create(null, {
- [EntitiesKey]: { value: new Map() }
- });
- }
- getEntities(path, discriminator) {
- let currentPaths = this.entityPaths;
- for (const pathSegment of path) {
- currentPaths = currentPaths[pathSegment] =
- currentPaths[pathSegment] ||
- Object.create(null, { [EntitiesKey]: { value: new Map() } });
- }
- return getOrCreate(currentPaths[EntitiesKey], discriminator, () => new Set());
- }
- }
- function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
- return Object.create(inheritedDescriptions, memberDescriptions);
- }
- const UnknownValue = Symbol('Unknown Value');
- const UNKNOWN_EXPRESSION = {
- deoptimizePath: () => { },
- getLiteralValueAtPath: () => UnknownValue,
- getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
- hasEffectsWhenAccessedAtPath: path => path.length > 0,
- hasEffectsWhenAssignedAtPath: path => path.length > 0,
- hasEffectsWhenCalledAtPath: () => true,
- include: () => { },
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- },
- included: true,
- toString: () => '[[UNKNOWN]]'
- };
- const UNDEFINED_EXPRESSION = {
- deoptimizePath: () => { },
- getLiteralValueAtPath: () => undefined,
- getReturnExpressionWhenCalledAtPath: () => UNKNOWN_EXPRESSION,
- hasEffectsWhenAccessedAtPath: path => path.length > 0,
- hasEffectsWhenAssignedAtPath: path => path.length > 0,
- hasEffectsWhenCalledAtPath: () => true,
- include: () => { },
- includeCallArguments() { },
- included: true,
- toString: () => 'undefined'
- };
- const returnsUnknown = {
- value: {
- callsArgs: null,
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_EXPRESSION
- }
- };
- const mutatesSelfReturnsUnknown = {
- value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: null, mutatesSelf: true }
- };
- const callsArgReturnsUnknown = {
- value: { returns: null, returnsPrimitive: UNKNOWN_EXPRESSION, callsArgs: [0], mutatesSelf: false }
- };
- class UnknownArrayExpression {
- constructor() {
- this.included = false;
- }
- deoptimizePath() { }
- getLiteralValueAtPath() {
- return UnknownValue;
- }
- getReturnExpressionWhenCalledAtPath(path) {
- if (path.length === 1) {
- return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
- }
- return UNKNOWN_EXPRESSION;
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenAssignedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length === 1) {
- return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
- }
- return true;
- }
- include() {
- this.included = true;
- }
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- }
- toString() {
- return '[[UNKNOWN ARRAY]]';
- }
- }
- const returnsArray = {
- value: {
- callsArgs: null,
- mutatesSelf: false,
- returns: UnknownArrayExpression,
- returnsPrimitive: null
- }
- };
- const mutatesSelfReturnsArray = {
- value: {
- callsArgs: null,
- mutatesSelf: true,
- returns: UnknownArrayExpression,
- returnsPrimitive: null
- }
- };
- const callsArgReturnsArray = {
- value: {
- callsArgs: [0],
- mutatesSelf: false,
- returns: UnknownArrayExpression,
- returnsPrimitive: null
- }
- };
- const callsArgMutatesSelfReturnsArray = {
- value: {
- callsArgs: [0],
- mutatesSelf: true,
- returns: UnknownArrayExpression,
- returnsPrimitive: null
- }
- };
- const UNKNOWN_LITERAL_BOOLEAN = {
- deoptimizePath: () => { },
- getLiteralValueAtPath: () => UnknownValue,
- getReturnExpressionWhenCalledAtPath: path => {
- if (path.length === 1) {
- return getMemberReturnExpressionWhenCalled(literalBooleanMembers, path[0]);
- }
- return UNKNOWN_EXPRESSION;
- },
- hasEffectsWhenAccessedAtPath: path => path.length > 1,
- hasEffectsWhenAssignedAtPath: path => path.length > 0,
- hasEffectsWhenCalledAtPath: path => {
- if (path.length === 1) {
- const subPath = path[0];
- return typeof subPath !== 'string' || !literalBooleanMembers[subPath];
- }
- return true;
- },
- include: () => { },
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- },
- included: true,
- toString: () => '[[UNKNOWN BOOLEAN]]'
- };
- const returnsBoolean = {
- value: {
- callsArgs: null,
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
- }
- };
- const callsArgReturnsBoolean = {
- value: {
- callsArgs: [0],
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_BOOLEAN
- }
- };
- const UNKNOWN_LITERAL_NUMBER = {
- deoptimizePath: () => { },
- getLiteralValueAtPath: () => UnknownValue,
- getReturnExpressionWhenCalledAtPath: path => {
- if (path.length === 1) {
- return getMemberReturnExpressionWhenCalled(literalNumberMembers, path[0]);
- }
- return UNKNOWN_EXPRESSION;
- },
- hasEffectsWhenAccessedAtPath: path => path.length > 1,
- hasEffectsWhenAssignedAtPath: path => path.length > 0,
- hasEffectsWhenCalledAtPath: path => {
- if (path.length === 1) {
- const subPath = path[0];
- return typeof subPath !== 'string' || !literalNumberMembers[subPath];
- }
- return true;
- },
- include: () => { },
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- },
- included: true,
- toString: () => '[[UNKNOWN NUMBER]]'
- };
- const returnsNumber = {
- value: {
- callsArgs: null,
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_NUMBER
- }
- };
- const mutatesSelfReturnsNumber = {
- value: {
- callsArgs: null,
- mutatesSelf: true,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_NUMBER
- }
- };
- const callsArgReturnsNumber = {
- value: {
- callsArgs: [0],
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_NUMBER
- }
- };
- const UNKNOWN_LITERAL_STRING = {
- deoptimizePath: () => { },
- getLiteralValueAtPath: () => UnknownValue,
- getReturnExpressionWhenCalledAtPath: path => {
- if (path.length === 1) {
- return getMemberReturnExpressionWhenCalled(literalStringMembers, path[0]);
- }
- return UNKNOWN_EXPRESSION;
- },
- hasEffectsWhenAccessedAtPath: path => path.length > 1,
- hasEffectsWhenAssignedAtPath: path => path.length > 0,
- hasEffectsWhenCalledAtPath: (path, callOptions, context) => {
- if (path.length === 1) {
- return hasMemberEffectWhenCalled(literalStringMembers, path[0], true, callOptions, context);
- }
- return true;
- },
- include: () => { },
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- },
- included: true,
- toString: () => '[[UNKNOWN STRING]]'
- };
- const returnsString = {
- value: {
- callsArgs: null,
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_STRING
- }
- };
- class UnknownObjectExpression {
- constructor() {
- this.included = false;
- }
- deoptimizePath() { }
- getLiteralValueAtPath() {
- return UnknownValue;
- }
- getReturnExpressionWhenCalledAtPath(path) {
- if (path.length === 1) {
- return getMemberReturnExpressionWhenCalled(objectMembers, path[0]);
- }
- return UNKNOWN_EXPRESSION;
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenAssignedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length === 1) {
- return hasMemberEffectWhenCalled(objectMembers, path[0], this.included, callOptions, context);
- }
- return true;
- }
- include() {
- this.included = true;
- }
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- }
- toString() {
- return '[[UNKNOWN OBJECT]]';
- }
- }
- const objectMembers = assembleMemberDescriptions({
- hasOwnProperty: returnsBoolean,
- isPrototypeOf: returnsBoolean,
- propertyIsEnumerable: returnsBoolean,
- toLocaleString: returnsString,
- toString: returnsString,
- valueOf: returnsUnknown
- });
- const arrayMembers = assembleMemberDescriptions({
- concat: returnsArray,
- copyWithin: mutatesSelfReturnsArray,
- every: callsArgReturnsBoolean,
- fill: mutatesSelfReturnsArray,
- filter: callsArgReturnsArray,
- find: callsArgReturnsUnknown,
- findIndex: callsArgReturnsNumber,
- forEach: callsArgReturnsUnknown,
- includes: returnsBoolean,
- indexOf: returnsNumber,
- join: returnsString,
- lastIndexOf: returnsNumber,
- map: callsArgReturnsArray,
- pop: mutatesSelfReturnsUnknown,
- push: mutatesSelfReturnsNumber,
- reduce: callsArgReturnsUnknown,
- reduceRight: callsArgReturnsUnknown,
- reverse: mutatesSelfReturnsArray,
- shift: mutatesSelfReturnsUnknown,
- slice: returnsArray,
- some: callsArgReturnsBoolean,
- sort: callsArgMutatesSelfReturnsArray,
- splice: mutatesSelfReturnsArray,
- unshift: mutatesSelfReturnsNumber
- }, objectMembers);
- const literalBooleanMembers = assembleMemberDescriptions({
- valueOf: returnsBoolean
- }, objectMembers);
- const literalNumberMembers = assembleMemberDescriptions({
- toExponential: returnsString,
- toFixed: returnsString,
- toLocaleString: returnsString,
- toPrecision: returnsString,
- valueOf: returnsNumber
- }, objectMembers);
- const literalStringMembers = assembleMemberDescriptions({
- charAt: returnsString,
- charCodeAt: returnsNumber,
- codePointAt: returnsNumber,
- concat: returnsString,
- endsWith: returnsBoolean,
- includes: returnsBoolean,
- indexOf: returnsNumber,
- lastIndexOf: returnsNumber,
- localeCompare: returnsNumber,
- match: returnsBoolean,
- normalize: returnsString,
- padEnd: returnsString,
- padStart: returnsString,
- repeat: returnsString,
- replace: {
- value: {
- callsArgs: [1],
- mutatesSelf: false,
- returns: null,
- returnsPrimitive: UNKNOWN_LITERAL_STRING
- }
- },
- search: returnsNumber,
- slice: returnsString,
- split: returnsArray,
- startsWith: returnsBoolean,
- substr: returnsString,
- substring: returnsString,
- toLocaleLowerCase: returnsString,
- toLocaleUpperCase: returnsString,
- toLowerCase: returnsString,
- toUpperCase: returnsString,
- trim: returnsString,
- valueOf: returnsString
- }, objectMembers);
- function getLiteralMembersForValue(value) {
- switch (typeof value) {
- case 'boolean':
- return literalBooleanMembers;
- case 'number':
- return literalNumberMembers;
- case 'string':
- return literalStringMembers;
- default:
- return Object.create(null);
- }
- }
- function hasMemberEffectWhenCalled(members, memberName, parentIncluded, callOptions, context) {
- if (typeof memberName !== 'string' ||
- !members[memberName] ||
- (members[memberName].mutatesSelf && parentIncluded))
- return true;
- if (!members[memberName].callsArgs)
- return false;
- for (const argIndex of members[memberName].callsArgs) {
- if (callOptions.args[argIndex] &&
- callOptions.args[argIndex].hasEffectsWhenCalledAtPath(EMPTY_PATH, {
- args: NO_ARGS,
- withNew: false
- }, context))
- return true;
- }
- return false;
- }
- function getMemberReturnExpressionWhenCalled(members, memberName) {
- if (typeof memberName !== 'string' || !members[memberName])
- return UNKNOWN_EXPRESSION;
- return members[memberName].returnsPrimitive !== null
- ? members[memberName].returnsPrimitive
- : new members[memberName].returns();
- }
- const BROKEN_FLOW_NONE = 0;
- const BROKEN_FLOW_BREAK_CONTINUE = 1;
- const BROKEN_FLOW_ERROR_RETURN_LABEL = 2;
- function createInclusionContext() {
- return {
- brokenFlow: BROKEN_FLOW_NONE,
- includedCallArguments: new Set(),
- includedLabels: new Set()
- };
- }
- function createHasEffectsContext() {
- return {
- accessed: new PathTracker(),
- assigned: new PathTracker(),
- brokenFlow: BROKEN_FLOW_NONE,
- called: new DiscriminatedPathTracker(),
- ignore: {
- breaks: false,
- continues: false,
- labels: new Set(),
- returnAwaitYield: false
- },
- includedLabels: new Set(),
- instantiated: new DiscriminatedPathTracker(),
- replacedVariableInits: new Map()
- };
- }
- class Variable {
- constructor(name) {
- this.alwaysRendered = false;
- this.included = false;
- this.isId = false;
- this.isReassigned = false;
- this.renderBaseName = null;
- this.renderName = null;
- this.name = name;
- }
- /**
- * Binds identifiers that reference this variable to this variable.
- * Necessary to be able to change variable names.
- */
- addReference(_identifier) { }
- deoptimizePath(_path) { }
- getBaseVariableName() {
- return this.renderBaseName || this.renderName || this.name;
- }
- getLiteralValueAtPath(_path, _recursionTracker, _origin) {
- return UnknownValue;
- }
- getName() {
- const name = this.renderName || this.name;
- return this.renderBaseName
- ? `${this.renderBaseName}${RESERVED_NAMES[name] ? `['${name}']` : `.${name}`}`
- : name;
- }
- getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
- return UNKNOWN_EXPRESSION;
- }
- hasEffectsWhenAccessedAtPath(path, _context) {
- return path.length > 0;
- }
- hasEffectsWhenAssignedAtPath(_path, _context) {
- return true;
- }
- hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
- return true;
- }
- /**
- * Marks this variable as being part of the bundle, which is usually the case when one of
- * its identifiers becomes part of the bundle. Returns true if it has not been included
- * previously.
- * Once a variable is included, it should take care all its declarations are included.
- */
- include() {
- this.included = true;
- }
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- }
- markCalledFromTryStatement() { }
- setRenderNames(baseName, name) {
- this.renderBaseName = baseName;
- this.renderName = name;
- }
- }
- // To avoid infinite recursions
- const MAX_PATH_DEPTH = 7;
- class LocalVariable extends Variable {
- constructor(name, declarator, init, context) {
- super(name);
- this.additionalInitializers = null;
- this.calledFromTryStatement = false;
- this.expressionsToBeDeoptimized = [];
- this.declarations = declarator ? [declarator] : [];
- this.init = init;
- this.deoptimizationTracker = context.deoptimizationTracker;
- this.module = context.module;
- }
- addDeclaration(identifier, init) {
- this.declarations.push(identifier);
- if (this.additionalInitializers === null) {
- this.additionalInitializers = this.init === null ? [] : [this.init];
- this.init = UNKNOWN_EXPRESSION;
- this.isReassigned = true;
- }
- if (init !== null) {
- this.additionalInitializers.push(init);
- }
- }
- consolidateInitializers() {
- if (this.additionalInitializers !== null) {
- for (const initializer of this.additionalInitializers) {
- initializer.deoptimizePath(UNKNOWN_PATH);
- }
- this.additionalInitializers = null;
- }
- }
- deoptimizePath(path) {
- if (path.length > MAX_PATH_DEPTH || this.isReassigned)
- return;
- const trackedEntities = this.deoptimizationTracker.getEntities(path);
- if (trackedEntities.has(this))
- return;
- trackedEntities.add(this);
- if (path.length === 0) {
- if (!this.isReassigned) {
- this.isReassigned = true;
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
- this.expressionsToBeDeoptimized = [];
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- if (this.init) {
- this.init.deoptimizePath(UNKNOWN_PATH);
- }
- }
- }
- else if (this.init) {
- this.init.deoptimizePath(path);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
- return UnknownValue;
- }
- const trackedEntities = recursionTracker.getEntities(path);
- if (trackedEntities.has(this.init)) {
- return UnknownValue;
- }
- this.expressionsToBeDeoptimized.push(origin);
- trackedEntities.add(this.init);
- const value = this.init.getLiteralValueAtPath(path, recursionTracker, origin);
- trackedEntities.delete(this.init);
- return value;
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- if (this.isReassigned || !this.init || path.length > MAX_PATH_DEPTH) {
- return UNKNOWN_EXPRESSION;
- }
- const trackedEntities = recursionTracker.getEntities(path);
- if (trackedEntities.has(this.init)) {
- return UNKNOWN_EXPRESSION;
- }
- this.expressionsToBeDeoptimized.push(origin);
- trackedEntities.add(this.init);
- const value = this.init.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- trackedEntities.delete(this.init);
- return value;
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- if (this.isReassigned || path.length > MAX_PATH_DEPTH)
- return true;
- const trackedExpressions = context.accessed.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return (this.init && this.init.hasEffectsWhenAccessedAtPath(path, context));
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (this.included || path.length > MAX_PATH_DEPTH)
- return true;
- if (path.length === 0)
- return false;
- if (this.isReassigned)
- return true;
- const trackedExpressions = context.assigned.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return (this.init && this.init.hasEffectsWhenAssignedAtPath(path, context));
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length > MAX_PATH_DEPTH || this.isReassigned)
- return true;
- const trackedExpressions = (callOptions.withNew
- ? context.instantiated
- : context.called).getEntities(path, callOptions);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return (this.init && this.init.hasEffectsWhenCalledAtPath(path, callOptions, context));
- }
- include() {
- if (!this.included) {
- this.included = true;
- for (const declaration of this.declarations) {
- // If node is a default export, it can save a tree-shaking run to include the full declaration now
- if (!declaration.included)
- declaration.include(createInclusionContext(), false);
- let node = declaration.parent;
- while (!node.included) {
- // We do not want to properly include parents in case they are part of a dead branch
- // in which case .include() might pull in more dead code
- node.included = true;
- if (node.type === Program$1)
- break;
- node = node.parent;
- }
- }
- }
- }
- includeCallArguments(context, args) {
- if (this.isReassigned || (this.init && context.includedCallArguments.has(this.init))) {
- for (const arg of args) {
- arg.include(context, false);
- }
- }
- else if (this.init) {
- context.includedCallArguments.add(this.init);
- this.init.includeCallArguments(context, args);
- context.includedCallArguments.delete(this.init);
- }
- }
- markCalledFromTryStatement() {
- this.calledFromTryStatement = true;
- }
- }
- class Scope$1$1 {
- constructor() {
- this.children = [];
- this.variables = new Map();
- }
- addDeclaration(identifier, context, init, _isHoisted) {
- const name = identifier.name;
- let variable = this.variables.get(name);
- if (variable) {
- variable.addDeclaration(identifier, init);
- }
- else {
- variable = new LocalVariable(identifier.name, identifier, init || UNDEFINED_EXPRESSION, context);
- this.variables.set(name, variable);
- }
- return variable;
- }
- contains(name) {
- return this.variables.has(name);
- }
- findVariable(_name) {
- throw new Error('Internal Error: findVariable needs to be implemented by a subclass');
- }
- }
- class ChildScope extends Scope$1$1 {
- constructor(parent) {
- super();
- this.accessedOutsideVariables = new Map();
- this.parent = parent;
- parent.children.push(this);
- }
- addAccessedDynamicImport(importExpression) {
- (this.accessedDynamicImports || (this.accessedDynamicImports = new Set())).add(importExpression);
- if (this.parent instanceof ChildScope) {
- this.parent.addAccessedDynamicImport(importExpression);
- }
- }
- addAccessedGlobals(globals, accessedGlobalsByScope) {
- const accessedGlobals = accessedGlobalsByScope.get(this) || new Set();
- for (const name of globals) {
- accessedGlobals.add(name);
- }
- accessedGlobalsByScope.set(this, accessedGlobals);
- if (this.parent instanceof ChildScope) {
- this.parent.addAccessedGlobals(globals, accessedGlobalsByScope);
- }
- }
- addNamespaceMemberAccess(name, variable) {
- this.accessedOutsideVariables.set(name, variable);
- this.parent.addNamespaceMemberAccess(name, variable);
- }
- addReturnExpression(expression) {
- this.parent instanceof ChildScope && this.parent.addReturnExpression(expression);
- }
- addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
- for (const variable of this.accessedOutsideVariables.values()) {
- if (variable.included) {
- usedNames.add(variable.getBaseVariableName());
- if (format === 'system' && exportNamesByVariable.has(variable)) {
- usedNames.add('exports');
- }
- }
- }
- const accessedGlobals = accessedGlobalsByScope.get(this);
- if (accessedGlobals) {
- for (const name of accessedGlobals) {
- usedNames.add(name);
- }
- }
- }
- contains(name) {
- return this.variables.has(name) || this.parent.contains(name);
- }
- deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
- const usedNames = new Set();
- this.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
- if (this.accessedDynamicImports) {
- for (const importExpression of this.accessedDynamicImports) {
- if (importExpression.inlineNamespace) {
- usedNames.add(importExpression.inlineNamespace.getBaseVariableName());
- }
- }
- }
- for (const [name, variable] of this.variables) {
- if (variable.included || variable.alwaysRendered) {
- variable.setRenderNames(null, getSafeName(name, usedNames));
- }
- }
- for (const scope of this.children) {
- scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
- }
- }
- findLexicalBoundary() {
- return this.parent.findLexicalBoundary();
- }
- findVariable(name) {
- const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
- if (knownVariable) {
- return knownVariable;
- }
- const variable = this.parent.findVariable(name);
- this.accessedOutsideVariables.set(name, variable);
- return variable;
- }
- }
- function getLocator$2(source, options) {
- if (options === void 0) { options = {}; }
- var offsetLine = options.offsetLine || 0;
- var offsetColumn = options.offsetColumn || 0;
- var originalLines = source.split('\n');
- var start = 0;
- var lineRanges = originalLines.map(function (line, i) {
- var end = start + line.length + 1;
- var range = { start: start, end: end, line: i };
- start = end;
- return range;
- });
- var i = 0;
- function rangeContains(range, index) {
- return range.start <= index && index < range.end;
- }
- function getLocation(range, index) {
- return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };
- }
- function locate(search, startIndex) {
- if (typeof search === 'string') {
- search = source.indexOf(search, startIndex || 0);
- }
- var range = lineRanges[i];
- var d = search >= range.end ? 1 : -1;
- while (range) {
- if (rangeContains(range, search))
- return getLocation(range, search);
- i += d;
- range = lineRanges[i];
- }
- }
- return locate;
- }
- function locate(source, search, options) {
- if (typeof options === 'number') {
- throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');
- }
- return getLocator$2(source, options)(search, options && options.startIndex);
- }
- const keys = {
- Literal: [],
- Program: ['body']
- };
- function getAndCreateKeys(esTreeNode) {
- keys[esTreeNode.type] = Object.keys(esTreeNode).filter(key => key !== '_rollupAnnotations' && typeof esTreeNode[key] === 'object');
- return keys[esTreeNode.type];
- }
- const INCLUDE_PARAMETERS = 'variables';
- class NodeBase {
- constructor(esTreeNode, parent, parentScope) {
- this.included = false;
- this.esTreeNode = esTreeNode;
- this.keys = keys[esTreeNode.type] || getAndCreateKeys(esTreeNode);
- this.parent = parent;
- this.context = parent.context;
- this.createScope(parentScope);
- this.parseNode(esTreeNode);
- this.initialise();
- this.context.magicString.addSourcemapLocation(this.start);
- this.context.magicString.addSourcemapLocation(this.end);
- }
- addExportedVariables(_variables, _exportNamesByVariable) { }
- /**
- * Override this to bind assignments to variables and do any initialisations that
- * require the scopes to be populated with variables.
- */
- bind() {
- for (const key of this.keys) {
- const value = this[key];
- if (value === null)
- continue;
- if (Array.isArray(value)) {
- for (const child of value) {
- if (child !== null)
- child.bind();
- }
- }
- else {
- value.bind();
- }
- }
- }
- /**
- * Override if this node should receive a different scope than the parent scope.
- */
- createScope(parentScope) {
- this.scope = parentScope;
- }
- deoptimizePath(_path) { }
- getLiteralValueAtPath(_path, _recursionTracker, _origin) {
- return UnknownValue;
- }
- getReturnExpressionWhenCalledAtPath(_path, _recursionTracker, _origin) {
- return UNKNOWN_EXPRESSION;
- }
- hasEffects(context) {
- for (const key of this.keys) {
- const value = this[key];
- if (value === null)
- continue;
- if (Array.isArray(value)) {
- for (const child of value) {
- if (child !== null && child.hasEffects(context))
- return true;
- }
- }
- else if (value.hasEffects(context))
- return true;
- }
- return false;
- }
- hasEffectsWhenAccessedAtPath(path, _context) {
- return path.length > 0;
- }
- hasEffectsWhenAssignedAtPath(_path, _context) {
- return true;
- }
- hasEffectsWhenCalledAtPath(_path, _callOptions, _context) {
- return true;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- for (const key of this.keys) {
- const value = this[key];
- if (value === null)
- continue;
- if (Array.isArray(value)) {
- for (const child of value) {
- if (child !== null)
- child.include(context, includeChildrenRecursively);
- }
- }
- else {
- value.include(context, includeChildrenRecursively);
- }
- }
- }
- includeAsSingleStatement(context, includeChildrenRecursively) {
- this.include(context, includeChildrenRecursively);
- }
- includeCallArguments(context, args) {
- for (const arg of args) {
- arg.include(context, false);
- }
- }
- /**
- * Override to perform special initialisation steps after the scope is initialised
- */
- initialise() { }
- insertSemicolon(code) {
- if (code.original[this.end - 1] !== ';') {
- code.appendLeft(this.end, ';');
- }
- }
- parseNode(esTreeNode) {
- for (const key of Object.keys(esTreeNode)) {
- // That way, we can override this function to add custom initialisation and then call super.parseNode
- if (this.hasOwnProperty(key))
- continue;
- const value = esTreeNode[key];
- if (key === '_rollupAnnotations') {
- this.annotations = value;
- }
- else if (typeof value !== 'object' || value === null) {
- this[key] = value;
- }
- else if (Array.isArray(value)) {
- this[key] = [];
- for (const child of value) {
- this[key].push(child === null
- ? null
- : new (this.context.nodeConstructors[child.type] ||
- this.context.nodeConstructors.UnknownNode)(child, this, this.scope));
- }
- }
- else {
- this[key] = new (this.context.nodeConstructors[value.type] ||
- this.context.nodeConstructors.UnknownNode)(value, this, this.scope);
- }
- }
- }
- render(code, options) {
- for (const key of this.keys) {
- const value = this[key];
- if (value === null)
- continue;
- if (Array.isArray(value)) {
- for (const child of value) {
- if (child !== null)
- child.render(code, options);
- }
- }
- else {
- value.render(code, options);
- }
- }
- }
- shouldBeIncluded(context) {
- return this.included || (!context.brokenFlow && this.hasEffects(createHasEffectsContext()));
- }
- }
- class ClassNode extends NodeBase {
- createScope(parentScope) {
- this.scope = new ChildScope(parentScope);
- }
- hasEffectsWhenAccessedAtPath(path) {
- if (path.length <= 1)
- return false;
- return path.length > 2 || path[0] !== 'prototype';
- }
- hasEffectsWhenAssignedAtPath(path) {
- if (path.length <= 1)
- return false;
- return path.length > 2 || path[0] !== 'prototype';
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (!callOptions.withNew)
- return true;
- return (this.body.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
- (this.superClass !== null &&
- this.superClass.hasEffectsWhenCalledAtPath(path, callOptions, context)));
- }
- initialise() {
- if (this.id !== null) {
- this.id.declare('class', this);
- }
- }
- }
- class ClassDeclaration extends ClassNode {
- initialise() {
- super.initialise();
- if (this.id !== null) {
- this.id.variable.isId = true;
- }
- }
- parseNode(esTreeNode) {
- if (esTreeNode.id !== null) {
- this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope.parent);
- }
- super.parseNode(esTreeNode);
- }
- render(code, options) {
- if (options.format === 'system' &&
- this.id &&
- options.exportNamesByVariable.has(this.id.variable)) {
- code.appendLeft(this.end, `${options.compact ? '' : ' '}${getSystemExportStatement([this.id.variable], options)};`);
- }
- super.render(code, options);
- }
- }
- class ArgumentsVariable extends LocalVariable {
- constructor(context) {
- super('arguments', null, UNKNOWN_EXPRESSION, context);
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenAssignedAtPath() {
- return true;
- }
- hasEffectsWhenCalledAtPath() {
- return true;
- }
- }
- class ThisVariable extends LocalVariable {
- constructor(context) {
- super('this', null, null, context);
- }
- getLiteralValueAtPath() {
- return UnknownValue;
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- return (this.getInit(context).hasEffectsWhenAccessedAtPath(path, context) ||
- super.hasEffectsWhenAccessedAtPath(path, context));
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return (this.getInit(context).hasEffectsWhenAssignedAtPath(path, context) ||
- super.hasEffectsWhenAssignedAtPath(path, context));
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- return (this.getInit(context).hasEffectsWhenCalledAtPath(path, callOptions, context) ||
- super.hasEffectsWhenCalledAtPath(path, callOptions, context));
- }
- getInit(context) {
- return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;
- }
- }
- class SpreadElement extends NodeBase {
- bind() {
- super.bind();
- // Only properties of properties of the argument could become subject to reassignment
- // This will also reassign the return values of iterators
- this.argument.deoptimizePath([UnknownKey, UnknownKey]);
- }
- }
- class ParameterScope extends ChildScope {
- constructor(parent, context) {
- super(parent);
- this.parameters = [];
- this.hasRest = false;
- this.context = context;
- this.hoistedBodyVarScope = new ChildScope(this);
- }
- /**
- * Adds a parameter to this scope. Parameters must be added in the correct
- * order, e.g. from left to right.
- */
- addParameterDeclaration(identifier) {
- const name = identifier.name;
- let variable = this.hoistedBodyVarScope.variables.get(name);
- if (variable) {
- variable.addDeclaration(identifier, null);
- }
- else {
- variable = new LocalVariable(name, identifier, UNKNOWN_EXPRESSION, this.context);
- }
- this.variables.set(name, variable);
- return variable;
- }
- addParameterVariables(parameters, hasRest) {
- this.parameters = parameters;
- for (const parameterList of parameters) {
- for (const parameter of parameterList) {
- parameter.alwaysRendered = true;
- }
- }
- this.hasRest = hasRest;
- }
- includeCallArguments(context, args) {
- let calledFromTryStatement = false;
- let argIncluded = false;
- const restParam = this.hasRest && this.parameters[this.parameters.length - 1];
- for (const checkedArg of args) {
- if (checkedArg instanceof SpreadElement) {
- for (const arg of args) {
- arg.include(context, false);
- }
- break;
- }
- }
- for (let index = args.length - 1; index >= 0; index--) {
- const paramVars = this.parameters[index] || restParam;
- const arg = args[index];
- if (paramVars) {
- calledFromTryStatement = false;
- if (paramVars.length === 0) {
- // handle empty destructuring
- argIncluded = true;
- }
- else {
- for (const variable of paramVars) {
- if (variable.included) {
- argIncluded = true;
- }
- if (variable.calledFromTryStatement) {
- calledFromTryStatement = true;
- }
- }
- }
- }
- if (!argIncluded && arg.shouldBeIncluded(context)) {
- argIncluded = true;
- }
- if (argIncluded) {
- arg.include(context, calledFromTryStatement);
- }
- }
- }
- }
- class ReturnValueScope extends ParameterScope {
- constructor() {
- super(...arguments);
- this.returnExpression = null;
- this.returnExpressions = [];
- }
- addReturnExpression(expression) {
- this.returnExpressions.push(expression);
- }
- getReturnExpression() {
- if (this.returnExpression === null)
- this.updateReturnExpression();
- return this.returnExpression;
- }
- updateReturnExpression() {
- if (this.returnExpressions.length === 1) {
- this.returnExpression = this.returnExpressions[0];
- }
- else {
- this.returnExpression = UNKNOWN_EXPRESSION;
- for (const expression of this.returnExpressions) {
- expression.deoptimizePath(UNKNOWN_PATH);
- }
- }
- }
- }
- class FunctionScope extends ReturnValueScope {
- constructor(parent, context) {
- super(parent, context);
- this.variables.set('arguments', (this.argumentsVariable = new ArgumentsVariable(context)));
- this.variables.set('this', (this.thisVariable = new ThisVariable(context)));
- }
- findLexicalBoundary() {
- return this;
- }
- includeCallArguments(context, args) {
- super.includeCallArguments(context, args);
- if (this.argumentsVariable.included) {
- for (const arg of args) {
- if (!arg.included) {
- arg.include(context, false);
- }
- }
- }
- }
- }
- //@ts-check
- /** @typedef { import('estree').Node} Node */
- /** @typedef {Node | {
- * type: 'PropertyDefinition';
- * computed: boolean;
- * value: Node
- * }} NodeWithPropertyDefinition */
- /**
- *
- * @param {NodeWithPropertyDefinition} node
- * @param {NodeWithPropertyDefinition} parent
- * @returns boolean
- */
- function is_reference (node, parent) {
- if (node.type === 'MemberExpression') {
- return !node.computed && is_reference(node.object, node);
- }
- if (node.type === 'Identifier') {
- if (!parent) return true;
- switch (parent.type) {
- // disregard `bar` in `foo.bar`
- case 'MemberExpression': return parent.computed || node === parent.object;
- // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
- case 'MethodDefinition': return parent.computed;
- // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
- case 'PropertyDefinition': return parent.computed || node === parent.value;
- // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
- case 'Property': return parent.computed || node === parent.value;
- // disregard the `bar` in `export { foo as bar }` or
- // the foo in `import { foo as bar }`
- case 'ExportSpecifier':
- case 'ImportSpecifier': return node === parent.local;
- // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
- case 'LabeledStatement':
- case 'BreakStatement':
- case 'ContinueStatement': return false;
- default: return true;
- }
- }
- return false;
- }
- const BLANK = Object.freeze(Object.create(null));
- const EMPTY_OBJECT = Object.freeze({});
- const EMPTY_ARRAY = Object.freeze([]);
- const ValueProperties = Symbol('Value Properties');
- const PURE = { pure: true };
- const IMPURE = { pure: false };
- // We use shortened variables to reduce file size here
- /* OBJECT */
- const O = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE
- };
- /* PURE FUNCTION */
- const PF = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE
- };
- /* CONSTRUCTOR */
- const C = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- prototype: O
- };
- /* PURE CONSTRUCTOR */
- const PC = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- prototype: O
- };
- const ARRAY_TYPE = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- from: PF,
- of: PF,
- prototype: O
- };
- const INTL_MEMBER = {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- supportedLocalesOf: PC
- };
- const knownGlobals = {
- // Placeholders for global objects to avoid shape mutations
- global: O,
- globalThis: O,
- self: O,
- window: O,
- // Common globals
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- Array: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- from: O,
- isArray: PF,
- of: PF,
- prototype: O
- },
- ArrayBuffer: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- isView: PF,
- prototype: O
- },
- Atomics: O,
- BigInt: C,
- BigInt64Array: C,
- BigUint64Array: C,
- Boolean: PC,
- // @ts-ignore
- constructor: C,
- DataView: PC,
- Date: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- now: PF,
- parse: PF,
- prototype: O,
- UTC: PF
- },
- decodeURI: PF,
- decodeURIComponent: PF,
- encodeURI: PF,
- encodeURIComponent: PF,
- Error: PC,
- escape: PF,
- eval: O,
- EvalError: PC,
- Float32Array: ARRAY_TYPE,
- Float64Array: ARRAY_TYPE,
- Function: C,
- // @ts-ignore
- hasOwnProperty: O,
- Infinity: O,
- Int16Array: ARRAY_TYPE,
- Int32Array: ARRAY_TYPE,
- Int8Array: ARRAY_TYPE,
- isFinite: PF,
- isNaN: PF,
- // @ts-ignore
- isPrototypeOf: O,
- JSON: O,
- Map: PC,
- Math: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- abs: PF,
- acos: PF,
- acosh: PF,
- asin: PF,
- asinh: PF,
- atan: PF,
- atan2: PF,
- atanh: PF,
- cbrt: PF,
- ceil: PF,
- clz32: PF,
- cos: PF,
- cosh: PF,
- exp: PF,
- expm1: PF,
- floor: PF,
- fround: PF,
- hypot: PF,
- imul: PF,
- log: PF,
- log10: PF,
- log1p: PF,
- log2: PF,
- max: PF,
- min: PF,
- pow: PF,
- random: PF,
- round: PF,
- sign: PF,
- sin: PF,
- sinh: PF,
- sqrt: PF,
- tan: PF,
- tanh: PF,
- trunc: PF
- },
- NaN: O,
- Number: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- isFinite: PF,
- isInteger: PF,
- isNaN: PF,
- isSafeInteger: PF,
- parseFloat: PF,
- parseInt: PF,
- prototype: O
- },
- Object: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- create: PF,
- getNotifier: PF,
- getOwn: PF,
- getOwnPropertyDescriptor: PF,
- getOwnPropertyNames: PF,
- getOwnPropertySymbols: PF,
- getPrototypeOf: PF,
- is: PF,
- isExtensible: PF,
- isFrozen: PF,
- isSealed: PF,
- keys: PF,
- prototype: O
- },
- parseFloat: PF,
- parseInt: PF,
- Promise: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- all: PF,
- prototype: O,
- race: PF,
- resolve: PF
- },
- // @ts-ignore
- propertyIsEnumerable: O,
- Proxy: O,
- RangeError: PC,
- ReferenceError: PC,
- Reflect: O,
- RegExp: PC,
- Set: PC,
- SharedArrayBuffer: C,
- String: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- fromCharCode: PF,
- fromCodePoint: PF,
- prototype: O,
- raw: PF
- },
- Symbol: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: PURE,
- for: PF,
- keyFor: PF,
- prototype: O
- },
- SyntaxError: PC,
- // @ts-ignore
- toLocaleString: O,
- // @ts-ignore
- toString: O,
- TypeError: PC,
- Uint16Array: ARRAY_TYPE,
- Uint32Array: ARRAY_TYPE,
- Uint8Array: ARRAY_TYPE,
- Uint8ClampedArray: ARRAY_TYPE,
- // Technically, this is a global, but it needs special handling
- // undefined: ?,
- unescape: PF,
- URIError: PC,
- // @ts-ignore
- valueOf: O,
- WeakMap: PC,
- WeakSet: PC,
- // Additional globals shared by Node and Browser that are not strictly part of the language
- clearInterval: C,
- clearTimeout: C,
- console: O,
- Intl: {
- // @ts-ignore
- __proto__: null,
- [ValueProperties]: IMPURE,
- Collator: INTL_MEMBER,
- DateTimeFormat: INTL_MEMBER,
- ListFormat: INTL_MEMBER,
- NumberFormat: INTL_MEMBER,
- PluralRules: INTL_MEMBER,
- RelativeTimeFormat: INTL_MEMBER
- },
- setInterval: C,
- setTimeout: C,
- TextDecoder: C,
- TextEncoder: C,
- URL: C,
- URLSearchParams: C,
- // Browser specific globals
- AbortController: C,
- AbortSignal: C,
- addEventListener: O,
- alert: O,
- AnalyserNode: C,
- Animation: C,
- AnimationEvent: C,
- applicationCache: O,
- ApplicationCache: C,
- ApplicationCacheErrorEvent: C,
- atob: O,
- Attr: C,
- Audio: C,
- AudioBuffer: C,
- AudioBufferSourceNode: C,
- AudioContext: C,
- AudioDestinationNode: C,
- AudioListener: C,
- AudioNode: C,
- AudioParam: C,
- AudioProcessingEvent: C,
- AudioScheduledSourceNode: C,
- AudioWorkletNode: C,
- BarProp: C,
- BaseAudioContext: C,
- BatteryManager: C,
- BeforeUnloadEvent: C,
- BiquadFilterNode: C,
- Blob: C,
- BlobEvent: C,
- blur: O,
- BroadcastChannel: C,
- btoa: O,
- ByteLengthQueuingStrategy: C,
- Cache: C,
- caches: O,
- CacheStorage: C,
- cancelAnimationFrame: O,
- cancelIdleCallback: O,
- CanvasCaptureMediaStreamTrack: C,
- CanvasGradient: C,
- CanvasPattern: C,
- CanvasRenderingContext2D: C,
- ChannelMergerNode: C,
- ChannelSplitterNode: C,
- CharacterData: C,
- clientInformation: O,
- ClipboardEvent: C,
- close: O,
- closed: O,
- CloseEvent: C,
- Comment: C,
- CompositionEvent: C,
- confirm: O,
- ConstantSourceNode: C,
- ConvolverNode: C,
- CountQueuingStrategy: C,
- createImageBitmap: O,
- Credential: C,
- CredentialsContainer: C,
- crypto: O,
- Crypto: C,
- CryptoKey: C,
- CSS: C,
- CSSConditionRule: C,
- CSSFontFaceRule: C,
- CSSGroupingRule: C,
- CSSImportRule: C,
- CSSKeyframeRule: C,
- CSSKeyframesRule: C,
- CSSMediaRule: C,
- CSSNamespaceRule: C,
- CSSPageRule: C,
- CSSRule: C,
- CSSRuleList: C,
- CSSStyleDeclaration: C,
- CSSStyleRule: C,
- CSSStyleSheet: C,
- CSSSupportsRule: C,
- CustomElementRegistry: C,
- customElements: O,
- CustomEvent: C,
- DataTransfer: C,
- DataTransferItem: C,
- DataTransferItemList: C,
- defaultstatus: O,
- defaultStatus: O,
- DelayNode: C,
- DeviceMotionEvent: C,
- DeviceOrientationEvent: C,
- devicePixelRatio: O,
- dispatchEvent: O,
- document: O,
- Document: C,
- DocumentFragment: C,
- DocumentType: C,
- DOMError: C,
- DOMException: C,
- DOMImplementation: C,
- DOMMatrix: C,
- DOMMatrixReadOnly: C,
- DOMParser: C,
- DOMPoint: C,
- DOMPointReadOnly: C,
- DOMQuad: C,
- DOMRect: C,
- DOMRectReadOnly: C,
- DOMStringList: C,
- DOMStringMap: C,
- DOMTokenList: C,
- DragEvent: C,
- DynamicsCompressorNode: C,
- Element: C,
- ErrorEvent: C,
- Event: C,
- EventSource: C,
- EventTarget: C,
- external: O,
- fetch: O,
- File: C,
- FileList: C,
- FileReader: C,
- find: O,
- focus: O,
- FocusEvent: C,
- FontFace: C,
- FontFaceSetLoadEvent: C,
- FormData: C,
- frames: O,
- GainNode: C,
- Gamepad: C,
- GamepadButton: C,
- GamepadEvent: C,
- getComputedStyle: O,
- getSelection: O,
- HashChangeEvent: C,
- Headers: C,
- history: O,
- History: C,
- HTMLAllCollection: C,
- HTMLAnchorElement: C,
- HTMLAreaElement: C,
- HTMLAudioElement: C,
- HTMLBaseElement: C,
- HTMLBodyElement: C,
- HTMLBRElement: C,
- HTMLButtonElement: C,
- HTMLCanvasElement: C,
- HTMLCollection: C,
- HTMLContentElement: C,
- HTMLDataElement: C,
- HTMLDataListElement: C,
- HTMLDetailsElement: C,
- HTMLDialogElement: C,
- HTMLDirectoryElement: C,
- HTMLDivElement: C,
- HTMLDListElement: C,
- HTMLDocument: C,
- HTMLElement: C,
- HTMLEmbedElement: C,
- HTMLFieldSetElement: C,
- HTMLFontElement: C,
- HTMLFormControlsCollection: C,
- HTMLFormElement: C,
- HTMLFrameElement: C,
- HTMLFrameSetElement: C,
- HTMLHeadElement: C,
- HTMLHeadingElement: C,
- HTMLHRElement: C,
- HTMLHtmlElement: C,
- HTMLIFrameElement: C,
- HTMLImageElement: C,
- HTMLInputElement: C,
- HTMLLabelElement: C,
- HTMLLegendElement: C,
- HTMLLIElement: C,
- HTMLLinkElement: C,
- HTMLMapElement: C,
- HTMLMarqueeElement: C,
- HTMLMediaElement: C,
- HTMLMenuElement: C,
- HTMLMetaElement: C,
- HTMLMeterElement: C,
- HTMLModElement: C,
- HTMLObjectElement: C,
- HTMLOListElement: C,
- HTMLOptGroupElement: C,
- HTMLOptionElement: C,
- HTMLOptionsCollection: C,
- HTMLOutputElement: C,
- HTMLParagraphElement: C,
- HTMLParamElement: C,
- HTMLPictureElement: C,
- HTMLPreElement: C,
- HTMLProgressElement: C,
- HTMLQuoteElement: C,
- HTMLScriptElement: C,
- HTMLSelectElement: C,
- HTMLShadowElement: C,
- HTMLSlotElement: C,
- HTMLSourceElement: C,
- HTMLSpanElement: C,
- HTMLStyleElement: C,
- HTMLTableCaptionElement: C,
- HTMLTableCellElement: C,
- HTMLTableColElement: C,
- HTMLTableElement: C,
- HTMLTableRowElement: C,
- HTMLTableSectionElement: C,
- HTMLTemplateElement: C,
- HTMLTextAreaElement: C,
- HTMLTimeElement: C,
- HTMLTitleElement: C,
- HTMLTrackElement: C,
- HTMLUListElement: C,
- HTMLUnknownElement: C,
- HTMLVideoElement: C,
- IDBCursor: C,
- IDBCursorWithValue: C,
- IDBDatabase: C,
- IDBFactory: C,
- IDBIndex: C,
- IDBKeyRange: C,
- IDBObjectStore: C,
- IDBOpenDBRequest: C,
- IDBRequest: C,
- IDBTransaction: C,
- IDBVersionChangeEvent: C,
- IdleDeadline: C,
- IIRFilterNode: C,
- Image: C,
- ImageBitmap: C,
- ImageBitmapRenderingContext: C,
- ImageCapture: C,
- ImageData: C,
- indexedDB: O,
- innerHeight: O,
- innerWidth: O,
- InputEvent: C,
- IntersectionObserver: C,
- IntersectionObserverEntry: C,
- isSecureContext: O,
- KeyboardEvent: C,
- KeyframeEffect: C,
- length: O,
- localStorage: O,
- location: O,
- Location: C,
- locationbar: O,
- matchMedia: O,
- MediaDeviceInfo: C,
- MediaDevices: C,
- MediaElementAudioSourceNode: C,
- MediaEncryptedEvent: C,
- MediaError: C,
- MediaKeyMessageEvent: C,
- MediaKeySession: C,
- MediaKeyStatusMap: C,
- MediaKeySystemAccess: C,
- MediaList: C,
- MediaQueryList: C,
- MediaQueryListEvent: C,
- MediaRecorder: C,
- MediaSettingsRange: C,
- MediaSource: C,
- MediaStream: C,
- MediaStreamAudioDestinationNode: C,
- MediaStreamAudioSourceNode: C,
- MediaStreamEvent: C,
- MediaStreamTrack: C,
- MediaStreamTrackEvent: C,
- menubar: O,
- MessageChannel: C,
- MessageEvent: C,
- MessagePort: C,
- MIDIAccess: C,
- MIDIConnectionEvent: C,
- MIDIInput: C,
- MIDIInputMap: C,
- MIDIMessageEvent: C,
- MIDIOutput: C,
- MIDIOutputMap: C,
- MIDIPort: C,
- MimeType: C,
- MimeTypeArray: C,
- MouseEvent: C,
- moveBy: O,
- moveTo: O,
- MutationEvent: C,
- MutationObserver: C,
- MutationRecord: C,
- name: O,
- NamedNodeMap: C,
- NavigationPreloadManager: C,
- navigator: O,
- Navigator: C,
- NetworkInformation: C,
- Node: C,
- NodeFilter: O,
- NodeIterator: C,
- NodeList: C,
- Notification: C,
- OfflineAudioCompletionEvent: C,
- OfflineAudioContext: C,
- offscreenBuffering: O,
- OffscreenCanvas: C,
- open: O,
- openDatabase: O,
- Option: C,
- origin: O,
- OscillatorNode: C,
- outerHeight: O,
- outerWidth: O,
- PageTransitionEvent: C,
- pageXOffset: O,
- pageYOffset: O,
- PannerNode: C,
- parent: O,
- Path2D: C,
- PaymentAddress: C,
- PaymentRequest: C,
- PaymentRequestUpdateEvent: C,
- PaymentResponse: C,
- performance: O,
- Performance: C,
- PerformanceEntry: C,
- PerformanceLongTaskTiming: C,
- PerformanceMark: C,
- PerformanceMeasure: C,
- PerformanceNavigation: C,
- PerformanceNavigationTiming: C,
- PerformanceObserver: C,
- PerformanceObserverEntryList: C,
- PerformancePaintTiming: C,
- PerformanceResourceTiming: C,
- PerformanceTiming: C,
- PeriodicWave: C,
- Permissions: C,
- PermissionStatus: C,
- personalbar: O,
- PhotoCapabilities: C,
- Plugin: C,
- PluginArray: C,
- PointerEvent: C,
- PopStateEvent: C,
- postMessage: O,
- Presentation: C,
- PresentationAvailability: C,
- PresentationConnection: C,
- PresentationConnectionAvailableEvent: C,
- PresentationConnectionCloseEvent: C,
- PresentationConnectionList: C,
- PresentationReceiver: C,
- PresentationRequest: C,
- print: O,
- ProcessingInstruction: C,
- ProgressEvent: C,
- PromiseRejectionEvent: C,
- prompt: O,
- PushManager: C,
- PushSubscription: C,
- PushSubscriptionOptions: C,
- queueMicrotask: O,
- RadioNodeList: C,
- Range: C,
- ReadableStream: C,
- RemotePlayback: C,
- removeEventListener: O,
- Request: C,
- requestAnimationFrame: O,
- requestIdleCallback: O,
- resizeBy: O,
- ResizeObserver: C,
- ResizeObserverEntry: C,
- resizeTo: O,
- Response: C,
- RTCCertificate: C,
- RTCDataChannel: C,
- RTCDataChannelEvent: C,
- RTCDtlsTransport: C,
- RTCIceCandidate: C,
- RTCIceTransport: C,
- RTCPeerConnection: C,
- RTCPeerConnectionIceEvent: C,
- RTCRtpReceiver: C,
- RTCRtpSender: C,
- RTCSctpTransport: C,
- RTCSessionDescription: C,
- RTCStatsReport: C,
- RTCTrackEvent: C,
- screen: O,
- Screen: C,
- screenLeft: O,
- ScreenOrientation: C,
- screenTop: O,
- screenX: O,
- screenY: O,
- ScriptProcessorNode: C,
- scroll: O,
- scrollbars: O,
- scrollBy: O,
- scrollTo: O,
- scrollX: O,
- scrollY: O,
- SecurityPolicyViolationEvent: C,
- Selection: C,
- ServiceWorker: C,
- ServiceWorkerContainer: C,
- ServiceWorkerRegistration: C,
- sessionStorage: O,
- ShadowRoot: C,
- SharedWorker: C,
- SourceBuffer: C,
- SourceBufferList: C,
- speechSynthesis: O,
- SpeechSynthesisEvent: C,
- SpeechSynthesisUtterance: C,
- StaticRange: C,
- status: O,
- statusbar: O,
- StereoPannerNode: C,
- stop: O,
- Storage: C,
- StorageEvent: C,
- StorageManager: C,
- styleMedia: O,
- StyleSheet: C,
- StyleSheetList: C,
- SubtleCrypto: C,
- SVGAElement: C,
- SVGAngle: C,
- SVGAnimatedAngle: C,
- SVGAnimatedBoolean: C,
- SVGAnimatedEnumeration: C,
- SVGAnimatedInteger: C,
- SVGAnimatedLength: C,
- SVGAnimatedLengthList: C,
- SVGAnimatedNumber: C,
- SVGAnimatedNumberList: C,
- SVGAnimatedPreserveAspectRatio: C,
- SVGAnimatedRect: C,
- SVGAnimatedString: C,
- SVGAnimatedTransformList: C,
- SVGAnimateElement: C,
- SVGAnimateMotionElement: C,
- SVGAnimateTransformElement: C,
- SVGAnimationElement: C,
- SVGCircleElement: C,
- SVGClipPathElement: C,
- SVGComponentTransferFunctionElement: C,
- SVGDefsElement: C,
- SVGDescElement: C,
- SVGDiscardElement: C,
- SVGElement: C,
- SVGEllipseElement: C,
- SVGFEBlendElement: C,
- SVGFEColorMatrixElement: C,
- SVGFEComponentTransferElement: C,
- SVGFECompositeElement: C,
- SVGFEConvolveMatrixElement: C,
- SVGFEDiffuseLightingElement: C,
- SVGFEDisplacementMapElement: C,
- SVGFEDistantLightElement: C,
- SVGFEDropShadowElement: C,
- SVGFEFloodElement: C,
- SVGFEFuncAElement: C,
- SVGFEFuncBElement: C,
- SVGFEFuncGElement: C,
- SVGFEFuncRElement: C,
- SVGFEGaussianBlurElement: C,
- SVGFEImageElement: C,
- SVGFEMergeElement: C,
- SVGFEMergeNodeElement: C,
- SVGFEMorphologyElement: C,
- SVGFEOffsetElement: C,
- SVGFEPointLightElement: C,
- SVGFESpecularLightingElement: C,
- SVGFESpotLightElement: C,
- SVGFETileElement: C,
- SVGFETurbulenceElement: C,
- SVGFilterElement: C,
- SVGForeignObjectElement: C,
- SVGGElement: C,
- SVGGeometryElement: C,
- SVGGradientElement: C,
- SVGGraphicsElement: C,
- SVGImageElement: C,
- SVGLength: C,
- SVGLengthList: C,
- SVGLinearGradientElement: C,
- SVGLineElement: C,
- SVGMarkerElement: C,
- SVGMaskElement: C,
- SVGMatrix: C,
- SVGMetadataElement: C,
- SVGMPathElement: C,
- SVGNumber: C,
- SVGNumberList: C,
- SVGPathElement: C,
- SVGPatternElement: C,
- SVGPoint: C,
- SVGPointList: C,
- SVGPolygonElement: C,
- SVGPolylineElement: C,
- SVGPreserveAspectRatio: C,
- SVGRadialGradientElement: C,
- SVGRect: C,
- SVGRectElement: C,
- SVGScriptElement: C,
- SVGSetElement: C,
- SVGStopElement: C,
- SVGStringList: C,
- SVGStyleElement: C,
- SVGSVGElement: C,
- SVGSwitchElement: C,
- SVGSymbolElement: C,
- SVGTextContentElement: C,
- SVGTextElement: C,
- SVGTextPathElement: C,
- SVGTextPositioningElement: C,
- SVGTitleElement: C,
- SVGTransform: C,
- SVGTransformList: C,
- SVGTSpanElement: C,
- SVGUnitTypes: C,
- SVGUseElement: C,
- SVGViewElement: C,
- TaskAttributionTiming: C,
- Text: C,
- TextEvent: C,
- TextMetrics: C,
- TextTrack: C,
- TextTrackCue: C,
- TextTrackCueList: C,
- TextTrackList: C,
- TimeRanges: C,
- toolbar: O,
- top: O,
- Touch: C,
- TouchEvent: C,
- TouchList: C,
- TrackEvent: C,
- TransitionEvent: C,
- TreeWalker: C,
- UIEvent: C,
- ValidityState: C,
- visualViewport: O,
- VisualViewport: C,
- VTTCue: C,
- WaveShaperNode: C,
- WebAssembly: O,
- WebGL2RenderingContext: C,
- WebGLActiveInfo: C,
- WebGLBuffer: C,
- WebGLContextEvent: C,
- WebGLFramebuffer: C,
- WebGLProgram: C,
- WebGLQuery: C,
- WebGLRenderbuffer: C,
- WebGLRenderingContext: C,
- WebGLSampler: C,
- WebGLShader: C,
- WebGLShaderPrecisionFormat: C,
- WebGLSync: C,
- WebGLTexture: C,
- WebGLTransformFeedback: C,
- WebGLUniformLocation: C,
- WebGLVertexArrayObject: C,
- WebSocket: C,
- WheelEvent: C,
- Window: C,
- Worker: C,
- WritableStream: C,
- XMLDocument: C,
- XMLHttpRequest: C,
- XMLHttpRequestEventTarget: C,
- XMLHttpRequestUpload: C,
- XMLSerializer: C,
- XPathEvaluator: C,
- XPathExpression: C,
- XPathResult: C,
- XSLTProcessor: C
- };
- for (const global of ['window', 'global', 'self', 'globalThis']) {
- knownGlobals[global] = knownGlobals;
- }
- function getGlobalAtPath(path) {
- let currentGlobal = knownGlobals;
- for (const pathSegment of path) {
- if (typeof pathSegment !== 'string') {
- return null;
- }
- currentGlobal = currentGlobal[pathSegment];
- if (!currentGlobal) {
- return null;
- }
- }
- return currentGlobal[ValueProperties];
- }
- function isPureGlobal(path) {
- const globalAtPath = getGlobalAtPath(path);
- return globalAtPath !== null && globalAtPath.pure;
- }
- function isGlobalMember(path) {
- if (path.length === 1) {
- return path[0] === 'undefined' || getGlobalAtPath(path) !== null;
- }
- return getGlobalAtPath(path.slice(0, -1)) !== null;
- }
- class GlobalVariable extends Variable {
- constructor() {
- super(...arguments);
- this.isReassigned = true;
- }
- hasEffectsWhenAccessedAtPath(path) {
- return !isGlobalMember([this.name, ...path]);
- }
- hasEffectsWhenCalledAtPath(path) {
- return !isPureGlobal([this.name, ...path]);
- }
- }
- class Identifier extends NodeBase {
- constructor() {
- super(...arguments);
- this.variable = null;
- this.bound = false;
- }
- addExportedVariables(variables, exportNamesByVariable) {
- if (this.variable !== null && exportNamesByVariable.has(this.variable)) {
- variables.push(this.variable);
- }
- }
- bind() {
- if (this.bound)
- return;
- this.bound = true;
- if (this.variable === null && is_reference(this, this.parent)) {
- this.variable = this.scope.findVariable(this.name);
- this.variable.addReference(this);
- }
- if (this.variable !== null &&
- this.variable instanceof LocalVariable &&
- this.variable.additionalInitializers !== null) {
- this.variable.consolidateInitializers();
- }
- }
- declare(kind, init) {
- let variable;
- switch (kind) {
- case 'var':
- variable = this.scope.addDeclaration(this, this.context, init, true);
- break;
- case 'function':
- // in strict mode, functions are only hoisted within a scope but not across block scopes
- variable = this.scope.addDeclaration(this, this.context, init, false);
- break;
- case 'let':
- case 'const':
- case 'class':
- variable = this.scope.addDeclaration(this, this.context, init, false);
- break;
- case 'parameter':
- variable = this.scope.addParameterDeclaration(this);
- break;
- /* istanbul ignore next */
- default:
- /* istanbul ignore next */
- throw new Error(`Internal Error: Unexpected identifier kind ${kind}.`);
- }
- return [(this.variable = variable)];
- }
- deoptimizePath(path) {
- if (!this.bound)
- this.bind();
- if (path.length === 0 && !this.scope.contains(this.name)) {
- this.disallowImportReassignment();
- }
- this.variable.deoptimizePath(path);
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (!this.bound)
- this.bind();
- return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- if (!this.bound)
- this.bind();
- return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- hasEffects() {
- return (this.context.options.treeshake.unknownGlobalSideEffects &&
- this.variable instanceof GlobalVariable &&
- this.variable.hasEffectsWhenAccessedAtPath(EMPTY_PATH));
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- return this.variable !== null && this.variable.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return !this.variable || this.variable.hasEffectsWhenAssignedAtPath(path, context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- return !this.variable || this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- include() {
- if (!this.included) {
- this.included = true;
- if (this.variable !== null) {
- this.context.includeVariableInModule(this.variable);
- }
- }
- }
- includeCallArguments(context, args) {
- this.variable.includeCallArguments(context, args);
- }
- render(code, _options, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
- if (this.variable) {
- const name = this.variable.getName();
- if (name !== this.name) {
- code.overwrite(this.start, this.end, name, {
- contentOnly: true,
- storeName: true
- });
- if (isShorthandProperty) {
- code.prependRight(this.start, `${this.name}: `);
- }
- }
- // In strict mode, any variable named "eval" must be the actual "eval" function
- if (name === 'eval' &&
- renderedParentType === CallExpression$1 &&
- isCalleeOfRenderedParent) {
- code.appendRight(this.start, '0, ');
- }
- }
- }
- disallowImportReassignment() {
- return this.context.error({
- code: 'ILLEGAL_REASSIGNMENT',
- message: `Illegal reassignment to import '${this.name}'`
- }, this.start);
- }
- }
- class RestElement extends NodeBase {
- constructor() {
- super(...arguments);
- this.declarationInit = null;
- }
- addExportedVariables(variables, exportNamesByVariable) {
- this.argument.addExportedVariables(variables, exportNamesByVariable);
- }
- bind() {
- super.bind();
- if (this.declarationInit !== null) {
- this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
- }
- }
- declare(kind, init) {
- this.declarationInit = init;
- return this.argument.declare(kind, UNKNOWN_EXPRESSION);
- }
- deoptimizePath(path) {
- path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return path.length > 0 || this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
- }
- }
- class FunctionNode extends NodeBase {
- constructor() {
- super(...arguments);
- this.isPrototypeDeoptimized = false;
- }
- createScope(parentScope) {
- this.scope = new FunctionScope(parentScope, this.context);
- }
- deoptimizePath(path) {
- if (path.length === 1) {
- if (path[0] === 'prototype') {
- this.isPrototypeDeoptimized = true;
- }
- else if (path[0] === UnknownKey) {
- this.isPrototypeDeoptimized = true;
- // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
- // which means the return expression needs to be reassigned as well
- this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
- }
- }
- }
- getReturnExpressionWhenCalledAtPath(path) {
- return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
- }
- hasEffects() {
- return this.id !== null && this.id.hasEffects();
- }
- hasEffectsWhenAccessedAtPath(path) {
- if (path.length <= 1)
- return false;
- return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
- }
- hasEffectsWhenAssignedAtPath(path) {
- if (path.length <= 1) {
- return false;
- }
- return path.length > 2 || path[0] !== 'prototype' || this.isPrototypeDeoptimized;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length > 0)
- return true;
- for (const param of this.params) {
- if (param.hasEffects(context))
- return true;
- }
- const thisInit = context.replacedVariableInits.get(this.scope.thisVariable);
- context.replacedVariableInits.set(this.scope.thisVariable, callOptions.withNew ? new UnknownObjectExpression() : UNKNOWN_EXPRESSION);
- const { brokenFlow, ignore } = context;
- context.ignore = {
- breaks: false,
- continues: false,
- labels: new Set(),
- returnAwaitYield: true
- };
- if (this.body.hasEffects(context))
- return true;
- context.brokenFlow = brokenFlow;
- if (thisInit) {
- context.replacedVariableInits.set(this.scope.thisVariable, thisInit);
- }
- else {
- context.replacedVariableInits.delete(this.scope.thisVariable);
- }
- context.ignore = ignore;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (this.id)
- this.id.include();
- const hasArguments = this.scope.argumentsVariable.included;
- for (const param of this.params) {
- if (!(param instanceof Identifier) || hasArguments) {
- param.include(context, includeChildrenRecursively);
- }
- }
- const { brokenFlow } = context;
- context.brokenFlow = BROKEN_FLOW_NONE;
- this.body.include(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- includeCallArguments(context, args) {
- this.scope.includeCallArguments(context, args);
- }
- initialise() {
- if (this.id !== null) {
- this.id.declare('function', this);
- }
- this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
- this.body.addImplicitReturnExpressionToScope();
- }
- parseNode(esTreeNode) {
- this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
- super.parseNode(esTreeNode);
- }
- }
- FunctionNode.prototype.preventChildBlockScope = true;
- class FunctionDeclaration extends FunctionNode {
- initialise() {
- super.initialise();
- if (this.id !== null) {
- this.id.variable.isId = true;
- }
- }
- parseNode(esTreeNode) {
- if (esTreeNode.id !== null) {
- this.id = new this.context.nodeConstructors.Identifier(esTreeNode.id, this, this.scope
- .parent);
- }
- super.parseNode(esTreeNode);
- }
- }
- // The header ends at the first non-white-space after "default"
- function getDeclarationStart(code, start) {
- return findNonWhiteSpace(code, findFirstOccurrenceOutsideComment(code, 'default', start) + 7);
- }
- function getIdInsertPosition(code, declarationKeyword, endMarker, start) {
- const declarationEnd = findFirstOccurrenceOutsideComment(code, declarationKeyword, start) + declarationKeyword.length;
- code = code.slice(declarationEnd, findFirstOccurrenceOutsideComment(code, endMarker, declarationEnd));
- const generatorStarPos = findFirstOccurrenceOutsideComment(code, '*');
- if (generatorStarPos === -1) {
- return declarationEnd;
- }
- return declarationEnd + generatorStarPos + 1;
- }
- class ExportDefaultDeclaration extends NodeBase {
- include(context, includeChildrenRecursively) {
- super.include(context, includeChildrenRecursively);
- if (includeChildrenRecursively) {
- this.context.includeVariableInModule(this.variable);
- }
- }
- initialise() {
- const declaration = this.declaration;
- this.declarationName =
- (declaration.id && declaration.id.name) || this.declaration.name;
- this.variable = this.scope.addExportDefaultDeclaration(this.declarationName || this.context.getModuleName(), this, this.context);
- this.context.addExport(this);
- }
- render(code, options, nodeRenderOptions) {
- const { start, end } = nodeRenderOptions;
- const declarationStart = getDeclarationStart(code.original, this.start);
- if (this.declaration instanceof FunctionDeclaration) {
- this.renderNamedDeclaration(code, declarationStart, 'function', '(', this.declaration.id === null, options);
- }
- else if (this.declaration instanceof ClassDeclaration) {
- this.renderNamedDeclaration(code, declarationStart, 'class', '{', this.declaration.id === null, options);
- }
- else if (this.variable.getOriginalVariable() !== this.variable) {
- // Remove altogether to prevent re-declaring the same variable
- treeshakeNode(this, code, start, end);
- return;
- }
- else if (this.variable.included) {
- this.renderVariableDeclaration(code, declarationStart, options);
- }
- else {
- code.remove(this.start, declarationStart);
- this.declaration.render(code, options, {
- isCalleeOfRenderedParent: false,
- renderedParentType: ExpressionStatement$1
- });
- if (code.original[this.end - 1] !== ';') {
- code.appendLeft(this.end, ';');
- }
- return;
- }
- this.declaration.render(code, options);
- }
- renderNamedDeclaration(code, declarationStart, declarationKeyword, endMarker, needsId, options) {
- const name = this.variable.getName();
- // Remove `export default`
- code.remove(this.start, declarationStart);
- if (needsId) {
- code.appendLeft(getIdInsertPosition(code.original, declarationKeyword, endMarker, declarationStart), ` ${name}`);
- }
- if (options.format === 'system' &&
- this.declaration instanceof ClassDeclaration &&
- options.exportNamesByVariable.has(this.variable)) {
- code.appendLeft(this.end, ` ${getSystemExportStatement([this.variable], options)};`);
- }
- }
- renderVariableDeclaration(code, declarationStart, options) {
- const hasTrailingSemicolon = code.original.charCodeAt(this.end - 1) === 59; /*";"*/
- const systemExportNames = options.format === 'system' && options.exportNamesByVariable.get(this.variable);
- if (systemExportNames) {
- code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = exports('${systemExportNames[0]}', `);
- code.appendRight(hasTrailingSemicolon ? this.end - 1 : this.end, ')' + (hasTrailingSemicolon ? '' : ';'));
- }
- else {
- code.overwrite(this.start, declarationStart, `${options.varOrConst} ${this.variable.getName()} = `);
- if (!hasTrailingSemicolon) {
- code.appendLeft(this.end, ';');
- }
- }
- }
- }
- ExportDefaultDeclaration.prototype.needsBoundaries = true;
- class UndefinedVariable extends Variable {
- constructor() {
- super('undefined');
- }
- getLiteralValueAtPath() {
- return undefined;
- }
- }
- class ExportDefaultVariable extends LocalVariable {
- constructor(name, exportDefaultDeclaration, context) {
- super(name, exportDefaultDeclaration, exportDefaultDeclaration.declaration, context);
- this.hasId = false;
- this.originalId = null;
- this.originalVariable = null;
- const declaration = exportDefaultDeclaration.declaration;
- if ((declaration instanceof FunctionDeclaration || declaration instanceof ClassDeclaration) &&
- declaration.id) {
- this.hasId = true;
- this.originalId = declaration.id;
- }
- else if (declaration instanceof Identifier) {
- this.originalId = declaration;
- }
- }
- addReference(identifier) {
- if (!this.hasId) {
- this.name = identifier.name;
- }
- }
- getAssignedVariableName() {
- return (this.originalId && this.originalId.name) || null;
- }
- getBaseVariableName() {
- const original = this.getOriginalVariable();
- if (original === this) {
- return super.getBaseVariableName();
- }
- else {
- return original.getBaseVariableName();
- }
- }
- getDirectOriginalVariable() {
- return this.originalId &&
- (this.hasId ||
- !(this.originalId.variable.isReassigned ||
- this.originalId.variable instanceof UndefinedVariable ||
- // this avoids a circular dependency
- 'syntheticNamespace' in this.originalId.variable))
- ? this.originalId.variable
- : null;
- }
- getName() {
- const original = this.getOriginalVariable();
- if (original === this) {
- return super.getName();
- }
- else {
- return original.getName();
- }
- }
- getOriginalVariable() {
- if (this.originalVariable)
- return this.originalVariable;
- let original = this;
- let currentVariable;
- const checkedVariables = new Set();
- do {
- checkedVariables.add(original);
- currentVariable = original;
- original = currentVariable.getDirectOriginalVariable();
- } while (original instanceof ExportDefaultVariable && !checkedVariables.has(original));
- return (this.originalVariable = original || currentVariable);
- }
- }
- const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';
- class ExportShimVariable extends Variable {
- constructor(module) {
- super(MISSING_EXPORT_SHIM_VARIABLE);
- this.module = module;
- }
- }
- class NamespaceVariable extends Variable {
- constructor(context, syntheticNamedExports) {
- super(context.getModuleName());
- this.memberVariables = null;
- this.mergedNamespaces = [];
- this.referencedEarly = false;
- this.references = [];
- this.context = context;
- this.module = context.module;
- this.syntheticNamedExports = syntheticNamedExports;
- }
- addReference(identifier) {
- this.references.push(identifier);
- this.name = identifier.name;
- }
- // This is only called if "UNKNOWN_PATH" is reassigned as in all other situations, either the
- // build fails due to an illegal namespace reassignment or MemberExpression already forwards
- // the reassignment to the right variable. This means we lost track of this variable and thus
- // need to reassign all exports.
- deoptimizePath() {
- const memberVariables = this.getMemberVariables();
- for (const key of Object.keys(memberVariables)) {
- memberVariables[key].deoptimizePath(UNKNOWN_PATH);
- }
- }
- getMemberVariables() {
- if (this.memberVariables) {
- return this.memberVariables;
- }
- const memberVariables = Object.create(null);
- for (const name of this.context.getExports().concat(this.context.getReexports())) {
- if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
- memberVariables[name] = this.context.traceExport(name);
- }
- }
- return (this.memberVariables = memberVariables);
- }
- include() {
- this.included = true;
- this.context.includeAllExports();
- }
- prepareNamespace(mergedNamespaces) {
- this.mergedNamespaces = mergedNamespaces;
- const moduleExecIndex = this.context.getModuleExecIndex();
- for (const identifier of this.references) {
- if (identifier.context.getModuleExecIndex() <= moduleExecIndex) {
- this.referencedEarly = true;
- break;
- }
- }
- }
- renderBlock(options) {
- const _ = options.compact ? '' : ' ';
- const n = options.compact ? '' : '\n';
- const t = options.indent;
- const memberVariables = this.getMemberVariables();
- const members = Object.keys(memberVariables).map(name => {
- const original = memberVariables[name];
- if (this.referencedEarly || original.isReassigned) {
- return `${t}get ${name}${_}()${_}{${_}return ${original.getName()}${options.compact ? '' : ';'}${_}}`;
- }
- const safeName = RESERVED_NAMES[name] ? `'${name}'` : name;
- return `${t}${safeName}: ${original.getName()}`;
- });
- if (options.namespaceToStringTag) {
- members.unshift(`${t}[Symbol.toStringTag]:${_}'Module'`);
- }
- const needsObjectAssign = this.mergedNamespaces.length > 0 || this.syntheticNamedExports;
- if (!needsObjectAssign)
- members.unshift(`${t}__proto__:${_}null`);
- let output = `{${n}${members.join(`,${n}`)}${n}}`;
- if (needsObjectAssign) {
- const assignmentArgs = ['/*#__PURE__*/Object.create(null)'];
- if (this.mergedNamespaces.length > 0) {
- assignmentArgs.push(...this.mergedNamespaces.map(variable => variable.getName()));
- }
- if (this.syntheticNamedExports) {
- assignmentArgs.push(this.module.getSyntheticNamespace().getName());
- }
- if (members.length > 0) {
- assignmentArgs.push(output);
- }
- output = `/*#__PURE__*/Object.assign(${assignmentArgs.join(`,${_}`)})`;
- }
- if (options.freeze) {
- output = `/*#__PURE__*/Object.freeze(${output})`;
- }
- const name = this.getName();
- output = `${options.varOrConst} ${name}${_}=${_}${output};`;
- if (options.format === 'system' && options.exportNamesByVariable.has(this)) {
- output += `${n}${getSystemExportStatement([this], options)};`;
- }
- return output;
- }
- renderFirst() {
- return this.referencedEarly;
- }
- }
- NamespaceVariable.prototype.isNamespace = true;
- class SyntheticNamedExportVariable extends Variable {
- constructor(context, name, syntheticNamespace) {
- super(name);
- this.baseVariable = null;
- this.context = context;
- this.module = context.module;
- this.syntheticNamespace = syntheticNamespace;
- }
- getBaseVariable() {
- if (this.baseVariable)
- return this.baseVariable;
- let baseVariable = this.syntheticNamespace;
- while (baseVariable instanceof ExportDefaultVariable ||
- baseVariable instanceof SyntheticNamedExportVariable) {
- if (baseVariable instanceof ExportDefaultVariable) {
- const original = baseVariable.getOriginalVariable();
- if (original === baseVariable)
- break;
- baseVariable = original;
- }
- if (baseVariable instanceof SyntheticNamedExportVariable) {
- baseVariable = baseVariable.syntheticNamespace;
- }
- }
- return (this.baseVariable = baseVariable);
- }
- getBaseVariableName() {
- return this.syntheticNamespace.getBaseVariableName();
- }
- getName() {
- const name = this.name;
- return `${this.syntheticNamespace.getName()}${getPropertyAccess(name)}`;
- }
- include() {
- if (!this.included) {
- this.included = true;
- this.context.includeVariableInModule(this.syntheticNamespace);
- }
- }
- setRenderNames(baseName, name) {
- super.setRenderNames(baseName, name);
- }
- }
- const getPropertyAccess = (name) => {
- return !RESERVED_NAMES[name] && /^(?!\d)[\w$]+$/.test(name)
- ? `.${name}`
- : `[${JSON.stringify(name)}]`;
- };
- class ExternalVariable extends Variable {
- constructor(module, name) {
- super(name);
- this.module = module;
- this.isNamespace = name === '*';
- this.referenced = false;
- }
- addReference(identifier) {
- this.referenced = true;
- if (this.name === 'default' || this.name === '*') {
- this.module.suggestName(identifier.name);
- }
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > (this.isNamespace ? 1 : 0);
- }
- include() {
- if (!this.included) {
- this.included = true;
- this.module.used = true;
- }
- }
- }
- const reservedWords$1$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'.split(' ');
- const builtins$1$1 = 'Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'.split(' ');
- const blacklisted = new Set(reservedWords$1$1.concat(builtins$1$1));
- const illegalCharacters = /[^$_a-zA-Z0-9]/g;
- const startsWithDigit = (str) => /\d/.test(str[0]);
- function isLegal(str) {
- if (startsWithDigit(str) || blacklisted.has(str)) {
- return false;
- }
- return !illegalCharacters.test(str);
- }
- function makeLegal(str) {
- str = str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase()).replace(illegalCharacters, '_');
- if (startsWithDigit(str) || blacklisted.has(str))
- str = `_${str}`;
- return str || '_';
- }
- const absolutePath = /^(?:\/|(?:[A-Za-z]:)?[\\|/])/;
- const relativePath = /^\.?\.\//;
- function isAbsolute(path) {
- return absolutePath.test(path);
- }
- function isRelative(path) {
- return relativePath.test(path);
- }
- function normalize(path) {
- if (path.indexOf('\\') == -1)
- return path;
- return path.replace(/\\/g, '/');
- }
- class ExternalModule {
- constructor(options, id, hasModuleSideEffects, meta) {
- this.options = options;
- this.id = id;
- this.defaultVariableName = '';
- this.dynamicImporters = [];
- this.importers = [];
- this.mostCommonSuggestion = 0;
- this.namespaceVariableName = '';
- this.reexported = false;
- this.renderPath = undefined;
- this.renormalizeRenderPath = false;
- this.used = false;
- this.variableName = '';
- this.execIndex = Infinity;
- this.suggestedVariableName = makeLegal(id.split(/[\\/]/).pop());
- this.nameSuggestions = Object.create(null);
- this.declarations = Object.create(null);
- this.exportedVariables = new Map();
- const module = this;
- this.info = {
- ast: null,
- code: null,
- dynamicallyImportedIds: EMPTY_ARRAY,
- get dynamicImporters() {
- return module.dynamicImporters.sort();
- },
- hasModuleSideEffects,
- id,
- implicitlyLoadedAfterOneOf: EMPTY_ARRAY,
- implicitlyLoadedBefore: EMPTY_ARRAY,
- importedIds: EMPTY_ARRAY,
- get importers() {
- return module.importers.sort();
- },
- isEntry: false,
- isExternal: true,
- meta,
- syntheticNamedExports: false
- };
- }
- getVariableForExportName(name) {
- let declaration = this.declarations[name];
- if (declaration)
- return declaration;
- this.declarations[name] = declaration = new ExternalVariable(this, name);
- this.exportedVariables.set(declaration, name);
- return declaration;
- }
- setRenderPath(options, inputBase) {
- this.renderPath =
- typeof options.paths === 'function' ? options.paths(this.id) : options.paths[this.id];
- if (!this.renderPath) {
- if (!isAbsolute(this.id)) {
- this.renderPath = this.id;
- }
- else {
- this.renderPath = normalize(relative$1(inputBase, this.id));
- this.renormalizeRenderPath = true;
- }
- }
- return this.renderPath;
- }
- suggestName(name) {
- if (!this.nameSuggestions[name])
- this.nameSuggestions[name] = 0;
- this.nameSuggestions[name] += 1;
- if (this.nameSuggestions[name] > this.mostCommonSuggestion) {
- this.mostCommonSuggestion = this.nameSuggestions[name];
- this.suggestedVariableName = name;
- }
- }
- warnUnusedImports() {
- const unused = Object.keys(this.declarations).filter(name => {
- if (name === '*')
- return false;
- const declaration = this.declarations[name];
- return !declaration.included && !this.reexported && !declaration.referenced;
- });
- if (unused.length === 0)
- return;
- const names = unused.length === 1
- ? `'${unused[0]}' is`
- : `${unused
- .slice(0, -1)
- .map(name => `'${name}'`)
- .join(', ')} and '${unused.slice(-1)}' are`;
- this.options.onwarn({
- code: 'UNUSED_EXTERNAL_IMPORT',
- message: `${names} imported from external module '${this.id}' but never used`,
- names: unused,
- source: this.id
- });
- }
- }
- function removeJsExtension(name) {
- return name.endsWith('.js') ? name.slice(0, -3) : name;
- }
- function getCompleteAmdId(options, chunkId) {
- if (!options.autoId) {
- return options.id || '';
- }
- else {
- return `${options.basePath ? options.basePath + '/' : ''}${removeJsExtension(chunkId)}`;
- }
- }
- const INTEROP_DEFAULT_VARIABLE = '_interopDefault';
- const INTEROP_DEFAULT_LEGACY_VARIABLE = '_interopDefaultLegacy';
- const INTEROP_NAMESPACE_VARIABLE = '_interopNamespace';
- const INTEROP_NAMESPACE_DEFAULT_VARIABLE = '_interopNamespaceDefault';
- const INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE = '_interopNamespaceDefaultOnly';
- const defaultInteropHelpersByInteropType = {
- auto: INTEROP_DEFAULT_VARIABLE,
- default: null,
- defaultOnly: null,
- esModule: null,
- false: null,
- true: INTEROP_DEFAULT_LEGACY_VARIABLE
- };
- function isDefaultAProperty(interopType, externalLiveBindings) {
- return (interopType === 'esModule' ||
- (externalLiveBindings && (interopType === 'auto' || interopType === 'true')));
- }
- const namespaceInteropHelpersByInteropType = {
- auto: INTEROP_NAMESPACE_VARIABLE,
- default: INTEROP_NAMESPACE_DEFAULT_VARIABLE,
- defaultOnly: INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE,
- esModule: null,
- false: null,
- true: INTEROP_NAMESPACE_VARIABLE
- };
- function canDefaultBeTakenFromNamespace(interopType, externalLiveBindings) {
- return (isDefaultAProperty(interopType, externalLiveBindings) &&
- defaultInteropHelpersByInteropType[interopType] === INTEROP_DEFAULT_VARIABLE);
- }
- function getDefaultOnlyHelper() {
- return INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE;
- }
- function getHelpersBlock(usedHelpers, accessedGlobals, _, n, s, t, liveBindings, freeze, namespaceToStringTag) {
- return HELPER_NAMES.map(variable => usedHelpers.has(variable) || accessedGlobals.has(variable)
- ? HELPER_GENERATORS[variable](_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers)
- : '').join('');
- }
- const HELPER_GENERATORS = {
- [INTEROP_DEFAULT_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_VARIABLE}${_}(e)${_}{${_}return ` +
- `e${_}&&${_}e.__esModule${_}?${_}` +
- `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
- [INTEROP_DEFAULT_LEGACY_VARIABLE]: (_, n, s, _t, liveBindings) => `function ${INTEROP_DEFAULT_LEGACY_VARIABLE}${_}(e)${_}{${_}return ` +
- `e${_}&&${_}typeof e${_}===${_}'object'${_}&&${_}'default'${_}in e${_}?${_}` +
- `${liveBindings ? getDefaultLiveBinding(_) : getDefaultStatic(_)}${s}${_}}${n}${n}`,
- [INTEROP_NAMESPACE_VARIABLE]: (_, n, s, t, liveBindings, freeze, namespaceToStringTag, usedHelpers) => `function ${INTEROP_NAMESPACE_VARIABLE}(e)${_}{${n}` +
- (usedHelpers.has(INTEROP_NAMESPACE_DEFAULT_VARIABLE)
- ? `${t}return e${_}&&${_}e.__esModule${_}?${_}e${_}:${_}${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${s}${n}`
- : `${t}if${_}(e${_}&&${_}e.__esModule)${_}return e;${n}` +
- createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag)) +
- `}${n}${n}`,
- [INTEROP_NAMESPACE_DEFAULT_VARIABLE]: (_, n, _s, t, liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_VARIABLE}(e)${_}{${n}` +
- createNamespaceObject(_, n, t, t, liveBindings, freeze, namespaceToStringTag) +
- `}${n}${n}`,
- [INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE]: (_, n, _s, t, _liveBindings, freeze, namespaceToStringTag) => `function ${INTEROP_NAMESPACE_DEFAULT_ONLY_VARIABLE}(e)${_}{${n}` +
- `${t}return ${getFrozen(`{__proto__: null,${namespaceToStringTag ? `${_}[Symbol.toStringTag]:${_}'Module',` : ''}${_}'default':${_}e}`, freeze)};${n}` +
- `}${n}${n}`
- };
- function getDefaultLiveBinding(_) {
- return `e${_}:${_}{${_}'default':${_}e${_}}`;
- }
- function getDefaultStatic(_) {
- return `e['default']${_}:${_}e`;
- }
- function createNamespaceObject(_, n, t, i, liveBindings, freeze, namespaceToStringTag) {
- return (`${i}var n${_}=${_}${namespaceToStringTag
- ? `{__proto__:${_}null,${_}[Symbol.toStringTag]:${_}'Module'}`
- : 'Object.create(null)'};${n}` +
- `${i}if${_}(e)${_}{${n}` +
- `${i}${t}Object.keys(e).forEach(function${_}(k)${_}{${n}` +
- (liveBindings ? copyPropertyLiveBinding : copyPropertyStatic)(_, n, t, i + t + t) +
- `${i}${t}});${n}` +
- `${i}}${n}` +
- `${i}n['default']${_}=${_}e;${n}` +
- `${i}return ${getFrozen('n', freeze)};${n}`);
- }
- function copyPropertyLiveBinding(_, n, t, i) {
- return (`${i}if${_}(k${_}!==${_}'default')${_}{${n}` +
- `${i}${t}var d${_}=${_}Object.getOwnPropertyDescriptor(e,${_}k);${n}` +
- `${i}${t}Object.defineProperty(n,${_}k,${_}d.get${_}?${_}d${_}:${_}{${n}` +
- `${i}${t}${t}enumerable:${_}true,${n}` +
- `${i}${t}${t}get:${_}function${_}()${_}{${n}` +
- `${i}${t}${t}${t}return e[k];${n}` +
- `${i}${t}${t}}${n}` +
- `${i}${t}});${n}` +
- `${i}}${n}`);
- }
- function copyPropertyStatic(_, n, _t, i) {
- return `${i}n[k]${_}=${_}e[k];${n}`;
- }
- function getFrozen(fragment, freeze) {
- return freeze ? `Object.freeze(${fragment})` : fragment;
- }
- const HELPER_NAMES = Object.keys(HELPER_GENERATORS);
- function getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, mechanism = 'return ') {
- const _ = compact ? '' : ' ';
- const n = compact ? '' : '\n';
- if (!namedExportsMode) {
- return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings)};`;
- }
- let exportBlock = '';
- for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
- if (reexports && namedExportsMode) {
- for (const specifier of reexports) {
- if (specifier.reexported !== '*') {
- const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
- if (exportBlock)
- exportBlock += n;
- exportBlock +=
- specifier.imported !== '*' && specifier.needsLiveBinding
- ? `Object.defineProperty(exports,${_}'${specifier.reexported}',${_}{${n}` +
- `${t}enumerable:${_}true,${n}` +
- `${t}get:${_}function${_}()${_}{${n}` +
- `${t}${t}return ${importName};${n}${t}}${n}});`
- : `exports.${specifier.reexported}${_}=${_}${importName};`;
- }
- }
- }
- }
- for (const chunkExport of exports) {
- const lhs = `exports.${chunkExport.exported}`;
- const rhs = chunkExport.local;
- if (lhs !== rhs) {
- if (exportBlock)
- exportBlock += n;
- exportBlock += `${lhs}${_}=${_}${rhs};`;
- }
- }
- for (const { name, reexports } of dependencies) {
- if (reexports && namedExportsMode) {
- for (const specifier of reexports) {
- if (specifier.reexported === '*') {
- if (exportBlock)
- exportBlock += n;
- if (specifier.needsLiveBinding) {
- exportBlock +=
- `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
- `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}Object.defineProperty(exports,${_}k,${_}{${n}` +
- `${t}${t}enumerable:${_}true,${n}` +
- `${t}${t}get:${_}function${_}()${_}{${n}` +
- `${t}${t}${t}return ${name}[k];${n}` +
- `${t}${t}}${n}${t}});${n}});`;
- }
- else {
- exportBlock +=
- `Object.keys(${name}).forEach(function${_}(k)${_}{${n}` +
- `${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}exports[k]${_}=${_}${name}[k];${n}});`;
- }
- }
- }
- }
- }
- if (exportBlock) {
- return `${n}${n}${exportBlock}`;
- }
- return '';
- }
- function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings) {
- if (exports.length > 0) {
- return exports[0].local;
- }
- else {
- for (const { defaultVariableName, id, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
- if (reexports) {
- return getReexportedImportName(name, reexports[0].imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, id, externalLiveBindings);
- }
- }
- }
- }
- function getReexportedImportName(moduleVariableName, imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, moduleId, externalLiveBindings) {
- if (imported === 'default') {
- if (!isChunk) {
- const moduleInterop = String(interop(moduleId));
- const variableName = defaultInteropHelpersByInteropType[moduleInterop]
- ? defaultVariableName
- : moduleVariableName;
- return isDefaultAProperty(moduleInterop, externalLiveBindings)
- ? `${variableName}['default']`
- : variableName;
- }
- return depNamedExportsMode ? `${moduleVariableName}['default']` : moduleVariableName;
- }
- if (imported === '*') {
- return (isChunk
- ? !depNamedExportsMode
- : namespaceInteropHelpersByInteropType[String(interop(moduleId))])
- ? namespaceVariableName
- : moduleVariableName;
- }
- return `${moduleVariableName}.${imported}`;
- }
- function getEsModuleExport(_) {
- return `Object.defineProperty(exports,${_}'__esModule',${_}{${_}value:${_}true${_}});`;
- }
- function getNamespaceToStringExport(_) {
- return `exports[Symbol.toStringTag]${_}=${_}'Module';`;
- }
- function getNamespaceMarkers(hasNamedExports, addEsModule, addNamespaceToStringTag, _, n) {
- let namespaceMarkers = '';
- if (hasNamedExports) {
- if (addEsModule) {
- namespaceMarkers += getEsModuleExport(_);
- }
- if (addNamespaceToStringTag) {
- if (namespaceMarkers) {
- namespaceMarkers += n;
- }
- namespaceMarkers += getNamespaceToStringExport(_);
- }
- }
- return namespaceMarkers;
- }
- function getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t) {
- const neededInteropHelpers = new Set();
- const interopStatements = [];
- const addInteropStatement = (helperVariableName, helper, dependencyVariableName) => {
- neededInteropHelpers.add(helper);
- interopStatements.push(`${varOrConst} ${helperVariableName}${_}=${_}/*#__PURE__*/${helper}(${dependencyVariableName});`);
- };
- for (const { defaultVariableName, imports, id, isChunk, name, namedExportsMode, namespaceVariableName, reexports } of dependencies) {
- if (isChunk) {
- for (const { imported, reexported } of [
- ...(imports || []),
- ...(reexports || [])
- ]) {
- if (imported === '*' && reexported !== '*') {
- if (!namedExportsMode) {
- addInteropStatement(namespaceVariableName, getDefaultOnlyHelper(), name);
- }
- break;
- }
- }
- }
- else {
- const moduleInterop = String(interop(id));
- let hasDefault = false;
- let hasNamespace = false;
- for (const { imported, reexported } of [
- ...(imports || []),
- ...(reexports || [])
- ]) {
- let helper;
- let variableName;
- if (imported === 'default') {
- if (!hasDefault) {
- hasDefault = true;
- if (defaultVariableName !== namespaceVariableName) {
- variableName = defaultVariableName;
- helper = defaultInteropHelpersByInteropType[moduleInterop];
- }
- }
- }
- else if (imported === '*' && reexported !== '*') {
- if (!hasNamespace) {
- hasNamespace = true;
- helper = namespaceInteropHelpersByInteropType[moduleInterop];
- variableName = namespaceVariableName;
- }
- }
- if (helper) {
- addInteropStatement(variableName, helper, name);
- }
- }
- }
- }
- return `${getHelpersBlock(neededInteropHelpers, accessedGlobals, _, n, s, t, externalLiveBindings, freeze, namespaceToStringTag)}${interopStatements.length > 0 ? `${interopStatements.join(n)}${n}${n}` : ''}`;
- }
- // AMD resolution will only respect the AMD baseUrl if the .js extension is omitted.
- // The assumption is that this makes sense for all relative ids:
- // https://requirejs.org/docs/api.html#jsfiles
- function removeExtensionFromRelativeAmdId(id) {
- return id[0] === '.' ? removeJsExtension(id) : id;
- }
- const builtins$6 = {
- assert: true,
- buffer: true,
- console: true,
- constants: true,
- domain: true,
- events: true,
- http: true,
- https: true,
- os: true,
- path: true,
- process: true,
- punycode: true,
- querystring: true,
- stream: true,
- string_decoder: true,
- timers: true,
- tty: true,
- url: true,
- util: true,
- vm: true,
- zlib: true
- };
- function warnOnBuiltins(warn, dependencies) {
- const externalBuiltins = dependencies.map(({ id }) => id).filter(id => id in builtins$6);
- if (!externalBuiltins.length)
- return;
- const detail = externalBuiltins.length === 1
- ? `module ('${externalBuiltins[0]}')`
- : `modules (${externalBuiltins
- .slice(0, -1)
- .map(name => `'${name}'`)
- .join(', ')} and '${externalBuiltins.slice(-1)}')`;
- warn({
- code: 'MISSING_NODE_BUILTINS',
- message: `Creating a browser bundle that depends on Node.js built-in ${detail}. You might need to include https://github.com/ionic-team/rollup-plugin-node-polyfills`,
- modules: externalBuiltins
- });
- }
- function amd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
- warnOnBuiltins(warn, dependencies);
- const deps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
- const args = dependencies.map(m => m.name);
- const n = compact ? '' : '\n';
- const s = compact ? '' : ';';
- const _ = compact ? '' : ' ';
- if (namedExportsMode && hasExports) {
- args.unshift(`exports`);
- deps.unshift(`'exports'`);
- }
- if (accessedGlobals.has('require')) {
- args.unshift('require');
- deps.unshift(`'require'`);
- }
- if (accessedGlobals.has('module')) {
- args.unshift('module');
- deps.unshift(`'module'`);
- }
- const completeAmdId = getCompleteAmdId(amd, id);
- const params = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
- (deps.length ? `[${deps.join(`,${_}`)}],${_}` : ``);
- const useStrict = strict ? `${_}'use strict';` : '';
- magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
- let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
- if (namespaceMarkers) {
- namespaceMarkers = n + n + namespaceMarkers;
- }
- magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
- return magicString
- .indent(t)
- .prepend(`${amd.define}(${params}function${_}(${args.join(`,${_}`)})${_}{${useStrict}${n}${n}`)
- .append(`${n}${n}});`);
- }
- function cjs$1(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, varOrConst }, { compact, esModule, externalLiveBindings, freeze, interop, namespaceToStringTag, strict }) {
- const n = compact ? '' : '\n';
- const s = compact ? '' : ';';
- const _ = compact ? '' : ' ';
- const useStrict = strict ? `'use strict';${n}${n}` : '';
- let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && esModule, isModuleFacade && namespaceToStringTag, _, n);
- if (namespaceMarkers) {
- namespaceMarkers += n + n;
- }
- const importBlock = getImportBlock$1(dependencies, compact, varOrConst, n, _);
- const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
- magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings, `module.exports${_}=${_}`);
- return magicString.append(`${exportBlock}${outro}`);
- }
- function getImportBlock$1(dependencies, compact, varOrConst, n, _) {
- let importBlock = '';
- let definingVariable = false;
- for (const { id, name, reexports, imports } of dependencies) {
- if (!reexports && !imports) {
- if (importBlock) {
- importBlock += !compact || definingVariable ? `;${n}` : ',';
- }
- definingVariable = false;
- importBlock += `require('${id}')`;
- }
- else {
- importBlock +=
- compact && definingVariable ? ',' : `${importBlock ? `;${n}` : ''}${varOrConst} `;
- definingVariable = true;
- importBlock += `${name}${_}=${_}require('${id}')`;
- }
- }
- if (importBlock) {
- return `${importBlock};${n}${n}`;
- }
- return '';
- }
- function es(magicString, { intro, outro, dependencies, exports, varOrConst }, { compact }) {
- const _ = compact ? '' : ' ';
- const n = compact ? '' : '\n';
- const importBlock = getImportBlock(dependencies, _);
- if (importBlock.length > 0)
- intro += importBlock.join(n) + n + n;
- if (intro)
- magicString.prepend(intro);
- const exportBlock = getExportBlock(exports, _, varOrConst);
- if (exportBlock.length)
- magicString.append(n + n + exportBlock.join(n).trim());
- if (outro)
- magicString.append(outro);
- return magicString.trim();
- }
- function getImportBlock(dependencies, _) {
- const importBlock = [];
- for (const { id, reexports, imports, name } of dependencies) {
- if (!reexports && !imports) {
- importBlock.push(`import${_}'${id}';`);
- continue;
- }
- if (imports) {
- let defaultImport = null;
- let starImport = null;
- const importedNames = [];
- for (const specifier of imports) {
- if (specifier.imported === 'default') {
- defaultImport = specifier;
- }
- else if (specifier.imported === '*') {
- starImport = specifier;
- }
- else {
- importedNames.push(specifier);
- }
- }
- if (starImport) {
- importBlock.push(`import${_}*${_}as ${starImport.local} from${_}'${id}';`);
- }
- if (defaultImport && importedNames.length === 0) {
- importBlock.push(`import ${defaultImport.local} from${_}'${id}';`);
- }
- else if (importedNames.length > 0) {
- importBlock.push(`import ${defaultImport ? `${defaultImport.local},${_}` : ''}{${_}${importedNames
- .map(specifier => {
- if (specifier.imported === specifier.local) {
- return specifier.imported;
- }
- else {
- return `${specifier.imported} as ${specifier.local}`;
- }
- })
- .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
- }
- }
- if (reexports) {
- let starExport = null;
- const namespaceReexports = [];
- const namedReexports = [];
- for (const specifier of reexports) {
- if (specifier.reexported === '*') {
- starExport = specifier;
- }
- else if (specifier.imported === '*') {
- namespaceReexports.push(specifier);
- }
- else {
- namedReexports.push(specifier);
- }
- }
- if (starExport) {
- importBlock.push(`export${_}*${_}from${_}'${id}';`);
- }
- if (namespaceReexports.length > 0) {
- if (!imports ||
- !imports.some(specifier => specifier.imported === '*' && specifier.local === name)) {
- importBlock.push(`import${_}*${_}as ${name} from${_}'${id}';`);
- }
- for (const specifier of namespaceReexports) {
- importBlock.push(`export${_}{${_}${name === specifier.reexported ? name : `${name} as ${specifier.reexported}`} };`);
- }
- }
- if (namedReexports.length > 0) {
- importBlock.push(`export${_}{${_}${namedReexports
- .map(specifier => {
- if (specifier.imported === specifier.reexported) {
- return specifier.imported;
- }
- else {
- return `${specifier.imported} as ${specifier.reexported}`;
- }
- })
- .join(`,${_}`)}${_}}${_}from${_}'${id}';`);
- }
- }
- }
- return importBlock;
- }
- function getExportBlock(exports, _, varOrConst) {
- const exportBlock = [];
- const exportDeclaration = [];
- for (const specifier of exports) {
- if (specifier.exported === 'default') {
- exportBlock.push(`export default ${specifier.local};`);
- }
- else {
- if (specifier.expression) {
- exportBlock.push(`${varOrConst} ${specifier.local}${_}=${_}${specifier.expression};`);
- }
- exportDeclaration.push(specifier.exported === specifier.local
- ? specifier.local
- : `${specifier.local} as ${specifier.exported}`);
- }
- }
- if (exportDeclaration.length) {
- exportBlock.push(`export${_}{${_}${exportDeclaration.join(`,${_}`)}${_}};`);
- }
- return exportBlock;
- }
- function spaces(i) {
- let result = '';
- while (i--)
- result += ' ';
- return result;
- }
- function tabsToSpaces(str) {
- return str.replace(/^\t+/, match => match.split('\t').join(' '));
- }
- function getCodeFrame(source, line, column) {
- let lines = source.split('\n');
- const frameStart = Math.max(0, line - 3);
- let frameEnd = Math.min(line + 2, lines.length);
- lines = lines.slice(frameStart, frameEnd);
- while (!/\S/.test(lines[lines.length - 1])) {
- lines.pop();
- frameEnd -= 1;
- }
- const digits = String(frameEnd).length;
- return lines
- .map((str, i) => {
- const isErrorLine = frameStart + i + 1 === line;
- let lineNum = String(i + frameStart + 1);
- while (lineNum.length < digits)
- lineNum = ` ${lineNum}`;
- if (isErrorLine) {
- const indicator = spaces(digits + 2 + tabsToSpaces(str.slice(0, column)).length) + '^';
- return `${lineNum}: ${tabsToSpaces(str)}\n${indicator}`;
- }
- return `${lineNum}: ${tabsToSpaces(str)}`;
- })
- .join('\n');
- }
- function sanitizeFileName(name) {
- const match = /^[a-z]:/i.exec(name);
- const driveLetter = match ? match[0] : "";
- // A `:` is only allowed as part of a windows drive letter (ex: C:\foo)
- // Otherwise, avoid them because they can refer to NTFS alternate data streams.
- return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_');
- }
- function getAliasName(id) {
- const base = basename(id);
- return base.substr(0, base.length - extname$1(id).length);
- }
- function relativeId(id) {
- if (!isAbsolute(id))
- return id;
- return relative$1(resolve$1(), id);
- }
- function isPlainPathFragment(name) {
- // not starting with "/", "./", "../"
- return (name[0] !== '/' &&
- !(name[0] === '.' && (name[1] === '/' || name[1] === '.')) &&
- sanitizeFileName(name) === name &&
- !isAbsolute(name));
- }
- function error(base) {
- if (!(base instanceof Error))
- base = Object.assign(new Error(base.message), base);
- throw base;
- }
- function augmentCodeLocation(props, pos, source, id) {
- if (typeof pos === 'object') {
- const { line, column } = pos;
- props.loc = { file: id, line, column };
- }
- else {
- props.pos = pos;
- const { line, column } = locate(source, pos, { offsetLine: 1 });
- props.loc = { file: id, line, column };
- }
- if (props.frame === undefined) {
- const { line, column } = props.loc;
- props.frame = getCodeFrame(source, line, column);
- }
- }
- var Errors;
- (function (Errors) {
- Errors["ALREADY_CLOSED"] = "ALREADY_CLOSED";
- Errors["ASSET_NOT_FINALISED"] = "ASSET_NOT_FINALISED";
- Errors["ASSET_NOT_FOUND"] = "ASSET_NOT_FOUND";
- Errors["ASSET_SOURCE_ALREADY_SET"] = "ASSET_SOURCE_ALREADY_SET";
- Errors["ASSET_SOURCE_MISSING"] = "ASSET_SOURCE_MISSING";
- Errors["BAD_LOADER"] = "BAD_LOADER";
- Errors["CANNOT_EMIT_FROM_OPTIONS_HOOK"] = "CANNOT_EMIT_FROM_OPTIONS_HOOK";
- Errors["CHUNK_NOT_GENERATED"] = "CHUNK_NOT_GENERATED";
- Errors["CHUNK_INVALID"] = "CHUNK_INVALID";
- Errors["CIRCULAR_REEXPORT"] = "CIRCULAR_REEXPORT";
- Errors["CYCLIC_CROSS_CHUNK_REEXPORT"] = "CYCLIC_CROSS_CHUNK_REEXPORT";
- Errors["DEPRECATED_FEATURE"] = "DEPRECATED_FEATURE";
- Errors["EXTERNAL_SYNTHETIC_EXPORTS"] = "EXTERNAL_SYNTHETIC_EXPORTS";
- Errors["FILE_NAME_CONFLICT"] = "FILE_NAME_CONFLICT";
- Errors["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
- Errors["INPUT_HOOK_IN_OUTPUT_PLUGIN"] = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
- Errors["INVALID_CHUNK"] = "INVALID_CHUNK";
- Errors["INVALID_EXPORT_OPTION"] = "INVALID_EXPORT_OPTION";
- Errors["INVALID_EXTERNAL_ID"] = "INVALID_EXTERNAL_ID";
- Errors["INVALID_OPTION"] = "INVALID_OPTION";
- Errors["INVALID_PLUGIN_HOOK"] = "INVALID_PLUGIN_HOOK";
- Errors["INVALID_ROLLUP_PHASE"] = "INVALID_ROLLUP_PHASE";
- Errors["MISSING_EXPORT"] = "MISSING_EXPORT";
- Errors["MISSING_IMPLICIT_DEPENDANT"] = "MISSING_IMPLICIT_DEPENDANT";
- Errors["MIXED_EXPORTS"] = "MIXED_EXPORTS";
- Errors["NAMESPACE_CONFLICT"] = "NAMESPACE_CONFLICT";
- Errors["NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE"] = "NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE";
- Errors["PLUGIN_ERROR"] = "PLUGIN_ERROR";
- Errors["PREFER_NAMED_EXPORTS"] = "PREFER_NAMED_EXPORTS";
- Errors["SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT"] = "SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT";
- Errors["UNEXPECTED_NAMED_IMPORT"] = "UNEXPECTED_NAMED_IMPORT";
- Errors["UNRESOLVED_ENTRY"] = "UNRESOLVED_ENTRY";
- Errors["UNRESOLVED_IMPORT"] = "UNRESOLVED_IMPORT";
- Errors["VALIDATION_ERROR"] = "VALIDATION_ERROR";
- })(Errors || (Errors = {}));
- function errAssetNotFinalisedForFileName(name) {
- return {
- code: Errors.ASSET_NOT_FINALISED,
- message: `Plugin error - Unable to get file name for asset "${name}". Ensure that the source is set and that generate is called first.`
- };
- }
- function errCannotEmitFromOptionsHook() {
- return {
- code: Errors.CANNOT_EMIT_FROM_OPTIONS_HOOK,
- message: `Cannot emit files or set asset sources in the "outputOptions" hook, use the "renderStart" hook instead.`
- };
- }
- function errChunkNotGeneratedForFileName(name) {
- return {
- code: Errors.CHUNK_NOT_GENERATED,
- message: `Plugin error - Unable to get file name for chunk "${name}". Ensure that generate is called first.`
- };
- }
- function errChunkInvalid({ fileName, code }, exception) {
- const errorProps = {
- code: Errors.CHUNK_INVALID,
- message: `Chunk "${fileName}" is not valid JavaScript: ${exception.message}.`
- };
- augmentCodeLocation(errorProps, exception.loc, code, fileName);
- return errorProps;
- }
- function errCircularReexport(exportName, importedModule) {
- return {
- code: Errors.CIRCULAR_REEXPORT,
- id: importedModule,
- message: `"${exportName}" cannot be exported from ${relativeId(importedModule)} as it is a reexport that references itself.`
- };
- }
- function errCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) {
- return {
- code: Errors.CYCLIC_CROSS_CHUNK_REEXPORT,
- exporter,
- importer,
- message: `Export "${exportName}" of module ${relativeId(exporter)} was reexported through module ${relativeId(reexporter)} while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in ${relativeId(importer)} to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
- reexporter
- };
- }
- function errAssetReferenceIdNotFoundForSetSource(assetReferenceId) {
- return {
- code: Errors.ASSET_NOT_FOUND,
- message: `Plugin error - Unable to set the source for unknown asset "${assetReferenceId}".`
- };
- }
- function errAssetSourceAlreadySet(name) {
- return {
- code: Errors.ASSET_SOURCE_ALREADY_SET,
- message: `Unable to set the source for asset "${name}", source already set.`
- };
- }
- function errNoAssetSourceSet(assetName) {
- return {
- code: Errors.ASSET_SOURCE_MISSING,
- message: `Plugin error creating asset "${assetName}" - no asset source set.`
- };
- }
- function errBadLoader(id) {
- return {
- code: Errors.BAD_LOADER,
- message: `Error loading ${relativeId(id)}: plugin load hook should return a string, a { code, map } object, or nothing/null`
- };
- }
- function errDeprecation(deprecation) {
- return {
- code: Errors.DEPRECATED_FEATURE,
- ...(typeof deprecation === 'string' ? { message: deprecation } : deprecation)
- };
- }
- function errFileReferenceIdNotFoundForFilename(assetReferenceId) {
- return {
- code: Errors.FILE_NOT_FOUND,
- message: `Plugin error - Unable to get file name for unknown file "${assetReferenceId}".`
- };
- }
- function errFileNameConflict(fileName) {
- return {
- code: Errors.FILE_NAME_CONFLICT,
- message: `The emitted file "${fileName}" overwrites a previously emitted file of the same name.`
- };
- }
- function errInputHookInOutputPlugin(pluginName, hookName) {
- return {
- code: Errors.INPUT_HOOK_IN_OUTPUT_PLUGIN,
- message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
- };
- }
- function errCannotAssignModuleToChunk(moduleId, assignToAlias, currentAlias) {
- return {
- code: Errors.INVALID_CHUNK,
- message: `Cannot assign ${relativeId(moduleId)} to the "${assignToAlias}" chunk as it is already in the "${currentAlias}" chunk.`
- };
- }
- function errInvalidExportOptionValue(optionValue) {
- return {
- code: Errors.INVALID_EXPORT_OPTION,
- message: `"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "${optionValue}"`,
- url: `https://rollupjs.org/guide/en/#outputexports`
- };
- }
- function errIncompatibleExportOptionValue(optionValue, keys, entryModule) {
- return {
- code: 'INVALID_EXPORT_OPTION',
- message: `"${optionValue}" was specified for "output.exports", but entry module "${relativeId(entryModule)}" has the following exports: ${keys.join(', ')}`
- };
- }
- function errInternalIdCannotBeExternal(source, importer) {
- return {
- code: Errors.INVALID_EXTERNAL_ID,
- message: `'${source}' is imported as an external by ${relativeId(importer)}, but is already an existing non-external module id.`
- };
- }
- function errInvalidOption(option, explanation) {
- return {
- code: Errors.INVALID_OPTION,
- message: `Invalid value for option "${option}" - ${explanation}.`
- };
- }
- function errInvalidRollupPhaseForAddWatchFile() {
- return {
- code: Errors.INVALID_ROLLUP_PHASE,
- message: `Cannot call addWatchFile after the build has finished.`
- };
- }
- function errInvalidRollupPhaseForChunkEmission() {
- return {
- code: Errors.INVALID_ROLLUP_PHASE,
- message: `Cannot emit chunks after module loading has finished.`
- };
- }
- function errMissingExport(exportName, importingModule, importedModule) {
- return {
- code: Errors.MISSING_EXPORT,
- message: `'${exportName}' is not exported by ${relativeId(importedModule)}, imported by ${relativeId(importingModule)}`,
- url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
- };
- }
- function errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore) {
- return {
- code: Errors.MISSING_IMPLICIT_DEPENDANT,
- message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" cannot be external.`
- };
- }
- function errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore) {
- return {
- code: Errors.MISSING_IMPLICIT_DEPENDANT,
- message: `Module "${relativeId(unresolvedId)}" that should be implicitly loaded before "${relativeId(implicitlyLoadedBefore)}" could not be resolved.`
- };
- }
- function errImplicitDependantIsNotIncluded(module) {
- const implicitDependencies = Array.from(module.implicitlyLoadedBefore, dependency => relativeId(dependency.id)).sort();
- return {
- code: Errors.MISSING_IMPLICIT_DEPENDANT,
- message: `Module "${relativeId(module.id)}" that should be implicitly loaded before "${implicitDependencies.length === 1
- ? implicitDependencies[0]
- : `${implicitDependencies.slice(0, -1).join('", "')}" and "${implicitDependencies.slice(-1)[0]}`}" is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
- };
- }
- function errMixedExport(facadeModuleId, name) {
- return {
- code: Errors.MIXED_EXPORTS,
- id: facadeModuleId,
- message: `Entry module "${relativeId(facadeModuleId)}" is using named and default exports together. Consumers of your bundle will have to use \`${name || 'chunk'}["default"]\` to access the default export, which may not be what you want. Use \`output.exports: "named"\` to disable this warning`,
- url: `https://rollupjs.org/guide/en/#outputexports`
- };
- }
- function errNamespaceConflict(name, reexportingModule, additionalExportAllModule) {
- return {
- code: Errors.NAMESPACE_CONFLICT,
- message: `Conflicting namespaces: ${relativeId(reexportingModule.id)} re-exports '${name}' from both ${relativeId(reexportingModule.exportsAll[name])} and ${relativeId(additionalExportAllModule.exportsAll[name])} (will be ignored)`,
- name,
- reexporter: reexportingModule.id,
- sources: [reexportingModule.exportsAll[name], additionalExportAllModule.exportsAll[name]]
- };
- }
- function errNoTransformMapOrAstWithoutCode(pluginName) {
- return {
- code: Errors.NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE,
- message: `The plugin "${pluginName}" returned a "map" or "ast" without returning ` +
- 'a "code". This will be ignored.'
- };
- }
- function errPreferNamedExports(facadeModuleId) {
- const file = relativeId(facadeModuleId);
- return {
- code: Errors.PREFER_NAMED_EXPORTS,
- id: facadeModuleId,
- message: `Entry module "${file}" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "${file}" to use named exports only.`,
- url: `https://rollupjs.org/guide/en/#outputexports`
- };
- }
- function errSyntheticNamedExportsNeedNamespaceExport(id, syntheticNamedExportsOption) {
- return {
- code: Errors.SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT,
- id,
- message: `Module "${relativeId(id)}" that is marked with 'syntheticNamedExports: ${JSON.stringify(syntheticNamedExportsOption)}' needs ${typeof syntheticNamedExportsOption === 'string' && syntheticNamedExportsOption !== 'default'
- ? `an export named "${syntheticNamedExportsOption}"`
- : 'a default export'} that does not reexport an unresolved named export of the same module.`
- };
- }
- function errUnexpectedNamedImport(id, imported, isReexport) {
- const importType = isReexport ? 'reexport' : 'import';
- return {
- code: Errors.UNEXPECTED_NAMED_IMPORT,
- id,
- message: `The named export "${imported}" was ${importType}ed from the external module ${relativeId(id)} even though its interop type is "defaultOnly". Either remove or change this ${importType} or change the value of the "output.interop" option.`,
- url: 'https://rollupjs.org/guide/en/#outputinterop'
- };
- }
- function errUnexpectedNamespaceReexport(id) {
- return {
- code: Errors.UNEXPECTED_NAMED_IMPORT,
- id,
- message: `There was a namespace "*" reexport from the external module ${relativeId(id)} even though its interop type is "defaultOnly". This will be ignored as namespace reexports only reexport named exports. If this is not intended, either remove or change this reexport or change the value of the "output.interop" option.`,
- url: 'https://rollupjs.org/guide/en/#outputinterop'
- };
- }
- function errEntryCannotBeExternal(unresolvedId) {
- return {
- code: Errors.UNRESOLVED_ENTRY,
- message: `Entry module cannot be external (${relativeId(unresolvedId)}).`
- };
- }
- function errUnresolvedEntry(unresolvedId) {
- return {
- code: Errors.UNRESOLVED_ENTRY,
- message: `Could not resolve entry module (${relativeId(unresolvedId)}).`
- };
- }
- function errUnresolvedImport(source, importer) {
- return {
- code: Errors.UNRESOLVED_IMPORT,
- message: `Could not resolve '${source}' from ${relativeId(importer)}`
- };
- }
- function errUnresolvedImportTreatedAsExternal(source, importer) {
- return {
- code: Errors.UNRESOLVED_IMPORT,
- importer: relativeId(importer),
- message: `'${source}' is imported by ${relativeId(importer)}, but could not be resolved – treating it as an external dependency`,
- source,
- url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency'
- };
- }
- function errExternalSyntheticExports(source, importer) {
- return {
- code: Errors.EXTERNAL_SYNTHETIC_EXPORTS,
- importer: relativeId(importer),
- message: `External '${source}' can not have 'syntheticNamedExports' enabled.`,
- source
- };
- }
- function errFailedValidation(message) {
- return {
- code: Errors.VALIDATION_ERROR,
- message
- };
- }
- function errAlreadyClosed() {
- return {
- code: Errors.ALREADY_CLOSED,
- message: 'Bundle is already closed, no more calls to "generate" or "write" are allowed.'
- };
- }
- function warnDeprecation(deprecation, activeDeprecation, options) {
- warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
- }
- function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
- if (activeDeprecation || strictDeprecations) {
- const warning = errDeprecation(deprecation);
- if (strictDeprecations) {
- return error(warning);
- }
- warn(warning);
- }
- }
- // Generate strings which dereference dotted properties, but use array notation `['prop-deref']`
- // if the property name isn't trivial
- const shouldUseDot = /^[a-zA-Z$_][a-zA-Z0-9$_]*$/;
- function property(prop) {
- return shouldUseDot.test(prop) ? `.${prop}` : `['${prop}']`;
- }
- function keypath(keypath) {
- return keypath
- .split('.')
- .map(property)
- .join('');
- }
- function setupNamespace(name, root, globals, compact) {
- const _ = compact ? '' : ' ';
- const parts = name.split('.');
- parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
- parts.pop();
- let acc = root;
- return (parts
- .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}${compact ? '' : ';'}`))
- .join(compact ? ',' : '\n') + (compact && parts.length ? ';' : '\n'));
- }
- function assignToDeepVariable(deepName, root, globals, compact, assignment) {
- const _ = compact ? '' : ' ';
- const parts = deepName.split('.');
- parts[0] = (typeof globals === 'function' ? globals(parts[0]) : globals[parts[0]]) || parts[0];
- const last = parts.pop();
- let acc = root;
- let deepAssignment = parts
- .map(part => ((acc += property(part)), `${acc}${_}=${_}${acc}${_}||${_}{}`))
- .concat(`${acc}${property(last)}`)
- .join(`,${_}`)
- .concat(`${_}=${_}${assignment}`);
- if (parts.length > 0) {
- deepAssignment = `(${deepAssignment})`;
- }
- return deepAssignment;
- }
- function trimEmptyImports(dependencies) {
- let i = dependencies.length;
- while (i--) {
- const { imports, reexports } = dependencies[i];
- if (imports || reexports) {
- return dependencies.slice(0, i + 1);
- }
- }
- return [];
- }
- const thisProp = (name) => `this${keypath(name)}`;
- function iife(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }) {
- const _ = compact ? '' : ' ';
- const s = compact ? '' : ';';
- const n = compact ? '' : '\n';
- const isNamespaced = name && name.indexOf('.') !== -1;
- const useVariableAssignment = !extend && !isNamespaced;
- if (name && useVariableAssignment && !isLegal(name)) {
- return error({
- code: 'ILLEGAL_IDENTIFIER_AS_NAME',
- message: `Given name "${name}" is not a legal JS identifier. If you need this, you can try "output.extend: true".`
- });
- }
- warnOnBuiltins(warn, dependencies);
- const external = trimEmptyImports(dependencies);
- const deps = external.map(dep => dep.globalName || 'null');
- const args = external.map(m => m.name);
- if (hasExports && !name) {
- warn({
- code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
- message: `If you do not supply "output.name", you may not be able to access the exports of an IIFE bundle.`
- });
- }
- if (namedExportsMode && hasExports) {
- if (extend) {
- deps.unshift(`${thisProp(name)}${_}=${_}${thisProp(name)}${_}||${_}{}`);
- args.unshift('exports');
- }
- else {
- deps.unshift('{}');
- args.unshift('exports');
- }
- }
- const useStrict = strict ? `${t}'use strict';${n}` : '';
- const interopBlock = getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t);
- magicString.prepend(`${intro}${interopBlock}`);
- let wrapperIntro = `(function${_}(${args.join(`,${_}`)})${_}{${n}${useStrict}${n}`;
- if (hasExports) {
- if (name && !(extend && namedExportsMode)) {
- wrapperIntro =
- (useVariableAssignment ? `${varOrConst} ${name}` : thisProp(name)) +
- `${_}=${_}${wrapperIntro}`;
- }
- if (isNamespaced) {
- wrapperIntro = setupNamespace(name, 'this', globals, compact) + wrapperIntro;
- }
- }
- let wrapperOutro = `${n}${n}}(${deps.join(`,${_}`)}));`;
- if (hasExports && !extend && namedExportsMode) {
- wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
- }
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
- let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
- if (namespaceMarkers) {
- namespaceMarkers = n + n + namespaceMarkers;
- }
- magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
- return magicString.indent(t).prepend(wrapperIntro).append(wrapperOutro);
- }
- function getStarExcludes({ dependencies, exports }) {
- const starExcludes = new Set(exports.map(expt => expt.exported));
- if (!starExcludes.has('default'))
- starExcludes.add('default');
- // also include reexport names
- for (const { reexports } of dependencies) {
- if (reexports) {
- for (const reexport of reexports) {
- if (reexport.imported !== '*' && !starExcludes.has(reexport.reexported))
- starExcludes.add(reexport.reexported);
- }
- }
- }
- return starExcludes;
- }
- const getStarExcludesBlock = (starExcludes, varOrConst, _, t, n) => starExcludes
- ? `${n}${t}${varOrConst} _starExcludes${_}=${_}{${_}${[...starExcludes]
- .map(prop => `${prop}:${_}1`)
- .join(`,${_}`)}${_}};`
- : '';
- const getImportBindingsBlock = (importBindings, _, t, n) => (importBindings.length ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
- function getExportsBlock(exports, _, t, n) {
- if (exports.length === 0) {
- return '';
- }
- if (exports.length === 1) {
- return `${t}${t}${t}exports('${exports[0].name}',${_}${exports[0].value});${n}${n}`;
- }
- return (`${t}${t}${t}exports({${n}` +
- exports.map(({ name, value }) => `${t}${t}${t}${t}${name}:${_}${value}`).join(`,${n}`) +
- `${n}${t}${t}${t}});${n}${n}`);
- }
- const getHoistedExportsBlock = (exports, _, t, n) => getExportsBlock(exports
- .filter(expt => expt.hoisted || expt.uninitialized)
- .map(expt => ({ name: expt.exported, value: expt.uninitialized ? 'void 0' : expt.local })), _, t, n);
- const getMissingExportsBlock = (exports, _, t, n) => getExportsBlock(exports
- .filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)
- .map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), _, t, n);
- const getSyntheticExportsBlock = (exports, _, t, n) => getExportsBlock(exports
- .filter(expt => expt.expression)
- .map(expt => ({ name: expt.exported, value: expt.local })), _, t, n);
- function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indentString: t, intro, outro, usesTopLevelAwait, varOrConst }, options) {
- const n = options.compact ? '' : '\n';
- const _ = options.compact ? '' : ' ';
- const dependencyIds = dependencies.map(m => `'${m.id}'`);
- const importBindings = [];
- let starExcludes;
- const setters = [];
- for (const { imports, reexports } of dependencies) {
- const setter = [];
- if (imports) {
- for (const specifier of imports) {
- importBindings.push(specifier.local);
- if (specifier.imported === '*') {
- setter.push(`${specifier.local}${_}=${_}module;`);
- }
- else {
- setter.push(`${specifier.local}${_}=${_}module.${specifier.imported};`);
- }
- }
- }
- if (reexports) {
- let createdSetter = false;
- // bulk-reexport form
- if (reexports.length > 1 ||
- (reexports.length === 1 &&
- (reexports[0].reexported === '*' || reexports[0].imported === '*'))) {
- // star reexports
- for (const specifier of reexports) {
- if (specifier.reexported !== '*')
- continue;
- // need own exports list for deduping in star export case
- if (!starExcludes) {
- starExcludes = getStarExcludes({ dependencies, exports });
- }
- if (!createdSetter) {
- setter.push(`${varOrConst} _setter${_}=${_}{};`);
- createdSetter = true;
- }
- setter.push(`for${_}(var _$p${_}in${_}module)${_}{`);
- setter.push(`${t}if${_}(!_starExcludes[_$p])${_}_setter[_$p]${_}=${_}module[_$p];`);
- setter.push('}');
- }
- // star import reexport
- for (const specifier of reexports) {
- if (specifier.imported !== '*' || specifier.reexported === '*')
- continue;
- setter.push(`exports('${specifier.reexported}',${_}module);`);
- }
- // reexports
- for (const specifier of reexports) {
- if (specifier.reexported === '*' || specifier.imported === '*')
- continue;
- if (!createdSetter) {
- setter.push(`${varOrConst} _setter${_}=${_}{};`);
- createdSetter = true;
- }
- setter.push(`_setter.${specifier.reexported}${_}=${_}module.${specifier.imported};`);
- }
- if (createdSetter) {
- setter.push('exports(_setter);');
- }
- }
- else {
- // single reexport
- for (const specifier of reexports) {
- setter.push(`exports('${specifier.reexported}',${_}module.${specifier.imported});`);
- }
- }
- }
- setters.push(setter.join(`${n}${t}${t}${t}`));
- }
- const registeredName = options.name ? `'${options.name}',${_}` : '';
- const wrapperParams = accessedGlobals.has('module')
- ? `exports,${_}module`
- : hasExports
- ? 'exports'
- : '';
- let wrapperStart = `System.register(${registeredName}[` +
- dependencyIds.join(`,${_}`) +
- `],${_}function${_}(${wrapperParams})${_}{${n}${t}${options.strict ? "'use strict';" : ''}` +
- getStarExcludesBlock(starExcludes, varOrConst, _, t, n) +
- getImportBindingsBlock(importBindings, _, t, n) +
- `${n}${t}return${_}{${setters.length
- ? `${n}${t}${t}setters:${_}[${setters
- .map(s => s
- ? `function${_}(module)${_}{${n}${t}${t}${t}${s}${n}${t}${t}}`
- : options.systemNullSetters
- ? `null`
- : `function${_}()${_}{}`)
- .join(`,${_}`)}],`
- : ''}${n}`;
- wrapperStart +=
- `${t}${t}execute:${_}${usesTopLevelAwait ? `async${_}` : ''}function${_}()${_}{${n}${n}` +
- getHoistedExportsBlock(exports, _, t, n);
- const wrapperEnd = `${n}${n}` +
- getSyntheticExportsBlock(exports, _, t, n) +
- getMissingExportsBlock(exports, _, t, n) +
- `${t}${t}}${n}${t}}${options.compact ? '' : ';'}${n}});`;
- if (intro)
- magicString.prepend(intro);
- if (outro)
- magicString.append(outro);
- return magicString.indent(`${t}${t}${t}`).append(wrapperEnd).prepend(wrapperStart);
- }
- function globalProp(name, globalVar) {
- if (!name)
- return 'null';
- return `${globalVar}${keypath(name)}`;
- }
- function safeAccess(name, globalVar, _) {
- const parts = name.split('.');
- let acc = globalVar;
- return parts.map(part => (acc += property(part))).join(`${_}&&${_}`);
- }
- function umd(magicString, { accessedGlobals, dependencies, exports, hasExports, id, indentString: t, intro, namedExportsMode, outro, varOrConst, warn }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, namespaceToStringTag, globals, noConflict, strict }) {
- const _ = compact ? '' : ' ';
- const n = compact ? '' : '\n';
- const s = compact ? '' : ';';
- const factoryVar = compact ? 'f' : 'factory';
- const globalVar = compact ? 'g' : 'global';
- if (hasExports && !name) {
- return error({
- code: 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT',
- message: 'You must supply "output.name" for UMD bundles that have exports so that the exports are accessible in environments without a module loader.'
- });
- }
- warnOnBuiltins(warn, dependencies);
- const amdDeps = dependencies.map(m => `'${removeExtensionFromRelativeAmdId(m.id)}'`);
- const cjsDeps = dependencies.map(m => `require('${m.id}')`);
- const trimmedImports = trimEmptyImports(dependencies);
- const globalDeps = trimmedImports.map(module => globalProp(module.globalName, globalVar));
- const factoryArgs = trimmedImports.map(m => m.name);
- if (namedExportsMode && (hasExports || noConflict)) {
- amdDeps.unshift(`'exports'`);
- cjsDeps.unshift(`exports`);
- globalDeps.unshift(assignToDeepVariable(name, globalVar, globals, compact, `${extend ? `${globalProp(name, globalVar)}${_}||${_}` : ''}{}`));
- factoryArgs.unshift('exports');
- }
- const completeAmdId = getCompleteAmdId(amd, id);
- const amdParams = (completeAmdId ? `'${completeAmdId}',${_}` : ``) +
- (amdDeps.length ? `[${amdDeps.join(`,${_}`)}],${_}` : ``);
- const define = amd.define;
- const cjsExport = !namedExportsMode && hasExports ? `module.exports${_}=${_}` : ``;
- const useStrict = strict ? `${_}'use strict';${n}` : ``;
- let iifeExport;
- if (noConflict) {
- const noConflictExportsVar = compact ? 'e' : 'exports';
- let factory;
- if (!namedExportsMode && hasExports) {
- factory = `var ${noConflictExportsVar}${_}=${_}${assignToDeepVariable(name, globalVar, globals, compact, `${factoryVar}(${globalDeps.join(`,${_}`)})`)};`;
- }
- else {
- const module = globalDeps.shift();
- factory =
- `var ${noConflictExportsVar}${_}=${_}${module};${n}` +
- `${t}${t}${factoryVar}(${[noConflictExportsVar].concat(globalDeps).join(`,${_}`)});`;
- }
- iifeExport =
- `(function${_}()${_}{${n}` +
- `${t}${t}var current${_}=${_}${safeAccess(name, globalVar, _)};${n}` +
- `${t}${t}${factory}${n}` +
- `${t}${t}${noConflictExportsVar}.noConflict${_}=${_}function${_}()${_}{${_}` +
- `${globalProp(name, globalVar)}${_}=${_}current;${_}return ${noConflictExportsVar}${compact ? '' : '; '}};${n}` +
- `${t}}())`;
- }
- else {
- iifeExport = `${factoryVar}(${globalDeps.join(`,${_}`)})`;
- if (!namedExportsMode && hasExports) {
- iifeExport = assignToDeepVariable(name, globalVar, globals, compact, iifeExport);
- }
- }
- const iifeNeedsGlobal = hasExports || (noConflict && namedExportsMode) || globalDeps.length > 0;
- const globalParam = iifeNeedsGlobal ? `${globalVar},${_}` : '';
- const globalArg = iifeNeedsGlobal ? `this,${_}` : '';
- const iifeStart = iifeNeedsGlobal
- ? `(${globalVar}${_}=${_}typeof globalThis${_}!==${_}'undefined'${_}?${_}globalThis${_}:${_}${globalVar}${_}||${_}self,${_}`
- : '';
- const iifeEnd = iifeNeedsGlobal ? ')' : '';
- const cjsIntro = iifeNeedsGlobal
- ? `${t}typeof exports${_}===${_}'object'${_}&&${_}typeof module${_}!==${_}'undefined'${_}?` +
- `${_}${cjsExport}${factoryVar}(${cjsDeps.join(`,${_}`)})${_}:${n}`
- : '';
- // factory function should be wrapped by parentheses to avoid lazy parsing
- const wrapperIntro = `(function${_}(${globalParam}${factoryVar})${_}{${n}` +
- cjsIntro +
- `${t}typeof ${define}${_}===${_}'function'${_}&&${_}${define}.amd${_}?${_}${define}(${amdParams}${factoryVar})${_}:${n}` +
- `${t}${iifeStart}${iifeExport}${iifeEnd};${n}` +
- `}(${globalArg}(function${_}(${factoryArgs.join(', ')})${_}{${useStrict}${n}`;
- const wrapperOutro = n + n + '})));';
- magicString.prepend(`${intro}${getInteropBlock(dependencies, varOrConst, interop, externalLiveBindings, freeze, namespaceToStringTag, accessedGlobals, _, n, s, t)}`);
- const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, compact, t, externalLiveBindings);
- let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule, namespaceToStringTag, _, n);
- if (namespaceMarkers) {
- namespaceMarkers = n + n + namespaceMarkers;
- }
- magicString.append(`${exportBlock}${namespaceMarkers}${outro}`);
- return magicString.trim().indent(t).append(wrapperOutro).prepend(wrapperIntro);
- }
- var finalisers = { system, amd, cjs: cjs$1, es, iife, umd };
- const extractors$2 = {
- ArrayPattern(names, param) {
- for (const element of param.elements) {
- if (element)
- extractors$2[element.type](names, element);
- }
- },
- AssignmentPattern(names, param) {
- extractors$2[param.left.type](names, param.left);
- },
- Identifier(names, param) {
- names.push(param.name);
- },
- MemberExpression() { },
- ObjectPattern(names, param) {
- for (const prop of param.properties) {
- if (prop.type === 'RestElement') {
- extractors$2.RestElement(names, prop);
- }
- else {
- extractors$2[prop.value.type](names, prop.value);
- }
- }
- },
- RestElement(names, param) {
- extractors$2[param.argument.type](names, param.argument);
- }
- };
- const extractAssignedNames$2 = function extractAssignedNames(param) {
- const names = [];
- extractors$2[param.type](names, param);
- return names;
- };
- class ExportAllDeclaration extends NodeBase {
- hasEffects() {
- return false;
- }
- initialise() {
- this.context.addExport(this);
- }
- render(code, _options, nodeRenderOptions) {
- code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
- }
- }
- ExportAllDeclaration.prototype.needsBoundaries = true;
- class ArrayExpression extends NodeBase {
- bind() {
- super.bind();
- for (const element of this.elements) {
- if (element !== null)
- element.deoptimizePath(UNKNOWN_PATH);
- }
- }
- getReturnExpressionWhenCalledAtPath(path) {
- if (path.length !== 1)
- return UNKNOWN_EXPRESSION;
- return getMemberReturnExpressionWhenCalled(arrayMembers, path[0]);
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length === 1) {
- return hasMemberEffectWhenCalled(arrayMembers, path[0], this.included, callOptions, context);
- }
- return true;
- }
- }
- class ArrayPattern extends NodeBase {
- addExportedVariables(variables, exportNamesByVariable) {
- for (const element of this.elements) {
- if (element !== null) {
- element.addExportedVariables(variables, exportNamesByVariable);
- }
- }
- }
- declare(kind) {
- const variables = [];
- for (const element of this.elements) {
- if (element !== null) {
- variables.push(...element.declare(kind, UNKNOWN_EXPRESSION));
- }
- }
- return variables;
- }
- deoptimizePath(path) {
- if (path.length === 0) {
- for (const element of this.elements) {
- if (element !== null) {
- element.deoptimizePath(path);
- }
- }
- }
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (path.length > 0)
- return true;
- for (const element of this.elements) {
- if (element !== null && element.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
- return true;
- }
- return false;
- }
- }
- class BlockScope extends ChildScope {
- addDeclaration(identifier, context, init, isHoisted) {
- if (isHoisted) {
- return this.parent.addDeclaration(identifier, context, UNKNOWN_EXPRESSION, isHoisted);
- }
- else {
- return super.addDeclaration(identifier, context, init, false);
- }
- }
- }
- class ExpressionStatement extends NodeBase {
- initialise() {
- if (this.directive &&
- this.directive !== 'use strict' &&
- this.parent.type === Program$1) {
- this.context.warn(
- // This is necessary, because either way (deleting or not) can lead to errors.
- {
- code: 'MODULE_LEVEL_DIRECTIVE',
- message: `Module level directives cause errors when bundled, '${this.directive}' was ignored.`
- }, this.start);
- }
- }
- render(code, options) {
- super.render(code, options);
- if (this.included)
- this.insertSemicolon(code);
- }
- shouldBeIncluded(context) {
- if (this.directive && this.directive !== 'use strict')
- return this.parent.type !== Program$1;
- return super.shouldBeIncluded(context);
- }
- }
- class BlockStatement extends NodeBase {
- constructor() {
- super(...arguments);
- this.directlyIncluded = false;
- }
- addImplicitReturnExpressionToScope() {
- const lastStatement = this.body[this.body.length - 1];
- if (!lastStatement || lastStatement.type !== ReturnStatement$1) {
- this.scope.addReturnExpression(UNKNOWN_EXPRESSION);
- }
- }
- createScope(parentScope) {
- this.scope = this.parent.preventChildBlockScope
- ? parentScope
- : new BlockScope(parentScope);
- }
- hasEffects(context) {
- if (this.deoptimizeBody)
- return true;
- for (const node of this.body) {
- if (node.hasEffects(context))
- return true;
- if (context.brokenFlow)
- break;
- }
- return false;
- }
- include(context, includeChildrenRecursively) {
- if (!this.deoptimizeBody || !this.directlyIncluded) {
- this.included = true;
- this.directlyIncluded = true;
- if (this.deoptimizeBody)
- includeChildrenRecursively = true;
- for (const node of this.body) {
- if (includeChildrenRecursively || node.shouldBeIncluded(context))
- node.include(context, includeChildrenRecursively);
- }
- }
- }
- initialise() {
- const firstBodyStatement = this.body[0];
- this.deoptimizeBody =
- firstBodyStatement instanceof ExpressionStatement &&
- firstBodyStatement.directive === 'use asm';
- }
- render(code, options) {
- if (this.body.length) {
- renderStatementList(this.body, code, this.start + 1, this.end - 1, options);
- }
- else {
- super.render(code, options);
- }
- }
- }
- class ArrowFunctionExpression extends NodeBase {
- createScope(parentScope) {
- this.scope = new ReturnValueScope(parentScope, this.context);
- }
- deoptimizePath(path) {
- // A reassignment of UNKNOWN_PATH is considered equivalent to having lost track
- // which means the return expression needs to be reassigned
- if (path.length === 1 && path[0] === UnknownKey) {
- this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
- }
- }
- getReturnExpressionWhenCalledAtPath(path) {
- return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
- }
- hasEffects() {
- return false;
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenAssignedAtPath(path) {
- return path.length > 1;
- }
- hasEffectsWhenCalledAtPath(path, _callOptions, context) {
- if (path.length > 0)
- return true;
- for (const param of this.params) {
- if (param.hasEffects(context))
- return true;
- }
- const { ignore, brokenFlow } = context;
- context.ignore = {
- breaks: false,
- continues: false,
- labels: new Set(),
- returnAwaitYield: true
- };
- if (this.body.hasEffects(context))
- return true;
- context.ignore = ignore;
- context.brokenFlow = brokenFlow;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- for (const param of this.params) {
- if (!(param instanceof Identifier)) {
- param.include(context, includeChildrenRecursively);
- }
- }
- const { brokenFlow } = context;
- context.brokenFlow = BROKEN_FLOW_NONE;
- this.body.include(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- includeCallArguments(context, args) {
- this.scope.includeCallArguments(context, args);
- }
- initialise() {
- this.scope.addParameterVariables(this.params.map(param => param.declare('parameter', UNKNOWN_EXPRESSION)), this.params[this.params.length - 1] instanceof RestElement);
- if (this.body instanceof BlockStatement) {
- this.body.addImplicitReturnExpressionToScope();
- }
- else {
- this.scope.addReturnExpression(this.body);
- }
- }
- parseNode(esTreeNode) {
- if (esTreeNode.body.type === BlockStatement$1) {
- this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope.hoistedBodyVarScope);
- }
- super.parseNode(esTreeNode);
- }
- }
- ArrowFunctionExpression.prototype.preventChildBlockScope = true;
- class AssignmentExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.deoptimized = false;
- }
- hasEffects(context) {
- if (!this.deoptimized)
- this.applyDeoptimizations();
- return (this.right.hasEffects(context) ||
- this.left.hasEffects(context) ||
- this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- return path.length > 0 && this.right.hasEffectsWhenAccessedAtPath(path, context);
- }
- include(context, includeChildrenRecursively) {
- if (!this.deoptimized)
- this.applyDeoptimizations();
- this.included = true;
- let hasEffectsContext;
- if (includeChildrenRecursively ||
- this.operator !== '=' ||
- this.left.included ||
- ((hasEffectsContext = createHasEffectsContext()),
- this.left.hasEffects(hasEffectsContext) ||
- this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, hasEffectsContext))) {
- this.left.include(context, includeChildrenRecursively);
- }
- this.right.include(context, includeChildrenRecursively);
- }
- render(code, options, { preventASI, renderedParentType } = BLANK) {
- if (this.left.included) {
- this.left.render(code, options);
- this.right.render(code, options);
- }
- else {
- const inclusionStart = findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, '=', this.left.end) + 1);
- code.remove(this.start, inclusionStart);
- if (preventASI) {
- removeLineBreaks(code, inclusionStart, this.right.start);
- }
- this.right.render(code, options, {
- renderedParentType: renderedParentType || this.parent.type
- });
- }
- if (options.format === 'system') {
- const exportNames = this.left.variable && options.exportNamesByVariable.get(this.left.variable);
- if (this.left.type === 'Identifier' && exportNames) {
- const _ = options.compact ? '' : ' ';
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
- const operation = this.operator.length > 1 ? `${exportNames[0]}${_}${this.operator.slice(0, -1)}${_}` : '';
- code.overwrite(operatorPos, findNonWhiteSpace(code.original, operatorPos + this.operator.length), `=${_}${exportNames.length === 1
- ? `exports('${exportNames[0]}',${_}`
- : getSystemExportFunctionLeft([this.left.variable], false, options)}${operation}`);
- code.appendLeft(this.right.end, ')');
- }
- else {
- const systemPatternExports = [];
- this.left.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
- if (systemPatternExports.length > 0) {
- code.prependRight(this.start, `(${getSystemExportFunctionLeft(systemPatternExports, true, options)}`);
- code.appendLeft(this.end, '))');
- }
- }
- }
- }
- applyDeoptimizations() {
- this.deoptimized = true;
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.deoptimizePath(UNKNOWN_PATH);
- }
- }
- class AssignmentPattern extends NodeBase {
- addExportedVariables(variables, exportNamesByVariable) {
- this.left.addExportedVariables(variables, exportNamesByVariable);
- }
- bind() {
- super.bind();
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.deoptimizePath(UNKNOWN_PATH);
- }
- declare(kind, init) {
- return this.left.declare(kind, init);
- }
- deoptimizePath(path) {
- path.length === 0 && this.left.deoptimizePath(path);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return path.length > 0 || this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context);
- }
- render(code, options, { isShorthandProperty } = BLANK) {
- this.left.render(code, options, { isShorthandProperty });
- this.right.render(code, options);
- }
- }
- class AwaitExpression extends NodeBase {
- hasEffects(context) {
- return !context.ignore.returnAwaitYield || this.argument.hasEffects(context);
- }
- include(context, includeChildrenRecursively) {
- if (!this.included) {
- this.included = true;
- checkTopLevelAwait: if (!this.context.usesTopLevelAwait) {
- let parent = this.parent;
- do {
- if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
- break checkTopLevelAwait;
- } while ((parent = parent.parent));
- this.context.usesTopLevelAwait = true;
- }
- }
- this.argument.include(context, includeChildrenRecursively);
- }
- }
- const binaryOperators = {
- '!=': (left, right) => left != right,
- '!==': (left, right) => left !== right,
- '%': (left, right) => left % right,
- '&': (left, right) => left & right,
- '*': (left, right) => left * right,
- // At the moment, "**" will be transpiled to Math.pow
- '**': (left, right) => left ** right,
- '+': (left, right) => left + right,
- '-': (left, right) => left - right,
- '/': (left, right) => left / right,
- '<': (left, right) => left < right,
- '<<': (left, right) => left << right,
- '<=': (left, right) => left <= right,
- '==': (left, right) => left == right,
- '===': (left, right) => left === right,
- '>': (left, right) => left > right,
- '>=': (left, right) => left >= right,
- '>>': (left, right) => left >> right,
- '>>>': (left, right) => left >>> right,
- '^': (left, right) => left ^ right,
- in: () => UnknownValue,
- instanceof: () => UnknownValue,
- '|': (left, right) => left | right
- };
- class BinaryExpression extends NodeBase {
- deoptimizeCache() { }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (path.length > 0)
- return UnknownValue;
- const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
- if (leftValue === UnknownValue)
- return UnknownValue;
- const rightValue = this.right.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
- if (rightValue === UnknownValue)
- return UnknownValue;
- const operatorFn = binaryOperators[this.operator];
- if (!operatorFn)
- return UnknownValue;
- return operatorFn(leftValue, rightValue);
- }
- hasEffects(context) {
- // support some implicit type coercion runtime errors
- if (this.operator === '+' &&
- this.parent instanceof ExpressionStatement &&
- this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this) === '')
- return true;
- return super.hasEffects(context);
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- }
- class BreakStatement extends NodeBase {
- hasEffects(context) {
- if (this.label) {
- if (!context.ignore.labels.has(this.label.name))
- return true;
- context.includedLabels.add(this.label.name);
- context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
- }
- else {
- if (!context.ignore.breaks)
- return true;
- context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
- }
- return false;
- }
- include(context) {
- this.included = true;
- if (this.label) {
- this.label.include();
- context.includedLabels.add(this.label.name);
- }
- context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
- }
- }
- class Literal extends NodeBase {
- getLiteralValueAtPath(path) {
- if (path.length > 0 ||
- // unknown literals can also be null but do not start with an "n"
- (this.value === null && this.context.code.charCodeAt(this.start) !== 110) ||
- typeof this.value === 'bigint' ||
- // to support shims for regular expressions
- this.context.code.charCodeAt(this.start) === 47) {
- return UnknownValue;
- }
- return this.value;
- }
- getReturnExpressionWhenCalledAtPath(path) {
- if (path.length !== 1)
- return UNKNOWN_EXPRESSION;
- return getMemberReturnExpressionWhenCalled(this.members, path[0]);
- }
- hasEffectsWhenAccessedAtPath(path) {
- if (this.value === null) {
- return path.length > 0;
- }
- return path.length > 1;
- }
- hasEffectsWhenAssignedAtPath(path) {
- return path.length > 0;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length === 1) {
- return hasMemberEffectWhenCalled(this.members, path[0], this.included, callOptions, context);
- }
- return true;
- }
- initialise() {
- this.members = getLiteralMembersForValue(this.value);
- }
- parseNode(esTreeNode) {
- this.value = esTreeNode.value;
- this.regex = esTreeNode.regex;
- super.parseNode(esTreeNode);
- }
- render(code) {
- if (typeof this.value === 'string') {
- code.indentExclusionRanges.push([this.start + 1, this.end - 1]);
- }
- }
- }
- function getResolvablePropertyKey(memberExpression) {
- return memberExpression.computed
- ? getResolvableComputedPropertyKey(memberExpression.property)
- : memberExpression.property.name;
- }
- function getResolvableComputedPropertyKey(propertyKey) {
- if (propertyKey instanceof Literal) {
- return String(propertyKey.value);
- }
- return null;
- }
- function getPathIfNotComputed(memberExpression) {
- const nextPathKey = memberExpression.propertyKey;
- const object = memberExpression.object;
- if (typeof nextPathKey === 'string') {
- if (object instanceof Identifier) {
- return [
- { key: object.name, pos: object.start },
- { key: nextPathKey, pos: memberExpression.property.start }
- ];
- }
- if (object instanceof MemberExpression) {
- const parentPath = getPathIfNotComputed(object);
- return (parentPath && [...parentPath, { key: nextPathKey, pos: memberExpression.property.start }]);
- }
- }
- return null;
- }
- function getStringFromPath(path) {
- let pathString = path[0].key;
- for (let index = 1; index < path.length; index++) {
- pathString += '.' + path[index].key;
- }
- return pathString;
- }
- class MemberExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.variable = null;
- this.bound = false;
- this.expressionsToBeDeoptimized = [];
- this.replacement = null;
- this.wasPathDeoptimizedWhileOptimized = false;
- }
- bind() {
- if (this.bound)
- return;
- this.bound = true;
- const path = getPathIfNotComputed(this);
- const baseVariable = path && this.scope.findVariable(path[0].key);
- if (baseVariable && baseVariable.isNamespace) {
- const resolvedVariable = this.resolveNamespaceVariables(baseVariable, path.slice(1));
- if (!resolvedVariable) {
- super.bind();
- }
- else if (typeof resolvedVariable === 'string') {
- this.replacement = resolvedVariable;
- }
- else {
- this.variable = resolvedVariable;
- this.scope.addNamespaceMemberAccess(getStringFromPath(path), resolvedVariable);
- }
- }
- else {
- super.bind();
- // ensure the propertyKey is set for the tree-shaking passes
- this.getPropertyKey();
- }
- }
- deoptimizeCache() {
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
- this.expressionsToBeDeoptimized = [];
- this.propertyKey = UnknownKey;
- if (this.wasPathDeoptimizedWhileOptimized) {
- this.object.deoptimizePath(UNKNOWN_PATH);
- }
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- deoptimizePath(path) {
- if (!this.bound)
- this.bind();
- if (path.length === 0)
- this.disallowNamespaceReassignment();
- if (this.variable) {
- this.variable.deoptimizePath(path);
- }
- else {
- const propertyKey = this.getPropertyKey();
- if (propertyKey === UnknownKey) {
- this.object.deoptimizePath(UNKNOWN_PATH);
- }
- else {
- this.wasPathDeoptimizedWhileOptimized = true;
- this.object.deoptimizePath([propertyKey, ...path]);
- }
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (!this.bound)
- this.bind();
- if (this.variable !== null) {
- return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
- }
- this.expressionsToBeDeoptimized.push(origin);
- return this.object.getLiteralValueAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- if (!this.bound)
- this.bind();
- if (this.variable !== null) {
- return this.variable.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- this.expressionsToBeDeoptimized.push(origin);
- return this.object.getReturnExpressionWhenCalledAtPath([this.getPropertyKey(), ...path], recursionTracker, origin);
- }
- hasEffects(context) {
- const propertyReadSideEffects = this.context.options.treeshake
- .propertyReadSideEffects;
- return (propertyReadSideEffects === 'always' ||
- this.property.hasEffects(context) ||
- this.object.hasEffects(context) ||
- (propertyReadSideEffects &&
- this.object.hasEffectsWhenAccessedAtPath([this.propertyKey], context)));
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- if (this.variable !== null) {
- return this.variable.hasEffectsWhenAccessedAtPath(path, context);
- }
- return this.object.hasEffectsWhenAccessedAtPath([this.propertyKey, ...path], context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (this.variable !== null) {
- return this.variable.hasEffectsWhenAssignedAtPath(path, context);
- }
- return this.object.hasEffectsWhenAssignedAtPath([this.propertyKey, ...path], context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (this.variable !== null) {
- return this.variable.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- return this.object.hasEffectsWhenCalledAtPath([this.propertyKey, ...path], callOptions, context);
- }
- include(context, includeChildrenRecursively) {
- if (!this.included) {
- this.included = true;
- if (this.variable !== null) {
- this.context.includeVariableInModule(this.variable);
- }
- }
- this.object.include(context, includeChildrenRecursively);
- this.property.include(context, includeChildrenRecursively);
- }
- includeCallArguments(context, args) {
- if (this.variable) {
- this.variable.includeCallArguments(context, args);
- }
- else {
- super.includeCallArguments(context, args);
- }
- }
- initialise() {
- this.propertyKey = getResolvablePropertyKey(this);
- }
- render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) {
- const isCalleeOfDifferentParent = renderedParentType === CallExpression$1 && isCalleeOfRenderedParent;
- if (this.variable || this.replacement) {
- let replacement = this.variable ? this.variable.getName() : this.replacement;
- if (isCalleeOfDifferentParent)
- replacement = '0, ' + replacement;
- code.overwrite(this.start, this.end, replacement, {
- contentOnly: true,
- storeName: true
- });
- }
- else {
- if (isCalleeOfDifferentParent) {
- code.appendRight(this.start, '0, ');
- }
- const surroundingElement = renderedParentType || renderedSurroundingElement;
- this.object.render(code, options, surroundingElement ? { renderedSurroundingElement: surroundingElement } : BLANK);
- this.property.render(code, options);
- }
- }
- disallowNamespaceReassignment() {
- if (this.object instanceof Identifier) {
- const variable = this.scope.findVariable(this.object.name);
- if (variable.isNamespace) {
- if (this.variable) {
- this.context.includeVariableInModule(this.variable);
- }
- this.context.warn({
- code: 'ILLEGAL_NAMESPACE_REASSIGNMENT',
- message: `Illegal reassignment to import '${this.object.name}'`
- }, this.start);
- }
- }
- }
- getPropertyKey() {
- if (this.propertyKey === null) {
- this.propertyKey = UnknownKey;
- const value = this.property.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
- return (this.propertyKey = value === UnknownValue ? UnknownKey : String(value));
- }
- return this.propertyKey;
- }
- resolveNamespaceVariables(baseVariable, path) {
- if (path.length === 0)
- return baseVariable;
- if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable)
- return null;
- const exportName = path[0].key;
- const variable = baseVariable.context.traceExport(exportName);
- if (!variable) {
- const fileName = baseVariable.context.fileName;
- this.context.warn({
- code: 'MISSING_EXPORT',
- exporter: relativeId(fileName),
- importer: relativeId(this.context.fileName),
- message: `'${exportName}' is not exported by '${relativeId(fileName)}'`,
- missing: exportName,
- url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module`
- }, path[0].pos);
- return 'undefined';
- }
- return this.resolveNamespaceVariables(variable, path.slice(1));
- }
- }
- class CallExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.expressionsToBeDeoptimized = [];
- this.returnExpression = null;
- this.wasPathDeoptmizedWhileOptimized = false;
- }
- bind() {
- super.bind();
- if (this.callee instanceof Identifier) {
- const variable = this.scope.findVariable(this.callee.name);
- if (variable.isNamespace) {
- this.context.warn({
- code: 'CANNOT_CALL_NAMESPACE',
- message: `Cannot call a namespace ('${this.callee.name}')`
- }, this.start);
- }
- if (this.callee.name === 'eval') {
- this.context.warn({
- code: 'EVAL',
- message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
- url: 'https://rollupjs.org/guide/en/#avoiding-eval'
- }, this.start);
- }
- }
- // ensure the returnExpression is set for the tree-shaking passes
- this.getReturnExpression(SHARED_RECURSION_TRACKER);
- // This deoptimizes "this" for non-namespace calls until we have a better solution
- if (this.callee instanceof MemberExpression && !this.callee.variable) {
- this.callee.object.deoptimizePath(UNKNOWN_PATH);
- }
- for (const argument of this.arguments) {
- // This will make sure all properties of parameters behave as "unknown"
- argument.deoptimizePath(UNKNOWN_PATH);
- }
- }
- deoptimizeCache() {
- if (this.returnExpression !== UNKNOWN_EXPRESSION) {
- this.returnExpression = null;
- const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
- if (returnExpression !== UNKNOWN_EXPRESSION) {
- // We need to replace here because is possible new expressions are added
- // while we are deoptimizing the old ones
- this.expressionsToBeDeoptimized = [];
- if (this.wasPathDeoptmizedWhileOptimized) {
- returnExpression.deoptimizePath(UNKNOWN_PATH);
- this.wasPathDeoptmizedWhileOptimized = false;
- }
- }
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- }
- deoptimizePath(path) {
- if (path.length === 0)
- return;
- const trackedEntities = this.context.deoptimizationTracker.getEntities(path);
- if (trackedEntities.has(this))
- return;
- trackedEntities.add(this);
- const returnExpression = this.getReturnExpression(SHARED_RECURSION_TRACKER);
- if (returnExpression !== UNKNOWN_EXPRESSION) {
- this.wasPathDeoptmizedWhileOptimized = true;
- returnExpression.deoptimizePath(path);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- const returnExpression = this.getReturnExpression(recursionTracker);
- if (returnExpression === UNKNOWN_EXPRESSION) {
- return UnknownValue;
- }
- const trackedEntities = recursionTracker.getEntities(path);
- if (trackedEntities.has(returnExpression)) {
- return UnknownValue;
- }
- this.expressionsToBeDeoptimized.push(origin);
- trackedEntities.add(returnExpression);
- const value = returnExpression.getLiteralValueAtPath(path, recursionTracker, origin);
- trackedEntities.delete(returnExpression);
- return value;
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- const returnExpression = this.getReturnExpression(recursionTracker);
- if (this.returnExpression === UNKNOWN_EXPRESSION) {
- return UNKNOWN_EXPRESSION;
- }
- const trackedEntities = recursionTracker.getEntities(path);
- if (trackedEntities.has(returnExpression)) {
- return UNKNOWN_EXPRESSION;
- }
- this.expressionsToBeDeoptimized.push(origin);
- trackedEntities.add(returnExpression);
- const value = returnExpression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- trackedEntities.delete(returnExpression);
- return value;
- }
- hasEffects(context) {
- var _a;
- for (const argument of this.arguments) {
- if (argument.hasEffects(context))
- return true;
- }
- if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
- return false;
- return (this.callee.hasEffects(context) ||
- this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- const trackedExpressions = context.accessed.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.returnExpression.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (path.length === 0)
- return true;
- const trackedExpressions = context.assigned.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- const trackedExpressions = (callOptions.withNew
- ? context.instantiated
- : context.called).getEntities(path, callOptions);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- include(context, includeChildrenRecursively) {
- if (includeChildrenRecursively) {
- super.include(context, includeChildrenRecursively);
- if (includeChildrenRecursively === INCLUDE_PARAMETERS &&
- this.callee instanceof Identifier &&
- this.callee.variable) {
- this.callee.variable.markCalledFromTryStatement();
- }
- }
- else {
- this.included = true;
- this.callee.include(context, false);
- }
- this.callee.includeCallArguments(context, this.arguments);
- if (!this.returnExpression.included) {
- this.returnExpression.include(context, false);
- }
- }
- initialise() {
- this.callOptions = {
- args: this.arguments,
- withNew: false
- };
- }
- render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
- const surroundingELement = renderedParentType || renderedSurroundingElement;
- this.callee.render(code, options, surroundingELement ? { renderedSurroundingElement: surroundingELement } : BLANK);
- if (this.arguments.length > 0) {
- if (this.arguments[this.arguments.length - 1].included) {
- for (const arg of this.arguments) {
- arg.render(code, options);
- }
- }
- else {
- let lastIncludedIndex = this.arguments.length - 2;
- while (lastIncludedIndex >= 0 && !this.arguments[lastIncludedIndex].included) {
- lastIncludedIndex--;
- }
- if (lastIncludedIndex >= 0) {
- for (let index = 0; index <= lastIncludedIndex; index++) {
- this.arguments[index].render(code, options);
- }
- code.remove(findFirstOccurrenceOutsideComment(code.original, ',', this.arguments[lastIncludedIndex].end), this.end - 1);
- }
- else {
- code.remove(findFirstOccurrenceOutsideComment(code.original, '(', this.callee.end) + 1, this.end - 1);
- }
- }
- }
- }
- getReturnExpression(recursionTracker) {
- if (this.returnExpression === null) {
- this.returnExpression = UNKNOWN_EXPRESSION;
- return (this.returnExpression = this.callee.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, recursionTracker, this));
- }
- return this.returnExpression;
- }
- }
- class CatchScope extends ParameterScope {
- addDeclaration(identifier, context, init, isHoisted) {
- if (isHoisted) {
- return this.parent.addDeclaration(identifier, context, init, isHoisted);
- }
- else {
- return super.addDeclaration(identifier, context, init, false);
- }
- }
- }
- class CatchClause extends NodeBase {
- createScope(parentScope) {
- this.scope = new CatchScope(parentScope, this.context);
- }
- initialise() {
- if (this.param) {
- this.param.declare('parameter', UNKNOWN_EXPRESSION);
- }
- }
- parseNode(esTreeNode) {
- this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope);
- super.parseNode(esTreeNode);
- }
- }
- CatchClause.prototype.preventChildBlockScope = true;
- class ChainExpression extends NodeBase {
- }
- class ClassBodyScope extends ChildScope {
- findLexicalBoundary() {
- return this;
- }
- }
- class MethodDefinition extends NodeBase {
- hasEffects(context) {
- return this.key.hasEffects(context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- return (path.length > 0 || this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
- }
- }
- class ClassBody extends NodeBase {
- createScope(parentScope) {
- this.scope = new ClassBodyScope(parentScope);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (path.length > 0)
- return true;
- return (this.classConstructor !== null &&
- this.classConstructor.hasEffectsWhenCalledAtPath(EMPTY_PATH, callOptions, context));
- }
- initialise() {
- for (const method of this.body) {
- if (method instanceof MethodDefinition && method.kind === 'constructor') {
- this.classConstructor = method;
- return;
- }
- }
- this.classConstructor = null;
- }
- }
- class ClassExpression extends ClassNode {
- render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
- super.render(code, options);
- const surroundingElement = renderedParentType || renderedSurroundingElement;
- if (surroundingElement === ExpressionStatement$1) {
- code.appendRight(this.start, '(');
- code.prependLeft(this.end, ')');
- }
- }
- }
- class MultiExpression {
- constructor(expressions) {
- this.included = false;
- this.expressions = expressions;
- }
- deoptimizePath(path) {
- for (const expression of this.expressions) {
- expression.deoptimizePath(path);
- }
- }
- getLiteralValueAtPath() {
- return UnknownValue;
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- return new MultiExpression(this.expressions.map(expression => expression.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)));
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- for (const expression of this.expressions) {
- if (expression.hasEffectsWhenAccessedAtPath(path, context))
- return true;
- }
- return false;
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- for (const expression of this.expressions) {
- if (expression.hasEffectsWhenAssignedAtPath(path, context))
- return true;
- }
- return false;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- for (const expression of this.expressions) {
- if (expression.hasEffectsWhenCalledAtPath(path, callOptions, context))
- return true;
- }
- return false;
- }
- include(context, includeChildrenRecursively) {
- // This is only relevant to include values that do not have an AST representation,
- // such as UnknownArrayExpression. Thus we only need to include them once.
- for (const expression of this.expressions) {
- if (!expression.included) {
- expression.include(context, includeChildrenRecursively);
- }
- }
- }
- includeCallArguments() { }
- }
- class ConditionalExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.expressionsToBeDeoptimized = [];
- this.isBranchResolutionAnalysed = false;
- this.usedBranch = null;
- this.wasPathDeoptimizedWhileOptimized = false;
- }
- bind() {
- super.bind();
- // ensure the usedBranch is set for the tree-shaking passes
- this.getUsedBranch();
- }
- deoptimizeCache() {
- if (this.usedBranch !== null) {
- const unusedBranch = this.usedBranch === this.consequent ? this.alternate : this.consequent;
- this.usedBranch = null;
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
- this.expressionsToBeDeoptimized = [];
- if (this.wasPathDeoptimizedWhileOptimized) {
- unusedBranch.deoptimizePath(UNKNOWN_PATH);
- }
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- }
- deoptimizePath(path) {
- if (path.length > 0) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null) {
- this.consequent.deoptimizePath(path);
- this.alternate.deoptimizePath(path);
- }
- else {
- this.wasPathDeoptimizedWhileOptimized = true;
- usedBranch.deoptimizePath(path);
- }
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null)
- return UnknownValue;
- this.expressionsToBeDeoptimized.push(origin);
- return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null)
- return new MultiExpression([
- this.consequent.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
- this.alternate.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
- ]);
- this.expressionsToBeDeoptimized.push(origin);
- return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- hasEffects(context) {
- if (this.test.hasEffects(context))
- return true;
- if (this.usedBranch === null) {
- return this.consequent.hasEffects(context) || this.alternate.hasEffects(context);
- }
- return this.usedBranch.hasEffects(context);
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- if (this.usedBranch === null) {
- return (this.consequent.hasEffectsWhenAccessedAtPath(path, context) ||
- this.alternate.hasEffectsWhenAccessedAtPath(path, context));
- }
- return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (path.length === 0)
- return true;
- if (this.usedBranch === null) {
- return (this.consequent.hasEffectsWhenAssignedAtPath(path, context) ||
- this.alternate.hasEffectsWhenAssignedAtPath(path, context));
- }
- return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (this.usedBranch === null) {
- return (this.consequent.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
- this.alternate.hasEffectsWhenCalledAtPath(path, callOptions, context));
- }
- return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (includeChildrenRecursively ||
- this.test.shouldBeIncluded(context) ||
- this.usedBranch === null) {
- this.test.include(context, includeChildrenRecursively);
- this.consequent.include(context, includeChildrenRecursively);
- this.alternate.include(context, includeChildrenRecursively);
- }
- else {
- this.usedBranch.include(context, includeChildrenRecursively);
- }
- }
- includeCallArguments(context, args) {
- if (this.usedBranch === null) {
- this.consequent.includeCallArguments(context, args);
- this.alternate.includeCallArguments(context, args);
- }
- else {
- this.usedBranch.includeCallArguments(context, args);
- }
- }
- render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
- if (!this.test.included) {
- const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
- const inclusionStart = findNonWhiteSpace(code.original, (this.consequent.included
- ? findFirstOccurrenceOutsideComment(code.original, '?', this.test.end)
- : colonPos) + 1);
- if (preventASI) {
- removeLineBreaks(code, inclusionStart, this.usedBranch.start);
- }
- code.remove(this.start, inclusionStart);
- if (this.consequent.included) {
- code.remove(colonPos, this.end);
- }
- removeAnnotations(this, code);
- this.usedBranch.render(code, options, {
- isCalleeOfRenderedParent: renderedParentType
- ? isCalleeOfRenderedParent
- : this.parent.callee === this,
- preventASI: true,
- renderedParentType: renderedParentType || this.parent.type
- });
- }
- else {
- super.render(code, options);
- }
- }
- getUsedBranch() {
- if (this.isBranchResolutionAnalysed) {
- return this.usedBranch;
- }
- this.isBranchResolutionAnalysed = true;
- const testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
- return testValue === UnknownValue
- ? null
- : (this.usedBranch = testValue ? this.consequent : this.alternate);
- }
- }
- class ContinueStatement extends NodeBase {
- hasEffects(context) {
- if (this.label) {
- if (!context.ignore.labels.has(this.label.name))
- return true;
- context.includedLabels.add(this.label.name);
- context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
- }
- else {
- if (!context.ignore.continues)
- return true;
- context.brokenFlow = BROKEN_FLOW_BREAK_CONTINUE;
- }
- return false;
- }
- include(context) {
- this.included = true;
- if (this.label) {
- this.label.include();
- context.includedLabels.add(this.label.name);
- }
- context.brokenFlow = this.label ? BROKEN_FLOW_ERROR_RETURN_LABEL : BROKEN_FLOW_BREAK_CONTINUE;
- }
- }
- class DoWhileStatement extends NodeBase {
- hasEffects(context) {
- if (this.test.hasEffects(context))
- return true;
- const { brokenFlow, ignore: { breaks, continues } } = context;
- context.ignore.breaks = true;
- context.ignore.continues = true;
- if (this.body.hasEffects(context))
- return true;
- context.ignore.breaks = breaks;
- context.ignore.continues = continues;
- context.brokenFlow = brokenFlow;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.test.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- this.body.includeAsSingleStatement(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- }
- class EmptyStatement extends NodeBase {
- hasEffects() {
- return false;
- }
- }
- class ExportNamedDeclaration extends NodeBase {
- bind() {
- // Do not bind specifiers
- if (this.declaration !== null)
- this.declaration.bind();
- }
- hasEffects(context) {
- return this.declaration !== null && this.declaration.hasEffects(context);
- }
- initialise() {
- this.context.addExport(this);
- }
- render(code, options, nodeRenderOptions) {
- const { start, end } = nodeRenderOptions;
- if (this.declaration === null) {
- code.remove(start, end);
- }
- else {
- code.remove(this.start, this.declaration.start);
- this.declaration.render(code, options, { start, end });
- }
- }
- }
- ExportNamedDeclaration.prototype.needsBoundaries = true;
- class ExportSpecifier extends NodeBase {
- }
- class ForInStatement extends NodeBase {
- bind() {
- this.left.bind();
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.bind();
- this.body.bind();
- }
- createScope(parentScope) {
- this.scope = new BlockScope(parentScope);
- }
- hasEffects(context) {
- if ((this.left &&
- (this.left.hasEffects(context) ||
- this.left.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))) ||
- (this.right && this.right.hasEffects(context)))
- return true;
- const { brokenFlow, ignore: { breaks, continues } } = context;
- context.ignore.breaks = true;
- context.ignore.continues = true;
- if (this.body.hasEffects(context))
- return true;
- context.ignore.breaks = breaks;
- context.ignore.continues = continues;
- context.brokenFlow = brokenFlow;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.left.include(context, includeChildrenRecursively || true);
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- this.body.includeAsSingleStatement(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- render(code, options) {
- this.left.render(code, options, NO_SEMICOLON);
- this.right.render(code, options, NO_SEMICOLON);
- // handle no space between "in" and the right side
- if (code.original.charCodeAt(this.right.start - 1) === 110 /* n */) {
- code.prependLeft(this.right.start, ' ');
- }
- this.body.render(code, options);
- }
- }
- class ForOfStatement extends NodeBase {
- bind() {
- this.left.bind();
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.bind();
- this.body.bind();
- }
- createScope(parentScope) {
- this.scope = new BlockScope(parentScope);
- }
- hasEffects() {
- // Placeholder until proper Symbol.Iterator support
- return true;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.left.include(context, includeChildrenRecursively || true);
- this.left.deoptimizePath(EMPTY_PATH);
- this.right.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- this.body.includeAsSingleStatement(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- render(code, options) {
- this.left.render(code, options, NO_SEMICOLON);
- this.right.render(code, options, NO_SEMICOLON);
- // handle no space between "of" and the right side
- if (code.original.charCodeAt(this.right.start - 1) === 102 /* f */) {
- code.prependLeft(this.right.start, ' ');
- }
- this.body.render(code, options);
- }
- }
- class ForStatement extends NodeBase {
- createScope(parentScope) {
- this.scope = new BlockScope(parentScope);
- }
- hasEffects(context) {
- if ((this.init && this.init.hasEffects(context)) ||
- (this.test && this.test.hasEffects(context)) ||
- (this.update && this.update.hasEffects(context)))
- return true;
- const { brokenFlow, ignore: { breaks, continues } } = context;
- context.ignore.breaks = true;
- context.ignore.continues = true;
- if (this.body.hasEffects(context))
- return true;
- context.ignore.breaks = breaks;
- context.ignore.continues = continues;
- context.brokenFlow = brokenFlow;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (this.init)
- this.init.includeAsSingleStatement(context, includeChildrenRecursively);
- if (this.test)
- this.test.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- if (this.update)
- this.update.include(context, includeChildrenRecursively);
- this.body.includeAsSingleStatement(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- render(code, options) {
- if (this.init)
- this.init.render(code, options, NO_SEMICOLON);
- if (this.test)
- this.test.render(code, options, NO_SEMICOLON);
- if (this.update)
- this.update.render(code, options, NO_SEMICOLON);
- this.body.render(code, options);
- }
- }
- class FunctionExpression extends FunctionNode {
- render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
- super.render(code, options);
- const surroundingElement = renderedParentType || renderedSurroundingElement;
- if (surroundingElement === ExpressionStatement$1) {
- code.appendRight(this.start, '(');
- code.prependLeft(this.end, ')');
- }
- }
- }
- class TrackingScope extends BlockScope {
- constructor() {
- super(...arguments);
- this.hoistedDeclarations = [];
- }
- addDeclaration(identifier, context, init, isHoisted) {
- this.hoistedDeclarations.push(identifier);
- return this.parent.addDeclaration(identifier, context, init, isHoisted);
- }
- }
- const unset = Symbol('unset');
- class IfStatement extends NodeBase {
- constructor() {
- super(...arguments);
- this.testValue = unset;
- }
- deoptimizeCache() {
- this.testValue = UnknownValue;
- }
- hasEffects(context) {
- if (this.test.hasEffects(context)) {
- return true;
- }
- const testValue = this.getTestValue();
- if (testValue === UnknownValue) {
- const { brokenFlow } = context;
- if (this.consequent.hasEffects(context))
- return true;
- const consequentBrokenFlow = context.brokenFlow;
- context.brokenFlow = brokenFlow;
- if (this.alternate === null)
- return false;
- if (this.alternate.hasEffects(context))
- return true;
- context.brokenFlow =
- context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
- return false;
- }
- return testValue
- ? this.consequent.hasEffects(context)
- : this.alternate !== null && this.alternate.hasEffects(context);
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (includeChildrenRecursively) {
- this.includeRecursively(includeChildrenRecursively, context);
- }
- else {
- const testValue = this.getTestValue();
- if (testValue === UnknownValue) {
- this.includeUnknownTest(context);
- }
- else {
- this.includeKnownTest(context, testValue);
- }
- }
- }
- parseNode(esTreeNode) {
- this.consequentScope = new TrackingScope(this.scope);
- this.consequent = new (this.context.nodeConstructors[esTreeNode.consequent.type] ||
- this.context.nodeConstructors.UnknownNode)(esTreeNode.consequent, this, this.consequentScope);
- if (esTreeNode.alternate) {
- this.alternateScope = new TrackingScope(this.scope);
- this.alternate = new (this.context.nodeConstructors[esTreeNode.alternate.type] ||
- this.context.nodeConstructors.UnknownNode)(esTreeNode.alternate, this, this.alternateScope);
- }
- super.parseNode(esTreeNode);
- }
- render(code, options) {
- // Note that unknown test values are always included
- const testValue = this.getTestValue();
- const hoistedDeclarations = [];
- const includesIfElse = this.test.included;
- const noTreeshake = !this.context.options.treeshake;
- if (includesIfElse) {
- this.test.render(code, options);
- }
- else {
- removeAnnotations(this, code);
- code.remove(this.start, this.consequent.start);
- }
- if (this.consequent.included && (noTreeshake || testValue === UnknownValue || testValue)) {
- this.consequent.render(code, options);
- }
- else {
- code.overwrite(this.consequent.start, this.consequent.end, includesIfElse ? ';' : '');
- hoistedDeclarations.push(...this.consequentScope.hoistedDeclarations);
- }
- if (this.alternate) {
- if (this.alternate.included && (noTreeshake || testValue === UnknownValue || !testValue)) {
- if (includesIfElse) {
- if (code.original.charCodeAt(this.alternate.start - 1) === 101) {
- code.prependLeft(this.alternate.start, ' ');
- }
- }
- else {
- code.remove(this.consequent.end, this.alternate.start);
- }
- this.alternate.render(code, options);
- }
- else {
- if (includesIfElse && this.shouldKeepAlternateBranch()) {
- code.overwrite(this.alternate.start, this.end, ';');
- }
- else {
- code.remove(this.consequent.end, this.end);
- }
- hoistedDeclarations.push(...this.alternateScope.hoistedDeclarations);
- }
- }
- this.renderHoistedDeclarations(hoistedDeclarations, code);
- }
- getTestValue() {
- if (this.testValue === unset) {
- return (this.testValue = this.test.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
- }
- return this.testValue;
- }
- includeKnownTest(context, testValue) {
- if (this.test.shouldBeIncluded(context)) {
- this.test.include(context, false);
- }
- if (testValue && this.consequent.shouldBeIncluded(context)) {
- this.consequent.includeAsSingleStatement(context, false);
- }
- if (this.alternate !== null && !testValue && this.alternate.shouldBeIncluded(context)) {
- this.alternate.includeAsSingleStatement(context, false);
- }
- }
- includeRecursively(includeChildrenRecursively, context) {
- this.test.include(context, includeChildrenRecursively);
- this.consequent.include(context, includeChildrenRecursively);
- if (this.alternate !== null) {
- this.alternate.include(context, includeChildrenRecursively);
- }
- }
- includeUnknownTest(context) {
- this.test.include(context, false);
- const { brokenFlow } = context;
- let consequentBrokenFlow = BROKEN_FLOW_NONE;
- if (this.consequent.shouldBeIncluded(context)) {
- this.consequent.includeAsSingleStatement(context, false);
- consequentBrokenFlow = context.brokenFlow;
- context.brokenFlow = brokenFlow;
- }
- if (this.alternate !== null && this.alternate.shouldBeIncluded(context)) {
- this.alternate.includeAsSingleStatement(context, false);
- context.brokenFlow =
- context.brokenFlow < consequentBrokenFlow ? context.brokenFlow : consequentBrokenFlow;
- }
- }
- renderHoistedDeclarations(hoistedDeclarations, code) {
- const hoistedVars = [
- ...new Set(hoistedDeclarations.map(identifier => {
- const variable = identifier.variable;
- return variable.included ? variable.getName() : '';
- }))
- ]
- .filter(Boolean)
- .join(', ');
- if (hoistedVars) {
- const parentType = this.parent.type;
- const needsBraces = parentType !== Program$1 && parentType !== BlockStatement$1;
- code.prependRight(this.start, `${needsBraces ? '{ ' : ''}var ${hoistedVars}; `);
- if (needsBraces) {
- code.appendLeft(this.end, ` }`);
- }
- }
- }
- shouldKeepAlternateBranch() {
- let currentParent = this.parent;
- do {
- if (currentParent instanceof IfStatement && currentParent.alternate) {
- return true;
- }
- if (currentParent instanceof BlockStatement) {
- return false;
- }
- currentParent = currentParent.parent;
- } while (currentParent);
- return false;
- }
- }
- class ImportDeclaration extends NodeBase {
- bind() { }
- hasEffects() {
- return false;
- }
- initialise() {
- this.context.addImport(this);
- }
- render(code, _options, nodeRenderOptions) {
- code.remove(nodeRenderOptions.start, nodeRenderOptions.end);
- }
- }
- ImportDeclaration.prototype.needsBoundaries = true;
- class ImportDefaultSpecifier extends NodeBase {
- }
- class ImportExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.inlineNamespace = null;
- this.mechanism = null;
- this.resolution = null;
- }
- hasEffects() {
- return true;
- }
- include(context, includeChildrenRecursively) {
- if (!this.included) {
- this.included = true;
- this.context.includeDynamicImport(this);
- this.scope.addAccessedDynamicImport(this);
- }
- this.source.include(context, includeChildrenRecursively);
- }
- initialise() {
- this.context.addDynamicImport(this);
- }
- render(code, options) {
- if (this.inlineNamespace) {
- const _ = options.compact ? '' : ' ';
- const s = options.compact ? '' : ';';
- code.overwrite(this.start, this.end, `Promise.resolve().then(function${_}()${_}{${_}return ${this.inlineNamespace.getName()}${s}${_}})`);
- return;
- }
- if (this.mechanism) {
- code.overwrite(this.start, findFirstOccurrenceOutsideComment(code.original, '(', this.start + 6) + 1, this.mechanism.left);
- code.overwrite(this.end - 1, this.end, this.mechanism.right);
- }
- this.source.render(code, options);
- }
- renderFinalResolution(code, resolution, namespaceExportName, options) {
- code.overwrite(this.source.start, this.source.end, resolution);
- if (namespaceExportName) {
- const _ = options.compact ? '' : ' ';
- const s = options.compact ? '' : ';';
- code.prependLeft(this.end, `.then(function${_}(n)${_}{${_}return n.${namespaceExportName}${s}${_}})`);
- }
- }
- setExternalResolution(exportMode, resolution, options, pluginDriver, accessedGlobalsByScope) {
- this.resolution = resolution;
- const accessedGlobals = [...(accessedImportGlobals[options.format] || [])];
- let helper;
- ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver));
- if (helper) {
- accessedGlobals.push(helper);
- }
- if (accessedGlobals.length > 0) {
- this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
- }
- }
- setInternalResolution(inlineNamespace) {
- this.inlineNamespace = inlineNamespace;
- }
- getDynamicImportMechanismAndHelper(resolution, exportMode, options, pluginDriver) {
- const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
- {
- customResolution: typeof this.resolution === 'string' ? this.resolution : null,
- format: options.format,
- moduleId: this.context.module.id,
- targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null
- }
- ]);
- if (mechanism) {
- return { helper: null, mechanism };
- }
- switch (options.format) {
- case 'cjs': {
- const _ = options.compact ? '' : ' ';
- const s = options.compact ? '' : ';';
- const leftStart = `Promise.resolve().then(function${_}()${_}{${_}return`;
- const helper = this.getInteropHelper(resolution, exportMode, options.interop);
- return {
- helper,
- mechanism: helper
- ? {
- left: `${leftStart} /*#__PURE__*/${helper}(require(`,
- right: `))${s}${_}})`
- }
- : {
- left: `${leftStart} require(`,
- right: `)${s}${_}})`
- }
- };
- }
- case 'amd': {
- const _ = options.compact ? '' : ' ';
- const resolve = options.compact ? 'c' : 'resolve';
- const reject = options.compact ? 'e' : 'reject';
- const helper = this.getInteropHelper(resolution, exportMode, options.interop);
- const resolveNamespace = helper
- ? `function${_}(m)${_}{${_}${resolve}(/*#__PURE__*/${helper}(m));${_}}`
- : resolve;
- return {
- helper,
- mechanism: {
- left: `new Promise(function${_}(${resolve},${_}${reject})${_}{${_}require([`,
- right: `],${_}${resolveNamespace},${_}${reject})${_}})`
- }
- };
- }
- case 'system':
- return {
- helper: null,
- mechanism: {
- left: 'module.import(',
- right: ')'
- }
- };
- case 'es':
- if (options.dynamicImportFunction) {
- return {
- helper: null,
- mechanism: {
- left: `${options.dynamicImportFunction}(`,
- right: ')'
- }
- };
- }
- }
- return { helper: null, mechanism: null };
- }
- getInteropHelper(resolution, exportMode, interop) {
- return exportMode === 'external'
- ? namespaceInteropHelpersByInteropType[String(interop(resolution instanceof ExternalModule ? resolution.id : null))]
- : exportMode === 'default'
- ? getDefaultOnlyHelper()
- : null;
- }
- }
- const accessedImportGlobals = {
- amd: ['require'],
- cjs: ['require'],
- system: ['module']
- };
- class ImportNamespaceSpecifier extends NodeBase {
- }
- class ImportSpecifier extends NodeBase {
- }
- class LabeledStatement extends NodeBase {
- hasEffects(context) {
- const brokenFlow = context.brokenFlow;
- context.ignore.labels.add(this.label.name);
- if (this.body.hasEffects(context))
- return true;
- context.ignore.labels.delete(this.label.name);
- if (context.includedLabels.has(this.label.name)) {
- context.includedLabels.delete(this.label.name);
- context.brokenFlow = brokenFlow;
- }
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- const brokenFlow = context.brokenFlow;
- this.body.include(context, includeChildrenRecursively);
- if (includeChildrenRecursively || context.includedLabels.has(this.label.name)) {
- this.label.include();
- context.includedLabels.delete(this.label.name);
- context.brokenFlow = brokenFlow;
- }
- }
- render(code, options) {
- if (this.label.included) {
- this.label.render(code, options);
- }
- else {
- code.remove(this.start, findNonWhiteSpace(code.original, findFirstOccurrenceOutsideComment(code.original, ':', this.label.end) + 1));
- }
- this.body.render(code, options);
- }
- }
- class LogicalExpression extends NodeBase {
- constructor() {
- super(...arguments);
- // We collect deoptimization information if usedBranch !== null
- this.expressionsToBeDeoptimized = [];
- this.isBranchResolutionAnalysed = false;
- this.unusedBranch = null;
- this.usedBranch = null;
- this.wasPathDeoptimizedWhileOptimized = false;
- }
- bind() {
- super.bind();
- // ensure the usedBranch is set for the tree-shaking passes
- this.getUsedBranch();
- }
- deoptimizeCache() {
- if (this.usedBranch !== null) {
- this.usedBranch = null;
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized;
- this.expressionsToBeDeoptimized = [];
- if (this.wasPathDeoptimizedWhileOptimized) {
- this.unusedBranch.deoptimizePath(UNKNOWN_PATH);
- }
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- }
- deoptimizePath(path) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null) {
- this.left.deoptimizePath(path);
- this.right.deoptimizePath(path);
- }
- else {
- this.wasPathDeoptimizedWhileOptimized = true;
- usedBranch.deoptimizePath(path);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null)
- return UnknownValue;
- this.expressionsToBeDeoptimized.push(origin);
- return usedBranch.getLiteralValueAtPath(path, recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- const usedBranch = this.getUsedBranch();
- if (usedBranch === null)
- return new MultiExpression([
- this.left.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin),
- this.right.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin)
- ]);
- this.expressionsToBeDeoptimized.push(origin);
- return usedBranch.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- hasEffects(context) {
- if (this.left.hasEffects(context)) {
- return true;
- }
- if (this.usedBranch !== this.left) {
- return this.right.hasEffects(context);
- }
- return false;
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- if (this.usedBranch === null) {
- return (this.left.hasEffectsWhenAccessedAtPath(path, context) ||
- this.right.hasEffectsWhenAccessedAtPath(path, context));
- }
- return this.usedBranch.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (path.length === 0)
- return true;
- if (this.usedBranch === null) {
- return (this.left.hasEffectsWhenAssignedAtPath(path, context) ||
- this.right.hasEffectsWhenAssignedAtPath(path, context));
- }
- return this.usedBranch.hasEffectsWhenAssignedAtPath(path, context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (this.usedBranch === null) {
- return (this.left.hasEffectsWhenCalledAtPath(path, callOptions, context) ||
- this.right.hasEffectsWhenCalledAtPath(path, callOptions, context));
- }
- return this.usedBranch.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (includeChildrenRecursively ||
- (this.usedBranch === this.right && this.left.shouldBeIncluded(context)) ||
- this.usedBranch === null) {
- this.left.include(context, includeChildrenRecursively);
- this.right.include(context, includeChildrenRecursively);
- }
- else {
- this.usedBranch.include(context, includeChildrenRecursively);
- }
- }
- render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
- if (!this.left.included || !this.right.included) {
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
- if (this.right.included) {
- const removePos = findNonWhiteSpace(code.original, operatorPos + 2);
- code.remove(this.start, removePos);
- if (preventASI) {
- removeLineBreaks(code, removePos, this.right.start);
- }
- }
- else {
- code.remove(operatorPos, this.end);
- }
- removeAnnotations(this, code);
- this.usedBranch.render(code, options, {
- isCalleeOfRenderedParent: renderedParentType
- ? isCalleeOfRenderedParent
- : this.parent.callee === this,
- preventASI,
- renderedParentType: renderedParentType || this.parent.type
- });
- }
- else {
- this.left.render(code, options, { preventASI });
- this.right.render(code, options);
- }
- }
- getUsedBranch() {
- if (!this.isBranchResolutionAnalysed) {
- this.isBranchResolutionAnalysed = true;
- const leftValue = this.left.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
- if (leftValue === UnknownValue) {
- return null;
- }
- else {
- if ((this.operator === '||' && leftValue) ||
- (this.operator === '&&' && !leftValue) ||
- (this.operator === '??' && leftValue != null)) {
- this.usedBranch = this.left;
- this.unusedBranch = this.right;
- }
- else {
- this.usedBranch = this.right;
- this.unusedBranch = this.left;
- }
- }
- }
- return this.usedBranch;
- }
- }
- const ASSET_PREFIX = 'ROLLUP_ASSET_URL_';
- const CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_';
- const FILE_PREFIX = 'ROLLUP_FILE_URL_';
- class MetaProperty extends NodeBase {
- addAccessedGlobals(format, accessedGlobalsByScope) {
- const metaProperty = this.metaProperty;
- const accessedGlobals = (metaProperty &&
- (metaProperty.startsWith(FILE_PREFIX) ||
- metaProperty.startsWith(ASSET_PREFIX) ||
- metaProperty.startsWith(CHUNK_PREFIX))
- ? accessedFileUrlGlobals
- : accessedMetaUrlGlobals)[format];
- if (accessedGlobals.length > 0) {
- this.scope.addAccessedGlobals(accessedGlobals, accessedGlobalsByScope);
- }
- }
- getReferencedFileName(outputPluginDriver) {
- const metaProperty = this.metaProperty;
- if (metaProperty && metaProperty.startsWith(FILE_PREFIX)) {
- return outputPluginDriver.getFileName(metaProperty.substr(FILE_PREFIX.length));
- }
- return null;
- }
- hasEffects() {
- return false;
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- include() {
- if (!this.included) {
- this.included = true;
- if (this.meta.name === 'import') {
- this.context.addImportMeta(this);
- const parent = this.parent;
- this.metaProperty =
- parent instanceof MemberExpression && typeof parent.propertyKey === 'string'
- ? parent.propertyKey
- : null;
- }
- }
- }
- renderFinalMechanism(code, chunkId, format, outputPluginDriver) {
- var _a;
- const parent = this.parent;
- const metaProperty = this.metaProperty;
- if (metaProperty &&
- (metaProperty.startsWith(FILE_PREFIX) ||
- metaProperty.startsWith(ASSET_PREFIX) ||
- metaProperty.startsWith(CHUNK_PREFIX))) {
- let referenceId = null;
- let assetReferenceId = null;
- let chunkReferenceId = null;
- let fileName;
- if (metaProperty.startsWith(FILE_PREFIX)) {
- referenceId = metaProperty.substr(FILE_PREFIX.length);
- fileName = outputPluginDriver.getFileName(referenceId);
- }
- else if (metaProperty.startsWith(ASSET_PREFIX)) {
- warnDeprecation(`Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
- assetReferenceId = metaProperty.substr(ASSET_PREFIX.length);
- fileName = outputPluginDriver.getFileName(assetReferenceId);
- }
- else {
- warnDeprecation(`Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, true, this.context.options);
- chunkReferenceId = metaProperty.substr(CHUNK_PREFIX.length);
- fileName = outputPluginDriver.getFileName(chunkReferenceId);
- }
- const relativePath = normalize(relative$1(dirname(chunkId), fileName));
- let replacement;
- if (assetReferenceId !== null) {
- replacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [
- {
- assetFileName: fileName,
- chunkId,
- format,
- moduleId: this.context.module.id,
- relativeAssetPath: relativePath
- }
- ]);
- }
- if (!replacement) {
- replacement =
- outputPluginDriver.hookFirstSync('resolveFileUrl', [
- {
- assetReferenceId,
- chunkId,
- chunkReferenceId,
- fileName,
- format,
- moduleId: this.context.module.id,
- referenceId: referenceId || assetReferenceId || chunkReferenceId,
- relativePath
- }
- ]) || relativeUrlMechanisms[format](relativePath);
- }
- code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
- return;
- }
- const replacement = outputPluginDriver.hookFirstSync('resolveImportMeta', [
- metaProperty,
- {
- chunkId,
- format,
- moduleId: this.context.module.id
- }
- ]) || ((_a = importMetaMechanisms[format]) === null || _a === void 0 ? void 0 : _a.call(importMetaMechanisms, metaProperty, chunkId));
- if (typeof replacement === 'string') {
- if (parent instanceof MemberExpression) {
- code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
- }
- else {
- code.overwrite(this.start, this.end, replacement, { contentOnly: true });
- }
- }
- }
- }
- const accessedMetaUrlGlobals = {
- amd: ['document', 'module', 'URL'],
- cjs: ['document', 'require', 'URL'],
- es: [],
- iife: ['document', 'URL'],
- system: ['module'],
- umd: ['document', 'require', 'URL']
- };
- const accessedFileUrlGlobals = {
- amd: ['document', 'require', 'URL'],
- cjs: ['document', 'require', 'URL'],
- es: [],
- iife: ['document', 'URL'],
- system: ['module', 'URL'],
- umd: ['document', 'require', 'URL']
- };
- const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
- const getRelativeUrlFromDocument = (relativePath) => getResolveUrl(`'${relativePath}', document.currentScript && document.currentScript.src || document.baseURI`);
- const getGenericImportMetaMechanism = (getUrl) => (prop, chunkId) => {
- const urlMechanism = getUrl(chunkId);
- return prop === null ? `({ url: ${urlMechanism} })` : prop === 'url' ? urlMechanism : 'undefined';
- };
- const getUrlFromDocument = (chunkId) => `(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
- const relativeUrlMechanisms = {
- amd: relativePath => {
- if (relativePath[0] !== '.')
- relativePath = './' + relativePath;
- return getResolveUrl(`require.toUrl('${relativePath}'), document.baseURI`);
- },
- cjs: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`,
- es: relativePath => getResolveUrl(`'${relativePath}', import.meta.url`),
- iife: relativePath => getRelativeUrlFromDocument(relativePath),
- system: relativePath => getResolveUrl(`'${relativePath}', module.meta.url`),
- umd: relativePath => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __dirname + '/${relativePath}'`, `(require('u' + 'rl').URL)`)} : ${getRelativeUrlFromDocument(relativePath)})`
- };
- const importMetaMechanisms = {
- amd: getGenericImportMetaMechanism(() => getResolveUrl(`module.uri, document.baseURI`)),
- cjs: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`),
- iife: getGenericImportMetaMechanism(chunkId => getUrlFromDocument(chunkId)),
- system: prop => (prop === null ? `module.meta` : `module.meta.${prop}`),
- umd: getGenericImportMetaMechanism(chunkId => `(typeof document === 'undefined' ? ${getResolveUrl(`'file:' + __filename`, `(require('u' + 'rl').URL)`)} : ${getUrlFromDocument(chunkId)})`)
- };
- class NewExpression extends NodeBase {
- bind() {
- super.bind();
- for (const argument of this.arguments) {
- // This will make sure all properties of parameters behave as "unknown"
- argument.deoptimizePath(UNKNOWN_PATH);
- }
- }
- hasEffects(context) {
- var _a;
- for (const argument of this.arguments) {
- if (argument.hasEffects(context))
- return true;
- }
- if (this.context.options.treeshake.annotations && ((_a = this.annotations) === null || _a === void 0 ? void 0 : _a.some((a) => a.pure)))
- return false;
- return (this.callee.hasEffects(context) ||
- this.callee.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- initialise() {
- this.callOptions = {
- args: this.arguments,
- withNew: true
- };
- }
- }
- class ObjectExpression extends NodeBase {
- constructor() {
- super(...arguments);
- this.deoptimizedPaths = new Set();
- // We collect deoptimization information if we can resolve a computed property access
- this.expressionsToBeDeoptimized = new Map();
- this.hasUnknownDeoptimizedProperty = false;
- this.propertyMap = null;
- this.unmatchablePropertiesRead = [];
- this.unmatchablePropertiesWrite = [];
- }
- bind() {
- super.bind();
- // ensure the propertyMap is set for the tree-shaking passes
- this.getPropertyMap();
- }
- // We could also track this per-property but this would quickly become much more complex
- deoptimizeCache() {
- if (!this.hasUnknownDeoptimizedProperty)
- this.deoptimizeAllProperties();
- }
- deoptimizePath(path) {
- if (this.hasUnknownDeoptimizedProperty)
- return;
- const propertyMap = this.getPropertyMap();
- const key = path[0];
- if (path.length === 1) {
- if (typeof key !== 'string') {
- this.deoptimizeAllProperties();
- return;
- }
- if (!this.deoptimizedPaths.has(key)) {
- this.deoptimizedPaths.add(key);
- // we only deoptimizeCache exact matches as in all other cases,
- // we do not return a literal value or return expression
- const expressionsToBeDeoptimized = this.expressionsToBeDeoptimized.get(key);
- if (expressionsToBeDeoptimized) {
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- }
- }
- const subPath = path.length === 1 ? UNKNOWN_PATH : path.slice(1);
- for (const property of typeof key === 'string'
- ? propertyMap[key]
- ? propertyMap[key].propertiesRead
- : []
- : this.properties) {
- property.deoptimizePath(subPath);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- const propertyMap = this.getPropertyMap();
- const key = path[0];
- if (path.length === 0 ||
- this.hasUnknownDeoptimizedProperty ||
- typeof key !== 'string' ||
- this.deoptimizedPaths.has(key)) {
- return UnknownValue;
- }
- if (path.length === 1 &&
- !propertyMap[key] &&
- !objectMembers[key] &&
- this.unmatchablePropertiesRead.length === 0) {
- getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
- return undefined;
- }
- if (!propertyMap[key] ||
- propertyMap[key].exactMatchRead === null ||
- propertyMap[key].propertiesRead.length > 1) {
- return UnknownValue;
- }
- getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
- return propertyMap[key].exactMatchRead.getLiteralValueAtPath(path.slice(1), recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- const propertyMap = this.getPropertyMap();
- const key = path[0];
- if (path.length === 0 ||
- this.hasUnknownDeoptimizedProperty ||
- typeof key !== 'string' ||
- this.deoptimizedPaths.has(key)) {
- return UNKNOWN_EXPRESSION;
- }
- if (path.length === 1 &&
- objectMembers[key] &&
- this.unmatchablePropertiesRead.length === 0 &&
- (!propertyMap[key] || propertyMap[key].exactMatchRead === null)) {
- return getMemberReturnExpressionWhenCalled(objectMembers, key);
- }
- if (!propertyMap[key] ||
- propertyMap[key].exactMatchRead === null ||
- propertyMap[key].propertiesRead.length > 1) {
- return UNKNOWN_EXPRESSION;
- }
- getOrCreate(this.expressionsToBeDeoptimized, key, () => []).push(origin);
- return propertyMap[key].exactMatchRead.getReturnExpressionWhenCalledAtPath(path.slice(1), recursionTracker, origin);
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (path.length === 0)
- return false;
- const key = path[0];
- const propertyMap = this.propertyMap;
- if (path.length > 1 &&
- (this.hasUnknownDeoptimizedProperty ||
- typeof key !== 'string' ||
- this.deoptimizedPaths.has(key) ||
- !propertyMap[key] ||
- propertyMap[key].exactMatchRead === null))
- return true;
- const subPath = path.slice(1);
- for (const property of typeof key !== 'string'
- ? this.properties
- : propertyMap[key]
- ? propertyMap[key].propertiesRead
- : []) {
- if (property.hasEffectsWhenAccessedAtPath(subPath, context))
- return true;
- }
- return false;
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- const key = path[0];
- const propertyMap = this.propertyMap;
- if (path.length > 1 &&
- (this.hasUnknownDeoptimizedProperty ||
- this.deoptimizedPaths.has(key) ||
- !propertyMap[key] ||
- propertyMap[key].exactMatchRead === null)) {
- return true;
- }
- const subPath = path.slice(1);
- for (const property of typeof key !== 'string'
- ? this.properties
- : path.length > 1
- ? propertyMap[key].propertiesRead
- : propertyMap[key]
- ? propertyMap[key].propertiesWrite
- : []) {
- if (property.hasEffectsWhenAssignedAtPath(subPath, context))
- return true;
- }
- return false;
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- const key = path[0];
- if (typeof key !== 'string' ||
- this.hasUnknownDeoptimizedProperty ||
- this.deoptimizedPaths.has(key) ||
- (this.propertyMap[key]
- ? !this.propertyMap[key].exactMatchRead
- : path.length > 1 || !objectMembers[key])) {
- return true;
- }
- const subPath = path.slice(1);
- if (this.propertyMap[key]) {
- for (const property of this.propertyMap[key].propertiesRead) {
- if (property.hasEffectsWhenCalledAtPath(subPath, callOptions, context))
- return true;
- }
- }
- if (path.length === 1 && objectMembers[key])
- return hasMemberEffectWhenCalled(objectMembers, key, this.included, callOptions, context);
- return false;
- }
- render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
- super.render(code, options);
- const surroundingElement = renderedParentType || renderedSurroundingElement;
- if (surroundingElement === ExpressionStatement$1 ||
- surroundingElement === ArrowFunctionExpression$1) {
- code.appendRight(this.start, '(');
- code.prependLeft(this.end, ')');
- }
- }
- deoptimizeAllProperties() {
- this.hasUnknownDeoptimizedProperty = true;
- for (const property of this.properties) {
- property.deoptimizePath(UNKNOWN_PATH);
- }
- for (const expressionsToBeDeoptimized of this.expressionsToBeDeoptimized.values()) {
- for (const expression of expressionsToBeDeoptimized) {
- expression.deoptimizeCache();
- }
- }
- }
- getPropertyMap() {
- if (this.propertyMap !== null) {
- return this.propertyMap;
- }
- const propertyMap = (this.propertyMap = Object.create(null));
- for (let index = this.properties.length - 1; index >= 0; index--) {
- const property = this.properties[index];
- if (property instanceof SpreadElement) {
- this.unmatchablePropertiesRead.push(property);
- continue;
- }
- const isWrite = property.kind !== 'get';
- const isRead = property.kind !== 'set';
- let key;
- if (property.computed) {
- const keyValue = property.key.getLiteralValueAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this);
- if (keyValue === UnknownValue) {
- if (isRead) {
- this.unmatchablePropertiesRead.push(property);
- }
- else {
- this.unmatchablePropertiesWrite.push(property);
- }
- continue;
- }
- key = String(keyValue);
- }
- else if (property.key instanceof Identifier) {
- key = property.key.name;
- }
- else {
- key = String(property.key.value);
- }
- const propertyMapProperty = propertyMap[key];
- if (!propertyMapProperty) {
- propertyMap[key] = {
- exactMatchRead: isRead ? property : null,
- exactMatchWrite: isWrite ? property : null,
- propertiesRead: isRead ? [property, ...this.unmatchablePropertiesRead] : [],
- propertiesWrite: isWrite && !isRead ? [property, ...this.unmatchablePropertiesWrite] : []
- };
- continue;
- }
- if (isRead && propertyMapProperty.exactMatchRead === null) {
- propertyMapProperty.exactMatchRead = property;
- propertyMapProperty.propertiesRead.push(property, ...this.unmatchablePropertiesRead);
- }
- if (isWrite && !isRead && propertyMapProperty.exactMatchWrite === null) {
- propertyMapProperty.exactMatchWrite = property;
- propertyMapProperty.propertiesWrite.push(property, ...this.unmatchablePropertiesWrite);
- }
- }
- return propertyMap;
- }
- }
- class ObjectPattern extends NodeBase {
- addExportedVariables(variables, exportNamesByVariable) {
- for (const property of this.properties) {
- if (property.type === Property$1) {
- property.value.addExportedVariables(variables, exportNamesByVariable);
- }
- else {
- property.argument.addExportedVariables(variables, exportNamesByVariable);
- }
- }
- }
- declare(kind, init) {
- const variables = [];
- for (const property of this.properties) {
- variables.push(...property.declare(kind, init));
- }
- return variables;
- }
- deoptimizePath(path) {
- if (path.length === 0) {
- for (const property of this.properties) {
- property.deoptimizePath(path);
- }
- }
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (path.length > 0)
- return true;
- for (const property of this.properties) {
- if (property.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context))
- return true;
- }
- return false;
- }
- }
- class PrivateIdentifier extends NodeBase {
- }
- class Program extends NodeBase {
- constructor() {
- super(...arguments);
- this.hasCachedEffect = false;
- }
- hasEffects(context) {
- // We are caching here to later more efficiently identify side-effect-free modules
- if (this.hasCachedEffect)
- return true;
- for (const node of this.body) {
- if (node.hasEffects(context)) {
- return (this.hasCachedEffect = true);
- }
- }
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- for (const node of this.body) {
- if (includeChildrenRecursively || node.shouldBeIncluded(context)) {
- node.include(context, includeChildrenRecursively);
- }
- }
- }
- render(code, options) {
- if (this.body.length) {
- renderStatementList(this.body, code, this.start, this.end, options);
- }
- else {
- super.render(code, options);
- }
- }
- }
- class Property extends NodeBase {
- constructor() {
- super(...arguments);
- this.declarationInit = null;
- this.returnExpression = null;
- }
- bind() {
- super.bind();
- if (this.kind === 'get') {
- // ensure the returnExpression is set for the tree-shaking passes
- this.getReturnExpression();
- }
- if (this.declarationInit !== null) {
- this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
- }
- }
- declare(kind, init) {
- this.declarationInit = init;
- return this.value.declare(kind, UNKNOWN_EXPRESSION);
- }
- // As getter properties directly receive their values from function expressions that always
- // have a fixed return value, there is no known situation where a getter is deoptimized.
- deoptimizeCache() { }
- deoptimizePath(path) {
- if (this.kind === 'get') {
- this.getReturnExpression().deoptimizePath(path);
- }
- else {
- this.value.deoptimizePath(path);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (this.kind === 'get') {
- return this.getReturnExpression().getLiteralValueAtPath(path, recursionTracker, origin);
- }
- return this.value.getLiteralValueAtPath(path, recursionTracker, origin);
- }
- getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin) {
- if (this.kind === 'get') {
- return this.getReturnExpression().getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- return this.value.getReturnExpressionWhenCalledAtPath(path, recursionTracker, origin);
- }
- hasEffects(context) {
- const propertyReadSideEffects = this.context.options.treeshake.propertyReadSideEffects;
- return this.parent.type === 'ObjectPattern' && propertyReadSideEffects === 'always' ||
- this.key.hasEffects(context) ||
- this.value.hasEffects(context);
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- if (this.kind === 'get') {
- const trackedExpressions = context.accessed.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return (this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context) ||
- (path.length > 0 && this.returnExpression.hasEffectsWhenAccessedAtPath(path, context)));
- }
- return this.value.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- if (this.kind === 'get') {
- const trackedExpressions = context.assigned.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.returnExpression.hasEffectsWhenAssignedAtPath(path, context);
- }
- if (this.kind === 'set') {
- const trackedExpressions = context.assigned.getEntities(path);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.value.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.accessorCallOptions, context);
- }
- return this.value.hasEffectsWhenAssignedAtPath(path, context);
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- if (this.kind === 'get') {
- const trackedExpressions = (callOptions.withNew
- ? context.instantiated
- : context.called).getEntities(path, callOptions);
- if (trackedExpressions.has(this))
- return false;
- trackedExpressions.add(this);
- return this.returnExpression.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- return this.value.hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- initialise() {
- this.accessorCallOptions = {
- args: NO_ARGS,
- withNew: false
- };
- }
- render(code, options) {
- if (!this.shorthand) {
- this.key.render(code, options);
- }
- this.value.render(code, options, { isShorthandProperty: this.shorthand });
- }
- getReturnExpression() {
- if (this.returnExpression === null) {
- this.returnExpression = UNKNOWN_EXPRESSION;
- return (this.returnExpression = this.value.getReturnExpressionWhenCalledAtPath(EMPTY_PATH, SHARED_RECURSION_TRACKER, this));
- }
- return this.returnExpression;
- }
- }
- class PropertyDefinition extends NodeBase {
- hasEffects(context) {
- return (this.key.hasEffects(context) ||
- (this.static && this.value !== null && this.value.hasEffects(context)));
- }
- }
- class ReturnStatement extends NodeBase {
- hasEffects(context) {
- if (!context.ignore.returnAwaitYield ||
- (this.argument !== null && this.argument.hasEffects(context)))
- return true;
- context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (this.argument) {
- this.argument.include(context, includeChildrenRecursively);
- }
- context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
- }
- initialise() {
- this.scope.addReturnExpression(this.argument || UNKNOWN_EXPRESSION);
- }
- render(code, options) {
- if (this.argument) {
- this.argument.render(code, options, { preventASI: true });
- if (this.argument.start === this.start + 6 /* 'return'.length */) {
- code.prependLeft(this.start + 6, ' ');
- }
- }
- }
- }
- class SequenceExpression extends NodeBase {
- deoptimizePath(path) {
- if (path.length > 0)
- this.expressions[this.expressions.length - 1].deoptimizePath(path);
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin);
- }
- hasEffects(context) {
- for (const expression of this.expressions) {
- if (expression.hasEffects(context))
- return true;
- }
- return false;
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- return (path.length > 0 &&
- this.expressions[this.expressions.length - 1].hasEffectsWhenAccessedAtPath(path, context));
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return (path.length === 0 ||
- this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context));
- }
- hasEffectsWhenCalledAtPath(path, callOptions, context) {
- return this.expressions[this.expressions.length - 1].hasEffectsWhenCalledAtPath(path, callOptions, context);
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- for (let i = 0; i < this.expressions.length - 1; i++) {
- const node = this.expressions[i];
- if (includeChildrenRecursively || node.shouldBeIncluded(context))
- node.include(context, includeChildrenRecursively);
- }
- this.expressions[this.expressions.length - 1].include(context, includeChildrenRecursively);
- }
- render(code, options, { renderedParentType, isCalleeOfRenderedParent, preventASI } = BLANK) {
- let includedNodes = 0;
- for (const { node, start, end } of getCommaSeparatedNodesWithBoundaries(this.expressions, code, this.start, this.end)) {
- if (!node.included) {
- treeshakeNode(node, code, start, end);
- continue;
- }
- includedNodes++;
- if (includedNodes === 1 && preventASI) {
- removeLineBreaks(code, start, node.start);
- }
- if (node === this.expressions[this.expressions.length - 1] && includedNodes === 1) {
- node.render(code, options, {
- isCalleeOfRenderedParent: renderedParentType
- ? isCalleeOfRenderedParent
- : this.parent.callee === this,
- renderedParentType: renderedParentType || this.parent.type
- });
- }
- else {
- node.render(code, options);
- }
- }
- }
- }
- class Super extends NodeBase {
- }
- class SwitchCase extends NodeBase {
- hasEffects(context) {
- if (this.test && this.test.hasEffects(context))
- return true;
- for (const node of this.consequent) {
- if (context.brokenFlow)
- break;
- if (node.hasEffects(context))
- return true;
- }
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (this.test)
- this.test.include(context, includeChildrenRecursively);
- for (const node of this.consequent) {
- if (includeChildrenRecursively || node.shouldBeIncluded(context))
- node.include(context, includeChildrenRecursively);
- }
- }
- render(code, options, nodeRenderOptions) {
- if (this.consequent.length) {
- this.test && this.test.render(code, options);
- const testEnd = this.test
- ? this.test.end
- : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
- const consequentStart = findFirstOccurrenceOutsideComment(code.original, ':', testEnd) + 1;
- renderStatementList(this.consequent, code, consequentStart, nodeRenderOptions.end, options);
- }
- else {
- super.render(code, options);
- }
- }
- }
- SwitchCase.prototype.needsBoundaries = true;
- class SwitchStatement extends NodeBase {
- createScope(parentScope) {
- this.scope = new BlockScope(parentScope);
- }
- hasEffects(context) {
- if (this.discriminant.hasEffects(context))
- return true;
- const { brokenFlow, ignore: { breaks } } = context;
- let minBrokenFlow = Infinity;
- context.ignore.breaks = true;
- for (const switchCase of this.cases) {
- if (switchCase.hasEffects(context))
- return true;
- minBrokenFlow = context.brokenFlow < minBrokenFlow ? context.brokenFlow : minBrokenFlow;
- context.brokenFlow = brokenFlow;
- }
- if (this.defaultCase !== null && !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
- context.brokenFlow = minBrokenFlow;
- }
- context.ignore.breaks = breaks;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.discriminant.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- let minBrokenFlow = Infinity;
- let isCaseIncluded = includeChildrenRecursively ||
- (this.defaultCase !== null && this.defaultCase < this.cases.length - 1);
- for (let caseIndex = this.cases.length - 1; caseIndex >= 0; caseIndex--) {
- const switchCase = this.cases[caseIndex];
- if (switchCase.included) {
- isCaseIncluded = true;
- }
- if (!isCaseIncluded) {
- const hasEffectsContext = createHasEffectsContext();
- hasEffectsContext.ignore.breaks = true;
- isCaseIncluded = switchCase.hasEffects(hasEffectsContext);
- }
- if (isCaseIncluded) {
- switchCase.include(context, includeChildrenRecursively);
- minBrokenFlow = minBrokenFlow < context.brokenFlow ? minBrokenFlow : context.brokenFlow;
- context.brokenFlow = brokenFlow;
- }
- else {
- minBrokenFlow = brokenFlow;
- }
- }
- if (isCaseIncluded &&
- this.defaultCase !== null &&
- !(minBrokenFlow === BROKEN_FLOW_BREAK_CONTINUE)) {
- context.brokenFlow = minBrokenFlow;
- }
- }
- initialise() {
- for (let caseIndex = 0; caseIndex < this.cases.length; caseIndex++) {
- if (this.cases[caseIndex].test === null) {
- this.defaultCase = caseIndex;
- return;
- }
- }
- this.defaultCase = null;
- }
- render(code, options) {
- this.discriminant.render(code, options);
- if (this.cases.length > 0) {
- renderStatementList(this.cases, code, this.cases[0].start, this.end - 1, options);
- }
- }
- }
- class TaggedTemplateExpression extends NodeBase {
- bind() {
- super.bind();
- if (this.tag.type === Identifier$1) {
- const name = this.tag.name;
- const variable = this.scope.findVariable(name);
- if (variable.isNamespace) {
- this.context.warn({
- code: 'CANNOT_CALL_NAMESPACE',
- message: `Cannot call a namespace ('${name}')`,
- }, this.start);
- }
- if (name === 'eval') {
- this.context.warn({
- code: 'EVAL',
- message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
- url: 'https://rollupjs.org/guide/en/#avoiding-eval',
- }, this.start);
- }
- }
- }
- hasEffects(context) {
- return (super.hasEffects(context) ||
- this.tag.hasEffectsWhenCalledAtPath(EMPTY_PATH, this.callOptions, context));
- }
- initialise() {
- this.callOptions = {
- args: NO_ARGS,
- withNew: false,
- };
- }
- }
- class TemplateElement extends NodeBase {
- bind() { }
- hasEffects() {
- return false;
- }
- include() {
- this.included = true;
- }
- parseNode(esTreeNode) {
- this.value = esTreeNode.value;
- super.parseNode(esTreeNode);
- }
- render() { }
- }
- class TemplateLiteral extends NodeBase {
- getLiteralValueAtPath(path) {
- if (path.length > 0 || this.quasis.length !== 1) {
- return UnknownValue;
- }
- return this.quasis[0].value.cooked;
- }
- render(code, options) {
- code.indentExclusionRanges.push([this.start, this.end]);
- super.render(code, options);
- }
- }
- class ModuleScope extends ChildScope {
- constructor(parent, context) {
- super(parent);
- this.context = context;
- this.variables.set('this', new LocalVariable('this', null, UNDEFINED_EXPRESSION, context));
- }
- addExportDefaultDeclaration(name, exportDefaultDeclaration, context) {
- const variable = new ExportDefaultVariable(name, exportDefaultDeclaration, context);
- this.variables.set('default', variable);
- return variable;
- }
- addNamespaceMemberAccess() { }
- deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
- // all module level variables are already deconflicted when deconflicting the chunk
- for (const scope of this.children)
- scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
- }
- findLexicalBoundary() {
- return this;
- }
- findVariable(name) {
- const knownVariable = this.variables.get(name) || this.accessedOutsideVariables.get(name);
- if (knownVariable) {
- return knownVariable;
- }
- const variable = this.context.traceVariable(name) || this.parent.findVariable(name);
- if (variable instanceof GlobalVariable) {
- this.accessedOutsideVariables.set(name, variable);
- }
- return variable;
- }
- }
- class ThisExpression extends NodeBase {
- bind() {
- super.bind();
- this.variable = this.scope.findVariable('this');
- }
- hasEffectsWhenAccessedAtPath(path, context) {
- return path.length > 0 && this.variable.hasEffectsWhenAccessedAtPath(path, context);
- }
- hasEffectsWhenAssignedAtPath(path, context) {
- return this.variable.hasEffectsWhenAssignedAtPath(path, context);
- }
- initialise() {
- this.alias =
- this.scope.findLexicalBoundary() instanceof ModuleScope ? this.context.moduleContext : null;
- if (this.alias === 'undefined') {
- this.context.warn({
- code: 'THIS_IS_UNDEFINED',
- message: `The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten`,
- url: `https://rollupjs.org/guide/en/#error-this-is-undefined`
- }, this.start);
- }
- }
- render(code) {
- if (this.alias !== null) {
- code.overwrite(this.start, this.end, this.alias, {
- contentOnly: false,
- storeName: true
- });
- }
- }
- }
- class ThrowStatement extends NodeBase {
- hasEffects() {
- return true;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.argument.include(context, includeChildrenRecursively);
- context.brokenFlow = BROKEN_FLOW_ERROR_RETURN_LABEL;
- }
- render(code, options) {
- this.argument.render(code, options, { preventASI: true });
- if (this.argument.start === this.start + 5 /* 'throw'.length */) {
- code.prependLeft(this.start + 5, ' ');
- }
- }
- }
- class TryStatement extends NodeBase {
- constructor() {
- super(...arguments);
- this.directlyIncluded = false;
- this.includedLabelsAfterBlock = null;
- }
- hasEffects(context) {
- return ((this.context.options.treeshake.tryCatchDeoptimization
- ? this.block.body.length > 0
- : this.block.hasEffects(context)) ||
- (this.finalizer !== null && this.finalizer.hasEffects(context)));
- }
- include(context, includeChildrenRecursively) {
- var _a;
- const tryCatchDeoptimization = (_a = this.context.options.treeshake) === null || _a === void 0 ? void 0 : _a.tryCatchDeoptimization;
- const { brokenFlow } = context;
- if (!this.directlyIncluded || !tryCatchDeoptimization) {
- this.included = true;
- this.directlyIncluded = true;
- this.block.include(context, tryCatchDeoptimization ? INCLUDE_PARAMETERS : includeChildrenRecursively);
- if (context.includedLabels.size > 0) {
- this.includedLabelsAfterBlock = [...context.includedLabels];
- }
- context.brokenFlow = brokenFlow;
- }
- else if (this.includedLabelsAfterBlock) {
- for (const label of this.includedLabelsAfterBlock) {
- context.includedLabels.add(label);
- }
- }
- if (this.handler !== null) {
- this.handler.include(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- if (this.finalizer !== null) {
- this.finalizer.include(context, includeChildrenRecursively);
- }
- }
- }
- const unaryOperators = {
- '!': value => !value,
- '+': value => +value,
- '-': value => -value,
- delete: () => UnknownValue,
- typeof: value => typeof value,
- void: () => undefined,
- '~': value => ~value
- };
- class UnaryExpression extends NodeBase {
- bind() {
- super.bind();
- if (this.operator === 'delete') {
- this.argument.deoptimizePath(EMPTY_PATH);
- }
- }
- getLiteralValueAtPath(path, recursionTracker, origin) {
- if (path.length > 0)
- return UnknownValue;
- const argumentValue = this.argument.getLiteralValueAtPath(EMPTY_PATH, recursionTracker, origin);
- if (argumentValue === UnknownValue)
- return UnknownValue;
- return unaryOperators[this.operator](argumentValue);
- }
- hasEffects(context) {
- if (this.operator === 'typeof' && this.argument instanceof Identifier)
- return false;
- return (this.argument.hasEffects(context) ||
- (this.operator === 'delete' &&
- this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context)));
- }
- hasEffectsWhenAccessedAtPath(path) {
- if (this.operator === 'void') {
- return path.length > 0;
- }
- return path.length > 1;
- }
- }
- class UnknownNode extends NodeBase {
- hasEffects() {
- return true;
- }
- include(context) {
- super.include(context, true);
- }
- }
- class UpdateExpression extends NodeBase {
- bind() {
- super.bind();
- this.argument.deoptimizePath(EMPTY_PATH);
- if (this.argument instanceof Identifier) {
- const variable = this.scope.findVariable(this.argument.name);
- variable.isReassigned = true;
- }
- }
- hasEffects(context) {
- return (this.argument.hasEffects(context) ||
- this.argument.hasEffectsWhenAssignedAtPath(EMPTY_PATH, context));
- }
- hasEffectsWhenAccessedAtPath(path) {
- return path.length > 1;
- }
- render(code, options) {
- this.argument.render(code, options);
- if (options.format === 'system') {
- const variable = this.argument.variable;
- const exportNames = options.exportNamesByVariable.get(variable);
- if (exportNames && exportNames.length) {
- const _ = options.compact ? '' : ' ';
- const name = variable.getName();
- if (this.prefix) {
- if (exportNames.length === 1) {
- code.overwrite(this.start, this.end, `exports('${exportNames[0]}',${_}${this.operator}${name})`);
- }
- else {
- code.overwrite(this.start, this.end, `(${this.operator}${name},${_}${getSystemExportStatement([variable], options)},${_}${name})`);
- }
- }
- else if (exportNames.length > 1) {
- code.overwrite(this.start, this.end, `(${getSystemExportFunctionLeft([variable], false, options)}${this.operator}${name}))`);
- }
- else {
- let op;
- switch (this.operator) {
- case '++':
- op = `${name}${_}+${_}1`;
- break;
- case '--':
- op = `${name}${_}-${_}1`;
- break;
- }
- code.overwrite(this.start, this.end, `(exports('${exportNames[0]}',${_}${op}),${_}${name}${this.operator})`);
- }
- }
- }
- }
- }
- function isReassignedExportsMember(variable, exportNamesByVariable) {
- return (variable.renderBaseName !== null && exportNamesByVariable.has(variable) && variable.isReassigned);
- }
- function areAllDeclarationsIncludedAndNotExported(declarations, exportNamesByVariable) {
- for (const declarator of declarations) {
- if (!declarator.id.included)
- return false;
- if (declarator.id.type === Identifier$1) {
- if (exportNamesByVariable.has(declarator.id.variable))
- return false;
- }
- else {
- const exportedVariables = [];
- declarator.id.addExportedVariables(exportedVariables, exportNamesByVariable);
- if (exportedVariables.length > 0)
- return false;
- }
- }
- return true;
- }
- class VariableDeclaration extends NodeBase {
- deoptimizePath() {
- for (const declarator of this.declarations) {
- declarator.deoptimizePath(EMPTY_PATH);
- }
- }
- hasEffectsWhenAssignedAtPath() {
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- for (const declarator of this.declarations) {
- if (includeChildrenRecursively || declarator.shouldBeIncluded(context))
- declarator.include(context, includeChildrenRecursively);
- }
- }
- includeAsSingleStatement(context, includeChildrenRecursively) {
- this.included = true;
- for (const declarator of this.declarations) {
- if (includeChildrenRecursively || declarator.shouldBeIncluded(context)) {
- declarator.include(context, includeChildrenRecursively);
- declarator.id.include(context, includeChildrenRecursively);
- }
- }
- }
- initialise() {
- for (const declarator of this.declarations) {
- declarator.declareDeclarator(this.kind);
- }
- }
- render(code, options, nodeRenderOptions = BLANK) {
- if (areAllDeclarationsIncludedAndNotExported(this.declarations, options.exportNamesByVariable)) {
- for (const declarator of this.declarations) {
- declarator.render(code, options);
- }
- if (!nodeRenderOptions.isNoStatement &&
- code.original.charCodeAt(this.end - 1) !== 59 /*";"*/) {
- code.appendLeft(this.end, ';');
- }
- }
- else {
- this.renderReplacedDeclarations(code, options, nodeRenderOptions);
- }
- }
- renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement) {
- if (code.original.charCodeAt(this.end - 1) === 59 /*";"*/) {
- code.remove(this.end - 1, this.end);
- }
- if (!isNoStatement) {
- separatorString += ';';
- }
- if (lastSeparatorPos !== null) {
- if (code.original.charCodeAt(actualContentEnd - 1) === 10 /*"\n"*/ &&
- (code.original.charCodeAt(this.end) === 10 /*"\n"*/ ||
- code.original.charCodeAt(this.end) === 13) /*"\r"*/) {
- actualContentEnd--;
- if (code.original.charCodeAt(actualContentEnd) === 13 /*"\r"*/) {
- actualContentEnd--;
- }
- }
- if (actualContentEnd === lastSeparatorPos + 1) {
- code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString);
- }
- else {
- code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
- code.remove(actualContentEnd, renderedContentEnd);
- }
- }
- else {
- code.appendLeft(renderedContentEnd, separatorString);
- }
- if (systemPatternExports.length > 0) {
- code.appendLeft(renderedContentEnd, ` ${getSystemExportStatement(systemPatternExports, options)};`);
- }
- }
- renderReplacedDeclarations(code, options, { isNoStatement }) {
- const separatedNodes = getCommaSeparatedNodesWithBoundaries(this.declarations, code, this.start + this.kind.length, this.end - (code.original.charCodeAt(this.end - 1) === 59 /*";"*/ ? 1 : 0));
- let actualContentEnd, renderedContentEnd;
- renderedContentEnd = findNonWhiteSpace(code.original, this.start + this.kind.length);
- let lastSeparatorPos = renderedContentEnd - 1;
- code.remove(this.start, lastSeparatorPos);
- let isInDeclaration = false;
- let hasRenderedContent = false;
- let separatorString = '', leadingString, nextSeparatorString;
- const systemPatternExports = [];
- for (const { node, start, separator, contentEnd, end } of separatedNodes) {
- if (!node.included) {
- code.remove(start, end);
- continue;
- }
- leadingString = '';
- nextSeparatorString = '';
- if (!node.id.included ||
- (node.id instanceof Identifier &&
- isReassignedExportsMember(node.id.variable, options.exportNamesByVariable))) {
- if (hasRenderedContent) {
- separatorString += ';';
- }
- isInDeclaration = false;
- }
- else {
- if (options.format === 'system' && node.init !== null) {
- if (node.id.type !== Identifier$1) {
- node.id.addExportedVariables(systemPatternExports, options.exportNamesByVariable);
- }
- else {
- const exportNames = options.exportNamesByVariable.get(node.id.variable);
- if (exportNames) {
- const _ = options.compact ? '' : ' ';
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', node.id.end);
- code.prependLeft(findNonWhiteSpace(code.original, operatorPos + 1), exportNames.length === 1
- ? `exports('${exportNames[0]}',${_}`
- : getSystemExportFunctionLeft([node.id.variable], false, options));
- nextSeparatorString += ')';
- }
- }
- }
- if (isInDeclaration) {
- separatorString += ',';
- }
- else {
- if (hasRenderedContent) {
- separatorString += ';';
- }
- leadingString += `${this.kind} `;
- isInDeclaration = true;
- }
- }
- if (renderedContentEnd === lastSeparatorPos + 1) {
- code.overwrite(lastSeparatorPos, renderedContentEnd, separatorString + leadingString);
- }
- else {
- code.overwrite(lastSeparatorPos, lastSeparatorPos + 1, separatorString);
- code.appendLeft(renderedContentEnd, leadingString);
- }
- node.render(code, options);
- actualContentEnd = contentEnd;
- renderedContentEnd = end;
- hasRenderedContent = true;
- lastSeparatorPos = separator;
- separatorString = nextSeparatorString;
- }
- this.renderDeclarationEnd(code, separatorString, lastSeparatorPos, actualContentEnd, renderedContentEnd, systemPatternExports, options, isNoStatement);
- }
- }
- class VariableDeclarator extends NodeBase {
- declareDeclarator(kind) {
- this.id.declare(kind, this.init || UNDEFINED_EXPRESSION);
- }
- deoptimizePath(path) {
- this.id.deoptimizePath(path);
- }
- hasEffects(context) {
- return this.id.hasEffects(context) || (this.init !== null && this.init.hasEffects(context));
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- if (includeChildrenRecursively || this.id.shouldBeIncluded(context)) {
- this.id.include(context, includeChildrenRecursively);
- }
- if (this.init) {
- this.init.include(context, includeChildrenRecursively);
- }
- }
- render(code, options) {
- const renderId = this.id.included;
- if (renderId) {
- this.id.render(code, options);
- }
- else {
- const operatorPos = findFirstOccurrenceOutsideComment(code.original, '=', this.id.end);
- code.remove(this.start, findNonWhiteSpace(code.original, operatorPos + 1));
- }
- if (this.init) {
- this.init.render(code, options, renderId ? BLANK : { renderedParentType: ExpressionStatement$1 });
- }
- else if (this.id instanceof Identifier &&
- isReassignedExportsMember(this.id.variable, options.exportNamesByVariable)) {
- const _ = options.compact ? '' : ' ';
- code.appendLeft(this.end, `${_}=${_}void 0`);
- }
- }
- }
- class WhileStatement extends NodeBase {
- hasEffects(context) {
- if (this.test.hasEffects(context))
- return true;
- const { brokenFlow, ignore: { breaks, continues } } = context;
- context.ignore.breaks = true;
- context.ignore.continues = true;
- if (this.body.hasEffects(context))
- return true;
- context.ignore.breaks = breaks;
- context.ignore.continues = continues;
- context.brokenFlow = brokenFlow;
- return false;
- }
- include(context, includeChildrenRecursively) {
- this.included = true;
- this.test.include(context, includeChildrenRecursively);
- const { brokenFlow } = context;
- this.body.includeAsSingleStatement(context, includeChildrenRecursively);
- context.brokenFlow = brokenFlow;
- }
- }
- class YieldExpression extends NodeBase {
- bind() {
- super.bind();
- if (this.argument !== null) {
- this.argument.deoptimizePath(UNKNOWN_PATH);
- }
- }
- hasEffects(context) {
- return (!context.ignore.returnAwaitYield ||
- (this.argument !== null && this.argument.hasEffects(context)));
- }
- render(code, options) {
- if (this.argument) {
- this.argument.render(code, options, { preventASI: true });
- if (this.argument.start === this.start + 5 /* 'yield'.length */) {
- code.prependLeft(this.start + 5, ' ');
- }
- }
- }
- }
- const nodeConstructors = {
- ArrayExpression,
- ArrayPattern,
- ArrowFunctionExpression,
- AssignmentExpression,
- AssignmentPattern,
- AwaitExpression,
- BinaryExpression,
- BlockStatement,
- BreakStatement,
- CallExpression,
- CatchClause,
- ChainExpression,
- ClassBody,
- ClassDeclaration,
- ClassExpression,
- ConditionalExpression,
- ContinueStatement,
- DoWhileStatement,
- EmptyStatement,
- ExportAllDeclaration,
- ExportDefaultDeclaration,
- ExportNamedDeclaration,
- ExportSpecifier,
- ExpressionStatement,
- ForInStatement,
- ForOfStatement,
- ForStatement,
- FunctionDeclaration,
- FunctionExpression,
- Identifier,
- IfStatement,
- ImportDeclaration,
- ImportDefaultSpecifier,
- ImportExpression,
- ImportNamespaceSpecifier,
- ImportSpecifier,
- LabeledStatement,
- Literal,
- LogicalExpression,
- MemberExpression,
- MetaProperty,
- MethodDefinition,
- NewExpression,
- ObjectExpression,
- ObjectPattern,
- PrivateIdentifier,
- Program,
- Property,
- PropertyDefinition,
- RestElement,
- ReturnStatement,
- SequenceExpression,
- SpreadElement,
- Super,
- SwitchCase,
- SwitchStatement,
- TaggedTemplateExpression,
- TemplateElement,
- TemplateLiteral,
- ThisExpression,
- ThrowStatement,
- TryStatement,
- UnaryExpression,
- UnknownNode,
- UpdateExpression,
- VariableDeclaration,
- VariableDeclarator,
- WhileStatement,
- YieldExpression
- };
- function getId(m) {
- return m.id;
- }
- function getOriginalLocation(sourcemapChain, location) {
- // This cast is guaranteed. If it were a missing Map, it wouldn't have a mappings.
- const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings);
- while (filteredSourcemapChain.length > 0) {
- const sourcemap = filteredSourcemapChain.pop();
- const line = sourcemap.mappings[location.line - 1];
- let locationFound = false;
- if (line !== undefined) {
- for (const segment of line) {
- if (segment[0] >= location.column) {
- if (segment.length === 1)
- break;
- location = {
- column: segment[3],
- line: segment[2] + 1,
- name: segment.length === 5 ? sourcemap.names[segment[4]] : undefined,
- source: sourcemap.sources[segment[1]]
- };
- locationFound = true;
- break;
- }
- }
- }
- if (!locationFound) {
- throw new Error("Can't resolve original location of error.");
- }
- }
- return location;
- }
- // this looks ridiculous, but it prevents sourcemap tooling from mistaking
- // this for an actual sourceMappingURL
- let SOURCEMAPPING_URL = 'sourceMa';
- SOURCEMAPPING_URL += 'ppingURL';
- const whiteSpaceNoNewline = '[ \\f\\r\\t\\v\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]';
- const SOURCEMAPPING_URL_LINE_COMMENT_RE = `//#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+`;
- const SOURCEMAPPING_URL_BLOCK_COMMENT_RE = `/\\*#${whiteSpaceNoNewline}+${SOURCEMAPPING_URL}=.+\\*/`;
- const SOURCEMAPPING_URL_COMMENT_RE = new RegExp(`(${SOURCEMAPPING_URL_LINE_COMMENT_RE})|(${SOURCEMAPPING_URL_BLOCK_COMMENT_RE})`, 'g');
- const NOOP = () => { };
- let getStartTime = () => [0, 0];
- let getElapsedTime = () => 0;
- let getMemory = () => 0;
- let timers = {};
- const normalizeHrTime = (time) => time[0] * 1e3 + time[1] / 1e6;
- function setTimeHelpers() {
- if (typeof process !== 'undefined' && typeof process.hrtime === 'function') {
- getStartTime = process.hrtime.bind(process);
- getElapsedTime = previous => normalizeHrTime(process.hrtime(previous));
- }
- else if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
- getStartTime = () => [performance.now(), 0];
- getElapsedTime = previous => performance.now() - previous[0];
- }
- if (typeof process !== 'undefined' && typeof process.memoryUsage === 'function') {
- getMemory = () => process.memoryUsage().heapUsed;
- }
- }
- function getPersistedLabel(label, level) {
- switch (level) {
- case 1:
- return `# ${label}`;
- case 2:
- return `## ${label}`;
- case 3:
- return label;
- default:
- return `${' '.repeat(level - 4)}- ${label}`;
- }
- }
- function timeStartImpl(label, level = 3) {
- label = getPersistedLabel(label, level);
- if (!timers.hasOwnProperty(label)) {
- timers[label] = {
- memory: 0,
- startMemory: undefined,
- startTime: undefined,
- time: 0,
- totalMemory: 0
- };
- }
- const currentMemory = getMemory();
- timers[label].startTime = getStartTime();
- timers[label].startMemory = currentMemory;
- }
- function timeEndImpl(label, level = 3) {
- label = getPersistedLabel(label, level);
- if (timers.hasOwnProperty(label)) {
- const currentMemory = getMemory();
- timers[label].time += getElapsedTime(timers[label].startTime);
- timers[label].totalMemory = Math.max(timers[label].totalMemory, currentMemory);
- timers[label].memory += currentMemory - timers[label].startMemory;
- }
- }
- function getTimings() {
- const newTimings = {};
- for (const label of Object.keys(timers)) {
- newTimings[label] = [timers[label].time, timers[label].memory, timers[label].totalMemory];
- }
- return newTimings;
- }
- let timeStart = NOOP, timeEnd = NOOP;
- const TIMED_PLUGIN_HOOKS = {
- load: true,
- resolveDynamicImport: true,
- resolveId: true,
- transform: true
- };
- function getPluginWithTimers(plugin, index) {
- const timedPlugin = {};
- for (const hook of Object.keys(plugin)) {
- if (TIMED_PLUGIN_HOOKS[hook] === true) {
- let timerLabel = `plugin ${index}`;
- if (plugin.name) {
- timerLabel += ` (${plugin.name})`;
- }
- timerLabel += ` - ${hook}`;
- timedPlugin[hook] = function () {
- timeStart(timerLabel, 4);
- let result = plugin[hook].apply(this === timedPlugin ? plugin : this, arguments);
- timeEnd(timerLabel, 4);
- if (result && typeof result.then === 'function') {
- timeStart(`${timerLabel} (async)`, 4);
- result = result.then(() => timeEnd(`${timerLabel} (async)`, 4));
- }
- return result;
- };
- }
- else {
- timedPlugin[hook] = plugin[hook];
- }
- }
- return timedPlugin;
- }
- function initialiseTimers(inputOptions) {
- if (inputOptions.perf) {
- timers = {};
- setTimeHelpers();
- timeStart = timeStartImpl;
- timeEnd = timeEndImpl;
- inputOptions.plugins = inputOptions.plugins.map(getPluginWithTimers);
- }
- else {
- timeStart = NOOP;
- timeEnd = NOOP;
- }
- }
- function markModuleAndImpureDependenciesAsExecuted(baseModule) {
- baseModule.isExecuted = true;
- const modules = [baseModule];
- const visitedModules = new Set();
- for (const module of modules) {
- for (const dependency of [...module.dependencies, ...module.implicitlyLoadedBefore]) {
- if (!(dependency instanceof ExternalModule) &&
- !dependency.isExecuted &&
- (dependency.info.hasModuleSideEffects || module.implicitlyLoadedBefore.has(dependency)) &&
- !visitedModules.has(dependency.id)) {
- dependency.isExecuted = true;
- visitedModules.add(dependency.id);
- modules.push(dependency);
- }
- }
- }
- }
- const MISSING_EXPORT_SHIM_DESCRIPTION = {
- identifier: null,
- localName: MISSING_EXPORT_SHIM_VARIABLE
- };
- function findSourceMappingURLComments(ast, code) {
- const ret = [];
- const addCommentsPos = (start, end) => {
- if (start == end) {
- return;
- }
- let sourcemappingUrlMatch;
- const interStatmentCode = code.slice(start, end);
- while (sourcemappingUrlMatch = SOURCEMAPPING_URL_COMMENT_RE.exec(interStatmentCode)) {
- ret.push([start + sourcemappingUrlMatch.index, start + SOURCEMAPPING_URL_COMMENT_RE.lastIndex]);
- }
- };
- let prevStmtEnd = 0;
- for (const stmt of ast.body) {
- addCommentsPos(prevStmtEnd, stmt.start);
- prevStmtEnd = stmt.end;
- }
- addCommentsPos(prevStmtEnd, code.length);
- return ret;
- }
- function getVariableForExportNameRecursive(target, name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules = new Map()) {
- const searchedModules = searchedNamesAndModules.get(name);
- if (searchedModules) {
- if (searchedModules.has(target)) {
- return isExportAllSearch ? null : error(errCircularReexport(name, target.id));
- }
- searchedModules.add(target);
- }
- else {
- searchedNamesAndModules.set(name, new Set([target]));
- }
- return target.getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules);
- }
- function getAndExtendSideEffectModules(variable, module) {
- const sideEffectModules = getOrCreate(module.sideEffectDependenciesByVariable, variable, () => new Set());
- let currentVariable = variable;
- const referencedVariables = new Set([currentVariable]);
- while (true) {
- const importingModule = currentVariable.module;
- currentVariable =
- currentVariable instanceof ExportDefaultVariable
- ? currentVariable.getDirectOriginalVariable()
- : currentVariable instanceof SyntheticNamedExportVariable
- ? currentVariable.syntheticNamespace
- : null;
- if (!currentVariable || referencedVariables.has(currentVariable)) {
- break;
- }
- referencedVariables.add(currentVariable);
- sideEffectModules.add(importingModule);
- const originalSideEffects = importingModule.sideEffectDependenciesByVariable.get(currentVariable);
- if (originalSideEffects) {
- for (const module of originalSideEffects) {
- sideEffectModules.add(module);
- }
- }
- }
- return sideEffectModules;
- }
- class Module$1 {
- constructor(graph, id, options, isEntry, hasModuleSideEffects, syntheticNamedExports, meta) {
- this.graph = graph;
- this.id = id;
- this.options = options;
- this.alternativeReexportModules = new Map();
- this.ast = null;
- this.chunkFileNames = new Set();
- this.chunkName = null;
- this.cycles = new Set();
- this.dependencies = new Set();
- this.dynamicDependencies = new Set();
- this.dynamicImporters = [];
- this.dynamicImports = [];
- this.execIndex = Infinity;
- this.exportAllSources = new Set();
- this.exports = Object.create(null);
- this.exportsAll = Object.create(null);
- this.implicitlyLoadedAfter = new Set();
- this.implicitlyLoadedBefore = new Set();
- this.importDescriptions = Object.create(null);
- this.importers = [];
- this.importMetas = [];
- this.imports = new Set();
- this.includedDynamicImporters = [];
- this.isExecuted = false;
- this.isUserDefinedEntryPoint = false;
- this.preserveSignature = this.options.preserveEntrySignatures;
- this.reexportDescriptions = Object.create(null);
- this.sideEffectDependenciesByVariable = new Map();
- this.sources = new Set();
- this.userChunkNames = new Set();
- this.usesTopLevelAwait = false;
- this.allExportNames = null;
- this.exportAllModules = [];
- this.exportNamesByVariable = null;
- this.exportShimVariable = new ExportShimVariable(this);
- this.relevantDependencies = null;
- this.syntheticExports = new Map();
- this.syntheticNamespace = null;
- this.transformDependencies = [];
- this.transitiveReexports = null;
- this.excludeFromSourcemap = /\0/.test(id);
- this.context = options.moduleContext(id);
- const module = this;
- this.info = {
- ast: null,
- code: null,
- get dynamicallyImportedIds() {
- const dynamicallyImportedIds = [];
- for (const { resolution } of module.dynamicImports) {
- if (resolution instanceof Module$1 || resolution instanceof ExternalModule) {
- dynamicallyImportedIds.push(resolution.id);
- }
- }
- return dynamicallyImportedIds;
- },
- get dynamicImporters() {
- return module.dynamicImporters.sort();
- },
- hasModuleSideEffects,
- id,
- get implicitlyLoadedAfterOneOf() {
- return Array.from(module.implicitlyLoadedAfter, getId);
- },
- get implicitlyLoadedBefore() {
- return Array.from(module.implicitlyLoadedBefore, getId);
- },
- get importedIds() {
- return Array.from(module.sources, source => module.resolvedIds[source].id);
- },
- get importers() {
- return module.importers.sort();
- },
- isEntry,
- isExternal: false,
- meta,
- syntheticNamedExports
- };
- }
- basename() {
- const base = basename(this.id);
- const ext = extname$1(this.id);
- return makeLegal(ext ? base.slice(0, -ext.length) : base);
- }
- bindReferences() {
- this.ast.bind();
- }
- error(props, pos) {
- this.addLocationToLogProps(props, pos);
- return error(props);
- }
- getAllExportNames() {
- if (this.allExportNames) {
- return this.allExportNames;
- }
- const allExportNames = (this.allExportNames = new Set());
- for (const name of Object.keys(this.exports)) {
- allExportNames.add(name);
- }
- for (const name of Object.keys(this.reexportDescriptions)) {
- allExportNames.add(name);
- }
- for (const module of this.exportAllModules) {
- if (module instanceof ExternalModule) {
- allExportNames.add(`*${module.id}`);
- continue;
- }
- for (const name of module.getAllExportNames()) {
- if (name !== 'default')
- allExportNames.add(name);
- }
- }
- return allExportNames;
- }
- getDependenciesToBeIncluded() {
- if (this.relevantDependencies)
- return this.relevantDependencies;
- const relevantDependencies = new Set();
- const necessaryDependencies = new Set();
- const alwaysCheckedDependencies = new Set();
- let dependencyVariables = this.imports.keys();
- if (this.info.isEntry ||
- this.includedDynamicImporters.length > 0 ||
- this.namespace.included ||
- this.implicitlyLoadedAfter.size > 0) {
- dependencyVariables = new Set(dependencyVariables);
- for (const exportName of [...this.getReexports(), ...this.getExports()]) {
- dependencyVariables.add(this.getVariableForExportName(exportName));
- }
- }
- for (let variable of dependencyVariables) {
- const sideEffectDependencies = this.sideEffectDependenciesByVariable.get(variable);
- if (sideEffectDependencies) {
- for (const module of sideEffectDependencies) {
- alwaysCheckedDependencies.add(module);
- }
- }
- if (variable instanceof SyntheticNamedExportVariable) {
- variable = variable.getBaseVariable();
- }
- else if (variable instanceof ExportDefaultVariable) {
- variable = variable.getOriginalVariable();
- }
- necessaryDependencies.add(variable.module);
- }
- if (this.options.treeshake && this.info.hasModuleSideEffects !== 'no-treeshake') {
- this.addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies);
- }
- else {
- for (const dependency of this.dependencies) {
- relevantDependencies.add(dependency);
- }
- }
- for (const dependency of necessaryDependencies) {
- relevantDependencies.add(dependency);
- }
- return (this.relevantDependencies = relevantDependencies);
- }
- getExportNamesByVariable() {
- if (this.exportNamesByVariable) {
- return this.exportNamesByVariable;
- }
- const exportNamesByVariable = new Map();
- for (const exportName of this.getAllExportNames()) {
- if (exportName === this.info.syntheticNamedExports)
- continue;
- let tracedVariable = this.getVariableForExportName(exportName);
- if (tracedVariable instanceof ExportDefaultVariable) {
- tracedVariable = tracedVariable.getOriginalVariable();
- }
- if (!tracedVariable ||
- !(tracedVariable.included || tracedVariable instanceof ExternalVariable)) {
- continue;
- }
- const existingExportNames = exportNamesByVariable.get(tracedVariable);
- if (existingExportNames) {
- existingExportNames.push(exportName);
- }
- else {
- exportNamesByVariable.set(tracedVariable, [exportName]);
- }
- }
- return (this.exportNamesByVariable = exportNamesByVariable);
- }
- getExports() {
- return Object.keys(this.exports);
- }
- getReexports() {
- if (this.transitiveReexports) {
- return this.transitiveReexports;
- }
- // to avoid infinite recursion when using circular `export * from X`
- this.transitiveReexports = [];
- const reexports = new Set();
- for (const name in this.reexportDescriptions) {
- reexports.add(name);
- }
- for (const module of this.exportAllModules) {
- if (module instanceof ExternalModule) {
- reexports.add(`*${module.id}`);
- }
- else {
- for (const name of [...module.getReexports(), ...module.getExports()]) {
- if (name !== 'default')
- reexports.add(name);
- }
- }
- }
- return (this.transitiveReexports = [...reexports]);
- }
- getRenderedExports() {
- // only direct exports are counted here, not reexports at all
- const renderedExports = [];
- const removedExports = [];
- for (const exportName in this.exports) {
- const variable = this.getVariableForExportName(exportName);
- (variable && variable.included ? renderedExports : removedExports).push(exportName);
- }
- return { renderedExports, removedExports };
- }
- getSyntheticNamespace() {
- if (this.syntheticNamespace === null) {
- this.syntheticNamespace = undefined;
- this.syntheticNamespace = this.getVariableForExportName(typeof this.info.syntheticNamedExports === 'string'
- ? this.info.syntheticNamedExports
- : 'default');
- }
- if (!this.syntheticNamespace) {
- return error(errSyntheticNamedExportsNeedNamespaceExport(this.id, this.info.syntheticNamedExports));
- }
- return this.syntheticNamespace;
- }
- getVariableForExportName(name, importerForSideEffects, isExportAllSearch, searchedNamesAndModules) {
- if (name[0] === '*') {
- if (name.length === 1) {
- // export * from './other'
- return this.namespace;
- }
- else {
- // export * from 'external'
- const module = this.graph.modulesById.get(name.slice(1));
- return module.getVariableForExportName('*');
- }
- }
- // export { foo } from './other'
- const reexportDeclaration = this.reexportDescriptions[name];
- if (reexportDeclaration) {
- const variable = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
- if (!variable) {
- return this.error(errMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
- }
- if (importerForSideEffects) {
- setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
- }
- return variable;
- }
- const exportDeclaration = this.exports[name];
- if (exportDeclaration) {
- if (exportDeclaration === MISSING_EXPORT_SHIM_DESCRIPTION) {
- return this.exportShimVariable;
- }
- const name = exportDeclaration.localName;
- const variable = this.traceVariable(name, importerForSideEffects);
- if (importerForSideEffects) {
- getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, () => new Set()).add(this);
- setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
- }
- return variable;
- }
- if (name !== 'default') {
- let foundSyntheticDeclaration = null;
- for (const module of this.exportAllModules) {
- const declaration = getVariableForExportNameRecursive(module, name, importerForSideEffects, true, searchedNamesAndModules);
- if (declaration) {
- if (!(declaration instanceof SyntheticNamedExportVariable)) {
- return declaration;
- }
- if (!foundSyntheticDeclaration) {
- foundSyntheticDeclaration = declaration;
- }
- }
- }
- if (foundSyntheticDeclaration) {
- return foundSyntheticDeclaration;
- }
- }
- if (this.info.syntheticNamedExports) {
- let syntheticExport = this.syntheticExports.get(name);
- if (!syntheticExport) {
- const syntheticNamespace = this.getSyntheticNamespace();
- syntheticExport = new SyntheticNamedExportVariable(this.astContext, name, syntheticNamespace);
- this.syntheticExports.set(name, syntheticExport);
- return syntheticExport;
- }
- return syntheticExport;
- }
- // we don't want to create shims when we are just
- // probing export * modules for exports
- if (!isExportAllSearch) {
- if (this.options.shimMissingExports) {
- this.shimMissingExport(name);
- return this.exportShimVariable;
- }
- }
- return null;
- }
- hasEffects() {
- return (this.info.hasModuleSideEffects === 'no-treeshake' ||
- (this.ast.included && this.ast.hasEffects(createHasEffectsContext())));
- }
- include() {
- const context = createInclusionContext();
- if (this.ast.shouldBeIncluded(context))
- this.ast.include(context, false);
- }
- includeAllExports(includeNamespaceMembers) {
- if (!this.isExecuted) {
- this.graph.needsTreeshakingPass = true;
- markModuleAndImpureDependenciesAsExecuted(this);
- }
- for (const exportName of this.getExports()) {
- if (includeNamespaceMembers || exportName !== this.info.syntheticNamedExports) {
- const variable = this.getVariableForExportName(exportName);
- variable.deoptimizePath(UNKNOWN_PATH);
- if (!variable.included) {
- this.includeVariable(variable);
- }
- }
- }
- for (const name of this.getReexports()) {
- const variable = this.getVariableForExportName(name);
- variable.deoptimizePath(UNKNOWN_PATH);
- if (!variable.included) {
- this.includeVariable(variable);
- }
- if (variable instanceof ExternalVariable) {
- variable.module.reexported = true;
- }
- }
- if (includeNamespaceMembers) {
- this.namespace.prepareNamespace(this.includeAndGetAdditionalMergedNamespaces());
- }
- }
- includeAllInBundle() {
- this.ast.include(createInclusionContext(), true);
- }
- isIncluded() {
- return this.ast.included || this.namespace.included;
- }
- linkImports() {
- this.addModulesToImportDescriptions(this.importDescriptions);
- this.addModulesToImportDescriptions(this.reexportDescriptions);
- for (const name in this.exports) {
- if (name !== 'default' && name !== this.info.syntheticNamedExports) {
- this.exportsAll[name] = this.id;
- }
- }
- const externalExportAllModules = [];
- for (const source of this.exportAllSources) {
- const module = this.graph.modulesById.get(this.resolvedIds[source].id);
- if (module instanceof ExternalModule) {
- externalExportAllModules.push(module);
- continue;
- }
- this.exportAllModules.push(module);
- for (const name in module.exportsAll) {
- if (name in this.exportsAll) {
- this.options.onwarn(errNamespaceConflict(name, this, module));
- }
- else {
- this.exportsAll[name] = module.exportsAll[name];
- }
- }
- }
- this.exportAllModules.push(...externalExportAllModules);
- }
- render(options) {
- const magicString = this.magicString.clone();
- this.ast.render(magicString, options);
- this.usesTopLevelAwait = this.astContext.usesTopLevelAwait;
- return magicString;
- }
- setSource({ alwaysRemovedCode, ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) {
- this.info.code = code;
- this.originalCode = originalCode;
- this.originalSourcemap = originalSourcemap;
- this.sourcemapChain = sourcemapChain;
- if (transformFiles) {
- this.transformFiles = transformFiles;
- }
- this.transformDependencies = transformDependencies;
- this.customTransformCache = customTransformCache;
- this.updateOptions(moduleOptions);
- timeStart('generate ast', 3);
- this.alwaysRemovedCode = alwaysRemovedCode || [];
- if (!ast) {
- ast = this.tryParse();
- }
- this.alwaysRemovedCode.push(...findSourceMappingURLComments(ast, this.info.code));
- timeEnd('generate ast', 3);
- this.resolvedIds = resolvedIds || Object.create(null);
- // By default, `id` is the file name. Custom resolvers and loaders
- // can change that, but it makes sense to use it for the source file name
- const fileName = this.id;
- this.magicString = new MagicString$1(code, {
- filename: (this.excludeFromSourcemap ? null : fileName),
- indentExclusionRanges: []
- });
- for (const [start, end] of this.alwaysRemovedCode) {
- this.magicString.remove(start, end);
- }
- timeStart('analyse ast', 3);
- this.astContext = {
- addDynamicImport: this.addDynamicImport.bind(this),
- addExport: this.addExport.bind(this),
- addImport: this.addImport.bind(this),
- addImportMeta: this.addImportMeta.bind(this),
- code,
- deoptimizationTracker: this.graph.deoptimizationTracker,
- error: this.error.bind(this),
- fileName,
- getExports: this.getExports.bind(this),
- getModuleExecIndex: () => this.execIndex,
- getModuleName: this.basename.bind(this),
- getReexports: this.getReexports.bind(this),
- importDescriptions: this.importDescriptions,
- includeAllExports: () => this.includeAllExports(true),
- includeDynamicImport: this.includeDynamicImport.bind(this),
- includeVariableInModule: this.includeVariableInModule.bind(this),
- magicString: this.magicString,
- module: this,
- moduleContext: this.context,
- nodeConstructors,
- options: this.options,
- traceExport: this.getVariableForExportName.bind(this),
- traceVariable: this.traceVariable.bind(this),
- usesTopLevelAwait: false,
- warn: this.warn.bind(this)
- };
- this.scope = new ModuleScope(this.graph.scope, this.astContext);
- this.namespace = new NamespaceVariable(this.astContext, this.info.syntheticNamedExports);
- this.ast = new Program(ast, { type: 'Module', context: this.astContext }, this.scope);
- this.info.ast = ast;
- timeEnd('analyse ast', 3);
- }
- toJSON() {
- return {
- alwaysRemovedCode: this.alwaysRemovedCode,
- ast: this.ast.esTreeNode,
- code: this.info.code,
- customTransformCache: this.customTransformCache,
- dependencies: Array.from(this.dependencies, getId),
- id: this.id,
- meta: this.info.meta,
- moduleSideEffects: this.info.hasModuleSideEffects,
- originalCode: this.originalCode,
- originalSourcemap: this.originalSourcemap,
- resolvedIds: this.resolvedIds,
- sourcemapChain: this.sourcemapChain,
- syntheticNamedExports: this.info.syntheticNamedExports,
- transformDependencies: this.transformDependencies,
- transformFiles: this.transformFiles
- };
- }
- traceVariable(name, importerForSideEffects) {
- const localVariable = this.scope.variables.get(name);
- if (localVariable) {
- return localVariable;
- }
- if (name in this.importDescriptions) {
- const importDeclaration = this.importDescriptions[name];
- const otherModule = importDeclaration.module;
- if (otherModule instanceof Module$1 && importDeclaration.name === '*') {
- return otherModule.namespace;
- }
- const declaration = otherModule.getVariableForExportName(importDeclaration.name, importerForSideEffects || this);
- if (!declaration) {
- return this.error(errMissingExport(importDeclaration.name, this.id, otherModule.id), importDeclaration.start);
- }
- return declaration;
- }
- return null;
- }
- tryParse() {
- try {
- return this.graph.contextParse(this.info.code);
- }
- catch (err) {
- let message = err.message.replace(/ \(\d+:\d+\)$/, '');
- if (this.id.endsWith('.json')) {
- message += ' (Note that you need @rollup/plugin-json to import JSON files)';
- }
- else if (!this.id.endsWith('.js')) {
- message += ' (Note that you need plugins to import files that are not JavaScript)';
- }
- return this.error({
- code: 'PARSE_ERROR',
- message,
- parserError: err
- }, err.pos);
- }
- }
- updateOptions({ meta, moduleSideEffects, syntheticNamedExports }) {
- if (moduleSideEffects != null) {
- this.info.hasModuleSideEffects = moduleSideEffects;
- }
- if (syntheticNamedExports != null) {
- this.info.syntheticNamedExports = syntheticNamedExports;
- }
- if (meta != null) {
- this.info.meta = { ...this.info.meta, ...meta };
- }
- }
- warn(props, pos) {
- this.addLocationToLogProps(props, pos);
- this.options.onwarn(props);
- }
- addDynamicImport(node) {
- let argument = node.source;
- if (argument instanceof TemplateLiteral) {
- if (argument.quasis.length === 1 && argument.quasis[0].value.cooked) {
- argument = argument.quasis[0].value.cooked;
- }
- }
- else if (argument instanceof Literal && typeof argument.value === 'string') {
- argument = argument.value;
- }
- this.dynamicImports.push({ node, resolution: null, argument });
- }
- addExport(node) {
- if (node instanceof ExportDefaultDeclaration) {
- // export default foo;
- this.exports.default = {
- identifier: node.variable.getAssignedVariableName(),
- localName: 'default'
- };
- }
- else if (node instanceof ExportAllDeclaration) {
- const source = node.source.value;
- this.sources.add(source);
- if (node.exported) {
- // export * as name from './other'
- const name = node.exported.name;
- this.reexportDescriptions[name] = {
- localName: '*',
- module: null,
- source,
- start: node.start
- };
- }
- else {
- // export * from './other'
- this.exportAllSources.add(source);
- }
- }
- else if (node.source instanceof Literal) {
- // export { name } from './other'
- const source = node.source.value;
- this.sources.add(source);
- for (const specifier of node.specifiers) {
- const name = specifier.exported.name;
- this.reexportDescriptions[name] = {
- localName: specifier.local.name,
- module: null,
- source,
- start: specifier.start
- };
- }
- }
- else if (node.declaration) {
- const declaration = node.declaration;
- if (declaration instanceof VariableDeclaration) {
- // export var { foo, bar } = ...
- // export var foo = 1, bar = 2;
- for (const declarator of declaration.declarations) {
- for (const localName of extractAssignedNames$2(declarator.id)) {
- this.exports[localName] = { identifier: null, localName };
- }
- }
- }
- else {
- // export function foo () {}
- const localName = declaration.id.name;
- this.exports[localName] = { identifier: null, localName };
- }
- }
- else {
- // export { foo, bar, baz }
- for (const specifier of node.specifiers) {
- const localName = specifier.local.name;
- const exportedName = specifier.exported.name;
- this.exports[exportedName] = { identifier: null, localName };
- }
- }
- }
- addImport(node) {
- const source = node.source.value;
- this.sources.add(source);
- for (const specifier of node.specifiers) {
- const isDefault = specifier.type === ImportDefaultSpecifier$1;
- const isNamespace = specifier.type === ImportNamespaceSpecifier$1;
- const name = isDefault
- ? 'default'
- : isNamespace
- ? '*'
- : specifier.imported.name;
- this.importDescriptions[specifier.local.name] = {
- module: null,
- name,
- source,
- start: specifier.start
- };
- }
- }
- addImportMeta(node) {
- this.importMetas.push(node);
- }
- addLocationToLogProps(props, pos) {
- props.id = this.id;
- props.pos = pos;
- let code = this.info.code;
- let { column, line } = locate(code, pos, { offsetLine: 1 });
- try {
- ({ column, line } = getOriginalLocation(this.sourcemapChain, { column, line }));
- code = this.originalCode;
- }
- catch (e) {
- this.options.onwarn({
- code: 'SOURCEMAP_ERROR',
- id: this.id,
- loc: {
- column,
- file: this.id,
- line
- },
- message: `Error when using sourcemap for reporting an error: ${e.message}`,
- pos
- });
- }
- augmentCodeLocation(props, { column, line }, code, this.id);
- }
- addModulesToImportDescriptions(importDescription) {
- for (const name of Object.keys(importDescription)) {
- const specifier = importDescription[name];
- const id = this.resolvedIds[specifier.source].id;
- specifier.module = this.graph.modulesById.get(id);
- }
- }
- addRelevantSideEffectDependencies(relevantDependencies, necessaryDependencies, alwaysCheckedDependencies) {
- const handledDependencies = new Set();
- const addSideEffectDependencies = (possibleDependencies) => {
- for (const dependency of possibleDependencies) {
- if (handledDependencies.has(dependency)) {
- continue;
- }
- handledDependencies.add(dependency);
- if (necessaryDependencies.has(dependency)) {
- relevantDependencies.add(dependency);
- continue;
- }
- if (!(dependency.info.hasModuleSideEffects || alwaysCheckedDependencies.has(dependency))) {
- continue;
- }
- if (dependency instanceof ExternalModule || dependency.hasEffects()) {
- relevantDependencies.add(dependency);
- continue;
- }
- addSideEffectDependencies(dependency.dependencies);
- }
- };
- addSideEffectDependencies(this.dependencies);
- addSideEffectDependencies(alwaysCheckedDependencies);
- }
- includeAndGetAdditionalMergedNamespaces() {
- const mergedNamespaces = [];
- for (const module of this.exportAllModules) {
- if (module instanceof ExternalModule) {
- const externalVariable = module.getVariableForExportName('*');
- externalVariable.include();
- this.imports.add(externalVariable);
- mergedNamespaces.push(externalVariable);
- }
- else if (module.info.syntheticNamedExports) {
- const syntheticNamespace = module.getSyntheticNamespace();
- syntheticNamespace.include();
- this.imports.add(syntheticNamespace);
- mergedNamespaces.push(syntheticNamespace);
- }
- }
- return mergedNamespaces;
- }
- includeDynamicImport(node) {
- const resolution = this.dynamicImports.find(dynamicImport => dynamicImport.node === node).resolution;
- if (resolution instanceof Module$1) {
- resolution.includedDynamicImporters.push(this);
- resolution.includeAllExports(true);
- }
- }
- includeVariable(variable) {
- if (!variable.included) {
- variable.include();
- this.graph.needsTreeshakingPass = true;
- const variableModule = variable.module;
- if (variableModule && variableModule instanceof Module$1) {
- if (!variableModule.isExecuted) {
- markModuleAndImpureDependenciesAsExecuted(variableModule);
- }
- if (variableModule !== this) {
- const sideEffectModules = getAndExtendSideEffectModules(variable, this);
- for (const module of sideEffectModules) {
- if (!module.isExecuted) {
- markModuleAndImpureDependenciesAsExecuted(module);
- }
- }
- }
- }
- }
- }
- includeVariableInModule(variable) {
- this.includeVariable(variable);
- const variableModule = variable.module;
- if (variableModule && variableModule !== this) {
- this.imports.add(variable);
- }
- }
- shimMissingExport(name) {
- this.options.onwarn({
- code: 'SHIMMED_EXPORT',
- exporter: relativeId(this.id),
- exportName: name,
- message: `Missing export "${name}" has been shimmed in module ${relativeId(this.id)}.`
- });
- this.exports[name] = MISSING_EXPORT_SHIM_DESCRIPTION;
- }
- }
- // if there is a cyclic import in the reexport chain, we should not
- // import from the original module but from the cyclic module to not
- // mess up execution order.
- function setAlternativeExporterIfCyclic(variable, importer, reexporter) {
- if (variable.module instanceof Module$1 && variable.module !== reexporter) {
- const exporterCycles = variable.module.cycles;
- if (exporterCycles.size > 0) {
- const importerCycles = reexporter.cycles;
- for (const cycleSymbol of importerCycles) {
- if (exporterCycles.has(cycleSymbol)) {
- importer.alternativeReexportModules.set(variable, reexporter);
- break;
- }
- }
- }
- }
- }
- class Source {
- constructor(filename, content) {
- this.isOriginal = true;
- this.filename = filename;
- this.content = content;
- }
- traceSegment(line, column, name) {
- return { line, column, name, source: this };
- }
- }
- class Link {
- constructor(map, sources) {
- this.sources = sources;
- this.names = map.names;
- this.mappings = map.mappings;
- }
- traceMappings() {
- const sources = [];
- const sourcesContent = [];
- const names = [];
- const mappings = [];
- for (const line of this.mappings) {
- const tracedLine = [];
- for (const segment of line) {
- if (segment.length == 1)
- continue;
- const source = this.sources[segment[1]];
- if (!source)
- continue;
- const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : '');
- if (traced) {
- // newer sources are more likely to be used, so search backwards.
- let sourceIndex = sources.lastIndexOf(traced.source.filename);
- if (sourceIndex === -1) {
- sourceIndex = sources.length;
- sources.push(traced.source.filename);
- sourcesContent[sourceIndex] = traced.source.content;
- }
- else if (sourcesContent[sourceIndex] == null) {
- sourcesContent[sourceIndex] = traced.source.content;
- }
- else if (traced.source.content != null &&
- sourcesContent[sourceIndex] !== traced.source.content) {
- return error({
- message: `Multiple conflicting contents for sourcemap source ${traced.source.filename}`
- });
- }
- const tracedSegment = [
- segment[0],
- sourceIndex,
- traced.line,
- traced.column
- ];
- if (traced.name) {
- let nameIndex = names.indexOf(traced.name);
- if (nameIndex === -1) {
- nameIndex = names.length;
- names.push(traced.name);
- }
- tracedSegment[4] = nameIndex;
- }
- tracedLine.push(tracedSegment);
- }
- }
- mappings.push(tracedLine);
- }
- return { sources, sourcesContent, names, mappings };
- }
- traceSegment(line, column, name) {
- const segments = this.mappings[line];
- if (!segments)
- return null;
- // binary search through segments for the given column
- let i = 0;
- let j = segments.length - 1;
- while (i <= j) {
- const m = (i + j) >> 1;
- const segment = segments[m];
- if (segment[0] === column) {
- if (segment.length == 1)
- return null;
- const source = this.sources[segment[1]];
- if (!source)
- return null;
- return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
- }
- if (segment[0] > column) {
- j = m - 1;
- }
- else {
- i = m + 1;
- }
- }
- return null;
- }
- }
- function getLinkMap(warn) {
- return function linkMap(source, map) {
- if (map.mappings) {
- return new Link(map, [source]);
- }
- warn({
- code: 'SOURCEMAP_BROKEN',
- message: `Sourcemap is likely to be incorrect: a plugin (${map.plugin}) was used to transform ` +
- "files, but didn't generate a sourcemap for the transformation. Consult the plugin " +
- 'documentation for help',
- plugin: map.plugin,
- url: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`
- });
- return new Link({
- mappings: [],
- names: []
- }, [source]);
- };
- }
- function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
- let source;
- if (!originalSourcemap) {
- source = new Source(id, originalCode);
- }
- else {
- const sources = originalSourcemap.sources;
- const sourcesContent = originalSourcemap.sourcesContent || [];
- const directory = dirname(id) || '.';
- const sourceRoot = originalSourcemap.sourceRoot || '.';
- const baseSources = sources.map((source, i) => new Source(resolve$1(directory, sourceRoot, source), sourcesContent[i]));
- source = new Link(originalSourcemap, baseSources);
- }
- return sourcemapChain.reduce(linkMap, source);
- }
- function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeContent, warn) {
- const linkMap = getLinkMap(warn);
- const moduleSources = modules
- .filter(module => !module.excludeFromSourcemap)
- .map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
- // DecodedSourceMap (from magic-string) uses a number[] instead of the more
- // correct SourceMapSegment tuples. Cast it here to gain type safety.
- let source = new Link(map, moduleSources);
- source = bundleSourcemapChain.reduce(linkMap, source);
- let { sources, sourcesContent, names, mappings } = source.traceMappings();
- if (file) {
- const directory = dirname(file);
- sources = sources.map((source) => relative$1(directory, source));
- file = basename(file);
- }
- sourcesContent = (excludeContent ? null : sourcesContent);
- return new SourceMap$1({ file, sources, sourcesContent, names, mappings });
- }
- function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn) {
- if (!sourcemapChain.length) {
- return originalSourcemap;
- }
- const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(warn));
- const map = source.traceMappings();
- return { version: 3, ...map };
- }
- const createHash = () => createHash$1();
- const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
- amd: deconflictImportsOther,
- cjs: deconflictImportsOther,
- es: deconflictImportsEsmOrSystem,
- iife: deconflictImportsOther,
- system: deconflictImportsEsmOrSystem,
- umd: deconflictImportsOther
- };
- function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
- const reversedModules = modules.slice().reverse();
- for (const module of reversedModules) {
- module.scope.addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope);
- }
- deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
- DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, syntheticExports);
- for (const module of reversedModules) {
- module.scope.deconflict(format, exportNamesByVariable, accessedGlobalsByScope);
- }
- }
- function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconflicted, _interop, preserveModules, _externalLiveBindings, chunkByModule, syntheticExports) {
- // This is needed for namespace reexports
- for (const dependency of dependenciesToBeDeconflicted.dependencies) {
- if (preserveModules || dependency instanceof ExternalModule) {
- dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
- }
- }
- for (const variable of imports) {
- const module = variable.module;
- const name = variable.name;
- if (variable.isNamespace && (preserveModules || module instanceof ExternalModule)) {
- variable.setRenderNames(null, (module instanceof ExternalModule ? module : chunkByModule.get(module)).variableName);
- }
- else if (module instanceof ExternalModule && name === 'default') {
- variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
- ? module.suggestedVariableName + '__default'
- : module.suggestedVariableName, usedNames));
- }
- else {
- variable.setRenderNames(null, getSafeName(name, usedNames));
- }
- }
- for (const variable of syntheticExports) {
- variable.setRenderNames(null, getSafeName(variable.name, usedNames));
- }
- }
- function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule) {
- for (const chunkOrExternalModule of dependencies) {
- chunkOrExternalModule.variableName = getSafeName(chunkOrExternalModule.suggestedVariableName, usedNames);
- }
- for (const externalModuleOrChunk of deconflictedNamespace) {
- externalModuleOrChunk.namespaceVariableName = getSafeName(`${externalModuleOrChunk.suggestedVariableName}__namespace`, usedNames);
- }
- for (const externalModule of deconflictedDefault) {
- if (deconflictedNamespace.has(externalModule) &&
- canDefaultBeTakenFromNamespace(String(interop(externalModule.id)), externalLiveBindings)) {
- externalModule.defaultVariableName = externalModule.namespaceVariableName;
- }
- else {
- externalModule.defaultVariableName = getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames);
- }
- }
- for (const variable of imports) {
- const module = variable.module;
- if (module instanceof ExternalModule) {
- const name = variable.name;
- if (name === 'default') {
- const moduleInterop = String(interop(module.id));
- const variableName = defaultInteropHelpersByInteropType[moduleInterop]
- ? module.defaultVariableName
- : module.variableName;
- if (isDefaultAProperty(moduleInterop, externalLiveBindings)) {
- variable.setRenderNames(variableName, 'default');
- }
- else {
- variable.setRenderNames(null, variableName);
- }
- }
- else if (name === '*') {
- variable.setRenderNames(null, namespaceInteropHelpersByInteropType[String(interop(module.id))]
- ? module.namespaceVariableName
- : module.variableName);
- }
- else {
- // if the second parameter is `null`, it uses its "name" for the property name
- variable.setRenderNames(module.variableName, null);
- }
- }
- else {
- const chunk = chunkByModule.get(module);
- if (preserveModules && variable.isNamespace) {
- variable.setRenderNames(null, chunk.exportMode === 'default' ? chunk.namespaceVariableName : chunk.variableName);
- }
- else if (chunk.exportMode === 'default') {
- variable.setRenderNames(null, chunk.variableName);
- }
- else {
- variable.setRenderNames(chunk.variableName, chunk.getVariableExportName(variable));
- }
- }
- }
- }
- function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
- for (const module of modules) {
- for (const variable of module.scope.variables.values()) {
- if (variable.included &&
- // this will only happen for exports in some formats
- !(variable.renderBaseName ||
- (variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
- variable.setRenderNames(null, getSafeName(variable.name, usedNames));
- }
- }
- if (includedNamespaces.has(module)) {
- const namespace = module.namespace;
- namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
- }
- }
- }
- const needsEscapeRegEx = /[\\'\r\n\u2028\u2029]/;
- const quoteNewlineRegEx = /(['\r\n\u2028\u2029])/g;
- const backSlashRegEx = /\\/g;
- function escapeId(id) {
- if (!id.match(needsEscapeRegEx))
- return id;
- return id.replace(backSlashRegEx, '\\\\').replace(quoteNewlineRegEx, '\\$1');
- }
- function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
- let nameIndex = 0;
- for (const variable of exports) {
- let exportName = variable.name[0];
- if (exportsByName[exportName]) {
- do {
- exportName = toBase64(++nameIndex);
- // skip past leading number identifiers
- if (exportName.charCodeAt(0) === 49 /* '1' */) {
- nameIndex += 9 * 64 ** (exportName.length - 1);
- exportName = toBase64(nameIndex);
- }
- } while (RESERVED_NAMES[exportName] || exportsByName[exportName]);
- }
- exportsByName[exportName] = variable;
- exportNamesByVariable.set(variable, [exportName]);
- }
- }
- function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
- for (const variable of exports) {
- let nameIndex = 0;
- let exportName = variable.name;
- while (exportsByName[exportName]) {
- exportName = variable.name + '$' + ++nameIndex;
- }
- exportsByName[exportName] = variable;
- exportNamesByVariable.set(variable, [exportName]);
- }
- }
- function getExportMode(chunk, { exports: exportMode, name, format }, unsetOptions, facadeModuleId, warn) {
- const exportKeys = chunk.getExportNames();
- if (exportMode === 'default') {
- if (exportKeys.length !== 1 || exportKeys[0] !== 'default') {
- return error(errIncompatibleExportOptionValue('default', exportKeys, facadeModuleId));
- }
- }
- else if (exportMode === 'none' && exportKeys.length) {
- return error(errIncompatibleExportOptionValue('none', exportKeys, facadeModuleId));
- }
- if (exportMode === 'auto') {
- if (exportKeys.length === 0) {
- exportMode = 'none';
- }
- else if (exportKeys.length === 1 && exportKeys[0] === 'default') {
- if (format === 'cjs' && unsetOptions.has('exports')) {
- warn(errPreferNamedExports(facadeModuleId));
- }
- exportMode = 'default';
- }
- else {
- if (format !== 'es' && exportKeys.indexOf('default') !== -1) {
- warn(errMixedExport(facadeModuleId, name));
- }
- exportMode = 'named';
- }
- }
- return exportMode;
- }
- function guessIndentString(code) {
- const lines = code.split('\n');
- const tabbed = lines.filter(line => /^\t+/.test(line));
- const spaced = lines.filter(line => /^ {2,}/.test(line));
- if (tabbed.length === 0 && spaced.length === 0) {
- return null;
- }
- // More lines tabbed than spaced? Assume tabs, and
- // default to tabs in the case of a tie (or nothing
- // to go on)
- if (tabbed.length >= spaced.length) {
- return '\t';
- }
- // Otherwise, we need to guess the multiple
- const min = spaced.reduce((previous, current) => {
- const numSpaces = /^ +/.exec(current)[0].length;
- return Math.min(numSpaces, previous);
- }, Infinity);
- return new Array(min + 1).join(' ');
- }
- function getIndentString(modules, options) {
- if (options.indent !== true)
- return options.indent;
- for (let i = 0; i < modules.length; i++) {
- const indent = guessIndentString(modules[i].originalCode);
- if (indent !== null)
- return indent;
- }
- return '\t';
- }
- function getStaticDependencies(chunk, orderedModules, chunkByModule) {
- const staticDependencyBlocks = [];
- const handledDependencies = new Set();
- for (let modulePos = orderedModules.length - 1; modulePos >= 0; modulePos--) {
- const module = orderedModules[modulePos];
- if (!handledDependencies.has(module)) {
- const staticDependencies = [];
- addStaticDependencies(module, staticDependencies, handledDependencies, chunk, chunkByModule);
- staticDependencyBlocks.unshift(staticDependencies);
- }
- }
- const dependencies = new Set();
- for (const block of staticDependencyBlocks) {
- for (const dependency of block) {
- dependencies.add(dependency);
- }
- }
- return dependencies;
- }
- function addStaticDependencies(module, staticDependencies, handledModules, chunk, chunkByModule) {
- const dependencies = module.getDependenciesToBeIncluded();
- for (const dependency of dependencies) {
- if (dependency instanceof ExternalModule) {
- staticDependencies.push(dependency);
- continue;
- }
- const dependencyChunk = chunkByModule.get(dependency);
- if (dependencyChunk !== chunk) {
- staticDependencies.push(dependencyChunk);
- continue;
- }
- if (!handledModules.has(dependency)) {
- handledModules.add(dependency);
- addStaticDependencies(dependency, staticDependencies, handledModules, chunk, chunkByModule);
- }
- }
- }
- function decodedSourcemap(map) {
- if (!map)
- return null;
- if (typeof map === 'string') {
- map = JSON.parse(map);
- }
- if (map.mappings === '') {
- return {
- mappings: [],
- names: [],
- sources: [],
- version: 3
- };
- }
- let mappings;
- if (typeof map.mappings === 'string') {
- mappings = decode(map.mappings);
- }
- else {
- mappings = map.mappings;
- }
- return { ...map, mappings };
- }
- function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemapChain }) {
- const renderChunkReducer = (code, result, plugin) => {
- if (result == null)
- return code;
- if (typeof result === 'string')
- result = {
- code: result,
- map: undefined
- };
- // strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning
- if (result.map !== null) {
- const map = decodedSourcemap(result.map);
- sourcemapChain.push(map || { missing: true, plugin: plugin.name });
- }
- return result.code;
- };
- return outputPluginDriver.hookReduceArg0('renderChunk', [code, renderChunk, options], renderChunkReducer);
- }
- function renderNamePattern(pattern, patternName, replacements) {
- if (!isPlainPathFragment(pattern))
- return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths and must not contain invalid characters.`));
- return pattern.replace(/\[(\w+)\]/g, (_match, type) => {
- if (!replacements.hasOwnProperty(type)) {
- return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`));
- }
- const replacement = replacements[type]();
- if (!isPlainPathFragment(replacement))
- return error(errFailedValidation(`Invalid substitution "${replacement}" for placeholder "[${type}]" in "${patternName}" pattern, can be neither absolute nor relative path.`));
- return replacement;
- });
- }
- function makeUnique(name, existingNames) {
- const existingNamesLowercase = new Set(Object.keys(existingNames).map(key => key.toLowerCase()));
- if (!existingNamesLowercase.has(name.toLocaleLowerCase()))
- return name;
- const ext = extname$1(name);
- name = name.substr(0, name.length - ext.length);
- let uniqueName, uniqueIndex = 1;
- while (existingNamesLowercase.has((uniqueName = name + ++uniqueIndex + ext).toLowerCase()))
- ;
- return uniqueName;
- }
- const NON_ASSET_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
- function getGlobalName(module, globals, hasExports, warn) {
- const globalName = typeof globals === 'function' ? globals(module.id) : globals[module.id];
- if (globalName) {
- return globalName;
- }
- if (hasExports) {
- warn({
- code: 'MISSING_GLOBAL_NAME',
- guess: module.variableName,
- message: `No name was provided for external module '${module.id}' in output.globals – guessing '${module.variableName}'`,
- source: module.id
- });
- return module.variableName;
- }
- }
- class Chunk$2 {
- constructor(orderedModules, inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, manualChunkAlias) {
- this.orderedModules = orderedModules;
- this.inputOptions = inputOptions;
- this.outputOptions = outputOptions;
- this.unsetOptions = unsetOptions;
- this.pluginDriver = pluginDriver;
- this.modulesById = modulesById;
- this.chunkByModule = chunkByModule;
- this.facadeChunkByModule = facadeChunkByModule;
- this.includedNamespaces = includedNamespaces;
- this.manualChunkAlias = manualChunkAlias;
- this.entryModules = [];
- this.exportMode = 'named';
- this.facadeModule = null;
- this.id = null;
- this.namespaceVariableName = '';
- this.variableName = '';
- this.accessedGlobalsByScope = new Map();
- this.dependencies = new Set();
- this.dynamicDependencies = new Set();
- this.dynamicEntryModules = [];
- this.exportNamesByVariable = new Map();
- this.exports = new Set();
- this.exportsByName = Object.create(null);
- this.fileName = null;
- this.implicitEntryModules = [];
- this.implicitlyLoadedBefore = new Set();
- this.imports = new Set();
- this.indentString = undefined;
- this.isEmpty = true;
- this.name = null;
- this.needsExportsShim = false;
- this.renderedDependencies = null;
- this.renderedExports = null;
- this.renderedHash = undefined;
- this.renderedModules = Object.create(null);
- this.renderedModuleSources = new Map();
- this.renderedSource = null;
- this.sortedExportNames = null;
- this.strictFacade = false;
- this.usedModules = undefined;
- this.execIndex = orderedModules.length > 0 ? orderedModules[0].execIndex : Infinity;
- const chunkModules = new Set(orderedModules);
- for (const module of orderedModules) {
- if (module.namespace.included) {
- includedNamespaces.add(module);
- }
- if (this.isEmpty && module.isIncluded()) {
- this.isEmpty = false;
- }
- if (module.info.isEntry || outputOptions.preserveModules) {
- this.entryModules.push(module);
- }
- for (const importer of module.includedDynamicImporters) {
- if (!chunkModules.has(importer)) {
- this.dynamicEntryModules.push(module);
- // Modules with synthetic exports need an artificial namespace for dynamic imports
- if (module.info.syntheticNamedExports && !outputOptions.preserveModules) {
- includedNamespaces.add(module);
- this.exports.add(module.namespace);
- }
- }
- }
- if (module.implicitlyLoadedAfter.size > 0) {
- this.implicitEntryModules.push(module);
- }
- }
- this.suggestedVariableName = makeLegal(this.generateVariableName());
- }
- static generateFacade(inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, facadedModule, facadeName) {
- const chunk = new Chunk$2([], inputOptions, outputOptions, unsetOptions, pluginDriver, modulesById, chunkByModule, facadeChunkByModule, includedNamespaces, null);
- chunk.assignFacadeName(facadeName, facadedModule);
- if (!facadeChunkByModule.has(facadedModule)) {
- facadeChunkByModule.set(facadedModule, chunk);
- }
- for (const dependency of facadedModule.getDependenciesToBeIncluded()) {
- chunk.dependencies.add(dependency instanceof Module$1 ? chunkByModule.get(dependency) : dependency);
- }
- if (!chunk.dependencies.has(chunkByModule.get(facadedModule)) &&
- facadedModule.info.hasModuleSideEffects &&
- facadedModule.hasEffects()) {
- chunk.dependencies.add(chunkByModule.get(facadedModule));
- }
- chunk.ensureReexportsAreAvailableForModule(facadedModule);
- chunk.facadeModule = facadedModule;
- chunk.strictFacade = true;
- return chunk;
- }
- canModuleBeFacade(module, exposedVariables) {
- const moduleExportNamesByVariable = module.getExportNamesByVariable();
- for (const exposedVariable of this.exports) {
- if (!moduleExportNamesByVariable.has(exposedVariable)) {
- if (moduleExportNamesByVariable.size === 0 &&
- module.isUserDefinedEntryPoint &&
- module.preserveSignature === 'strict' &&
- this.unsetOptions.has('preserveEntrySignatures')) {
- this.inputOptions.onwarn({
- code: 'EMPTY_FACADE',
- id: module.id,
- message: `To preserve the export signature of the entry module "${relativeId(module.id)}", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`,
- url: 'https://rollupjs.org/guide/en/#preserveentrysignatures'
- });
- }
- return false;
- }
- }
- for (const exposedVariable of exposedVariables) {
- if (!(moduleExportNamesByVariable.has(exposedVariable) || exposedVariable.module === module)) {
- return false;
- }
- }
- return true;
- }
- generateExports() {
- this.sortedExportNames = null;
- const remainingExports = new Set(this.exports);
- if (this.facadeModule !== null &&
- (this.facadeModule.preserveSignature !== false || this.strictFacade)) {
- const exportNamesByVariable = this.facadeModule.getExportNamesByVariable();
- for (const [variable, exportNames] of exportNamesByVariable) {
- this.exportNamesByVariable.set(variable, [...exportNames]);
- for (const exportName of exportNames) {
- this.exportsByName[exportName] = variable;
- }
- remainingExports.delete(variable);
- }
- }
- if (this.outputOptions.minifyInternalExports) {
- assignExportsToMangledNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
- }
- else {
- assignExportsToNames(remainingExports, this.exportsByName, this.exportNamesByVariable);
- }
- if (this.outputOptions.preserveModules || (this.facadeModule && this.facadeModule.info.isEntry))
- this.exportMode = getExportMode(this, this.outputOptions, this.unsetOptions, this.facadeModule.id, this.inputOptions.onwarn);
- }
- generateFacades() {
- var _a;
- const facades = [];
- const entryModules = new Set([...this.entryModules, ...this.implicitEntryModules]);
- const exposedVariables = new Set(this.dynamicEntryModules.map(module => module.namespace));
- for (const module of entryModules) {
- if (module.preserveSignature) {
- for (const exportedVariable of module.getExportNamesByVariable().keys()) {
- exposedVariables.add(exportedVariable);
- }
- }
- }
- for (const module of entryModules) {
- const requiredFacades = Array.from(module.userChunkNames, name => ({
- name
- }));
- if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {
- requiredFacades.push({});
- }
- requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));
- if (requiredFacades.length === 0) {
- requiredFacades.push({});
- }
- if (!this.facadeModule) {
- const needsStrictFacade = module.preserveSignature === 'strict' ||
- (module.preserveSignature === 'exports-only' &&
- module.getExportNamesByVariable().size !== 0);
- if (!needsStrictFacade ||
- this.outputOptions.preserveModules ||
- this.canModuleBeFacade(module, exposedVariables)) {
- this.facadeModule = module;
- this.facadeChunkByModule.set(module, this);
- if (module.preserveSignature) {
- this.strictFacade = needsStrictFacade;
- }
- this.assignFacadeName(requiredFacades.shift(), module);
- }
- }
- for (const facadeName of requiredFacades) {
- facades.push(Chunk$2.generateFacade(this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.modulesById, this.chunkByModule, this.facadeChunkByModule, this.includedNamespaces, module, facadeName));
- }
- }
- for (const module of this.dynamicEntryModules) {
- if (module.info.syntheticNamedExports)
- continue;
- if (!this.facadeModule && this.canModuleBeFacade(module, exposedVariables)) {
- this.facadeModule = module;
- this.facadeChunkByModule.set(module, this);
- this.strictFacade = true;
- this.assignFacadeName({}, module);
- }
- else if (this.facadeModule === module &&
- !this.strictFacade &&
- this.canModuleBeFacade(module, exposedVariables)) {
- this.strictFacade = true;
- }
- else if (!((_a = this.facadeChunkByModule.get(module)) === null || _a === void 0 ? void 0 : _a.strictFacade)) {
- this.includedNamespaces.add(module);
- this.exports.add(module.namespace);
- }
- }
- return facades;
- }
- generateId(addons, options, existingNames, includeHash) {
- if (this.fileName !== null) {
- return this.fileName;
- }
- const [pattern, patternName] = this.facadeModule && this.facadeModule.isUserDefinedEntryPoint
- ? [options.entryFileNames, 'output.entryFileNames']
- : [options.chunkFileNames, 'output.chunkFileNames'];
- return makeUnique(renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, patternName, {
- format: () => options.format,
- hash: () => includeHash
- ? this.computeContentHashWithDependencies(addons, options, existingNames)
- : '[hash]',
- name: () => this.getChunkName()
- }), existingNames);
- }
- generateIdPreserveModules(preserveModulesRelativeDir, options, existingNames, unsetOptions) {
- const id = this.orderedModules[0].id;
- const sanitizedId = sanitizeFileName(id);
- let path;
- if (isAbsolute(id)) {
- const extension = extname$1(id);
- const pattern = unsetOptions.has('entryFileNames')
- ? NON_ASSET_EXTENSIONS.includes(extension)
- ? '[name].js'
- : '[name][extname].js'
- : options.entryFileNames;
- const currentDir = dirname(sanitizedId);
- const fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getChunkInfo()) : pattern, 'output.entryFileNames', {
- ext: () => extension.substr(1),
- extname: () => extension,
- format: () => options.format,
- name: () => this.getChunkName()
- });
- const currentPath = `${currentDir}/${fileName}`;
- const { preserveModulesRoot } = options;
- if (preserveModulesRoot && currentPath.startsWith(preserveModulesRoot)) {
- path = currentPath.slice(preserveModulesRoot.length).replace(/^[\\/]/, '');
- }
- else {
- path = relative(preserveModulesRelativeDir, currentPath);
- }
- }
- else {
- path = `_virtual/${basename(sanitizedId)}`;
- }
- return makeUnique(normalize(path), existingNames);
- }
- getChunkInfo() {
- const facadeModule = this.facadeModule;
- const getChunkName = this.getChunkName.bind(this);
- return {
- exports: this.getExportNames(),
- facadeModuleId: facadeModule && facadeModule.id,
- isDynamicEntry: this.dynamicEntryModules.length > 0,
- isEntry: facadeModule !== null && facadeModule.info.isEntry,
- isImplicitEntry: this.implicitEntryModules.length > 0,
- modules: this.renderedModules,
- get name() {
- return getChunkName();
- },
- type: 'chunk'
- };
- }
- getChunkInfoWithFileNames() {
- return Object.assign(this.getChunkInfo(), {
- code: undefined,
- dynamicImports: Array.from(this.dynamicDependencies, getId),
- fileName: this.id,
- implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, getId),
- importedBindings: this.getImportedBindingsPerDependency(),
- imports: Array.from(this.dependencies, getId),
- map: undefined,
- referencedFiles: this.getReferencedFiles()
- });
- }
- getChunkName() {
- return this.name || (this.name = sanitizeFileName(this.getFallbackChunkName()));
- }
- getExportNames() {
- return (this.sortedExportNames || (this.sortedExportNames = Object.keys(this.exportsByName).sort()));
- }
- getRenderedHash() {
- if (this.renderedHash)
- return this.renderedHash;
- const hash = createHash();
- const hashAugmentation = this.pluginDriver.hookReduceValueSync('augmentChunkHash', '', [this.getChunkInfo()], (augmentation, pluginHash) => {
- if (pluginHash) {
- augmentation += pluginHash;
- }
- return augmentation;
- });
- hash.update(hashAugmentation);
- hash.update(this.renderedSource.toString());
- hash.update(this.getExportNames()
- .map(exportName => {
- const variable = this.exportsByName[exportName];
- return `${relativeId(variable.module.id).replace(/\\/g, '/')}:${variable.name}:${exportName}`;
- })
- .join(','));
- return (this.renderedHash = hash.digest('hex'));
- }
- getVariableExportName(variable) {
- if (this.outputOptions.preserveModules && variable instanceof NamespaceVariable) {
- return '*';
- }
- return this.exportNamesByVariable.get(variable)[0];
- }
- link() {
- this.dependencies = getStaticDependencies(this, this.orderedModules, this.chunkByModule);
- for (const module of this.orderedModules) {
- this.addDependenciesToChunk(module.dynamicDependencies, this.dynamicDependencies);
- this.addDependenciesToChunk(module.implicitlyLoadedBefore, this.implicitlyLoadedBefore);
- this.setUpChunkImportsAndExportsForModule(module);
- }
- }
- // prerender allows chunk hashes and names to be generated before finalizing
- preRender(options, inputBase) {
- const magicString = new Bundle$1({ separator: options.compact ? '' : '\n\n' });
- this.usedModules = [];
- this.indentString = getIndentString(this.orderedModules, options);
- const n = options.compact ? '' : '\n';
- const _ = options.compact ? '' : ' ';
- const renderOptions = {
- compact: options.compact,
- dynamicImportFunction: options.dynamicImportFunction,
- exportNamesByVariable: this.exportNamesByVariable,
- format: options.format,
- freeze: options.freeze,
- indent: this.indentString,
- namespaceToStringTag: options.namespaceToStringTag,
- outputPluginDriver: this.pluginDriver,
- varOrConst: options.preferConst ? 'const' : 'var'
- };
- // for static and dynamic entry points, inline the execution list to avoid loading latency
- if (options.hoistTransitiveImports &&
- !this.outputOptions.preserveModules &&
- this.facadeModule !== null) {
- for (const dep of this.dependencies) {
- if (dep instanceof Chunk$2)
- this.inlineChunkDependencies(dep);
- }
- }
- this.prepareDynamicImportsAndImportMetas();
- this.setIdentifierRenderResolutions(options);
- let hoistedSource = '';
- const renderedModules = this.renderedModules;
- for (const module of this.orderedModules) {
- let renderedLength = 0;
- if (module.isIncluded() || this.includedNamespaces.has(module)) {
- const source = module.render(renderOptions).trim();
- renderedLength = source.length();
- if (renderedLength) {
- if (options.compact && source.lastLine().indexOf('//') !== -1)
- source.append('\n');
- this.renderedModuleSources.set(module, source);
- magicString.addSource(source);
- this.usedModules.push(module);
- }
- const namespace = module.namespace;
- if (this.includedNamespaces.has(module) && !this.outputOptions.preserveModules) {
- const rendered = namespace.renderBlock(renderOptions);
- if (namespace.renderFirst())
- hoistedSource += n + rendered;
- else
- magicString.addSource(new MagicString$1(rendered));
- }
- }
- const { renderedExports, removedExports } = module.getRenderedExports();
- renderedModules[module.id] = {
- originalLength: module.originalCode.length,
- removedExports,
- renderedExports,
- renderedLength
- };
- }
- if (hoistedSource)
- magicString.prepend(hoistedSource + n + n);
- if (this.needsExportsShim) {
- magicString.prepend(`${n}${renderOptions.varOrConst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);
- }
- if (options.compact) {
- this.renderedSource = magicString;
- }
- else {
- this.renderedSource = magicString.trim();
- }
- this.renderedHash = undefined;
- if (this.isEmpty && this.getExportNames().length === 0 && this.dependencies.size === 0) {
- const chunkName = this.getChunkName();
- this.inputOptions.onwarn({
- chunkName,
- code: 'EMPTY_BUNDLE',
- message: `Generated an empty chunk: "${chunkName}"`
- });
- }
- this.setExternalRenderPaths(options, inputBase);
- this.renderedDependencies = this.getChunkDependencyDeclarations(options);
- this.renderedExports =
- this.exportMode === 'none' ? [] : this.getChunkExportDeclarations(options.format);
- }
- async render(options, addons, outputChunk) {
- timeStart('render format', 2);
- const format = options.format;
- const finalise = finalisers[format];
- if (options.dynamicImportFunction && format !== 'es') {
- this.inputOptions.onwarn({
- code: 'INVALID_OPTION',
- message: '"output.dynamicImportFunction" is ignored for formats other than "es".'
- });
- }
- // populate ids in the rendered declarations only here
- // as chunk ids known only after prerender
- for (const dependency of this.dependencies) {
- const renderedDependency = this.renderedDependencies.get(dependency);
- if (dependency instanceof ExternalModule) {
- const originalId = dependency.renderPath;
- renderedDependency.id = escapeId(dependency.renormalizeRenderPath ? this.getRelativePath(originalId, false) : originalId);
- }
- else {
- renderedDependency.namedExportsMode = dependency.exportMode !== 'default';
- renderedDependency.id = escapeId(this.getRelativePath(dependency.id, false));
- }
- }
- this.finaliseDynamicImports(options);
- this.finaliseImportMetas(format);
- const hasExports = this.renderedExports.length !== 0 ||
- [...this.renderedDependencies.values()].some(dep => (dep.reexports && dep.reexports.length !== 0));
- let usesTopLevelAwait = false;
- const accessedGlobals = new Set();
- for (const module of this.orderedModules) {
- if (module.usesTopLevelAwait) {
- usesTopLevelAwait = true;
- }
- const accessedGlobalVariables = this.accessedGlobalsByScope.get(module.scope);
- if (accessedGlobalVariables) {
- for (const name of accessedGlobalVariables) {
- accessedGlobals.add(name);
- }
- }
- }
- if (usesTopLevelAwait && format !== 'es' && format !== 'system') {
- return error({
- code: 'INVALID_TLA_FORMAT',
- message: `Module format ${format} does not support top-level await. Use the "es" or "system" output formats rather.`
- });
- }
- /* istanbul ignore next */
- if (!this.id) {
- throw new Error('Internal Error: expecting chunk id');
- }
- const magicString = finalise(this.renderedSource, {
- accessedGlobals,
- dependencies: [...this.renderedDependencies.values()],
- exports: this.renderedExports,
- hasExports,
- id: this.id,
- indentString: this.indentString,
- intro: addons.intro,
- isEntryFacade: this.outputOptions.preserveModules ||
- (this.facadeModule !== null && this.facadeModule.info.isEntry),
- isModuleFacade: this.facadeModule !== null,
- namedExportsMode: this.exportMode !== 'default',
- outro: addons.outro,
- usesTopLevelAwait,
- varOrConst: options.preferConst ? 'const' : 'var',
- warn: this.inputOptions.onwarn
- }, options);
- if (addons.banner)
- magicString.prepend(addons.banner);
- if (addons.footer)
- magicString.append(addons.footer);
- const prevCode = magicString.toString();
- timeEnd('render format', 2);
- let map = null;
- const chunkSourcemapChain = [];
- let code = await renderChunk({
- code: prevCode,
- options,
- outputPluginDriver: this.pluginDriver,
- renderChunk: outputChunk,
- sourcemapChain: chunkSourcemapChain
- });
- if (options.sourcemap) {
- timeStart('sourcemap', 2);
- let file;
- if (options.file)
- file = resolve$1(options.sourcemapFile || options.file);
- else if (options.dir)
- file = resolve$1(options.dir, this.id);
- else
- file = resolve$1(this.id);
- const decodedMap = magicString.generateDecodedMap({});
- map = collapseSourcemaps(file, decodedMap, this.usedModules, chunkSourcemapChain, options.sourcemapExcludeSources, this.inputOptions.onwarn);
- map.sources = map.sources
- .map(sourcePath => {
- const { sourcemapPathTransform } = options;
- if (sourcemapPathTransform) {
- const newSourcePath = sourcemapPathTransform(sourcePath, `${file}.map`);
- if (typeof newSourcePath !== 'string') {
- error(errFailedValidation(`sourcemapPathTransform function must return a string.`));
- }
- return newSourcePath;
- }
- return sourcePath;
- })
- .map(normalize);
- timeEnd('sourcemap', 2);
- }
- if (!options.compact && code[code.length - 1] !== '\n')
- code += '\n';
- return { code, map };
- }
- addDependenciesToChunk(moduleDependencies, chunkDependencies) {
- for (const module of moduleDependencies) {
- if (module instanceof Module$1) {
- const chunk = this.chunkByModule.get(module);
- if (chunk && chunk !== this) {
- chunkDependencies.add(chunk);
- }
- }
- else {
- chunkDependencies.add(module);
- }
- }
- }
- assignFacadeName({ fileName, name }, facadedModule) {
- if (fileName) {
- this.fileName = fileName;
- }
- else {
- this.name = sanitizeFileName(name || facadedModule.chunkName || getAliasName(facadedModule.id));
- }
- }
- checkCircularDependencyImport(variable, importingModule) {
- const variableModule = variable.module;
- if (variableModule instanceof Module$1) {
- const exportChunk = this.chunkByModule.get(variableModule);
- let alternativeReexportModule;
- do {
- alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
- if (alternativeReexportModule) {
- const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
- if (exportingChunk && exportingChunk !== exportChunk) {
- this.inputOptions.onwarn(errCyclicCrossChunkReexport(variableModule.getExportNamesByVariable().get(variable)[0], variableModule.id, alternativeReexportModule.id, importingModule.id));
- }
- importingModule = alternativeReexportModule;
- }
- } while (alternativeReexportModule);
- }
- }
- computeContentHashWithDependencies(addons, options, existingNames) {
- const hash = createHash();
- hash.update([addons.intro, addons.outro, addons.banner, addons.footer].map(addon => addon || '').join(':'));
- hash.update(options.format);
- const dependenciesForHashing = new Set([this]);
- for (const current of dependenciesForHashing) {
- if (current instanceof ExternalModule) {
- hash.update(':' + current.renderPath);
- }
- else {
- hash.update(current.getRenderedHash());
- hash.update(current.generateId(addons, options, existingNames, false));
- }
- if (current instanceof ExternalModule)
- continue;
- for (const dependency of [...current.dependencies, ...current.dynamicDependencies]) {
- dependenciesForHashing.add(dependency);
- }
- }
- return hash.digest('hex').substr(0, 8);
- }
- ensureReexportsAreAvailableForModule(module) {
- const map = module.getExportNamesByVariable();
- for (const exportedVariable of map.keys()) {
- const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
- const importedVariable = isSynthetic
- ? exportedVariable.getBaseVariable()
- : exportedVariable;
- if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
- this.checkCircularDependencyImport(importedVariable, module);
- const exportingModule = importedVariable.module;
- if (exportingModule instanceof Module$1) {
- const chunk = this.chunkByModule.get(exportingModule);
- if (chunk && chunk !== this) {
- chunk.exports.add(importedVariable);
- if (isSynthetic) {
- this.imports.add(importedVariable);
- }
- }
- }
- }
- }
- }
- finaliseDynamicImports(options) {
- const stripKnownJsExtensions = options.format === 'amd';
- for (const [module, code] of this.renderedModuleSources) {
- for (const { node, resolution } of module.dynamicImports) {
- const chunk = this.chunkByModule.get(resolution);
- const facadeChunk = this.facadeChunkByModule.get(resolution);
- if (!resolution || !node.included || chunk === this) {
- continue;
- }
- const renderedResolution = resolution instanceof Module$1
- ? `'${this.getRelativePath((facadeChunk || chunk).id, stripKnownJsExtensions)}'`
- : resolution instanceof ExternalModule
- ? `'${resolution.renormalizeRenderPath
- ? this.getRelativePath(resolution.renderPath, stripKnownJsExtensions)
- : resolution.renderPath}'`
- : resolution;
- node.renderFinalResolution(code, renderedResolution, resolution instanceof Module$1 &&
- !(facadeChunk === null || facadeChunk === void 0 ? void 0 : facadeChunk.strictFacade) &&
- chunk.exportNamesByVariable.get(resolution.namespace)[0], options);
- }
- }
- }
- finaliseImportMetas(format) {
- for (const [module, code] of this.renderedModuleSources) {
- for (const importMeta of module.importMetas) {
- importMeta.renderFinalMechanism(code, this.id, format, this.pluginDriver);
- }
- }
- }
- generateVariableName() {
- if (this.manualChunkAlias) {
- return this.manualChunkAlias;
- }
- const moduleForNaming = this.entryModules[0] ||
- this.implicitEntryModules[0] ||
- this.dynamicEntryModules[0] ||
- this.orderedModules[this.orderedModules.length - 1];
- if (moduleForNaming) {
- return moduleForNaming.chunkName || getAliasName(moduleForNaming.id);
- }
- return 'chunk';
- }
- getChunkDependencyDeclarations(options) {
- const importSpecifiers = this.getImportSpecifiers();
- const reexportSpecifiers = this.getReexportSpecifiers();
- const dependencyDeclaration = new Map();
- for (const dep of this.dependencies) {
- const imports = importSpecifiers.get(dep) || null;
- const reexports = reexportSpecifiers.get(dep) || null;
- const namedExportsMode = dep instanceof ExternalModule || dep.exportMode !== 'default';
- dependencyDeclaration.set(dep, {
- defaultVariableName: dep.defaultVariableName,
- globalName: (dep instanceof ExternalModule &&
- (options.format === 'umd' || options.format === 'iife') &&
- getGlobalName(dep, options.globals, (imports || reexports) !== null, this.inputOptions.onwarn)),
- id: undefined,
- imports,
- isChunk: dep instanceof Chunk$2,
- name: dep.variableName,
- namedExportsMode,
- namespaceVariableName: dep.namespaceVariableName,
- reexports
- });
- }
- return dependencyDeclaration;
- }
- getChunkExportDeclarations(format) {
- const exports = [];
- for (const exportName of this.getExportNames()) {
- if (exportName[0] === '*')
- continue;
- const variable = this.exportsByName[exportName];
- if (!(variable instanceof SyntheticNamedExportVariable)) {
- const module = variable.module;
- if (module && this.chunkByModule.get(module) !== this)
- continue;
- }
- let expression = null;
- let hoisted = false;
- let uninitialized = false;
- let local = variable.getName();
- if (variable instanceof LocalVariable) {
- if (variable.init === UNDEFINED_EXPRESSION) {
- uninitialized = true;
- }
- for (const declaration of variable.declarations) {
- if (declaration.parent instanceof FunctionDeclaration ||
- (declaration instanceof ExportDefaultDeclaration &&
- declaration.declaration instanceof FunctionDeclaration)) {
- hoisted = true;
- break;
- }
- }
- }
- else if (variable instanceof SyntheticNamedExportVariable) {
- expression = local;
- if (format === 'es' && exportName !== 'default') {
- local = variable.renderName;
- }
- }
- exports.push({
- exported: exportName,
- expression,
- hoisted,
- local,
- uninitialized
- });
- }
- return exports;
- }
- getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) {
- const dependencies = new Set();
- const deconflictedDefault = new Set();
- const deconflictedNamespace = new Set();
- for (const variable of [...this.exportNamesByVariable.keys(), ...this.imports]) {
- if (addNonNamespacesAndInteropHelpers || variable.isNamespace) {
- const module = variable.module;
- if (module instanceof ExternalModule) {
- dependencies.add(module);
- if (addNonNamespacesAndInteropHelpers) {
- if (variable.name === 'default') {
- if (defaultInteropHelpersByInteropType[String(interop(module.id))]) {
- deconflictedDefault.add(module);
- }
- }
- else if (variable.name === '*') {
- if (namespaceInteropHelpersByInteropType[String(interop(module.id))]) {
- deconflictedNamespace.add(module);
- }
- }
- }
- }
- else {
- const chunk = this.chunkByModule.get(module);
- if (chunk !== this) {
- dependencies.add(chunk);
- if (addNonNamespacesAndInteropHelpers &&
- chunk.exportMode === 'default' &&
- variable.isNamespace) {
- deconflictedNamespace.add(chunk);
- }
- }
- }
- }
- }
- if (addDependenciesWithoutBindings) {
- for (const dependency of this.dependencies) {
- dependencies.add(dependency);
- }
- }
- return { deconflictedDefault, deconflictedNamespace, dependencies };
- }
- getFallbackChunkName() {
- if (this.manualChunkAlias) {
- return this.manualChunkAlias;
- }
- if (this.fileName) {
- return getAliasName(this.fileName);
- }
- return getAliasName(this.orderedModules[this.orderedModules.length - 1].id);
- }
- getImportedBindingsPerDependency() {
- const importSpecifiers = {};
- for (const [dependency, declaration] of this.renderedDependencies) {
- const specifiers = new Set();
- if (declaration.imports) {
- for (const { imported } of declaration.imports) {
- specifiers.add(imported);
- }
- }
- if (declaration.reexports) {
- for (const { imported } of declaration.reexports) {
- specifiers.add(imported);
- }
- }
- importSpecifiers[dependency.id] = [...specifiers];
- }
- return importSpecifiers;
- }
- getImportSpecifiers() {
- const { interop } = this.outputOptions;
- const importsByDependency = new Map();
- for (const variable of this.imports) {
- const module = variable.module;
- let dependency;
- let imported;
- if (module instanceof ExternalModule) {
- dependency = module;
- imported = variable.name;
- if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
- return error(errUnexpectedNamedImport(module.id, imported, false));
- }
- }
- else {
- dependency = this.chunkByModule.get(module);
- imported = dependency.getVariableExportName(variable);
- }
- getOrCreate(importsByDependency, dependency, () => []).push({
- imported,
- local: variable.getName()
- });
- }
- return importsByDependency;
- }
- getReexportSpecifiers() {
- const { externalLiveBindings, interop } = this.outputOptions;
- const reexportSpecifiers = new Map();
- for (let exportName of this.getExportNames()) {
- let dependency;
- let imported;
- let needsLiveBinding = false;
- if (exportName[0] === '*') {
- const id = exportName.substr(1);
- if (interop(id) === 'defaultOnly') {
- this.inputOptions.onwarn(errUnexpectedNamespaceReexport(id));
- }
- needsLiveBinding = externalLiveBindings;
- dependency = this.modulesById.get(id);
- imported = exportName = '*';
- }
- else {
- const variable = this.exportsByName[exportName];
- if (variable instanceof SyntheticNamedExportVariable)
- continue;
- const module = variable.module;
- if (module instanceof Module$1) {
- dependency = this.chunkByModule.get(module);
- if (dependency === this)
- continue;
- imported = dependency.getVariableExportName(variable);
- needsLiveBinding = variable.isReassigned;
- }
- else {
- dependency = module;
- imported = variable.name;
- if (imported !== 'default' && imported !== '*' && interop(module.id) === 'defaultOnly') {
- return error(errUnexpectedNamedImport(module.id, imported, true));
- }
- needsLiveBinding =
- externalLiveBindings &&
- (imported !== 'default' || isDefaultAProperty(String(interop(module.id)), true));
- }
- }
- getOrCreate(reexportSpecifiers, dependency, () => []).push({
- imported,
- needsLiveBinding,
- reexported: exportName
- });
- }
- return reexportSpecifiers;
- }
- getReferencedFiles() {
- const referencedFiles = [];
- for (const module of this.orderedModules) {
- for (const meta of module.importMetas) {
- const fileName = meta.getReferencedFileName(this.pluginDriver);
- if (fileName) {
- referencedFiles.push(fileName);
- }
- }
- }
- return referencedFiles;
- }
- getRelativePath(targetPath, stripJsExtension) {
- let relativePath = normalize(relative(dirname(this.id), targetPath));
- if (stripJsExtension && relativePath.endsWith('.js')) {
- relativePath = relativePath.slice(0, -3);
- }
- if (relativePath === '..')
- return '../../' + basename(targetPath);
- if (relativePath === '')
- return '../' + basename(targetPath);
- return relativePath.startsWith('../') ? relativePath : './' + relativePath;
- }
- inlineChunkDependencies(chunk) {
- for (const dep of chunk.dependencies) {
- if (this.dependencies.has(dep))
- continue;
- this.dependencies.add(dep);
- if (dep instanceof Chunk$2) {
- this.inlineChunkDependencies(dep);
- }
- }
- }
- prepareDynamicImportsAndImportMetas() {
- var _a;
- const accessedGlobalsByScope = this.accessedGlobalsByScope;
- for (const module of this.orderedModules) {
- for (const { node, resolution } of module.dynamicImports) {
- if (node.included) {
- if (resolution instanceof Module$1) {
- const chunk = this.chunkByModule.get(resolution);
- if (chunk === this) {
- node.setInternalResolution(resolution.namespace);
- }
- else {
- node.setExternalResolution(((_a = this.facadeChunkByModule.get(resolution)) === null || _a === void 0 ? void 0 : _a.exportMode) || chunk.exportMode, resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
- }
- }
- else {
- node.setExternalResolution('external', resolution, this.outputOptions, this.pluginDriver, accessedGlobalsByScope);
- }
- }
- }
- for (const importMeta of module.importMetas) {
- importMeta.addAccessedGlobals(this.outputOptions.format, accessedGlobalsByScope);
- }
- }
- }
- setExternalRenderPaths(options, inputBase) {
- for (const dependency of [...this.dependencies, ...this.dynamicDependencies]) {
- if (dependency instanceof ExternalModule) {
- dependency.setRenderPath(options, inputBase);
- }
- }
- }
- setIdentifierRenderResolutions({ format, interop, namespaceToStringTag }) {
- const syntheticExports = new Set();
- for (const exportName of this.getExportNames()) {
- const exportVariable = this.exportsByName[exportName];
- if (exportVariable instanceof ExportShimVariable) {
- this.needsExportsShim = true;
- }
- if (format !== 'es' &&
- format !== 'system' &&
- exportVariable.isReassigned &&
- !exportVariable.isId) {
- exportVariable.setRenderNames('exports', exportName);
- }
- else if (exportVariable instanceof SyntheticNamedExportVariable) {
- syntheticExports.add(exportVariable);
- }
- else {
- exportVariable.setRenderNames(null, null);
- }
- }
- const usedNames = new Set(['Object', 'Promise']);
- if (this.needsExportsShim) {
- usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
- }
- if (namespaceToStringTag) {
- usedNames.add('Symbol');
- }
- switch (format) {
- case 'system':
- usedNames.add('module').add('exports');
- break;
- case 'es':
- break;
- case 'cjs':
- usedNames.add('module').add('require').add('__filename').add('__dirname');
- // fallthrough
- default:
- usedNames.add('exports');
- for (const helper of HELPER_NAMES) {
- usedNames.add(helper);
- }
- }
- deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, this.outputOptions.preserveModules, this.outputOptions.externalLiveBindings, this.chunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
- }
- setUpChunkImportsAndExportsForModule(module) {
- const moduleImports = new Set(module.imports);
- // when we are not preserving modules, we need to make all namespace variables available for
- // rendering the namespace object
- if (!this.outputOptions.preserveModules) {
- if (this.includedNamespaces.has(module)) {
- const memberVariables = module.namespace.getMemberVariables();
- for (const name of Object.keys(memberVariables)) {
- moduleImports.add(memberVariables[name]);
- }
- }
- }
- for (let variable of moduleImports) {
- if (variable instanceof ExportDefaultVariable) {
- variable = variable.getOriginalVariable();
- }
- if (variable instanceof SyntheticNamedExportVariable) {
- variable = variable.getBaseVariable();
- }
- const chunk = this.chunkByModule.get(variable.module);
- if (chunk !== this) {
- this.imports.add(variable);
- if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules) &&
- variable.module instanceof Module$1) {
- chunk.exports.add(variable);
- this.checkCircularDependencyImport(variable, module);
- }
- }
- }
- if (this.includedNamespaces.has(module) ||
- (module.info.isEntry && module.preserveSignature !== false) ||
- module.includedDynamicImporters.some(importer => this.chunkByModule.get(importer) !== this)) {
- this.ensureReexportsAreAvailableForModule(module);
- }
- for (const { node, resolution } of module.dynamicImports) {
- if (node.included &&
- resolution instanceof Module$1 &&
- this.chunkByModule.get(resolution) === this &&
- !this.includedNamespaces.has(resolution)) {
- this.includedNamespaces.add(resolution);
- this.ensureReexportsAreAvailableForModule(resolution);
- }
- }
- }
- }
- const concatSep = (out, next) => (next ? `${out}\n${next}` : out);
- const concatDblSep = (out, next) => (next ? `${out}\n\n${next}` : out);
- async function createAddons(options, outputPluginDriver) {
- try {
- let [banner, footer, intro, outro] = await Promise.all([
- outputPluginDriver.hookReduceValue('banner', options.banner(), [], concatSep),
- outputPluginDriver.hookReduceValue('footer', options.footer(), [], concatSep),
- outputPluginDriver.hookReduceValue('intro', options.intro(), [], concatDblSep),
- outputPluginDriver.hookReduceValue('outro', options.outro(), [], concatDblSep)
- ]);
- if (intro)
- intro += '\n\n';
- if (outro)
- outro = `\n\n${outro}`;
- if (banner.length)
- banner += '\n';
- if (footer.length)
- footer = '\n' + footer;
- return { intro, outro, banner, footer };
- }
- catch (err) {
- return error({
- code: 'ADDON_ERROR',
- message: `Could not retrieve ${err.hook}. Check configuration of plugin ${err.plugin}.
- \tError Message: ${err.message}`
- });
- }
- }
- function getChunkAssignments(entryModules, manualChunkAliasByEntry) {
- const chunkDefinitions = [];
- const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
- const manualChunkModulesByAlias = Object.create(null);
- for (const [entry, alias] of manualChunkAliasByEntry) {
- const chunkModules = (manualChunkModulesByAlias[alias] =
- manualChunkModulesByAlias[alias] || []);
- addStaticDependenciesToManualChunk(entry, chunkModules, modulesInManualChunks);
- }
- for (const [alias, modules] of Object.entries(manualChunkModulesByAlias)) {
- chunkDefinitions.push({ alias, modules });
- }
- const assignedEntryPointsByModule = new Map();
- const { dependentEntryPointsByModule, dynamicEntryModules } = analyzeModuleGraph(entryModules);
- const dynamicallyDependentEntryPointsByDynamicEntry = getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules);
- const staticEntries = new Set(entryModules);
- function assignEntryToStaticDependencies(entry, dynamicDependentEntryPoints) {
- const modulesToHandle = new Set([entry]);
- for (const module of modulesToHandle) {
- const assignedEntryPoints = getOrCreate(assignedEntryPointsByModule, module, () => new Set());
- if (dynamicDependentEntryPoints &&
- areEntryPointsContainedOrDynamicallyDependent(dynamicDependentEntryPoints, dependentEntryPointsByModule.get(module))) {
- continue;
- }
- else {
- assignedEntryPoints.add(entry);
- }
- for (const dependency of module.getDependenciesToBeIncluded()) {
- if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
- modulesToHandle.add(dependency);
- }
- }
- }
- }
- function areEntryPointsContainedOrDynamicallyDependent(entryPoints, containedIn) {
- const entriesToCheck = new Set(entryPoints);
- for (const entry of entriesToCheck) {
- if (!containedIn.has(entry)) {
- if (staticEntries.has(entry))
- return false;
- const dynamicallyDependentEntryPoints = dynamicallyDependentEntryPointsByDynamicEntry.get(entry);
- for (const dependentEntry of dynamicallyDependentEntryPoints) {
- entriesToCheck.add(dependentEntry);
- }
- }
- }
- return true;
- }
- for (const entry of entryModules) {
- if (!modulesInManualChunks.has(entry)) {
- assignEntryToStaticDependencies(entry, null);
- }
- }
- for (const entry of dynamicEntryModules) {
- if (!modulesInManualChunks.has(entry)) {
- assignEntryToStaticDependencies(entry, dynamicallyDependentEntryPointsByDynamicEntry.get(entry));
- }
- }
- chunkDefinitions.push(...createChunks([...entryModules, ...dynamicEntryModules], assignedEntryPointsByModule));
- return chunkDefinitions;
- }
- function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesInManualChunks) {
- const modulesToHandle = new Set([entry]);
- for (const module of modulesToHandle) {
- modulesInManualChunks.add(module);
- manualChunkModules.push(module);
- for (const dependency of module.dependencies) {
- if (!(dependency instanceof ExternalModule || modulesInManualChunks.has(dependency))) {
- modulesToHandle.add(dependency);
- }
- }
- }
- }
- function analyzeModuleGraph(entryModules) {
- const dynamicEntryModules = new Set();
- const dependentEntryPointsByModule = new Map();
- const entriesToHandle = new Set(entryModules);
- for (const currentEntry of entriesToHandle) {
- const modulesToHandle = new Set([currentEntry]);
- for (const module of modulesToHandle) {
- getOrCreate(dependentEntryPointsByModule, module, () => new Set()).add(currentEntry);
- for (const dependency of module.getDependenciesToBeIncluded()) {
- if (!(dependency instanceof ExternalModule)) {
- modulesToHandle.add(dependency);
- }
- }
- for (const { resolution } of module.dynamicImports) {
- if (resolution instanceof Module$1 && resolution.includedDynamicImporters.length > 0) {
- dynamicEntryModules.add(resolution);
- entriesToHandle.add(resolution);
- }
- }
- for (const dependency of module.implicitlyLoadedBefore) {
- dynamicEntryModules.add(dependency);
- entriesToHandle.add(dependency);
- }
- }
- }
- return { dependentEntryPointsByModule, dynamicEntryModules };
- }
- function getDynamicDependentEntryPoints(dependentEntryPointsByModule, dynamicEntryModules) {
- const dynamicallyDependentEntryPointsByDynamicEntry = new Map();
- for (const dynamicEntry of dynamicEntryModules) {
- const dynamicDependentEntryPoints = getOrCreate(dynamicallyDependentEntryPointsByDynamicEntry, dynamicEntry, () => new Set());
- for (const importer of [
- ...dynamicEntry.includedDynamicImporters,
- ...dynamicEntry.implicitlyLoadedAfter
- ]) {
- for (const entryPoint of dependentEntryPointsByModule.get(importer)) {
- dynamicDependentEntryPoints.add(entryPoint);
- }
- }
- }
- return dynamicallyDependentEntryPointsByDynamicEntry;
- }
- function createChunks(allEntryPoints, assignedEntryPointsByModule) {
- const chunkModules = Object.create(null);
- for (const [module, assignedEntryPoints] of assignedEntryPointsByModule) {
- let chunkSignature = '';
- for (const entry of allEntryPoints) {
- chunkSignature += assignedEntryPoints.has(entry) ? 'X' : '_';
- }
- const chunk = chunkModules[chunkSignature];
- if (chunk) {
- chunk.push(module);
- }
- else {
- chunkModules[chunkSignature] = [module];
- }
- }
- return Object.keys(chunkModules).map(chunkSignature => ({
- alias: null,
- modules: chunkModules[chunkSignature]
- }));
- }
- // ported from https://github.com/substack/node-commondir
- function commondir$1(files) {
- if (files.length === 0)
- return '/';
- if (files.length === 1)
- return dirname(files[0]);
- const commonSegments = files.slice(1).reduce((commonSegments, file) => {
- const pathSegements = file.split(/\/+|\\+/);
- let i;
- for (i = 0; commonSegments[i] === pathSegements[i] &&
- i < Math.min(commonSegments.length, pathSegements.length); i++)
- ;
- return commonSegments.slice(0, i);
- }, files[0].split(/\/+|\\+/));
- // Windows correctly handles paths with forward-slashes
- return commonSegments.length > 1 ? commonSegments.join('/') : '/';
- }
- const compareExecIndex = (unitA, unitB) => unitA.execIndex > unitB.execIndex ? 1 : -1;
- function sortByExecutionOrder(units) {
- units.sort(compareExecIndex);
- }
- function analyseModuleExecution(entryModules) {
- let nextExecIndex = 0;
- const cyclePaths = [];
- const analysedModules = new Set();
- const dynamicImports = new Set();
- const parents = new Map();
- const orderedModules = [];
- const analyseModule = (module) => {
- if (module instanceof Module$1) {
- for (const dependency of module.dependencies) {
- if (parents.has(dependency)) {
- if (!analysedModules.has(dependency)) {
- cyclePaths.push(getCyclePath(dependency, module, parents));
- }
- continue;
- }
- parents.set(dependency, module);
- analyseModule(dependency);
- }
- for (const dependency of module.implicitlyLoadedBefore) {
- dynamicImports.add(dependency);
- }
- for (const { resolution } of module.dynamicImports) {
- if (resolution instanceof Module$1) {
- dynamicImports.add(resolution);
- }
- }
- orderedModules.push(module);
- }
- module.execIndex = nextExecIndex++;
- analysedModules.add(module);
- };
- for (const curEntry of entryModules) {
- if (!parents.has(curEntry)) {
- parents.set(curEntry, null);
- analyseModule(curEntry);
- }
- }
- for (const curEntry of dynamicImports) {
- if (!parents.has(curEntry)) {
- parents.set(curEntry, null);
- analyseModule(curEntry);
- }
- }
- return { orderedModules, cyclePaths };
- }
- function getCyclePath(module, parent, parents) {
- const cycleSymbol = Symbol(module.id);
- const path = [relativeId(module.id)];
- let nextModule = parent;
- module.cycles.add(cycleSymbol);
- while (nextModule !== module) {
- nextModule.cycles.add(cycleSymbol);
- path.push(relativeId(nextModule.id));
- nextModule = parents.get(nextModule);
- }
- path.push(path[0]);
- path.reverse();
- return path;
- }
- var BuildPhase;
- (function (BuildPhase) {
- BuildPhase[BuildPhase["LOAD_AND_PARSE"] = 0] = "LOAD_AND_PARSE";
- BuildPhase[BuildPhase["ANALYSE"] = 1] = "ANALYSE";
- BuildPhase[BuildPhase["GENERATE"] = 2] = "GENERATE";
- })(BuildPhase || (BuildPhase = {}));
- function generateAssetFileName(name, source, output) {
- const emittedName = name || 'asset';
- return makeUnique(renderNamePattern(typeof output.assetFileNames === 'function'
- ? output.assetFileNames({ name, source, type: 'asset' })
- : output.assetFileNames, 'output.assetFileNames', {
- hash() {
- const hash = createHash();
- hash.update(emittedName);
- hash.update(':');
- hash.update(source);
- return hash.digest('hex').substr(0, 8);
- },
- ext: () => extname$1(emittedName).substr(1),
- extname: () => extname$1(emittedName),
- name: () => emittedName.substr(0, emittedName.length - extname$1(emittedName).length)
- }), output.bundle);
- }
- function reserveFileNameInBundle(fileName, bundle, warn) {
- if (fileName in bundle) {
- warn(errFileNameConflict(fileName));
- }
- bundle[fileName] = FILE_PLACEHOLDER;
- }
- const FILE_PLACEHOLDER = {
- type: 'placeholder'
- };
- function hasValidType(emittedFile) {
- return Boolean(emittedFile &&
- (emittedFile.type === 'asset' ||
- emittedFile.type === 'chunk'));
- }
- function hasValidName(emittedFile) {
- const validatedName = emittedFile.fileName || emittedFile.name;
- return (!validatedName || (typeof validatedName === 'string' && isPlainPathFragment(validatedName)));
- }
- function getValidSource(source, emittedFile, fileReferenceId) {
- if (!(typeof source === 'string' || source instanceof Uint8Array)) {
- const assetName = emittedFile.fileName || emittedFile.name || fileReferenceId;
- return error(errFailedValidation(`Could not set source for ${typeof assetName === 'string' ? `asset "${assetName}"` : 'unnamed asset'}, asset source needs to be a string, Uint8Array or Buffer.`));
- }
- return source;
- }
- function getAssetFileName(file, referenceId) {
- if (typeof file.fileName !== 'string') {
- return error(errAssetNotFinalisedForFileName(file.name || referenceId));
- }
- return file.fileName;
- }
- function getChunkFileName(file, facadeChunkByModule) {
- var _a;
- const fileName = file.fileName || (file.module && ((_a = facadeChunkByModule === null || facadeChunkByModule === void 0 ? void 0 : facadeChunkByModule.get(file.module)) === null || _a === void 0 ? void 0 : _a.id));
- if (!fileName)
- return error(errChunkNotGeneratedForFileName(file.fileName || file.name));
- return fileName;
- }
- class FileEmitter {
- constructor(graph, options, baseFileEmitter) {
- this.graph = graph;
- this.options = options;
- this.facadeChunkByModule = null;
- this.output = null;
- this.assertAssetsFinalized = () => {
- for (const [referenceId, emittedFile] of this.filesByReferenceId.entries()) {
- if (emittedFile.type === 'asset' && typeof emittedFile.fileName !== 'string')
- return error(errNoAssetSourceSet(emittedFile.name || referenceId));
- }
- };
- this.emitFile = (emittedFile) => {
- if (!hasValidType(emittedFile)) {
- return error(errFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
- }
- if (!hasValidName(emittedFile)) {
- return error(errFailedValidation(`The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths and do not contain invalid characters, received "${emittedFile.fileName || emittedFile.name}".`));
- }
- if (emittedFile.type === 'chunk') {
- return this.emitChunk(emittedFile);
- }
- else {
- return this.emitAsset(emittedFile);
- }
- };
- this.getFileName = (fileReferenceId) => {
- const emittedFile = this.filesByReferenceId.get(fileReferenceId);
- if (!emittedFile)
- return error(errFileReferenceIdNotFoundForFilename(fileReferenceId));
- if (emittedFile.type === 'chunk') {
- return getChunkFileName(emittedFile, this.facadeChunkByModule);
- }
- else {
- return getAssetFileName(emittedFile, fileReferenceId);
- }
- };
- this.setAssetSource = (referenceId, requestedSource) => {
- const consumedFile = this.filesByReferenceId.get(referenceId);
- if (!consumedFile)
- return error(errAssetReferenceIdNotFoundForSetSource(referenceId));
- if (consumedFile.type !== 'asset') {
- return error(errFailedValidation(`Asset sources can only be set for emitted assets but "${referenceId}" is an emitted chunk.`));
- }
- if (consumedFile.source !== undefined) {
- return error(errAssetSourceAlreadySet(consumedFile.name || referenceId));
- }
- const source = getValidSource(requestedSource, consumedFile, referenceId);
- if (this.output) {
- this.finalizeAsset(consumedFile, source, referenceId, this.output);
- }
- else {
- consumedFile.source = source;
- }
- };
- this.setOutputBundle = (outputBundle, assetFileNames, facadeChunkByModule) => {
- this.output = {
- assetFileNames,
- bundle: outputBundle
- };
- this.facadeChunkByModule = facadeChunkByModule;
- for (const emittedFile of this.filesByReferenceId.values()) {
- if (emittedFile.fileName) {
- reserveFileNameInBundle(emittedFile.fileName, this.output.bundle, this.options.onwarn);
- }
- }
- for (const [referenceId, consumedFile] of this.filesByReferenceId.entries()) {
- if (consumedFile.type === 'asset' && consumedFile.source !== undefined) {
- this.finalizeAsset(consumedFile, consumedFile.source, referenceId, this.output);
- }
- }
- };
- this.filesByReferenceId = baseFileEmitter
- ? new Map(baseFileEmitter.filesByReferenceId)
- : new Map();
- }
- assignReferenceId(file, idBase) {
- let referenceId;
- do {
- const hash = createHash();
- if (referenceId) {
- hash.update(referenceId);
- }
- else {
- hash.update(idBase);
- }
- referenceId = hash.digest('hex').substr(0, 8);
- } while (this.filesByReferenceId.has(referenceId));
- this.filesByReferenceId.set(referenceId, file);
- return referenceId;
- }
- emitAsset(emittedAsset) {
- const source = typeof emittedAsset.source !== 'undefined'
- ? getValidSource(emittedAsset.source, emittedAsset, null)
- : undefined;
- const consumedAsset = {
- fileName: emittedAsset.fileName,
- name: emittedAsset.name,
- source,
- type: 'asset'
- };
- const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || emittedAsset.type);
- if (this.output) {
- if (emittedAsset.fileName) {
- reserveFileNameInBundle(emittedAsset.fileName, this.output.bundle, this.options.onwarn);
- }
- if (source !== undefined) {
- this.finalizeAsset(consumedAsset, source, referenceId, this.output);
- }
- }
- return referenceId;
- }
- emitChunk(emittedChunk) {
- if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
- return error(errInvalidRollupPhaseForChunkEmission());
- }
- if (typeof emittedChunk.id !== 'string') {
- return error(errFailedValidation(`Emitted chunks need to have a valid string id, received "${emittedChunk.id}"`));
- }
- const consumedChunk = {
- fileName: emittedChunk.fileName,
- module: null,
- name: emittedChunk.name || emittedChunk.id,
- type: 'chunk'
- };
- this.graph.moduleLoader
- .emitChunk(emittedChunk)
- .then(module => (consumedChunk.module = module))
- .catch(() => {
- // Avoid unhandled Promise rejection as the error will be thrown later
- // once module loading has finished
- });
- return this.assignReferenceId(consumedChunk, emittedChunk.id);
- }
- finalizeAsset(consumedFile, source, referenceId, output) {
- const fileName = consumedFile.fileName ||
- findExistingAssetFileNameWithSource(output.bundle, source) ||
- generateAssetFileName(consumedFile.name, source, output);
- // We must not modify the original assets to avoid interaction between outputs
- const assetWithFileName = { ...consumedFile, source, fileName };
- this.filesByReferenceId.set(referenceId, assetWithFileName);
- const options = this.options;
- output.bundle[fileName] = {
- fileName,
- name: consumedFile.name,
- get isAsset() {
- warnDeprecation('Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', true, options);
- return true;
- },
- source,
- type: 'asset'
- };
- }
- }
- function findExistingAssetFileNameWithSource(bundle, source) {
- for (const fileName of Object.keys(bundle)) {
- const outputFile = bundle[fileName];
- if (outputFile.type === 'asset' && areSourcesEqual(source, outputFile.source))
- return fileName;
- }
- return null;
- }
- function areSourcesEqual(sourceA, sourceB) {
- if (typeof sourceA === 'string') {
- return sourceA === sourceB;
- }
- if (typeof sourceB === 'string') {
- return false;
- }
- if ('equals' in sourceA) {
- return sourceA.equals(sourceB);
- }
- if (sourceA.length !== sourceB.length) {
- return false;
- }
- for (let index = 0; index < sourceA.length; index++) {
- if (sourceA[index] !== sourceB[index]) {
- return false;
- }
- }
- return true;
- }
- class Bundle {
- constructor(outputOptions, unsetOptions, inputOptions, pluginDriver, graph) {
- this.outputOptions = outputOptions;
- this.unsetOptions = unsetOptions;
- this.inputOptions = inputOptions;
- this.pluginDriver = pluginDriver;
- this.graph = graph;
- this.facadeChunkByModule = new Map();
- this.includedNamespaces = new Set();
- }
- async generate(isWrite) {
- timeStart('GENERATE', 1);
- const outputBundle = Object.create(null);
- this.pluginDriver.setOutputBundle(outputBundle, this.outputOptions.assetFileNames, this.facadeChunkByModule);
- try {
- await this.pluginDriver.hookParallel('renderStart', [this.outputOptions, this.inputOptions]);
- timeStart('generate chunks', 2);
- const chunks = await this.generateChunks();
- if (chunks.length > 1) {
- validateOptionsForMultiChunkOutput(this.outputOptions, this.inputOptions.onwarn);
- }
- const inputBase = commondir$1(getAbsoluteEntryModulePaths(chunks));
- timeEnd('generate chunks', 2);
- timeStart('render modules', 2);
- // We need to create addons before prerender because at the moment, there
- // can be no async code between prerender and render due to internal state
- const addons = await createAddons(this.outputOptions, this.pluginDriver);
- this.prerenderChunks(chunks, inputBase);
- timeEnd('render modules', 2);
- await this.addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle);
- }
- catch (error) {
- await this.pluginDriver.hookParallel('renderError', [error]);
- throw error;
- }
- await this.pluginDriver.hookSeq('generateBundle', [
- this.outputOptions,
- outputBundle,
- isWrite
- ]);
- this.finaliseAssets(outputBundle);
- timeEnd('GENERATE', 1);
- return outputBundle;
- }
- async addFinalizedChunksToBundle(chunks, inputBase, addons, outputBundle) {
- this.assignChunkIds(chunks, inputBase, addons, outputBundle);
- for (const chunk of chunks) {
- outputBundle[chunk.id] = chunk.getChunkInfoWithFileNames();
- }
- await Promise.all(chunks.map(async (chunk) => {
- const outputChunk = outputBundle[chunk.id];
- Object.assign(outputChunk, await chunk.render(this.outputOptions, addons, outputChunk));
- }));
- }
- async addManualChunks(manualChunks) {
- const manualChunkAliasByEntry = new Map();
- const chunkEntries = await Promise.all(Object.keys(manualChunks).map(async (alias) => ({
- alias,
- entries: await this.graph.moduleLoader.addAdditionalModules(manualChunks[alias])
- })));
- for (const { alias, entries } of chunkEntries) {
- for (const entry of entries) {
- addModuleToManualChunk(alias, entry, manualChunkAliasByEntry);
- }
- }
- return manualChunkAliasByEntry;
- }
- assignChunkIds(chunks, inputBase, addons, bundle) {
- const entryChunks = [];
- const otherChunks = [];
- for (const chunk of chunks) {
- (chunk.facadeModule && chunk.facadeModule.isUserDefinedEntryPoint
- ? entryChunks
- : otherChunks).push(chunk);
- }
- // make sure entry chunk names take precedence with regard to deconflicting
- const chunksForNaming = entryChunks.concat(otherChunks);
- for (const chunk of chunksForNaming) {
- if (this.outputOptions.file) {
- chunk.id = basename(this.outputOptions.file);
- }
- else if (this.outputOptions.preserveModules) {
- chunk.id = chunk.generateIdPreserveModules(inputBase, this.outputOptions, bundle, this.unsetOptions);
- }
- else {
- chunk.id = chunk.generateId(addons, this.outputOptions, bundle, true);
- }
- bundle[chunk.id] = FILE_PLACEHOLDER;
- }
- }
- assignManualChunks(getManualChunk) {
- const manualChunkAliasByEntry = new Map();
- const manualChunksApi = {
- getModuleIds: () => this.graph.modulesById.keys(),
- getModuleInfo: this.graph.getModuleInfo
- };
- for (const module of this.graph.modulesById.values()) {
- if (module instanceof Module$1) {
- const manualChunkAlias = getManualChunk(module.id, manualChunksApi);
- if (typeof manualChunkAlias === 'string') {
- addModuleToManualChunk(manualChunkAlias, module, manualChunkAliasByEntry);
- }
- }
- }
- return manualChunkAliasByEntry;
- }
- finaliseAssets(outputBundle) {
- for (const key of Object.keys(outputBundle)) {
- const file = outputBundle[key];
- if (!file.type) {
- warnDeprecation('A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', true, this.inputOptions);
- file.type = 'asset';
- }
- if (this.outputOptions.validate && typeof file.code == 'string') {
- try {
- this.graph.contextParse(file.code, {
- allowHashBang: true,
- ecmaVersion: 'latest'
- });
- }
- catch (exception) {
- this.inputOptions.onwarn(errChunkInvalid(file, exception));
- }
- }
- }
- this.pluginDriver.finaliseAssets();
- }
- async generateChunks() {
- const { manualChunks } = this.outputOptions;
- const manualChunkAliasByEntry = typeof manualChunks === 'object'
- ? await this.addManualChunks(manualChunks)
- : this.assignManualChunks(manualChunks);
- const chunks = [];
- const chunkByModule = new Map();
- for (const { alias, modules } of this.outputOptions.inlineDynamicImports
- ? [{ alias: null, modules: getIncludedModules(this.graph.modulesById) }]
- : this.outputOptions.preserveModules
- ? getIncludedModules(this.graph.modulesById).map(module => ({
- alias: null,
- modules: [module]
- }))
- : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry)) {
- sortByExecutionOrder(modules);
- const chunk = new Chunk$2(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias);
- chunks.push(chunk);
- for (const module of modules) {
- chunkByModule.set(module, chunk);
- }
- }
- for (const chunk of chunks) {
- chunk.link();
- }
- const facades = [];
- for (const chunk of chunks) {
- facades.push(...chunk.generateFacades());
- }
- return [...chunks, ...facades];
- }
- prerenderChunks(chunks, inputBase) {
- for (const chunk of chunks) {
- chunk.generateExports();
- }
- for (const chunk of chunks) {
- chunk.preRender(this.outputOptions, inputBase);
- }
- }
- }
- function getAbsoluteEntryModulePaths(chunks) {
- const absoluteEntryModulePaths = [];
- for (const chunk of chunks) {
- for (const entryModule of chunk.entryModules) {
- if (isAbsolute(entryModule.id)) {
- absoluteEntryModulePaths.push(entryModule.id);
- }
- }
- }
- return absoluteEntryModulePaths;
- }
- function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
- if (outputOptions.format === 'umd' || outputOptions.format === 'iife')
- return error({
- code: 'INVALID_OPTION',
- message: 'UMD and IIFE output formats are not supported for code-splitting builds.'
- });
- if (typeof outputOptions.file === 'string')
- return error({
- code: 'INVALID_OPTION',
- message: 'When building multiple chunks, the "output.dir" option must be used, not "output.file". ' +
- 'To inline dynamic imports, set the "inlineDynamicImports" option.'
- });
- if (outputOptions.sourcemapFile)
- return error({
- code: 'INVALID_OPTION',
- message: '"output.sourcemapFile" is only supported for single-file builds.'
- });
- if (!outputOptions.amd.autoId && outputOptions.amd.id)
- onWarn({
- code: 'INVALID_OPTION',
- message: '"output.amd.id" is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath".'
- });
- }
- function getIncludedModules(modulesById) {
- return [...modulesById.values()].filter(module => module instanceof Module$1 &&
- (module.isIncluded() || module.info.isEntry || module.includedDynamicImporters.length > 0));
- }
- function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
- const existingAlias = manualChunkAliasByEntry.get(module);
- if (typeof existingAlias === 'string' && existingAlias !== alias) {
- return error(errCannotAssignModuleToChunk(module.id, alias, existingAlias));
- }
- manualChunkAliasByEntry.set(module, alias);
- }
- // Reserved word lists for various dialects of the language
- var reservedWords$5 = {
- 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
- 5: "class enum extends super const export import",
- 6: "enum",
- strict: "implements interface let package private protected public static yield",
- strictBind: "eval arguments"
- };
- // And the keywords
- var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
- var keywords = {
- 5: ecma5AndLessKeywords,
- "5module": ecma5AndLessKeywords + " export import",
- 6: ecma5AndLessKeywords + " const class extends export import super"
- };
- var keywordRelationalOperator = /^in(stanceof)?$/;
- // ## Character categories
- // Big ugly regular expressions that match characters in the
- // whitespace, identifier, and identifier-start categories. These
- // are only applied when a character is found to actually have a
- // code point above 128.
- // Generated by `bin/generate-identifier-regex.js`.
- var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08c7\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9ffc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7ca\ua7f5-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
- var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf\u1ac0\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
- var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
- var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
- nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
- // These are a run-length and offset encoded representation of the
- // >0xffff code points that are a valid part of identifiers. The
- // offset starts at 0x10000, and each pair of numbers represents an
- // offset to the next range, and then a size of the range. They were
- // generated by bin/generate-identifier-regex.js
- // eslint-disable-next-line comma-spacing
- var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938];
- // eslint-disable-next-line comma-spacing
- var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];
- // This has a complexity linear to the value of the code. The
- // assumption is that looking up astral identifier characters is
- // rare.
- function isInAstralSet(code, set) {
- var pos = 0x10000;
- for (var i = 0; i < set.length; i += 2) {
- pos += set[i];
- if (pos > code) { return false }
- pos += set[i + 1];
- if (pos >= code) { return true }
- }
- }
- // Test whether a given character code starts an identifier.
- function isIdentifierStart(code, astral) {
- if (code < 65) { return code === 36 }
- if (code < 91) { return true }
- if (code < 97) { return code === 95 }
- if (code < 123) { return true }
- if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
- if (astral === false) { return false }
- return isInAstralSet(code, astralIdentifierStartCodes)
- }
- // Test whether a given character is part of an identifier.
- function isIdentifierChar(code, astral) {
- if (code < 48) { return code === 36 }
- if (code < 58) { return true }
- if (code < 65) { return false }
- if (code < 91) { return true }
- if (code < 97) { return code === 95 }
- if (code < 123) { return true }
- if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
- if (astral === false) { return false }
- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
- }
- // ## Token types
- // The assignment of fine-grained, information-carrying type objects
- // allows the tokenizer to store the information it has about a
- // token in a way that is very cheap for the parser to look up.
- // All token type variables start with an underscore, to make them
- // easy to recognize.
- // The `beforeExpr` property is used to disambiguate between regular
- // expressions and divisions. It is set on all token types that can
- // be followed by an expression (thus, a slash after them would be a
- // regular expression).
- //
- // The `startsExpr` property is used to check if the token ends a
- // `yield` expression. It is set on all token types that either can
- // directly start an expression (like a quotation mark) or can
- // continue an expression (like the body of a string).
- //
- // `isLoop` marks a keyword as starting a loop, which is important
- // to know when parsing a label, in order to allow or disallow
- // continue jumps to that label.
- var TokenType = function TokenType(label, conf) {
- if ( conf === void 0 ) conf = {};
- this.label = label;
- this.keyword = conf.keyword;
- this.beforeExpr = !!conf.beforeExpr;
- this.startsExpr = !!conf.startsExpr;
- this.isLoop = !!conf.isLoop;
- this.isAssign = !!conf.isAssign;
- this.prefix = !!conf.prefix;
- this.postfix = !!conf.postfix;
- this.binop = conf.binop || null;
- this.updateContext = null;
- };
- function binop(name, prec) {
- return new TokenType(name, {beforeExpr: true, binop: prec})
- }
- var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};
- // Map keyword names to token types.
- var keywords$1 = {};
- // Succinct definitions of keyword token types
- function kw(name, options) {
- if ( options === void 0 ) options = {};
- options.keyword = name;
- return keywords$1[name] = new TokenType(name, options)
- }
- var types = {
- num: new TokenType("num", startsExpr),
- regexp: new TokenType("regexp", startsExpr),
- string: new TokenType("string", startsExpr),
- name: new TokenType("name", startsExpr),
- eof: new TokenType("eof"),
- // Punctuation token types.
- bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
- bracketR: new TokenType("]"),
- braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
- braceR: new TokenType("}"),
- parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
- parenR: new TokenType(")"),
- comma: new TokenType(",", beforeExpr),
- semi: new TokenType(";", beforeExpr),
- colon: new TokenType(":", beforeExpr),
- dot: new TokenType("."),
- question: new TokenType("?", beforeExpr),
- questionDot: new TokenType("?."),
- arrow: new TokenType("=>", beforeExpr),
- template: new TokenType("template"),
- invalidTemplate: new TokenType("invalidTemplate"),
- ellipsis: new TokenType("...", beforeExpr),
- backQuote: new TokenType("`", startsExpr),
- dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),
- // Operators. These carry several kinds of properties to help the
- // parser use them properly (the presence of these properties is
- // what categorizes them as operators).
- //
- // `binop`, when present, specifies that this operator is a binary
- // operator, and will refer to its precedence.
- //
- // `prefix` and `postfix` mark the operator as a prefix or postfix
- // unary operator.
- //
- // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
- // binary operators with a very low precedence, that should result
- // in AssignmentExpression nodes.
- eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
- assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
- incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
- prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
- logicalOR: binop("||", 1),
- logicalAND: binop("&&", 2),
- bitwiseOR: binop("|", 3),
- bitwiseXOR: binop("^", 4),
- bitwiseAND: binop("&", 5),
- equality: binop("==/!=/===/!==", 6),
- relational: binop("</>/<=/>=", 7),
- bitShift: binop("<</>>/>>>", 8),
- plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
- modulo: binop("%", 10),
- star: binop("*", 10),
- slash: binop("/", 10),
- starstar: new TokenType("**", {beforeExpr: true}),
- coalesce: binop("??", 1),
- // Keyword token types.
- _break: kw("break"),
- _case: kw("case", beforeExpr),
- _catch: kw("catch"),
- _continue: kw("continue"),
- _debugger: kw("debugger"),
- _default: kw("default", beforeExpr),
- _do: kw("do", {isLoop: true, beforeExpr: true}),
- _else: kw("else", beforeExpr),
- _finally: kw("finally"),
- _for: kw("for", {isLoop: true}),
- _function: kw("function", startsExpr),
- _if: kw("if"),
- _return: kw("return", beforeExpr),
- _switch: kw("switch"),
- _throw: kw("throw", beforeExpr),
- _try: kw("try"),
- _var: kw("var"),
- _const: kw("const"),
- _while: kw("while", {isLoop: true}),
- _with: kw("with"),
- _new: kw("new", {beforeExpr: true, startsExpr: true}),
- _this: kw("this", startsExpr),
- _super: kw("super", startsExpr),
- _class: kw("class", startsExpr),
- _extends: kw("extends", beforeExpr),
- _export: kw("export"),
- _import: kw("import", startsExpr),
- _null: kw("null", startsExpr),
- _true: kw("true", startsExpr),
- _false: kw("false", startsExpr),
- _in: kw("in", {beforeExpr: true, binop: 7}),
- _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
- _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
- _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
- _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
- };
- // Matches a whole line break (where CRLF is considered a single
- // line break). Used to count lines.
- var lineBreak = /\r\n?|\n|\u2028|\u2029/;
- var lineBreakG = new RegExp(lineBreak.source, "g");
- function isNewLine(code, ecma2019String) {
- return code === 10 || code === 13 || (!ecma2019String && (code === 0x2028 || code === 0x2029))
- }
- var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
- var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
- var ref = Object.prototype;
- var hasOwnProperty$1 = ref.hasOwnProperty;
- var toString$2 = ref.toString;
- // Checks if an object has a property.
- function has(obj, propName) {
- return hasOwnProperty$1.call(obj, propName)
- }
- var isArray$6 = Array.isArray || (function (obj) { return (
- toString$2.call(obj) === "[object Array]"
- ); });
- function wordsRegexp(words) {
- return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$")
- }
- // These are used when `options.locations` is on, for the
- // `startLoc` and `endLoc` properties.
- var Position = function Position(line, col) {
- this.line = line;
- this.column = col;
- };
- Position.prototype.offset = function offset (n) {
- return new Position(this.line, this.column + n)
- };
- var SourceLocation = function SourceLocation(p, start, end) {
- this.start = start;
- this.end = end;
- if (p.sourceFile !== null) { this.source = p.sourceFile; }
- };
- // The `getLineInfo` function is mostly useful when the
- // `locations` option is off (for performance reasons) and you
- // want to find the line/column position for a given character
- // offset. `input` should be the code string that the offset refers
- // into.
- function getLineInfo(input, offset) {
- for (var line = 1, cur = 0;;) {
- lineBreakG.lastIndex = cur;
- var match = lineBreakG.exec(input);
- if (match && match.index < offset) {
- ++line;
- cur = match.index + match[0].length;
- } else {
- return new Position(line, offset - cur)
- }
- }
- }
- // A second argument must be given to configure the parser process.
- // These options are recognized (only `ecmaVersion` is required):
- var defaultOptions = {
- // `ecmaVersion` indicates the ECMAScript version to parse. Must be
- // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
- // (2019), 11 (2020), 12 (2021), or `"latest"` (the latest version
- // the library supports). This influences support for strict mode,
- // the set of reserved words, and support for new syntax features.
- ecmaVersion: null,
- // `sourceType` indicates the mode the code should be parsed in.
- // Can be either `"script"` or `"module"`. This influences global
- // strict mode and parsing of `import` and `export` declarations.
- sourceType: "script",
- // `onInsertedSemicolon` can be a callback that will be called
- // when a semicolon is automatically inserted. It will be passed
- // the position of the comma as an offset, and if `locations` is
- // enabled, it is given the location as a `{line, column}` object
- // as second argument.
- onInsertedSemicolon: null,
- // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
- // trailing commas.
- onTrailingComma: null,
- // By default, reserved words are only enforced if ecmaVersion >= 5.
- // Set `allowReserved` to a boolean value to explicitly turn this on
- // an off. When this option has the value "never", reserved words
- // and keywords can also not be used as property names.
- allowReserved: null,
- // When enabled, a return at the top level is not considered an
- // error.
- allowReturnOutsideFunction: false,
- // When enabled, import/export statements are not constrained to
- // appearing at the top of the program.
- allowImportExportEverywhere: false,
- // When enabled, await identifiers are allowed to appear at the top-level scope,
- // but they are still not allowed in non-async functions.
- allowAwaitOutsideFunction: false,
- // When enabled, hashbang directive in the beginning of file
- // is allowed and treated as a line comment.
- allowHashBang: false,
- // When `locations` is on, `loc` properties holding objects with
- // `start` and `end` properties in `{line, column}` form (with
- // line being 1-based and column 0-based) will be attached to the
- // nodes.
- locations: false,
- // A function can be passed as `onToken` option, which will
- // cause Acorn to call that function with object in the same
- // format as tokens returned from `tokenizer().getToken()`. Note
- // that you are not allowed to call the parser from the
- // callback—that will corrupt its internal state.
- onToken: null,
- // A function can be passed as `onComment` option, which will
- // cause Acorn to call that function with `(block, text, start,
- // end)` parameters whenever a comment is skipped. `block` is a
- // boolean indicating whether this is a block (`/* */`) comment,
- // `text` is the content of the comment, and `start` and `end` are
- // character offsets that denote the start and end of the comment.
- // When the `locations` option is on, two more parameters are
- // passed, the full `{line, column}` locations of the start and
- // end of the comments. Note that you are not allowed to call the
- // parser from the callback—that will corrupt its internal state.
- onComment: null,
- // Nodes have their start and end characters offsets recorded in
- // `start` and `end` properties (directly on the node, rather than
- // the `loc` object, which holds line/column data. To also add a
- // [semi-standardized][range] `range` property holding a `[start,
- // end]` array with the same numbers, set the `ranges` option to
- // `true`.
- //
- // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
- ranges: false,
- // It is possible to parse multiple files into a single AST by
- // passing the tree produced by parsing the first file as
- // `program` option in subsequent parses. This will add the
- // toplevel forms of the parsed file to the `Program` (top) node
- // of an existing parse tree.
- program: null,
- // When `locations` is on, you can pass this to record the source
- // file in every node's `loc` object.
- sourceFile: null,
- // This value, if given, is stored in every node, whether
- // `locations` is on or off.
- directSourceFile: null,
- // When enabled, parenthesized expressions are represented by
- // (non-standard) ParenthesizedExpression nodes
- preserveParens: false
- };
- // Interpret and default an options object
- var warnedAboutEcmaVersion = false;
- function getOptions(opts) {
- var options = {};
- for (var opt in defaultOptions)
- { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; }
- if (options.ecmaVersion === "latest") {
- options.ecmaVersion = 1e8;
- } else if (options.ecmaVersion == null) {
- if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
- warnedAboutEcmaVersion = true;
- console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
- }
- options.ecmaVersion = 11;
- } else if (options.ecmaVersion >= 2015) {
- options.ecmaVersion -= 2009;
- }
- if (options.allowReserved == null)
- { options.allowReserved = options.ecmaVersion < 5; }
- if (isArray$6(options.onToken)) {
- var tokens = options.onToken;
- options.onToken = function (token) { return tokens.push(token); };
- }
- if (isArray$6(options.onComment))
- { options.onComment = pushComment(options, options.onComment); }
- return options
- }
- function pushComment(options, array) {
- return function(block, text, start, end, startLoc, endLoc) {
- var comment = {
- type: block ? "Block" : "Line",
- value: text,
- start: start,
- end: end
- };
- if (options.locations)
- { comment.loc = new SourceLocation(this, startLoc, endLoc); }
- if (options.ranges)
- { comment.range = [start, end]; }
- array.push(comment);
- }
- }
- // Each scope gets a bitset that may contain these flags
- var
- SCOPE_TOP = 1,
- SCOPE_FUNCTION = 2,
- SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION,
- SCOPE_ASYNC = 4,
- SCOPE_GENERATOR = 8,
- SCOPE_ARROW = 16,
- SCOPE_SIMPLE_CATCH = 32,
- SCOPE_SUPER = 64,
- SCOPE_DIRECT_SUPER = 128;
- function functionFlags(async, generator) {
- return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
- }
- // Used in checkLVal* and declareName to determine the type of a binding
- var
- BIND_NONE = 0, // Not a binding
- BIND_VAR = 1, // Var-style binding
- BIND_LEXICAL = 2, // Let- or const-style binding
- BIND_FUNCTION = 3, // Function declaration
- BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
- BIND_OUTSIDE = 5; // Special case for function names as bound inside the function
- var Parser = function Parser(options, input, startPos) {
- this.options = options = getOptions(options);
- this.sourceFile = options.sourceFile;
- this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
- var reserved = "";
- if (options.allowReserved !== true) {
- reserved = reservedWords$5[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
- if (options.sourceType === "module") { reserved += " await"; }
- }
- this.reservedWords = wordsRegexp(reserved);
- var reservedStrict = (reserved ? reserved + " " : "") + reservedWords$5.strict;
- this.reservedWordsStrict = wordsRegexp(reservedStrict);
- this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords$5.strictBind);
- this.input = String(input);
- // Used to signal to callers of `readWord1` whether the word
- // contained any escape sequences. This is needed because words with
- // escape sequences must not be interpreted as keywords.
- this.containsEsc = false;
- // Set up token state
- // The current position of the tokenizer in the input.
- if (startPos) {
- this.pos = startPos;
- this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
- this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length;
- } else {
- this.pos = this.lineStart = 0;
- this.curLine = 1;
- }
- // Properties of the current token:
- // Its type
- this.type = types.eof;
- // For tokens that include more information than their type, the value
- this.value = null;
- // Its start and end offset
- this.start = this.end = this.pos;
- // And, if locations are used, the {line, column} object
- // corresponding to those offsets
- this.startLoc = this.endLoc = this.curPosition();
- // Position information for the previous token
- this.lastTokEndLoc = this.lastTokStartLoc = null;
- this.lastTokStart = this.lastTokEnd = this.pos;
- // The context stack is used to superficially track syntactic
- // context to predict whether a regular expression is allowed in a
- // given position.
- this.context = this.initialContext();
- this.exprAllowed = true;
- // Figure out if it's a module code.
- this.inModule = options.sourceType === "module";
- this.strict = this.inModule || this.strictDirective(this.pos);
- // Used to signify the start of a potential arrow function
- this.potentialArrowAt = -1;
- // Positions to delayed-check that yield/await does not exist in default parameters.
- this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
- // Labels in scope.
- this.labels = [];
- // Thus-far undefined exports.
- this.undefinedExports = Object.create(null);
- // If enabled, skip leading hashbang line.
- if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
- { this.skipLineComment(2); }
- // Scope tracking for duplicate variable names (see scope.js)
- this.scopeStack = [];
- this.enterScope(SCOPE_TOP);
- // For RegExp validation
- this.regexpState = null;
- };
- var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },inNonArrowFunction: { configurable: true } };
- Parser.prototype.parse = function parse () {
- var node = this.options.program || this.startNode();
- this.nextToken();
- return this.parseTopLevel(node)
- };
- prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
- prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };
- prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };
- prototypeAccessors.allowSuper.get = function () { return (this.currentThisScope().flags & SCOPE_SUPER) > 0 };
- prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };
- prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };
- prototypeAccessors.inNonArrowFunction.get = function () { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0 };
- Parser.extend = function extend () {
- var plugins = [], len = arguments.length;
- while ( len-- ) plugins[ len ] = arguments[ len ];
- var cls = this;
- for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
- return cls
- };
- Parser.parse = function parse (input, options) {
- return new this(options, input).parse()
- };
- Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
- var parser = new this(options, input, pos);
- parser.nextToken();
- return parser.parseExpression()
- };
- Parser.tokenizer = function tokenizer (input, options) {
- return new this(options, input)
- };
- Object.defineProperties( Parser.prototype, prototypeAccessors );
- var pp = Parser.prototype;
- // ## Parser utilities
- var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;
- pp.strictDirective = function(start) {
- for (;;) {
- // Try to find string literal.
- skipWhiteSpace.lastIndex = start;
- start += skipWhiteSpace.exec(this.input)[0].length;
- var match = literal.exec(this.input.slice(start));
- if (!match) { return false }
- if ((match[1] || match[2]) === "use strict") {
- skipWhiteSpace.lastIndex = start + match[0].length;
- var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
- var next = this.input.charAt(end);
- return next === ";" || next === "}" ||
- (lineBreak.test(spaceAfter[0]) &&
- !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
- }
- start += match[0].length;
- // Skip semicolon, if any.
- skipWhiteSpace.lastIndex = start;
- start += skipWhiteSpace.exec(this.input)[0].length;
- if (this.input[start] === ";")
- { start++; }
- }
- };
- // Predicate that tests whether the next token is of the given
- // type, and if yes, consumes it as a side effect.
- pp.eat = function(type) {
- if (this.type === type) {
- this.next();
- return true
- } else {
- return false
- }
- };
- // Tests whether parsed token is a contextual keyword.
- pp.isContextual = function(name) {
- return this.type === types.name && this.value === name && !this.containsEsc
- };
- // Consumes contextual keyword if possible.
- pp.eatContextual = function(name) {
- if (!this.isContextual(name)) { return false }
- this.next();
- return true
- };
- // Asserts that following token is given contextual keyword.
- pp.expectContextual = function(name) {
- if (!this.eatContextual(name)) { this.unexpected(); }
- };
- // Test whether a semicolon can be inserted at the current position.
- pp.canInsertSemicolon = function() {
- return this.type === types.eof ||
- this.type === types.braceR ||
- lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
- };
- pp.insertSemicolon = function() {
- if (this.canInsertSemicolon()) {
- if (this.options.onInsertedSemicolon)
- { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
- return true
- }
- };
- // Consume a semicolon, or, failing that, see if we are allowed to
- // pretend that there is a semicolon at this position.
- pp.semicolon = function() {
- if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); }
- };
- pp.afterTrailingComma = function(tokType, notNext) {
- if (this.type === tokType) {
- if (this.options.onTrailingComma)
- { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
- if (!notNext)
- { this.next(); }
- return true
- }
- };
- // Expect a token of a given type. If found, consume it, otherwise,
- // raise an unexpected token error.
- pp.expect = function(type) {
- this.eat(type) || this.unexpected();
- };
- // Raise an unexpected token error.
- pp.unexpected = function(pos) {
- this.raise(pos != null ? pos : this.start, "Unexpected token");
- };
- function DestructuringErrors() {
- this.shorthandAssign =
- this.trailingComma =
- this.parenthesizedAssign =
- this.parenthesizedBind =
- this.doubleProto =
- -1;
- }
- pp.checkPatternErrors = function(refDestructuringErrors, isAssign) {
- if (!refDestructuringErrors) { return }
- if (refDestructuringErrors.trailingComma > -1)
- { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
- var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
- if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); }
- };
- pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
- if (!refDestructuringErrors) { return false }
- var shorthandAssign = refDestructuringErrors.shorthandAssign;
- var doubleProto = refDestructuringErrors.doubleProto;
- if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
- if (shorthandAssign >= 0)
- { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
- if (doubleProto >= 0)
- { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
- };
- pp.checkYieldAwaitInDefaultParams = function() {
- if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
- { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
- if (this.awaitPos)
- { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
- };
- pp.isSimpleAssignTarget = function(expr) {
- if (expr.type === "ParenthesizedExpression")
- { return this.isSimpleAssignTarget(expr.expression) }
- return expr.type === "Identifier" || expr.type === "MemberExpression"
- };
- var pp$1 = Parser.prototype;
- // ### Statement parsing
- // Parse a program. Initializes the parser, reads any number of
- // statements, and wraps them in a Program node. Optionally takes a
- // `program` argument. If present, the statements will be appended
- // to its body instead of creating a new node.
- pp$1.parseTopLevel = function(node) {
- var exports = Object.create(null);
- if (!node.body) { node.body = []; }
- while (this.type !== types.eof) {
- var stmt = this.parseStatement(null, true, exports);
- node.body.push(stmt);
- }
- if (this.inModule)
- { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
- {
- var name = list[i];
- this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
- } }
- this.adaptDirectivePrologue(node.body);
- this.next();
- node.sourceType = this.options.sourceType;
- return this.finishNode(node, "Program")
- };
- var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};
- pp$1.isLet = function(context) {
- if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
- skipWhiteSpace.lastIndex = this.pos;
- var skip = skipWhiteSpace.exec(this.input);
- var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
- // For ambiguous cases, determine if a LexicalDeclaration (or only a
- // Statement) is allowed here. If context is not empty then only a Statement
- // is allowed. However, `let [` is an explicit negative lookahead for
- // ExpressionStatement, so special-case it first.
- if (nextCh === 91) { return true } // '['
- if (context) { return false }
- if (nextCh === 123) { return true } // '{'
- if (isIdentifierStart(nextCh, true)) {
- var pos = next + 1;
- while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
- var ident = this.input.slice(next, pos);
- if (!keywordRelationalOperator.test(ident)) { return true }
- }
- return false
- };
- // check 'async [no LineTerminator here] function'
- // - 'async /*foo*/ function' is OK.
- // - 'async /*\n*/ function' is invalid.
- pp$1.isAsyncFunction = function() {
- if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
- { return false }
- skipWhiteSpace.lastIndex = this.pos;
- var skip = skipWhiteSpace.exec(this.input);
- var next = this.pos + skip[0].length;
- return !lineBreak.test(this.input.slice(this.pos, next)) &&
- this.input.slice(next, next + 8) === "function" &&
- (next + 8 === this.input.length || !isIdentifierChar(this.input.charAt(next + 8)))
- };
- // Parse a single statement.
- //
- // If expecting a statement and finding a slash operator, parse a
- // regular expression literal. This is to handle cases like
- // `if (foo) /blah/.exec(foo)`, where looking at the previous token
- // does not help.
- pp$1.parseStatement = function(context, topLevel, exports) {
- var starttype = this.type, node = this.startNode(), kind;
- if (this.isLet(context)) {
- starttype = types._var;
- kind = "let";
- }
- // Most types of statements are recognized by the keyword they
- // start with. Many are trivial to parse, some require a bit of
- // complexity.
- switch (starttype) {
- case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
- case types._debugger: return this.parseDebuggerStatement(node)
- case types._do: return this.parseDoStatement(node)
- case types._for: return this.parseForStatement(node)
- case types._function:
- // Function as sole body of either an if statement or a labeled statement
- // works, but not when it is part of a labeled statement that is the sole
- // body of an if statement.
- if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
- return this.parseFunctionStatement(node, false, !context)
- case types._class:
- if (context) { this.unexpected(); }
- return this.parseClass(node, true)
- case types._if: return this.parseIfStatement(node)
- case types._return: return this.parseReturnStatement(node)
- case types._switch: return this.parseSwitchStatement(node)
- case types._throw: return this.parseThrowStatement(node)
- case types._try: return this.parseTryStatement(node)
- case types._const: case types._var:
- kind = kind || this.value;
- if (context && kind !== "var") { this.unexpected(); }
- return this.parseVarStatement(node, kind)
- case types._while: return this.parseWhileStatement(node)
- case types._with: return this.parseWithStatement(node)
- case types.braceL: return this.parseBlock(true, node)
- case types.semi: return this.parseEmptyStatement(node)
- case types._export:
- case types._import:
- if (this.options.ecmaVersion > 10 && starttype === types._import) {
- skipWhiteSpace.lastIndex = this.pos;
- var skip = skipWhiteSpace.exec(this.input);
- var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
- if (nextCh === 40 || nextCh === 46) // '(' or '.'
- { return this.parseExpressionStatement(node, this.parseExpression()) }
- }
- if (!this.options.allowImportExportEverywhere) {
- if (!topLevel)
- { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
- if (!this.inModule)
- { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
- }
- return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports)
- // If the statement does not start with a statement keyword or a
- // brace, it's an ExpressionStatement or LabeledStatement. We
- // simply start parsing an expression, and afterwards, if the
- // next token is a colon and the expression was a simple
- // Identifier node, we switch to interpreting it as a label.
- default:
- if (this.isAsyncFunction()) {
- if (context) { this.unexpected(); }
- this.next();
- return this.parseFunctionStatement(node, true, !context)
- }
- var maybeName = this.value, expr = this.parseExpression();
- if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon))
- { return this.parseLabeledStatement(node, maybeName, expr, context) }
- else { return this.parseExpressionStatement(node, expr) }
- }
- };
- pp$1.parseBreakContinueStatement = function(node, keyword) {
- var isBreak = keyword === "break";
- this.next();
- if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; }
- else if (this.type !== types.name) { this.unexpected(); }
- else {
- node.label = this.parseIdent();
- this.semicolon();
- }
- // Verify that there is an actual destination to break or
- // continue to.
- var i = 0;
- for (; i < this.labels.length; ++i) {
- var lab = this.labels[i];
- if (node.label == null || lab.name === node.label.name) {
- if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
- if (node.label && isBreak) { break }
- }
- }
- if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
- return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
- };
- pp$1.parseDebuggerStatement = function(node) {
- this.next();
- this.semicolon();
- return this.finishNode(node, "DebuggerStatement")
- };
- pp$1.parseDoStatement = function(node) {
- this.next();
- this.labels.push(loopLabel);
- node.body = this.parseStatement("do");
- this.labels.pop();
- this.expect(types._while);
- node.test = this.parseParenExpression();
- if (this.options.ecmaVersion >= 6)
- { this.eat(types.semi); }
- else
- { this.semicolon(); }
- return this.finishNode(node, "DoWhileStatement")
- };
- // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
- // loop is non-trivial. Basically, we have to parse the init `var`
- // statement or expression, disallowing the `in` operator (see
- // the second parameter to `parseExpression`), and then check
- // whether the next token is `in` or `of`. When there is no init
- // part (semicolon immediately after the opening parenthesis), it
- // is a regular `for` loop.
- pp$1.parseForStatement = function(node) {
- this.next();
- var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
- this.labels.push(loopLabel);
- this.enterScope(0);
- this.expect(types.parenL);
- if (this.type === types.semi) {
- if (awaitAt > -1) { this.unexpected(awaitAt); }
- return this.parseFor(node, null)
- }
- var isLet = this.isLet();
- if (this.type === types._var || this.type === types._const || isLet) {
- var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
- this.next();
- this.parseVar(init$1, true, kind);
- this.finishNode(init$1, "VariableDeclaration");
- if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {
- if (this.options.ecmaVersion >= 9) {
- if (this.type === types._in) {
- if (awaitAt > -1) { this.unexpected(awaitAt); }
- } else { node.await = awaitAt > -1; }
- }
- return this.parseForIn(node, init$1)
- }
- if (awaitAt > -1) { this.unexpected(awaitAt); }
- return this.parseFor(node, init$1)
- }
- var refDestructuringErrors = new DestructuringErrors;
- var init = this.parseExpression(true, refDestructuringErrors);
- if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
- if (this.options.ecmaVersion >= 9) {
- if (this.type === types._in) {
- if (awaitAt > -1) { this.unexpected(awaitAt); }
- } else { node.await = awaitAt > -1; }
- }
- this.toAssignable(init, false, refDestructuringErrors);
- this.checkLValPattern(init);
- return this.parseForIn(node, init)
- } else {
- this.checkExpressionErrors(refDestructuringErrors, true);
- }
- if (awaitAt > -1) { this.unexpected(awaitAt); }
- return this.parseFor(node, init)
- };
- pp$1.parseFunctionStatement = function(node, isAsync, declarationPosition) {
- this.next();
- return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
- };
- pp$1.parseIfStatement = function(node) {
- this.next();
- node.test = this.parseParenExpression();
- // allow function declarations in branches, but only in non-strict mode
- node.consequent = this.parseStatement("if");
- node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
- return this.finishNode(node, "IfStatement")
- };
- pp$1.parseReturnStatement = function(node) {
- if (!this.inFunction && !this.options.allowReturnOutsideFunction)
- { this.raise(this.start, "'return' outside of function"); }
- this.next();
- // In `return` (and `break`/`continue`), the keywords with
- // optional arguments, we eagerly look for a semicolon or the
- // possibility to insert one.
- if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; }
- else { node.argument = this.parseExpression(); this.semicolon(); }
- return this.finishNode(node, "ReturnStatement")
- };
- pp$1.parseSwitchStatement = function(node) {
- this.next();
- node.discriminant = this.parseParenExpression();
- node.cases = [];
- this.expect(types.braceL);
- this.labels.push(switchLabel);
- this.enterScope(0);
- // Statements under must be grouped (by label) in SwitchCase
- // nodes. `cur` is used to keep the node that we are currently
- // adding statements to.
- var cur;
- for (var sawDefault = false; this.type !== types.braceR;) {
- if (this.type === types._case || this.type === types._default) {
- var isCase = this.type === types._case;
- if (cur) { this.finishNode(cur, "SwitchCase"); }
- node.cases.push(cur = this.startNode());
- cur.consequent = [];
- this.next();
- if (isCase) {
- cur.test = this.parseExpression();
- } else {
- if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
- sawDefault = true;
- cur.test = null;
- }
- this.expect(types.colon);
- } else {
- if (!cur) { this.unexpected(); }
- cur.consequent.push(this.parseStatement(null));
- }
- }
- this.exitScope();
- if (cur) { this.finishNode(cur, "SwitchCase"); }
- this.next(); // Closing brace
- this.labels.pop();
- return this.finishNode(node, "SwitchStatement")
- };
- pp$1.parseThrowStatement = function(node) {
- this.next();
- if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
- { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
- node.argument = this.parseExpression();
- this.semicolon();
- return this.finishNode(node, "ThrowStatement")
- };
- // Reused empty array added for node fields that are always empty.
- var empty = [];
- pp$1.parseTryStatement = function(node) {
- this.next();
- node.block = this.parseBlock();
- node.handler = null;
- if (this.type === types._catch) {
- var clause = this.startNode();
- this.next();
- if (this.eat(types.parenL)) {
- clause.param = this.parseBindingAtom();
- var simple = clause.param.type === "Identifier";
- this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
- this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
- this.expect(types.parenR);
- } else {
- if (this.options.ecmaVersion < 10) { this.unexpected(); }
- clause.param = null;
- this.enterScope(0);
- }
- clause.body = this.parseBlock(false);
- this.exitScope();
- node.handler = this.finishNode(clause, "CatchClause");
- }
- node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
- if (!node.handler && !node.finalizer)
- { this.raise(node.start, "Missing catch or finally clause"); }
- return this.finishNode(node, "TryStatement")
- };
- pp$1.parseVarStatement = function(node, kind) {
- this.next();
- this.parseVar(node, false, kind);
- this.semicolon();
- return this.finishNode(node, "VariableDeclaration")
- };
- pp$1.parseWhileStatement = function(node) {
- this.next();
- node.test = this.parseParenExpression();
- this.labels.push(loopLabel);
- node.body = this.parseStatement("while");
- this.labels.pop();
- return this.finishNode(node, "WhileStatement")
- };
- pp$1.parseWithStatement = function(node) {
- if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
- this.next();
- node.object = this.parseParenExpression();
- node.body = this.parseStatement("with");
- return this.finishNode(node, "WithStatement")
- };
- pp$1.parseEmptyStatement = function(node) {
- this.next();
- return this.finishNode(node, "EmptyStatement")
- };
- pp$1.parseLabeledStatement = function(node, maybeName, expr, context) {
- for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
- {
- var label = list[i$1];
- if (label.name === maybeName)
- { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
- } }
- var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null;
- for (var i = this.labels.length - 1; i >= 0; i--) {
- var label$1 = this.labels[i];
- if (label$1.statementStart === node.start) {
- // Update information about previous labels on this node
- label$1.statementStart = this.start;
- label$1.kind = kind;
- } else { break }
- }
- this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
- node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
- this.labels.pop();
- node.label = expr;
- return this.finishNode(node, "LabeledStatement")
- };
- pp$1.parseExpressionStatement = function(node, expr) {
- node.expression = expr;
- this.semicolon();
- return this.finishNode(node, "ExpressionStatement")
- };
- // Parse a semicolon-enclosed block of statements, handling `"use
- // strict"` declarations when `allowStrict` is true (used for
- // function bodies).
- pp$1.parseBlock = function(createNewLexicalScope, node, exitStrict) {
- if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
- if ( node === void 0 ) node = this.startNode();
- node.body = [];
- this.expect(types.braceL);
- if (createNewLexicalScope) { this.enterScope(0); }
- while (this.type !== types.braceR) {
- var stmt = this.parseStatement(null);
- node.body.push(stmt);
- }
- if (exitStrict) { this.strict = false; }
- this.next();
- if (createNewLexicalScope) { this.exitScope(); }
- return this.finishNode(node, "BlockStatement")
- };
- // Parse a regular `for` loop. The disambiguation code in
- // `parseStatement` will already have parsed the init statement or
- // expression.
- pp$1.parseFor = function(node, init) {
- node.init = init;
- this.expect(types.semi);
- node.test = this.type === types.semi ? null : this.parseExpression();
- this.expect(types.semi);
- node.update = this.type === types.parenR ? null : this.parseExpression();
- this.expect(types.parenR);
- node.body = this.parseStatement("for");
- this.exitScope();
- this.labels.pop();
- return this.finishNode(node, "ForStatement")
- };
- // Parse a `for`/`in` and `for`/`of` loop, which are almost
- // same from parser's perspective.
- pp$1.parseForIn = function(node, init) {
- var isForIn = this.type === types._in;
- this.next();
- if (
- init.type === "VariableDeclaration" &&
- init.declarations[0].init != null &&
- (
- !isForIn ||
- this.options.ecmaVersion < 8 ||
- this.strict ||
- init.kind !== "var" ||
- init.declarations[0].id.type !== "Identifier"
- )
- ) {
- this.raise(
- init.start,
- ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
- );
- }
- node.left = init;
- node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
- this.expect(types.parenR);
- node.body = this.parseStatement("for");
- this.exitScope();
- this.labels.pop();
- return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
- };
- // Parse a list of variable declarations.
- pp$1.parseVar = function(node, isFor, kind) {
- node.declarations = [];
- node.kind = kind;
- for (;;) {
- var decl = this.startNode();
- this.parseVarId(decl, kind);
- if (this.eat(types.eq)) {
- decl.init = this.parseMaybeAssign(isFor);
- } else if (kind === "const" && !(this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
- this.unexpected();
- } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types._in || this.isContextual("of")))) {
- this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
- } else {
- decl.init = null;
- }
- node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
- if (!this.eat(types.comma)) { break }
- }
- return node
- };
- pp$1.parseVarId = function(decl, kind) {
- decl.id = this.parseBindingAtom();
- this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
- };
- var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
- // Parse a function declaration or literal (depending on the
- // `statement & FUNC_STATEMENT`).
- // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
- pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
- this.initFunction(node);
- if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
- if (this.type === types.star && (statement & FUNC_HANGING_STATEMENT))
- { this.unexpected(); }
- node.generator = this.eat(types.star);
- }
- if (this.options.ecmaVersion >= 8)
- { node.async = !!isAsync; }
- if (statement & FUNC_STATEMENT) {
- node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types.name ? null : this.parseIdent();
- if (node.id && !(statement & FUNC_HANGING_STATEMENT))
- // If it is a regular function declaration in sloppy mode, then it is
- // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
- // mode depends on properties of the current scope (see
- // treatFunctionsAsVar).
- { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
- }
- var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
- this.yieldPos = 0;
- this.awaitPos = 0;
- this.awaitIdentPos = 0;
- this.enterScope(functionFlags(node.async, node.generator));
- if (!(statement & FUNC_STATEMENT))
- { node.id = this.type === types.name ? this.parseIdent() : null; }
- this.parseFunctionParams(node);
- this.parseFunctionBody(node, allowExpressionBody, false);
- this.yieldPos = oldYieldPos;
- this.awaitPos = oldAwaitPos;
- this.awaitIdentPos = oldAwaitIdentPos;
- return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
- };
- pp$1.parseFunctionParams = function(node) {
- this.expect(types.parenL);
- node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
- this.checkYieldAwaitInDefaultParams();
- };
- // Parse a class declaration or literal (depending on the
- // `isStatement` parameter).
- pp$1.parseClass = function(node, isStatement) {
- this.next();
- // ecma-262 14.6 Class Definitions
- // A class definition is always strict mode code.
- var oldStrict = this.strict;
- this.strict = true;
- this.parseClassId(node, isStatement);
- this.parseClassSuper(node);
- var classBody = this.startNode();
- var hadConstructor = false;
- classBody.body = [];
- this.expect(types.braceL);
- while (this.type !== types.braceR) {
- var element = this.parseClassElement(node.superClass !== null);
- if (element) {
- classBody.body.push(element);
- if (element.type === "MethodDefinition" && element.kind === "constructor") {
- if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
- hadConstructor = true;
- }
- }
- }
- this.strict = oldStrict;
- this.next();
- node.body = this.finishNode(classBody, "ClassBody");
- return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
- };
- pp$1.parseClassElement = function(constructorAllowsSuper) {
- var this$1 = this;
- if (this.eat(types.semi)) { return null }
- var method = this.startNode();
- var tryContextual = function (k, noLineBreak) {
- if ( noLineBreak === void 0 ) noLineBreak = false;
- var start = this$1.start, startLoc = this$1.startLoc;
- if (!this$1.eatContextual(k)) { return false }
- if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true }
- if (method.key) { this$1.unexpected(); }
- method.computed = false;
- method.key = this$1.startNodeAt(start, startLoc);
- method.key.name = k;
- this$1.finishNode(method.key, "Identifier");
- return false
- };
- method.kind = "method";
- method.static = tryContextual("static");
- var isGenerator = this.eat(types.star);
- var isAsync = false;
- if (!isGenerator) {
- if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) {
- isAsync = true;
- isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
- } else if (tryContextual("get")) {
- method.kind = "get";
- } else if (tryContextual("set")) {
- method.kind = "set";
- }
- }
- if (!method.key) { this.parsePropertyName(method); }
- var key = method.key;
- var allowsDirectSuper = false;
- if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
- key.type === "Literal" && key.value === "constructor")) {
- if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
- if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
- if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
- method.kind = "constructor";
- allowsDirectSuper = constructorAllowsSuper;
- } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
- this.raise(key.start, "Classes may not have a static property named prototype");
- }
- this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
- if (method.kind === "get" && method.value.params.length !== 0)
- { this.raiseRecoverable(method.value.start, "getter should have no params"); }
- if (method.kind === "set" && method.value.params.length !== 1)
- { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
- if (method.kind === "set" && method.value.params[0].type === "RestElement")
- { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
- return method
- };
- pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
- method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
- return this.finishNode(method, "MethodDefinition")
- };
- pp$1.parseClassId = function(node, isStatement) {
- if (this.type === types.name) {
- node.id = this.parseIdent();
- if (isStatement)
- { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
- } else {
- if (isStatement === true)
- { this.unexpected(); }
- node.id = null;
- }
- };
- pp$1.parseClassSuper = function(node) {
- node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
- };
- // Parses module export declaration.
- pp$1.parseExport = function(node, exports) {
- this.next();
- // export * from '...'
- if (this.eat(types.star)) {
- if (this.options.ecmaVersion >= 11) {
- if (this.eatContextual("as")) {
- node.exported = this.parseIdent(true);
- this.checkExport(exports, node.exported.name, this.lastTokStart);
- } else {
- node.exported = null;
- }
- }
- this.expectContextual("from");
- if (this.type !== types.string) { this.unexpected(); }
- node.source = this.parseExprAtom();
- this.semicolon();
- return this.finishNode(node, "ExportAllDeclaration")
- }
- if (this.eat(types._default)) { // export default ...
- this.checkExport(exports, "default", this.lastTokStart);
- var isAsync;
- if (this.type === types._function || (isAsync = this.isAsyncFunction())) {
- var fNode = this.startNode();
- this.next();
- if (isAsync) { this.next(); }
- node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync);
- } else if (this.type === types._class) {
- var cNode = this.startNode();
- node.declaration = this.parseClass(cNode, "nullableID");
- } else {
- node.declaration = this.parseMaybeAssign();
- this.semicolon();
- }
- return this.finishNode(node, "ExportDefaultDeclaration")
- }
- // export var|const|let|function|class ...
- if (this.shouldParseExportStatement()) {
- node.declaration = this.parseStatement(null);
- if (node.declaration.type === "VariableDeclaration")
- { this.checkVariableExport(exports, node.declaration.declarations); }
- else
- { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); }
- node.specifiers = [];
- node.source = null;
- } else { // export { x, y as z } [from '...']
- node.declaration = null;
- node.specifiers = this.parseExportSpecifiers(exports);
- if (this.eatContextual("from")) {
- if (this.type !== types.string) { this.unexpected(); }
- node.source = this.parseExprAtom();
- } else {
- for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
- // check for keywords used as local names
- var spec = list[i];
- this.checkUnreserved(spec.local);
- // check if export is defined
- this.checkLocalExport(spec.local);
- }
- node.source = null;
- }
- this.semicolon();
- }
- return this.finishNode(node, "ExportNamedDeclaration")
- };
- pp$1.checkExport = function(exports, name, pos) {
- if (!exports) { return }
- if (has(exports, name))
- { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
- exports[name] = true;
- };
- pp$1.checkPatternExport = function(exports, pat) {
- var type = pat.type;
- if (type === "Identifier")
- { this.checkExport(exports, pat.name, pat.start); }
- else if (type === "ObjectPattern")
- { for (var i = 0, list = pat.properties; i < list.length; i += 1)
- {
- var prop = list[i];
- this.checkPatternExport(exports, prop);
- } }
- else if (type === "ArrayPattern")
- { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
- var elt = list$1[i$1];
- if (elt) { this.checkPatternExport(exports, elt); }
- } }
- else if (type === "Property")
- { this.checkPatternExport(exports, pat.value); }
- else if (type === "AssignmentPattern")
- { this.checkPatternExport(exports, pat.left); }
- else if (type === "RestElement")
- { this.checkPatternExport(exports, pat.argument); }
- else if (type === "ParenthesizedExpression")
- { this.checkPatternExport(exports, pat.expression); }
- };
- pp$1.checkVariableExport = function(exports, decls) {
- if (!exports) { return }
- for (var i = 0, list = decls; i < list.length; i += 1)
- {
- var decl = list[i];
- this.checkPatternExport(exports, decl.id);
- }
- };
- pp$1.shouldParseExportStatement = function() {
- return this.type.keyword === "var" ||
- this.type.keyword === "const" ||
- this.type.keyword === "class" ||
- this.type.keyword === "function" ||
- this.isLet() ||
- this.isAsyncFunction()
- };
- // Parses a comma-separated list of module exports.
- pp$1.parseExportSpecifiers = function(exports) {
- var nodes = [], first = true;
- // export { x, y as z } [from '...']
- this.expect(types.braceL);
- while (!this.eat(types.braceR)) {
- if (!first) {
- this.expect(types.comma);
- if (this.afterTrailingComma(types.braceR)) { break }
- } else { first = false; }
- var node = this.startNode();
- node.local = this.parseIdent(true);
- node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local;
- this.checkExport(exports, node.exported.name, node.exported.start);
- nodes.push(this.finishNode(node, "ExportSpecifier"));
- }
- return nodes
- };
- // Parses import declaration.
- pp$1.parseImport = function(node) {
- this.next();
- // import '...'
- if (this.type === types.string) {
- node.specifiers = empty;
- node.source = this.parseExprAtom();
- } else {
- node.specifiers = this.parseImportSpecifiers();
- this.expectContextual("from");
- node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected();
- }
- this.semicolon();
- return this.finishNode(node, "ImportDeclaration")
- };
- // Parses a comma-separated list of module imports.
- pp$1.parseImportSpecifiers = function() {
- var nodes = [], first = true;
- if (this.type === types.name) {
- // import defaultObj, { x, y as z } from '...'
- var node = this.startNode();
- node.local = this.parseIdent();
- this.checkLValSimple(node.local, BIND_LEXICAL);
- nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
- if (!this.eat(types.comma)) { return nodes }
- }
- if (this.type === types.star) {
- var node$1 = this.startNode();
- this.next();
- this.expectContextual("as");
- node$1.local = this.parseIdent();
- this.checkLValSimple(node$1.local, BIND_LEXICAL);
- nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
- return nodes
- }
- this.expect(types.braceL);
- while (!this.eat(types.braceR)) {
- if (!first) {
- this.expect(types.comma);
- if (this.afterTrailingComma(types.braceR)) { break }
- } else { first = false; }
- var node$2 = this.startNode();
- node$2.imported = this.parseIdent(true);
- if (this.eatContextual("as")) {
- node$2.local = this.parseIdent();
- } else {
- this.checkUnreserved(node$2.imported);
- node$2.local = node$2.imported;
- }
- this.checkLValSimple(node$2.local, BIND_LEXICAL);
- nodes.push(this.finishNode(node$2, "ImportSpecifier"));
- }
- return nodes
- };
- // Set `ExpressionStatement#directive` property for directive prologues.
- pp$1.adaptDirectivePrologue = function(statements) {
- for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
- statements[i].directive = statements[i].expression.raw.slice(1, -1);
- }
- };
- pp$1.isDirectiveCandidate = function(statement) {
- return (
- statement.type === "ExpressionStatement" &&
- statement.expression.type === "Literal" &&
- typeof statement.expression.value === "string" &&
- // Reject parenthesized strings.
- (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
- )
- };
- var pp$2 = Parser.prototype;
- // Convert existing expression atom to assignable pattern
- // if possible.
- pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
- if (this.options.ecmaVersion >= 6 && node) {
- switch (node.type) {
- case "Identifier":
- if (this.inAsync && node.name === "await")
- { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
- break
- case "ObjectPattern":
- case "ArrayPattern":
- case "AssignmentPattern":
- case "RestElement":
- break
- case "ObjectExpression":
- node.type = "ObjectPattern";
- if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
- for (var i = 0, list = node.properties; i < list.length; i += 1) {
- var prop = list[i];
- this.toAssignable(prop, isBinding);
- // Early error:
- // AssignmentRestProperty[Yield, Await] :
- // `...` DestructuringAssignmentTarget[Yield, Await]
- //
- // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
- if (
- prop.type === "RestElement" &&
- (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
- ) {
- this.raise(prop.argument.start, "Unexpected token");
- }
- }
- break
- case "Property":
- // AssignmentProperty has type === "Property"
- if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
- this.toAssignable(node.value, isBinding);
- break
- case "ArrayExpression":
- node.type = "ArrayPattern";
- if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
- this.toAssignableList(node.elements, isBinding);
- break
- case "SpreadElement":
- node.type = "RestElement";
- this.toAssignable(node.argument, isBinding);
- if (node.argument.type === "AssignmentPattern")
- { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
- break
- case "AssignmentExpression":
- if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
- node.type = "AssignmentPattern";
- delete node.operator;
- this.toAssignable(node.left, isBinding);
- break
- case "ParenthesizedExpression":
- this.toAssignable(node.expression, isBinding, refDestructuringErrors);
- break
- case "ChainExpression":
- this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
- break
- case "MemberExpression":
- if (!isBinding) { break }
- default:
- this.raise(node.start, "Assigning to rvalue");
- }
- } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
- return node
- };
- // Convert list of expression atoms to binding list.
- pp$2.toAssignableList = function(exprList, isBinding) {
- var end = exprList.length;
- for (var i = 0; i < end; i++) {
- var elt = exprList[i];
- if (elt) { this.toAssignable(elt, isBinding); }
- }
- if (end) {
- var last = exprList[end - 1];
- if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
- { this.unexpected(last.argument.start); }
- }
- return exprList
- };
- // Parses spread element.
- pp$2.parseSpread = function(refDestructuringErrors) {
- var node = this.startNode();
- this.next();
- node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
- return this.finishNode(node, "SpreadElement")
- };
- pp$2.parseRestBinding = function() {
- var node = this.startNode();
- this.next();
- // RestElement inside of a function parameter must be an identifier
- if (this.options.ecmaVersion === 6 && this.type !== types.name)
- { this.unexpected(); }
- node.argument = this.parseBindingAtom();
- return this.finishNode(node, "RestElement")
- };
- // Parses lvalue (assignable) atom.
- pp$2.parseBindingAtom = function() {
- if (this.options.ecmaVersion >= 6) {
- switch (this.type) {
- case types.bracketL:
- var node = this.startNode();
- this.next();
- node.elements = this.parseBindingList(types.bracketR, true, true);
- return this.finishNode(node, "ArrayPattern")
- case types.braceL:
- return this.parseObj(true)
- }
- }
- return this.parseIdent()
- };
- pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {
- var elts = [], first = true;
- while (!this.eat(close)) {
- if (first) { first = false; }
- else { this.expect(types.comma); }
- if (allowEmpty && this.type === types.comma) {
- elts.push(null);
- } else if (allowTrailingComma && this.afterTrailingComma(close)) {
- break
- } else if (this.type === types.ellipsis) {
- var rest = this.parseRestBinding();
- this.parseBindingListItem(rest);
- elts.push(rest);
- if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
- this.expect(close);
- break
- } else {
- var elem = this.parseMaybeDefault(this.start, this.startLoc);
- this.parseBindingListItem(elem);
- elts.push(elem);
- }
- }
- return elts
- };
- pp$2.parseBindingListItem = function(param) {
- return param
- };
- // Parses assignment pattern around given atom if possible.
- pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
- left = left || this.parseBindingAtom();
- if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left }
- var node = this.startNodeAt(startPos, startLoc);
- node.left = left;
- node.right = this.parseMaybeAssign();
- return this.finishNode(node, "AssignmentPattern")
- };
- // The following three functions all verify that a node is an lvalue —
- // something that can be bound, or assigned to. In order to do so, they perform
- // a variety of checks:
- //
- // - Check that none of the bound/assigned-to identifiers are reserved words.
- // - Record name declarations for bindings in the appropriate scope.
- // - Check duplicate argument names, if checkClashes is set.
- //
- // If a complex binding pattern is encountered (e.g., object and array
- // destructuring), the entire pattern is recursively checked.
- //
- // There are three versions of checkLVal*() appropriate for different
- // circumstances:
- //
- // - checkLValSimple() shall be used if the syntactic construct supports
- // nothing other than identifiers and member expressions. Parenthesized
- // expressions are also correctly handled. This is generally appropriate for
- // constructs for which the spec says
- //
- // > It is a Syntax Error if AssignmentTargetType of [the production] is not
- // > simple.
- //
- // It is also appropriate for checking if an identifier is valid and not
- // defined elsewhere, like import declarations or function/class identifiers.
- //
- // Examples where this is used include:
- // a += …;
- // import a from '…';
- // where a is the node to be checked.
- //
- // - checkLValPattern() shall be used if the syntactic construct supports
- // anything checkLValSimple() supports, as well as object and array
- // destructuring patterns. This is generally appropriate for constructs for
- // which the spec says
- //
- // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
- // > an ArrayLiteral and AssignmentTargetType of [the production] is not
- // > simple.
- //
- // Examples where this is used include:
- // (a = …);
- // const a = …;
- // try { … } catch (a) { … }
- // where a is the node to be checked.
- //
- // - checkLValInnerPattern() shall be used if the syntactic construct supports
- // anything checkLValPattern() supports, as well as default assignment
- // patterns, rest elements, and other constructs that may appear within an
- // object or array destructuring pattern.
- //
- // As a special case, function parameters also use checkLValInnerPattern(),
- // as they also support defaults and rest constructs.
- //
- // These functions deliberately support both assignment and binding constructs,
- // as the logic for both is exceedingly similar. If the node is the target of
- // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
- // should be set to the appropriate BIND_* constant, like BIND_VAR or
- // BIND_LEXICAL.
- //
- // If the function is called with a non-BIND_NONE bindingType, then
- // additionally a checkClashes object may be specified to allow checking for
- // duplicate argument names. checkClashes is ignored if the provided construct
- // is an assignment (i.e., bindingType is BIND_NONE).
- pp$2.checkLValSimple = function(expr, bindingType, checkClashes) {
- if ( bindingType === void 0 ) bindingType = BIND_NONE;
- var isBind = bindingType !== BIND_NONE;
- switch (expr.type) {
- case "Identifier":
- if (this.strict && this.reservedWordsStrictBind.test(expr.name))
- { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
- if (isBind) {
- if (bindingType === BIND_LEXICAL && expr.name === "let")
- { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
- if (checkClashes) {
- if (has(checkClashes, expr.name))
- { this.raiseRecoverable(expr.start, "Argument name clash"); }
- checkClashes[expr.name] = true;
- }
- if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
- }
- break
- case "ChainExpression":
- this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
- break
- case "MemberExpression":
- if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
- break
- case "ParenthesizedExpression":
- if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
- return this.checkLValSimple(expr.expression, bindingType, checkClashes)
- default:
- this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
- }
- };
- pp$2.checkLValPattern = function(expr, bindingType, checkClashes) {
- if ( bindingType === void 0 ) bindingType = BIND_NONE;
- switch (expr.type) {
- case "ObjectPattern":
- for (var i = 0, list = expr.properties; i < list.length; i += 1) {
- var prop = list[i];
- this.checkLValInnerPattern(prop, bindingType, checkClashes);
- }
- break
- case "ArrayPattern":
- for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
- var elem = list$1[i$1];
- if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
- }
- break
- default:
- this.checkLValSimple(expr, bindingType, checkClashes);
- }
- };
- pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
- if ( bindingType === void 0 ) bindingType = BIND_NONE;
- switch (expr.type) {
- case "Property":
- // AssignmentProperty has type === "Property"
- this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
- break
- case "AssignmentPattern":
- this.checkLValPattern(expr.left, bindingType, checkClashes);
- break
- case "RestElement":
- this.checkLValPattern(expr.argument, bindingType, checkClashes);
- break
- default:
- this.checkLValPattern(expr, bindingType, checkClashes);
- }
- };
- // A recursive descent parser operates by defining functions for all
- var pp$3 = Parser.prototype;
- // Check if property name clashes with already added.
- // Object/class getters and setters are not allowed to clash —
- // either with each other or with an init property — and in
- // strict mode, init properties are also not allowed to be repeated.
- pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
- if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
- { return }
- if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
- { return }
- var key = prop.key;
- var name;
- switch (key.type) {
- case "Identifier": name = key.name; break
- case "Literal": name = String(key.value); break
- default: return
- }
- var kind = prop.kind;
- if (this.options.ecmaVersion >= 6) {
- if (name === "__proto__" && kind === "init") {
- if (propHash.proto) {
- if (refDestructuringErrors) {
- if (refDestructuringErrors.doubleProto < 0)
- { refDestructuringErrors.doubleProto = key.start; }
- // Backwards-compat kludge. Can be removed in version 6.0
- } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); }
- }
- propHash.proto = true;
- }
- return
- }
- name = "$" + name;
- var other = propHash[name];
- if (other) {
- var redefinition;
- if (kind === "init") {
- redefinition = this.strict && other.init || other.get || other.set;
- } else {
- redefinition = other.init || other[kind];
- }
- if (redefinition)
- { this.raiseRecoverable(key.start, "Redefinition of property"); }
- } else {
- other = propHash[name] = {
- init: false,
- get: false,
- set: false
- };
- }
- other[kind] = true;
- };
- // ### Expression parsing
- // These nest, from the most general expression type at the top to
- // 'atomic', nondivisible expression types at the bottom. Most of
- // the functions will simply let the function(s) below them parse,
- // and, *if* the syntactic construct they handle is present, wrap
- // the AST node that the inner parser gave them in another node.
- // Parse a full expression. The optional arguments are used to
- // forbid the `in` operator (in for loops initalization expressions)
- // and provide reference for storing '=' operator inside shorthand
- // property assignment in contexts where both object expression
- // and object pattern might appear (so it's possible to raise
- // delayed syntax error at correct position).
- pp$3.parseExpression = function(noIn, refDestructuringErrors) {
- var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
- if (this.type === types.comma) {
- var node = this.startNodeAt(startPos, startLoc);
- node.expressions = [expr];
- while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
- return this.finishNode(node, "SequenceExpression")
- }
- return expr
- };
- // Parse an assignment expression. This includes applications of
- // operators like `+=`.
- pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
- if (this.isContextual("yield")) {
- if (this.inGenerator) { return this.parseYield(noIn) }
- // The tokenizer will assume an expression is allowed after
- // `yield`, but this isn't that kind of yield
- else { this.exprAllowed = false; }
- }
- var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1;
- if (refDestructuringErrors) {
- oldParenAssign = refDestructuringErrors.parenthesizedAssign;
- oldTrailingComma = refDestructuringErrors.trailingComma;
- refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
- } else {
- refDestructuringErrors = new DestructuringErrors;
- ownDestructuringErrors = true;
- }
- var startPos = this.start, startLoc = this.startLoc;
- if (this.type === types.parenL || this.type === types.name)
- { this.potentialArrowAt = this.start; }
- var left = this.parseMaybeConditional(noIn, refDestructuringErrors);
- if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
- if (this.type.isAssign) {
- var node = this.startNodeAt(startPos, startLoc);
- node.operator = this.value;
- if (this.type === types.eq)
- { left = this.toAssignable(left, false, refDestructuringErrors); }
- if (!ownDestructuringErrors) {
- refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
- }
- if (refDestructuringErrors.shorthandAssign >= left.start)
- { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
- if (this.type === types.eq)
- { this.checkLValPattern(left); }
- else
- { this.checkLValSimple(left); }
- node.left = left;
- this.next();
- node.right = this.parseMaybeAssign(noIn);
- return this.finishNode(node, "AssignmentExpression")
- } else {
- if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
- }
- if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
- if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
- return left
- };
- // Parse a ternary conditional (`?:`) operator.
- pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
- var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseExprOps(noIn, refDestructuringErrors);
- if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
- if (this.eat(types.question)) {
- var node = this.startNodeAt(startPos, startLoc);
- node.test = expr;
- node.consequent = this.parseMaybeAssign();
- this.expect(types.colon);
- node.alternate = this.parseMaybeAssign(noIn);
- return this.finishNode(node, "ConditionalExpression")
- }
- return expr
- };
- // Start the precedence parser.
- pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
- var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseMaybeUnary(refDestructuringErrors, false);
- if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
- return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn)
- };
- // Parse binary operators with the operator precedence parsing
- // algorithm. `left` is the left-hand side of the operator.
- // `minPrec` provides context that allows the function to stop and
- // defer further parser to one of its callers when it encounters an
- // operator that has a lower precedence than the set it is parsing.
- pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
- var prec = this.type.binop;
- if (prec != null && (!noIn || this.type !== types._in)) {
- if (prec > minPrec) {
- var logical = this.type === types.logicalOR || this.type === types.logicalAND;
- var coalesce = this.type === types.coalesce;
- if (coalesce) {
- // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
- // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
- prec = types.logicalAND.binop;
- }
- var op = this.value;
- this.next();
- var startPos = this.start, startLoc = this.startLoc;
- var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn);
- var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
- if ((logical && this.type === types.coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {
- this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
- }
- return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn)
- }
- }
- return left
- };
- pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
- var node = this.startNodeAt(startPos, startLoc);
- node.left = left;
- node.operator = op;
- node.right = right;
- return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
- };
- // Parse unary operators, both prefix and postfix.
- pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
- var startPos = this.start, startLoc = this.startLoc, expr;
- if (this.isContextual("await") && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction))) {
- expr = this.parseAwait();
- sawUnary = true;
- } else if (this.type.prefix) {
- var node = this.startNode(), update = this.type === types.incDec;
- node.operator = this.value;
- node.prefix = true;
- this.next();
- node.argument = this.parseMaybeUnary(null, true);
- this.checkExpressionErrors(refDestructuringErrors, true);
- if (update) { this.checkLValSimple(node.argument); }
- else if (this.strict && node.operator === "delete" &&
- node.argument.type === "Identifier")
- { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
- else { sawUnary = true; }
- expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
- } else {
- expr = this.parseExprSubscripts(refDestructuringErrors);
- if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
- while (this.type.postfix && !this.canInsertSemicolon()) {
- var node$1 = this.startNodeAt(startPos, startLoc);
- node$1.operator = this.value;
- node$1.prefix = false;
- node$1.argument = expr;
- this.checkLValSimple(expr);
- this.next();
- expr = this.finishNode(node$1, "UpdateExpression");
- }
- }
- if (!sawUnary && this.eat(types.starstar))
- { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) }
- else
- { return expr }
- };
- // Parse call, dot, and `[]`-subscript expressions.
- pp$3.parseExprSubscripts = function(refDestructuringErrors) {
- var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseExprAtom(refDestructuringErrors);
- if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
- { return expr }
- var result = this.parseSubscripts(expr, startPos, startLoc);
- if (refDestructuringErrors && result.type === "MemberExpression") {
- if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
- if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
- }
- return result
- };
- pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
- var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
- this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
- this.potentialArrowAt === base.start;
- var optionalChained = false;
- while (true) {
- var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained);
- if (element.optional) { optionalChained = true; }
- if (element === base || element.type === "ArrowFunctionExpression") {
- if (optionalChained) {
- var chainNode = this.startNodeAt(startPos, startLoc);
- chainNode.expression = element;
- element = this.finishNode(chainNode, "ChainExpression");
- }
- return element
- }
- base = element;
- }
- };
- pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
- var optionalSupported = this.options.ecmaVersion >= 11;
- var optional = optionalSupported && this.eat(types.questionDot);
- if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
- var computed = this.eat(types.bracketL);
- if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
- var node = this.startNodeAt(startPos, startLoc);
- node.object = base;
- node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
- node.computed = !!computed;
- if (computed) { this.expect(types.bracketR); }
- if (optionalSupported) {
- node.optional = optional;
- }
- base = this.finishNode(node, "MemberExpression");
- } else if (!noCalls && this.eat(types.parenL)) {
- var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
- this.yieldPos = 0;
- this.awaitPos = 0;
- this.awaitIdentPos = 0;
- var exprList = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
- if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types.arrow)) {
- this.checkPatternErrors(refDestructuringErrors, false);
- this.checkYieldAwaitInDefaultParams();
- if (this.awaitIdentPos > 0)
- { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
- this.yieldPos = oldYieldPos;
- this.awaitPos = oldAwaitPos;
- this.awaitIdentPos = oldAwaitIdentPos;
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
- }
- this.checkExpressionErrors(refDestructuringErrors, true);
- this.yieldPos = oldYieldPos || this.yieldPos;
- this.awaitPos = oldAwaitPos || this.awaitPos;
- this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
- var node$1 = this.startNodeAt(startPos, startLoc);
- node$1.callee = base;
- node$1.arguments = exprList;
- if (optionalSupported) {
- node$1.optional = optional;
- }
- base = this.finishNode(node$1, "CallExpression");
- } else if (this.type === types.backQuote) {
- if (optional || optionalChained) {
- this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
- }
- var node$2 = this.startNodeAt(startPos, startLoc);
- node$2.tag = base;
- node$2.quasi = this.parseTemplate({isTagged: true});
- base = this.finishNode(node$2, "TaggedTemplateExpression");
- }
- return base
- };
- // Parse an atomic expression — either a single token that is an
- // expression, an expression started by a keyword like `function` or
- // `new`, or an expression wrapped in punctuation like `()`, `[]`,
- // or `{}`.
- pp$3.parseExprAtom = function(refDestructuringErrors) {
- // If a division operator appears in an expression position, the
- // tokenizer got confused, and we force it to read a regexp instead.
- if (this.type === types.slash) { this.readRegexp(); }
- var node, canBeArrow = this.potentialArrowAt === this.start;
- switch (this.type) {
- case types._super:
- if (!this.allowSuper)
- { this.raise(this.start, "'super' keyword outside a method"); }
- node = this.startNode();
- this.next();
- if (this.type === types.parenL && !this.allowDirectSuper)
- { this.raise(node.start, "super() call outside constructor of a subclass"); }
- // The `super` keyword can appear at below:
- // SuperProperty:
- // super [ Expression ]
- // super . IdentifierName
- // SuperCall:
- // super ( Arguments )
- if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL)
- { this.unexpected(); }
- return this.finishNode(node, "Super")
- case types._this:
- node = this.startNode();
- this.next();
- return this.finishNode(node, "ThisExpression")
- case types.name:
- var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
- var id = this.parseIdent(false);
- if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
- { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
- if (canBeArrow && !this.canInsertSemicolon()) {
- if (this.eat(types.arrow))
- { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) }
- if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) {
- id = this.parseIdent(false);
- if (this.canInsertSemicolon() || !this.eat(types.arrow))
- { this.unexpected(); }
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
- }
- }
- return id
- case types.regexp:
- var value = this.value;
- node = this.parseLiteral(value.value);
- node.regex = {pattern: value.pattern, flags: value.flags};
- return node
- case types.num: case types.string:
- return this.parseLiteral(this.value)
- case types._null: case types._true: case types._false:
- node = this.startNode();
- node.value = this.type === types._null ? null : this.type === types._true;
- node.raw = this.type.keyword;
- this.next();
- return this.finishNode(node, "Literal")
- case types.parenL:
- var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
- if (refDestructuringErrors) {
- if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
- { refDestructuringErrors.parenthesizedAssign = start; }
- if (refDestructuringErrors.parenthesizedBind < 0)
- { refDestructuringErrors.parenthesizedBind = start; }
- }
- return expr
- case types.bracketL:
- node = this.startNode();
- this.next();
- node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors);
- return this.finishNode(node, "ArrayExpression")
- case types.braceL:
- return this.parseObj(false, refDestructuringErrors)
- case types._function:
- node = this.startNode();
- this.next();
- return this.parseFunction(node, 0)
- case types._class:
- return this.parseClass(this.startNode(), false)
- case types._new:
- return this.parseNew()
- case types.backQuote:
- return this.parseTemplate()
- case types._import:
- if (this.options.ecmaVersion >= 11) {
- return this.parseExprImport()
- } else {
- return this.unexpected()
- }
- default:
- this.unexpected();
- }
- };
- pp$3.parseExprImport = function() {
- var node = this.startNode();
- // Consume `import` as an identifier for `import.meta`.
- // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
- if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
- var meta = this.parseIdent(true);
- switch (this.type) {
- case types.parenL:
- return this.parseDynamicImport(node)
- case types.dot:
- node.meta = meta;
- return this.parseImportMeta(node)
- default:
- this.unexpected();
- }
- };
- pp$3.parseDynamicImport = function(node) {
- this.next(); // skip `(`
- // Parse node.source.
- node.source = this.parseMaybeAssign();
- // Verify ending.
- if (!this.eat(types.parenR)) {
- var errorPos = this.start;
- if (this.eat(types.comma) && this.eat(types.parenR)) {
- this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
- } else {
- this.unexpected(errorPos);
- }
- }
- return this.finishNode(node, "ImportExpression")
- };
- pp$3.parseImportMeta = function(node) {
- this.next(); // skip `.`
- var containsEsc = this.containsEsc;
- node.property = this.parseIdent(true);
- if (node.property.name !== "meta")
- { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
- if (containsEsc)
- { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
- if (this.options.sourceType !== "module")
- { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }
- return this.finishNode(node, "MetaProperty")
- };
- pp$3.parseLiteral = function(value) {
- var node = this.startNode();
- node.value = value;
- node.raw = this.input.slice(this.start, this.end);
- if (node.raw.charCodeAt(node.raw.length - 1) === 110) { node.bigint = node.raw.slice(0, -1).replace(/_/g, ""); }
- this.next();
- return this.finishNode(node, "Literal")
- };
- pp$3.parseParenExpression = function() {
- this.expect(types.parenL);
- var val = this.parseExpression();
- this.expect(types.parenR);
- return val
- };
- pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
- var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
- if (this.options.ecmaVersion >= 6) {
- this.next();
- var innerStartPos = this.start, innerStartLoc = this.startLoc;
- var exprList = [], first = true, lastIsComma = false;
- var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
- this.yieldPos = 0;
- this.awaitPos = 0;
- // Do not save awaitIdentPos to allow checking awaits nested in parameters
- while (this.type !== types.parenR) {
- first ? first = false : this.expect(types.comma);
- if (allowTrailingComma && this.afterTrailingComma(types.parenR, true)) {
- lastIsComma = true;
- break
- } else if (this.type === types.ellipsis) {
- spreadStart = this.start;
- exprList.push(this.parseParenItem(this.parseRestBinding()));
- if (this.type === types.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }
- break
- } else {
- exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
- }
- }
- var innerEndPos = this.start, innerEndLoc = this.startLoc;
- this.expect(types.parenR);
- if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
- this.checkPatternErrors(refDestructuringErrors, false);
- this.checkYieldAwaitInDefaultParams();
- this.yieldPos = oldYieldPos;
- this.awaitPos = oldAwaitPos;
- return this.parseParenArrowList(startPos, startLoc, exprList)
- }
- if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
- if (spreadStart) { this.unexpected(spreadStart); }
- this.checkExpressionErrors(refDestructuringErrors, true);
- this.yieldPos = oldYieldPos || this.yieldPos;
- this.awaitPos = oldAwaitPos || this.awaitPos;
- if (exprList.length > 1) {
- val = this.startNodeAt(innerStartPos, innerStartLoc);
- val.expressions = exprList;
- this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
- } else {
- val = exprList[0];
- }
- } else {
- val = this.parseParenExpression();
- }
- if (this.options.preserveParens) {
- var par = this.startNodeAt(startPos, startLoc);
- par.expression = val;
- return this.finishNode(par, "ParenthesizedExpression")
- } else {
- return val
- }
- };
- pp$3.parseParenItem = function(item) {
- return item
- };
- pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
- };
- // New's precedence is slightly tricky. It must allow its argument to
- // be a `[]` or dot subscript expression, but not a call — at least,
- // not without wrapping it in parentheses. Thus, it uses the noCalls
- // argument to parseSubscripts to prevent it from consuming the
- // argument list.
- var empty$1 = [];
- pp$3.parseNew = function() {
- if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
- var node = this.startNode();
- var meta = this.parseIdent(true);
- if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
- node.meta = meta;
- var containsEsc = this.containsEsc;
- node.property = this.parseIdent(true);
- if (node.property.name !== "target")
- { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
- if (containsEsc)
- { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
- if (!this.inNonArrowFunction)
- { this.raiseRecoverable(node.start, "'new.target' can only be used in functions"); }
- return this.finishNode(node, "MetaProperty")
- }
- var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types._import;
- node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
- if (isImport && node.callee.type === "ImportExpression") {
- this.raise(startPos, "Cannot use new with import()");
- }
- if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }
- else { node.arguments = empty$1; }
- return this.finishNode(node, "NewExpression")
- };
- // Parse template expression.
- pp$3.parseTemplateElement = function(ref) {
- var isTagged = ref.isTagged;
- var elem = this.startNode();
- if (this.type === types.invalidTemplate) {
- if (!isTagged) {
- this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
- }
- elem.value = {
- raw: this.value,
- cooked: null
- };
- } else {
- elem.value = {
- raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
- cooked: this.value
- };
- }
- this.next();
- elem.tail = this.type === types.backQuote;
- return this.finishNode(elem, "TemplateElement")
- };
- pp$3.parseTemplate = function(ref) {
- if ( ref === void 0 ) ref = {};
- var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
- var node = this.startNode();
- this.next();
- node.expressions = [];
- var curElt = this.parseTemplateElement({isTagged: isTagged});
- node.quasis = [curElt];
- while (!curElt.tail) {
- if (this.type === types.eof) { this.raise(this.pos, "Unterminated template literal"); }
- this.expect(types.dollarBraceL);
- node.expressions.push(this.parseExpression());
- this.expect(types.braceR);
- node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
- }
- this.next();
- return this.finishNode(node, "TemplateLiteral")
- };
- pp$3.isAsyncProp = function(prop) {
- return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
- (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
- !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
- };
- // Parse an object literal or binding pattern.
- pp$3.parseObj = function(isPattern, refDestructuringErrors) {
- var node = this.startNode(), first = true, propHash = {};
- node.properties = [];
- this.next();
- while (!this.eat(types.braceR)) {
- if (!first) {
- this.expect(types.comma);
- if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types.braceR)) { break }
- } else { first = false; }
- var prop = this.parseProperty(isPattern, refDestructuringErrors);
- if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
- node.properties.push(prop);
- }
- return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
- };
- pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
- var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
- if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
- if (isPattern) {
- prop.argument = this.parseIdent(false);
- if (this.type === types.comma) {
- this.raise(this.start, "Comma is not permitted after the rest element");
- }
- return this.finishNode(prop, "RestElement")
- }
- // To disallow parenthesized identifier via `this.toAssignable()`.
- if (this.type === types.parenL && refDestructuringErrors) {
- if (refDestructuringErrors.parenthesizedAssign < 0) {
- refDestructuringErrors.parenthesizedAssign = this.start;
- }
- if (refDestructuringErrors.parenthesizedBind < 0) {
- refDestructuringErrors.parenthesizedBind = this.start;
- }
- }
- // Parse argument.
- prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
- // To disallow trailing comma via `this.toAssignable()`.
- if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
- refDestructuringErrors.trailingComma = this.start;
- }
- // Finish
- return this.finishNode(prop, "SpreadElement")
- }
- if (this.options.ecmaVersion >= 6) {
- prop.method = false;
- prop.shorthand = false;
- if (isPattern || refDestructuringErrors) {
- startPos = this.start;
- startLoc = this.startLoc;
- }
- if (!isPattern)
- { isGenerator = this.eat(types.star); }
- }
- var containsEsc = this.containsEsc;
- this.parsePropertyName(prop);
- if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
- isAsync = true;
- isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star);
- this.parsePropertyName(prop, refDestructuringErrors);
- } else {
- isAsync = false;
- }
- this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
- return this.finishNode(prop, "Property")
- };
- pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
- if ((isGenerator || isAsync) && this.type === types.colon)
- { this.unexpected(); }
- if (this.eat(types.colon)) {
- prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
- prop.kind = "init";
- } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) {
- if (isPattern) { this.unexpected(); }
- prop.kind = "init";
- prop.method = true;
- prop.value = this.parseMethod(isGenerator, isAsync);
- } else if (!isPattern && !containsEsc &&
- this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
- (prop.key.name === "get" || prop.key.name === "set") &&
- (this.type !== types.comma && this.type !== types.braceR && this.type !== types.eq)) {
- if (isGenerator || isAsync) { this.unexpected(); }
- prop.kind = prop.key.name;
- this.parsePropertyName(prop);
- prop.value = this.parseMethod(false);
- var paramCount = prop.kind === "get" ? 0 : 1;
- if (prop.value.params.length !== paramCount) {
- var start = prop.value.start;
- if (prop.kind === "get")
- { this.raiseRecoverable(start, "getter should have no params"); }
- else
- { this.raiseRecoverable(start, "setter should have exactly one param"); }
- } else {
- if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
- { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
- }
- } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
- if (isGenerator || isAsync) { this.unexpected(); }
- this.checkUnreserved(prop.key);
- if (prop.key.name === "await" && !this.awaitIdentPos)
- { this.awaitIdentPos = startPos; }
- prop.kind = "init";
- if (isPattern) {
- prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
- } else if (this.type === types.eq && refDestructuringErrors) {
- if (refDestructuringErrors.shorthandAssign < 0)
- { refDestructuringErrors.shorthandAssign = this.start; }
- prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
- } else {
- prop.value = this.copyNode(prop.key);
- }
- prop.shorthand = true;
- } else { this.unexpected(); }
- };
- pp$3.parsePropertyName = function(prop) {
- if (this.options.ecmaVersion >= 6) {
- if (this.eat(types.bracketL)) {
- prop.computed = true;
- prop.key = this.parseMaybeAssign();
- this.expect(types.bracketR);
- return prop.key
- } else {
- prop.computed = false;
- }
- }
- return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
- };
- // Initialize empty function node.
- pp$3.initFunction = function(node) {
- node.id = null;
- if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
- if (this.options.ecmaVersion >= 8) { node.async = false; }
- };
- // Parse object or class method.
- pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
- var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
- this.initFunction(node);
- if (this.options.ecmaVersion >= 6)
- { node.generator = isGenerator; }
- if (this.options.ecmaVersion >= 8)
- { node.async = !!isAsync; }
- this.yieldPos = 0;
- this.awaitPos = 0;
- this.awaitIdentPos = 0;
- this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
- this.expect(types.parenL);
- node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8);
- this.checkYieldAwaitInDefaultParams();
- this.parseFunctionBody(node, false, true);
- this.yieldPos = oldYieldPos;
- this.awaitPos = oldAwaitPos;
- this.awaitIdentPos = oldAwaitIdentPos;
- return this.finishNode(node, "FunctionExpression")
- };
- // Parse arrow function expression with given parameters.
- pp$3.parseArrowExpression = function(node, params, isAsync) {
- var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
- this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
- this.initFunction(node);
- if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }
- this.yieldPos = 0;
- this.awaitPos = 0;
- this.awaitIdentPos = 0;
- node.params = this.toAssignableList(params, true);
- this.parseFunctionBody(node, true, false);
- this.yieldPos = oldYieldPos;
- this.awaitPos = oldAwaitPos;
- this.awaitIdentPos = oldAwaitIdentPos;
- return this.finishNode(node, "ArrowFunctionExpression")
- };
- // Parse function body and check parameters.
- pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
- var isExpression = isArrowFunction && this.type !== types.braceL;
- var oldStrict = this.strict, useStrict = false;
- if (isExpression) {
- node.body = this.parseMaybeAssign();
- node.expression = true;
- this.checkParams(node, false);
- } else {
- var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
- if (!oldStrict || nonSimple) {
- useStrict = this.strictDirective(this.end);
- // If this is a strict mode function, verify that argument names
- // are not repeated, and it does not try to bind the words `eval`
- // or `arguments`.
- if (useStrict && nonSimple)
- { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
- }
- // Start a new scope with regard to labels and the `inFunction`
- // flag (restore them to their old value afterwards).
- var oldLabels = this.labels;
- this.labels = [];
- if (useStrict) { this.strict = true; }
- // Add the params to varDeclaredNames to ensure that an error is thrown
- // if a let/const declaration in the function clashes with one of the params.
- this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
- // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
- if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
- node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
- node.expression = false;
- this.adaptDirectivePrologue(node.body.body);
- this.labels = oldLabels;
- }
- this.exitScope();
- };
- pp$3.isSimpleParamList = function(params) {
- for (var i = 0, list = params; i < list.length; i += 1)
- {
- var param = list[i];
- if (param.type !== "Identifier") { return false
- } }
- return true
- };
- // Checks function params for various disallowed patterns such as using "eval"
- // or "arguments" and duplicate parameters.
- pp$3.checkParams = function(node, allowDuplicates) {
- var nameHash = Object.create(null);
- for (var i = 0, list = node.params; i < list.length; i += 1)
- {
- var param = list[i];
- this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
- }
- };
- // Parses a comma-separated list of expressions, and returns them as
- // an array. `close` is the token type that ends the list, and
- // `allowEmpty` can be turned on to allow subsequent commas with
- // nothing in between them to be parsed as `null` (which is needed
- // for array literals).
- pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
- var elts = [], first = true;
- while (!this.eat(close)) {
- if (!first) {
- this.expect(types.comma);
- if (allowTrailingComma && this.afterTrailingComma(close)) { break }
- } else { first = false; }
- var elt = (void 0);
- if (allowEmpty && this.type === types.comma)
- { elt = null; }
- else if (this.type === types.ellipsis) {
- elt = this.parseSpread(refDestructuringErrors);
- if (refDestructuringErrors && this.type === types.comma && refDestructuringErrors.trailingComma < 0)
- { refDestructuringErrors.trailingComma = this.start; }
- } else {
- elt = this.parseMaybeAssign(false, refDestructuringErrors);
- }
- elts.push(elt);
- }
- return elts
- };
- pp$3.checkUnreserved = function(ref) {
- var start = ref.start;
- var end = ref.end;
- var name = ref.name;
- if (this.inGenerator && name === "yield")
- { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
- if (this.inAsync && name === "await")
- { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
- if (this.keywords.test(name))
- { this.raise(start, ("Unexpected keyword '" + name + "'")); }
- if (this.options.ecmaVersion < 6 &&
- this.input.slice(start, end).indexOf("\\") !== -1) { return }
- var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
- if (re.test(name)) {
- if (!this.inAsync && name === "await")
- { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
- this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
- }
- };
- // Parse the next token as an identifier. If `liberal` is true (used
- // when parsing properties), it will also convert keywords into
- // identifiers.
- pp$3.parseIdent = function(liberal, isBinding) {
- var node = this.startNode();
- if (this.type === types.name) {
- node.name = this.value;
- } else if (this.type.keyword) {
- node.name = this.type.keyword;
- // To fix https://github.com/acornjs/acorn/issues/575
- // `class` and `function` keywords push new context into this.context.
- // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
- // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
- if ((node.name === "class" || node.name === "function") &&
- (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
- this.context.pop();
- }
- } else {
- this.unexpected();
- }
- this.next(!!liberal);
- this.finishNode(node, "Identifier");
- if (!liberal) {
- this.checkUnreserved(node);
- if (node.name === "await" && !this.awaitIdentPos)
- { this.awaitIdentPos = node.start; }
- }
- return node
- };
- // Parses yield expression inside generator.
- pp$3.parseYield = function(noIn) {
- if (!this.yieldPos) { this.yieldPos = this.start; }
- var node = this.startNode();
- this.next();
- if (this.type === types.semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {
- node.delegate = false;
- node.argument = null;
- } else {
- node.delegate = this.eat(types.star);
- node.argument = this.parseMaybeAssign(noIn);
- }
- return this.finishNode(node, "YieldExpression")
- };
- pp$3.parseAwait = function() {
- if (!this.awaitPos) { this.awaitPos = this.start; }
- var node = this.startNode();
- this.next();
- node.argument = this.parseMaybeUnary(null, true);
- return this.finishNode(node, "AwaitExpression")
- };
- var pp$4 = Parser.prototype;
- // This function is used to raise exceptions on parse errors. It
- // takes an offset integer (into the current `input`) to indicate
- // the location of the error, attaches the position to the end
- // of the error message, and then raises a `SyntaxError` with that
- // message.
- pp$4.raise = function(pos, message) {
- var loc = getLineInfo(this.input, pos);
- message += " (" + loc.line + ":" + loc.column + ")";
- var err = new SyntaxError(message);
- err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
- throw err
- };
- pp$4.raiseRecoverable = pp$4.raise;
- pp$4.curPosition = function() {
- if (this.options.locations) {
- return new Position(this.curLine, this.pos - this.lineStart)
- }
- };
- var pp$5 = Parser.prototype;
- var Scope$2 = function Scope(flags) {
- this.flags = flags;
- // A list of var-declared names in the current lexical scope
- this.var = [];
- // A list of lexically-declared names in the current lexical scope
- this.lexical = [];
- // A list of lexically-declared FunctionDeclaration names in the current lexical scope
- this.functions = [];
- };
- // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.
- pp$5.enterScope = function(flags) {
- this.scopeStack.push(new Scope$2(flags));
- };
- pp$5.exitScope = function() {
- this.scopeStack.pop();
- };
- // The spec says:
- // > At the top level of a function, or script, function declarations are
- // > treated like var declarations rather than like lexical declarations.
- pp$5.treatFunctionsAsVarInScope = function(scope) {
- return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
- };
- pp$5.declareName = function(name, bindingType, pos) {
- var redeclared = false;
- if (bindingType === BIND_LEXICAL) {
- var scope = this.currentScope();
- redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
- scope.lexical.push(name);
- if (this.inModule && (scope.flags & SCOPE_TOP))
- { delete this.undefinedExports[name]; }
- } else if (bindingType === BIND_SIMPLE_CATCH) {
- var scope$1 = this.currentScope();
- scope$1.lexical.push(name);
- } else if (bindingType === BIND_FUNCTION) {
- var scope$2 = this.currentScope();
- if (this.treatFunctionsAsVar)
- { redeclared = scope$2.lexical.indexOf(name) > -1; }
- else
- { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
- scope$2.functions.push(name);
- } else {
- for (var i = this.scopeStack.length - 1; i >= 0; --i) {
- var scope$3 = this.scopeStack[i];
- if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
- !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
- redeclared = true;
- break
- }
- scope$3.var.push(name);
- if (this.inModule && (scope$3.flags & SCOPE_TOP))
- { delete this.undefinedExports[name]; }
- if (scope$3.flags & SCOPE_VAR) { break }
- }
- }
- if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
- };
- pp$5.checkLocalExport = function(id) {
- // scope.functions must be empty as Module code is always strict.
- if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
- this.scopeStack[0].var.indexOf(id.name) === -1) {
- this.undefinedExports[id.name] = id;
- }
- };
- pp$5.currentScope = function() {
- return this.scopeStack[this.scopeStack.length - 1]
- };
- pp$5.currentVarScope = function() {
- for (var i = this.scopeStack.length - 1;; i--) {
- var scope = this.scopeStack[i];
- if (scope.flags & SCOPE_VAR) { return scope }
- }
- };
- // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
- pp$5.currentThisScope = function() {
- for (var i = this.scopeStack.length - 1;; i--) {
- var scope = this.scopeStack[i];
- if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) { return scope }
- }
- };
- var Node = function Node(parser, pos, loc) {
- this.type = "";
- this.start = pos;
- this.end = 0;
- if (parser.options.locations)
- { this.loc = new SourceLocation(parser, loc); }
- if (parser.options.directSourceFile)
- { this.sourceFile = parser.options.directSourceFile; }
- if (parser.options.ranges)
- { this.range = [pos, 0]; }
- };
- // Start an AST node, attaching a start offset.
- var pp$6 = Parser.prototype;
- pp$6.startNode = function() {
- return new Node(this, this.start, this.startLoc)
- };
- pp$6.startNodeAt = function(pos, loc) {
- return new Node(this, pos, loc)
- };
- // Finish an AST node, adding `type` and `end` properties.
- function finishNodeAt(node, type, pos, loc) {
- node.type = type;
- node.end = pos;
- if (this.options.locations)
- { node.loc.end = loc; }
- if (this.options.ranges)
- { node.range[1] = pos; }
- return node
- }
- pp$6.finishNode = function(node, type) {
- return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
- };
- // Finish node at given position
- pp$6.finishNodeAt = function(node, type, pos, loc) {
- return finishNodeAt.call(this, node, type, pos, loc)
- };
- pp$6.copyNode = function(node) {
- var newNode = new Node(this, node.start, this.startLoc);
- for (var prop in node) { newNode[prop] = node[prop]; }
- return newNode
- };
- // The algorithm used to determine whether a regexp can appear at a
- var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
- this.token = token;
- this.isExpr = !!isExpr;
- this.preserveSpace = !!preserveSpace;
- this.override = override;
- this.generator = !!generator;
- };
- var types$1 = {
- b_stat: new TokContext("{", false),
- b_expr: new TokContext("{", true),
- b_tmpl: new TokContext("${", false),
- p_stat: new TokContext("(", false),
- p_expr: new TokContext("(", true),
- q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
- f_stat: new TokContext("function", false),
- f_expr: new TokContext("function", true),
- f_expr_gen: new TokContext("function", true, false, null, true),
- f_gen: new TokContext("function", false, false, null, true)
- };
- var pp$7 = Parser.prototype;
- pp$7.initialContext = function() {
- return [types$1.b_stat]
- };
- pp$7.braceIsBlock = function(prevType) {
- var parent = this.curContext();
- if (parent === types$1.f_expr || parent === types$1.f_stat)
- { return true }
- if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
- { return !parent.isExpr }
- // The check for `tt.name && exprAllowed` detects whether we are
- // after a `yield` or `of` construct. See the `updateContext` for
- // `tt.name`.
- if (prevType === types._return || prevType === types.name && this.exprAllowed)
- { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
- if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
- { return true }
- if (prevType === types.braceL)
- { return parent === types$1.b_stat }
- if (prevType === types._var || prevType === types._const || prevType === types.name)
- { return false }
- return !this.exprAllowed
- };
- pp$7.inGeneratorContext = function() {
- for (var i = this.context.length - 1; i >= 1; i--) {
- var context = this.context[i];
- if (context.token === "function")
- { return context.generator }
- }
- return false
- };
- pp$7.updateContext = function(prevType) {
- var update, type = this.type;
- if (type.keyword && prevType === types.dot)
- { this.exprAllowed = false; }
- else if (update = type.updateContext)
- { update.call(this, prevType); }
- else
- { this.exprAllowed = type.beforeExpr; }
- };
- // Token-specific context update code
- types.parenR.updateContext = types.braceR.updateContext = function() {
- if (this.context.length === 1) {
- this.exprAllowed = true;
- return
- }
- var out = this.context.pop();
- if (out === types$1.b_stat && this.curContext().token === "function") {
- out = this.context.pop();
- }
- this.exprAllowed = !out.isExpr;
- };
- types.braceL.updateContext = function(prevType) {
- this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
- this.exprAllowed = true;
- };
- types.dollarBraceL.updateContext = function() {
- this.context.push(types$1.b_tmpl);
- this.exprAllowed = true;
- };
- types.parenL.updateContext = function(prevType) {
- var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
- this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
- this.exprAllowed = true;
- };
- types.incDec.updateContext = function() {
- // tokExprAllowed stays unchanged
- };
- types._function.updateContext = types._class.updateContext = function(prevType) {
- if (prevType.beforeExpr && prevType !== types._else &&
- !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
- !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
- !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
- { this.context.push(types$1.f_expr); }
- else
- { this.context.push(types$1.f_stat); }
- this.exprAllowed = false;
- };
- types.backQuote.updateContext = function() {
- if (this.curContext() === types$1.q_tmpl)
- { this.context.pop(); }
- else
- { this.context.push(types$1.q_tmpl); }
- this.exprAllowed = false;
- };
- types.star.updateContext = function(prevType) {
- if (prevType === types._function) {
- var index = this.context.length - 1;
- if (this.context[index] === types$1.f_expr)
- { this.context[index] = types$1.f_expr_gen; }
- else
- { this.context[index] = types$1.f_gen; }
- }
- this.exprAllowed = true;
- };
- types.name.updateContext = function(prevType) {
- var allowed = false;
- if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
- if (this.value === "of" && !this.exprAllowed ||
- this.value === "yield" && this.inGeneratorContext())
- { allowed = true; }
- }
- this.exprAllowed = allowed;
- };
- // This file contains Unicode properties extracted from the ECMAScript
- // specification. The lists are extracted like so:
- // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)
- // #table-binary-unicode-properties
- var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
- var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
- var ecma11BinaryProperties = ecma10BinaryProperties;
- var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
- var unicodeBinaryProperties = {
- 9: ecma9BinaryProperties,
- 10: ecma10BinaryProperties,
- 11: ecma11BinaryProperties,
- 12: ecma12BinaryProperties
- };
- // #table-unicode-general-category-values
- var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
- // #table-unicode-script-values
- var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
- var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
- var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
- var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
- var unicodeScriptValues = {
- 9: ecma9ScriptValues,
- 10: ecma10ScriptValues,
- 11: ecma11ScriptValues,
- 12: ecma12ScriptValues
- };
- var data = {};
- function buildUnicodeData(ecmaVersion) {
- var d = data[ecmaVersion] = {
- binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
- nonBinary: {
- General_Category: wordsRegexp(unicodeGeneralCategoryValues),
- Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
- }
- };
- d.nonBinary.Script_Extensions = d.nonBinary.Script;
- d.nonBinary.gc = d.nonBinary.General_Category;
- d.nonBinary.sc = d.nonBinary.Script;
- d.nonBinary.scx = d.nonBinary.Script_Extensions;
- }
- buildUnicodeData(9);
- buildUnicodeData(10);
- buildUnicodeData(11);
- buildUnicodeData(12);
- var pp$8 = Parser.prototype;
- var RegExpValidationState = function RegExpValidationState(parser) {
- this.parser = parser;
- this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
- this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
- this.source = "";
- this.flags = "";
- this.start = 0;
- this.switchU = false;
- this.switchN = false;
- this.pos = 0;
- this.lastIntValue = 0;
- this.lastStringValue = "";
- this.lastAssertionIsQuantifiable = false;
- this.numCapturingParens = 0;
- this.maxBackReference = 0;
- this.groupNames = [];
- this.backReferenceNames = [];
- };
- RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
- var unicode = flags.indexOf("u") !== -1;
- this.start = start | 0;
- this.source = pattern + "";
- this.flags = flags;
- this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
- this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
- };
- RegExpValidationState.prototype.raise = function raise (message) {
- this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
- };
- // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
- // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
- RegExpValidationState.prototype.at = function at (i, forceU) {
- if ( forceU === void 0 ) forceU = false;
- var s = this.source;
- var l = s.length;
- if (i >= l) {
- return -1
- }
- var c = s.charCodeAt(i);
- if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
- return c
- }
- var next = s.charCodeAt(i + 1);
- return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
- };
- RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
- if ( forceU === void 0 ) forceU = false;
- var s = this.source;
- var l = s.length;
- if (i >= l) {
- return l
- }
- var c = s.charCodeAt(i), next;
- if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
- (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
- return i + 1
- }
- return i + 2
- };
- RegExpValidationState.prototype.current = function current (forceU) {
- if ( forceU === void 0 ) forceU = false;
- return this.at(this.pos, forceU)
- };
- RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
- if ( forceU === void 0 ) forceU = false;
- return this.at(this.nextIndex(this.pos, forceU), forceU)
- };
- RegExpValidationState.prototype.advance = function advance (forceU) {
- if ( forceU === void 0 ) forceU = false;
- this.pos = this.nextIndex(this.pos, forceU);
- };
- RegExpValidationState.prototype.eat = function eat (ch, forceU) {
- if ( forceU === void 0 ) forceU = false;
- if (this.current(forceU) === ch) {
- this.advance(forceU);
- return true
- }
- return false
- };
- function codePointToString(ch) {
- if (ch <= 0xFFFF) { return String.fromCharCode(ch) }
- ch -= 0x10000;
- return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00)
- }
- /**
- * Validate the flags part of a given RegExpLiteral.
- *
- * @param {RegExpValidationState} state The state to validate RegExp.
- * @returns {void}
- */
- pp$8.validateRegExpFlags = function(state) {
- var validFlags = state.validFlags;
- var flags = state.flags;
- for (var i = 0; i < flags.length; i++) {
- var flag = flags.charAt(i);
- if (validFlags.indexOf(flag) === -1) {
- this.raise(state.start, "Invalid regular expression flag");
- }
- if (flags.indexOf(flag, i + 1) > -1) {
- this.raise(state.start, "Duplicate regular expression flag");
- }
- }
- };
- /**
- * Validate the pattern part of a given RegExpLiteral.
- *
- * @param {RegExpValidationState} state The state to validate RegExp.
- * @returns {void}
- */
- pp$8.validateRegExpPattern = function(state) {
- this.regexp_pattern(state);
- // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
- // parsing contains a |GroupName|, reparse with the goal symbol
- // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
- // exception if _P_ did not conform to the grammar, if any elements of _P_
- // were not matched by the parse, or if any Early Error conditions exist.
- if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) {
- state.switchN = true;
- this.regexp_pattern(state);
- }
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
- pp$8.regexp_pattern = function(state) {
- state.pos = 0;
- state.lastIntValue = 0;
- state.lastStringValue = "";
- state.lastAssertionIsQuantifiable = false;
- state.numCapturingParens = 0;
- state.maxBackReference = 0;
- state.groupNames.length = 0;
- state.backReferenceNames.length = 0;
- this.regexp_disjunction(state);
- if (state.pos !== state.source.length) {
- // Make the same messages as V8.
- if (state.eat(0x29 /* ) */)) {
- state.raise("Unmatched ')'");
- }
- if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
- state.raise("Lone quantifier brackets");
- }
- }
- if (state.maxBackReference > state.numCapturingParens) {
- state.raise("Invalid escape");
- }
- for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
- var name = list[i];
- if (state.groupNames.indexOf(name) === -1) {
- state.raise("Invalid named capture referenced");
- }
- }
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
- pp$8.regexp_disjunction = function(state) {
- this.regexp_alternative(state);
- while (state.eat(0x7C /* | */)) {
- this.regexp_alternative(state);
- }
- // Make the same message as V8.
- if (this.regexp_eatQuantifier(state, true)) {
- state.raise("Nothing to repeat");
- }
- if (state.eat(0x7B /* { */)) {
- state.raise("Lone quantifier brackets");
- }
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
- pp$8.regexp_alternative = function(state) {
- while (state.pos < state.source.length && this.regexp_eatTerm(state))
- { }
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
- pp$8.regexp_eatTerm = function(state) {
- if (this.regexp_eatAssertion(state)) {
- // Handle `QuantifiableAssertion Quantifier` alternative.
- // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
- // is a QuantifiableAssertion.
- if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
- // Make the same message as V8.
- if (state.switchU) {
- state.raise("Invalid quantifier");
- }
- }
- return true
- }
- if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
- this.regexp_eatQuantifier(state);
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
- pp$8.regexp_eatAssertion = function(state) {
- var start = state.pos;
- state.lastAssertionIsQuantifiable = false;
- // ^, $
- if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
- return true
- }
- // \b \B
- if (state.eat(0x5C /* \ */)) {
- if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
- return true
- }
- state.pos = start;
- }
- // Lookahead / Lookbehind
- if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
- var lookbehind = false;
- if (this.options.ecmaVersion >= 9) {
- lookbehind = state.eat(0x3C /* < */);
- }
- if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
- this.regexp_disjunction(state);
- if (!state.eat(0x29 /* ) */)) {
- state.raise("Unterminated group");
- }
- state.lastAssertionIsQuantifiable = !lookbehind;
- return true
- }
- }
- state.pos = start;
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
- pp$8.regexp_eatQuantifier = function(state, noError) {
- if ( noError === void 0 ) noError = false;
- if (this.regexp_eatQuantifierPrefix(state, noError)) {
- state.eat(0x3F /* ? */);
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
- pp$8.regexp_eatQuantifierPrefix = function(state, noError) {
- return (
- state.eat(0x2A /* * */) ||
- state.eat(0x2B /* + */) ||
- state.eat(0x3F /* ? */) ||
- this.regexp_eatBracedQuantifier(state, noError)
- )
- };
- pp$8.regexp_eatBracedQuantifier = function(state, noError) {
- var start = state.pos;
- if (state.eat(0x7B /* { */)) {
- var min = 0, max = -1;
- if (this.regexp_eatDecimalDigits(state)) {
- min = state.lastIntValue;
- if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
- max = state.lastIntValue;
- }
- if (state.eat(0x7D /* } */)) {
- // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
- if (max !== -1 && max < min && !noError) {
- state.raise("numbers out of order in {} quantifier");
- }
- return true
- }
- }
- if (state.switchU && !noError) {
- state.raise("Incomplete quantifier");
- }
- state.pos = start;
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
- pp$8.regexp_eatAtom = function(state) {
- return (
- this.regexp_eatPatternCharacters(state) ||
- state.eat(0x2E /* . */) ||
- this.regexp_eatReverseSolidusAtomEscape(state) ||
- this.regexp_eatCharacterClass(state) ||
- this.regexp_eatUncapturingGroup(state) ||
- this.regexp_eatCapturingGroup(state)
- )
- };
- pp$8.regexp_eatReverseSolidusAtomEscape = function(state) {
- var start = state.pos;
- if (state.eat(0x5C /* \ */)) {
- if (this.regexp_eatAtomEscape(state)) {
- return true
- }
- state.pos = start;
- }
- return false
- };
- pp$8.regexp_eatUncapturingGroup = function(state) {
- var start = state.pos;
- if (state.eat(0x28 /* ( */)) {
- if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) {
- this.regexp_disjunction(state);
- if (state.eat(0x29 /* ) */)) {
- return true
- }
- state.raise("Unterminated group");
- }
- state.pos = start;
- }
- return false
- };
- pp$8.regexp_eatCapturingGroup = function(state) {
- if (state.eat(0x28 /* ( */)) {
- if (this.options.ecmaVersion >= 9) {
- this.regexp_groupSpecifier(state);
- } else if (state.current() === 0x3F /* ? */) {
- state.raise("Invalid group");
- }
- this.regexp_disjunction(state);
- if (state.eat(0x29 /* ) */)) {
- state.numCapturingParens += 1;
- return true
- }
- state.raise("Unterminated group");
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
- pp$8.regexp_eatExtendedAtom = function(state) {
- return (
- state.eat(0x2E /* . */) ||
- this.regexp_eatReverseSolidusAtomEscape(state) ||
- this.regexp_eatCharacterClass(state) ||
- this.regexp_eatUncapturingGroup(state) ||
- this.regexp_eatCapturingGroup(state) ||
- this.regexp_eatInvalidBracedQuantifier(state) ||
- this.regexp_eatExtendedPatternCharacter(state)
- )
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
- pp$8.regexp_eatInvalidBracedQuantifier = function(state) {
- if (this.regexp_eatBracedQuantifier(state, true)) {
- state.raise("Nothing to repeat");
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
- pp$8.regexp_eatSyntaxCharacter = function(state) {
- var ch = state.current();
- if (isSyntaxCharacter(ch)) {
- state.lastIntValue = ch;
- state.advance();
- return true
- }
- return false
- };
- function isSyntaxCharacter(ch) {
- return (
- ch === 0x24 /* $ */ ||
- ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
- ch === 0x2E /* . */ ||
- ch === 0x3F /* ? */ ||
- ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
- ch >= 0x7B /* { */ && ch <= 0x7D /* } */
- )
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
- // But eat eager.
- pp$8.regexp_eatPatternCharacters = function(state) {
- var start = state.pos;
- var ch = 0;
- while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
- state.advance();
- }
- return state.pos !== start
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
- pp$8.regexp_eatExtendedPatternCharacter = function(state) {
- var ch = state.current();
- if (
- ch !== -1 &&
- ch !== 0x24 /* $ */ &&
- !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
- ch !== 0x2E /* . */ &&
- ch !== 0x3F /* ? */ &&
- ch !== 0x5B /* [ */ &&
- ch !== 0x5E /* ^ */ &&
- ch !== 0x7C /* | */
- ) {
- state.advance();
- return true
- }
- return false
- };
- // GroupSpecifier ::
- // [empty]
- // `?` GroupName
- pp$8.regexp_groupSpecifier = function(state) {
- if (state.eat(0x3F /* ? */)) {
- if (this.regexp_eatGroupName(state)) {
- if (state.groupNames.indexOf(state.lastStringValue) !== -1) {
- state.raise("Duplicate capture group name");
- }
- state.groupNames.push(state.lastStringValue);
- return
- }
- state.raise("Invalid group");
- }
- };
- // GroupName ::
- // `<` RegExpIdentifierName `>`
- // Note: this updates `state.lastStringValue` property with the eaten name.
- pp$8.regexp_eatGroupName = function(state) {
- state.lastStringValue = "";
- if (state.eat(0x3C /* < */)) {
- if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
- return true
- }
- state.raise("Invalid capture group name");
- }
- return false
- };
- // RegExpIdentifierName ::
- // RegExpIdentifierStart
- // RegExpIdentifierName RegExpIdentifierPart
- // Note: this updates `state.lastStringValue` property with the eaten name.
- pp$8.regexp_eatRegExpIdentifierName = function(state) {
- state.lastStringValue = "";
- if (this.regexp_eatRegExpIdentifierStart(state)) {
- state.lastStringValue += codePointToString(state.lastIntValue);
- while (this.regexp_eatRegExpIdentifierPart(state)) {
- state.lastStringValue += codePointToString(state.lastIntValue);
- }
- return true
- }
- return false
- };
- // RegExpIdentifierStart ::
- // UnicodeIDStart
- // `$`
- // `_`
- // `\` RegExpUnicodeEscapeSequence[+U]
- pp$8.regexp_eatRegExpIdentifierStart = function(state) {
- var start = state.pos;
- var forceU = this.options.ecmaVersion >= 11;
- var ch = state.current(forceU);
- state.advance(forceU);
- if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
- ch = state.lastIntValue;
- }
- if (isRegExpIdentifierStart(ch)) {
- state.lastIntValue = ch;
- return true
- }
- state.pos = start;
- return false
- };
- function isRegExpIdentifierStart(ch) {
- return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
- }
- // RegExpIdentifierPart ::
- // UnicodeIDContinue
- // `$`
- // `_`
- // `\` RegExpUnicodeEscapeSequence[+U]
- // <ZWNJ>
- // <ZWJ>
- pp$8.regexp_eatRegExpIdentifierPart = function(state) {
- var start = state.pos;
- var forceU = this.options.ecmaVersion >= 11;
- var ch = state.current(forceU);
- state.advance(forceU);
- if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
- ch = state.lastIntValue;
- }
- if (isRegExpIdentifierPart(ch)) {
- state.lastIntValue = ch;
- return true
- }
- state.pos = start;
- return false
- };
- function isRegExpIdentifierPart(ch) {
- return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
- pp$8.regexp_eatAtomEscape = function(state) {
- if (
- this.regexp_eatBackReference(state) ||
- this.regexp_eatCharacterClassEscape(state) ||
- this.regexp_eatCharacterEscape(state) ||
- (state.switchN && this.regexp_eatKGroupName(state))
- ) {
- return true
- }
- if (state.switchU) {
- // Make the same message as V8.
- if (state.current() === 0x63 /* c */) {
- state.raise("Invalid unicode escape");
- }
- state.raise("Invalid escape");
- }
- return false
- };
- pp$8.regexp_eatBackReference = function(state) {
- var start = state.pos;
- if (this.regexp_eatDecimalEscape(state)) {
- var n = state.lastIntValue;
- if (state.switchU) {
- // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
- if (n > state.maxBackReference) {
- state.maxBackReference = n;
- }
- return true
- }
- if (n <= state.numCapturingParens) {
- return true
- }
- state.pos = start;
- }
- return false
- };
- pp$8.regexp_eatKGroupName = function(state) {
- if (state.eat(0x6B /* k */)) {
- if (this.regexp_eatGroupName(state)) {
- state.backReferenceNames.push(state.lastStringValue);
- return true
- }
- state.raise("Invalid named reference");
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
- pp$8.regexp_eatCharacterEscape = function(state) {
- return (
- this.regexp_eatControlEscape(state) ||
- this.regexp_eatCControlLetter(state) ||
- this.regexp_eatZero(state) ||
- this.regexp_eatHexEscapeSequence(state) ||
- this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
- (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
- this.regexp_eatIdentityEscape(state)
- )
- };
- pp$8.regexp_eatCControlLetter = function(state) {
- var start = state.pos;
- if (state.eat(0x63 /* c */)) {
- if (this.regexp_eatControlLetter(state)) {
- return true
- }
- state.pos = start;
- }
- return false
- };
- pp$8.regexp_eatZero = function(state) {
- if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
- state.lastIntValue = 0;
- state.advance();
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
- pp$8.regexp_eatControlEscape = function(state) {
- var ch = state.current();
- if (ch === 0x74 /* t */) {
- state.lastIntValue = 0x09; /* \t */
- state.advance();
- return true
- }
- if (ch === 0x6E /* n */) {
- state.lastIntValue = 0x0A; /* \n */
- state.advance();
- return true
- }
- if (ch === 0x76 /* v */) {
- state.lastIntValue = 0x0B; /* \v */
- state.advance();
- return true
- }
- if (ch === 0x66 /* f */) {
- state.lastIntValue = 0x0C; /* \f */
- state.advance();
- return true
- }
- if (ch === 0x72 /* r */) {
- state.lastIntValue = 0x0D; /* \r */
- state.advance();
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
- pp$8.regexp_eatControlLetter = function(state) {
- var ch = state.current();
- if (isControlLetter(ch)) {
- state.lastIntValue = ch % 0x20;
- state.advance();
- return true
- }
- return false
- };
- function isControlLetter(ch) {
- return (
- (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
- (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
- )
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
- pp$8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
- if ( forceU === void 0 ) forceU = false;
- var start = state.pos;
- var switchU = forceU || state.switchU;
- if (state.eat(0x75 /* u */)) {
- if (this.regexp_eatFixedHexDigits(state, 4)) {
- var lead = state.lastIntValue;
- if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
- var leadSurrogateEnd = state.pos;
- if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
- var trail = state.lastIntValue;
- if (trail >= 0xDC00 && trail <= 0xDFFF) {
- state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
- return true
- }
- }
- state.pos = leadSurrogateEnd;
- state.lastIntValue = lead;
- }
- return true
- }
- if (
- switchU &&
- state.eat(0x7B /* { */) &&
- this.regexp_eatHexDigits(state) &&
- state.eat(0x7D /* } */) &&
- isValidUnicode(state.lastIntValue)
- ) {
- return true
- }
- if (switchU) {
- state.raise("Invalid unicode escape");
- }
- state.pos = start;
- }
- return false
- };
- function isValidUnicode(ch) {
- return ch >= 0 && ch <= 0x10FFFF
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
- pp$8.regexp_eatIdentityEscape = function(state) {
- if (state.switchU) {
- if (this.regexp_eatSyntaxCharacter(state)) {
- return true
- }
- if (state.eat(0x2F /* / */)) {
- state.lastIntValue = 0x2F; /* / */
- return true
- }
- return false
- }
- var ch = state.current();
- if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
- state.lastIntValue = ch;
- state.advance();
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
- pp$8.regexp_eatDecimalEscape = function(state) {
- state.lastIntValue = 0;
- var ch = state.current();
- if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
- do {
- state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
- state.advance();
- } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
- pp$8.regexp_eatCharacterClassEscape = function(state) {
- var ch = state.current();
- if (isCharacterClassEscape(ch)) {
- state.lastIntValue = -1;
- state.advance();
- return true
- }
- if (
- state.switchU &&
- this.options.ecmaVersion >= 9 &&
- (ch === 0x50 /* P */ || ch === 0x70 /* p */)
- ) {
- state.lastIntValue = -1;
- state.advance();
- if (
- state.eat(0x7B /* { */) &&
- this.regexp_eatUnicodePropertyValueExpression(state) &&
- state.eat(0x7D /* } */)
- ) {
- return true
- }
- state.raise("Invalid property name");
- }
- return false
- };
- function isCharacterClassEscape(ch) {
- return (
- ch === 0x64 /* d */ ||
- ch === 0x44 /* D */ ||
- ch === 0x73 /* s */ ||
- ch === 0x53 /* S */ ||
- ch === 0x77 /* w */ ||
- ch === 0x57 /* W */
- )
- }
- // UnicodePropertyValueExpression ::
- // UnicodePropertyName `=` UnicodePropertyValue
- // LoneUnicodePropertyNameOrValue
- pp$8.regexp_eatUnicodePropertyValueExpression = function(state) {
- var start = state.pos;
- // UnicodePropertyName `=` UnicodePropertyValue
- if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
- var name = state.lastStringValue;
- if (this.regexp_eatUnicodePropertyValue(state)) {
- var value = state.lastStringValue;
- this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
- return true
- }
- }
- state.pos = start;
- // LoneUnicodePropertyNameOrValue
- if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
- var nameOrValue = state.lastStringValue;
- this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue);
- return true
- }
- return false
- };
- pp$8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
- if (!has(state.unicodeProperties.nonBinary, name))
- { state.raise("Invalid property name"); }
- if (!state.unicodeProperties.nonBinary[name].test(value))
- { state.raise("Invalid property value"); }
- };
- pp$8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
- if (!state.unicodeProperties.binary.test(nameOrValue))
- { state.raise("Invalid property name"); }
- };
- // UnicodePropertyName ::
- // UnicodePropertyNameCharacters
- pp$8.regexp_eatUnicodePropertyName = function(state) {
- var ch = 0;
- state.lastStringValue = "";
- while (isUnicodePropertyNameCharacter(ch = state.current())) {
- state.lastStringValue += codePointToString(ch);
- state.advance();
- }
- return state.lastStringValue !== ""
- };
- function isUnicodePropertyNameCharacter(ch) {
- return isControlLetter(ch) || ch === 0x5F /* _ */
- }
- // UnicodePropertyValue ::
- // UnicodePropertyValueCharacters
- pp$8.regexp_eatUnicodePropertyValue = function(state) {
- var ch = 0;
- state.lastStringValue = "";
- while (isUnicodePropertyValueCharacter(ch = state.current())) {
- state.lastStringValue += codePointToString(ch);
- state.advance();
- }
- return state.lastStringValue !== ""
- };
- function isUnicodePropertyValueCharacter(ch) {
- return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
- }
- // LoneUnicodePropertyNameOrValue ::
- // UnicodePropertyValueCharacters
- pp$8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
- return this.regexp_eatUnicodePropertyValue(state)
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
- pp$8.regexp_eatCharacterClass = function(state) {
- if (state.eat(0x5B /* [ */)) {
- state.eat(0x5E /* ^ */);
- this.regexp_classRanges(state);
- if (state.eat(0x5D /* ] */)) {
- return true
- }
- // Unreachable since it threw "unterminated regular expression" error before.
- state.raise("Unterminated character class");
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
- // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
- // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
- pp$8.regexp_classRanges = function(state) {
- while (this.regexp_eatClassAtom(state)) {
- var left = state.lastIntValue;
- if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
- var right = state.lastIntValue;
- if (state.switchU && (left === -1 || right === -1)) {
- state.raise("Invalid character class");
- }
- if (left !== -1 && right !== -1 && left > right) {
- state.raise("Range out of order in character class");
- }
- }
- }
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
- // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
- pp$8.regexp_eatClassAtom = function(state) {
- var start = state.pos;
- if (state.eat(0x5C /* \ */)) {
- if (this.regexp_eatClassEscape(state)) {
- return true
- }
- if (state.switchU) {
- // Make the same message as V8.
- var ch$1 = state.current();
- if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
- state.raise("Invalid class escape");
- }
- state.raise("Invalid escape");
- }
- state.pos = start;
- }
- var ch = state.current();
- if (ch !== 0x5D /* ] */) {
- state.lastIntValue = ch;
- state.advance();
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
- pp$8.regexp_eatClassEscape = function(state) {
- var start = state.pos;
- if (state.eat(0x62 /* b */)) {
- state.lastIntValue = 0x08; /* <BS> */
- return true
- }
- if (state.switchU && state.eat(0x2D /* - */)) {
- state.lastIntValue = 0x2D; /* - */
- return true
- }
- if (!state.switchU && state.eat(0x63 /* c */)) {
- if (this.regexp_eatClassControlLetter(state)) {
- return true
- }
- state.pos = start;
- }
- return (
- this.regexp_eatCharacterClassEscape(state) ||
- this.regexp_eatCharacterEscape(state)
- )
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
- pp$8.regexp_eatClassControlLetter = function(state) {
- var ch = state.current();
- if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
- state.lastIntValue = ch % 0x20;
- state.advance();
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
- pp$8.regexp_eatHexEscapeSequence = function(state) {
- var start = state.pos;
- if (state.eat(0x78 /* x */)) {
- if (this.regexp_eatFixedHexDigits(state, 2)) {
- return true
- }
- if (state.switchU) {
- state.raise("Invalid escape");
- }
- state.pos = start;
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
- pp$8.regexp_eatDecimalDigits = function(state) {
- var start = state.pos;
- var ch = 0;
- state.lastIntValue = 0;
- while (isDecimalDigit(ch = state.current())) {
- state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
- state.advance();
- }
- return state.pos !== start
- };
- function isDecimalDigit(ch) {
- return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
- pp$8.regexp_eatHexDigits = function(state) {
- var start = state.pos;
- var ch = 0;
- state.lastIntValue = 0;
- while (isHexDigit(ch = state.current())) {
- state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
- state.advance();
- }
- return state.pos !== start
- };
- function isHexDigit(ch) {
- return (
- (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
- (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
- (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
- )
- }
- function hexToInt(ch) {
- if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
- return 10 + (ch - 0x41 /* A */)
- }
- if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
- return 10 + (ch - 0x61 /* a */)
- }
- return ch - 0x30 /* 0 */
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
- // Allows only 0-377(octal) i.e. 0-255(decimal).
- pp$8.regexp_eatLegacyOctalEscapeSequence = function(state) {
- if (this.regexp_eatOctalDigit(state)) {
- var n1 = state.lastIntValue;
- if (this.regexp_eatOctalDigit(state)) {
- var n2 = state.lastIntValue;
- if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
- state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
- } else {
- state.lastIntValue = n1 * 8 + n2;
- }
- } else {
- state.lastIntValue = n1;
- }
- return true
- }
- return false
- };
- // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
- pp$8.regexp_eatOctalDigit = function(state) {
- var ch = state.current();
- if (isOctalDigit(ch)) {
- state.lastIntValue = ch - 0x30; /* 0 */
- state.advance();
- return true
- }
- state.lastIntValue = 0;
- return false
- };
- function isOctalDigit(ch) {
- return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
- }
- // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
- // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
- // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
- pp$8.regexp_eatFixedHexDigits = function(state, length) {
- var start = state.pos;
- state.lastIntValue = 0;
- for (var i = 0; i < length; ++i) {
- var ch = state.current();
- if (!isHexDigit(ch)) {
- state.pos = start;
- return false
- }
- state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
- state.advance();
- }
- return true
- };
- // Object type used to represent tokens. Note that normally, tokens
- // simply exist as properties on the parser object. This is only
- // used for the onToken callback and the external tokenizer.
- var Token = function Token(p) {
- this.type = p.type;
- this.value = p.value;
- this.start = p.start;
- this.end = p.end;
- if (p.options.locations)
- { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
- if (p.options.ranges)
- { this.range = [p.start, p.end]; }
- };
- // ## Tokenizer
- var pp$9 = Parser.prototype;
- // Move to the next token
- pp$9.next = function(ignoreEscapeSequenceInKeyword) {
- if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
- { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
- if (this.options.onToken)
- { this.options.onToken(new Token(this)); }
- this.lastTokEnd = this.end;
- this.lastTokStart = this.start;
- this.lastTokEndLoc = this.endLoc;
- this.lastTokStartLoc = this.startLoc;
- this.nextToken();
- };
- pp$9.getToken = function() {
- this.next();
- return new Token(this)
- };
- // If we're in an ES6 environment, make parsers iterable
- if (typeof Symbol !== "undefined")
- { pp$9[Symbol.iterator] = function() {
- var this$1 = this;
- return {
- next: function () {
- var token = this$1.getToken();
- return {
- done: token.type === types.eof,
- value: token
- }
- }
- }
- }; }
- // Toggle strict mode. Re-reads the next number or string to please
- // pedantic tests (`"use strict"; 010;` should fail).
- pp$9.curContext = function() {
- return this.context[this.context.length - 1]
- };
- // Read a single token, updating the parser object's token-related
- // properties.
- pp$9.nextToken = function() {
- var curContext = this.curContext();
- if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }
- this.start = this.pos;
- if (this.options.locations) { this.startLoc = this.curPosition(); }
- if (this.pos >= this.input.length) { return this.finishToken(types.eof) }
- if (curContext.override) { return curContext.override(this) }
- else { this.readToken(this.fullCharCodeAtPos()); }
- };
- pp$9.readToken = function(code) {
- // Identifier or keyword. '\uXXXX' sequences are allowed in
- // identifiers, so '\' also dispatches to that.
- if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
- { return this.readWord() }
- return this.getTokenFromCode(code)
- };
- pp$9.fullCharCodeAtPos = function() {
- var code = this.input.charCodeAt(this.pos);
- if (code <= 0xd7ff || code >= 0xe000) { return code }
- var next = this.input.charCodeAt(this.pos + 1);
- return (code << 10) + next - 0x35fdc00
- };
- pp$9.skipBlockComment = function() {
- var startLoc = this.options.onComment && this.curPosition();
- var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
- if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
- this.pos = end + 2;
- if (this.options.locations) {
- lineBreakG.lastIndex = start;
- var match;
- while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) {
- ++this.curLine;
- this.lineStart = match.index + match[0].length;
- }
- }
- if (this.options.onComment)
- { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
- startLoc, this.curPosition()); }
- };
- pp$9.skipLineComment = function(startSkip) {
- var start = this.pos;
- var startLoc = this.options.onComment && this.curPosition();
- var ch = this.input.charCodeAt(this.pos += startSkip);
- while (this.pos < this.input.length && !isNewLine(ch)) {
- ch = this.input.charCodeAt(++this.pos);
- }
- if (this.options.onComment)
- { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
- startLoc, this.curPosition()); }
- };
- // Called at the start of the parse and after every token. Skips
- // whitespace and comments, and.
- pp$9.skipSpace = function() {
- loop: while (this.pos < this.input.length) {
- var ch = this.input.charCodeAt(this.pos);
- switch (ch) {
- case 32: case 160: // ' '
- ++this.pos;
- break
- case 13:
- if (this.input.charCodeAt(this.pos + 1) === 10) {
- ++this.pos;
- }
- case 10: case 8232: case 8233:
- ++this.pos;
- if (this.options.locations) {
- ++this.curLine;
- this.lineStart = this.pos;
- }
- break
- case 47: // '/'
- switch (this.input.charCodeAt(this.pos + 1)) {
- case 42: // '*'
- this.skipBlockComment();
- break
- case 47:
- this.skipLineComment(2);
- break
- default:
- break loop
- }
- break
- default:
- if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
- ++this.pos;
- } else {
- break loop
- }
- }
- }
- };
- // Called at the end of every token. Sets `end`, `val`, and
- // maintains `context` and `exprAllowed`, and skips the space after
- // the token, so that the next one's `start` will point at the
- // right position.
- pp$9.finishToken = function(type, val) {
- this.end = this.pos;
- if (this.options.locations) { this.endLoc = this.curPosition(); }
- var prevType = this.type;
- this.type = type;
- this.value = val;
- this.updateContext(prevType);
- };
- // ### Token reading
- // This is the function that is called to fetch the next token. It
- // is somewhat obscure, because it works in character codes rather
- // than characters, and because operator parsing has been inlined
- // into it.
- //
- // All in the name of speed.
- //
- pp$9.readToken_dot = function() {
- var next = this.input.charCodeAt(this.pos + 1);
- if (next >= 48 && next <= 57) { return this.readNumber(true) }
- var next2 = this.input.charCodeAt(this.pos + 2);
- if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
- this.pos += 3;
- return this.finishToken(types.ellipsis)
- } else {
- ++this.pos;
- return this.finishToken(types.dot)
- }
- };
- pp$9.readToken_slash = function() { // '/'
- var next = this.input.charCodeAt(this.pos + 1);
- if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
- if (next === 61) { return this.finishOp(types.assign, 2) }
- return this.finishOp(types.slash, 1)
- };
- pp$9.readToken_mult_modulo_exp = function(code) { // '%*'
- var next = this.input.charCodeAt(this.pos + 1);
- var size = 1;
- var tokentype = code === 42 ? types.star : types.modulo;
- // exponentiation operator ** and **=
- if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
- ++size;
- tokentype = types.starstar;
- next = this.input.charCodeAt(this.pos + 2);
- }
- if (next === 61) { return this.finishOp(types.assign, size + 1) }
- return this.finishOp(tokentype, size)
- };
- pp$9.readToken_pipe_amp = function(code) { // '|&'
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === code) {
- if (this.options.ecmaVersion >= 12) {
- var next2 = this.input.charCodeAt(this.pos + 2);
- if (next2 === 61) { return this.finishOp(types.assign, 3) }
- }
- return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2)
- }
- if (next === 61) { return this.finishOp(types.assign, 2) }
- return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1)
- };
- pp$9.readToken_caret = function() { // '^'
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === 61) { return this.finishOp(types.assign, 2) }
- return this.finishOp(types.bitwiseXOR, 1)
- };
- pp$9.readToken_plus_min = function(code) { // '+-'
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === code) {
- if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
- (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
- // A `-->` line comment
- this.skipLineComment(3);
- this.skipSpace();
- return this.nextToken()
- }
- return this.finishOp(types.incDec, 2)
- }
- if (next === 61) { return this.finishOp(types.assign, 2) }
- return this.finishOp(types.plusMin, 1)
- };
- pp$9.readToken_lt_gt = function(code) { // '<>'
- var next = this.input.charCodeAt(this.pos + 1);
- var size = 1;
- if (next === code) {
- size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
- if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) }
- return this.finishOp(types.bitShift, size)
- }
- if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
- this.input.charCodeAt(this.pos + 3) === 45) {
- // `<!--`, an XML-style comment that should be interpreted as a line comment
- this.skipLineComment(4);
- this.skipSpace();
- return this.nextToken()
- }
- if (next === 61) { size = 2; }
- return this.finishOp(types.relational, size)
- };
- pp$9.readToken_eq_excl = function(code) { // '=!'
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
- if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
- this.pos += 2;
- return this.finishToken(types.arrow)
- }
- return this.finishOp(code === 61 ? types.eq : types.prefix, 1)
- };
- pp$9.readToken_question = function() { // '?'
- var ecmaVersion = this.options.ecmaVersion;
- if (ecmaVersion >= 11) {
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === 46) {
- var next2 = this.input.charCodeAt(this.pos + 2);
- if (next2 < 48 || next2 > 57) { return this.finishOp(types.questionDot, 2) }
- }
- if (next === 63) {
- if (ecmaVersion >= 12) {
- var next2$1 = this.input.charCodeAt(this.pos + 2);
- if (next2$1 === 61) { return this.finishOp(types.assign, 3) }
- }
- return this.finishOp(types.coalesce, 2)
- }
- }
- return this.finishOp(types.question, 1)
- };
- pp$9.getTokenFromCode = function(code) {
- switch (code) {
- // The interpretation of a dot depends on whether it is followed
- // by a digit or another two dots.
- case 46: // '.'
- return this.readToken_dot()
- // Punctuation tokens.
- case 40: ++this.pos; return this.finishToken(types.parenL)
- case 41: ++this.pos; return this.finishToken(types.parenR)
- case 59: ++this.pos; return this.finishToken(types.semi)
- case 44: ++this.pos; return this.finishToken(types.comma)
- case 91: ++this.pos; return this.finishToken(types.bracketL)
- case 93: ++this.pos; return this.finishToken(types.bracketR)
- case 123: ++this.pos; return this.finishToken(types.braceL)
- case 125: ++this.pos; return this.finishToken(types.braceR)
- case 58: ++this.pos; return this.finishToken(types.colon)
- case 96: // '`'
- if (this.options.ecmaVersion < 6) { break }
- ++this.pos;
- return this.finishToken(types.backQuote)
- case 48: // '0'
- var next = this.input.charCodeAt(this.pos + 1);
- if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
- if (this.options.ecmaVersion >= 6) {
- if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
- if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
- }
- // Anything else beginning with a digit is an integer, octal
- // number, or float.
- case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
- return this.readNumber(false)
- // Quotes produce strings.
- case 34: case 39: // '"', "'"
- return this.readString(code)
- // Operators are parsed inline in tiny state machines. '=' (61) is
- // often referred to. `finishOp` simply skips the amount of
- // characters it is given as second argument, and returns a token
- // of the type given by its first argument.
- case 47: // '/'
- return this.readToken_slash()
- case 37: case 42: // '%*'
- return this.readToken_mult_modulo_exp(code)
- case 124: case 38: // '|&'
- return this.readToken_pipe_amp(code)
- case 94: // '^'
- return this.readToken_caret()
- case 43: case 45: // '+-'
- return this.readToken_plus_min(code)
- case 60: case 62: // '<>'
- return this.readToken_lt_gt(code)
- case 61: case 33: // '=!'
- return this.readToken_eq_excl(code)
- case 63: // '?'
- return this.readToken_question()
- case 126: // '~'
- return this.finishOp(types.prefix, 1)
- }
- this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
- };
- pp$9.finishOp = function(type, size) {
- var str = this.input.slice(this.pos, this.pos + size);
- this.pos += size;
- return this.finishToken(type, str)
- };
- pp$9.readRegexp = function() {
- var escaped, inClass, start = this.pos;
- for (;;) {
- if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
- var ch = this.input.charAt(this.pos);
- if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
- if (!escaped) {
- if (ch === "[") { inClass = true; }
- else if (ch === "]" && inClass) { inClass = false; }
- else if (ch === "/" && !inClass) { break }
- escaped = ch === "\\";
- } else { escaped = false; }
- ++this.pos;
- }
- var pattern = this.input.slice(start, this.pos);
- ++this.pos;
- var flagsStart = this.pos;
- var flags = this.readWord1();
- if (this.containsEsc) { this.unexpected(flagsStart); }
- // Validate pattern
- var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
- state.reset(start, pattern, flags);
- this.validateRegExpFlags(state);
- this.validateRegExpPattern(state);
- // Create Literal#value property value.
- var value = null;
- try {
- value = new RegExp(pattern, flags);
- } catch (e) {
- // ESTree requires null if it failed to instantiate RegExp object.
- // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
- }
- return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value})
- };
- // Read an integer in the given radix. Return null if zero digits
- // were read, the integer value otherwise. When `len` is given, this
- // will return `null` unless the integer has exactly `len` digits.
- pp$9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
- // `len` is used for character escape sequences. In that case, disallow separators.
- var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;
- // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
- // and isn't fraction part nor exponent part. In that case, if the first digit
- // is zero then disallow separators.
- var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;
- var start = this.pos, total = 0, lastCode = 0;
- for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
- var code = this.input.charCodeAt(this.pos), val = (void 0);
- if (allowSeparators && code === 95) {
- if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
- if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
- if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
- lastCode = code;
- continue
- }
- if (code >= 97) { val = code - 97 + 10; } // a
- else if (code >= 65) { val = code - 65 + 10; } // A
- else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
- else { val = Infinity; }
- if (val >= radix) { break }
- lastCode = code;
- total = total * radix + val;
- }
- if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
- if (this.pos === start || len != null && this.pos - start !== len) { return null }
- return total
- };
- function stringToNumber(str, isLegacyOctalNumericLiteral) {
- if (isLegacyOctalNumericLiteral) {
- return parseInt(str, 8)
- }
- // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
- return parseFloat(str.replace(/_/g, ""))
- }
- function stringToBigInt(str) {
- if (typeof BigInt !== "function") {
- return null
- }
- // `BigInt(value)` throws syntax error if the string contains numeric separators.
- return BigInt(str.replace(/_/g, ""))
- }
- pp$9.readRadixNumber = function(radix) {
- var start = this.pos;
- this.pos += 2; // 0x
- var val = this.readInt(radix);
- if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
- if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
- val = stringToBigInt(this.input.slice(start, this.pos));
- ++this.pos;
- } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
- return this.finishToken(types.num, val)
- };
- // Read an integer, octal integer, or floating-point number.
- pp$9.readNumber = function(startsWithDot) {
- var start = this.pos;
- if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
- var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
- if (octal && this.strict) { this.raise(start, "Invalid number"); }
- var next = this.input.charCodeAt(this.pos);
- if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
- var val$1 = stringToBigInt(this.input.slice(start, this.pos));
- ++this.pos;
- if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
- return this.finishToken(types.num, val$1)
- }
- if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
- if (next === 46 && !octal) { // '.'
- ++this.pos;
- this.readInt(10);
- next = this.input.charCodeAt(this.pos);
- }
- if ((next === 69 || next === 101) && !octal) { // 'eE'
- next = this.input.charCodeAt(++this.pos);
- if (next === 43 || next === 45) { ++this.pos; } // '+-'
- if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
- }
- if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
- var val = stringToNumber(this.input.slice(start, this.pos), octal);
- return this.finishToken(types.num, val)
- };
- // Read a string value, interpreting backslash-escapes.
- pp$9.readCodePoint = function() {
- var ch = this.input.charCodeAt(this.pos), code;
- if (ch === 123) { // '{'
- if (this.options.ecmaVersion < 6) { this.unexpected(); }
- var codePos = ++this.pos;
- code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
- ++this.pos;
- if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
- } else {
- code = this.readHexChar(4);
- }
- return code
- };
- function codePointToString$1(code) {
- // UTF-16 Decoding
- if (code <= 0xFFFF) { return String.fromCharCode(code) }
- code -= 0x10000;
- return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
- }
- pp$9.readString = function(quote) {
- var out = "", chunkStart = ++this.pos;
- for (;;) {
- if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
- var ch = this.input.charCodeAt(this.pos);
- if (ch === quote) { break }
- if (ch === 92) { // '\'
- out += this.input.slice(chunkStart, this.pos);
- out += this.readEscapedChar(false);
- chunkStart = this.pos;
- } else {
- if (isNewLine(ch, this.options.ecmaVersion >= 10)) { this.raise(this.start, "Unterminated string constant"); }
- ++this.pos;
- }
- }
- out += this.input.slice(chunkStart, this.pos++);
- return this.finishToken(types.string, out)
- };
- // Reads template string tokens.
- var INVALID_TEMPLATE_ESCAPE_ERROR = {};
- pp$9.tryReadTemplateToken = function() {
- this.inTemplateElement = true;
- try {
- this.readTmplToken();
- } catch (err) {
- if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
- this.readInvalidTemplateToken();
- } else {
- throw err
- }
- }
- this.inTemplateElement = false;
- };
- pp$9.invalidStringToken = function(position, message) {
- if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
- throw INVALID_TEMPLATE_ESCAPE_ERROR
- } else {
- this.raise(position, message);
- }
- };
- pp$9.readTmplToken = function() {
- var out = "", chunkStart = this.pos;
- for (;;) {
- if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
- var ch = this.input.charCodeAt(this.pos);
- if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
- if (this.pos === this.start && (this.type === types.template || this.type === types.invalidTemplate)) {
- if (ch === 36) {
- this.pos += 2;
- return this.finishToken(types.dollarBraceL)
- } else {
- ++this.pos;
- return this.finishToken(types.backQuote)
- }
- }
- out += this.input.slice(chunkStart, this.pos);
- return this.finishToken(types.template, out)
- }
- if (ch === 92) { // '\'
- out += this.input.slice(chunkStart, this.pos);
- out += this.readEscapedChar(true);
- chunkStart = this.pos;
- } else if (isNewLine(ch)) {
- out += this.input.slice(chunkStart, this.pos);
- ++this.pos;
- switch (ch) {
- case 13:
- if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
- case 10:
- out += "\n";
- break
- default:
- out += String.fromCharCode(ch);
- break
- }
- if (this.options.locations) {
- ++this.curLine;
- this.lineStart = this.pos;
- }
- chunkStart = this.pos;
- } else {
- ++this.pos;
- }
- }
- };
- // Reads a template token to search for the end, without validating any escape sequences
- pp$9.readInvalidTemplateToken = function() {
- for (; this.pos < this.input.length; this.pos++) {
- switch (this.input[this.pos]) {
- case "\\":
- ++this.pos;
- break
- case "$":
- if (this.input[this.pos + 1] !== "{") {
- break
- }
- // falls through
- case "`":
- return this.finishToken(types.invalidTemplate, this.input.slice(this.start, this.pos))
- // no default
- }
- }
- this.raise(this.start, "Unterminated template");
- };
- // Used to read escaped characters
- pp$9.readEscapedChar = function(inTemplate) {
- var ch = this.input.charCodeAt(++this.pos);
- ++this.pos;
- switch (ch) {
- case 110: return "\n" // 'n' -> '\n'
- case 114: return "\r" // 'r' -> '\r'
- case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
- case 117: return codePointToString$1(this.readCodePoint()) // 'u'
- case 116: return "\t" // 't' -> '\t'
- case 98: return "\b" // 'b' -> '\b'
- case 118: return "\u000b" // 'v' -> '\u000b'
- case 102: return "\f" // 'f' -> '\f'
- case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
- case 10: // ' \n'
- if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
- return ""
- case 56:
- case 57:
- if (this.strict) {
- this.invalidStringToken(
- this.pos - 1,
- "Invalid escape sequence"
- );
- }
- if (inTemplate) {
- var codePos = this.pos - 1;
- this.invalidStringToken(
- codePos,
- "Invalid escape sequence in template string"
- );
- return null
- }
- default:
- if (ch >= 48 && ch <= 55) {
- var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
- var octal = parseInt(octalStr, 8);
- if (octal > 255) {
- octalStr = octalStr.slice(0, -1);
- octal = parseInt(octalStr, 8);
- }
- this.pos += octalStr.length - 1;
- ch = this.input.charCodeAt(this.pos);
- if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
- this.invalidStringToken(
- this.pos - 1 - octalStr.length,
- inTemplate
- ? "Octal literal in template string"
- : "Octal literal in strict mode"
- );
- }
- return String.fromCharCode(octal)
- }
- if (isNewLine(ch)) {
- // Unicode new line characters after \ get removed from output in both
- // template literals and strings
- return ""
- }
- return String.fromCharCode(ch)
- }
- };
- // Used to read character escape sequences ('\x', '\u', '\U').
- pp$9.readHexChar = function(len) {
- var codePos = this.pos;
- var n = this.readInt(16, len);
- if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
- return n
- };
- // Read an identifier, and return it as a string. Sets `this.containsEsc`
- // to whether the word contained a '\u' escape.
- //
- // Incrementally adds only escaped chars, adding other chunks as-is
- // as a micro-optimization.
- pp$9.readWord1 = function() {
- this.containsEsc = false;
- var word = "", first = true, chunkStart = this.pos;
- var astral = this.options.ecmaVersion >= 6;
- while (this.pos < this.input.length) {
- var ch = this.fullCharCodeAtPos();
- if (isIdentifierChar(ch, astral)) {
- this.pos += ch <= 0xffff ? 1 : 2;
- } else if (ch === 92) { // "\"
- this.containsEsc = true;
- word += this.input.slice(chunkStart, this.pos);
- var escStart = this.pos;
- if (this.input.charCodeAt(++this.pos) !== 117) // "u"
- { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
- ++this.pos;
- var esc = this.readCodePoint();
- if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
- { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
- word += codePointToString$1(esc);
- chunkStart = this.pos;
- } else {
- break
- }
- first = false;
- }
- return word + this.input.slice(chunkStart, this.pos)
- };
- // Read an identifier or keyword token. Will check for reserved
- // words when necessary.
- pp$9.readWord = function() {
- var word = this.readWord1();
- var type = types.name;
- if (this.keywords.test(word)) {
- type = keywords$1[word];
- }
- return this.finishToken(type, word)
- };
- // Acorn is a tiny, fast JavaScript parser written in JavaScript.
- var version$2 = "8.0.5";
- Parser.acorn = {
- Parser: Parser,
- version: version$2,
- defaultOptions: defaultOptions,
- Position: Position,
- SourceLocation: SourceLocation,
- getLineInfo: getLineInfo,
- Node: Node,
- TokenType: TokenType,
- tokTypes: types,
- keywordTypes: keywords$1,
- TokContext: TokContext,
- tokContexts: types$1,
- isIdentifierChar: isIdentifierChar,
- isIdentifierStart: isIdentifierStart,
- Token: Token,
- isNewLine: isNewLine,
- lineBreak: lineBreak,
- lineBreakG: lineBreakG,
- nonASCIIwhitespace: nonASCIIwhitespace
- };
- // The main exported interface (under `self.acorn` when in the
- // browser) is a `parse` function that takes a code string and
- // returns an abstract syntax tree as specified by [Mozilla parser
- // API][api].
- //
- // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
- function parse$2(input, options) {
- return Parser.parse(input, options)
- }
- // This function tries to parse a single expression at a given
- // offset in a string. Useful for parsing mixed-language formats
- // that embed JavaScript expressions.
- function parseExpressionAt(input, pos, options) {
- return Parser.parseExpressionAt(input, pos, options)
- }
- // Acorn is organized as a tokenizer and a recursive-descent parser.
- // The `tokenizer` export provides an interface to the tokenizer.
- function tokenizer(input, options) {
- return Parser.tokenizer(input, options)
- }
- var acorn = {
- __proto__: null,
- Node: Node,
- Parser: Parser,
- Position: Position,
- SourceLocation: SourceLocation,
- TokContext: TokContext,
- Token: Token,
- TokenType: TokenType,
- defaultOptions: defaultOptions,
- getLineInfo: getLineInfo,
- isIdentifierChar: isIdentifierChar,
- isIdentifierStart: isIdentifierStart,
- isNewLine: isNewLine,
- keywordTypes: keywords$1,
- lineBreak: lineBreak,
- lineBreakG: lineBreakG,
- nonASCIIwhitespace: nonASCIIwhitespace,
- parse: parse$2,
- parseExpressionAt: parseExpressionAt,
- tokContexts: types$1,
- tokTypes: types,
- tokenizer: tokenizer,
- version: version$2
- };
- class GlobalScope extends Scope$1$1 {
- constructor() {
- super();
- this.variables.set('undefined', new UndefinedVariable());
- }
- findVariable(name) {
- let variable = this.variables.get(name);
- if (!variable) {
- variable = new GlobalVariable(name);
- this.variables.set(name, variable);
- }
- return variable;
- }
- }
- const readFile$1 = (file) => new Promise((fulfil, reject) => readFile$2(file, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents))));
- function mkdirpath(path) {
- const dir = dirname(path);
- try {
- readdirSync(dir);
- }
- catch (err) {
- mkdirpath(dir);
- try {
- mkdirSync(dir);
- }
- catch (err2) {
- if (err2.code !== 'EEXIST') {
- throw err2;
- }
- }
- }
- }
- function writeFile(dest, data) {
- return new Promise((fulfil, reject) => {
- mkdirpath(dest);
- writeFile$1(dest, data, err => {
- if (err) {
- reject(err);
- }
- else {
- fulfil();
- }
- });
- });
- }
- function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
- let skipped = null;
- let replaceContext = null;
- if (skip) {
- skipped = new Set();
- for (const skippedCall of skip) {
- if (source === skippedCall.source && importer === skippedCall.importer) {
- skipped.add(skippedCall.plugin);
- }
- }
- replaceContext = (pluginContext, plugin) => ({
- ...pluginContext,
- resolve: (source, importer, { custom, skipSelf } = BLANK) => {
- return moduleLoaderResolveId(source, importer, custom, skipSelf ? [...skip, { importer, plugin, source }] : skip);
- }
- });
- }
- return pluginDriver.hookFirst('resolveId', [source, importer, { custom: customOptions }], replaceContext, skipped);
- }
- async function resolveId$1(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions) {
- const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions);
- if (pluginResult != null)
- return pluginResult;
- // external modules (non-entry modules that start with neither '.' or '/')
- // are skipped at this stage.
- if (importer !== undefined && !isAbsolute(source) && source[0] !== '.')
- return null;
- // `resolve` processes paths from right to left, prepending them until an
- // absolute path is created. Absolute importees therefore shortcircuit the
- // resolve call and require no special handing on our part.
- // See https://nodejs.org/api/path.html#path_path_resolve_paths
- return addJsExtensionIfNecessary(importer ? resolve$1(dirname(importer), source) : resolve$1(source), preserveSymlinks);
- }
- function addJsExtensionIfNecessary(file, preserveSymlinks) {
- let found = findFile(file, preserveSymlinks);
- if (found)
- return found;
- found = findFile(file + '.mjs', preserveSymlinks);
- if (found)
- return found;
- found = findFile(file + '.js', preserveSymlinks);
- return found;
- }
- function findFile(file, preserveSymlinks) {
- try {
- const stats = lstatSync(file);
- if (!preserveSymlinks && stats.isSymbolicLink())
- return findFile(realpathSync$2(file), preserveSymlinks);
- if ((preserveSymlinks && stats.isSymbolicLink()) || stats.isFile()) {
- // check case
- const name = basename(file);
- const files = readdirSync(dirname(file));
- if (files.indexOf(name) !== -1)
- return file;
- }
- }
- catch (_a) {
- // suppress
- }
- }
- const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
- const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
- function throwPluginError(err, plugin, { hook, id } = {}) {
- if (typeof err === 'string')
- err = { message: err };
- if (err.code && err.code !== Errors.PLUGIN_ERROR) {
- err.pluginCode = err.code;
- }
- err.code = Errors.PLUGIN_ERROR;
- err.plugin = plugin;
- if (hook) {
- err.hook = hook;
- }
- if (id) {
- err.id = id;
- }
- return error(err);
- }
- const deprecatedHooks = [
- { active: true, deprecated: 'resolveAssetUrl', replacement: 'resolveFileUrl' }
- ];
- function warnDeprecatedHooks(plugins, options) {
- for (const { active, deprecated, replacement } of deprecatedHooks) {
- for (const plugin of plugins) {
- if (deprecated in plugin) {
- warnDeprecation({
- message: `The "${deprecated}" hook used by plugin ${plugin.name} is deprecated. The "${replacement}" hook should be used instead.`,
- plugin: plugin.name
- }, active, options);
- }
- }
- }
- }
- function createPluginCache(cache) {
- return {
- has(id) {
- const item = cache[id];
- if (!item)
- return false;
- item[0] = 0;
- return true;
- },
- get(id) {
- const item = cache[id];
- if (!item)
- return undefined;
- item[0] = 0;
- return item[1];
- },
- set(id, value) {
- cache[id] = [0, value];
- },
- delete(id) {
- return delete cache[id];
- }
- };
- }
- function getTrackedPluginCache(pluginCache, onUse) {
- return {
- has(id) {
- onUse();
- return pluginCache.has(id);
- },
- get(id) {
- onUse();
- return pluginCache.get(id);
- },
- set(id, value) {
- onUse();
- return pluginCache.set(id, value);
- },
- delete(id) {
- onUse();
- return pluginCache.delete(id);
- }
- };
- }
- const NO_CACHE = {
- has() {
- return false;
- },
- get() {
- return undefined;
- },
- set() { },
- delete() {
- return false;
- }
- };
- function uncacheablePluginError(pluginName) {
- if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
- pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
- return error({
- code: 'ANONYMOUS_PLUGIN_CACHE',
- message: 'A plugin is trying to use the Rollup cache but is not declaring a plugin name or cacheKey.'
- });
- }
- return error({
- code: 'DUPLICATE_PLUGIN_NAME',
- message: `The plugin name ${pluginName} is being used twice in the same build. Plugin names must be distinct or provide a cacheKey (please post an issue to the plugin if you are a plugin user).`
- });
- }
- function getCacheForUncacheablePlugin(pluginName) {
- return {
- has() {
- return uncacheablePluginError(pluginName);
- },
- get() {
- return uncacheablePluginError(pluginName);
- },
- set() {
- return uncacheablePluginError(pluginName);
- },
- delete() {
- return uncacheablePluginError(pluginName);
- }
- };
- }
- function transform(source, module, pluginDriver, warn) {
- const id = module.id;
- const sourcemapChain = [];
- let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
- const originalCode = source.code;
- let ast = source.ast;
- const transformDependencies = [];
- const emittedFiles = [];
- let customTransformCache = false;
- const useCustomTransformCache = () => (customTransformCache = true);
- let curPlugin;
- const curSource = source.code;
- function transformReducer(previousCode, result, plugin) {
- let code;
- let map;
- if (typeof result === 'string') {
- code = result;
- }
- else if (result && typeof result === 'object') {
- module.updateOptions(result);
- if (result.code == null) {
- if (result.map || result.ast) {
- warn(errNoTransformMapOrAstWithoutCode(plugin.name));
- }
- return previousCode;
- }
- ({ code, map, ast } = result);
- }
- else {
- return previousCode;
- }
- // strict null check allows 'null' maps to not be pushed to the chain,
- // while 'undefined' gets the missing map warning
- if (map !== null) {
- sourcemapChain.push(decodedSourcemap(typeof map === 'string' ? JSON.parse(map) : map) || {
- missing: true,
- plugin: plugin.name
- });
- }
- return code;
- }
- return pluginDriver
- .hookReduceArg0('transform', [curSource, id], transformReducer, (pluginContext, plugin) => {
- curPlugin = plugin;
- return {
- ...pluginContext,
- cache: customTransformCache
- ? pluginContext.cache
- : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache),
- warn(warning, pos) {
- if (typeof warning === 'string')
- warning = { message: warning };
- if (pos)
- augmentCodeLocation(warning, pos, curSource, id);
- warning.id = id;
- warning.hook = 'transform';
- pluginContext.warn(warning);
- },
- error(err, pos) {
- if (typeof err === 'string')
- err = { message: err };
- if (pos)
- augmentCodeLocation(err, pos, curSource, id);
- err.id = id;
- err.hook = 'transform';
- return pluginContext.error(err);
- },
- emitAsset(name, source) {
- emittedFiles.push({ type: 'asset', name, source });
- return pluginContext.emitAsset(name, source);
- },
- emitChunk(id, options) {
- emittedFiles.push({ type: 'chunk', id, name: options && options.name });
- return pluginContext.emitChunk(id, options);
- },
- emitFile(emittedFile) {
- emittedFiles.push(emittedFile);
- return pluginDriver.emitFile(emittedFile);
- },
- addWatchFile(id) {
- transformDependencies.push(id);
- pluginContext.addWatchFile(id);
- },
- setAssetSource() {
- return this.error({
- code: 'INVALID_SETASSETSOURCE',
- message: `setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.`
- });
- },
- getCombinedSourcemap() {
- const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, warn);
- if (!combinedMap) {
- const magicString = new MagicString$1(originalCode);
- return magicString.generateMap({ includeContent: true, hires: true, source: id });
- }
- if (originalSourcemap !== combinedMap) {
- originalSourcemap = combinedMap;
- sourcemapChain.length = 0;
- }
- return new SourceMap$1({
- ...combinedMap,
- file: null,
- sourcesContent: combinedMap.sourcesContent
- });
- }
- };
- })
- .catch(err => throwPluginError(err, curPlugin.name, { hook: 'transform', id }))
- .then(code => {
- if (!customTransformCache) {
- // files emitted by a transform hook need to be emitted again if the hook is skipped
- if (emittedFiles.length)
- module.transformFiles = emittedFiles;
- }
- return {
- ast,
- code,
- customTransformCache,
- meta: module.info.meta,
- originalCode,
- originalSourcemap,
- sourcemapChain,
- transformDependencies
- };
- });
- }
- class ModuleLoader {
- constructor(graph, modulesById, options, pluginDriver) {
- this.graph = graph;
- this.modulesById = modulesById;
- this.options = options;
- this.pluginDriver = pluginDriver;
- this.implicitEntryModules = new Set();
- this.indexedEntryModules = [];
- this.latestLoadModulesPromise = Promise.resolve();
- this.nextEntryModuleIndex = 0;
- this.resolveId = async (source, importer, customOptions, skip = null) => {
- return this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
- ? false
- : await resolveId$1(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions), importer, source));
- };
- this.hasModuleSideEffects = options.treeshake
- ? options.treeshake.moduleSideEffects
- : () => true;
- }
- async addAdditionalModules(unresolvedModules) {
- const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
- await this.awaitLoadModulesPromise();
- return result;
- }
- async addEntryModules(unresolvedEntryModules, isUserDefined) {
- const firstEntryModuleIndex = this.nextEntryModuleIndex;
- this.nextEntryModuleIndex += unresolvedEntryModules.length;
- const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => {
- let moduleIndex = firstEntryModuleIndex;
- for (let index = 0; index < entryModules.length; index++) {
- const entryModule = entryModules[index];
- entryModule.isUserDefinedEntryPoint =
- entryModule.isUserDefinedEntryPoint || isUserDefined;
- addChunkNamesToModule(entryModule, unresolvedEntryModules[index], isUserDefined);
- const existingIndexedModule = this.indexedEntryModules.find(indexedModule => indexedModule.module === entryModule);
- if (!existingIndexedModule) {
- this.indexedEntryModules.push({ module: entryModule, index: moduleIndex });
- }
- else {
- existingIndexedModule.index = Math.min(existingIndexedModule.index, moduleIndex);
- }
- moduleIndex++;
- }
- this.indexedEntryModules.sort(({ index: indexA }, { index: indexB }) => indexA > indexB ? 1 : -1);
- return entryModules;
- }));
- await this.awaitLoadModulesPromise();
- return {
- entryModules: this.indexedEntryModules.map(({ module }) => module),
- implicitEntryModules: [...this.implicitEntryModules],
- newEntryModules
- };
- }
- async emitChunk({ fileName, id, importer, name, implicitlyLoadedAfterOneOf, preserveSignature }) {
- const unresolvedModule = {
- fileName: fileName || null,
- id,
- importer,
- name: name || null
- };
- const module = implicitlyLoadedAfterOneOf
- ? await this.addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfterOneOf)
- : (await this.addEntryModules([unresolvedModule], false)).newEntryModules[0];
- if (preserveSignature != null) {
- module.preserveSignature = preserveSignature;
- }
- return module;
- }
- addDefaultsToResolvedId(resolvedId) {
- var _a, _b;
- if (!resolvedId) {
- return null;
- }
- const external = resolvedId.external || false;
- return {
- external,
- id: resolvedId.id,
- meta: resolvedId.meta || EMPTY_OBJECT,
- moduleSideEffects: (_a = resolvedId.moduleSideEffects) !== null && _a !== void 0 ? _a : this.hasModuleSideEffects(resolvedId.id, external),
- syntheticNamedExports: (_b = resolvedId.syntheticNamedExports) !== null && _b !== void 0 ? _b : false
- };
- }
- addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
- return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
- addChunkNamesToModule(entryModule, unresolvedModule, false);
- if (!entryModule.info.isEntry) {
- this.implicitEntryModules.add(entryModule);
- const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id)));
- for (const module of implicitlyLoadedAfterModules) {
- entryModule.implicitlyLoadedAfter.add(module);
- }
- for (const dependant of entryModule.implicitlyLoadedAfter) {
- dependant.implicitlyLoadedBefore.add(entryModule);
- }
- }
- return entryModule;
- }));
- }
- async addModuleSource(id, importer, module) {
- var _a;
- timeStart('load modules', 3);
- let source;
- try {
- source = (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await readFile$1(id));
- }
- catch (err) {
- timeEnd('load modules', 3);
- let msg = `Could not load ${id}`;
- if (importer)
- msg += ` (imported by ${relativeId(importer)})`;
- msg += `: ${err.message}`;
- err.message = msg;
- throw err;
- }
- timeEnd('load modules', 3);
- const sourceDescription = typeof source === 'string'
- ? { code: source }
- : typeof source === 'object' && typeof source.code === 'string'
- ? source
- : error(errBadLoader(id));
- const cachedModule = this.graph.cachedModules.get(id);
- if (cachedModule &&
- !cachedModule.customTransformCache &&
- cachedModule.originalCode === sourceDescription.code) {
- if (cachedModule.transformFiles) {
- for (const emittedFile of cachedModule.transformFiles)
- this.pluginDriver.emitFile(emittedFile);
- }
- module.setSource(cachedModule);
- }
- else {
- module.updateOptions(sourceDescription);
- module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options.onwarn));
- }
- }
- async awaitLoadModulesPromise() {
- let startingPromise;
- do {
- startingPromise = this.latestLoadModulesPromise;
- await startingPromise;
- } while (startingPromise !== this.latestLoadModulesPromise);
- }
- extendLoadModulesPromise(loadNewModulesPromise) {
- this.latestLoadModulesPromise = Promise.all([
- loadNewModulesPromise,
- this.latestLoadModulesPromise
- ]);
- this.latestLoadModulesPromise.catch(() => {
- /* Avoid unhandled Promise rejections */
- });
- return loadNewModulesPromise;
- }
- async fetchDynamicDependencies(module) {
- const dependencies = await Promise.all(module.dynamicImports.map(async (dynamicImport) => {
- const resolvedId = await this.resolveDynamicImport(module, typeof dynamicImport.argument === 'string'
- ? dynamicImport.argument
- : dynamicImport.argument.esTreeNode, module.id);
- if (resolvedId === null)
- return null;
- if (typeof resolvedId === 'string') {
- dynamicImport.resolution = resolvedId;
- return null;
- }
- return (dynamicImport.resolution = await this.fetchResolvedDependency(relativeId(resolvedId.id), module.id, resolvedId));
- }));
- for (const dependency of dependencies) {
- if (dependency) {
- module.dynamicDependencies.add(dependency);
- dependency.dynamicImporters.push(module.id);
- }
- }
- }
- async fetchModule({ id, meta, moduleSideEffects, syntheticNamedExports }, importer, isEntry) {
- const existingModule = this.modulesById.get(id);
- if (existingModule instanceof Module$1) {
- if (isEntry) {
- existingModule.info.isEntry = true;
- this.implicitEntryModules.delete(existingModule);
- for (const dependant of existingModule.implicitlyLoadedAfter) {
- dependant.implicitlyLoadedBefore.delete(existingModule);
- }
- existingModule.implicitlyLoadedAfter.clear();
- }
- return existingModule;
- }
- const module = new Module$1(this.graph, id, this.options, isEntry, moduleSideEffects, syntheticNamedExports, meta);
- this.modulesById.set(id, module);
- this.graph.watchFiles[id] = true;
- await this.addModuleSource(id, importer, module);
- await this.pluginDriver.hookParallel('moduleParsed', [module.info]);
- await Promise.all([
- this.fetchStaticDependencies(module),
- this.fetchDynamicDependencies(module)
- ]);
- module.linkImports();
- return module;
- }
- fetchResolvedDependency(source, importer, resolvedId) {
- if (resolvedId.external) {
- if (!this.modulesById.has(resolvedId.id)) {
- this.modulesById.set(resolvedId.id, new ExternalModule(this.options, resolvedId.id, resolvedId.moduleSideEffects, resolvedId.meta));
- }
- const externalModule = this.modulesById.get(resolvedId.id);
- if (!(externalModule instanceof ExternalModule)) {
- return error(errInternalIdCannotBeExternal(source, importer));
- }
- return Promise.resolve(externalModule);
- }
- else {
- return this.fetchModule(resolvedId, importer, false);
- }
- }
- async fetchStaticDependencies(module) {
- for (const dependency of await Promise.all(Array.from(module.sources, async (source) => this.fetchResolvedDependency(source, module.id, (module.resolvedIds[source] =
- module.resolvedIds[source] ||
- this.handleResolveId(await this.resolveId(source, module.id, EMPTY_OBJECT), source, module.id)))))) {
- module.dependencies.add(dependency);
- dependency.importers.push(module.id);
- }
- }
- getNormalizedResolvedIdWithoutDefaults(resolveIdResult, importer, source) {
- if (resolveIdResult) {
- if (typeof resolveIdResult === 'object') {
- return {
- ...resolveIdResult,
- external: resolveIdResult.external || this.options.external(resolveIdResult.id, importer, true)
- };
- }
- const external = this.options.external(resolveIdResult, importer, true);
- return {
- external,
- id: external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult
- };
- }
- const id = normalizeRelativeExternalId(source, importer);
- if (resolveIdResult !== false && !this.options.external(id, importer, true)) {
- return null;
- }
- return {
- external: true,
- id
- };
- }
- handleResolveId(resolvedId, source, importer) {
- if (resolvedId === null) {
- if (isRelative(source)) {
- return error(errUnresolvedImport(source, importer));
- }
- this.options.onwarn(errUnresolvedImportTreatedAsExternal(source, importer));
- return {
- external: true,
- id: source,
- meta: EMPTY_OBJECT,
- moduleSideEffects: this.hasModuleSideEffects(source, true),
- syntheticNamedExports: false
- };
- }
- else {
- if (resolvedId.external && resolvedId.syntheticNamedExports) {
- this.options.onwarn(errExternalSyntheticExports(source, importer));
- }
- }
- return resolvedId;
- }
- async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore) {
- const resolveIdResult = await resolveId$1(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT);
- if (resolveIdResult == null) {
- return error(implicitlyLoadedBefore === null
- ? errUnresolvedEntry(unresolvedId)
- : errUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore));
- }
- if (resolveIdResult === false ||
- (typeof resolveIdResult === 'object' && resolveIdResult.external)) {
- return error(implicitlyLoadedBefore === null
- ? errEntryCannotBeExternal(unresolvedId)
- : errImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore));
- }
- return this.fetchModule(this.addDefaultsToResolvedId(typeof resolveIdResult === 'object' ? resolveIdResult : { id: resolveIdResult }), undefined, isEntry);
- }
- async resolveDynamicImport(module, specifier, importer) {
- const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [
- specifier,
- importer
- ]);
- if (typeof specifier !== 'string') {
- if (typeof resolution === 'string') {
- return resolution;
- }
- if (!resolution) {
- return null;
- }
- return {
- external: false,
- moduleSideEffects: true,
- ...resolution
- };
- }
- if (resolution == null) {
- return (module.resolvedIds[specifier] =
- module.resolvedIds[specifier] ||
- this.handleResolveId(await this.resolveId(specifier, module.id, EMPTY_OBJECT), specifier, module.id));
- }
- return this.handleResolveId(this.addDefaultsToResolvedId(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier)), specifier, importer);
- }
- }
- function normalizeRelativeExternalId(source, importer) {
- return isRelative(source)
- ? importer
- ? resolve$1(importer, '..', source)
- : resolve$1(source)
- : source;
- }
- function addChunkNamesToModule(module, { fileName, name }, isUserDefined) {
- if (fileName !== null) {
- module.chunkFileNames.add(fileName);
- }
- else if (name !== null) {
- if (module.chunkName === null) {
- module.chunkName = name;
- }
- if (isUserDefined) {
- module.userChunkNames.add(name);
- }
- }
- }
- function getDeprecatedContextHandler(handler, handlerName, newHandlerName, pluginName, activeDeprecation, options) {
- let deprecationWarningShown = false;
- return ((...args) => {
- if (!deprecationWarningShown) {
- deprecationWarningShown = true;
- warnDeprecation({
- message: `The "this.${handlerName}" plugin context function used by plugin ${pluginName} is deprecated. The "this.${newHandlerName}" plugin context function should be used instead.`,
- plugin: pluginName
- }, activeDeprecation, options);
- }
- return handler(...args);
- });
- }
- function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, existingPluginNames) {
- let cacheable = true;
- if (typeof plugin.cacheKey !== 'string') {
- if (plugin.name.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
- plugin.name.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX) ||
- existingPluginNames.has(plugin.name)) {
- cacheable = false;
- }
- else {
- existingPluginNames.add(plugin.name);
- }
- }
- let cacheInstance;
- if (!pluginCache) {
- cacheInstance = NO_CACHE;
- }
- else if (cacheable) {
- const cacheKey = plugin.cacheKey || plugin.name;
- cacheInstance = createPluginCache(pluginCache[cacheKey] || (pluginCache[cacheKey] = Object.create(null)));
- }
- else {
- cacheInstance = getCacheForUncacheablePlugin(plugin.name);
- }
- const context = {
- addWatchFile(id) {
- if (graph.phase >= BuildPhase.GENERATE) {
- return this.error(errInvalidRollupPhaseForAddWatchFile());
- }
- graph.watchFiles[id] = true;
- },
- cache: cacheInstance,
- emitAsset: getDeprecatedContextHandler((name, source) => fileEmitter.emitFile({ type: 'asset', name, source }), 'emitAsset', 'emitFile', plugin.name, true, options),
- emitChunk: getDeprecatedContextHandler((id, options) => fileEmitter.emitFile({ type: 'chunk', id, name: options && options.name }), 'emitChunk', 'emitFile', plugin.name, true, options),
- emitFile: fileEmitter.emitFile,
- error(err) {
- return throwPluginError(err, plugin.name);
- },
- getAssetFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getAssetFileName', 'getFileName', plugin.name, true, options),
- getChunkFileName: getDeprecatedContextHandler(fileEmitter.getFileName, 'getChunkFileName', 'getFileName', plugin.name, true, options),
- getFileName: fileEmitter.getFileName,
- getModuleIds: () => graph.modulesById.keys(),
- getModuleInfo: graph.getModuleInfo,
- getWatchFiles: () => Object.keys(graph.watchFiles),
- isExternal: getDeprecatedContextHandler((id, parentId, isResolved = false) => options.external(id, parentId, isResolved), 'isExternal', 'resolve', plugin.name, true, options),
- meta: {
- rollupVersion: version$1,
- watchMode: graph.watchMode
- },
- get moduleIds() {
- function* wrappedModuleIds() {
- warnDeprecation({
- message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,
- plugin: plugin.name
- }, false, options);
- yield* moduleIds;
- }
- const moduleIds = graph.modulesById.keys();
- return wrappedModuleIds();
- },
- parse: graph.contextParse.bind(graph),
- resolve(source, importer, { custom, skipSelf } = BLANK) {
- return graph.moduleLoader.resolveId(source, importer, custom, skipSelf ? [{ importer, plugin, source }] : null);
- },
- resolveId: getDeprecatedContextHandler((source, importer) => graph.moduleLoader
- .resolveId(source, importer, BLANK)
- .then(resolveId => resolveId && resolveId.id), 'resolveId', 'resolve', plugin.name, true, options),
- setAssetSource: fileEmitter.setAssetSource,
- warn(warning) {
- if (typeof warning === 'string')
- warning = { message: warning };
- if (warning.code)
- warning.pluginCode = warning.code;
- warning.code = 'PLUGIN_WARNING';
- warning.plugin = plugin.name;
- options.onwarn(warning);
- }
- };
- return context;
- }
- const inputHookNames = {
- buildEnd: 1,
- buildStart: 1,
- closeBundle: 1,
- closeWatcher: 1,
- load: 1,
- moduleParsed: 1,
- options: 1,
- resolveDynamicImport: 1,
- resolveId: 1,
- transform: 1,
- watchChange: 1
- };
- const inputHooks = Object.keys(inputHookNames);
- function throwInvalidHookError(hookName, pluginName) {
- return error({
- code: 'INVALID_PLUGIN_HOOK',
- message: `Error running plugin hook ${hookName} for ${pluginName}, expected a function hook.`
- });
- }
- class PluginDriver {
- constructor(graph, options, userPlugins, pluginCache, basePluginDriver) {
- this.graph = graph;
- this.options = options;
- this.pluginContexts = new Map();
- warnDeprecatedHooks(userPlugins, options);
- this.pluginCache = pluginCache;
- this.fileEmitter = new FileEmitter(graph, options, basePluginDriver && basePluginDriver.fileEmitter);
- this.emitFile = this.fileEmitter.emitFile;
- this.getFileName = this.fileEmitter.getFileName;
- this.finaliseAssets = this.fileEmitter.assertAssetsFinalized;
- this.setOutputBundle = this.fileEmitter.setOutputBundle;
- this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);
- const existingPluginNames = new Set();
- for (const plugin of this.plugins) {
- this.pluginContexts.set(plugin, getPluginContext(plugin, pluginCache, graph, options, this.fileEmitter, existingPluginNames));
- }
- if (basePluginDriver) {
- for (const plugin of userPlugins) {
- for (const hook of inputHooks) {
- if (hook in plugin) {
- options.onwarn(errInputHookInOutputPlugin(plugin.name, hook));
- }
- }
- }
- }
- }
- createOutputPluginDriver(plugins) {
- return new PluginDriver(this.graph, this.options, plugins, this.pluginCache, this);
- }
- // chains, first non-null result stops and returns
- hookFirst(hookName, args, replaceContext, skipped) {
- let promise = Promise.resolve(undefined);
- for (const plugin of this.plugins) {
- if (skipped && skipped.has(plugin))
- continue;
- promise = promise.then(result => {
- if (result != null)
- return result;
- return this.runHook(hookName, args, plugin, false, replaceContext);
- });
- }
- return promise;
- }
- // chains synchronously, first non-null result stops and returns
- hookFirstSync(hookName, args, replaceContext) {
- for (const plugin of this.plugins) {
- const result = this.runHookSync(hookName, args, plugin, replaceContext);
- if (result != null)
- return result;
- }
- return null;
- }
- // parallel, ignores returns
- hookParallel(hookName, args, replaceContext) {
- const promises = [];
- for (const plugin of this.plugins) {
- const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
- if (!hookPromise)
- continue;
- promises.push(hookPromise);
- }
- return Promise.all(promises).then(() => { });
- }
- // chains, reduces returned value, handling the reduced value as the first hook argument
- hookReduceArg0(hookName, [arg0, ...rest], reduce, replaceContext) {
- let promise = Promise.resolve(arg0);
- for (const plugin of this.plugins) {
- promise = promise.then(arg0 => {
- const args = [arg0, ...rest];
- const hookPromise = this.runHook(hookName, args, plugin, false, replaceContext);
- if (!hookPromise)
- return arg0;
- return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin));
- });
- }
- return promise;
- }
- // chains synchronously, reduces returned value, handling the reduced value as the first hook argument
- hookReduceArg0Sync(hookName, [arg0, ...rest], reduce, replaceContext) {
- for (const plugin of this.plugins) {
- const args = [arg0, ...rest];
- const result = this.runHookSync(hookName, args, plugin, replaceContext);
- arg0 = reduce.call(this.pluginContexts.get(plugin), arg0, result, plugin);
- }
- return arg0;
- }
- // chains, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
- hookReduceValue(hookName, initialValue, args, reduce, replaceContext) {
- let promise = Promise.resolve(initialValue);
- for (const plugin of this.plugins) {
- promise = promise.then(value => {
- const hookPromise = this.runHook(hookName, args, plugin, true, replaceContext);
- if (!hookPromise)
- return value;
- return hookPromise.then(result => reduce.call(this.pluginContexts.get(plugin), value, result, plugin));
- });
- }
- return promise;
- }
- // chains synchronously, reduces returned value to type T, handling the reduced value separately. permits hooks as values.
- hookReduceValueSync(hookName, initialValue, args, reduce, replaceContext) {
- let acc = initialValue;
- for (const plugin of this.plugins) {
- const result = this.runHookSync(hookName, args, plugin, replaceContext);
- acc = reduce.call(this.pluginContexts.get(plugin), acc, result, plugin);
- }
- return acc;
- }
- // chains, ignores returns
- hookSeq(hookName, args, replaceContext) {
- let promise = Promise.resolve();
- for (const plugin of this.plugins) {
- promise = promise.then(() => this.runHook(hookName, args, plugin, false, replaceContext));
- }
- return promise;
- }
- // chains synchronously, ignores returns
- hookSeqSync(hookName, args, replaceContext) {
- for (const plugin of this.plugins) {
- this.runHookSync(hookName, args, plugin, replaceContext);
- }
- }
- runHook(hookName, args, plugin, permitValues, hookContext) {
- const hook = plugin[hookName];
- if (!hook)
- return undefined;
- let context = this.pluginContexts.get(plugin);
- if (hookContext) {
- context = hookContext(context, plugin);
- }
- return Promise.resolve()
- .then(() => {
- // permit values allows values to be returned instead of a functional hook
- if (typeof hook !== 'function') {
- if (permitValues)
- return hook;
- return throwInvalidHookError(hookName, plugin.name);
- }
- return hook.apply(context, args);
- })
- .catch(err => throwPluginError(err, plugin.name, { hook: hookName }));
- }
- /**
- * Run a sync plugin hook and return the result.
- * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
- * @param args Arguments passed to the plugin hook.
- * @param plugin The acutal plugin
- * @param hookContext When passed, the plugin context can be overridden.
- */
- runHookSync(hookName, args, plugin, hookContext) {
- const hook = plugin[hookName];
- if (!hook)
- return undefined;
- let context = this.pluginContexts.get(plugin);
- if (hookContext) {
- context = hookContext(context, plugin);
- }
- try {
- // permit values allows values to be returned instead of a functional hook
- if (typeof hook !== 'function') {
- return throwInvalidHookError(hookName, plugin.name);
- }
- return hook.apply(context, args);
- }
- catch (err) {
- return throwPluginError(err, plugin.name, { hook: hookName });
- }
- }
- }
- // AST walker module for Mozilla Parser API compatible trees
- function skipThrough(node, st, c) { c(node, st); }
- function ignore(_node, _st, _c) {}
- // Node walkers.
- var base = {};
- base.Program = base.BlockStatement = function (node, st, c) {
- for (var i = 0, list = node.body; i < list.length; i += 1)
- {
- var stmt = list[i];
- c(stmt, st, "Statement");
- }
- };
- base.Statement = skipThrough;
- base.EmptyStatement = ignore;
- base.ExpressionStatement = base.ParenthesizedExpression = base.ChainExpression =
- function (node, st, c) { return c(node.expression, st, "Expression"); };
- base.IfStatement = function (node, st, c) {
- c(node.test, st, "Expression");
- c(node.consequent, st, "Statement");
- if (node.alternate) { c(node.alternate, st, "Statement"); }
- };
- base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); };
- base.BreakStatement = base.ContinueStatement = ignore;
- base.WithStatement = function (node, st, c) {
- c(node.object, st, "Expression");
- c(node.body, st, "Statement");
- };
- base.SwitchStatement = function (node, st, c) {
- c(node.discriminant, st, "Expression");
- for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
- var cs = list$1[i$1];
- if (cs.test) { c(cs.test, st, "Expression"); }
- for (var i = 0, list = cs.consequent; i < list.length; i += 1)
- {
- var cons = list[i];
- c(cons, st, "Statement");
- }
- }
- };
- base.SwitchCase = function (node, st, c) {
- if (node.test) { c(node.test, st, "Expression"); }
- for (var i = 0, list = node.consequent; i < list.length; i += 1)
- {
- var cons = list[i];
- c(cons, st, "Statement");
- }
- };
- base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
- if (node.argument) { c(node.argument, st, "Expression"); }
- };
- base.ThrowStatement = base.SpreadElement =
- function (node, st, c) { return c(node.argument, st, "Expression"); };
- base.TryStatement = function (node, st, c) {
- c(node.block, st, "Statement");
- if (node.handler) { c(node.handler, st); }
- if (node.finalizer) { c(node.finalizer, st, "Statement"); }
- };
- base.CatchClause = function (node, st, c) {
- if (node.param) { c(node.param, st, "Pattern"); }
- c(node.body, st, "Statement");
- };
- base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
- c(node.test, st, "Expression");
- c(node.body, st, "Statement");
- };
- base.ForStatement = function (node, st, c) {
- if (node.init) { c(node.init, st, "ForInit"); }
- if (node.test) { c(node.test, st, "Expression"); }
- if (node.update) { c(node.update, st, "Expression"); }
- c(node.body, st, "Statement");
- };
- base.ForInStatement = base.ForOfStatement = function (node, st, c) {
- c(node.left, st, "ForInit");
- c(node.right, st, "Expression");
- c(node.body, st, "Statement");
- };
- base.ForInit = function (node, st, c) {
- if (node.type === "VariableDeclaration") { c(node, st); }
- else { c(node, st, "Expression"); }
- };
- base.DebuggerStatement = ignore;
- base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); };
- base.VariableDeclaration = function (node, st, c) {
- for (var i = 0, list = node.declarations; i < list.length; i += 1)
- {
- var decl = list[i];
- c(decl, st);
- }
- };
- base.VariableDeclarator = function (node, st, c) {
- c(node.id, st, "Pattern");
- if (node.init) { c(node.init, st, "Expression"); }
- };
- base.Function = function (node, st, c) {
- if (node.id) { c(node.id, st, "Pattern"); }
- for (var i = 0, list = node.params; i < list.length; i += 1)
- {
- var param = list[i];
- c(param, st, "Pattern");
- }
- c(node.body, st, node.expression ? "Expression" : "Statement");
- };
- base.Pattern = function (node, st, c) {
- if (node.type === "Identifier")
- { c(node, st, "VariablePattern"); }
- else if (node.type === "MemberExpression")
- { c(node, st, "MemberPattern"); }
- else
- { c(node, st); }
- };
- base.VariablePattern = ignore;
- base.MemberPattern = skipThrough;
- base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); };
- base.ArrayPattern = function (node, st, c) {
- for (var i = 0, list = node.elements; i < list.length; i += 1) {
- var elt = list[i];
- if (elt) { c(elt, st, "Pattern"); }
- }
- };
- base.ObjectPattern = function (node, st, c) {
- for (var i = 0, list = node.properties; i < list.length; i += 1) {
- var prop = list[i];
- if (prop.type === "Property") {
- if (prop.computed) { c(prop.key, st, "Expression"); }
- c(prop.value, st, "Pattern");
- } else if (prop.type === "RestElement") {
- c(prop.argument, st, "Pattern");
- }
- }
- };
- base.Expression = skipThrough;
- base.ThisExpression = base.Super = base.MetaProperty = ignore;
- base.ArrayExpression = function (node, st, c) {
- for (var i = 0, list = node.elements; i < list.length; i += 1) {
- var elt = list[i];
- if (elt) { c(elt, st, "Expression"); }
- }
- };
- base.ObjectExpression = function (node, st, c) {
- for (var i = 0, list = node.properties; i < list.length; i += 1)
- {
- var prop = list[i];
- c(prop, st);
- }
- };
- base.FunctionExpression = base.ArrowFunctionExpression = base.FunctionDeclaration;
- base.SequenceExpression = function (node, st, c) {
- for (var i = 0, list = node.expressions; i < list.length; i += 1)
- {
- var expr = list[i];
- c(expr, st, "Expression");
- }
- };
- base.TemplateLiteral = function (node, st, c) {
- for (var i = 0, list = node.quasis; i < list.length; i += 1)
- {
- var quasi = list[i];
- c(quasi, st);
- }
- for (var i$1 = 0, list$1 = node.expressions; i$1 < list$1.length; i$1 += 1)
- {
- var expr = list$1[i$1];
- c(expr, st, "Expression");
- }
- };
- base.TemplateElement = ignore;
- base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
- c(node.argument, st, "Expression");
- };
- base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
- c(node.left, st, "Expression");
- c(node.right, st, "Expression");
- };
- base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
- c(node.left, st, "Pattern");
- c(node.right, st, "Expression");
- };
- base.ConditionalExpression = function (node, st, c) {
- c(node.test, st, "Expression");
- c(node.consequent, st, "Expression");
- c(node.alternate, st, "Expression");
- };
- base.NewExpression = base.CallExpression = function (node, st, c) {
- c(node.callee, st, "Expression");
- if (node.arguments)
- { for (var i = 0, list = node.arguments; i < list.length; i += 1)
- {
- var arg = list[i];
- c(arg, st, "Expression");
- } }
- };
- base.MemberExpression = function (node, st, c) {
- c(node.object, st, "Expression");
- if (node.computed) { c(node.property, st, "Expression"); }
- };
- base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
- if (node.declaration)
- { c(node.declaration, st, node.type === "ExportNamedDeclaration" || node.declaration.id ? "Statement" : "Expression"); }
- if (node.source) { c(node.source, st, "Expression"); }
- };
- base.ExportAllDeclaration = function (node, st, c) {
- if (node.exported)
- { c(node.exported, st); }
- c(node.source, st, "Expression");
- };
- base.ImportDeclaration = function (node, st, c) {
- for (var i = 0, list = node.specifiers; i < list.length; i += 1)
- {
- var spec = list[i];
- c(spec, st);
- }
- c(node.source, st, "Expression");
- };
- base.ImportExpression = function (node, st, c) {
- c(node.source, st, "Expression");
- };
- base.ImportSpecifier = base.ImportDefaultSpecifier = base.ImportNamespaceSpecifier = base.Identifier = base.Literal = ignore;
- base.TaggedTemplateExpression = function (node, st, c) {
- c(node.tag, st, "Expression");
- c(node.quasi, st, "Expression");
- };
- base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class"); };
- base.Class = function (node, st, c) {
- if (node.id) { c(node.id, st, "Pattern"); }
- if (node.superClass) { c(node.superClass, st, "Expression"); }
- c(node.body, st);
- };
- base.ClassBody = function (node, st, c) {
- for (var i = 0, list = node.body; i < list.length; i += 1)
- {
- var elt = list[i];
- c(elt, st);
- }
- };
- base.MethodDefinition = base.Property = function (node, st, c) {
- if (node.computed) { c(node.key, st, "Expression"); }
- c(node.value, st, "Expression");
- };
- // patch up acorn-walk until class-fields are officially supported
- base.PropertyDefinition = function (node, st, c) {
- if (node.computed) {
- c(node.key, st, 'Expression');
- }
- if (node.value) {
- c(node.value, st, 'Expression');
- }
- };
- function handlePureAnnotationsOfNode(node, state, type = node.type) {
- let commentNode = state.commentNodes[state.commentIndex];
- while (commentNode && node.start >= commentNode.end) {
- markPureNode(node, commentNode);
- commentNode = state.commentNodes[++state.commentIndex];
- }
- if (commentNode && commentNode.end <= node.end) {
- base[type](node, state, handlePureAnnotationsOfNode);
- }
- }
- function markPureNode(node, comment) {
- if (node._rollupAnnotations) {
- node._rollupAnnotations.push({ comment });
- }
- else {
- node._rollupAnnotations = [{ comment }];
- }
- while (node.type === ExpressionStatement$1 || node.type === ChainExpression$1) {
- node = node.expression;
- }
- if (node.type === CallExpression$1 || node.type === NewExpression$1) {
- if (node._rollupAnnotations) {
- node._rollupAnnotations.push({ pure: true });
- }
- else {
- node._rollupAnnotations = [{ pure: true }];
- }
- }
- }
- const pureCommentRegex = /[@#]__PURE__/;
- const isPureComment = (comment) => pureCommentRegex.test(comment.value);
- function markPureCallExpressions(comments, esTreeAst) {
- handlePureAnnotationsOfNode(esTreeAst, {
- commentIndex: 0,
- commentNodes: comments.filter(isPureComment)
- });
- }
- function normalizeEntryModules(entryModules) {
- if (Array.isArray(entryModules)) {
- return entryModules.map(id => ({
- fileName: null,
- id,
- implicitlyLoadedAfter: [],
- importer: undefined,
- name: null
- }));
- }
- return Object.keys(entryModules).map(name => ({
- fileName: null,
- id: entryModules[name],
- implicitlyLoadedAfter: [],
- importer: undefined,
- name
- }));
- }
- class Graph {
- constructor(options, watcher) {
- var _a, _b;
- this.options = options;
- this.entryModules = [];
- this.modulesById = new Map();
- this.needsTreeshakingPass = false;
- this.phase = BuildPhase.LOAD_AND_PARSE;
- this.watchFiles = Object.create(null);
- this.watchMode = false;
- this.externalModules = [];
- this.implicitEntryModules = [];
- this.modules = [];
- this.getModuleInfo = (moduleId) => {
- const foundModule = this.modulesById.get(moduleId);
- if (!foundModule)
- return null;
- return foundModule.info;
- };
- this.deoptimizationTracker = new PathTracker();
- this.cachedModules = new Map();
- if (options.cache !== false) {
- if ((_a = options.cache) === null || _a === void 0 ? void 0 : _a.modules) {
- for (const module of options.cache.modules)
- this.cachedModules.set(module.id, module);
- }
- this.pluginCache = ((_b = options.cache) === null || _b === void 0 ? void 0 : _b.plugins) || Object.create(null);
- // increment access counter
- for (const name in this.pluginCache) {
- const cache = this.pluginCache[name];
- for (const key of Object.keys(cache))
- cache[key][0]++;
- }
- }
- if (watcher) {
- this.watchMode = true;
- const handleChange = (...args) => this.pluginDriver.hookSeqSync('watchChange', args);
- const handleClose = () => this.pluginDriver.hookSeqSync('closeWatcher', []);
- watcher.on('change', handleChange);
- watcher.on('close', handleClose);
- watcher.once('restart', () => {
- watcher.removeListener('change', handleChange);
- watcher.removeListener('close', handleClose);
- });
- }
- this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
- this.scope = new GlobalScope();
- this.acornParser = Parser.extend(...options.acornInjectPlugins);
- this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
- }
- async build() {
- timeStart('generate module graph', 2);
- await this.generateModuleGraph();
- timeEnd('generate module graph', 2);
- timeStart('sort modules', 2);
- this.phase = BuildPhase.ANALYSE;
- this.sortModules();
- timeEnd('sort modules', 2);
- timeStart('mark included statements', 2);
- this.includeStatements();
- timeEnd('mark included statements', 2);
- this.phase = BuildPhase.GENERATE;
- }
- contextParse(code, options = {}) {
- const onCommentOrig = options.onComment;
- const comments = [];
- if (onCommentOrig && typeof onCommentOrig == 'function') {
- options.onComment = (block, text, start, end, ...args) => {
- comments.push({ type: block ? "Block" : "Line", value: text, start, end });
- return onCommentOrig.call(options, block, text, start, end, ...args);
- };
- }
- else {
- options.onComment = comments;
- }
- const ast = this.acornParser.parse(code, {
- ...this.options.acorn,
- ...options
- });
- if (typeof onCommentOrig == 'object') {
- onCommentOrig.push(...comments);
- }
- options.onComment = onCommentOrig;
- markPureCallExpressions(comments, ast);
- return ast;
- }
- getCache() {
- // handle plugin cache eviction
- for (const name in this.pluginCache) {
- const cache = this.pluginCache[name];
- let allDeleted = true;
- for (const key of Object.keys(cache)) {
- if (cache[key][0] >= this.options.experimentalCacheExpiry)
- delete cache[key];
- else
- allDeleted = false;
- }
- if (allDeleted)
- delete this.pluginCache[name];
- }
- return {
- modules: this.modules.map(module => module.toJSON()),
- plugins: this.pluginCache
- };
- }
- async generateModuleGraph() {
- ({
- entryModules: this.entryModules,
- implicitEntryModules: this.implicitEntryModules
- } = await this.moduleLoader.addEntryModules(normalizeEntryModules(this.options.input), true));
- if (this.entryModules.length === 0) {
- throw new Error('You must supply options.input to rollup');
- }
- for (const module of this.modulesById.values()) {
- if (module instanceof Module$1) {
- this.modules.push(module);
- }
- else {
- this.externalModules.push(module);
- }
- }
- }
- includeStatements() {
- for (const module of [...this.entryModules, ...this.implicitEntryModules]) {
- if (module.preserveSignature !== false) {
- module.includeAllExports(false);
- }
- else {
- markModuleAndImpureDependenciesAsExecuted(module);
- }
- }
- if (this.options.treeshake) {
- let treeshakingPass = 1;
- do {
- timeStart(`treeshaking pass ${treeshakingPass}`, 3);
- this.needsTreeshakingPass = false;
- for (const module of this.modules) {
- if (module.isExecuted) {
- if (module.info.hasModuleSideEffects === 'no-treeshake') {
- module.includeAllInBundle();
- }
- else {
- module.include();
- }
- }
- }
- timeEnd(`treeshaking pass ${treeshakingPass++}`, 3);
- } while (this.needsTreeshakingPass);
- }
- else {
- for (const module of this.modules)
- module.includeAllInBundle();
- }
- for (const externalModule of this.externalModules)
- externalModule.warnUnusedImports();
- for (const module of this.implicitEntryModules) {
- for (const dependant of module.implicitlyLoadedAfter) {
- if (!(dependant.info.isEntry || dependant.isIncluded())) {
- error(errImplicitDependantIsNotIncluded(dependant));
- }
- }
- }
- }
- sortModules() {
- const { orderedModules, cyclePaths } = analyseModuleExecution(this.entryModules);
- for (const cyclePath of cyclePaths) {
- this.options.onwarn({
- code: 'CIRCULAR_DEPENDENCY',
- cycle: cyclePath,
- importer: cyclePath[0],
- message: `Circular dependency: ${cyclePath.join(' -> ')}`
- });
- }
- this.modules = orderedModules;
- for (const module of this.modules) {
- module.bindReferences();
- }
- this.warnForMissingExports();
- }
- warnForMissingExports() {
- for (const module of this.modules) {
- for (const importName of Object.keys(module.importDescriptions)) {
- const importDescription = module.importDescriptions[importName];
- if (importDescription.name !== '*' &&
- !importDescription.module.getVariableForExportName(importDescription.name)) {
- module.warn({
- code: 'NON_EXISTENT_EXPORT',
- message: `Non-existent export '${importDescription.name}' is imported from ${relativeId(importDescription.module.id)}`,
- name: importDescription.name,
- source: importDescription.module.id
- }, importDescription.start);
- }
- }
- }
- }
- }
- function ensureArray$5(items) {
- if (Array.isArray(items)) {
- return items.filter(Boolean);
- }
- if (items) {
- return [items];
- }
- return [];
- }
- function getAugmentedNamespace(n) {
- if (n.__esModule) return n;
- var a = Object.defineProperty({}, '__esModule', {value: true});
- Object.keys(n).forEach(function (k) {
- var d = Object.getOwnPropertyDescriptor(n, k);
- Object.defineProperty(a, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return n[k];
- }
- });
- });
- return a;
- }
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(acorn);
- const getPrototype = Object.getPrototypeOf || (o => o.__proto__);
- const getAcorn$1 = Parser => {
- if (Parser.acorn) return Parser.acorn
- const acorn = require$$1;
- if (acorn.version.indexOf("6.") != 0 && acorn.version.indexOf("6.0.") == 0 && acorn.version.indexOf("7.") != 0) {
- throw new Error(`acorn-private-class-elements requires acorn@^6.1.0 or acorn@7.0.0, not ${acorn.version}`)
- }
- // Make sure `Parser` comes from the same acorn as we `require`d,
- // otherwise the comparisons fail.
- for (let cur = Parser; cur && cur !== acorn.Parser; cur = getPrototype(cur)) {
- if (cur !== acorn.Parser) {
- throw new Error("acorn-private-class-elements does not support mixing different acorn copies")
- }
- }
- return acorn
- };
- var acornPrivateClassElements = function(Parser) {
- // Only load this plugin once.
- if (Parser.prototype.parsePrivateName) {
- return Parser
- }
- const acorn = getAcorn$1(Parser);
- Parser = class extends Parser {
- _branch() {
- this.__branch = this.__branch || new Parser({ecmaVersion: this.options.ecmaVersion}, this.input);
- this.__branch.end = this.end;
- this.__branch.pos = this.pos;
- this.__branch.type = this.type;
- this.__branch.value = this.value;
- this.__branch.containsEsc = this.containsEsc;
- return this.__branch
- }
- parsePrivateClassElementName(element) {
- element.computed = false;
- element.key = this.parsePrivateName();
- if (element.key.name == "constructor") this.raise(element.key.start, "Classes may not have a private element named constructor");
- const accept = {get: "set", set: "get"}[element.kind];
- const privateBoundNames = this._privateBoundNames;
- if (Object.prototype.hasOwnProperty.call(privateBoundNames, element.key.name) && privateBoundNames[element.key.name] !== accept) {
- this.raise(element.start, "Duplicate private element");
- }
- privateBoundNames[element.key.name] = element.kind || true;
- delete this._unresolvedPrivateNames[element.key.name];
- return element.key
- }
- parsePrivateName() {
- const node = this.startNode();
- node.name = this.value;
- this.next();
- this.finishNode(node, "PrivateIdentifier");
- if (this.options.allowReserved == "never") this.checkUnreserved(node);
- return node
- }
- // Parse # token
- getTokenFromCode(code) {
- if (code === 35) {
- ++this.pos;
- const word = this.readWord1();
- return this.finishToken(this.privateIdentifierToken, word)
- }
- return super.getTokenFromCode(code)
- }
- // Manage stacks and check for undeclared private names
- parseClass(node, isStatement) {
- const oldOuterPrivateBoundNames = this._outerPrivateBoundNames;
- this._outerPrivateBoundNames = this._privateBoundNames;
- this._privateBoundNames = Object.create(this._privateBoundNames || null);
- const oldOuterUnresolvedPrivateNames = this._outerUnresolvedPrivateNames;
- this._outerUnresolvedPrivateNames = this._unresolvedPrivateNames;
- this._unresolvedPrivateNames = Object.create(null);
- const _return = super.parseClass(node, isStatement);
- const unresolvedPrivateNames = this._unresolvedPrivateNames;
- this._privateBoundNames = this._outerPrivateBoundNames;
- this._outerPrivateBoundNames = oldOuterPrivateBoundNames;
- this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
- this._outerUnresolvedPrivateNames = oldOuterUnresolvedPrivateNames;
- if (!this._unresolvedPrivateNames) {
- const names = Object.keys(unresolvedPrivateNames);
- if (names.length) {
- names.sort((n1, n2) => unresolvedPrivateNames[n1] - unresolvedPrivateNames[n2]);
- this.raise(unresolvedPrivateNames[names[0]], "Usage of undeclared private name");
- }
- } else Object.assign(this._unresolvedPrivateNames, unresolvedPrivateNames);
- return _return
- }
- // Class heritage is evaluated with outer private environment
- parseClassSuper(node) {
- const privateBoundNames = this._privateBoundNames;
- this._privateBoundNames = this._outerPrivateBoundNames;
- const unresolvedPrivateNames = this._unresolvedPrivateNames;
- this._unresolvedPrivateNames = this._outerUnresolvedPrivateNames;
- const _return = super.parseClassSuper(node);
- this._privateBoundNames = privateBoundNames;
- this._unresolvedPrivateNames = unresolvedPrivateNames;
- return _return
- }
- // Parse private element access
- parseSubscript(base, startPos, startLoc, _noCalls, _maybeAsyncArrow, _optionalChained) {
- const optionalSupported = this.options.ecmaVersion >= 11 && acorn.tokTypes.questionDot;
- const branch = this._branch();
- if (!(
- (branch.eat(acorn.tokTypes.dot) || (optionalSupported && branch.eat(acorn.tokTypes.questionDot))) &&
- branch.type == this.privateIdentifierToken
- )) {
- return super.parseSubscript.apply(this, arguments)
- }
- let optional = false;
- if (!this.eat(acorn.tokTypes.dot)) {
- this.expect(acorn.tokTypes.questionDot);
- optional = true;
- }
- let node = this.startNodeAt(startPos, startLoc);
- node.object = base;
- node.computed = false;
- if (optionalSupported) {
- node.optional = optional;
- }
- if (this.type == this.privateIdentifierToken) {
- if (base.type == "Super") {
- this.raise(this.start, "Cannot access private element on super");
- }
- node.property = this.parsePrivateName();
- if (!this._privateBoundNames || !this._privateBoundNames[node.property.name]) {
- if (!this._unresolvedPrivateNames) {
- this.raise(node.property.start, "Usage of undeclared private name");
- }
- this._unresolvedPrivateNames[node.property.name] = node.property.start;
- }
- } else {
- node.property = this.parseIdent(true);
- }
- return this.finishNode(node, "MemberExpression")
- }
- // Prohibit delete of private class elements
- parseMaybeUnary(refDestructuringErrors, sawUnary) {
- const _return = super.parseMaybeUnary(refDestructuringErrors, sawUnary);
- if (_return.operator == "delete") {
- if (_return.argument.type == "MemberExpression" && _return.argument.property.type == "PrivateIdentifier") {
- this.raise(_return.start, "Private elements may not be deleted");
- }
- }
- return _return
- }
- };
- Parser.prototype.privateIdentifierToken = new acorn.TokenType("privateIdentifier");
- return Parser
- };
- const privateClassElements$1 = acornPrivateClassElements;
- var acornClassFields = function(Parser) {
- const acorn = Parser.acorn || require$$1;
- const tt = acorn.tokTypes;
- Parser = privateClassElements$1(Parser);
- return class extends Parser {
- _maybeParseFieldValue(field) {
- if (this.eat(tt.eq)) {
- const oldInFieldValue = this._inFieldValue;
- this._inFieldValue = true;
- if (this.type === tt.name && this.value === "await" && (this.inAsync || this.options.allowAwaitOutsideFunction)) {
- field.value = this.parseAwait();
- } else field.value = this.parseExpression();
- this._inFieldValue = oldInFieldValue;
- } else field.value = null;
- }
- // Parse fields
- parseClassElement(_constructorAllowsSuper) {
- if (this.options.ecmaVersion >= 8 && (this.type == tt.name || this.type.keyword || this.type == this.privateIdentifierToken || this.type == tt.bracketL || this.type == tt.string || this.type == tt.num)) {
- const branch = this._branch();
- if (branch.type == tt.bracketL) {
- let count = 0;
- do {
- if (branch.eat(tt.bracketL)) ++count;
- else if (branch.eat(tt.bracketR)) --count;
- else branch.next();
- } while (count > 0)
- } else branch.next(true);
- let isField = branch.type == tt.eq || branch.type == tt.semi;
- if (!isField && branch.canInsertSemicolon()) {
- isField = branch.type != tt.parenL;
- }
- if (isField) {
- const node = this.startNode();
- if (this.type == this.privateIdentifierToken) {
- this.parsePrivateClassElementName(node);
- } else {
- this.parsePropertyName(node);
- }
- if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
- (node.key.type === "Literal" && node.key.value === "constructor")) {
- this.raise(node.key.start, "Classes may not have a field called constructor");
- }
- this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
- this._maybeParseFieldValue(node);
- this.exitScope();
- this.finishNode(node, "PropertyDefinition");
- this.semicolon();
- return node
- }
- }
- return super.parseClassElement.apply(this, arguments)
- }
- // Prohibit arguments in class field initializers
- parseIdent(liberal, isBinding) {
- const ident = super.parseIdent(liberal, isBinding);
- if (this._inFieldValue && ident.name == "arguments") this.raise(ident.start, "A class field initializer may not contain arguments");
- return ident
- }
- }
- };
- const privateClassElements = acornPrivateClassElements;
- var acornStaticClassFeatures = function(Parser) {
- const ExtendedParser = privateClassElements(Parser);
- const acorn = Parser.acorn || require$$1;
- const tt = acorn.tokTypes;
- return class extends ExtendedParser {
- _maybeParseFieldValue(field) {
- if (this.eat(tt.eq)) {
- const oldInFieldValue = this._inStaticFieldScope;
- this._inStaticFieldScope = this.currentThisScope();
- field.value = this.parseExpression();
- this._inStaticFieldScope = oldInFieldValue;
- } else field.value = null;
- }
- // Parse fields
- parseClassElement(_constructorAllowsSuper) {
- if (this.options.ecmaVersion < 8 || !this.isContextual("static")) {
- return super.parseClassElement.apply(this, arguments)
- }
- const branch = this._branch();
- branch.next();
- if ([tt.name, tt.bracketL, tt.string, tt.num, this.privateIdentifierToken].indexOf(branch.type) == -1 && !branch.type.keyword) {
- return super.parseClassElement.apply(this, arguments)
- }
- if (branch.type == tt.bracketL) {
- let count = 0;
- do {
- if (branch.eat(tt.bracketL)) ++count;
- else if (branch.eat(tt.bracketR)) --count;
- else branch.next();
- } while (count > 0)
- } else branch.next();
- if (branch.type != tt.eq && !branch.canInsertSemicolon() && branch.type != tt.semi) {
- return super.parseClassElement.apply(this, arguments)
- }
- const node = this.startNode();
- node.static = this.eatContextual("static");
- if (this.type == this.privateIdentifierToken) {
- this.parsePrivateClassElementName(node);
- } else {
- this.parsePropertyName(node);
- }
- if ((node.key.type === "Identifier" && node.key.name === "constructor") ||
- (node.key.type === "Literal" && !node.computed && node.key.value === "constructor")) {
- this.raise(node.key.start, "Classes may not have a field called constructor");
- }
- if ((node.key.name || node.key.value) === "prototype" && !node.computed) {
- this.raise(node.key.start, "Classes may not have a static property named prototype");
- }
- this.enterScope(64 | 2 | 1); // See acorn's scopeflags.js
- this._maybeParseFieldValue(node);
- this.exitScope();
- this.finishNode(node, "PropertyDefinition");
- this.semicolon();
- return node
- }
- // Parse private static methods
- parsePropertyName(prop) {
- if (prop.static && this.type == this.privateIdentifierToken) {
- this.parsePrivateClassElementName(prop);
- } else {
- super.parsePropertyName(prop);
- }
- }
- // Prohibit arguments in class field initializers
- parseIdent(liberal, isBinding) {
- const ident = super.parseIdent(liberal, isBinding);
- if (this._inStaticFieldScope && this.currentThisScope() === this._inStaticFieldScope && ident.name == "arguments") {
- this.raise(ident.start, "A static class field initializer may not contain arguments");
- }
- return ident
- }
- }
- };
- const defaultOnWarn = warning => console.warn(warning.message || warning);
- function warnUnknownOptions(passedOptions, validOptions, optionType, warn, ignoredKeys = /$./) {
- const validOptionSet = new Set(validOptions);
- const unknownOptions = Object.keys(passedOptions).filter(key => !(validOptionSet.has(key) || ignoredKeys.test(key)));
- if (unknownOptions.length > 0) {
- warn({
- code: 'UNKNOWN_OPTION',
- message: `Unknown ${optionType}: ${unknownOptions.join(', ')}. Allowed options: ${[
- ...validOptionSet
- ]
- .sort()
- .join(', ')}`
- });
- }
- }
- function normalizeInputOptions(config) {
- var _a, _b;
- // These are options that may trigger special warnings or behaviour later
- // if the user did not select an explicit value
- const unsetOptions = new Set();
- const context = (_a = config.context) !== null && _a !== void 0 ? _a : 'undefined';
- const onwarn = getOnwarn(config);
- const strictDeprecations = config.strictDeprecations || false;
- const options = {
- acorn: getAcorn(config),
- acornInjectPlugins: getAcornInjectPlugins(config),
- cache: getCache(config),
- context,
- experimentalCacheExpiry: (_b = config.experimentalCacheExpiry) !== null && _b !== void 0 ? _b : 10,
- external: getIdMatcher(config.external),
- inlineDynamicImports: getInlineDynamicImports$1(config, onwarn, strictDeprecations),
- input: getInput(config),
- manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
- moduleContext: getModuleContext(config, context),
- onwarn,
- perf: config.perf || false,
- plugins: ensureArray$5(config.plugins),
- preserveEntrySignatures: getPreserveEntrySignatures(config, unsetOptions),
- preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
- preserveSymlinks: config.preserveSymlinks || false,
- shimMissingExports: config.shimMissingExports || false,
- strictDeprecations,
- treeshake: getTreeshake(config, onwarn, strictDeprecations)
- };
- warnUnknownOptions(config, [...Object.keys(options), 'watch'], 'input options', options.onwarn, /^(output)$/);
- return { options, unsetOptions };
- }
- const getOnwarn = (config) => {
- return config.onwarn
- ? warning => {
- warning.toString = () => {
- let str = '';
- if (warning.plugin)
- str += `(${warning.plugin} plugin) `;
- if (warning.loc)
- str += `${relativeId(warning.loc.file)} (${warning.loc.line}:${warning.loc.column}) `;
- str += warning.message;
- return str;
- };
- config.onwarn(warning, defaultOnWarn);
- }
- : defaultOnWarn;
- };
- const getAcorn = (config) => ({
- allowAwaitOutsideFunction: true,
- ecmaVersion: 'latest',
- preserveParens: false,
- sourceType: 'module',
- ...config.acorn
- });
- const getAcornInjectPlugins = (config) => [
- acornClassFields,
- acornStaticClassFeatures,
- ...ensureArray$5(config.acornInjectPlugins)
- ];
- const getCache = (config) => {
- var _a;
- return ((_a = config.cache) === null || _a === void 0 ? void 0 : _a.cache) || config.cache;
- };
- const getIdMatcher = (option) => {
- if (option === true) {
- return () => true;
- }
- if (typeof option === 'function') {
- return (id, ...args) => (!id.startsWith('\0') && option(id, ...args)) || false;
- }
- if (option) {
- const ids = new Set();
- const matchers = [];
- for (const value of ensureArray$5(option)) {
- if (value instanceof RegExp) {
- matchers.push(value);
- }
- else {
- ids.add(value);
- }
- }
- return (id, ..._args) => ids.has(id) || matchers.some(matcher => matcher.test(id));
- }
- return () => false;
- };
- const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
- const configInlineDynamicImports = config.inlineDynamicImports;
- if (configInlineDynamicImports) {
- warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', false, warn, strictDeprecations);
- }
- return configInlineDynamicImports;
- };
- const getInput = (config) => {
- const configInput = config.input;
- return configInput == null ? [] : typeof configInput === 'string' ? [configInput] : configInput;
- };
- const getManualChunks$1 = (config, warn, strictDeprecations) => {
- const configManualChunks = config.manualChunks;
- if (configManualChunks) {
- warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', false, warn, strictDeprecations);
- }
- return configManualChunks;
- };
- const getModuleContext = (config, context) => {
- const configModuleContext = config.moduleContext;
- if (typeof configModuleContext === 'function') {
- return id => { var _a; return (_a = configModuleContext(id)) !== null && _a !== void 0 ? _a : context; };
- }
- if (configModuleContext) {
- const contextByModuleId = Object.create(null);
- for (const key of Object.keys(configModuleContext)) {
- contextByModuleId[resolve$1(key)] = configModuleContext[key];
- }
- return id => contextByModuleId[id] || context;
- }
- return () => context;
- };
- const getPreserveEntrySignatures = (config, unsetOptions) => {
- const configPreserveEntrySignatures = config.preserveEntrySignatures;
- if (configPreserveEntrySignatures == null) {
- unsetOptions.add('preserveEntrySignatures');
- }
- return configPreserveEntrySignatures !== null && configPreserveEntrySignatures !== void 0 ? configPreserveEntrySignatures : 'strict';
- };
- const getPreserveModules$1 = (config, warn, strictDeprecations) => {
- const configPreserveModules = config.preserveModules;
- if (configPreserveModules) {
- warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', false, warn, strictDeprecations);
- }
- return configPreserveModules;
- };
- const getTreeshake = (config, warn, strictDeprecations) => {
- const configTreeshake = config.treeshake;
- if (configTreeshake === false) {
- return false;
- }
- if (configTreeshake && configTreeshake !== true) {
- if (typeof configTreeshake.pureExternalModules !== 'undefined') {
- warnDeprecationWithOptions(`The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, true, warn, strictDeprecations);
- }
- return {
- annotations: configTreeshake.annotations !== false,
- moduleSideEffects: getHasModuleSideEffects(configTreeshake.moduleSideEffects, configTreeshake.pureExternalModules, warn),
- propertyReadSideEffects: configTreeshake.propertyReadSideEffects === 'always' && 'always' ||
- configTreeshake.propertyReadSideEffects !== false,
- tryCatchDeoptimization: configTreeshake.tryCatchDeoptimization !== false,
- unknownGlobalSideEffects: configTreeshake.unknownGlobalSideEffects !== false
- };
- }
- return {
- annotations: true,
- moduleSideEffects: () => true,
- propertyReadSideEffects: true,
- tryCatchDeoptimization: true,
- unknownGlobalSideEffects: true
- };
- };
- const getHasModuleSideEffects = (moduleSideEffectsOption, pureExternalModules, warn) => {
- if (typeof moduleSideEffectsOption === 'boolean') {
- return () => moduleSideEffectsOption;
- }
- if (moduleSideEffectsOption === 'no-external') {
- return (_id, external) => !external;
- }
- if (typeof moduleSideEffectsOption === 'function') {
- return (id, external) => !id.startsWith('\0') ? moduleSideEffectsOption(id, external) !== false : true;
- }
- if (Array.isArray(moduleSideEffectsOption)) {
- const ids = new Set(moduleSideEffectsOption);
- return id => ids.has(id);
- }
- if (moduleSideEffectsOption) {
- warn(errInvalidOption('treeshake.moduleSideEffects', 'please use one of false, "no-external", a function or an array'));
- }
- const isPureExternalModule = getIdMatcher(pureExternalModules);
- return (id, external) => !(external && isPureExternalModule(id));
- };
- function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
- var _a, _b, _c, _d, _e, _f, _g;
- // These are options that may trigger special warnings or behaviour later
- // if the user did not select an explicit value
- const unsetOptions = new Set(unsetInputOptions);
- const compact = config.compact || false;
- const format = getFormat(config);
- const inlineDynamicImports = getInlineDynamicImports(config, inputOptions);
- const preserveModules = getPreserveModules(config, inlineDynamicImports, inputOptions);
- const file = getFile(config, preserveModules, inputOptions);
- const outputOptions = {
- amd: getAmd(config),
- assetFileNames: (_a = config.assetFileNames) !== null && _a !== void 0 ? _a : 'assets/[name]-[hash][extname]',
- banner: getAddon(config, 'banner'),
- chunkFileNames: (_b = config.chunkFileNames) !== null && _b !== void 0 ? _b : '[name]-[hash].js',
- compact,
- dir: getDir(config, file),
- dynamicImportFunction: getDynamicImportFunction(config, inputOptions),
- entryFileNames: getEntryFileNames(config, unsetOptions),
- esModule: (_c = config.esModule) !== null && _c !== void 0 ? _c : true,
- exports: getExports(config, unsetOptions),
- extend: config.extend || false,
- externalLiveBindings: (_d = config.externalLiveBindings) !== null && _d !== void 0 ? _d : true,
- file,
- footer: getAddon(config, 'footer'),
- format,
- freeze: (_e = config.freeze) !== null && _e !== void 0 ? _e : true,
- globals: config.globals || {},
- hoistTransitiveImports: (_f = config.hoistTransitiveImports) !== null && _f !== void 0 ? _f : true,
- indent: getIndent(config, compact),
- inlineDynamicImports,
- interop: getInterop(config, inputOptions),
- intro: getAddon(config, 'intro'),
- manualChunks: getManualChunks(config, inlineDynamicImports, preserveModules, inputOptions),
- minifyInternalExports: getMinifyInternalExports(config, format, compact),
- name: config.name,
- namespaceToStringTag: config.namespaceToStringTag || false,
- noConflict: config.noConflict || false,
- outro: getAddon(config, 'outro'),
- paths: config.paths || {},
- plugins: ensureArray$5(config.plugins),
- preferConst: config.preferConst || false,
- preserveModules,
- preserveModulesRoot: getPreserveModulesRoot(config),
- sourcemap: config.sourcemap || false,
- sourcemapExcludeSources: config.sourcemapExcludeSources || false,
- sourcemapFile: config.sourcemapFile,
- sourcemapPathTransform: config.sourcemapPathTransform,
- strict: (_g = config.strict) !== null && _g !== void 0 ? _g : true,
- systemNullSetters: config.systemNullSetters || false,
- validate: config.validate || false
- };
- warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onwarn);
- return { options: outputOptions, unsetOptions };
- }
- const getFile = (config, preserveModules, inputOptions) => {
- const file = config.file;
- if (typeof file === 'string') {
- if (preserveModules) {
- return error({
- code: 'INVALID_OPTION',
- message: 'You must set "output.dir" instead of "output.file" when using the "output.preserveModules" option.'
- });
- }
- if (!Array.isArray(inputOptions.input))
- return error({
- code: 'INVALID_OPTION',
- message: 'You must set "output.dir" instead of "output.file" when providing named inputs.'
- });
- }
- return file;
- };
- const getFormat = (config) => {
- const configFormat = config.format;
- switch (configFormat) {
- case undefined:
- case 'es':
- case 'esm':
- case 'module':
- return 'es';
- case 'cjs':
- case 'commonjs':
- return 'cjs';
- case 'system':
- case 'systemjs':
- return 'system';
- case 'amd':
- case 'iife':
- case 'umd':
- return configFormat;
- default:
- return error({
- message: `You must specify "output.format", which can be one of "amd", "cjs", "system", "es", "iife" or "umd".`,
- url: `https://rollupjs.org/guide/en/#outputformat`
- });
- }
- };
- const getInlineDynamicImports = (config, inputOptions) => {
- var _a;
- const inlineDynamicImports = ((_a = config.inlineDynamicImports) !== null && _a !== void 0 ? _a : inputOptions.inlineDynamicImports) ||
- false;
- const { input } = inputOptions;
- if (inlineDynamicImports && (Array.isArray(input) ? input : Object.keys(input)).length > 1) {
- return error({
- code: 'INVALID_OPTION',
- message: 'Multiple inputs are not supported for "output.inlineDynamicImports".'
- });
- }
- return inlineDynamicImports;
- };
- const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
- var _a;
- const preserveModules = ((_a = config.preserveModules) !== null && _a !== void 0 ? _a : inputOptions.preserveModules) || false;
- if (preserveModules) {
- if (inlineDynamicImports) {
- return error({
- code: 'INVALID_OPTION',
- message: `The "output.inlineDynamicImports" option is not supported for "output.preserveModules".`
- });
- }
- if (inputOptions.preserveEntrySignatures === false) {
- return error({
- code: 'INVALID_OPTION',
- message: 'Setting "preserveEntrySignatures" to "false" is not supported for "output.preserveModules".'
- });
- }
- }
- return preserveModules;
- };
- const getPreserveModulesRoot = (config) => {
- const preserveModulesRoot = config.preserveModulesRoot;
- if (preserveModulesRoot === null || preserveModulesRoot === undefined) {
- return undefined;
- }
- return resolve$1(preserveModulesRoot);
- };
- const getAmd = (config) => {
- const collection = {
- autoId: false,
- basePath: '',
- define: 'define',
- ...config.amd
- };
- if ((collection.autoId || collection.basePath) && collection.id) {
- return error({
- code: 'INVALID_OPTION',
- message: '"output.amd.autoId"/"output.amd.basePath" and "output.amd.id" cannot be used together.'
- });
- }
- if (collection.basePath && !collection.autoId) {
- return error({
- code: 'INVALID_OPTION',
- message: '"output.amd.basePath" only works with "output.amd.autoId".'
- });
- }
- let normalized;
- if (collection.autoId) {
- normalized = {
- autoId: true,
- basePath: collection.basePath,
- define: collection.define
- };
- }
- else {
- normalized = {
- autoId: false,
- define: collection.define,
- id: collection.id
- };
- }
- return normalized;
- };
- const getAddon = (config, name) => {
- const configAddon = config[name];
- if (typeof configAddon === 'function') {
- return configAddon;
- }
- return () => configAddon || '';
- };
- const getDir = (config, file) => {
- const dir = config.dir;
- if (typeof dir === 'string' && typeof file === 'string') {
- return error({
- code: 'INVALID_OPTION',
- message: 'You must set either "output.file" for a single-file build or "output.dir" when generating multiple chunks.'
- });
- }
- return dir;
- };
- const getDynamicImportFunction = (config, inputOptions) => {
- const configDynamicImportFunction = config.dynamicImportFunction;
- if (configDynamicImportFunction) {
- warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, false, inputOptions);
- }
- return configDynamicImportFunction;
- };
- const getEntryFileNames = (config, unsetOptions) => {
- const configEntryFileNames = config.entryFileNames;
- if (configEntryFileNames == null) {
- unsetOptions.add('entryFileNames');
- }
- return configEntryFileNames !== null && configEntryFileNames !== void 0 ? configEntryFileNames : '[name].js';
- };
- function getExports(config, unsetOptions) {
- const configExports = config.exports;
- if (configExports == null) {
- unsetOptions.add('exports');
- }
- else if (!['default', 'named', 'none', 'auto'].includes(configExports)) {
- return error(errInvalidExportOptionValue(configExports));
- }
- return configExports || 'auto';
- }
- const getIndent = (config, compact) => {
- if (compact) {
- return '';
- }
- const configIndent = config.indent;
- return configIndent === false ? '' : configIndent !== null && configIndent !== void 0 ? configIndent : true;
- };
- const ALLOWED_INTEROP_TYPES = new Set(['auto', 'esModule', 'default', 'defaultOnly', true, false]);
- const getInterop = (config, inputOptions) => {
- const configInterop = config.interop;
- const validatedInteropTypes = new Set();
- const validateInterop = (interop) => {
- if (!validatedInteropTypes.has(interop)) {
- validatedInteropTypes.add(interop);
- if (!ALLOWED_INTEROP_TYPES.has(interop)) {
- return error({
- code: 'INVALID_OPTION',
- message: `The value ${JSON.stringify(interop)} is not supported for "output.interop". Use one of ${Array.from(ALLOWED_INTEROP_TYPES.values(), value => JSON.stringify(value)).join(', ')} instead.`,
- url: 'https://rollupjs.org/guide/en/#outputinterop'
- });
- }
- if (typeof interop === 'boolean') {
- warnDeprecation({
- message: `The boolean value "${interop}" for the "output.interop" option is deprecated. Use ${interop ? '"auto"' : '"esModule", "default" or "defaultOnly"'} instead.`,
- url: 'https://rollupjs.org/guide/en/#outputinterop'
- }, false, inputOptions);
- }
- }
- return interop;
- };
- if (typeof configInterop === 'function') {
- const interopPerId = Object.create(null);
- let defaultInterop = null;
- return id => id === null
- ? defaultInterop || validateInterop((defaultInterop = configInterop(id)))
- : id in interopPerId
- ? interopPerId[id]
- : validateInterop((interopPerId[id] = configInterop(id)));
- }
- return configInterop === undefined ? () => true : () => validateInterop(configInterop);
- };
- const getManualChunks = (config, inlineDynamicImports, preserveModules, inputOptions) => {
- const configManualChunks = config.manualChunks || inputOptions.manualChunks;
- if (configManualChunks) {
- if (inlineDynamicImports) {
- return error({
- code: 'INVALID_OPTION',
- message: 'The "output.manualChunks" option is not supported for "output.inlineDynamicImports".'
- });
- }
- if (preserveModules) {
- return error({
- code: 'INVALID_OPTION',
- message: 'The "output.manualChunks" option is not supported for "output.preserveModules".'
- });
- }
- }
- return configManualChunks || {};
- };
- const getMinifyInternalExports = (config, format, compact) => { var _a; return (_a = config.minifyInternalExports) !== null && _a !== void 0 ? _a : (compact || format === 'es' || format === 'system'); };
- function rollup(rawInputOptions) {
- return rollupInternal(rawInputOptions, null);
- }
- async function rollupInternal(rawInputOptions, watcher) {
- const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null);
- initialiseTimers(inputOptions);
- const graph = new Graph(inputOptions, watcher);
- // remove the cache option from the memory after graph creation (cache is not used anymore)
- const useCache = rawInputOptions.cache !== false;
- delete inputOptions.cache;
- delete rawInputOptions.cache;
- timeStart('BUILD', 1);
- try {
- await graph.pluginDriver.hookParallel('buildStart', [inputOptions]);
- await graph.build();
- }
- catch (err) {
- const watchFiles = Object.keys(graph.watchFiles);
- if (watchFiles.length > 0) {
- err.watchFiles = watchFiles;
- }
- await graph.pluginDriver.hookParallel('buildEnd', [err]);
- await graph.pluginDriver.hookParallel('closeBundle', []);
- throw err;
- }
- await graph.pluginDriver.hookParallel('buildEnd', []);
- timeEnd('BUILD', 1);
- const result = {
- cache: useCache ? graph.getCache() : undefined,
- closed: false,
- async close() {
- if (result.closed)
- return;
- result.closed = true;
- await graph.pluginDriver.hookParallel('closeBundle', []);
- },
- async generate(rawOutputOptions) {
- if (result.closed)
- return error(errAlreadyClosed());
- return handleGenerateWrite(false, inputOptions, unsetInputOptions, rawOutputOptions, graph);
- },
- watchFiles: Object.keys(graph.watchFiles),
- async write(rawOutputOptions) {
- if (result.closed)
- return error(errAlreadyClosed());
- return handleGenerateWrite(true, inputOptions, unsetInputOptions, rawOutputOptions, graph);
- }
- };
- if (inputOptions.perf)
- result.getTimings = getTimings;
- return result;
- }
- async function getInputOptions(rawInputOptions, watchMode) {
- if (!rawInputOptions) {
- throw new Error('You must supply an options object to rollup');
- }
- const rawPlugins = ensureArray$5(rawInputOptions.plugins);
- const { options, unsetOptions } = normalizeInputOptions(await rawPlugins.reduce(applyOptionHook(watchMode), Promise.resolve(rawInputOptions)));
- normalizePlugins(options.plugins, ANONYMOUS_PLUGIN_PREFIX);
- return { options, unsetOptions };
- }
- function applyOptionHook(watchMode) {
- return async (inputOptions, plugin) => {
- if (plugin.options)
- return (plugin.options.call({ meta: { rollupVersion: version$1, watchMode } }, await inputOptions) || inputOptions);
- return inputOptions;
- };
- }
- function normalizePlugins(plugins, anonymousPrefix) {
- for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
- const plugin = plugins[pluginIndex];
- if (!plugin.name) {
- plugin.name = `${anonymousPrefix}${pluginIndex + 1}`;
- }
- }
- }
- async function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutputOptions, graph) {
- const { options: outputOptions, outputPluginDriver, unsetOptions } = getOutputOptionsAndPluginDriver(rawOutputOptions, graph.pluginDriver, inputOptions, unsetInputOptions);
- const bundle = new Bundle(outputOptions, unsetOptions, inputOptions, outputPluginDriver, graph);
- const generated = await bundle.generate(isWrite);
- if (isWrite) {
- if (!outputOptions.dir && !outputOptions.file) {
- return error({
- code: 'MISSING_OPTION',
- message: 'You must specify "output.file" or "output.dir" for the build.'
- });
- }
- await Promise.all(Object.keys(generated).map(chunkId => writeOutputFile(generated[chunkId], outputOptions)));
- await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]);
- }
- return createOutput(generated);
- }
- function getOutputOptionsAndPluginDriver(rawOutputOptions, inputPluginDriver, inputOptions, unsetInputOptions) {
- if (!rawOutputOptions) {
- throw new Error('You must supply an options object');
- }
- const rawPlugins = ensureArray$5(rawOutputOptions.plugins);
- normalizePlugins(rawPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
- const outputPluginDriver = inputPluginDriver.createOutputPluginDriver(rawPlugins);
- return {
- ...getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver),
- outputPluginDriver
- };
- }
- function getOutputOptions(inputOptions, unsetInputOptions, rawOutputOptions, outputPluginDriver) {
- return normalizeOutputOptions(outputPluginDriver.hookReduceArg0Sync('outputOptions', [rawOutputOptions.output || rawOutputOptions], (outputOptions, result) => result || outputOptions, pluginContext => {
- const emitError = () => pluginContext.error(errCannotEmitFromOptionsHook());
- return {
- ...pluginContext,
- emitFile: emitError,
- setAssetSource: emitError
- };
- }), inputOptions, unsetInputOptions);
- }
- function createOutput(outputBundle) {
- return {
- output: Object.keys(outputBundle)
- .map(fileName => outputBundle[fileName])
- .filter(outputFile => Object.keys(outputFile).length > 0).sort((outputFileA, outputFileB) => {
- const fileTypeA = getSortingFileType(outputFileA);
- const fileTypeB = getSortingFileType(outputFileB);
- if (fileTypeA === fileTypeB)
- return 0;
- return fileTypeA < fileTypeB ? -1 : 1;
- })
- };
- }
- var SortingFileType;
- (function (SortingFileType) {
- SortingFileType[SortingFileType["ENTRY_CHUNK"] = 0] = "ENTRY_CHUNK";
- SortingFileType[SortingFileType["SECONDARY_CHUNK"] = 1] = "SECONDARY_CHUNK";
- SortingFileType[SortingFileType["ASSET"] = 2] = "ASSET";
- })(SortingFileType || (SortingFileType = {}));
- function getSortingFileType(file) {
- if (file.type === 'asset') {
- return SortingFileType.ASSET;
- }
- if (file.isEntry) {
- return SortingFileType.ENTRY_CHUNK;
- }
- return SortingFileType.SECONDARY_CHUNK;
- }
- function writeOutputFile(outputFile, outputOptions) {
- const fileName = resolve$1(outputOptions.dir || dirname(outputOptions.file), outputFile.fileName);
- let writeSourceMapPromise;
- let source;
- if (outputFile.type === 'asset') {
- source = outputFile.source;
- }
- else {
- source = outputFile.code;
- if (outputOptions.sourcemap && outputFile.map) {
- let url;
- if (outputOptions.sourcemap === 'inline') {
- url = outputFile.map.toUrl();
- }
- else {
- url = `${basename(outputFile.fileName)}.map`;
- writeSourceMapPromise = writeFile(`${fileName}.map`, outputFile.map.toString());
- }
- if (outputOptions.sourcemap !== 'hidden') {
- source += `//# ${SOURCEMAPPING_URL}=${url}\n`;
- }
- }
- }
- return Promise.all([writeFile(fileName, source), writeSourceMapPromise]);
- }
- const devNodeModuleResolveId = async (config, inMemoryFs, resolvedId, importee) => {
- if (!shouldCheckDevModule(resolvedId, importee)) {
- return resolvedId;
- }
- const resolvedPath = resolvedId.id;
- const pkgPath = getPackageJsonPath(resolvedPath, importee);
- if (!pkgPath) {
- return resolvedId;
- }
- const pkgJsonStr = await inMemoryFs.readFile(pkgPath);
- if (!pkgJsonStr) {
- return resolvedId;
- }
- let pkgJsonData;
- try {
- pkgJsonData = JSON.parse(pkgJsonStr);
- }
- catch (e) { }
- if (!pkgJsonData || !pkgJsonData.version) {
- return resolvedId;
- }
- resolvedId.id = serializeDevNodeModuleUrl(config, pkgJsonData.name, pkgJsonData.version, resolvedPath);
- resolvedId.external = true;
- return resolvedId;
- };
- const getPackageJsonPath = (resolvedPath, importee) => {
- let currentPath = resolvedPath;
- for (let i = 0; i < 10; i++) {
- currentPath = dirname(currentPath);
- const aBasename = basename(currentPath);
- const upDir = dirname(currentPath);
- const bBasename = basename(upDir);
- if (aBasename === importee && bBasename === 'node_modules') {
- return join(currentPath, 'package.json');
- }
- }
- return null;
- };
- const compilerRequest = async (config, compilerCtx, data) => {
- const results = {
- path: data.path,
- nodeModuleId: null,
- nodeModuleVersion: null,
- nodeResolvedPath: null,
- cachePath: null,
- cacheHit: false,
- content: '',
- status: 404,
- };
- try {
- const parsedUrl = parseDevModuleUrl(config, data.path);
- Object.assign(results, parsedUrl);
- if (parsedUrl.nodeModuleId) {
- if (!parsedUrl.nodeModuleVersion) {
- results.content = `/* invalid module version */`;
- results.status = 400;
- return results;
- }
- if (!parsedUrl.nodeResolvedPath) {
- results.content = `/* invalid resolved path */`;
- results.status = 400;
- return results;
- }
- const useCache = await useDevModuleCache(config, parsedUrl.nodeResolvedPath);
- let cachePath = null;
- if (useCache) {
- cachePath = getDevModuleCachePath(config, parsedUrl);
- const cachedContent = await config.sys.readFile(cachePath);
- if (typeof cachedContent === 'string') {
- results.content = cachedContent;
- results.cachePath = cachePath;
- results.cacheHit = true;
- results.status = 200;
- return results;
- }
- }
- await bundleDevModule(config, compilerCtx, parsedUrl, results);
- if (results.status === 200 && useCache) {
- results.cachePath = cachePath;
- writeCachedFile(config, results);
- }
- }
- else {
- results.content = `/* invalid dev module */`;
- results.status = 400;
- return results;
- }
- }
- catch (e) {
- if (e) {
- if (e instanceof Error && e.stack) {
- results.content = `/*\n${e.stack}\n*/`;
- }
- else {
- results.content = `/*\n${e}\n*/`;
- }
- }
- results.status = 500;
- }
- return results;
- };
- const bundleDevModule = async (config, compilerCtx, parsedUrl, results) => {
- const buildCtx = new BuildContext(config, compilerCtx);
- try {
- const inputOpts = getRollupOptions(config, compilerCtx, buildCtx, {
- id: parsedUrl.nodeModuleId,
- platform: 'client',
- inputs: {
- index: parsedUrl.nodeResolvedPath,
- },
- });
- const rollupBuild = await rollup(inputOpts);
- const outputOpts = {
- banner: generatePreamble(config),
- format: 'es',
- };
- if (parsedUrl.nodeModuleId) {
- const commentPath = relative$1(config.rootDir, parsedUrl.nodeResolvedPath);
- outputOpts.intro = `/**\n * Dev Node Module: ${parsedUrl.nodeModuleId}, v${parsedUrl.nodeModuleVersion}\n * Entry: ${commentPath}\n * DEVELOPMENT PURPOSES ONLY!!\n */`;
- inputOpts.input = parsedUrl.nodeResolvedPath;
- }
- const r = await rollupBuild.generate(outputOpts);
- if (buildCtx.hasError) {
- results.status = 500;
- results.content = `console.error(${JSON.stringify(buildCtx.diagnostics)})`;
- }
- else if (r && r.output && r.output.length > 0) {
- results.content = r.output[0].code;
- results.status = 200;
- }
- }
- catch (e) {
- results.status = 500;
- const errorMsg = e instanceof Error ? e.stack : e + '';
- results.content = `console.error(${JSON.stringify(errorMsg)})`;
- }
- };
- const useDevModuleCache = async (config, p) => {
- if (config.enableCache) {
- for (let i = 0; i < 10; i++) {
- const n = basename(p);
- if (n === 'node_modules') {
- return true;
- }
- const isSymbolicLink = await config.sys.isSymbolicLink(p);
- if (isSymbolicLink) {
- return false;
- }
- p = dirname(p);
- }
- }
- return false;
- };
- const writeCachedFile = async (config, results) => {
- try {
- await config.sys.createDir(config.cacheDir);
- config.sys.writeFile(results.cachePath, results.content);
- }
- catch (e) {
- console.error(e);
- }
- };
- const serializeDevNodeModuleUrl = (config, moduleId, moduleVersion, resolvedPath) => {
- resolvedPath = relative$1(config.rootDir, resolvedPath);
- let id = `/${DEV_MODULE_DIR}/`;
- id += encodeURIComponent(moduleId) + '@';
- id += encodeURIComponent(moduleVersion) + '.js';
- id += '?p=' + encodeURIComponent(resolvedPath);
- return id;
- };
- const parseDevModuleUrl = (config, u) => {
- const parsedUrl = {
- nodeModuleId: null,
- nodeModuleVersion: null,
- nodeResolvedPath: null,
- };
- if (u && u.includes(DEV_MODULE_DIR) && u.endsWith('.js')) {
- const url = new URL(u, 'https://stenciljs.com');
- let reqPath = basename(url.pathname);
- reqPath = reqPath.substring(0, reqPath.length - 3);
- let splt = reqPath.split('@');
- if (splt.length === 2) {
- parsedUrl.nodeModuleId = decodeURIComponent(splt[0]);
- parsedUrl.nodeModuleVersion = decodeURIComponent(splt[1]);
- parsedUrl.nodeResolvedPath = url.searchParams.get('p');
- if (parsedUrl.nodeResolvedPath) {
- parsedUrl.nodeResolvedPath = decodeURIComponent(parsedUrl.nodeResolvedPath);
- parsedUrl.nodeResolvedPath = join(config.rootDir, parsedUrl.nodeResolvedPath);
- }
- }
- }
- return parsedUrl;
- };
- const getDevModuleCachePath = (config, parsedUrl) => {
- return join(config.cacheDir, `dev_module_${parsedUrl.nodeModuleId}_${parsedUrl.nodeModuleVersion}_${DEV_MODULE_CACHE_BUSTER}.log`);
- };
- const DEV_MODULE_CACHE_BUSTER = 0;
- const DEV_MODULE_DIR = `~dev-module`;
- const shouldCheckDevModule = (resolvedId, importee) => resolvedId &&
- importee &&
- resolvedId.id &&
- resolvedId.id.includes('node_modules') &&
- (resolvedId.id.endsWith('.js') || resolvedId.id.endsWith('.mjs')) &&
- !resolvedId.external &&
- !importee.startsWith('.') &&
- !importee.startsWith('/');
- const extFormatPlugin = (config) => {
- return {
- name: 'extFormatPlugin',
- transform(code, importPath) {
- if (/\0/.test(importPath)) {
- return null;
- }
- const { ext, filePath, format } = normalizeFsPathQuery(importPath);
- // ?format= param takes precedence before file extension
- switch (format) {
- case 'url':
- return { code: formatUrl(config, this, code, filePath, ext), map: null };
- case 'text':
- return { code: formatText(code, filePath), map: null };
- }
- // didn't provide a ?format= param
- // check if it's a known extension we should format
- if (FORMAT_TEXT_EXTS.includes(ext)) {
- return { code: formatText(code, filePath), map: null };
- }
- if (FORMAT_URL_MIME[ext]) {
- return { code: formatUrl(config, this, code, filePath, ext), map: null };
- }
- return null;
- },
- };
- };
- const FORMAT_TEXT_EXTS = ['txt', 'frag', 'vert'];
- const FORMAT_URL_MIME = {
- svg: 'image/svg+xml',
- };
- const DATAURL_MAX_IMAGE_SIZE = 4 * 1024; // 4KiB
- const formatText = (code, filePath) => {
- const varName = createJsVarName(basename(filePath));
- return `const ${varName} = ${JSON.stringify(code)};export default ${varName};`;
- };
- const formatUrl = (config, pluginCtx, code, filePath, ext) => {
- const mime = FORMAT_URL_MIME[ext];
- if (!mime) {
- pluginCtx.warn(`Unsupported url format for "${ext}" extension.`);
- return formatText('', filePath);
- }
- const varName = createJsVarName(basename(filePath));
- const base64 = config.sys.encodeToBase64(code);
- if (config.devMode && base64.length > DATAURL_MAX_IMAGE_SIZE) {
- pluginCtx.warn(`Importing large files will bloat your bundle size, please use external assets instead.`);
- }
- return `const ${varName} = 'data:${mime};base64,${base64}';export default ${varName};`;
- };
- const extTransformsPlugin = (config, compilerCtx, buildCtx, bundleOpts) => {
- return {
- name: 'extTransformsPlugin',
- async transform(_, id) {
- if (/\0/.test(id)) {
- return null;
- }
- const { data } = parseImportPath(id);
- if (data != null) {
- let cmp;
- const filePath = normalizeFsPath(id);
- const code = await compilerCtx.fs.readFile(filePath);
- if (typeof code !== 'string') {
- return null;
- }
- const pluginTransforms = await runPluginTransformsEsmImports(config, compilerCtx, buildCtx, code, filePath);
- const commentOriginalSelector = bundleOpts.platform === 'hydrate' && data.encapsulation === 'shadow';
- if (data.tag) {
- cmp = buildCtx.components.find((c) => c.tagName === data.tag);
- const moduleFile = cmp && compilerCtx.moduleMap.get(cmp.sourceFilePath);
- if (moduleFile) {
- const collectionDirs = config.outputTargets.filter(isOutputTargetDistCollection);
- const relPath = relative$1(config.srcDir, pluginTransforms.id);
- await Promise.all(collectionDirs.map(async (outputTarget) => {
- const collectionPath = join(outputTarget.collectionDir, relPath);
- await compilerCtx.fs.writeFile(collectionPath, pluginTransforms.code);
- }));
- }
- }
- const cssTransformResults = await compilerCtx.worker.transformCssToEsm({
- file: pluginTransforms.id,
- input: pluginTransforms.code,
- tag: data.tag,
- encapsulation: data.encapsulation,
- mode: data.mode,
- commentOriginalSelector,
- sourceMap: config.sourceMap,
- minify: config.minifyCss,
- autoprefixer: config.autoprefixCss,
- docs: config.buildDocs,
- });
- // Set style docs
- if (cmp) {
- cmp.styleDocs = cssTransformResults.styleDocs;
- }
- // Track dependencies
- for (const dep of pluginTransforms.dependencies) {
- this.addWatchFile(dep);
- compilerCtx.addWatchFile(dep);
- }
- buildCtx.diagnostics.push(...pluginTransforms.diagnostics);
- buildCtx.diagnostics.push(...cssTransformResults.diagnostics);
- const didError = hasError(cssTransformResults.diagnostics) || hasError(pluginTransforms.diagnostics);
- if (didError) {
- this.error('Plugin CSS transform error');
- }
- const hasUpdatedStyle = buildCtx.stylesUpdated.some((s) => {
- return s.styleTag === data.tag && s.styleMode === data.mode && s.styleText === cssTransformResults.styleText;
- });
- if (!hasUpdatedStyle) {
- buildCtx.stylesUpdated.push({
- styleTag: data.tag,
- styleMode: data.mode,
- styleText: cssTransformResults.styleText,
- });
- }
- return {
- code: cssTransformResults.output,
- map: cssTransformResults.map,
- moduleSideEffects: false,
- };
- }
- return null;
- },
- };
- };
- const fileLoadPlugin = (fs) => {
- return {
- name: 'fileLoadPlugin',
- load(id) {
- const fsFilePath = normalizeFsPath(id);
- if (id.endsWith('.d.ts')) {
- return '';
- }
- return fs.readFile(fsFilePath);
- },
- };
- };
- const lazyComponentPlugin = (buildCtx) => {
- const entrys = new Map();
- const plugin = {
- name: 'lazyComponentPlugin',
- resolveId(importee) {
- const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === importee);
- if (entryModule) {
- entrys.set(importee, entryModule);
- return importee;
- }
- return null;
- },
- load(id) {
- const entryModule = entrys.get(id);
- if (entryModule) {
- return entryModule.cmps.map(createComponentExport).join('\n');
- }
- return null;
- },
- };
- return plugin;
- };
- const createComponentExport = (cmp) => {
- const originalClassName = cmp.componentClassName;
- const underscoredClassName = cmp.tagName.replace(/-/g, '_');
- const filePath = normalizePath$1(cmp.sourceFilePath);
- return `export { ${originalClassName} as ${underscoredClassName} } from '${filePath}';`;
- };
- /**
- * Rollup plugin that aids in resolving the entry points (1 or more files) for a Stencil project. For example, a project
- * using the `dist-custom-elements` output target may have a single 'entry point' for each file containing a component.
- * Each of those files will be independently resolved and loaded by this plugin for further processing by Rollup later
- * in the bundling process.
- * @param entries the Stencil project files to process. It should be noted that the keys in this object may not
- * necessarily be an absolute or relative path to a file, but may be a Rollup Virtual Module (which begin with \0).
- * @returns the rollup plugin that loads and process a Stencil project's entry points
- */
- const loaderPlugin = (entries = {}) => {
- return {
- name: 'stencilLoaderPlugin',
- /**
- * A rollup build hook for resolving the imports of individual Stencil project files. This hook only resolves
- * modules that are contained in the plugin's `entries` argument. [Source](https://rollupjs.org/guide/en/#resolveid)
- * @param id the importee to resolve
- * @returns a string that resolves an import to some id, null otherwise
- */
- resolveId(id) {
- if (id in entries) {
- return {
- id,
- };
- }
- return null;
- },
- /**
- * A rollup build hook for loading individual Stencil project files [Source](https://rollupjs.org/guide/en/#load)
- * @param id the path of the module to load. It should be noted that the keys in this object may not necessarily
- * be an absolute or relative path to a file, but may be a Rollup Virtual Module.
- * @returns the module matched, null otherwise
- */
- load(id) {
- if (id in entries) {
- return entries[id];
- }
- return null;
- },
- };
- };
- const pluginHelper = (config, builtCtx, platform) => {
- return {
- name: 'pluginHelper',
- resolveId(importee, importer) {
- if (/\0/.test(importee)) {
- // ignore IDs with null character, these belong to other plugins
- return null;
- }
- if (importee.endsWith('/')) {
- importee = importee.slice(0, -1);
- }
- if (builtIns.has(importee)) {
- let fromMsg = '';
- if (importer) {
- fromMsg = ` from ${relative$1(config.rootDir, importer)}`;
- }
- const diagnostic = buildError(builtCtx.diagnostics);
- diagnostic.header = `Node Polyfills Required`;
- diagnostic.messageText = `For the import "${importee}" to be bundled${fromMsg}, ensure the "rollup-plugin-node-polyfills" plugin is installed and added to the stencil config plugins (${platform}). Please see the bundling docs for more information.
- Further information: https://stenciljs.com/docs/module-bundling`;
- }
- return null;
- },
- };
- };
- const builtIns = new Set([
- 'child_process',
- 'cluster',
- 'dgram',
- 'dns',
- 'module',
- 'net',
- 'readline',
- 'repl',
- 'tls',
- 'assert',
- 'console',
- 'constants',
- 'domain',
- 'events',
- 'path',
- 'punycode',
- 'querystring',
- '_stream_duplex',
- '_stream_passthrough',
- '_stream_readable',
- '_stream_writable',
- '_stream_transform',
- 'string_decoder',
- 'sys',
- 'tty',
- 'crypto',
- 'fs',
- 'Buffer',
- 'buffer',
- 'global',
- 'http',
- 'https',
- 'os',
- 'process',
- 'stream',
- 'timers',
- 'url',
- 'util',
- 'vm',
- 'zlib',
- ]);
- const getModule = (compilerCtx, filePath) => compilerCtx.moduleMap.get(normalizePath$1(filePath));
- const createModule = (staticSourceFile, // this is NOT the original
- staticSourceFileText, emitFilepath) => ({
- sourceFilePath: normalizePath$1(staticSourceFile.fileName),
- jsFilePath: emitFilepath,
- staticSourceFile,
- staticSourceFileText,
- cmps: [],
- coreRuntimeApis: [],
- collectionName: null,
- dtsFilePath: null,
- excludeFromCollection: false,
- externalImports: [],
- hasVdomAttribute: false,
- hasVdomClass: false,
- hasVdomFunctional: false,
- hasVdomKey: false,
- hasVdomListener: false,
- hasVdomPropOrAttr: false,
- hasVdomRef: false,
- hasVdomRender: false,
- hasVdomStyle: false,
- hasVdomText: false,
- hasVdomXlink: false,
- htmlAttrNames: [],
- htmlParts: [],
- htmlTagNames: [],
- isCollectionDependency: false,
- isLegacy: false,
- localImports: [],
- originalCollectionComponentPath: null,
- originalImports: [],
- potentialCmpRefs: [],
- sourceMapPath: null,
- sourceMapFileText: null,
- });
- const fetchModuleSync = (sys, inMemoryFs, pkgVersions, url, filePath) => {
- if (skipFilePathFetch(filePath)) {
- return undefined;
- }
- const content = fetchUrlSync(url);
- if (isString$1(content)) {
- writeFetchSuccessSync(sys, inMemoryFs, url, filePath, content, pkgVersions);
- }
- return content;
- };
- const fetchUrlSync = (url) => {
- if (known404Urls.has(url) || skipUrlFetch(url)) {
- return undefined;
- }
- try {
- const xhr = new XMLHttpRequest();
- xhr.open('GET', url, false);
- xhr.send(null);
- if (xhr.status >= 200 && xhr.status <= 299) {
- return xhr.responseText;
- }
- }
- catch (e) { }
- known404Urls.add(url);
- return undefined;
- };
- const patchTsSystemFileSystem = (config, stencilSys, inMemoryFs, tsSys) => {
- const realpath = (path) => {
- const rp = stencilSys.realpathSync(path);
- if (isString$1(rp)) {
- return rp;
- }
- return path;
- };
- const getAccessibleFileSystemEntries = (path) => {
- try {
- const entries = stencilSys.readDirSync(path || '.').sort();
- const files = [];
- const directories = [];
- for (const absPath of entries) {
- // This is necessary because on some file system node fails to exclude
- // "." and "..". See https://github.com/nodejs/node/issues/4002
- const stat = inMemoryFs.statSync(absPath);
- if (!stat) {
- continue;
- }
- const entry = basename(absPath);
- if (stat.isFile) {
- files.push(entry);
- }
- else if (stat.isDirectory) {
- directories.push(entry);
- }
- }
- return { files, directories };
- }
- catch (e) {
- return { files: [], directories: [] };
- }
- };
- tsSys.createDirectory = (p) => {
- stencilSys.createDirSync(p, { recursive: true });
- };
- tsSys.directoryExists = (p) => {
- const s = inMemoryFs.statSync(p);
- return s.isDirectory;
- };
- tsSys.exit = stencilSys.exit;
- tsSys.fileExists = (p) => {
- let filePath = p;
- if (isRemoteUrl(p)) {
- filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
- }
- const s = inMemoryFs.statSync(filePath);
- return !!(s && s.isFile);
- };
- tsSys.getCurrentDirectory = stencilSys.getCurrentDirectory;
- tsSys.getExecutingFilePath = stencilSys.getCompilerExecutingPath;
- tsSys.getDirectories = (p) => {
- const items = stencilSys.readDirSync(p);
- return items.filter((itemPath) => {
- const s = inMemoryFs.statSync(itemPath);
- return !!(s && s.exists && s.isDirectory);
- });
- };
- tsSys.readDirectory = (path, extensions, exclude, include, depth) => {
- const cwd = stencilSys.getCurrentDirectory();
- // TODO(STENCIL-344): Replace `matchFiles` with a function that is publicly exposed
- return t.matchFiles(path, extensions, exclude, include, IS_CASE_SENSITIVE_FILE_NAMES, cwd, depth, getAccessibleFileSystemEntries, realpath);
- };
- tsSys.readFile = (p) => {
- let filePath = p;
- const isUrl = isRemoteUrl(p);
- if (isUrl) {
- filePath = getTypescriptPathFromUrl(config, tsSys.getExecutingFilePath(), p);
- }
- let content = inMemoryFs.readFileSync(filePath, { useCache: isUrl });
- if (typeof content !== 'string' && isUrl) {
- if (IS_WEB_WORKER_ENV) {
- content = fetchUrlSync(p);
- if (typeof content === 'string') {
- inMemoryFs.writeFile(filePath, content);
- }
- }
- else {
- config.logger.error(`ts.sys can only request http resources from within a web worker: ${p}`);
- }
- }
- return content;
- };
- tsSys.writeFile = (p, data) => inMemoryFs.writeFile(p, data);
- return tsSys;
- };
- const patchTsSystemWatch = (stencilSys, tsSys) => {
- tsSys.watchDirectory = (p, cb, recursive) => {
- const watcher = stencilSys.watchDirectory(p, (filePath) => {
- cb(filePath);
- }, recursive);
- return {
- close() {
- watcher.close();
- },
- };
- };
- tsSys.watchFile = (p, cb) => {
- const watcher = stencilSys.watchFile(p, (filePath, eventKind) => {
- if (eventKind === 'fileAdd') {
- cb(filePath, t.FileWatcherEventKind.Created);
- }
- else if (eventKind === 'fileUpdate') {
- cb(filePath, t.FileWatcherEventKind.Changed);
- }
- else if (eventKind === 'fileDelete') {
- cb(filePath, t.FileWatcherEventKind.Deleted);
- }
- });
- return {
- close() {
- watcher.close();
- },
- };
- };
- };
- const patchTypescript = (config, inMemoryFs) => {
- if (!t.__patched) {
- if (config.sys) {
- patchTsSystemFileSystem(config, config.sys, inMemoryFs, t.sys);
- patchTsSystemWatch(config.sys, t.sys);
- }
- patchTypeScriptResolveModule(config, inMemoryFs);
- patchTypeScriptGetParsedCommandLineOfConfigFile();
- t.__patched = true;
- }
- };
- const patchTypeScriptSysMinimum = () => {
- if (!t.sys) {
- // patches just the bare minimum
- // if ts.sys already exists then it must be node ts.sys
- // otherwise we're browser
- // will be updated later on with the stencil sys
- t.sys = {
- args: [],
- createDirectory: noop$1,
- directoryExists: () => false,
- exit: noop$1,
- fileExists: () => false,
- getCurrentDirectory,
- getDirectories: () => [],
- getExecutingFilePath: () => './',
- readDirectory: () => [],
- readFile: noop$1,
- newLine: '\n',
- resolvePath: resolve$1,
- useCaseSensitiveFileNames: false,
- write: noop$1,
- writeFile: noop$1,
- };
- }
- };
- patchTypeScriptSysMinimum();
- const getTypescriptPathFromUrl = (config, tsExecutingUrl, url) => {
- const tsBaseUrl = new URL('..', tsExecutingUrl).href;
- if (url.startsWith(tsBaseUrl)) {
- const tsFilePath = url.replace(tsBaseUrl, '/');
- const tsNodePath = config.sys.getLocalModulePath({
- rootDir: config.rootDir,
- moduleId: '@stencil/core',
- path: tsFilePath,
- });
- return normalizePath$1(tsNodePath);
- }
- return url;
- };
- const patchTypeScriptGetParsedCommandLineOfConfigFile = () => {
- const orgGetParsedCommandLineOfConfigFile = t.getParsedCommandLineOfConfigFile;
- t.getParsedCommandLineOfConfigFile = (configFileName, optionsToExtend, host, extendedConfigCache) => {
- const results = orgGetParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host, extendedConfigCache);
- // manually filter out any .spec or .e2e files
- results.fileNames = results.fileNames.filter((f) => {
- // filter e2e tests
- if (f.includes('.e2e.') || f.includes('/e2e.')) {
- return false;
- }
- // filter spec tests
- if (f.includes('.spec.') || f.includes('/spec.')) {
- return false;
- }
- return true;
- });
- return results;
- };
- };
- const resolveRemoteModuleIdSync = (config, inMemoryFs, opts) => {
- const packageJson = resolveRemotePackageJsonSync(config, inMemoryFs, opts.moduleId);
- if (packageJson) {
- const resolveModuleSyncOpts = {
- ...opts,
- exts: ['.js', '.mjs'],
- };
- const resolvedUrl = resolveModuleIdSync(config.sys, inMemoryFs, resolveModuleSyncOpts);
- if (typeof resolvedUrl === 'string') {
- return {
- resolvedUrl,
- packageJson,
- };
- }
- }
- return null;
- };
- const resolveRemotePackageJsonSync = (config, inMemoryFs, moduleId) => {
- if (inMemoryFs) {
- const filePath = normalizePath$1(config.sys.getLocalModulePath({ rootDir: config.rootDir, moduleId, path: 'package.json' }));
- let pkgJson = inMemoryFs.readFileSync(filePath);
- if (!isString$1(pkgJson) && IS_WEB_WORKER_ENV) {
- const url = config.sys.getRemoteModuleUrl({ moduleId, path: 'package.json' });
- pkgJson = fetchModuleSync(config.sys, inMemoryFs, packageVersions, url, filePath);
- }
- if (typeof pkgJson === 'string') {
- try {
- return JSON.parse(pkgJson);
- }
- catch (e) { }
- }
- }
- return null;
- };
- const resolveModuleIdSync = (sys, inMemoryFs, opts) => {
- if (inMemoryFs) {
- const resolverOpts = createCustomResolverSync(sys, inMemoryFs, opts.exts);
- resolverOpts.basedir = dirname(opts.containingFile);
- resolverOpts.packageFilter = opts.packageFilter;
- const resolvedModule = resolve.sync(opts.moduleId, resolverOpts);
- return resolvedModule;
- }
- return null;
- };
- const createCustomResolverSync = (sys, inMemoryFs, exts) => {
- return {
- isFile(filePath) {
- const fsFilePath = normalizeFsPath(filePath);
- const stat = inMemoryFs.statSync(fsFilePath);
- if (stat.isFile) {
- return true;
- }
- if (shouldFetchModule(fsFilePath)) {
- const endsWithExt = exts.some((ext) => fsFilePath.endsWith(ext));
- if (!endsWithExt) {
- return false;
- }
- const url = getNodeModuleFetchUrl(sys, packageVersions, fsFilePath);
- const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, fsFilePath);
- return typeof content === 'string';
- }
- return false;
- },
- isDirectory(dirPath) {
- const fsDirPath = normalizeFsPath(dirPath);
- const stat = inMemoryFs.statSync(fsDirPath);
- if (stat.isDirectory) {
- return true;
- }
- if (shouldFetchModule(fsDirPath)) {
- if (basename(fsDirPath) === 'node_modules') {
- // just the /node_modules directory
- inMemoryFs.sys.createDirSync(fsDirPath);
- inMemoryFs.clearFileCache(fsDirPath);
- return true;
- }
- if (isCommonDirModuleFile(fsDirPath)) {
- // don't bother seeing if it's a directory if it has a common file extension
- return false;
- }
- const checkFileExists = (fileName) => {
- const url = getCommonDirUrl(sys, packageVersions, fsDirPath, fileName);
- const filePath = getCommonDirName(fsDirPath, fileName);
- const content = fetchModuleSync(sys, inMemoryFs, packageVersions, url, filePath);
- return isString$1(content);
- };
- return COMMON_DIR_FILENAMES.some(checkFileExists);
- }
- return false;
- },
- readFileSync(p) {
- const data = inMemoryFs.readFileSync(p);
- if (isString$1(data)) {
- return data;
- }
- throw new Error(`file not found: ${p}`);
- },
- realpathSync(p) {
- const fsFilePath = normalizeFsPath(p);
- try {
- return sys.realpathSync(fsFilePath);
- }
- catch (realpathErr) {
- if (isErrnoException(realpathErr)) {
- if (realpathErr.code !== 'ENOENT') {
- throw realpathErr;
- }
- }
- }
- return fsFilePath;
- },
- extensions: exts,
- };
- };
- /**
- * Type guard to determine if an Error is an instance of `ErrnoException`. For the purposes of this type guard, we
- * must ensure that the `code` field is present. This type guard was written with the `ErrnoException` definition from
- * https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d121716ed123957f6a86f8985eb013fcaddab345/types/node/globals.d.ts#L183-L188
- * in mind.
- * @param err the entity to check the type of
- * @return true if the provided value is an instance of `ErrnoException`, `false` otherwise
- */
- function isErrnoException(err) {
- return err instanceof Error && err.hasOwnProperty('code');
- }
- const patchTypeScriptResolveModule = (config, inMemoryFs) => {
- let compilerExe;
- if (config.sys) {
- compilerExe = config.sys.getCompilerExecutingPath();
- }
- else if (IS_BROWSER_ENV) {
- compilerExe = location.href;
- }
- if (shouldPatchRemoteTypeScript(compilerExe)) {
- const resolveModuleName = (t.__resolveModuleName = t.resolveModuleName);
- t.resolveModuleName = (moduleName, containingFile, compilerOptions, host, cache, redirectedReference) => {
- const resolvedModule = patchedTsResolveModule(config, inMemoryFs, moduleName, containingFile);
- if (resolvedModule) {
- return resolvedModule;
- }
- return resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
- };
- }
- };
- const tsResolveModuleName = (config, compilerCtx, moduleName, containingFile) => {
- const resolveModuleName = t.__resolveModuleName || t.resolveModuleName;
- if (moduleName && resolveModuleName && config.tsCompilerOptions) {
- const host = patchTsSystemFileSystem(config, config.sys, compilerCtx.fs, t.sys);
- const compilerOptions = { ...config.tsCompilerOptions };
- compilerOptions.resolveJsonModule = true;
- return resolveModuleName(moduleName, containingFile, compilerOptions, host);
- }
- return null;
- };
- const tsResolveModuleNamePackageJsonPath = (config, compilerCtx, moduleName, containingFile) => {
- try {
- const resolvedModule = tsResolveModuleName(config, compilerCtx, moduleName, containingFile);
- if (resolvedModule && resolvedModule.resolvedModule && resolvedModule.resolvedModule.resolvedFileName) {
- const rootDir = resolve$1('/');
- let resolvedFileName = resolvedModule.resolvedModule.resolvedFileName;
- for (let i = 0; i < 30; i++) {
- if (rootDir === resolvedFileName) {
- return null;
- }
- resolvedFileName = dirname(resolvedFileName);
- const pkgJsonPath = join(resolvedFileName, 'package.json');
- const exists = config.sys.accessSync(pkgJsonPath);
- if (exists) {
- return normalizePath$1(pkgJsonPath);
- }
- }
- }
- }
- catch (e) {
- config.logger.error(e);
- }
- return null;
- };
- const patchedTsResolveModule = (config, inMemoryFs, moduleName, containingFile) => {
- if (isLocalModule(moduleName)) {
- const containingDir = dirname(containingFile);
- let resolvedFileName = join(containingDir, moduleName);
- resolvedFileName = normalizePath$1(ensureExtension(resolvedFileName, containingFile));
- if (isAbsolute$1(resolvedFileName) && !inMemoryFs.accessSync(resolvedFileName)) {
- return null;
- }
- if (!isAbsolute$1(resolvedFileName) && !resolvedFileName.startsWith('.') && !resolvedFileName.startsWith('/')) {
- resolvedFileName = './' + resolvedFileName;
- }
- const rtn = {
- resolvedModule: {
- extension: getTsResolveExtension(resolvedFileName),
- resolvedFileName,
- packageId: {
- name: moduleName,
- subModuleName: '',
- version: version$3,
- },
- },
- };
- rtn.failedLookupLocations = [];
- return rtn;
- }
- // node module id
- return tsResolveNodeModule(config, inMemoryFs, moduleName, containingFile);
- };
- const tsResolveNodeModule = (config, inMemoryFs, moduleId, containingFile) => {
- if (isStencilCoreImport(moduleId)) {
- const rtn = {
- resolvedModule: {
- extension: t.Extension.Dts,
- resolvedFileName: normalizePath$1(config.sys.getLocalModulePath({
- rootDir: config.rootDir,
- moduleId: '@stencil/core',
- path: 'internal/index.d.ts',
- })),
- packageId: {
- name: moduleId,
- subModuleName: '',
- version: version$3,
- },
- },
- };
- rtn.failedLookupLocations = [];
- return rtn;
- }
- const resolved = resolveRemoteModuleIdSync(config, inMemoryFs, {
- moduleId,
- containingFile,
- });
- if (resolved) {
- const rtn = {
- resolvedModule: {
- extension: t.Extension.Js,
- resolvedFileName: resolved.resolvedUrl,
- packageId: {
- name: moduleId,
- subModuleName: '',
- version: resolved.packageJson.version,
- },
- },
- };
- rtn.failedLookupLocations = [];
- return rtn;
- }
- return null;
- };
- const ensureExtension = (fileName, containingFile) => {
- if (!basename(fileName).includes('.') && isString$1(containingFile)) {
- containingFile = containingFile.toLowerCase();
- if (isJsFile(containingFile)) {
- fileName += '.js';
- }
- else if (isDtsFile(containingFile)) {
- fileName += '.d.ts';
- }
- else if (isTsxFile(containingFile)) {
- fileName += '.tsx';
- }
- else if (isTsFile(containingFile)) {
- fileName += '.ts';
- }
- else if (isJsxFile(containingFile)) {
- fileName += '.jsx';
- }
- }
- return fileName;
- };
- const getTsResolveExtension = (p) => {
- if (isDtsFile(p)) {
- return t.Extension.Dts;
- }
- if (isTsxFile(p)) {
- return t.Extension.Tsx;
- }
- if (isJsFile(p)) {
- return t.Extension.Js;
- }
- if (isJsxFile(p)) {
- return t.Extension.Jsx;
- }
- if (isJsonFile(p)) {
- return t.Extension.Json;
- }
- return t.Extension.Ts;
- };
- const shouldPatchRemoteTypeScript = (compilerExe) => !IS_NODE_ENV && isRemoteUrl(compilerExe);
- /**
- * Rollup plugin that aids in resolving the TypeScript files and performing the transpilation step.
- * @param compilerCtx the current compiler context
- * @param bundleOpts Rollup bundling options to apply during TypeScript compilation
- * @param config the Stencil configuration for the project
- * @returns the rollup plugin for handling TypeScript files.
- */
- const typescriptPlugin = (compilerCtx, bundleOpts, config) => {
- return {
- name: `${bundleOpts.id}TypescriptPlugin`,
- /**
- * A rollup build hook for loading TypeScript files and their associated source maps (if they exist).
- * [Source](https://rollupjs.org/guide/en/#load)
- * @param id the path of the file to load
- * @returns the module matched (with its sourcemap if it exists), null otherwise
- */
- load(id) {
- if (isAbsolute$1(id)) {
- const fsFilePath = normalizeFsPath(id);
- const module = getModule(compilerCtx, fsFilePath);
- if (module) {
- if (!module.sourceMapFileText) {
- return { code: module.staticSourceFileText, map: null };
- }
- const sourceMap = JSON.parse(module.sourceMapFileText);
- sourceMap.sources = sourceMap.sources.map((src) => basename(src));
- return { code: module.staticSourceFileText, map: sourceMap };
- }
- }
- return null;
- },
- /**
- * Performs TypeScript compilation/transpilation, including applying any transformations against the Abstract Syntax
- * Tree (AST) specific to stencil
- * @param _code the code to modify, unused
- * @param id module's identifier
- * @returns the transpiled code, with its associated sourcemap. null otherwise
- */
- transform(_code, id) {
- if (isAbsolute$1(id)) {
- const fsFilePath = normalizeFsPath(id);
- const mod = getModule(compilerCtx, fsFilePath);
- if (mod && mod.cmps.length > 0) {
- const tsResult = t.transpileModule(mod.staticSourceFileText, {
- compilerOptions: config.tsCompilerOptions,
- fileName: mod.sourceFilePath,
- transformers: { before: bundleOpts.customTransformers },
- });
- const sourceMap = tsResult.sourceMapText ? JSON.parse(tsResult.sourceMapText) : null;
- return { code: tsResult.outputText, map: sourceMap };
- }
- }
- return null;
- },
- };
- };
- const resolveIdWithTypeScript = (config, compilerCtx) => {
- return {
- name: `resolveIdWithTypeScript`,
- async resolveId(importee, importer) {
- if (/\0/.test(importee) || !isString$1(importer)) {
- return null;
- }
- const tsResolved = tsResolveModuleName(config, compilerCtx, importee, importer);
- if (tsResolved && tsResolved.resolvedModule) {
- // this is probably a .d.ts file for whatever reason in how TS resolves this
- // use this resolved file as the "importer"
- const tsResolvedPath = tsResolved.resolvedModule.resolvedFileName;
- if (isString$1(tsResolvedPath) && !tsResolvedPath.endsWith('.d.ts')) {
- return tsResolvedPath;
- }
- }
- return null;
- },
- };
- };
- /**
- * Node builtin modules as of v14.5.0
- */
- const NODE_BUILTINS = [
- '_http_agent',
- '_http_client',
- '_http_common',
- '_http_incoming',
- '_http_outgoing',
- '_http_server',
- '_stream_duplex',
- '_stream_passthrough',
- '_stream_readable',
- '_stream_transform',
- '_stream_wrap',
- '_stream_writable',
- '_tls_common',
- '_tls_wrap',
- 'assert',
- 'async_hooks',
- 'buffer',
- 'child_process',
- 'cluster',
- 'console',
- 'constants',
- 'crypto',
- 'dgram',
- 'dns',
- 'domain',
- 'events',
- 'fs',
- 'fs/promises',
- 'http',
- 'http2',
- 'https',
- 'inspector',
- 'module',
- 'net',
- 'os',
- 'path',
- 'perf_hooks',
- 'process',
- 'punycode',
- 'querystring',
- 'readline',
- 'repl',
- 'stream',
- 'string_decoder',
- 'sys',
- 'timers',
- 'tls',
- 'trace_events',
- 'tty',
- 'url',
- 'util',
- 'v8',
- 'vm',
- 'worker_threads',
- 'zlib',
- ];
- class Module {
- static get builtinModules() {
- return NODE_BUILTINS;
- }
- }
- // Rollup 2.42.3
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- function createCommonjsModule(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire();
- }
- }, fn(module, module.exports), module.exports;
- }
- function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
- }
- const WIN_SLASH = '\\\\/';
- const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
- /**
- * Posix glob regex
- */
- const DOT_LITERAL = '\\.';
- const PLUS_LITERAL = '\\+';
- const QMARK_LITERAL = '\\?';
- const SLASH_LITERAL = '\\/';
- const ONE_CHAR = '(?=.)';
- const QMARK = '[^/]';
- const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
- const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
- const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
- const NO_DOT = `(?!${DOT_LITERAL})`;
- const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
- const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
- const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
- const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
- const STAR = `${QMARK}*?`;
- const POSIX_CHARS = {
- DOT_LITERAL,
- PLUS_LITERAL,
- QMARK_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- QMARK,
- END_ANCHOR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- };
- /**
- * Windows glob regex
- */
- const WINDOWS_CHARS = {
- ...POSIX_CHARS,
- SLASH_LITERAL: `[${WIN_SLASH}]`,
- QMARK: WIN_NO_SLASH,
- STAR: `${WIN_NO_SLASH}*?`,
- DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
- NO_DOT: `(?!${DOT_LITERAL})`,
- NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
- NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
- QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
- START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
- END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
- };
- /**
- * POSIX Bracket Regex
- */
- const POSIX_REGEX_SOURCE$1 = {
- alnum: 'a-zA-Z0-9',
- alpha: 'a-zA-Z',
- ascii: '\\x00-\\x7F',
- blank: ' \\t',
- cntrl: '\\x00-\\x1F\\x7F',
- digit: '0-9',
- graph: '\\x21-\\x7E',
- lower: 'a-z',
- print: '\\x20-\\x7E ',
- punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
- space: ' \\t\\r\\n\\v\\f',
- upper: 'A-Z',
- word: 'A-Za-z0-9_',
- xdigit: 'A-Fa-f0-9'
- };
- var constants = {
- MAX_LENGTH: 1024 * 64,
- POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
- // regular expressions
- REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
- REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
- REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
- REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
- REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
- REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
- // Replace globs with equivalent patterns to reduce parsing time.
- REPLACEMENTS: {
- '***': '*',
- '**/**': '**',
- '**/**/**': '**'
- },
- // Digits
- CHAR_0: 48, /* 0 */
- CHAR_9: 57, /* 9 */
- // Alphabet chars.
- CHAR_UPPERCASE_A: 65, /* A */
- CHAR_LOWERCASE_A: 97, /* a */
- CHAR_UPPERCASE_Z: 90, /* Z */
- CHAR_LOWERCASE_Z: 122, /* z */
- CHAR_LEFT_PARENTHESES: 40, /* ( */
- CHAR_RIGHT_PARENTHESES: 41, /* ) */
- CHAR_ASTERISK: 42, /* * */
- // Non-alphabetic chars.
- CHAR_AMPERSAND: 38, /* & */
- CHAR_AT: 64, /* @ */
- CHAR_BACKWARD_SLASH: 92, /* \ */
- CHAR_CARRIAGE_RETURN: 13, /* \r */
- CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
- CHAR_COLON: 58, /* : */
- CHAR_COMMA: 44, /* , */
- CHAR_DOT: 46, /* . */
- CHAR_DOUBLE_QUOTE: 34, /* " */
- CHAR_EQUAL: 61, /* = */
- CHAR_EXCLAMATION_MARK: 33, /* ! */
- CHAR_FORM_FEED: 12, /* \f */
- CHAR_FORWARD_SLASH: 47, /* / */
- CHAR_GRAVE_ACCENT: 96, /* ` */
- CHAR_HASH: 35, /* # */
- CHAR_HYPHEN_MINUS: 45, /* - */
- CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
- CHAR_LEFT_CURLY_BRACE: 123, /* { */
- CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
- CHAR_LINE_FEED: 10, /* \n */
- CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
- CHAR_PERCENT: 37, /* % */
- CHAR_PLUS: 43, /* + */
- CHAR_QUESTION_MARK: 63, /* ? */
- CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
- CHAR_RIGHT_CURLY_BRACE: 125, /* } */
- CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
- CHAR_SEMICOLON: 59, /* ; */
- CHAR_SINGLE_QUOTE: 39, /* ' */
- CHAR_SPACE: 32, /* */
- CHAR_TAB: 9, /* \t */
- CHAR_UNDERSCORE: 95, /* _ */
- CHAR_VERTICAL_LINE: 124, /* | */
- CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
- SEP: path$5.sep,
- /**
- * Create EXTGLOB_CHARS
- */
- extglobChars(chars) {
- return {
- '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
- '?': { type: 'qmark', open: '(?:', close: ')?' },
- '+': { type: 'plus', open: '(?:', close: ')+' },
- '*': { type: 'star', open: '(?:', close: ')*' },
- '@': { type: 'at', open: '(?:', close: ')' }
- };
- },
- /**
- * Create GLOB_CHARS
- */
- globChars(win32) {
- return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
- }
- };
- var utils = createCommonjsModule(function (module, exports) {
- const win32 = process.platform === 'win32';
- const {
- REGEX_BACKSLASH,
- REGEX_REMOVE_BACKSLASH,
- REGEX_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_GLOBAL
- } = constants;
- exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
- exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
- exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
- exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
- exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
- exports.removeBackslashes = str => {
- return str.replace(REGEX_REMOVE_BACKSLASH, match => {
- return match === '\\' ? '' : match;
- });
- };
- exports.supportsLookbehinds = () => {
- const segs = process.version.slice(1).split('.').map(Number);
- if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
- return true;
- }
- return false;
- };
- exports.isWindows = options => {
- if (options && typeof options.windows === 'boolean') {
- return options.windows;
- }
- return win32 === true || path$5.sep === '\\';
- };
- exports.escapeLast = (input, char, lastIdx) => {
- const idx = input.lastIndexOf(char, lastIdx);
- if (idx === -1) return input;
- if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
- return `${input.slice(0, idx)}\\${input.slice(idx)}`;
- };
- exports.removePrefix = (input, state = {}) => {
- let output = input;
- if (output.startsWith('./')) {
- output = output.slice(2);
- state.prefix = './';
- }
- return output;
- };
- exports.wrapOutput = (input, state = {}, options = {}) => {
- const prepend = options.contains ? '' : '^';
- const append = options.contains ? '' : '$';
- let output = `${prepend}(?:${input})${append}`;
- if (state.negated === true) {
- output = `(?:^(?!${output}).*$)`;
- }
- return output;
- };
- });
- const {
- CHAR_ASTERISK, /* * */
- CHAR_AT, /* @ */
- CHAR_BACKWARD_SLASH, /* \ */
- CHAR_COMMA, /* , */
- CHAR_DOT, /* . */
- CHAR_EXCLAMATION_MARK, /* ! */
- CHAR_FORWARD_SLASH, /* / */
- CHAR_LEFT_CURLY_BRACE, /* { */
- CHAR_LEFT_PARENTHESES, /* ( */
- CHAR_LEFT_SQUARE_BRACKET, /* [ */
- CHAR_PLUS, /* + */
- CHAR_QUESTION_MARK, /* ? */
- CHAR_RIGHT_CURLY_BRACE, /* } */
- CHAR_RIGHT_PARENTHESES, /* ) */
- CHAR_RIGHT_SQUARE_BRACKET /* ] */
- } = constants;
- const isPathSeparator = code => {
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
- };
- const depth = token => {
- if (token.isPrefix !== true) {
- token.depth = token.isGlobstar ? Infinity : 1;
- }
- };
- /**
- * Quickly scans a glob pattern and returns an object with a handful of
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
- *
- * ```js
- * const pm = require('picomatch');
- * console.log(pm.scan('foo/bar/*.js'));
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
- * ```
- * @param {String} `str`
- * @param {Object} `options`
- * @return {Object} Returns an object with tokens and regex source string.
- * @api public
- */
- const scan = (input, options) => {
- const opts = options || {};
- const length = input.length - 1;
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
- const slashes = [];
- const tokens = [];
- const parts = [];
- let str = input;
- let index = -1;
- let start = 0;
- let lastIndex = 0;
- let isBrace = false;
- let isBracket = false;
- let isGlob = false;
- let isExtglob = false;
- let isGlobstar = false;
- let braceEscaped = false;
- let backslashes = false;
- let negated = false;
- let negatedExtglob = false;
- let finished = false;
- let braces = 0;
- let prev;
- let code;
- let token = { value: '', depth: 0, isGlob: false };
- const eos = () => index >= length;
- const peek = () => str.charCodeAt(index + 1);
- const advance = () => {
- prev = code;
- return str.charCodeAt(++index);
- };
- while (index < length) {
- code = advance();
- let next;
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braceEscaped = true;
- }
- continue;
- }
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (code === CHAR_LEFT_CURLY_BRACE) {
- braces++;
- continue;
- }
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (braceEscaped !== true && code === CHAR_COMMA) {
- isBrace = token.isBrace = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_RIGHT_CURLY_BRACE) {
- braces--;
- if (braces === 0) {
- braceEscaped = false;
- isBrace = token.isBrace = true;
- finished = true;
- break;
- }
- }
- }
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_FORWARD_SLASH) {
- slashes.push(index);
- tokens.push(token);
- token = { value: '', depth: 0, isGlob: false };
- if (finished === true) continue;
- if (prev === CHAR_DOT && index === (start + 1)) {
- start += 2;
- continue;
- }
- lastIndex = index + 1;
- continue;
- }
- if (opts.noext !== true) {
- const isExtglobChar = code === CHAR_PLUS
- || code === CHAR_AT
- || code === CHAR_ASTERISK
- || code === CHAR_QUESTION_MARK
- || code === CHAR_EXCLAMATION_MARK;
- if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- isExtglob = token.isExtglob = true;
- finished = true;
- if (code === CHAR_EXCLAMATION_MARK && index === start) {
- negatedExtglob = true;
- }
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- }
- if (code === CHAR_ASTERISK) {
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_QUESTION_MARK) {
- isGlob = token.isGlob = true;
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
- while (eos() !== true && (next = advance())) {
- if (next === CHAR_BACKWARD_SLASH) {
- backslashes = token.backslashes = true;
- advance();
- continue;
- }
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
- isBracket = token.isBracket = true;
- isGlob = token.isGlob = true;
- finished = true;
- break;
- }
- }
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
- negated = token.negated = true;
- start++;
- continue;
- }
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
- isGlob = token.isGlob = true;
- if (scanToEnd === true) {
- while (eos() !== true && (code = advance())) {
- if (code === CHAR_LEFT_PARENTHESES) {
- backslashes = token.backslashes = true;
- code = advance();
- continue;
- }
- if (code === CHAR_RIGHT_PARENTHESES) {
- finished = true;
- break;
- }
- }
- continue;
- }
- break;
- }
- if (isGlob === true) {
- finished = true;
- if (scanToEnd === true) {
- continue;
- }
- break;
- }
- }
- if (opts.noext === true) {
- isExtglob = false;
- isGlob = false;
- }
- let base = str;
- let prefix = '';
- let glob = '';
- if (start > 0) {
- prefix = str.slice(0, start);
- str = str.slice(start);
- lastIndex -= start;
- }
- if (base && isGlob === true && lastIndex > 0) {
- base = str.slice(0, lastIndex);
- glob = str.slice(lastIndex);
- } else if (isGlob === true) {
- base = '';
- glob = str;
- } else {
- base = str;
- }
- if (base && base !== '' && base !== '/' && base !== str) {
- if (isPathSeparator(base.charCodeAt(base.length - 1))) {
- base = base.slice(0, -1);
- }
- }
- if (opts.unescape === true) {
- if (glob) glob = utils.removeBackslashes(glob);
- if (base && backslashes === true) {
- base = utils.removeBackslashes(base);
- }
- }
- const state = {
- prefix,
- input,
- start,
- base,
- glob,
- isBrace,
- isBracket,
- isGlob,
- isExtglob,
- isGlobstar,
- negated,
- negatedExtglob
- };
- if (opts.tokens === true) {
- state.maxDepth = 0;
- if (!isPathSeparator(code)) {
- tokens.push(token);
- }
- state.tokens = tokens;
- }
- if (opts.parts === true || opts.tokens === true) {
- let prevIndex;
- for (let idx = 0; idx < slashes.length; idx++) {
- const n = prevIndex ? prevIndex + 1 : start;
- const i = slashes[idx];
- const value = input.slice(n, i);
- if (opts.tokens) {
- if (idx === 0 && start !== 0) {
- tokens[idx].isPrefix = true;
- tokens[idx].value = prefix;
- } else {
- tokens[idx].value = value;
- }
- depth(tokens[idx]);
- state.maxDepth += tokens[idx].depth;
- }
- if (idx !== 0 || value !== '') {
- parts.push(value);
- }
- prevIndex = i;
- }
- if (prevIndex && prevIndex + 1 < input.length) {
- const value = input.slice(prevIndex + 1);
- parts.push(value);
- if (opts.tokens) {
- tokens[tokens.length - 1].value = value;
- depth(tokens[tokens.length - 1]);
- state.maxDepth += tokens[tokens.length - 1].depth;
- }
- }
- state.slashes = slashes;
- state.parts = parts;
- }
- return state;
- };
- var scan_1 = scan;
- /**
- * Constants
- */
- const {
- MAX_LENGTH,
- POSIX_REGEX_SOURCE,
- REGEX_NON_SPECIAL_CHARS,
- REGEX_SPECIAL_CHARS_BACKREF,
- REPLACEMENTS
- } = constants;
- /**
- * Helpers
- */
- const expandRange = (args, options) => {
- if (typeof options.expandRange === 'function') {
- return options.expandRange(...args, options);
- }
- args.sort();
- const value = `[${args.join('-')}]`;
- try {
- /* eslint-disable-next-line no-new */
- new RegExp(value);
- } catch (ex) {
- return args.map(v => utils.escapeRegex(v)).join('..');
- }
- return value;
- };
- /**
- * Create the message for a syntax error
- */
- const syntaxError = (type, char) => {
- return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
- };
- /**
- * Parse the given input string.
- * @param {String} input
- * @param {Object} options
- * @return {Object}
- */
- const parse$1 = (input, options) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected a string');
- }
- input = REPLACEMENTS[input] || input;
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- let len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
- const bos = { type: 'bos', value: '', output: opts.prepend || '' };
- const tokens = [bos];
- const capture = opts.capture ? '' : '?:';
- const win32 = utils.isWindows(options);
- // create constants based on platform, for windows or posix
- const PLATFORM_CHARS = constants.globChars(win32);
- const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
- const {
- DOT_LITERAL,
- PLUS_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOT_SLASH,
- NO_DOTS_SLASH,
- QMARK,
- QMARK_NO_DOT,
- STAR,
- START_ANCHOR
- } = PLATFORM_CHARS;
- const globstar = opts => {
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const nodot = opts.dot ? '' : NO_DOT;
- const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
- let star = opts.bash === true ? globstar(opts) : STAR;
- if (opts.capture) {
- star = `(${star})`;
- }
- // minimatch options support
- if (typeof opts.noext === 'boolean') {
- opts.noextglob = opts.noext;
- }
- const state = {
- input,
- index: -1,
- start: 0,
- dot: opts.dot === true,
- consumed: '',
- output: '',
- prefix: '',
- backtrack: false,
- negated: false,
- brackets: 0,
- braces: 0,
- parens: 0,
- quotes: 0,
- globstar: false,
- tokens
- };
- input = utils.removePrefix(input, state);
- len = input.length;
- const extglobs = [];
- const braces = [];
- const stack = [];
- let prev = bos;
- let value;
- /**
- * Tokenizing helpers
- */
- const eos = () => state.index === len - 1;
- const peek = state.peek = (n = 1) => input[state.index + n];
- const advance = state.advance = () => input[++state.index] || '';
- const remaining = () => input.slice(state.index + 1);
- const consume = (value = '', num = 0) => {
- state.consumed += value;
- state.index += num;
- };
- const append = token => {
- state.output += token.output != null ? token.output : token.value;
- consume(token.value);
- };
- const negate = () => {
- let count = 1;
- while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
- advance();
- state.start++;
- count++;
- }
- if (count % 2 === 0) {
- return false;
- }
- state.negated = true;
- state.start++;
- return true;
- };
- const increment = type => {
- state[type]++;
- stack.push(type);
- };
- const decrement = type => {
- state[type]--;
- stack.pop();
- };
- /**
- * Push tokens onto the tokens array. This helper speeds up
- * tokenizing by 1) helping us avoid backtracking as much as possible,
- * and 2) helping us avoid creating extra tokens when consecutive
- * characters are plain text. This improves performance and simplifies
- * lookbehinds.
- */
- const push = tok => {
- if (prev.type === 'globstar') {
- const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
- const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
- if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
- state.output = state.output.slice(0, -prev.output.length);
- prev.type = 'star';
- prev.value = '*';
- prev.output = star;
- state.output += prev.output;
- }
- }
- if (extglobs.length && tok.type !== 'paren') {
- extglobs[extglobs.length - 1].inner += tok.value;
- }
- if (tok.value || tok.output) append(tok);
- if (prev && prev.type === 'text' && tok.type === 'text') {
- prev.value += tok.value;
- prev.output = (prev.output || '') + tok.value;
- return;
- }
- tok.prev = prev;
- tokens.push(tok);
- prev = tok;
- };
- const extglobOpen = (type, value) => {
- const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
- token.prev = prev;
- token.parens = state.parens;
- token.output = state.output;
- const output = (opts.capture ? '(' : '') + token.open;
- increment('parens');
- push({ type, value, output: state.output ? '' : ONE_CHAR });
- push({ type: 'paren', extglob: true, value: advance(), output });
- extglobs.push(token);
- };
- const extglobClose = token => {
- let output = token.close + (opts.capture ? ')' : '');
- let rest;
- if (token.type === 'negate') {
- let extglobStar = star;
- if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
- extglobStar = globstar(opts);
- }
- if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
- output = token.close = `)$))${extglobStar}`;
- }
- if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
- output = token.close = `)${rest})${extglobStar})`;
- }
- if (token.prev.type === 'bos') {
- state.negatedExtglob = true;
- }
- }
- push({ type: 'paren', extglob: true, value, output });
- decrement('parens');
- };
- /**
- * Fast paths
- */
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
- let backslashes = false;
- let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
- if (first === '\\') {
- backslashes = true;
- return m;
- }
- if (first === '?') {
- if (esc) {
- return esc + first + (rest ? QMARK.repeat(rest.length) : '');
- }
- if (index === 0) {
- return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
- }
- return QMARK.repeat(chars.length);
- }
- if (first === '.') {
- return DOT_LITERAL.repeat(chars.length);
- }
- if (first === '*') {
- if (esc) {
- return esc + first + (rest ? star : '');
- }
- return star;
- }
- return esc ? m : `\\${m}`;
- });
- if (backslashes === true) {
- if (opts.unescape === true) {
- output = output.replace(/\\/g, '');
- } else {
- output = output.replace(/\\+/g, m => {
- return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
- });
- }
- }
- if (output === input && opts.contains === true) {
- state.output = input;
- return state;
- }
- state.output = utils.wrapOutput(output, state, options);
- return state;
- }
- /**
- * Tokenize input until we reach end-of-string
- */
- while (!eos()) {
- value = advance();
- if (value === '\u0000') {
- continue;
- }
- /**
- * Escaped characters
- */
- if (value === '\\') {
- const next = peek();
- if (next === '/' && opts.bash !== true) {
- continue;
- }
- if (next === '.' || next === ';') {
- continue;
- }
- if (!next) {
- value += '\\';
- push({ type: 'text', value });
- continue;
- }
- // collapse slashes to reduce potential for exploits
- const match = /^\\+/.exec(remaining());
- let slashes = 0;
- if (match && match[0].length > 2) {
- slashes = match[0].length;
- state.index += slashes;
- if (slashes % 2 !== 0) {
- value += '\\';
- }
- }
- if (opts.unescape === true) {
- value = advance();
- } else {
- value += advance();
- }
- if (state.brackets === 0) {
- push({ type: 'text', value });
- continue;
- }
- }
- /**
- * If we're inside a regex character class, continue
- * until we reach the closing bracket.
- */
- if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
- if (opts.posix !== false && value === ':') {
- const inner = prev.value.slice(1);
- if (inner.includes('[')) {
- prev.posix = true;
- if (inner.includes(':')) {
- const idx = prev.value.lastIndexOf('[');
- const pre = prev.value.slice(0, idx);
- const rest = prev.value.slice(idx + 2);
- const posix = POSIX_REGEX_SOURCE[rest];
- if (posix) {
- prev.value = pre + posix;
- state.backtrack = true;
- advance();
- if (!bos.output && tokens.indexOf(prev) === 1) {
- bos.output = ONE_CHAR;
- }
- continue;
- }
- }
- }
- }
- if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
- value = `\\${value}`;
- }
- if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
- value = `\\${value}`;
- }
- if (opts.posix === true && value === '!' && prev.value === '[') {
- value = '^';
- }
- prev.value += value;
- append({ value });
- continue;
- }
- /**
- * If we're inside a quoted string, continue
- * until we reach the closing double quote.
- */
- if (state.quotes === 1 && value !== '"') {
- value = utils.escapeRegex(value);
- prev.value += value;
- append({ value });
- continue;
- }
- /**
- * Double quotes
- */
- if (value === '"') {
- state.quotes = state.quotes === 1 ? 0 : 1;
- if (opts.keepQuotes === true) {
- push({ type: 'text', value });
- }
- continue;
- }
- /**
- * Parentheses
- */
- if (value === '(') {
- increment('parens');
- push({ type: 'paren', value });
- continue;
- }
- if (value === ')') {
- if (state.parens === 0 && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '('));
- }
- const extglob = extglobs[extglobs.length - 1];
- if (extglob && state.parens === extglob.parens + 1) {
- extglobClose(extglobs.pop());
- continue;
- }
- push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
- decrement('parens');
- continue;
- }
- /**
- * Square brackets
- */
- if (value === '[') {
- if (opts.nobracket === true || !remaining().includes(']')) {
- if (opts.nobracket !== true && opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('closing', ']'));
- }
- value = `\\${value}`;
- } else {
- increment('brackets');
- }
- push({ type: 'bracket', value });
- continue;
- }
- if (value === ']') {
- if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
- if (state.brackets === 0) {
- if (opts.strictBrackets === true) {
- throw new SyntaxError(syntaxError('opening', '['));
- }
- push({ type: 'text', value, output: `\\${value}` });
- continue;
- }
- decrement('brackets');
- const prevValue = prev.value.slice(1);
- if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
- value = `/${value}`;
- }
- prev.value += value;
- append({ value });
- // when literal brackets are explicitly disabled
- // assume we should match with a regex character class
- if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
- continue;
- }
- const escaped = utils.escapeRegex(prev.value);
- state.output = state.output.slice(0, -prev.value.length);
- // when literal brackets are explicitly enabled
- // assume we should escape the brackets to match literal characters
- if (opts.literalBrackets === true) {
- state.output += escaped;
- prev.value = escaped;
- continue;
- }
- // when the user specifies nothing, try to match both
- prev.value = `(${capture}${escaped}|${prev.value})`;
- state.output += prev.value;
- continue;
- }
- /**
- * Braces
- */
- if (value === '{' && opts.nobrace !== true) {
- increment('braces');
- const open = {
- type: 'brace',
- value,
- output: '(',
- outputIndex: state.output.length,
- tokensIndex: state.tokens.length
- };
- braces.push(open);
- push(open);
- continue;
- }
- if (value === '}') {
- const brace = braces[braces.length - 1];
- if (opts.nobrace === true || !brace) {
- push({ type: 'text', value, output: value });
- continue;
- }
- let output = ')';
- if (brace.dots === true) {
- const arr = tokens.slice();
- const range = [];
- for (let i = arr.length - 1; i >= 0; i--) {
- tokens.pop();
- if (arr[i].type === 'brace') {
- break;
- }
- if (arr[i].type !== 'dots') {
- range.unshift(arr[i].value);
- }
- }
- output = expandRange(range, opts);
- state.backtrack = true;
- }
- if (brace.comma !== true && brace.dots !== true) {
- const out = state.output.slice(0, brace.outputIndex);
- const toks = state.tokens.slice(brace.tokensIndex);
- brace.value = brace.output = '\\{';
- value = output = '\\}';
- state.output = out;
- for (const t of toks) {
- state.output += (t.output || t.value);
- }
- }
- push({ type: 'brace', value, output });
- decrement('braces');
- braces.pop();
- continue;
- }
- /**
- * Pipes
- */
- if (value === '|') {
- if (extglobs.length > 0) {
- extglobs[extglobs.length - 1].conditions++;
- }
- push({ type: 'text', value });
- continue;
- }
- /**
- * Commas
- */
- if (value === ',') {
- let output = value;
- const brace = braces[braces.length - 1];
- if (brace && stack[stack.length - 1] === 'braces') {
- brace.comma = true;
- output = '|';
- }
- push({ type: 'comma', value, output });
- continue;
- }
- /**
- * Slashes
- */
- if (value === '/') {
- // if the beginning of the glob is "./", advance the start
- // to the current index, and don't add the "./" characters
- // to the state. This greatly simplifies lookbehinds when
- // checking for BOS characters like "!" and "." (not "./")
- if (prev.type === 'dot' && state.index === state.start + 1) {
- state.start = state.index + 1;
- state.consumed = '';
- state.output = '';
- tokens.pop();
- prev = bos; // reset "prev" to the first token
- continue;
- }
- push({ type: 'slash', value, output: SLASH_LITERAL });
- continue;
- }
- /**
- * Dots
- */
- if (value === '.') {
- if (state.braces > 0 && prev.type === 'dot') {
- if (prev.value === '.') prev.output = DOT_LITERAL;
- const brace = braces[braces.length - 1];
- prev.type = 'dots';
- prev.output += value;
- prev.value += value;
- brace.dots = true;
- continue;
- }
- if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
- push({ type: 'text', value, output: DOT_LITERAL });
- continue;
- }
- push({ type: 'dot', value, output: DOT_LITERAL });
- continue;
- }
- /**
- * Question marks
- */
- if (value === '?') {
- const isGroup = prev && prev.value === '(';
- if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('qmark', value);
- continue;
- }
- if (prev && prev.type === 'paren') {
- const next = peek();
- let output = value;
- if (next === '<' && !utils.supportsLookbehinds()) {
- throw new Error('Node.js v10 or higher is required for regex lookbehinds');
- }
- if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
- output = `\\${value}`;
- }
- push({ type: 'text', value, output });
- continue;
- }
- if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
- push({ type: 'qmark', value, output: QMARK_NO_DOT });
- continue;
- }
- push({ type: 'qmark', value, output: QMARK });
- continue;
- }
- /**
- * Exclamation
- */
- if (value === '!') {
- if (opts.noextglob !== true && peek() === '(') {
- if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
- extglobOpen('negate', value);
- continue;
- }
- }
- if (opts.nonegate !== true && state.index === 0) {
- negate();
- continue;
- }
- }
- /**
- * Plus
- */
- if (value === '+') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- extglobOpen('plus', value);
- continue;
- }
- if ((prev && prev.value === '(') || opts.regex === false) {
- push({ type: 'plus', value, output: PLUS_LITERAL });
- continue;
- }
- if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
- push({ type: 'plus', value });
- continue;
- }
- push({ type: 'plus', value: PLUS_LITERAL });
- continue;
- }
- /**
- * Plain text
- */
- if (value === '@') {
- if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
- push({ type: 'at', extglob: true, value, output: '' });
- continue;
- }
- push({ type: 'text', value });
- continue;
- }
- /**
- * Plain text
- */
- if (value !== '*') {
- if (value === '$' || value === '^') {
- value = `\\${value}`;
- }
- const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
- if (match) {
- value += match[0];
- state.index += match[0].length;
- }
- push({ type: 'text', value });
- continue;
- }
- /**
- * Stars
- */
- if (prev && (prev.type === 'globstar' || prev.star === true)) {
- prev.type = 'star';
- prev.star = true;
- prev.value += value;
- prev.output = star;
- state.backtrack = true;
- state.globstar = true;
- consume(value);
- continue;
- }
- let rest = remaining();
- if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
- extglobOpen('star', value);
- continue;
- }
- if (prev.type === 'star') {
- if (opts.noglobstar === true) {
- consume(value);
- continue;
- }
- const prior = prev.prev;
- const before = prior.prev;
- const isStart = prior.type === 'slash' || prior.type === 'bos';
- const afterStar = before && (before.type === 'star' || before.type === 'globstar');
- if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
- push({ type: 'star', value, output: '' });
- continue;
- }
- const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
- const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
- if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
- push({ type: 'star', value, output: '' });
- continue;
- }
- // strip consecutive `/**/`
- while (rest.slice(0, 3) === '/**') {
- const after = input[state.index + 4];
- if (after && after !== '/') {
- break;
- }
- rest = rest.slice(3);
- consume('/**', 3);
- }
- if (prior.type === 'bos' && eos()) {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = globstar(opts);
- state.output = prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = 'globstar';
- prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
- prev.value += value;
- state.globstar = true;
- state.output += prior.output + prev.output;
- consume(value);
- continue;
- }
- if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
- const end = rest[1] !== void 0 ? '|$' : '';
- state.output = state.output.slice(0, -(prior.output + prev.output).length);
- prior.output = `(?:${prior.output}`;
- prev.type = 'globstar';
- prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
- prev.value += value;
- state.output += prior.output + prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
- if (prior.type === 'bos' && rest[0] === '/') {
- prev.type = 'globstar';
- prev.value += value;
- prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
- state.output = prev.output;
- state.globstar = true;
- consume(value + advance());
- push({ type: 'slash', value: '/', output: '' });
- continue;
- }
- // remove single star from output
- state.output = state.output.slice(0, -prev.output.length);
- // reset previous token to globstar
- prev.type = 'globstar';
- prev.output = globstar(opts);
- prev.value += value;
- // reset output with globstar
- state.output += prev.output;
- state.globstar = true;
- consume(value);
- continue;
- }
- const token = { type: 'star', value, output: star };
- if (opts.bash === true) {
- token.output = '.*?';
- if (prev.type === 'bos' || prev.type === 'slash') {
- token.output = nodot + token.output;
- }
- push(token);
- continue;
- }
- if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
- token.output = value;
- push(token);
- continue;
- }
- if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
- if (prev.type === 'dot') {
- state.output += NO_DOT_SLASH;
- prev.output += NO_DOT_SLASH;
- } else if (opts.dot === true) {
- state.output += NO_DOTS_SLASH;
- prev.output += NO_DOTS_SLASH;
- } else {
- state.output += nodot;
- prev.output += nodot;
- }
- if (peek() !== '*') {
- state.output += ONE_CHAR;
- prev.output += ONE_CHAR;
- }
- }
- push(token);
- }
- while (state.brackets > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
- state.output = utils.escapeLast(state.output, '[');
- decrement('brackets');
- }
- while (state.parens > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
- state.output = utils.escapeLast(state.output, '(');
- decrement('parens');
- }
- while (state.braces > 0) {
- if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
- state.output = utils.escapeLast(state.output, '{');
- decrement('braces');
- }
- if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
- push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
- }
- // rebuild the output if we had to backtrack at any point
- if (state.backtrack === true) {
- state.output = '';
- for (const token of state.tokens) {
- state.output += token.output != null ? token.output : token.value;
- if (token.suffix) {
- state.output += token.suffix;
- }
- }
- }
- return state;
- };
- /**
- * Fast paths for creating regular expressions for common glob patterns.
- * This can significantly speed up processing and has very little downside
- * impact when none of the fast paths match.
- */
- parse$1.fastpaths = (input, options) => {
- const opts = { ...options };
- const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
- const len = input.length;
- if (len > max) {
- throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
- }
- input = REPLACEMENTS[input] || input;
- const win32 = utils.isWindows(options);
- // create constants based on platform, for windows or posix
- const {
- DOT_LITERAL,
- SLASH_LITERAL,
- ONE_CHAR,
- DOTS_SLASH,
- NO_DOT,
- NO_DOTS,
- NO_DOTS_SLASH,
- STAR,
- START_ANCHOR
- } = constants.globChars(win32);
- const nodot = opts.dot ? NO_DOTS : NO_DOT;
- const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
- const capture = opts.capture ? '' : '?:';
- const state = { negated: false, prefix: '' };
- let star = opts.bash === true ? '.*?' : STAR;
- if (opts.capture) {
- star = `(${star})`;
- }
- const globstar = opts => {
- if (opts.noglobstar === true) return star;
- return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
- };
- const create = str => {
- switch (str) {
- case '*':
- return `${nodot}${ONE_CHAR}${star}`;
- case '.*':
- return `${DOT_LITERAL}${ONE_CHAR}${star}`;
- case '*.*':
- return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case '*/*':
- return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
- case '**':
- return nodot + globstar(opts);
- case '**/*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
- case '**/*.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
- case '**/.*':
- return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
- default: {
- const match = /^(.*?)\.(\w+)$/.exec(str);
- if (!match) return;
- const source = create(match[1]);
- if (!source) return;
- return source + DOT_LITERAL + match[2];
- }
- }
- };
- const output = utils.removePrefix(input, state);
- let source = create(output);
- if (source && opts.strictSlashes !== true) {
- source += `${SLASH_LITERAL}?`;
- }
- return source;
- };
- var parse_1 = parse$1;
- const isObject$1 = val => val && typeof val === 'object' && !Array.isArray(val);
- /**
- * Creates a matcher function from one or more glob patterns. The
- * returned function takes a string to match as its first argument,
- * and returns true if the string is a match. The returned matcher
- * function also takes a boolean as the second argument that, when true,
- * returns an object with additional information.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch(glob[, options]);
- *
- * const isMatch = picomatch('*.!(*a)');
- * console.log(isMatch('a.a')); //=> false
- * console.log(isMatch('a.b')); //=> true
- * ```
- * @name picomatch
- * @param {String|Array} `globs` One or more glob patterns.
- * @param {Object=} `options`
- * @return {Function=} Returns a matcher function.
- * @api public
- */
- const picomatch$1 = (glob, options, returnState = false) => {
- if (Array.isArray(glob)) {
- const fns = glob.map(input => picomatch$1(input, options, returnState));
- const arrayMatcher = str => {
- for (const isMatch of fns) {
- const state = isMatch(str);
- if (state) return state;
- }
- return false;
- };
- return arrayMatcher;
- }
- const isState = isObject$1(glob) && glob.tokens && glob.input;
- if (glob === '' || (typeof glob !== 'string' && !isState)) {
- throw new TypeError('Expected pattern to be a non-empty string');
- }
- const opts = options || {};
- const posix = utils.isWindows(options);
- const regex = isState
- ? picomatch$1.compileRe(glob, options)
- : picomatch$1.makeRe(glob, options, false, true);
- const state = regex.state;
- delete regex.state;
- let isIgnored = () => false;
- if (opts.ignore) {
- const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
- isIgnored = picomatch$1(opts.ignore, ignoreOpts, returnState);
- }
- const matcher = (input, returnObject = false) => {
- const { isMatch, match, output } = picomatch$1.test(input, regex, options, { glob, posix });
- const result = { glob, state, regex, posix, input, output, match, isMatch };
- if (typeof opts.onResult === 'function') {
- opts.onResult(result);
- }
- if (isMatch === false) {
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (isIgnored(input)) {
- if (typeof opts.onIgnore === 'function') {
- opts.onIgnore(result);
- }
- result.isMatch = false;
- return returnObject ? result : false;
- }
- if (typeof opts.onMatch === 'function') {
- opts.onMatch(result);
- }
- return returnObject ? result : true;
- };
- if (returnState) {
- matcher.state = state;
- }
- return matcher;
- };
- /**
- * Test `input` with the given `regex`. This is used by the main
- * `picomatch()` function to test the input string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.test(input, regex[, options]);
- *
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp} `regex`
- * @return {Object} Returns an object with matching info.
- * @api public
- */
- picomatch$1.test = (input, regex, options, { glob, posix } = {}) => {
- if (typeof input !== 'string') {
- throw new TypeError('Expected input to be a string');
- }
- if (input === '') {
- return { isMatch: false, output: '' };
- }
- const opts = options || {};
- const format = opts.format || (posix ? utils.toPosixSlashes : null);
- let match = input === glob;
- let output = (match && format) ? format(input) : input;
- if (match === false) {
- output = format ? format(input) : input;
- match = output === glob;
- }
- if (match === false || opts.capture === true) {
- if (opts.matchBase === true || opts.basename === true) {
- match = picomatch$1.matchBase(input, regex, options, posix);
- } else {
- match = regex.exec(output);
- }
- }
- return { isMatch: Boolean(match), match, output };
- };
- /**
- * Match the basename of a filepath.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.matchBase(input, glob[, options]);
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
- * ```
- * @param {String} `input` String to test.
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
- * @return {Boolean}
- * @api public
- */
- picomatch$1.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
- const regex = glob instanceof RegExp ? glob : picomatch$1.makeRe(glob, options);
- return regex.test(path$5.basename(input));
- };
- /**
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.isMatch(string, patterns[, options]);
- *
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
- * ```
- * @param {String|Array} str The string to test.
- * @param {String|Array} patterns One or more glob patterns to use for matching.
- * @param {Object} [options] See available [options](#options).
- * @return {Boolean} Returns true if any patterns match `str`
- * @api public
- */
- picomatch$1.isMatch = (str, patterns, options) => picomatch$1(patterns, options)(str);
- /**
- * Parse a glob pattern to create the source string for a regular
- * expression.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const result = picomatch.parse(pattern[, options]);
- * ```
- * @param {String} `pattern`
- * @param {Object} `options`
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
- * @api public
- */
- picomatch$1.parse = (pattern, options) => {
- if (Array.isArray(pattern)) return pattern.map(p => picomatch$1.parse(p, options));
- return parse_1(pattern, { ...options, fastpaths: false });
- };
- /**
- * Scan a glob pattern to separate the pattern into segments.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.scan(input[, options]);
- *
- * const result = picomatch.scan('!./foo/*.js');
- * console.log(result);
- * { prefix: '!./',
- * input: '!./foo/*.js',
- * start: 3,
- * base: 'foo',
- * glob: '*.js',
- * isBrace: false,
- * isBracket: false,
- * isGlob: true,
- * isExtglob: false,
- * isGlobstar: false,
- * negated: true }
- * ```
- * @param {String} `input` Glob pattern to scan.
- * @param {Object} `options`
- * @return {Object} Returns an object with
- * @api public
- */
- picomatch$1.scan = (input, options) => scan_1(input, options);
- /**
- * Compile a regular expression from the `state` object returned by the
- * [parse()](#parse) method.
- *
- * @param {Object} `state`
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
- * @return {RegExp}
- * @api public
- */
- picomatch$1.compileRe = (state, options, returnOutput = false, returnState = false) => {
- if (returnOutput === true) {
- return state.output;
- }
- const opts = options || {};
- const prepend = opts.contains ? '' : '^';
- const append = opts.contains ? '' : '$';
- let source = `${prepend}(?:${state.output})${append}`;
- if (state && state.negated === true) {
- source = `^(?!${source}).*$`;
- }
- const regex = picomatch$1.toRegex(source, options);
- if (returnState === true) {
- regex.state = state;
- }
- return regex;
- };
- /**
- * Create a regular expression from a parsed glob pattern.
- *
- * ```js
- * const picomatch = require('picomatch');
- * const state = picomatch.parse('*.js');
- * // picomatch.compileRe(state[, options]);
- *
- * console.log(picomatch.compileRe(state));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `state` The object returned from the `.parse` method.
- * @param {Object} `options`
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
- * @return {RegExp} Returns a regex created from the given pattern.
- * @api public
- */
- picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
- if (!input || typeof input !== 'string') {
- throw new TypeError('Expected a non-empty string');
- }
- let parsed = { negated: false, fastpaths: true };
- if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
- parsed.output = parse_1.fastpaths(input, options);
- }
- if (!parsed.output) {
- parsed = parse_1(input, options);
- }
- return picomatch$1.compileRe(parsed, options, returnOutput, returnState);
- };
- /**
- * Create a regular expression from the given regex source string.
- *
- * ```js
- * const picomatch = require('picomatch');
- * // picomatch.toRegex(source[, options]);
- *
- * const { output } = picomatch.parse('*.js');
- * console.log(picomatch.toRegex(output));
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
- * ```
- * @param {String} `source` Regular expression source string.
- * @param {Object} `options`
- * @return {RegExp}
- * @api public
- */
- picomatch$1.toRegex = (source, options) => {
- try {
- const opts = options || {};
- return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
- } catch (err) {
- if (options && options.debug === true) throw err;
- return /$^/;
- }
- };
- /**
- * Picomatch constants.
- * @return {Object}
- */
- picomatch$1.constants = constants;
- /**
- * Expose "picomatch"
- */
- var picomatch_1 = picomatch$1;
- var picomatch = picomatch_1;
- function walk$2(ast, { enter, leave }) {
- return visit(ast, null, enter, leave);
- }
- let should_skip = false;
- let should_remove = false;
- let replacement = null;
- const context = {
- skip: () => should_skip = true,
- remove: () => should_remove = true,
- replace: (node) => replacement = node
- };
- function replace$1(parent, prop, index, node) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
- }
- function remove(parent, prop, index) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
- }
- function visit(
- node,
- parent,
- enter,
- leave,
- prop,
- index
- ) {
- if (node) {
- if (enter) {
- const _should_skip = should_skip;
- const _should_remove = should_remove;
- const _replacement = replacement;
- should_skip = false;
- should_remove = false;
- replacement = null;
- enter.call(context, node, parent, prop, index);
- if (replacement) {
- node = replacement;
- replace$1(parent, prop, index, node);
- }
- if (should_remove) {
- remove(parent, prop, index);
- }
- const skipped = should_skip;
- const removed = should_remove;
- should_skip = _should_skip;
- should_remove = _should_remove;
- replacement = _replacement;
- if (skipped) return node;
- if (removed) return null;
- }
- for (const key in node) {
- const value = (node )[key];
- if (typeof value !== 'object') {
- continue;
- }
- else if (Array.isArray(value)) {
- for (let j = 0, k = 0; j < value.length; j += 1, k += 1) {
- if (value[j] !== null && typeof value[j].type === 'string') {
- if (!visit(value[j], node, enter, leave, key, k)) {
- // removed
- j--;
- }
- }
- }
- }
- else if (value !== null && typeof value.type === 'string') {
- visit(value, node, enter, leave, key, null);
- }
- }
- if (leave) {
- const _replacement = replacement;
- const _should_remove = should_remove;
- replacement = null;
- should_remove = false;
- leave.call(context, node, parent, prop, index);
- if (replacement) {
- node = replacement;
- replace$1(parent, prop, index, node);
- }
- if (should_remove) {
- remove(parent, prop, index);
- }
- const removed = should_remove;
- replacement = _replacement;
- should_remove = _should_remove;
- if (removed) return null;
- }
- }
- return node;
- }
- const extractors$1 = {
- ArrayPattern(names, param) {
- for (const element of param.elements) {
- if (element)
- extractors$1[element.type](names, element);
- }
- },
- AssignmentPattern(names, param) {
- extractors$1[param.left.type](names, param.left);
- },
- Identifier(names, param) {
- names.push(param.name);
- },
- MemberExpression() { },
- ObjectPattern(names, param) {
- for (const prop of param.properties) {
- // @ts-ignore Typescript reports that this is not a valid type
- if (prop.type === 'RestElement') {
- extractors$1.RestElement(names, prop);
- }
- else {
- extractors$1[prop.value.type](names, prop.value);
- }
- }
- },
- RestElement(names, param) {
- extractors$1[param.argument.type](names, param.argument);
- }
- };
- const extractAssignedNames$1 = function extractAssignedNames(param) {
- const names = [];
- extractors$1[param.type](names, param);
- return names;
- };
- const blockDeclarations$1 = {
- const: true,
- let: true
- };
- class Scope$1 {
- constructor(options = {}) {
- this.parent = options.parent;
- this.isBlockScope = !!options.block;
- this.declarations = Object.create(null);
- if (options.params) {
- options.params.forEach((param) => {
- extractAssignedNames$1(param).forEach((name) => {
- this.declarations[name] = true;
- });
- });
- }
- }
- addDeclaration(node, isBlockDeclaration, isVar) {
- if (!isBlockDeclaration && this.isBlockScope) {
- // it's a `var` or function node, and this
- // is a block scope, so we need to go up
- this.parent.addDeclaration(node, isBlockDeclaration, isVar);
- }
- else if (node.id) {
- extractAssignedNames$1(node.id).forEach((name) => {
- this.declarations[name] = true;
- });
- }
- }
- contains(name) {
- return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
- }
- }
- const attachScopes$1 = function attachScopes(ast, propertyName = 'scope') {
- let scope = new Scope$1();
- walk$2(ast, {
- enter(n, parent) {
- const node = n;
- // function foo () {...}
- // class Foo {...}
- if (/(Function|Class)Declaration/.test(node.type)) {
- scope.addDeclaration(node, false, false);
- }
- // var foo = 1
- if (node.type === 'VariableDeclaration') {
- const { kind } = node;
- const isBlockDeclaration = blockDeclarations$1[kind];
- // don't add const/let declarations in the body of a for loop #113
- const parentType = parent ? parent.type : '';
- if (!(isBlockDeclaration && /ForOfStatement/.test(parentType))) {
- node.declarations.forEach((declaration) => {
- scope.addDeclaration(declaration, isBlockDeclaration, true);
- });
- }
- }
- let newScope;
- // create new function scope
- if (/Function/.test(node.type)) {
- const func = node;
- newScope = new Scope$1({
- parent: scope,
- block: false,
- params: func.params
- });
- // named function expressions - the name is considered
- // part of the function's scope
- if (func.type === 'FunctionExpression' && func.id) {
- newScope.addDeclaration(func, false, false);
- }
- }
- // create new block scope
- if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
- newScope = new Scope$1({
- parent: scope,
- block: true
- });
- }
- // catch clause has its own block scope
- if (node.type === 'CatchClause') {
- newScope = new Scope$1({
- parent: scope,
- params: node.param ? [node.param] : [],
- block: true
- });
- }
- if (newScope) {
- Object.defineProperty(node, propertyName, {
- value: newScope,
- configurable: true
- });
- scope = newScope;
- }
- },
- leave(n) {
- const node = n;
- if (node[propertyName])
- scope = scope.parent;
- }
- });
- return scope;
- };
- // Helper since Typescript can't detect readonly arrays with Array.isArray
- function isArray$5(arg) {
- return Array.isArray(arg);
- }
- function ensureArray$4(thing) {
- if (isArray$5(thing))
- return thing;
- if (thing == null)
- return [];
- return [thing];
- }
- function getMatcherString$4(id, resolutionBase) {
- if (resolutionBase === false) {
- return id;
- }
- // resolve('') is valid and will default to process.cwd()
- const basePath = resolve$1(resolutionBase || '')
- .split(sep)
- .join('/')
- // escape all possible (posix + win) path characters that might interfere with regex
- .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
- // Note that we use posix.join because:
- // 1. the basePath has been normalized to use /
- // 2. the incoming glob (id) matcher, also uses /
- // otherwise Node will force backslash (\) on windows
- return posix$1.join(basePath, id);
- }
- const createFilter$4 = function createFilter(include, exclude, options) {
- const resolutionBase = options && options.resolve;
- const getMatcher = (id) => id instanceof RegExp
- ? id
- : {
- test: (what) => {
- // this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString$4(id, resolutionBase);
- const fn = picomatch(pattern, { dot: true });
- const result = fn(what);
- return result;
- }
- };
- const includeMatchers = ensureArray$4(include).map(getMatcher);
- const excludeMatchers = ensureArray$4(exclude).map(getMatcher);
- return function result(id) {
- if (typeof id !== 'string')
- return false;
- if (/\0/.test(id))
- return false;
- const pathId = id.split(sep).join('/');
- for (let i = 0; i < excludeMatchers.length; ++i) {
- const matcher = excludeMatchers[i];
- if (matcher.test(pathId))
- return false;
- }
- for (let i = 0; i < includeMatchers.length; ++i) {
- const matcher = includeMatchers[i];
- if (matcher.test(pathId))
- return true;
- }
- return !includeMatchers.length;
- };
- };
- const reservedWords$4 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
- const builtins$5 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
- const forbiddenIdentifiers$4 = new Set(`${reservedWords$4} ${builtins$5}`.split(' '));
- forbiddenIdentifiers$4.add('');
- const makeLegalIdentifier$2 = function makeLegalIdentifier(str) {
- let identifier = str
- .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
- .replace(/[^$_a-zA-Z0-9]/g, '_');
- if (/\d/.test(identifier[0]) || forbiddenIdentifiers$4.has(identifier)) {
- identifier = `_${identifier}`;
- }
- return identifier || '_';
- };
- var commondir = function (basedir, relfiles) {
- if (relfiles) {
- var files = relfiles.map(function (r) {
- return path$5.resolve(basedir, r);
- });
- }
- else {
- var files = basedir;
- }
-
- var res = files.slice(1).reduce(function (ps, file) {
- if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
- throw new Error('relative path without a basedir');
- }
-
- var xs = file.split(/\/+|\\+/);
- for (
- var i = 0;
- ps[i] === xs[i] && i < Math.min(ps.length, xs.length);
- i++
- );
- return ps.slice(0, i);
- }, files[0].split(/\/+|\\+/));
-
- // Windows correctly handles paths with forward-slashes
- return res.length > 1 ? res.join('/') : '/'
- };
- // @ts-check
- /** @typedef { import('estree').BaseNode} BaseNode */
- /** @typedef {{
- skip: () => void;
- remove: () => void;
- replace: (node: BaseNode) => void;
- }} WalkerContext */
- class WalkerBase$1 {
- constructor() {
- /** @type {boolean} */
- this.should_skip = false;
- /** @type {boolean} */
- this.should_remove = false;
- /** @type {BaseNode | null} */
- this.replacement = null;
- /** @type {WalkerContext} */
- this.context = {
- skip: () => (this.should_skip = true),
- remove: () => (this.should_remove = true),
- replace: (node) => (this.replacement = node)
- };
- }
- /**
- *
- * @param {any} parent
- * @param {string} prop
- * @param {number} index
- * @param {BaseNode} node
- */
- replace(parent, prop, index, node) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
- }
- /**
- *
- * @param {any} parent
- * @param {string} prop
- * @param {number} index
- */
- remove(parent, prop, index) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
- }
- }
- // @ts-check
- /** @typedef { import('estree').BaseNode} BaseNode */
- /** @typedef { import('./walker.js').WalkerContext} WalkerContext */
- /** @typedef {(
- * this: WalkerContext,
- * node: BaseNode,
- * parent: BaseNode,
- * key: string,
- * index: number
- * ) => void} SyncHandler */
- class SyncWalker extends WalkerBase$1 {
- /**
- *
- * @param {SyncHandler} enter
- * @param {SyncHandler} leave
- */
- constructor(enter, leave) {
- super();
- /** @type {SyncHandler} */
- this.enter = enter;
- /** @type {SyncHandler} */
- this.leave = leave;
- }
- /**
- *
- * @param {BaseNode} node
- * @param {BaseNode} parent
- * @param {string} [prop]
- * @param {number} [index]
- * @returns {BaseNode}
- */
- visit(node, parent, prop, index) {
- if (node) {
- if (this.enter) {
- const _should_skip = this.should_skip;
- const _should_remove = this.should_remove;
- const _replacement = this.replacement;
- this.should_skip = false;
- this.should_remove = false;
- this.replacement = null;
- this.enter.call(this.context, node, parent, prop, index);
- if (this.replacement) {
- node = this.replacement;
- this.replace(parent, prop, index, node);
- }
- if (this.should_remove) {
- this.remove(parent, prop, index);
- }
- const skipped = this.should_skip;
- const removed = this.should_remove;
- this.should_skip = _should_skip;
- this.should_remove = _should_remove;
- this.replacement = _replacement;
- if (skipped) return node;
- if (removed) return null;
- }
- for (const key in node) {
- const value = node[key];
- if (typeof value !== "object") {
- continue;
- } else if (Array.isArray(value)) {
- for (let i = 0; i < value.length; i += 1) {
- if (value[i] !== null && typeof value[i].type === 'string') {
- if (!this.visit(value[i], node, key, i)) {
- // removed
- i--;
- }
- }
- }
- } else if (value !== null && typeof value.type === "string") {
- this.visit(value, node, key, null);
- }
- }
- if (this.leave) {
- const _replacement = this.replacement;
- const _should_remove = this.should_remove;
- this.replacement = null;
- this.should_remove = false;
- this.leave.call(this.context, node, parent, prop, index);
- if (this.replacement) {
- node = this.replacement;
- this.replace(parent, prop, index, node);
- }
- if (this.should_remove) {
- this.remove(parent, prop, index);
- }
- const removed = this.should_remove;
- this.replacement = _replacement;
- this.should_remove = _should_remove;
- if (removed) return null;
- }
- }
- return node;
- }
- }
- // @ts-check
- /** @typedef { import('estree').BaseNode} BaseNode */
- /** @typedef { import('./sync.js').SyncHandler} SyncHandler */
- /** @typedef { import('./async.js').AsyncHandler} AsyncHandler */
- /**
- *
- * @param {BaseNode} ast
- * @param {{
- * enter?: SyncHandler
- * leave?: SyncHandler
- * }} walker
- * @returns {BaseNode}
- */
- function walk$1(ast, { enter, leave }) {
- const instance = new SyncWalker(enter, leave);
- return instance.visit(ast, null);
- }
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
- function encode(decoded) {
- var sourceFileIndex = 0; // second field
- var sourceCodeLine = 0; // third field
- var sourceCodeColumn = 0; // fourth field
- var nameIndex = 0; // fifth field
- var mappings = '';
- for (var i = 0; i < decoded.length; i++) {
- var line = decoded[i];
- if (i > 0)
- mappings += ';';
- if (line.length === 0)
- continue;
- var generatedCodeColumn = 0; // first field
- var lineMappings = [];
- for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {
- var segment = line_1[_i];
- var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);
- generatedCodeColumn = segment[0];
- if (segment.length > 1) {
- segmentMappings +=
- encodeInteger(segment[1] - sourceFileIndex) +
- encodeInteger(segment[2] - sourceCodeLine) +
- encodeInteger(segment[3] - sourceCodeColumn);
- sourceFileIndex = segment[1];
- sourceCodeLine = segment[2];
- sourceCodeColumn = segment[3];
- }
- if (segment.length === 5) {
- segmentMappings += encodeInteger(segment[4] - nameIndex);
- nameIndex = segment[4];
- }
- lineMappings.push(segmentMappings);
- }
- mappings += lineMappings.join(',');
- }
- return mappings;
- }
- function encodeInteger(num) {
- var result = '';
- num = num < 0 ? (-num << 1) | 1 : num << 1;
- do {
- var clamped = num & 31;
- num >>>= 5;
- if (num > 0) {
- clamped |= 32;
- }
- result += chars[clamped];
- } while (num > 0);
- return result;
- }
- var BitSet = function BitSet(arg) {
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
- };
- BitSet.prototype.add = function add (n) {
- this.bits[n >> 5] |= 1 << (n & 31);
- };
- BitSet.prototype.has = function has (n) {
- return !!(this.bits[n >> 5] & (1 << (n & 31)));
- };
- var Chunk = function Chunk(start, end, content) {
- this.start = start;
- this.end = end;
- this.original = content;
- this.intro = '';
- this.outro = '';
- this.content = content;
- this.storeName = false;
- this.edited = false;
- // we make these non-enumerable, for sanity while debugging
- Object.defineProperties(this, {
- previous: { writable: true, value: null },
- next: { writable: true, value: null }
- });
- };
- Chunk.prototype.appendLeft = function appendLeft (content) {
- this.outro += content;
- };
- Chunk.prototype.appendRight = function appendRight (content) {
- this.intro = this.intro + content;
- };
- Chunk.prototype.clone = function clone () {
- var chunk = new Chunk(this.start, this.end, this.original);
- chunk.intro = this.intro;
- chunk.outro = this.outro;
- chunk.content = this.content;
- chunk.storeName = this.storeName;
- chunk.edited = this.edited;
- return chunk;
- };
- Chunk.prototype.contains = function contains (index) {
- return this.start < index && index < this.end;
- };
- Chunk.prototype.eachNext = function eachNext (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.next;
- }
- };
- Chunk.prototype.eachPrevious = function eachPrevious (fn) {
- var chunk = this;
- while (chunk) {
- fn(chunk);
- chunk = chunk.previous;
- }
- };
- Chunk.prototype.edit = function edit (content, storeName, contentOnly) {
- this.content = content;
- if (!contentOnly) {
- this.intro = '';
- this.outro = '';
- }
- this.storeName = storeName;
- this.edited = true;
- return this;
- };
- Chunk.prototype.prependLeft = function prependLeft (content) {
- this.outro = content + this.outro;
- };
- Chunk.prototype.prependRight = function prependRight (content) {
- this.intro = content + this.intro;
- };
- Chunk.prototype.split = function split (index) {
- var sliceIndex = index - this.start;
- var originalBefore = this.original.slice(0, sliceIndex);
- var originalAfter = this.original.slice(sliceIndex);
- this.original = originalBefore;
- var newChunk = new Chunk(index, this.end, originalAfter);
- newChunk.outro = this.outro;
- this.outro = '';
- this.end = index;
- if (this.edited) {
- // TODO is this block necessary?...
- newChunk.edit('', false);
- this.content = '';
- } else {
- this.content = originalBefore;
- }
- newChunk.next = this.next;
- if (newChunk.next) { newChunk.next.previous = newChunk; }
- newChunk.previous = this;
- this.next = newChunk;
- return newChunk;
- };
- Chunk.prototype.toString = function toString () {
- return this.intro + this.content + this.outro;
- };
- Chunk.prototype.trimEnd = function trimEnd (rx) {
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.start + trimmed.length).edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- }
- };
- Chunk.prototype.trimStart = function trimStart (rx) {
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var trimmed = this.content.replace(rx, '');
- if (trimmed.length) {
- if (trimmed !== this.content) {
- this.split(this.end - trimmed.length);
- this.edit('', undefined, true);
- }
- return true;
- } else {
- this.edit('', undefined, true);
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- }
- };
- var btoa$1 = function () {
- throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
- };
- if (typeof window !== 'undefined' && typeof window.btoa === 'function') {
- btoa$1 = function (str) { return window.btoa(unescape(encodeURIComponent(str))); };
- } else if (typeof Buffer === 'function') {
- btoa$1 = function (str) { return Buffer.from(str, 'utf-8').toString('base64'); };
- }
- var SourceMap = function SourceMap(properties) {
- this.version = 3;
- this.file = properties.file;
- this.sources = properties.sources;
- this.sourcesContent = properties.sourcesContent;
- this.names = properties.names;
- this.mappings = encode(properties.mappings);
- };
- SourceMap.prototype.toString = function toString () {
- return JSON.stringify(this);
- };
- SourceMap.prototype.toUrl = function toUrl () {
- return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString());
- };
- function guessIndent(code) {
- var lines = code.split('\n');
- var tabbed = lines.filter(function (line) { return /^\t+/.test(line); });
- var spaced = lines.filter(function (line) { return /^ {2,}/.test(line); });
- if (tabbed.length === 0 && spaced.length === 0) {
- return null;
- }
- // More lines tabbed than spaced? Assume tabs, and
- // default to tabs in the case of a tie (or nothing
- // to go on)
- if (tabbed.length >= spaced.length) {
- return '\t';
- }
- // Otherwise, we need to guess the multiple
- var min = spaced.reduce(function (previous, current) {
- var numSpaces = /^ +/.exec(current)[0].length;
- return Math.min(numSpaces, previous);
- }, Infinity);
- return new Array(min + 1).join(' ');
- }
- function getRelativePath(from, to) {
- var fromParts = from.split(/[/\\]/);
- var toParts = to.split(/[/\\]/);
- fromParts.pop(); // get dirname
- while (fromParts[0] === toParts[0]) {
- fromParts.shift();
- toParts.shift();
- }
- if (fromParts.length) {
- var i = fromParts.length;
- while (i--) { fromParts[i] = '..'; }
- }
- return fromParts.concat(toParts).join('/');
- }
- var toString = Object.prototype.toString;
- function isObject(thing) {
- return toString.call(thing) === '[object Object]';
- }
- function getLocator(source) {
- var originalLines = source.split('\n');
- var lineOffsets = [];
- for (var i = 0, pos = 0; i < originalLines.length; i++) {
- lineOffsets.push(pos);
- pos += originalLines[i].length + 1;
- }
- return function locate(index) {
- var i = 0;
- var j = lineOffsets.length;
- while (i < j) {
- var m = (i + j) >> 1;
- if (index < lineOffsets[m]) {
- j = m;
- } else {
- i = m + 1;
- }
- }
- var line = i - 1;
- var column = index - lineOffsets[line];
- return { line: line, column: column };
- };
- }
- var Mappings = function Mappings(hires) {
- this.hires = hires;
- this.generatedCodeLine = 0;
- this.generatedCodeColumn = 0;
- this.raw = [];
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
- this.pending = null;
- };
- Mappings.prototype.addEdit = function addEdit (sourceIndex, content, loc, nameIndex) {
- if (content.length) {
- var segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
- if (nameIndex >= 0) {
- segment.push(nameIndex);
- }
- this.rawSegments.push(segment);
- } else if (this.pending) {
- this.rawSegments.push(this.pending);
- }
- this.advance(content);
- this.pending = null;
- };
- Mappings.prototype.addUneditedChunk = function addUneditedChunk (sourceIndex, chunk, original, loc, sourcemapLocations) {
- var originalCharIndex = chunk.start;
- var first = true;
- while (originalCharIndex < chunk.end) {
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
- this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]);
- }
- if (original[originalCharIndex] === '\n') {
- loc.line += 1;
- loc.column = 0;
- this.generatedCodeLine += 1;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- this.generatedCodeColumn = 0;
- first = true;
- } else {
- loc.column += 1;
- this.generatedCodeColumn += 1;
- first = false;
- }
- originalCharIndex += 1;
- }
- this.pending = null;
- };
- Mappings.prototype.advance = function advance (str) {
- if (!str) { return; }
- var lines = str.split('\n');
- if (lines.length > 1) {
- for (var i = 0; i < lines.length - 1; i++) {
- this.generatedCodeLine++;
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
- }
- this.generatedCodeColumn = 0;
- }
- this.generatedCodeColumn += lines[lines.length - 1].length;
- };
- var n = '\n';
- var warned = {
- insertLeft: false,
- insertRight: false,
- storeName: false
- };
- var MagicString = function MagicString(string, options) {
- if ( options === void 0 ) options = {};
- var chunk = new Chunk(0, string.length, string);
- Object.defineProperties(this, {
- original: { writable: true, value: string },
- outro: { writable: true, value: '' },
- intro: { writable: true, value: '' },
- firstChunk: { writable: true, value: chunk },
- lastChunk: { writable: true, value: chunk },
- lastSearchedChunk: { writable: true, value: chunk },
- byStart: { writable: true, value: {} },
- byEnd: { writable: true, value: {} },
- filename: { writable: true, value: options.filename },
- indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
- sourcemapLocations: { writable: true, value: new BitSet() },
- storedNames: { writable: true, value: {} },
- indentStr: { writable: true, value: guessIndent(string) }
- });
- this.byStart[0] = chunk;
- this.byEnd[string.length] = chunk;
- };
- MagicString.prototype.addSourcemapLocation = function addSourcemapLocation (char) {
- this.sourcemapLocations.add(char);
- };
- MagicString.prototype.append = function append (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.outro += content;
- return this;
- };
- MagicString.prototype.appendLeft = function appendLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.appendLeft(content);
- } else {
- this.intro += content;
- }
- return this;
- };
- MagicString.prototype.appendRight = function appendRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.appendRight(content);
- } else {
- this.outro += content;
- }
- return this;
- };
- MagicString.prototype.clone = function clone () {
- var cloned = new MagicString(this.original, { filename: this.filename });
- var originalChunk = this.firstChunk;
- var clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
- while (originalChunk) {
- cloned.byStart[clonedChunk.start] = clonedChunk;
- cloned.byEnd[clonedChunk.end] = clonedChunk;
- var nextOriginalChunk = originalChunk.next;
- var nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
- if (nextClonedChunk) {
- clonedChunk.next = nextClonedChunk;
- nextClonedChunk.previous = clonedChunk;
- clonedChunk = nextClonedChunk;
- }
- originalChunk = nextOriginalChunk;
- }
- cloned.lastChunk = clonedChunk;
- if (this.indentExclusionRanges) {
- cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
- }
- cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
- cloned.intro = this.intro;
- cloned.outro = this.outro;
- return cloned;
- };
- MagicString.prototype.generateDecodedMap = function generateDecodedMap (options) {
- var this$1 = this;
- options = options || {};
- var sourceIndex = 0;
- var names = Object.keys(this.storedNames);
- var mappings = new Mappings(options.hires);
- var locate = getLocator(this.original);
- if (this.intro) {
- mappings.advance(this.intro);
- }
- this.firstChunk.eachNext(function (chunk) {
- var loc = locate(chunk.start);
- if (chunk.intro.length) { mappings.advance(chunk.intro); }
- if (chunk.edited) {
- mappings.addEdit(
- sourceIndex,
- chunk.content,
- loc,
- chunk.storeName ? names.indexOf(chunk.original) : -1
- );
- } else {
- mappings.addUneditedChunk(sourceIndex, chunk, this$1.original, loc, this$1.sourcemapLocations);
- }
- if (chunk.outro.length) { mappings.advance(chunk.outro); }
- });
- return {
- file: options.file ? options.file.split(/[/\\]/).pop() : null,
- sources: [options.source ? getRelativePath(options.file || '', options.source) : null],
- sourcesContent: options.includeContent ? [this.original] : [null],
- names: names,
- mappings: mappings.raw
- };
- };
- MagicString.prototype.generateMap = function generateMap (options) {
- return new SourceMap(this.generateDecodedMap(options));
- };
- MagicString.prototype.getIndentString = function getIndentString () {
- return this.indentStr === null ? '\t' : this.indentStr;
- };
- MagicString.prototype.indent = function indent (indentStr, options) {
- var pattern = /^[^\r\n]/gm;
- if (isObject(indentStr)) {
- options = indentStr;
- indentStr = undefined;
- }
- indentStr = indentStr !== undefined ? indentStr : this.indentStr || '\t';
- if (indentStr === '') { return this; } // noop
- options = options || {};
- // Process exclusion ranges
- var isExcluded = {};
- if (options.exclude) {
- var exclusions =
- typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
- exclusions.forEach(function (exclusion) {
- for (var i = exclusion[0]; i < exclusion[1]; i += 1) {
- isExcluded[i] = true;
- }
- });
- }
- var shouldIndentNextCharacter = options.indentStart !== false;
- var replacer = function (match) {
- if (shouldIndentNextCharacter) { return ("" + indentStr + match); }
- shouldIndentNextCharacter = true;
- return match;
- };
- this.intro = this.intro.replace(pattern, replacer);
- var charIndex = 0;
- var chunk = this.firstChunk;
- while (chunk) {
- var end = chunk.end;
- if (chunk.edited) {
- if (!isExcluded[charIndex]) {
- chunk.content = chunk.content.replace(pattern, replacer);
- if (chunk.content.length) {
- shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
- }
- }
- } else {
- charIndex = chunk.start;
- while (charIndex < end) {
- if (!isExcluded[charIndex]) {
- var char = this.original[charIndex];
- if (char === '\n') {
- shouldIndentNextCharacter = true;
- } else if (char !== '\r' && shouldIndentNextCharacter) {
- shouldIndentNextCharacter = false;
- if (charIndex === chunk.start) {
- chunk.prependRight(indentStr);
- } else {
- this._splitChunk(chunk, charIndex);
- chunk = chunk.next;
- chunk.prependRight(indentStr);
- }
- }
- }
- charIndex += 1;
- }
- }
- charIndex = chunk.end;
- chunk = chunk.next;
- }
- this.outro = this.outro.replace(pattern, replacer);
- return this;
- };
- MagicString.prototype.insert = function insert () {
- throw new Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
- };
- MagicString.prototype.insertLeft = function insertLeft (index, content) {
- if (!warned.insertLeft) {
- console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'); // eslint-disable-line no-console
- warned.insertLeft = true;
- }
- return this.appendLeft(index, content);
- };
- MagicString.prototype.insertRight = function insertRight (index, content) {
- if (!warned.insertRight) {
- console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'); // eslint-disable-line no-console
- warned.insertRight = true;
- }
- return this.prependRight(index, content);
- };
- MagicString.prototype.move = function move (start, end, index) {
- if (index >= start && index <= end) { throw new Error('Cannot move a selection inside itself'); }
- this._split(start);
- this._split(end);
- this._split(index);
- var first = this.byStart[start];
- var last = this.byEnd[end];
- var oldLeft = first.previous;
- var oldRight = last.next;
- var newRight = this.byStart[index];
- if (!newRight && last === this.lastChunk) { return this; }
- var newLeft = newRight ? newRight.previous : this.lastChunk;
- if (oldLeft) { oldLeft.next = oldRight; }
- if (oldRight) { oldRight.previous = oldLeft; }
- if (newLeft) { newLeft.next = first; }
- if (newRight) { newRight.previous = last; }
- if (!first.previous) { this.firstChunk = last.next; }
- if (!last.next) {
- this.lastChunk = first.previous;
- this.lastChunk.next = null;
- }
- first.previous = newLeft;
- last.next = newRight || null;
- if (!newLeft) { this.firstChunk = first; }
- if (!newRight) { this.lastChunk = last; }
- return this;
- };
- MagicString.prototype.overwrite = function overwrite (start, end, content, options) {
- if (typeof content !== 'string') { throw new TypeError('replacement content must be a string'); }
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (end > this.original.length) { throw new Error('end is out of bounds'); }
- if (start === end)
- { throw new Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead'); }
- this._split(start);
- this._split(end);
- if (options === true) {
- if (!warned.storeName) {
- console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'); // eslint-disable-line no-console
- warned.storeName = true;
- }
- options = { storeName: true };
- }
- var storeName = options !== undefined ? options.storeName : false;
- var contentOnly = options !== undefined ? options.contentOnly : false;
- if (storeName) {
- var original = this.original.slice(start, end);
- this.storedNames[original] = true;
- }
- var first = this.byStart[start];
- var last = this.byEnd[end];
- if (first) {
- if (end > first.end && first.next !== this.byStart[first.end]) {
- throw new Error('Cannot overwrite across a split point');
- }
- first.edit(content, storeName, contentOnly);
- if (first !== last) {
- var chunk = first.next;
- while (chunk !== last) {
- chunk.edit('', false);
- chunk = chunk.next;
- }
- chunk.edit('', false);
- }
- } else {
- // must be inserting at the end
- var newChunk = new Chunk(start, end, '').edit(content, storeName);
- // TODO last chunk in the array may not be the last chunk, if it's moved...
- last.next = newChunk;
- newChunk.previous = last;
- }
- return this;
- };
- MagicString.prototype.prepend = function prepend (content) {
- if (typeof content !== 'string') { throw new TypeError('outro content must be a string'); }
- this.intro = content + this.intro;
- return this;
- };
- MagicString.prototype.prependLeft = function prependLeft (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byEnd[index];
- if (chunk) {
- chunk.prependLeft(content);
- } else {
- this.intro = content + this.intro;
- }
- return this;
- };
- MagicString.prototype.prependRight = function prependRight (index, content) {
- if (typeof content !== 'string') { throw new TypeError('inserted content must be a string'); }
- this._split(index);
- var chunk = this.byStart[index];
- if (chunk) {
- chunk.prependRight(content);
- } else {
- this.outro = content + this.outro;
- }
- return this;
- };
- MagicString.prototype.remove = function remove (start, end) {
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- if (start === end) { return this; }
- if (start < 0 || end > this.original.length) { throw new Error('Character is out of bounds'); }
- if (start > end) { throw new Error('end must be greater than start'); }
- this._split(start);
- this._split(end);
- var chunk = this.byStart[start];
- while (chunk) {
- chunk.intro = '';
- chunk.outro = '';
- chunk.edit('');
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
- }
- return this;
- };
- MagicString.prototype.lastChar = function lastChar () {
- if (this.outro.length)
- { return this.outro[this.outro.length - 1]; }
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length)
- { return chunk.outro[chunk.outro.length - 1]; }
- if (chunk.content.length)
- { return chunk.content[chunk.content.length - 1]; }
- if (chunk.intro.length)
- { return chunk.intro[chunk.intro.length - 1]; }
- } while (chunk = chunk.previous);
- if (this.intro.length)
- { return this.intro[this.intro.length - 1]; }
- return '';
- };
- MagicString.prototype.lastLine = function lastLine () {
- var lineIndex = this.outro.lastIndexOf(n);
- if (lineIndex !== -1)
- { return this.outro.substr(lineIndex + 1); }
- var lineStr = this.outro;
- var chunk = this.lastChunk;
- do {
- if (chunk.outro.length > 0) {
- lineIndex = chunk.outro.lastIndexOf(n);
- if (lineIndex !== -1)
- { return chunk.outro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.outro + lineStr;
- }
- if (chunk.content.length > 0) {
- lineIndex = chunk.content.lastIndexOf(n);
- if (lineIndex !== -1)
- { return chunk.content.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.content + lineStr;
- }
- if (chunk.intro.length > 0) {
- lineIndex = chunk.intro.lastIndexOf(n);
- if (lineIndex !== -1)
- { return chunk.intro.substr(lineIndex + 1) + lineStr; }
- lineStr = chunk.intro + lineStr;
- }
- } while (chunk = chunk.previous);
- lineIndex = this.intro.lastIndexOf(n);
- if (lineIndex !== -1)
- { return this.intro.substr(lineIndex + 1) + lineStr; }
- return this.intro + lineStr;
- };
- MagicString.prototype.slice = function slice (start, end) {
- if ( start === void 0 ) start = 0;
- if ( end === void 0 ) end = this.original.length;
- while (start < 0) { start += this.original.length; }
- while (end < 0) { end += this.original.length; }
- var result = '';
- // find start chunk
- var chunk = this.firstChunk;
- while (chunk && (chunk.start > start || chunk.end <= start)) {
- // found end chunk before start
- if (chunk.start < end && chunk.end >= end) {
- return result;
- }
- chunk = chunk.next;
- }
- if (chunk && chunk.edited && chunk.start !== start)
- { throw new Error(("Cannot use replaced character " + start + " as slice start anchor.")); }
- var startChunk = chunk;
- while (chunk) {
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
- result += chunk.intro;
- }
- var containsEnd = chunk.start < end && chunk.end >= end;
- if (containsEnd && chunk.edited && chunk.end !== end)
- { throw new Error(("Cannot use replaced character " + end + " as slice end anchor.")); }
- var sliceStart = startChunk === chunk ? start - chunk.start : 0;
- var sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
- result += chunk.content.slice(sliceStart, sliceEnd);
- if (chunk.outro && (!containsEnd || chunk.end === end)) {
- result += chunk.outro;
- }
- if (containsEnd) {
- break;
- }
- chunk = chunk.next;
- }
- return result;
- };
- // TODO deprecate this? not really very useful
- MagicString.prototype.snip = function snip (start, end) {
- var clone = this.clone();
- clone.remove(0, start);
- clone.remove(end, clone.original.length);
- return clone;
- };
- MagicString.prototype._split = function _split (index) {
- if (this.byStart[index] || this.byEnd[index]) { return; }
- var chunk = this.lastSearchedChunk;
- var searchForward = index > chunk.end;
- while (chunk) {
- if (chunk.contains(index)) { return this._splitChunk(chunk, index); }
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
- }
- };
- MagicString.prototype._splitChunk = function _splitChunk (chunk, index) {
- if (chunk.edited && chunk.content.length) {
- // zero-length edited chunks are a special case (overlapping replacements)
- var loc = getLocator(this.original)(index);
- throw new Error(
- ("Cannot split a chunk that has already been edited (" + (loc.line) + ":" + (loc.column) + " – \"" + (chunk.original) + "\")")
- );
- }
- var newChunk = chunk.split(index);
- this.byEnd[index] = chunk;
- this.byStart[index] = newChunk;
- this.byEnd[newChunk.end] = newChunk;
- if (chunk === this.lastChunk) { this.lastChunk = newChunk; }
- this.lastSearchedChunk = chunk;
- return true;
- };
- MagicString.prototype.toString = function toString () {
- var str = this.intro;
- var chunk = this.firstChunk;
- while (chunk) {
- str += chunk.toString();
- chunk = chunk.next;
- }
- return str + this.outro;
- };
- MagicString.prototype.isEmpty = function isEmpty () {
- var chunk = this.firstChunk;
- do {
- if (chunk.intro.length && chunk.intro.trim() ||
- chunk.content.length && chunk.content.trim() ||
- chunk.outro.length && chunk.outro.trim())
- { return false; }
- } while (chunk = chunk.next);
- return true;
- };
- MagicString.prototype.length = function length () {
- var chunk = this.firstChunk;
- var length = 0;
- do {
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
- } while (chunk = chunk.next);
- return length;
- };
- MagicString.prototype.trimLines = function trimLines () {
- return this.trim('[\\r\\n]');
- };
- MagicString.prototype.trim = function trim (charType) {
- return this.trimStart(charType).trimEnd(charType);
- };
- MagicString.prototype.trimEndAborted = function trimEndAborted (charType) {
- var rx = new RegExp((charType || '\\s') + '+$');
- this.outro = this.outro.replace(rx, '');
- if (this.outro.length) { return true; }
- var chunk = this.lastChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimEnd(rx);
- // if chunk was trimmed, we have a new lastChunk
- if (chunk.end !== end) {
- if (this.lastChunk === chunk) {
- this.lastChunk = chunk.next;
- }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.previous;
- } while (chunk);
- return false;
- };
- MagicString.prototype.trimEnd = function trimEnd (charType) {
- this.trimEndAborted(charType);
- return this;
- };
- MagicString.prototype.trimStartAborted = function trimStartAborted (charType) {
- var rx = new RegExp('^' + (charType || '\\s') + '+');
- this.intro = this.intro.replace(rx, '');
- if (this.intro.length) { return true; }
- var chunk = this.firstChunk;
- do {
- var end = chunk.end;
- var aborted = chunk.trimStart(rx);
- if (chunk.end !== end) {
- // special case...
- if (chunk === this.lastChunk) { this.lastChunk = chunk.next; }
- this.byEnd[chunk.end] = chunk;
- this.byStart[chunk.next.start] = chunk.next;
- this.byEnd[chunk.next.end] = chunk.next;
- }
- if (aborted) { return true; }
- chunk = chunk.next;
- } while (chunk);
- return false;
- };
- MagicString.prototype.trimStart = function trimStart (charType) {
- this.trimStartAborted(charType);
- return this;
- };
- function isReference(node, parent) {
- if (node.type === 'MemberExpression') {
- return !node.computed && isReference(node.object, node);
- }
- if (node.type === 'Identifier') {
- if (!parent)
- return true;
- switch (parent.type) {
- // disregard `bar` in `foo.bar`
- case 'MemberExpression': return parent.computed || node === parent.object;
- // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
- case 'MethodDefinition': return parent.computed;
- // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
- case 'FieldDefinition': return parent.computed || node === parent.value;
- // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
- case 'Property': return parent.computed || node === parent.value;
- // disregard the `bar` in `export { foo as bar }` or
- // the foo in `import { foo as bar }`
- case 'ExportSpecifier':
- case 'ImportSpecifier': return node === parent.local;
- // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
- case 'LabeledStatement':
- case 'BreakStatement':
- case 'ContinueStatement': return false;
- default: return true;
- }
- }
- return false;
- }
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a
- // copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to permit
- // persons to whom the Software is furnished to do so, subject to the
- // following conditions:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
- var isWindows = process.platform === 'win32';
- function rethrow() {
- // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
- // is fairly slow to generate.
- var callback;
- callback = missingCallback;
- return callback;
- function missingCallback(err) {
- if (err) {
- if (process.throwDeprecation)
- throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
- else if (!process.noDeprecation) {
- var msg = 'fs: missing callback ' + (err.stack || err.message);
- if (process.traceDeprecation)
- console.trace(msg);
- else
- console.error(msg);
- }
- }
- }
- }
- function maybeCallback(cb) {
- return typeof cb === 'function' ? cb : rethrow();
- }
- // Regexp that finds the next partion of a (partial) path
- // result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
- if (isWindows) {
- var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
- } else {
- var nextPartRe = /(.*?)(?:[\/]+|$)/g;
- }
- // Regex to find the device root, including trailing slash. E.g. 'c:\\'.
- if (isWindows) {
- var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
- } else {
- var splitRootRe = /^[\/]*/;
- }
- var realpathSync$1 = function realpathSync(p, cache) {
- // make p is absolute
- p = path$5.resolve(p);
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
- return cache[p];
- }
- var original = p,
- seenLinks = {},
- knownHard = {};
- // current character position in p
- var pos;
- // the partial path so far, including a trailing slash if any
- var current;
- // the partial path without a trailing slash (except when pointing at a root)
- var base;
- // the partial path scanned in the previous round, with slash
- var previous;
- start();
- function start() {
- // Skip over roots
- var m = splitRootRe.exec(p);
- pos = m[0].length;
- current = m[0];
- base = m[0];
- previous = '';
- // On windows, check that the root exists. On unix there is no need.
- if (isWindows && !knownHard[base]) {
- fs$3.lstatSync(base);
- knownHard[base] = true;
- }
- }
- // walk down the path, swapping out linked pathparts for their real
- // values
- // NB: p.length changes.
- while (pos < p.length) {
- // find the next part
- nextPartRe.lastIndex = pos;
- var result = nextPartRe.exec(p);
- previous = current;
- current += result[0];
- base = previous + result[1];
- pos = nextPartRe.lastIndex;
- // continue if not a symlink
- if (knownHard[base] || (cache && cache[base] === base)) {
- continue;
- }
- var resolvedLink;
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
- // some known symbolic link. no need to stat again.
- resolvedLink = cache[base];
- } else {
- var stat = fs$3.lstatSync(base);
- if (!stat.isSymbolicLink()) {
- knownHard[base] = true;
- if (cache) cache[base] = base;
- continue;
- }
- // read the link if it wasn't read before
- // dev/ino always return 0 on windows, so skip the check.
- var linkTarget = null;
- if (!isWindows) {
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
- if (seenLinks.hasOwnProperty(id)) {
- linkTarget = seenLinks[id];
- }
- }
- if (linkTarget === null) {
- fs$3.statSync(base);
- linkTarget = fs$3.readlinkSync(base);
- }
- resolvedLink = path$5.resolve(previous, linkTarget);
- // track this, if given a cache.
- if (cache) cache[base] = resolvedLink;
- if (!isWindows) seenLinks[id] = linkTarget;
- }
- // resolve the link, then start over
- p = path$5.resolve(resolvedLink, p.slice(pos));
- start();
- }
- if (cache) cache[original] = p;
- return p;
- };
- var realpath$2 = function realpath(p, cache, cb) {
- if (typeof cb !== 'function') {
- cb = maybeCallback(cache);
- cache = null;
- }
- // make p is absolute
- p = path$5.resolve(p);
- if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
- return process.nextTick(cb.bind(null, null, cache[p]));
- }
- var original = p,
- seenLinks = {},
- knownHard = {};
- // current character position in p
- var pos;
- // the partial path so far, including a trailing slash if any
- var current;
- // the partial path without a trailing slash (except when pointing at a root)
- var base;
- // the partial path scanned in the previous round, with slash
- var previous;
- start();
- function start() {
- // Skip over roots
- var m = splitRootRe.exec(p);
- pos = m[0].length;
- current = m[0];
- base = m[0];
- previous = '';
- // On windows, check that the root exists. On unix there is no need.
- if (isWindows && !knownHard[base]) {
- fs$3.lstat(base, function(err) {
- if (err) return cb(err);
- knownHard[base] = true;
- LOOP();
- });
- } else {
- process.nextTick(LOOP);
- }
- }
- // walk down the path, swapping out linked pathparts for their real
- // values
- function LOOP() {
- // stop if scanned past end of path
- if (pos >= p.length) {
- if (cache) cache[original] = p;
- return cb(null, p);
- }
- // find the next part
- nextPartRe.lastIndex = pos;
- var result = nextPartRe.exec(p);
- previous = current;
- current += result[0];
- base = previous + result[1];
- pos = nextPartRe.lastIndex;
- // continue if not a symlink
- if (knownHard[base] || (cache && cache[base] === base)) {
- return process.nextTick(LOOP);
- }
- if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
- // known symbolic link. no need to stat again.
- return gotResolvedLink(cache[base]);
- }
- return fs$3.lstat(base, gotStat);
- }
- function gotStat(err, stat) {
- if (err) return cb(err);
- // if not a symlink, skip to the next path part
- if (!stat.isSymbolicLink()) {
- knownHard[base] = true;
- if (cache) cache[base] = base;
- return process.nextTick(LOOP);
- }
- // stat & read the link if not read before
- // call gotTarget as soon as the link target is known
- // dev/ino always return 0 on windows, so skip the check.
- if (!isWindows) {
- var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
- if (seenLinks.hasOwnProperty(id)) {
- return gotTarget(null, seenLinks[id], base);
- }
- }
- fs$3.stat(base, function(err) {
- if (err) return cb(err);
- fs$3.readlink(base, function(err, target) {
- if (!isWindows) seenLinks[id] = target;
- gotTarget(err, target);
- });
- });
- }
- function gotTarget(err, target, base) {
- if (err) return cb(err);
- var resolvedLink = path$5.resolve(previous, target);
- if (cache) cache[base] = resolvedLink;
- gotResolvedLink(resolvedLink);
- }
- function gotResolvedLink(resolvedLink) {
- // resolve the link, then start over
- p = path$5.resolve(resolvedLink, p.slice(pos));
- start();
- }
- };
- var old = {
- realpathSync: realpathSync$1,
- realpath: realpath$2
- };
- var fs_realpath = realpath$1;
- realpath$1.realpath = realpath$1;
- realpath$1.sync = realpathSync;
- realpath$1.realpathSync = realpathSync;
- realpath$1.monkeypatch = monkeypatch;
- realpath$1.unmonkeypatch = unmonkeypatch;
- var origRealpath = fs$3.realpath;
- var origRealpathSync = fs$3.realpathSync;
- var version = process.version;
- var ok = /^v[0-5]\./.test(version);
- function newError (er) {
- return er && er.syscall === 'realpath' && (
- er.code === 'ELOOP' ||
- er.code === 'ENOMEM' ||
- er.code === 'ENAMETOOLONG'
- )
- }
- function realpath$1 (p, cache, cb) {
- if (ok) {
- return origRealpath(p, cache, cb)
- }
- if (typeof cache === 'function') {
- cb = cache;
- cache = null;
- }
- origRealpath(p, cache, function (er, result) {
- if (newError(er)) {
- old.realpath(p, cache, cb);
- } else {
- cb(er, result);
- }
- });
- }
- function realpathSync (p, cache) {
- if (ok) {
- return origRealpathSync(p, cache)
- }
- try {
- return origRealpathSync(p, cache)
- } catch (er) {
- if (newError(er)) {
- return old.realpathSync(p, cache)
- } else {
- throw er
- }
- }
- }
- function monkeypatch () {
- fs$3.realpath = realpath$1;
- fs$3.realpathSync = realpathSync;
- }
- function unmonkeypatch () {
- fs$3.realpath = origRealpath;
- fs$3.realpathSync = origRealpathSync;
- }
- var concatMap = function (xs, fn) {
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- var x = fn(xs[i], i);
- if (isArray$4(x)) res.push.apply(res, x);
- else res.push(x);
- }
- return res;
- };
- var isArray$4 = Array.isArray || function (xs) {
- return Object.prototype.toString.call(xs) === '[object Array]';
- };
- var balancedMatch = balanced;
- function balanced(a, b, str) {
- if (a instanceof RegExp) a = maybeMatch(a, str);
- if (b instanceof RegExp) b = maybeMatch(b, str);
- var r = range(a, b, str);
- return r && {
- start: r[0],
- end: r[1],
- pre: str.slice(0, r[0]),
- body: str.slice(r[0] + a.length, r[1]),
- post: str.slice(r[1] + b.length)
- };
- }
- function maybeMatch(reg, str) {
- var m = str.match(reg);
- return m ? m[0] : null;
- }
- balanced.range = range;
- function range(a, b, str) {
- var begs, beg, left, right, result;
- var ai = str.indexOf(a);
- var bi = str.indexOf(b, ai + 1);
- var i = ai;
- if (ai >= 0 && bi > 0) {
- begs = [];
- left = str.length;
- while (i >= 0 && !result) {
- if (i == ai) {
- begs.push(i);
- ai = str.indexOf(a, i + 1);
- } else if (begs.length == 1) {
- result = [ begs.pop(), bi ];
- } else {
- beg = begs.pop();
- if (beg < left) {
- left = beg;
- right = bi;
- }
- bi = str.indexOf(b, i + 1);
- }
- i = ai < bi && ai >= 0 ? ai : bi;
- }
- if (begs.length) {
- result = [ left, right ];
- }
- }
- return result;
- }
- var braceExpansion = expandTop;
- var escSlash = '\0SLASH'+Math.random()+'\0';
- var escOpen = '\0OPEN'+Math.random()+'\0';
- var escClose = '\0CLOSE'+Math.random()+'\0';
- var escComma = '\0COMMA'+Math.random()+'\0';
- var escPeriod = '\0PERIOD'+Math.random()+'\0';
- function numeric(str) {
- return parseInt(str, 10) == str
- ? parseInt(str, 10)
- : str.charCodeAt(0);
- }
- function escapeBraces(str) {
- return str.split('\\\\').join(escSlash)
- .split('\\{').join(escOpen)
- .split('\\}').join(escClose)
- .split('\\,').join(escComma)
- .split('\\.').join(escPeriod);
- }
- function unescapeBraces(str) {
- return str.split(escSlash).join('\\')
- .split(escOpen).join('{')
- .split(escClose).join('}')
- .split(escComma).join(',')
- .split(escPeriod).join('.');
- }
- // Basically just str.split(","), but handling cases
- // where we have nested braced sections, which should be
- // treated as individual members, like {a,{b,c},d}
- function parseCommaParts(str) {
- if (!str)
- return [''];
- var parts = [];
- var m = balancedMatch('{', '}', str);
- if (!m)
- return str.split(',');
- var pre = m.pre;
- var body = m.body;
- var post = m.post;
- var p = pre.split(',');
- p[p.length-1] += '{' + body + '}';
- var postParts = parseCommaParts(post);
- if (post.length) {
- p[p.length-1] += postParts.shift();
- p.push.apply(p, postParts);
- }
- parts.push.apply(parts, p);
- return parts;
- }
- function expandTop(str) {
- if (!str)
- return [];
- // I don't know why Bash 4.3 does this, but it does.
- // Anything starting with {} will have the first two bytes preserved
- // but *only* at the top level, so {},a}b will not expand to anything,
- // but a{},b}c will be expanded to [a}c,abc].
- // One could argue that this is a bug in Bash, but since the goal of
- // this module is to match Bash's rules, we escape a leading {}
- if (str.substr(0, 2) === '{}') {
- str = '\\{\\}' + str.substr(2);
- }
- return expand(escapeBraces(str), true).map(unescapeBraces);
- }
- function embrace(str) {
- return '{' + str + '}';
- }
- function isPadded(el) {
- return /^-?0\d/.test(el);
- }
- function lte(i, y) {
- return i <= y;
- }
- function gte(i, y) {
- return i >= y;
- }
- function expand(str, isTop) {
- var expansions = [];
- var m = balancedMatch('{', '}', str);
- if (!m || /\$$/.test(m.pre)) return [str];
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
- var isSequence = isNumericSequence || isAlphaSequence;
- var isOptions = m.body.indexOf(',') >= 0;
- if (!isSequence && !isOptions) {
- // {a},b}
- if (m.post.match(/,.*\}/)) {
- str = m.pre + '{' + m.body + escClose + m.post;
- return expand(str);
- }
- return [str];
- }
- var n;
- if (isSequence) {
- n = m.body.split(/\.\./);
- } else {
- n = parseCommaParts(m.body);
- if (n.length === 1) {
- // x{{a,b}}y ==> x{a}y x{b}y
- n = expand(n[0], false).map(embrace);
- if (n.length === 1) {
- var post = m.post.length
- ? expand(m.post, false)
- : [''];
- return post.map(function(p) {
- return m.pre + n[0] + p;
- });
- }
- }
- }
- // at this point, n is the parts, and we know it's not a comma set
- // with a single entry.
- // no need to expand pre, since it is guaranteed to be free of brace-sets
- var pre = m.pre;
- var post = m.post.length
- ? expand(m.post, false)
- : [''];
- var N;
- if (isSequence) {
- var x = numeric(n[0]);
- var y = numeric(n[1]);
- var width = Math.max(n[0].length, n[1].length);
- var incr = n.length == 3
- ? Math.abs(numeric(n[2]))
- : 1;
- var test = lte;
- var reverse = y < x;
- if (reverse) {
- incr *= -1;
- test = gte;
- }
- var pad = n.some(isPadded);
- N = [];
- for (var i = x; test(i, y); i += incr) {
- var c;
- if (isAlphaSequence) {
- c = String.fromCharCode(i);
- if (c === '\\')
- c = '';
- } else {
- c = String(i);
- if (pad) {
- var need = width - c.length;
- if (need > 0) {
- var z = new Array(need + 1).join('0');
- if (i < 0)
- c = '-' + z + c.slice(1);
- else
- c = z + c;
- }
- }
- }
- N.push(c);
- }
- } else {
- N = concatMap(n, function(el) { return expand(el, false) });
- }
- for (var j = 0; j < N.length; j++) {
- for (var k = 0; k < post.length; k++) {
- var expansion = pre + N[j] + post[k];
- if (!isTop || isSequence || expansion)
- expansions.push(expansion);
- }
- }
- return expansions;
- }
- var minimatch_1 = minimatch;
- minimatch.Minimatch = Minimatch$1;
- var path = { sep: '/' };
- try {
- path = path$5;
- } catch (er) {}
- var GLOBSTAR = minimatch.GLOBSTAR = Minimatch$1.GLOBSTAR = {};
- var plTypes = {
- '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
- '?': { open: '(?:', close: ')?' },
- '+': { open: '(?:', close: ')+' },
- '*': { open: '(?:', close: ')*' },
- '@': { open: '(?:', close: ')' }
- };
- // any single thing other than /
- // don't need to escape / when using new RegExp()
- var qmark = '[^/]';
- // * => any number of characters
- var star = qmark + '*?';
- // ** when dots are allowed. Anything goes, except .. and .
- // not (^ or / followed by one or two dots followed by $ or /),
- // followed by anything, any number of times.
- var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?';
- // not a ^ or / followed by a dot,
- // followed by anything, any number of times.
- var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?';
- // characters that need to be escaped in RegExp.
- var reSpecials = charSet('().*{}+?[]^$\\!');
- // "abc" -> { a:true, b:true, c:true }
- function charSet (s) {
- return s.split('').reduce(function (set, c) {
- set[c] = true;
- return set
- }, {})
- }
- // normalizes slashes.
- var slashSplit = /\/+/;
- minimatch.filter = filter;
- function filter (pattern, options) {
- options = options || {};
- return function (p, i, list) {
- return minimatch(p, pattern, options)
- }
- }
- function ext (a, b) {
- a = a || {};
- b = b || {};
- var t = {};
- Object.keys(b).forEach(function (k) {
- t[k] = b[k];
- });
- Object.keys(a).forEach(function (k) {
- t[k] = a[k];
- });
- return t
- }
- minimatch.defaults = function (def) {
- if (!def || !Object.keys(def).length) return minimatch
- var orig = minimatch;
- var m = function minimatch (p, pattern, options) {
- return orig.minimatch(p, pattern, ext(def, options))
- };
- m.Minimatch = function Minimatch (pattern, options) {
- return new orig.Minimatch(pattern, ext(def, options))
- };
- return m
- };
- Minimatch$1.defaults = function (def) {
- if (!def || !Object.keys(def).length) return Minimatch$1
- return minimatch.defaults(def).Minimatch
- };
- function minimatch (p, pattern, options) {
- if (typeof pattern !== 'string') {
- throw new TypeError('glob pattern string required')
- }
- if (!options) options = {};
- // shortcut: comments match nothing.
- if (!options.nocomment && pattern.charAt(0) === '#') {
- return false
- }
- // "" only matches ""
- if (pattern.trim() === '') return p === ''
- return new Minimatch$1(pattern, options).match(p)
- }
- function Minimatch$1 (pattern, options) {
- if (!(this instanceof Minimatch$1)) {
- return new Minimatch$1(pattern, options)
- }
- if (typeof pattern !== 'string') {
- throw new TypeError('glob pattern string required')
- }
- if (!options) options = {};
- pattern = pattern.trim();
- // windows support: need to use /, not \
- if (path.sep !== '/') {
- pattern = pattern.split(path.sep).join('/');
- }
- this.options = options;
- this.set = [];
- this.pattern = pattern;
- this.regexp = null;
- this.negate = false;
- this.comment = false;
- this.empty = false;
- // make the set of regexps etc.
- this.make();
- }
- Minimatch$1.prototype.debug = function () {};
- Minimatch$1.prototype.make = make;
- function make () {
- // don't do it more than once.
- if (this._made) return
- var pattern = this.pattern;
- var options = this.options;
- // empty patterns and comments match nothing.
- if (!options.nocomment && pattern.charAt(0) === '#') {
- this.comment = true;
- return
- }
- if (!pattern) {
- this.empty = true;
- return
- }
- // step 1: figure out negation, etc.
- this.parseNegate();
- // step 2: expand braces
- var set = this.globSet = this.braceExpand();
- if (options.debug) this.debug = console.error;
- this.debug(this.pattern, set);
- // step 3: now we have a set, so turn each one into a series of path-portion
- // matching patterns.
- // These will be regexps, except in the case of "**", which is
- // set to the GLOBSTAR object for globstar behavior,
- // and will not contain any / characters
- set = this.globParts = set.map(function (s) {
- return s.split(slashSplit)
- });
- this.debug(this.pattern, set);
- // glob --> regexps
- set = set.map(function (s, si, set) {
- return s.map(this.parse, this)
- }, this);
- this.debug(this.pattern, set);
- // filter out everything that didn't compile properly.
- set = set.filter(function (s) {
- return s.indexOf(false) === -1
- });
- this.debug(this.pattern, set);
- this.set = set;
- }
- Minimatch$1.prototype.parseNegate = parseNegate;
- function parseNegate () {
- var pattern = this.pattern;
- var negate = false;
- var options = this.options;
- var negateOffset = 0;
- if (options.nonegate) return
- for (var i = 0, l = pattern.length
- ; i < l && pattern.charAt(i) === '!'
- ; i++) {
- negate = !negate;
- negateOffset++;
- }
- if (negateOffset) this.pattern = pattern.substr(negateOffset);
- this.negate = negate;
- }
- // Brace expansion:
- // a{b,c}d -> abd acd
- // a{b,}c -> abc ac
- // a{0..3}d -> a0d a1d a2d a3d
- // a{b,c{d,e}f}g -> abg acdfg acefg
- // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
- //
- // Invalid sets are not expanded.
- // a{2..}b -> a{2..}b
- // a{b}c -> a{b}c
- minimatch.braceExpand = function (pattern, options) {
- return braceExpand(pattern, options)
- };
- Minimatch$1.prototype.braceExpand = braceExpand;
- function braceExpand (pattern, options) {
- if (!options) {
- if (this instanceof Minimatch$1) {
- options = this.options;
- } else {
- options = {};
- }
- }
- pattern = typeof pattern === 'undefined'
- ? this.pattern : pattern;
- if (typeof pattern === 'undefined') {
- throw new TypeError('undefined pattern')
- }
- if (options.nobrace ||
- !pattern.match(/\{.*\}/)) {
- // shortcut. no need to expand.
- return [pattern]
- }
- return braceExpansion(pattern)
- }
- // parse a component of the expanded set.
- // At this point, no pattern may contain "/" in it
- // so we're going to return a 2d array, where each entry is the full
- // pattern, split on '/', and then turned into a regular expression.
- // A regexp is made at the end which joins each array with an
- // escaped /, and another full one which joins each regexp with |.
- //
- // Following the lead of Bash 4.1, note that "**" only has special meaning
- // when it is the *only* thing in a path portion. Otherwise, any series
- // of * is equivalent to a single *. Globstar behavior is enabled by
- // default, and can be disabled by setting options.noglobstar.
- Minimatch$1.prototype.parse = parse;
- var SUBPARSE = {};
- function parse (pattern, isSub) {
- if (pattern.length > 1024 * 64) {
- throw new TypeError('pattern is too long')
- }
- var options = this.options;
- // shortcuts
- if (!options.noglobstar && pattern === '**') return GLOBSTAR
- if (pattern === '') return ''
- var re = '';
- var hasMagic = !!options.nocase;
- var escaping = false;
- // ? => one single character
- var patternListStack = [];
- var negativeLists = [];
- var stateChar;
- var inClass = false;
- var reClassStart = -1;
- var classStart = -1;
- // . and .. never match anything that doesn't start with .,
- // even when options.dot is set.
- var patternStart = pattern.charAt(0) === '.' ? '' // anything
- // not (start or / followed by . or .. followed by / or end)
- : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
- : '(?!\\.)';
- var self = this;
- function clearStateChar () {
- if (stateChar) {
- // we had some state-tracking character
- // that wasn't consumed by this pass.
- switch (stateChar) {
- case '*':
- re += star;
- hasMagic = true;
- break
- case '?':
- re += qmark;
- hasMagic = true;
- break
- default:
- re += '\\' + stateChar;
- break
- }
- self.debug('clearStateChar %j %j', stateChar, re);
- stateChar = false;
- }
- }
- for (var i = 0, len = pattern.length, c
- ; (i < len) && (c = pattern.charAt(i))
- ; i++) {
- this.debug('%s\t%s %s %j', pattern, i, re, c);
- // skip over any that are escaped.
- if (escaping && reSpecials[c]) {
- re += '\\' + c;
- escaping = false;
- continue
- }
- switch (c) {
- case '/':
- // completely not allowed, even escaped.
- // Should already be path-split by now.
- return false
- case '\\':
- clearStateChar();
- escaping = true;
- continue
- // the various stateChar values
- // for the "extglob" stuff.
- case '?':
- case '*':
- case '+':
- case '@':
- case '!':
- this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c);
- // all of those are literals inside a class, except that
- // the glob [!a] means [^a] in regexp
- if (inClass) {
- this.debug(' in class');
- if (c === '!' && i === classStart + 1) c = '^';
- re += c;
- continue
- }
- // if we already have a stateChar, then it means
- // that there was something like ** or +? in there.
- // Handle the stateChar, then proceed with this one.
- self.debug('call clearStateChar %j', stateChar);
- clearStateChar();
- stateChar = c;
- // if extglob is disabled, then +(asdf|foo) isn't a thing.
- // just clear the statechar *now*, rather than even diving into
- // the patternList stuff.
- if (options.noext) clearStateChar();
- continue
- case '(':
- if (inClass) {
- re += '(';
- continue
- }
- if (!stateChar) {
- re += '\\(';
- continue
- }
- patternListStack.push({
- type: stateChar,
- start: i - 1,
- reStart: re.length,
- open: plTypes[stateChar].open,
- close: plTypes[stateChar].close
- });
- // negation is (?:(?!js)[^/]*)
- re += stateChar === '!' ? '(?:(?!(?:' : '(?:';
- this.debug('plType %j %j', stateChar, re);
- stateChar = false;
- continue
- case ')':
- if (inClass || !patternListStack.length) {
- re += '\\)';
- continue
- }
- clearStateChar();
- hasMagic = true;
- var pl = patternListStack.pop();
- // negation is (?:(?!js)[^/]*)
- // The others are (?:<pattern>)<type>
- re += pl.close;
- if (pl.type === '!') {
- negativeLists.push(pl);
- }
- pl.reEnd = re.length;
- continue
- case '|':
- if (inClass || !patternListStack.length || escaping) {
- re += '\\|';
- escaping = false;
- continue
- }
- clearStateChar();
- re += '|';
- continue
- // these are mostly the same in regexp and glob
- case '[':
- // swallow any state-tracking char before the [
- clearStateChar();
- if (inClass) {
- re += '\\' + c;
- continue
- }
- inClass = true;
- classStart = i;
- reClassStart = re.length;
- re += c;
- continue
- case ']':
- // a right bracket shall lose its special
- // meaning and represent itself in
- // a bracket expression if it occurs
- // first in the list. -- POSIX.2 2.8.3.2
- if (i === classStart + 1 || !inClass) {
- re += '\\' + c;
- escaping = false;
- continue
- }
- // handle the case where we left a class open.
- // "[z-a]" is valid, equivalent to "\[z-a\]"
- if (inClass) {
- // split where the last [ was, make sure we don't have
- // an invalid re. if so, re-walk the contents of the
- // would-be class to re-translate any characters that
- // were passed through as-is
- // TODO: It would probably be faster to determine this
- // without a try/catch and a new RegExp, but it's tricky
- // to do safely. For now, this is safe and works.
- var cs = pattern.substring(classStart + 1, i);
- try {
- RegExp('[' + cs + ']');
- } catch (er) {
- // not a valid class!
- var sp = this.parse(cs, SUBPARSE);
- re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]';
- hasMagic = hasMagic || sp[1];
- inClass = false;
- continue
- }
- }
- // finish up the class.
- hasMagic = true;
- inClass = false;
- re += c;
- continue
- default:
- // swallow any state char that wasn't consumed
- clearStateChar();
- if (escaping) {
- // no need
- escaping = false;
- } else if (reSpecials[c]
- && !(c === '^' && inClass)) {
- re += '\\';
- }
- re += c;
- } // switch
- } // for
- // handle the case where we left a class open.
- // "[abc" is valid, equivalent to "\[abc"
- if (inClass) {
- // split where the last [ was, and escape it
- // this is a huge pita. We now have to re-walk
- // the contents of the would-be class to re-translate
- // any characters that were passed through as-is
- cs = pattern.substr(classStart + 1);
- sp = this.parse(cs, SUBPARSE);
- re = re.substr(0, reClassStart) + '\\[' + sp[0];
- hasMagic = hasMagic || sp[1];
- }
- // handle the case where we had a +( thing at the *end*
- // of the pattern.
- // each pattern list stack adds 3 chars, and we need to go through
- // and escape any | chars that were passed through as-is for the regexp.
- // Go through and escape them, taking care not to double-escape any
- // | chars that were already escaped.
- for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
- var tail = re.slice(pl.reStart + pl.open.length);
- this.debug('setting tail', re, pl);
- // maybe some even number of \, then maybe 1 \, followed by a |
- tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
- if (!$2) {
- // the | isn't already escaped, so escape it.
- $2 = '\\';
- }
- // need to escape all those slashes *again*, without escaping the
- // one that we need for escaping the | character. As it works out,
- // escaping an even number of slashes can be done by simply repeating
- // it exactly after itself. That's why this trick works.
- //
- // I am sorry that you have to see this.
- return $1 + $1 + $2 + '|'
- });
- this.debug('tail=%j\n %s', tail, tail, pl, re);
- var t = pl.type === '*' ? star
- : pl.type === '?' ? qmark
- : '\\' + pl.type;
- hasMagic = true;
- re = re.slice(0, pl.reStart) + t + '\\(' + tail;
- }
- // handle trailing things that only matter at the very end.
- clearStateChar();
- if (escaping) {
- // trailing \\
- re += '\\\\';
- }
- // only need to apply the nodot start if the re starts with
- // something that could conceivably capture a dot
- var addPatternStart = false;
- switch (re.charAt(0)) {
- case '.':
- case '[':
- case '(': addPatternStart = true;
- }
- // Hack to work around lack of negative lookbehind in JS
- // A pattern like: *.!(x).!(y|z) needs to ensure that a name
- // like 'a.xyz.yz' doesn't match. So, the first negative
- // lookahead, has to look ALL the way ahead, to the end of
- // the pattern.
- for (var n = negativeLists.length - 1; n > -1; n--) {
- var nl = negativeLists[n];
- var nlBefore = re.slice(0, nl.reStart);
- var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
- var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
- var nlAfter = re.slice(nl.reEnd);
- nlLast += nlAfter;
- // Handle nested stuff like *(*.js|!(*.json)), where open parens
- // mean that we should *not* include the ) in the bit that is considered
- // "after" the negated section.
- var openParensBefore = nlBefore.split('(').length - 1;
- var cleanAfter = nlAfter;
- for (i = 0; i < openParensBefore; i++) {
- cleanAfter = cleanAfter.replace(/\)[+*?]?/, '');
- }
- nlAfter = cleanAfter;
- var dollar = '';
- if (nlAfter === '' && isSub !== SUBPARSE) {
- dollar = '$';
- }
- var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
- re = newRe;
- }
- // if the re is not "" at this point, then we need to make sure
- // it doesn't match against an empty path part.
- // Otherwise a/* will match a/, which it should not.
- if (re !== '' && hasMagic) {
- re = '(?=.)' + re;
- }
- if (addPatternStart) {
- re = patternStart + re;
- }
- // parsing just a piece of a larger pattern.
- if (isSub === SUBPARSE) {
- return [re, hasMagic]
- }
- // skip the regexp for non-magical patterns
- // unescape anything in it, though, so that it'll be
- // an exact match against a file etc.
- if (!hasMagic) {
- return globUnescape(pattern)
- }
- var flags = options.nocase ? 'i' : '';
- try {
- var regExp = new RegExp('^' + re + '$', flags);
- } catch (er) {
- // If it was an invalid regular expression, then it can't match
- // anything. This trick looks for a character after the end of
- // the string, which is of course impossible, except in multi-line
- // mode, but it's not a /m regex.
- return new RegExp('$.')
- }
- regExp._glob = pattern;
- regExp._src = re;
- return regExp
- }
- minimatch.makeRe = function (pattern, options) {
- return new Minimatch$1(pattern, options || {}).makeRe()
- };
- Minimatch$1.prototype.makeRe = makeRe;
- function makeRe () {
- if (this.regexp || this.regexp === false) return this.regexp
- // at this point, this.set is a 2d array of partial
- // pattern strings, or "**".
- //
- // It's better to use .match(). This function shouldn't
- // be used, really, but it's pretty convenient sometimes,
- // when you just want to work with a regex.
- var set = this.set;
- if (!set.length) {
- this.regexp = false;
- return this.regexp
- }
- var options = this.options;
- var twoStar = options.noglobstar ? star
- : options.dot ? twoStarDot
- : twoStarNoDot;
- var flags = options.nocase ? 'i' : '';
- var re = set.map(function (pattern) {
- return pattern.map(function (p) {
- return (p === GLOBSTAR) ? twoStar
- : (typeof p === 'string') ? regExpEscape(p)
- : p._src
- }).join('\\\/')
- }).join('|');
- // must match entire pattern
- // ending in a * or ** will make it less strict.
- re = '^(?:' + re + ')$';
- // can match anything, as long as it's not this.
- if (this.negate) re = '^(?!' + re + ').*$';
- try {
- this.regexp = new RegExp(re, flags);
- } catch (ex) {
- this.regexp = false;
- }
- return this.regexp
- }
- minimatch.match = function (list, pattern, options) {
- options = options || {};
- var mm = new Minimatch$1(pattern, options);
- list = list.filter(function (f) {
- return mm.match(f)
- });
- if (mm.options.nonull && !list.length) {
- list.push(pattern);
- }
- return list
- };
- Minimatch$1.prototype.match = match;
- function match (f, partial) {
- this.debug('match', f, this.pattern);
- // short-circuit in the case of busted things.
- // comments, etc.
- if (this.comment) return false
- if (this.empty) return f === ''
- if (f === '/' && partial) return true
- var options = this.options;
- // windows: need to use /, not \
- if (path.sep !== '/') {
- f = f.split(path.sep).join('/');
- }
- // treat the test path as a set of pathparts.
- f = f.split(slashSplit);
- this.debug(this.pattern, 'split', f);
- // just ONE of the pattern sets in this.set needs to match
- // in order for it to be valid. If negating, then just one
- // match means that we have failed.
- // Either way, return on the first hit.
- var set = this.set;
- this.debug(this.pattern, 'set', set);
- // Find the basename of the path by looking for the last non-empty segment
- var filename;
- var i;
- for (i = f.length - 1; i >= 0; i--) {
- filename = f[i];
- if (filename) break
- }
- for (i = 0; i < set.length; i++) {
- var pattern = set[i];
- var file = f;
- if (options.matchBase && pattern.length === 1) {
- file = [filename];
- }
- var hit = this.matchOne(file, pattern, partial);
- if (hit) {
- if (options.flipNegate) return true
- return !this.negate
- }
- }
- // didn't get any hits. this is success if it's a negative
- // pattern, failure otherwise.
- if (options.flipNegate) return false
- return this.negate
- }
- // set partial to true to test if, for example,
- // "/a/b" matches the start of "/*/b/*/d"
- // Partial means, if you run out of file before you run
- // out of pattern, then that's fine, as long as all
- // the parts match.
- Minimatch$1.prototype.matchOne = function (file, pattern, partial) {
- var options = this.options;
- this.debug('matchOne',
- { 'this': this, file: file, pattern: pattern });
- this.debug('matchOne', file.length, pattern.length);
- for (var fi = 0,
- pi = 0,
- fl = file.length,
- pl = pattern.length
- ; (fi < fl) && (pi < pl)
- ; fi++, pi++) {
- this.debug('matchOne loop');
- var p = pattern[pi];
- var f = file[fi];
- this.debug(pattern, p, f);
- // should be impossible.
- // some invalid regexp stuff in the set.
- if (p === false) return false
- if (p === GLOBSTAR) {
- this.debug('GLOBSTAR', [pattern, p, f]);
- // "**"
- // a/**/b/**/c would match the following:
- // a/b/x/y/z/c
- // a/x/y/z/b/c
- // a/b/x/b/x/c
- // a/b/c
- // To do this, take the rest of the pattern after
- // the **, and see if it would match the file remainder.
- // If so, return success.
- // If not, the ** "swallows" a segment, and try again.
- // This is recursively awful.
- //
- // a/**/b/**/c matching a/b/x/y/z/c
- // - a matches a
- // - doublestar
- // - matchOne(b/x/y/z/c, b/**/c)
- // - b matches b
- // - doublestar
- // - matchOne(x/y/z/c, c) -> no
- // - matchOne(y/z/c, c) -> no
- // - matchOne(z/c, c) -> no
- // - matchOne(c, c) yes, hit
- var fr = fi;
- var pr = pi + 1;
- if (pr === pl) {
- this.debug('** at the end');
- // a ** at the end will just swallow the rest.
- // We have found a match.
- // however, it will not swallow /.x, unless
- // options.dot is set.
- // . and .. are *never* matched by **, for explosively
- // exponential reasons.
- for (; fi < fl; fi++) {
- if (file[fi] === '.' || file[fi] === '..' ||
- (!options.dot && file[fi].charAt(0) === '.')) return false
- }
- return true
- }
- // ok, let's see if we can swallow whatever we can.
- while (fr < fl) {
- var swallowee = file[fr];
- this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
- // XXX remove this slice. Just pass the start index.
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
- this.debug('globstar found match!', fr, fl, swallowee);
- // found a match.
- return true
- } else {
- // can't swallow "." or ".." ever.
- // can only swallow ".foo" when explicitly asked.
- if (swallowee === '.' || swallowee === '..' ||
- (!options.dot && swallowee.charAt(0) === '.')) {
- this.debug('dot detected!', file, fr, pattern, pr);
- break
- }
- // ** swallows a segment, and continue.
- this.debug('globstar swallow a segment, and continue');
- fr++;
- }
- }
- // no match was found.
- // However, in partial mode, we can't say this is necessarily over.
- // If there's more *pattern* left, then
- if (partial) {
- // ran out of file
- this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
- if (fr === fl) return true
- }
- return false
- }
- // something other than **
- // non-magic patterns just have to match exactly
- // patterns with magic have been turned into regexps.
- var hit;
- if (typeof p === 'string') {
- if (options.nocase) {
- hit = f.toLowerCase() === p.toLowerCase();
- } else {
- hit = f === p;
- }
- this.debug('string match', p, f, hit);
- } else {
- hit = f.match(p);
- this.debug('pattern match', p, f, hit);
- }
- if (!hit) return false
- }
- // Note: ending in / means that we'll get a final ""
- // at the end of the pattern. This can only match a
- // corresponding "" at the end of the file.
- // If the file ends in /, then it can only match a
- // a pattern that ends in /, unless the pattern just
- // doesn't have any more for it. But, a/b/ should *not*
- // match "a/b/*", even though "" matches against the
- // [^/]*? pattern, except in partial mode, where it might
- // simply not be reached yet.
- // However, a/b/ should still satisfy a/*
- // now either we fell off the end of the pattern, or we're done.
- if (fi === fl && pi === pl) {
- // ran out of pattern and filename at the same time.
- // an exact hit!
- return true
- } else if (fi === fl) {
- // ran out of file, but still had pattern left.
- // this is ok if we're doing the match as part of
- // a glob fs traversal.
- return partial
- } else if (pi === pl) {
- // ran out of pattern, still have file left.
- // this is only acceptable if we're on the very last
- // empty segment of a file with a trailing slash.
- // a/* should match a/b/
- var emptyFileEnd = (fi === fl - 1) && (file[fi] === '');
- return emptyFileEnd
- }
- // should be unreachable.
- throw new Error('wtf?')
- };
- // replace stuff like \* with *
- function globUnescape (s) {
- return s.replace(/\\(.)/g, '$1')
- }
- function regExpEscape (s) {
- return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
- }
- var inherits_browser = createCommonjsModule(function (module) {
- if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- }
- };
- } else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- if (superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function () {};
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- }
- };
- }
- });
- var inherits$1 = createCommonjsModule(function (module) {
- try {
- var util = require$$0$1;
- /* istanbul ignore next */
- if (typeof util.inherits !== 'function') throw '';
- module.exports = util.inherits;
- } catch (e) {
- /* istanbul ignore next */
- module.exports = inherits_browser;
- }
- });
- // Copyright Joyent, Inc. and other Node contributors.
- var R = typeof Reflect === 'object' ? Reflect : null;
- var ReflectApply = R && typeof R.apply === 'function'
- ? R.apply
- : function ReflectApply(target, receiver, args) {
- return Function.prototype.apply.call(target, receiver, args);
- };
- var ReflectOwnKeys;
- if (R && typeof R.ownKeys === 'function') {
- ReflectOwnKeys = R.ownKeys;
- } else if (Object.getOwnPropertySymbols) {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target)
- .concat(Object.getOwnPropertySymbols(target));
- };
- } else {
- ReflectOwnKeys = function ReflectOwnKeys(target) {
- return Object.getOwnPropertyNames(target);
- };
- }
- function ProcessEmitWarning(warning) {
- if (console && console.warn) console.warn(warning);
- }
- var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
- return value !== value;
- };
- function EventEmitter() {
- EventEmitter.init.call(this);
- }
- var events = EventEmitter;
- var once_1$1 = once$1;
- // Backwards-compat with node 0.10.x
- EventEmitter.EventEmitter = EventEmitter;
- EventEmitter.prototype._events = undefined;
- EventEmitter.prototype._eventsCount = 0;
- EventEmitter.prototype._maxListeners = undefined;
- // By default EventEmitters will print a warning if more than 10 listeners are
- // added to it. This is a useful default which helps finding memory leaks.
- var defaultMaxListeners = 10;
- function checkListener(listener) {
- if (typeof listener !== 'function') {
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
- }
- }
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
- enumerable: true,
- get: function() {
- return defaultMaxListeners;
- },
- set: function(arg) {
- if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.');
- }
- defaultMaxListeners = arg;
- }
- });
- EventEmitter.init = function() {
- if (this._events === undefined ||
- this._events === Object.getPrototypeOf(this)._events) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- }
- this._maxListeners = this._maxListeners || undefined;
- };
- // Obviously not all Emitters should be limited to 10. This function allows
- // that to be increased. Set to zero for unlimited.
- EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.');
- }
- this._maxListeners = n;
- return this;
- };
- function _getMaxListeners(that) {
- if (that._maxListeners === undefined)
- return EventEmitter.defaultMaxListeners;
- return that._maxListeners;
- }
- EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
- return _getMaxListeners(this);
- };
- EventEmitter.prototype.emit = function emit(type) {
- var args = [];
- for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
- var doError = (type === 'error');
- var events = this._events;
- if (events !== undefined)
- doError = (doError && events.error === undefined);
- else if (!doError)
- return false;
- // If there is no 'error' event listener then throw.
- if (doError) {
- var er;
- if (args.length > 0)
- er = args[0];
- if (er instanceof Error) {
- // Note: The comments on the `throw` lines are intentional, they show
- // up in Node's output if this results in an unhandled exception.
- throw er; // Unhandled 'error' event
- }
- // At least give some kind of context to the user
- var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));
- err.context = er;
- throw err; // Unhandled 'error' event
- }
- var handler = events[type];
- if (handler === undefined)
- return false;
- if (typeof handler === 'function') {
- ReflectApply(handler, this, args);
- } else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- ReflectApply(listeners[i], this, args);
- }
- return true;
- };
- function _addListener(target, type, listener, prepend) {
- var m;
- var events;
- var existing;
- checkListener(listener);
- events = target._events;
- if (events === undefined) {
- events = target._events = Object.create(null);
- target._eventsCount = 0;
- } else {
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (events.newListener !== undefined) {
- target.emit('newListener', type,
- listener.listener ? listener.listener : listener);
- // Re-assign `events` because a newListener handler could have caused the
- // this._events to be assigned to a new object
- events = target._events;
- }
- existing = events[type];
- }
- if (existing === undefined) {
- // Optimize the case of one listener. Don't need the extra array object.
- existing = events[type] = listener;
- ++target._eventsCount;
- } else {
- if (typeof existing === 'function') {
- // Adding the second element, need to change to array.
- existing = events[type] =
- prepend ? [listener, existing] : [existing, listener];
- // If we've already got an array, just append.
- } else if (prepend) {
- existing.unshift(listener);
- } else {
- existing.push(listener);
- }
- // Check for listener leak
- m = _getMaxListeners(target);
- if (m > 0 && existing.length > m && !existing.warned) {
- existing.warned = true;
- // No error code for this since it is a Warning
- // eslint-disable-next-line no-restricted-syntax
- var w = new Error('Possible EventEmitter memory leak detected. ' +
- existing.length + ' ' + String(type) + ' listeners ' +
- 'added. Use emitter.setMaxListeners() to ' +
- 'increase limit');
- w.name = 'MaxListenersExceededWarning';
- w.emitter = target;
- w.type = type;
- w.count = existing.length;
- ProcessEmitWarning(w);
- }
- }
- return target;
- }
- EventEmitter.prototype.addListener = function addListener(type, listener) {
- return _addListener(this, type, listener, false);
- };
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
- EventEmitter.prototype.prependListener =
- function prependListener(type, listener) {
- return _addListener(this, type, listener, true);
- };
- function onceWrapper() {
- if (!this.fired) {
- this.target.removeListener(this.type, this.wrapFn);
- this.fired = true;
- if (arguments.length === 0)
- return this.listener.call(this.target);
- return this.listener.apply(this.target, arguments);
- }
- }
- function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
- var wrapped = onceWrapper.bind(state);
- wrapped.listener = listener;
- state.wrapFn = wrapped;
- return wrapped;
- }
- EventEmitter.prototype.once = function once(type, listener) {
- checkListener(listener);
- this.on(type, _onceWrap(this, type, listener));
- return this;
- };
- EventEmitter.prototype.prependOnceListener =
- function prependOnceListener(type, listener) {
- checkListener(listener);
- this.prependListener(type, _onceWrap(this, type, listener));
- return this;
- };
- // Emits a 'removeListener' event if and only if the listener was removed.
- EventEmitter.prototype.removeListener =
- function removeListener(type, listener) {
- var list, events, position, i, originalListener;
- checkListener(listener);
- events = this._events;
- if (events === undefined)
- return this;
- list = events[type];
- if (list === undefined)
- return this;
- if (list === listener || list.listener === listener) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else {
- delete events[type];
- if (events.removeListener)
- this.emit('removeListener', type, list.listener || listener);
- }
- } else if (typeof list !== 'function') {
- position = -1;
- for (i = list.length - 1; i >= 0; i--) {
- if (list[i] === listener || list[i].listener === listener) {
- originalListener = list[i].listener;
- position = i;
- break;
- }
- }
- if (position < 0)
- return this;
- if (position === 0)
- list.shift();
- else {
- spliceOne(list, position);
- }
- if (list.length === 1)
- events[type] = list[0];
- if (events.removeListener !== undefined)
- this.emit('removeListener', type, originalListener || listener);
- }
- return this;
- };
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.removeAllListeners =
- function removeAllListeners(type) {
- var listeners, events, i;
- events = this._events;
- if (events === undefined)
- return this;
- // not listening for removeListener, no need to emit
- if (events.removeListener === undefined) {
- if (arguments.length === 0) {
- this._events = Object.create(null);
- this._eventsCount = 0;
- } else if (events[type] !== undefined) {
- if (--this._eventsCount === 0)
- this._events = Object.create(null);
- else
- delete events[type];
- }
- return this;
- }
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- var keys = Object.keys(events);
- var key;
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = Object.create(null);
- this._eventsCount = 0;
- return this;
- }
- listeners = events[type];
- if (typeof listeners === 'function') {
- this.removeListener(type, listeners);
- } else if (listeners !== undefined) {
- // LIFO order
- for (i = listeners.length - 1; i >= 0; i--) {
- this.removeListener(type, listeners[i]);
- }
- }
- return this;
- };
- function _listeners(target, type, unwrap) {
- var events = target._events;
- if (events === undefined)
- return [];
- var evlistener = events[type];
- if (evlistener === undefined)
- return [];
- if (typeof evlistener === 'function')
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
- return unwrap ?
- unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
- }
- EventEmitter.prototype.listeners = function listeners(type) {
- return _listeners(this, type, true);
- };
- EventEmitter.prototype.rawListeners = function rawListeners(type) {
- return _listeners(this, type, false);
- };
- EventEmitter.listenerCount = function(emitter, type) {
- if (typeof emitter.listenerCount === 'function') {
- return emitter.listenerCount(type);
- } else {
- return listenerCount.call(emitter, type);
- }
- };
- EventEmitter.prototype.listenerCount = listenerCount;
- function listenerCount(type) {
- var events = this._events;
- if (events !== undefined) {
- var evlistener = events[type];
- if (typeof evlistener === 'function') {
- return 1;
- } else if (evlistener !== undefined) {
- return evlistener.length;
- }
- }
- return 0;
- }
- EventEmitter.prototype.eventNames = function eventNames() {
- return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
- };
- function arrayClone(arr, n) {
- var copy = new Array(n);
- for (var i = 0; i < n; ++i)
- copy[i] = arr[i];
- return copy;
- }
- function spliceOne(list, index) {
- for (; index + 1 < list.length; index++)
- list[index] = list[index + 1];
- list.pop();
- }
- function unwrapListeners(arr) {
- var ret = new Array(arr.length);
- for (var i = 0; i < ret.length; ++i) {
- ret[i] = arr[i].listener || arr[i];
- }
- return ret;
- }
- function once$1(emitter, name) {
- return new Promise(function (resolve, reject) {
- function errorListener(err) {
- emitter.removeListener(name, resolver);
- reject(err);
- }
- function resolver() {
- if (typeof emitter.removeListener === 'function') {
- emitter.removeListener('error', errorListener);
- }
- resolve([].slice.call(arguments));
- }
- eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
- if (name !== 'error') {
- addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
- }
- });
- }
- function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
- if (typeof emitter.on === 'function') {
- eventTargetAgnosticAddListener(emitter, 'error', handler, flags);
- }
- }
- function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
- if (typeof emitter.on === 'function') {
- if (flags.once) {
- emitter.once(name, listener);
- } else {
- emitter.on(name, listener);
- }
- } else if (typeof emitter.addEventListener === 'function') {
- // EventTarget does not have `error` event semantics like Node
- // EventEmitters, we do not listen for `error` events here.
- emitter.addEventListener(name, function wrapListener(arg) {
- // IE does not have builtin `{ once: true }` support so we
- // have to do it manually.
- if (flags.once) {
- emitter.removeEventListener(name, wrapListener);
- }
- listener(arg);
- });
- } else {
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
- }
- }
- events.once = once_1$1;
- /*
- object-assign
- (c) Sindre Sorhus
- @license MIT
- */
- /* eslint-disable no-unused-vars */
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
- function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
- return Object(val);
- }
- function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
- // Detect buggy property enumeration order in older V8 versions.
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
- }
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
- return to;
- };
- var isBuffer = function isBuffer(arg) {
- return arg instanceof Buffer;
- };
- var inherits = require$$0$1.inherits;
- var util = createCommonjsModule(function (module, exports) {
- // Copyright Joyent, Inc. and other Node contributors.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a
- // copy of this software and associated documentation files (the
- // "Software"), to deal in the Software without restriction, including
- // without limitation the rights to use, copy, modify, merge, publish,
- // distribute, sublicense, and/or sell copies of the Software, and to permit
- // persons to whom the Software is furnished to do so, subject to the
- // following conditions:
- //
- // The above copyright notice and this permission notice shall be included
- // in all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
- var formatRegExp = /%[sdj%]/g;
- exports.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(' ');
- }
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x) {
- if (x === '%%') return '%';
- if (i >= len) return x;
- switch (x) {
- case '%s': return String(args[i++]);
- case '%d': return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- default:
- return x;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += ' ' + x;
- } else {
- str += ' ' + inspect(x);
- }
- }
- return str;
- };
- // Mark that a method should not be used.
- // Returns a modified function which warns once by default.
- // If --no-deprecation is set, then it is a no-op.
- exports.deprecate = function(fn, msg) {
- // Allow for deprecating things in the process of starting up.
- if (isUndefined(commonjsGlobal.process)) {
- return function() {
- return exports.deprecate(fn, msg).apply(this, arguments);
- };
- }
- if (process.noDeprecation === true) {
- return fn;
- }
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
- return deprecated;
- };
- var debugs = {};
- var debugEnviron;
- exports.debuglog = function(set) {
- if (isUndefined(debugEnviron))
- debugEnviron = '';
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports.format.apply(exports, arguments);
- console.error('%s %d: %s', set, pid, msg);
- };
- } else {
- debugs[set] = function() {};
- }
- }
- return debugs[set];
- };
- /**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Object} opts Optional options object that alters the output.
- */
- /* legacy: obj, showHidden, depth, colors*/
- function inspect(obj, opts) {
- // default options
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- // legacy...
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- // legacy...
- ctx.showHidden = opts;
- } else if (opts) {
- // got an "options" object
- exports._extend(ctx, opts);
- }
- // set default options
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
- if (isUndefined(ctx.depth)) ctx.depth = 2;
- if (isUndefined(ctx.colors)) ctx.colors = false;
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
- if (ctx.colors) ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
- }
- exports.inspect = inspect;
- // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
- inspect.colors = {
- 'bold' : [1, 22],
- 'italic' : [3, 23],
- 'underline' : [4, 24],
- 'inverse' : [7, 27],
- 'white' : [37, 39],
- 'grey' : [90, 39],
- 'black' : [30, 39],
- 'blue' : [34, 39],
- 'cyan' : [36, 39],
- 'green' : [32, 39],
- 'magenta' : [35, 39],
- 'red' : [31, 39],
- 'yellow' : [33, 39]
- };
- // Don't use 'blue' not visible on cmd.exe
- inspect.styles = {
- 'special': 'cyan',
- 'number': 'yellow',
- 'boolean': 'yellow',
- 'undefined': 'grey',
- 'null': 'bold',
- 'string': 'green',
- 'date': 'magenta',
- // "name": intentionally not styling
- 'regexp': 'red'
- };
- function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
- if (style) {
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
- '\u001b[' + inspect.colors[style][1] + 'm';
- } else {
- return str;
- }
- }
- function stylizeNoColor(str, styleType) {
- return str;
- }
- function arrayToHash(array) {
- var hash = {};
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
- return hash;
- }
- function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (ctx.customInspect &&
- value &&
- isFunction(value.inspect) &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
- // Look up the keys of the object.
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
- // IE doesn't make error fields non-enumerable
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
- if (isError(value)
- && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
- return formatError(value);
- }
- // Some type of object without properties can be shortcutted.
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ': ' + value.name : '';
- return ctx.stylize('[Function' + name + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
- var base = '', array = false, braces = ['{', '}'];
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
- // Make functions say that they are functions
- if (isFunction(value)) {
- var n = value.name ? ': ' + value.name : '';
- base = ' [Function' + n + ']';
- }
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
- // Make error with message first say the error
- if (isError(value)) {
- base = ' ' + formatError(value);
- }
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
- ctx.seen.push(value);
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
- ctx.seen.pop();
- return reduceToSingleString(output, base, braces);
- }
- function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize('undefined', 'undefined');
- if (isString(value)) {
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
- }
- if (isNumber(value))
- return ctx.stylize('' + value, 'number');
- if (isBoolean(value))
- return ctx.stylize('' + value, 'boolean');
- // For some reason typeof null is "object", so special case here.
- if (isNull(value))
- return ctx.stylize('null', 'null');
- }
- function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
- }
- function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
- }
- function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (desc.set) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
- return name + ': ' + str;
- }
- function reduceToSingleString(output, base, braces) {
- var length = output.reduce(function(prev, cur) {
- if (cur.indexOf('\n') >= 0) ;
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
- }, 0);
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
- }
- // NOTE: These type checking functions intentionally don't use `instanceof`
- // because it is fragile and can be easily faked with `Object.create()`.
- function isArray(ar) {
- return Array.isArray(ar);
- }
- exports.isArray = isArray;
- function isBoolean(arg) {
- return typeof arg === 'boolean';
- }
- exports.isBoolean = isBoolean;
- function isNull(arg) {
- return arg === null;
- }
- exports.isNull = isNull;
- function isNullOrUndefined(arg) {
- return arg == null;
- }
- exports.isNullOrUndefined = isNullOrUndefined;
- function isNumber(arg) {
- return typeof arg === 'number';
- }
- exports.isNumber = isNumber;
- function isString(arg) {
- return typeof arg === 'string';
- }
- exports.isString = isString;
- function isSymbol(arg) {
- return typeof arg === 'symbol';
- }
- exports.isSymbol = isSymbol;
- function isUndefined(arg) {
- return arg === void 0;
- }
- exports.isUndefined = isUndefined;
- function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
- }
- exports.isRegExp = isRegExp;
- function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
- }
- exports.isObject = isObject;
- function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
- }
- exports.isDate = isDate;
- function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
- }
- exports.isError = isError;
- function isFunction(arg) {
- return typeof arg === 'function';
- }
- exports.isFunction = isFunction;
- function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
- }
- exports.isPrimitive = isPrimitive;
- exports.isBuffer = isBuffer;
- function objectToString(o) {
- return Object.prototype.toString.call(o);
- }
- function pad(n) {
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
- }
- var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
- 'Oct', 'Nov', 'Dec'];
- // 26 Feb 16:19:34
- function timestamp() {
- var d = new Date();
- var time = [pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())].join(':');
- return [d.getDate(), months[d.getMonth()], time].join(' ');
- }
- // log is just a thin wrapper to console.log that prepends a timestamp
- exports.log = function() {
- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
- };
- /**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be rewritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- * prototype.
- * @param {function} superCtor Constructor function to inherit prototype from.
- */
- exports.inherits = inherits;
- exports._extend = function(origin, add) {
- // Don't do anything if add isn't an object
- if (!add || !isObject(add)) return origin;
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
- };
- function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- });
- var assert_1 = createCommonjsModule(function (module) {
- // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
- // original notice:
- /*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
- * @license MIT
- */
- function compare(a, b) {
- if (a === b) {
- return 0;
- }
- var x = a.length;
- var y = b.length;
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i];
- y = b[i];
- break;
- }
- }
- if (x < y) {
- return -1;
- }
- if (y < x) {
- return 1;
- }
- return 0;
- }
- function isBuffer(b) {
- if (commonjsGlobal.Buffer && typeof commonjsGlobal.Buffer.isBuffer === 'function') {
- return commonjsGlobal.Buffer.isBuffer(b);
- }
- return !!(b != null && b._isBuffer);
- }
- // based on node assert, original notice:
- // NB: The URL to the CommonJS spec is kept just for tradition.
- // node-assert has evolved a lot since then, both in API and behavior.
- // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
- //
- // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
- //
- // Originally from narwhal.js (http://narwhaljs.org)
- // Copyright (c) 2009 Thomas Robinson <280north.com>
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the 'Software'), to
- // deal in the Software without restriction, including without limitation the
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- // sell copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- var hasOwn = Object.prototype.hasOwnProperty;
- var pSlice = Array.prototype.slice;
- var functionsHaveNames = (function () {
- return function foo() {}.name === 'foo';
- }());
- function pToString (obj) {
- return Object.prototype.toString.call(obj);
- }
- function isView(arrbuf) {
- if (isBuffer(arrbuf)) {
- return false;
- }
- if (typeof commonjsGlobal.ArrayBuffer !== 'function') {
- return false;
- }
- if (typeof ArrayBuffer.isView === 'function') {
- return ArrayBuffer.isView(arrbuf);
- }
- if (!arrbuf) {
- return false;
- }
- if (arrbuf instanceof DataView) {
- return true;
- }
- if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
- return true;
- }
- return false;
- }
- // 1. The assert module provides functions that throw
- // AssertionError's when particular conditions are not met. The
- // assert module must conform to the following interface.
- var assert = module.exports = ok;
- // 2. The AssertionError is defined in assert.
- // new assert.AssertionError({ message: message,
- // actual: actual,
- // expected: expected })
- var regex = /\s*function\s+([^\(\s]*)\s*/;
- // based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
- function getName(func) {
- if (!util.isFunction(func)) {
- return;
- }
- if (functionsHaveNames) {
- return func.name;
- }
- var str = func.toString();
- var match = str.match(regex);
- return match && match[1];
- }
- assert.AssertionError = function AssertionError(options) {
- this.name = 'AssertionError';
- this.actual = options.actual;
- this.expected = options.expected;
- this.operator = options.operator;
- if (options.message) {
- this.message = options.message;
- this.generatedMessage = false;
- } else {
- this.message = getMessage(this);
- this.generatedMessage = true;
- }
- var stackStartFunction = options.stackStartFunction || fail;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, stackStartFunction);
- } else {
- // non v8 browsers so we can have a stacktrace
- var err = new Error();
- if (err.stack) {
- var out = err.stack;
- // try to strip useless frames
- var fn_name = getName(stackStartFunction);
- var idx = out.indexOf('\n' + fn_name);
- if (idx >= 0) {
- // once we have located the function frame
- // we need to strip out everything before it (and its line)
- var next_line = out.indexOf('\n', idx + 1);
- out = out.substring(next_line + 1);
- }
- this.stack = out;
- }
- }
- };
- // assert.AssertionError instanceof Error
- util.inherits(assert.AssertionError, Error);
- function truncate(s, n) {
- if (typeof s === 'string') {
- return s.length < n ? s : s.slice(0, n);
- } else {
- return s;
- }
- }
- function inspect(something) {
- if (functionsHaveNames || !util.isFunction(something)) {
- return util.inspect(something);
- }
- var rawname = getName(something);
- var name = rawname ? ': ' + rawname : '';
- return '[Function' + name + ']';
- }
- function getMessage(self) {
- return truncate(inspect(self.actual), 128) + ' ' +
- self.operator + ' ' +
- truncate(inspect(self.expected), 128);
- }
- // At present only the three keys mentioned above are used and
- // understood by the spec. Implementations or sub modules can pass
- // other keys to the AssertionError's constructor - they will be
- // ignored.
- // 3. All of the following functions must throw an AssertionError
- // when a corresponding condition is not met, with a message that
- // may be undefined if not provided. All assertion methods provide
- // both the actual and expected values to the assertion error for
- // display purposes.
- function fail(actual, expected, message, operator, stackStartFunction) {
- throw new assert.AssertionError({
- message: message,
- actual: actual,
- expected: expected,
- operator: operator,
- stackStartFunction: stackStartFunction
- });
- }
- // EXTENSION! allows for well behaved errors defined elsewhere.
- assert.fail = fail;
- // 4. Pure assertion tests whether a value is truthy, as determined
- // by !!guard.
- // assert.ok(guard, message_opt);
- // This statement is equivalent to assert.equal(true, !!guard,
- // message_opt);. To test strictly for the value true, use
- // assert.strictEqual(true, guard, message_opt);.
- function ok(value, message) {
- if (!value) fail(value, true, message, '==', assert.ok);
- }
- assert.ok = ok;
- // 5. The equality assertion tests shallow, coercive equality with
- // ==.
- // assert.equal(actual, expected, message_opt);
- assert.equal = function equal(actual, expected, message) {
- if (actual != expected) fail(actual, expected, message, '==', assert.equal);
- };
- // 6. The non-equality assertion tests for whether two objects are not equal
- // with != assert.notEqual(actual, expected, message_opt);
- assert.notEqual = function notEqual(actual, expected, message) {
- if (actual == expected) {
- fail(actual, expected, message, '!=', assert.notEqual);
- }
- };
- // 7. The equivalence assertion tests a deep equality relation.
- // assert.deepEqual(actual, expected, message_opt);
- assert.deepEqual = function deepEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, 'deepEqual', assert.deepEqual);
- }
- };
- assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
- }
- };
- function _deepEqual(actual, expected, strict, memos) {
- // 7.1. All identical values are equivalent, as determined by ===.
- if (actual === expected) {
- return true;
- } else if (isBuffer(actual) && isBuffer(expected)) {
- return compare(actual, expected) === 0;
- // 7.2. If the expected value is a Date object, the actual value is
- // equivalent if it is also a Date object that refers to the same time.
- } else if (util.isDate(actual) && util.isDate(expected)) {
- return actual.getTime() === expected.getTime();
- // 7.3 If the expected value is a RegExp object, the actual value is
- // equivalent if it is also a RegExp object with the same source and
- // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
- } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
- return actual.source === expected.source &&
- actual.global === expected.global &&
- actual.multiline === expected.multiline &&
- actual.lastIndex === expected.lastIndex &&
- actual.ignoreCase === expected.ignoreCase;
- // 7.4. Other pairs that do not both pass typeof value == 'object',
- // equivalence is determined by ==.
- } else if ((actual === null || typeof actual !== 'object') &&
- (expected === null || typeof expected !== 'object')) {
- return strict ? actual === expected : actual == expected;
- // If both values are instances of typed arrays, wrap their underlying
- // ArrayBuffers in a Buffer each to increase performance
- // This optimization requires the arrays to have the same type as checked by
- // Object.prototype.toString (aka pToString). Never perform binary
- // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
- // bit patterns are not identical.
- } else if (isView(actual) && isView(expected) &&
- pToString(actual) === pToString(expected) &&
- !(actual instanceof Float32Array ||
- actual instanceof Float64Array)) {
- return compare(new Uint8Array(actual.buffer),
- new Uint8Array(expected.buffer)) === 0;
- // 7.5 For all other Object pairs, including Array objects, equivalence is
- // determined by having the same number of owned properties (as verified
- // with Object.prototype.hasOwnProperty.call), the same set of keys
- // (although not necessarily the same order), equivalent values for every
- // corresponding key, and an identical 'prototype' property. Note: this
- // accounts for both named and indexed properties on Arrays.
- } else if (isBuffer(actual) !== isBuffer(expected)) {
- return false;
- } else {
- memos = memos || {actual: [], expected: []};
- var actualIndex = memos.actual.indexOf(actual);
- if (actualIndex !== -1) {
- if (actualIndex === memos.expected.indexOf(expected)) {
- return true;
- }
- }
- memos.actual.push(actual);
- memos.expected.push(expected);
- return objEquiv(actual, expected, strict, memos);
- }
- }
- function isArguments(object) {
- return Object.prototype.toString.call(object) == '[object Arguments]';
- }
- function objEquiv(a, b, strict, actualVisitedObjects) {
- if (a === null || a === undefined || b === null || b === undefined)
- return false;
- // if one is a primitive, the other must be same
- if (util.isPrimitive(a) || util.isPrimitive(b))
- return a === b;
- if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
- return false;
- var aIsArgs = isArguments(a);
- var bIsArgs = isArguments(b);
- if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
- return false;
- if (aIsArgs) {
- a = pSlice.call(a);
- b = pSlice.call(b);
- return _deepEqual(a, b, strict);
- }
- var ka = objectKeys(a);
- var kb = objectKeys(b);
- var key, i;
- // having the same number of owned properties (keys incorporates
- // hasOwnProperty)
- if (ka.length !== kb.length)
- return false;
- //the same set of keys (although not necessarily the same order),
- ka.sort();
- kb.sort();
- //~~~cheap key test
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] !== kb[i])
- return false;
- }
- //equivalent values for every corresponding key, and
- //~~~possibly expensive deep test
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
- return false;
- }
- return true;
- }
- // 8. The non-equivalence assertion tests for any deep inequality.
- // assert.notDeepEqual(actual, expected, message_opt);
- assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
- }
- };
- assert.notDeepStrictEqual = notDeepStrictEqual;
- function notDeepStrictEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
- }
- }
- // 9. The strict equality assertion tests strict equality, as determined by ===.
- // assert.strictEqual(actual, expected, message_opt);
- assert.strictEqual = function strictEqual(actual, expected, message) {
- if (actual !== expected) {
- fail(actual, expected, message, '===', assert.strictEqual);
- }
- };
- // 10. The strict non-equality assertion tests for strict inequality, as
- // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
- assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
- if (actual === expected) {
- fail(actual, expected, message, '!==', assert.notStrictEqual);
- }
- };
- function expectedException(actual, expected) {
- if (!actual || !expected) {
- return false;
- }
- if (Object.prototype.toString.call(expected) == '[object RegExp]') {
- return expected.test(actual);
- }
- try {
- if (actual instanceof expected) {
- return true;
- }
- } catch (e) {
- // Ignore. The instanceof check doesn't work for arrow functions.
- }
- if (Error.isPrototypeOf(expected)) {
- return false;
- }
- return expected.call({}, actual) === true;
- }
- function _tryBlock(block) {
- var error;
- try {
- block();
- } catch (e) {
- error = e;
- }
- return error;
- }
- function _throws(shouldThrow, block, expected, message) {
- var actual;
- if (typeof block !== 'function') {
- throw new TypeError('"block" argument must be a function');
- }
- if (typeof expected === 'string') {
- message = expected;
- expected = null;
- }
- actual = _tryBlock(block);
- message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
- (message ? ' ' + message : '.');
- if (shouldThrow && !actual) {
- fail(actual, expected, 'Missing expected exception' + message);
- }
- var userProvidedMessage = typeof message === 'string';
- var isUnwantedException = !shouldThrow && util.isError(actual);
- var isUnexpectedException = !shouldThrow && actual && !expected;
- if ((isUnwantedException &&
- userProvidedMessage &&
- expectedException(actual, expected)) ||
- isUnexpectedException) {
- fail(actual, expected, 'Got unwanted exception' + message);
- }
- if ((shouldThrow && actual && expected &&
- !expectedException(actual, expected)) || (!shouldThrow && actual)) {
- throw actual;
- }
- }
- // 11. Expected to throw an error:
- // assert.throws(block, Error_opt, message_opt);
- assert.throws = function(block, /*optional*/error, /*optional*/message) {
- _throws(true, block, error, message);
- };
- // EXTENSION! This is annoying to write outside this module.
- assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
- _throws(false, block, error, message);
- };
- assert.ifError = function(err) { if (err) throw err; };
- // Expose a strict only variant of assert
- function strict(value, message) {
- if (!value) fail(value, true, message, '==', strict);
- }
- assert.strict = objectAssign(strict, assert, {
- equal: assert.strictEqual,
- deepEqual: assert.deepStrictEqual,
- notEqual: assert.notStrictEqual,
- notDeepEqual: assert.notDeepStrictEqual
- });
- assert.strict.strict = assert.strict;
- var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- if (hasOwn.call(obj, key)) keys.push(key);
- }
- return keys;
- };
- });
- function posix(path) {
- return path.charAt(0) === '/';
- }
- function win32(path) {
- // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
- var result = splitDeviceRe.exec(path);
- var device = result[1] || '';
- var isUnc = Boolean(device && device.charAt(1) !== ':');
- // UNC paths are always absolute
- return Boolean(result[2] || isUnc);
- }
- var pathIsAbsolute = process.platform === 'win32' ? win32 : posix;
- var posix_1 = posix;
- var win32_1 = win32;
- pathIsAbsolute.posix = posix_1;
- pathIsAbsolute.win32 = win32_1;
- var alphasort_1 = alphasort;
- var alphasorti_1 = alphasorti;
- var setopts_1 = setopts$2;
- var ownProp_1 = ownProp$2;
- var makeAbs_1 = makeAbs;
- var finish_1 = finish;
- var mark_1 = mark;
- var isIgnored_1 = isIgnored$2;
- var childrenIgnored_1 = childrenIgnored$2;
- function ownProp$2 (obj, field) {
- return Object.prototype.hasOwnProperty.call(obj, field)
- }
- var Minimatch = minimatch_1.Minimatch;
- function alphasorti (a, b) {
- return a.toLowerCase().localeCompare(b.toLowerCase())
- }
- function alphasort (a, b) {
- return a.localeCompare(b)
- }
- function setupIgnores (self, options) {
- self.ignore = options.ignore || [];
- if (!Array.isArray(self.ignore))
- self.ignore = [self.ignore];
- if (self.ignore.length) {
- self.ignore = self.ignore.map(ignoreMap);
- }
- }
- // ignore patterns are always in dot:true mode.
- function ignoreMap (pattern) {
- var gmatcher = null;
- if (pattern.slice(-3) === '/**') {
- var gpattern = pattern.replace(/(\/\*\*)+$/, '');
- gmatcher = new Minimatch(gpattern, { dot: true });
- }
- return {
- matcher: new Minimatch(pattern, { dot: true }),
- gmatcher: gmatcher
- }
- }
- function setopts$2 (self, pattern, options) {
- if (!options)
- options = {};
- // base-matching: just use globstar for that.
- if (options.matchBase && -1 === pattern.indexOf("/")) {
- if (options.noglobstar) {
- throw new Error("base matching requires globstar")
- }
- pattern = "**/" + pattern;
- }
- self.silent = !!options.silent;
- self.pattern = pattern;
- self.strict = options.strict !== false;
- self.realpath = !!options.realpath;
- self.realpathCache = options.realpathCache || Object.create(null);
- self.follow = !!options.follow;
- self.dot = !!options.dot;
- self.mark = !!options.mark;
- self.nodir = !!options.nodir;
- if (self.nodir)
- self.mark = true;
- self.sync = !!options.sync;
- self.nounique = !!options.nounique;
- self.nonull = !!options.nonull;
- self.nosort = !!options.nosort;
- self.nocase = !!options.nocase;
- self.stat = !!options.stat;
- self.noprocess = !!options.noprocess;
- self.absolute = !!options.absolute;
- self.maxLength = options.maxLength || Infinity;
- self.cache = options.cache || Object.create(null);
- self.statCache = options.statCache || Object.create(null);
- self.symlinks = options.symlinks || Object.create(null);
- setupIgnores(self, options);
- self.changedCwd = false;
- var cwd = process.cwd();
- if (!ownProp$2(options, "cwd"))
- self.cwd = cwd;
- else {
- self.cwd = path$5.resolve(options.cwd);
- self.changedCwd = self.cwd !== cwd;
- }
- self.root = options.root || path$5.resolve(self.cwd, "/");
- self.root = path$5.resolve(self.root);
- if (process.platform === "win32")
- self.root = self.root.replace(/\\/g, "/");
- // TODO: is an absolute `cwd` supposed to be resolved against `root`?
- // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
- self.cwdAbs = pathIsAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd);
- if (process.platform === "win32")
- self.cwdAbs = self.cwdAbs.replace(/\\/g, "/");
- self.nomount = !!options.nomount;
- // disable comments and negation in Minimatch.
- // Note that they are not supported in Glob itself anyway.
- options.nonegate = true;
- options.nocomment = true;
- self.minimatch = new Minimatch(pattern, options);
- self.options = self.minimatch.options;
- }
- function finish (self) {
- var nou = self.nounique;
- var all = nou ? [] : Object.create(null);
- for (var i = 0, l = self.matches.length; i < l; i ++) {
- var matches = self.matches[i];
- if (!matches || Object.keys(matches).length === 0) {
- if (self.nonull) {
- // do like the shell, and spit out the literal glob
- var literal = self.minimatch.globSet[i];
- if (nou)
- all.push(literal);
- else
- all[literal] = true;
- }
- } else {
- // had matches
- var m = Object.keys(matches);
- if (nou)
- all.push.apply(all, m);
- else
- m.forEach(function (m) {
- all[m] = true;
- });
- }
- }
- if (!nou)
- all = Object.keys(all);
- if (!self.nosort)
- all = all.sort(self.nocase ? alphasorti : alphasort);
- // at *some* point we statted all of these
- if (self.mark) {
- for (var i = 0; i < all.length; i++) {
- all[i] = self._mark(all[i]);
- }
- if (self.nodir) {
- all = all.filter(function (e) {
- var notDir = !(/\/$/.test(e));
- var c = self.cache[e] || self.cache[makeAbs(self, e)];
- if (notDir && c)
- notDir = c !== 'DIR' && !Array.isArray(c);
- return notDir
- });
- }
- }
- if (self.ignore.length)
- all = all.filter(function(m) {
- return !isIgnored$2(self, m)
- });
- self.found = all;
- }
- function mark (self, p) {
- var abs = makeAbs(self, p);
- var c = self.cache[abs];
- var m = p;
- if (c) {
- var isDir = c === 'DIR' || Array.isArray(c);
- var slash = p.slice(-1) === '/';
- if (isDir && !slash)
- m += '/';
- else if (!isDir && slash)
- m = m.slice(0, -1);
- if (m !== p) {
- var mabs = makeAbs(self, m);
- self.statCache[mabs] = self.statCache[abs];
- self.cache[mabs] = self.cache[abs];
- }
- }
- return m
- }
- // lotta situps...
- function makeAbs (self, f) {
- var abs = f;
- if (f.charAt(0) === '/') {
- abs = path$5.join(self.root, f);
- } else if (pathIsAbsolute(f) || f === '') {
- abs = f;
- } else if (self.changedCwd) {
- abs = path$5.resolve(self.cwd, f);
- } else {
- abs = path$5.resolve(f);
- }
- if (process.platform === 'win32')
- abs = abs.replace(/\\/g, '/');
- return abs
- }
- // Return true, if pattern ends with globstar '**', for the accompanying parent directory.
- // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
- function isIgnored$2 (self, path) {
- if (!self.ignore.length)
- return false
- return self.ignore.some(function(item) {
- return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
- })
- }
- function childrenIgnored$2 (self, path) {
- if (!self.ignore.length)
- return false
- return self.ignore.some(function(item) {
- return !!(item.gmatcher && item.gmatcher.match(path))
- })
- }
- var common = {
- alphasort: alphasort_1,
- alphasorti: alphasorti_1,
- setopts: setopts_1,
- ownProp: ownProp_1,
- makeAbs: makeAbs_1,
- finish: finish_1,
- mark: mark_1,
- isIgnored: isIgnored_1,
- childrenIgnored: childrenIgnored_1
- };
- var sync = globSync;
- globSync.GlobSync = GlobSync$1;
- var setopts$1 = common.setopts;
- var ownProp$1 = common.ownProp;
- var childrenIgnored$1 = common.childrenIgnored;
- var isIgnored$1 = common.isIgnored;
- function globSync (pattern, options) {
- if (typeof options === 'function' || arguments.length === 3)
- throw new TypeError('callback provided to sync glob\n'+
- 'See: https://github.com/isaacs/node-glob/issues/167')
- return new GlobSync$1(pattern, options).found
- }
- function GlobSync$1 (pattern, options) {
- if (!pattern)
- throw new Error('must provide pattern')
- if (typeof options === 'function' || arguments.length === 3)
- throw new TypeError('callback provided to sync glob\n'+
- 'See: https://github.com/isaacs/node-glob/issues/167')
- if (!(this instanceof GlobSync$1))
- return new GlobSync$1(pattern, options)
- setopts$1(this, pattern, options);
- if (this.noprocess)
- return this
- var n = this.minimatch.set.length;
- this.matches = new Array(n);
- for (var i = 0; i < n; i ++) {
- this._process(this.minimatch.set[i], i, false);
- }
- this._finish();
- }
- GlobSync$1.prototype._finish = function () {
- assert_1(this instanceof GlobSync$1);
- if (this.realpath) {
- var self = this;
- this.matches.forEach(function (matchset, index) {
- var set = self.matches[index] = Object.create(null);
- for (var p in matchset) {
- try {
- p = self._makeAbs(p);
- var real = fs_realpath.realpathSync(p, self.realpathCache);
- set[real] = true;
- } catch (er) {
- if (er.syscall === 'stat')
- set[self._makeAbs(p)] = true;
- else
- throw er
- }
- }
- });
- }
- common.finish(this);
- };
- GlobSync$1.prototype._process = function (pattern, index, inGlobStar) {
- assert_1(this instanceof GlobSync$1);
- // Get the first [n] parts of pattern that are all strings.
- var n = 0;
- while (typeof pattern[n] === 'string') {
- n ++;
- }
- // now n is the index of the first one that is *not* a string.
- // See if there's anything else
- var prefix;
- switch (n) {
- // if not, then this is rather simple
- case pattern.length:
- this._processSimple(pattern.join('/'), index);
- return
- case 0:
- // pattern *starts* with some non-trivial item.
- // going to readdir(cwd), but not include the prefix in matches.
- prefix = null;
- break
- default:
- // pattern has some string bits in the front.
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
- // or 'relative' like '../baz'
- prefix = pattern.slice(0, n).join('/');
- break
- }
- var remain = pattern.slice(n);
- // get the list of entries.
- var read;
- if (prefix === null)
- read = '.';
- else if (pathIsAbsolute(prefix) || pathIsAbsolute(pattern.join('/'))) {
- if (!prefix || !pathIsAbsolute(prefix))
- prefix = '/' + prefix;
- read = prefix;
- } else
- read = prefix;
- var abs = this._makeAbs(read);
- //if ignored, skip processing
- if (childrenIgnored$1(this, read))
- return
- var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar);
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar);
- };
- GlobSync$1.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
- var entries = this._readdir(abs, inGlobStar);
- // if the abs isn't a dir, then nothing can match!
- if (!entries)
- return
- // It will only match dot entries if it starts with a dot, or if
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
- var pn = remain[0];
- var negate = !!this.minimatch.negate;
- var rawGlob = pn._glob;
- var dotOk = this.dot || rawGlob.charAt(0) === '.';
- var matchedEntries = [];
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (e.charAt(0) !== '.' || dotOk) {
- var m;
- if (negate && !prefix) {
- m = !e.match(pn);
- } else {
- m = e.match(pn);
- }
- if (m)
- matchedEntries.push(e);
- }
- }
- var len = matchedEntries.length;
- // If there are no matched entries, then nothing matches.
- if (len === 0)
- return
- // if this is the last remaining pattern bit, then no need for
- // an additional stat *unless* the user has specified mark or
- // stat explicitly. We know they exist, since readdir returned
- // them.
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = Object.create(null);
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i];
- if (prefix) {
- if (prefix.slice(-1) !== '/')
- e = prefix + '/' + e;
- else
- e = prefix + e;
- }
- if (e.charAt(0) === '/' && !this.nomount) {
- e = path$5.join(this.root, e);
- }
- this._emitMatch(index, e);
- }
- // This was the last one, and no stats were needed
- return
- }
- // now test all matched entries as stand-ins for that part
- // of the pattern.
- remain.shift();
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i];
- var newPattern;
- if (prefix)
- newPattern = [prefix, e];
- else
- newPattern = [e];
- this._process(newPattern.concat(remain), index, inGlobStar);
- }
- };
- GlobSync$1.prototype._emitMatch = function (index, e) {
- if (isIgnored$1(this, e))
- return
- var abs = this._makeAbs(e);
- if (this.mark)
- e = this._mark(e);
- if (this.absolute) {
- e = abs;
- }
- if (this.matches[index][e])
- return
- if (this.nodir) {
- var c = this.cache[abs];
- if (c === 'DIR' || Array.isArray(c))
- return
- }
- this.matches[index][e] = true;
- if (this.stat)
- this._stat(e);
- };
- GlobSync$1.prototype._readdirInGlobStar = function (abs) {
- // follow all symlinked directories forever
- // just proceed as if this is a non-globstar situation
- if (this.follow)
- return this._readdir(abs, false)
- var entries;
- var lstat;
- try {
- lstat = fs$3.lstatSync(abs);
- } catch (er) {
- if (er.code === 'ENOENT') {
- // lstat failed, doesn't exist
- return null
- }
- }
- var isSym = lstat && lstat.isSymbolicLink();
- this.symlinks[abs] = isSym;
- // If it's not a symlink or a dir, then it's definitely a regular file.
- // don't bother doing a readdir in that case.
- if (!isSym && lstat && !lstat.isDirectory())
- this.cache[abs] = 'FILE';
- else
- entries = this._readdir(abs, false);
- return entries
- };
- GlobSync$1.prototype._readdir = function (abs, inGlobStar) {
- if (inGlobStar && !ownProp$1(this.symlinks, abs))
- return this._readdirInGlobStar(abs)
- if (ownProp$1(this.cache, abs)) {
- var c = this.cache[abs];
- if (!c || c === 'FILE')
- return null
- if (Array.isArray(c))
- return c
- }
- try {
- return this._readdirEntries(abs, fs$3.readdirSync(abs))
- } catch (er) {
- this._readdirError(abs, er);
- return null
- }
- };
- GlobSync$1.prototype._readdirEntries = function (abs, entries) {
- // if we haven't asked to stat everything, then just
- // assume that everything in there exists, so we can avoid
- // having to stat it a second time.
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i ++) {
- var e = entries[i];
- if (abs === '/')
- e = abs + e;
- else
- e = abs + '/' + e;
- this.cache[e] = true;
- }
- }
- this.cache[abs] = entries;
- // mark and cache dir-ness
- return entries
- };
- GlobSync$1.prototype._readdirError = function (f, er) {
- // handle errors, and cache the information
- switch (er.code) {
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
- case 'ENOTDIR': // totally normal. means it *does* exist.
- var abs = this._makeAbs(f);
- this.cache[abs] = 'FILE';
- if (abs === this.cwdAbs) {
- var error = new Error(er.code + ' invalid cwd ' + this.cwd);
- error.path = this.cwd;
- error.code = er.code;
- throw error
- }
- break
- case 'ENOENT': // not terribly unusual
- case 'ELOOP':
- case 'ENAMETOOLONG':
- case 'UNKNOWN':
- this.cache[this._makeAbs(f)] = false;
- break
- default: // some unusual error. Treat as failure.
- this.cache[this._makeAbs(f)] = false;
- if (this.strict)
- throw er
- if (!this.silent)
- console.error('glob error', er);
- break
- }
- };
- GlobSync$1.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
- var entries = this._readdir(abs, inGlobStar);
- // no entries means not a dir, so it can never have matches
- // foo.txt/** doesn't match foo.txt
- if (!entries)
- return
- // test without the globstar, and with every child both below
- // and replacing the globstar.
- var remainWithoutGlobStar = remain.slice(1);
- var gspref = prefix ? [ prefix ] : [];
- var noGlobStar = gspref.concat(remainWithoutGlobStar);
- // the noGlobStar pattern exits the inGlobStar state
- this._process(noGlobStar, index, false);
- var len = entries.length;
- var isSym = this.symlinks[abs];
- // If it's a symlink, and we're in a globstar, then stop
- if (isSym && inGlobStar)
- return
- for (var i = 0; i < len; i++) {
- var e = entries[i];
- if (e.charAt(0) === '.' && !this.dot)
- continue
- // these two cases enter the inGlobStar state
- var instead = gspref.concat(entries[i], remainWithoutGlobStar);
- this._process(instead, index, true);
- var below = gspref.concat(entries[i], remain);
- this._process(below, index, true);
- }
- };
- GlobSync$1.prototype._processSimple = function (prefix, index) {
- // XXX review this. Shouldn't it be doing the mounting etc
- // before doing stat? kinda weird?
- var exists = this._stat(prefix);
- if (!this.matches[index])
- this.matches[index] = Object.create(null);
- // If it doesn't exist, then just mark the lack of results
- if (!exists)
- return
- if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix);
- if (prefix.charAt(0) === '/') {
- prefix = path$5.join(this.root, prefix);
- } else {
- prefix = path$5.resolve(this.root, prefix);
- if (trail)
- prefix += '/';
- }
- }
- if (process.platform === 'win32')
- prefix = prefix.replace(/\\/g, '/');
- // Mark this as a match
- this._emitMatch(index, prefix);
- };
- // Returns either 'DIR', 'FILE', or false
- GlobSync$1.prototype._stat = function (f) {
- var abs = this._makeAbs(f);
- var needDir = f.slice(-1) === '/';
- if (f.length > this.maxLength)
- return false
- if (!this.stat && ownProp$1(this.cache, abs)) {
- var c = this.cache[abs];
- if (Array.isArray(c))
- c = 'DIR';
- // It exists, but maybe not how we need it
- if (!needDir || c === 'DIR')
- return c
- if (needDir && c === 'FILE')
- return false
- // otherwise we have to stat, because maybe c=true
- // if we know it exists, but not what it is.
- }
- var stat = this.statCache[abs];
- if (!stat) {
- var lstat;
- try {
- lstat = fs$3.lstatSync(abs);
- } catch (er) {
- if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
- this.statCache[abs] = false;
- return false
- }
- }
- if (lstat && lstat.isSymbolicLink()) {
- try {
- stat = fs$3.statSync(abs);
- } catch (er) {
- stat = lstat;
- }
- } else {
- stat = lstat;
- }
- }
- this.statCache[abs] = stat;
- var c = true;
- if (stat)
- c = stat.isDirectory() ? 'DIR' : 'FILE';
- this.cache[abs] = this.cache[abs] || c;
- if (needDir && c === 'FILE')
- return false
- return c
- };
- GlobSync$1.prototype._mark = function (p) {
- return common.mark(this, p)
- };
- GlobSync$1.prototype._makeAbs = function (f) {
- return common.makeAbs(this, f)
- };
- // Returns a wrapper function that returns a wrapped callback
- // The wrapper function should do some stuff, and return a
- // presumably different callback function.
- // This makes sure that own properties are retained, so that
- // decorations and such are not lost along the way.
- var wrappy_1 = wrappy;
- function wrappy (fn, cb) {
- if (fn && cb) return wrappy(fn)(cb)
- if (typeof fn !== 'function')
- throw new TypeError('need wrapper function')
- Object.keys(fn).forEach(function (k) {
- wrapper[k] = fn[k];
- });
- return wrapper
- function wrapper() {
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
- var ret = fn.apply(this, args);
- var cb = args[args.length-1];
- if (typeof ret === 'function' && ret !== cb) {
- Object.keys(cb).forEach(function (k) {
- ret[k] = cb[k];
- });
- }
- return ret
- }
- }
- var once_1 = wrappy_1(once);
- var strict = wrappy_1(onceStrict);
- once.proto = once(function () {
- Object.defineProperty(Function.prototype, 'once', {
- value: function () {
- return once(this)
- },
- configurable: true
- });
- Object.defineProperty(Function.prototype, 'onceStrict', {
- value: function () {
- return onceStrict(this)
- },
- configurable: true
- });
- });
- function once (fn) {
- var f = function () {
- if (f.called) return f.value
- f.called = true;
- return f.value = fn.apply(this, arguments)
- };
- f.called = false;
- return f
- }
- function onceStrict (fn) {
- var f = function () {
- if (f.called)
- throw new Error(f.onceError)
- f.called = true;
- return f.value = fn.apply(this, arguments)
- };
- var name = fn.name || 'Function wrapped with `once`';
- f.onceError = name + " shouldn't be called more than once";
- f.called = false;
- return f
- }
- once_1.strict = strict;
- var reqs = Object.create(null);
- var inflight_1 = wrappy_1(inflight);
- function inflight (key, cb) {
- if (reqs[key]) {
- reqs[key].push(cb);
- return null
- } else {
- reqs[key] = [cb];
- return makeres(key)
- }
- }
- function makeres (key) {
- return once_1(function RES () {
- var cbs = reqs[key];
- var len = cbs.length;
- var args = slice(arguments);
- // XXX It's somewhat ambiguous whether a new callback added in this
- // pass should be queued for later execution if something in the
- // list of callbacks throws, or if it should just be discarded.
- // However, it's such an edge case that it hardly matters, and either
- // choice is likely as surprising as the other.
- // As it happens, we do go ahead and schedule it for later execution.
- try {
- for (var i = 0; i < len; i++) {
- cbs[i].apply(null, args);
- }
- } finally {
- if (cbs.length > len) {
- // added more in the interim.
- // de-zalgo, just in case, but don't call again.
- cbs.splice(0, len);
- process.nextTick(function () {
- RES.apply(null, args);
- });
- } else {
- delete reqs[key];
- }
- }
- })
- }
- function slice (args) {
- var length = args.length;
- var array = [];
- for (var i = 0; i < length; i++) array[i] = args[i];
- return array
- }
- // Approach:
- //
- // 1. Get the minimatch set
- // 2. For each pattern in the set, PROCESS(pattern, false)
- // 3. Store matches per-set, then uniq them
- //
- // PROCESS(pattern, inGlobStar)
- // Get the first [n] items from pattern that are all strings
- // Join these together. This is PREFIX.
- // If there is no more remaining, then stat(PREFIX) and
- // add to matches if it succeeds. END.
- //
- // If inGlobStar and PREFIX is symlink and points to dir
- // set ENTRIES = []
- // else readdir(PREFIX) as ENTRIES
- // If fail, END
- //
- // with ENTRIES
- // If pattern[n] is GLOBSTAR
- // // handle the case where the globstar match is empty
- // // by pruning it out, and testing the resulting pattern
- // PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
- // // handle other cases.
- // for ENTRY in ENTRIES (not dotfiles)
- // // attach globstar + tail onto the entry
- // // Mark that this entry is a globstar match
- // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
- //
- // else // not globstar
- // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
- // Test ENTRY against pattern[n]
- // If fails, continue
- // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
- //
- // Caveat:
- // Cache all stats and readdirs results to minimize syscall. Since all
- // we ever care about is existence and directory-ness, we can just keep
- // `true` for files, and [children,...] for directories, or `false` for
- // things that don't exist.
- var glob_1 = glob;
- var EE = events.EventEmitter;
- var setopts = common.setopts;
- var ownProp = common.ownProp;
- var childrenIgnored = common.childrenIgnored;
- var isIgnored = common.isIgnored;
- function glob (pattern, options, cb) {
- if (typeof options === 'function') cb = options, options = {};
- if (!options) options = {};
- if (options.sync) {
- if (cb)
- throw new TypeError('callback provided to sync glob')
- return sync(pattern, options)
- }
- return new Glob(pattern, options, cb)
- }
- glob.sync = sync;
- var GlobSync = glob.GlobSync = sync.GlobSync;
- // old api surface
- glob.glob = glob;
- function extend (origin, add) {
- if (add === null || typeof add !== 'object') {
- return origin
- }
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin
- }
- glob.hasMagic = function (pattern, options_) {
- var options = extend({}, options_);
- options.noprocess = true;
- var g = new Glob(pattern, options);
- var set = g.minimatch.set;
- if (!pattern)
- return false
- if (set.length > 1)
- return true
- for (var j = 0; j < set[0].length; j++) {
- if (typeof set[0][j] !== 'string')
- return true
- }
- return false
- };
- glob.Glob = Glob;
- inherits$1(Glob, EE);
- function Glob (pattern, options, cb) {
- if (typeof options === 'function') {
- cb = options;
- options = null;
- }
- if (options && options.sync) {
- if (cb)
- throw new TypeError('callback provided to sync glob')
- return new GlobSync(pattern, options)
- }
- if (!(this instanceof Glob))
- return new Glob(pattern, options, cb)
- setopts(this, pattern, options);
- this._didRealPath = false;
- // process each pattern in the minimatch set
- var n = this.minimatch.set.length;
- // The matches are stored as {<filename>: true,...} so that
- // duplicates are automagically pruned.
- // Later, we do an Object.keys() on these.
- // Keep them as a list so we can fill in when nonull is set.
- this.matches = new Array(n);
- if (typeof cb === 'function') {
- cb = once_1(cb);
- this.on('error', cb);
- this.on('end', function (matches) {
- cb(null, matches);
- });
- }
- var self = this;
- this._processing = 0;
- this._emitQueue = [];
- this._processQueue = [];
- this.paused = false;
- if (this.noprocess)
- return this
- if (n === 0)
- return done()
- var sync = true;
- for (var i = 0; i < n; i ++) {
- this._process(this.minimatch.set[i], i, false, done);
- }
- sync = false;
- function done () {
- --self._processing;
- if (self._processing <= 0) {
- if (sync) {
- process.nextTick(function () {
- self._finish();
- });
- } else {
- self._finish();
- }
- }
- }
- }
- Glob.prototype._finish = function () {
- assert_1(this instanceof Glob);
- if (this.aborted)
- return
- if (this.realpath && !this._didRealpath)
- return this._realpath()
- common.finish(this);
- this.emit('end', this.found);
- };
- Glob.prototype._realpath = function () {
- if (this._didRealpath)
- return
- this._didRealpath = true;
- var n = this.matches.length;
- if (n === 0)
- return this._finish()
- var self = this;
- for (var i = 0; i < this.matches.length; i++)
- this._realpathSet(i, next);
- function next () {
- if (--n === 0)
- self._finish();
- }
- };
- Glob.prototype._realpathSet = function (index, cb) {
- var matchset = this.matches[index];
- if (!matchset)
- return cb()
- var found = Object.keys(matchset);
- var self = this;
- var n = found.length;
- if (n === 0)
- return cb()
- var set = this.matches[index] = Object.create(null);
- found.forEach(function (p, i) {
- // If there's a problem with the stat, then it means that
- // one or more of the links in the realpath couldn't be
- // resolved. just return the abs value in that case.
- p = self._makeAbs(p);
- fs_realpath.realpath(p, self.realpathCache, function (er, real) {
- if (!er)
- set[real] = true;
- else if (er.syscall === 'stat')
- set[p] = true;
- else
- self.emit('error', er); // srsly wtf right here
- if (--n === 0) {
- self.matches[index] = set;
- cb();
- }
- });
- });
- };
- Glob.prototype._mark = function (p) {
- return common.mark(this, p)
- };
- Glob.prototype._makeAbs = function (f) {
- return common.makeAbs(this, f)
- };
- Glob.prototype.abort = function () {
- this.aborted = true;
- this.emit('abort');
- };
- Glob.prototype.pause = function () {
- if (!this.paused) {
- this.paused = true;
- this.emit('pause');
- }
- };
- Glob.prototype.resume = function () {
- if (this.paused) {
- this.emit('resume');
- this.paused = false;
- if (this._emitQueue.length) {
- var eq = this._emitQueue.slice(0);
- this._emitQueue.length = 0;
- for (var i = 0; i < eq.length; i ++) {
- var e = eq[i];
- this._emitMatch(e[0], e[1]);
- }
- }
- if (this._processQueue.length) {
- var pq = this._processQueue.slice(0);
- this._processQueue.length = 0;
- for (var i = 0; i < pq.length; i ++) {
- var p = pq[i];
- this._processing--;
- this._process(p[0], p[1], p[2], p[3]);
- }
- }
- }
- };
- Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
- assert_1(this instanceof Glob);
- assert_1(typeof cb === 'function');
- if (this.aborted)
- return
- this._processing++;
- if (this.paused) {
- this._processQueue.push([pattern, index, inGlobStar, cb]);
- return
- }
- //console.error('PROCESS %d', this._processing, pattern)
- // Get the first [n] parts of pattern that are all strings.
- var n = 0;
- while (typeof pattern[n] === 'string') {
- n ++;
- }
- // now n is the index of the first one that is *not* a string.
- // see if there's anything else
- var prefix;
- switch (n) {
- // if not, then this is rather simple
- case pattern.length:
- this._processSimple(pattern.join('/'), index, cb);
- return
- case 0:
- // pattern *starts* with some non-trivial item.
- // going to readdir(cwd), but not include the prefix in matches.
- prefix = null;
- break
- default:
- // pattern has some string bits in the front.
- // whatever it starts with, whether that's 'absolute' like /foo/bar,
- // or 'relative' like '../baz'
- prefix = pattern.slice(0, n).join('/');
- break
- }
- var remain = pattern.slice(n);
- // get the list of entries.
- var read;
- if (prefix === null)
- read = '.';
- else if (pathIsAbsolute(prefix) || pathIsAbsolute(pattern.join('/'))) {
- if (!prefix || !pathIsAbsolute(prefix))
- prefix = '/' + prefix;
- read = prefix;
- } else
- read = prefix;
- var abs = this._makeAbs(read);
- //if ignored, skip _processing
- if (childrenIgnored(this, read))
- return cb()
- var isGlobStar = remain[0] === minimatch_1.GLOBSTAR;
- if (isGlobStar)
- this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb);
- else
- this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb);
- };
- Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
- var self = this;
- this._readdir(abs, inGlobStar, function (er, entries) {
- return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
- });
- };
- Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
- // if the abs isn't a dir, then nothing can match!
- if (!entries)
- return cb()
- // It will only match dot entries if it starts with a dot, or if
- // dot is set. Stuff like @(.foo|.bar) isn't allowed.
- var pn = remain[0];
- var negate = !!this.minimatch.negate;
- var rawGlob = pn._glob;
- var dotOk = this.dot || rawGlob.charAt(0) === '.';
- var matchedEntries = [];
- for (var i = 0; i < entries.length; i++) {
- var e = entries[i];
- if (e.charAt(0) !== '.' || dotOk) {
- var m;
- if (negate && !prefix) {
- m = !e.match(pn);
- } else {
- m = e.match(pn);
- }
- if (m)
- matchedEntries.push(e);
- }
- }
- //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
- var len = matchedEntries.length;
- // If there are no matched entries, then nothing matches.
- if (len === 0)
- return cb()
- // if this is the last remaining pattern bit, then no need for
- // an additional stat *unless* the user has specified mark or
- // stat explicitly. We know they exist, since readdir returned
- // them.
- if (remain.length === 1 && !this.mark && !this.stat) {
- if (!this.matches[index])
- this.matches[index] = Object.create(null);
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i];
- if (prefix) {
- if (prefix !== '/')
- e = prefix + '/' + e;
- else
- e = prefix + e;
- }
- if (e.charAt(0) === '/' && !this.nomount) {
- e = path$5.join(this.root, e);
- }
- this._emitMatch(index, e);
- }
- // This was the last one, and no stats were needed
- return cb()
- }
- // now test all matched entries as stand-ins for that part
- // of the pattern.
- remain.shift();
- for (var i = 0; i < len; i ++) {
- var e = matchedEntries[i];
- if (prefix) {
- if (prefix !== '/')
- e = prefix + '/' + e;
- else
- e = prefix + e;
- }
- this._process([e].concat(remain), index, inGlobStar, cb);
- }
- cb();
- };
- Glob.prototype._emitMatch = function (index, e) {
- if (this.aborted)
- return
- if (isIgnored(this, e))
- return
- if (this.paused) {
- this._emitQueue.push([index, e]);
- return
- }
- var abs = pathIsAbsolute(e) ? e : this._makeAbs(e);
- if (this.mark)
- e = this._mark(e);
- if (this.absolute)
- e = abs;
- if (this.matches[index][e])
- return
- if (this.nodir) {
- var c = this.cache[abs];
- if (c === 'DIR' || Array.isArray(c))
- return
- }
- this.matches[index][e] = true;
- var st = this.statCache[abs];
- if (st)
- this.emit('stat', e, st);
- this.emit('match', e);
- };
- Glob.prototype._readdirInGlobStar = function (abs, cb) {
- if (this.aborted)
- return
- // follow all symlinked directories forever
- // just proceed as if this is a non-globstar situation
- if (this.follow)
- return this._readdir(abs, false, cb)
- var lstatkey = 'lstat\0' + abs;
- var self = this;
- var lstatcb = inflight_1(lstatkey, lstatcb_);
- if (lstatcb)
- fs$3.lstat(abs, lstatcb);
- function lstatcb_ (er, lstat) {
- if (er && er.code === 'ENOENT')
- return cb()
- var isSym = lstat && lstat.isSymbolicLink();
- self.symlinks[abs] = isSym;
- // If it's not a symlink or a dir, then it's definitely a regular file.
- // don't bother doing a readdir in that case.
- if (!isSym && lstat && !lstat.isDirectory()) {
- self.cache[abs] = 'FILE';
- cb();
- } else
- self._readdir(abs, false, cb);
- }
- };
- Glob.prototype._readdir = function (abs, inGlobStar, cb) {
- if (this.aborted)
- return
- cb = inflight_1('readdir\0'+abs+'\0'+inGlobStar, cb);
- if (!cb)
- return
- //console.error('RD %j %j', +inGlobStar, abs)
- if (inGlobStar && !ownProp(this.symlinks, abs))
- return this._readdirInGlobStar(abs, cb)
- if (ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (!c || c === 'FILE')
- return cb()
- if (Array.isArray(c))
- return cb(null, c)
- }
- fs$3.readdir(abs, readdirCb(this, abs, cb));
- };
- function readdirCb (self, abs, cb) {
- return function (er, entries) {
- if (er)
- self._readdirError(abs, er, cb);
- else
- self._readdirEntries(abs, entries, cb);
- }
- }
- Glob.prototype._readdirEntries = function (abs, entries, cb) {
- if (this.aborted)
- return
- // if we haven't asked to stat everything, then just
- // assume that everything in there exists, so we can avoid
- // having to stat it a second time.
- if (!this.mark && !this.stat) {
- for (var i = 0; i < entries.length; i ++) {
- var e = entries[i];
- if (abs === '/')
- e = abs + e;
- else
- e = abs + '/' + e;
- this.cache[e] = true;
- }
- }
- this.cache[abs] = entries;
- return cb(null, entries)
- };
- Glob.prototype._readdirError = function (f, er, cb) {
- if (this.aborted)
- return
- // handle errors, and cache the information
- switch (er.code) {
- case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
- case 'ENOTDIR': // totally normal. means it *does* exist.
- var abs = this._makeAbs(f);
- this.cache[abs] = 'FILE';
- if (abs === this.cwdAbs) {
- var error = new Error(er.code + ' invalid cwd ' + this.cwd);
- error.path = this.cwd;
- error.code = er.code;
- this.emit('error', error);
- this.abort();
- }
- break
- case 'ENOENT': // not terribly unusual
- case 'ELOOP':
- case 'ENAMETOOLONG':
- case 'UNKNOWN':
- this.cache[this._makeAbs(f)] = false;
- break
- default: // some unusual error. Treat as failure.
- this.cache[this._makeAbs(f)] = false;
- if (this.strict) {
- this.emit('error', er);
- // If the error is handled, then we abort
- // if not, we threw out of here
- this.abort();
- }
- if (!this.silent)
- console.error('glob error', er);
- break
- }
- return cb()
- };
- Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
- var self = this;
- this._readdir(abs, inGlobStar, function (er, entries) {
- self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb);
- });
- };
- Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
- //console.error('pgs2', prefix, remain[0], entries)
- // no entries means not a dir, so it can never have matches
- // foo.txt/** doesn't match foo.txt
- if (!entries)
- return cb()
- // test without the globstar, and with every child both below
- // and replacing the globstar.
- var remainWithoutGlobStar = remain.slice(1);
- var gspref = prefix ? [ prefix ] : [];
- var noGlobStar = gspref.concat(remainWithoutGlobStar);
- // the noGlobStar pattern exits the inGlobStar state
- this._process(noGlobStar, index, false, cb);
- var isSym = this.symlinks[abs];
- var len = entries.length;
- // If it's a symlink, and we're in a globstar, then stop
- if (isSym && inGlobStar)
- return cb()
- for (var i = 0; i < len; i++) {
- var e = entries[i];
- if (e.charAt(0) === '.' && !this.dot)
- continue
- // these two cases enter the inGlobStar state
- var instead = gspref.concat(entries[i], remainWithoutGlobStar);
- this._process(instead, index, true, cb);
- var below = gspref.concat(entries[i], remain);
- this._process(below, index, true, cb);
- }
- cb();
- };
- Glob.prototype._processSimple = function (prefix, index, cb) {
- // XXX review this. Shouldn't it be doing the mounting etc
- // before doing stat? kinda weird?
- var self = this;
- this._stat(prefix, function (er, exists) {
- self._processSimple2(prefix, index, er, exists, cb);
- });
- };
- Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
- //console.error('ps2', prefix, exists)
- if (!this.matches[index])
- this.matches[index] = Object.create(null);
- // If it doesn't exist, then just mark the lack of results
- if (!exists)
- return cb()
- if (prefix && pathIsAbsolute(prefix) && !this.nomount) {
- var trail = /[\/\\]$/.test(prefix);
- if (prefix.charAt(0) === '/') {
- prefix = path$5.join(this.root, prefix);
- } else {
- prefix = path$5.resolve(this.root, prefix);
- if (trail)
- prefix += '/';
- }
- }
- if (process.platform === 'win32')
- prefix = prefix.replace(/\\/g, '/');
- // Mark this as a match
- this._emitMatch(index, prefix);
- cb();
- };
- // Returns either 'DIR', 'FILE', or false
- Glob.prototype._stat = function (f, cb) {
- var abs = this._makeAbs(f);
- var needDir = f.slice(-1) === '/';
- if (f.length > this.maxLength)
- return cb()
- if (!this.stat && ownProp(this.cache, abs)) {
- var c = this.cache[abs];
- if (Array.isArray(c))
- c = 'DIR';
- // It exists, but maybe not how we need it
- if (!needDir || c === 'DIR')
- return cb(null, c)
- if (needDir && c === 'FILE')
- return cb()
- // otherwise we have to stat, because maybe c=true
- // if we know it exists, but not what it is.
- }
- var stat = this.statCache[abs];
- if (stat !== undefined) {
- if (stat === false)
- return cb(null, stat)
- else {
- var type = stat.isDirectory() ? 'DIR' : 'FILE';
- if (needDir && type === 'FILE')
- return cb()
- else
- return cb(null, type, stat)
- }
- }
- var self = this;
- var statcb = inflight_1('stat\0' + abs, lstatcb_);
- if (statcb)
- fs$3.lstat(abs, statcb);
- function lstatcb_ (er, lstat) {
- if (lstat && lstat.isSymbolicLink()) {
- // If it's a symlink, then treat it as the target, unless
- // the target does not exist, then treat it as a file.
- return fs$3.stat(abs, function (er, stat) {
- if (er)
- self._stat2(f, abs, null, lstat, cb);
- else
- self._stat2(f, abs, er, stat, cb);
- })
- } else {
- self._stat2(f, abs, er, lstat, cb);
- }
- }
- };
- Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
- if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
- this.statCache[abs] = false;
- return cb()
- }
- var needDir = f.slice(-1) === '/';
- this.statCache[abs] = stat;
- if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
- return cb(null, false, stat)
- var c = true;
- if (stat)
- c = stat.isDirectory() ? 'DIR' : 'FILE';
- this.cache[abs] = this.cache[abs] || c;
- if (needDir && c === 'FILE')
- return cb()
- return cb(null, c, stat)
- };
- var peerDependencies = {
- rollup: "^2.22.0"
- };
- const PROXY_SUFFIX = '?commonjs-proxy';
- const getProxyId = (id) => `\0${id}${PROXY_SUFFIX}`;
- const getIdFromProxyId = (proxyId) => proxyId.slice(1, -PROXY_SUFFIX.length);
- const EXTERNAL_SUFFIX = '?commonjs-external';
- const getExternalProxyId = (id) => `\0${id}${EXTERNAL_SUFFIX}`;
- const getIdFromExternalProxyId = (proxyId) => proxyId.slice(1, -EXTERNAL_SUFFIX.length);
- const VIRTUAL_PATH_BASE = '/$$rollup_base$$';
- const getVirtualPathForDynamicRequirePath = (path, commonDir) => {
- if (path.startsWith(commonDir)) return VIRTUAL_PATH_BASE + path.slice(commonDir.length);
- return path;
- };
- const DYNAMIC_REGISTER_PREFIX = '\0commonjs-dynamic-register:';
- const DYNAMIC_JSON_PREFIX = '\0commonjs-dynamic-json:';
- const DYNAMIC_PACKAGES_ID = '\0commonjs-dynamic-packages';
- const HELPERS_ID = '\0commonjsHelpers.js';
- // `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
- // Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
- // This will no longer be necessary once Rollup switches to ES6 output, likely
- // in Rollup 3
- // The "hasOwnProperty" call in "getDefaultExportFromCjs" is technically not
- // needed, but for consumers that use Rollup's old interop pattern, it will fix
- // rollup/rollup-plugin-commonjs#224
- // We should remove it once Rollup core and this plugin are updated to not use
- // this pattern any more
- const HELPERS = `
- export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- export function getDefaultExportFromCjs (x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
- }
- export function createCommonjsModule(fn, basedir, module) {
- return module = {
- path: basedir,
- exports: {},
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
- }
- }, fn(module, module.exports), module.exports;
- }
- export function getDefaultExportFromNamespaceIfPresent (n) {
- return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
- }
- export function getDefaultExportFromNamespaceIfNotNamed (n) {
- return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
- }
- export function getAugmentedNamespace(n) {
- if (n.__esModule) return n;
- var a = Object.defineProperty({}, '__esModule', {value: true});
- Object.keys(n).forEach(function (k) {
- var d = Object.getOwnPropertyDescriptor(n, k);
- Object.defineProperty(a, k, d.get ? d : {
- enumerable: true,
- get: function () {
- return n[k];
- }
- });
- });
- return a;
- }
- `;
- const HELPER_NON_DYNAMIC = `
- export function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
- }
- `;
- const HELPERS_DYNAMIC = `
- export function commonjsRegister (path, loader) {
- DYNAMIC_REQUIRE_LOADERS[path] = loader;
- }
- const DYNAMIC_REQUIRE_LOADERS = Object.create(null);
- const DYNAMIC_REQUIRE_CACHE = Object.create(null);
- const DEFAULT_PARENT_MODULE = {
- id: '<' + 'rollup>', exports: {}, parent: undefined, filename: null, loaded: false, children: [], paths: []
- };
- const CHECKED_EXTENSIONS = ['', '.js', '.json'];
- function normalize (path) {
- path = path.replace(/\\\\/g, '/');
- const parts = path.split('/');
- const slashed = parts[0] === '';
- for (let i = 1; i < parts.length; i++) {
- if (parts[i] === '.' || parts[i] === '') {
- parts.splice(i--, 1);
- }
- }
- for (let i = 1; i < parts.length; i++) {
- if (parts[i] !== '..') continue;
- if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {
- parts.splice(--i, 2);
- i--;
- }
- }
- path = parts.join('/');
- if (slashed && path[0] !== '/')
- path = '/' + path;
- else if (path.length === 0)
- path = '.';
- return path;
- }
- function join () {
- if (arguments.length === 0)
- return '.';
- let joined;
- for (let i = 0; i < arguments.length; ++i) {
- let arg = arguments[i];
- if (arg.length > 0) {
- if (joined === undefined)
- joined = arg;
- else
- joined += '/' + arg;
- }
- }
- if (joined === undefined)
- return '.';
- return joined;
- }
- function isPossibleNodeModulesPath (modulePath) {
- let c0 = modulePath[0];
- if (c0 === '/' || c0 === '\\\\') return false;
- let c1 = modulePath[1], c2 = modulePath[2];
- if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||
- (c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;
- if (c1 === ':' && (c2 === '/' || c2 === '\\\\'))
- return false;
- return true;
- }
- function dirname (path) {
- if (path.length === 0)
- return '.';
- let i = path.length - 1;
- while (i > 0) {
- const c = path.charCodeAt(i);
- if ((c === 47 || c === 92) && i !== path.length - 1)
- break;
- i--;
- }
- if (i > 0)
- return path.substr(0, i);
- if (path.chartCodeAt(0) === 47 || path.chartCodeAt(0) === 92)
- return path.charAt(0);
- return '.';
- }
- export function commonjsRequire (path, originalModuleDir) {
- const shouldTryNodeModules = isPossibleNodeModulesPath(path);
- path = normalize(path);
- let relPath;
- while (true) {
- if (!shouldTryNodeModules) {
- relPath = originalModuleDir ? normalize(originalModuleDir + '/' + path) : path;
- } else if (originalModuleDir) {
- relPath = normalize(originalModuleDir + '/node_modules/' + path);
- } else {
- relPath = normalize(join('node_modules', path));
- }
- for (let extensionIndex = 0; extensionIndex < CHECKED_EXTENSIONS.length; extensionIndex++) {
- const resolvedPath = relPath + CHECKED_EXTENSIONS[extensionIndex];
- let cachedModule = DYNAMIC_REQUIRE_CACHE[resolvedPath];
- if (cachedModule) return cachedModule.exports;
- const loader = DYNAMIC_REQUIRE_LOADERS[resolvedPath];
- if (loader) {
- DYNAMIC_REQUIRE_CACHE[resolvedPath] = cachedModule = {
- id: resolvedPath,
- filename: resolvedPath,
- path: dirname(resolvedPath),
- exports: {},
- parent: DEFAULT_PARENT_MODULE,
- loaded: false,
- children: [],
- paths: [],
- require: function (path, base) {
- return commonjsRequire(path, (base === undefined || base === null) ? cachedModule.path : base);
- }
- };
- try {
- loader.call(commonjsGlobal, cachedModule, cachedModule.exports);
- } catch (error) {
- delete DYNAMIC_REQUIRE_CACHE[resolvedPath];
- throw error;
- }
- cachedModule.loaded = true;
- return cachedModule.exports;
- };
- }
- if (!shouldTryNodeModules) break;
- const nextDir = normalize(originalModuleDir + '/..');
- if (nextDir === originalModuleDir) break;
- originalModuleDir = nextDir;
- }
- return require(path);
- }
- commonjsRequire.cache = DYNAMIC_REQUIRE_CACHE;
- `;
- function getHelpersModule(isDynamicRequireModulesEnabled) {
- return `${HELPERS}${isDynamicRequireModulesEnabled ? HELPERS_DYNAMIC : HELPER_NON_DYNAMIC}`;
- }
- /* eslint-disable no-undefined */
- const operators = {
- '==': (x) => equals(x.left, x.right, false),
- '!=': (x) => not(operators['=='](x)),
- '===': (x) => equals(x.left, x.right, true),
- '!==': (x) => not(operators['==='](x)),
- '!': (x) => isFalsy(x.argument),
- '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
- '||': (x) => isTruthy(x.left) || isTruthy(x.right)
- };
- function flatten(node) {
- const parts = [];
- while (node.type === 'MemberExpression') {
- if (node.computed) return null;
- parts.unshift(node.property.name);
- // eslint-disable-next-line no-param-reassign
- node = node.object;
- }
- if (node.type !== 'Identifier') return null;
- const { name } = node;
- parts.unshift(name);
- return { name, keypath: parts.join('.') };
- }
- function isTruthy(node) {
- if (node.type === 'Literal') return !!node.value;
- if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
- if (node.operator in operators) return operators[node.operator](node);
- return undefined;
- }
- function isFalsy(node) {
- return not(isTruthy(node));
- }
- function not(value) {
- return value === undefined ? value : !value;
- }
- function equals(a, b, strict) {
- if (a.type !== b.type) return undefined;
- // eslint-disable-next-line eqeqeq
- if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
- return undefined;
- }
- /* eslint-disable import/prefer-default-export */
- function getName(id) {
- const name = makeLegalIdentifier$2(basename(id, extname$1(id)));
- if (name !== 'index') {
- return name;
- }
- const segments = dirname(id).split(sep);
- return makeLegalIdentifier$2(segments[segments.length - 1]);
- }
- /* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
- const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split(
- ' '
- );
- const blacklist = { __esModule: true };
- reserved.forEach((word) => (blacklist[word] = true));
- const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
- const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
- const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
- const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
- function deconflict(scope, globals, identifier) {
- let i = 1;
- let deconflicted = makeLegalIdentifier$2(identifier);
- while (scope.contains(deconflicted) || globals.has(deconflicted) || deconflicted in blacklist) {
- deconflicted = `${identifier}_${i}`;
- i += 1;
- }
- scope.declarations[deconflicted] = true;
- return deconflicted;
- }
- function tryParse(parse, code, id) {
- try {
- return parse(code, { allowReturnOutsideFunction: true });
- } catch (err) {
- err.message += ` in ${id}`;
- throw err;
- }
- }
- function normalizePathSlashes(path) {
- return path.replace(/\\/g, '/');
- }
- function hasCjsKeywords(code, ignoreGlobal) {
- const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
- return firstpass.test(code);
- }
- function checkEsModule(parse, code, id) {
- const ast = tryParse(parse, code, id);
- let isEsModule = false;
- let hasDefaultExport = false;
- let hasNamedExports = false;
- for (const node of ast.body) {
- if (node.type === 'ExportDefaultDeclaration') {
- isEsModule = true;
- hasDefaultExport = true;
- } else if (node.type === 'ExportNamedDeclaration') {
- isEsModule = true;
- if (node.declaration) {
- hasNamedExports = true;
- } else {
- for (const specifier of node.specifiers) {
- if (specifier.exported.name === 'default') {
- hasDefaultExport = true;
- } else {
- hasNamedExports = true;
- }
- }
- }
- } else if (node.type === 'ExportAllDeclaration') {
- isEsModule = true;
- if (node.exported && node.exported.name === 'default') {
- hasDefaultExport = true;
- } else {
- hasNamedExports = true;
- }
- } else if (node.type === 'ImportDeclaration') {
- isEsModule = true;
- }
- }
- return { isEsModule, hasDefaultExport, hasNamedExports, ast };
- }
- function getDefinePropertyCallName(node, targetName) {
- if (node.type !== 'CallExpression') return;
- const {
- callee: { object, property }
- } = node;
- if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
- if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
- if (node.arguments.length !== 3) return;
- const [target, val] = node.arguments;
- if (target.type !== 'Identifier' || target.name !== targetName) return;
- // eslint-disable-next-line consistent-return
- return val.value;
- }
- function transformCommonjs(
- parse,
- code,
- id,
- isEsModule,
- ignoreGlobal,
- ignoreRequire,
- sourceMap,
- isDynamicRequireModulesEnabled,
- dynamicRequireModuleSet,
- commonDir,
- astCache
- ) {
- const ast = astCache || tryParse(parse, code, id);
- const magicString = new MagicString(code);
- const required = {};
- // Because objects have no guaranteed ordering, yet we need it,
- // we need to keep track of the order in a array
- const sources = [];
- let uid = 0;
- let scope = attachScopes$1(ast, 'scope');
- const uses = { module: false, exports: false, global: false, require: false };
- let lexicalDepth = 0;
- let programDepth = 0;
- const globals = new Set();
- // TODO technically wrong since globals isn't populated yet, but ¯\_(ツ)_/¯
- const HELPERS_NAME = deconflict(scope, globals, 'commonjsHelpers');
- // TODO handle transpiled modules
- let shouldWrap = /__esModule/.test(code);
- let usesCommonjsHelpers = false;
- function isRequireStatement(node) {
- if (!node) return false;
- if (node.type !== 'CallExpression') return false;
- // Weird case of `require()` or `module.require()` without arguments
- if (node.arguments.length === 0) return false;
- return isRequireIdentifier(node.callee);
- }
- function isRequireIdentifier(node) {
- if (!node) return false;
- if (node.type === 'Identifier' && node.name === 'require' /* `require` */) {
- // `require` is hidden by a variable in local scope
- if (scope.contains('require')) return false;
- return true;
- } else if (node.type === 'MemberExpression' /* `[something].[something]` */) {
- // `module.[something]`
- if (node.object.type !== 'Identifier' || node.object.name !== 'module') return false;
- // `module` is hidden by a variable in local scope
- if (scope.contains('module')) return false;
- // `module.require(...)`
- if (node.property.type !== 'Identifier' || node.property.name !== 'require') return false;
- return true;
- }
- return false;
- }
- function hasDynamicArguments(node) {
- return (
- node.arguments.length > 1 ||
- (node.arguments[0].type !== 'Literal' &&
- (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
- );
- }
- function isStaticRequireStatement(node) {
- if (!isRequireStatement(node)) return false;
- return !hasDynamicArguments(node);
- }
- function isNodeRequireStatement(parent) {
- const reservedMethod = ['resolve', 'cache', 'main'];
- return !!(parent && parent.property && reservedMethod.indexOf(parent.property.name) > -1);
- }
- function isIgnoredRequireStatement(requiredNode) {
- return ignoreRequire(requiredNode.arguments[0].value);
- }
- function getRequireStringArg(node) {
- return node.arguments[0].type === 'Literal'
- ? node.arguments[0].value
- : node.arguments[0].quasis[0].value.cooked;
- }
- function getRequired(node, name) {
- let sourceId = getRequireStringArg(node);
- const isDynamicRegister = sourceId.startsWith(DYNAMIC_REGISTER_PREFIX);
- if (isDynamicRegister) {
- sourceId = sourceId.substr(DYNAMIC_REGISTER_PREFIX.length);
- }
- const existing = required[sourceId];
- // eslint-disable-next-line no-undefined
- if (existing === undefined) {
- const isDynamic = hasDynamicModuleForPath(sourceId);
- if (!name) {
- do {
- name = `require$$${uid}`;
- uid += 1;
- } while (scope.contains(name));
- }
- if (isDynamicRegister && sourceId.endsWith('.json')) {
- sourceId = DYNAMIC_JSON_PREFIX + sourceId;
- }
- if (isDynamicRegister || !isDynamic || sourceId.endsWith('.json')) {
- sources.push([sourceId, !isDynamicRegister]);
- }
- required[sourceId] = { source: sourceId, name, importsDefault: false, isDynamic };
- }
- return required[sourceId];
- }
- function hasDynamicModuleForPath(source) {
- if (!/[/\\]/.test(source)) {
- try {
- const resolvedPath = normalizePathSlashes(
- resolve.sync(source, { basedir: dirname(id) })
- );
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
- }
- } catch (ex) {
- // Probably a node.js internal module
- return false;
- }
- return false;
- }
- for (const attemptExt of ['', '.js', '.json']) {
- const resolvedPath = normalizePathSlashes(resolve$1(dirname(id), source + attemptExt));
- if (dynamicRequireModuleSet.has(resolvedPath)) {
- return true;
- }
- }
- return false;
- }
- function shouldUseSimulatedRequire(required) {
- return (
- hasDynamicModuleForPath(required.source) &&
- // We only do `commonjsRequire` for json if it's the `commonjsRegister` call.
- (required.source.startsWith(DYNAMIC_REGISTER_PREFIX) || !required.source.endsWith('.json'))
- );
- }
- // do a first pass, see which names are assigned to. This is necessary to prevent
- // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
- // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
- const assignedTo = new Set();
- walk$1(ast, {
- enter(node) {
- if (node.type !== 'AssignmentExpression') return;
- if (node.left.type === 'MemberExpression') return;
- extractAssignedNames$1(node.left).forEach((name) => {
- assignedTo.add(name);
- });
- }
- });
- walk$1(ast, {
- enter(node, parent) {
- if (sourceMap) {
- magicString.addSourcemapLocation(node.start);
- magicString.addSourcemapLocation(node.end);
- }
- // skip dead branches
- if (parent && (parent.type === 'IfStatement' || parent.type === 'ConditionalExpression')) {
- if (node === parent.consequent && isFalsy(parent.test)) {
- this.skip();
- return;
- }
- if (node === parent.alternate && isTruthy(parent.test)) {
- this.skip();
- return;
- }
- }
- if (node._skip) {
- this.skip();
- return;
- }
- programDepth += 1;
- if (node.scope) ({ scope } = node);
- if (functionType.test(node.type)) lexicalDepth += 1;
- // if toplevel return, we need to wrap it
- if (node.type === 'ReturnStatement' && lexicalDepth === 0) {
- shouldWrap = true;
- }
- // rewrite `this` as `commonjsHelpers.commonjsGlobal`
- if (node.type === 'ThisExpression' && lexicalDepth === 0) {
- uses.global = true;
- if (!ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
- return;
- }
- // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
- if (node.type === 'UnaryExpression' && node.operator === 'typeof') {
- const flattened = flatten(node.argument);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
- if (
- flattened.keypath === 'module.exports' ||
- flattened.keypath === 'module' ||
- flattened.keypath === 'exports'
- ) {
- magicString.overwrite(node.start, node.end, `'object'`, { storeName: false });
- }
- }
- // rewrite `require` (if not already handled) `global` and `define`, and handle free references to
- // `module` and `exports` as these mean we need to wrap the module in commonjsHelpers.createCommonjsModule
- if (node.type === 'Identifier') {
- if (isReference(node, parent) && !scope.contains(node.name)) {
- if (node.name in uses) {
- if (isRequireIdentifier(node)) {
- if (isNodeRequireStatement(parent)) {
- return;
- }
- if (!isDynamicRequireModulesEnabled && isStaticRequireStatement(parent)) {
- return;
- }
- if (isDynamicRequireModulesEnabled && isRequireStatement(parent)) {
- magicString.appendLeft(
- parent.end - 1,
- `,${JSON.stringify(
- dirname(id) === '.'
- ? null /* default behavior */
- : getVirtualPathForDynamicRequirePath(
- normalizePathSlashes(dirname(id)),
- commonDir
- )
- )}`
- );
- }
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsRequire`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
- uses[node.name] = true;
- if (node.name === 'global' && !ignoreGlobal) {
- magicString.overwrite(node.start, node.end, `${HELPERS_NAME}.commonjsGlobal`, {
- storeName: true
- });
- usesCommonjsHelpers = true;
- }
- // if module or exports are used outside the context of an assignment
- // expression, we need to wrap the module
- if (node.name === 'module' || node.name === 'exports') {
- shouldWrap = true;
- }
- }
- if (node.name === 'define') {
- magicString.overwrite(node.start, node.end, 'undefined', { storeName: true });
- }
- globals.add(node.name);
- }
- return;
- }
- // Is this an assignment to exports or module.exports?
- if (node.type === 'AssignmentExpression') {
- if (node.left.type !== 'MemberExpression') return;
- const flattened = flatten(node.left);
- if (!flattened) return;
- if (scope.contains(flattened.name)) return;
- const match = exportsPattern.exec(flattened.keypath);
- if (!match || flattened.keypath === 'exports') return;
- uses[flattened.name] = true;
- // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
- // if this isn't top-level, we'll need to wrap the module
- if (programDepth > 3) shouldWrap = true;
- node.left._skip = true;
- if (flattened.keypath === 'module.exports' && node.right.type === 'ObjectExpression') {
- node.right.properties.forEach((prop) => {
- if (prop.computed || !('key' in prop) || prop.key.type !== 'Identifier') return;
- const { name } = prop.key;
- if (name === makeLegalIdentifier$2(name)) ;
- });
- return;
- }
- return;
- }
- const name = getDefinePropertyCallName(node, 'exports');
- if (name && name === makeLegalIdentifier$2(name)) ;
- // if this is `var x = require('x')`, we can do `import x from 'x'`
- if (
- node.type === 'VariableDeclarator' &&
- node.id.type === 'Identifier' &&
- isStaticRequireStatement(node.init) &&
- !isIgnoredRequireStatement(node.init)
- ) {
- // for now, only do this for top-level requires. maybe fix this in future
- if (scope.parent) return;
- // edge case — CJS allows you to assign to imports. ES doesn't
- if (assignedTo.has(node.id.name)) return;
- const required = getRequired(node.init, node.id.name);
- required.importsDefault = true;
- if (required.name === node.id.name && !required.isDynamic) {
- node._shouldRemove = true;
- }
- }
- if (!isStaticRequireStatement(node) || isIgnoredRequireStatement(node)) {
- return;
- }
- const required = getRequired(node);
- if (parent.type === 'ExpressionStatement') {
- // is a bare import, e.g. `require('foo');`
- magicString.remove(parent.start, parent.end);
- } else {
- required.importsDefault = true;
- if (shouldUseSimulatedRequire(required)) {
- magicString.overwrite(
- node.start,
- node.end,
- `${HELPERS_NAME}.commonjsRequire(${JSON.stringify(
- getVirtualPathForDynamicRequirePath(normalizePathSlashes(required.source), commonDir)
- )}, ${JSON.stringify(
- dirname(id) === '.'
- ? null /* default behavior */
- : getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
- )})`
- );
- usesCommonjsHelpers = true;
- } else {
- magicString.overwrite(node.start, node.end, required.name);
- }
- }
- node.callee._skip = true;
- },
- leave(node) {
- programDepth -= 1;
- if (node.scope) scope = scope.parent;
- if (functionType.test(node.type)) lexicalDepth -= 1;
- if (node.type === 'VariableDeclaration') {
- let keepDeclaration = false;
- let c = node.declarations[0].start;
- for (let i = 0; i < node.declarations.length; i += 1) {
- const declarator = node.declarations[i];
- if (declarator._shouldRemove) {
- magicString.remove(c, declarator.end);
- } else {
- if (!keepDeclaration) {
- magicString.remove(c, declarator.start);
- keepDeclaration = true;
- }
- c = declarator.end;
- }
- }
- if (!keepDeclaration) {
- magicString.remove(node.start, node.end);
- }
- }
- }
- });
- if (
- !sources.length &&
- !uses.module &&
- !uses.exports &&
- !uses.require &&
- (ignoreGlobal || !uses.global)
- ) {
- // not a CommonJS module
- return null;
- }
- // If `isEsModule` is on, it means it has ES6 import/export statements,
- // which just can't be wrapped in a function.
- if (isEsModule) shouldWrap = false;
- usesCommonjsHelpers = usesCommonjsHelpers || shouldWrap;
- const importBlock = `${(usesCommonjsHelpers
- ? [`import * as ${HELPERS_NAME} from '${HELPERS_ID}';`]
- : []
- )
- .concat(
- sources.map(
- ([source]) =>
- // import the actual module before the proxy, so that we know
- // what kind of proxy to build
- `import '${source}';`
- ),
- sources
- .filter(([, importProxy]) => importProxy)
- .map(([source]) => {
- const { name, importsDefault } = required[source];
- return `import ${importsDefault ? `${name} from ` : ``}'${
- source.startsWith('\0') ? source : getProxyId(source)
- }';`;
- })
- )
- .join('\n')}\n\n`;
- const namedExportDeclarations = [];
- let wrapperStart = '';
- let wrapperEnd = '';
- const moduleName = deconflict(scope, globals, getName(id));
- if (!isEsModule) {
- const exportModuleExports = {
- str: `export { ${moduleName} as __moduleExports };`,
- name: '__moduleExports'
- };
- namedExportDeclarations.push(exportModuleExports);
- }
- const defaultExportPropertyAssignments = [];
- let hasDefaultExport = false;
- if (shouldWrap) {
- const args = `module${uses.exports ? ', exports' : ''}`;
- wrapperStart = `var ${moduleName} = ${HELPERS_NAME}.createCommonjsModule(function (${args}) {\n`;
- wrapperEnd = `\n}`;
- if (isDynamicRequireModulesEnabled) {
- wrapperEnd += `, ${JSON.stringify(
- getVirtualPathForDynamicRequirePath(normalizePathSlashes(dirname(id)), commonDir)
- )}`;
- }
- wrapperEnd += `);`;
- } else {
- const names = [];
- for (const node of ast.body) {
- if (node.type === 'ExpressionStatement' && node.expression.type === 'AssignmentExpression') {
- const { left } = node.expression;
- const flattened = flatten(left);
- if (!flattened) {
- continue;
- }
- const match = exportsPattern.exec(flattened.keypath);
- if (!match) {
- continue;
- }
- if (flattened.keypath === 'module.exports') {
- hasDefaultExport = true;
- magicString.overwrite(left.start, left.end, `var ${moduleName}`);
- } else {
- const [, name] = match;
- const deconflicted = deconflict(scope, globals, name);
- names.push({ name, deconflicted });
- magicString.overwrite(node.start, left.end, `var ${deconflicted}`);
- const declaration =
- name === deconflicted
- ? `export { ${name} };`
- : `export { ${deconflicted} as ${name} };`;
- if (name !== 'default') {
- namedExportDeclarations.push({
- str: declaration,
- name
- });
- }
- defaultExportPropertyAssignments.push(`${moduleName}.${name} = ${deconflicted};`);
- }
- }
- }
- if (!(isEsModule || hasDefaultExport)) {
- wrapperEnd = `\n\nvar ${moduleName} = {\n${names
- .map(({ name, deconflicted }) => `\t${name}: ${deconflicted}`)
- .join(',\n')}\n};`;
- }
- }
- magicString
- .trim()
- .prepend(importBlock + wrapperStart)
- .trim()
- .append(wrapperEnd);
- const defaultExport =
- code.indexOf('__esModule') >= 0
- ? `export default /*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${moduleName});`
- : `export default ${moduleName};`;
- const named = namedExportDeclarations
- .filter((x) => x.name !== 'default' || !hasDefaultExport)
- .map((x) => x.str);
- magicString.append(
- `\n\n${(isEsModule ? [] : [defaultExport])
- .concat(named)
- .concat(hasDefaultExport ? defaultExportPropertyAssignments : [])
- .join('\n')}`
- );
- code = magicString.toString();
- const map = sourceMap ? magicString.generateMap() : null;
- return { code, map, syntheticNamedExports: isEsModule ? false : '__moduleExports' };
- }
- function getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir) {
- let code = `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');`;
- for (const dir of dynamicRequireModuleDirPaths) {
- let entryPoint = 'index.js';
- try {
- if (existsSync(join(dir, 'package.json'))) {
- entryPoint =
- JSON.parse(readFileSync(join(dir, 'package.json'), { encoding: 'utf8' })).main ||
- entryPoint;
- }
- } catch (ignored) {
- // ignored
- }
- code += `\ncommonjsRegister(${JSON.stringify(
- getVirtualPathForDynamicRequirePath(dir, commonDir)
- )}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizePathSlashes(join(dir, entryPoint)))});
- });`;
- }
- return code;
- }
- function getDynamicPackagesEntryIntro(
- id,
- dynamicRequireModuleDirPaths,
- dynamicRequireModuleSet
- ) {
- try {
- const code = readFileSync(id, { encoding: 'utf8' });
- let dynamicImports = Array.from(
- dynamicRequireModuleSet,
- (dynamicId) => `require(${JSON.stringify(DYNAMIC_REGISTER_PREFIX + dynamicId)});`
- ).join('\n');
- if (dynamicRequireModuleDirPaths.length) {
- dynamicImports += `require(${JSON.stringify(
- DYNAMIC_REGISTER_PREFIX + DYNAMIC_PACKAGES_ID
- )});`;
- }
- return `${dynamicImports}\n${code}`;
- } catch (ex) {
- this.warn(`Failed to read file ${id}, dynamic modules might not work correctly`);
- return null;
- }
- }
- function getDynamicRequirePaths(patterns) {
- const dynamicRequireModuleSet = new Set();
- for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
- const isNegated = pattern.startsWith('!');
- const modifySet = Set.prototype[isNegated ? 'delete' : 'add'].bind(dynamicRequireModuleSet);
- for (const path of glob_1.sync(isNegated ? pattern.substr(1) : pattern)) {
- modifySet(normalizePathSlashes(resolve$1(path)));
- }
- }
- const dynamicRequireModuleDirPaths = Array.from(dynamicRequireModuleSet.values()).filter(
- (path) => {
- try {
- if (statSync(path).isDirectory()) return true;
- } catch (ignored) {
- // Nothing to do here
- }
- return false;
- }
- );
- return { dynamicRequireModuleSet, dynamicRequireModuleDirPaths };
- }
- /* eslint-disable no-undefined */
- const isCjsPromises = new Map();
- function getIsCjsPromise(id) {
- let isCjsPromise = isCjsPromises.get(id);
- if (isCjsPromise) return isCjsPromise.promise;
- const promise = new Promise((resolve) => {
- isCjsPromise = {
- resolve,
- promise: undefined
- };
- isCjsPromises.set(id, isCjsPromise);
- });
- isCjsPromise.promise = promise;
- return promise;
- }
- function setIsCjsPromise(id, resolution) {
- const isCjsPromise = isCjsPromises.get(id);
- if (isCjsPromise) {
- if (isCjsPromise.resolve) {
- isCjsPromise.resolve(resolution);
- isCjsPromise.resolve = undefined;
- }
- } else {
- isCjsPromises.set(id, { promise: Promise.resolve(resolution), resolve: undefined });
- }
- }
- // e.g. id === "commonjsHelpers?commonjsRegister"
- function getSpecificHelperProxy(id) {
- return `export {${id.split('?')[1]} as default} from '${HELPERS_ID}';`;
- }
- function getUnknownRequireProxy(id, requireReturnsDefault) {
- if (requireReturnsDefault === true || id.endsWith('.json')) {
- return `export {default} from ${JSON.stringify(id)};`;
- }
- const name = getName(id);
- const exported =
- requireReturnsDefault === 'auto'
- ? `import {getDefaultExportFromNamespaceIfNotNamed} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
- : requireReturnsDefault === 'preferred'
- ? `import {getDefaultExportFromNamespaceIfPresent} from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
- : !requireReturnsDefault
- ? `import {getAugmentedNamespace} from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
- : `export default ${name};`;
- return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
- }
- function getDynamicJsonProxy(id, commonDir) {
- const normalizedPath = normalizePathSlashes(id.slice(DYNAMIC_JSON_PREFIX.length));
- return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
- getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
- )}, function (module, exports) {
- module.exports = require(${JSON.stringify(normalizedPath)});
- });`;
- }
- function getDynamicRequireProxy(normalizedPath, commonDir) {
- return `const commonjsRegister = require('${HELPERS_ID}?commonjsRegister');\ncommonjsRegister(${JSON.stringify(
- getVirtualPathForDynamicRequirePath(normalizedPath, commonDir)
- )}, function (module, exports) {
- ${readFileSync(normalizedPath, { encoding: 'utf8' })}
- });`;
- }
- async function getStaticRequireProxy(
- id,
- requireReturnsDefault,
- esModulesWithDefaultExport,
- esModulesWithNamedExports
- ) {
- const name = getName(id);
- const isCjs = await getIsCjsPromise(id);
- if (isCjs) {
- return `import { __moduleExports } from ${JSON.stringify(id)}; export default __moduleExports;`;
- } else if (isCjs === null) {
- return getUnknownRequireProxy(id, requireReturnsDefault);
- } else if (!requireReturnsDefault) {
- return `import {getAugmentedNamespace} from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
- id
- )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
- } else if (
- requireReturnsDefault !== true &&
- (requireReturnsDefault === 'namespace' ||
- !esModulesWithDefaultExport.has(id) ||
- (requireReturnsDefault === 'auto' && esModulesWithNamedExports.has(id)))
- ) {
- return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
- }
- return `export {default} from ${JSON.stringify(id)};`;
- }
- /* eslint-disable no-param-reassign, no-undefined */
- function getCandidatesForExtension(resolved, extension) {
- return [resolved + extension, `${resolved}${sep}index${extension}`];
- }
- function getCandidates(resolved, extensions) {
- return extensions.reduce(
- (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
- [resolved]
- );
- }
- function getResolveId(extensions) {
- function resolveExtensions(importee, importer) {
- // not our problem
- if (importee[0] !== '.' || !importer) return undefined;
- const resolved = resolve$1(dirname(importer), importee);
- const candidates = getCandidates(resolved, extensions);
- for (let i = 0; i < candidates.length; i += 1) {
- try {
- const stats = statSync(candidates[i]);
- if (stats.isFile()) return { id: candidates[i] };
- } catch (err) {
- /* noop */
- }
- }
- return undefined;
- }
- function resolveId(importee, importer) {
- const isProxyModule = importee.endsWith(PROXY_SUFFIX);
- if (isProxyModule) {
- importee = getIdFromProxyId(importee);
- }
- if (importee.startsWith('\0')) {
- if (
- importee.startsWith(HELPERS_ID) ||
- importee === DYNAMIC_PACKAGES_ID ||
- importee.startsWith(DYNAMIC_JSON_PREFIX)
- ) {
- return importee;
- }
- if (!isProxyModule) {
- return null;
- }
- }
- if (importer && importer.endsWith(PROXY_SUFFIX)) {
- importer = getIdFromProxyId(importer);
- }
- return this.resolve(importee, importer, { skipSelf: true }).then((resolved) => {
- if (!resolved) {
- resolved = resolveExtensions(importee, importer);
- }
- if (isProxyModule) {
- if (!resolved) {
- return { id: getExternalProxyId(importee), external: false };
- }
- resolved.id = (resolved.external ? getExternalProxyId : getProxyId)(resolved.id);
- resolved.external = false;
- return resolved;
- }
- return resolved;
- });
- }
- return resolveId;
- }
- function commonjs(options = {}) {
- const extensions = options.extensions || ['.js'];
- const filter = createFilter$4(options.include, options.exclude);
- const {
- ignoreGlobal,
- requireReturnsDefault: requireReturnsDefaultOption,
- esmExternals
- } = options;
- const getRequireReturnsDefault =
- typeof requireReturnsDefaultOption === 'function'
- ? requireReturnsDefaultOption
- : () => requireReturnsDefaultOption;
- let esmExternalIds;
- const isEsmExternal =
- typeof esmExternals === 'function'
- ? esmExternals
- : Array.isArray(esmExternals)
- ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
- : () => esmExternals;
- const { dynamicRequireModuleSet, dynamicRequireModuleDirPaths } = getDynamicRequirePaths(
- options.dynamicRequireTargets
- );
- const isDynamicRequireModulesEnabled = dynamicRequireModuleSet.size > 0;
- const commonDir = isDynamicRequireModulesEnabled
- ? commondir(null, Array.from(dynamicRequireModuleSet).concat(process.cwd()))
- : null;
- const esModulesWithDefaultExport = new Set();
- const esModulesWithNamedExports = new Set();
- const ignoreRequire =
- typeof options.ignore === 'function'
- ? options.ignore
- : Array.isArray(options.ignore)
- ? (id) => options.ignore.includes(id)
- : () => false;
- const resolveId = getResolveId(extensions);
- const sourceMap = options.sourceMap !== false;
- function transformAndCheckExports(code, id) {
- const { isEsModule, hasDefaultExport, hasNamedExports, ast } = checkEsModule(
- this.parse,
- code,
- id
- );
- if (hasDefaultExport) {
- esModulesWithDefaultExport.add(id);
- }
- if (hasNamedExports) {
- esModulesWithNamedExports.add(id);
- }
- if (
- !dynamicRequireModuleSet.has(normalizePathSlashes(id)) &&
- (!hasCjsKeywords(code, ignoreGlobal) || (isEsModule && !options.transformMixedEsModules))
- ) {
- setIsCjsPromise(id, false);
- return null;
- }
- const transformed = transformCommonjs(
- this.parse,
- code,
- id,
- isEsModule,
- ignoreGlobal || isEsModule,
- ignoreRequire,
- sourceMap,
- isDynamicRequireModulesEnabled,
- dynamicRequireModuleSet,
- commonDir,
- ast
- );
- setIsCjsPromise(id, isEsModule ? false : Boolean(transformed));
- return transformed;
- }
- return {
- name: 'commonjs',
- buildStart() {
- if (options.namedExports != null) {
- this.warn(
- 'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
- );
- }
- const [major, minor] = this.meta.rollupVersion.split('.').map(Number);
- const minVersion = peerDependencies.rollup.slice(2);
- const [minMajor, minMinor] = minVersion.split('.').map(Number);
- if (major < minMajor || (major === minMajor && minor < minMinor)) {
- this.error(
- `Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least rollup@${minVersion} but found rollup@${this.meta.rollupVersion}.`
- );
- }
- },
- resolveId,
- load(id) {
- if (id === HELPERS_ID) {
- return getHelpersModule(isDynamicRequireModulesEnabled);
- }
- if (id.startsWith(HELPERS_ID)) {
- return getSpecificHelperProxy(id);
- }
- if (id.endsWith(EXTERNAL_SUFFIX)) {
- const actualId = getIdFromExternalProxyId(id);
- return getUnknownRequireProxy(
- actualId,
- isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
- );
- }
- if (id === DYNAMIC_PACKAGES_ID) {
- return getDynamicPackagesModule(dynamicRequireModuleDirPaths, commonDir);
- }
- if (id.startsWith(DYNAMIC_JSON_PREFIX)) {
- return getDynamicJsonProxy(id, commonDir);
- }
- const normalizedPath = normalizePathSlashes(id);
- if (dynamicRequireModuleSet.has(normalizedPath) && !normalizedPath.endsWith('.json')) {
- return getDynamicRequireProxy(normalizedPath, commonDir);
- }
- if (id.endsWith(PROXY_SUFFIX)) {
- const actualId = getIdFromProxyId(id);
- return getStaticRequireProxy(
- actualId,
- getRequireReturnsDefault(actualId),
- esModulesWithDefaultExport,
- esModulesWithNamedExports
- );
- }
- if (isDynamicRequireModulesEnabled && this.getModuleInfo(id).isEntry) {
- return getDynamicPackagesEntryIntro(
- id,
- dynamicRequireModuleDirPaths,
- dynamicRequireModuleSet
- );
- }
- return null;
- },
- transform(code, id) {
- const extName = extname$1(id);
- if (
- extName !== '.cjs' &&
- id !== DYNAMIC_PACKAGES_ID &&
- !id.startsWith(DYNAMIC_JSON_PREFIX) &&
- (!filter(id) || !extensions.includes(extName))
- ) {
- setIsCjsPromise(id, null);
- return null;
- }
- let transformed;
- try {
- transformed = transformAndCheckExports.call(this, code, id);
- } catch (err) {
- transformed = null;
- setIsCjsPromise(id, false);
- this.error(err, err.loc);
- }
- return transformed;
- }
- };
- }
- // Helper since Typescript can't detect readonly arrays with Array.isArray
- function isArray$3(arg) {
- return Array.isArray(arg);
- }
- function ensureArray$3(thing) {
- if (isArray$3(thing))
- return thing;
- if (thing == null)
- return [];
- return [thing];
- }
- function getMatcherString$3(id, resolutionBase) {
- if (resolutionBase === false) {
- return id;
- }
- // resolve('') is valid and will default to process.cwd()
- const basePath = resolve$1(resolutionBase || '')
- .split(sep)
- .join('/')
- // escape all possible (posix + win) path characters that might interfere with regex
- .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
- // Note that we use posix.join because:
- // 1. the basePath has been normalized to use /
- // 2. the incoming glob (id) matcher, also uses /
- // otherwise Node will force backslash (\) on windows
- return posix$1.join(basePath, id);
- }
- const createFilter$3 = function createFilter(include, exclude, options) {
- const resolutionBase = options && options.resolve;
- const getMatcher = (id) => id instanceof RegExp
- ? id
- : {
- test: (what) => {
- // this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString$3(id, resolutionBase);
- const fn = picomatch(pattern, { dot: true });
- const result = fn(what);
- return result;
- }
- };
- const includeMatchers = ensureArray$3(include).map(getMatcher);
- const excludeMatchers = ensureArray$3(exclude).map(getMatcher);
- return function result(id) {
- if (typeof id !== 'string')
- return false;
- if (/\0/.test(id))
- return false;
- const pathId = id.split(sep).join('/');
- for (let i = 0; i < excludeMatchers.length; ++i) {
- const matcher = excludeMatchers[i];
- if (matcher.test(pathId))
- return false;
- }
- for (let i = 0; i < includeMatchers.length; ++i) {
- const matcher = includeMatchers[i];
- if (matcher.test(pathId))
- return true;
- }
- return !includeMatchers.length;
- };
- };
- const reservedWords$3 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
- const builtins$4 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
- const forbiddenIdentifiers$3 = new Set(`${reservedWords$3} ${builtins$4}`.split(' '));
- forbiddenIdentifiers$3.add('');
- const makeLegalIdentifier$1 = function makeLegalIdentifier(str) {
- let identifier = str
- .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
- .replace(/[^$_a-zA-Z0-9]/g, '_');
- if (/\d/.test(identifier[0]) || forbiddenIdentifiers$3.has(identifier)) {
- identifier = `_${identifier}`;
- }
- return identifier || '_';
- };
- function stringify$1(obj) {
- return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
- }
- function serializeArray$1(arr, indent, baseIndent) {
- let output = '[';
- const separator = indent ? `\n${baseIndent}${indent}` : '';
- for (let i = 0; i < arr.length; i++) {
- const key = arr[i];
- output += `${i > 0 ? ',' : ''}${separator}${serialize$1(key, indent, baseIndent + indent)}`;
- }
- return `${output}${indent ? `\n${baseIndent}` : ''}]`;
- }
- function serializeObject$1(obj, indent, baseIndent) {
- let output = '{';
- const separator = indent ? `\n${baseIndent}${indent}` : '';
- const entries = Object.entries(obj);
- for (let i = 0; i < entries.length; i++) {
- const [key, value] = entries[i];
- const stringKey = makeLegalIdentifier$1(key) === key ? key : stringify$1(key);
- output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize$1(value, indent, baseIndent + indent)}`;
- }
- return `${output}${indent ? `\n${baseIndent}` : ''}}`;
- }
- function serialize$1(obj, indent, baseIndent) {
- if (obj === Infinity)
- return 'Infinity';
- if (obj === -Infinity)
- return '-Infinity';
- if (obj === 0 && 1 / obj === -Infinity)
- return '-0';
- if (obj instanceof Date)
- return `new Date(${obj.getTime()})`;
- if (obj instanceof RegExp)
- return obj.toString();
- if (obj !== obj)
- return 'NaN'; // eslint-disable-line no-self-compare
- if (Array.isArray(obj))
- return serializeArray$1(obj, indent, baseIndent);
- if (obj === null)
- return 'null';
- if (typeof obj === 'object')
- return serializeObject$1(obj, indent, baseIndent);
- return stringify$1(obj);
- }
- const dataToEsm$1 = function dataToEsm(data, options = {}) {
- const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
- const _ = options.compact ? '' : ' ';
- const n = options.compact ? '' : '\n';
- const declarationType = options.preferConst ? 'const' : 'var';
- if (options.namedExports === false ||
- typeof data !== 'object' ||
- Array.isArray(data) ||
- data instanceof Date ||
- data instanceof RegExp ||
- data === null) {
- const code = serialize$1(data, options.compact ? null : t, '');
- const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
- return `export default${magic}${code};`;
- }
- let namedExportCode = '';
- const defaultExportRows = [];
- for (const [key, value] of Object.entries(data)) {
- if (key === makeLegalIdentifier$1(key)) {
- if (options.objectShorthand)
- defaultExportRows.push(key);
- else
- defaultExportRows.push(`${key}:${_}${key}`);
- namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize$1(value, options.compact ? null : t, '')};${n}`;
- }
- else {
- defaultExportRows.push(`${stringify$1(key)}:${_}${serialize$1(value, options.compact ? null : t, '')}`);
- }
- }
- return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
- };
- function json(options) {
- if ( options === void 0 ) options = {};
- var filter = createFilter$3(options.include, options.exclude);
- var indent = 'indent' in options ? options.indent : '\t';
- return {
- name: 'json',
- // eslint-disable-next-line no-shadow
- transform: function transform(json, id) {
- if (id.slice(-5) !== '.json' || !filter(id)) { return null; }
- try {
- var parsed = JSON.parse(json);
- return {
- code: dataToEsm$1(parsed, {
- preferConst: options.preferConst,
- compact: options.compact,
- namedExports: options.namedExports,
- indent: indent
- }),
- map: { mappings: '' }
- };
- } catch (err) {
- var message = 'Could not parse JSON file';
- var position = parseInt(/[\d]/.exec(err.message)[0], 10);
- this.warn({ message: message, id: id, position: position });
- return null;
- }
- }
- };
- }
- const {builtinModules} = Module;
- const ignoreList = [
- 'sys'
- ];
- // eslint-disable-next-line node/no-deprecated-api
- var builtinModules_1 = (builtinModules)
- .filter(x => !/^_|^(internal|v8|node-inspect)\/|\//.test(x) && !ignoreList.includes(x))
- .sort();
- var isMergeableObject = function isMergeableObject(value) {
- return isNonNullObject(value)
- && !isSpecial(value)
- };
- function isNonNullObject(value) {
- return !!value && typeof value === 'object'
- }
- function isSpecial(value) {
- var stringValue = Object.prototype.toString.call(value);
- return stringValue === '[object RegExp]'
- || stringValue === '[object Date]'
- || isReactElement(value)
- }
- // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
- var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
- function isReactElement(value) {
- return value.$$typeof === REACT_ELEMENT_TYPE
- }
- function emptyTarget(val) {
- return Array.isArray(val) ? [] : {}
- }
- function cloneUnlessOtherwiseSpecified(value, options) {
- return (options.clone !== false && options.isMergeableObject(value))
- ? deepmerge(emptyTarget(value), value, options)
- : value
- }
- function defaultArrayMerge(target, source, options) {
- return target.concat(source).map(function(element) {
- return cloneUnlessOtherwiseSpecified(element, options)
- })
- }
- function getMergeFunction(key, options) {
- if (!options.customMerge) {
- return deepmerge
- }
- var customMerge = options.customMerge(key);
- return typeof customMerge === 'function' ? customMerge : deepmerge
- }
- function getEnumerableOwnPropertySymbols(target) {
- return Object.getOwnPropertySymbols
- ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
- return target.propertyIsEnumerable(symbol)
- })
- : []
- }
- function getKeys(target) {
- return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
- }
- function propertyIsOnObject(object, property) {
- try {
- return property in object
- } catch(_) {
- return false
- }
- }
- // Protects from prototype poisoning and unexpected merging up the prototype chain.
- function propertyIsUnsafe(target, key) {
- return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
- && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
- && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
- }
- function mergeObject(target, source, options) {
- var destination = {};
- if (options.isMergeableObject(target)) {
- getKeys(target).forEach(function(key) {
- destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
- });
- }
- getKeys(source).forEach(function(key) {
- if (propertyIsUnsafe(target, key)) {
- return
- }
- if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
- destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
- } else {
- destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
- }
- });
- return destination
- }
- function deepmerge(target, source, options) {
- options = options || {};
- options.arrayMerge = options.arrayMerge || defaultArrayMerge;
- options.isMergeableObject = options.isMergeableObject || isMergeableObject;
- // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
- // implementations can use it. The caller may not replace it.
- options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
- var sourceIsArray = Array.isArray(source);
- var targetIsArray = Array.isArray(target);
- var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
- if (!sourceAndTargetTypesMatch) {
- return cloneUnlessOtherwiseSpecified(source, options)
- } else if (sourceIsArray) {
- return options.arrayMerge(target, source, options)
- } else {
- return mergeObject(target, source, options)
- }
- }
- deepmerge.all = function deepmergeAll(array, options) {
- if (!Array.isArray(array)) {
- throw new Error('first argument should be an array')
- }
- return array.reduce(function(prev, next) {
- return deepmerge(prev, next, options)
- }, {})
- };
- var deepmerge_1 = deepmerge;
- var cjs = deepmerge_1;
- // no idea what these regular expressions do,
- // but i extracted it from https://github.com/yahoo/js-module-formats/blob/master/index.js#L18
- var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;
- var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
- var isModule = function (sauce) {
- return ES6ImportExportRegExp.test(sauce)
- || ES6AliasRegExp.test(sauce);
- };
- // Helper since Typescript can't detect readonly arrays with Array.isArray
- function isArray$2(arg) {
- return Array.isArray(arg);
- }
- function ensureArray$2(thing) {
- if (isArray$2(thing))
- return thing;
- if (thing == null)
- return [];
- return [thing];
- }
- function getMatcherString$2(id, resolutionBase) {
- if (resolutionBase === false) {
- return id;
- }
- // resolve('') is valid and will default to process.cwd()
- const basePath = resolve$1(resolutionBase || '')
- .split(sep)
- .join('/')
- // escape all possible (posix + win) path characters that might interfere with regex
- .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
- // Note that we use posix.join because:
- // 1. the basePath has been normalized to use /
- // 2. the incoming glob (id) matcher, also uses /
- // otherwise Node will force backslash (\) on windows
- return posix$1.join(basePath, id);
- }
- const createFilter$2 = function createFilter(include, exclude, options) {
- const resolutionBase = options && options.resolve;
- const getMatcher = (id) => id instanceof RegExp
- ? id
- : {
- test: (what) => {
- // this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString$2(id, resolutionBase);
- const fn = picomatch(pattern, { dot: true });
- const result = fn(what);
- return result;
- }
- };
- const includeMatchers = ensureArray$2(include).map(getMatcher);
- const excludeMatchers = ensureArray$2(exclude).map(getMatcher);
- return function result(id) {
- if (typeof id !== 'string')
- return false;
- if (/\0/.test(id))
- return false;
- const pathId = id.split(sep).join('/');
- for (let i = 0; i < excludeMatchers.length; ++i) {
- const matcher = excludeMatchers[i];
- if (matcher.test(pathId))
- return false;
- }
- for (let i = 0; i < includeMatchers.length; ++i) {
- const matcher = includeMatchers[i];
- if (matcher.test(pathId))
- return true;
- }
- return !includeMatchers.length;
- };
- };
- const reservedWords$2 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
- const builtins$3 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
- const forbiddenIdentifiers$2 = new Set(`${reservedWords$2} ${builtins$3}`.split(' '));
- forbiddenIdentifiers$2.add('');
- const exists = promisify(fs$3.exists);
- const readFile = promisify(fs$3.readFile);
- const realpath = promisify(fs$3.realpath);
- const stat = promisify(fs$3.stat);
- const onError = (error) => {
- if (error.code === 'ENOENT') {
- return false;
- }
- throw error;
- };
- const makeCache = (fn) => {
- const cache = new Map();
- const wrapped = async (param, done) => {
- if (cache.has(param) === false) {
- cache.set(
- param,
- fn(param).catch((err) => {
- cache.delete(param);
- throw err;
- })
- );
- }
- try {
- const result = cache.get(param);
- const value = await result;
- return done(null, value);
- } catch (error) {
- return done(error);
- }
- };
- wrapped.clear = () => cache.clear();
- return wrapped;
- };
- const isDirCached = makeCache(async (file) => {
- try {
- const stats = await stat(file);
- return stats.isDirectory();
- } catch (error) {
- return onError(error);
- }
- });
- const isFileCached = makeCache(async (file) => {
- try {
- const stats = await stat(file);
- return stats.isFile();
- } catch (error) {
- return onError(error);
- }
- });
- const readCachedFile = makeCache(readFile);
- const resolveId = promisify(resolve);
- // returns the imported package name for bare module imports
- function getPackageName(id) {
- if (id.startsWith('.') || id.startsWith('/')) {
- return null;
- }
- const split = id.split('/');
- // @my-scope/my-package/foo.js -> @my-scope/my-package
- // @my-scope/my-package -> @my-scope/my-package
- if (split[0][0] === '@') {
- return `${split[0]}/${split[1]}`;
- }
- // my-package/foo.js -> my-package
- // my-package -> my-package
- return split[0];
- }
- function getMainFields(options) {
- let mainFields;
- if (options.mainFields) {
- ({ mainFields } = options);
- } else {
- mainFields = ['module', 'main'];
- }
- if (options.browser && mainFields.indexOf('browser') === -1) {
- return ['browser'].concat(mainFields);
- }
- if (!mainFields.length) {
- throw new Error('Please ensure at least one `mainFields` value is specified');
- }
- return mainFields;
- }
- function getPackageInfo(options) {
- const { cache, extensions, pkg, mainFields, preserveSymlinks, useBrowserOverrides } = options;
- let { pkgPath } = options;
- if (cache.has(pkgPath)) {
- return cache.get(pkgPath);
- }
- // browserify/resolve doesn't realpath paths returned in its packageFilter callback
- if (!preserveSymlinks) {
- pkgPath = realpathSync$2(pkgPath);
- }
- const pkgRoot = dirname(pkgPath);
- const packageInfo = {
- // copy as we are about to munge the `main` field of `pkg`.
- packageJson: Object.assign({}, pkg),
- // path to package.json file
- packageJsonPath: pkgPath,
- // directory containing the package.json
- root: pkgRoot,
- // which main field was used during resolution of this module (main, module, or browser)
- resolvedMainField: 'main',
- // whether the browser map was used to resolve the entry point to this module
- browserMappedMain: false,
- // the entry point of the module with respect to the selected main field and any
- // relevant browser mappings.
- resolvedEntryPoint: ''
- };
- let overriddenMain = false;
- for (let i = 0; i < mainFields.length; i++) {
- const field = mainFields[i];
- if (typeof pkg[field] === 'string') {
- pkg.main = pkg[field];
- packageInfo.resolvedMainField = field;
- overriddenMain = true;
- break;
- }
- }
- const internalPackageInfo = {
- cachedPkg: pkg,
- hasModuleSideEffects: () => null,
- hasPackageEntry: overriddenMain !== false || mainFields.indexOf('main') !== -1,
- packageBrowserField:
- useBrowserOverrides &&
- typeof pkg.browser === 'object' &&
- Object.keys(pkg.browser).reduce((browser, key) => {
- let resolved = pkg.browser[key];
- if (resolved && resolved[0] === '.') {
- resolved = resolve$1(pkgRoot, resolved);
- }
- /* eslint-disable no-param-reassign */
- browser[key] = resolved;
- if (key[0] === '.') {
- const absoluteKey = resolve$1(pkgRoot, key);
- browser[absoluteKey] = resolved;
- if (!extname$1(key)) {
- extensions.reduce((subBrowser, ext) => {
- subBrowser[absoluteKey + ext] = subBrowser[key];
- return subBrowser;
- }, browser);
- }
- }
- return browser;
- }, {}),
- packageInfo
- };
- const browserMap = internalPackageInfo.packageBrowserField;
- if (
- useBrowserOverrides &&
- typeof pkg.browser === 'object' &&
- // eslint-disable-next-line no-prototype-builtins
- browserMap.hasOwnProperty(pkg.main)
- ) {
- packageInfo.resolvedEntryPoint = browserMap[pkg.main];
- packageInfo.browserMappedMain = true;
- } else {
- // index.node is technically a valid default entrypoint as well...
- packageInfo.resolvedEntryPoint = resolve$1(pkgRoot, pkg.main || 'index.js');
- packageInfo.browserMappedMain = false;
- }
- const packageSideEffects = pkg.sideEffects;
- if (typeof packageSideEffects === 'boolean') {
- internalPackageInfo.hasModuleSideEffects = () => packageSideEffects;
- } else if (Array.isArray(packageSideEffects)) {
- internalPackageInfo.hasModuleSideEffects = createFilter$2(packageSideEffects, null, {
- resolve: pkgRoot
- });
- }
- cache.set(pkgPath, internalPackageInfo);
- return internalPackageInfo;
- }
- function normalizeInput(input) {
- if (Array.isArray(input)) {
- return input;
- } else if (typeof input === 'object') {
- return Object.values(input);
- }
- // otherwise it's a string
- return [input];
- }
- // Resolve module specifiers in order. Promise resolves to the first module that resolves
- // successfully, or the error that resulted from the last attempted module resolution.
- function resolveImportSpecifiers(importSpecifierList, resolveOptions) {
- let promise = Promise.resolve();
- for (let i = 0; i < importSpecifierList.length; i++) {
- promise = promise.then((value) => {
- // if we've already resolved to something, just return it.
- if (value) {
- return value;
- }
- return resolveId(importSpecifierList[i], resolveOptions).then((result) => {
- if (!resolveOptions.preserveSymlinks) {
- result = realpathSync$2(result);
- }
- return result;
- });
- });
- if (i < importSpecifierList.length - 1) {
- // swallow MODULE_NOT_FOUND errors from all but the last resolution
- promise = promise.catch((error) => {
- if (error.code !== 'MODULE_NOT_FOUND') {
- throw error;
- }
- });
- }
- }
- return promise;
- }
- /* eslint-disable no-param-reassign, no-shadow, no-undefined */
- const builtins$2 = new Set(builtinModules_1);
- const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
- const nullFn = () => null;
- const deepFreeze = (object) => {
- Object.freeze(object);
- for (const value of Object.values(object)) {
- if (typeof value === 'object' && !Object.isFrozen(value)) {
- deepFreeze(value);
- }
- }
- return object;
- };
- const defaults = {
- customResolveOptions: {},
- dedupe: [],
- // It's important that .mjs is listed before .js so that Rollup will interpret npm modules
- // which deploy both ESM .mjs and CommonJS .js files as ESM.
- extensions: ['.mjs', '.js', '.json', '.node'],
- resolveOnly: []
- };
- deepFreeze(cjs({}, defaults));
- function nodeResolve(opts = {}) {
- const options = Object.assign({}, defaults, opts);
- const { customResolveOptions, extensions, jail } = options;
- const warnings = [];
- const packageInfoCache = new Map();
- const idToPackageInfo = new Map();
- const mainFields = getMainFields(options);
- const useBrowserOverrides = mainFields.indexOf('browser') !== -1;
- const isPreferBuiltinsSet = options.preferBuiltins === true || options.preferBuiltins === false;
- const preferBuiltins = isPreferBuiltinsSet ? options.preferBuiltins : true;
- const rootDir = options.rootDir || process.cwd();
- let { dedupe } = options;
- let rollupOptions;
- if (options.only) {
- warnings.push('node-resolve: The `only` options is deprecated, please use `resolveOnly`');
- options.resolveOnly = options.only;
- }
- if (typeof dedupe !== 'function') {
- dedupe = (importee) =>
- options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
- }
- const resolveOnly = options.resolveOnly.map((pattern) => {
- if (pattern instanceof RegExp) {
- return pattern;
- }
- const normalized = pattern.replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
- return new RegExp(`^${normalized}$`);
- });
- const browserMapCache = new Map();
- let preserveSymlinks;
- return {
- name: 'node-resolve',
- buildStart(options) {
- rollupOptions = options;
- for (const warning of warnings) {
- this.warn(warning);
- }
- ({ preserveSymlinks } = options);
- },
- generateBundle() {
- readCachedFile.clear();
- isFileCached.clear();
- isDirCached.clear();
- },
- async resolveId(importee, importer) {
- if (importee === ES6_BROWSER_EMPTY) {
- return importee;
- }
- // ignore IDs with null character, these belong to other plugins
- if (/\0/.test(importee)) return null;
- // strip hash and query params from import
- const [withoutHash, hash] = importee.split('#');
- const [importPath, params] = withoutHash.split('?');
- const importSuffix = `${params ? `?${params}` : ''}${hash ? `#${hash}` : ''}`;
- importee = importPath;
- const basedir = !importer || dedupe(importee) ? rootDir : dirname(importer);
- // https://github.com/defunctzombie/package-browser-field-spec
- const browser = browserMapCache.get(importer);
- if (useBrowserOverrides && browser) {
- const resolvedImportee = resolve$1(basedir, importee);
- if (browser[importee] === false || browser[resolvedImportee] === false) {
- return ES6_BROWSER_EMPTY;
- }
- const browserImportee =
- browser[importee] ||
- browser[resolvedImportee] ||
- browser[`${resolvedImportee}.js`] ||
- browser[`${resolvedImportee}.json`];
- if (browserImportee) {
- importee = browserImportee;
- }
- }
- const parts = importee.split(/[/\\]/);
- let id = parts.shift();
- let isRelativeImport = false;
- if (id[0] === '@' && parts.length > 0) {
- // scoped packages
- id += `/${parts.shift()}`;
- } else if (id[0] === '.') {
- // an import relative to the parent dir of the importer
- id = resolve$1(basedir, importee);
- isRelativeImport = true;
- }
- if (
- !isRelativeImport &&
- resolveOnly.length &&
- !resolveOnly.some((pattern) => pattern.test(id))
- ) {
- if (normalizeInput(rollupOptions.input).includes(importee)) {
- return null;
- }
- return false;
- }
- let hasModuleSideEffects = nullFn;
- let hasPackageEntry = true;
- let packageBrowserField = false;
- let packageInfo;
- const filter = (pkg, pkgPath) => {
- const info = getPackageInfo({
- cache: packageInfoCache,
- extensions,
- pkg,
- pkgPath,
- mainFields,
- preserveSymlinks,
- useBrowserOverrides
- });
- ({ packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField } = info);
- return info.cachedPkg;
- };
- let resolveOptions = {
- basedir,
- packageFilter: filter,
- readFile: readCachedFile,
- isFile: isFileCached,
- isDirectory: isDirCached,
- extensions
- };
- if (preserveSymlinks !== undefined) {
- resolveOptions.preserveSymlinks = preserveSymlinks;
- }
- const importSpecifierList = [];
- if (importer === undefined && !importee[0].match(/^\.?\.?\//)) {
- // For module graph roots (i.e. when importer is undefined), we
- // need to handle 'path fragments` like `foo/bar` that are commonly
- // found in rollup config files. If importee doesn't look like a
- // relative or absolute path, we make it relative and attempt to
- // resolve it. If we don't find anything, we try resolving it as we
- // got it.
- importSpecifierList.push(`./${importee}`);
- }
- const importeeIsBuiltin = builtins$2.has(importee);
- if (importeeIsBuiltin && (!preferBuiltins || !isPreferBuiltinsSet)) {
- // The `resolve` library will not resolve packages with the same
- // name as a node built-in module. If we're resolving something
- // that's a builtin, and we don't prefer to find built-ins, we
- // first try to look up a local module with that name. If we don't
- // find anything, we resolve the builtin which just returns back
- // the built-in's name.
- importSpecifierList.push(`${importee}/`);
- }
- // TypeScript files may import '.js' to refer to either '.ts' or '.tsx'
- if (importer && importee.endsWith('.js')) {
- for (const ext of ['.ts', '.tsx']) {
- if (importer.endsWith(ext) && extensions.includes(ext)) {
- importSpecifierList.push(importee.replace(/.js$/, ext));
- }
- }
- }
- importSpecifierList.push(importee);
- resolveOptions = Object.assign(resolveOptions, customResolveOptions);
- try {
- let resolved = await resolveImportSpecifiers(importSpecifierList, resolveOptions);
- if (resolved && packageBrowserField) {
- if (Object.prototype.hasOwnProperty.call(packageBrowserField, resolved)) {
- if (!packageBrowserField[resolved]) {
- browserMapCache.set(resolved, packageBrowserField);
- return ES6_BROWSER_EMPTY;
- }
- resolved = packageBrowserField[resolved];
- }
- browserMapCache.set(resolved, packageBrowserField);
- }
- if (hasPackageEntry && !preserveSymlinks && resolved) {
- const fileExists = await exists(resolved);
- if (fileExists) {
- resolved = await realpath(resolved);
- }
- }
- idToPackageInfo.set(resolved, packageInfo);
- if (hasPackageEntry) {
- if (builtins$2.has(resolved) && preferBuiltins && isPreferBuiltinsSet) {
- return null;
- } else if (importeeIsBuiltin && preferBuiltins) {
- if (!isPreferBuiltinsSet) {
- this.warn(
- `preferring built-in module '${importee}' over local alternative at '${resolved}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning`
- );
- }
- return null;
- } else if (jail && resolved.indexOf(normalize$1(jail.trim(sep))) !== 0) {
- return null;
- }
- }
- if (resolved && options.modulesOnly) {
- const code = await readFile(resolved, 'utf-8');
- if (isModule(code)) {
- return {
- id: `${resolved}${importSuffix}`,
- moduleSideEffects: hasModuleSideEffects(resolved)
- };
- }
- return null;
- }
- const result = {
- id: `${resolved}${importSuffix}`,
- moduleSideEffects: hasModuleSideEffects(resolved)
- };
- return result;
- } catch (error) {
- return null;
- }
- },
- load(importee) {
- if (importee === ES6_BROWSER_EMPTY) {
- return 'export default {};';
- }
- return null;
- },
- getPackageInfoForId(id) {
- return idToPackageInfo.get(id);
- }
- };
- }
- const addExtension = function addExtension(filename, ext = '.js') {
- let result = `${filename}`;
- if (!extname$1(filename))
- result += ext;
- return result;
- };
- class WalkerBase {constructor() { WalkerBase.prototype.__init.call(this);WalkerBase.prototype.__init2.call(this);WalkerBase.prototype.__init3.call(this);WalkerBase.prototype.__init4.call(this); }
- __init() {this.should_skip = false;}
- __init2() {this.should_remove = false;}
- __init3() {this.replacement = null;}
- __init4() {this.context = {
- skip: () => (this.should_skip = true),
- remove: () => (this.should_remove = true),
- replace: (node) => (this.replacement = node)
- };}
- replace(parent, prop, index, node) {
- if (parent) {
- if (index !== null) {
- parent[prop][index] = node;
- } else {
- parent[prop] = node;
- }
- }
- }
- remove(parent, prop, index) {
- if (parent) {
- if (index !== null) {
- parent[prop].splice(index, 1);
- } else {
- delete parent[prop];
- }
- }
- }
- }
- class SyncWalkerClass extends WalkerBase {
-
-
- constructor(walker) {
- super();
- this.enter = walker.enter;
- this.leave = walker.leave;
- }
- visit(
- node,
- parent,
- enter,
- leave,
- prop,
- index
- ) {
- if (node) {
- if (enter) {
- const _should_skip = this.should_skip;
- const _should_remove = this.should_remove;
- const _replacement = this.replacement;
- this.should_skip = false;
- this.should_remove = false;
- this.replacement = null;
- enter.call(this.context, node, parent, prop, index);
- if (this.replacement) {
- node = this.replacement;
- this.replace(parent, prop, index, node);
- }
- if (this.should_remove) {
- this.remove(parent, prop, index);
- }
- const skipped = this.should_skip;
- const removed = this.should_remove;
- this.should_skip = _should_skip;
- this.should_remove = _should_remove;
- this.replacement = _replacement;
- if (skipped) return node;
- if (removed) return null;
- }
- for (const key in node) {
- const value = (node )[key];
- if (typeof value !== "object") {
- continue;
- } else if (Array.isArray(value)) {
- for (let i = 0; i < value.length; i += 1) {
- if (value[i] !== null && typeof value[i].type === 'string') {
- if (!this.visit(value[i], node, enter, leave, key, i)) {
- // removed
- i--;
- }
- }
- }
- } else if (value !== null && typeof value.type === "string") {
- this.visit(value, node, enter, leave, key, null);
- }
- }
- if (leave) {
- const _replacement = this.replacement;
- const _should_remove = this.should_remove;
- this.replacement = null;
- this.should_remove = false;
- leave.call(this.context, node, parent, prop, index);
- if (this.replacement) {
- node = this.replacement;
- this.replace(parent, prop, index, node);
- }
- if (this.should_remove) {
- this.remove(parent, prop, index);
- }
- const removed = this.should_remove;
- this.replacement = _replacement;
- this.should_remove = _should_remove;
- if (removed) return null;
- }
- }
- return node;
- }
- }
- function walk(ast, walker) {
- const instance = new SyncWalkerClass(walker);
- return instance.visit(ast, null, walker.enter, walker.leave);
- }
- const extractors = {
- ArrayPattern(names, param) {
- for (const element of param.elements) {
- if (element)
- extractors[element.type](names, element);
- }
- },
- AssignmentPattern(names, param) {
- extractors[param.left.type](names, param.left);
- },
- Identifier(names, param) {
- names.push(param.name);
- },
- MemberExpression() { },
- ObjectPattern(names, param) {
- for (const prop of param.properties) {
- // @ts-ignore Typescript reports that this is not a valid type
- if (prop.type === 'RestElement') {
- extractors.RestElement(names, prop);
- }
- else {
- extractors[prop.value.type](names, prop.value);
- }
- }
- },
- RestElement(names, param) {
- extractors[param.argument.type](names, param.argument);
- }
- };
- const extractAssignedNames = function extractAssignedNames(param) {
- const names = [];
- extractors[param.type](names, param);
- return names;
- };
- const blockDeclarations = {
- const: true,
- let: true
- };
- class Scope {
- constructor(options = {}) {
- this.parent = options.parent;
- this.isBlockScope = !!options.block;
- this.declarations = Object.create(null);
- if (options.params) {
- options.params.forEach((param) => {
- extractAssignedNames(param).forEach((name) => {
- this.declarations[name] = true;
- });
- });
- }
- }
- addDeclaration(node, isBlockDeclaration, isVar) {
- if (!isBlockDeclaration && this.isBlockScope) {
- // it's a `var` or function node, and this
- // is a block scope, so we need to go up
- this.parent.addDeclaration(node, isBlockDeclaration, isVar);
- }
- else if (node.id) {
- extractAssignedNames(node.id).forEach((name) => {
- this.declarations[name] = true;
- });
- }
- }
- contains(name) {
- return this.declarations[name] || (this.parent ? this.parent.contains(name) : false);
- }
- }
- const attachScopes = function attachScopes(ast, propertyName = 'scope') {
- let scope = new Scope();
- walk(ast, {
- enter(n, parent) {
- const node = n;
- // function foo () {...}
- // class Foo {...}
- if (/(Function|Class)Declaration/.test(node.type)) {
- scope.addDeclaration(node, false, false);
- }
- // var foo = 1
- if (node.type === 'VariableDeclaration') {
- const { kind } = node;
- const isBlockDeclaration = blockDeclarations[kind];
- node.declarations.forEach((declaration) => {
- scope.addDeclaration(declaration, isBlockDeclaration, true);
- });
- }
- let newScope;
- // create new function scope
- if (/Function/.test(node.type)) {
- const func = node;
- newScope = new Scope({
- parent: scope,
- block: false,
- params: func.params
- });
- // named function expressions - the name is considered
- // part of the function's scope
- if (func.type === 'FunctionExpression' && func.id) {
- newScope.addDeclaration(func, false, false);
- }
- }
- // create new for scope
- if (/For(In|Of)?Statement/.test(node.type)) {
- newScope = new Scope({
- parent: scope,
- block: true
- });
- }
- // create new block scope
- if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) {
- newScope = new Scope({
- parent: scope,
- block: true
- });
- }
- // catch clause has its own block scope
- if (node.type === 'CatchClause') {
- newScope = new Scope({
- parent: scope,
- params: node.param ? [node.param] : [],
- block: true
- });
- }
- if (newScope) {
- Object.defineProperty(node, propertyName, {
- value: newScope,
- configurable: true
- });
- scope = newScope;
- }
- },
- leave(n) {
- const node = n;
- if (node[propertyName])
- scope = scope.parent;
- }
- });
- return scope;
- };
- // Helper since Typescript can't detect readonly arrays with Array.isArray
- function isArray$1(arg) {
- return Array.isArray(arg);
- }
- function ensureArray$1(thing) {
- if (isArray$1(thing))
- return thing;
- if (thing == null)
- return [];
- return [thing];
- }
- const normalizePath = function (filename) {
- return filename.split(win32$1.sep).join(posix$1.sep);
- };
- function getMatcherString$1(id, resolutionBase) {
- if (resolutionBase === false || isAbsolute$1(id) || id.startsWith('*')) {
- return id;
- }
- // resolve('') is valid and will default to process.cwd()
- const basePath = normalizePath(resolve$1(resolutionBase || ''))
- // escape all possible (posix + win) path characters that might interfere with regex
- .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
- // Note that we use posix.join because:
- // 1. the basePath has been normalized to use /
- // 2. the incoming glob (id) matcher, also uses /
- // otherwise Node will force backslash (\) on windows
- return posix$1.join(basePath, id);
- }
- const createFilter$1 = function createFilter(include, exclude, options) {
- const resolutionBase = options && options.resolve;
- const getMatcher = (id) => id instanceof RegExp
- ? id
- : {
- test: (what) => {
- // this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString$1(id, resolutionBase);
- const fn = picomatch(pattern, { dot: true });
- const result = fn(what);
- return result;
- }
- };
- const includeMatchers = ensureArray$1(include).map(getMatcher);
- const excludeMatchers = ensureArray$1(exclude).map(getMatcher);
- return function result(id) {
- if (typeof id !== 'string')
- return false;
- if (/\0/.test(id))
- return false;
- const pathId = normalizePath(id);
- for (let i = 0; i < excludeMatchers.length; ++i) {
- const matcher = excludeMatchers[i];
- if (matcher.test(pathId))
- return false;
- }
- for (let i = 0; i < includeMatchers.length; ++i) {
- const matcher = includeMatchers[i];
- if (matcher.test(pathId))
- return true;
- }
- return !includeMatchers.length;
- };
- };
- const reservedWords$1 = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
- const builtins$1 = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
- const forbiddenIdentifiers$1 = new Set(`${reservedWords$1} ${builtins$1}`.split(' '));
- forbiddenIdentifiers$1.add('');
- const makeLegalIdentifier = function makeLegalIdentifier(str) {
- let identifier = str
- .replace(/-(\w)/g, (_, letter) => letter.toUpperCase())
- .replace(/[^$_a-zA-Z0-9]/g, '_');
- if (/\d/.test(identifier[0]) || forbiddenIdentifiers$1.has(identifier)) {
- identifier = `_${identifier}`;
- }
- return identifier || '_';
- };
- function stringify(obj) {
- return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`);
- }
- function serializeArray(arr, indent, baseIndent) {
- let output = '[';
- const separator = indent ? `\n${baseIndent}${indent}` : '';
- for (let i = 0; i < arr.length; i++) {
- const key = arr[i];
- output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`;
- }
- return `${output}${indent ? `\n${baseIndent}` : ''}]`;
- }
- function serializeObject(obj, indent, baseIndent) {
- let output = '{';
- const separator = indent ? `\n${baseIndent}${indent}` : '';
- const entries = Object.entries(obj);
- for (let i = 0; i < entries.length; i++) {
- const [key, value] = entries[i];
- const stringKey = makeLegalIdentifier(key) === key ? key : stringify(key);
- output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`;
- }
- return `${output}${indent ? `\n${baseIndent}` : ''}}`;
- }
- function serialize(obj, indent, baseIndent) {
- if (obj === Infinity)
- return 'Infinity';
- if (obj === -Infinity)
- return '-Infinity';
- if (obj === 0 && 1 / obj === -Infinity)
- return '-0';
- if (obj instanceof Date)
- return `new Date(${obj.getTime()})`;
- if (obj instanceof RegExp)
- return obj.toString();
- if (obj !== obj)
- return 'NaN'; // eslint-disable-line no-self-compare
- if (Array.isArray(obj))
- return serializeArray(obj, indent, baseIndent);
- if (obj === null)
- return 'null';
- if (typeof obj === 'object')
- return serializeObject(obj, indent, baseIndent);
- return stringify(obj);
- }
- const dataToEsm = function dataToEsm(data, options = {}) {
- const t = options.compact ? '' : 'indent' in options ? options.indent : '\t';
- const _ = options.compact ? '' : ' ';
- const n = options.compact ? '' : '\n';
- const declarationType = options.preferConst ? 'const' : 'var';
- if (options.namedExports === false ||
- typeof data !== 'object' ||
- Array.isArray(data) ||
- data instanceof Date ||
- data instanceof RegExp ||
- data === null) {
- const code = serialize(data, options.compact ? null : t, '');
- const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape
- return `export default${magic}${code};`;
- }
- let namedExportCode = '';
- const defaultExportRows = [];
- for (const [key, value] of Object.entries(data)) {
- if (key === makeLegalIdentifier(key)) {
- if (options.objectShorthand)
- defaultExportRows.push(key);
- else
- defaultExportRows.push(`${key}:${_}${key}`);
- namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`;
- }
- else {
- defaultExportRows.push(`${stringify(key)}:${_}${serialize(value, options.compact ? null : t, '')}`);
- }
- }
- return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
- };
- // TODO: remove this in next major
- var index = {
- addExtension,
- attachScopes,
- createFilter: createFilter$1,
- dataToEsm,
- extractAssignedNames,
- makeLegalIdentifier,
- normalizePath
- };
- // Helper since Typescript can't detect readonly arrays with Array.isArray
- function isArray(arg) {
- return Array.isArray(arg);
- }
- function ensureArray(thing) {
- if (isArray(thing))
- return thing;
- if (thing == null)
- return [];
- return [thing];
- }
- function getMatcherString(id, resolutionBase) {
- if (resolutionBase === false) {
- return id;
- }
- // resolve('') is valid and will default to process.cwd()
- const basePath = resolve$1(resolutionBase || '')
- .split(sep)
- .join('/')
- // escape all possible (posix + win) path characters that might interfere with regex
- .replace(/[-^$*+?.()|[\]{}]/g, '\\$&');
- // Note that we use posix.join because:
- // 1. the basePath has been normalized to use /
- // 2. the incoming glob (id) matcher, also uses /
- // otherwise Node will force backslash (\) on windows
- return posix$1.join(basePath, id);
- }
- const createFilter = function createFilter(include, exclude, options) {
- const resolutionBase = options && options.resolve;
- const getMatcher = (id) => id instanceof RegExp
- ? id
- : {
- test: (what) => {
- // this refactor is a tad overly verbose but makes for easy debugging
- const pattern = getMatcherString(id, resolutionBase);
- const fn = picomatch(pattern, { dot: true });
- const result = fn(what);
- return result;
- }
- };
- const includeMatchers = ensureArray(include).map(getMatcher);
- const excludeMatchers = ensureArray(exclude).map(getMatcher);
- return function result(id) {
- if (typeof id !== 'string')
- return false;
- if (/\0/.test(id))
- return false;
- const pathId = id.split(sep).join('/');
- for (let i = 0; i < excludeMatchers.length; ++i) {
- const matcher = excludeMatchers[i];
- if (matcher.test(pathId))
- return false;
- }
- for (let i = 0; i < includeMatchers.length; ++i) {
- const matcher = includeMatchers[i];
- if (matcher.test(pathId))
- return true;
- }
- return !includeMatchers.length;
- };
- };
- const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public';
- const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl';
- const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
- forbiddenIdentifiers.add('');
- function escape(str) {
- return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
- }
- function ensureFunction(functionOrValue) {
- if (typeof functionOrValue === 'function') { return functionOrValue; }
- return function () { return functionOrValue; };
- }
- function longest(a, b) {
- return b.length - a.length;
- }
- function getReplacements(options) {
- if (options.values) {
- return Object.assign({}, options.values);
- }
- var values = Object.assign({}, options);
- delete values.delimiters;
- delete values.include;
- delete values.exclude;
- delete values.sourcemap;
- delete values.sourceMap;
- return values;
- }
- function mapToFunctions(object) {
- return Object.keys(object).reduce(function (fns, key) {
- var functions = Object.assign({}, fns);
- functions[key] = ensureFunction(object[key]);
- return functions;
- }, {});
- }
- function replace(options) {
- if ( options === void 0 ) options = {};
- var filter = createFilter(options.include, options.exclude);
- var delimiters = options.delimiters;
- var functionValues = mapToFunctions(getReplacements(options));
- var keys = Object.keys(functionValues)
- .sort(longest)
- .map(escape);
- var pattern = delimiters
- ? new RegExp(((escape(delimiters[0])) + "(" + (keys.join('|')) + ")" + (escape(delimiters[1]))), 'g')
- : new RegExp(("\\b(" + (keys.join('|')) + ")\\b"), 'g');
- return {
- name: 'replace',
- renderChunk: function renderChunk(code, chunk) {
- var id = chunk.fileName;
- if (!keys.length) { return null; }
- if (!filter(id)) { return null; }
- return executeReplacement(code, id);
- },
- transform: function transform(code, id) {
- if (!keys.length) { return null; }
- if (!filter(id)) { return null; }
- return executeReplacement(code, id);
- }
- };
- function executeReplacement(code, id) {
- var magicString = new MagicString(code);
- if (!codeHasReplacements(code, id, magicString)) {
- return null;
- }
- var result = { code: magicString.toString() };
- if (isSourceMapEnabled()) {
- result.map = magicString.generateMap({ hires: true });
- }
- return result;
- }
- function codeHasReplacements(code, id, magicString) {
- var result = false;
- var match;
- // eslint-disable-next-line no-cond-assign
- while ((match = pattern.exec(code))) {
- result = true;
- var start = match.index;
- var end = start + match[0].length;
- var replacement = String(functionValues[match[1]](id));
- magicString.overwrite(start, end, replacement);
- }
- return result;
- }
- function isSourceMapEnabled() {
- return options.sourceMap !== false && options.sourcemap !== false;
- }
- }
- const serverPlugin = (config, platform) => {
- const isHydrateBundle = platform === 'hydrate';
- const serverVarid = `@removed-server-code`;
- const isServerOnlyModule = (id) => {
- if (isString$1(id)) {
- id = normalizeFsPath(id);
- return id.includes('.server/') || id.endsWith('.server');
- }
- return false;
- };
- const externals = isHydrateBundle
- ? config.outputTargets.filter(isOutputTargetHydrate).flatMap((o) => o.external)
- : [];
- return {
- name: 'serverPlugin',
- resolveId(id, importer) {
- if (id === serverVarid) {
- return id;
- }
- if (isHydrateBundle) {
- if (externals.includes(id)) {
- // don't attempt to bundle node builtins for the hydrate bundle
- return {
- id,
- external: true,
- };
- }
- if (isServerOnlyModule(importer) && !id.startsWith('.') && !isAbsolute$1(id)) {
- // do not bundle if the importer is a server-only module
- // and the module it is importing is a node module
- return {
- id,
- external: true,
- };
- }
- }
- else {
- if (isServerOnlyModule(id)) {
- // any path that has .server in it shouldn't actually
- // be bundled in the web build, only the hydrate build
- return serverVarid;
- }
- }
- return null;
- },
- load(id) {
- if (id === serverVarid) {
- return {
- code: 'export default {};',
- syntheticNamedExports: true,
- };
- }
- return null;
- },
- };
- };
- const userIndexPlugin = (config, compilerCtx) => {
- return {
- name: 'userIndexPlugin',
- async resolveId(importee) {
- if (importee === USER_INDEX_ENTRY_ID) {
- const usersIndexJsPath = join(config.srcDir, 'index.ts');
- const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
- if (hasUserIndex) {
- return usersIndexJsPath;
- }
- return importee;
- }
- return null;
- },
- async load(id) {
- if (id === USER_INDEX_ENTRY_ID) {
- return `//! Autogenerated index`;
- }
- return null;
- },
- };
- };
- const workerPlugin = (config, compilerCtx, buildCtx, platform, inlineWorkers) => {
- if (platform === 'worker' || platform === 'hydrate') {
- return {
- name: 'workerPlugin',
- transform(_, id) {
- if (id.endsWith('?worker') || id.endsWith('?worker-inline')) {
- return getMockedWorkerMain();
- }
- return null;
- },
- };
- }
- const workersMap = new Map();
- return {
- name: 'workerPlugin',
- buildStart() {
- workersMap.clear();
- },
- resolveId(id) {
- if (id === WORKER_HELPER_ID) {
- return {
- id,
- moduleSideEffects: false,
- };
- }
- return null;
- },
- load(id) {
- if (id === WORKER_HELPER_ID) {
- return WORKER_HELPERS;
- }
- return null;
- },
- async transform(_, id) {
- if (/\0/.test(id)) {
- return null;
- }
- // Canonical worker path
- if (id.endsWith('?worker')) {
- const workerEntryPath = normalizeFsPath(id);
- const workerName = getWorkerName(workerEntryPath);
- const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
- const referenceId = this.emitFile({
- type: 'asset',
- source: code,
- name: workerName + '.js',
- });
- dependencies.forEach((id) => this.addWatchFile(id));
- return {
- code: getWorkerMain(referenceId, workerName, workerMsgId),
- moduleSideEffects: false,
- };
- }
- else if (id.endsWith('?worker-inline')) {
- const workerEntryPath = normalizeFsPath(id);
- const workerName = getWorkerName(workerEntryPath);
- const { code, dependencies, workerMsgId } = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
- const referenceId = this.emitFile({
- type: 'asset',
- source: code,
- name: workerName + '.js',
- });
- dependencies.forEach((id) => this.addWatchFile(id));
- return {
- code: getInlineWorker(referenceId, workerName, workerMsgId),
- moduleSideEffects: false,
- };
- }
- // Proxy worker path
- const workerEntryPath = getWorkerEntryPath(id);
- if (workerEntryPath != null) {
- const worker = await getWorker(config, compilerCtx, buildCtx, this, workersMap, workerEntryPath);
- if (worker) {
- if (inlineWorkers) {
- return {
- code: getInlineWorkerProxy(workerEntryPath, worker.workerMsgId, worker.exports),
- moduleSideEffects: false,
- };
- }
- else {
- return {
- code: getWorkerProxy(workerEntryPath, worker.exports),
- moduleSideEffects: false,
- };
- }
- }
- }
- return null;
- },
- };
- };
- const getWorkerEntryPath = (id) => {
- if (WORKER_SUFFIX.some((p) => id.endsWith(p))) {
- return normalizeFsPath(id);
- }
- return null;
- };
- const getWorker = async (config, compilerCtx, buildCtx, ctx, workersMap, workerEntryPath) => {
- let worker = workersMap.get(workerEntryPath);
- if (!worker) {
- worker = await buildWorker(config, compilerCtx, buildCtx, ctx, workerEntryPath);
- workersMap.set(workerEntryPath, worker);
- }
- return worker;
- };
- const getWorkerName = (id) => {
- const parts = id.split('/').filter((i) => !i.includes('index'));
- id = parts[parts.length - 1];
- return id.replace('.tsx', '').replace('.ts', '');
- };
- const buildWorker = async (config, compilerCtx, buildCtx, ctx, workerEntryPath) => {
- const workerName = getWorkerName(workerEntryPath);
- const workerMsgId = `stencil.${workerName}`;
- const build = await bundleOutput(config, compilerCtx, buildCtx, {
- platform: 'worker',
- id: workerName,
- inputs: {
- [workerName]: workerEntryPath,
- },
- inlineDynamicImports: true,
- });
- if (build) {
- // Generate commonjs output so we can intercept exports at runtime
- const output = await build.generate({
- format: 'commonjs',
- banner: `${generatePreamble(config)}\n(()=>{\n`,
- footer: '})();',
- intro: getWorkerIntro(workerMsgId, config.devMode),
- esModule: false,
- preferConst: true,
- externalLiveBindings: false,
- });
- const entryPoint = output.output[0];
- if (entryPoint.imports.length > 0) {
- ctx.error('Workers should not have any external imports: ' + JSON.stringify(entryPoint.imports));
- }
- // Optimize code
- let code = entryPoint.code;
- const results = await optimizeModule(config, compilerCtx, {
- input: code,
- sourceTarget: config.buildEs5 ? 'es5' : 'es2017',
- isCore: false,
- minify: config.minifyJs,
- inlineHelpers: true,
- });
- buildCtx.diagnostics.push(...results.diagnostics);
- if (!hasError(results.diagnostics)) {
- code = results.output;
- }
- return {
- code,
- exports: entryPoint.exports,
- workerMsgId,
- dependencies: Object.keys(entryPoint.modules).filter((id) => !/\0/.test(id) && id !== workerEntryPath),
- };
- }
- return null;
- };
- const WORKER_SUFFIX = ['.worker.ts', '.worker.tsx', '.worker/index.ts', '.worker/index.tsx'];
- const WORKER_HELPER_ID = '@worker-helper';
- const GET_TRANSFERABLES = `
- const isInstanceOf = (value, className) => {
- const C = globalThis[className];
- return C != null && value instanceof C;
- }
- const getTransferables = (value) => {
- if (value != null) {
- if (
- isInstanceOf(value, "ArrayBuffer") ||
- isInstanceOf(value, "MessagePort") ||
- isInstanceOf(value, "ImageBitmap") ||
- isInstanceOf(value, "OffscreenCanvas")
- ) {
- return [value];
- }
- if (typeof value === "object") {
- if (value.constructor === Object) {
- value = Object.values(value);
- }
- if (Array.isArray(value)) {
- return value.flatMap(getTransferables);
- }
- return getTransferables(value.buffer);
- }
- }
- return [];
- };`;
- const getWorkerIntro = (workerMsgId, isDev) => `
- ${GET_TRANSFERABLES}
- const exports = {};
- const workerMsgId = '${workerMsgId}';
- const workerMsgCallbackId = workerMsgId + '.cb';
- addEventListener('message', async ({data}) => {
- if (data && data[0] === workerMsgId) {
- let id = data[1];
- let method = data[2];
- let args = data[3];
- let i = 0;
- let argsLen = args.length;
- let value;
- let err;
- try {
- for (; i < argsLen; i++) {
- if (Array.isArray(args[i]) && args[i][0] === workerMsgCallbackId) {
- const callbackId = args[i][1];
- args[i] = (...cbArgs) => {
- postMessage(
- [workerMsgCallbackId, callbackId, cbArgs]
- );
- };
- }
- }
- ${isDev
- ? `
- value = exports[method](...args);
- if (!value || !value.then) {
- throw new Error('The exported method "' + method + '" does not return a Promise, make sure it is an "async" function');
- }
- value = await value;
- `
- : `
- value = await exports[method](...args);`}
- } catch (e) {
- value = null;
- if (e instanceof Error) {
- err = {
- isError: true,
- value: {
- message: e.message,
- name: e.name,
- stack: e.stack,
- }
- };
- } else {
- err = {
- isError: false,
- value: e
- };
- }
- value = undefined;
- }
- const transferables = getTransferables(value);
- ${isDev ? `if (transferables.length > 0) console.debug('Transfering', transferables);` : ''}
- postMessage(
- [workerMsgId, id, value, err],
- transferables
- );
- }
- });
- `;
- const WORKER_HELPERS = `
- import { consoleError } from '${STENCIL_INTERNAL_ID}';
- ${GET_TRANSFERABLES}
- let pendingIds = 0;
- let callbackIds = 0;
- const pending = new Map();
- const callbacks = new Map();
- export const createWorker = (workerPath, workerName, workerMsgId) => {
- const worker = new Worker(workerPath, {name:workerName});
- worker.addEventListener('message', ({data}) => {
- if (data) {
- const workerMsg = data[0];
- const id = data[1];
- const value = data[2];
- if (workerMsg === workerMsgId) {
- const err = data[3];
- const [resolve, reject, callbackIds] = pending.get(id);
- pending.delete(id);
- if (err) {
- const errObj = (err.isError)
- ? Object.assign(new Error(err.value.message), err.value)
- : err.value;
- consoleError(errObj);
- reject(errObj);
- } else {
- if (callbackIds) {
- callbackIds.forEach(id => callbacks.delete(id));
- }
- resolve(value);
- }
- } else if (workerMsg === workerMsgId + '.cb') {
- try {
- callbacks.get(id)(...value);
- } catch (e) {
- consoleError(e);
- }
- }
- }
- });
- return worker;
- };
- export const createWorkerProxy = (worker, workerMsgId, exportedMethod) => (
- (...args) => new Promise((resolve, reject) => {
- let pendingId = pendingIds++;
- let i = 0;
- let argLen = args.length;
- let mainData = [resolve, reject];
- pending.set(pendingId, mainData);
- for (; i < argLen; i++) {
- if (typeof args[i] === 'function') {
- const callbackId = callbackIds++;
- callbacks.set(callbackId, args[i]);
- args[i] = [workerMsgId + '.cb', callbackId];
- (mainData[2] = mainData[2] || []).push(callbackId);
- }
- }
- const postMessage = (w) => (
- w.postMessage(
- [workerMsgId, pendingId, exportedMethod, args],
- getTransferables(args)
- )
- );
- if (worker.then) {
- worker.then(postMessage);
- } else {
- postMessage(worker);
- }
- })
- );
- `;
- const getWorkerMain = (referenceId, workerName, workerMsgId) => {
- return `
- import { createWorker } from '${WORKER_HELPER_ID}';
- export const workerName = '${workerName}';
- export const workerMsgId = '${workerMsgId}';
- export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
- export const worker = /*@__PURE__*/createWorker(workerPath, workerName, workerMsgId);
- `;
- };
- const getInlineWorker = (referenceId, workerName, workerMsgId) => {
- return `
- import { createWorker } from '${WORKER_HELPER_ID}';
- export const workerName = '${workerName}';
- export const workerMsgId = '${workerMsgId}';
- export const workerPath = /*@__PURE__*/import.meta.ROLLUP_FILE_URL_${referenceId};
- const blob = new Blob(['importScripts("' + workerPath + '")'], { type: 'text/javascript' });
- const url = URL.createObjectURL(blob);
- export const worker = /*@__PURE__*/createWorker(url, workerName, workerMsgId);
- URL.revokeObjectURL(url);
- `;
- };
- const getMockedWorkerMain = () => {
- // for the hydrate build the workers won't actually work
- // however, we still need to make the {worker} export
- // kick-in otherwise bundling chokes
- return `
- export const workerName = 'mocked-worker';
- export const workerMsgId = workerName;
- export const workerPath = workerName;
- export const worker = { name: workerName };
- `;
- };
- const getWorkerProxy = (workerEntryPath, exportedMethods) => {
- return `
- import { createWorkerProxy } from '${WORKER_HELPER_ID}';
- import { worker, workerName, workerMsgId } from '${workerEntryPath}?worker';
- ${exportedMethods
- .map((exportedMethod) => {
- return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(worker, workerMsgId, '${exportedMethod}');`;
- })
- .join('\n')}
- `;
- };
- const getInlineWorkerProxy = (workerEntryPath, workerMsgId, exportedMethods) => {
- return `
- import { createWorkerProxy } from '${WORKER_HELPER_ID}';
- const workerPromise = import('${workerEntryPath}?worker-inline').then(m => m.worker);
- ${exportedMethods
- .map((exportedMethod) => {
- return `export const ${exportedMethod} = /*@__PURE__*/createWorkerProxy(workerPromise, '${workerMsgId}', '${exportedMethod}');`;
- })
- .join('\n')}
- `;
- };
- const bundleOutput = async (config, compilerCtx, buildCtx, bundleOpts) => {
- try {
- const rollupOptions = getRollupOptions(config, compilerCtx, buildCtx, bundleOpts);
- const rollupBuild = await rollup(rollupOptions);
- compilerCtx.rollupCache.set(bundleOpts.id, rollupBuild.cache);
- return rollupBuild;
- }
- catch (e) {
- if (!buildCtx.hasError) {
- // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
- // breakable) and type safety (so that the error variable may be something other than `any`)
- loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
- }
- }
- return undefined;
- };
- /**
- * Build the rollup options that will be used to transpile, minify, and otherwise transform a Stencil project
- * @param config the Stencil configuration for the project
- * @param compilerCtx the current compiler context
- * @param buildCtx a context object containing information about the current build
- * @param bundleOpts Rollup bundling options to apply to the base configuration setup by this function
- * @returns the rollup options to be used
- */
- const getRollupOptions = (config, compilerCtx, buildCtx, bundleOpts) => {
- var _a;
- const customResolveOptions = createCustomResolverAsync(config.sys, compilerCtx.fs, [
- '.tsx',
- '.ts',
- '.js',
- '.mjs',
- '.json',
- '.d.ts',
- ]);
- const nodeResolvePlugin = nodeResolve({
- mainFields: ['collection:main', 'jsnext:main', 'es2017', 'es2015', 'module', 'main'],
- customResolveOptions,
- browser: true,
- rootDir: config.rootDir,
- ...config.nodeResolve,
- });
- const orgNodeResolveId = nodeResolvePlugin.resolveId;
- const orgNodeResolveId2 = (nodeResolvePlugin.resolveId = async function (importee, importer) {
- const [realImportee, query] = importee.split('?');
- const resolved = await orgNodeResolveId.call(nodeResolvePlugin, realImportee, importer);
- if (resolved) {
- if (isString$1(resolved)) {
- return query ? resolved + '?' + query : resolved;
- }
- return {
- ...resolved,
- id: query ? resolved.id + '?' + query : resolved.id,
- };
- }
- return resolved;
- });
- if (config.devServer && config.devServer.experimentalDevModules) {
- nodeResolvePlugin.resolveId = async function (importee, importer) {
- const resolvedId = await orgNodeResolveId2.call(nodeResolvePlugin, importee, importer);
- return devNodeModuleResolveId(config, compilerCtx.fs, resolvedId, importee);
- };
- }
- const beforePlugins = config.rollupPlugins.before || [];
- const afterPlugins = config.rollupPlugins.after || [];
- const rollupOptions = {
- input: bundleOpts.inputs,
- plugins: [
- coreResolvePlugin(config, compilerCtx, bundleOpts.platform, bundleOpts.externalRuntime),
- appDataPlugin(config, compilerCtx, buildCtx, bundleOpts.conditionals, bundleOpts.platform),
- lazyComponentPlugin(buildCtx),
- loaderPlugin(bundleOpts.loader),
- userIndexPlugin(config, compilerCtx),
- typescriptPlugin(compilerCtx, bundleOpts, config),
- extFormatPlugin(config),
- extTransformsPlugin(config, compilerCtx, buildCtx, bundleOpts),
- workerPlugin(config, compilerCtx, buildCtx, bundleOpts.platform, !!bundleOpts.inlineWorkers),
- serverPlugin(config, bundleOpts.platform),
- ...beforePlugins,
- nodeResolvePlugin,
- resolveIdWithTypeScript(config, compilerCtx),
- commonjs({
- include: /node_modules/,
- sourceMap: config.sourceMap,
- transformMixedEsModules: false,
- ...config.commonjs,
- }),
- ...afterPlugins,
- pluginHelper(config, buildCtx, bundleOpts.platform),
- json({
- preferConst: true,
- }),
- replace({
- 'process.env.NODE_ENV': config.devMode ? '"development"' : '"production"',
- }),
- fileLoadPlugin(compilerCtx.fs),
- ],
- treeshake: getTreeshakeOption(config, bundleOpts),
- inlineDynamicImports: bundleOpts.inlineDynamicImports,
- preserveEntrySignatures: (_a = bundleOpts.preserveEntrySignatures) !== null && _a !== void 0 ? _a : 'strict',
- onwarn: createOnWarnFn(buildCtx.diagnostics),
- cache: compilerCtx.rollupCache.get(bundleOpts.id),
- };
- return rollupOptions;
- };
- const getTreeshakeOption = (config, bundleOpts) => {
- if (bundleOpts.platform === 'hydrate') {
- return {
- propertyReadSideEffects: false,
- tryCatchDeoptimization: false,
- };
- }
- const treeshake = !config.devMode && config.rollupConfig.inputOptions.treeshake !== false
- ? {
- propertyReadSideEffects: false,
- tryCatchDeoptimization: false,
- }
- : false;
- return treeshake;
- };
- const getBuildFeatures = (cmps) => {
- const slot = cmps.some((c) => c.htmlTagNames.includes('slot'));
- const shadowDom = cmps.some((c) => c.encapsulation === 'shadow');
- const slotRelocation = cmps.some((c) => c.encapsulation !== 'shadow' && c.htmlTagNames.includes('slot'));
- const f = {
- allRenderFn: cmps.every((c) => c.hasRenderFn),
- cmpDidLoad: cmps.some((c) => c.hasComponentDidLoadFn),
- cmpShouldUpdate: cmps.some((c) => c.hasComponentShouldUpdateFn),
- cmpDidUnload: cmps.some((c) => c.hasComponentDidUnloadFn),
- cmpDidUpdate: cmps.some((c) => c.hasComponentDidUpdateFn),
- cmpDidRender: cmps.some((c) => c.hasComponentDidRenderFn),
- cmpWillLoad: cmps.some((c) => c.hasComponentWillLoadFn),
- cmpWillUpdate: cmps.some((c) => c.hasComponentWillUpdateFn),
- cmpWillRender: cmps.some((c) => c.hasComponentWillRenderFn),
- connectedCallback: cmps.some((c) => c.hasConnectedCallbackFn),
- disconnectedCallback: cmps.some((c) => c.hasDisconnectedCallbackFn),
- element: cmps.some((c) => c.hasElement),
- event: cmps.some((c) => c.hasEvent),
- hasRenderFn: cmps.some((c) => c.hasRenderFn),
- lifecycle: cmps.some((c) => c.hasLifecycle),
- asyncLoading: false,
- hostListener: cmps.some((c) => c.hasListener),
- hostListenerTargetWindow: cmps.some((c) => c.hasListenerTargetWindow),
- hostListenerTargetDocument: cmps.some((c) => c.hasListenerTargetDocument),
- hostListenerTargetBody: cmps.some((c) => c.hasListenerTargetBody),
- hostListenerTargetParent: cmps.some((c) => c.hasListenerTargetParent),
- hostListenerTarget: cmps.some((c) => c.hasListenerTarget),
- member: cmps.some((c) => c.hasMember),
- method: cmps.some((c) => c.hasMethod),
- mode: cmps.some((c) => c.hasMode),
- observeAttribute: cmps.some((c) => c.hasAttribute),
- prop: cmps.some((c) => c.hasProp),
- propBoolean: cmps.some((c) => c.hasPropBoolean),
- propNumber: cmps.some((c) => c.hasPropNumber),
- propString: cmps.some((c) => c.hasPropString),
- propMutable: cmps.some((c) => c.hasPropMutable),
- reflect: cmps.some((c) => c.hasReflect),
- scoped: cmps.some((c) => c.encapsulation === 'scoped'),
- shadowDom,
- shadowDelegatesFocus: shadowDom && cmps.some((c) => c.shadowDelegatesFocus),
- slot,
- slotRelocation,
- state: cmps.some((c) => c.hasState),
- style: cmps.some((c) => c.hasStyle),
- svg: cmps.some((c) => c.htmlTagNames.includes('svg')),
- updatable: cmps.some((c) => c.isUpdateable),
- vdomAttribute: cmps.some((c) => c.hasVdomAttribute),
- vdomXlink: cmps.some((c) => c.hasVdomXlink),
- vdomClass: cmps.some((c) => c.hasVdomClass),
- vdomFunctional: cmps.some((c) => c.hasVdomFunctional),
- vdomKey: cmps.some((c) => c.hasVdomKey),
- vdomListener: cmps.some((c) => c.hasVdomListener),
- vdomPropOrAttr: cmps.some((c) => c.hasVdomPropOrAttr),
- vdomRef: cmps.some((c) => c.hasVdomRef),
- vdomRender: cmps.some((c) => c.hasVdomRender),
- vdomStyle: cmps.some((c) => c.hasVdomStyle),
- vdomText: cmps.some((c) => c.hasVdomText),
- watchCallback: cmps.some((c) => c.hasWatchCallback),
- taskQueue: true,
- };
- f.asyncLoading = f.cmpWillUpdate || f.cmpWillLoad || f.cmpWillRender;
- f.vdomAttribute = f.vdomAttribute || f.reflect;
- f.vdomPropOrAttr = f.vdomPropOrAttr || f.reflect;
- return f;
- };
- const updateComponentBuildConditionals = (moduleMap, cmps) => {
- cmps.forEach((cmp) => {
- const importedModules = getModuleImports(moduleMap, cmp.sourceFilePath, []);
- importedModules.forEach((importedModule) => {
- // if the component already has a boolean true value it'll keep it
- // otherwise we get the boolean value from the imported module
- cmp.hasVdomAttribute = cmp.hasVdomAttribute || importedModule.hasVdomAttribute;
- cmp.hasVdomPropOrAttr = cmp.hasVdomPropOrAttr || importedModule.hasVdomPropOrAttr;
- cmp.hasVdomXlink = cmp.hasVdomXlink || importedModule.hasVdomXlink;
- cmp.hasVdomClass = cmp.hasVdomClass || importedModule.hasVdomClass;
- cmp.hasVdomFunctional = cmp.hasVdomFunctional || importedModule.hasVdomFunctional;
- cmp.hasVdomKey = cmp.hasVdomKey || importedModule.hasVdomKey;
- cmp.hasVdomListener = cmp.hasVdomListener || importedModule.hasVdomListener;
- cmp.hasVdomRef = cmp.hasVdomRef || importedModule.hasVdomRef;
- cmp.hasVdomRender = cmp.hasVdomRender || importedModule.hasVdomRender;
- cmp.hasVdomStyle = cmp.hasVdomStyle || importedModule.hasVdomStyle;
- cmp.hasVdomText = cmp.hasVdomText || importedModule.hasVdomText;
- cmp.htmlAttrNames.push(...importedModule.htmlAttrNames);
- cmp.htmlTagNames.push(...importedModule.htmlTagNames);
- cmp.potentialCmpRefs.push(...importedModule.potentialCmpRefs);
- });
- cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
- cmp.htmlTagNames = unique(cmp.htmlTagNames);
- cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
- });
- };
- const getModuleImports = (moduleMap, filePath, importedModules) => {
- let moduleFile = moduleMap.get(filePath);
- if (moduleFile == null) {
- moduleFile = moduleMap.get(filePath + '.tsx');
- if (moduleFile == null) {
- moduleFile = moduleMap.get(filePath + '.ts');
- if (moduleFile == null) {
- moduleFile = moduleMap.get(filePath + '.js');
- }
- }
- }
- if (moduleFile != null && !importedModules.some((m) => m.sourceFilePath === moduleFile.sourceFilePath)) {
- importedModules.push(moduleFile);
- moduleFile.localImports.forEach((localImport) => {
- getModuleImports(moduleMap, localImport, importedModules);
- });
- }
- return importedModules;
- };
- const updateBuildConditionals = (config, b) => {
- b.isDebug = config.logLevel === 'debug';
- b.isDev = !!config.devMode;
- b.isTesting = !!config._isTesting;
- b.devTools = b.isDev && !config._isTesting;
- b.profile = !!config.profile;
- b.hotModuleReplacement = !!(config.devMode &&
- config.devServer &&
- config.devServer.reloadStrategy === 'hmr' &&
- !config._isTesting);
- b.updatable = b.updatable || b.hydrateClientSide || b.hotModuleReplacement;
- b.member = b.member || b.updatable || b.mode || b.lifecycle;
- b.constructableCSS = !b.hotModuleReplacement || !!config._isTesting;
- b.asyncLoading = !!(b.asyncLoading || b.lazyLoad || b.taskQueue || b.initializeNextTick);
- b.cssAnnotations = true;
- b.appendChildSlotFix = config.extras.appendChildSlotFix;
- b.slotChildNodesFix = config.extras.slotChildNodesFix;
- b.cloneNodeFix = config.extras.cloneNodeFix;
- b.dynamicImportShim = config.extras.dynamicImportShim;
- b.lifecycleDOMEvents = !!(b.isDebug || config._isTesting || config.extras.lifecycleDOMEvents);
- b.safari10 = config.extras.safari10;
- b.scopedSlotTextContentFix = !!config.extras.scopedSlotTextContentFix;
- b.scriptDataOpts = config.extras.scriptDataOpts;
- b.shadowDomShim = config.extras.shadowDomShim;
- b.attachStyles = true;
- b.invisiblePrehydration = typeof config.invisiblePrehydration === 'undefined' ? true : config.invisiblePrehydration;
- if (b.shadowDomShim) {
- b.slotRelocation = b.slot;
- }
- if (config.hydratedFlag) {
- b.hydratedAttribute = config.hydratedFlag.selector === 'attribute';
- b.hydratedClass = config.hydratedFlag.selector === 'class';
- }
- else {
- b.hydratedAttribute = false;
- b.hydratedClass = false;
- }
- };
- const getCustomElementsBuildConditionals = (config, cmps) => {
- // because custom elements bundling does not customize the build conditionals by default
- // then the default in "import { BUILD, NAMESPACE } from '@stencil/core/internal/app-data'"
- // needs to have the static build conditionals set for the custom elements build
- const build = getBuildFeatures(cmps);
- build.lazyLoad = false;
- build.hydrateClientSide = false;
- build.hydrateServerSide = false;
- build.asyncQueue = config.taskQueue === 'congestionAsync';
- build.taskQueue = config.taskQueue !== 'immediate';
- updateBuildConditionals(config, build);
- build.devTools = false;
- return build;
- };
- const CLASS_DECORATORS_TO_REMOVE = new Set(['Component']);
- const MEMBER_DECORATORS_TO_REMOVE = new Set([
- 'Element',
- 'Event',
- 'Listen',
- 'Method',
- 'Prop',
- 'PropDidChange',
- 'PropWillChange',
- 'State',
- 'Watch',
- ]);
- /**
- * Determine if a class member is private or not
- * @param member the class member to evaluate
- * @returns `true` if the member has the `private` or `protected` modifier attached to it. `false` otherwise
- */
- const isMemberPrivate = (member) => {
- if (member.modifiers &&
- member.modifiers.some((m) => m.kind === t.SyntaxKind.PrivateKeyword || m.kind === t.SyntaxKind.ProtectedKeyword)) {
- return true;
- }
- return false;
- };
- const convertValueToLiteral = (val, refs = null) => {
- if (refs == null) {
- refs = new WeakSet();
- }
- if (val === String) {
- return t.createIdentifier('String');
- }
- if (val === Number) {
- return t.createIdentifier('Number');
- }
- if (val === Boolean) {
- return t.createIdentifier('Boolean');
- }
- if (val === undefined) {
- return t.createIdentifier('undefined');
- }
- if (val === null) {
- return t.createIdentifier('null');
- }
- if (Array.isArray(val)) {
- return arrayToArrayLiteral(val, refs);
- }
- if (typeof val === 'object') {
- if (val.__identifier && val.__escapedText) {
- return t.createIdentifier(val.__escapedText);
- }
- return objectToObjectLiteral(val, refs);
- }
- return t.createLiteral(val);
- };
- const arrayToArrayLiteral = (list, refs) => {
- const newList = list.map((l) => {
- return convertValueToLiteral(l, refs);
- });
- return t.createArrayLiteral(newList);
- };
- const objectToObjectLiteral = (obj, refs) => {
- if (refs.has(obj)) {
- return t.createIdentifier('undefined');
- }
- refs.add(obj);
- const newProperties = Object.keys(obj).map((key) => {
- const prop = t.createPropertyAssignment(t.createLiteral(key), convertValueToLiteral(obj[key], refs));
- return prop;
- });
- return t.createObjectLiteral(newProperties, true);
- };
- const createStaticGetter = (propName, returnExpression) => {
- return t.createGetAccessor(undefined, [t.createToken(t.SyntaxKind.StaticKeyword)], propName, undefined, undefined, t.createBlock([t.createReturn(returnExpression)]));
- };
- const getStaticValue = (staticMembers, staticName) => {
- const staticMember = staticMembers.find((member) => member.name.escapedText === staticName);
- if (!staticMember || !staticMember.body || !staticMember.body.statements) {
- return null;
- }
- const rtnStatement = staticMember.body.statements.find((s) => s.kind === t.SyntaxKind.ReturnStatement);
- if (!rtnStatement || !rtnStatement.expression) {
- return null;
- }
- const expKind = rtnStatement.expression.kind;
- if (expKind === t.SyntaxKind.StringLiteral) {
- return rtnStatement.expression.text;
- }
- if (expKind === t.SyntaxKind.NoSubstitutionTemplateLiteral) {
- return rtnStatement.expression.text;
- }
- if (expKind === t.SyntaxKind.TrueKeyword) {
- return true;
- }
- if (expKind === t.SyntaxKind.FalseKeyword) {
- return false;
- }
- if (expKind === t.SyntaxKind.ObjectLiteralExpression) {
- return objectLiteralToObjectMap(rtnStatement.expression);
- }
- if (expKind === t.SyntaxKind.ArrayLiteralExpression &&
- rtnStatement.expression.elements) {
- return arrayLiteralToArray(rtnStatement.expression);
- }
- if (expKind === t.SyntaxKind.Identifier) {
- const identifier = rtnStatement.expression;
- if (typeof identifier.escapedText === 'string') {
- return getIdentifierValue(identifier.escapedText);
- }
- if (identifier.escapedText) {
- const obj = {};
- Object.keys(identifier.escapedText).forEach((key) => {
- obj[key] = getIdentifierValue(identifier.escapedText[key]);
- });
- return obj;
- }
- }
- return null;
- };
- const arrayLiteralToArray = (arr) => {
- return arr.elements.map((element) => {
- let val;
- switch (element.kind) {
- case t.SyntaxKind.ObjectLiteralExpression:
- val = objectLiteralToObjectMap(element);
- break;
- case t.SyntaxKind.StringLiteral:
- val = element.text;
- break;
- case t.SyntaxKind.TrueKeyword:
- val = true;
- break;
- case t.SyntaxKind.FalseKeyword:
- val = false;
- break;
- case t.SyntaxKind.Identifier:
- const escapedText = element.escapedText;
- if (escapedText === 'String') {
- val = String;
- }
- else if (escapedText === 'Number') {
- val = Number;
- }
- else if (escapedText === 'Boolean') {
- val = Boolean;
- }
- break;
- case t.SyntaxKind.PropertyAccessExpression:
- default:
- val = element;
- }
- return val;
- });
- };
- const objectLiteralToObjectMap = (objectLiteral) => {
- const properties = objectLiteral.properties;
- const final = {};
- for (const propAssignment of properties) {
- const propName = getTextOfPropertyName(propAssignment.name);
- let val;
- if (t.isShorthandPropertyAssignment(propAssignment)) {
- val = getIdentifierValue(propName);
- }
- else if (t.isPropertyAssignment(propAssignment)) {
- switch (propAssignment.initializer.kind) {
- case t.SyntaxKind.ArrayLiteralExpression:
- val = arrayLiteralToArray(propAssignment.initializer);
- break;
- case t.SyntaxKind.ObjectLiteralExpression:
- val = objectLiteralToObjectMap(propAssignment.initializer);
- break;
- case t.SyntaxKind.StringLiteral:
- val = propAssignment.initializer.text;
- break;
- case t.SyntaxKind.NoSubstitutionTemplateLiteral:
- val = propAssignment.initializer.text;
- break;
- case t.SyntaxKind.TrueKeyword:
- val = true;
- break;
- case t.SyntaxKind.FalseKeyword:
- val = false;
- break;
- case t.SyntaxKind.Identifier:
- const escapedText = propAssignment.initializer.escapedText;
- if (escapedText === 'String') {
- val = String;
- }
- else if (escapedText === 'Number') {
- val = Number;
- }
- else if (escapedText === 'Boolean') {
- val = Boolean;
- }
- else if (escapedText === 'undefined') {
- val = undefined;
- }
- else if (escapedText === 'null') {
- val = null;
- }
- else {
- val = getIdentifierValue(propAssignment.initializer.escapedText);
- }
- break;
- case t.SyntaxKind.PropertyAccessExpression:
- default:
- val = propAssignment.initializer;
- }
- }
- final[propName] = val;
- }
- return final;
- };
- const getIdentifierValue = (escapedText) => {
- const identifier = {
- __identifier: true,
- __escapedText: escapedText,
- };
- return identifier;
- };
- const getTextOfPropertyName = (propName) => {
- switch (propName.kind) {
- case t.SyntaxKind.Identifier:
- return propName.text;
- case t.SyntaxKind.StringLiteral:
- case t.SyntaxKind.NumericLiteral:
- return propName.text;
- case t.SyntaxKind.ComputedPropertyName:
- const expression = propName.expression;
- if (t.isStringLiteral(expression) || t.isNumericLiteral(expression)) {
- return propName.expression.text;
- }
- }
- return undefined;
- };
- /**
- * Generate a series of type references for a given AST node
- * @param baseNode the AST node to pull type references from
- * @param sourceFile the source file in which the provided `baseNode` exists
- * @returns the generated series of type references
- */
- const getAttributeTypeInfo = (baseNode, sourceFile) => {
- const allReferences = {};
- getAllTypeReferences(baseNode).forEach((typeName) => {
- allReferences[typeName] = getTypeReferenceLocation(typeName, sourceFile);
- });
- return allReferences;
- };
- /**
- * Get the text-based name from a TypeScript `EntityName`, which is an identifier of some form
- * @param entity a TypeScript `EntityName` to retrieve the name of an entity from
- * @returns the entity's name
- */
- const getEntityName = (entity) => {
- if (t.isIdentifier(entity)) {
- return entity.escapedText.toString();
- }
- else {
- // We have qualified name - e.g. const x: Foo.Bar.Baz;
- // Recurse until we find the 'base' of the qualified name
- return getEntityName(entity.left);
- }
- };
- /**
- * Recursively walks the provided AST to collect all TypeScript type references that are found
- * @param node the node to walk to retrieve type information
- * @returns the collected type references
- */
- const getAllTypeReferences = (node) => {
- const referencedTypes = [];
- const visit = (node) => {
- /**
- * A type reference node will refer to some type T.
- * e.g: In `const foo: Bar = {...}` the reference node will contain semantic information about `Bar`.
- * In TypeScript, types that are also keywords (e.g. `number` in `const foo: number`) are not `TypeReferenceNode`s.
- */
- if (t.isTypeReferenceNode(node)) {
- referencedTypes.push(getEntityName(node.typeName));
- if (node.typeArguments) {
- // a type may contain types itself (e.g. generics - Foo<Bar>)
- node.typeArguments
- .filter((typeArg) => t.isTypeReferenceNode(typeArg))
- .forEach((typeRef) => {
- const typeName = typeRef.typeName;
- if (typeName && typeName.escapedText) {
- referencedTypes.push(typeName.escapedText.toString());
- }
- });
- }
- }
- return t.forEachChild(node, visit);
- };
- visit(node);
- return referencedTypes;
- };
- const validateReferences = (diagnostics, references, node) => {
- Object.keys(references).forEach((refName) => {
- const ref = references[refName];
- if (ref.path === '@stencil/core' && MEMBER_DECORATORS_TO_REMOVE.has(refName)) {
- const err = buildError(diagnostics);
- augmentDiagnosticWithNode(err, node);
- }
- });
- };
- /**
- * Determine where a TypeScript type reference originates from. This is accomplished by interrogating the AST node in
- * which the type's name appears
- *
- * A type may originate:
- * - from the same file where it is used (a type is declared in some file, `foo.ts`, and later used in the same file)
- * - from another file (I.E. it is imported and should have an import statement somewhere in the file)
- * - from a global context
- * - etc.
- *
- * The type may be declared using the `type` or `interface` keywords.
- *
- * @param typeName the name of the type to find the origination of
- * @param tsNode the TypeScript AST node being searched for the provided `typeName`
- * @returns the context stating where the type originates from
- */
- const getTypeReferenceLocation = (typeName, tsNode) => {
- const sourceFileObj = tsNode.getSourceFile();
- // Loop through all top level imports to find any reference to the type for 'import' reference location
- const importTypeDeclaration = sourceFileObj.statements.find((st) => {
- const statement = t.isImportDeclaration(st) &&
- st.importClause &&
- t.isImportClause(st.importClause) &&
- st.importClause.namedBindings &&
- t.isNamedImports(st.importClause.namedBindings) &&
- Array.isArray(st.importClause.namedBindings.elements) &&
- st.importClause.namedBindings.elements.find((nbe) => nbe.name.getText() === typeName);
- if (!statement) {
- return false;
- }
- return true;
- });
- if (importTypeDeclaration) {
- const localImportPath = importTypeDeclaration.moduleSpecifier.text;
- return {
- location: 'import',
- path: localImportPath,
- };
- }
- // Loop through all top level exports to find if any reference to the type for 'local' reference location
- const isExported = sourceFileObj.statements.some((st) => {
- // Is the interface defined in the file and exported
- const isInterfaceDeclarationExported = t.isInterfaceDeclaration(st) &&
- st.name.getText() === typeName &&
- Array.isArray(st.modifiers) &&
- st.modifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
- const isTypeAliasDeclarationExported = t.isTypeAliasDeclaration(st) &&
- st.name.getText() === typeName &&
- Array.isArray(st.modifiers) &&
- st.modifiers.some((mod) => mod.kind === t.SyntaxKind.ExportKeyword);
- // Is the interface exported through a named export
- const isTypeInExportDeclaration = t.isExportDeclaration(st) &&
- t.isNamedExports(st.exportClause) &&
- st.exportClause.elements.some((nee) => nee.name.getText() === typeName);
- return isInterfaceDeclarationExported || isTypeAliasDeclarationExported || isTypeInExportDeclaration;
- });
- if (isExported) {
- return {
- location: 'local',
- };
- }
- // This is most likely a global type, if it is a local that is not exported then typescript will inform the dev
- return {
- location: 'global',
- };
- };
- const resolveType = (checker, type) => {
- const set = new Set();
- parseDocsType(checker, type, set);
- // normalize booleans
- const hasTrue = set.delete('true');
- const hasFalse = set.delete('false');
- if (hasTrue || hasFalse) {
- set.add('boolean');
- }
- let parts = Array.from(set.keys()).sort();
- // TODO(STENCIL-366): Get this section of code under tests that directly exercises this behavior
- if (parts.length > 1) {
- parts = parts.map((p) => (p.indexOf('=>') >= 0 ? `(${p})` : p));
- }
- if (parts.length > 20) {
- return typeToString(checker, type);
- }
- else {
- return parts.join(' | ');
- }
- };
- /**
- * Formats a TypeScript `Type` entity as a string
- * @param checker a reference to the TypeScript type checker
- * @param type a TypeScript `Type` entity to format
- * @returns the formatted string
- */
- const typeToString = (checker, type) => {
- const TYPE_FORMAT_FLAGS = t.TypeFormatFlags.NoTruncation | t.TypeFormatFlags.InTypeAlias | t.TypeFormatFlags.InElementType;
- return checker.typeToString(type, undefined, TYPE_FORMAT_FLAGS);
- };
- const parseDocsType = (checker, type, parts) => {
- if (type.isUnion()) {
- type.types.forEach((t) => {
- parseDocsType(checker, t, parts);
- });
- }
- else {
- const text = typeToString(checker, type);
- parts.add(text);
- }
- };
- const getModuleFromSourceFile = (compilerCtx, tsSourceFile) => {
- const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
- const moduleFile = compilerCtx.moduleMap.get(sourceFilePath);
- if (moduleFile != null) {
- return moduleFile;
- }
- const moduleFiles = Array.from(compilerCtx.moduleMap.values());
- return moduleFiles.find((m) => m.jsFilePath === sourceFilePath);
- };
- const getComponentMeta = (compilerCtx, tsSourceFile, node) => {
- const meta = compilerCtx.nodeMap.get(node);
- if (meta) {
- return meta;
- }
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- if (moduleFile != null && node.members != null) {
- const staticMembers = node.members.filter(isStaticGetter);
- const tagName = getComponentTagName(staticMembers);
- if (typeof tagName === 'string') {
- return moduleFile.cmps.find((cmp) => cmp.tagName === tagName);
- }
- }
- return undefined;
- };
- const getComponentTagName = (staticMembers) => {
- if (staticMembers.length > 0) {
- const tagName = getStaticValue(staticMembers, 'is');
- if (typeof tagName === 'string' && tagName.includes('-')) {
- return tagName;
- }
- }
- return null;
- };
- const isStaticGetter = (member) => {
- return (member.kind === t.SyntaxKind.GetAccessor &&
- member.modifiers &&
- member.modifiers.some(({ kind }) => kind === t.SyntaxKind.StaticKeyword));
- };
- /**
- * Create a serialized representation of a TypeScript `Symbol` entity to expose the Symbol's text and attached JSDoc.
- * Note that the `Symbol` being serialized is not the same as the JavaScript primitive 'symbol'.
- * @param checker a reference to the TypeScript type checker
- * @param symbol the `Symbol` to serialize
- * @returns the serialized `Symbol` data
- */
- const serializeSymbol = (checker, symbol) => {
- if (!checker || !symbol) {
- return {
- tags: [],
- text: '',
- };
- }
- return {
- tags: mapJSDocTagInfo(symbol.getJsDocTags()),
- text: t.displayPartsToString(symbol.getDocumentationComment(checker)),
- };
- };
- /**
- * Maps a TypeScript 4.3+ JSDocTagInfo to a flattened Stencil CompilerJsDocTagInfo.
- * @param tags A readonly array of JSDocTagInfo objects.
- * @returns An array of CompilerJsDocTagInfo objects.
- */
- const mapJSDocTagInfo = (tags) => {
- // The text following a tag is split semantically by TS 4.3+, e.g. '@param foo the first parameter' ->
- // [{text: 'foo', kind: 'parameterName'}, {text: ' ', kind: 'space'}, {text: 'the first parameter', kind: 'text'}], so
- // we join the elements to reconstruct the text.
- return tags.map((tag) => { var _a; return ({ ...tag, text: (_a = tag.text) === null || _a === void 0 ? void 0 : _a.map((part) => part.text).join('') }); });
- };
- const isInternal = (jsDocs) => {
- return jsDocs && jsDocs.tags.some((s) => s.name === 'internal');
- };
- const isMethod = (member, methodName) => {
- return t.isMethodDeclaration(member) && member.name && member.name.escapedText === methodName;
- };
- const createImportStatement = (importFnNames, importPath) => {
- // ESM Imports
- // import { importNames } from 'importPath';
- const importSpecifiers = importFnNames.map((importKey) => {
- const splt = importKey.split(' as ');
- let importAs = importKey;
- let importFnName = importKey;
- if (splt.length > 1) {
- importAs = splt[1];
- importFnName = splt[0];
- }
- return t.factory.createImportSpecifier(false, typeof importFnName === 'string' && importFnName !== importAs
- ? t.factory.createIdentifier(importFnName)
- : undefined, t.factory.createIdentifier(importAs));
- });
- return t.createImportDeclaration(undefined, undefined, t.createImportClause(undefined, t.createNamedImports(importSpecifiers)), t.createLiteral(importPath));
- };
- const createRequireStatement = (importFnNames, importPath) => {
- // CommonJS require()
- // const { a, b, c } = require(importPath);
- const importBinding = t.createObjectBindingPattern(importFnNames.map((importKey) => {
- const splt = importKey.split(' as ');
- let importAs = importKey;
- let importFnName = importKey;
- if (splt.length > 1) {
- importAs = splt[1];
- importFnName = splt[0];
- }
- return t.createBindingElement(undefined, importFnName, importAs);
- }));
- return t.createVariableStatement(undefined, t.createVariableDeclarationList([
- t.createVariableDeclaration(importBinding, undefined, t.createCall(t.createIdentifier('require'), [], [t.createLiteral(importPath)])),
- ], t.NodeFlags.Const));
- };
- const addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
- if (importFnNames.length === 0) {
- return tsSourceFile;
- }
- if (transformOpts.module === 'cjs') {
- // CommonJS require()
- const newRequire = createRequireStatement(importFnNames, importPath);
- const statements = tsSourceFile.statements.slice();
- statements.splice(2, 0, newRequire);
- return t.updateSourceFileNode(tsSourceFile, statements);
- }
- // ESM Imports
- const newImport = createImportStatement(importFnNames, importPath);
- const statements = tsSourceFile.statements.slice();
- statements.unshift(newImport);
- return t.updateSourceFileNode(tsSourceFile, statements);
- };
- const ATTACH_SHADOW = '__stencil_attachShadow';
- const CREATE_EVENT = '__stencil_createEvent';
- const DEFINE_CUSTOM_ELEMENT = '__stencil_defineCustomElement';
- const GET_CONNECT = '__stencil_getConnect';
- const GET_CONTEXT = '__stencil_getContext';
- const GET_ELEMENT = '__stencil_getElement';
- const HOST = '__stencil_Host';
- const HTML_ELEMENT = 'HTMLElement';
- const PROXY_CUSTOM_ELEMENT = '__stencil_proxyCustomElement';
- const REGISTER_INSTANCE = '__stencil_registerInstance';
- const REGISTER_HOST = '__stencil_registerHost';
- const H = '__stencil_h';
- const RUNTIME_APIS = {
- attachShadow: `attachShadow as ${ATTACH_SHADOW}`,
- createEvent: `createEvent as ${CREATE_EVENT}`,
- defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
- getConnect: `getConnect as ${GET_CONNECT}`,
- getContext: `getContext as ${GET_CONTEXT}`,
- getElement: `getElement as ${GET_ELEMENT}`,
- h: `h as ${H}`,
- legacyH: `h`,
- Host: `Host as ${HOST}`,
- HTMLElement: HTML_ELEMENT,
- proxyCustomElement: `proxyCustomElement as ${PROXY_CUSTOM_ELEMENT}`,
- registerHost: `registerHost as ${REGISTER_HOST}`,
- registerInstance: `registerInstance as ${REGISTER_INSTANCE}`,
- };
- const addCoreRuntimeApi = (moduleFile, coreRuntimeApi) => {
- if (!moduleFile.coreRuntimeApis.includes(coreRuntimeApi)) {
- moduleFile.coreRuntimeApis.push(coreRuntimeApi);
- }
- };
- const addLegacyApis = (moduleFile) => {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.legacyH);
- };
- const addModuleMetadataProxies = (tsSourceFile, moduleFile) => {
- const statements = tsSourceFile.statements.slice();
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.proxyCustomElement);
- statements.push(...moduleFile.cmps.map(addComponentMetadataProxy));
- return t.updateSourceFileNode(tsSourceFile, statements);
- };
- const addComponentMetadataProxy = (compilerMeta) => {
- return t.createStatement(createComponentMetadataProxy(compilerMeta));
- };
- /**
- * Create a call expression for wrapping a component in a proxy. This call expression takes a form:
- * ```ts
- * PROXY_CUSTOM_ELEMENT(ComponentClassName, Metadata);
- * ```
- * where
- * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
- * name at compile name
- * - `ComponentClassName` is the name Stencil component's class
- * - `Metadata` is the compiler metadata associated with the Stencil component
- *
- * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
- * @returns the generated call expression
- */
- const createComponentMetadataProxy = (compilerMeta) => {
- const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
- const literalCmpClassName = t.factory.createIdentifier(compilerMeta.componentClassName);
- const literalMeta = convertValueToLiteral(compactMeta);
- return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [literalCmpClassName, literalMeta]);
- };
- /**
- * Create a call expression for wrapping a component represented as an anonymous class in a proxy. This call expression
- * takes a form:
- * ```ts
- * PROXY_CUSTOM_ELEMENT(Clazz, Metadata);
- * ```
- * where
- * - `PROXY_CUSTOM_ELEMENT` is a Stencil internal identifier that will be replaced with the name of the actual function
- * name at compile name
- * - `Clazz` is an anonymous class to be proxied
- * - `Metadata` is the compiler metadata associated with the Stencil component
- *
- * @param compilerMeta compiler metadata associated with the component to be wrapped in a proxy
- * @param clazz the anonymous class to proxy
- * @returns the generated call expression
- */
- const createAnonymousClassMetadataProxy = (compilerMeta, clazz) => {
- const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
- const literalMeta = convertValueToLiteral(compactMeta);
- return t.factory.createCallExpression(t.factory.createIdentifier(PROXY_CUSTOM_ELEMENT), [], [clazz, literalMeta]);
- };
- const defineCustomElement = (tsSourceFile, moduleFile, transformOpts) => {
- let statements = tsSourceFile.statements.slice();
- statements.push(...moduleFile.cmps.map((cmp) => {
- return addDefineCustomElement(moduleFile, cmp);
- }));
- if (transformOpts.module === 'cjs') {
- // remove commonjs exports keyword from component classes
- statements = removeComponentCjsExport(statements, moduleFile);
- }
- return t.updateSourceFileNode(tsSourceFile, statements);
- };
- const addDefineCustomElement = (moduleFile, compilerMeta) => {
- if (compilerMeta.isPlain) {
- // add customElements.define('cmp-a', CmpClass);
- return t.createStatement(t.createCall(t.createPropertyAccess(t.createIdentifier('customElements'), t.createIdentifier('define')), [], [t.createLiteral(compilerMeta.tagName), t.createIdentifier(compilerMeta.componentClassName)]));
- }
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.defineCustomElement);
- const compactMeta = formatComponentRuntimeMeta(compilerMeta, true);
- const liternalCmpClassName = t.createIdentifier(compilerMeta.componentClassName);
- const liternalMeta = convertValueToLiteral(compactMeta);
- return t.createStatement(t.createCall(t.createIdentifier(DEFINE_CUSTOM_ELEMENT), [], [liternalCmpClassName, liternalMeta]));
- };
- const removeComponentCjsExport = (statements, moduleFile) => {
- const cmpClassNames = new Set(moduleFile.cmps.map((cmp) => cmp.componentClassName));
- return statements.filter((s) => {
- if (s.kind === t.SyntaxKind.ExpressionStatement) {
- const exp = s.expression;
- if (exp && exp.kind === t.SyntaxKind.BinaryExpression) {
- const left = exp.left;
- if (left && left.kind === t.SyntaxKind.PropertyAccessExpression) {
- if (left.expression && left.expression.kind === t.SyntaxKind.Identifier) {
- const leftText = left.expression;
- if (leftText.text === 'exports') {
- const right = exp.right;
- if (right && cmpClassNames.has(right.text)) {
- return false;
- }
- }
- }
- }
- }
- }
- return true;
- });
- };
- const addNativeComponentMeta = (classMembers, cmp) => {
- classMembers.push(createStaticGetter('is', convertValueToLiteral(cmp.tagName)));
- };
- const addNativeConnectedCallback = (classMembers, cmp) => {
- // function call to stencil's exported connectedCallback(elm, plt)
- // TODO: fast path
- if (cmp.isPlain && cmp.hasRenderFn) {
- const fnCall = t.createExpressionStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), 'textContent'), t.createCall(t.createPropertyAccess(t.createThis(), 'render'), undefined, undefined)));
- const connectedCallback = classMembers.find((classMember) => {
- return t.isMethodDeclaration(classMember) && classMember.name.escapedText === 'connectedCallback';
- });
- if (connectedCallback != null) {
- // class already has a connectedCallback(), so update it
- const callbackMethod = t.createMethod(undefined, undefined, undefined, 'connectedCallback', undefined, undefined, undefined, undefined, t.createBlock([fnCall, ...connectedCallback.body.statements], true));
- const index = classMembers.indexOf(connectedCallback);
- classMembers[index] = callbackMethod;
- }
- else {
- // class doesn't have a connectedCallback(), so add it
- const callbackMethod = t.createMethod(undefined, undefined, undefined, 'connectedCallback', undefined, undefined, undefined, undefined, t.createBlock([fnCall], true));
- classMembers.push(callbackMethod);
- }
- }
- };
- const addNativeElementGetter = (classMembers, cmp) => {
- // @Element() element;
- // is transformed into:
- // get element() { return this; }
- if (cmp.elementRef) {
- classMembers.push(t.createGetAccessor(undefined, undefined, cmp.elementRef, [], undefined, t.createBlock([t.createReturn(t.createThis())])));
- }
- };
- const addNativeStaticStyle = (classMembers, cmp) => {
- if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
- if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
- // multiple style modes
- addMultipleModeStyleGetter(classMembers, cmp, cmp.styles);
- }
- else {
- // single style
- addSingleStyleGetter(classMembers, cmp, cmp.styles[0]);
- }
- }
- };
- const addMultipleModeStyleGetter = (classMembers, cmp, styles) => {
- const styleModes = [];
- styles.forEach((style) => {
- if (typeof style.styleStr === 'string') {
- // inline the style string
- // static get style() { return { "ios": "string" }; }
- const styleLiteral = createStyleLiteral$1(cmp, style);
- const propStr = t.createPropertyAssignment(style.modeName, styleLiteral);
- styleModes.push(propStr);
- }
- else if (typeof style.styleIdentifier === 'string') {
- // direct import already written in the source code
- // import myTagIosStyle from './import-path.css';
- // static get style() { return { "ios": myTagIosStyle }; }
- const styleIdentifier = t.createIdentifier(style.styleIdentifier);
- const propIdentifier = t.createPropertyAssignment(style.modeName, styleIdentifier);
- styleModes.push(propIdentifier);
- }
- else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
- // import generated from @Component() styleUrls option
- // import myTagIosStyle from './import-path.css';
- // static get style() { return { "ios": myTagIosStyle }; }
- const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
- const propUrlIdentifier = t.createPropertyAssignment(style.modeName, styleUrlIdentifier);
- styleModes.push(propUrlIdentifier);
- }
- });
- const styleObj = t.createObjectLiteral(styleModes, true);
- classMembers.push(createStaticGetter('style', styleObj));
- };
- const addSingleStyleGetter = (classMembers, cmp, style) => {
- if (typeof style.styleStr === 'string') {
- // inline the style string
- // static get style() { return "string"; }
- const styleLiteral = createStyleLiteral$1(cmp, style);
- classMembers.push(createStaticGetter('style', styleLiteral));
- }
- else if (typeof style.styleIdentifier === 'string') {
- // direct import already written in the source code
- // import myTagStyle from './import-path.css';
- // static get style() { return myTagStyle; }
- const styleIdentifier = t.createIdentifier(style.styleIdentifier);
- classMembers.push(createStaticGetter('style', styleIdentifier));
- }
- else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
- // import generated from @Component() styleUrls option
- // import myTagStyle from './import-path.css';
- // static get style() { return myTagStyle; }
- const styleUrlIdentifier = createStyleIdentifierFromUrl$1(cmp, style);
- classMembers.push(createStaticGetter('style', styleUrlIdentifier));
- }
- };
- const createStyleLiteral$1 = (cmp, style) => {
- if (cmp.encapsulation === 'scoped') {
- // scope the css first
- const scopeId = getScopeId(cmp.tagName, style.modeName);
- return t.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
- }
- return t.createStringLiteral(style.styleStr);
- };
- const createStyleIdentifierFromUrl$1 = (cmp, style) => {
- style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
- style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
- if (style.modeName !== DEFAULT_STYLE_MODE) {
- style.styleIdentifier += dashToPascalCase$1(style.modeName);
- }
- style.styleIdentifier += 'Style';
- style.externalStyles = [style.externalStyles[0]];
- return t.createIdentifier(style.styleIdentifier);
- };
- const addWatchers = (classMembers, cmp) => {
- if (cmp.watchers.length > 0) {
- const watcherObj = {};
- cmp.watchers.forEach(({ propName, methodName }) => {
- watcherObj[propName] = watcherObj[propName] || [];
- watcherObj[propName].push(methodName);
- });
- classMembers.push(createStaticGetter('watchers', convertValueToLiteral(watcherObj)));
- }
- };
- const removeStaticMetaProperties = (classNode) => {
- if (classNode.members == null) {
- return [];
- }
- return classNode.members.filter((classMember) => {
- if (classMember.modifiers) {
- if (classMember.modifiers.some((m) => m.kind === t.SyntaxKind.StaticKeyword)) {
- const memberName = classMember.name.escapedText;
- if (REMOVE_STATIC_GETTERS.has(memberName)) {
- return false;
- }
- }
- }
- return true;
- });
- };
- const REMOVE_STATIC_GETTERS = new Set([
- 'is',
- 'properties',
- 'encapsulation',
- 'elementRef',
- 'events',
- 'listeners',
- 'methods',
- 'states',
- 'originalStyleUrls',
- 'styleMode',
- 'style',
- 'styles',
- 'styleUrl',
- 'watchers',
- 'styleUrls',
- 'contextProps',
- 'connectProps',
- ]);
- const transformHostData = (classElements, moduleFile) => {
- const hasHostData = classElements.some((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'hostData');
- if (hasHostData) {
- const renderIndex = classElements.findIndex((e) => t.isMethodDeclaration(e) && e.name.escapedText === 'render');
- if (renderIndex >= 0) {
- const renderMethod = classElements[renderIndex];
- classElements[renderIndex] = t.updateMethod(renderMethod, renderMethod.decorators, renderMethod.modifiers, renderMethod.asteriskToken, t.createIdentifier(INTERNAL_RENDER), renderMethod.questionToken, renderMethod.typeParameters, renderMethod.parameters, renderMethod.type, renderMethod.body);
- }
- classElements.push(syntheticRender(moduleFile, renderIndex >= 0));
- }
- };
- const syntheticRender = (moduleFile, hasRender) => {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.Host);
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.h);
- const hArguments = [
- // __stencil_Host
- t.createIdentifier(HOST),
- // this.hostData()
- t.createCall(t.createPropertyAccess(t.createThis(), 'hostData'), undefined, undefined),
- ];
- if (hasRender) {
- hArguments.push(
- // this.render()
- t.createCall(t.createPropertyAccess(t.createThis(), INTERNAL_RENDER), undefined, undefined));
- }
- /**
- * render() {
- * return h(arguments);
- * }
- */
- return t.createMethod(undefined, undefined, undefined, 'render', undefined, undefined, undefined, undefined, t.createBlock([t.createReturn(t.createCall(t.createIdentifier(H), undefined, hArguments))]));
- };
- const INTERNAL_RENDER = '__stencil_render';
- const updateComponentClass = (transformOpts, classNode, heritageClauses, members) => {
- let classModifiers = Array.isArray(classNode.modifiers) ? classNode.modifiers.slice() : [];
- if (transformOpts.module === 'cjs') {
- // CommonJS, leave component class as is
- if (transformOpts.componentExport === 'customelement') {
- // remove export from class
- classModifiers = classModifiers.filter((m) => {
- return m.kind !== t.SyntaxKind.ExportKeyword;
- });
- }
- return t.updateClassDeclaration(classNode, classNode.decorators, classModifiers, classNode.name, classNode.typeParameters, heritageClauses, members);
- }
- // ESM with export
- return createConstClass(transformOpts, classNode, heritageClauses, members);
- };
- const createConstClass = (transformOpts, classNode, heritageClauses, members) => {
- const className = classNode.name;
- const classModifiers = (Array.isArray(classNode.modifiers) ? classNode.modifiers : []).filter((m) => {
- // remove the export
- return m.kind !== t.SyntaxKind.ExportKeyword;
- });
- const constModifiers = [];
- if (transformOpts.componentExport !== 'customelement') {
- constModifiers.push(t.createModifier(t.SyntaxKind.ExportKeyword));
- }
- return t.createVariableStatement(constModifiers, t.createVariableDeclarationList([
- t.createVariableDeclaration(className, undefined, t.createClassExpression(classModifiers, undefined, classNode.typeParameters, heritageClauses, members)),
- ], t.NodeFlags.Const));
- };
- const addCreateEvents = (moduleFile, cmp) => {
- return cmp.events.map((ev) => {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.createEvent);
- return t.createStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), t.createIdentifier(ev.method)), t.createCall(t.createIdentifier(CREATE_EVENT), undefined, [
- t.createThis(),
- t.createLiteral(ev.name),
- t.createLiteral(computeFlags(ev)),
- ])));
- });
- };
- const computeFlags = (eventMeta) => {
- let flags = 0;
- if (eventMeta.bubbles) {
- flags |= 4 /* Bubbles */;
- }
- if (eventMeta.composed) {
- flags |= 2 /* Composed */;
- }
- if (eventMeta.cancelable) {
- flags |= 1 /* Cancellable */;
- }
- return flags;
- };
- const addLegacyProps = (moduleFile, cmp) => {
- if (cmp.legacyConnect.length > 0) {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getConnect);
- }
- if (cmp.legacyContext.length > 0) {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getContext);
- }
- return [
- ...cmp.legacyConnect.map((c) => getStatement(c.name, GET_CONNECT, c.connect)),
- ...cmp.legacyContext.map((c) => getStatement(c.name, GET_CONTEXT, c.context)),
- ];
- };
- const getStatement = (propName, method, arg) => {
- return t.createExpressionStatement(t.createAssignment(t.createPropertyAccess(t.createThis(), propName), t.createCall(t.createIdentifier(method), undefined, [t.createThis(), t.createLiteral(arg)])));
- };
- const updateNativeConstructor = (classMembers, moduleFile, cmp, ensureSuper) => {
- if (cmp.isPlain) {
- return;
- }
- const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
- if (cstrMethodIndex >= 0) {
- // add to the existing constructor()
- const cstrMethod = classMembers[cstrMethodIndex];
- let statements = [
- ...nativeInit(moduleFile, cmp),
- ...addCreateEvents(moduleFile, cmp),
- ...cstrMethod.body.statements,
- ...addLegacyProps(moduleFile, cmp),
- ];
- if (ensureSuper) {
- const hasSuper = cstrMethod.body.statements.some((s) => s.kind === t.SyntaxKind.SuperKeyword);
- if (!hasSuper) {
- statements = [createNativeConstructorSuper(), ...statements];
- }
- }
- classMembers[cstrMethodIndex] = t.updateConstructor(cstrMethod, cstrMethod.decorators, cstrMethod.modifiers, cstrMethod.parameters, t.updateBlock(cstrMethod.body, statements));
- }
- else {
- // create a constructor()
- let statements = [
- ...nativeInit(moduleFile, cmp),
- ...addCreateEvents(moduleFile, cmp),
- ...addLegacyProps(moduleFile, cmp),
- ];
- if (ensureSuper) {
- statements = [createNativeConstructorSuper(), ...statements];
- }
- const cstrMethod = t.createConstructor(undefined, undefined, undefined, t.createBlock(statements, true));
- classMembers.unshift(cstrMethod);
- }
- };
- /**
- * Generates a series of expression statements used to help initialize a Stencil component
- * @param moduleFile the Stencil module that will be instantiated
- * @param cmp the component's metadata
- * @returns the generated expression statements
- */
- const nativeInit = (moduleFile, cmp) => {
- const initStatements = [nativeRegisterHostStatement()];
- if (cmp.encapsulation === 'shadow') {
- initStatements.push(nativeAttachShadowStatement(moduleFile));
- }
- return initStatements;
- };
- const nativeRegisterHostStatement = () => {
- return t.createStatement(t.createCall(t.createPropertyAccess(t.createThis(), t.createIdentifier('__registerHost')), undefined, undefined));
- };
- /**
- * Generates an expression statement for attaching a shadow DOM tree to an element.
- * @param moduleFile the Stencil module that will use the generated expression statement
- * @returns the generated expression statement
- */
- const nativeAttachShadowStatement = (moduleFile) => {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.attachShadow);
- // Create an expression statement, `this.__attachShadow();`
- return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createThis(), t.factory.createIdentifier('__attachShadow')), undefined, undefined));
- };
- const createNativeConstructorSuper = () => {
- return t.createExpressionStatement(t.createCall(t.createIdentifier('super'), undefined, undefined));
- };
- const updateNativeComponentClass = (transformOpts, classNode, moduleFile, cmp) => {
- const heritageClauses = updateNativeHostComponentHeritageClauses(classNode, moduleFile);
- const members = updateNativeHostComponentMembers(transformOpts, classNode, moduleFile, cmp);
- return updateComponentClass(transformOpts, classNode, heritageClauses, members);
- };
- const updateNativeHostComponentHeritageClauses = (classNode, moduleFile) => {
- if (classNode.heritageClauses != null && classNode.heritageClauses.length > 0) {
- return classNode.heritageClauses;
- }
- if (moduleFile.cmps.length >= 1) {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.HTMLElement);
- }
- const heritageClause = t.factory.createHeritageClause(t.SyntaxKind.ExtendsKeyword, [
- t.factory.createExpressionWithTypeArguments(t.factory.createIdentifier(HTML_ELEMENT), []),
- ]);
- return [heritageClause];
- };
- const updateNativeHostComponentMembers = (transformOpts, classNode, moduleFile, cmp) => {
- const classMembers = removeStaticMetaProperties(classNode);
- updateNativeConstructor(classMembers, moduleFile, cmp, true);
- addNativeConnectedCallback(classMembers, cmp);
- addNativeElementGetter(classMembers, cmp);
- addWatchers(classMembers, cmp);
- if (cmp.isPlain) {
- addNativeComponentMeta(classMembers, cmp);
- }
- if (transformOpts.style === 'static') {
- addNativeStaticStyle(classMembers, cmp);
- }
- transformHostData(classMembers, moduleFile);
- return classMembers;
- };
- const updateStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
- // add style imports built from @Component() styleUrl option
- if (transformOpts.module === 'cjs') {
- return updateCjsStyleRequires(transformOpts, tsSourceFile, moduleFile);
- }
- return updateEsmStyleImports(transformOpts, tsSourceFile, moduleFile);
- };
- const updateEsmStyleImports = (transformOpts, tsSourceFile, moduleFile) => {
- const styleImports = [];
- let statements = tsSourceFile.statements.slice();
- let updateSourceFile = false;
- moduleFile.cmps.forEach((cmp) => {
- cmp.styles.forEach((style) => {
- if (typeof style.styleIdentifier === 'string') {
- updateSourceFile = true;
- if (style.externalStyles.length > 0) {
- // add style imports built from @Component() styleUrl option
- styleImports.push(createEsmStyleImport(transformOpts, tsSourceFile, cmp, style));
- }
- else {
- // update existing esm import of a style identifier
- statements = updateEsmStyleImportPath(transformOpts, tsSourceFile, statements, cmp, style);
- }
- }
- });
- });
- if (updateSourceFile) {
- let lastImportIndex = -1;
- for (let i = 0; i < statements.length; i++) {
- if (t.isImportDeclaration(statements[i])) {
- lastImportIndex = i;
- }
- }
- statements.splice(lastImportIndex + 1, 0, ...styleImports);
- return t.updateSourceFileNode(tsSourceFile, statements);
- }
- return tsSourceFile;
- };
- const updateEsmStyleImportPath = (transformOpts, tsSourceFile, statements, cmp, style) => {
- for (let i = 0; i < statements.length; i++) {
- const n = statements[i];
- if (t.isImportDeclaration(n) && n.importClause && n.moduleSpecifier && t.isStringLiteral(n.moduleSpecifier)) {
- if (n.importClause.name && n.importClause.name.escapedText === style.styleIdentifier) {
- const orgImportPath = n.moduleSpecifier.text;
- const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, orgImportPath);
- statements[i] = t.factory.updateImportDeclaration(n, n.decorators, n.modifiers, n.importClause, t.factory.createStringLiteral(importPath), undefined);
- break;
- }
- }
- }
- return statements;
- };
- const createEsmStyleImport = (transformOpts, tsSourceFile, cmp, style) => {
- const importName = t.createIdentifier(style.styleIdentifier);
- const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
- return t.createImportDeclaration(undefined, undefined, t.createImportClause(importName, undefined), t.createLiteral(importPath));
- };
- const updateCjsStyleRequires = (transformOpts, tsSourceFile, moduleFile) => {
- const styleRequires = [];
- moduleFile.cmps.forEach((cmp) => {
- cmp.styles.forEach((style) => {
- if (typeof style.styleIdentifier === 'string' && style.externalStyles.length > 0) {
- // add style imports built from @Component() styleUrl option
- styleRequires.push(createCjsStyleRequire(transformOpts, tsSourceFile, cmp, style));
- }
- });
- });
- if (styleRequires.length > 0) {
- return t.updateSourceFileNode(tsSourceFile, [...styleRequires, ...tsSourceFile.statements]);
- }
- return tsSourceFile;
- };
- const createCjsStyleRequire = (transformOpts, tsSourceFile, cmp, style) => {
- const importName = t.createIdentifier(style.styleIdentifier);
- const importPath = getStyleImportPath(transformOpts, tsSourceFile, cmp, style, style.externalStyles[0].absolutePath);
- return t.createVariableStatement(undefined, t.createVariableDeclarationList([
- t.createVariableDeclaration(importName, undefined, t.createCall(t.createIdentifier('require'), [], [t.createLiteral(importPath)])),
- ], t.NodeFlags.Const));
- };
- const getStyleImportPath = (transformOpts, tsSourceFile, cmp, style, importPath) => {
- const importData = {
- importeePath: importPath,
- importerPath: tsSourceFile.fileName,
- tag: cmp.tagName,
- encapsulation: cmp.encapsulation,
- mode: style.modeName,
- };
- return serializeImportPath(importData, transformOpts.styleImportData);
- };
- const nativeComponentTransform = (compilerCtx, transformOpts) => {
- return (transformCtx) => {
- return (tsSourceFile) => {
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- const visitNode = (node) => {
- if (t.isClassDeclaration(node)) {
- const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
- if (cmp != null) {
- return updateNativeComponentClass(transformOpts, node, moduleFile, cmp);
- }
- }
- return t.visitEachChild(node, visitNode, transformCtx);
- };
- tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
- if (moduleFile.cmps.length > 0) {
- if (transformOpts.componentExport === 'customelement') {
- // define custom element, will have no export
- tsSourceFile = defineCustomElement(tsSourceFile, moduleFile, transformOpts);
- }
- else if (transformOpts.proxy === 'defineproperty') {
- // exporting as a module, but also add the component proxy fn
- tsSourceFile = addModuleMetadataProxies(tsSourceFile, moduleFile);
- }
- tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
- }
- if (moduleFile.isLegacy) {
- addLegacyApis(moduleFile);
- }
- tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
- return tsSourceFile;
- };
- };
- };
- /**
- * Import and define components along with any component dependents within the `dist-custom-elements` output.
- * Adds `defineCustomElement()` function for all components.
- * @param compilerCtx - current compiler context
- * @param components - all current components within the stencil buildCtx
- * @param outputTarget - the output target being compiled
- * @returns a TS AST transformer factory function
- */
- const addDefineCustomElementFunctions = (compilerCtx, components, outputTarget) => {
- return () => {
- return (tsSourceFile) => {
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- const newStatements = [];
- const caseStatements = [];
- const tagNames = [];
- if (moduleFile.cmps.length) {
- const principalComponent = moduleFile.cmps[0];
- tagNames.push(principalComponent.tagName);
- // define the current component - `customElements.define(tagName, MyProxiedComponent);`
- const customElementsDefineCallExpression = t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'define'), undefined, [t.factory.createIdentifier('tagName'), t.factory.createIdentifier(principalComponent.componentClassName)]);
- // create a `case` block that defines the current component. We'll add them to our switch statement later.
- caseStatements.push(createCustomElementsDefineCase(principalComponent.tagName, customElementsDefineCallExpression));
- setupComponentDependencies(moduleFile, components, newStatements, caseStatements, tagNames);
- addDefineCustomElementFunction(tagNames, newStatements, caseStatements);
- if (outputTarget.autoDefineCustomElements) {
- const conditionalDefineCustomElementCall = createAutoDefinitionExpression(principalComponent.componentClassName);
- newStatements.push(conditionalDefineCustomElementCall);
- }
- }
- tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [...tsSourceFile.statements, ...newStatements]);
- return tsSourceFile;
- };
- };
- };
- /**
- * Adds dependent component import statements and sets up and case blocks
- * @param moduleFile current components' module
- * @param components all current components within the stencil buildCtx
- * @param newStatements new top level statement array to add to that will get added to the AST
- * @param caseStatements an array of case statement blocks to add to. Will get added to `defineCustomElement` later
- * @param tagNames array of all related component tag-names to add to
- */
- const setupComponentDependencies = (moduleFile, components, newStatements, caseStatements, tagNames) => {
- moduleFile.cmps.forEach((cmp) => {
- cmp.dependencies.forEach((dCmp) => {
- const foundDep = components.find((dComp) => dComp.tagName === dCmp);
- const exportName = dashToPascalCase$1(foundDep.tagName);
- const importAs = `$${exportName}DefineCustomElement`;
- tagNames.push(foundDep.tagName);
- // Will add `import { defineCustomElement as $ComponentDefineCustomElement } from 'my-nested-component.tsx';`
- newStatements.push(createImportStatement([`defineCustomElement as ${importAs}`], foundDep.sourceFilePath));
- // define a dependent component by recursively calling their own `defineCustomElement()`
- const callExpression = t.factory.createCallExpression(t.factory.createIdentifier(importAs), undefined, []);
- // `case` blocks that define the dependent components. We'll add them to our switch statement later.
- caseStatements.push(createCustomElementsDefineCase(foundDep.tagName, callExpression));
- });
- });
- };
- /**
- * Creates a case block which will be used to define components. e.g.
- * ``` javascript
- * case "my-component":
- * if (!customElements.get(tagName)) {
- * customElements.define(tagName, MyProxiedComponent);
- * // OR for dependent components
- * defineCustomElement(tagName);
- * }
- * break;
- * } });
- ```
- * @param tagName the components' tagName saved within stencil.
- * @param actionExpression the actual expression to call to define the customElement
- * @returns ts AST CaseClause
- */
- const createCustomElementsDefineCase = (tagName, actionExpression) => {
- return t.factory.createCaseClause(t.factory.createStringLiteral(tagName), [
- t.factory.createIfStatement(t.factory.createPrefixUnaryExpression(t.SyntaxKind.ExclamationToken, t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('customElements'), 'get'), undefined, [t.factory.createIdentifier('tagName')])), t.factory.createBlock([t.factory.createExpressionStatement(actionExpression)])),
- t.factory.createBreakStatement(),
- ]);
- };
- /**
- * Add the main `defineCustomElement` function e.g.
- * ```javascript
- * function defineCustomElement() {
- * if (typeof customElements === 'undefined') {
- * return;
- * }
- * const components = ['my-component'];
- * components.forEach(tagName => {
- * switch (tagName) {
- * case "my-component":
- * if (!customElements.get(tagName)) {
- * customElements.define(tagName, MyProxiedComponent);
- * // OR for dependent components
- * defineCustomElement(tagName);
- * }
- * break;
- * }
- * });
- * }
- ```
- * @param tagNames all components that will be defined
- * @param newStatements new top level statement array that will get added to the AST
- * @param caseStatements an array of case statement blocks. Will get added to `defineCustomElement` later
- */
- const addDefineCustomElementFunction = (tagNames, newStatements, caseStatements) => {
- const newExpression = t.factory.createFunctionDeclaration(undefined, [t.factory.createModifier(t.SyntaxKind.ExportKeyword)], undefined, t.factory.createIdentifier('defineCustomElement'), undefined, undefined, undefined, t.factory.createBlock([
- t.factory.createIfStatement(t.factory.createStrictEquality(t.factory.createTypeOfExpression(t.factory.createIdentifier('customElements')), t.factory.createStringLiteral('undefined')), t.factory.createBlock([t.factory.createReturnStatement()])),
- t.factory.createVariableStatement(undefined, t.factory.createVariableDeclarationList([
- t.factory.createVariableDeclaration('components', undefined, undefined, t.factory.createArrayLiteralExpression(tagNames.map((tagName) => t.factory.createStringLiteral(tagName)))),
- ], t.NodeFlags.Const)),
- t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createPropertyAccessExpression(t.factory.createIdentifier('components'), 'forEach'), undefined, [
- t.factory.createArrowFunction(undefined, undefined, [
- t.factory.createParameterDeclaration(undefined, undefined, undefined, t.factory.createIdentifier('tagName'), undefined, undefined),
- ], undefined, t.factory.createToken(t.SyntaxKind.EqualsGreaterThanToken), t.factory.createBlock([
- t.factory.createSwitchStatement(t.factory.createIdentifier('tagName'), t.factory.createCaseBlock(caseStatements)),
- ])),
- ])),
- ], true));
- newStatements.push(newExpression);
- };
- /**
- * Create a call to `defineCustomElement` for the principle web component.
- * ```typescript
- * defineCustomElement(MyPrincipalComponent);
- * ```
- * @returns the expression statement described above
- */
- function createAutoDefinitionExpression(componentName) {
- return t.factory.createExpressionStatement(t.factory.createCallExpression(t.factory.createIdentifier('defineCustomElement'), undefined, [
- t.factory.createIdentifier(componentName),
- ]));
- }
- /**
- * Proxy custom elements for the `dist-custom-elements` output target. This function searches for a Stencil component's
- * class initializer (found on the righthand side of the '=' operator):
- *
- * ```ts
- * const MyComponent = class extends HTMLElement { // Implementation omitted }
- * ```
- *
- * and wraps the initializer into a `proxyCustomElement` call:
- *
- * ```ts
- * const MyComponent = proxyCustomElement(class extends HTMLElement { // Implementation omitted }, componentMetadata);
- * ```
- *
- * This is to work around an issue where treeshaking does not work for webpack users, whose details are captured in full
- * in [this issue on the webpack GitHub repo](https://github.com/webpack/webpack/issues/14963).
- *
- * @param compilerCtx current compiler context
- * @param transformOpts transpilation options for the current build
- * @returns a TypeScript AST transformer factory function that performs the above described transformation
- */
- const proxyCustomElement = (compilerCtx, transformOpts) => {
- return () => {
- return (tsSourceFile) => {
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- if (!moduleFile.cmps.length) {
- return tsSourceFile;
- }
- const principalComponent = moduleFile.cmps[0];
- for (let [stmtIndex, stmt] of tsSourceFile.statements.entries()) {
- if (t.isVariableStatement(stmt)) {
- for (let [declarationIndex, declaration] of stmt.declarationList.declarations.entries()) {
- if (declaration.name.getText() !== principalComponent.componentClassName) {
- continue;
- }
- // wrap the Stencil component's class declaration in a component proxy
- const proxyCreationCall = createAnonymousClassMetadataProxy(principalComponent, declaration.initializer);
- t.addSyntheticLeadingComment(proxyCreationCall, t.SyntaxKind.MultiLineCommentTrivia, '@__PURE__', false);
- // update the component's variable declaration to use the new initializer
- const proxiedComponentDeclaration = t.factory.updateVariableDeclaration(declaration, declaration.name, declaration.exclamationToken, declaration.type, proxyCreationCall);
- // update the declaration list that contains the updated variable declaration
- const updatedDeclarationList = t.factory.updateVariableDeclarationList(stmt.declarationList, [
- ...stmt.declarationList.declarations.slice(0, declarationIndex),
- proxiedComponentDeclaration,
- ...stmt.declarationList.declarations.slice(declarationIndex + 1),
- ]);
- // update the variable statement containing the updated declaration list
- const updatedVariableStatement = t.factory.updateVariableStatement(stmt, [t.factory.createModifier(t.SyntaxKind.ExportKeyword)], updatedDeclarationList);
- // update the source file's statements to use the new variable statement
- tsSourceFile = t.factory.updateSourceFile(tsSourceFile, [
- ...tsSourceFile.statements.slice(0, stmtIndex),
- updatedVariableStatement,
- ...tsSourceFile.statements.slice(stmtIndex + 1),
- ]);
- // finally, ensure that the proxyCustomElement function is imported
- tsSourceFile = addImports(transformOpts, tsSourceFile, [RUNTIME_APIS.proxyCustomElement], transformOpts.coreImportPath);
- return tsSourceFile;
- }
- }
- }
- return tsSourceFile;
- };
- };
- };
- const updateStencilCoreImports = (updatedCoreImportPath) => {
- return () => {
- return (tsSourceFile) => {
- if (STENCIL_CORE_ID === updatedCoreImportPath) {
- return tsSourceFile;
- }
- let madeChanges = false;
- const newStatements = [];
- tsSourceFile.statements.forEach((s) => {
- if (t.isImportDeclaration(s)) {
- if (s.moduleSpecifier != null && t.isStringLiteral(s.moduleSpecifier)) {
- if (s.moduleSpecifier.text === STENCIL_CORE_ID) {
- if (s.importClause &&
- s.importClause.namedBindings &&
- s.importClause.namedBindings.kind === t.SyntaxKind.NamedImports) {
- const origImports = s.importClause.namedBindings.elements;
- const keepImports = origImports.map((e) => e.getText()).filter((name) => KEEP_IMPORTS.has(name));
- if (keepImports.length > 0) {
- const newImport = t.factory.updateImportDeclaration(s, undefined, undefined, t.factory.createImportClause(false, undefined, t.factory.createNamedImports(keepImports.map((name) => t.factory.createImportSpecifier(false, undefined, t.factory.createIdentifier(name))))), t.factory.createStringLiteral(updatedCoreImportPath), undefined);
- newStatements.push(newImport);
- }
- }
- madeChanges = true;
- return;
- }
- }
- }
- newStatements.push(s);
- });
- if (madeChanges) {
- return t.updateSourceFileNode(tsSourceFile, newStatements, tsSourceFile.isDeclarationFile, tsSourceFile.referencedFiles, tsSourceFile.typeReferenceDirectives, tsSourceFile.hasNoDefaultLib, tsSourceFile.libReferenceDirectives);
- }
- return tsSourceFile;
- };
- };
- };
- const KEEP_IMPORTS = new Set([
- 'h',
- 'setMode',
- 'getMode',
- 'setPlatformHelpers',
- 'Build',
- 'Env',
- 'Host',
- 'Fragment',
- 'getAssetPath',
- 'writeTask',
- 'readTask',
- 'getElement',
- 'forceUpdate',
- 'getRenderingRef',
- 'forceModeUpdate',
- 'setErrorHandler',
- ]);
- const outputCustomElements = async (config, compilerCtx, buildCtx) => {
- if (!config.buildDist) {
- return;
- }
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
- if (outputTargets.length === 0) {
- return;
- }
- const bundlingEventMessage = 'generate custom elements';
- const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
- await Promise.all(outputTargets.map((o) => bundleCustomElements$1(config, compilerCtx, buildCtx, o)));
- timespan.finish(`${bundlingEventMessage} finished`);
- };
- const bundleCustomElements$1 = async (config, compilerCtx, buildCtx, outputTarget) => {
- try {
- const bundleOpts = {
- id: 'customElements',
- platform: 'client',
- conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
- customTransformers: getCustomElementCustomTransformer(config, compilerCtx, buildCtx.components, outputTarget),
- externalRuntime: !!outputTarget.externalRuntime,
- inlineWorkers: true,
- inputs: {
- index: '\0core',
- },
- loader: {
- '\0core': generateEntryPoint$1(outputTarget),
- },
- inlineDynamicImports: outputTarget.inlineDynamicImports,
- preserveEntrySignatures: 'allow-extension',
- };
- addCustomElementInputs(buildCtx, bundleOpts);
- const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
- if (build) {
- const rollupOutput = await build.generate({
- banner: generatePreamble(config),
- format: 'esm',
- sourcemap: config.sourceMap,
- chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
- entryFileNames: '[name].js',
- hoistTransitiveImports: false,
- preferConst: true,
- });
- const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
- const files = rollupOutput.output.map(async (bundle) => {
- if (bundle.type === 'chunk') {
- let code = bundle.code;
- let sourceMap = rollupToStencilSourceMap(bundle.map);
- const optimizeResults = await optimizeModule(config, compilerCtx, {
- input: code,
- isCore: bundle.isEntry,
- minify,
- sourceMap,
- });
- buildCtx.diagnostics.push(...optimizeResults.diagnostics);
- if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
- code = optimizeResults.output;
- sourceMap = optimizeResults.sourceMap;
- }
- if (sourceMap) {
- code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
- await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
- outputTargetType: outputTarget.type,
- });
- }
- await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName), code, {
- outputTargetType: outputTarget.type,
- });
- }
- });
- await Promise.all(files);
- }
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- };
- /**
- * Create the virtual modules/input modules for the `dist-custom-elements` output target.
- * @param buildCtx the context for the current build
- * @param bundleOpts the bundle options to store the virtual modules under. acts as an output parameter
- */
- const addCustomElementInputs = (buildCtx, bundleOpts) => {
- const components = buildCtx.components;
- components.forEach((cmp) => {
- const exp = [];
- const exportName = dashToPascalCase$1(cmp.tagName);
- const importName = cmp.componentClassName;
- const importAs = `$Cmp${exportName}`;
- const coreKey = `\0${exportName}`;
- if (cmp.isPlain) {
- exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
- }
- else {
- // the `importName` may collide with the `exportName`, alias it just in case it does with `importAs`
- exp.push(`import { ${importName} as ${importAs}, defineCustomElement as cmpDefCustomEle } from '${cmp.sourceFilePath}';`);
- exp.push(`export const ${exportName} = ${importAs};`);
- exp.push(`export const defineCustomElement = cmpDefCustomEle;`);
- }
- bundleOpts.inputs[cmp.tagName] = coreKey;
- bundleOpts.loader[coreKey] = exp.join('\n');
- });
- };
- /**
- * Generate the entrypoint (`index.ts` file) contents for the `dist-custom-elements` output target
- * @param outputTarget the output target's configuration
- * @returns the stringified contents to be placed in the entrypoint
- */
- const generateEntryPoint$1 = (outputTarget) => {
- const imp = [];
- imp.push(`export { setAssetPath, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
- if (outputTarget.includeGlobalScripts !== false) {
- imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
- }
- return imp.join('\n') + '\n';
- };
- /**
- * Get the series of custom transformers that will be applied to a Stencil project's source code during the TypeScript
- * transpilation process
- * @param config the configuration for the Stencil project
- * @param compilerCtx the current compiler context
- * @param components the components that will be compiled as a part of the current build
- * @param outputTarget the output target configuration
- * @returns a list of transformers to use in the transpilation process
- */
- const getCustomElementCustomTransformer = (config, compilerCtx, components, outputTarget) => {
- const transformOpts = {
- coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
- componentExport: null,
- componentMetadata: null,
- currentDirectory: config.sys.getCurrentDirectory(),
- proxy: null,
- style: 'static',
- styleImportData: 'queryparams',
- };
- return [
- addDefineCustomElementFunctions(compilerCtx, components, outputTarget),
- updateStencilCoreImports(transformOpts.coreImportPath),
- nativeComponentTransform(compilerCtx, transformOpts),
- proxyCustomElement(compilerCtx, transformOpts),
- removeCollectionImports(compilerCtx),
- ];
- };
- const outputCustomElementsBundle = async (config, compilerCtx, buildCtx) => {
- if (!config.buildDist) {
- return;
- }
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
- if (outputTargets.length === 0) {
- return;
- }
- const bundlingEventMessage = `generate custom elements bundle${config.sourceMap ? ' + source maps' : ''}`;
- const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`);
- await Promise.all(outputTargets.map((o) => bundleCustomElements(config, compilerCtx, buildCtx, o)));
- timespan.finish(`${bundlingEventMessage} finished`);
- };
- const bundleCustomElements = async (config, compilerCtx, buildCtx, outputTarget) => {
- try {
- const bundleOpts = {
- id: 'customElementsBundle',
- platform: 'client',
- conditionals: getCustomElementsBuildConditionals(config, buildCtx.components),
- customTransformers: getCustomElementBundleCustomTransformer(config, compilerCtx),
- externalRuntime: !!outputTarget.externalRuntime,
- inlineWorkers: true,
- inputs: {
- index: '\0core',
- },
- loader: {
- '\0core': generateEntryPoint(outputTarget, buildCtx),
- },
- inlineDynamicImports: outputTarget.inlineDynamicImports,
- preserveEntrySignatures: 'allow-extension',
- };
- const build = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
- if (build) {
- const rollupOutput = await build.generate({
- banner: generatePreamble(config),
- format: 'esm',
- sourcemap: config.sourceMap,
- chunkFileNames: outputTarget.externalRuntime || !config.hashFileNames ? '[name].js' : 'p-[hash].js',
- entryFileNames: '[name].js',
- hoistTransitiveImports: false,
- preferConst: true,
- });
- const minify = outputTarget.externalRuntime || outputTarget.minify !== true ? false : config.minifyJs;
- const files = rollupOutput.output.map(async (bundle) => {
- if (bundle.type === 'chunk') {
- let code = bundle.code;
- let sourceMap = rollupToStencilSourceMap(bundle.map);
- const optimizeResults = await optimizeModule(config, compilerCtx, {
- input: code,
- isCore: bundle.isEntry,
- minify,
- sourceMap,
- });
- buildCtx.diagnostics.push(...optimizeResults.diagnostics);
- if (!hasError(optimizeResults.diagnostics) && typeof optimizeResults.output === 'string') {
- code = optimizeResults.output;
- sourceMap = optimizeResults.sourceMap;
- }
- if (sourceMap) {
- code = code + getSourceMappingUrlForEndOfFile(bundle.fileName);
- await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName + '.map'), JSON.stringify(sourceMap), {
- outputTargetType: outputTarget.type,
- });
- }
- await compilerCtx.fs.writeFile(join(outputTarget.dir, bundle.fileName), code, {
- outputTargetType: outputTarget.type,
- });
- }
- });
- await Promise.all(files);
- }
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- };
- const generateEntryPoint = (outputTarget, buildCtx) => {
- const imp = [];
- const exp = [];
- const exportNames = [];
- imp.push(`import { proxyCustomElement } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export { setAssetPath, setPlatformOptions } from '${STENCIL_INTERNAL_CLIENT_ID}';`, `export * from '${USER_INDEX_ENTRY_ID}';`);
- if (outputTarget.includeGlobalScripts !== false) {
- imp.push(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';`, `globalScripts();`);
- }
- buildCtx.components.forEach((cmp) => {
- const exportName = dashToPascalCase$1(cmp.tagName);
- const importName = cmp.componentClassName;
- const importAs = `$Cmp${exportName}`;
- if (cmp.isPlain) {
- exp.push(`export { ${importName} as ${exportName} } from '${cmp.sourceFilePath}';`);
- }
- else {
- const meta = stringifyRuntimeData(formatComponentRuntimeMeta(cmp, false));
- imp.push(`import { ${importName} as ${importAs} } from '${cmp.sourceFilePath}';`);
- exp.push(`export const ${exportName} = /*@__PURE__*/proxyCustomElement(${importAs}, ${meta});`);
- }
- exportNames.push(exportName);
- });
- exp.push(`export const defineCustomElements = (opts) => {`);
- exp.push(` if (typeof customElements !== 'undefined') {`);
- exp.push(` [`);
- exp.push(` ${exportNames.join(',\n ')}`);
- exp.push(` ].forEach(cmp => {`);
- exp.push(` if (!customElements.get(cmp.is)) {`);
- exp.push(` customElements.define(cmp.is, cmp, opts);`);
- exp.push(` }`);
- exp.push(` });`);
- exp.push(` }`);
- exp.push(`};`);
- return [...imp, ...exp].join('\n') + '\n';
- };
- const getCustomElementBundleCustomTransformer = (config, compilerCtx) => {
- const transformOpts = {
- coreImportPath: STENCIL_INTERNAL_CLIENT_ID,
- componentExport: null,
- componentMetadata: null,
- currentDirectory: config.sys.getCurrentDirectory(),
- proxy: null,
- style: 'static',
- styleImportData: 'queryparams',
- };
- return [
- updateStencilCoreImports(transformOpts.coreImportPath),
- nativeComponentTransform(compilerCtx, transformOpts),
- removeCollectionImports(compilerCtx),
- ];
- };
- const AUTO_GENERATE_COMMENT = `<!-- Auto Generated Below -->`;
- const NOTE = `*Built with [StencilJS](https://stenciljs.com/)*`;
- const generateDocData = async (config, compilerCtx, buildCtx) => {
- return {
- timestamp: getBuildTimestamp(),
- compiler: {
- name: '@stencil/core',
- version: version$3,
- typescriptVersion,
- },
- components: await getDocsComponents(config, compilerCtx, buildCtx),
- };
- };
- const getDocsComponents = async (config, compilerCtx, buildCtx) => {
- const results = await Promise.all(buildCtx.moduleFiles.map(async (moduleFile) => {
- const filePath = moduleFile.sourceFilePath;
- const dirPath = normalizePath$1(dirname(filePath));
- const readmePath = normalizePath$1(join(dirPath, 'readme.md'));
- const usagesDir = normalizePath$1(join(dirPath, 'usage'));
- const readme = await getUserReadmeContent(compilerCtx, readmePath);
- const usage = await generateUsages(compilerCtx, usagesDir);
- return moduleFile.cmps
- .filter((cmp) => !cmp.internal && !cmp.isCollectionDependency)
- .map((cmp) => ({
- dirPath,
- filePath: relative$1(config.rootDir, filePath),
- fileName: basename(filePath),
- readmePath,
- usagesDir,
- tag: cmp.tagName,
- readme,
- usage,
- docs: generateDocs(readme, cmp.docs),
- docsTags: cmp.docs.tags,
- encapsulation: getDocsEncapsulation(cmp),
- dependents: cmp.directDependents,
- dependencies: cmp.directDependencies,
- dependencyGraph: buildDocsDepGraph(cmp, buildCtx.components),
- deprecation: getDocsDeprecationText(cmp.docs.tags),
- props: getDocsProperties(cmp),
- methods: getDocsMethods(cmp.methods),
- events: getDocsEvents(cmp.events),
- styles: getDocsStyles(cmp),
- slots: getDocsSlots(cmp.docs.tags),
- parts: getDocsParts(cmp.htmlParts, cmp.docs.tags),
- listeners: getDocsListeners(cmp.listeners),
- }));
- }));
- return sortBy(flatOne(results), (cmp) => cmp.tag);
- };
- const buildDocsDepGraph = (cmp, cmps) => {
- const dependencies = {};
- function walk(tagName) {
- if (!dependencies[tagName]) {
- const cmp = cmps.find((c) => c.tagName === tagName);
- const deps = cmp.directDependencies;
- if (deps.length > 0) {
- dependencies[tagName] = deps;
- deps.forEach(walk);
- }
- }
- }
- walk(cmp.tagName);
- // load dependents
- cmp.directDependents.forEach((tagName) => {
- if (dependencies[tagName] && !dependencies[tagName].includes(cmp.tagName)) {
- dependencies[tagName].push(cmp.tagName);
- }
- else {
- dependencies[tagName] = [cmp.tagName];
- }
- });
- return dependencies;
- };
- const getDocsEncapsulation = (cmp) => {
- if (cmp.encapsulation === 'shadow') {
- return 'shadow';
- }
- else if (cmp.encapsulation === 'scoped') {
- return 'scoped';
- }
- else {
- return 'none';
- }
- };
- const getDocsProperties = (cmpMeta) => {
- return sortBy([...getRealProperties(cmpMeta.properties), ...getVirtualProperties(cmpMeta.virtualProperties)], (p) => p.name);
- };
- const getRealProperties = (properties) => {
- return properties
- .filter((member) => !member.internal)
- .map((member) => ({
- name: member.name,
- type: member.complexType.resolved,
- mutable: member.mutable,
- attr: member.attribute,
- reflectToAttr: !!member.reflect,
- docs: member.docs.text,
- docsTags: member.docs.tags,
- default: member.defaultValue,
- deprecation: getDocsDeprecationText(member.docs.tags),
- values: parseTypeIntoValues(member.complexType.resolved),
- optional: member.optional,
- required: member.required,
- }));
- };
- const getVirtualProperties = (virtualProps) => {
- return virtualProps.map((member) => ({
- name: member.name,
- type: member.type,
- mutable: false,
- attr: member.name,
- reflectToAttr: false,
- docs: member.docs,
- docsTags: [],
- default: undefined,
- deprecation: undefined,
- values: parseTypeIntoValues(member.type),
- optional: true,
- required: false,
- }));
- };
- const parseTypeIntoValues = (type) => {
- if (typeof type === 'string') {
- const unions = type.split('|').map((u) => u.trim());
- const parsedUnions = [];
- unions.forEach((u) => {
- if (u === 'true') {
- parsedUnions.push({
- value: 'true',
- type: 'boolean',
- });
- return;
- }
- if (u === 'false') {
- parsedUnions.push({
- value: 'false',
- type: 'boolean',
- });
- return;
- }
- if (!Number.isNaN(parseFloat(u))) {
- // union is a number
- parsedUnions.push({
- value: u,
- type: 'number',
- });
- return;
- }
- if (/^("|').+("|')$/gm.test(u)) {
- // ionic is a string
- parsedUnions.push({
- value: u.slice(1, -1),
- type: 'string',
- });
- return;
- }
- parsedUnions.push({
- type: u,
- });
- });
- return parsedUnions;
- }
- return [];
- };
- const getDocsMethods = (methods) => {
- return sortBy(methods, (member) => member.name)
- .filter((member) => !member.internal)
- .map((member) => ({
- name: member.name,
- returns: {
- type: member.complexType.return,
- docs: member.docs.tags
- .filter((t) => t.name === 'return' || t.name === 'returns')
- .map((t) => t.text)
- .join('\n'),
- },
- signature: `${member.name}${member.complexType.signature}`,
- parameters: [],
- docs: member.docs.text,
- docsTags: member.docs.tags,
- deprecation: getDocsDeprecationText(member.docs.tags),
- }));
- };
- const getDocsEvents = (events) => {
- return sortBy(events, (eventMeta) => eventMeta.name.toLowerCase())
- .filter((eventMeta) => !eventMeta.internal)
- .map((eventMeta) => ({
- event: eventMeta.name,
- detail: eventMeta.complexType.resolved,
- bubbles: eventMeta.bubbles,
- cancelable: eventMeta.cancelable,
- composed: eventMeta.composed,
- docs: eventMeta.docs.text,
- docsTags: eventMeta.docs.tags,
- deprecation: getDocsDeprecationText(eventMeta.docs.tags),
- }));
- };
- const getDocsStyles = (cmpMeta) => {
- if (!cmpMeta.styleDocs) {
- return [];
- }
- return sortBy(cmpMeta.styleDocs, (o) => o.name.toLowerCase()).map((styleDoc) => {
- return {
- name: styleDoc.name,
- annotation: styleDoc.annotation || '',
- docs: styleDoc.docs || '',
- };
- });
- };
- const getDocsListeners = (listeners) => {
- return listeners.map((listener) => ({
- event: listener.name,
- target: listener.target,
- capture: listener.capture,
- passive: listener.passive,
- }));
- };
- const getDocsDeprecationText = (tags) => {
- const deprecation = tags.find((t) => t.name === 'deprecated');
- if (deprecation) {
- return deprecation.text || '';
- }
- return undefined;
- };
- const getDocsSlots = (tags) => {
- return sortBy(getNameText('slot', tags).map(([name, docs]) => ({ name, docs })), (a) => a.name);
- };
- const getDocsParts = (vdom, tags) => {
- const docsParts = getNameText('part', tags).map(([name, docs]) => ({ name, docs }));
- const vdomParts = vdom.map((name) => ({ name, docs: '' }));
- return sortBy(unique([...docsParts, ...vdomParts], (p) => p.name), (p) => p.name);
- };
- const getNameText = (name, tags) => {
- return tags
- .filter((tag) => tag.name === name && tag.text)
- .map(({ text }) => {
- const [namePart, ...rest] = (' ' + text).split(' - ');
- return [namePart.trim(), rest.join(' - ').trim()];
- });
- };
- const getUserReadmeContent = async (compilerCtx, readmePath) => {
- try {
- const existingContent = await compilerCtx.fs.readFile(readmePath);
- const userContentIndex = existingContent.indexOf(AUTO_GENERATE_COMMENT) - 1;
- if (userContentIndex >= 0) {
- return existingContent.substring(0, userContentIndex);
- }
- }
- catch (e) { }
- return undefined;
- };
- const generateDocs = (readme, jsdoc) => {
- const docs = jsdoc.text;
- if (docs !== '' || !readme) {
- return docs;
- }
- let isContent = false;
- const lines = readme.split('\n');
- const contentLines = [];
- for (const line of lines) {
- const isHeader = line.startsWith('#');
- if (isHeader && isContent) {
- break;
- }
- if (!isHeader && !isContent) {
- isContent = true;
- }
- if (isContent) {
- contentLines.push(line);
- }
- }
- return contentLines.join('\n').trim();
- };
- const generateUsages = async (compilerCtx, usagesDir) => {
- const rtn = {};
- try {
- const usageFilePaths = await compilerCtx.fs.readdir(usagesDir);
- const usages = {};
- await Promise.all(usageFilePaths.map(async (f) => {
- if (!f.isFile) {
- return;
- }
- const fileName = basename(f.relPath);
- if (!fileName.toLowerCase().endsWith('.md')) {
- return;
- }
- const parts = fileName.split('.');
- parts.pop();
- const key = parts.join('.');
- usages[key] = await compilerCtx.fs.readFile(f.absPath);
- }));
- Object.keys(usages)
- .sort()
- .forEach((key) => {
- rtn[key] = usages[key];
- });
- }
- catch (e) { }
- return rtn;
- };
- const generateCustomDocs = async (config, docsData, outputTargets) => {
- const customOutputTargets = outputTargets.filter(isOutputTargetDocsCustom);
- if (customOutputTargets.length === 0) {
- return;
- }
- await Promise.all(customOutputTargets.map(async (customOutput) => {
- try {
- await customOutput.generator(docsData, config);
- }
- catch (e) {
- config.logger.error(`uncaught custom docs error: ${e}`);
- }
- }));
- };
- const generateJsonDocs = async (config, compilerCtx, docsData, outputTargets) => {
- const jsonOutputTargets = outputTargets.filter(isOutputTargetDocsJson);
- if (jsonOutputTargets.length === 0) {
- return;
- }
- const docsDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'stencil-public-docs.d.ts');
- const docsDts = await compilerCtx.fs.readFile(docsDtsPath);
- const typesContent = `
- /**
- * This is an autogenerated file created by the Stencil compiler.
- * DO NOT MODIFY IT MANUALLY
- */
- ${docsDts}
- declare const _default: JsonDocs;
- export default _default;
- `;
- const json = {
- ...docsData,
- components: docsData.components.map((cmp) => ({
- filePath: cmp.filePath,
- encapsulation: cmp.encapsulation,
- tag: cmp.tag,
- readme: cmp.readme,
- docs: cmp.docs,
- docsTags: cmp.docsTags,
- usage: cmp.usage,
- props: cmp.props,
- methods: cmp.methods,
- events: cmp.events,
- listeners: cmp.listeners,
- styles: cmp.styles,
- slots: cmp.slots,
- parts: cmp.parts,
- dependents: cmp.dependents,
- dependencies: cmp.dependencies,
- dependencyGraph: cmp.dependencyGraph,
- deprecation: cmp.deprecation,
- })),
- };
- const jsonContent = JSON.stringify(json, null, 2);
- await Promise.all(jsonOutputTargets.map((jsonOutput) => {
- return writeDocsOutput(compilerCtx, jsonOutput, jsonContent, typesContent);
- }));
- };
- const writeDocsOutput = async (compilerCtx, jsonOutput, jsonContent, typesContent) => {
- return Promise.all([
- compilerCtx.fs.writeFile(jsonOutput.file, jsonContent),
- jsonOutput.typesFile ? compilerCtx.fs.writeFile(jsonOutput.typesFile, typesContent) : Promise.resolve(),
- ]);
- };
- class MarkdownTable {
- constructor() {
- this.rows = [];
- }
- addHeader(data) {
- this.addRow(data, true);
- }
- addRow(data, isHeader = false) {
- const colData = [];
- data.forEach((text) => {
- const col = {
- text: escapeMarkdownTableColumn(text),
- width: text.length,
- };
- colData.push(col);
- });
- this.rows.push({
- columns: colData,
- isHeader: isHeader,
- });
- }
- toMarkdown() {
- return createTable(this.rows);
- }
- }
- const escapeMarkdownTableColumn = (text) => {
- text = text.replace(/\r?\n/g, ' ');
- text = text.replace(/\|/g, '\\|');
- return text;
- };
- const createTable = (rows) => {
- const content = [];
- if (rows.length === 0) {
- return content;
- }
- normalizeColumCount(rows);
- normalizeColumnWidth(rows);
- const th = rows.find((r) => r.isHeader);
- if (th) {
- const headerRow = createRow(th);
- content.push(headerRow);
- content.push(createBorder(th));
- }
- const tds = rows.filter((r) => !r.isHeader);
- tds.forEach((td) => {
- content.push(createRow(td));
- });
- return content;
- };
- const createBorder = (th) => {
- const border = {
- columns: [],
- isHeader: false,
- };
- th.columns.forEach((c) => {
- const borderCol = {
- text: '',
- width: c.width,
- };
- while (borderCol.text.length < borderCol.width) {
- borderCol.text += '-';
- }
- border.columns.push(borderCol);
- });
- return createRow(border);
- };
- const createRow = (row) => {
- const content = ['| '];
- row.columns.forEach((c) => {
- content.push(c.text);
- content.push(' | ');
- });
- return content.join('').trim();
- };
- const normalizeColumCount = (rows) => {
- let columnCount = 0;
- rows.forEach((r) => {
- if (r.columns.length > columnCount) {
- columnCount = r.columns.length;
- }
- });
- rows.forEach((r) => {
- while (r.columns.length < columnCount) {
- r.columns.push({
- text: ``,
- width: 0,
- });
- }
- });
- };
- const normalizeColumnWidth = (rows) => {
- const columnCount = rows[0].columns.length;
- for (let columnIndex = 0; columnIndex < columnCount; columnIndex++) {
- let longestText = 0;
- rows.forEach((r) => {
- const col = r.columns[columnIndex];
- if (col.text.length > longestText) {
- longestText = col.text.length;
- }
- });
- rows.forEach((r) => {
- const col = r.columns[columnIndex];
- col.width = longestText;
- while (col.text.length < longestText) {
- col.text += ' ';
- }
- });
- }
- };
- const propsToMarkdown = (props) => {
- const content = [];
- if (props.length === 0) {
- return content;
- }
- content.push(`## Properties`);
- content.push(``);
- const table = new MarkdownTable();
- table.addHeader(['Property', 'Attribute', 'Description', 'Type', 'Default']);
- props.forEach((prop) => {
- table.addRow([
- getPropertyField(prop),
- getAttributeField(prop),
- getDocsField$2(prop),
- `\`${prop.type}\``,
- `\`${prop.default}\``,
- ]);
- });
- content.push(...table.toMarkdown());
- content.push(``);
- content.push(``);
- return content;
- };
- const getPropertyField = (prop) => {
- return `\`${prop.name}\`${prop.required ? ' _(required)_' : ''}`;
- };
- const getAttributeField = (prop) => {
- return prop.attr ? `\`${prop.attr}\`` : '--';
- };
- const getDocsField$2 = (prop) => {
- return `${prop.deprecation !== undefined
- ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
- : ''}${prop.docs}`;
- };
- const eventsToMarkdown = (events) => {
- const content = [];
- if (events.length === 0) {
- return content;
- }
- content.push(`## Events`);
- content.push(``);
- const table = new MarkdownTable();
- table.addHeader(['Event', 'Description', 'Type']);
- events.forEach((ev) => {
- table.addRow([`\`${ev.event}\``, getDocsField$1(ev), `\`CustomEvent<${ev.detail}>\``]);
- });
- content.push(...table.toMarkdown());
- content.push(``);
- content.push(``);
- return content;
- };
- const getDocsField$1 = (prop) => {
- return `${prop.deprecation !== undefined
- ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
- : ''}${prop.docs}`;
- };
- const methodsToMarkdown = (methods) => {
- const content = [];
- if (methods.length === 0) {
- return content;
- }
- content.push(`## Methods`);
- content.push(``);
- methods.forEach((method) => {
- content.push(`### \`${method.signature}\``);
- content.push(``);
- content.push(getDocsField(method));
- content.push(``);
- if (method.parameters.length > 0) {
- const parmsTable = new MarkdownTable();
- parmsTable.addHeader(['Name', 'Type', 'Description']);
- method.parameters.forEach(({ name, type, docs }) => {
- parmsTable.addRow(['`' + name + '`', '`' + type + '`', docs]);
- });
- content.push(`#### Parameters`);
- content.push(``);
- content.push(...parmsTable.toMarkdown());
- content.push(``);
- }
- if (method.returns) {
- content.push(`#### Returns`);
- content.push(``);
- content.push(`Type: \`${method.returns.type}\``);
- content.push(``);
- content.push(method.returns.docs);
- content.push(``);
- }
- });
- content.push(``);
- return content;
- };
- const getDocsField = (prop) => {
- return `${prop.deprecation !== undefined
- ? `<span style="color:red">**[DEPRECATED]**</span> ${prop.deprecation}<br/><br/>`
- : ''}${prop.docs}`;
- };
- const usageToMarkdown = (usages) => {
- const content = [];
- const merged = mergeUsages(usages);
- if (merged.length === 0) {
- return content;
- }
- content.push(`## Usage`);
- merged.forEach(({ name, text }) => {
- content.push('');
- content.push(`### ${toTitleCase(name)}`);
- content.push('');
- content.push(text);
- content.push('');
- }),
- content.push('');
- content.push('');
- return content;
- };
- const mergeUsages = (usages) => {
- const keys = Object.keys(usages);
- const map = new Map();
- keys.forEach((key) => {
- const usage = usages[key].trim();
- const array = map.get(usage) || [];
- array.push(key);
- map.set(usage, array);
- });
- const merged = [];
- map.forEach((value, key) => {
- merged.push({
- name: value.join(' / '),
- text: key,
- });
- });
- return merged;
- };
- const stylesToMarkdown = (styles) => {
- const content = [];
- if (styles.length === 0) {
- return content;
- }
- content.push(`## CSS Custom Properties`);
- content.push(``);
- const table = new MarkdownTable();
- table.addHeader(['Name', 'Description']);
- styles.forEach((style) => {
- table.addRow([`\`${style.name}\``, style.docs]);
- });
- content.push(...table.toMarkdown());
- content.push(``);
- content.push(``);
- return content;
- };
- const slotsToMarkdown = (slots) => {
- const content = [];
- if (slots.length === 0) {
- return content;
- }
- content.push(`## Slots`);
- content.push(``);
- const table = new MarkdownTable();
- table.addHeader(['Slot', 'Description']);
- slots.forEach((style) => {
- table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
- });
- content.push(...table.toMarkdown());
- content.push(``);
- content.push(``);
- return content;
- };
- const partsToMarkdown = (parts) => {
- const content = [];
- if (parts.length === 0) {
- return content;
- }
- content.push(`## Shadow Parts`);
- content.push(``);
- const table = new MarkdownTable();
- table.addHeader(['Part', 'Description']);
- parts.forEach((style) => {
- table.addRow([style.name === '' ? '' : `\`"${style.name}"\``, style.docs]);
- });
- content.push(...table.toMarkdown());
- content.push(``);
- content.push(``);
- return content;
- };
- const depsToMarkdown = (cmp, cmps) => {
- const content = [];
- const deps = Object.entries(cmp.dependencyGraph);
- if (deps.length === 0) {
- return content;
- }
- content.push(`## Dependencies`);
- content.push(``);
- if (cmp.dependents.length > 0) {
- const usedBy = cmp.dependents.map((tag) => ' - ' + getCmpLink(cmp, tag, cmps));
- content.push(`### Used by`);
- content.push(``);
- content.push(...usedBy);
- content.push(``);
- }
- if (cmp.dependencies.length > 0) {
- const dependsOn = cmp.dependencies.map((tag) => '- ' + getCmpLink(cmp, tag, cmps));
- content.push(`### Depends on`);
- content.push(``);
- content.push(...dependsOn);
- content.push(``);
- }
- content.push(`### Graph`);
- content.push('```mermaid');
- content.push('graph TD;');
- deps.forEach(([key, deps]) => {
- deps.forEach((dep) => {
- content.push(` ${key} --> ${dep}`);
- });
- });
- content.push(` style ${cmp.tag} fill:#f9f,stroke:#333,stroke-width:4px`);
- content.push('```');
- content.push(``);
- return content;
- };
- const getCmpLink = (from, to, cmps) => {
- const destCmp = cmps.find((c) => c.tag === to);
- if (destCmp) {
- const cmpRelPath = normalizePath$1(relative$1(from.dirPath, destCmp.dirPath));
- return `[${to}](${cmpRelPath})`;
- }
- return to;
- };
- const generateReadme = async (config, compilerCtx, readmeOutputs, docsData, cmps) => {
- const isUpdate = !!docsData.readme;
- const userContent = isUpdate ? docsData.readme : getDefaultReadme(docsData);
- await Promise.all(readmeOutputs.map(async (readmeOutput) => {
- if (readmeOutput.dir) {
- const readmeContent = generateMarkdown(userContent, docsData, cmps, readmeOutput);
- const relPath = relative$1(config.srcDir, docsData.readmePath);
- const absPath = join(readmeOutput.dir, relPath);
- const results = await compilerCtx.fs.writeFile(absPath, readmeContent);
- if (results.changedContent) {
- if (isUpdate) {
- config.logger.info(`updated readme docs: ${docsData.tag}`);
- }
- else {
- config.logger.info(`created readme docs: ${docsData.tag}`);
- }
- }
- }
- }));
- };
- const generateMarkdown = (userContent, cmp, cmps, readmeOutput) => {
- //If the readmeOutput.dependencies is true or undefined the dependencies will be generated.
- const dependencies = readmeOutput.dependencies !== false ? depsToMarkdown(cmp, cmps) : [];
- return [
- userContent,
- AUTO_GENERATE_COMMENT,
- '',
- '',
- ...getDocsDeprecation(cmp),
- ...usageToMarkdown(cmp.usage),
- ...propsToMarkdown(cmp.props),
- ...eventsToMarkdown(cmp.events),
- ...methodsToMarkdown(cmp.methods),
- ...slotsToMarkdown(cmp.slots),
- ...partsToMarkdown(cmp.parts),
- ...stylesToMarkdown(cmp.styles),
- ...dependencies,
- `----------------------------------------------`,
- '',
- readmeOutput.footer,
- '',
- ].join('\n');
- };
- const getDocsDeprecation = (cmp) => {
- if (cmp.deprecation !== undefined) {
- return [`> **[DEPRECATED]** ${cmp.deprecation}`, ''];
- }
- return [];
- };
- const getDefaultReadme = (docsData) => {
- return [`# ${docsData.tag}`, '', '', ''].join('\n');
- };
- const generateReadmeDocs = async (config, compilerCtx, docsData, outputTargets) => {
- const readmeOutputTargets = outputTargets.filter(isOutputTargetDocsReadme);
- if (readmeOutputTargets.length === 0) {
- return;
- }
- const strictCheck = readmeOutputTargets.some((o) => o.strict);
- if (strictCheck) {
- strickCheckDocs(config, docsData);
- }
- await Promise.all(docsData.components.map((cmpData) => {
- return generateReadme(config, compilerCtx, readmeOutputTargets, cmpData, docsData.components);
- }));
- };
- const strickCheckDocs = (config, docsData) => {
- docsData.components.forEach((component) => {
- component.props.forEach((prop) => {
- if (!prop.docs && prop.deprecation === undefined) {
- config.logger.warn(`Property "${prop.name}" of "${component.tag}" is not documented. ${component.filePath}`);
- }
- });
- component.methods.forEach((method) => {
- if (!method.docs && method.deprecation === undefined) {
- config.logger.warn(`Method "${method.name}" of "${component.tag}" is not documented. ${component.filePath}`);
- }
- });
- component.events.forEach((ev) => {
- if (!ev.docs && ev.deprecation === undefined) {
- config.logger.warn(`Event "${ev.event}" of "${component.tag}" is not documented. ${component.filePath}`);
- }
- });
- component.parts.forEach((ev) => {
- if (ev.docs === '') {
- config.logger.warn(`Part "${ev.name}" of "${component.tag}" is not documented. ${component.filePath}`);
- }
- });
- });
- };
- const generateVscodeDocs = async (compilerCtx, docsData, outputTargets) => {
- const vsCodeOutputTargets = outputTargets.filter(isOutputTargetDocsVscode);
- if (vsCodeOutputTargets.length === 0) {
- return;
- }
- await Promise.all(vsCodeOutputTargets.map(async (outputTarget) => {
- const json = {
- version: 1.1,
- tags: docsData.components.map((cmp) => ({
- name: cmp.tag,
- description: {
- kind: 'markdown',
- value: cmp.docs,
- },
- attributes: cmp.props.filter((p) => p.attr).map(serializeAttribute),
- references: getReferences(cmp, outputTarget.sourceCodeBaseUrl),
- })),
- };
- const jsonContent = JSON.stringify(json, null, 2);
- await compilerCtx.fs.writeFile(outputTarget.file, jsonContent);
- }));
- };
- const getReferences = (cmp, repoBaseUrl) => {
- const references = getNameText('reference', cmp.docsTags).map(([name, url]) => ({ name, url }));
- if (repoBaseUrl) {
- references.push({
- name: 'Source code',
- url: join(repoBaseUrl, cmp.filePath),
- });
- }
- if (references.length > 0) {
- return references;
- }
- return undefined;
- };
- const serializeAttribute = (prop) => {
- const attribute = {
- name: prop.attr,
- description: prop.docs,
- };
- const values = prop.values
- .filter(({ type, value }) => type === 'string' && value !== undefined)
- .map(({ value }) => ({ name: value }));
- if (values.length > 0) {
- attribute.values = values;
- }
- return attribute;
- };
- const outputCustom = async (config, compilerCtx, buildCtx, docs, outputTargets) => {
- const customOutputTargets = outputTargets.filter(isOutputTargetCustom);
- if (customOutputTargets.length === 0) {
- return;
- }
- await Promise.all(customOutputTargets.map(async (o) => {
- const timespan = buildCtx.createTimeSpan(`generating ${o.name} started`);
- try {
- await o.generator(config, compilerCtx, buildCtx, docs);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- timespan.finish(`generate ${o.name} finished`);
- }));
- };
- const outputDocs = async (config, compilerCtx, buildCtx) => {
- if (!config.buildDocs) {
- return;
- }
- const docsOutputTargets = config.outputTargets.filter((o) => isOutputTargetCustom(o) ||
- isOutputTargetDocsReadme(o) ||
- isOutputTargetDocsJson(o) ||
- isOutputTargetDocsCustom(o) ||
- isOutputTargetDocsVscode(o));
- if (docsOutputTargets.length === 0) {
- return;
- }
- // ensure all the styles are built first, which parses all the css docs
- await buildCtx.stylesPromise;
- const docsData = await generateDocData(config, compilerCtx, buildCtx);
- await Promise.all([
- generateReadmeDocs(config, compilerCtx, docsData, docsOutputTargets),
- generateJsonDocs(config, compilerCtx, docsData, docsOutputTargets),
- generateVscodeDocs(compilerCtx, docsData, docsOutputTargets),
- generateCustomDocs(config, docsData, docsOutputTargets),
- outputCustom(config, compilerCtx, buildCtx, docsData, docsOutputTargets),
- ]);
- };
- const getHydrateBuildConditionals$1 = (cmps) => {
- const build = getBuildFeatures(cmps);
- build.slotRelocation = true;
- build.lazyLoad = true;
- build.hydrateServerSide = true;
- build.cssVarShim = false;
- build.hydrateClientSide = true;
- build.isDebug = false;
- build.isDev = false;
- build.isTesting = false;
- build.devTools = false;
- build.lifecycleDOMEvents = false;
- build.profile = false;
- build.hotModuleReplacement = false;
- build.updatable = true;
- build.member = true;
- build.constructableCSS = false;
- build.asyncLoading = true;
- build.appendChildSlotFix = false;
- build.slotChildNodesFix = false;
- build.cloneNodeFix = false;
- build.cssAnnotations = true;
- build.shadowDomShim = true;
- build.safari10 = false;
- build.hydratedAttribute = false;
- build.hydratedClass = true;
- build.scriptDataOpts = false;
- build.dynamicImportShim = false;
- build.attachStyles = true;
- return build;
- };
- const addLazyElementGetter = (classMembers, moduleFile, cmp) => {
- // @Element() element;
- // is transformed into:
- // get element() { return __stencil_getElement(this); }
- if (cmp.elementRef) {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.getElement);
- classMembers.push(t.createGetAccessor(undefined, undefined, cmp.elementRef, [], undefined, t.createBlock([t.createReturn(t.createCall(t.createIdentifier(GET_ELEMENT), undefined, [t.createThis()]))])));
- }
- };
- /**
- * Adds static "style" getter within the class
- * const MyComponent = class {
- * static get style() { return "styles"; }
- * }
- */
- const addStaticStyleGetterWithinClass = (classMembers, cmp, commentOriginalSelector) => {
- const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
- if (styleLiteral) {
- classMembers.push(createStaticGetter('style', styleLiteral));
- }
- };
- /**
- * Adds static "style" property to the class variable.
- * const MyComponent = class {}
- * MyComponent.style = "styles";
- */
- const addStaticStylePropertyToClass = (styleStatements, cmp, commentOriginalSelector) => {
- const styleLiteral = getStyleLiteral(cmp, commentOriginalSelector);
- if (styleLiteral) {
- const statement = t.createStatement(t.createAssignment(t.createPropertyAccess(t.createIdentifier(cmp.componentClassName), 'style'), styleLiteral));
- styleStatements.push(statement);
- }
- };
- const getStyleLiteral = (cmp, commentOriginalSelector) => {
- if (Array.isArray(cmp.styles) && cmp.styles.length > 0) {
- if (cmp.styles.length > 1 || (cmp.styles.length === 1 && cmp.styles[0].modeName !== DEFAULT_STYLE_MODE)) {
- // multiple style modes
- return getMultipleModeStyle(cmp, cmp.styles, commentOriginalSelector);
- }
- else {
- // single style
- return getSingleStyle(cmp, cmp.styles[0], commentOriginalSelector);
- }
- }
- return null;
- };
- const getMultipleModeStyle = (cmp, styles, commentOriginalSelector) => {
- const styleModes = [];
- styles.forEach((style) => {
- if (typeof style.styleStr === 'string') {
- // inline the style string
- // static get style() { return { ios: "string" }; }
- const styleLiteral = createStyleLiteral(cmp, style, commentOriginalSelector);
- const propStr = createPropertyAssignment(style.modeName, styleLiteral);
- styleModes.push(propStr);
- }
- else if (typeof style.styleIdentifier === 'string') {
- // direct import already written in the source code
- // import myTagIosStyle from './import-path.css';
- // static get style() { return { ios: myTagIosStyle }; }
- const styleIdentifier = t.createIdentifier(style.styleIdentifier);
- const propIdentifier = createPropertyAssignment(style.modeName, styleIdentifier);
- styleModes.push(propIdentifier);
- }
- else if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
- // import generated from @Component() styleUrls option
- // import myTagIosStyle from './import-path.css';
- // static get style() { return { ios: myTagIosStyle }; }
- const styleUrlIdentifier = createStyleIdentifierFromUrl(cmp, style);
- const propUrlIdentifier = createPropertyAssignment(style.modeName, styleUrlIdentifier);
- styleModes.push(propUrlIdentifier);
- }
- });
- return t.createObjectLiteral(styleModes, true);
- };
- const createPropertyAssignment = (mode, initializer) => {
- const node = t.createPropertyAssignment(mode, initializer);
- return node;
- };
- const getSingleStyle = (cmp, style, commentOriginalSelector) => {
- if (typeof style.styleStr === 'string') {
- // inline the style string
- // static get style() { return "string"; }
- return createStyleLiteral(cmp, style, commentOriginalSelector);
- }
- if (typeof style.styleIdentifier === 'string') {
- // direct import already written in the source code
- // import myTagStyle from './import-path.css';
- // static get style() { return myTagStyle; }
- return t.createIdentifier(style.styleIdentifier);
- }
- if (Array.isArray(style.externalStyles) && style.externalStyles.length > 0) {
- // import generated from @Component() styleUrls option
- // import myTagStyle from './import-path.css';
- // static get style() { return myTagStyle; }
- return createStyleIdentifierFromUrl(cmp, style);
- }
- return null;
- };
- const createStyleLiteral = (cmp, style, commentOriginalSelector) => {
- if (cmp.encapsulation === 'scoped' || (commentOriginalSelector && cmp.encapsulation === 'shadow')) {
- // scope the css first
- const scopeId = getScopeId(cmp.tagName, style.modeName);
- return t.createStringLiteral(scopeCss(style.styleStr, scopeId, commentOriginalSelector));
- }
- return t.createStringLiteral(style.styleStr);
- };
- const createStyleIdentifierFromUrl = (cmp, style) => {
- style.styleIdentifier = dashToPascalCase$1(cmp.tagName);
- style.styleIdentifier = style.styleIdentifier.charAt(0).toLowerCase() + style.styleIdentifier.substring(1);
- if (style.modeName !== DEFAULT_STYLE_MODE) {
- style.styleIdentifier += dashToPascalCase$1(style.modeName);
- }
- style.styleIdentifier += 'Style';
- style.externalStyles = [style.externalStyles[0]];
- return t.createIdentifier(style.styleIdentifier);
- };
- const addHydrateRuntimeCmpMeta = (classMembers, cmp) => {
- const compactMeta = formatComponentRuntimeMeta(cmp, true);
- const cmpMeta = {
- $flags$: compactMeta[0],
- $tagName$: compactMeta[1],
- $members$: compactMeta[2],
- $listeners$: compactMeta[3],
- $lazyBundleId$: fakeBundleIds(),
- $attrsToReflect$: getHydrateAttrsToReflect(cmp),
- };
- // We always need shadow-dom shim in hydrate runtime
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
- }
- const staticMember = createStaticGetter('cmpMeta', convertValueToLiteral(cmpMeta));
- const commentOriginalSelector = cmp.encapsulation === 'shadow';
- addStaticStyleGetterWithinClass(classMembers, cmp, commentOriginalSelector);
- classMembers.push(staticMember);
- };
- const fakeBundleIds = (_cmp) => {
- return '-';
- };
- const getHydrateAttrsToReflect = (cmp) => {
- return cmp.properties.reduce((attrs, prop) => {
- if (prop.reflect) {
- attrs.push([prop.name, prop.attribute]);
- }
- return attrs;
- }, []);
- };
- const updateLazyComponentConstructor = (classMembers, moduleFile, cmp) => {
- const cstrMethodArgs = [t.createParameter(undefined, undefined, undefined, t.createIdentifier(HOST_REF_ARG))];
- const cstrMethodIndex = classMembers.findIndex((m) => m.kind === t.SyntaxKind.Constructor);
- if (cstrMethodIndex >= 0) {
- // add to the existing constructor()
- const cstrMethod = classMembers[cstrMethodIndex];
- const body = t.updateBlock(cstrMethod.body, [
- registerInstanceStatement(moduleFile),
- ...addCreateEvents(moduleFile, cmp),
- ...cstrMethod.body.statements,
- ...addLegacyProps(moduleFile, cmp),
- ]);
- classMembers[cstrMethodIndex] = t.updateConstructor(cstrMethod, cstrMethod.decorators, cstrMethod.modifiers, cstrMethodArgs, body);
- }
- else {
- // create a constructor()
- const cstrMethod = t.createConstructor(undefined, undefined, cstrMethodArgs, t.createBlock([
- registerInstanceStatement(moduleFile),
- ...addCreateEvents(moduleFile, cmp),
- ...addLegacyProps(moduleFile, cmp),
- ], true));
- classMembers.unshift(cstrMethod);
- }
- };
- const registerInstanceStatement = (moduleFile) => {
- addCoreRuntimeApi(moduleFile, RUNTIME_APIS.registerInstance);
- return t.createStatement(t.createCall(t.createIdentifier(REGISTER_INSTANCE), undefined, [
- t.createThis(),
- t.createIdentifier(HOST_REF_ARG),
- ]));
- };
- const HOST_REF_ARG = 'hostRef';
- const updateHydrateComponentClass = (classNode, moduleFile, cmp) => {
- return t.updateClassDeclaration(classNode, classNode.decorators, classNode.modifiers, classNode.name, classNode.typeParameters, classNode.heritageClauses, updateHydrateHostComponentMembers(classNode, moduleFile, cmp));
- };
- const updateHydrateHostComponentMembers = (classNode, moduleFile, cmp) => {
- const classMembers = removeStaticMetaProperties(classNode);
- updateLazyComponentConstructor(classMembers, moduleFile, cmp);
- addLazyElementGetter(classMembers, moduleFile, cmp);
- addWatchers(classMembers, cmp);
- addHydrateRuntimeCmpMeta(classMembers, cmp);
- transformHostData(classMembers, moduleFile);
- return classMembers;
- };
- const hydrateComponentTransform = (compilerCtx, transformOpts) => {
- return (transformCtx) => {
- return (tsSourceFile) => {
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- const visitNode = (node) => {
- if (t.isClassDeclaration(node)) {
- const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
- if (cmp != null) {
- return updateHydrateComponentClass(node, moduleFile, cmp);
- }
- }
- return t.visitEachChild(node, visitNode, transformCtx);
- };
- tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
- if (moduleFile.cmps.length > 0) {
- tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
- }
- if (moduleFile.isLegacy) {
- addLegacyApis(moduleFile);
- }
- tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
- return tsSourceFile;
- };
- };
- };
- const bundleHydrateFactory = async (config, compilerCtx, buildCtx, _build, appFactoryEntryCode) => {
- try {
- const bundleOpts = {
- id: 'hydrate',
- platform: 'hydrate',
- conditionals: getHydrateBuildConditionals$1(buildCtx.components),
- customTransformers: getHydrateCustomTransformer(config, compilerCtx),
- inlineDynamicImports: true,
- inputs: {
- '@app-factory-entry': '@app-factory-entry',
- },
- loader: {
- '@app-factory-entry': appFactoryEntryCode,
- },
- };
- const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
- return rollupBuild;
- }
- catch (e) {
- if (!buildCtx.hasError) {
- // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
- // breakable) and type safety (so that the error variable may be something other than `any`)
- loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
- }
- }
- return undefined;
- };
- const getHydrateCustomTransformer = (config, compilerCtx) => {
- const transformOpts = {
- coreImportPath: STENCIL_INTERNAL_HYDRATE_ID,
- componentExport: null,
- componentMetadata: null,
- currentDirectory: config.sys.getCurrentDirectory(),
- proxy: null,
- style: 'static',
- styleImportData: 'queryparams',
- };
- return [
- updateStencilCoreImports(transformOpts.coreImportPath),
- hydrateComponentTransform(compilerCtx, transformOpts),
- removeCollectionImports(compilerCtx),
- ];
- };
- const HYDRATE_APP_CLOSURE_START = `/*hydrateAppClosure start*/`;
- const HYDRATE_FACTORY_INTRO = `
- export function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) {
- var globalThis = $stencilWindow;
- var self = $stencilWindow;
- var top = $stencilWindow;
- var parent = $stencilWindow;
- var addEventListener = $stencilWindow.addEventListener.bind($stencilWindow);
- var alert = $stencilWindow.alert.bind($stencilWindow);
- var blur = $stencilWindow.blur.bind($stencilWindow);
- var cancelAnimationFrame = $stencilWindow.cancelAnimationFrame.bind($stencilWindow);
- var cancelIdleCallback = $stencilWindow.cancelIdleCallback.bind($stencilWindow);
- var clearInterval = $stencilWindow.clearInterval.bind($stencilWindow);
- var clearTimeout = $stencilWindow.clearTimeout.bind($stencilWindow);
- var close = () => {};
- var confirm = $stencilWindow.confirm.bind($stencilWindow);
- var dispatchEvent = $stencilWindow.dispatchEvent.bind($stencilWindow);
- var focus = $stencilWindow.focus.bind($stencilWindow);
- var getComputedStyle = $stencilWindow.getComputedStyle.bind($stencilWindow);
- var matchMedia = $stencilWindow.matchMedia.bind($stencilWindow);
- var open = $stencilWindow.open.bind($stencilWindow);
- var prompt = $stencilWindow.prompt.bind($stencilWindow);
- var removeEventListener = $stencilWindow.removeEventListener.bind($stencilWindow);
- var requestAnimationFrame = $stencilWindow.requestAnimationFrame.bind($stencilWindow);
- var requestIdleCallback = $stencilWindow.requestIdleCallback.bind($stencilWindow);
- var setInterval = $stencilWindow.setInterval.bind($stencilWindow);
- var setTimeout = $stencilWindow.setTimeout.bind($stencilWindow);
- var CharacterData = $stencilWindow.CharacterData;
- var CSS = $stencilWindow.CSS;
- var CustomEvent = $stencilWindow.CustomEvent;
- var Document = $stencilWindow.Document;
- var DocumentFragment = $stencilWindow.DocumentFragment;
- var DocumentType = $stencilWindow.DocumentType;
- var DOMTokenList = $stencilWindow.DOMTokenList;
- var Element = $stencilWindow.Element;
- var Event = $stencilWindow.Event;
- var HTMLAnchorElement = $stencilWindow.HTMLAnchorElement;
- var HTMLBaseElement = $stencilWindow.HTMLBaseElement;
- var HTMLButtonElement = $stencilWindow.HTMLButtonElement;
- var HTMLCanvasElement = $stencilWindow.HTMLCanvasElement;
- var HTMLElement = $stencilWindow.HTMLElement;
- var HTMLFormElement = $stencilWindow.HTMLFormElement;
- var HTMLImageElement = $stencilWindow.HTMLImageElement;
- var HTMLInputElement = $stencilWindow.HTMLInputElement;
- var HTMLLinkElement = $stencilWindow.HTMLLinkElement;
- var HTMLMetaElement = $stencilWindow.HTMLMetaElement;
- var HTMLScriptElement = $stencilWindow.HTMLScriptElement;
- var HTMLStyleElement = $stencilWindow.HTMLStyleElement;
- var HTMLTemplateElement = $stencilWindow.HTMLTemplateElement;
- var HTMLTitleElement = $stencilWindow.HTMLTitleElement;
- var IntersectionObserver = $stencilWindow.IntersectionObserver;
- var KeyboardEvent = $stencilWindow.KeyboardEvent;
- var MouseEvent = $stencilWindow.MouseEvent;
- var Node = $stencilWindow.Node;
- var NodeList = $stencilWindow.NodeList;
- var URL = $stencilWindow.URL;
- var console = $stencilWindow.console;
- var customElements = $stencilWindow.customElements;
- var history = $stencilWindow.history;
- var localStorage = $stencilWindow.localStorage;
- var location = $stencilWindow.location;
- var navigator = $stencilWindow.navigator;
- var performance = $stencilWindow.performance;
- var sessionStorage = $stencilWindow.sessionStorage;
- var devicePixelRatio = $stencilWindow.devicePixelRatio;
- var innerHeight = $stencilWindow.innerHeight;
- var innerWidth = $stencilWindow.innerWidth;
- var origin = $stencilWindow.origin;
- var pageXOffset = $stencilWindow.pageXOffset;
- var pageYOffset = $stencilWindow.pageYOffset;
- var screen = $stencilWindow.screen;
- var screenLeft = $stencilWindow.screenLeft;
- var screenTop = $stencilWindow.screenTop;
- var screenX = $stencilWindow.screenX;
- var screenY = $stencilWindow.screenY;
- var scrollX = $stencilWindow.scrollX;
- var scrollY = $stencilWindow.scrollY;
- var exports = {};
- var fetch, FetchError, Headers, Request, Response;
- if (typeof $stencilWindow.fetch === 'function') {
- fetch = $stencilWindow.fetch;
- } else {
- fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); };
- }
- if (typeof $stencilWindow.FetchError === 'function') {
- FetchError = $stencilWindow.FetchError;
- } else {
- FetchError = $stencilWindow.FetchError = class FetchError { constructor() { throw new Error('FetchError is not implemented'); } };
- }
- if (typeof $stencilWindow.Headers === 'function') {
- Headers = $stencilWindow.Headers;
- } else {
- Headers = $stencilWindow.Headers = class Headers { constructor() { throw new Error('Headers is not implemented'); } };
- }
- if (typeof $stencilWindow.Request === 'function') {
- Request = $stencilWindow.Request;
- } else {
- Request = $stencilWindow.Request = class Request { constructor() { throw new Error('Request is not implemented'); } };
- }
- if (typeof $stencilWindow.Response === 'function') {
- Response = $stencilWindow.Response;
- } else {
- Response = $stencilWindow.Response = class Response { constructor() { throw new Error('Response is not implemented'); } };
- }
- function hydrateAppClosure($stencilWindow) {
- const window = $stencilWindow;
- const document = $stencilWindow.document;
- ${HYDRATE_APP_CLOSURE_START}
- `;
- const HYDRATE_FACTORY_OUTRO = `
- /*hydrateAppClosure end*/
- hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve);
- }
- hydrateAppClosure($stencilWindow);
- }
- `;
- const updateToHydrateComponents = async (cmps) => {
- const hydrateCmps = await Promise.all(cmps.map(updateToHydrateComponent));
- return sortBy(hydrateCmps, (c) => c.cmp.componentClassName);
- };
- const updateToHydrateComponent = async (cmp) => {
- const cmpData = {
- filePath: cmp.sourceFilePath,
- exportLine: ``,
- cmp: cmp,
- uniqueComponentClassName: ``,
- importLine: ``,
- };
- const pascalCasedClassName = dashToPascalCase$1(toTitleCase(cmp.tagName));
- if (cmp.componentClassName !== pascalCasedClassName) {
- cmpData.uniqueComponentClassName = pascalCasedClassName;
- cmpData.importLine = `import { ${cmp.componentClassName} as ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
- }
- else {
- cmpData.uniqueComponentClassName = cmp.componentClassName;
- cmpData.importLine = `import { ${cmpData.uniqueComponentClassName} } from '${cmpData.filePath}';`;
- }
- return cmpData;
- };
- const relocateHydrateContextConst = (config, compilerCtx, code) => {
- // for whatever reason, const Context = {};
- // is not hoisted to the correct location when bundled,
- // so manually doing it here
- // /*hydrate context start*/export const Context = {};/*hydrate context end*/
- const globalScripts = getGlobalScriptData(config, compilerCtx);
- if (globalScripts.length > 0) {
- const startCode = code.indexOf('/*hydrate context start*/');
- if (startCode > -1) {
- const endCode = code.indexOf('/*hydrate context end*/') + '/*hydrate context end*/'.length;
- const hydrateContextCode = code.substring(startCode, endCode);
- code = code.replace(hydrateContextCode, '');
- return code.replace(HYDRATE_APP_CLOSURE_START, HYDRATE_APP_CLOSURE_START + '\n ' + hydrateContextCode);
- }
- }
- return code;
- };
- const writeHydrateOutputs = (config, compilerCtx, buildCtx, outputTargets, rollupOutput) => {
- return Promise.all(outputTargets.map((outputTarget) => {
- return writeHydrateOutput(config, compilerCtx, buildCtx, outputTarget, rollupOutput);
- }));
- };
- const writeHydrateOutput = async (config, compilerCtx, buildCtx, outputTarget, rollupOutput) => {
- const hydratePackageName = await getHydratePackageName(config, compilerCtx);
- const hydrateAppDirPath = outputTarget.dir;
- const hydrateCoreIndexPath = join(hydrateAppDirPath, 'index.js');
- const hydrateCoreIndexDtsFilePath = join(hydrateAppDirPath, 'index.d.ts');
- const pkgJsonPath = join(hydrateAppDirPath, 'package.json');
- const pkgJsonCode = getHydratePackageJson(config, hydrateCoreIndexPath, hydrateCoreIndexDtsFilePath, hydratePackageName);
- await Promise.all([
- copyHydrateRunnerDts(config, compilerCtx, hydrateAppDirPath),
- compilerCtx.fs.writeFile(pkgJsonPath, pkgJsonCode),
- ]);
- // always remember a path to the hydrate app that the prerendering may need later on
- buildCtx.hydrateAppFilePath = hydrateCoreIndexPath;
- await Promise.all(rollupOutput.output.map(async (output) => {
- if (output.type === 'chunk') {
- output.code = relocateHydrateContextConst(config, compilerCtx, output.code);
- const filePath = join(hydrateAppDirPath, output.fileName);
- await compilerCtx.fs.writeFile(filePath, output.code, { immediateWrite: true });
- }
- }));
- };
- const getHydratePackageJson = (config, hydrateAppFilePath, hydrateDtsFilePath, hydratePackageName) => {
- const pkg = {
- name: hydratePackageName,
- description: `${config.namespace} component hydration app.`,
- main: basename(hydrateAppFilePath),
- types: basename(hydrateDtsFilePath),
- };
- return JSON.stringify(pkg, null, 2);
- };
- const getHydratePackageName = async (config, compilerCtx) => {
- try {
- const rootPkgFilePath = join(config.rootDir, 'package.json');
- const pkgStr = await compilerCtx.fs.readFile(rootPkgFilePath);
- const pkgData = JSON.parse(pkgStr);
- return `${pkgData.name}/hydrate`;
- }
- catch (e) { }
- return `${config.fsNamespace}/hydrate`;
- };
- const copyHydrateRunnerDts = async (config, compilerCtx, hydrateAppDirPath) => {
- const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
- const srcHydrateDir = join(packageDir, 'internal', 'hydrate', 'runner.d.ts');
- const runnerDtsDestPath = join(hydrateAppDirPath, 'index.d.ts');
- await compilerCtx.fs.copyFile(srcHydrateDir, runnerDtsDestPath);
- };
- const generateHydrateApp = async (config, compilerCtx, buildCtx, outputTargets) => {
- try {
- const packageDir = join(config.sys.getCompilerExecutingPath(), '..', '..');
- const input = join(packageDir, 'internal', 'hydrate', 'runner.js');
- const mockDoc = join(packageDir, 'mock-doc', 'index.js');
- const rollupOptions = {
- ...config.rollupConfig.inputOptions,
- input,
- inlineDynamicImports: true,
- plugins: [
- {
- name: 'hydrateAppPlugin',
- resolveId(id) {
- if (id === STENCIL_HYDRATE_FACTORY_ID) {
- return id;
- }
- if (id === STENCIL_MOCK_DOC_ID) {
- return mockDoc;
- }
- return null;
- },
- load(id) {
- if (id === STENCIL_HYDRATE_FACTORY_ID) {
- return generateHydrateFactory(config, compilerCtx, buildCtx);
- }
- return null;
- },
- },
- ],
- treeshake: false,
- onwarn: createOnWarnFn(buildCtx.diagnostics),
- };
- const rollupAppBuild = await rollup(rollupOptions);
- const rollupOutput = await rollupAppBuild.generate({
- banner: generatePreamble(config),
- format: 'cjs',
- file: 'index.js',
- });
- await writeHydrateOutputs(config, compilerCtx, buildCtx, outputTargets, rollupOutput);
- }
- catch (e) {
- if (!buildCtx.hasError) {
- // TODO(STENCIL-353): Implement a type guard that balances using our own copy of Rollup types (which are
- // breakable) and type safety (so that the error variable may be something other than `any`)
- loadRollupDiagnostics(config, compilerCtx, buildCtx, e);
- }
- }
- };
- const generateHydrateFactory = async (config, compilerCtx, buildCtx) => {
- if (!buildCtx.hasError) {
- try {
- const cmps = buildCtx.components;
- const build = getHydrateBuildConditionals(config, cmps);
- const appFactoryEntryCode = await generateHydrateFactoryEntry(buildCtx);
- const rollupFactoryBuild = await bundleHydrateFactory(config, compilerCtx, buildCtx, build, appFactoryEntryCode);
- if (rollupFactoryBuild != null) {
- const rollupOutput = await rollupFactoryBuild.generate({
- format: 'cjs',
- esModule: false,
- strict: false,
- intro: HYDRATE_FACTORY_INTRO,
- outro: HYDRATE_FACTORY_OUTRO,
- preferConst: false,
- });
- if (!buildCtx.hasError && rollupOutput != null && Array.isArray(rollupOutput.output)) {
- return rollupOutput.output[0].code;
- }
- }
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- }
- return '';
- };
- const generateHydrateFactoryEntry = async (buildCtx) => {
- const cmps = buildCtx.components;
- const hydrateCmps = await updateToHydrateComponents(cmps);
- const s = new MagicString$2('');
- s.append(`import { hydrateApp, registerComponents, styles } from '${STENCIL_INTERNAL_HYDRATE_ID}';\n`);
- hydrateCmps.forEach((cmpData) => s.append(cmpData.importLine + '\n'));
- s.append(`registerComponents([\n`);
- hydrateCmps.forEach((cmpData) => {
- s.append(` ${cmpData.uniqueComponentClassName},\n`);
- });
- s.append(`]);\n`);
- s.append(`export { hydrateApp }\n`);
- return s.toString();
- };
- const getHydrateBuildConditionals = (config, cmps) => {
- const build = getBuildFeatures(cmps);
- build.lazyLoad = true;
- build.hydrateClientSide = false;
- build.hydrateServerSide = true;
- updateBuildConditionals(config, build);
- build.lifecycleDOMEvents = false;
- build.devTools = false;
- build.hotModuleReplacement = false;
- build.cloneNodeFix = false;
- build.appendChildSlotFix = false;
- build.slotChildNodesFix = false;
- build.safari10 = false;
- build.shadowDomShim = false;
- return build;
- };
- const outputHydrateScript = async (config, compilerCtx, buildCtx) => {
- const hydrateOutputTargets = config.outputTargets.filter(isOutputTargetHydrate);
- if (hydrateOutputTargets.length > 0) {
- const timespan = buildCtx.createTimeSpan(`generate hydrate app started`);
- await generateHydrateApp(config, compilerCtx, buildCtx, hydrateOutputTargets);
- timespan.finish(`generate hydrate app finished`);
- }
- };
- const getLazyBuildConditionals = (config, cmps) => {
- const build = getBuildFeatures(cmps);
- build.lazyLoad = true;
- build.hydrateServerSide = false;
- build.cssVarShim = config.extras.cssVarsShim;
- build.transformTagName = config.extras.tagNameTransform;
- build.asyncQueue = config.taskQueue === 'congestionAsync';
- build.taskQueue = config.taskQueue !== 'immediate';
- build.initializeNextTick = config.extras.initializeNextTick;
- const hasHydrateOutputTargets = config.outputTargets.some(isOutputTargetHydrate);
- build.hydrateClientSide = hasHydrateOutputTargets;
- updateBuildConditionals(config, build);
- return build;
- };
- const updateLazyComponentClass = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
- const members = updateLazyComponentMembers(transformOpts, styleStatements, classNode, moduleFile, cmp);
- return updateComponentClass(transformOpts, classNode, classNode.heritageClauses, members);
- };
- const updateLazyComponentMembers = (transformOpts, styleStatements, classNode, moduleFile, cmp) => {
- const classMembers = removeStaticMetaProperties(classNode);
- updateLazyComponentConstructor(classMembers, moduleFile, cmp);
- addLazyElementGetter(classMembers, moduleFile, cmp);
- addWatchers(classMembers, cmp);
- transformHostData(classMembers, moduleFile);
- if (transformOpts.style === 'static') {
- addStaticStylePropertyToClass(styleStatements, cmp, false);
- }
- return classMembers;
- };
- const lazyComponentTransform = (compilerCtx, transformOpts) => {
- return (transformCtx) => {
- return (tsSourceFile) => {
- const styleStatements = [];
- const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
- const visitNode = (node) => {
- if (t.isClassDeclaration(node)) {
- const cmp = getComponentMeta(compilerCtx, tsSourceFile, node);
- if (cmp != null) {
- return updateLazyComponentClass(transformOpts, styleStatements, node, moduleFile, cmp);
- }
- }
- return t.visitEachChild(node, visitNode, transformCtx);
- };
- tsSourceFile = t.visitEachChild(tsSourceFile, visitNode, transformCtx);
- if (moduleFile.cmps.length > 0) {
- tsSourceFile = updateStyleImports(transformOpts, tsSourceFile, moduleFile);
- }
- if (moduleFile.isLegacy) {
- addLegacyApis(moduleFile);
- }
- tsSourceFile = addImports(transformOpts, tsSourceFile, moduleFile.coreRuntimeApis, transformOpts.coreImportPath);
- if (styleStatements.length > 0) {
- tsSourceFile = t.updateSourceFileNode(tsSourceFile, [...tsSourceFile.statements, ...styleStatements]);
- }
- return tsSourceFile;
- };
- };
- };
- const generateRollupOutput = async (build, options, config, entryModules) => {
- if (build == null) {
- return null;
- }
- const { output } = await build.generate(options);
- return output.map((chunk) => {
- if (chunk.type === 'chunk') {
- const isCore = Object.keys(chunk.modules).some((m) => m.includes('@stencil/core'));
- return {
- type: 'chunk',
- fileName: chunk.fileName,
- map: chunk.map,
- code: chunk.code,
- moduleFormat: options.format,
- entryKey: chunk.name,
- imports: chunk.imports,
- isEntry: !!chunk.isEntry,
- isComponent: !!chunk.isEntry && entryModules.some((m) => m.entryKey === chunk.name),
- isBrowserLoader: chunk.isEntry && chunk.name === config.fsNamespace,
- isIndex: chunk.isEntry && chunk.name === 'index',
- isCore,
- };
- }
- else {
- return {
- type: 'asset',
- fileName: chunk.fileName,
- content: chunk.source,
- };
- }
- });
- };
- const writeLazyModule = async (config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix) => {
- // code = replaceStylePlaceholders(entryModule.cmps, modeName, code);
- const bundleId = await getBundleId(config, entryModule.entryKey, shouldHash, code, sufix);
- const fileName = `${bundleId}.entry.js`;
- if (sourceMap) {
- code = code + getSourceMappingUrlForEndOfFile(fileName);
- }
- await Promise.all(destinations.map((dst) => {
- compilerCtx.fs.writeFile(join(dst, fileName), code, { outputTargetType });
- if (!!sourceMap) {
- compilerCtx.fs.writeFile(join(dst, fileName) + '.map', JSON.stringify(sourceMap), { outputTargetType });
- }
- }));
- return {
- bundleId,
- fileName,
- code,
- };
- };
- const getBundleId = async (config, entryKey, shouldHash, code, sufix) => {
- if (shouldHash) {
- const hash = await config.sys.generateContentHash(code, config.hashedFileNameLength);
- return `p-${hash}${sufix}`;
- }
- const components = entryKey.split('.');
- let bundleId = components[0];
- if (components.length > 2) {
- bundleId = `${bundleId}_${components.length - 1}`;
- }
- return bundleId + sufix;
- };
- const generateLazyModules = async (config, compilerCtx, buildCtx, outputTargetType, destinations, results, sourceTarget, isBrowserBuild, sufix) => {
- if (!Array.isArray(destinations) || destinations.length === 0) {
- return [];
- }
- const shouldMinify = config.minifyJs && isBrowserBuild;
- const rollupResults = results.filter((r) => r.type === 'chunk');
- const entryComponentsResults = rollupResults.filter((rollupResult) => rollupResult.isComponent);
- const chunkResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && !rollupResult.isEntry);
- const [bundleModules] = await Promise.all([
- Promise.all(entryComponentsResults.map((rollupResult) => {
- return generateLazyEntryModule(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix);
- })),
- Promise.all(chunkResults.map((rollupResult) => {
- return writeLazyChunk(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild);
- })),
- ]);
- const lazyRuntimeData = formatLazyBundlesRuntimeMeta(bundleModules);
- const entryResults = rollupResults.filter((rollupResult) => !rollupResult.isComponent && rollupResult.isEntry);
- await Promise.all(entryResults.map((rollupResult) => {
- return writeLazyEntry(config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild);
- }));
- await Promise.all(results
- .filter((r) => r.type === 'asset')
- .map((r) => {
- return Promise.all(destinations.map((dest) => {
- return compilerCtx.fs.writeFile(join(dest, r.fileName), r.content);
- }));
- }));
- return bundleModules;
- };
- const generateLazyEntryModule = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild, sufix) => {
- const entryModule = buildCtx.entryModules.find((entryModule) => entryModule.entryKey === rollupResult.entryKey);
- const shouldHash = config.hashFileNames && isBrowserBuild;
- const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, rollupResult.code, rollupResult.map);
- const output = await writeLazyModule(config, compilerCtx, outputTargetType, destinations, entryModule, shouldHash, code, sourceMap, sufix);
- return {
- rollupResult,
- entryKey: rollupResult.entryKey,
- cmps: entryModule.cmps,
- output,
- };
- };
- const writeLazyChunk = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, sourceTarget, shouldMinify, isBrowserBuild) => {
- const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, rollupResult.isCore, isBrowserBuild, rollupResult.code, rollupResult.map);
- await Promise.all(destinations.map((dst) => {
- const filePath = join(dst, rollupResult.fileName);
- let fileCode = code;
- if (rollupResult.map) {
- fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
- compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
- }
- compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
- }));
- };
- const writeLazyEntry = async (config, compilerCtx, buildCtx, rollupResult, outputTargetType, destinations, lazyRuntimeData, sourceTarget, shouldMinify, isBrowserBuild) => {
- if (isBrowserBuild && ['loader'].includes(rollupResult.entryKey)) {
- return;
- }
- let inputCode = rollupResult.code.replace(`[/*!__STENCIL_LAZY_DATA__*/]`, `${lazyRuntimeData}`);
- const { code, sourceMap } = await convertChunk(config, compilerCtx, buildCtx, sourceTarget, shouldMinify, false, isBrowserBuild, inputCode, rollupResult.map);
- await Promise.all(destinations.map((dst) => {
- const filePath = join(dst, rollupResult.fileName);
- let fileCode = code;
- if (sourceMap) {
- fileCode = code + getSourceMappingUrlForEndOfFile(rollupResult.fileName);
- compilerCtx.fs.writeFile(filePath + '.map', JSON.stringify(sourceMap), { outputTargetType });
- }
- return compilerCtx.fs.writeFile(filePath, fileCode, { outputTargetType });
- }));
- };
- const formatLazyBundlesRuntimeMeta = (bundleModules) => {
- const sortedBundles = bundleModules.slice().sort(sortBundleModules);
- const lazyBundles = sortedBundles.map(formatLazyRuntimeBundle);
- return stringifyRuntimeData(lazyBundles);
- };
- const formatLazyRuntimeBundle = (bundleModule) => {
- let bundleId = bundleModule.output.bundleId;
- const bundleCmps = bundleModule.cmps.slice().sort(sortBundleComponents);
- return [bundleId, bundleCmps.map((cmp) => formatComponentRuntimeMeta(cmp, true))];
- };
- const sortBundleModules = (a, b) => {
- const aDependents = a.cmps.reduce((dependents, cmp) => {
- dependents.push(...cmp.dependents);
- return dependents;
- }, []);
- const bDependents = b.cmps.reduce((dependents, cmp) => {
- dependents.push(...cmp.dependents);
- return dependents;
- }, []);
- if (a.cmps.some((cmp) => bDependents.includes(cmp.tagName)))
- return 1;
- if (b.cmps.some((cmp) => aDependents.includes(cmp.tagName)))
- return -1;
- const aDependencies = a.cmps.reduce((dependencies, cmp) => {
- dependencies.push(...cmp.dependencies);
- return dependencies;
- }, []);
- const bDependencies = b.cmps.reduce((dependencies, cmp) => {
- dependencies.push(...cmp.dependencies);
- return dependencies;
- }, []);
- if (a.cmps.some((cmp) => bDependencies.includes(cmp.tagName)))
- return -1;
- if (b.cmps.some((cmp) => aDependencies.includes(cmp.tagName)))
- return 1;
- if (aDependents.length < bDependents.length)
- return -1;
- if (aDependents.length > bDependents.length)
- return 1;
- if (aDependencies.length > bDependencies.length)
- return -1;
- if (aDependencies.length < bDependencies.length)
- return 1;
- const aTags = a.cmps.map((cmp) => cmp.tagName);
- const bTags = b.cmps.map((cmp) => cmp.tagName);
- if (aTags.length > bTags.length)
- return -1;
- if (aTags.length < bTags.length)
- return 1;
- const aTagsStr = aTags.sort().join('.');
- const bTagsStr = bTags.sort().join('.');
- if (aTagsStr < bTagsStr)
- return -1;
- if (aTagsStr > bTagsStr)
- return 1;
- return 0;
- };
- const sortBundleComponents = (a, b) => {
- // <cmp-a>
- // <cmp-b>
- // <cmp-c></cmp-c>
- // </cmp-b>
- // </cmp-a>
- // cmp-c is a dependency of cmp-a and cmp-b
- // cmp-c is a directDependency of cmp-b
- // cmp-a is a dependant of cmp-b and cmp-c
- // cmp-a is a directDependant of cmp-b
- if (a.directDependents.includes(b.tagName))
- return 1;
- if (b.directDependents.includes(a.tagName))
- return -1;
- if (a.directDependencies.includes(b.tagName))
- return 1;
- if (b.directDependencies.includes(a.tagName))
- return -1;
- if (a.dependents.includes(b.tagName))
- return 1;
- if (b.dependents.includes(a.tagName))
- return -1;
- if (a.dependencies.includes(b.tagName))
- return 1;
- if (b.dependencies.includes(a.tagName))
- return -1;
- if (a.dependents.length < b.dependents.length)
- return -1;
- if (a.dependents.length > b.dependents.length)
- return 1;
- if (a.dependencies.length > b.dependencies.length)
- return -1;
- if (a.dependencies.length < b.dependencies.length)
- return 1;
- if (a.tagName < b.tagName)
- return -1;
- if (a.tagName > b.tagName)
- return 1;
- return 0;
- };
- const convertChunk = async (config, compilerCtx, buildCtx, sourceTarget, shouldMinify, isCore, isBrowserBuild, code, rollupSrcMap) => {
- let sourceMap = rollupToStencilSourceMap(rollupSrcMap);
- const inlineHelpers = isBrowserBuild || !hasDependency(buildCtx, 'tslib');
- const optimizeResults = await optimizeModule(config, compilerCtx, {
- input: code,
- sourceMap: sourceMap,
- isCore,
- sourceTarget,
- inlineHelpers,
- minify: shouldMinify,
- });
- buildCtx.diagnostics.push(...optimizeResults.diagnostics);
- if (typeof optimizeResults.output === 'string') {
- code = optimizeResults.output;
- sourceMap = optimizeResults.sourceMap;
- }
- return { code, sourceMap };
- };
- const generateCjs = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
- const cjsOutputs = outputTargets.filter((o) => !!o.cjsDir);
- if (cjsOutputs.length > 0) {
- const outputTargetType = cjsOutputs[0].type;
- const esmOpts = {
- banner: generatePreamble(config),
- format: 'cjs',
- entryFileNames: '[name].cjs.js',
- assetFileNames: '[name]-[hash][extname]',
- preferConst: true,
- sourcemap: config.sourceMap,
- };
- const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
- if (results != null) {
- const destinations = cjsOutputs.map((o) => o.cjsDir);
- buildCtx.commonJsComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, destinations, results, 'es2017', false, '.cjs');
- await generateShortcuts$1(compilerCtx, results, cjsOutputs);
- }
- }
- return { name: 'cjs', buildCtx };
- };
- const generateShortcuts$1 = (compilerCtx, rollupResult, outputTargets) => {
- const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
- return Promise.all(outputTargets.map(async (o) => {
- if (o.cjsIndexFile) {
- const entryPointPath = join(o.cjsDir, indexFilename);
- const relativePath = relativeImport(o.cjsIndexFile, entryPointPath);
- const shortcutContent = `module.exports = require('${relativePath}');\n`;
- await compilerCtx.fs.writeFile(o.cjsIndexFile, shortcutContent, { outputTargetType: o.type });
- }
- }));
- };
- const generateEsmBrowser = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
- const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !!o.isBrowserBuild);
- if (esmOutputs.length) {
- const outputTargetType = esmOutputs[0].type;
- const esmOpts = {
- banner: generatePreamble(config),
- format: 'es',
- entryFileNames: '[name].esm.js',
- chunkFileNames: config.hashFileNames ? 'p-[hash].js' : '[name]-[hash].js',
- assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
- preferConst: true,
- sourcemap: config.sourceMap,
- };
- if (config.extras.dynamicImportShim) {
- // for Edge 16-18
- esmOpts.dynamicImportFunction = getDynamicImportFunction$1(config.fsNamespace);
- }
- const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
- if (output != null) {
- const es2017destinations = esmOutputs.map((o) => o.esmDir);
- buildCtx.esmBrowserComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', true, '');
- }
- }
- return { name: 'esm-browser', buildCtx };
- };
- const generateEsm = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
- const esmEs5Outputs = config.buildEs5 ? outputTargets.filter((o) => !!o.esmEs5Dir && !o.isBrowserBuild) : [];
- const esmOutputs = outputTargets.filter((o) => !!o.esmDir && !o.isBrowserBuild);
- if (esmOutputs.length + esmEs5Outputs.length > 0) {
- const esmOpts = {
- banner: generatePreamble(config),
- format: 'es',
- entryFileNames: '[name].js',
- assetFileNames: '[name]-[hash][extname]',
- preferConst: true,
- sourcemap: config.sourceMap,
- };
- const outputTargetType = esmOutputs[0].type;
- const output = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
- if (output != null) {
- const es2017destinations = esmOutputs.map((o) => o.esmDir);
- buildCtx.esmComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es2017destinations, output, 'es2017', false, '');
- const es5destinations = esmEs5Outputs.map((o) => o.esmEs5Dir);
- buildCtx.es5ComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargetType, es5destinations, output, 'es5', false, '');
- await copyPolyfills(config, compilerCtx, esmOutputs);
- await generateShortcuts(config, compilerCtx, outputTargets, output);
- }
- }
- return { name: 'esm', buildCtx };
- };
- const copyPolyfills = async (config, compilerCtx, outputTargets) => {
- const destinations = outputTargets.filter((o) => o.polyfills).map((o) => o.esmDir);
- if (destinations.length === 0) {
- return;
- }
- const src = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills');
- const files = await compilerCtx.fs.readdir(src);
- await Promise.all(destinations.map((dest) => {
- return Promise.all(files.map((f) => {
- return compilerCtx.fs.copyFile(f.absPath, join(dest, 'polyfills', f.relPath));
- }));
- }));
- };
- const generateShortcuts = (config, compilerCtx, outputTargets, rollupResult) => {
- const indexFilename = rollupResult.find((r) => r.type === 'chunk' && r.isIndex).fileName;
- return Promise.all(outputTargets.map(async (o) => {
- if (o.esmDir && o.esmIndexFile) {
- const entryPointPath = config.buildEs5 && o.esmEs5Dir ? join(o.esmEs5Dir, indexFilename) : join(o.esmDir, indexFilename);
- const relativePath = relativeImport(o.esmIndexFile, entryPointPath);
- const shortcutContent = `export * from '${relativePath}';`;
- await compilerCtx.fs.writeFile(o.esmIndexFile, shortcutContent, { outputTargetType: o.type });
- }
- }));
- };
- const getClientPolyfill = async (config, compilerCtx, polyfillFile) => {
- const polyfillFilePath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', 'client', 'polyfills', polyfillFile);
- return compilerCtx.fs.readFile(polyfillFilePath);
- };
- const getAppBrowserCorePolyfills = async (config, compilerCtx) => {
- // read all the polyfill content, in this particular order
- const polyfills = INLINE_POLYFILLS.slice();
- if (config.extras.cssVarsShim) {
- polyfills.push(INLINE_CSS_SHIM);
- }
- const results = await Promise.all(polyfills.map((polyfillFile) => getClientPolyfill(config, compilerCtx, polyfillFile)));
- // concat the polyfills
- return results.join('\n').trim();
- };
- // order of the polyfills matters!! test test test
- // actual source of the polyfills are found in /src/client/polyfills/
- const INLINE_POLYFILLS = ['core-js.js', 'dom.js', 'es5-html-element.js', 'system.js'];
- const INLINE_CSS_SHIM = 'css-shim.js';
- const generateSystem = async (config, compilerCtx, buildCtx, rollupBuild, outputTargets) => {
- const systemOutputs = outputTargets.filter((o) => !!o.systemDir);
- if (systemOutputs.length > 0) {
- const esmOpts = {
- banner: generatePreamble(config),
- format: 'system',
- entryFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name].system.js',
- chunkFileNames: config.hashFileNames ? 'p-[hash].system.js' : '[name]-[hash].system.js',
- assetFileNames: config.hashFileNames ? 'p-[hash][extname]' : '[name]-[hash][extname]',
- preferConst: true,
- sourcemap: config.sourceMap,
- };
- const results = await generateRollupOutput(rollupBuild, esmOpts, config, buildCtx.entryModules);
- if (results != null) {
- const destinations = systemOutputs.map((o) => o.esmDir);
- buildCtx.systemComponentBundle = await generateLazyModules(config, compilerCtx, buildCtx, outputTargets[0].type, destinations, results, 'es5', true, '.system');
- await generateSystemLoaders(config, compilerCtx, results, systemOutputs);
- }
- }
- return { name: 'system', buildCtx };
- };
- const generateSystemLoaders = (config, compilerCtx, rollupResult, systemOutputs) => {
- const loaderFilename = rollupResult.find((r) => r.type === 'chunk' && r.isBrowserLoader).fileName;
- return Promise.all(systemOutputs.map((o) => writeSystemLoader(config, compilerCtx, loaderFilename, o)));
- };
- const writeSystemLoader = async (config, compilerCtx, loaderFilename, outputTarget) => {
- if (outputTarget.systemLoaderFile) {
- const entryPointPath = join(outputTarget.systemDir, loaderFilename);
- const relativePath = relativeImport(outputTarget.systemLoaderFile, entryPointPath);
- const loaderContent = await getSystemLoader(config, compilerCtx, relativePath, outputTarget.polyfills);
- await compilerCtx.fs.writeFile(outputTarget.systemLoaderFile, loaderContent, {
- outputTargetType: outputTarget.type,
- });
- }
- };
- const getSystemLoader = async (config, compilerCtx, corePath, includePolyfills) => {
- const polyfills = includePolyfills
- ? await getAppBrowserCorePolyfills(config, compilerCtx)
- : '/* polyfills excluded */';
- return `
- 'use strict';
- (function () {
- var currentScript = document.currentScript;
- // Safari 10 support type="module" but still download and executes the nomodule script
- if (!currentScript || !currentScript.hasAttribute('nomodule') || !('onbeforeload' in currentScript)) {
- ${polyfills}
- // Figure out currentScript (for IE11, since it does not support currentScript)
- var regex = /\\/${config.fsNamespace}(\\.esm)?\\.js($|\\?|#)/;
- var scriptElm = currentScript || Array.from(document.querySelectorAll('script')).find(function(s) {
- return regex.test(s.src) || s.getAttribute('data-stencil-namespace') === "${config.fsNamespace}";
- });
- var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
- var start = function() {
- var url = new URL('${corePath}', new URL(resourcesUrl, window.location.origin));
- System.import(url.href);
- };
- if (window.__cssshim) {
- window.__cssshim.i().then(start);
- } else {
- start();
- }
- // Note: using .call(window) here because the self-executing function needs
- // to be scoped to the window object for the ES6Promise polyfill to work
- }
- }).call(window);
- `;
- };
- const generateModuleGraph = (cmps, bundleModules) => {
- const cmpMap = new Map();
- cmps.forEach((cmp) => {
- const bundle = bundleModules.find((b) => b.cmps.includes(cmp));
- if (bundle) {
- // add default case for no mode
- cmpMap.set(getScopeId(cmp.tagName), bundle.rollupResult.imports);
- }
- });
- return cmpMap;
- };
- /**
- * Scan the provided `doc` for any known Stencil components
- * @param doc the Document to scan
- * @param cmps the compiler metadata of known Stencil components
- * @returns a list of all tags that were identified as known Stencil components
- */
- const getUsedComponents = (doc, cmps) => {
- const tags = new Set(cmps.map((cmp) => cmp.tagName.toUpperCase()));
- const found = [];
- const searchComponents = (el) => {
- if (tags.has(el.tagName)) {
- found.push(el.tagName.toLowerCase());
- }
- for (let i = 0; i < el.childElementCount; i++) {
- searchComponents(el.children[i]);
- }
- };
- searchComponents(doc.documentElement);
- return found;
- };
- /**
- * Retrieve the component bundle groupings to be used when generating output
- * @param config the Stencil configuration used for the build
- * @param buildCtx the current build context
- * @param cmps the components that have been registered & defined for the current build
- * @returns the component bundling data
- */
- function getDefaultBundles(config, buildCtx, cmps) {
- // get all of the user defined bundles in the Stencil config file
- const userConfigEntryPoints = getUserConfigBundles(config, buildCtx, cmps);
- if (userConfigEntryPoints.length > 0) {
- // prefer user defined entry points over anything else Stencil may derive
- return userConfigEntryPoints;
- }
- let entryPointsHints = config.entryComponentsHint;
- if (!entryPointsHints && buildCtx.indexDoc) {
- // attempt to scan an HTML file for known Stencil components
- entryPointsHints = getUsedComponents(buildCtx.indexDoc, cmps);
- }
- if (!entryPointsHints) {
- return [];
- }
- const mainBundle = unique([
- ...entryPointsHints,
- ...flatOne(entryPointsHints.map(resolveTag).map((cmp) => cmp.dependencies)),
- ]).map(resolveTag);
- function resolveTag(tag) {
- return cmps.find((cmp) => cmp.tagName === tag);
- }
- return [mainBundle];
- }
- /**
- * Retrieve and validate the `bundles` field on a project's Stencil configuration file
- * @param config the configuration file with a `bundles` field to inspect
- * @param buildCtx the current build context
- * @param cmps the components that have been registered & defined for the current build
- * @returns a three dimensional array with the compiler metadata for each component used
- */
- function getUserConfigBundles(config, buildCtx, cmps) {
- const definedTags = new Set();
- const entryTags = config.bundles.map((b) => {
- return b.components
- .map((tag) => {
- const tagError = validateComponentTag(tag);
- if (tagError) {
- const err = buildError(buildCtx.diagnostics);
- err.header = `Stencil Config`;
- err.messageText = tagError;
- }
- const component = cmps.find((cmp) => cmp.tagName === tag);
- if (!component) {
- const warn = buildWarn(buildCtx.diagnostics);
- warn.header = `Stencil Config`;
- warn.messageText = `Component tag "${tag}" is defined in a bundle but no matching component was found within this app or its collections.`;
- }
- if (definedTags.has(tag)) {
- const warn = buildWarn(buildCtx.diagnostics);
- warn.header = `Stencil Config`;
- warn.messageText = `Component tag "${tag}" has been defined multiple times in the "bundles" config.`;
- }
- definedTags.add(tag);
- return component;
- })
- .sort();
- });
- return entryTags;
- }
- /**
- * Generate a list of all component tags that will be used by the output
- * @param config the Stencil configuration used for the build
- * @param defaultBundles metadata of the assumed components being used/bundled
- * @param allCmps all known components
- * @returns a set of all component tags that are used
- */
- function computeUsedComponents(config, defaultBundles, allCmps) {
- if (!config.excludeUnusedDependencies) {
- // the user/config has specified that Stencil should use all the dependencies it's found, return the set of all
- // known tags
- return new Set(allCmps.map((c) => c.tagName));
- }
- const usedComponents = new Set();
- // All components
- defaultBundles.forEach((entry) => {
- entry.forEach((cmp) => usedComponents.add(cmp.tagName));
- });
- allCmps.forEach((cmp) => {
- if (!cmp.isCollectionDependency) {
- usedComponents.add(cmp.tagName);
- }
- });
- allCmps.forEach((cmp) => {
- if (cmp.isCollectionDependency) {
- if (cmp.dependents.some((dep) => usedComponents.has(dep))) {
- usedComponents.add(cmp.tagName);
- }
- }
- });
- return usedComponents;
- }
- /**
- * Generate the bundles that will be used during the bundling process
- * @param config the Stencil configuration used for the build
- * @param buildCtx the current build context
- * @returns the bundles to be used during the bundling process
- */
- function generateComponentBundles(config, buildCtx) {
- const cmps = sortBy(buildCtx.components, (cmp) => cmp.dependents.length);
- const defaultBundles = getDefaultBundles(config, buildCtx, cmps);
- const usedComponents = computeUsedComponents(config, defaultBundles, cmps);
- if (config.devMode) {
- return cmps
- .filter((c) => usedComponents.has(c.tagName))
- .map((cmp) => [cmp]);
- }
- // Visit components that are already in one of the default bundlers
- const alreadyBundled = new Set();
- defaultBundles.forEach((entry) => {
- entry.forEach((cmp) => alreadyBundled.add(cmp));
- });
- const bundlers = cmps
- .filter((cmp) => usedComponents.has(cmp.tagName) && !alreadyBundled.has(cmp))
- .map((c) => [c]);
- return [...defaultBundles, ...optimizeBundlers(bundlers, 0.6)].filter((b) => b.length > 0);
- }
- /**
- * Calculate and reorganize bundles based on a calculated similarity score between bundle entries
- * @param bundles the bundles to reorganize
- * @param threshold a numeric value used to determine whether or not bundles should be reorganized
- * @returns the reorganized bundles
- */
- function optimizeBundlers(bundles, threshold) {
- /**
- * build a mapping of component tag names in each `bundles` entry to the index where that entry occurs in `bundles`:
- * ```ts
- * bundles = [
- * [
- * {
- * tagName: 'my-foo', ...<other_fields>,
- * },
- * ],
- * [
- * {
- * tagName: 'my-bar', ...<other_fields>,
- * },
- * {
- * tagName: 'my-baz', ...<other_fields>,
- * },
- * ],
- * ];
- * // yields
- * {
- * 'my-foo': 0,
- * 'my-bar': 1,
- * 'my-baz': 1,
- * }
- * ```
- * note that in the event of a component being found >1 time, store the index of the last entry in which it's found
- */
- const cmpIndexMap = new Map();
- bundles.forEach((entry, index) => {
- entry.forEach((cmp) => {
- cmpIndexMap.set(cmp.tagName, index);
- });
- });
- // build a record of components
- const matrix = bundles.map((entry) => {
- const vector = new Uint8Array(bundles.length);
- entry.forEach((cmp) => {
- // for each dependent of a component, check to see if the dependent has been seen already when the `cmpIndexMap`
- // was originally built. If so, mark it with a '1'
- cmp.dependents.forEach((tag) => {
- const index = cmpIndexMap.get(tag);
- if (index !== undefined) {
- vector[index] = 1;
- }
- });
- });
- entry.forEach((cmp) => {
- // for each entry, check to see if the component has been seen already when the `cmpIndexMap` was originally
- // built. If so, mark it with a '0', potentially overriding a previously set value on the vector.
- const index = cmpIndexMap.get(cmp.tagName);
- if (index !== undefined) {
- vector[index] = 0;
- }
- });
- return vector;
- });
- // resolve similar components
- const newBundles = [];
- const visited = new Uint8Array(bundles.length);
- for (let i = 0; i < matrix.length; i++) {
- // check if bundle is visited (0 means it's not)
- if (visited[i] === 0) {
- const bundle = [...bundles[i]];
- visited[i] = 1;
- for (let j = i + 1; j < matrix.length; j++) {
- if (visited[j] === 0 && computeScore(matrix[i], matrix[j]) >= threshold) {
- bundle.push(...bundles[j]);
- visited[j] = 1;
- }
- }
- newBundles.push(bundle);
- }
- }
- return newBundles;
- }
- /**
- * Computes a 'score' between two arrays, that is defined as the number of times that the value at a given index is the
- * same in both arrays divided by the number of times the value in either array is high at the given index.
- * @param m0 the first array to calculate sameness with
- * @param m1 the second array to calculate sameness with
- * @returns the calculated score
- */
- function computeScore(m0, m1) {
- let total = 0;
- let match = 0;
- for (let i = 0; i < m0.length; i++) {
- if (m0[i] === 1 || m1[i] === 1) {
- total++;
- if (m0[i] === m1[i]) {
- match++;
- }
- }
- }
- return match / total;
- }
- const outputLazy = async (config, compilerCtx, buildCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistLazy);
- if (outputTargets.length === 0) {
- return;
- }
- const bundleEventMessage = `generate lazy${config.sourceMap ? ' + source maps' : ''}`;
- const timespan = buildCtx.createTimeSpan(`${bundleEventMessage} started`);
- try {
- const bundleOpts = {
- id: 'lazy',
- platform: 'client',
- conditionals: getLazyBuildConditionals(config, buildCtx.components),
- customTransformers: getLazyCustomTransformer(config, compilerCtx),
- inlineWorkers: config.outputTargets.some(isOutputTargetDist),
- inputs: {
- [config.fsNamespace]: LAZY_BROWSER_ENTRY_ID,
- loader: LAZY_EXTERNAL_ENTRY_ID,
- index: USER_INDEX_ENTRY_ID,
- },
- loader: {
- [LAZY_EXTERNAL_ENTRY_ID]: getLazyEntry(false),
- [LAZY_BROWSER_ENTRY_ID]: getLazyEntry(true),
- },
- };
- // we've got the compiler context filled with app modules and collection dependency modules
- // figure out how all these components should be connected
- generateEntryModules(config, buildCtx);
- buildCtx.entryModules.forEach((entryModule) => {
- bundleOpts.inputs[entryModule.entryKey] = entryModule.entryKey;
- });
- const rollupBuild = await bundleOutput(config, compilerCtx, buildCtx, bundleOpts);
- if (rollupBuild != null) {
- const results = await Promise.all([
- generateEsmBrowser(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
- generateEsm(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
- generateSystem(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
- generateCjs(config, compilerCtx, buildCtx, rollupBuild, outputTargets),
- ]);
- results.forEach((result) => {
- if (result.name === 'cjs') {
- buildCtx.commonJsComponentBundle = result.buildCtx.commonJsComponentBundle;
- }
- else if (result.name === 'system') {
- buildCtx.systemComponentBundle = result.buildCtx.systemComponentBundle;
- }
- else if (result.name === 'esm') {
- buildCtx.esmComponentBundle = result.buildCtx.esmComponentBundle;
- buildCtx.es5ComponentBundle = result.buildCtx.es5ComponentBundle;
- }
- else if (result.name === 'esm-browser') {
- buildCtx.esmBrowserComponentBundle = result.buildCtx.esmBrowserComponentBundle;
- buildCtx.buildResults = result.buildCtx.buildResults;
- buildCtx.components = result.buildCtx.components;
- }
- });
- if (buildCtx.esmBrowserComponentBundle != null) {
- buildCtx.componentGraph = generateModuleGraph(buildCtx.components, buildCtx.esmBrowserComponentBundle);
- }
- }
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- timespan.finish(`${bundleEventMessage} finished`);
- };
- const getLazyCustomTransformer = (config, compilerCtx) => {
- const transformOpts = {
- coreImportPath: STENCIL_CORE_ID,
- componentExport: 'lazy',
- componentMetadata: null,
- currentDirectory: config.sys.getCurrentDirectory(),
- proxy: null,
- style: 'static',
- styleImportData: 'queryparams',
- };
- return [
- updateStencilCoreImports(transformOpts.coreImportPath),
- lazyComponentTransform(compilerCtx, transformOpts),
- removeCollectionImports(compilerCtx),
- ];
- };
- /**
- * Generate entry modules to be used by the build process by determining how modules and components are connected
- * @param config the Stencil configuration file that was provided as a part of the build step
- * @param buildCtx the current build context
- */
- function generateEntryModules(config, buildCtx) {
- // figure out how modules and components connect
- try {
- const bundles = generateComponentBundles(config, buildCtx);
- buildCtx.entryModules = bundles.map(createEntryModule);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- buildCtx.debug(`generateEntryModules, ${buildCtx.entryModules.length} entryModules`);
- }
- /**
- * Generates an entry module to be used during the bundling process
- * @param cmps the component metadata to create a single entry module from
- * @returns the entry module generated
- */
- function createEntryModule(cmps) {
- // generate a unique entry key based on the components within this entry module
- cmps = sortBy(cmps, (c) => c.tagName);
- const entryKey = cmps.map((c) => c.tagName).join('.') + '.entry';
- return {
- cmps,
- entryKey,
- };
- }
- const getLazyEntry = (isBrowser) => {
- const s = new MagicString$2(``);
- s.append(`import { bootstrapLazy } from '${STENCIL_CORE_ID}';\n`);
- if (isBrowser) {
- s.append(`import { patchBrowser } from '${STENCIL_INTERNAL_CLIENT_PATCH_BROWSER_ID}';\n`);
- s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
- s.append(`patchBrowser().then(options => {\n`);
- s.append(` globalScripts();\n`);
- s.append(` return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
- s.append(`});\n`);
- }
- else {
- s.append(`import { patchEsm } from '${STENCIL_INTERNAL_CLIENT_PATCH_ESM_ID}';\n`);
- s.append(`import { globalScripts } from '${STENCIL_APP_GLOBALS_ID}';\n`);
- s.append(`export const defineCustomElements = (win, options) => {\n`);
- s.append(` if (typeof window === 'undefined') return Promise.resolve();\n`);
- s.append(` return patchEsm().then(() => {\n`);
- s.append(` globalScripts();\n`);
- s.append(` return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n`);
- s.append(` });\n`);
- s.append(`};\n`);
- }
- return s.toString();
- };
- const outputLazyLoader = async (config, compilerCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistLazyLoader);
- if (outputTargets.length === 0) {
- return;
- }
- await Promise.all(outputTargets.map((o) => generateLoader(config, compilerCtx, o)));
- };
- const generateLoader = async (config, compilerCtx, outputTarget) => {
- const loaderPath = outputTarget.dir;
- const es2017Dir = outputTarget.esmDir;
- const es5Dir = outputTarget.esmEs5Dir || es2017Dir;
- const cjsDir = outputTarget.cjsDir;
- if (!loaderPath || !es2017Dir || !cjsDir) {
- return;
- }
- const es5HtmlElement = await getClientPolyfill(config, compilerCtx, 'es5-html-element.js');
- const packageJsonContent = JSON.stringify({
- name: config.fsNamespace + '-loader',
- typings: './index.d.ts',
- module: './index.js',
- main: './index.cjs.js',
- 'jsnext:main': './index.es2017.js',
- es2015: './index.es2017.js',
- es2017: './index.es2017.js',
- unpkg: './cdn.js',
- }, null, 2);
- const es5EntryPoint = join(es5Dir, 'loader.js');
- const es2017EntryPoint = join(es2017Dir, 'loader.js');
- const polyfillsEntryPoint = join(es2017Dir, 'polyfills/index.js');
- const cjsEntryPoint = join(cjsDir, 'loader.cjs.js');
- const polyfillsExport = `export * from '${normalizePath$1(relative$1(loaderPath, polyfillsEntryPoint))}';`;
- const indexContent = `${generatePreamble(config)}
- ${es5HtmlElement}
- ${polyfillsExport}
- export * from '${normalizePath$1(relative$1(loaderPath, es5EntryPoint))}';
- `;
- const indexES2017Content = `${generatePreamble(config)}
- ${polyfillsExport}
- export * from '${normalizePath$1(relative$1(loaderPath, es2017EntryPoint))}';
- `;
- const indexCjsContent = `${generatePreamble(config)}
- module.exports = require('${normalizePath$1(relative$1(loaderPath, cjsEntryPoint))}');
- module.exports.applyPolyfills = function() { return Promise.resolve() };
- `;
- const indexDtsPath = join(loaderPath, 'index.d.ts');
- await Promise.all([
- compilerCtx.fs.writeFile(join(loaderPath, 'package.json'), packageJsonContent),
- compilerCtx.fs.writeFile(join(loaderPath, 'index.d.ts'), generateIndexDts(indexDtsPath, outputTarget.componentDts)),
- compilerCtx.fs.writeFile(join(loaderPath, 'index.js'), indexContent),
- compilerCtx.fs.writeFile(join(loaderPath, 'index.cjs.js'), indexCjsContent),
- compilerCtx.fs.writeFile(join(loaderPath, 'cdn.js'), indexCjsContent),
- compilerCtx.fs.writeFile(join(loaderPath, 'index.es2017.js'), indexES2017Content),
- ]);
- };
- const generateIndexDts = (indexDtsPath, componentsDtsPath) => {
- return `export * from '${relativeImport(indexDtsPath, componentsDtsPath, '.d.ts')}';
- export interface CustomElementsDefineOptions {
- exclude?: string[];
- resourcesUrl?: string;
- syncQueue?: boolean;
- jmp?: (c: Function) => any;
- raf?: (c: FrameRequestCallback) => number;
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
- }
- export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
- export declare function applyPolyfills(): Promise<void>;
- `;
- };
- const addScriptDataAttribute = (config, doc, outputTarget) => {
- const resourcesUrl = getAbsoluteBuildDir(outputTarget);
- const entryEsmFilename = `${config.fsNamespace}.esm.js`;
- const entryNoModuleFilename = `${config.fsNamespace}.js`;
- const expectedEsmSrc = join(resourcesUrl, entryEsmFilename);
- const expectedNoModuleSrc = join(resourcesUrl, entryNoModuleFilename);
- const scripts = Array.from(doc.querySelectorAll('script'));
- const scriptEsm = scripts.find((s) => s.getAttribute('src') === expectedEsmSrc);
- const scriptNomodule = scripts.find((s) => s.getAttribute('src') === expectedNoModuleSrc);
- if (scriptEsm) {
- scriptEsm.setAttribute('data-stencil', '');
- }
- if (scriptNomodule) {
- scriptNomodule.setAttribute('data-stencil', '');
- }
- };
- const generateEs5DisabledMessage = async (config, compilerCtx, outputTarget) => {
- // not doing an es5 right now
- // but it's possible during development the user
- // tests on a browser that doesn't support es2017
- const fileName = `${config.fsNamespace}.js`;
- const filePath = join(outputTarget.buildDir, fileName);
- await compilerCtx.fs.writeFile(filePath, getDisabledMessageScript(config));
- return fileName;
- };
- const getDisabledMessageScript = (config) => {
- const style = `
- <style>
- body {
- display: block !important;
- font-family: sans-serif;
- padding: 20px;
- line-height:22px;
- }
- h1 {
- font-size: 18px;
- }
- h2 {
- font-size: 14px;
- margin-top: 40px;
- }
- </style>
- `;
- const htmlLegacy = `
- ${style}
- <h1>This Stencil app is disabled for this browser.</h1>
- <h2>Developers:</h2>
- <ul>
- <li>ES5 builds are disabled <strong>during development</strong> to take advantage of 2x faster build times.</li>
- <li>Please see the example below or our <a href="https://stenciljs.com/docs/stencil-config" target="_blank" rel="noopener noreferrer">config docs</a> if you would like to develop on a browser that does not fully support ES2017 and custom elements.</li>
- <li>Note that as of Stencil v2, ES5 builds and polyfills are <strong>disabled</strong> during production builds. You can enable these <a href="https://stenciljs.com/docs/config#buildes5" target="_blank" rel="noopener noreferrer">in your stencil.config.ts file</a>.</li>
- <li>When testing browsers it is recommended to always test in production mode, and ES5 builds should always be enabled during production builds.</li>
- <li><em>This is only an experiment and if it slows down app development then we will revert this and enable ES5 builds during dev.</em></li>
- </ul>
- <h2>Enabling ES5 builds during development:</h2>
- <pre>
- <code>npm run dev --es5</code>
- </pre>
- <p>For stencil-component-starter, use:</p>
- <pre>
- <code>npm start --es5</code>
- </pre>
- <h2>Enabling full production builds during development:</h2>
- <pre>
- <code>npm run dev --prod</code>
- </pre>
- <p>For stencil-component-starter, use:</p>
- <pre>
- <code>npm start --prod</code>
- </pre>
- <h2>Current Browser's Support:</h2>
- <ul>
- <li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import">ES Module Imports</a>: <span id="es-modules-test"></span></li>
- <li><a href="http://2ality.com/2017/01/import-operator.html">ES Dynamic Imports</a>: <span id="es-dynamic-modules-test"></span></li>
- <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements">Custom Elements</a>: <span id="custom-elements-test"></span></li>
- <li><a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM">Shadow DOM</a>: <span id="shadow-dom-test"></span></li>
- <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">fetch</a>: <span id="fetch-test"></span></li>
- <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables">CSS Variables</a>: <span id="css-variables-test"></span></li>
- </ul>
- <h2>Current Browser:</h2>
- <pre>
- <code id="current-browser-output"></code>
- </pre>
- `;
- const htmlUpdate = `
- ${style}
- <h1>Update src/index.html</h1>
- <p>Stencil recently changed how scripts are loaded in order to improve performance.</p>
- <h2>BEFORE:</h2>
- <p>Previously, a single script was included that handled loading the correct JavaScript based on browser support.</p>
- <pre>
- <code>${escapeHtml(`<script src="/build/${config.fsNamespace}.js"></script>
- `)}</code>
- </pre>
- <h2 style="margin-top:0">AFTER:</h2>
- <p>The index.html should now include two scripts using the modern ES Module script pattern.
- Note that only one file will actually be requested and loaded based on the browser's native support for ES Modules.
- For more info, please see <a href="https://developers.google.com/web/fundamentals/primers/modules#browser" target="_blank" rel="noopener noreferrer">Using JavaScript modules on the web</a>.
- </p>
- <pre>
- <code>${escapeHtml(`<script`)} <span style="background:yellow">type="module"</span> src="/build/${config.fsNamespace}<span style="background:yellow">.esm</span>.js"${escapeHtml(`></script>`)}
- ${escapeHtml(`<script`)} <span style="background:yellow">nomodule</span> ${escapeHtml(`src="/build/${config.fsNamespace}.js"></script>`)}</code>
- </pre>
- `;
- return `${generatePreamble(config)}
- (function() {
- function checkSupport() {
- if (!document.body) {
- setTimeout(checkSupport);
- return;
- }
- function supportsDynamicImports() {
- try {
- new Function('import("")');
- return true;
- } catch (e) {}
- return false;
- }
- var supportsEsModules = !!('noModule' in document.createElement('script'));
- if (!supportsEsModules) {
- document.body.innerHTML = '${inlineHTML(htmlLegacy)}';
- document.getElementById('current-browser-output').textContent = window.navigator.userAgent;
- document.getElementById('es-modules-test').textContent = supportsEsModules;
- document.getElementById('es-dynamic-modules-test').textContent = supportsDynamicImports();
- document.getElementById('shadow-dom-test').textContent = !!(document.head.attachShadow);
- document.getElementById('custom-elements-test').textContent = !!(window.customElements);
- document.getElementById('css-variables-test').textContent = !!(window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--c)'));
- document.getElementById('fetch-test').textContent = !!(window.fetch);
- } else {
- document.body.innerHTML = '${inlineHTML(htmlUpdate)}';
- }
- }
- setTimeout(checkSupport);
- })();`;
- };
- const inlineHTML = (html) => {
- return html.replace(/\n/g, '\\n').replace(/\'/g, `\\'`).trim();
- };
- const generateHashedCopy = async (config, compilerCtx, path) => {
- try {
- const content = await compilerCtx.fs.readFile(path);
- const hash = await config.sys.generateContentHash(content, config.hashedFileNameLength);
- const hashedFileName = `p-${hash}${extname$1(path)}`;
- await compilerCtx.fs.writeFile(join(dirname(path), hashedFileName), content);
- return hashedFileName;
- }
- catch (e) { }
- return undefined;
- };
- const generateServiceWorker = async (config, buildCtx, workbox, outputTarget) => {
- const serviceWorker = await getServiceWorker(outputTarget);
- if (serviceWorker.unregister) {
- await config.sys.writeFile(serviceWorker.swDest, SELF_UNREGISTER_SW);
- }
- else if (serviceWorker.swSrc) {
- return Promise.all([copyLib(buildCtx, outputTarget, workbox), injectManifest(buildCtx, serviceWorker, workbox)]);
- }
- else {
- return generateSW(buildCtx, serviceWorker, workbox);
- }
- };
- const copyLib = async (buildCtx, outputTarget, workbox) => {
- const timeSpan = buildCtx.createTimeSpan(`copy service worker library started`, true);
- try {
- await workbox.copyWorkboxLibraries(outputTarget.appDir);
- }
- catch (e) {
- const d = buildWarn(buildCtx.diagnostics);
- d.messageText = 'Service worker library already exists';
- }
- timeSpan.finish(`copy service worker library finished`);
- };
- const generateSW = async (buildCtx, serviceWorker, workbox) => {
- const timeSpan = buildCtx.createTimeSpan(`generate service worker started`);
- try {
- await workbox.generateSW(serviceWorker);
- timeSpan.finish(`generate service worker finished`);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- };
- const injectManifest = async (buildCtx, serviceWorker, workbox) => {
- const timeSpan = buildCtx.createTimeSpan(`inject manifest into service worker started`);
- try {
- await workbox.injectManifest(serviceWorker);
- timeSpan.finish('inject manifest into service worker finished');
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- };
- const hasServiceWorkerChanges = (config, buildCtx) => {
- if (config.devMode && !config.flags.serviceWorker) {
- return false;
- }
- const wwwServiceOutputs = config.outputTargets
- .filter(isOutputTargetWww)
- .filter((o) => o.serviceWorker && o.serviceWorker.swSrc);
- return wwwServiceOutputs.some((outputTarget) => {
- return buildCtx.filesChanged.some((fileChanged) => {
- if (outputTarget.serviceWorker) {
- return basename(fileChanged).toLowerCase() === basename(outputTarget.serviceWorker.swSrc).toLowerCase();
- }
- return false;
- });
- });
- };
- const getServiceWorker = async (outputTarget) => {
- if (!outputTarget.serviceWorker) {
- return undefined;
- }
- const serviceWorker = {
- ...outputTarget.serviceWorker,
- };
- if (serviceWorker.unregister !== true) {
- delete serviceWorker.unregister;
- }
- return serviceWorker;
- };
- const INDEX_ORG = 'index-org.html';
- const getRegisterSW = (swUrl) => {
- return `
- if ('serviceWorker' in navigator && location.protocol !== 'file:') {
- window.addEventListener('load', function() {
- navigator.serviceWorker.register('${swUrl}')
- .then(function(reg) {
- reg.onupdatefound = function() {
- var installingWorker = reg.installing;
- installingWorker.onstatechange = function() {
- if (installingWorker.state === 'installed') {
- window.dispatchEvent(new Event('swUpdate'))
- }
- }
- }
- })
- .catch(function(err) { console.error('service worker error', err) });
- });
- }`;
- };
- const UNREGISTER_SW = `
- if ('serviceWorker' in navigator && location.protocol !== 'file:') {
- // auto-unregister service worker during dev mode
- navigator.serviceWorker.getRegistration().then(function(registration) {
- if (registration) {
- registration.unregister().then(function() { location.reload(true) });
- }
- });
- }
- `;
- const SELF_UNREGISTER_SW = `
- self.addEventListener('install', function(e) {
- self.skipWaiting();
- });
- self.addEventListener('activate', function(e) {
- self.registration.unregister()
- .then(function() {
- return self.clients.matchAll();
- })
- .then(function(clients) {
- clients.forEach(client => client.navigate(client.url))
- });
- });
- `;
- const inlineStyleSheets = (compilerCtx, doc, maxSize, outputTarget) => {
- const globalLinks = Array.from(doc.querySelectorAll('link[rel=stylesheet]'));
- return Promise.all(globalLinks.map(async (link) => {
- const href = link.getAttribute('href');
- if (typeof href !== 'string' || !href.startsWith('/') || link.getAttribute('media') !== null) {
- return;
- }
- try {
- const fsPath = join(outputTarget.dir, href);
- const styles = await compilerCtx.fs.readFile(fsPath);
- if (styles.length > maxSize) {
- return;
- }
- // insert inline <style>
- const inlinedStyles = doc.createElement('style');
- inlinedStyles.innerHTML = styles;
- link.parentNode.insertBefore(inlinedStyles, link);
- link.remove();
- }
- catch (e) { }
- }));
- };
- const optimizeEsmImport = async (config, compilerCtx, doc, outputTarget) => {
- const resourcesUrl = getAbsoluteBuildDir(outputTarget);
- const entryFilename = `${config.fsNamespace}.esm.js`;
- const expectedSrc = join(resourcesUrl, entryFilename);
- const script = Array.from(doc.querySelectorAll('script')).find((s) => s.getAttribute('type') === 'module' && !s.hasAttribute('crossorigin') && s.getAttribute('src') === expectedSrc);
- if (!script) {
- return false;
- }
- script.setAttribute('data-resources-url', resourcesUrl);
- script.setAttribute('data-stencil-namespace', config.fsNamespace);
- const entryPath = join(outputTarget.buildDir, entryFilename);
- const content = await compilerCtx.fs.readFile(entryPath);
- if (isString$1(content)) {
- // If the script is too big, instead of inlining, we hash the file and change
- // the <script> to the new location
- if (config.allowInlineScripts && content.length < MAX_JS_INLINE_SIZE) {
- // Let's try to inline, we have to fix all the relative paths of the imports
- const results = updateImportPaths(content, resourcesUrl);
- if (results.orgImportPaths.length > 0) {
- // insert inline script
- script.removeAttribute('src');
- script.innerHTML = results.code;
- }
- }
- else {
- const hashedFile = await generateHashedCopy(config, compilerCtx, entryPath);
- if (hashedFile) {
- const hashedPath = join(resourcesUrl, hashedFile);
- script.setAttribute('src', hashedPath);
- injectModulePreloads(doc, [hashedPath]);
- }
- }
- return true;
- }
- return false;
- };
- const updateImportPaths = (code, newDir) => {
- const orgImportPaths = [];
- const tsSourceFile = t.createSourceFile('module.ts', code, t.ScriptTarget.Latest);
- t.transform(tsSourceFile, [readImportPaths(orgImportPaths)]);
- orgImportPaths.forEach((orgImportPath) => {
- const newPath = replacePathDir(orgImportPath, newDir);
- if (newPath) {
- code = code.replace(`"${orgImportPath}"`, `"${newPath}"`);
- code = code.replace(`'${orgImportPath}'`, `'${newPath}'`);
- }
- });
- return {
- code,
- orgImportPaths,
- };
- };
- const replacePathDir = (orgImportPath, newDir) => {
- if (orgImportPath.startsWith('./') && (orgImportPath.endsWith('.js') || orgImportPath.endsWith('.mjs'))) {
- return newDir + orgImportPath.substring(2);
- }
- return null;
- };
- const readImportPaths = (orgImportPaths) => {
- return () => {
- return (tsSourceFile) => {
- const importStatements = tsSourceFile.statements
- .filter(t.isImportDeclaration)
- .filter((s) => s.moduleSpecifier != null)
- .filter((s) => t.isStringLiteral(s.moduleSpecifier) && s.moduleSpecifier.text);
- importStatements.forEach((s) => {
- if (t.isStringLiteral(s.moduleSpecifier)) {
- orgImportPaths.push(s.moduleSpecifier.text);
- }
- });
- return tsSourceFile;
- };
- };
- };
- // https://twitter.com/addyosmani/status/1143938175926095872
- const MAX_JS_INLINE_SIZE = 1 * 1024;
- const updateGlobalStylesLink = (config, doc, globalScriptFilename, outputTarget) => {
- if (!globalScriptFilename) {
- return;
- }
- const buildDir = getAbsoluteBuildDir(outputTarget);
- const originalPath = join(buildDir, config.fsNamespace + '.css');
- const newPath = join(buildDir, globalScriptFilename);
- if (originalPath === newPath) {
- return;
- }
- const replacer = new RegExp(escapeRegExp(originalPath) + '$');
- Array.from(doc.querySelectorAll('link')).forEach((link) => {
- const href = link.getAttribute('href');
- if (href) {
- const newHref = href.replace(replacer, newPath);
- if (newHref !== href) {
- link.setAttribute('href', newHref);
- }
- }
- });
- };
- const escapeRegExp = (text) => text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
- const generateServiceWorkerUrl = (outputTarget, serviceWorker) => {
- let swUrl = normalizePath$1(relative$1(outputTarget.appDir, serviceWorker.swDest));
- if (swUrl.charAt(0) !== '/') {
- swUrl = '/' + swUrl;
- }
- const baseUrl = new URL(outputTarget.baseUrl, 'http://config.stenciljs.com');
- let basePath = baseUrl.pathname;
- if (!basePath.endsWith('/')) {
- basePath += '/';
- }
- swUrl = basePath + swUrl.substring(1);
- return swUrl;
- };
- const updateIndexHtmlServiceWorker = async (config, buildCtx, doc, outputTarget) => {
- const serviceWorker = outputTarget.serviceWorker;
- if (serviceWorker !== false) {
- if ((serviceWorker && serviceWorker.unregister) || (!serviceWorker && config.devMode)) {
- injectUnregisterServiceWorker(doc);
- }
- else if (serviceWorker) {
- await injectRegisterServiceWorker(buildCtx, outputTarget, doc);
- }
- }
- };
- const injectRegisterServiceWorker = async (buildCtx, outputTarget, doc) => {
- const swUrl = generateServiceWorkerUrl(outputTarget, outputTarget.serviceWorker);
- const serviceWorker = getRegisterSwScript(doc, buildCtx, swUrl);
- doc.body.appendChild(serviceWorker);
- };
- const injectUnregisterServiceWorker = (doc) => {
- const script = doc.createElement('script');
- script.innerHTML = UNREGISTER_SW;
- doc.body.appendChild(script);
- };
- const getRegisterSwScript = (doc, buildCtx, swUrl) => {
- const script = doc.createElement('script');
- script.setAttribute('data-build', `${buildCtx.timestamp}`);
- script.innerHTML = getRegisterSW(swUrl);
- return script;
- };
- const outputWww = async (config, compilerCtx, buildCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetWww);
- if (outputTargets.length === 0) {
- return;
- }
- const timespan = buildCtx.createTimeSpan(`generate www started`, true);
- const criticalBundles = getCriticalPath(buildCtx);
- await Promise.all(outputTargets.map((outputTarget) => generateWww(config, compilerCtx, buildCtx, criticalBundles, outputTarget)));
- timespan.finish(`generate www finished`);
- };
- const getCriticalPath = (buildCtx) => {
- const componentGraph = buildCtx.componentGraph;
- if (!buildCtx.indexDoc || !componentGraph) {
- return [];
- }
- return unique(flatOne(getUsedComponents(buildCtx.indexDoc, buildCtx.components)
- .map((tagName) => getScopeId(tagName))
- .map((scopeId) => buildCtx.componentGraph.get(scopeId) || []))).sort();
- };
- const generateWww = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
- if (!config.buildEs5) {
- await generateEs5DisabledMessage(config, compilerCtx, outputTarget);
- }
- // Copy global styles into the build directory
- // Process
- if (buildCtx.indexDoc && outputTarget.indexHtml) {
- await generateIndexHtml(config, compilerCtx, buildCtx, criticalPath, outputTarget);
- }
- await generateHostConfig(compilerCtx, outputTarget);
- };
- const generateHostConfig = (compilerCtx, outputTarget) => {
- const buildDir = getAbsoluteBuildDir(outputTarget);
- const hostConfigPath = join(outputTarget.appDir, 'host.config.json');
- const hostConfigContent = JSON.stringify({
- hosting: {
- headers: [
- {
- source: join(buildDir, '/p-*'),
- headers: [
- {
- key: 'Cache-Control',
- value: 'max-age=31556952, s-maxage=31556952, immutable',
- },
- ],
- },
- ],
- },
- }, null, ' ');
- return compilerCtx.fs.writeFile(hostConfigPath, hostConfigContent, { outputTargetType: outputTarget.type });
- };
- const generateIndexHtml = async (config, compilerCtx, buildCtx, criticalPath, outputTarget) => {
- if (compilerCtx.hasSuccessfulBuild && !buildCtx.hasHtmlChanges) {
- // no need to rebuild index.html if there were no app file changes
- return;
- }
- // get the source index html content
- try {
- const doc = cloneDocument(buildCtx.indexDoc);
- addScriptDataAttribute(config, doc, outputTarget);
- // validateHtml(config, buildCtx, doc);
- await updateIndexHtmlServiceWorker(config, buildCtx, doc, outputTarget);
- if (!config.watch && !config.devMode) {
- const globalStylesFilename = await generateHashedCopy(config, compilerCtx, join(outputTarget.buildDir, `${config.fsNamespace}.css`));
- const scriptFound = await optimizeEsmImport(config, compilerCtx, doc, outputTarget);
- await inlineStyleSheets(compilerCtx, doc, MAX_CSS_INLINE_SIZE, outputTarget);
- updateGlobalStylesLink(config, doc, globalStylesFilename, outputTarget);
- if (scriptFound) {
- optimizeCriticalPath(doc, criticalPath, outputTarget);
- }
- }
- const indexContent = serializeNodeToHtml(doc);
- await compilerCtx.fs.writeFile(outputTarget.indexHtml, indexContent, { outputTargetType: outputTarget.type });
- if (outputTarget.serviceWorker && config.flags.prerender) {
- await compilerCtx.fs.writeFile(join(outputTarget.appDir, INDEX_ORG), indexContent, {
- outputTargetType: outputTarget.type,
- });
- }
- buildCtx.debug(`generateIndexHtml, write: ${relative$1(config.rootDir, outputTarget.indexHtml)}`);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- };
- const MAX_CSS_INLINE_SIZE = 3 * 1024;
- const outputCollection = async (config, compilerCtx, buildCtx, changedModuleFiles) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
- if (outputTargets.length === 0) {
- return;
- }
- const bundlingEventMessage = `generate collections${config.sourceMap ? ' + source maps' : ''}`;
- const timespan = buildCtx.createTimeSpan(`${bundlingEventMessage} started`, true);
- try {
- await Promise.all(changedModuleFiles.map(async (mod) => {
- let code = mod.staticSourceFileText;
- if (config.preamble) {
- code = `${generatePreamble(config)}\n${code}`;
- }
- const mapCode = mod.sourceMapFileText;
- await Promise.all(outputTargets.map(async (o) => {
- const relPath = relative$1(config.srcDir, mod.jsFilePath);
- const filePath = join(o.collectionDir, relPath);
- await compilerCtx.fs.writeFile(filePath, code, { outputTargetType: o.type });
- if (mod.sourceMapPath) {
- const relativeSourceMapPath = relative$1(config.srcDir, mod.sourceMapPath);
- const sourceMapOutputFilePath = join(o.collectionDir, relativeSourceMapPath);
- await compilerCtx.fs.writeFile(sourceMapOutputFilePath, mapCode, { outputTargetType: o.type });
- }
- }));
- }));
- await writeCollectionManifests(config, compilerCtx, buildCtx, outputTargets);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- timespan.finish(`${bundlingEventMessage} finished`);
- };
- const writeCollectionManifests = async (config, compilerCtx, buildCtx, outputTargets) => {
- const collectionData = JSON.stringify(serializeCollectionManifest(config, compilerCtx, buildCtx), null, 2);
- return Promise.all(outputTargets.map((o) => writeCollectionManifest(compilerCtx, collectionData, o)));
- };
- // this maps the json data to our internal data structure
- // apping is so that the internal data structure "could"
- // change, but the external user data will always use the same api
- // over the top lame mapping functions is basically so we can loosly
- // couple core component meta data between specific versions of the compiler
- const writeCollectionManifest = async (compilerCtx, collectionData, outputTarget) => {
- // get the absolute path to the directory where the collection will be saved
- const collectionDir = normalizePath$1(outputTarget.collectionDir);
- // create an absolute file path to the actual collection json file
- const collectionFilePath = normalizePath$1(join(collectionDir, COLLECTION_MANIFEST_FILE_NAME));
- // don't bother serializing/writing the collection if we're not creating a distribution
- await compilerCtx.fs.writeFile(collectionFilePath, collectionData);
- };
- const serializeCollectionManifest = (config, compilerCtx, buildCtx) => {
- // create the single collection we're going to fill up with data
- const collectionManifest = {
- entries: buildCtx.moduleFiles
- .filter((mod) => !mod.isCollectionDependency && mod.cmps.length > 0)
- .map((mod) => relative$1(config.srcDir, mod.jsFilePath)),
- compiler: {
- name: '@stencil/core',
- version: version$3,
- typescriptVersion,
- },
- collections: serializeCollectionDependencies(compilerCtx),
- bundles: config.bundles.map((b) => ({
- components: b.components.slice().sort(),
- })),
- };
- if (config.globalScript) {
- const mod = compilerCtx.moduleMap.get(normalizePath$1(config.globalScript));
- if (mod) {
- collectionManifest.global = relative$1(config.srcDir, mod.jsFilePath);
- }
- }
- return collectionManifest;
- };
- const serializeCollectionDependencies = (compilerCtx) => {
- const collectionDeps = compilerCtx.collections.map((c) => ({
- name: c.collectionName,
- tags: flatOne(c.moduleFiles.map((m) => m.cmps))
- .map((cmp) => cmp.tagName)
- .sort(),
- }));
- return sortBy(collectionDeps, (item) => item.name);
- };
- /**
- * Update a type declaration file's import declarations using the module `@stencil/core`
- * @param typesDir the directory where type declaration files are expected to exist
- * @param dtsFilePath the path of the type declaration file being updated, used to derive the correct import declaration
- * module
- * @param dtsContent the content of a type declaration file to update
- * @returns the updated type declaration file contents
- */
- const updateStencilTypesImports = (typesDir, dtsFilePath, dtsContent) => {
- const dir = dirname(dtsFilePath);
- // determine the relative path between the directory of the .d.ts file and the types directory. this value may result
- // in '.' if they are the same
- const relPath = relative$1(dir, typesDir);
- let coreDtsPath = join(relPath, CORE_FILENAME);
- if (!coreDtsPath.startsWith('.')) {
- coreDtsPath = `./${coreDtsPath}`;
- }
- coreDtsPath = normalizePath$1(coreDtsPath);
- if (dtsContent.includes('@stencil/core')) {
- dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core\/internal('|")/g, `$1${coreDtsPath}$2`);
- dtsContent = dtsContent.replace(/(from\s*(:?'|"))@stencil\/core('|")/g, `$1${coreDtsPath}$2`);
- }
- return dtsContent;
- };
- /**
- * Writes Stencil core typings file to disk for a dist-* output target
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @returns the results of writing one or more type declaration files to disk
- */
- const copyStencilCoreDts = async (config, compilerCtx) => {
- const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes).filter((o) => o.typesDir);
- const srcStencilDtsPath = join(config.sys.getCompilerExecutingPath(), '..', '..', 'internal', CORE_DTS);
- const srcStencilCoreDts = await compilerCtx.fs.readFile(srcStencilDtsPath);
- return Promise.all(typesOutputTargets.map((o) => {
- const coreDtsFilePath = join(o.typesDir, CORE_DTS);
- return compilerCtx.fs.writeFile(coreDtsFilePath, srcStencilCoreDts, { outputTargetType: o.type });
- }));
- };
- const CORE_FILENAME = `stencil-public-runtime`;
- const CORE_DTS = `${CORE_FILENAME}.d.ts`;
- const COMPONENTS_DTS_HEADER = `/* eslint-disable */
- /* tslint:disable */
- /**
- * This is an autogenerated file created by the Stencil compiler.
- * It contains typing information for all components that exist in this project.
- */`;
- const sortImportNames = (a, b) => {
- const aName = a.localName.toLowerCase();
- const bName = b.localName.toLowerCase();
- if (aName < bName)
- return -1;
- if (aName > bName)
- return 1;
- if (a.localName < b.localName)
- return -1;
- if (a.localName > b.localName)
- return 1;
- return 0;
- };
- /**
- * Generates the individual event types for all @Event() decorated events in a component
- * @param cmpMeta component runtime metadata for a single component
- * @returns the generated type metadata
- */
- const generateEventTypes = (cmpMeta) => {
- return cmpMeta.events.map((cmpEvent) => {
- const name = `on${toTitleCase(cmpEvent.name)}`;
- const type = cmpEvent.complexType.original
- ? `(event: CustomEvent<${cmpEvent.complexType.original}>) => void`
- : `CustomEvent`;
- return {
- name,
- type,
- optional: false,
- required: false,
- internal: cmpEvent.internal,
- jsdoc: getTextDocs(cmpEvent.docs),
- };
- });
- };
- /**
- * Generates the individual event types for all @Method() decorated events in a component
- * @param cmpMeta component runtime metadata for a single component
- * @returns the generated type metadata
- */
- const generateMethodTypes = (cmpMeta) => {
- return cmpMeta.methods.map((cmpMethod) => ({
- name: cmpMethod.name,
- type: cmpMethod.complexType.signature,
- optional: false,
- required: false,
- internal: cmpMethod.internal,
- jsdoc: getTextDocs(cmpMethod.docs),
- }));
- };
- /**
- * Generates the individual event types for all @Prop() decorated events in a component
- * @param cmpMeta component runtime metadata for a single component
- * @returns the generated type metadata
- */
- const generatePropTypes = (cmpMeta) => {
- return [
- ...cmpMeta.properties.map((cmpProp) => ({
- name: cmpProp.name,
- type: cmpProp.complexType.original,
- optional: cmpProp.optional,
- required: cmpProp.required,
- internal: cmpProp.internal,
- jsdoc: getTextDocs(cmpProp.docs),
- })),
- ...cmpMeta.virtualProperties.map((cmpProp) => ({
- name: cmpProp.name,
- type: cmpProp.type,
- optional: true,
- required: false,
- jsdoc: cmpProp.docs,
- internal: false,
- })),
- ];
- };
- /**
- * Generate a string based on the types that are defined within a component
- * @param cmp the metadata for the component that a type definition string is generated for
- * @param areTypesInternal `true` if types being generated are for a project's internal purposes, `false` otherwise
- * @returns the generated types string alongside additional metadata
- */
- const generateComponentTypes = (cmp, areTypesInternal) => {
- const tagName = cmp.tagName.toLowerCase();
- const tagNameAsPascal = dashToPascalCase$1(tagName);
- const htmlElementName = `HTML${tagNameAsPascal}Element`;
- const propAttributes = generatePropTypes(cmp);
- const methodAttributes = generateMethodTypes(cmp);
- const eventAttributes = generateEventTypes(cmp);
- const componentAttributes = attributesToMultiLineString([...propAttributes, ...methodAttributes], false, areTypesInternal);
- const isDep = cmp.isCollectionDependency;
- const jsxAttributes = attributesToMultiLineString([...propAttributes, ...eventAttributes], true, areTypesInternal);
- const element = [
- ` interface ${htmlElementName} extends Components.${tagNameAsPascal}, HTMLStencilElement {`,
- ` }`,
- ` var ${htmlElementName}: {`,
- ` prototype: ${htmlElementName};`,
- ` new (): ${htmlElementName};`,
- ` };`,
- ];
- return {
- isDep,
- tagName,
- tagNameAsPascal,
- htmlElementName,
- component: ` interface ${tagNameAsPascal} {\n${componentAttributes} }`,
- jsx: ` interface ${tagNameAsPascal} {\n${jsxAttributes} }`,
- element: element.join(`\n`),
- };
- };
- const attributesToMultiLineString = (attributes, jsxAttributes, internal) => {
- const attributesStr = sortBy(attributes, (a) => a.name)
- .filter((type) => {
- if (jsxAttributes && !internal && type.internal) {
- return false;
- }
- return true;
- })
- .reduce((fullList, type) => {
- if (type.jsdoc) {
- fullList.push(` /**`);
- fullList.push(...type.jsdoc.split('\n').map((line) => ' * ' + line));
- fullList.push(` */`);
- }
- const optional = jsxAttributes ? !type.required : type.optional;
- fullList.push(` "${type.name}"${optional ? '?' : ''}: ${type.type};`);
- return fullList;
- }, [])
- .join(`\n`);
- return attributesStr !== '' ? `${attributesStr}\n` : '';
- };
- /**
- * Find all referenced types by a component and add them to the `importDataObj` parameter
- * @param importDataObj key/value of type import file, each value is an array of imported types
- * @param allTypes an output parameter containing a map of seen types and the number of times the type has been seen
- * @param cmp the metadata associated with the component whose types are being inspected
- * @param filePath the path of the component file
- * @returns the updated import data
- */
- const updateReferenceTypeImports = (importDataObj, allTypes, cmp, filePath) => {
- const updateImportReferences = updateImportReferenceFactory(allTypes, filePath);
- return [...cmp.properties, ...cmp.events, ...cmp.methods]
- .filter((cmpProp) => cmpProp.complexType && cmpProp.complexType.references)
- .reduce((obj, cmpProp) => {
- return updateImportReferences(obj, cmpProp.complexType.references);
- }, importDataObj);
- };
- const updateImportReferenceFactory = (allTypes, filePath) => {
- function getIncrementTypeName(name) {
- const counter = allTypes.get(name);
- if (counter === undefined) {
- allTypes.set(name, 1);
- return name;
- }
- allTypes.set(name, counter + 1);
- return `${name}${counter}`;
- }
- return (obj, typeReferences) => {
- Object.keys(typeReferences)
- .map((typeName) => {
- return [typeName, typeReferences[typeName]];
- })
- .forEach(([typeName, type]) => {
- let importFileLocation;
- // If global then there is no import statement needed
- if (type.location === 'global') {
- return;
- // If local then import location is the current file
- }
- else if (type.location === 'local') {
- importFileLocation = filePath;
- }
- else if (type.location === 'import') {
- importFileLocation = type.path;
- }
- // If this is a relative path make it absolute
- if (importFileLocation.startsWith('.')) {
- importFileLocation = resolve$1(dirname(filePath), importFileLocation);
- }
- obj[importFileLocation] = obj[importFileLocation] || [];
- // If this file already has a reference to this type move on
- if (obj[importFileLocation].find((df) => df.localName === typeName)) {
- return;
- }
- const newTypeName = getIncrementTypeName(typeName);
- obj[importFileLocation].push({
- localName: typeName,
- importName: newTypeName,
- });
- });
- return obj;
- };
- };
- /**
- * Generates and writes a `components.d.ts` file to disk. This file may be written to the `src` directory of a project,
- * or be written to a directory that is meant to be distributed (e.g. the output directory of `dist-custom-elements`).
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- * @param destination the relative directory in the filesystem to write the type declaration file to
- * @returns `true` if the type declaration file written to disk has changed, `false` otherwise
- */
- const generateAppTypes = async (config, compilerCtx, buildCtx, destination) => {
- // only gather components that are still root ts files we've found and have component metadata
- // the compilerCtx cache may still have files that may have been deleted/renamed
- const timespan = buildCtx.createTimeSpan(`generated app types started`, true);
- const areTypesInternal = destination === 'src';
- // Generate d.ts files for component types
- let componentTypesFileContent = generateComponentTypesFile(config, buildCtx, areTypesInternal);
- // immediately write the components.d.ts file to disk and put it into fs memory
- let componentsDtsFilePath = getComponentsDtsSrcFilePath(config);
- if (!areTypesInternal) {
- componentsDtsFilePath = resolve$1(destination, GENERATED_DTS$1);
- componentTypesFileContent = updateStencilTypesImports(destination, componentsDtsFilePath, componentTypesFileContent);
- }
- const writeResults = await compilerCtx.fs.writeFile(componentsDtsFilePath, componentTypesFileContent, {
- immediateWrite: true,
- });
- const hasComponentsDtsChanged = writeResults.changedContent;
- const componentsDtsRelFileName = relative$1(config.rootDir, componentsDtsFilePath);
- if (hasComponentsDtsChanged) {
- config.logger.debug(`generateAppTypes: ${componentsDtsRelFileName} has changed`);
- }
- timespan.finish(`generated app types finished: ${componentsDtsRelFileName}`);
- return hasComponentsDtsChanged;
- };
- /**
- * Generates a `component.d.ts` file's contents, which contains the typings for all components in a Stencil project
- * @param config the Stencil configuration associated with the project being compiled
- * @param buildCtx the context associated with the current build
- * @param areTypesInternal determines if non-exported type definitions are being generated or not
- * @returns the contents of the `components.d.ts` file
- */
- const generateComponentTypesFile = (config, buildCtx, areTypesInternal) => {
- let typeImportData = {};
- const c = [];
- const allTypes = new Map();
- const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
- const modules = components.map((cmp) => {
- typeImportData = updateReferenceTypeImports(typeImportData, allTypes, cmp, cmp.sourceFilePath);
- return generateComponentTypes(cmp, areTypesInternal);
- });
- c.push(COMPONENTS_DTS_HEADER);
- c.push(`import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";`);
- c.push(...Object.keys(typeImportData).map((filePath) => {
- const typeData = typeImportData[filePath];
- let importFilePath;
- if (isAbsolute$1(filePath)) {
- importFilePath = normalizePath$1('./' + relative$1(config.srcDir, filePath)).replace(/\.(tsx|ts)$/, '');
- }
- else {
- importFilePath = filePath;
- }
- return `import { ${typeData
- .sort(sortImportNames)
- .map((td) => {
- if (td.localName === td.importName) {
- return `${td.importName}`;
- }
- else {
- return `${td.localName} as ${td.importName}`;
- }
- })
- .join(`, `)} } from "${importFilePath}";`;
- }));
- c.push(`export namespace Components {\n${modules.map((m) => `${m.component}`).join('\n')}\n}`);
- c.push(`declare global {`);
- c.push(...modules.map((m) => m.element));
- c.push(` interface HTMLElementTagNameMap {`);
- c.push(...modules.map((m) => ` "${m.tagName}": ${m.htmlElementName};`));
- c.push(` }`);
- c.push(`}`);
- c.push(`declare namespace LocalJSX {`);
- c.push(...modules.map((m) => ` ${m.jsx}`));
- c.push(` interface IntrinsicElements {`);
- c.push(...modules.map((m) => ` "${m.tagName}": ${m.tagNameAsPascal};`));
- c.push(` }`);
- c.push(`}`);
- c.push(`export { LocalJSX as JSX };`);
- c.push(`declare module "@stencil/core" {`);
- c.push(` export namespace JSX {`);
- c.push(` interface IntrinsicElements {`);
- c.push(...modules.map((m) => ` "${m.tagName}": LocalJSX.${m.tagNameAsPascal} & JSXBase.HTMLAttributes<${m.htmlElementName}>;`));
- c.push(` }`);
- c.push(` }`);
- c.push(`}`);
- return c.join(`\n`) + `\n`;
- };
- const generateCustomElementsBundleTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElementsBundle);
- await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput$1(config, compilerCtx, buildCtx, distDtsFilePath, outputTarget)));
- };
- const generateCustomElementsTypesOutput$1 = async (config, compilerCtx, buildCtx, distDtsFilePath, outputTarget) => {
- const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
- const componentsDtsRelPath = relDts$1(outputTarget.dir, distDtsFilePath);
- const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
- const code = [
- `/* ${config.namespace} custom elements bundle */`,
- ``,
- `import type { Components, JSX } from "${componentsDtsRelPath}";`,
- ``,
- ...components.map(generateCustomElementType$1),
- `/**`,
- ` * Utility to define all custom elements within this package using the tag name provided in the component's source. `,
- ` * When defining each custom element, it will also check it's safe to define by:`,
- ` *`,
- ` * 1. Ensuring the "customElements" registry is available in the global context (window).`,
- ` * 2. The component tag name is not already defined.`,
- ` *`,
- ` * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define) `,
- ` * method instead to define custom elements individually, or to provide a different tag name.`,
- ` */`,
- `export declare const defineCustomElements: (opts?: any) => void;`,
- ``,
- `/**`,
- ` * Used to manually set the base path where assets can be found.`,
- ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
- ` * such as "setAssetPath(import.meta.url)". Other options include`,
- ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
- ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
- ` * But do note that this configuration depends on how your script is bundled, or lack of`,
- ` * bunding, and where your assets can be loaded from. Additionally custom bundling`,
- ` * will have to ensure the static assets are copied to its build directory.`,
- ` */`,
- `export declare const setAssetPath: (path: string) => void;`,
- ``,
- `export interface SetPlatformOptions {`,
- ` raf?: (c: FrameRequestCallback) => number;`,
- ` ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
- ` rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
- ` ce?: (eventName: string, opts?: any) => CustomEvent;`,
- `}`,
- `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
- ``,
- `export type { Components, JSX };`,
- ``,
- ];
- const usersIndexJsPath = join(config.srcDir, 'index.ts');
- const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
- if (hasUserIndex) {
- const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
- code.push(`export * from '${userIndexRelPath}';`);
- }
- else {
- code.push(`export * from '${componentsDtsRelPath}';`);
- }
- await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
- outputTargetType: outputTarget.type,
- });
- };
- const generateCustomElementType$1 = (cmp) => {
- const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
- const o = [
- `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
- `export const ${tagNameAsPascal}: {`,
- ` prototype: ${tagNameAsPascal};`,
- ` new (): ${tagNameAsPascal};`,
- `};`,
- ``,
- ];
- return o.join('\n');
- };
- const relDts$1 = (fromPath, dtsPath) => {
- dtsPath = relative$1(fromPath, dtsPath);
- if (!dtsPath.startsWith('.')) {
- dtsPath = '.' + dtsPath;
- }
- return normalizePath$1(dtsPath.replace('.d.ts', ''));
- };
- /**
- * Entrypoint for generating types for one or more `dist-custom-elements` output targets defined in a Stencil project's
- * configuration
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- * @param distDtsFilePath the path to a type declaration file (.d.ts) that is being generated for the output target.
- * This path is not necessarily the `components.d.ts` file that is found in the root of a project's `src` directory.
- */
- const generateCustomElementsTypes = async (config, compilerCtx, buildCtx, distDtsFilePath) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCustomElements);
- await Promise.all(outputTargets.map((outputTarget) => generateCustomElementsTypesOutput(config, compilerCtx, buildCtx, distDtsFilePath, outputTarget)));
- };
- /**
- * Generates types for a single `dist-custom-elements` output target definition in a Stencil project's configuration
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- * @param distDtsFilePath the path to a type declaration file (.d.ts) that is being generated for the output target.
- * This path is not necessarily the `components.d.ts` file that is found in the root of a project's `src` directory.
- * @param outputTarget the output target for which types are being currently generated
- */
- const generateCustomElementsTypesOutput = async (config, compilerCtx, buildCtx, distDtsFilePath, outputTarget) => {
- const customElementsDtsPath = join(outputTarget.dir, 'index.d.ts');
- const componentsDtsRelPath = relDts(outputTarget.dir, distDtsFilePath);
- const code = [
- `/* ${config.namespace} custom elements */`,
- ``,
- `import type { Components, JSX } from "${componentsDtsRelPath}";`,
- ``,
- `/**`,
- ` * Used to manually set the base path where assets can be found.`,
- ` * If the script is used as "module", it's recommended to use "import.meta.url",`,
- ` * such as "setAssetPath(import.meta.url)". Other options include`,
- ` * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to`,
- ` * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".`,
- ` * But do note that this configuration depends on how your script is bundled, or lack of`,
- ` * bundling, and where your assets can be loaded from. Additionally custom bundling`,
- ` * will have to ensure the static assets are copied to its build directory.`,
- ` */`,
- `export declare const setAssetPath: (path: string) => void;`,
- ``,
- `export interface SetPlatformOptions {`,
- ` raf?: (c: FrameRequestCallback) => number;`,
- ` ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
- ` rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;`,
- `}`,
- `export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;`,
- ``,
- `export type { Components, JSX };`,
- ``,
- ];
- const usersIndexJsPath = join(config.srcDir, 'index.ts');
- const hasUserIndex = await compilerCtx.fs.access(usersIndexJsPath);
- if (hasUserIndex) {
- const userIndexRelPath = normalizePath$1(dirname(componentsDtsRelPath));
- code.push(`export * from '${userIndexRelPath}';`);
- }
- else {
- code.push(`export * from '${componentsDtsRelPath}';`);
- }
- await compilerCtx.fs.writeFile(customElementsDtsPath, code.join('\n') + `\n`, {
- outputTargetType: outputTarget.type,
- });
- const components = buildCtx.components.filter((m) => !m.isCollectionDependency);
- await Promise.all(components.map(async (cmp) => {
- const dtsCode = generateCustomElementType(componentsDtsRelPath, cmp);
- const fileName = `${cmp.tagName}.d.ts`;
- const filePath = join(outputTarget.dir, fileName);
- await compilerCtx.fs.writeFile(filePath, dtsCode, { outputTargetType: outputTarget.type });
- }));
- };
- /**
- * Generate a type declaration file for a specific Stencil component
- * @param componentsDtsRelPath the path to a root type declaration file from which commonly used entities can be
- * referenced from in the newly generated file
- * @param cmp the component to generate the type declaration file for
- * @returns the contents of the type declaration file for the provided `cmp`
- */
- const generateCustomElementType = (componentsDtsRelPath, cmp) => {
- const tagNameAsPascal = dashToPascalCase$1(cmp.tagName);
- const o = [
- `import type { Components, JSX } from "${componentsDtsRelPath}";`,
- ``,
- `interface ${tagNameAsPascal} extends Components.${tagNameAsPascal}, HTMLElement {}`,
- `export const ${tagNameAsPascal}: {`,
- ` prototype: ${tagNameAsPascal};`,
- ` new (): ${tagNameAsPascal};`,
- `};`,
- `/**`,
- ` * Used to define this component and all nested components recursively.`,
- ` */`,
- `export const defineCustomElement: () => void;`,
- ``,
- ];
- return o.join('\n');
- };
- /**
- * Determines the relative path between two provided paths. If a type declaration file extension is present on
- * `dtsPath`, it will be removed from the computed relative path.
- * @param fromPath the path from which to start at
- * @param dtsPath the destination path
- * @returns the relative path from the provided `fromPath` to the `dtsPath`
- */
- const relDts = (fromPath, dtsPath) => {
- dtsPath = relative$1(fromPath, dtsPath);
- if (!dtsPath.startsWith('.')) {
- dtsPath = '.' + dtsPath;
- }
- return normalizePath$1(dtsPath.replace('.d.ts', ''));
- };
- /**
- * For a single output target, generate types, then copy the Stencil core type declaration file
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- * @param outputTarget the output target to generate types for
- */
- const generateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
- if (!buildCtx.hasError) {
- await generateTypesOutput(config, compilerCtx, buildCtx, outputTarget);
- await copyStencilCoreDts(config, compilerCtx);
- }
- };
- /**
- * Generate type definition files and write them to a dist directory
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- * @param outputTarget the output target to generate types for
- */
- const generateTypesOutput = async (config, compilerCtx, buildCtx, outputTarget) => {
- // get all type declaration files in a project's src/ directory
- const srcDirItems = await compilerCtx.fs.readdir(config.srcDir, { recursive: false });
- const srcDtsFiles = srcDirItems.filter((srcItem) => srcItem.isFile && isDtsFile$1(srcItem.absPath));
- // Copy .d.ts files from src to dist
- // In addition, all references to @stencil/core are replaced
- let distDtsFilePath;
- await Promise.all(srcDtsFiles.map(async (srcDtsFile) => {
- const relPath = relative$1(config.srcDir, srcDtsFile.absPath);
- const distPath = join(outputTarget.typesDir, relPath);
- const originalDtsContent = await compilerCtx.fs.readFile(srcDtsFile.absPath);
- const distDtsContent = updateStencilTypesImports(outputTarget.typesDir, distPath, originalDtsContent);
- await compilerCtx.fs.writeFile(distPath, distDtsContent);
- distDtsFilePath = distPath;
- }));
- const distPath = outputTarget.typesDir;
- await generateAppTypes(config, compilerCtx, buildCtx, distPath);
- if (distDtsFilePath) {
- await generateCustomElementsTypes(config, compilerCtx, buildCtx, distDtsFilePath);
- await generateCustomElementsBundleTypes(config, compilerCtx, buildCtx, distDtsFilePath);
- }
- };
- /**
- * Entrypoint for generating types for all output targets
- * @param config the Stencil configuration associated with the project being compiled
- * @param compilerCtx the current compiler context
- * @param buildCtx the context associated with the current build
- */
- const outputTypes = async (config, compilerCtx, buildCtx) => {
- const outputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
- if (outputTargets.length === 0) {
- return;
- }
- const timespan = buildCtx.createTimeSpan(`generate types started`, true);
- await Promise.all(outputTargets.map((outputsTarget) => generateTypes(config, compilerCtx, buildCtx, outputsTarget)));
- timespan.finish(`generate types finished`);
- };
- const generateOutputTargets = async (config, compilerCtx, buildCtx) => {
- const timeSpan = buildCtx.createTimeSpan('generate outputs started', true);
- const changedModuleFiles = Array.from(compilerCtx.changedModules)
- .map((filename) => compilerCtx.moduleMap.get(filename))
- .filter((mod) => mod && !mod.isCollectionDependency);
- compilerCtx.changedModules.clear();
- invalidateRollupCaches(compilerCtx);
- await Promise.all([
- outputAngular(config, compilerCtx, buildCtx),
- outputCopy(config, compilerCtx, buildCtx),
- outputCollection(config, compilerCtx, buildCtx, changedModuleFiles),
- outputCustomElements(config, compilerCtx, buildCtx),
- outputCustomElementsBundle(config, compilerCtx, buildCtx),
- outputHydrateScript(config, compilerCtx, buildCtx),
- outputLazyLoader(config, compilerCtx),
- outputLazy(config, compilerCtx, buildCtx),
- outputWww(config, compilerCtx, buildCtx),
- ]);
- // must run after all the other outputs
- // since it validates files were created
- await outputDocs(config, compilerCtx, buildCtx);
- await outputTypes(config, compilerCtx, buildCtx);
- timeSpan.finish('generate outputs finished');
- };
- const invalidateRollupCaches = (compilerCtx) => {
- const invalidatedIds = compilerCtx.changedFiles;
- compilerCtx.rollupCache.forEach((cache) => {
- cache.modules.forEach((mod) => {
- if (mod.transformDependencies.some((id) => invalidatedIds.has(id))) {
- mod.originalCode = null;
- }
- });
- });
- };
- const getDeclarationParameters = (decorator) => {
- if (!t.isCallExpression(decorator.expression)) {
- return [];
- }
- return decorator.expression.arguments.map(getDeclarationParameter);
- };
- const getDeclarationParameter = (arg) => {
- if (t.isObjectLiteralExpression(arg)) {
- return objectLiteralToObjectMap(arg);
- }
- else if (t.isStringLiteral(arg)) {
- return arg.text;
- }
- throw new Error(`invalid decorator argument: ${arg.getText()}`);
- };
- /**
- * Returns a function that checks if a decorator:
- * - is a call expression. these are decorators that are immediately followed by open/close parenthesis with optional
- * arg(s), e.g. `@Prop()`
- * - the name of the decorator matches the provided `propName`
- *
- * @param propName the name of the decorator to match against
- * @returns true if the conditions above are both true, false otherwise
- */
- const isDecoratorNamed = (propName) => {
- return (dec) => {
- return t.isCallExpression(dec.expression) && dec.expression.expression.getText() === propName;
- };
- };
- const styleToStatic = (newMembers, componentOptions) => {
- const defaultModeStyles = [];
- if (componentOptions.styleUrls) {
- if (Array.isArray(componentOptions.styleUrls)) {
- defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls));
- }
- else {
- defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrls[DEFAULT_STYLE_MODE]));
- }
- }
- if (componentOptions.styleUrl) {
- defaultModeStyles.push(...normalizeStyleUrl(componentOptions.styleUrl));
- }
- let styleUrls = {};
- if (componentOptions.styleUrls && !Array.isArray(componentOptions.styleUrls)) {
- styleUrls = normalizeStyleUrls(componentOptions.styleUrls);
- }
- if (defaultModeStyles.length > 0) {
- styleUrls[DEFAULT_STYLE_MODE] = defaultModeStyles;
- }
- if (Object.keys(styleUrls).length > 0) {
- const originalStyleUrls = convertValueToLiteral(styleUrls);
- newMembers.push(createStaticGetter('originalStyleUrls', originalStyleUrls));
- const norlizedStyleExt = normalizeExtension(styleUrls);
- const normalizedStyleExp = convertValueToLiteral(norlizedStyleExt);
- newMembers.push(createStaticGetter('styleUrls', normalizedStyleExp));
- }
- if (typeof componentOptions.styles === 'string') {
- const styles = componentOptions.styles.trim();
- if (styles.length > 0) {
- // @Component({
- // styles: ":host {...}"
- // })
- newMembers.push(createStaticGetter('styles', t.createLiteral(styles)));
- }
- }
- else if (componentOptions.styles) {
- const convertIdentifier = componentOptions.styles;
- if (convertIdentifier.__identifier) {
- // import styles from './styles.css';
- // @Component({
- // styles
- // })
- const stylesIdentifier = convertIdentifier.__escapedText;
- newMembers.push(createStaticGetter('styles', t.createIdentifier(stylesIdentifier)));
- }
- else if (typeof convertIdentifier === 'object') {
- // import ios from './ios.css';
- // import md from './md.css';
- // @Component({
- // styles: {
- // ios
- // md
- // }
- // })
- if (Object.keys(convertIdentifier).length > 0) {
- newMembers.push(createStaticGetter('styles', convertValueToLiteral(convertIdentifier)));
- }
- }
- }
- };
- const normalizeExtension = (styleUrls) => {
- const compilerStyleUrls = {};
- Object.keys(styleUrls).forEach((key) => {
- compilerStyleUrls[key] = styleUrls[key].map((s) => useCss(s));
- });
- return compilerStyleUrls;
- };
- const useCss = (stylePath) => {
- const sourceFileDir = dirname(stylePath);
- const sourceFileExt = extname$1(stylePath);
- const sourceFileName = basename(stylePath, sourceFileExt);
- return join(sourceFileDir, sourceFileName + '.css');
- };
- const normalizeStyleUrls = (styleUrls) => {
- const compilerStyleUrls = {};
- Object.keys(styleUrls).forEach((key) => {
- compilerStyleUrls[key] = normalizeStyleUrl(styleUrls[key]);
- });
- return compilerStyleUrls;
- };
- const normalizeStyleUrl = (style) => {
- if (Array.isArray(style)) {
- return style;
- }
- if (style) {
- return [style];
- }
- return [];
- };
- const componentDecoratorToStatic = (config, typeChecker, diagnostics, cmpNode, newMembers, componentDecorator) => {
- const [componentOptions] = getDeclarationParameters(componentDecorator);
- if (!componentOptions) {
- return;
- }
- if (!validateComponent(config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator)) {
- return;
- }
- newMembers.push(createStaticGetter('is', convertValueToLiteral(componentOptions.tag.trim())));
- if (componentOptions.shadow) {
- newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('shadow')));
- if (typeof componentOptions.shadow !== 'boolean') {
- if (componentOptions.shadow.delegatesFocus === true) {
- newMembers.push(createStaticGetter('delegatesFocus', convertValueToLiteral(true)));
- }
- }
- }
- else if (componentOptions.scoped) {
- newMembers.push(createStaticGetter('encapsulation', convertValueToLiteral('scoped')));
- }
- styleToStatic(newMembers, componentOptions);
- const assetsDirs = componentOptions.assetsDirs || [];
- if (isString$1(componentOptions.assetsDir)) {
- assetsDirs.push(componentOptions.assetsDir);
- const warn = buildWarn(diagnostics);
- warn.messageText = `@Component option "assetsDir" should be renamed to "assetsDirs" and the value should be an array of strings.`;
- augmentDiagnosticWithNode(warn, componentDecorator);
- }
- if (assetsDirs.length > 0) {
- newMembers.push(createStaticGetter('assetsDirs', convertValueToLiteral(assetsDirs)));
- }
- };
- const validateComponent = (config, diagnostics, typeChecker, componentOptions, cmpNode, componentDecorator) => {
- const extendNode = cmpNode.heritageClauses && cmpNode.heritageClauses.find((c) => c.token === t.SyntaxKind.ExtendsKeyword);
- if (extendNode) {
- const err = buildError(diagnostics);
- err.messageText = `Classes decorated with @Component can not extend from a base class.
- Stencil needs to be able to switch between different base classes in order to implement the different output targets such as: lazy and raw web components.`;
- augmentDiagnosticWithNode(err, extendNode);
- return false;
- }
- if (componentOptions.shadow && componentOptions.scoped) {
- const err = buildError(diagnostics);
- err.messageText = `Components cannot be "scoped" and "shadow" at the same time, they are mutually exclusive configurations.`;
- augmentDiagnosticWithNode(err, findTagNode('scoped', componentDecorator));
- return false;
- }
- const constructor = cmpNode.members.find(t.isConstructorDeclaration);
- if (constructor && constructor.parameters.length > 0) {
- const err = buildError(diagnostics);
- err.messageText = `Classes decorated with @Component can not have a "constructor" that takes arguments.
- All data required by a component must be passed by using class properties decorated with @Prop()`;
- augmentDiagnosticWithNode(err, constructor.parameters[0]);
- return false;
- }
- // check if class has more than one decorator
- const otherDecorator = cmpNode.decorators && cmpNode.decorators.find((d) => d !== componentDecorator);
- if (otherDecorator) {
- const err = buildError(diagnostics);
- err.messageText = `Classes decorated with @Component can not be decorated with more decorators.
- Stencil performs extensive static analysis on top of your components in order to generate the necessary metadata, runtime decorators at the components level make this task very hard.`;
- augmentDiagnosticWithNode(err, otherDecorator);
- return false;
- }
- const tag = componentOptions.tag;
- if (typeof tag !== 'string' || tag.trim().length === 0) {
- const err = buildError(diagnostics);
- err.messageText = `tag missing in component decorator`;
- augmentDiagnosticWithNode(err, componentDecorator);
- return false;
- }
- const tagError = validateComponentTag(tag);
- if (tagError) {
- const err = buildError(diagnostics);
- err.messageText = `${tagError}. Please refer to https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name for more info.`;
- augmentDiagnosticWithNode(err, findTagNode('tag', componentDecorator));
- return false;
- }
- if (!config._isTesting) {
- const nonTypeExports = typeChecker
- .getExportsOfModule(typeChecker.getSymbolAtLocation(cmpNode.getSourceFile()))
- .filter((symbol) => (symbol.flags & (t.SymbolFlags.Interface | t.SymbolFlags.TypeAlias)) === 0)
- .filter((symbol) => symbol.name !== cmpNode.name.text);
- nonTypeExports.forEach((symbol) => {
- const err = buildError(diagnostics);
- err.messageText = `To allow efficient bundling, modules using @Component() can only have a single export which is the component class itself.
- Any other exports should be moved to a separate file.
- For further information check out: https://stenciljs.com/docs/module-bundling`;
- const errorNode = symbol.valueDeclaration ? symbol.valueDeclaration : symbol.declarations[0];
- augmentDiagnosticWithNode(err, errorNode);
- });
- if (nonTypeExports.length > 0) {
- return false;
- }
- }
- return true;
- };
- const findTagNode = (propName, node) => {
- if (t.isDecorator(node) && t.isCallExpression(node.expression)) {
- const arg = node.expression.arguments[0];
- if (t.isObjectLiteralExpression(arg)) {
- arg.properties.forEach((p) => {
- if (t.isPropertyAssignment(p)) {
- if (p.name.getText() === propName) {
- node = p.initializer;
- }
- }
- });
- }
- }
- return node;
- };
- const elementDecoratorsToStatic = (diagnostics, decoratedMembers, typeChecker, newMembers) => {
- const elementRefs = decoratedMembers
- .filter(t.isPropertyDeclaration)
- .map((prop) => parseElementDecorator(diagnostics, typeChecker, prop))
- .filter((element) => !!element);
- if (elementRefs.length > 0) {
- newMembers.push(createStaticGetter('elementRef', t.createLiteral(elementRefs[0])));
- if (elementRefs.length > 1) {
- const error = buildError(diagnostics);
- error.messageText = `It's not valid to add more than one Element() decorator`;
- }
- }
- };
- const parseElementDecorator = (_diagnostics, _typeChecker, prop) => {
- const elementDecorator = prop.decorators && prop.decorators.find(isDecoratorNamed('Element'));
- if (elementDecorator == null) {
- return null;
- }
- return prop.name.getText();
- };
- const eventDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, newMembers) => {
- const events = decoratedProps
- .filter(t.isPropertyDeclaration)
- .map((prop) => parseEventDecorator(diagnostics, typeChecker, prop))
- .filter((ev) => !!ev);
- if (events.length > 0) {
- newMembers.push(createStaticGetter('events', convertValueToLiteral(events)));
- }
- };
- const parseEventDecorator = (diagnostics, typeChecker, prop) => {
- const eventDecorator = prop.decorators.find(isDecoratorNamed('Event'));
- if (eventDecorator == null) {
- return null;
- }
- const memberName = prop.name.getText();
- if (!memberName) {
- return null;
- }
- const [eventOpts] = getDeclarationParameters(eventDecorator);
- const symbol = typeChecker.getSymbolAtLocation(prop.name);
- const eventName = getEventName(eventOpts, memberName);
- validateEventName(diagnostics, prop.name, eventName);
- const eventMeta = {
- method: memberName,
- name: eventName,
- bubbles: eventOpts && typeof eventOpts.bubbles === 'boolean' ? eventOpts.bubbles : true,
- cancelable: eventOpts && typeof eventOpts.cancelable === 'boolean' ? eventOpts.cancelable : true,
- composed: eventOpts && typeof eventOpts.composed === 'boolean' ? eventOpts.composed : true,
- docs: serializeSymbol(typeChecker, symbol),
- complexType: getComplexType$1(typeChecker, prop),
- };
- validateReferences(diagnostics, eventMeta.complexType.references, prop.type);
- return eventMeta;
- };
- const getEventName = (eventOptions, memberName) => {
- if (eventOptions && typeof eventOptions.eventName === 'string' && eventOptions.eventName.trim().length > 0) {
- // always use the event name if given
- return eventOptions.eventName.trim();
- }
- return memberName;
- };
- const getComplexType$1 = (typeChecker, node) => {
- const sourceFile = node.getSourceFile();
- const eventType = node.type ? getEventType(node.type) : null;
- return {
- original: eventType ? eventType.getText() : 'any',
- resolved: eventType ? resolveType(typeChecker, typeChecker.getTypeFromTypeNode(eventType)) : 'any',
- references: eventType ? getAttributeTypeInfo(eventType, sourceFile) : {},
- };
- };
- const getEventType = (type) => {
- if (t.isTypeReferenceNode(type) &&
- t.isIdentifier(type.typeName) &&
- type.typeName.text === 'EventEmitter' &&
- type.typeArguments &&
- type.typeArguments.length > 0) {
- return type.typeArguments[0];
- }
- return null;
- };
- const validateEventName = (diagnostics, node, eventName) => {
- if (/^[A-Z]/.test(eventName)) {
- const diagnostic = buildWarn(diagnostics);
- diagnostic.messageText = [
- `In order to be compatible with all event listeners on elements, the event name `,
- `cannot start with a capital letter. `,
- `Please lowercase the first character for the event to best work with all listeners.`,
- ].join('');
- augmentDiagnosticWithNode(diagnostic, node);
- return;
- }
- if (/^on[A-Z]/.test(eventName)) {
- const warn = buildWarn(diagnostics);
- const suggestedEventName = eventName[2].toLowerCase() + eventName.slice(3);
- warn.messageText = `Events decorated with @Event() should describe the actual DOM event name, not the handler. In other words "${eventName}" would be better named as "${suggestedEventName}".`;
- augmentDiagnosticWithNode(warn, node);
- return;
- }
- if (DOM_EVENT_NAMES.has(eventName.toLowerCase())) {
- const diagnostic = buildWarn(diagnostics);
- diagnostic.messageText = `The event name conflicts with the "${eventName}" native DOM event name.`;
- augmentDiagnosticWithNode(diagnostic, node);
- return;
- }
- };
- const DOM_EVENT_NAMES = new Set([
- 'CheckboxStateChange',
- 'DOMContentLoaded',
- 'DOMMenuItemActive',
- 'DOMMenuItemInactive',
- 'DOMMouseScroll',
- 'MSManipulationStateChanged',
- 'MSPointerHover',
- 'MozAudioAvailable',
- 'MozGamepadButtonDown',
- 'MozGamepadButtonUp',
- 'MozMousePixelScroll',
- 'MozOrientation',
- 'MozScrolledAreaChanged',
- 'RadioStateChange',
- 'SVGAbort',
- 'SVGError',
- 'SVGLoad',
- 'SVGResize',
- 'SVGScroll',
- 'SVGUnload',
- 'SVGZoom',
- 'abort',
- 'afterprint',
- 'afterscriptexecute',
- 'alerting',
- 'animationcancel',
- 'animationend',
- 'animationiteration',
- 'animationstart',
- 'appinstalled',
- 'audioend',
- 'audioprocess',
- 'audiostart',
- 'auxclick',
- 'beforeinstallprompt',
- 'beforeprint',
- 'beforescriptexecute',
- 'beforeunload',
- 'beginEvent',
- 'blur',
- 'boundary',
- 'broadcast',
- 'busy',
- 'callschanged',
- 'canplay',
- 'canplaythrough',
- 'cardstatechange',
- 'cfstatechange',
- 'change',
- 'chargingchange',
- 'chargingtimechange',
- 'checking',
- 'click',
- 'command',
- 'commandupdate',
- 'compassneedscalibration',
- 'complete',
- 'compositionend',
- 'compositionstart',
- 'compositionupdate',
- 'connected',
- 'connecting',
- 'connectionInfoUpdate',
- 'contextmenu',
- 'copy',
- 'cut',
- 'datachange',
- 'dataerror',
- 'dblclick',
- 'delivered',
- 'devicechange',
- 'devicemotion',
- 'deviceorientation',
- 'dialing',
- 'disabled',
- 'dischargingtimechange',
- 'disconnected',
- 'disconnecting',
- 'downloading',
- 'drag',
- 'dragend',
- 'dragenter',
- 'dragleave',
- 'dragover',
- 'dragstart',
- 'drop',
- 'durationchange',
- 'emptied',
- 'enabled',
- 'end',
- 'endEvent',
- 'ended',
- 'error',
- 'focus',
- 'focusin',
- 'focusout',
- 'fullscreenchange',
- 'fullscreenerror',
- 'gamepadconnected',
- 'gamepaddisconnected',
- 'gotpointercapture',
- 'hashchange',
- 'held',
- 'holding',
- 'icccardlockerror',
- 'iccinfochange',
- 'incoming',
- 'input',
- 'invalid',
- 'keydown',
- 'keypress',
- 'keyup',
- 'languagechange',
- 'levelchange',
- 'load',
- 'loadeddata',
- 'loadedmetadata',
- 'loadend',
- 'loadstart',
- 'localized',
- 'lostpointercapture',
- 'mark',
- 'message',
- 'messageerror',
- 'mousedown',
- 'mouseenter',
- 'mouseleave',
- 'mousemove',
- 'mouseout',
- 'mouseover',
- 'mouseup',
- 'mousewheel',
- 'mozbrowseractivitydone',
- 'mozbrowserasyncscroll',
- 'mozbrowseraudioplaybackchange',
- 'mozbrowsercaretstatechanged',
- 'mozbrowserclose',
- 'mozbrowsercontextmenu',
- 'mozbrowserdocumentfirstpaint',
- 'mozbrowsererror',
- 'mozbrowserfindchange',
- 'mozbrowserfirstpaint',
- 'mozbrowsericonchange',
- 'mozbrowserloadend',
- 'mozbrowserloadstart',
- 'mozbrowserlocationchange',
- 'mozbrowsermanifestchange',
- 'mozbrowsermetachange',
- 'mozbrowseropensearch',
- 'mozbrowseropentab',
- 'mozbrowseropenwindow',
- 'mozbrowserresize',
- 'mozbrowserscroll',
- 'mozbrowserscrollareachanged',
- 'mozbrowserscrollviewchange',
- 'mozbrowsersecuritychange',
- 'mozbrowserselectionstatechanged',
- 'mozbrowsershowmodalprompt',
- 'mozbrowsertitlechange',
- 'mozbrowserusernameandpasswordrequired',
- 'mozbrowservisibilitychange',
- 'moztimechange',
- 'msContentZoom',
- 'nomatch',
- 'notificationclick',
- 'noupdate',
- 'obsolete',
- 'offline',
- 'online',
- 'orientationchange',
- 'overflow',
- 'pagehide',
- 'pageshow',
- 'paste',
- 'pause',
- 'play',
- 'playing',
- 'pointercancel',
- 'pointerdown',
- 'pointerenter',
- 'pointerleave',
- 'pointerlockchange',
- 'pointerlockerror',
- 'pointermove',
- 'pointerout',
- 'pointerover',
- 'pointerup',
- 'popstate',
- 'popuphidden',
- 'popuphiding',
- 'popupshowing',
- 'popupshown',
- 'progress',
- 'push',
- 'pushsubscriptionchange',
- 'ratechange',
- 'readystatechange',
- 'received',
- 'repeatEvent',
- 'reset',
- 'resize',
- 'resourcetimingbufferfull',
- 'result',
- 'resume',
- 'resuming',
- 'scroll',
- 'seeked',
- 'seeking',
- 'select',
- 'selectionchange',
- 'selectstart',
- 'sent',
- 'show',
- 'slotchange',
- 'smartcard-insert',
- 'smartcard-remove',
- 'soundend',
- 'soundstart',
- 'speechend',
- 'speechstart',
- 'stalled',
- 'start',
- 'statechange',
- 'statuschange',
- 'stkcommand',
- 'stksessionend',
- 'storage',
- 'submit',
- 'suspend',
- 'timeout',
- 'timeupdate',
- 'touchcancel',
- 'touchend',
- 'touchenter',
- 'touchleave',
- 'touchmove',
- 'touchstart',
- 'transitioncancel',
- 'transitionend',
- 'transitionrun',
- 'transitionstart',
- 'underflow',
- 'unload',
- 'updateready',
- 'userproximity',
- 'ussdreceived',
- 'visibilitychange',
- 'voicechange',
- 'voiceschanged',
- 'volumechange',
- 'vrdisplayactivate',
- 'vrdisplayblur',
- 'vrdisplayconnect',
- 'vrdisplaydeactivate',
- 'vrdisplaydisconnect',
- 'vrdisplayfocus',
- 'vrdisplaypresentchange',
- 'waiting',
- 'wheel',
- ].map((e) => e.toLowerCase()));
- const listenDecoratorsToStatic = (diagnostics, decoratedMembers, newMembers) => {
- const listeners = decoratedMembers
- .filter(t.isMethodDeclaration)
- .map((method) => parseListenDecorators(diagnostics, method));
- const flatListeners = flatOne(listeners);
- if (flatListeners.length > 0) {
- newMembers.push(createStaticGetter('listeners', convertValueToLiteral(flatListeners)));
- }
- };
- const parseListenDecorators = (diagnostics, method) => {
- const listenDecorators = method.decorators.filter(isDecoratorNamed('Listen'));
- if (listenDecorators.length === 0) {
- return [];
- }
- return listenDecorators.map((listenDecorator) => {
- const methodName = method.name.getText();
- const [listenText, listenOptions] = getDeclarationParameters(listenDecorator);
- const eventNames = listenText.split(',');
- if (eventNames.length > 1) {
- const err = buildError(diagnostics);
- err.messageText = 'Please use multiple @Listen() decorators instead of comma-separated names.';
- augmentDiagnosticWithNode(err, listenDecorator);
- }
- const listener = parseListener(eventNames[0], listenOptions, methodName);
- if (listener.target === 'parent') {
- const err = buildError(diagnostics);
- err.messageText =
- 'The "parent" target is no longer available as of Stencil 2. Please use "window", "document" or "body" instead.';
- augmentDiagnosticWithNode(err, listenDecorator);
- }
- return listener;
- });
- };
- const parseListener = (eventName, opts = {}, methodName) => {
- const rawEventName = eventName.trim();
- const listener = {
- name: rawEventName,
- method: methodName,
- target: opts.target,
- capture: typeof opts.capture === 'boolean' ? opts.capture : false,
- passive: typeof opts.passive === 'boolean'
- ? opts.passive
- : // if the event name is kown to be a passive event then set it to true
- PASSIVE_TRUE_DEFAULTS.has(rawEventName.toLowerCase()),
- };
- return listener;
- };
- const PASSIVE_TRUE_DEFAULTS = new Set([
- 'dragstart',
- 'drag',
- 'dragend',
- 'dragenter',
- 'dragover',
- 'dragleave',
- 'drop',
- 'mouseenter',
- 'mouseover',
- 'mousemove',
- 'mousedown',
- 'mouseup',
- 'mouseleave',
- 'mouseout',
- 'mousewheel',
- 'pointerover',
- 'pointerenter',
- 'pointerdown',
- 'pointermove',
- 'pointerup',
- 'pointercancel',
- 'pointerout',
- 'pointerleave',
- 'resize',
- 'scroll',
- 'touchstart',
- 'touchmove',
- 'touchend',
- 'touchenter',
- 'touchleave',
- 'touchcancel',
- 'wheel',
- ]);
- /**
- * Determine if a public class member collides with a reserved name for HTML elements, nodes, or JSX
- * @param diagnostics a collection of compiler diagnostics. If a naming collision is found, a diagnostic detected must
- * be added to this collection
- * @param memberName the name of the class member to check for collision
- * @param decorator the decorator associated with the class member, used in providing richer error diagnostics
- * @param memberType a string representing the class member's type. e.g. 'prop'. Used in providing richer error
- * diagnostics
- * @param node the TypeScript AST node at which the class member is defined
- */
- const validatePublicName = (diagnostics, memberName, decorator, memberType, node) => {
- if (RESERVED_PUBLIC_MEMBERS.has(memberName.toLowerCase())) {
- const warn = buildWarn(diagnostics);
- warn.messageText = [
- `The ${decorator} name "${memberName}" is a reserved public name. `,
- `Please rename the "${memberName}" ${memberType} so it does not conflict with an existing standardized prototype member. `,
- `Reusing ${memberType} names that are already defined on the element's prototype may cause `,
- `unexpected runtime errors or user-interface issues on various browsers, so it's best to avoid them entirely.`,
- ].join('');
- augmentDiagnosticWithNode(warn, node);
- return;
- }
- };
- const HTML_ELEMENT_KEYS = [
- 'title',
- 'lang',
- 'translate',
- 'dir',
- // 'dataset',
- // 'hidden',
- 'tabIndex',
- 'accessKey',
- 'draggable',
- // 'spellcheck',
- // 'autocapitalize',
- 'contentEditable',
- 'isContentEditable',
- // 'inputMode',
- 'offsetParent',
- 'offsetTop',
- 'offsetLeft',
- 'offsetWidth',
- 'offsetHeight',
- 'style',
- 'innerText',
- 'outerText',
- 'oncopy',
- 'oncut',
- 'onpaste',
- 'onabort',
- 'onblur',
- 'oncancel',
- 'oncanplay',
- 'oncanplaythrough',
- 'onchange',
- 'onclick',
- 'onclose',
- 'oncontextmenu',
- 'oncuechange',
- 'ondblclick',
- 'ondrag',
- 'ondragend',
- 'ondragenter',
- 'ondragleave',
- 'ondragover',
- 'ondragstart',
- 'ondrop',
- 'ondurationchange',
- 'onemptied',
- 'onended',
- 'onerror',
- 'onfocus',
- 'onfocusin',
- 'onfocusout',
- 'oninput',
- 'oninvalid',
- 'onkeydown',
- 'onkeypress',
- 'onkeyup',
- 'onload',
- 'onloadeddata',
- 'onloadedmetadata',
- 'onloadstart',
- 'onmousedown',
- 'onmouseenter',
- 'onmouseleave',
- 'onmousemove',
- 'onmouseout',
- 'onmouseover',
- 'onmouseup',
- 'onmousewheel',
- 'onpause',
- 'onplay',
- 'onplaying',
- 'onprogress',
- 'onratechange',
- 'onreset',
- 'onresize',
- 'onscroll',
- 'onseeked',
- 'onseeking',
- 'onselect',
- 'onstalled',
- 'onsubmit',
- 'onsuspend',
- 'ontimeupdate',
- 'ontoggle',
- 'onvolumechange',
- 'onwaiting',
- 'onwheel',
- 'onauxclick',
- 'ongotpointercapture',
- 'onlostpointercapture',
- 'onpointerdown',
- 'onpointermove',
- 'onpointerup',
- 'onpointercancel',
- 'onpointerover',
- 'onpointerout',
- 'onpointerenter',
- 'onpointerleave',
- 'onselectstart',
- 'onselectionchange',
- 'nonce',
- 'click',
- 'focus',
- 'blur',
- ];
- const ELEMENT_KEYS = [
- 'namespaceURI',
- 'prefix',
- 'localName',
- 'tagName',
- 'id',
- 'className',
- 'classList',
- 'slot',
- 'attributes',
- 'shadowRoot',
- 'assignedSlot',
- 'innerHTML',
- 'outerHTML',
- 'scrollTop',
- 'scrollLeft',
- 'scrollWidth',
- 'scrollHeight',
- 'clientTop',
- 'clientLeft',
- 'clientWidth',
- 'clientHeight',
- 'attributeStyleMap',
- 'onbeforecopy',
- 'onbeforecut',
- 'onbeforepaste',
- 'onsearch',
- 'previousElementSibling',
- 'nextElementSibling',
- 'children',
- 'firstElementChild',
- 'lastElementChild',
- 'childElementCount',
- 'onfullscreenchange',
- 'onfullscreenerror',
- 'onwebkitfullscreenchange',
- 'onwebkitfullscreenerror',
- 'setPointerCapture',
- 'releasePointerCapture',
- 'hasPointerCapture',
- 'hasAttributes',
- 'getAttributeNames',
- 'getAttribute',
- 'getAttributeNS',
- 'setAttribute',
- 'setAttributeNS',
- 'removeAttribute',
- 'removeAttributeNS',
- 'hasAttribute',
- 'hasAttributeNS',
- 'toggleAttribute',
- 'getAttributeNode',
- 'getAttributeNodeNS',
- 'setAttributeNode',
- 'setAttributeNodeNS',
- 'removeAttributeNode',
- 'closest',
- 'matches',
- 'webkitMatchesSelector',
- 'attachShadow',
- 'getElementsByTagName',
- 'getElementsByTagNameNS',
- 'getElementsByClassName',
- 'insertAdjacentElement',
- 'insertAdjacentText',
- 'insertAdjacentHTML',
- 'requestPointerLock',
- 'getClientRects',
- 'getBoundingClientRect',
- 'scrollIntoView',
- 'scroll',
- 'scrollTo',
- 'scrollBy',
- 'scrollIntoViewIfNeeded',
- 'animate',
- 'computedStyleMap',
- 'before',
- 'after',
- 'replaceWith',
- 'remove',
- 'prepend',
- 'append',
- 'querySelector',
- 'querySelectorAll',
- 'requestFullscreen',
- 'webkitRequestFullScreen',
- 'webkitRequestFullscreen',
- 'part',
- 'createShadowRoot',
- 'getDestinationInsertionPoints',
- ];
- const NODE_KEYS = [
- 'ELEMENT_NODE',
- 'ATTRIBUTE_NODE',
- 'TEXT_NODE',
- 'CDATA_SECTION_NODE',
- 'ENTITY_REFERENCE_NODE',
- 'ENTITY_NODE',
- 'PROCESSING_INSTRUCTION_NODE',
- 'COMMENT_NODE',
- 'DOCUMENT_NODE',
- 'DOCUMENT_TYPE_NODE',
- 'DOCUMENT_FRAGMENT_NODE',
- 'NOTATION_NODE',
- 'DOCUMENT_POSITION_DISCONNECTED',
- 'DOCUMENT_POSITION_PRECEDING',
- 'DOCUMENT_POSITION_FOLLOWING',
- 'DOCUMENT_POSITION_CONTAINS',
- 'DOCUMENT_POSITION_CONTAINED_BY',
- 'DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC',
- 'nodeType',
- 'nodeName',
- 'baseURI',
- 'isConnected',
- 'ownerDocument',
- 'parentNode',
- 'parentElement',
- 'childNodes',
- 'firstChild',
- 'lastChild',
- 'previousSibling',
- 'nextSibling',
- 'nodeValue',
- 'textContent',
- 'hasChildNodes',
- 'getRootNode',
- 'normalize',
- 'cloneNode',
- 'isEqualNode',
- 'isSameNode',
- 'compareDocumentPosition',
- 'contains',
- 'lookupPrefix',
- 'lookupNamespaceURI',
- 'isDefaultNamespace',
- 'insertBefore',
- 'appendChild',
- 'replaceChild',
- 'removeChild',
- ];
- const JSX_KEYS = ['ref', 'key'];
- const ALL_KEYS = [...HTML_ELEMENT_KEYS, ...ELEMENT_KEYS, ...NODE_KEYS, ...JSX_KEYS].map((p) => p.toLowerCase());
- const RESERVED_PUBLIC_MEMBERS = new Set(ALL_KEYS);
- const methodDecoratorsToStatic = (config, diagnostics, cmpNode, decoratedProps, typeChecker, newMembers) => {
- const tsSourceFile = cmpNode.getSourceFile();
- const methods = decoratedProps
- .filter(t.isMethodDeclaration)
- .map((method) => parseMethodDecorator(config, diagnostics, tsSourceFile, typeChecker, method))
- .filter((method) => !!method);
- if (methods.length > 0) {
- newMembers.push(createStaticGetter('methods', t.createObjectLiteral(methods, true)));
- }
- };
- const parseMethodDecorator = (config, diagnostics, tsSourceFile, typeChecker, method) => {
- const methodDecorator = method.decorators.find(isDecoratorNamed('Method'));
- if (methodDecorator == null) {
- return null;
- }
- const methodName = method.name.getText();
- const flags = t.TypeFormatFlags.WriteArrowStyleSignature | t.TypeFormatFlags.NoTruncation;
- const signature = typeChecker.getSignatureFromDeclaration(method);
- const returnType = typeChecker.getReturnTypeOfSignature(signature);
- const returnTypeNode = typeChecker.typeToTypeNode(returnType, method, t.NodeBuilderFlags.NoTruncation | t.NodeBuilderFlags.NoTypeReduction);
- let returnString = typeToString(typeChecker, returnType);
- let signatureString = typeChecker.signatureToString(signature, method, flags, t.SignatureKind.Call);
- if (!config._isTesting) {
- if (returnString === 'void') {
- const warn = buildWarn(diagnostics);
- warn.header = '@Method requires async';
- warn.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
- augmentDiagnosticWithNode(warn, method.name);
- returnString = 'Promise<void>';
- signatureString = signatureString.replace(/=> void$/, '=> Promise<void>');
- }
- else if (!isTypePromise(returnString)) {
- const err = buildError(diagnostics);
- err.header = '@Method requires async';
- err.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`;
- augmentDiagnosticWithNode(err, method.name);
- }
- }
- if (isMemberPrivate(method)) {
- const err = buildError(diagnostics);
- err.messageText =
- 'Methods decorated with the @Method() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/methods';
- augmentDiagnosticWithNode(err, method.modifiers[0]);
- }
- // Validate if the method name does not conflict with existing public names
- validatePublicName(diagnostics, methodName, '@Method()', 'method', method.name);
- const methodMeta = {
- complexType: {
- signature: signatureString,
- parameters: signature.parameters.map((symbol) => serializeSymbol(typeChecker, symbol)),
- references: {
- ...getAttributeTypeInfo(returnTypeNode, tsSourceFile),
- ...getAttributeTypeInfo(method, tsSourceFile),
- },
- return: returnString,
- },
- docs: {
- text: t.displayPartsToString(signature.getDocumentationComment(typeChecker)),
- tags: mapJSDocTagInfo(signature.getJsDocTags()),
- },
- };
- validateReferences(diagnostics, methodMeta.complexType.references, method.type || method.name);
- const staticProp = t.createPropertyAssignment(t.createLiteral(methodName), convertValueToLiteral(methodMeta));
- return staticProp;
- };
- const isTypePromise = (typeStr) => {
- return /^Promise<.+>$/.test(typeStr);
- };
- const validateMethods = (diagnostics, members) => {
- members.filter(t.isMethodDeclaration).map((method) => {
- if (method.name.getText() === 'componentDidUnload') {
- const err = buildError(diagnostics);
- err.header = `Replace "componentDidUnload()" with "disconnectedCallback()"`;
- err.messageText = `The "componentDidUnload()" method was removed in Stencil 2. Please use the "disconnectedCallback()" method instead.`;
- augmentDiagnosticWithNode(err, method.name);
- }
- });
- };
- /**
- * Parse a collection of class members decorated with `@Prop()`
- * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
- * added to this collection
- * @param decoratedProps a collection of class elements that may or may not my class members decorated with `@Prop`.
- * Only those decorated with `@Prop()` will be parsed.
- * @param typeChecker a reference to the TypeScript type checker
- * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
- * @param newMembers a collection that parsed `@Prop` annotated class members should be pushed to as a side effect of
- * calling this function
- */
- const propDecoratorsToStatic = (diagnostics, decoratedProps, typeChecker, watchable, newMembers) => {
- const properties = decoratedProps
- .filter(t.isPropertyDeclaration)
- .map((prop) => parsePropDecorator(diagnostics, typeChecker, prop, watchable))
- .filter((prop) => prop != null);
- if (properties.length > 0) {
- newMembers.push(createStaticGetter('properties', t.createObjectLiteral(properties, true)));
- }
- };
- /**
- * Parse a single `@Prop` decorator annotated class member
- * @param diagnostics a collection of compiler diagnostics. During the parsing process, any errors detected must be
- * added to this collection
- * @param typeChecker a reference to the TypeScript type checker
- * @param prop the TypeScript `PropertyDeclaration` to parse
- * @param watchable a collection of class members that can be watched for changes using Stencil's `@Watch` decorator
- * @returns a property assignment expression to be added to the Stencil component's class
- */
- const parsePropDecorator = (diagnostics, typeChecker, prop, watchable) => {
- const propDecorator = prop.decorators.find(isDecoratorNamed('Prop'));
- if (propDecorator == null) {
- return null;
- }
- const decoratorParams = getDeclarationParameters(propDecorator);
- const propOptions = decoratorParams[0] || {};
- const propName = prop.name.getText();
- if (isMemberPrivate(prop)) {
- const err = buildError(diagnostics);
- err.messageText =
- 'Properties decorated with the @Prop() decorator cannot be "private" nor "protected". More info: https://stenciljs.com/docs/properties';
- augmentDiagnosticWithNode(err, prop.modifiers[0]);
- }
- if (/^on(-|[A-Z])/.test(propName)) {
- const warn = buildWarn(diagnostics);
- warn.messageText = `The @Prop() name "${propName}" looks like an event. Please use the "@Event()" decorator to expose events instead, not properties or methods.`;
- augmentDiagnosticWithNode(warn, prop.name);
- }
- else {
- validatePublicName(diagnostics, propName, '@Prop()', 'prop', prop.name);
- }
- const symbol = typeChecker.getSymbolAtLocation(prop.name);
- const type = typeChecker.getTypeAtLocation(prop);
- const typeStr = propTypeFromTSType(type);
- const propMeta = {
- type: typeStr,
- mutable: !!propOptions.mutable,
- complexType: getComplexType(typeChecker, prop, type),
- required: prop.exclamationToken !== undefined && propName !== 'mode',
- optional: prop.questionToken !== undefined,
- docs: serializeSymbol(typeChecker, symbol),
- };
- validateReferences(diagnostics, propMeta.complexType.references, prop.type);
- // prop can have an attribute if type is NOT "unknown"
- if (typeStr !== 'unknown') {
- propMeta.attribute = getAttributeName(propName, propOptions);
- propMeta.reflect = getReflect(diagnostics, propDecorator, propOptions);
- }
- // extract default value
- const initializer = prop.initializer;
- if (initializer) {
- propMeta.defaultValue = initializer.getText();
- }
- const staticProp = t.createPropertyAssignment(t.createLiteral(propName), convertValueToLiteral(propMeta));
- watchable.add(propName);
- return staticProp;
- };
- /**
- * Format the attribute name provided as an argument to `@Prop({attribute: ''}`
- * @param propName the prop's name, used as a fallback value
- * @param propOptions the options passed in to the `@Prop` call expression
- * @returns the formatted attribute name
- */
- const getAttributeName = (propName, propOptions) => {
- if (propOptions.attribute === null) {
- return undefined;
- }
- if (typeof propOptions.attribute === 'string' && propOptions.attribute.trim().length > 0) {
- return propOptions.attribute.trim().toLowerCase();
- }
- return toDashCase(propName);
- };
- /**
- * Determines if the 'reflect' property should be applied to the class member decorated with `@Prop`
- * @param diagnostics a collection of compiler diagnostics. Any errors detected with setting 'reflect' must be added to
- * this collection
- * @param propDecorator the AST containing the Prop decorator
- * @param propOptions the options passed in to the `@Prop` call expression
- * @returns `true` if the prop should be reflected in the DOM, `false` otherwise
- */
- const getReflect = (diagnostics, propDecorator, propOptions) => {
- if (typeof propOptions.reflect === 'boolean') {
- return propOptions.reflect;
- }
- if (typeof propOptions.reflectToAttr === 'boolean') {
- const err = buildError(diagnostics);
- err.header = `Rename "reflectToAttr" to "reflect"`;
- err.messageText = `@Prop option "reflectToAttr" should be renamed to "reflect".`;
- augmentDiagnosticWithNode(err, propDecorator);
- return propOptions.reflectToAttr;
- }
- return false;
- };
- const getComplexType = (typeChecker, node, type) => {
- const nodeType = node.type;
- return {
- original: nodeType ? nodeType.getText() : typeToString(typeChecker, type),
- resolved: resolveType(typeChecker, type),
- references: getAttributeTypeInfo(node, node.getSourceFile()),
- };
- };
- /**
- * Derives a Stencil-permitted prop type from the TypeScript compiler's output. This function may narrow the type of a
- * prop, as the types that can be returned from the TypeScript compiler may be more complex than what Stencil can/should
- * handle for props.
- * @param type the prop type to narrow
- * @returns a valid Stencil prop type
- */
- const propTypeFromTSType = (type) => {
- const isAnyType = checkType(type, isAny);
- if (isAnyType) {
- return 'any';
- }
- const isStr = checkType(type, isString);
- const isNu = checkType(type, isNumber);
- const isBool = checkType(type, isBoolean);
- // if type is more than a primitive type at the same time, we mark it as any
- if (Number(isStr) + Number(isNu) + Number(isBool) > 1) {
- return 'any';
- }
- // at this point we know the prop's type is NOT the mix of primitive types
- if (isStr) {
- return 'string';
- }
- if (isNu) {
- return 'number';
- }
- if (isBool) {
- return 'boolean';
- }
- return 'unknown';
- };
- /**
- * Determines if a TypeScript compiler given `Type` is of a particular type according to the provided `check` parameter.
- * Union types (e.g. `boolean | number | string`) will be evaluated one type at a time.
- * @param type the TypeScript `Type` entity to evaluate
- * @param check a function that takes a TypeScript `Type` as its only argument and returns `true` if the `Type` conforms
- * to a particular type
- * @returns the result of the `check` argument. The result of `check` is `true` for one or more types in a union type,
- * return `true`.
- */
- const checkType = (type, check) => {
- if (type.flags & t.TypeFlags.Union) {
- // if the type is a union, check each type in the union
- const union = type;
- if (union.types.some((type) => checkType(type, check))) {
- return true;
- }
- }
- return check(type);
- };
- /**
- * Determine if a TypeScript compiler `Type` is a boolean
- * @param t the `Type` to evaluate
- * @returns `true` if the `Type` has any boolean-similar flags, `false` otherwise
- */
- const isBoolean = (t$1) => {
- if (t$1) {
- return !!(t$1.flags & (t.TypeFlags.Boolean | t.TypeFlags.BooleanLike));
- }
- return false;
- };
- /**
- * Determine if a TypeScript compiler `Type` is a number
- * @param t the `Type` to evaluate
- * @returns `true` if the `Type` has any number-similar flags, `false` otherwise
- */
- const isNumber = (t$1) => {
- if (t$1) {
- return !!(t$1.flags & (t.TypeFlags.Number | t.TypeFlags.NumberLike | t.TypeFlags.NumberLiteral));
- }
- return false;
- };
- /**
- * Determine if a TypeScript compiler `Type` is a string
- * @param t the `Type` to evaluate
- * @returns `true` if the `Type` has any string-similar flags, `false` otherwise
- */
- const isString = (t$1) => {
- if (t$1) {
- return !!(t$1.flags & (t.TypeFlags.String | t.TypeFlags.StringLike | t.TypeFlags.StringLiteral));
- }
- return false;
- };
- /**
- * Determine if a TypeScript compiler `Type` is of type any
- * @param t the `Type` to evaluate
- * @returns `true` if the `Type` has the `Any` flag set on it, `false` otherwise
- */
- const isAny = (t$1) => {
- if (t$1) {
- return !!(t$1.flags & t.TypeFlags.Any);
- }
- return false;
- };
- const stateDecoratorsToStatic = (decoratedProps, watchable, newMembers) => {
- const states = decoratedProps
- .filter(t.isPropertyDeclaration)
- .map((prop) => stateDecoratorToStatic(prop, watchable))
- .filter((state) => !!state);
- if (states.length > 0) {
- newMembers.push(createStaticGetter('states', t.createObjectLiteral(states, true)));
- }
- };
- const stateDecoratorToStatic = (prop, watchable) => {
- const stateDecorator = prop.decorators.find(isDecoratorNamed('State'));
- if (stateDecorator == null) {
- return null;
- }
- const stateName = prop.name.getText();
- watchable.add(stateName);
- return t.createPropertyAssignment(t.createLiteral(stateName), t.createObjectLiteral([], true));
- };
- const watchDecoratorsToStatic = (config, diagnostics, decoratedProps, watchable, newMembers) => {
- const watchers = decoratedProps
- .filter(t.isMethodDeclaration)
- .map((method) => parseWatchDecorator(config, diagnostics, watchable, method));
- const flatWatchers = flatOne(watchers);
- if (flatWatchers.length > 0) {
- newMembers.push(createStaticGetter('watchers', convertValueToLiteral(flatWatchers)));
- }
- };
- const parseWatchDecorator = (config, diagnostics, watchable, method) => {
- const methodName = method.name.getText();
- return method.decorators.filter(isDecoratorNamed('Watch')).map((decorator) => {
- const [propName] = getDeclarationParameters(decorator);
- if (!watchable.has(propName)) {
- const diagnostic = config.devMode ? buildWarn(diagnostics) : buildError(diagnostics);
- diagnostic.messageText = `@Watch('${propName}') is trying to watch for changes in a property that does not exist.
- Make sure only properties decorated with @State() or @Prop() are watched.`;
- augmentDiagnosticWithNode(diagnostic, decorator);
- }
- return {
- propName,
- methodName,
- };
- });
- };
- const convertDecoratorsToStatic = (config, diagnostics, typeChecker) => {
- return (transformCtx) => {
- const visit = (node) => {
- if (t.isClassDeclaration(node)) {
- return visitClassDeclaration(config, diagnostics, typeChecker, node);
- }
- return t.visitEachChild(node, visit, transformCtx);
- };
- return (tsSourceFile) => {
- return t.visitEachChild(tsSourceFile, visit, transformCtx);
- };
- };
- };
- const visitClassDeclaration = (config, diagnostics, typeChecker, classNode) => {
- if (!classNode.decorators) {
- return classNode;
- }
- const componentDecorator = classNode.decorators.find(isDecoratorNamed('Component'));
- if (!componentDecorator) {
- return classNode;
- }
- const classMembers = classNode.members;
- const decoratedMembers = classMembers.filter((member) => Array.isArray(member.decorators) && member.decorators.length > 0);
- const newMembers = removeStencilDecorators(Array.from(classMembers));
- // parser component decorator (Component)
- componentDecoratorToStatic(config, typeChecker, diagnostics, classNode, newMembers, componentDecorator);
- // stores a reference to fields that should be watched for changes
- const watchable = new Set();
- // parse member decorators (Prop, State, Listen, Event, Method, Element and Watch)
- if (decoratedMembers.length > 0) {
- propDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, watchable, newMembers);
- stateDecoratorsToStatic(decoratedMembers, watchable, newMembers);
- eventDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, newMembers);
- methodDecoratorsToStatic(config, diagnostics, classNode, decoratedMembers, typeChecker, newMembers);
- elementDecoratorsToStatic(diagnostics, decoratedMembers, typeChecker, newMembers);
- watchDecoratorsToStatic(config, diagnostics, decoratedMembers, watchable, newMembers);
- listenDecoratorsToStatic(diagnostics, decoratedMembers, newMembers);
- }
- validateMethods(diagnostics, classMembers);
- return t.updateClassDeclaration(classNode, removeDecorators(classNode, CLASS_DECORATORS_TO_REMOVE), classNode.modifiers, classNode.name, classNode.typeParameters, classNode.heritageClauses, newMembers);
- };
- const removeStencilDecorators = (classMembers) => {
- return classMembers.map((m) => {
- const currentDecorators = m.decorators;
- const newDecorators = removeDecorators(m, MEMBER_DECORATORS_TO_REMOVE);
- if (currentDecorators !== newDecorators) {
- if (t.isMethodDeclaration(m)) {
- return t.updateMethod(m, newDecorators, m.modifiers, m.asteriskToken, m.name, m.questionToken, m.typeParameters, m.parameters, m.type, m.body);
- }
- else if (t.isPropertyDeclaration(m)) {
- return t.updateProperty(m, newDecorators, m.modifiers, m.name, m.questionToken, m.type, m.initializer);
- }
- else {
- console.log('unknown class node');
- }
- }
- return m;
- });
- };
- const removeDecorators = (node, decoratorNames) => {
- if (node.decorators) {
- const updatedDecoratorList = node.decorators.filter((dec) => {
- const name = t.isCallExpression(dec.expression) &&
- t.isIdentifier(dec.expression.expression) &&
- dec.expression.expression.text;
- return !decoratorNames.has(name);
- });
- if (updatedDecoratorList.length === 0) {
- return undefined;
- }
- else if (updatedDecoratorList.length !== node.decorators.length) {
- return t.createNodeArray(updatedDecoratorList);
- }
- }
- return node.decorators;
- };
- function resolveComponentDependencies(cmps) {
- computeDependencies(cmps);
- computeDependents(cmps);
- }
- function computeDependencies(cmps) {
- const visited = new Set();
- cmps.forEach((cmp) => {
- resolveTransitiveDependencies(cmp, cmps, visited);
- cmp.dependencies = unique(cmp.dependencies).sort();
- });
- }
- function computeDependents(cmps) {
- cmps.forEach((cmp) => {
- resolveTransitiveDependents(cmp, cmps);
- });
- }
- function resolveTransitiveDependencies(cmp, cmps, visited) {
- if (visited.has(cmp)) {
- return cmp.dependencies;
- }
- visited.add(cmp);
- const dependencies = unique(cmp.potentialCmpRefs.filter((tagName) => cmps.some((c) => c.tagName === tagName)));
- cmp.dependencies = cmp.directDependencies = dependencies;
- const transitiveDeps = flatOne(dependencies
- .map((tagName) => cmps.find((c) => c.tagName === tagName))
- .map((c) => resolveTransitiveDependencies(c, cmps, visited)));
- return (cmp.dependencies = [...dependencies, ...transitiveDeps]);
- }
- function resolveTransitiveDependents(cmp, cmps) {
- cmp.dependents = cmps
- .filter((c) => c.dependencies.includes(cmp.tagName))
- .map((c) => c.tagName)
- .sort();
- cmp.directDependents = cmps
- .filter((c) => c.directDependencies.includes(cmp.tagName))
- .map((c) => c.tagName)
- .sort();
- }
- const gatherVdomMeta = (m, args) => {
- m.hasVdomRender = true;
- // Parse vdom tag
- const hTag = args[0];
- if (!t.isStringLiteral(hTag) && (!t.isIdentifier(hTag) || hTag.text !== 'Host')) {
- m.hasVdomFunctional = true;
- }
- // Parse attributes
- if (args.length > 1) {
- const objectLiteral = args[1];
- if (t.isCallExpression(objectLiteral) || t.isIdentifier(objectLiteral)) {
- m.hasVdomAttribute = true;
- m.hasVdomClass = true;
- m.hasVdomKey = true;
- m.hasVdomListener = true;
- m.hasVdomPropOrAttr = true;
- m.hasVdomRef = true;
- m.hasVdomStyle = true;
- m.hasVdomXlink = true;
- }
- else if (t.isObjectLiteralExpression(objectLiteral)) {
- objectLiteral.properties.forEach((prop) => {
- m.hasVdomAttribute = true;
- if (t.isSpreadAssignment(prop) || t.isComputedPropertyName(prop.name)) {
- m.hasVdomClass = true;
- m.hasVdomKey = true;
- m.hasVdomListener = true;
- m.hasVdomPropOrAttr = true;
- m.hasVdomRef = true;
- m.hasVdomStyle = true;
- m.hasVdomXlink = true;
- }
- else if (prop.name && prop.name.text && prop.name.text.length > 0) {
- const attrName = prop.name.text;
- if (attrName === 'key') {
- m.hasVdomKey = true;
- }
- else if (attrName === 'ref') {
- m.hasVdomRef = true;
- }
- else if (attrName === 'class' || attrName === 'className') {
- m.hasVdomClass = true;
- }
- else if (attrName === 'style') {
- m.hasVdomStyle = true;
- }
- else if (/^on(-|[A-Z])/.test(attrName)) {
- m.hasVdomListener = true;
- }
- else if (attrName.startsWith('xlink')) {
- m.hasVdomXlink = true;
- m.hasVdomPropOrAttr = true;
- }
- else {
- m.hasVdomPropOrAttr = true;
- }
- if (attrName === 'part' && t.isPropertyAssignment(prop) && t.isStringLiteral(prop.initializer)) {
- m.htmlParts.push(...prop.initializer.text
- .toLowerCase()
- .split(' ')
- .filter((part) => part.length > 0));
- }
- m.htmlAttrNames.push(attrName);
- }
- });
- }
- }
- // Parse children
- if (!m.hasVdomText) {
- for (let i = 2; i < args.length; i++) {
- const arg = args[i];
- if (!t.isCallExpression(arg) || !t.isIdentifier(arg.expression) || arg.expression.text !== 'h') {
- m.hasVdomText = true;
- break;
- }
- }
- }
- };
- const parseCallExpression = (m, node) => {
- if (node.arguments != null && node.arguments.length > 0) {
- if (t.isIdentifier(node.expression)) {
- // h('tag')
- visitCallExpressionArgs(m, node.expression, node.arguments);
- }
- else if (t.isPropertyAccessExpression(node.expression)) {
- // document.createElement('tag')
- const n = node.expression.name;
- if (t.isIdentifier(n) && n) {
- visitCallExpressionArgs(m, n, node.arguments);
- }
- }
- }
- };
- const visitCallExpressionArgs = (m, callExpressionName, args) => {
- const fnName = callExpressionName.escapedText;
- if (fnName === 'h' || fnName === H || fnName === 'createElement') {
- visitCallExpressionArg(m, args[0]);
- if (fnName === 'h' || fnName === H) {
- gatherVdomMeta(m, args);
- }
- }
- else if (args.length > 1 && fnName === 'createElementNS') {
- visitCallExpressionArg(m, args[1]);
- }
- else if (fnName === 'require' && args.length > 0 && m.originalImports) {
- const arg = args[0];
- if (t.isStringLiteral(arg)) {
- if (!m.originalImports.includes(arg.text)) {
- m.originalImports.push(arg.text);
- }
- }
- }
- };
- const visitCallExpressionArg = (m, arg) => {
- if (t.isStringLiteral(arg)) {
- let tag = arg.text;
- if (typeof tag === 'string') {
- tag = tag.toLowerCase();
- m.htmlTagNames.push(tag);
- if (tag.includes('-')) {
- m.potentialCmpRefs.push(tag);
- }
- }
- }
- };
- const parseCollectionComponents = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
- if (collectionManifest.entries) {
- collectionManifest.entries.forEach((entryPath) => {
- const componentPath = join(collectionDir, entryPath);
- transpileCollectionModule(config, compilerCtx, buildCtx, collection, componentPath);
- });
- }
- };
- const transpileCollectionModule = (config, compilerCtx, buildCtx, collection, inputFileName) => {
- const sourceText = compilerCtx.fs.readFileSync(inputFileName);
- const sourceFile = t.createSourceFile(inputFileName, sourceText, t.ScriptTarget.ES2017, true, t.ScriptKind.JS);
- return updateModule(config, compilerCtx, buildCtx, sourceFile, sourceText, inputFileName, undefined, collection);
- };
- const parseCollectionManifest = (config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr) => {
- const collectionManifest = JSON.parse(collectionJsonStr);
- const compilerVersion = collectionManifest.compiler || {};
- const collection = {
- collectionName: collectionName,
- moduleId: collectionName,
- moduleFiles: [],
- dependencies: parseCollectionDependencies(collectionManifest),
- compiler: {
- name: compilerVersion.name || '',
- version: compilerVersion.version || '',
- typescriptVersion: compilerVersion.typescriptVersion || '',
- },
- bundles: parseBundles(collectionManifest),
- };
- parseGlobal(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
- parseCollectionComponents(config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection);
- return collection;
- };
- const parseCollectionDependencies = (collectionManifest) => {
- return (collectionManifest.collections || []).map((c) => c.name);
- };
- const parseGlobal = (config, compilerCtx, buildCtx, collectionDir, collectionManifest, collection) => {
- if (typeof collectionManifest.global !== 'string') {
- return;
- }
- const sourceFilePath = normalizePath$1(join(collectionDir, collectionManifest.global));
- const globalModule = transpileCollectionModule(config, compilerCtx, buildCtx, collection, sourceFilePath);
- collection.global = globalModule;
- };
- const parseBundles = (collectionManifest) => {
- if (invalidArrayData(collectionManifest.bundles)) {
- return [];
- }
- return collectionManifest.bundles.map((b) => {
- return {
- components: b.components.slice().sort(),
- };
- });
- };
- const invalidArrayData = (arr) => {
- return !arr || !Array.isArray(arr) || arr.length === 0;
- };
- const parseCollection = (config, compilerCtx, buildCtx, moduleId, pkgJsonFilePath, pkgData) => {
- // note this MUST be synchronous because this is used during transpile
- const collectionName = pkgData.name;
- let collection = compilerCtx.collections.find((c) => c.collectionName === collectionName);
- if (collection != null) {
- // we've already cached the collection, no need for another resolve/readFile/parse
- // thought being that /node_modules/ isn't changing between watch builds
- return collection;
- }
- // get the root directory of the dependency
- const collectionPackageRootDir = dirname(pkgJsonFilePath);
- // figure out the full path to the collection collection file
- const collectionFilePath = join(collectionPackageRootDir, pkgData.collection);
- const relPath = relative$1(config.rootDir, collectionFilePath);
- config.logger.debug(`load collection: ${collectionName}, ${relPath}`);
- // we haven't cached the collection yet, let's read this file
- // sync on purpose :(
- const collectionJsonStr = compilerCtx.fs.readFileSync(collectionFilePath);
- if (!collectionJsonStr) {
- return null;
- }
- // get the directory where the collection collection file is sitting
- const collectionDir = normalizePath$1(dirname(collectionFilePath));
- // parse the json string into our collection data
- collection = parseCollectionManifest(config, compilerCtx, buildCtx, collectionName, collectionDir, collectionJsonStr);
- collection.moduleId = moduleId;
- if (pkgData.module && pkgData.module !== pkgData.main) {
- collection.hasExports = true;
- }
- // remember the source of this collection node_module
- collection.moduleDir = collectionPackageRootDir;
- // cache it for later yo
- compilerCtx.collections.push(collection);
- return collection;
- };
- const addExternalImport = (config, compilerCtx, buildCtx, moduleFile, containingFile, moduleId, resolveCollections) => {
- if (!moduleFile.externalImports.includes(moduleId)) {
- moduleFile.externalImports.push(moduleId);
- moduleFile.externalImports.sort();
- }
- if (!resolveCollections || compilerCtx.resolvedCollections.has(moduleId)) {
- // we've already handled this collection moduleId before
- return;
- }
- let pkgJsonFilePath = tsResolveModuleNamePackageJsonPath(config, compilerCtx, moduleId, containingFile);
- // cache that we've already parsed this
- compilerCtx.resolvedCollections.add(moduleId);
- if (pkgJsonFilePath == null) {
- return;
- }
- const realPkgJsonFilePath = config.sys.realpathSync(pkgJsonFilePath);
- if (realPkgJsonFilePath.path) {
- pkgJsonFilePath = realPkgJsonFilePath.path;
- }
- if (pkgJsonFilePath === config.packageJsonFilePath) {
- // same package silly!
- return;
- }
- // open up and parse the package.json
- // sync on purpose :(
- const pkgJsonStr = compilerCtx.fs.readFileSync(pkgJsonFilePath);
- if (pkgJsonStr == null) {
- return;
- }
- const parsedPkgJson = parsePackageJson(pkgJsonStr, pkgJsonFilePath);
- if (parsedPkgJson.diagnostic) {
- buildCtx.diagnostics.push(parsedPkgJson.diagnostic);
- return;
- }
- if (!isString$1(parsedPkgJson.data.collection) || !parsedPkgJson.data.collection.endsWith('.json')) {
- // this import is not a stencil collection
- return;
- }
- if (!isString$1(parsedPkgJson.data.types) || !parsedPkgJson.data.types.endsWith('.d.ts')) {
- // this import should have types
- return;
- }
- // this import is a stencil collection
- // let's parse it and gather all the module data about it
- // internally it'll cached collection data if we've already done this
- const collection = parseCollection(config, compilerCtx, buildCtx, moduleId, parsedPkgJson.filePath, parsedPkgJson.data);
- if (!collection) {
- return;
- }
- // check if we already added this collection to the build context
- const alreadyHasCollection = buildCtx.collections.some((c) => {
- return c.collectionName === collection.collectionName;
- });
- if (alreadyHasCollection) {
- // we already have this collection in our build context
- return;
- }
- // let's add the collection to the build context
- buildCtx.collections.push(collection);
- if (Array.isArray(collection.dependencies)) {
- // this collection has more collections
- // let's keep digging down and discover all of them
- collection.dependencies.forEach((dependencyModuleId) => {
- const resolveFromDir = dirname(pkgJsonFilePath);
- addExternalImport(config, compilerCtx, buildCtx, moduleFile, resolveFromDir, dependencyModuleId, resolveCollections);
- });
- }
- };
- const parseModuleImport = (config, compilerCtx, buildCtx, moduleFile, dirPath, importNode, resolveCollections) => {
- if (importNode.moduleSpecifier && t.isStringLiteral(importNode.moduleSpecifier)) {
- let importPath = importNode.moduleSpecifier.text;
- if (!moduleFile.originalImports.includes(importPath)) {
- moduleFile.originalImports.push(importPath);
- }
- if (isAbsolute$1(importPath)) {
- // absolute import
- importPath = normalizePath$1(importPath);
- moduleFile.localImports.push(importPath);
- }
- else if (importPath.startsWith('.')) {
- // relative import
- importPath = normalizePath$1(resolve$1(dirPath, importPath));
- moduleFile.localImports.push(importPath);
- }
- else {
- // node resolve side effect import
- addExternalImport(config, compilerCtx, buildCtx, moduleFile, moduleFile.sourceFilePath, importPath, resolveCollections);
- }
- }
- };
- const addComponentMetaStatic = (cmpNode, cmpMeta) => {
- const publicCompilerMeta = getPublicCompilerMeta(cmpMeta);
- const cmpMetaStaticProp = createStaticGetter('COMPILER_META', convertValueToLiteral(publicCompilerMeta));
- const classMembers = [...cmpNode.members, cmpMetaStaticProp];
- return t.updateClassDeclaration(cmpNode, cmpNode.decorators, cmpNode.modifiers, cmpNode.name, cmpNode.typeParameters, cmpNode.heritageClauses, classMembers);
- };
- const getPublicCompilerMeta = (cmpMeta) => {
- const publicCompilerMeta = Object.assign({}, cmpMeta);
- // no need to copy all compiler meta data
- delete publicCompilerMeta.assetsDirs;
- delete publicCompilerMeta.dependencies;
- delete publicCompilerMeta.excludeFromCollection;
- delete publicCompilerMeta.isCollectionDependency;
- delete publicCompilerMeta.docs;
- delete publicCompilerMeta.jsFilePath;
- delete publicCompilerMeta.potentialCmpRefs;
- delete publicCompilerMeta.styleDocs;
- delete publicCompilerMeta.sourceFilePath;
- return publicCompilerMeta;
- };
- const parseStaticMethods = (staticMembers) => {
- const parsedMethods = getStaticValue(staticMembers, 'methods');
- if (!parsedMethods) {
- return [];
- }
- const methodNames = Object.keys(parsedMethods);
- if (methodNames.length === 0) {
- return [];
- }
- return methodNames.map((methodName) => {
- return {
- name: methodName,
- docs: parsedMethods[methodName].docs,
- complexType: parsedMethods[methodName].complexType,
- internal: isInternal(parsedMethods[methodName].docs),
- };
- });
- };
- const parseStaticListeners = (staticMembers) => {
- const parsedListeners = getStaticValue(staticMembers, 'listeners');
- if (!parsedListeners || parsedListeners.length === 0) {
- return [];
- }
- return parsedListeners.map((parsedListener) => {
- return {
- name: parsedListener.name,
- method: parsedListener.method,
- capture: !!parsedListener.capture,
- passive: !!parsedListener.passive,
- target: parsedListener.target,
- };
- });
- };
- const parseClassMethods = (cmpNode, cmpMeta) => {
- const classMembers = cmpNode.members;
- if (!classMembers || classMembers.length === 0) {
- return;
- }
- const classMethods = classMembers.filter((m) => t.isMethodDeclaration(m));
- if (classMethods.length === 0) {
- return;
- }
- const hasHostData = classMethods.some((m) => isMethod(m, 'hostData'));
- cmpMeta.hasAttributeChangedCallbackFn = classMethods.some((m) => isMethod(m, 'attributeChangedCallback'));
- cmpMeta.hasConnectedCallbackFn = classMethods.some((m) => isMethod(m, 'connectedCallback'));
- cmpMeta.hasDisconnectedCallbackFn = classMethods.some((m) => isMethod(m, 'disconnectedCallback'));
- cmpMeta.hasComponentWillLoadFn = classMethods.some((m) => isMethod(m, 'componentWillLoad'));
- cmpMeta.hasComponentWillUpdateFn = classMethods.some((m) => isMethod(m, 'componentWillUpdate'));
- cmpMeta.hasComponentWillRenderFn = classMethods.some((m) => isMethod(m, 'componentWillRender'));
- cmpMeta.hasComponentDidRenderFn = classMethods.some((m) => isMethod(m, 'componentDidRender'));
- cmpMeta.hasComponentDidLoadFn = classMethods.some((m) => isMethod(m, 'componentDidLoad'));
- cmpMeta.hasComponentShouldUpdateFn = classMethods.some((m) => isMethod(m, 'componentShouldUpdate'));
- cmpMeta.hasComponentDidUpdateFn = classMethods.some((m) => isMethod(m, 'componentDidUpdate'));
- cmpMeta.hasComponentDidUnloadFn = classMethods.some((m) => isMethod(m, 'componentDidUnload'));
- cmpMeta.hasLifecycle =
- cmpMeta.hasComponentWillLoadFn ||
- cmpMeta.hasComponentDidLoadFn ||
- cmpMeta.hasComponentWillUpdateFn ||
- cmpMeta.hasComponentDidUpdateFn;
- cmpMeta.hasRenderFn = classMethods.some((m) => isMethod(m, 'render')) || hasHostData;
- cmpMeta.hasVdomRender = cmpMeta.hasVdomRender || hasHostData;
- };
- const parseStaticElementRef = (staticMembers) => {
- const parsedElementRef = getStaticValue(staticMembers, 'elementRef');
- if (typeof parsedElementRef === 'string') {
- return parsedElementRef;
- }
- return null;
- };
- const parseStaticEncapsulation = (staticMembers) => {
- let encapsulation = getStaticValue(staticMembers, 'encapsulation');
- if (typeof encapsulation === 'string') {
- encapsulation = encapsulation.toLowerCase().trim();
- if (encapsulation === 'shadow' || encapsulation === 'scoped') {
- return encapsulation;
- }
- }
- return 'none';
- };
- const parseStaticShadowDelegatesFocus = (encapsulation, staticMembers) => {
- if (encapsulation === 'shadow') {
- const delegatesFocus = getStaticValue(staticMembers, 'delegatesFocus');
- return !!delegatesFocus;
- }
- return null;
- };
- const parseStaticEvents = (staticMembers) => {
- const parsedEvents = getStaticValue(staticMembers, 'events');
- if (!parsedEvents || parsedEvents.length === 0) {
- return [];
- }
- return parsedEvents.map((parsedEvent) => {
- return {
- name: parsedEvent.name,
- method: parsedEvent.method,
- bubbles: parsedEvent.bubbles,
- cancelable: parsedEvent.cancelable,
- composed: parsedEvent.composed,
- docs: parsedEvent.docs,
- complexType: parsedEvent.complexType,
- internal: isInternal(parsedEvent.docs),
- };
- });
- };
- const parseStaticProps = (staticMembers) => {
- const parsedProps = getStaticValue(staticMembers, 'properties');
- if (!parsedProps) {
- return [];
- }
- const propNames = Object.keys(parsedProps);
- if (propNames.length === 0) {
- return [];
- }
- return propNames.map((propName) => {
- const val = parsedProps[propName];
- return {
- name: propName,
- type: val.type,
- attribute: val.attribute ? val.attribute.toLowerCase() : undefined,
- reflect: typeof val.reflect === 'boolean' ? val.reflect : false,
- mutable: !!val.mutable,
- required: !!val.required,
- optional: !!val.optional,
- defaultValue: val.defaultValue,
- complexType: val.complexType,
- docs: val.docs,
- internal: isInternal(val.docs),
- };
- });
- };
- const parseStaticStates = (staticMembers) => {
- const parsedStates = getStaticValue(staticMembers, 'states');
- if (!parsedStates) {
- return [];
- }
- const stateNames = Object.keys(parsedStates);
- if (stateNames.length === 0) {
- return [];
- }
- return stateNames.map((stateName) => {
- return {
- name: stateName,
- };
- });
- };
- const parseStaticWatchers = (staticMembers) => {
- const parsedWatchers = getStaticValue(staticMembers, 'watchers');
- if (!parsedWatchers || parsedWatchers.length === 0) {
- return [];
- }
- return parsedWatchers.map((parsedWatch) => {
- return {
- propName: parsedWatch.propName,
- methodName: parsedWatch.methodName,
- };
- });
- };
- const normalizeStyles = (tagName, componentFilePath, styles) => {
- styles.forEach((style) => {
- if (style.modeName === DEFAULT_STYLE_MODE) {
- style.styleId = tagName.toUpperCase();
- }
- else {
- style.styleId = `${tagName.toUpperCase()}#${style.modeName}`;
- }
- if (Array.isArray(style.externalStyles)) {
- style.externalStyles.forEach((externalStyle) => {
- normalizeExternalStyle(componentFilePath, externalStyle);
- });
- }
- });
- };
- const normalizeExternalStyle = (componentFilePath, externalStyle) => {
- if (typeof externalStyle.originalComponentPath !== 'string' ||
- externalStyle.originalComponentPath.trim().length === 0) {
- return;
- }
- // get the absolute path of the directory which the component is sitting in
- const componentDir = dirname(componentFilePath);
- if (isAbsolute$1(externalStyle.originalComponentPath)) {
- // this path is absolute already!
- // add to our list of style absolute paths
- externalStyle.absolutePath = normalizePath$1(externalStyle.originalComponentPath);
- // if this is an absolute path already, let's convert it to be relative
- externalStyle.relativePath = normalizePath$1(relative$1(componentDir, externalStyle.originalComponentPath));
- }
- else {
- // this path is relative to the component
- // add to our list of style relative paths
- externalStyle.relativePath = normalizePath$1(externalStyle.originalComponentPath);
- // create the absolute path to the style file
- externalStyle.absolutePath = normalizePath$1(join(componentDir, externalStyle.originalComponentPath));
- }
- };
- const parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDependency, staticMembers) => {
- const styles = [];
- const styleUrlsProp = isCollectionDependency ? 'styleUrls' : 'originalStyleUrls';
- const parsedStyleUrls = getStaticValue(staticMembers, styleUrlsProp);
- let parsedStyle = getStaticValue(staticMembers, 'styles');
- if (parsedStyle) {
- if (typeof parsedStyle === 'string') {
- // styles: 'div { padding: 10px }'
- parsedStyle = parsedStyle.trim();
- if (parsedStyle.length > 0) {
- styles.push({
- modeName: DEFAULT_STYLE_MODE,
- styleId: null,
- styleStr: parsedStyle,
- styleIdentifier: null,
- externalStyles: [],
- });
- compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
- }
- }
- else if (parsedStyle.__identifier) {
- styles.push(parseStyleIdentifier(parsedStyle, DEFAULT_STYLE_MODE));
- compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
- }
- else if (typeof parsedStyle === 'object') {
- Object.keys(parsedStyle).forEach((modeName) => {
- const parsedStyleMode = parsedStyle[modeName];
- if (typeof parsedStyleMode === 'string') {
- styles.push({
- modeName: modeName,
- styleId: null,
- styleStr: parsedStyleMode,
- styleIdentifier: null,
- externalStyles: [],
- });
- }
- else {
- styles.push(parseStyleIdentifier(parsedStyleMode, modeName));
- }
- compilerCtx.styleModeNames.add(modeName);
- });
- }
- }
- if (parsedStyleUrls && typeof parsedStyleUrls === 'object') {
- Object.keys(parsedStyleUrls).forEach((modeName) => {
- const externalStyles = [];
- const styleObj = parsedStyleUrls[modeName];
- styleObj.forEach((styleUrl) => {
- if (typeof styleUrl === 'string' && styleUrl.trim().length > 0) {
- externalStyles.push({
- absolutePath: null,
- relativePath: null,
- originalComponentPath: styleUrl.trim(),
- });
- }
- });
- if (externalStyles.length > 0) {
- const style = {
- modeName: modeName,
- styleId: null,
- styleStr: null,
- styleIdentifier: null,
- externalStyles: externalStyles,
- };
- styles.push(style);
- compilerCtx.styleModeNames.add(modeName);
- }
- });
- }
- normalizeStyles(tagName, componentFilePath, styles);
- return sortBy(styles, (s) => s.modeName);
- };
- const parseStyleIdentifier = (parsedStyle, modeName) => {
- const style = {
- modeName: modeName,
- styleId: null,
- styleStr: null,
- styleIdentifier: parsedStyle.__escapedText,
- externalStyles: [],
- };
- return style;
- };
- const parseStringLiteral = (m, node) => {
- if (typeof node.text === 'string' && node.text.includes('</')) {
- if (node.text.includes('<slot')) {
- m.htmlTagNames.push('slot');
- }
- if (node.text.includes('<svg')) {
- m.htmlTagNames.push('svg');
- }
- }
- };
- const setComponentBuildConditionals = (cmpMeta) => {
- if (cmpMeta.properties.length > 0) {
- cmpMeta.hasProp = true;
- cmpMeta.hasPropMutable = cmpMeta.properties.some((p) => p.mutable);
- cmpMeta.hasReflect = cmpMeta.properties.some((p) => p.reflect);
- cmpMeta.hasAttribute = cmpMeta.properties.some((p) => typeof p.attribute === 'string');
- cmpMeta.hasPropBoolean = cmpMeta.properties.some((p) => p.type === 'boolean');
- cmpMeta.hasPropNumber = cmpMeta.properties.some((p) => p.type === 'number');
- cmpMeta.hasPropString = cmpMeta.properties.some((p) => p.type === 'string');
- }
- if (cmpMeta.states.length > 0) {
- cmpMeta.hasState = true;
- }
- if (cmpMeta.watchers.length > 0) {
- cmpMeta.hasWatchCallback = true;
- }
- if (cmpMeta.methods.length > 0) {
- cmpMeta.hasMethod = true;
- }
- if (cmpMeta.events.length > 0) {
- cmpMeta.hasEvent = true;
- }
- if (cmpMeta.listeners.length > 0) {
- cmpMeta.hasListener = true;
- cmpMeta.hasListenerTargetWindow = cmpMeta.listeners.some((l) => l.target === 'window');
- cmpMeta.hasListenerTargetDocument = cmpMeta.listeners.some((l) => l.target === 'document');
- cmpMeta.hasListenerTargetBody = cmpMeta.listeners.some((l) => l.target === 'body');
- cmpMeta.hasListenerTargetParent = cmpMeta.listeners.some((l) => l.target === 'parent');
- cmpMeta.hasListenerTarget = cmpMeta.listeners.some((l) => !!l.target);
- }
- cmpMeta.hasMember = cmpMeta.hasProp || cmpMeta.hasState || cmpMeta.hasElement || cmpMeta.hasMethod;
- cmpMeta.isUpdateable = cmpMeta.hasProp || cmpMeta.hasState;
- if (cmpMeta.styles.length > 0) {
- cmpMeta.hasStyle = true;
- cmpMeta.hasMode = cmpMeta.styles.some((s) => s.modeName !== DEFAULT_STYLE_MODE);
- }
- cmpMeta.hasLifecycle =
- cmpMeta.hasComponentWillLoadFn ||
- cmpMeta.hasComponentDidLoadFn ||
- cmpMeta.hasComponentShouldUpdateFn ||
- cmpMeta.hasComponentWillUpdateFn ||
- cmpMeta.hasComponentDidUpdateFn ||
- cmpMeta.hasComponentWillRenderFn ||
- cmpMeta.hasComponentDidRenderFn;
- cmpMeta.isPlain =
- !cmpMeta.hasMember && !cmpMeta.hasStyle && !cmpMeta.hasLifecycle && !cmpMeta.hasListener && !cmpMeta.hasVdomRender;
- };
- const parseStaticComponentMeta = (compilerCtx, typeChecker, cmpNode, moduleFile, nodeMap, transformOpts) => {
- if (cmpNode.members == null) {
- return cmpNode;
- }
- const staticMembers = cmpNode.members.filter(isStaticGetter);
- const tagName = getComponentTagName(staticMembers);
- if (tagName == null) {
- return cmpNode;
- }
- const symbol = typeChecker ? typeChecker.getSymbolAtLocation(cmpNode.name) : undefined;
- const docs = serializeSymbol(typeChecker, symbol);
- const isCollectionDependency = moduleFile.isCollectionDependency;
- const encapsulation = parseStaticEncapsulation(staticMembers);
- const cmp = {
- tagName: tagName,
- excludeFromCollection: moduleFile.excludeFromCollection,
- isCollectionDependency,
- componentClassName: cmpNode.name ? cmpNode.name.text : '',
- elementRef: parseStaticElementRef(staticMembers),
- encapsulation,
- shadowDelegatesFocus: parseStaticShadowDelegatesFocus(encapsulation, staticMembers),
- properties: parseStaticProps(staticMembers),
- virtualProperties: parseVirtualProps(docs),
- states: parseStaticStates(staticMembers),
- methods: parseStaticMethods(staticMembers),
- listeners: parseStaticListeners(staticMembers),
- events: parseStaticEvents(staticMembers),
- watchers: parseStaticWatchers(staticMembers),
- styles: parseStaticStyles(compilerCtx, tagName, moduleFile.sourceFilePath, isCollectionDependency, staticMembers),
- legacyConnect: getStaticValue(staticMembers, 'connectProps') || [],
- legacyContext: getStaticValue(staticMembers, 'contextProps') || [],
- internal: isInternal(docs),
- assetsDirs: parseAssetsDirs(staticMembers, moduleFile.jsFilePath),
- styleDocs: [],
- docs,
- jsFilePath: moduleFile.jsFilePath,
- sourceFilePath: moduleFile.sourceFilePath,
- sourceMapPath: moduleFile.sourceMapPath,
- hasAttributeChangedCallbackFn: false,
- hasComponentWillLoadFn: false,
- hasComponentDidLoadFn: false,
- hasComponentShouldUpdateFn: false,
- hasComponentWillUpdateFn: false,
- hasComponentDidUpdateFn: false,
- hasComponentWillRenderFn: false,
- hasComponentDidRenderFn: false,
- hasComponentDidUnloadFn: false,
- hasConnectedCallbackFn: false,
- hasDisconnectedCallbackFn: false,
- hasElement: false,
- hasEvent: false,
- hasLifecycle: false,
- hasListener: false,
- hasListenerTarget: false,
- hasListenerTargetWindow: false,
- hasListenerTargetDocument: false,
- hasListenerTargetBody: false,
- hasListenerTargetParent: false,
- hasMember: false,
- hasMethod: false,
- hasMode: false,
- hasAttribute: false,
- hasProp: false,
- hasPropNumber: false,
- hasPropBoolean: false,
- hasPropString: false,
- hasPropMutable: false,
- hasReflect: false,
- hasRenderFn: false,
- hasState: false,
- hasStyle: false,
- hasVdomAttribute: false,
- hasVdomXlink: false,
- hasVdomClass: false,
- hasVdomFunctional: false,
- hasVdomKey: false,
- hasVdomListener: false,
- hasVdomPropOrAttr: false,
- hasVdomRef: false,
- hasVdomRender: false,
- hasVdomStyle: false,
- hasVdomText: false,
- hasWatchCallback: false,
- isPlain: false,
- htmlAttrNames: [],
- htmlTagNames: [],
- htmlParts: [],
- isUpdateable: false,
- potentialCmpRefs: [],
- };
- const visitComponentChildNode = (node) => {
- if (t.isCallExpression(node)) {
- parseCallExpression(cmp, node);
- }
- else if (t.isStringLiteral(node)) {
- parseStringLiteral(cmp, node);
- }
- node.forEachChild(visitComponentChildNode);
- };
- visitComponentChildNode(cmpNode);
- parseClassMethods(cmpNode, cmp);
- cmp.legacyConnect.forEach(({ connect }) => {
- cmp.htmlTagNames.push(connect);
- if (connect.includes('-')) {
- cmp.potentialCmpRefs.push(connect);
- }
- });
- cmp.htmlAttrNames = unique(cmp.htmlAttrNames);
- cmp.htmlTagNames = unique(cmp.htmlTagNames);
- cmp.potentialCmpRefs = unique(cmp.potentialCmpRefs);
- setComponentBuildConditionals(cmp);
- if (transformOpts && transformOpts.componentMetadata === 'compilerstatic') {
- cmpNode = addComponentMetaStatic(cmpNode, cmp);
- }
- // add to module map
- moduleFile.cmps.push(cmp);
- // add to node map
- nodeMap.set(cmpNode, cmp);
- return cmpNode;
- };
- const parseVirtualProps = (docs) => {
- return docs.tags
- .filter(({ name }) => name === 'virtualProp')
- .map(parseVirtualProp)
- .filter((prop) => !!prop);
- };
- const parseVirtualProp = (tag) => {
- const results = /^\s*(?:\{([^}]+)\}\s+)?(\w+)\s+-\s+(.*)$/.exec(tag.text);
- if (!results) {
- return undefined;
- }
- const [, type, name, docs] = results;
- return {
- type: type == null ? 'any' : type.trim(),
- name: name.trim(),
- docs: docs.trim(),
- };
- };
- const parseAssetsDirs = (staticMembers, componentFilePath) => {
- const dirs = getStaticValue(staticMembers, 'assetsDirs') || [];
- const componentDir = normalizePath$1(dirname(componentFilePath));
- return dirs.map((dir) => {
- // get the relative path from the component file to the assets directory
- dir = normalizePath$1(dir.trim());
- let absolutePath = dir;
- let cmpRelativePath = dir;
- if (isAbsolute$1(dir)) {
- // if this is an absolute path already, let's convert it to be relative
- cmpRelativePath = relative$1(componentDir, dir);
- }
- else {
- // create the absolute path to the asset dir
- absolutePath = join(componentDir, dir);
- }
- return {
- absolutePath,
- cmpRelativePath,
- originalComponentPath: dir,
- };
- });
- };
- const updateModule = (config, compilerCtx, buildCtx, tsSourceFile, sourceFileText, emitFilePath, typeChecker, collection) => {
- const sourceFilePath = normalizePath$1(tsSourceFile.fileName);
- const prevModuleFile = getModule(compilerCtx, sourceFilePath);
- if (prevModuleFile && prevModuleFile.staticSourceFileText === sourceFileText) {
- return prevModuleFile;
- }
- const srcDirPath = dirname(sourceFilePath);
- const emitFileName = basename(emitFilePath);
- emitFilePath = normalizePath$1(join(srcDirPath, emitFileName));
- const moduleFile = createModule(tsSourceFile, sourceFileText, emitFilePath);
- if (emitFilePath.endsWith('.js.map')) {
- moduleFile.sourceMapPath = emitFilePath;
- moduleFile.sourceMapFileText = sourceFileText;
- }
- else if (prevModuleFile && prevModuleFile.sourceMapPath) {
- moduleFile.sourceMapPath = prevModuleFile.sourceMapPath;
- moduleFile.sourceMapFileText = prevModuleFile.sourceMapFileText;
- }
- const moduleFileKey = normalizePath$1(moduleFile.sourceFilePath);
- compilerCtx.moduleMap.set(moduleFileKey, moduleFile);
- compilerCtx.changedModules.add(moduleFile.sourceFilePath);
- const visitNode = (node) => {
- if (t.isClassDeclaration(node)) {
- parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, compilerCtx.nodeMap);
- return;
- }
- else if (t.isImportDeclaration(node)) {
- parseModuleImport(config, compilerCtx, buildCtx, moduleFile, srcDirPath, node, true);
- return;
- }
- else if (t.isCallExpression(node)) {
- parseCallExpression(moduleFile, node);
- }
- else if (t.isStringLiteral(node)) {
- parseStringLiteral(moduleFile, node);
- }
- node.forEachChild(visitNode);
- };
- if (collection != null) {
- moduleFile.isCollectionDependency = true;
- moduleFile.collectionName = collection.collectionName;
- collection.moduleFiles.push(moduleFile);
- }
- visitNode(tsSourceFile);
- // TODO: workaround around const enums
- // find better way
- if (moduleFile.cmps.length > 0) {
- moduleFile.staticSourceFile = t.createSourceFile(sourceFilePath, sourceFileText, tsSourceFile.languageVersion, true, t.ScriptKind.JS);
- }
- return moduleFile;
- };
- const validateTranspiledComponents = (config, buildCtx) => {
- for (const cmp of buildCtx.components) {
- validateUniqueTagNames(config, buildCtx, cmp);
- }
- };
- const validateUniqueTagNames = (config, buildCtx, cmp) => {
- const tagName = cmp.tagName;
- const cmpsWithTagName = buildCtx.components.filter((c) => c.tagName === tagName);
- if (cmpsWithTagName.length > 1) {
- const err = buildError(buildCtx.diagnostics);
- err.header = `Component Tag Name "${tagName}" Must Be Unique`;
- err.messageText = `Please update the components so "${tagName}" is only used once: ${cmpsWithTagName
- .map((c) => relative$1(config.rootDir, c.sourceFilePath))
- .join(' ')}`;
- }
- };
- const runTsProgram = async (config, compilerCtx, buildCtx, tsBuilder) => {
- const tsSyntactic = loadTypeScriptDiagnostics(tsBuilder.getSyntacticDiagnostics());
- const tsGlobal = loadTypeScriptDiagnostics(tsBuilder.getGlobalDiagnostics());
- const tsOptions = loadTypeScriptDiagnostics(tsBuilder.getOptionsDiagnostics());
- buildCtx.diagnostics.push(...tsSyntactic);
- buildCtx.diagnostics.push(...tsGlobal);
- buildCtx.diagnostics.push(...tsOptions);
- if (buildCtx.hasError) {
- return false;
- }
- const tsProgram = tsBuilder.getProgram();
- const tsTypeChecker = tsProgram.getTypeChecker();
- const typesOutputTarget = config.outputTargets.filter(isOutputTargetDistTypes);
- const emittedDts = [];
- const emitCallback = (emitFilePath, data, _w, _e, tsSourceFiles) => {
- if (emitFilePath.endsWith('.js') || emitFilePath.endsWith('js.map')) {
- updateModule(config, compilerCtx, buildCtx, tsSourceFiles[0], data, emitFilePath, tsTypeChecker, null);
- }
- else if (emitFilePath.endsWith('.d.ts')) {
- const srcDtsPath = normalizePath$1(tsSourceFiles[0].fileName);
- const relativeEmitFilepath = getRelativeDts(config, srcDtsPath, emitFilePath);
- emittedDts.push(srcDtsPath);
- typesOutputTarget.forEach((o) => {
- const distPath = join(o.typesDir, relativeEmitFilepath);
- data = updateStencilTypesImports(o.typesDir, distPath, data);
- compilerCtx.fs.writeFile(distPath, data);
- });
- }
- };
- // Emit files that changed
- tsBuilder.emit(undefined, emitCallback, undefined, false, {
- before: [convertDecoratorsToStatic(config, buildCtx.diagnostics, tsTypeChecker)],
- });
- const changedmodules = Array.from(compilerCtx.changedModules.keys());
- buildCtx.debug('Transpiled modules: ' + JSON.stringify(changedmodules, null, '\n'));
- // Finalize components metadata
- buildCtx.moduleFiles = Array.from(compilerCtx.moduleMap.values());
- buildCtx.components = getComponentsFromModules(buildCtx.moduleFiles);
- updateComponentBuildConditionals(compilerCtx.moduleMap, buildCtx.components);
- resolveComponentDependencies(buildCtx.components);
- validateTranspiledComponents(config, buildCtx);
- if (buildCtx.hasError) {
- return false;
- }
- // create the components.d.ts file and write to disk
- const hasTypesChanged = await generateAppTypes(config, compilerCtx, buildCtx, 'src');
- if (hasTypesChanged) {
- return true;
- }
- if (typesOutputTarget.length > 0) {
- // copy src dts files that do not get emitted by the compiler
- // but we still want to ship them in the dist directory
- const srcRootDtsFiles = tsProgram
- .getRootFileNames()
- .filter((f) => f.endsWith('.d.ts') && !f.endsWith('components.d.ts'))
- .map(normalizePath$1)
- .filter((f) => !emittedDts.includes(f))
- .map((srcRootDtsFilePath) => {
- const relativeEmitFilepath = relative$1(config.srcDir, srcRootDtsFilePath);
- return Promise.all(typesOutputTarget.map(async (o) => {
- const distPath = join(o.typesDir, relativeEmitFilepath);
- let dtsContent = await compilerCtx.fs.readFile(srcRootDtsFilePath);
- dtsContent = updateStencilTypesImports(o.typesDir, distPath, dtsContent);
- await compilerCtx.fs.writeFile(distPath, dtsContent);
- }));
- });
- await Promise.all(srcRootDtsFiles);
- }
- if (config.validateTypes) {
- const tsSemantic = loadTypeScriptDiagnostics(tsBuilder.getSemanticDiagnostics());
- if (config.devMode) {
- tsSemantic.forEach((semanticDiagnostic) => {
- // Unused variable errors become warnings in dev mode
- if (semanticDiagnostic.code === '6133' || semanticDiagnostic.code === '6192') {
- semanticDiagnostic.level = 'warn';
- }
- });
- }
- buildCtx.diagnostics.push(...tsSemantic);
- }
- return false;
- };
- const getRelativeDts = (config, srcPath, emitDtsPath) => {
- const parts = [];
- for (let i = 0; i < 30; i++) {
- if (config.srcDir === srcPath) {
- break;
- }
- const b = basename(emitDtsPath);
- parts.push(b);
- emitDtsPath = join(emitDtsPath, '..');
- srcPath = normalizePath$1(join(srcPath, '..'));
- }
- return join.apply(null, parts.reverse());
- };
- const outputServiceWorkers = async (config, buildCtx) => {
- const wwwServiceOutputs = config.outputTargets
- .filter(isOutputTargetWww)
- .filter((o) => typeof o.indexHtml === 'string' && !!o.serviceWorker);
- if (wwwServiceOutputs.length === 0 || config.sys.lazyRequire == null) {
- return;
- }
- // let's make sure they have what we need from workbox installed
- const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ['workbox-build']);
- if (diagnostics.length > 0) {
- buildCtx.diagnostics.push(...diagnostics);
- }
- else {
- // we've ensure workbox is installed, so let's require it now
- const workbox = config.sys.lazyRequire.require(config.rootDir, 'workbox-build');
- await Promise.all(wwwServiceOutputs.map((outputTarget) => generateServiceWorker(config, buildCtx, workbox, outputTarget)));
- }
- };
- const validateBuildPackageJson = async (config, compilerCtx, buildCtx) => {
- if (config.watch) {
- return;
- }
- if (buildCtx.packageJson == null) {
- return;
- }
- const outputTargets = config.outputTargets.filter(isOutputTargetDistCollection);
- const typesOutputTargets = config.outputTargets.filter(isOutputTargetDistTypes);
- await Promise.all([
- ...outputTargets.map((outputsTarget) => {
- return validatePackageJsonOutput(config, compilerCtx, buildCtx, outputsTarget);
- }),
- ...typesOutputTargets.map((outputTarget) => {
- return validateTypes(config, compilerCtx, buildCtx, outputTarget);
- }),
- ]);
- };
- const validatePackageJsonOutput = async (config, compilerCtx, buildCtx, outputTarget) => {
- await Promise.all([
- validatePackageFiles(config, compilerCtx, buildCtx, outputTarget),
- validateMain(config, compilerCtx, buildCtx, outputTarget),
- validateModule(config, compilerCtx, buildCtx, outputTarget),
- validateCollection$1(config, compilerCtx, buildCtx, outputTarget),
- validateBrowser(config, compilerCtx, buildCtx),
- ]);
- };
- const validatePackageFiles = async (config, compilerCtx, buildCtx, outputTarget) => {
- if (!config.devMode && Array.isArray(buildCtx.packageJson.files)) {
- const actualDistDir = normalizePath$1(relative$1(config.rootDir, outputTarget.dir));
- const validPaths = [`${actualDistDir}`, `${actualDistDir}/`, `./${actualDistDir}`, `./${actualDistDir}/`];
- const containsDistDir = buildCtx.packageJson.files.some((userPath) => validPaths.some((validPath) => normalizePath$1(userPath) === validPath));
- if (!containsDistDir) {
- const msg = `package.json "files" array must contain the distribution directory "${actualDistDir}/" when generating a distribution.`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"files"`);
- return;
- }
- await Promise.all(buildCtx.packageJson.files.map(async (pkgFile) => {
- if (!isGlob(pkgFile)) {
- const packageJsonDir = dirname(config.packageJsonFilePath);
- const absPath = join(packageJsonDir, pkgFile);
- const hasAccess = await compilerCtx.fs.access(absPath);
- if (!hasAccess) {
- const msg = `Unable to find "${pkgFile}" within the package.json "files" array.`;
- packageJsonError(config, compilerCtx, buildCtx, msg, `"${pkgFile}"`);
- }
- }
- }));
- }
- };
- const validateMain = (config, compilerCtx, buildCtx, outputTarget) => {
- const mainAbs = join(outputTarget.dir, 'index.cjs.js');
- const mainRel = relative$1(config.rootDir, mainAbs);
- if (!isString$1(buildCtx.packageJson.main) || buildCtx.packageJson.main === '') {
- const msg = `package.json "main" property is required when generating a distribution. It's recommended to set the "main" property to: ${mainRel}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
- }
- else if (normalizePath$1(buildCtx.packageJson.main) !== normalizePath$1(mainRel)) {
- const msg = `package.json "main" property is set to "${buildCtx.packageJson.main}". It's recommended to set the "main" property to: ${mainRel}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"main"`);
- }
- };
- const validateModule = (config, compilerCtx, buildCtx, outputTarget) => {
- const customElementsOutput = config.outputTargets.find(isOutputTargetDistCustomElementsBundle);
- const currentModule = buildCtx.packageJson.module;
- const distAbs = join(outputTarget.dir, 'index.js');
- const distRel = relative$1(config.rootDir, distAbs);
- let recommendedRelPath = distRel;
- if (customElementsOutput) {
- const customElementsAbs = join(customElementsOutput.dir, 'index.js');
- recommendedRelPath = relative$1(config.rootDir, customElementsAbs);
- }
- if (!isString$1(currentModule)) {
- const msg = `package.json "module" property is required when generating a distribution. It's recommended to set the "module" property to: ${recommendedRelPath}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
- }
- else if (normalizePath$1(currentModule) !== normalizePath$1(recommendedRelPath) &&
- normalizePath$1(currentModule) !== normalizePath$1(distRel)) {
- const msg = `package.json "module" property is set to "${currentModule}". It's recommended to set the "module" property to: ${recommendedRelPath}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"module"`);
- }
- };
- const validateTypes = async (config, compilerCtx, buildCtx, outputTarget) => {
- const typesAbs = getComponentsDtsTypesFilePath(outputTarget);
- const recommendedPath = relative$1(config.rootDir, typesAbs);
- if (!isString$1(buildCtx.packageJson.types) || buildCtx.packageJson.types === '') {
- const msg = `package.json "types" property is required when generating a distribution. It's recommended to set the "types" property to: ${recommendedPath}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
- }
- else if (!buildCtx.packageJson.types.endsWith('.d.ts')) {
- const msg = `package.json "types" file must have a ".d.ts" extension: ${buildCtx.packageJson.types}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"types"`);
- }
- else {
- const typesFile = join(config.rootDir, buildCtx.packageJson.types);
- const typesFileExists = await compilerCtx.fs.access(typesFile);
- if (!typesFileExists) {
- let msg = `package.json "types" property is set to "${buildCtx.packageJson.types}" but cannot be found.`;
- if (normalizePath$1(buildCtx.packageJson.types) !== normalizePath$1(recommendedPath)) {
- msg += ` It's recommended to set the "types" property to: ${recommendedPath}`;
- }
- packageJsonError(config, compilerCtx, buildCtx, msg, `"types"`);
- }
- }
- };
- const validateCollection$1 = (config, compilerCtx, buildCtx, outputTarget) => {
- if (outputTarget.collectionDir) {
- const collectionRel = join(relative$1(config.rootDir, outputTarget.collectionDir), COLLECTION_MANIFEST_FILE_NAME);
- if (!buildCtx.packageJson.collection || normalizePath$1(buildCtx.packageJson.collection) !== collectionRel) {
- const msg = `package.json "collection" property is required when generating a distribution and must be set to: ${collectionRel}`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"collection"`);
- }
- }
- };
- const validateBrowser = (config, compilerCtx, buildCtx) => {
- if (isString$1(buildCtx.packageJson.browser)) {
- const msg = `package.json "browser" property is set to "${buildCtx.packageJson.browser}". However, for maximum compatibility with all bundlers it's recommended to not set the "browser" property and instead ensure both "module" and "main" properties are set.`;
- packageJsonWarn(config, compilerCtx, buildCtx, msg, `"browser"`);
- }
- };
- const packageJsonError = (config, compilerCtx, buildCtx, msg, warnKey) => {
- const err = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, warnKey);
- err.header = `Package Json`;
- return err;
- };
- const packageJsonWarn = (config, compilerCtx, buildCtx, msg, warnKey) => {
- const warn = buildJsonFileError(compilerCtx, buildCtx.diagnostics, config.packageJsonFilePath, msg, warnKey);
- warn.header = `Package Json`;
- warn.level = 'warn';
- return warn;
- };
- const validateManifestJson = (config, compilerCtx, buildCtx) => {
- if (config.devMode) {
- return null;
- }
- const outputTargets = config.outputTargets.filter(isOutputTargetWww);
- return Promise.all(outputTargets.map(async (outputsTarget) => {
- const manifestFilePath = join(outputsTarget.dir, 'manifest.json');
- try {
- const manifestContent = await compilerCtx.fs.readFile(manifestFilePath);
- if (manifestContent) {
- try {
- const manifestData = JSON.parse(manifestContent);
- await validateManifestJsonData(compilerCtx, buildCtx, manifestFilePath, manifestData);
- }
- catch (e) {
- const err = buildError(buildCtx.diagnostics);
- err.header = `Invalid manifest.json: ${e}`;
- err.absFilePath = manifestFilePath;
- }
- }
- }
- catch (e) { }
- }));
- };
- const validateManifestJsonData = async (compilerCtx, buildCtx, manifestFilePath, manifestData) => {
- if (Array.isArray(manifestData.icons)) {
- await Promise.all(manifestData.icons.map((manifestIcon) => {
- return validateManifestJsonIcon(compilerCtx, buildCtx, manifestFilePath, manifestIcon);
- }));
- }
- };
- const validateManifestJsonIcon = async (compilerCtx, buildCtx, manifestFilePath, manifestIcon) => {
- let iconSrc = manifestIcon.src;
- if (typeof iconSrc !== 'string') {
- const msg = `Manifest icon missing "src"`;
- buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"icons"`);
- return;
- }
- if (iconSrc.startsWith('/')) {
- iconSrc = iconSrc.slice(1);
- }
- const manifestDir = dirname(manifestFilePath);
- const iconPath = join(manifestDir, iconSrc);
- const hasAccess = await compilerCtx.fs.access(iconPath);
- if (!hasAccess) {
- const msg = `Unable to find manifest icon "${manifestIcon.src}"`;
- buildJsonFileError(compilerCtx, buildCtx.diagnostics, manifestFilePath, msg, `"${manifestIcon.src}"`);
- }
- };
- const validateBuildFiles = (config, compilerCtx, buildCtx) => {
- if (buildCtx.hasError) {
- return null;
- }
- return Promise.all([
- validateBuildPackageJson(config, compilerCtx, buildCtx),
- validateManifestJson(config, compilerCtx, buildCtx),
- ]);
- };
- const writeBuild = async (config, compilerCtx, buildCtx) => {
- const timeSpan = buildCtx.createTimeSpan(`writeBuildFiles started`, true);
- let totalFilesWrote = 0;
- try {
- // commit all the writeFiles, mkdirs, rmdirs and unlinks to disk
- const commitResults = await compilerCtx.fs.commit();
- // get the results from the write to disk commit
- buildCtx.filesWritten = commitResults.filesWritten;
- buildCtx.filesDeleted = commitResults.filesDeleted;
- buildCtx.dirsDeleted = commitResults.dirsDeleted;
- buildCtx.dirsAdded = commitResults.dirsAdded;
- totalFilesWrote = commitResults.filesWritten.length;
- // successful write
- // kick off writing the cached file stuff
- // await compilerCtx.cache.commit();
- buildCtx.debug(`in-memory-fs: ${compilerCtx.fs.getMemoryStats()}`);
- // buildCtx.debug(`cache: ${compilerCtx.cache.getMemoryStats()}`);
- await outputServiceWorkers(config, buildCtx), await validateBuildFiles(config, compilerCtx, buildCtx);
- }
- catch (e) {
- catchError(buildCtx.diagnostics, e);
- }
- timeSpan.finish(`writeBuildFiles finished, files wrote: ${totalFilesWrote}`);
- };
- const build = async (config, compilerCtx, buildCtx, tsBuilder) => {
- try {
- // reset process.cwd() for 3rd-party plugins
- process.chdir(config.rootDir);
- // empty the directories on the first build
- await emptyOutputTargets(config, compilerCtx, buildCtx);
- if (buildCtx.hasError)
- return buildAbort(buildCtx);
- if (config.srcIndexHtml) {
- const indexSrcHtml = await compilerCtx.fs.readFile(config.srcIndexHtml);
- if (isString$1(indexSrcHtml)) {
- buildCtx.indexDoc = createDocument(indexSrcHtml);
- }
- }
- await readPackageJson(config, compilerCtx, buildCtx);
- if (buildCtx.hasError)
- return buildAbort(buildCtx);
- // run typescript program
- const tsTimeSpan = buildCtx.createTimeSpan('transpile started');
- const componentDtsChanged = await runTsProgram(config, compilerCtx, buildCtx, tsBuilder);
- tsTimeSpan.finish('transpile finished');
- if (buildCtx.hasError)
- return buildAbort(buildCtx);
- if (config.watch && componentDtsChanged) {
- // silent abort for watch mode only
- return null;
- }
- // preprocess and generate styles before any outputTarget starts
- buildCtx.stylesPromise = generateGlobalStyles(config, compilerCtx, buildCtx);
- if (buildCtx.hasError)
- return buildAbort(buildCtx);
- // create outputs
- await generateOutputTargets(config, compilerCtx, buildCtx);
- if (buildCtx.hasError)
- return buildAbort(buildCtx);
- // write outputs
- await buildCtx.stylesPromise;
- await writeBuild(config, compilerCtx, buildCtx);
- }
- catch (e) {
- // ¯\_(ツ)_/¯
- catchError(buildCtx.diagnostics, e);
- }
- // TODO
- // clear changed files
- compilerCtx.changedFiles.clear();
- // return what we've learned today
- return buildFinish(buildCtx);
- };
- const getTsOptionsToExtend = (config) => {
- const tsOptions = {
- experimentalDecorators: true,
- declaration: config.outputTargets.some(isOutputTargetDistTypes),
- module: t.ModuleKind.ESNext,
- moduleResolution: t.ModuleResolutionKind.NodeJs,
- noEmitOnError: false,
- outDir: config.cacheDir || config.sys.tmpDirSync(),
- sourceMap: config.sourceMap,
- inlineSources: config.sourceMap,
- };
- return tsOptions;
- };
- const createTsBuildProgram = async (config, buildCallback) => {
- let isRunning = false;
- let timeoutId;
- const optionsToExtend = getTsOptionsToExtend(config);
- const tsWatchSys = {
- ...t.sys,
- watchFile(path, callback) {
- if (path.endsWith(`/${GENERATED_DTS$1}`)) {
- return t.sys.watchFile(path, callback);
- }
- return {
- close() { },
- };
- },
- watchDirectory() {
- return {
- close() { },
- };
- },
- setTimeout(callback, time) {
- timeoutId = setInterval(() => {
- if (!isRunning) {
- callback();
- clearInterval(timeoutId);
- }
- }, config.sys.watchTimeout || time);
- return timeoutId;
- },
- clearTimeout(id) {
- return clearInterval(id);
- },
- };
- config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId));
- const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
- config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
- }, (reportWatchStatus) => {
- config.logger.debug(reportWatchStatus.messageText);
- });
- tsWatchHost.afterProgramCreate = async (tsBuilder) => {
- isRunning = true;
- await buildCallback(tsBuilder);
- isRunning = false;
- };
- return t.createWatchProgram(tsWatchHost);
- };
- const createFullBuild = async (config, compilerCtx) => {
- return new Promise((resolve) => {
- let tsWatchProgram = null;
- compilerCtx.events.on('fileUpdate', (p) => {
- config.logger.debug(`fileUpdate: ${p}`);
- compilerCtx.fs.clearFileCache(p);
- });
- const onBuild = async (tsBuilder) => {
- const buildCtx = new BuildContext(config, compilerCtx);
- buildCtx.isRebuild = false;
- buildCtx.requiresFullBuild = true;
- buildCtx.start();
- const result = await build(config, compilerCtx, buildCtx, tsBuilder);
- if (result !== null) {
- if (tsWatchProgram) {
- tsWatchProgram.close();
- tsWatchProgram = null;
- }
- resolve(result);
- }
- };
- createTsBuildProgram(config, onBuild).then((program) => {
- tsWatchProgram = program;
- });
- });
- };
- const createInMemoryFs = (sys) => {
- const items = new Map();
- const outputTargetTypes = new Map();
- const accessData = async (filePath) => {
- const item = getItem(filePath);
- if (typeof item.exists === 'boolean') {
- return {
- exists: item.exists,
- isDirectory: item.isDirectory,
- isFile: item.isFile,
- };
- }
- const data = {
- exists: false,
- isDirectory: false,
- isFile: false,
- };
- const s = await stat(filePath);
- if (s) {
- item.exists = s.exists;
- item.isDirectory = s.isDirectory;
- item.isFile = s.isFile;
- data.exists = item.exists;
- data.isDirectory = item.isDirectory;
- data.isFile = item.isFile;
- }
- else {
- item.exists = false;
- }
- return data;
- };
- const access = async (filePath) => {
- const data = await accessData(filePath);
- return data.exists;
- };
- /**
- * Synchronous!!! Do not use!!!
- * (Only typescript transpiling is allowed to use)
- * @param filePath
- */
- const accessSync = (filePath) => {
- const item = getItem(filePath);
- if (typeof item.exists !== 'boolean') {
- const s = statSync(filePath);
- item.exists = s.exists;
- item.isDirectory = s.isDirectory;
- item.isFile = s.isFile;
- }
- return item.exists;
- };
- const copyFile = async (src, dest) => {
- const item = getItem(src);
- item.queueCopyFileToDest = dest;
- };
- const emptyDirs = async (dirs) => {
- dirs = dirs
- .filter(isString$1)
- .map(normalizePath$1)
- .reduce((dirs, dir) => {
- if (!dirs.includes(dir)) {
- dirs.push(dir);
- }
- return dirs;
- }, []);
- const allFsItems = await Promise.all(dirs.map((dir) => readdir(dir, { recursive: true })));
- const reducedItems = [];
- for (const fsItems of allFsItems) {
- for (const f of fsItems) {
- if (!reducedItems.includes(f.absPath)) {
- reducedItems.push(f.absPath);
- }
- }
- }
- reducedItems.sort((a, b) => {
- const partsA = a.split('/').length;
- const partsB = b.split('/').length;
- if (partsA < partsB)
- return 1;
- if (partsA > partsB)
- return -1;
- return 0;
- });
- await Promise.all(reducedItems.map(removeItem));
- dirs.forEach((dir) => {
- const item = getItem(dir);
- item.isFile = false;
- item.isDirectory = true;
- item.queueWriteToDisk = true;
- item.queueDeleteFromDisk = false;
- });
- };
- const readdir = async (dirPath, opts = {}) => {
- dirPath = normalizePath$1(dirPath);
- const collectedPaths = [];
- if (opts.inMemoryOnly === true) {
- let inMemoryDir = dirPath;
- if (!inMemoryDir.endsWith('/')) {
- inMemoryDir += '/';
- }
- const inMemoryDirs = dirPath.split('/');
- items.forEach((d, filePath) => {
- if (!filePath.startsWith(dirPath)) {
- return;
- }
- const parts = filePath.split('/');
- if (parts.length === inMemoryDirs.length + 1 || (opts.recursive && parts.length > inMemoryDirs.length)) {
- if (d.exists) {
- const item = {
- absPath: filePath,
- relPath: parts[inMemoryDirs.length],
- isDirectory: d.isDirectory,
- isFile: d.isFile,
- };
- if (!shouldExcludeFromReaddir(opts, item)) {
- collectedPaths.push(item);
- }
- }
- }
- });
- }
- else {
- // always a disk read
- await readDirectory(dirPath, dirPath, opts, collectedPaths);
- }
- return collectedPaths.sort((a, b) => {
- if (a.absPath < b.absPath)
- return -1;
- if (a.absPath > b.absPath)
- return 1;
- return 0;
- });
- };
- const readDirectory = async (initPath, dirPath, opts, collectedPaths) => {
- // used internally only so we could easily recursively drill down
- // loop through this directory and sub directories
- // always a disk read!!removeDir
- const dirItems = await sys.readDir(dirPath);
- if (dirItems.length > 0) {
- // cache some facts about this path
- const item = getItem(dirPath);
- item.exists = true;
- item.isFile = false;
- item.isDirectory = true;
- await Promise.all(dirItems.map(async (dirItem) => {
- // let's loop through each of the files we've found so far
- // create an absolute path of the item inside of this directory
- const absPath = normalizePath$1(dirItem);
- const relPath = normalizePath$1(relative$1(initPath, absPath));
- // get the fs stats for the item, could be either a file or directory
- const stats = await stat(absPath);
- const childItem = {
- absPath: absPath,
- relPath: relPath,
- isDirectory: stats.isDirectory,
- isFile: stats.isFile,
- };
- if (shouldExcludeFromReaddir(opts, childItem)) {
- return;
- }
- collectedPaths.push(childItem);
- if (opts.recursive === true && stats.isDirectory === true) {
- // looks like it's yet another directory
- // let's keep drilling down
- await readDirectory(initPath, absPath, opts, collectedPaths);
- }
- }));
- }
- };
- const shouldExcludeFromReaddir = (opts, item) => {
- if (item.isDirectory) {
- if (Array.isArray(opts.excludeDirNames)) {
- const base = basename(item.absPath);
- if (opts.excludeDirNames.some((dir) => base === dir)) {
- return true;
- }
- }
- }
- else {
- if (Array.isArray(opts.excludeExtensions)) {
- const p = item.relPath.toLowerCase();
- if (opts.excludeExtensions.some((ext) => p.endsWith(ext))) {
- return true;
- }
- }
- }
- return false;
- };
- const readFile = async (filePath, opts) => {
- if (opts == null || opts.useCache === true || opts.useCache === undefined) {
- const item = getItem(filePath);
- if (item.exists && typeof item.fileText === 'string') {
- return item.fileText;
- }
- }
- const fileText = await sys.readFile(filePath);
- const item = getItem(filePath);
- if (typeof fileText === 'string') {
- if (fileText.length < MAX_TEXT_CACHE) {
- item.exists = true;
- item.isFile = true;
- item.isDirectory = false;
- item.fileText = fileText;
- }
- }
- else {
- item.exists = false;
- }
- return fileText;
- };
- /**
- * Synchronous!!! Do not use!!!
- * (Only typescript transpiling is allowed to use)
- * @param filePath
- */
- const readFileSync = (filePath, opts) => {
- if (opts == null || opts.useCache === true || opts.useCache === undefined) {
- const item = getItem(filePath);
- if (item.exists && typeof item.fileText === 'string') {
- return item.fileText;
- }
- }
- const fileText = sys.readFileSync(filePath);
- const item = getItem(filePath);
- if (typeof fileText === 'string') {
- if (fileText.length < MAX_TEXT_CACHE) {
- item.exists = true;
- item.isFile = true;
- item.isDirectory = false;
- item.fileText = fileText;
- }
- }
- else {
- item.exists = false;
- }
- return fileText;
- };
- const remove = async (itemPath) => {
- const stats = await stat(itemPath);
- if (stats.isDirectory === true) {
- await removeDir(itemPath);
- }
- else if (stats.isFile === true) {
- await removeItem(itemPath);
- }
- };
- const removeDir = async (dirPath) => {
- const item = getItem(dirPath);
- item.isFile = false;
- item.isDirectory = true;
- if (!item.queueWriteToDisk) {
- item.queueDeleteFromDisk = true;
- }
- try {
- const dirItems = await readdir(dirPath, { recursive: true });
- await Promise.all(dirItems.map((item) => {
- if (item.relPath.endsWith('.gitkeep')) {
- return null;
- }
- return removeItem(item.absPath);
- }));
- }
- catch (e) {
- // do not throw error if the directory never existed
- }
- };
- const removeItem = async (filePath) => {
- const item = getItem(filePath);
- if (!item.queueWriteToDisk) {
- item.queueDeleteFromDisk = true;
- }
- };
- const stat = async (itemPath) => {
- const item = getItem(itemPath);
- if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
- const stat = await sys.stat(itemPath);
- if (!stat.error) {
- item.exists = true;
- if (stat.isFile) {
- item.isFile = true;
- item.isDirectory = false;
- item.size = stat.size;
- }
- else if (stat.isDirectory) {
- item.isFile = false;
- item.isDirectory = true;
- item.size = stat.size;
- }
- else {
- item.isFile = false;
- item.isDirectory = false;
- item.size = null;
- }
- }
- else {
- item.exists = false;
- }
- }
- return {
- exists: !!item.exists,
- isFile: !!item.isFile,
- isDirectory: !!item.isDirectory,
- size: typeof item.size === 'number' ? item.size : 0,
- };
- };
- /**
- * Synchronous!!! Do not use!!!
- * Always returns an object, does not throw errors.
- * (Only typescript transpiling is allowed to use)
- * @param itemPath
- */
- const statSync = (itemPath) => {
- const item = getItem(itemPath);
- if (typeof item.isDirectory !== 'boolean' || typeof item.isFile !== 'boolean') {
- const stat = sys.statSync(itemPath);
- if (!stat.error) {
- item.exists = true;
- if (stat.isFile) {
- item.isFile = true;
- item.isDirectory = false;
- item.size = stat.size;
- }
- else if (stat.isDirectory) {
- item.isFile = false;
- item.isDirectory = true;
- item.size = stat.size;
- }
- else {
- item.isFile = false;
- item.isDirectory = false;
- item.size = null;
- }
- }
- else {
- item.exists = false;
- }
- }
- return {
- exists: !!item.exists,
- isFile: !!item.isFile,
- isDirectory: !!item.isDirectory,
- };
- };
- const writeFile = async (filePath, content, opts) => {
- if (typeof filePath !== 'string') {
- throw new Error(`writeFile, invalid filePath: ${filePath}`);
- }
- if (typeof content !== 'string') {
- throw new Error(`writeFile, invalid content: ${filePath}`);
- }
- const results = {
- ignored: false,
- changedContent: false,
- queuedWrite: false,
- };
- if (shouldIgnore(filePath) === true) {
- results.ignored = true;
- return results;
- }
- const item = getItem(filePath);
- item.exists = true;
- item.isFile = true;
- item.isDirectory = false;
- item.queueDeleteFromDisk = false;
- if (typeof item.fileText === 'string') {
- // compare strings but replace Windows CR to rule out any
- // insignificant new line differences
- results.changedContent = item.fileText.replace(/\r/g, '') !== content.replace(/\r/g, '');
- }
- else {
- results.changedContent = true;
- }
- item.fileText = content;
- results.queuedWrite = false;
- if (opts != null) {
- if (typeof opts.outputTargetType === 'string') {
- outputTargetTypes.set(filePath, opts.outputTargetType);
- }
- if (opts.useCache === false) {
- item.useCache = false;
- }
- }
- if (opts != null && opts.inMemoryOnly === true) {
- // we don't want to actually write this to disk
- // just keep it in memory
- if (item.queueWriteToDisk) {
- // we already queued this file to write to disk
- // in that case we still need to do it
- results.queuedWrite = true;
- }
- else {
- // we only want this in memory and
- // it wasn't already queued to be written
- item.queueWriteToDisk = false;
- }
- // ensure in-memory directories are created
- await ensureDir(filePath, true);
- }
- else if (opts != null && opts.immediateWrite === true) {
- // if this is an immediate write then write the file
- // now and do not add it to the queue
- if (results.changedContent || opts.useCache !== true) {
- // writing the file to disk is a big deal and kicks off fs watchers
- // so let's just double check that the file is actually different first
- const existingFile = await sys.readFile(filePath);
- if (typeof existingFile === 'string') {
- results.changedContent = item.fileText.replace(/\r/g, '') !== existingFile.replace(/\r/g, '');
- }
- if (results.changedContent) {
- await ensureDir(filePath, false);
- await sys.writeFile(filePath, item.fileText);
- }
- }
- }
- else {
- // we want to write this to disk (eventually)
- // but only if the content is different
- // from our existing cached content
- if (!item.queueWriteToDisk && results.changedContent === true) {
- // not already queued to be written
- // and the content is different
- item.queueWriteToDisk = true;
- results.queuedWrite = true;
- }
- }
- return results;
- };
- const writeFiles = (files, opts) => {
- const writes = [];
- if (isIterable(files)) {
- files.forEach((content, filePath) => {
- writes.push(writeFile(filePath, content, opts));
- });
- }
- else {
- Object.keys(files).map((filePath) => {
- writes.push(writeFile(filePath, files[filePath], opts));
- });
- }
- return Promise.all(writes);
- };
- const commit = async () => {
- const instructions = getCommitInstructions(items);
- // ensure directories we need exist
- const dirsAdded = await commitEnsureDirs(instructions.dirsToEnsure, false);
- // write all queued the files
- const filesWritten = await commitWriteFiles(instructions.filesToWrite);
- // write all queued the files to copy
- const filesCopied = await commitCopyFiles(instructions.filesToCopy);
- // remove all the queued files to be deleted
- const filesDeleted = await commitDeleteFiles(instructions.filesToDelete);
- // remove all the queued dirs to be deleted
- const dirsDeleted = await commitDeleteDirs(instructions.dirsToDelete);
- instructions.filesToDelete.forEach(clearFileCache);
- instructions.dirsToDelete.forEach(clearDirCache);
- // return only the files that were
- return {
- filesCopied,
- filesWritten,
- filesDeleted,
- dirsDeleted,
- dirsAdded,
- };
- };
- const ensureDir = async (p, inMemoryOnly) => {
- const allDirs = [];
- while (true) {
- p = dirname(p);
- if (typeof p === 'string' &&
- p.length > 0 &&
- p !== '/' &&
- p.endsWith(':/') === false &&
- p.endsWith(':\\') === false) {
- allDirs.push(p);
- }
- else {
- break;
- }
- }
- allDirs.reverse();
- await commitEnsureDirs(allDirs, inMemoryOnly);
- };
- const commitEnsureDirs = async (dirsToEnsure, inMemoryOnly) => {
- const dirsAdded = [];
- for (const dirPath of dirsToEnsure) {
- const item = getItem(dirPath);
- if (item.exists === true && item.isDirectory === true) {
- // already cached that this path is indeed an existing directory
- continue;
- }
- try {
- // cache that we know this is a directory on disk
- item.exists = true;
- item.isDirectory = true;
- item.isFile = false;
- if (!inMemoryOnly) {
- await sys.createDir(dirPath);
- }
- dirsAdded.push(dirPath);
- }
- catch (e) { }
- }
- return dirsAdded;
- };
- const commitCopyFiles = (filesToCopy) => {
- const copiedFiles = Promise.all(filesToCopy.map(async (data) => {
- const src = data[0];
- const dest = data[1];
- await sys.copyFile(src, dest);
- return [src, dest];
- }));
- return copiedFiles;
- };
- const commitWriteFiles = (filesToWrite) => {
- const writtenFiles = Promise.all(filesToWrite.map(async (filePath) => {
- if (typeof filePath !== 'string') {
- throw new Error(`unable to writeFile without filePath`);
- }
- return commitWriteFile(filePath);
- }));
- return writtenFiles;
- };
- const commitWriteFile = async (filePath) => {
- const item = getItem(filePath);
- if (item.fileText == null) {
- throw new Error(`unable to find item fileText to write: ${filePath}`);
- }
- await sys.writeFile(filePath, item.fileText);
- if (item.useCache === false) {
- clearFileCache(filePath);
- }
- return filePath;
- };
- const commitDeleteFiles = async (filesToDelete) => {
- const deletedFiles = await Promise.all(filesToDelete.map(async (filePath) => {
- if (typeof filePath !== 'string') {
- throw new Error(`unable to unlink without filePath`);
- }
- await sys.removeFile(filePath);
- return filePath;
- }));
- return deletedFiles;
- };
- const commitDeleteDirs = async (dirsToDelete) => {
- const dirsDeleted = [];
- for (const dirPath of dirsToDelete) {
- await sys.removeDir(dirPath);
- dirsDeleted.push(dirPath);
- }
- return dirsDeleted;
- };
- const clearDirCache = (dirPath) => {
- dirPath = normalizePath$1(dirPath);
- items.forEach((_, f) => {
- const filePath = relative$1(dirPath, f).split('/')[0];
- if (!filePath.startsWith('.') && !filePath.startsWith('/')) {
- clearFileCache(f);
- }
- });
- };
- const clearFileCache = (filePath) => {
- filePath = normalizePath$1(filePath);
- const item = items.get(filePath);
- if (item != null && !item.queueWriteToDisk) {
- items.delete(filePath);
- }
- };
- const cancelDeleteFilesFromDisk = (filePaths) => {
- for (const filePath of filePaths) {
- const item = getItem(filePath);
- if (item.isFile === true && item.queueDeleteFromDisk === true) {
- item.queueDeleteFromDisk = false;
- }
- }
- };
- const cancelDeleteDirectoriesFromDisk = (dirPaths) => {
- for (const dirPath of dirPaths) {
- const item = getItem(dirPath);
- if (item.queueDeleteFromDisk === true) {
- item.queueDeleteFromDisk = false;
- }
- }
- };
- const getItem = (itemPath) => {
- itemPath = normalizePath$1(itemPath);
- let item = items.get(itemPath);
- if (item != null) {
- return item;
- }
- items.set(itemPath, (item = {
- exists: null,
- fileText: null,
- size: null,
- mtimeMs: null,
- isDirectory: null,
- isFile: null,
- queueCopyFileToDest: null,
- queueDeleteFromDisk: null,
- queueWriteToDisk: null,
- useCache: null,
- }));
- return item;
- };
- const clearCache = () => items.clear();
- const keys = () => Array.from(items.keys()).sort();
- const getMemoryStats = () => `data length: ${items.size}`;
- const getBuildOutputs = () => {
- const outputs = [];
- outputTargetTypes.forEach((outputTargetType, filePath) => {
- const output = outputs.find((o) => o.type === outputTargetType);
- if (output) {
- output.files.push(filePath);
- }
- else {
- outputs.push({
- type: outputTargetType,
- files: [filePath],
- });
- }
- });
- outputs.forEach((o) => o.files.sort());
- return outputs.sort((a, b) => {
- if (a.type < b.type)
- return -1;
- if (a.type > b.type)
- return 1;
- return 0;
- });
- };
- // only cache if it's less than 5MB-ish (using .length as a rough guess)
- // why 5MB? idk, seems like a good number for source text
- // it's pretty darn large to cover almost ALL legitimate source files
- // and anything larger is probably a REALLY large file and a rare case
- // which we don't need to eat up memory for
- const MAX_TEXT_CACHE = 5242880;
- const fs = {
- access,
- accessSync,
- accessData,
- cancelDeleteDirectoriesFromDisk,
- cancelDeleteFilesFromDisk,
- clearCache,
- clearDirCache,
- clearFileCache,
- commit,
- copyFile,
- emptyDirs,
- getBuildOutputs,
- getItem,
- getMemoryStats,
- keys,
- readFile,
- readFileSync,
- readdir,
- remove,
- stat,
- statSync,
- sys,
- writeFile,
- writeFiles,
- };
- return fs;
- };
- const getCommitInstructions = (items) => {
- const instructions = {
- filesToDelete: [],
- filesToWrite: [],
- filesToCopy: [],
- dirsToDelete: [],
- dirsToEnsure: [],
- };
- items.forEach((item, itemPath) => {
- if (item.queueWriteToDisk === true) {
- if (item.isFile === true) {
- instructions.filesToWrite.push(itemPath);
- const dir = normalizePath$1(dirname(itemPath));
- if (!instructions.dirsToEnsure.includes(dir)) {
- instructions.dirsToEnsure.push(dir);
- }
- const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
- if (dirDeleteIndex > -1) {
- instructions.dirsToDelete.splice(dirDeleteIndex, 1);
- }
- const fileDeleteIndex = instructions.filesToDelete.indexOf(itemPath);
- if (fileDeleteIndex > -1) {
- instructions.filesToDelete.splice(fileDeleteIndex, 1);
- }
- }
- else if (item.isDirectory === true) {
- if (!instructions.dirsToEnsure.includes(itemPath)) {
- instructions.dirsToEnsure.push(itemPath);
- }
- const dirDeleteIndex = instructions.dirsToDelete.indexOf(itemPath);
- if (dirDeleteIndex > -1) {
- instructions.dirsToDelete.splice(dirDeleteIndex, 1);
- }
- }
- }
- else if (item.queueDeleteFromDisk === true) {
- if (item.isDirectory && !instructions.dirsToEnsure.includes(itemPath)) {
- instructions.dirsToDelete.push(itemPath);
- }
- else if (item.isFile && !instructions.filesToWrite.includes(itemPath)) {
- instructions.filesToDelete.push(itemPath);
- }
- }
- else if (typeof item.queueCopyFileToDest === 'string') {
- const src = itemPath;
- const dest = item.queueCopyFileToDest;
- instructions.filesToCopy.push([src, dest]);
- const dir = normalizePath$1(dirname(dest));
- if (!instructions.dirsToEnsure.includes(dir)) {
- instructions.dirsToEnsure.push(dir);
- }
- const dirDeleteIndex = instructions.dirsToDelete.indexOf(dir);
- if (dirDeleteIndex > -1) {
- instructions.dirsToDelete.splice(dirDeleteIndex, 1);
- }
- const fileDeleteIndex = instructions.filesToDelete.indexOf(dest);
- if (fileDeleteIndex > -1) {
- instructions.filesToDelete.splice(fileDeleteIndex, 1);
- }
- }
- item.queueDeleteFromDisk = false;
- item.queueWriteToDisk = false;
- });
- // add all the ancestor directories for each directory too
- for (let i = 0, ilen = instructions.dirsToEnsure.length; i < ilen; i++) {
- const segments = instructions.dirsToEnsure[i].split('/');
- for (let j = 2; j < segments.length; j++) {
- const dir = segments.slice(0, j).join('/');
- if (instructions.dirsToEnsure.includes(dir) === false) {
- instructions.dirsToEnsure.push(dir);
- }
- }
- }
- // sort directories so shortest paths are ensured first
- instructions.dirsToEnsure.sort((a, b) => {
- const segmentsA = a.split('/').length;
- const segmentsB = b.split('/').length;
- if (segmentsA < segmentsB)
- return -1;
- if (segmentsA > segmentsB)
- return 1;
- if (a.length < b.length)
- return -1;
- if (a.length > b.length)
- return 1;
- return 0;
- });
- // sort directories so longest paths are removed first
- instructions.dirsToDelete.sort((a, b) => {
- const segmentsA = a.split('/').length;
- const segmentsB = b.split('/').length;
- if (segmentsA < segmentsB)
- return 1;
- if (segmentsA > segmentsB)
- return -1;
- if (a.length < b.length)
- return 1;
- if (a.length > b.length)
- return -1;
- return 0;
- });
- for (const dirToEnsure of instructions.dirsToEnsure) {
- const i = instructions.dirsToDelete.indexOf(dirToEnsure);
- if (i > -1) {
- instructions.dirsToDelete.splice(i, 1);
- }
- }
- instructions.dirsToDelete = instructions.dirsToDelete.filter((dir) => {
- if (dir === '/' || dir.endsWith(':/') === true) {
- return false;
- }
- return true;
- });
- instructions.dirsToEnsure = instructions.dirsToEnsure.filter((dir) => {
- const item = items.get(dir);
- if (item != null && item.exists === true && item.isDirectory === true) {
- return false;
- }
- if (dir === '/' || dir.endsWith(':/')) {
- return false;
- }
- return true;
- });
- return instructions;
- };
- const shouldIgnore = (filePath) => {
- filePath = filePath.trim().toLowerCase();
- return IGNORE.some((ignoreFile) => filePath.endsWith(ignoreFile));
- };
- const IGNORE = ['.ds_store', '.gitignore', 'desktop.ini', 'thumbs.db'];
- const createWorkerMainContext = (workerCtrl) => ({
- optimizeCss: workerCtrl.handler('optimizeCss'),
- prepareModule: workerCtrl.handler('prepareModule'),
- prerenderWorker: workerCtrl.handler('prerenderWorker'),
- transformCssToEsm: workerCtrl.handler('transformCssToEsm'),
- });
- const createSysWorker = (config) => {
- if (isFunction(config.sys.createWorkerController) &&
- config.maxConcurrentWorkers > 0 &&
- config.sys.hardwareConcurrency > 1) {
- const workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
- config.sys.addDestory(() => workerCtrl.destroy());
- config.logger.debug(`create workers, maxWorkers: ${workerCtrl.maxWorkers}`);
- return createWorkerMainContext(workerCtrl);
- }
- config.logger.debug(`no workers, maxConcurrentWorkers: ${config.maxConcurrentWorkers}, hardwareConcurrency: ${config.sys.hardwareConcurrency}`);
- return createWorkerContext(config.sys);
- };
- const createTsWatchProgram = async (config, buildCallback) => {
- let isRunning = false;
- let lastTsBuilder;
- let timeoutId;
- let rebuildTimer;
- const optionsToExtend = getTsOptionsToExtend(config);
- const tsWatchSys = {
- ...t.sys,
- setTimeout(callback, time) {
- clearInterval(rebuildTimer);
- const t = (timeoutId = setInterval(() => {
- if (!isRunning) {
- callback();
- clearInterval(t);
- timeoutId = rebuildTimer = null;
- }
- }, config.sys.watchTimeout || time));
- return t;
- },
- clearTimeout(id) {
- return clearInterval(id);
- },
- };
- config.sys.addDestory(() => tsWatchSys.clearTimeout(timeoutId));
- const tsWatchHost = t.createWatchCompilerHost(config.tsconfig, optionsToExtend, tsWatchSys, t.createEmitAndSemanticDiagnosticsBuilderProgram, (reportDiagnostic) => {
- config.logger.debug('watch reportDiagnostic:' + reportDiagnostic.messageText);
- }, (reportWatchStatus) => {
- config.logger.debug(reportWatchStatus.messageText);
- });
- tsWatchHost.afterProgramCreate = async (tsBuilder) => {
- lastTsBuilder = tsBuilder;
- isRunning = true;
- await buildCallback(tsBuilder);
- isRunning = false;
- };
- return {
- program: t.createWatchProgram(tsWatchHost),
- rebuild: () => {
- if (lastTsBuilder && !timeoutId) {
- rebuildTimer = tsWatchSys.setTimeout(() => tsWatchHost.afterProgramCreate(lastTsBuilder), 300);
- }
- },
- };
- };
- const filesChanged = (buildCtx) => {
- // files changed include updated, added and deleted
- return unique([...buildCtx.filesUpdated, ...buildCtx.filesAdded, ...buildCtx.filesDeleted]).sort();
- };
- const scriptsAdded = (buildCtx) => {
- // collect all the scripts that were added
- return buildCtx.filesAdded
- .filter((f) => {
- return SCRIPT_EXT.some((ext) => f.endsWith(ext.toLowerCase()));
- })
- .map((f) => basename(f));
- };
- const scriptsDeleted = (buildCtx) => {
- // collect all the scripts that were deleted
- return buildCtx.filesDeleted
- .filter((f) => {
- return SCRIPT_EXT.some((ext) => f.endsWith(ext.toLowerCase()));
- })
- .map((f) => basename(f));
- };
- const hasScriptChanges = (buildCtx) => {
- return buildCtx.filesChanged.some((f) => {
- const ext = getExt(f);
- return SCRIPT_EXT.includes(ext);
- });
- };
- const hasStyleChanges = (buildCtx) => {
- return buildCtx.filesChanged.some((f) => {
- const ext = getExt(f);
- return STYLE_EXT.includes(ext);
- });
- };
- const getExt = (filePath) => filePath.split('.').pop().toLowerCase();
- const SCRIPT_EXT = ['ts', 'tsx', 'js', 'jsx'];
- const STYLE_EXT = ['css', 'scss', 'sass', 'pcss', 'styl', 'stylus', 'less'];
- const hasHtmlChanges = (config, buildCtx) => {
- const anyHtmlChanged = buildCtx.filesChanged.some((f) => f.toLowerCase().endsWith('.html'));
- if (anyHtmlChanged) {
- // any *.html in any directory that changes counts and rebuilds
- return true;
- }
- const srcIndexHtmlChanged = buildCtx.filesChanged.some((fileChanged) => {
- // the src index index.html file has changed
- // this file name could be something other than index.html
- return fileChanged === config.srcIndexHtml;
- });
- return srcIndexHtmlChanged;
- };
- const isWatchIgnorePath = (config, path) => {
- if (isString$1(path)) {
- const isWatchIgnore = config.watchIgnoredRegex.some((reg) => reg.test(path));
- if (isWatchIgnore) {
- return true;
- }
- const outputTargets = config.outputTargets;
- const ignoreFiles = [
- ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.file),
- ...outputTargets.filter(isOutputTargetDocsJson).map((o) => o.typesFile),
- ...outputTargets.filter(isOutputTargetStats).map((o) => o.file),
- ...outputTargets.filter(isOutputTargetDocsVscode).map((o) => o.file),
- ];
- if (ignoreFiles.includes(path)) {
- return true;
- }
- }
- return false;
- };
- const createWatchBuild = async (config, compilerCtx) => {
- let isRebuild = false;
- let tsWatchProgram;
- let closeResolver;
- const watchWaiter = new Promise((resolve) => (closeResolver = resolve));
- const dirsAdded = new Set();
- const dirsDeleted = new Set();
- const filesAdded = new Set();
- const filesUpdated = new Set();
- const filesDeleted = new Set();
- const onBuild = async (tsBuilder) => {
- const buildCtx = new BuildContext(config, compilerCtx);
- buildCtx.isRebuild = isRebuild;
- buildCtx.requiresFullBuild = !isRebuild;
- buildCtx.dirsAdded = Array.from(dirsAdded.keys()).sort();
- buildCtx.dirsDeleted = Array.from(dirsDeleted.keys()).sort();
- buildCtx.filesAdded = Array.from(filesAdded.keys()).sort();
- buildCtx.filesUpdated = Array.from(filesUpdated.keys()).sort();
- buildCtx.filesDeleted = Array.from(filesDeleted.keys()).sort();
- buildCtx.filesChanged = filesChanged(buildCtx);
- buildCtx.scriptsAdded = scriptsAdded(buildCtx);
- buildCtx.scriptsDeleted = scriptsDeleted(buildCtx);
- buildCtx.hasScriptChanges = hasScriptChanges(buildCtx);
- buildCtx.hasStyleChanges = hasStyleChanges(buildCtx);
- buildCtx.hasHtmlChanges = hasHtmlChanges(config, buildCtx);
- buildCtx.hasServiceWorkerChanges = hasServiceWorkerChanges(config, buildCtx);
- dirsAdded.clear();
- dirsDeleted.clear();
- filesAdded.clear();
- filesUpdated.clear();
- filesDeleted.clear();
- emitFsChange(compilerCtx, buildCtx);
- buildCtx.start();
- const result = await build(config, compilerCtx, buildCtx, tsBuilder);
- if (result && !result.hasError) {
- isRebuild = true;
- }
- };
- const start = async () => {
- const srcRead = watchSrcDirectory(config, compilerCtx);
- const otherRead = watchRootFiles(config, compilerCtx);
- await srcRead;
- await otherRead;
- tsWatchProgram = await createTsWatchProgram(config, onBuild);
- return watchWaiter;
- };
- const watchingDirs = new Map();
- const watchingFiles = new Map();
- const onFsChange = (p, eventKind) => {
- if (tsWatchProgram && !isWatchIgnorePath(config, p)) {
- updateCompilerCtxCache(config, compilerCtx, p, eventKind);
- switch (eventKind) {
- case 'dirAdd':
- dirsAdded.add(p);
- break;
- case 'dirDelete':
- dirsDeleted.add(p);
- break;
- case 'fileAdd':
- filesAdded.add(p);
- break;
- case 'fileUpdate':
- filesUpdated.add(p);
- break;
- case 'fileDelete':
- filesDeleted.add(p);
- break;
- }
- config.logger.debug(`onFsChange ${eventKind}: ${p}`);
- tsWatchProgram.rebuild();
- }
- };
- const onDirChange = (p, eventKind) => {
- if (eventKind != null) {
- onFsChange(p, eventKind);
- }
- };
- const close = async () => {
- watchingDirs.forEach((w) => w.close());
- watchingFiles.forEach((w) => w.close());
- watchingDirs.clear();
- watchingFiles.clear();
- if (tsWatchProgram) {
- tsWatchProgram.program.close();
- tsWatchProgram = null;
- }
- const watcherCloseResults = {
- exitCode: 0,
- };
- closeResolver(watcherCloseResults);
- return watcherCloseResults;
- };
- const request = async (data) => compilerRequest(config, compilerCtx, data);
- compilerCtx.addWatchFile = (filePath) => {
- if (isString$1(filePath) && !watchingFiles.has(filePath) && !isWatchIgnorePath(config, filePath)) {
- watchingFiles.set(filePath, config.sys.watchFile(filePath, onFsChange));
- }
- };
- compilerCtx.addWatchDir = (dirPath, recursive) => {
- if (isString$1(dirPath) && !watchingDirs.has(dirPath) && !isWatchIgnorePath(config, dirPath)) {
- watchingDirs.set(dirPath, config.sys.watchDirectory(dirPath, onDirChange, recursive));
- }
- };
- config.sys.addDestory(close);
- return {
- start,
- close,
- on: compilerCtx.events.on,
- request,
- };
- };
- const watchSrcDirectory = async (config, compilerCtx) => {
- const srcFiles = await compilerCtx.fs.readdir(config.srcDir, {
- recursive: true,
- excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
- excludeExtensions: [
- '.md',
- '.markdown',
- '.txt',
- '.spec.ts',
- '.spec.tsx',
- '.e2e.ts',
- '.e2e.tsx',
- '.gitignore',
- '.editorconfig',
- ],
- });
- srcFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
- compilerCtx.addWatchDir(config.srcDir, true);
- };
- const watchRootFiles = async (config, compilerCtx) => {
- // non-src files that cause a rebuild
- // mainly for root level config files, and getting an event when they change
- const rootFiles = await compilerCtx.fs.readdir(config.rootDir, {
- recursive: false,
- excludeDirNames: ['.cache', '.git', '.github', '.stencil', '.vscode', 'node_modules'],
- });
- rootFiles.filter(({ isFile }) => isFile).forEach(({ absPath }) => compilerCtx.addWatchFile(absPath));
- };
- const emitFsChange = (compilerCtx, buildCtx) => {
- if (buildCtx.dirsAdded.length > 0 ||
- buildCtx.dirsDeleted.length > 0 ||
- buildCtx.filesUpdated.length > 0 ||
- buildCtx.filesAdded.length > 0 ||
- buildCtx.filesDeleted.length > 0) {
- compilerCtx.events.emit('fsChange', {
- dirsAdded: buildCtx.dirsAdded.slice(),
- dirsDeleted: buildCtx.dirsDeleted.slice(),
- filesUpdated: buildCtx.filesUpdated.slice(),
- filesAdded: buildCtx.filesAdded.slice(),
- filesDeleted: buildCtx.filesDeleted.slice(),
- });
- }
- };
- const updateCompilerCtxCache = (config, compilerCtx, path, kind) => {
- compilerCtx.fs.clearFileCache(path);
- compilerCtx.changedFiles.add(path);
- if (kind === 'fileDelete') {
- compilerCtx.moduleMap.delete(path);
- }
- else if (kind === 'dirDelete') {
- const fsRootDir = resolve$1('/');
- compilerCtx.moduleMap.forEach((_, moduleFilePath) => {
- let moduleAncestorDir = dirname(moduleFilePath);
- for (let i = 0; i < 50; i++) {
- if (moduleAncestorDir === config.rootDir || moduleAncestorDir === fsRootDir) {
- break;
- }
- if (moduleAncestorDir === path) {
- compilerCtx.fs.clearFileCache(moduleFilePath);
- compilerCtx.moduleMap.delete(moduleFilePath);
- compilerCtx.changedFiles.add(moduleFilePath);
- break;
- }
- moduleAncestorDir = dirname(moduleAncestorDir);
- }
- });
- }
- };
- const getConfig = (userConfig) => {
- const config = { ...userConfig };
- if (!config.logger) {
- config.logger = createLogger();
- }
- if (!config.sys) {
- config.sys = createSystem({ logger: config.logger });
- }
- setPlatformPath(config.sys.platformPath);
- config.flags = config.flags || {};
- if (config.flags.debug || config.flags.verbose) {
- config.logLevel = 'debug';
- }
- else if (config.flags.logLevel) {
- config.logLevel = config.flags.logLevel;
- }
- else if (typeof config.logLevel !== 'string') {
- config.logLevel = 'info';
- }
- config.logger.setLevel(config.logLevel);
- return config;
- };
- const patchFs = (userSys) => {
- const fsObj = fs$3;
- Object.assign(fsObj.__sys, userSys);
- };
- const createCompiler = async (config) => {
- // actual compiler code
- // could be in a web worker on the browser
- // or the main thread in node
- config = getConfig(config);
- const diagnostics = [];
- const sys = config.sys;
- const compilerCtx = new CompilerContext();
- if (isFunction(config.sys.setupCompiler)) {
- config.sys.setupCompiler({ ts: t });
- }
- patchFs(sys);
- compilerCtx.fs = createInMemoryFs(sys);
- compilerCtx.cache = new Cache(config, createInMemoryFs(sys));
- await compilerCtx.cache.initCacheDir();
- sys.resolveModuleId = (opts) => resolveModuleIdAsync(sys, compilerCtx.fs, opts);
- compilerCtx.worker = createSysWorker(config);
- if (sys.events) {
- // Pipe events from sys.events to compilerCtx
- sys.events.on(compilerCtx.events.emit);
- }
- patchTypescript(config, compilerCtx.fs);
- const build = () => createFullBuild(config, compilerCtx);
- const createWatcher = () => createWatchBuild(config, compilerCtx);
- const destroy = async () => {
- compilerCtx.reset();
- compilerCtx.events.unsubscribeAll();
- await sys.destroy();
- };
- const compiler = {
- build,
- createWatcher,
- destroy,
- sys,
- };
- config.logger.printDiagnostics(diagnostics);
- return compiler;
- };
- const createHydrateBuildId = () => {
- // should be case insensitive because it could be in a URL
- // and shouldn't start with a number cuz we might use it as a js prop
- let chars = 'abcdefghijklmnopqrstuvwxyz';
- let buildId = '';
- while (buildId.length < 8) {
- const char = chars[Math.floor(Math.random() * chars.length)];
- buildId += char;
- if (buildId.length === 1) {
- chars += '0123456789';
- }
- }
- return buildId;
- };
- const getWriteFilePathFromUrlPath = (manager, inputHref) => {
- const baseUrl = new URL(manager.outputTarget.baseUrl, manager.devServerHostUrl);
- const basePathname = baseUrl.pathname.toLowerCase();
- const inputUrl = new URL(inputHref, manager.devServerHostUrl);
- const inputPathname = inputUrl.pathname.toLowerCase();
- const basePathParts = basePathname.split('/');
- const inputPathParts = inputPathname.split('/');
- const isPrerrenderRoot = basePathname === inputPathname;
- let fileName;
- if (isPrerrenderRoot) {
- fileName = path$5.basename(manager.outputTarget.indexHtml);
- }
- else {
- fileName = 'index.html';
- }
- const pathParts = [];
- for (let i = 0; i < inputPathParts.length; i++) {
- const basePathPart = basePathParts[i];
- const inputPathPart = inputPathParts[i];
- if (typeof basePathPart === 'string' && basePathPart === inputPathPart) {
- continue;
- }
- if (i === inputPathParts.length - 1) {
- const lastPart = inputPathParts[i].toLowerCase();
- if (lastPart.endsWith('.html') || lastPart.endsWith('.htm')) {
- fileName = inputPathParts[i];
- break;
- }
- }
- pathParts.push(inputPathPart);
- }
- pathParts.push(fileName);
- // figure out the directory where this file will be saved
- return path$5.join(manager.outputTarget.appDir, ...pathParts);
- };
- const initializePrerenderEntryUrls = (results, manager) => {
- const entryAnchors = [];
- if (Array.isArray(manager.prerenderConfig.entryUrls)) {
- for (const entryUrl of manager.prerenderConfig.entryUrls) {
- const entryAnchor = {
- href: entryUrl,
- };
- entryAnchors.push(entryAnchor);
- }
- }
- else {
- const entryAnchor = {
- href: manager.outputTarget.baseUrl,
- };
- entryAnchors.push(entryAnchor);
- }
- for (const entryAnchor of entryAnchors) {
- // ensure each entry url is valid
- // and has a domain
- try {
- new URL(entryAnchor.href, manager.outputTarget.baseUrl);
- }
- catch (e) {
- const diagnostic = buildError(results.diagnostics);
- diagnostic.header = `Invalid Prerender Entry Url: ${entryAnchor.href}`;
- diagnostic.messageText = `Entry Urls must include the protocol and domain of the site being prerendered.`;
- return;
- }
- }
- const base = new URL(manager.outputTarget.baseUrl);
- const hrefs = crawlAnchorsForNextUrls(manager.prerenderConfig, results.diagnostics, base, base, entryAnchors);
- for (const href of hrefs) {
- addUrlToPendingQueue(manager, href, '#entryUrl');
- }
- };
- const addUrlToPendingQueue = (manager, queueUrl, fromUrl) => {
- if (!isString$1(queueUrl) || queueUrl === '') {
- return;
- }
- if (manager.urlsPending.has(queueUrl)) {
- return;
- }
- if (manager.urlsProcessing.has(queueUrl)) {
- return;
- }
- if (manager.urlsCompleted.has(queueUrl)) {
- return;
- }
- manager.urlsPending.add(queueUrl);
- if (manager.isDebug) {
- const url = new URL(queueUrl, manager.outputTarget.baseUrl).pathname;
- const from = fromUrl.startsWith('#') ? fromUrl : new URL(fromUrl, manager.outputTarget.baseUrl).pathname;
- manager.config.logger.debug(`prerender queue: ${url} (from ${from})`);
- }
- };
- const drainPrerenderQueue = (results, manager) => {
- const nextUrl = manager.urlsPending.values().next();
- if (!nextUrl.done) {
- if (manager.urlsProcessing.size > manager.maxConcurrency) {
- // slow it down there buddy, too many at one time
- setTimeout(() => drainPrerenderQueue(results, manager));
- }
- else {
- const url = nextUrl.value;
- // looks like we're ready to prerender more
- // remove from pending
- manager.urlsPending.delete(url);
- // move to processing
- manager.urlsProcessing.add(url);
- // kick off async prerendering
- prerenderUrl(results, manager, url);
- if (manager.urlsProcessing.size < manager.maxConcurrency) {
- // could be more ready for prerendering
- // let's check again after a tick
- manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
- }
- }
- }
- if (manager.urlsProcessing.size === 0 && manager.urlsPending.size === 0) {
- if (isFunction(manager.resolve)) {
- // we're not actively processing anything
- // and there aren't anymore urls in the queue to be prerendered
- // so looks like our job here is done, good work team
- manager.resolve();
- manager.resolve = null;
- }
- }
- };
- const prerenderUrl = async (results, manager, url) => {
- let previewUrl = url;
- try {
- previewUrl = new URL(url).pathname;
- let timespan;
- if (manager.isDebug) {
- timespan = manager.config.logger.createTimeSpan(`prerender start: ${previewUrl}`, true);
- }
- const prerenderRequest = {
- appDir: manager.outputTarget.appDir,
- baseUrl: manager.outputTarget.baseUrl,
- buildId: results.buildId,
- componentGraphPath: manager.componentGraphPath,
- devServerHostUrl: manager.devServerHostUrl,
- hydrateAppFilePath: manager.hydrateAppFilePath,
- isDebug: manager.isDebug,
- prerenderConfigPath: manager.prerenderConfigPath,
- staticSite: manager.staticSite,
- templateId: manager.templateId,
- url: url,
- writeToFilePath: getWriteFilePathFromUrlPath(manager, url),
- };
- // prender this path and wait on the results
- const urlResults = await manager.prerenderUrlWorker(prerenderRequest);
- if (manager.isDebug) {
- const filePath = relative$1(manager.config.rootDir, urlResults.filePath);
- const hasError = urlResults.diagnostics.some((d) => d.level === 'error');
- if (hasError) {
- timespan.finish(`prerender failed: ${previewUrl}, ${filePath}`, 'red');
- }
- else {
- timespan.finish(`prerender finish: ${previewUrl}, ${filePath}`);
- }
- }
- manager.diagnostics.push(...urlResults.diagnostics);
- if (Array.isArray(urlResults.anchorUrls)) {
- for (const anchorUrl of urlResults.anchorUrls) {
- addUrlToPendingQueue(manager, anchorUrl, url);
- }
- }
- }
- catch (e) {
- // darn, idk, bad news
- catchError(manager.diagnostics, e);
- }
- manager.urlsProcessing.delete(url);
- manager.urlsCompleted.add(url);
- results.urls++;
- const urlsCompletedSize = manager.urlsCompleted.size;
- if (manager.progressLogger && urlsCompletedSize > 1) {
- manager.progressLogger.update(` prerendered ${urlsCompletedSize} urls: ${manager.config.logger.dim(previewUrl)}`);
- }
- // let's try to drain the queue again and let this
- // next call figure out if we're actually done or not
- manager.config.sys.nextTick(() => drainPrerenderQueue(results, manager));
- };
- const generateSitemapXml = async (manager) => {
- if (manager.prerenderConfig.sitemapXml === null) {
- // if it's set to null then let's not create a sitemap.xml file
- return null;
- }
- try {
- if (typeof manager.prerenderConfig.sitemapXml !== 'function') {
- // not set to null, but also no config.sitemapXml(), so let's make a default
- manager.prerenderConfig.sitemapXml = function sitemapXml(opts) {
- const content = [];
- content.push(`<?xml version="1.0" encoding="UTF-8"?>`);
- content.push(`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`);
- for (const url of opts.urls) {
- content.push(`<url><loc>${url}</loc></url>`);
- }
- content.push(`</urlset>`);
- return content.join('\n');
- };
- }
- const opts = {
- urls: getSitemapUrls(manager),
- baseUrl: manager.outputTarget.baseUrl,
- dir: manager.outputTarget.appDir,
- };
- const userResults = manager.prerenderConfig.sitemapXml(opts);
- if (userResults == null) {
- return null;
- }
- const results = {
- content: null,
- filePath: null,
- url: null,
- };
- if (typeof userResults === 'string') {
- results.content = userResults;
- }
- else {
- results.content = userResults.content;
- results.filePath = userResults.filePath;
- }
- if (typeof results.content !== 'string') {
- return null;
- }
- if (typeof results.filePath !== 'string') {
- results.filePath = join(manager.outputTarget.appDir, `sitemap.xml`);
- }
- if (typeof results.url !== 'string') {
- const sitemapUrl = new URL(`sitemap.xml`, manager.outputTarget.baseUrl);
- results.url = sitemapUrl.href;
- }
- await manager.config.sys.writeFile(results.filePath, results.content);
- return results;
- }
- catch (e) {
- catchError(manager.diagnostics, e);
- return null;
- }
- };
- const getSitemapUrls = (manager) => {
- const urls = [];
- if (typeof manager.prerenderConfig.canonicalUrl === 'function') {
- // user provide a canonicalUrl() function
- // use that to normalize the urls for the sitemap.xml
- // if it returned null then don't add it to the sitemap
- for (const url of manager.urlsCompleted) {
- const canonicalUrl = manager.prerenderConfig.canonicalUrl(new URL(url));
- if (typeof canonicalUrl === 'string' && canonicalUrl.trim() !== '') {
- urls.push(canonicalUrl);
- }
- }
- }
- else {
- for (const url of manager.urlsCompleted) {
- if (typeof url === 'string') {
- urls.push(url);
- }
- }
- }
- return urls.sort(sortUrls);
- };
- const sortUrls = (a, b) => {
- const partsA = a.split('/').length;
- const partsB = b.split('/').length;
- if (partsA < partsB)
- return -1;
- if (partsA > partsB)
- return 1;
- if (a < b)
- return -1;
- if (a > b)
- return 1;
- return 0;
- };
- const generateRobotsTxt = async (manager, sitemapResults) => {
- if (manager.prerenderConfig.robotsTxt === null) {
- // if it's set to null then let's not create a robots.txt file
- return null;
- }
- try {
- if (typeof manager.prerenderConfig.robotsTxt !== 'function') {
- // not set to null, but also no config.robotsTxt(), so let's make a default
- manager.prerenderConfig.robotsTxt = function robotsTxt(opts) {
- const content = [`User-agent: *`, `Disallow:`];
- if (typeof opts.sitemapUrl === 'string') {
- content.push(`Sitemap: ${opts.sitemapUrl}`);
- }
- return content.join('\n');
- };
- }
- const opts = {
- urls: getSitemapUrls(manager),
- baseUrl: manager.outputTarget.baseUrl,
- sitemapUrl: sitemapResults ? sitemapResults.url : null,
- dir: manager.outputTarget.dir,
- };
- const userResults = manager.prerenderConfig.robotsTxt(opts);
- if (userResults == null) {
- return null;
- }
- const results = {
- content: null,
- filePath: null,
- url: null,
- };
- if (typeof userResults === 'string') {
- results.content = userResults;
- }
- else {
- results.content = userResults.content;
- results.filePath = userResults.filePath;
- }
- if (typeof results.content !== 'string') {
- return null;
- }
- const lines = results.content.replace(/\r/g, '\n').split('\n');
- results.content = lines.map((l) => l.trim()).join('\n');
- if (typeof results.filePath !== 'string') {
- results.filePath = join(manager.outputTarget.dir, `robots.txt`);
- }
- if (typeof results.url !== 'string') {
- const robotsTxtUrl = new URL(`/robots.txt`, manager.outputTarget.baseUrl);
- results.url = robotsTxtUrl.href;
- }
- await manager.config.sys.writeFile(results.filePath, results.content);
- return results;
- }
- catch (e) {
- catchError(manager.diagnostics, e);
- return null;
- }
- };
- const generateTemplateHtml = async (config, prerenderConfig, diagnostics, isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager) => {
- try {
- if (!isString$1(srcIndexHtmlPath)) {
- srcIndexHtmlPath = outputTarget.indexHtml;
- }
- let templateHtml;
- if (isFunction(prerenderConfig.loadTemplate)) {
- const loadTemplateResult = prerenderConfig.loadTemplate(srcIndexHtmlPath);
- if (isPromise(loadTemplateResult)) {
- templateHtml = await loadTemplateResult;
- }
- else {
- templateHtml = loadTemplateResult;
- }
- }
- else {
- templateHtml = await config.sys.readFile(srcIndexHtmlPath);
- }
- let doc = createDocument(templateHtml);
- let staticSite = false;
- if (prerenderConfig.staticSite) {
- // purposely do not want any clientside JS
- // go through the document and remove only stencil's scripts
- removeStencilScripts(doc);
- staticSite = true;
- }
- else {
- // config didn't set if it's a staticSite only,
- // but the HTML may not have any stencil scripts at all,
- // so we'll need to know that so we don't add preload modules
- // if there isn't at least one stencil script then it's a static site
- staticSite = !hasStencilScript(doc);
- }
- doc.documentElement.classList.add('hydrated');
- if (hydrateOpts.inlineExternalStyleSheets && !isDebug) {
- try {
- await inlineExternalStyleSheets(config.sys, outputTarget.appDir, doc);
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- if (hydrateOpts.minifyScriptElements && !isDebug) {
- try {
- await minifyScriptElements(doc, true);
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- if (hydrateOpts.minifyStyleElements && !isDebug) {
- try {
- const baseUrl = new URL(outputTarget.baseUrl, manager.devServerHostUrl);
- await minifyStyleElements(config.sys, outputTarget.appDir, doc, baseUrl, true);
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- }
- if (isFunction(prerenderConfig.beforeSerializeTemplate)) {
- const beforeSerializeResults = prerenderConfig.beforeSerializeTemplate(doc);
- if (isPromise(beforeSerializeResults)) {
- doc = await beforeSerializeResults;
- }
- else {
- doc = beforeSerializeResults;
- }
- }
- let html = serializeNodeToHtml(doc);
- if (isFunction(prerenderConfig.afterSerializeTemplate)) {
- const afterSerializeResults = prerenderConfig.afterSerializeTemplate(html);
- if (isPromise(afterSerializeResults)) {
- html = await afterSerializeResults;
- }
- else {
- html = afterSerializeResults;
- }
- }
- return {
- html,
- staticSite,
- };
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- return undefined;
- };
- const createPrerenderer = async (config) => {
- const start = (opts) => {
- return runPrerender(config, opts.hydrateAppFilePath, opts.componentGraph, opts.srcIndexHtmlPath, opts.buildId);
- };
- return {
- start,
- };
- };
- const runPrerender = async (config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, buildId) => {
- const startTime = Date.now();
- const diagnostics = [];
- const results = {
- buildId,
- diagnostics,
- urls: 0,
- duration: 0,
- average: 0,
- };
- const outputTargets = config.outputTargets.filter(isOutputTargetWww).filter((o) => isString$1(o.indexHtml));
- if (!isString$1(results.buildId)) {
- results.buildId = createHydrateBuildId();
- }
- if (outputTargets.length === 0) {
- return results;
- }
- if (!isString$1(hydrateAppFilePath)) {
- const diagnostic = buildError(diagnostics);
- diagnostic.header = `Prerender Error`;
- diagnostic.messageText = `Build results missing "hydrateAppFilePath"`;
- }
- else {
- if (!isAbsolute$1(hydrateAppFilePath)) {
- hydrateAppFilePath = join(config.sys.getCurrentDirectory(), hydrateAppFilePath);
- }
- const hydrateAppExists = await config.sys.access(hydrateAppFilePath);
- if (!hydrateAppExists) {
- const diagnostic = buildError(diagnostics);
- diagnostic.header = `Prerender Error`;
- diagnostic.messageText = `Unable to open "hydrateAppFilePath": ${hydrateAppFilePath}`;
- }
- }
- if (!hasError(diagnostics)) {
- let workerCtx;
- let workerCtrl;
- if (config.sys.createWorkerController == null || config.maxConcurrentWorkers < 1) {
- workerCtx = createWorkerContext(config.sys);
- }
- else {
- workerCtrl = config.sys.createWorkerController(config.maxConcurrentWorkers);
- workerCtx = createWorkerMainContext(workerCtrl);
- }
- const devServerConfig = { ...config.devServer };
- devServerConfig.openBrowser = false;
- devServerConfig.gzip = false;
- devServerConfig.logRequests = false;
- devServerConfig.reloadStrategy = null;
- const devServerPath = config.sys.getDevServerExecutingPath();
- const { start } = await config.sys.dynamicImport(devServerPath);
- const devServer = await start(devServerConfig, config.logger);
- try {
- await Promise.all(outputTargets.map((outputTarget) => {
- return runPrerenderOutputTarget(workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget);
- }));
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- if (workerCtrl) {
- workerCtrl.destroy();
- }
- if (devServer) {
- await devServer.close();
- }
- }
- results.duration = Date.now() - startTime;
- if (results.urls > 0) {
- results.average = results.duration / results.urls;
- }
- return results;
- };
- const runPrerenderOutputTarget = async (workerCtx, results, diagnostics, config, devServer, hydrateAppFilePath, componentGraph, srcIndexHtmlPath, outputTarget) => {
- try {
- const timeSpan = config.logger.createTimeSpan(`prerendering started`);
- const devServerBaseUrl = new URL(devServer.browserUrl);
- const devServerHostUrl = devServerBaseUrl.origin;
- const prerenderConfig = getPrerenderConfig(diagnostics, outputTarget.prerenderConfig);
- const hydrateOpts = getHydrateOptions(prerenderConfig, devServerBaseUrl, diagnostics);
- config.logger.debug(`prerender hydrate app: ${hydrateAppFilePath}`);
- config.logger.debug(`prerender dev server: ${devServerHostUrl}`);
- if (hasError(diagnostics)) {
- return;
- }
- // get the prerender urls to queue up
- const prerenderDiagnostics = [];
- const manager = {
- prerenderUrlWorker: (prerenderRequest) => workerCtx.prerenderWorker(prerenderRequest),
- componentGraphPath: null,
- config: config,
- diagnostics: prerenderDiagnostics,
- devServerHostUrl: devServerHostUrl,
- hydrateAppFilePath: hydrateAppFilePath,
- isDebug: config.logLevel === 'debug',
- logCount: 0,
- maxConcurrency: Math.max(20, config.maxConcurrentWorkers * 10),
- outputTarget: outputTarget,
- prerenderConfig: prerenderConfig,
- prerenderConfigPath: outputTarget.prerenderConfig,
- staticSite: false,
- templateId: null,
- urlsCompleted: new Set(),
- urlsPending: new Set(),
- urlsProcessing: new Set(),
- resolve: null,
- };
- if (!config.flags.ci && !manager.isDebug) {
- manager.progressLogger = await config.logger.createLineUpdater();
- }
- initializePrerenderEntryUrls(results, manager);
- if (manager.urlsPending.size === 0) {
- const err = buildError(diagnostics);
- err.messageText = `prerendering failed: no urls found in the prerender config`;
- return;
- }
- const templateData = await generateTemplateHtml(config, prerenderConfig, diagnostics, manager.isDebug, srcIndexHtmlPath, outputTarget, hydrateOpts, manager);
- if (diagnostics.length > 0 || !templateData || !isString$1(templateData.html)) {
- return;
- }
- manager.templateId = await createPrerenderTemplate(config, templateData.html);
- manager.staticSite = templateData.staticSite;
- manager.componentGraphPath = await createComponentGraphPath(config, componentGraph, outputTarget);
- await new Promise((resolve) => {
- manager.resolve = resolve;
- config.sys.nextTick(() => drainPrerenderQueue(results, manager));
- });
- if (manager.isDebug) {
- const debugDiagnostics = prerenderDiagnostics.filter((d) => d.level === 'debug');
- if (debugDiagnostics.length > 0) {
- config.logger.printDiagnostics(debugDiagnostics);
- }
- }
- const duration = timeSpan.duration();
- const sitemapResults = await generateSitemapXml(manager);
- await generateRobotsTxt(manager, sitemapResults);
- const prerenderBuildErrors = prerenderDiagnostics.filter((d) => d.level === 'error');
- const prerenderRuntimeErrors = prerenderDiagnostics.filter((d) => d.type === 'runtime');
- if (prerenderBuildErrors.length > 0) {
- // convert to just runtime errors so the other build files still write
- // but the CLI knows an error occurred and should have an exit code 1
- for (const diagnostic of prerenderBuildErrors) {
- diagnostic.type = 'runtime';
- }
- diagnostics.push(...prerenderBuildErrors);
- }
- diagnostics.push(...prerenderRuntimeErrors);
- // Clear progress logger
- if (manager.progressLogger) {
- await manager.progressLogger.stop();
- }
- const totalUrls = manager.urlsCompleted.size;
- if (totalUrls > 1) {
- const average = Math.round(duration / totalUrls);
- config.logger.info(`prerendered ${totalUrls} urls, averaging ${average} ms per url`);
- }
- const statusMessage = prerenderBuildErrors.length > 0 ? 'failed' : 'finished';
- const statusColor = prerenderBuildErrors.length > 0 ? 'red' : 'green';
- timeSpan.finish(`prerendering ${statusMessage}`, statusColor, true);
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- };
- const createPrerenderTemplate = async (config, templateHtml) => {
- const hash = await config.sys.generateContentHash(templateHtml, 12);
- const templateFileName = `prerender-${hash}.html`;
- const templateId = join(config.sys.tmpDirSync(), templateFileName);
- config.logger.debug(`prerender template: ${templateId}`);
- config.sys.writeFileSync(templateId, templateHtml);
- return templateId;
- };
- const createComponentGraphPath = async (config, componentGraph, outputTarget) => {
- if (componentGraph) {
- const content = getComponentPathContent(componentGraph, outputTarget);
- const hash = await config.sys.generateContentHash(content);
- const fileName = `prerender-component-graph-${hash}.json`;
- const componentGraphPath = join(config.sys.tmpDirSync(), fileName);
- config.sys.writeFileSync(componentGraphPath, content);
- return componentGraphPath;
- }
- return null;
- };
- const getComponentPathContent = (componentGraph, outputTarget) => {
- const buildDir = getAbsoluteBuildDir(outputTarget);
- const object = {};
- const entries = Object.entries(componentGraph);
- for (const [key, chunks] of entries) {
- object[key] = chunks.map((filename) => join(buildDir, filename));
- }
- return JSON.stringify(object);
- };
- const dependencies = [
- {
- name: "@stencil/core",
- version: "2.15.1",
- main: "compiler/stencil.js",
- resources: [
- "package.json",
- "compiler/lib.d.ts",
- "compiler/lib.dom.d.ts",
- "compiler/lib.dom.iterable.d.ts",
- "compiler/lib.es2015.collection.d.ts",
- "compiler/lib.es2015.core.d.ts",
- "compiler/lib.es2015.d.ts",
- "compiler/lib.es2015.generator.d.ts",
- "compiler/lib.es2015.iterable.d.ts",
- "compiler/lib.es2015.promise.d.ts",
- "compiler/lib.es2015.proxy.d.ts",
- "compiler/lib.es2015.reflect.d.ts",
- "compiler/lib.es2015.symbol.d.ts",
- "compiler/lib.es2015.symbol.wellknown.d.ts",
- "compiler/lib.es2016.array.include.d.ts",
- "compiler/lib.es2016.d.ts",
- "compiler/lib.es2016.full.d.ts",
- "compiler/lib.es2017.d.ts",
- "compiler/lib.es2017.full.d.ts",
- "compiler/lib.es2017.intl.d.ts",
- "compiler/lib.es2017.object.d.ts",
- "compiler/lib.es2017.sharedmemory.d.ts",
- "compiler/lib.es2017.string.d.ts",
- "compiler/lib.es2017.typedarrays.d.ts",
- "compiler/lib.es2018.asyncgenerator.d.ts",
- "compiler/lib.es2018.asynciterable.d.ts",
- "compiler/lib.es2018.d.ts",
- "compiler/lib.es2018.full.d.ts",
- "compiler/lib.es2018.intl.d.ts",
- "compiler/lib.es2018.promise.d.ts",
- "compiler/lib.es2018.regexp.d.ts",
- "compiler/lib.es2019.array.d.ts",
- "compiler/lib.es2019.d.ts",
- "compiler/lib.es2019.full.d.ts",
- "compiler/lib.es2019.object.d.ts",
- "compiler/lib.es2019.string.d.ts",
- "compiler/lib.es2019.symbol.d.ts",
- "compiler/lib.es2020.bigint.d.ts",
- "compiler/lib.es2020.d.ts",
- "compiler/lib.es2020.full.d.ts",
- "compiler/lib.es2020.intl.d.ts",
- "compiler/lib.es2020.promise.d.ts",
- "compiler/lib.es2020.sharedmemory.d.ts",
- "compiler/lib.es2020.string.d.ts",
- "compiler/lib.es2020.symbol.wellknown.d.ts",
- "compiler/lib.es2021.d.ts",
- "compiler/lib.es2021.full.d.ts",
- "compiler/lib.es2021.intl.d.ts",
- "compiler/lib.es2021.promise.d.ts",
- "compiler/lib.es2021.string.d.ts",
- "compiler/lib.es2021.weakref.d.ts",
- "compiler/lib.es5.d.ts",
- "compiler/lib.es6.d.ts",
- "compiler/lib.esnext.d.ts",
- "compiler/lib.esnext.full.d.ts",
- "compiler/lib.esnext.intl.d.ts",
- "compiler/lib.esnext.promise.d.ts",
- "compiler/lib.esnext.string.d.ts",
- "compiler/lib.esnext.weakref.d.ts",
- "compiler/lib.scripthost.d.ts",
- "compiler/lib.webworker.d.ts",
- "compiler/lib.webworker.importscripts.d.ts",
- "compiler/lib.webworker.iterable.d.ts",
- "internal/index.d.ts",
- "internal/index.js",
- "internal/package.json",
- "internal/stencil-ext-modules.d.ts",
- "internal/stencil-private.d.ts",
- "internal/stencil-public-compiler.d.ts",
- "internal/stencil-public-docs.d.ts",
- "internal/stencil-public-runtime.d.ts",
- "mock-doc/index.js",
- "mock-doc/package.json",
- "internal/client/css-shim.js",
- "internal/client/dom.js",
- "internal/client/index.js",
- "internal/client/package.json",
- "internal/client/patch-browser.js",
- "internal/client/patch-esm.js",
- "internal/client/shadow-css.js",
- "internal/hydrate/index.js",
- "internal/hydrate/package.json",
- "internal/hydrate/runner.js",
- "internal/hydrate/shadow-css.js",
- "internal/stencil-core/index.d.ts",
- "internal/stencil-core/index.js"
- ]
- },
- {
- name: "rollup",
- version: "2.42.3",
- main: "dist/es/rollup.browser.js"
- },
- {
- name: "terser",
- version: "5.6.1",
- main: "dist/bundle.min.js"
- },
- {
- name: "typescript",
- version: "4.5.4",
- main: "lib/typescript.js"
- }
- ];
- const getAbsolutePath = (config, dir) => {
- if (!isAbsolute$1(dir)) {
- dir = join(config.rootDir, dir);
- }
- return dir;
- };
- const setBooleanConfig = (config, configName, flagName, defaultValue) => {
- if (flagName) {
- if (typeof config.flags[flagName] === 'boolean') {
- config[configName] = config.flags[flagName];
- }
- }
- const userConfigName = getUserConfigName(config, configName);
- if (typeof config[userConfigName] === 'function') {
- config[userConfigName] = !!config[userConfigName]();
- }
- if (typeof config[userConfigName] === 'boolean') {
- config[configName] = config[userConfigName];
- }
- else {
- config[configName] = defaultValue;
- }
- };
- const getUserConfigName = (config, correctConfigName) => {
- const userConfigNames = Object.keys(config);
- for (const userConfigName of userConfigNames) {
- if (userConfigName.toLowerCase() === correctConfigName.toLowerCase()) {
- if (userConfigName !== correctConfigName) {
- config.logger.warn(`config "${userConfigName}" should be "${correctConfigName}"`);
- return userConfigName;
- }
- break;
- }
- }
- return correctConfigName;
- };
- const validateDevServer = (config, diagnostics) => {
- var _a;
- if ((config.devServer === null || config.devServer) === false) {
- return null;
- }
- const flags = config.flags;
- const devServer = { ...config.devServer };
- if (isString$1(flags.address)) {
- devServer.address = flags.address;
- }
- else if (!isString$1(devServer.address)) {
- devServer.address = '0.0.0.0';
- }
- let addressProtocol;
- if (devServer.address.toLowerCase().startsWith('http://')) {
- devServer.address = devServer.address.substring(7);
- addressProtocol = 'http';
- }
- else if (devServer.address.toLowerCase().startsWith('https://')) {
- devServer.address = devServer.address.substring(8);
- addressProtocol = 'https';
- }
- devServer.address = devServer.address.split('/')[0];
- let addressPort;
- const addressSplit = devServer.address.split(':');
- if (addressSplit.length > 1) {
- if (!isNaN(addressSplit[1])) {
- devServer.address = addressSplit[0];
- addressPort = parseInt(addressSplit[1], 10);
- }
- }
- if (isNumber$1(flags.port)) {
- devServer.port = flags.port;
- }
- else if (devServer.port !== null && !isNumber$1(devServer.port)) {
- if (isNumber$1(addressPort)) {
- devServer.port = addressPort;
- }
- else if (devServer.address === 'localhost' || !isNaN(devServer.address.split('.')[0])) {
- devServer.port = 3333;
- }
- else {
- devServer.port = null;
- }
- }
- if (devServer.reloadStrategy === undefined) {
- devServer.reloadStrategy = 'hmr';
- }
- else if (devServer.reloadStrategy !== 'hmr' &&
- devServer.reloadStrategy !== 'pageReload' &&
- devServer.reloadStrategy !== null) {
- const err = buildError(diagnostics);
- err.messageText = `Invalid devServer reloadStrategy "${devServer.reloadStrategy}". Valid configs include "hmr", "pageReload" and null.`;
- }
- if (!isBoolean$1(devServer.gzip)) {
- devServer.gzip = true;
- }
- if (!isBoolean$1(devServer.openBrowser)) {
- devServer.openBrowser = true;
- }
- if (!isBoolean$1(devServer.websocket)) {
- devServer.websocket = true;
- }
- if ((_a = config === null || config === void 0 ? void 0 : config.flags) === null || _a === void 0 ? void 0 : _a.ssr) {
- devServer.ssr = true;
- }
- else {
- devServer.ssr = !!devServer.ssr;
- }
- if (devServer.ssr) {
- const wwwOutput = config.outputTargets.find(isOutputTargetWww);
- devServer.prerenderConfig = wwwOutput === null || wwwOutput === void 0 ? void 0 : wwwOutput.prerenderConfig;
- }
- if (isString$1(config.srcIndexHtml)) {
- devServer.srcIndexHtml = normalizePath$1(config.srcIndexHtml);
- }
- if (devServer.protocol !== 'http' && devServer.protocol !== 'https') {
- devServer.protocol = devServer.https ? 'https' : addressProtocol ? addressProtocol : 'http';
- }
- if (devServer.historyApiFallback !== null && devServer.historyApiFallback !== false) {
- devServer.historyApiFallback = devServer.historyApiFallback || {};
- if (!isString$1(devServer.historyApiFallback.index)) {
- devServer.historyApiFallback.index = 'index.html';
- }
- if (!isBoolean$1(devServer.historyApiFallback.disableDotRule)) {
- devServer.historyApiFallback.disableDotRule = false;
- }
- }
- if (flags.open === false) {
- devServer.openBrowser = false;
- }
- else if (flags.prerender && !config.watch) {
- devServer.openBrowser = false;
- }
- let serveDir = null;
- let basePath = null;
- const wwwOutputTarget = config.outputTargets.find(isOutputTargetWww);
- if (wwwOutputTarget) {
- const baseUrl = new URL(wwwOutputTarget.baseUrl, 'http://config.stenciljs.com');
- basePath = baseUrl.pathname;
- serveDir = wwwOutputTarget.appDir;
- }
- else {
- serveDir = config.rootDir;
- }
- if (!isString$1(basePath) || basePath.trim() === '') {
- basePath = `/`;
- }
- basePath = normalizePath$1(basePath);
- if (!basePath.startsWith('/')) {
- basePath = '/' + basePath;
- }
- if (!basePath.endsWith('/')) {
- basePath += '/';
- }
- if (!isBoolean$1(devServer.logRequests)) {
- devServer.logRequests = config.logLevel === 'debug';
- }
- if (!isString$1(devServer.root)) {
- devServer.root = serveDir;
- }
- if (!isString$1(devServer.basePath)) {
- devServer.basePath = basePath;
- }
- if (isString$1(devServer.baseUrl)) {
- const err = buildError(diagnostics);
- err.messageText = `devServer config "baseUrl" has been renamed to "basePath", and should not include a domain or protocol.`;
- }
- if (!isAbsolute$1(devServer.root)) {
- devServer.root = join(config.rootDir, devServer.root);
- }
- devServer.root = normalizePath$1(devServer.root);
- if (devServer.excludeHmr) {
- if (!Array.isArray(devServer.excludeHmr)) {
- const err = buildError(diagnostics);
- err.messageText = `dev server excludeHmr must be an array of glob strings`;
- }
- }
- else {
- devServer.excludeHmr = [];
- }
- if (!config.devMode || config.buildEs5) {
- devServer.experimentalDevModules = false;
- }
- else {
- devServer.experimentalDevModules = !!devServer.experimentalDevModules;
- }
- return devServer;
- };
- const validateNamespace = (c, diagnostics) => {
- c.namespace = isString$1(c.namespace) ? c.namespace : DEFAULT_NAMESPACE;
- c.namespace = c.namespace.trim();
- const invalidNamespaceChars = c.namespace.replace(/(\w)|(\-)|(\$)/g, '');
- if (invalidNamespaceChars !== '') {
- const err = buildError(diagnostics);
- err.messageText = `Namespace "${c.namespace}" contains invalid characters: ${invalidNamespaceChars}`;
- }
- if (c.namespace.length < 3) {
- const err = buildError(diagnostics);
- err.messageText = `Namespace "${c.namespace}" must be at least 3 characters`;
- }
- if (/^\d+$/.test(c.namespace.charAt(0))) {
- const err = buildError(diagnostics);
- err.messageText = `Namespace "${c.namespace}" cannot have a number for the first character`;
- }
- if (c.namespace.charAt(0) === '-') {
- const err = buildError(diagnostics);
- err.messageText = `Namespace "${c.namespace}" cannot have a dash for the first character`;
- }
- if (c.namespace.charAt(c.namespace.length - 1) === '-') {
- const err = buildError(diagnostics);
- err.messageText = `Namespace "${c.namespace}" cannot have a dash for the last character`;
- }
- // the file system namespace is the one
- // used in filenames and seen in the url
- if (!isString$1(c.fsNamespace)) {
- c.fsNamespace = c.namespace.toLowerCase().trim();
- }
- if (c.namespace.includes('-')) {
- // convert to PascalCase
- c.namespace = dashToPascalCase$1(c.namespace);
- }
- };
- const validateDistNamespace = (config, diagnostics) => {
- const hasDist = config.outputTargets.some(isOutputTargetDist);
- if (hasDist) {
- if (!isString$1(config.namespace) || config.namespace.toLowerCase() === 'app') {
- const err = buildError(diagnostics);
- err.messageText = `When generating a distribution it is recommended to choose a unique namespace rather than the default setting "App". Please updated the "namespace" config property within the stencil config.`;
- }
- }
- };
- const DEFAULT_NAMESPACE = 'App';
- const validateHydrated = (config) => {
- if (config.hydratedFlag === null || config.hydratedFlag === false) {
- return null;
- }
- const hydratedFlag = { ...config.hydratedFlag };
- if (!isString$1(hydratedFlag.name) || hydratedFlag.property === '') {
- hydratedFlag.name = `hydrated`;
- }
- if (hydratedFlag.selector === 'attribute') {
- hydratedFlag.selector = `attribute`;
- }
- else {
- hydratedFlag.selector = `class`;
- }
- if (!isString$1(hydratedFlag.property) || hydratedFlag.property === '') {
- hydratedFlag.property = `visibility`;
- }
- if (!isString$1(hydratedFlag.initialValue) && hydratedFlag.initialValue !== null) {
- hydratedFlag.initialValue = `hidden`;
- }
- if (!isString$1(hydratedFlag.hydratedValue) && hydratedFlag.initialValue !== null) {
- hydratedFlag.hydratedValue = `inherit`;
- }
- return hydratedFlag;
- };
- const validateCollection = (config, userOutputs) => {
- return userOutputs.filter(isOutputTargetDistCollection).map((o) => {
- return {
- ...o,
- dir: getAbsolutePath(config, o.dir || 'dist/collection'),
- };
- });
- };
- const validateCopy = (copy, defaultCopy = []) => {
- if (copy === null || copy === false) {
- return [];
- }
- if (!Array.isArray(copy)) {
- copy = [];
- }
- copy = copy.slice();
- for (const task of defaultCopy) {
- if (copy.every((t) => t.src !== task.src)) {
- copy.push(task);
- }
- }
- return unique(copy, (task) => `${task.src}:${task.dest}:${task.keepDirStructure}`);
- };
- /**
- * Validate one or more `dist-custom-elements` output targets. Validation of an output target may involve back-filling
- * fields that are omitted with sensible defaults and/or creating additional supporting output targets that were not
- * explicitly defined by the user
- * @param config the Stencil configuration associated with the project being compiled
- * @param userOutputs the output target(s) specified by the user
- * @returns the validated output target(s)
- */
- const validateCustomElement = (config, userOutputs) => {
- const defaultDir = 'dist';
- return userOutputs.filter(isOutputTargetDistCustomElements).reduce((outputs, o) => {
- const outputTarget = {
- ...o,
- dir: getAbsolutePath(config, o.dir || join(defaultDir, 'components')),
- };
- if (!isBoolean$1(outputTarget.empty)) {
- outputTarget.empty = true;
- }
- if (!isBoolean$1(outputTarget.externalRuntime)) {
- outputTarget.externalRuntime = true;
- }
- // unlike other output targets, Stencil does not allow users to define the output location of types at this time
- if (outputTarget.generateTypeDeclarations) {
- const typesDirectory = getAbsolutePath(config, join(defaultDir, 'types'));
- outputs.push({
- type: DIST_TYPES,
- dir: outputTarget.dir,
- typesDir: typesDirectory,
- });
- }
- outputTarget.copy = validateCopy(outputTarget.copy, []);
- if (outputTarget.copy.length > 0) {
- outputs.push({
- type: COPY,
- dir: config.rootDir,
- copy: [...outputTarget.copy],
- });
- }
- outputs.push(outputTarget);
- return outputs;
- }, []);
- };
- const validateCustomOutput = (config, diagnostics, userOutputs) => {
- return userOutputs.filter(isOutputTargetCustom).map((o) => {
- if (o.validate) {
- const localDiagnostics = [];
- try {
- o.validate(config, diagnostics);
- }
- catch (e) {
- catchError(localDiagnostics, e);
- }
- if (o.copy && o.copy.length > 0) {
- config.outputTargets.push({
- type: COPY,
- dir: config.rootDir,
- copy: [...o.copy],
- });
- }
- diagnostics.push(...localDiagnostics);
- }
- return o;
- });
- };
- const validateDist = (config, userOutputs) => {
- const distOutputTargets = userOutputs.filter(isOutputTargetDist);
- return distOutputTargets.reduce((outputs, o) => {
- const distOutputTarget = validateOutputTargetDist(config, o);
- outputs.push(distOutputTarget);
- const namespace = config.fsNamespace || 'app';
- const lazyDir = join(distOutputTarget.buildDir, namespace);
- // Lazy build for CDN in dist
- outputs.push({
- type: DIST_LAZY,
- esmDir: lazyDir,
- systemDir: config.buildEs5 ? lazyDir : undefined,
- systemLoaderFile: config.buildEs5 ? join(lazyDir, namespace + '.js') : undefined,
- legacyLoaderFile: join(distOutputTarget.buildDir, namespace + '.js'),
- polyfills: distOutputTarget.polyfills !== undefined ? !!distOutputTarget.polyfills : true,
- isBrowserBuild: true,
- empty: distOutputTarget.empty,
- });
- outputs.push({
- type: COPY,
- dir: lazyDir,
- copyAssets: 'dist',
- copy: [...distOutputTarget.copy],
- });
- outputs.push({
- type: DIST_GLOBAL_STYLES,
- file: join(lazyDir, `${config.fsNamespace}.css`),
- });
- outputs.push({
- type: DIST_TYPES,
- dir: distOutputTarget.dir,
- typesDir: distOutputTarget.typesDir,
- empty: distOutputTarget.empty,
- });
- if (config.buildDist) {
- if (distOutputTarget.collectionDir) {
- outputs.push({
- type: DIST_COLLECTION,
- dir: distOutputTarget.dir,
- collectionDir: distOutputTarget.collectionDir,
- empty: distOutputTarget.empty,
- });
- outputs.push({
- type: COPY,
- dir: distOutputTarget.collectionDir,
- copyAssets: 'collection',
- copy: [...distOutputTarget.copy, { src: '**/*.svg' }, { src: '**/*.js' }],
- });
- }
- const esmDir = join(distOutputTarget.dir, 'esm');
- const esmEs5Dir = config.buildEs5 ? join(distOutputTarget.dir, 'esm-es5') : undefined;
- const cjsDir = join(distOutputTarget.dir, 'cjs');
- // Create lazy output-target
- outputs.push({
- type: DIST_LAZY,
- esmDir,
- esmEs5Dir,
- cjsDir,
- cjsIndexFile: join(distOutputTarget.dir, 'index.cjs.js'),
- esmIndexFile: join(distOutputTarget.dir, 'index.js'),
- polyfills: true,
- empty: distOutputTarget.empty,
- });
- // Create output target that will generate the /loader entry-point
- outputs.push({
- type: DIST_LAZY_LOADER,
- dir: distOutputTarget.esmLoaderPath,
- esmDir,
- esmEs5Dir,
- cjsDir,
- componentDts: getComponentsDtsTypesFilePath(distOutputTarget),
- empty: distOutputTarget.empty,
- });
- }
- return outputs;
- }, []);
- };
- const validateOutputTargetDist = (config, o) => {
- const outputTarget = {
- ...o,
- dir: getAbsolutePath(config, o.dir || DEFAULT_DIR),
- };
- if (!isString$1(outputTarget.buildDir)) {
- outputTarget.buildDir = DEFAULT_BUILD_DIR;
- }
- if (!isAbsolute$1(outputTarget.buildDir)) {
- outputTarget.buildDir = join(outputTarget.dir, outputTarget.buildDir);
- }
- if (outputTarget.collectionDir === undefined) {
- outputTarget.collectionDir = DEFAULT_COLLECTION_DIR;
- }
- if (outputTarget.collectionDir && !isAbsolute$1(outputTarget.collectionDir)) {
- outputTarget.collectionDir = join(outputTarget.dir, outputTarget.collectionDir);
- }
- if (!outputTarget.esmLoaderPath) {
- outputTarget.esmLoaderPath = DEFAULT_ESM_LOADER_DIR;
- }
- if (!isAbsolute$1(outputTarget.esmLoaderPath)) {
- outputTarget.esmLoaderPath = resolve$1(outputTarget.dir, outputTarget.esmLoaderPath);
- }
- if (!outputTarget.typesDir) {
- outputTarget.typesDir = DEFAULT_TYPES_DIR;
- }
- if (!isAbsolute$1(outputTarget.typesDir)) {
- outputTarget.typesDir = join(outputTarget.dir, outputTarget.typesDir);
- }
- if (!isBoolean$1(outputTarget.empty)) {
- outputTarget.empty = true;
- }
- outputTarget.copy = validateCopy(outputTarget.copy, []);
- return outputTarget;
- };
- const DEFAULT_DIR = 'dist';
- const DEFAULT_BUILD_DIR = '';
- const DEFAULT_COLLECTION_DIR = 'collection';
- const DEFAULT_TYPES_DIR = 'types';
- const DEFAULT_ESM_LOADER_DIR = 'loader';
- const validateDocs = (config, diagnostics, userOutputs) => {
- const docsOutputs = [];
- // json docs flag
- if (isString$1(config.flags.docsJson)) {
- docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, {
- type: 'docs-json',
- file: config.flags.docsJson,
- }));
- }
- // json docs
- const jsonDocsOutputs = userOutputs.filter(isOutputTargetDocsJson);
- jsonDocsOutputs.forEach((jsonDocsOutput) => {
- docsOutputs.push(validateJsonDocsOutputTarget(config, diagnostics, jsonDocsOutput));
- });
- // readme docs flag
- if (config.flags.docs || config.flags.task === 'docs') {
- if (!userOutputs.some(isOutputTargetDocsReadme)) {
- // didn't provide a docs config, so let's add one
- docsOutputs.push(validateReadmeOutputTarget(config, { type: 'docs-readme' }));
- }
- }
- // readme docs
- const readmeDocsOutputs = userOutputs.filter(isOutputTargetDocsReadme);
- readmeDocsOutputs.forEach((readmeDocsOutput) => {
- docsOutputs.push(validateReadmeOutputTarget(config, readmeDocsOutput));
- });
- // custom docs
- const customDocsOutputs = userOutputs.filter(isOutputTargetDocsCustom);
- customDocsOutputs.forEach((jsonDocsOutput) => {
- docsOutputs.push(validateCustomDocsOutputTarget(diagnostics, jsonDocsOutput));
- });
- // vscode docs
- const vscodeDocsOutputs = userOutputs.filter(isOutputTargetDocsVscode);
- vscodeDocsOutputs.forEach((vscodeDocsOutput) => {
- docsOutputs.push(validateVScodeDocsOutputTarget(diagnostics, vscodeDocsOutput));
- });
- return docsOutputs;
- };
- const validateReadmeOutputTarget = (config, outputTarget) => {
- if (!isString$1(outputTarget.dir)) {
- outputTarget.dir = config.srcDir;
- }
- if (!isAbsolute$1(outputTarget.dir)) {
- outputTarget.dir = join(config.rootDir, outputTarget.dir);
- }
- if (outputTarget.footer == null) {
- outputTarget.footer = NOTE;
- }
- outputTarget.strict = !!outputTarget.strict;
- return outputTarget;
- };
- const validateJsonDocsOutputTarget = (config, diagnostics, outputTarget) => {
- if (!isString$1(outputTarget.file)) {
- const err = buildError(diagnostics);
- err.messageText = `docs-json outputTarget missing the "file" option`;
- }
- outputTarget.file = join(config.rootDir, outputTarget.file);
- if (isString$1(outputTarget.typesFile)) {
- outputTarget.typesFile = join(config.rootDir, outputTarget.typesFile);
- }
- else if (outputTarget.typesFile !== null && outputTarget.file.endsWith('.json')) {
- outputTarget.typesFile = outputTarget.file.replace(/\.json$/, '.d.ts');
- }
- outputTarget.strict = !!outputTarget.strict;
- return outputTarget;
- };
- const validateCustomDocsOutputTarget = (diagnostics, outputTarget) => {
- if (!isFunction(outputTarget.generator)) {
- const err = buildError(diagnostics);
- err.messageText = `docs-custom outputTarget missing the "generator" function`;
- }
- outputTarget.strict = !!outputTarget.strict;
- return outputTarget;
- };
- const validateVScodeDocsOutputTarget = (diagnostics, outputTarget) => {
- if (!isString$1(outputTarget.file)) {
- const err = buildError(diagnostics);
- err.messageText = `docs-vscode outputTarget missing the "file" path`;
- }
- return outputTarget;
- };
- const validateAngular = (userConfig, userOutputs) => {
- const angularOutputTargets = userOutputs.filter(isOutputTargetAngular);
- return angularOutputTargets.map((outputTarget) => {
- let directivesProxyFile = outputTarget.directivesProxyFile;
- if (directivesProxyFile && !isAbsolute$1(directivesProxyFile)) {
- directivesProxyFile = join(userConfig.rootDir, directivesProxyFile);
- }
- let directivesArrayFile = outputTarget.directivesArrayFile;
- if (directivesArrayFile && !isAbsolute$1(directivesArrayFile)) {
- directivesArrayFile = join(userConfig.rootDir, directivesArrayFile);
- }
- let directivesUtilsFile = outputTarget.directivesUtilsFile;
- if (directivesUtilsFile && !isAbsolute$1(directivesUtilsFile)) {
- directivesUtilsFile = join(userConfig.rootDir, directivesUtilsFile);
- }
- return {
- type: 'angular',
- componentCorePackage: outputTarget.componentCorePackage,
- directivesProxyFile,
- directivesArrayFile,
- directivesUtilsFile,
- excludeComponents: outputTarget.excludeComponents || [],
- };
- });
- };
- const validateHydrateScript = (config, userOutputs) => {
- const output = [];
- const hasHydrateOutputTarget = userOutputs.some(isOutputTargetHydrate);
- if (!hasHydrateOutputTarget) {
- // we don't already have a hydrate output target
- // let's still see if we require one because of other output targets
- const hasWwwOutput = userOutputs.filter(isOutputTargetWww).some((o) => isString$1(o.indexHtml));
- const shouldBuildHydrate = (config === null || config === void 0 ? void 0 : config.flags.prerender) || (config === null || config === void 0 ? void 0 : config.flags.ssr);
- if (hasWwwOutput && shouldBuildHydrate) {
- // we're prerendering a www output target, so we'll need a hydrate app
- let hydrateDir;
- const distOutput = userOutputs.find(isOutputTargetDist);
- if (distOutput != null && isString$1(distOutput.dir)) {
- hydrateDir = join(distOutput.dir, 'hydrate');
- }
- else {
- hydrateDir = 'dist/hydrate';
- }
- const hydrateForWwwOutputTarget = {
- type: DIST_HYDRATE_SCRIPT,
- dir: hydrateDir,
- };
- userOutputs.push(hydrateForWwwOutputTarget);
- }
- }
- const hydrateOutputTargets = userOutputs.filter(isOutputTargetHydrate);
- hydrateOutputTargets.forEach((outputTarget) => {
- if (!isString$1(outputTarget.dir)) {
- // no directory given, see if we've got a dist to go off of
- outputTarget.dir = 'hydrate';
- }
- if (!isAbsolute$1(outputTarget.dir)) {
- outputTarget.dir = join(config.rootDir, outputTarget.dir);
- }
- if (!isBoolean$1(outputTarget.empty)) {
- outputTarget.empty = true;
- }
- outputTarget.external = outputTarget.external || [];
- outputTarget.external.push(...NODE_BUILTINS);
- output.push(outputTarget);
- });
- return output;
- };
- const validateLazy = (config, userOutputs) => {
- return userOutputs.filter(isOutputTargetDistLazy).map((o) => {
- const dir = getAbsolutePath(config, o.dir || join('dist', config.fsNamespace));
- const lazyOutput = {
- type: DIST_LAZY,
- esmDir: dir,
- systemDir: config.buildEs5 ? dir : undefined,
- systemLoaderFile: config.buildEs5 ? join(dir, `${config.fsNamespace}.js`) : undefined,
- polyfills: !!o.polyfills,
- isBrowserBuild: true,
- empty: isBoolean$1(o.empty) ? o.empty : true,
- };
- return lazyOutput;
- });
- };
- const validateStats = (userConfig, userOutputs) => {
- const outputTargets = [];
- if (userConfig.flags.stats) {
- const hasOutputTarget = userOutputs.some(isOutputTargetStats);
- if (!hasOutputTarget) {
- outputTargets.push({
- type: STATS,
- });
- }
- }
- outputTargets.push(...userOutputs.filter(isOutputTargetStats));
- outputTargets.forEach((outputTarget) => {
- if (!outputTarget.file) {
- outputTarget.file = 'stencil-stats.json';
- }
- if (!isAbsolute$1(outputTarget.file)) {
- outputTarget.file = join(userConfig.rootDir, outputTarget.file);
- }
- });
- return outputTargets;
- };
- const validatePrerender = (config, diagnostics, outputTarget) => {
- if (!config.flags || (!config.flags.ssr && !config.flags.prerender && config.flags.task !== 'prerender')) {
- return;
- }
- outputTarget.baseUrl = normalizePath$1(outputTarget.baseUrl);
- if (!outputTarget.baseUrl.startsWith('http://') && !outputTarget.baseUrl.startsWith('https://')) {
- const err = buildError(diagnostics);
- err.messageText = `When prerendering, the "baseUrl" output target config must be a full URL and start with either "http://" or "https://". The config can be updated in the "www" output target within the stencil config.`;
- }
- try {
- new URL(outputTarget.baseUrl);
- }
- catch (e) {
- const err = buildError(diagnostics);
- err.messageText = `invalid "baseUrl": ${e}`;
- }
- if (!outputTarget.baseUrl.endsWith('/')) {
- outputTarget.baseUrl += '/';
- }
- if (isString$1(outputTarget.prerenderConfig)) {
- if (!isAbsolute$1(outputTarget.prerenderConfig)) {
- outputTarget.prerenderConfig = join(config.rootDir, outputTarget.prerenderConfig);
- }
- }
- };
- const HOST_CONFIG_FILENAME = 'host.config.json';
- const validateServiceWorker = (config, outputTarget) => {
- if (outputTarget.serviceWorker === false) {
- return;
- }
- if (config.devMode && !config.flags.serviceWorker) {
- outputTarget.serviceWorker = null;
- return;
- }
- if (outputTarget.serviceWorker === null) {
- outputTarget.serviceWorker = null;
- return;
- }
- if (outputTarget.serviceWorker === true) {
- outputTarget.serviceWorker = {};
- }
- else if (!outputTarget.serviceWorker && config.devMode) {
- outputTarget.serviceWorker = null;
- return;
- }
- if (typeof outputTarget.serviceWorker !== 'object') {
- // what was passed in could have been a boolean
- // in that case let's just turn it into an empty obj so Object.assign doesn't crash
- outputTarget.serviceWorker = {};
- }
- if (!Array.isArray(outputTarget.serviceWorker.globPatterns)) {
- if (typeof outputTarget.serviceWorker.globPatterns === 'string') {
- outputTarget.serviceWorker.globPatterns = [outputTarget.serviceWorker.globPatterns];
- }
- else if (typeof outputTarget.serviceWorker.globPatterns !== 'string') {
- outputTarget.serviceWorker.globPatterns = DEFAULT_GLOB_PATTERNS.slice();
- }
- }
- if (typeof outputTarget.serviceWorker.globDirectory !== 'string') {
- outputTarget.serviceWorker.globDirectory = outputTarget.appDir;
- }
- if (typeof outputTarget.serviceWorker.globIgnores === 'string') {
- outputTarget.serviceWorker.globIgnores = [outputTarget.serviceWorker.globIgnores];
- }
- outputTarget.serviceWorker.globIgnores = outputTarget.serviceWorker.globIgnores || [];
- addGlobIgnores(config, outputTarget.serviceWorker.globIgnores);
- outputTarget.serviceWorker.dontCacheBustURLsMatching = /p-\w{8}/;
- if (isString$1(outputTarget.serviceWorker.swSrc) && !isAbsolute$1(outputTarget.serviceWorker.swSrc)) {
- outputTarget.serviceWorker.swSrc = join(config.rootDir, outputTarget.serviceWorker.swSrc);
- }
- if (!isString$1(outputTarget.serviceWorker.swDest)) {
- outputTarget.serviceWorker.swDest = join(outputTarget.appDir, DEFAULT_FILENAME);
- }
- if (!isAbsolute$1(outputTarget.serviceWorker.swDest)) {
- outputTarget.serviceWorker.swDest = join(outputTarget.appDir, outputTarget.serviceWorker.swDest);
- }
- };
- const addGlobIgnores = (config, globIgnores) => {
- globIgnores.push(`**/${HOST_CONFIG_FILENAME}`, `**/*.system.entry.js`, `**/*.system.js`, `**/${config.fsNamespace}.js`, `**/${config.fsNamespace}.esm.js`, `**/${config.fsNamespace}.css`);
- };
- const DEFAULT_GLOB_PATTERNS = ['*.html', '**/*.{js,css,json}'];
- const DEFAULT_FILENAME = 'sw.js';
- const validateWww = (config, diagnostics, userOutputs) => {
- const hasOutputTargets = userOutputs.length > 0;
- const hasE2eTests = !!(config.flags && config.flags.e2e);
- const userWwwOutputs = userOutputs.filter(isOutputTargetWww);
- if (!hasOutputTargets ||
- (hasE2eTests && !userOutputs.some(isOutputTargetWww) && !userOutputs.some(isOutputTargetDist))) {
- userWwwOutputs.push({ type: WWW });
- }
- if (config.flags.prerender && userWwwOutputs.length === 0) {
- const err = buildError(diagnostics);
- err.messageText = `You need at least one "www" output target configured in your stencil.config.ts, when the "--prerender" flag is used`;
- }
- return userWwwOutputs.reduce((outputs, o) => {
- const outputTarget = validateWwwOutputTarget(config, o, diagnostics);
- outputs.push(outputTarget);
- // Add dist-lazy output target
- const buildDir = outputTarget.buildDir;
- outputs.push({
- type: DIST_LAZY,
- dir: buildDir,
- esmDir: buildDir,
- systemDir: config.buildEs5 ? buildDir : undefined,
- systemLoaderFile: config.buildEs5 ? join(buildDir, `${config.fsNamespace}.js`) : undefined,
- polyfills: outputTarget.polyfills,
- isBrowserBuild: true,
- });
- // Copy for dist
- outputs.push({
- type: COPY,
- dir: buildDir,
- copyAssets: 'dist',
- });
- // Copy for www
- outputs.push({
- type: COPY,
- dir: outputTarget.appDir,
- copy: validateCopy(outputTarget.copy, [
- { src: 'assets', warn: false },
- { src: 'manifest.json', warn: false },
- ]),
- });
- // Generate global style with original name
- outputs.push({
- type: DIST_GLOBAL_STYLES,
- file: join(buildDir, `${config.fsNamespace}.css`),
- });
- return outputs;
- }, []);
- };
- const validateWwwOutputTarget = (config, outputTarget, diagnostics) => {
- if (!isString$1(outputTarget.baseUrl)) {
- outputTarget.baseUrl = '/';
- }
- if (!outputTarget.baseUrl.endsWith('/')) {
- // Make sure the baseUrl always finish with "/"
- outputTarget.baseUrl += '/';
- }
- outputTarget.dir = getAbsolutePath(config, outputTarget.dir || 'www');
- // Fix "dir" to account
- const pathname = new URL(outputTarget.baseUrl, 'http://localhost/').pathname;
- outputTarget.appDir = join(outputTarget.dir, pathname);
- if (outputTarget.appDir.endsWith('/') || outputTarget.appDir.endsWith('\\')) {
- outputTarget.appDir = outputTarget.appDir.substring(0, outputTarget.appDir.length - 1);
- }
- if (!isString$1(outputTarget.buildDir)) {
- outputTarget.buildDir = 'build';
- }
- if (!isAbsolute$1(outputTarget.buildDir)) {
- outputTarget.buildDir = join(outputTarget.appDir, outputTarget.buildDir);
- }
- if (!isString$1(outputTarget.indexHtml)) {
- outputTarget.indexHtml = 'index.html';
- }
- if (!isAbsolute$1(outputTarget.indexHtml)) {
- outputTarget.indexHtml = join(outputTarget.appDir, outputTarget.indexHtml);
- }
- if (!isBoolean$1(outputTarget.empty)) {
- outputTarget.empty = true;
- }
- validatePrerender(config, diagnostics, outputTarget);
- validateServiceWorker(config, outputTarget);
- if (outputTarget.polyfills === undefined) {
- outputTarget.polyfills = true;
- }
- outputTarget.polyfills = !!outputTarget.polyfills;
- return outputTarget;
- };
- const validateCustomElementBundle = (config, userOutputs) => {
- return userOutputs.filter(isOutputTargetDistCustomElementsBundle).reduce((arr, o) => {
- const outputTarget = {
- ...o,
- dir: getAbsolutePath(config, o.dir || 'dist/custom-elements'),
- };
- if (!isBoolean$1(outputTarget.empty)) {
- outputTarget.empty = true;
- }
- if (!isBoolean$1(outputTarget.externalRuntime)) {
- outputTarget.externalRuntime = true;
- }
- outputTarget.copy = validateCopy(outputTarget.copy, []);
- if (outputTarget.copy.length > 0) {
- arr.push({
- type: COPY,
- dir: config.rootDir,
- copy: [...outputTarget.copy],
- });
- }
- arr.push(outputTarget);
- return arr;
- }, []);
- };
- const validateOutputTargets = (config, diagnostics) => {
- const userOutputs = (config.outputTargets || []).slice();
- userOutputs.forEach((outputTarget) => {
- if (!VALID_TYPES.includes(outputTarget.type)) {
- const err = buildError(diagnostics);
- err.messageText = `Invalid outputTarget type "${outputTarget.type}". Valid outputTarget types include: ${VALID_TYPES.map((t) => `"${t}"`).join(', ')}`;
- }
- else if (outputTarget.type === DIST_CUSTOM_ELEMENTS_BUNDLE) {
- // TODO(STENCIL-260): Remove this check when the 'dist-custom-elements-bundle' is removed
- const warning = buildWarn(diagnostics);
- warning.messageText = `dist-custom-elements-bundle is deprecated and will be removed in a future major version release. Use "dist-custom-elements" instead. If "dist-custom-elements" does not meet your needs, please add a comment to https://github.com/ionic-team/stencil/issues/3136.`;
- }
- });
- config.outputTargets = [
- ...validateCollection(config, userOutputs),
- ...validateCustomElement(config, userOutputs),
- ...validateCustomElementBundle(config, userOutputs),
- ...validateCustomOutput(config, diagnostics, userOutputs),
- ...validateLazy(config, userOutputs),
- ...validateWww(config, diagnostics, userOutputs),
- ...validateDist(config, userOutputs),
- ...validateDocs(config, diagnostics, userOutputs),
- ...validateAngular(config, userOutputs),
- ...validateStats(config, userOutputs),
- ];
- // hydrate also gets info from the www output
- config.outputTargets = [
- ...config.outputTargets,
- ...validateHydrateScript(config, [...userOutputs, ...config.outputTargets]),
- ];
- };
- const validatePaths = (config) => {
- if (typeof config.rootDir !== 'string') {
- config.rootDir = '/';
- }
- if (typeof config.srcDir !== 'string') {
- config.srcDir = DEFAULT_SRC_DIR;
- }
- if (!isAbsolute$1(config.srcDir)) {
- config.srcDir = join(config.rootDir, config.srcDir);
- }
- if (typeof config.cacheDir !== 'string') {
- config.cacheDir = DEFAULT_CACHE_DIR;
- }
- if (!isAbsolute$1(config.cacheDir)) {
- config.cacheDir = join(config.rootDir, config.cacheDir);
- }
- if (typeof config.srcIndexHtml !== 'string') {
- config.srcIndexHtml = join(config.srcDir, DEFAULT_INDEX_HTML);
- }
- if (!isAbsolute$1(config.srcIndexHtml)) {
- config.srcIndexHtml = join(config.rootDir, config.srcIndexHtml);
- }
- if (typeof config.globalScript === 'string' && !isAbsolute$1(config.globalScript)) {
- if (!isAbsolute$1(config.globalScript)) {
- config.globalScript = join(config.rootDir, config.globalScript);
- }
- }
- if (typeof config.globalStyle === 'string') {
- if (!isAbsolute$1(config.globalStyle)) {
- config.globalStyle = join(config.rootDir, config.globalStyle);
- }
- }
- if (config.writeLog) {
- if (typeof config.buildLogFilePath !== 'string') {
- config.buildLogFilePath = DEFAULT_BUILD_LOG_FILE_NAME;
- }
- if (!isAbsolute$1(config.buildLogFilePath)) {
- config.buildLogFilePath = join(config.rootDir, config.buildLogFilePath);
- }
- }
- config.packageJsonFilePath = join(config.rootDir, 'package.json');
- };
- const DEFAULT_BUILD_LOG_FILE_NAME = 'stencil-build.log';
- const DEFAULT_CACHE_DIR = '.stencil';
- const DEFAULT_INDEX_HTML = 'index.html';
- const DEFAULT_SRC_DIR = 'src';
- const validatePlugins = (config, diagnostics) => {
- const userPlugins = config.plugins;
- if (!config.rollupPlugins) {
- config.rollupPlugins = {};
- }
- if (!Array.isArray(userPlugins)) {
- config.plugins = [];
- return;
- }
- const rollupPlugins = userPlugins.filter((plugin) => {
- return !!(plugin && typeof plugin === 'object' && !plugin.pluginType);
- });
- const hasResolveNode = rollupPlugins.some((p) => p.name === 'node-resolve');
- const hasCommonjs = rollupPlugins.some((p) => p.name === 'commonjs');
- if (hasCommonjs) {
- const warn = buildWarn(diagnostics);
- warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
- You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
- }
- if (hasResolveNode) {
- const warn = buildWarn(diagnostics);
- warn.messageText = `Stencil already uses "@rollup/plugin-commonjs", please remove it from your "stencil.config.ts" plugins.
- You can configure the commonjs settings using the "commonjs" property in "stencil.config.ts`;
- }
- config.rollupPlugins.before = [
- ...(config.rollupPlugins.before || []),
- ...rollupPlugins.filter(({ name }) => name !== 'node-resolve' && name !== 'commonjs'),
- ];
- config.plugins = userPlugins.filter((plugin) => {
- return !!(plugin && typeof plugin === 'object' && plugin.pluginType);
- });
- };
- const validateRollupConfig = (config) => {
- const cleanRollupConfig = getCleanRollupConfig(config.rollupConfig);
- config.rollupConfig = cleanRollupConfig;
- };
- const getCleanRollupConfig = (rollupConfig) => {
- let cleanRollupConfig = DEFAULT_ROLLUP_CONFIG;
- if (!rollupConfig || !isObject$4(rollupConfig)) {
- return cleanRollupConfig;
- }
- if (rollupConfig.inputOptions && isObject$4(rollupConfig.inputOptions)) {
- cleanRollupConfig = {
- ...cleanRollupConfig,
- inputOptions: pluck(rollupConfig.inputOptions, ['context', 'moduleContext', 'treeshake']),
- };
- }
- if (rollupConfig.outputOptions && isObject$4(rollupConfig.outputOptions)) {
- cleanRollupConfig = {
- ...cleanRollupConfig,
- outputOptions: pluck(rollupConfig.outputOptions, ['globals']),
- };
- }
- return cleanRollupConfig;
- };
- const DEFAULT_ROLLUP_CONFIG = {
- inputOptions: {},
- outputOptions: {},
- };
- const validateTesting = (config, diagnostics) => {
- const testing = (config.testing = Object.assign({}, config.testing || {}));
- if (!config.flags || (!config.flags.e2e && !config.flags.spec)) {
- return;
- }
- let configPathDir = config.configPath;
- if (isString$1(configPathDir)) {
- if (basename(configPathDir).includes('.')) {
- configPathDir = dirname(configPathDir);
- }
- }
- else {
- configPathDir = config.rootDir;
- }
- if (typeof config.flags.headless === 'boolean') {
- testing.browserHeadless = config.flags.headless;
- }
- else if (typeof testing.browserHeadless !== 'boolean') {
- testing.browserHeadless = true;
- }
- if (!testing.browserWaitUntil) {
- testing.browserWaitUntil = 'load';
- }
- testing.browserArgs = testing.browserArgs || [];
- addTestingConfigOption(testing.browserArgs, '--font-render-hinting=medium');
- addTestingConfigOption(testing.browserArgs, '--incognito');
- if (config.flags.ci) {
- addTestingConfigOption(testing.browserArgs, '--no-sandbox');
- addTestingConfigOption(testing.browserArgs, '--disable-setuid-sandbox');
- addTestingConfigOption(testing.browserArgs, '--disable-dev-shm-usage');
- testing.browserHeadless = true;
- }
- if (typeof testing.rootDir === 'string') {
- if (!isAbsolute$1(testing.rootDir)) {
- testing.rootDir = join(config.rootDir, testing.rootDir);
- }
- }
- else {
- testing.rootDir = config.rootDir;
- }
- if (config.flags && typeof config.flags.screenshotConnector === 'string') {
- testing.screenshotConnector = config.flags.screenshotConnector;
- }
- if (typeof testing.screenshotConnector === 'string') {
- if (!isAbsolute$1(testing.screenshotConnector)) {
- testing.screenshotConnector = join(config.rootDir, testing.screenshotConnector);
- }
- }
- else {
- testing.screenshotConnector = join(config.sys.getCompilerExecutingPath(), '..', '..', 'screenshot', 'local-connector.js');
- }
- if (!Array.isArray(testing.testPathIgnorePatterns)) {
- testing.testPathIgnorePatterns = DEFAULT_IGNORE_PATTERNS.map((ignorePattern) => {
- return join(testing.rootDir, ignorePattern);
- });
- config.outputTargets
- .filter((o) => (isOutputTargetDist(o) || isOutputTargetWww(o)) && o.dir)
- .forEach((outputTarget) => {
- testing.testPathIgnorePatterns.push(outputTarget.dir);
- });
- }
- if (typeof testing.preset !== 'string') {
- testing.preset = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing');
- }
- else if (!isAbsolute$1(testing.preset)) {
- testing.preset = join(configPathDir, testing.preset);
- }
- if (!Array.isArray(testing.setupFilesAfterEnv)) {
- testing.setupFilesAfterEnv = [];
- }
- testing.setupFilesAfterEnv.unshift(join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-setuptestframework.js'));
- if (isString$1(testing.testEnvironment)) {
- if (!isAbsolute$1(testing.testEnvironment) && isLocalModule(testing.testEnvironment)) {
- testing.testEnvironment = join(configPathDir, testing.testEnvironment);
- }
- }
- if (typeof testing.allowableMismatchedPixels === 'number') {
- if (testing.allowableMismatchedPixels < 0) {
- const err = buildError(diagnostics);
- err.messageText = `allowableMismatchedPixels must be a value that is 0 or greater`;
- }
- }
- else {
- testing.allowableMismatchedPixels = DEFAULT_ALLOWABLE_MISMATCHED_PIXELS;
- }
- if (typeof testing.allowableMismatchedRatio === 'number') {
- if (testing.allowableMismatchedRatio < 0 || testing.allowableMismatchedRatio > 1) {
- const err = buildError(diagnostics);
- err.messageText = `allowableMismatchedRatio must be a value ranging from 0 to 1`;
- }
- }
- if (typeof testing.pixelmatchThreshold === 'number') {
- if (testing.pixelmatchThreshold < 0 || testing.pixelmatchThreshold > 1) {
- const err = buildError(diagnostics);
- err.messageText = `pixelmatchThreshold must be a value ranging from 0 to 1`;
- }
- }
- else {
- testing.pixelmatchThreshold = DEFAULT_PIXEL_MATCH_THRESHOLD;
- }
- if (testing.testRegex === undefined) {
- /**
- * The test regex covers cases of:
- * - files under a `__tests__` directory
- * - the case where a test file has a name such as `test.ts`, `spec.ts` or `e2e.ts`.
- * - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
- * - this regex only handles the entire path of a file, e.g. `/some/path/e2e.ts`
- * - the case where a test file ends with `.test.ts`, `.spec.ts`, or `.e2e.ts`.
- * - these files can use any of the following file extensions: .ts, .tsx, .js, .jsx.
- * - this regex case shall match file names such as `my-cmp.spec.ts`, `test.spec.ts`
- * - this regex case shall not match file names such as `attest.ts`, `bespec.ts`
- */
- testing.testRegex = '(/__tests__/.*|(\\.|/)(test|spec|e2e))\\.[jt]sx?$';
- }
- if (Array.isArray(testing.testMatch)) {
- delete testing.testRegex;
- }
- else if (typeof testing.testRegex === 'string') {
- delete testing.testMatch;
- }
- if (typeof testing.runner !== 'string') {
- testing.runner = join(config.sys.getCompilerExecutingPath(), '..', '..', 'testing', 'jest-runner.js');
- }
- if (typeof testing.waitBeforeScreenshot === 'number') {
- if (testing.waitBeforeScreenshot < 0) {
- const err = buildError(diagnostics);
- err.messageText = `waitBeforeScreenshot must be a value that is 0 or greater`;
- }
- }
- else {
- testing.waitBeforeScreenshot = 10;
- }
- if (!Array.isArray(testing.emulate) || testing.emulate.length === 0) {
- testing.emulate = [
- {
- userAgent: 'default',
- viewport: {
- width: 600,
- height: 600,
- deviceScaleFactor: 1,
- isMobile: false,
- hasTouch: false,
- isLandscape: false,
- },
- },
- ];
- }
- };
- const addTestingConfigOption = (setArray, option) => {
- if (!setArray.includes(option)) {
- setArray.push(option);
- }
- };
- const DEFAULT_ALLOWABLE_MISMATCHED_PIXELS = 100;
- const DEFAULT_PIXEL_MATCH_THRESHOLD = 0.1;
- const DEFAULT_IGNORE_PATTERNS = ['.vscode', '.stencil', 'node_modules'];
- const validateWorkers = (config) => {
- if (typeof config.maxConcurrentWorkers !== 'number') {
- config.maxConcurrentWorkers = 8;
- }
- if (config.flags) {
- if (typeof config.flags.maxWorkers === 'number') {
- config.maxConcurrentWorkers = config.flags.maxWorkers;
- }
- else if (config.flags.ci) {
- config.maxConcurrentWorkers = 4;
- }
- }
- config.maxConcurrentWorkers = Math.max(Math.min(config.maxConcurrentWorkers, 16), 0);
- if (config.devServer) {
- config.devServer.worker = config.maxConcurrentWorkers > 0;
- }
- };
- const validateConfig = (userConfig) => {
- const config = Object.assign({}, userConfig || {}); // not positive it's json safe
- const diagnostics = [];
- // copy flags (we know it'll be json safe)
- config.flags = JSON.parse(JSON.stringify(config.flags || {}));
- // default devMode false
- if (config.flags.prod) {
- config.devMode = false;
- }
- else if (config.flags.dev) {
- config.devMode = true;
- }
- else if (!isBoolean$1(config.devMode)) {
- config.devMode = DEFAULT_DEV_MODE;
- }
- config.extras = config.extras || {};
- config.extras.appendChildSlotFix = !!config.extras.appendChildSlotFix;
- config.extras.cloneNodeFix = !!config.extras.cloneNodeFix;
- config.extras.cssVarsShim = !!config.extras.cssVarsShim;
- config.extras.dynamicImportShim = !!config.extras.dynamicImportShim;
- config.extras.lifecycleDOMEvents = !!config.extras.lifecycleDOMEvents;
- config.extras.safari10 = !!config.extras.safari10;
- config.extras.scriptDataOpts = !!config.extras.scriptDataOpts;
- config.extras.shadowDomShim = !!config.extras.shadowDomShim;
- config.extras.slotChildNodesFix = !!config.extras.slotChildNodesFix;
- config.extras.initializeNextTick = !!config.extras.initializeNextTick;
- config.extras.tagNameTransform = !!config.extras.tagNameTransform;
- config.buildEs5 = config.buildEs5 === true || (!config.devMode && config.buildEs5 === 'prod');
- setBooleanConfig(config, 'minifyCss', null, !config.devMode);
- setBooleanConfig(config, 'minifyJs', null, !config.devMode);
- setBooleanConfig(config, 'sourceMap', null, typeof config.sourceMap === 'undefined' ? false : config.sourceMap);
- setBooleanConfig(config, 'watch', 'watch', false);
- setBooleanConfig(config, 'buildDocs', 'docs', !config.devMode);
- setBooleanConfig(config, 'buildDist', 'esm', !config.devMode || config.buildEs5);
- setBooleanConfig(config, 'profile', 'profile', config.devMode);
- setBooleanConfig(config, 'writeLog', 'log', false);
- setBooleanConfig(config, 'buildAppCore', null, true);
- setBooleanConfig(config, 'autoprefixCss', null, config.buildEs5);
- setBooleanConfig(config, 'validateTypes', null, !config._isTesting);
- setBooleanConfig(config, 'allowInlineScripts', null, true);
- if (!isString$1(config.taskQueue)) {
- config.taskQueue = 'async';
- }
- // hash file names
- if (!isBoolean$1(config.hashFileNames)) {
- config.hashFileNames = !config.devMode;
- }
- if (!isNumber$1(config.hashedFileNameLength)) {
- config.hashedFileNameLength = DEFAULT_HASHED_FILENAME_LENTH;
- }
- if (config.hashedFileNameLength < MIN_HASHED_FILENAME_LENTH) {
- const err = buildError(diagnostics);
- err.messageText = `config.hashedFileNameLength must be at least ${MIN_HASHED_FILENAME_LENTH} characters`;
- }
- if (config.hashedFileNameLength > MAX_HASHED_FILENAME_LENTH) {
- const err = buildError(diagnostics);
- err.messageText = `config.hashedFileNameLength cannot be more than ${MAX_HASHED_FILENAME_LENTH} characters`;
- }
- if (!config.env) {
- config.env = {};
- }
- // get a good namespace
- validateNamespace(config, diagnostics);
- // figure out all of the config paths and absolute paths
- validatePaths(config);
- // outputTargets
- validateOutputTargets(config, diagnostics);
- // plugins
- validatePlugins(config, diagnostics);
- // rollup config
- validateRollupConfig(config);
- // dev server
- config.devServer = validateDevServer(config, diagnostics);
- // testing
- validateTesting(config, diagnostics);
- // hydrate flag
- config.hydratedFlag = validateHydrated(config);
- // bundles
- if (Array.isArray(config.bundles)) {
- config.bundles = sortBy(config.bundles, (a) => a.components.length);
- }
- else {
- config.bundles = [];
- }
- // validate how many workers we can use
- validateWorkers(config);
- // default devInspector to whatever devMode is
- setBooleanConfig(config, 'devInspector', null, config.devMode);
- if (!config._isTesting) {
- validateDistNamespace(config, diagnostics);
- }
- setBooleanConfig(config, 'enableCache', 'cache', true);
- if (!Array.isArray(config.watchIgnoredRegex) && config.watchIgnoredRegex != null) {
- config.watchIgnoredRegex = [config.watchIgnoredRegex];
- }
- config.watchIgnoredRegex = (config.watchIgnoredRegex || []).reduce((arr, reg) => {
- if (reg instanceof RegExp) {
- arr.push(reg);
- }
- return arr;
- }, []);
- return {
- config,
- diagnostics,
- };
- };
- const DEFAULT_DEV_MODE = false;
- const DEFAULT_HASHED_FILENAME_LENTH = 8;
- const MIN_HASHED_FILENAME_LENTH = 4;
- const MAX_HASHED_FILENAME_LENTH = 32;
- const validateTsConfig = async (config, sys, init) => {
- var _a;
- const tsconfig = {
- path: null,
- compilerOptions: null,
- files: null,
- include: null,
- exclude: null,
- extends: null,
- diagnostics: [],
- };
- try {
- const readTsConfig = await getTsConfigPath(config, sys, init);
- if (!readTsConfig) {
- const diagnostic = buildError(tsconfig.diagnostics);
- diagnostic.header = `Missing tsconfig.json`;
- diagnostic.messageText = `Unable to load TypeScript config file. Please create a "tsconfig.json" file within the "${config.rootDir}" directory.`;
- }
- else {
- tsconfig.path = readTsConfig.path;
- const host = {
- ...t.sys,
- readFile: (p) => {
- if (p === tsconfig.path) {
- return readTsConfig.content;
- }
- return sys.readFileSync(p);
- },
- readDirectory: (p) => sys.readDirSync(p),
- fileExists: (p) => sys.accessSync(p),
- onUnRecoverableConfigFileDiagnostic: (e) => console.error(e),
- };
- const results = t.getParsedCommandLineOfConfigFile(tsconfig.path, {}, host);
- if (results.errors && results.errors.length > 0) {
- results.errors.forEach((configErr) => {
- const tsDiagnostic = loadTypeScriptDiagnostic(configErr);
- if (tsDiagnostic.code === '18003') {
- // "No inputs were found in config file"
- // fine to just "warn" rather than "error" even before starting
- tsDiagnostic.level = 'warn';
- }
- tsDiagnostic.absFilePath = tsconfig.path;
- tsconfig.diagnostics.push(tsDiagnostic);
- });
- }
- else {
- if (results.raw) {
- const srcDir = relative$1(config.rootDir, config.srcDir);
- if (!hasSrcDirectoryInclude(results.raw.include, srcDir)) {
- const warn = buildWarn(tsconfig.diagnostics);
- warn.header = `tsconfig.json "include" required`;
- warn.messageText = `In order for TypeScript to improve watch performance, it's recommended the "tsconfig.json" file should have the "include" property, with at least the app's "${srcDir}" directory listed. For example: "include": ["${srcDir}"]`;
- }
- if (hasStencilConfigInclude(results.raw.include)) {
- const warn = buildWarn(tsconfig.diagnostics);
- warn.header = `tsconfig.json should not reference stencil.config.ts`;
- warn.messageText = `stencil.config.ts is not part of the output build, it should not be included.`;
- }
- if (Array.isArray(results.raw.files)) {
- tsconfig.files = results.raw.files.slice();
- }
- if (Array.isArray(results.raw.include)) {
- tsconfig.include = results.raw.include.slice();
- }
- if (Array.isArray(results.raw.exclude)) {
- tsconfig.exclude = results.raw.exclude.slice();
- }
- if (isString$1(results.raw.extends)) {
- tsconfig.extends = results.raw.extends;
- }
- }
- if (results.options) {
- tsconfig.compilerOptions = results.options;
- const target = (_a = tsconfig.compilerOptions.target) !== null && _a !== void 0 ? _a : t.ScriptTarget.ES5;
- if ([t.ScriptTarget.ES3, t.ScriptTarget.ES5, t.ScriptTarget.ES2015, t.ScriptTarget.ES2016].includes(target)) {
- const warn = buildWarn(tsconfig.diagnostics);
- warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “target” setting to "es2017". Note that the compiler will automatically handle transpilation for ES5-only browsers.`;
- }
- if (tsconfig.compilerOptions.module !== t.ModuleKind.ESNext && !config._isTesting) {
- const warn = buildWarn(tsconfig.diagnostics);
- warn.messageText = `To improve bundling, it is always recommended to set the tsconfig.json “module” setting to “esnext”. Note that the compiler will automatically handle bundling both modern and legacy builds.`;
- }
- tsconfig.compilerOptions.sourceMap = config.sourceMap;
- tsconfig.compilerOptions.inlineSources = config.sourceMap;
- }
- }
- }
- }
- catch (e) {
- catchError(tsconfig.diagnostics, e);
- }
- return tsconfig;
- };
- const getTsConfigPath = async (config, sys, init) => {
- const tsconfig = {
- path: null,
- content: null,
- };
- if (isString$1(config.tsconfig)) {
- if (!isAbsolute$1(config.tsconfig)) {
- tsconfig.path = join(config.rootDir, config.tsconfig);
- }
- else {
- tsconfig.path = config.tsconfig;
- }
- }
- else {
- tsconfig.path = join(config.rootDir, 'tsconfig.json');
- }
- tsconfig.content = await sys.readFile(tsconfig.path);
- if (!isString$1(tsconfig.content)) {
- if (!init.initTsConfig) {
- // not set to automatically generate a default tsconfig
- return null;
- }
- // create a default tsconfig
- tsconfig.path = join(config.rootDir, 'tsconfig.json');
- tsconfig.content = createDefaultTsConfig(config);
- await sys.writeFile(tsconfig.path, tsconfig.content);
- }
- tsconfig.path = normalizePath$1(tsconfig.path);
- return tsconfig;
- };
- const createDefaultTsConfig = (config) => JSON.stringify({
- compilerOptions: {
- allowSyntheticDefaultImports: true,
- experimentalDecorators: true,
- lib: ['dom', 'es2015'],
- moduleResolution: 'node',
- module: 'esnext',
- target: 'es2017',
- jsx: 'react',
- jsxFactory: 'h',
- jsxFragmentFactory: 'Fragment',
- sourceMap: config.sourceMap,
- inlineSources: config.sourceMap,
- },
- include: [relative$1(config.rootDir, config.srcDir)],
- }, null, 2);
- const hasSrcDirectoryInclude = (includeProp, src) => Array.isArray(includeProp) && includeProp.includes(src);
- const hasStencilConfigInclude = (includeProp) => Array.isArray(includeProp) && includeProp.includes('stencil.config.ts');
- const loadConfig = async (init = {}) => {
- const results = {
- config: null,
- diagnostics: [],
- tsconfig: {
- path: null,
- compilerOptions: null,
- files: null,
- include: null,
- exclude: null,
- extends: null,
- },
- };
- try {
- const sys = init.sys || createSystem();
- const config = init.config || {};
- let configPath = init.configPath || config.configPath;
- const loadedConfigFile = await loadConfigFile(sys, results.diagnostics, configPath);
- if (hasError(results.diagnostics)) {
- return results;
- }
- if (loadedConfigFile != null) {
- // merge the user's config object into their loaded config file
- configPath = loadedConfigFile.configPath;
- results.config = { ...loadedConfigFile, ...config };
- results.config.configPath = configPath;
- results.config.rootDir = normalizePath$1(dirname(configPath));
- }
- else {
- // no stencil.config.ts or .js file, which is fine
- // #0CJS ¯\_(ツ)_/¯
- results.config = { ...config };
- results.config.configPath = null;
- results.config.rootDir = normalizePath$1(sys.getCurrentDirectory());
- }
- results.config.sys = sys;
- const validated = validateConfig(results.config);
- results.diagnostics.push(...validated.diagnostics);
- if (hasError(results.diagnostics)) {
- return results;
- }
- results.config = validated.config;
- if (results.config.flags.debug || results.config.flags.verbose) {
- results.config.logLevel = 'debug';
- }
- else if (results.config.flags.logLevel) {
- results.config.logLevel = results.config.flags.logLevel;
- }
- else if (typeof results.config.logLevel !== 'string') {
- results.config.logLevel = 'info';
- }
- results.config.logger = init.logger || results.config.logger || createLogger();
- results.config.logger.setLevel(results.config.logLevel);
- if (!hasError(results.diagnostics)) {
- const tsConfigResults = await validateTsConfig(results.config, sys, init);
- results.diagnostics.push(...tsConfigResults.diagnostics);
- results.config.tsconfig = tsConfigResults.path;
- results.config.tsCompilerOptions = tsConfigResults.compilerOptions;
- results.tsconfig.path = tsConfigResults.path;
- results.tsconfig.compilerOptions = JSON.parse(JSON.stringify(tsConfigResults.compilerOptions));
- results.tsconfig.files = tsConfigResults.files;
- results.tsconfig.include = tsConfigResults.include;
- results.tsconfig.exclude = tsConfigResults.exclude;
- results.tsconfig.extends = tsConfigResults.extends;
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- return results;
- };
- const loadConfigFile = async (sys, diagnostics, configPath) => {
- let config = null;
- if (isString$1(configPath)) {
- // the passed in config was a string, so it's probably a path to the config we need to load
- const configFileData = await evaluateConfigFile(sys, diagnostics, configPath);
- if (hasError(diagnostics)) {
- return config;
- }
- if (!configFileData.config) {
- const err = buildError(diagnostics);
- err.messageText = `Invalid Stencil configuration file "${configPath}". Missing "config" property.`;
- err.absFilePath = configPath;
- return config;
- }
- config = configFileData.config;
- config.configPath = normalizePath$1(configPath);
- }
- return config;
- };
- const evaluateConfigFile = async (sys, diagnostics, configFilePath) => {
- let configFileData = null;
- try {
- if (IS_NODE_ENV) {
- const results = nodeRequire(configFilePath);
- diagnostics.push(...results.diagnostics);
- configFileData = results.module;
- }
- else {
- // browser environment, can't use node's require() to evaluate
- let sourceText = await sys.readFile(configFilePath);
- sourceText = transpileTypedConfig(diagnostics, sourceText, configFilePath);
- if (hasError(diagnostics)) {
- return configFileData;
- }
- const evalConfig = new Function(`const exports = {}; ${sourceText}; return exports;`);
- configFileData = evalConfig();
- }
- }
- catch (e) {
- catchError(diagnostics, e);
- }
- return configFileData;
- };
- const transpileTypedConfig = (diagnostics, sourceText, filePath) => {
- // let's transpile an awesome stencil.config.ts file into
- // a boring stencil.config.js file
- if (hasError(diagnostics)) {
- return sourceText;
- }
- const opts = {
- fileName: filePath,
- compilerOptions: {
- module: t.ModuleKind.CommonJS,
- moduleResolution: t.ModuleResolutionKind.NodeJs,
- esModuleInterop: true,
- target: t.ScriptTarget.ES2015,
- allowJs: true,
- },
- reportDiagnostics: false,
- };
- const output = t.transpileModule(sourceText, opts);
- return output.outputText;
- };
- const getTranspileResults = (code, input) => {
- if (!isString$1(input.file)) {
- input.file = 'module.tsx';
- }
- const parsedImport = parseImportPath(input.file);
- const results = {
- code: typeof code === 'string' ? code : '',
- data: [],
- diagnostics: [],
- inputFileExtension: parsedImport.ext,
- inputFilePath: input.file,
- imports: [],
- map: null,
- outputFilePath: null,
- };
- return {
- importData: parsedImport.data,
- results,
- };
- };
- const transpileCtx = { sys: null };
- const getTranspileConfig = (input) => {
- if (input.sys) {
- transpileCtx.sys = input.sys;
- }
- else if (!transpileCtx.sys) {
- if (IS_NODE_ENV) {
- transpileCtx.sys = requireFunc('../sys/node/index.js').createNodeSys();
- }
- else {
- transpileCtx.sys = createSystem();
- }
- }
- const compileOpts = {
- componentExport: getTranspileConfigOpt(input.componentExport, VALID_EXPORT, 'customelement'),
- componentMetadata: getTranspileConfigOpt(input.componentMetadata, VALID_METADATA, null),
- coreImportPath: isString$1(input.coreImportPath) ? input.coreImportPath : STENCIL_INTERNAL_CLIENT_ID,
- currentDirectory: isString$1(input.currentDirectory)
- ? input.currentDirectory
- : transpileCtx.sys.getCurrentDirectory(),
- file: input.file,
- proxy: getTranspileConfigOpt(input.proxy, VALID_PROXY, 'defineproperty'),
- module: getTranspileConfigOpt(input.module, VALID_MODULE, 'esm'),
- sourceMap: input.sourceMap === 'inline' ? 'inline' : input.sourceMap !== false,
- style: getTranspileConfigOpt(input.style, VALID_STYLE, 'static'),
- styleImportData: getTranspileConfigOpt(input.styleImportData, VALID_STYLE_IMPORT_DATA, 'queryparams'),
- target: getTranspileConfigOpt(input.target, VALID_TARGET, 'latest'),
- };
- const tsCompilerOptions = {
- // best we always set this to true
- allowSyntheticDefaultImports: true,
- // best we always set this to true
- esModuleInterop: true,
- // always get source maps
- sourceMap: compileOpts.sourceMap !== false,
- // isolated per file transpiling
- isolatedModules: true,
- // transpileModule does not write anything to disk so there is no need to verify that there are no conflicts between input and output paths.
- suppressOutputPathCheck: true,
- // Filename can be non-ts file.
- allowNonTsExtensions: true,
- // We are not returning a sourceFile for lib file when asked by the program,
- // so pass --noLib to avoid reporting a file not found error.
- noLib: true,
- noResolve: true,
- // NOTE: "module" and "target" configs will be set later
- // after the "ts" object has been loaded
- };
- if (isString$1(input.baseUrl)) {
- compileOpts.baseUrl = input.baseUrl;
- tsCompilerOptions.baseUrl = compileOpts.baseUrl;
- }
- if (input.paths) {
- compileOpts.paths = { ...input.paths };
- tsCompilerOptions.paths = { ...compileOpts.paths };
- }
- const transformOpts = {
- coreImportPath: compileOpts.coreImportPath,
- componentExport: compileOpts.componentExport,
- componentMetadata: compileOpts.componentMetadata,
- currentDirectory: compileOpts.currentDirectory,
- isolatedModules: true,
- module: compileOpts.module,
- proxy: compileOpts.proxy,
- file: compileOpts.file,
- style: compileOpts.style,
- styleImportData: compileOpts.styleImportData,
- target: compileOpts.target,
- };
- const config = {
- rootDir: compileOpts.currentDirectory,
- srcDir: compileOpts.currentDirectory,
- devMode: true,
- minifyCss: true,
- minifyJs: false,
- _isTesting: true,
- validateTypes: false,
- enableCache: false,
- sys: transpileCtx.sys,
- tsCompilerOptions,
- };
- return {
- compileOpts,
- config,
- transformOpts,
- };
- };
- const getTranspileCssConfig = (compileOpts, importData, results) => {
- const transformInput = {
- file: results.inputFilePath,
- input: results.code,
- tag: importData && importData.tag,
- encapsulation: importData && importData.encapsulation,
- mode: importData && importData.mode,
- sourceMap: compileOpts.sourceMap !== false,
- commentOriginalSelector: false,
- minify: false,
- autoprefixer: false,
- module: compileOpts.module,
- styleImportData: compileOpts.styleImportData,
- };
- return transformInput;
- };
- const getTranspileConfigOpt = (value, validValues, defaultValue) => {
- if (value === null || value === 'null') {
- return null;
- }
- value = isString$1(value) ? value.toLowerCase().trim() : null;
- if (validValues.has(value)) {
- return value;
- }
- return defaultValue;
- };
- const VALID_EXPORT = new Set(['customelement', 'module']);
- const VALID_METADATA = new Set(['compilerstatic', null]);
- const VALID_MODULE = new Set(['cjs', 'esm']);
- const VALID_PROXY = new Set(['defineproperty', null]);
- const VALID_STYLE = new Set(['static']);
- const VALID_STYLE_IMPORT_DATA = new Set(['queryparams']);
- const VALID_TARGET = new Set(['latest', 'esnext', 'es2020', 'es2019', 'es2018', 'es2017', 'es2016', 'es2015', 'es5']);
- const convertStaticToMeta = (config, compilerCtx, buildCtx, typeChecker, collection, transformOpts) => {
- return (transformCtx) => {
- let dirPath;
- let moduleFile;
- const visitNode = (node) => {
- if (t.isClassDeclaration(node)) {
- return parseStaticComponentMeta(compilerCtx, typeChecker, node, moduleFile, compilerCtx.nodeMap, transformOpts);
- }
- else if (t.isImportDeclaration(node)) {
- parseModuleImport(config, compilerCtx, buildCtx, moduleFile, dirPath, node, !transformOpts.isolatedModules);
- }
- else if (t.isCallExpression(node)) {
- parseCallExpression(moduleFile, node);
- }
- else if (t.isStringLiteral(node)) {
- parseStringLiteral(moduleFile, node);
- }
- return t.visitEachChild(node, visitNode, transformCtx);
- };
- return (tsSourceFile) => {
- dirPath = dirname(tsSourceFile.fileName);
- moduleFile = getModuleLegacy(config, compilerCtx, tsSourceFile.fileName);
- resetModuleLegacy(moduleFile);
- if (collection != null) {
- moduleFile.isCollectionDependency = true;
- moduleFile.collectionName = collection.collectionName;
- collection.moduleFiles.push(moduleFile);
- }
- else {
- moduleFile.isCollectionDependency = false;
- moduleFile.collectionName = null;
- }
- return visitNode(tsSourceFile);
- };
- };
- };
- /**
- * Stand-alone compiling of a single string
- */
- const transpileModule = (config, input, transformOpts) => {
- if (!config.logger) {
- config = {
- ...config,
- logger: createLogger(),
- };
- }
- const compilerCtx = new CompilerContext();
- const buildCtx = new BuildContext(config, compilerCtx);
- const tsCompilerOptions = {
- ...config.tsCompilerOptions,
- };
- let sourceFilePath = transformOpts.file;
- if (isString$1(sourceFilePath)) {
- sourceFilePath = normalizePath$1(sourceFilePath);
- }
- else {
- sourceFilePath = tsCompilerOptions.jsx ? `module.tsx` : `module.ts`;
- }
- const results = {
- sourceFilePath: sourceFilePath,
- code: null,
- map: null,
- diagnostics: [],
- moduleFile: null,
- };
- if (transformOpts.module === 'cjs') {
- tsCompilerOptions.module = t.ModuleKind.CommonJS;
- }
- else {
- tsCompilerOptions.module = t.ModuleKind.ESNext;
- }
- tsCompilerOptions.target = getScriptTargetKind(transformOpts);
- if ((sourceFilePath.endsWith('.tsx') || sourceFilePath.endsWith('.jsx')) && tsCompilerOptions.jsx == null) {
- // ensure we're setup for JSX in typescript
- tsCompilerOptions.jsx = t.JsxEmit.React;
- }
- if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFactory)) {
- tsCompilerOptions.jsxFactory = 'h';
- }
- if (tsCompilerOptions.jsx != null && !isString$1(tsCompilerOptions.jsxFragmentFactory)) {
- tsCompilerOptions.jsxFragmentFactory = 'Fragment';
- }
- if (tsCompilerOptions.paths && !isString$1(tsCompilerOptions.baseUrl)) {
- tsCompilerOptions.baseUrl = '.';
- }
- const sourceFile = t.createSourceFile(sourceFilePath, input, tsCompilerOptions.target);
- // Create a compilerHost object to allow the compiler to read and write files
- const compilerHost = {
- getSourceFile: (fileName) => {
- return normalizePath$1(fileName) === normalizePath$1(sourceFilePath) ? sourceFile : undefined;
- },
- writeFile: (name, text) => {
- if (name.endsWith('.js.map')) {
- results.map = text;
- }
- else if (name.endsWith('.js')) {
- results.code = text;
- }
- },
- getDefaultLibFileName: () => `lib.d.ts`,
- useCaseSensitiveFileNames: () => false,
- getCanonicalFileName: (fileName) => fileName,
- getCurrentDirectory: () => transformOpts.currentDirectory || getCurrentDirectory(),
- getNewLine: () => t.sys.newLine || '\n',
- fileExists: (fileName) => normalizePath$1(fileName) === normalizePath$1(sourceFilePath),
- readFile: () => '',
- directoryExists: () => true,
- getDirectories: () => [],
- };
- const program = t.createProgram([sourceFilePath], tsCompilerOptions, compilerHost);
- const typeChecker = program.getTypeChecker();
- const after = [
- convertStaticToMeta(config, compilerCtx, buildCtx, typeChecker, null, transformOpts),
- ];
- if (transformOpts.componentExport === 'customelement' || transformOpts.componentExport === 'module') {
- after.push(nativeComponentTransform(compilerCtx, transformOpts));
- }
- else {
- after.push(lazyComponentTransform(compilerCtx, transformOpts));
- }
- program.emit(undefined, undefined, undefined, false, {
- before: [
- convertDecoratorsToStatic(config, buildCtx.diagnostics, typeChecker),
- updateStencilCoreImports(transformOpts.coreImportPath),
- ],
- after,
- });
- const tsDiagnostics = [...program.getSyntacticDiagnostics()];
- if (config.validateTypes) {
- tsDiagnostics.push(...program.getOptionsDiagnostics());
- }
- buildCtx.diagnostics.push(...loadTypeScriptDiagnostics(tsDiagnostics));
- results.diagnostics.push(...buildCtx.diagnostics);
- results.moduleFile = compilerCtx.moduleMap.get(results.sourceFilePath);
- return results;
- };
- const getScriptTargetKind = (transformOpts) => {
- const target = transformOpts.target && transformOpts.target.toUpperCase();
- if (isNumber$1(t.ScriptTarget[target])) {
- return t.ScriptTarget[target];
- }
- // ESNext and Latest are the same
- return t.ScriptTarget.Latest;
- };
- const transpile = async (code, opts = {}) => {
- const { importData, results } = getTranspileResults(code, opts);
- try {
- if (shouldTranspileModule(results.inputFileExtension)) {
- const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
- patchTypescript(config, null);
- transpileCode(config, compileOpts, transformOpts, results);
- }
- else if (results.inputFileExtension === 'd.ts') {
- results.code = '';
- }
- else if (results.inputFileExtension === 'css') {
- const transformInput = getTranspileCssConfig(opts, importData, results);
- await transpileCss(transformInput, results);
- }
- else if (results.inputFileExtension === 'json') {
- transpileJson(results);
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- return results;
- };
- const transpileSync = (code, opts = {}) => {
- const { importData, results } = getTranspileResults(code, opts);
- try {
- if (shouldTranspileModule(results.inputFileExtension)) {
- const { config, compileOpts, transformOpts } = getTranspileConfig(opts);
- patchTypescript(config, null);
- transpileCode(config, compileOpts, transformOpts, results);
- }
- else if (results.inputFileExtension === 'd.ts') {
- results.code = '';
- }
- else if (results.inputFileExtension === 'css') {
- const transformInput = getTranspileCssConfig(opts, importData, results);
- transpileCssSync(transformInput, results);
- }
- else if (results.inputFileExtension === 'json') {
- transpileJson(results);
- }
- }
- catch (e) {
- catchError(results.diagnostics, e);
- }
- return results;
- };
- const transpileCode = (config, transpileOpts, transformOpts, results) => {
- const transpileResults = transpileModule(config, results.code, transformOpts);
- results.diagnostics.push(...transpileResults.diagnostics);
- if (typeof transpileResults.code === 'string') {
- results.code = transpileResults.code;
- results.map = transpileResults.map;
- if (transpileOpts.sourceMap === 'inline') {
- try {
- const mapObject = JSON.parse(transpileResults.map);
- mapObject.file = transpileOpts.file;
- mapObject.sources = [transpileOpts.file];
- delete mapObject.sourceRoot;
- const sourceMapComment = results.code.lastIndexOf('//#');
- results.code =
- results.code.slice(0, sourceMapComment) + getInlineSourceMappingUrlLinker(JSON.stringify(mapObject));
- }
- catch (e) {
- console.error(e);
- }
- }
- }
- if (isString$1(transpileResults.sourceFilePath)) {
- results.inputFilePath = transpileResults.sourceFilePath;
- }
- const moduleFile = transpileResults.moduleFile;
- if (moduleFile) {
- results.outputFilePath = moduleFile.jsFilePath;
- moduleFile.cmps.forEach((cmp) => {
- results.data.push(getPublicCompilerMeta(cmp));
- });
- moduleFile.originalImports.forEach((originalImport) => {
- results.imports.push({
- path: originalImport,
- });
- });
- }
- };
- const transpileCss = async (transformInput, results) => {
- const cssResults = await transformCssToEsm(transformInput);
- results.code = cssResults.output;
- results.map = cssResults.map;
- results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
- results.diagnostics.push(...cssResults.diagnostics);
- };
- const transpileCssSync = (transformInput, results) => {
- const cssResults = transformCssToEsmSync(transformInput);
- results.code = cssResults.output;
- results.map = cssResults.map;
- results.imports = cssResults.imports.map((p) => ({ path: p.importPath }));
- results.diagnostics.push(...cssResults.diagnostics);
- };
- const transpileJson = (results) => {
- results.code = index.dataToEsm(JSON.parse(results.code), {
- preferConst: true,
- compact: false,
- indent: ' ',
- });
- results.map = { mappings: '' };
- };
- // NOTE: if you change this, also change scripts/bundles/helpers/jest/jest-preset.js
- const shouldTranspileModule = (ext) => ['tsx', 'ts', 'mjs', 'jsx', 'js'].includes(ext);
- if (IS_WEB_WORKER_ENV) {
- initWebWorkerThread(createWorkerMessageHandler(createSystem()));
- }
- exports.buildId = buildId;
- exports.createCompiler = createCompiler;
- exports.createPrerenderer = createPrerenderer;
- exports.createSystem = createSystem;
- exports.createWorkerContext = createWorkerContext;
- exports.createWorkerMessageHandler = createWorkerMessageHandler;
- exports.dependencies = dependencies;
- exports.loadConfig = loadConfig;
- exports.nodeRequire = nodeRequire;
- exports.optimizeCss = optimizeCss$1;
- exports.optimizeJs = optimizeJs;
- exports.path = path$5;
- exports.transpile = transpile;
- exports.transpileSync = transpileSync;
- exports.ts = t;
- exports.vermoji = vermoji;
- exports.version = version$3;
- exports.versions = versions;
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = exports;
- }
- globalThis.stencil = exports;
- })({});
- //# sourceMappingURL=stencil.js.map
|