123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584 |
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
- (global = global || self, factory(global.Babel = {}));
- }(this, (function (exports) { 'use strict';
- var context = /*#__PURE__*/Object.freeze({
- __proto__: null,
- get types () { return t; },
- get DEFAULT_EXTENSIONS () { return DEFAULT_EXTENSIONS; },
- get OptionManager () { return OptionManager; },
- get Plugin () { return Plugin$1; },
- get File () { return File$2; },
- get buildExternalHelpers () { return babelBuildExternalHelpers; },
- get resolvePlugin () { return resolvePlugin; },
- get resolvePreset () { return resolvePreset; },
- get version () { return version$1; },
- get getEnv () { return getEnv; },
- get tokTypes () { return types; },
- get traverse () { return traverse$1; },
- get template () { return template; },
- get createConfigItem () { return createConfigItem; },
- get loadPartialConfig () { return loadPartialConfig$1; },
- get loadPartialConfigSync () { return loadPartialConfigSync; },
- get loadPartialConfigAsync () { return loadPartialConfigAsync; },
- get loadOptions () { return loadOptions; },
- get loadOptionsSync () { return loadOptionsSync; },
- get loadOptionsAsync () { return loadOptionsAsync; },
- get transform () { return transform; },
- get transformSync () { return transformSync; },
- get transformAsync () { return transformAsync; },
- get transformFile () { return transformFile$1; },
- get transformFileSync () { return transformFileSync; },
- get transformFileAsync () { return transformFileAsync; },
- get transformFromAst () { return transformFromAst; },
- get transformFromAstSync () { return transformFromAstSync; },
- get transformFromAstAsync () { return transformFromAstAsync; },
- get parse () { return parse$3; },
- get parseSync () { return parseSync; },
- get parseAsync () { return parseAsync; }
- });
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
- return target;
- }
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return self;
- }
- function _taggedTemplateLiteralLoose(strings, raw) {
- if (!raw) {
- raw = strings.slice(0);
- }
- strings.raw = raw;
- return strings;
- }
- function shallowEqual(actual, expected) {
- var keys = Object.keys(expected);
- for (var _i = 0, _arr = keys; _i < _arr.length; _i++) {
- var key = _arr[_i];
- if (actual[key] !== expected[key]) {
- return false;
- }
- }
- return true;
- }
- function isArrayExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ArrayExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isAssignmentExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "AssignmentExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBinaryExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BinaryExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isInterpreterDirective(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "InterpreterDirective") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDirective(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Directive") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDirectiveLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DirectiveLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBlockStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BlockStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBreakStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BreakStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isCallExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "CallExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isCatchClause(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "CatchClause") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isConditionalExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ConditionalExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isContinueStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ContinueStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDebuggerStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DebuggerStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDoWhileStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DoWhileStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEmptyStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EmptyStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExpressionStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExpressionStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFile(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "File") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isForInStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ForInStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isForStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ForStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunctionDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FunctionDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunctionExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FunctionExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isIdentifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Identifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isIfStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "IfStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isLabeledStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "LabeledStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isStringLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "StringLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNumericLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NumericLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNullLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NullLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBooleanLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BooleanLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isRegExpLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "RegExpLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isLogicalExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "LogicalExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isMemberExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "MemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNewExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NewExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isProgram(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Program") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectMethod(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isRestElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "RestElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isReturnStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ReturnStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSequenceExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "SequenceExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isParenthesizedExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ParenthesizedExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSwitchCase(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "SwitchCase") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSwitchStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "SwitchStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isThisExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ThisExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isThrowStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ThrowStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTryStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TryStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isUnaryExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "UnaryExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isUpdateExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "UpdateExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isVariableDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "VariableDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isVariableDeclarator(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "VariableDeclarator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isWhileStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "WhileStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isWithStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "WithStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isAssignmentPattern(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "AssignmentPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isArrayPattern(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ArrayPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isArrowFunctionExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ArrowFunctionExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportAllDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportAllDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportDefaultDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportDefaultDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportNamedDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportNamedDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isForOfStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ForOfStatement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isImportDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ImportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isImportDefaultSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ImportDefaultSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isImportNamespaceSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ImportNamespaceSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isImportSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ImportSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isMetaProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "MetaProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassMethod(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectPattern(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectPattern") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSpreadElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "SpreadElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSuper(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Super") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTaggedTemplateExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TaggedTemplateExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTemplateElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TemplateElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTemplateLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TemplateLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isYieldExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "YieldExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isAnyTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "AnyTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isArrayTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ArrayTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBooleanTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BooleanTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBooleanLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BooleanLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNullLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NullLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassImplements(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassImplements") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareClass(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareClass") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareFunction(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareInterface(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareInterface") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareModule(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareModule") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareModuleExports(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareModuleExports") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareTypeAlias(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareTypeAlias") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareOpaqueType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareOpaqueType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareVariable(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareVariable") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareExportDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareExportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclareExportAllDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclareExportAllDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclaredPredicate(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DeclaredPredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExistsTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExistsTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunctionTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FunctionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunctionTypeParam(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FunctionTypeParam") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isGenericTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "GenericTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isInferredPredicate(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "InferredPredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isInterfaceExtends(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "InterfaceExtends") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isInterfaceDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "InterfaceDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isInterfaceTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "InterfaceTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isIntersectionTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "IntersectionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isMixedTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "MixedTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEmptyTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EmptyTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNullableTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NullableTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNumberLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NumberLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNumberTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NumberTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeInternalSlot(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeInternalSlot") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeCallProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeCallProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeIndexer(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeIndexer") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectTypeSpreadProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectTypeSpreadProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isOpaqueType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "OpaqueType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isQualifiedTypeIdentifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "QualifiedTypeIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isStringLiteralTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "StringLiteralTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isStringTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "StringTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isThisTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ThisTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTupleTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TupleTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeofTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeofTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeAlias(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeAlias") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeCastExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeCastExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeParameter(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeParameter") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeParameterDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeParameterDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTypeParameterInstantiation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TypeParameterInstantiation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isUnionTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "UnionTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isVariance(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Variance") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isVoidTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "VoidTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumBooleanBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumBooleanBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumNumberBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumNumberBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumStringBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumStringBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumSymbolBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumSymbolBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumBooleanMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumBooleanMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumNumberMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumNumberMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumStringMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumStringMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumDefaultedMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumDefaultedMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXAttribute(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXAttribute") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXClosingElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXClosingElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXEmptyExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXEmptyExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXExpressionContainer(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXExpressionContainer") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXSpreadChild(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXSpreadChild") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXIdentifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXMemberExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXMemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXNamespacedName(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXNamespacedName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXOpeningElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXOpeningElement") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXSpreadAttribute(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXSpreadAttribute") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXText(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXText") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXFragment(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXOpeningFragment(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXOpeningFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSXClosingFragment(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSXClosingFragment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNoop(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Noop") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPlaceholder(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Placeholder") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isV8IntrinsicIdentifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "V8IntrinsicIdentifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isArgumentPlaceholder(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ArgumentPlaceholder") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isAwaitExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "AwaitExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBindExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BindExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isOptionalMemberExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "OptionalMemberExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPipelineTopicExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "PipelineTopicExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPipelineBareFunction(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "PipelineBareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPipelinePrimaryTopicReference(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "PipelinePrimaryTopicReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isOptionalCallExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "OptionalCallExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassPrivateProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassPrivateProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClassPrivateMethod(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ClassPrivateMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isImport(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Import") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDecorator(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Decorator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDoExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "DoExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportDefaultSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportDefaultSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportNamespaceSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportNamespaceSpecifier") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPrivateName(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "PrivateName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBigIntLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BigIntLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSParameterProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSParameterProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSDeclareFunction(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSDeclareFunction") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSDeclareMethod(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSDeclareMethod") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSQualifiedName(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSQualifiedName") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSCallSignatureDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSCallSignatureDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSConstructSignatureDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSConstructSignatureDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSPropertySignature(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSPropertySignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSMethodSignature(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSMethodSignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSIndexSignature(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSIndexSignature") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSAnyKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSAnyKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSBooleanKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSBooleanKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSBigIntKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSBigIntKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSNeverKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSNeverKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSNullKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSNullKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSNumberKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSNumberKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSObjectKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSObjectKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSStringKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSStringKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSSymbolKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSSymbolKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSUndefinedKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSUndefinedKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSUnknownKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSUnknownKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSVoidKeyword(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSVoidKeyword") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSThisType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSThisType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSFunctionType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSFunctionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSConstructorType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSConstructorType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeReference(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypePredicate(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypePredicate") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeQuery(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeQuery") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSArrayType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSArrayType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTupleType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTupleType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSOptionalType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSOptionalType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSRestType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSRestType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSUnionType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSUnionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSIntersectionType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSIntersectionType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSConditionalType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSConditionalType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSInferType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSInferType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSParenthesizedType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSParenthesizedType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeOperator(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeOperator") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSIndexedAccessType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSIndexedAccessType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSMappedType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSMappedType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSLiteralType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSLiteralType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSExpressionWithTypeArguments(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSExpressionWithTypeArguments") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSInterfaceDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSInterfaceDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSInterfaceBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSInterfaceBody") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAliasDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeAliasDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSAsExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSAsExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAssertion(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeAssertion") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSEnumDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSEnumDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSEnumMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSEnumMember") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSModuleDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSModuleDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSModuleBlock(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSModuleBlock") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSImportType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSImportType") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSImportEqualsDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSImportEqualsDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSExternalModuleReference(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSExternalModuleReference") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSNonNullExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSNonNullExpression") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSExportAssignment(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSExportAssignment") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSNamespaceExportDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSNamespaceExportDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeAnnotation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameterInstantiation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeParameterInstantiation") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameterDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeParameterDeclaration") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeParameter(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeParameter") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExpression(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ParenthesizedExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "PipelinePrimaryTopicReference" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType || nodeType === "Placeholder" && ("Expression" === node.expectedNode || "Identifier" === node.expectedNode || "StringLiteral" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBinary(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Binary" || "BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isScopable(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBlockParent(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isBlock(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType || "TSModuleBlock" === nodeType || nodeType === "Placeholder" && "BlockStatement" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType || nodeType === "Placeholder" && ("Statement" === node.expectedNode || "Declaration" === node.expectedNode || "BlockStatement" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTerminatorless(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Terminatorless" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isCompletionStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "CompletionStatement" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isConditional(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Conditional" || "ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isLoop(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Loop" || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isWhile(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "While" || "DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExpressionWrapper(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExpressionWrapper" || "ExpressionStatement" === nodeType || "ParenthesizedExpression" === nodeType || "TypeCastExpression" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFor(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "For" || "ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isForXStatement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ForXStatement" || "ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunction(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Function" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFunctionParent(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FunctionParent" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPureish(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || nodeType === "Placeholder" && "Declaration" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPatternLike(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "PatternLike" || "Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isLVal(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "LVal" || "Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType || nodeType === "Placeholder" && ("Pattern" === node.expectedNode || "Identifier" === node.expectedNode)) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSEntityName(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSEntityName" || "Identifier" === nodeType || "TSQualifiedName" === nodeType || nodeType === "Placeholder" && "Identifier" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isLiteral(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType || nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isUserWhitespacable(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "UserWhitespacable" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isMethod(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Method" || "ObjectMethod" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isObjectMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ObjectMember" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isProperty(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Property" || "ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isUnaryLike(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "UnaryLike" || "UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPattern(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Pattern" || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || nodeType === "Placeholder" && "Pattern" === node.expectedNode) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isClass(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Class" || "ClassExpression" === nodeType || "ClassDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isModuleDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ModuleDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isExportDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ExportDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isModuleSpecifier(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFlow(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFlowType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFlowBaseAnnotation(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFlowDeclaration(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FlowDeclaration" || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isFlowPredicate(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "FlowPredicate" || "DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumBody(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumBody" || "EnumBooleanBody" === nodeType || "EnumNumberBody" === nodeType || "EnumStringBody" === nodeType || "EnumSymbolBody" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isEnumMember(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "EnumMember" || "EnumBooleanMember" === nodeType || "EnumNumberMember" === nodeType || "EnumStringMember" === nodeType || "EnumDefaultedMember" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isJSX(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "JSX" || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isPrivate(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "Private" || "ClassPrivateProperty" === nodeType || "ClassPrivateMethod" === nodeType || "PrivateName" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSTypeElement(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSTypeElement" || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isTSType(node, opts) {
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSBigIntKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSUnknownKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSOptionalType" === nodeType || "TSRestType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType || "TSImportType" === nodeType) {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isNumberLiteral(node, opts) {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "NumberLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isRegexLiteral(node, opts) {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "RegexLiteral") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isRestProperty(node, opts) {
- console.trace("The node type RestProperty has been renamed to RestElement");
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "RestProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function isSpreadProperty(node, opts) {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- if (!node) return false;
- var nodeType = node.type;
- if (nodeType === "SpreadProperty") {
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- return false;
- }
- function matchesPattern(member, match, allowPartial) {
- if (!isMemberExpression(member)) return false;
- var parts = Array.isArray(match) ? match : match.split(".");
- var nodes = [];
- var node;
- for (node = member; isMemberExpression(node); node = node.object) {
- nodes.push(node.property);
- }
- nodes.push(node);
- if (nodes.length < parts.length) return false;
- if (!allowPartial && nodes.length > parts.length) return false;
- for (var i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
- var _node = nodes[j];
- var value = void 0;
- if (isIdentifier(_node)) {
- value = _node.name;
- } else if (isStringLiteral(_node)) {
- value = _node.value;
- } else {
- return false;
- }
- if (parts[i] !== value) return false;
- }
- return true;
- }
- function buildMatchMemberExpression(match, allowPartial) {
- var parts = match.split(".");
- return function (member) {
- return matchesPattern(member, parts, allowPartial);
- };
- }
- var isReactComponent = buildMatchMemberExpression("React.Component");
- function isCompatTag(tagName) {
- return !!tagName && /^[a-z]/.test(tagName);
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- var _listCacheClear = listCacheClear;
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var eq_1 = eq;
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq_1(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- var _assocIndexOf = assocIndexOf;
- var arrayProto = Array.prototype;
- var splice = arrayProto.splice;
- function listCacheDelete(key) {
- var data = this.__data__,
- index = _assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- var _listCacheDelete = listCacheDelete;
- function listCacheGet(key) {
- var data = this.__data__,
- index = _assocIndexOf(data, key);
- return index < 0 ? undefined : data[index][1];
- }
- var _listCacheGet = listCacheGet;
- function listCacheHas(key) {
- return _assocIndexOf(this.__data__, key) > -1;
- }
- var _listCacheHas = listCacheHas;
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = _assocIndexOf(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- var _listCacheSet = listCacheSet;
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- ListCache.prototype.clear = _listCacheClear;
- ListCache.prototype['delete'] = _listCacheDelete;
- ListCache.prototype.get = _listCacheGet;
- ListCache.prototype.has = _listCacheHas;
- ListCache.prototype.set = _listCacheSet;
- var _ListCache = ListCache;
- function stackClear() {
- this.__data__ = new _ListCache();
- this.size = 0;
- }
- var _stackClear = stackClear;
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
- this.size = data.size;
- return result;
- }
- var _stackDelete = stackDelete;
- function stackGet(key) {
- return this.__data__.get(key);
- }
- var _stackGet = stackGet;
- function stackHas(key) {
- return this.__data__.has(key);
- }
- var _stackHas = stackHas;
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
- function commonjsRequire () {
- throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs');
- }
- function unwrapExports (x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
- }
- function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
- }
- function getCjsExportFromNamespace (n) {
- return n && n['default'] || n;
- }
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var _freeGlobal = freeGlobal;
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
- var root = _freeGlobal || freeSelf || Function('return this')();
- var _root = root;
- var Symbol$1 = _root.Symbol;
- var _Symbol = Symbol$1;
- var objectProto = Object.prototype;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var nativeObjectToString = objectProto.toString;
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
- var _getRawTag = getRawTag;
- var objectProto$1 = Object.prototype;
- var nativeObjectToString$1 = objectProto$1.toString;
- function objectToString(value) {
- return nativeObjectToString$1.call(value);
- }
- var _objectToString = objectToString;
- var nullTag = '[object Null]',
- undefinedTag = '[object Undefined]';
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return symToStringTag$1 && symToStringTag$1 in Object(value) ? _getRawTag(value) : _objectToString(value);
- }
- var _baseGetTag = baseGetTag;
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
- var isObject_1 = isObject;
- var asyncTag = '[object AsyncFunction]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- proxyTag = '[object Proxy]';
- function isFunction$1(value) {
- if (!isObject_1(value)) {
- return false;
- }
- var tag = _baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- var isFunction_1 = isFunction$1;
- var coreJsData = _root['__core-js_shared__'];
- var _coreJsData = coreJsData;
- var maskSrcKey = function () {
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
- return uid ? 'Symbol(src)_1.' + uid : '';
- }();
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var _isMasked = isMasked;
- var funcProto = Function.prototype;
- var funcToString = funcProto.toString;
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return func + '';
- } catch (e) {}
- }
- return '';
- }
- var _toSource = toSource;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var funcProto$1 = Function.prototype,
- objectProto$2 = Object.prototype;
- var funcToString$1 = funcProto$1.toString;
- var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
- var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
- function baseIsNative(value) {
- if (!isObject_1(value) || _isMasked(value)) {
- return false;
- }
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
- return pattern.test(_toSource(value));
- }
- var _baseIsNative = baseIsNative;
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
- var _getValue = getValue;
- function getNative(object, key) {
- var value = _getValue(object, key);
- return _baseIsNative(value) ? value : undefined;
- }
- var _getNative = getNative;
- var Map$1 = _getNative(_root, 'Map');
- var _Map = Map$1;
- var nativeCreate = _getNative(Object, 'create');
- var _nativeCreate = nativeCreate;
- function hashClear() {
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
- this.size = 0;
- }
- var _hashClear = hashClear;
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
- var _hashDelete = hashDelete;
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
- var objectProto$3 = Object.prototype;
- var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
- function hashGet(key) {
- var data = this.__data__;
- if (_nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty$2.call(data, key) ? data[key] : undefined;
- }
- var _hashGet = hashGet;
- var objectProto$4 = Object.prototype;
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
- function hashHas(key) {
- var data = this.__data__;
- return _nativeCreate ? data[key] !== undefined : hasOwnProperty$3.call(data, key);
- }
- var _hashHas = hashHas;
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = _nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
- return this;
- }
- var _hashSet = hashSet;
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- Hash.prototype.clear = _hashClear;
- Hash.prototype['delete'] = _hashDelete;
- Hash.prototype.get = _hashGet;
- Hash.prototype.has = _hashHas;
- Hash.prototype.set = _hashSet;
- var _Hash = Hash;
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new _Hash(),
- 'map': new (_Map || _ListCache)(),
- 'string': new _Hash()
- };
- }
- var _mapCacheClear = mapCacheClear;
- function isKeyable(value) {
- var type = typeof value;
- return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
- }
- var _isKeyable = isKeyable;
- function getMapData(map, key) {
- var data = map.__data__;
- return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
- }
- var _getMapData = getMapData;
- function mapCacheDelete(key) {
- var result = _getMapData(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
- var _mapCacheDelete = mapCacheDelete;
- function mapCacheGet(key) {
- return _getMapData(this, key).get(key);
- }
- var _mapCacheGet = mapCacheGet;
- function mapCacheHas(key) {
- return _getMapData(this, key).has(key);
- }
- var _mapCacheHas = mapCacheHas;
- function mapCacheSet(key, value) {
- var data = _getMapData(this, key),
- size = data.size;
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
- var _mapCacheSet = mapCacheSet;
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- MapCache.prototype.clear = _mapCacheClear;
- MapCache.prototype['delete'] = _mapCacheDelete;
- MapCache.prototype.get = _mapCacheGet;
- MapCache.prototype.has = _mapCacheHas;
- MapCache.prototype.set = _mapCacheSet;
- var _MapCache = MapCache;
- var LARGE_ARRAY_SIZE = 200;
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof _ListCache) {
- var pairs = data.__data__;
- if (!_Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new _MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- var _stackSet = stackSet;
- function Stack(entries) {
- var data = this.__data__ = new _ListCache(entries);
- this.size = data.size;
- }
- Stack.prototype.clear = _stackClear;
- Stack.prototype['delete'] = _stackDelete;
- Stack.prototype.get = _stackGet;
- Stack.prototype.has = _stackHas;
- Stack.prototype.set = _stackSet;
- var _Stack = Stack;
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- var _arrayEach = arrayEach;
- var defineProperty = function () {
- try {
- var func = _getNative(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }();
- var _defineProperty = defineProperty;
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && _defineProperty) {
- _defineProperty(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
- var _baseAssignValue = baseAssignValue;
- var objectProto$5 = Object.prototype;
- var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty$4.call(object, key) && eq_1(objValue, value)) || value === undefined && !(key in object)) {
- _baseAssignValue(object, key, value);
- }
- }
- var _assignValue = assignValue;
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index = -1,
- length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- _baseAssignValue(object, key, newValue);
- } else {
- _assignValue(object, key, newValue);
- }
- }
- return object;
- }
- var _copyObject = copyObject;
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- var _baseTimes = baseTimes;
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
- var isObjectLike_1 = isObjectLike;
- var argsTag = '[object Arguments]';
- function baseIsArguments(value) {
- return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
- }
- var _baseIsArguments = baseIsArguments;
- var objectProto$6 = Object.prototype;
- var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
- var propertyIsEnumerable = objectProto$6.propertyIsEnumerable;
- var isArguments = _baseIsArguments(function () {
- return arguments;
- }()) ? _baseIsArguments : function (value) {
- return isObjectLike_1(value) && hasOwnProperty$5.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
- };
- var isArguments_1 = isArguments;
- var isArray = Array.isArray;
- var isArray_1 = isArray;
- function stubFalse() {
- return false;
- }
- var stubFalse_1 = stubFalse;
- var isBuffer_1 = createCommonjsModule(function (module, exports) {
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var Buffer = moduleExports ? _root.Buffer : undefined;
- var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
- var isBuffer = nativeIsBuffer || stubFalse_1;
- module.exports = isBuffer;
- });
- var MAX_SAFE_INTEGER = 9007199254740991;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
- }
- var _isIndex = isIndex;
- var MAX_SAFE_INTEGER$1 = 9007199254740991;
- function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
- }
- var isLength_1 = isLength;
- var argsTag$1 = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag$1 = '[object Function]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- weakMapTag = '[object WeakMap]';
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- function baseIsTypedArray(value) {
- return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
- }
- var _baseIsTypedArray = baseIsTypedArray;
- function baseUnary(func) {
- return function (value) {
- return func(value);
- };
- }
- var _baseUnary = baseUnary;
- var _nodeUtil = createCommonjsModule(function (module, exports) {
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && _freeGlobal.process;
- var nodeUtil = function () {
- try {
- var types = freeModule && freeModule.require && freeModule.require('util').types;
- if (types) {
- return types;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }();
- module.exports = nodeUtil;
- });
- var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
- var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
- var isTypedArray_1 = isTypedArray;
- var objectProto$7 = Object.prototype;
- var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray_1(value),
- isArg = !isArr && isArguments_1(value),
- isBuff = !isArr && !isArg && isBuffer_1(value),
- isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? _baseTimes(value.length, String) : [],
- length = result.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty$6.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || _isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
- }
- var _arrayLikeKeys = arrayLikeKeys;
- var objectProto$8 = Object.prototype;
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$8;
- return value === proto;
- }
- var _isPrototype = isPrototype;
- function overArg(func, transform) {
- return function (arg) {
- return func(transform(arg));
- };
- }
- var _overArg = overArg;
- var nativeKeys = _overArg(Object.keys, Object);
- var _nativeKeys = nativeKeys;
- var objectProto$9 = Object.prototype;
- var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
- function baseKeys(object) {
- if (!_isPrototype(object)) {
- return _nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty$7.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
- var _baseKeys = baseKeys;
- function isArrayLike(value) {
- return value != null && isLength_1(value.length) && !isFunction_1(value);
- }
- var isArrayLike_1 = isArrayLike;
- function keys(object) {
- return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
- }
- var keys_1 = keys;
- function baseAssign(object, source) {
- return object && _copyObject(source, keys_1(source), object);
- }
- var _baseAssign = baseAssign;
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
- var _nativeKeysIn = nativeKeysIn;
- var objectProto$a = Object.prototype;
- var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
- function baseKeysIn(object) {
- if (!isObject_1(object)) {
- return _nativeKeysIn(object);
- }
- var isProto = _isPrototype(object),
- result = [];
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty$8.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
- var _baseKeysIn = baseKeysIn;
- function keysIn$1(object) {
- return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
- }
- var keysIn_1 = keysIn$1;
- function baseAssignIn(object, source) {
- return object && _copyObject(source, keysIn_1(source), object);
- }
- var _baseAssignIn = baseAssignIn;
- var _cloneBuffer = createCommonjsModule(function (module, exports) {
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var Buffer = moduleExports ? _root.Buffer : undefined,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result);
- return result;
- }
- module.exports = cloneBuffer;
- });
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- var _copyArray = copyArray;
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- var _arrayFilter = arrayFilter;
- function stubArray() {
- return [];
- }
- var stubArray_1 = stubArray;
- var objectProto$b = Object.prototype;
- var propertyIsEnumerable$1 = objectProto$b.propertyIsEnumerable;
- var nativeGetSymbols = Object.getOwnPropertySymbols;
- var getSymbols = !nativeGetSymbols ? stubArray_1 : function (object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return _arrayFilter(nativeGetSymbols(object), function (symbol) {
- return propertyIsEnumerable$1.call(object, symbol);
- });
- };
- var _getSymbols = getSymbols;
- function copySymbols(source, object) {
- return _copyObject(source, _getSymbols(source), object);
- }
- var _copySymbols = copySymbols;
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- var _arrayPush = arrayPush;
- var getPrototype = _overArg(Object.getPrototypeOf, Object);
- var _getPrototype = getPrototype;
- var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
- var getSymbolsIn = !nativeGetSymbols$1 ? stubArray_1 : function (object) {
- var result = [];
- while (object) {
- _arrayPush(result, _getSymbols(object));
- object = _getPrototype(object);
- }
- return result;
- };
- var _getSymbolsIn = getSymbolsIn;
- function copySymbolsIn(source, object) {
- return _copyObject(source, _getSymbolsIn(source), object);
- }
- var _copySymbolsIn = copySymbolsIn;
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
- }
- var _baseGetAllKeys = baseGetAllKeys;
- function getAllKeys(object) {
- return _baseGetAllKeys(object, keys_1, _getSymbols);
- }
- var _getAllKeys = getAllKeys;
- function getAllKeysIn(object) {
- return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);
- }
- var _getAllKeysIn = getAllKeysIn;
- var DataView$1 = _getNative(_root, 'DataView');
- var _DataView = DataView$1;
- var Promise$1 = _getNative(_root, 'Promise');
- var _Promise = Promise$1;
- var Set$1 = _getNative(_root, 'Set');
- var _Set = Set$1;
- var WeakMap$1 = _getNative(_root, 'WeakMap');
- var _WeakMap = WeakMap$1;
- var mapTag$1 = '[object Map]',
- objectTag$1 = '[object Object]',
- promiseTag = '[object Promise]',
- setTag$1 = '[object Set]',
- weakMapTag$1 = '[object WeakMap]';
- var dataViewTag$1 = '[object DataView]';
- var dataViewCtorString = _toSource(_DataView),
- mapCtorString = _toSource(_Map),
- promiseCtorString = _toSource(_Promise),
- setCtorString = _toSource(_Set),
- weakMapCtorString = _toSource(_WeakMap);
- var getTag = _baseGetTag;
- if (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$1 || _Map && getTag(new _Map()) != mapTag$1 || _Promise && getTag(_Promise.resolve()) != promiseTag || _Set && getTag(new _Set()) != setTag$1 || _WeakMap && getTag(new _WeakMap()) != weakMapTag$1) {
- getTag = function getTag(value) {
- var result = _baseGetTag(value),
- Ctor = result == objectTag$1 ? value.constructor : undefined,
- ctorString = Ctor ? _toSource(Ctor) : '';
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag$1;
- case mapCtorString:
- return mapTag$1;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag$1;
- case weakMapCtorString:
- return weakMapTag$1;
- }
- }
- return result;
- };
- }
- var _getTag = getTag;
- var objectProto$c = Object.prototype;
- var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
- if (length && typeof array[0] == 'string' && hasOwnProperty$9.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
- var _initCloneArray = initCloneArray;
- var Uint8Array$1 = _root.Uint8Array;
- var _Uint8Array = Uint8Array$1;
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
- return result;
- }
- var _cloneArrayBuffer = cloneArrayBuffer;
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- var _cloneDataView = cloneDataView;
- var reFlags = /\w*$/;
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
- var _cloneRegExp = cloneRegExp;
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
- var _cloneSymbol = cloneSymbol;
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- var _cloneTypedArray = cloneTypedArray;
- var boolTag$1 = '[object Boolean]',
- dateTag$1 = '[object Date]',
- mapTag$2 = '[object Map]',
- numberTag$1 = '[object Number]',
- regexpTag$1 = '[object RegExp]',
- setTag$2 = '[object Set]',
- stringTag$1 = '[object String]',
- symbolTag = '[object Symbol]';
- var arrayBufferTag$1 = '[object ArrayBuffer]',
- dataViewTag$2 = '[object DataView]',
- float32Tag$1 = '[object Float32Array]',
- float64Tag$1 = '[object Float64Array]',
- int8Tag$1 = '[object Int8Array]',
- int16Tag$1 = '[object Int16Array]',
- int32Tag$1 = '[object Int32Array]',
- uint8Tag$1 = '[object Uint8Array]',
- uint8ClampedTag$1 = '[object Uint8ClampedArray]',
- uint16Tag$1 = '[object Uint16Array]',
- uint32Tag$1 = '[object Uint32Array]';
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag$1:
- return _cloneArrayBuffer(object);
- case boolTag$1:
- case dateTag$1:
- return new Ctor(+object);
- case dataViewTag$2:
- return _cloneDataView(object, isDeep);
- case float32Tag$1:
- case float64Tag$1:
- case int8Tag$1:
- case int16Tag$1:
- case int32Tag$1:
- case uint8Tag$1:
- case uint8ClampedTag$1:
- case uint16Tag$1:
- case uint32Tag$1:
- return _cloneTypedArray(object, isDeep);
- case mapTag$2:
- return new Ctor();
- case numberTag$1:
- case stringTag$1:
- return new Ctor(object);
- case regexpTag$1:
- return _cloneRegExp(object);
- case setTag$2:
- return new Ctor();
- case symbolTag:
- return _cloneSymbol(object);
- }
- }
- var _initCloneByTag = initCloneByTag;
- var objectCreate = Object.create;
- var baseCreate = function () {
- function object() {}
- return function (proto) {
- if (!isObject_1(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object();
- object.prototype = undefined;
- return result;
- };
- }();
- var _baseCreate = baseCreate;
- function initCloneObject(object) {
- return typeof object.constructor == 'function' && !_isPrototype(object) ? _baseCreate(_getPrototype(object)) : {};
- }
- var _initCloneObject = initCloneObject;
- var mapTag$3 = '[object Map]';
- function baseIsMap(value) {
- return isObjectLike_1(value) && _getTag(value) == mapTag$3;
- }
- var _baseIsMap = baseIsMap;
- var nodeIsMap = _nodeUtil && _nodeUtil.isMap;
- var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;
- var isMap_1 = isMap;
- var setTag$3 = '[object Set]';
- function baseIsSet(value) {
- return isObjectLike_1(value) && _getTag(value) == setTag$3;
- }
- var _baseIsSet = baseIsSet;
- var nodeIsSet = _nodeUtil && _nodeUtil.isSet;
- var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;
- var isSet_1 = isSet;
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
- var argsTag$2 = '[object Arguments]',
- arrayTag$1 = '[object Array]',
- boolTag$2 = '[object Boolean]',
- dateTag$2 = '[object Date]',
- errorTag$1 = '[object Error]',
- funcTag$2 = '[object Function]',
- genTag$1 = '[object GeneratorFunction]',
- mapTag$4 = '[object Map]',
- numberTag$2 = '[object Number]',
- objectTag$2 = '[object Object]',
- regexpTag$2 = '[object RegExp]',
- setTag$4 = '[object Set]',
- stringTag$2 = '[object String]',
- symbolTag$1 = '[object Symbol]',
- weakMapTag$2 = '[object WeakMap]';
- var arrayBufferTag$2 = '[object ArrayBuffer]',
- dataViewTag$3 = '[object DataView]',
- float32Tag$2 = '[object Float32Array]',
- float64Tag$2 = '[object Float64Array]',
- int8Tag$2 = '[object Int8Array]',
- int16Tag$2 = '[object Int16Array]',
- int32Tag$2 = '[object Int32Array]',
- uint8Tag$2 = '[object Uint8Array]',
- uint8ClampedTag$2 = '[object Uint8ClampedArray]',
- uint16Tag$2 = '[object Uint16Array]',
- uint32Tag$2 = '[object Uint32Array]';
- var cloneableTags = {};
- cloneableTags[argsTag$2] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$2] = cloneableTags[dataViewTag$3] = cloneableTags[boolTag$2] = cloneableTags[dateTag$2] = cloneableTags[float32Tag$2] = cloneableTags[float64Tag$2] = cloneableTags[int8Tag$2] = cloneableTags[int16Tag$2] = cloneableTags[int32Tag$2] = cloneableTags[mapTag$4] = cloneableTags[numberTag$2] = cloneableTags[objectTag$2] = cloneableTags[regexpTag$2] = cloneableTags[setTag$4] = cloneableTags[stringTag$2] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag$2] = cloneableTags[uint8ClampedTag$2] = cloneableTags[uint16Tag$2] = cloneableTags[uint32Tag$2] = true;
- cloneableTags[errorTag$1] = cloneableTags[funcTag$2] = cloneableTags[weakMapTag$2] = false;
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject_1(value)) {
- return value;
- }
- var isArr = isArray_1(value);
- if (isArr) {
- result = _initCloneArray(value);
- if (!isDeep) {
- return _copyArray(value, result);
- }
- } else {
- var tag = _getTag(value),
- isFunc = tag == funcTag$2 || tag == genTag$1;
- if (isBuffer_1(value)) {
- return _cloneBuffer(value, isDeep);
- }
- if (tag == objectTag$2 || tag == argsTag$2 || isFunc && !object) {
- result = isFlat || isFunc ? {} : _initCloneObject(value);
- if (!isDeep) {
- return isFlat ? _copySymbolsIn(value, _baseAssignIn(result, value)) : _copySymbols(value, _baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = _initCloneByTag(value, tag, isDeep);
- }
- }
- stack || (stack = new _Stack());
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
- if (isSet_1(value)) {
- value.forEach(function (subValue) {
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap_1(value)) {
- value.forEach(function (subValue, key) {
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- }
- var keysFunc = isFull ? isFlat ? _getAllKeysIn : _getAllKeys : isFlat ? keysIn : keys_1;
- var props = isArr ? undefined : keysFunc(value);
- _arrayEach(props || value, function (subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- _assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
- var _baseClone = baseClone;
- var CLONE_SYMBOLS_FLAG$1 = 4;
- function clone(value) {
- return _baseClone(value, CLONE_SYMBOLS_FLAG$1);
- }
- var clone_1 = clone;
- var fastProto = null;
- function FastObject(o) {
- if (fastProto !== null && typeof fastProto.property) {
- var result = fastProto;
- fastProto = FastObject.prototype = null;
- return result;
- }
- fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
- return new FastObject();
- }
- FastObject();
- var toFastProperties = function toFastproperties(o) {
- return FastObject(o);
- };
- var global$1 = typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout() {
- throw new Error('clearTimeout has not been defined');
- }
- var cachedSetTimeout = defaultSetTimout;
- var cachedClearTimeout = defaultClearTimeout;
- if (typeof global$1.setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- }
- if (typeof global$1.clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- }
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- return setTimeout(fun, 0);
- }
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- return cachedSetTimeout(fun, 0);
- } catch (e) {
- try {
- return cachedSetTimeout.call(null, fun, 0);
- } catch (e) {
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- return clearTimeout(marker);
- }
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- return cachedClearTimeout(marker);
- } catch (e) {
- try {
- return cachedClearTimeout.call(null, marker);
- } catch (e) {
- return cachedClearTimeout.call(this, marker);
- }
- }
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
- var len = queue.length;
- while (len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
- function nextTick(fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- }
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- var title = 'browser';
- var platform = 'browser';
- var browser = true;
- var env = {};
- var argv = [];
- var version = '';
- var versions = {};
- var release = {};
- var config = {};
- function noop() {}
- var on = noop;
- var addListener = noop;
- var once = noop;
- var off = noop;
- var removeListener = noop;
- var removeAllListeners = noop;
- var emit = noop;
- function binding(name) {
- throw new Error('process.binding is not supported');
- }
- function cwd() {
- return '/';
- }
- function chdir(dir) {
- throw new Error('process.chdir is not supported');
- }
- function umask() {
- return 0;
- }
- var performance = global$1.performance || {};
- var performanceNow = performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow || function () {
- return new Date().getTime();
- };
- function hrtime(previousTimestamp) {
- var clocktime = performanceNow.call(performance) * 1e-3;
- var seconds = Math.floor(clocktime);
- var nanoseconds = Math.floor(clocktime % 1 * 1e9);
- if (previousTimestamp) {
- seconds = seconds - previousTimestamp[0];
- nanoseconds = nanoseconds - previousTimestamp[1];
- if (nanoseconds < 0) {
- seconds--;
- nanoseconds += 1e9;
- }
- }
- return [seconds, nanoseconds];
- }
- var startTime = new Date();
- function uptime() {
- var currentTime = new Date();
- var dif = currentTime - startTime;
- return dif / 1000;
- }
- var process = {
- nextTick: nextTick,
- title: title,
- browser: browser,
- env: env,
- argv: argv,
- version: version,
- versions: versions,
- on: on,
- addListener: addListener,
- once: once,
- off: off,
- removeListener: removeListener,
- removeAllListeners: removeAllListeners,
- emit: emit,
- binding: binding,
- cwd: cwd,
- chdir: chdir,
- umask: umask,
- hrtime: hrtime,
- platform: platform,
- release: release,
- config: config,
- uptime: uptime
- };
- var ast = createCommonjsModule(function (module) {
- (function () {
- function isExpression(node) {
- if (node == null) {
- return false;
- }
- switch (node.type) {
- case 'ArrayExpression':
- case 'AssignmentExpression':
- case 'BinaryExpression':
- case 'CallExpression':
- case 'ConditionalExpression':
- case 'FunctionExpression':
- case 'Identifier':
- case 'Literal':
- case 'LogicalExpression':
- case 'MemberExpression':
- case 'NewExpression':
- case 'ObjectExpression':
- case 'SequenceExpression':
- case 'ThisExpression':
- case 'UnaryExpression':
- case 'UpdateExpression':
- return true;
- }
- return false;
- }
- function isIterationStatement(node) {
- if (node == null) {
- return false;
- }
- switch (node.type) {
- case 'DoWhileStatement':
- case 'ForInStatement':
- case 'ForStatement':
- case 'WhileStatement':
- return true;
- }
- return false;
- }
- function isStatement(node) {
- if (node == null) {
- return false;
- }
- switch (node.type) {
- case 'BlockStatement':
- case 'BreakStatement':
- case 'ContinueStatement':
- case 'DebuggerStatement':
- case 'DoWhileStatement':
- case 'EmptyStatement':
- case 'ExpressionStatement':
- case 'ForInStatement':
- case 'ForStatement':
- case 'IfStatement':
- case 'LabeledStatement':
- case 'ReturnStatement':
- case 'SwitchStatement':
- case 'ThrowStatement':
- case 'TryStatement':
- case 'VariableDeclaration':
- case 'WhileStatement':
- case 'WithStatement':
- return true;
- }
- return false;
- }
- function isSourceElement(node) {
- return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
- }
- function trailingStatement(node) {
- switch (node.type) {
- case 'IfStatement':
- if (node.alternate != null) {
- return node.alternate;
- }
- return node.consequent;
- case 'LabeledStatement':
- case 'ForStatement':
- case 'ForInStatement':
- case 'WhileStatement':
- case 'WithStatement':
- return node.body;
- }
- return null;
- }
- function isProblematicIfStatement(node) {
- var current;
- if (node.type !== 'IfStatement') {
- return false;
- }
- if (node.alternate == null) {
- return false;
- }
- current = node.consequent;
- do {
- if (current.type === 'IfStatement') {
- if (current.alternate == null) {
- return true;
- }
- }
- current = trailingStatement(current);
- } while (current);
- return false;
- }
- module.exports = {
- isExpression: isExpression,
- isStatement: isStatement,
- isIterationStatement: isIterationStatement,
- isSourceElement: isSourceElement,
- isProblematicIfStatement: isProblematicIfStatement,
- trailingStatement: trailingStatement
- };
- })();
- });
- var ast_1 = ast.isExpression;
- var ast_2 = ast.isStatement;
- var ast_3 = ast.isIterationStatement;
- var ast_4 = ast.isSourceElement;
- var ast_5 = ast.isProblematicIfStatement;
- var ast_6 = ast.trailingStatement;
- var code = createCommonjsModule(function (module) {
- (function () {
- var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
- ES5Regex = {
- NonAsciiIdentifierStart: /[\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\u08B6-\u08BD\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\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\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-\u1884\u1887-\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\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\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-\uA7AE\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]/,
- NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\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\u08B6-\u08BD\u08D4-\u08E1\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\u0C80-\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\u0D54-\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\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-\u19D9\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\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\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-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\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]/
- };
- ES6Regex = {
- NonAsciiIdentifierStart: /[\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\u08B6-\u08BD\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\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\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\u1C80-\u1C88\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-\uA7AE\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\uDCB0-\uDCD3\uDCD8-\uDCFB\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[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\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\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\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\uDD00-\uDD43]|\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]/,
- NonAsciiIdentifierPart: /[\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\u08B6-\u08BD\u08D4-\u08E1\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\u0C80-\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\u0D54-\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\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\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\uDCB0-\uDCD3\uDCD8-\uDCFB\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\uDE3E\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[\uDC00-\uDC4A\uDC50-\uDC59\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]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\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\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\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]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\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 isDecimalDigit(ch) {
- return 0x30 <= ch && ch <= 0x39;
- }
- function isHexDigit(ch) {
- return 0x30 <= ch && ch <= 0x39 || 0x61 <= ch && ch <= 0x66 || 0x41 <= ch && ch <= 0x46;
- }
- function isOctalDigit(ch) {
- return ch >= 0x30 && ch <= 0x37;
- }
- NON_ASCII_WHITESPACES = [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF];
- function isWhiteSpace(ch) {
- return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
- }
- function isLineTerminator(ch) {
- return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
- }
- function fromCodePoint(cp) {
- if (cp <= 0xFFFF) {
- return String.fromCharCode(cp);
- }
- var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
- var cu2 = String.fromCharCode((cp - 0x10000) % 0x400 + 0xDC00);
- return cu1 + cu2;
- }
- IDENTIFIER_START = new Array(0x80);
- for (ch = 0; ch < 0x80; ++ch) {
- IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || ch >= 0x41 && ch <= 0x5A || ch === 0x24 || ch === 0x5F;
- }
- IDENTIFIER_PART = new Array(0x80);
- for (ch = 0; ch < 0x80; ++ch) {
- IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || ch >= 0x41 && ch <= 0x5A || ch >= 0x30 && ch <= 0x39 || ch === 0x24 || ch === 0x5F;
- }
- function isIdentifierStartES5(ch) {
- return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
- }
- function isIdentifierPartES5(ch) {
- return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
- }
- function isIdentifierStartES6(ch) {
- return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
- }
- function isIdentifierPartES6(ch) {
- return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
- }
- module.exports = {
- isDecimalDigit: isDecimalDigit,
- isHexDigit: isHexDigit,
- isOctalDigit: isOctalDigit,
- isWhiteSpace: isWhiteSpace,
- isLineTerminator: isLineTerminator,
- isIdentifierStartES5: isIdentifierStartES5,
- isIdentifierPartES5: isIdentifierPartES5,
- isIdentifierStartES6: isIdentifierStartES6,
- isIdentifierPartES6: isIdentifierPartES6
- };
- })();
- });
- var code_1 = code.isDecimalDigit;
- var code_2 = code.isHexDigit;
- var code_3 = code.isOctalDigit;
- var code_4 = code.isWhiteSpace;
- var code_5 = code.isLineTerminator;
- var code_6 = code.isIdentifierStartES5;
- var code_7 = code.isIdentifierPartES5;
- var code_8 = code.isIdentifierStartES6;
- var code_9 = code.isIdentifierPartES6;
- var keyword = createCommonjsModule(function (module) {
- (function () {
- var code$1 = code;
- function isStrictModeReservedWordES6(id) {
- switch (id) {
- case 'implements':
- case 'interface':
- case 'package':
- case 'private':
- case 'protected':
- case 'public':
- case 'static':
- case 'let':
- return true;
- default:
- return false;
- }
- }
- function isKeywordES5(id, strict) {
- if (!strict && id === 'yield') {
- return false;
- }
- return isKeywordES6(id, strict);
- }
- function isKeywordES6(id, strict) {
- if (strict && isStrictModeReservedWordES6(id)) {
- return true;
- }
- switch (id.length) {
- case 2:
- return id === 'if' || id === 'in' || id === 'do';
- case 3:
- return id === 'var' || id === 'for' || id === 'new' || id === 'try';
- case 4:
- return id === 'this' || id === 'else' || id === 'case' || id === 'void' || id === 'with' || id === 'enum';
- case 5:
- return id === 'while' || id === 'break' || id === 'catch' || id === 'throw' || id === 'const' || id === 'yield' || id === 'class' || id === 'super';
- case 6:
- return id === 'return' || id === 'typeof' || id === 'delete' || id === 'switch' || id === 'export' || id === 'import';
- case 7:
- return id === 'default' || id === 'finally' || id === 'extends';
- case 8:
- return id === 'function' || id === 'continue' || id === 'debugger';
- case 10:
- return id === 'instanceof';
- default:
- return false;
- }
- }
- function isReservedWordES5(id, strict) {
- return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
- }
- function isReservedWordES6(id, strict) {
- return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
- }
- function isRestrictedWord(id) {
- return id === 'eval' || id === 'arguments';
- }
- function isIdentifierNameES5(id) {
- var i, iz, ch;
- if (id.length === 0) {
- return false;
- }
- ch = id.charCodeAt(0);
- if (!code$1.isIdentifierStartES5(ch)) {
- return false;
- }
- for (i = 1, iz = id.length; i < iz; ++i) {
- ch = id.charCodeAt(i);
- if (!code$1.isIdentifierPartES5(ch)) {
- return false;
- }
- }
- return true;
- }
- function decodeUtf16(lead, trail) {
- return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
- }
- function isIdentifierNameES6(id) {
- var i, iz, ch, lowCh, check;
- if (id.length === 0) {
- return false;
- }
- check = code$1.isIdentifierStartES6;
- for (i = 0, iz = id.length; i < iz; ++i) {
- ch = id.charCodeAt(i);
- if (0xD800 <= ch && ch <= 0xDBFF) {
- ++i;
- if (i >= iz) {
- return false;
- }
- lowCh = id.charCodeAt(i);
- if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
- return false;
- }
- ch = decodeUtf16(ch, lowCh);
- }
- if (!check(ch)) {
- return false;
- }
- check = code$1.isIdentifierPartES6;
- }
- return true;
- }
- function isIdentifierES5(id, strict) {
- return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
- }
- function isIdentifierES6(id, strict) {
- return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
- }
- module.exports = {
- isKeywordES5: isKeywordES5,
- isKeywordES6: isKeywordES6,
- isReservedWordES5: isReservedWordES5,
- isReservedWordES6: isReservedWordES6,
- isRestrictedWord: isRestrictedWord,
- isIdentifierNameES5: isIdentifierNameES5,
- isIdentifierNameES6: isIdentifierNameES6,
- isIdentifierES5: isIdentifierES5,
- isIdentifierES6: isIdentifierES6
- };
- })();
- });
- var keyword_1 = keyword.isKeywordES5;
- var keyword_2 = keyword.isKeywordES6;
- var keyword_3 = keyword.isReservedWordES5;
- var keyword_4 = keyword.isReservedWordES6;
- var keyword_5 = keyword.isRestrictedWord;
- var keyword_6 = keyword.isIdentifierNameES5;
- var keyword_7 = keyword.isIdentifierNameES6;
- var keyword_8 = keyword.isIdentifierES5;
- var keyword_9 = keyword.isIdentifierES6;
- var utils = createCommonjsModule(function (module, exports) {
- (function () {
- exports.ast = ast;
- exports.code = code;
- exports.keyword = keyword;
- })();
- });
- var utils_1 = utils.ast;
- var utils_2 = utils.code;
- var utils_3 = utils.keyword;
- function isType(nodeType, targetType) {
- if (nodeType === targetType) return true;
- if (ALIAS_KEYS[targetType]) return false;
- var aliases = FLIPPED_ALIAS_KEYS[targetType];
- if (aliases) {
- if (aliases[0] === nodeType) return true;
- for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var alias = _ref;
- if (nodeType === alias) return true;
- }
- }
- return false;
- }
- function isPlaceholderType(placeholderType, targetType) {
- if (placeholderType === targetType) return true;
- var aliases = PLACEHOLDERS_ALIAS[placeholderType];
- if (aliases) {
- for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var alias = _ref;
- if (targetType === alias) return true;
- }
- }
- return false;
- }
- function is(type, node, opts) {
- if (!node) return false;
- var matches = isType(node.type, type);
- if (!matches) {
- if (!opts && node.type === "Placeholder" && type in FLIPPED_ALIAS_KEYS) {
- return isPlaceholderType(node.expectedNode, type);
- }
- return false;
- }
- if (typeof opts === "undefined") {
- return true;
- } else {
- return shallowEqual(node, opts);
- }
- }
- var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
- var FLATTENABLE_KEYS = ["body", "expressions"];
- var FOR_INIT_KEYS = ["left", "init"];
- var COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
- var LOGICAL_OPERATORS = ["||", "&&", "??"];
- var UPDATE_OPERATORS = ["++", "--"];
- var BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
- var EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
- var COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]);
- var BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS);
- var NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
- var BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS);
- var ASSIGNMENT_OPERATORS = ["=", "+="].concat(NUMBER_BINARY_OPERATORS.map(function (op) {
- return op + "=";
- }));
- var BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
- var NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
- var STRING_UNARY_OPERATORS = ["typeof"];
- var UNARY_OPERATORS = ["void", "throw"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS);
- var INHERIT_KEYS = {
- optional: ["typeAnnotation", "typeParameters", "returnType"],
- force: ["start", "loc", "end"]
- };
- var BLOCK_SCOPED_SYMBOL = Symbol["for"]("var used to be block scoped");
- var NOT_LOCAL_BINDING = Symbol["for"]("should not be considered a local binding");
- function validate(node, key, val) {
- if (!node) return;
- var fields = NODE_FIELDS[node.type];
- if (!fields) return;
- var field = fields[key];
- validateField(node, key, val, field);
- validateChild(node, key, val);
- }
- function validateField(node, key, val, field) {
- if (!field || !field.validate) return;
- if (field.optional && val == null) return;
- field.validate(node, key, val);
- }
- function validateChild(node, key, val) {
- if (val == null) return;
- var validate = NODE_PARENT_VALIDATIONS[val.type];
- if (!validate) return;
- validate(node, key, val);
- }
- var VISITOR_KEYS = {};
- var ALIAS_KEYS = {};
- var FLIPPED_ALIAS_KEYS = {};
- var NODE_FIELDS = {};
- var BUILDER_KEYS = {};
- var DEPRECATED_KEYS = {};
- var NODE_PARENT_VALIDATIONS = {};
- function getType(val) {
- if (Array.isArray(val)) {
- return "array";
- } else if (val === null) {
- return "null";
- } else {
- return typeof val;
- }
- }
- function validate$1(validate) {
- return {
- validate: validate
- };
- }
- function typeIs(typeName) {
- return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType.apply(void 0, typeName);
- }
- function validateType(typeName) {
- return validate$1(typeIs(typeName));
- }
- function validateOptional(validate) {
- return {
- validate: validate,
- optional: true
- };
- }
- function validateOptionalType(typeName) {
- return {
- validate: typeIs(typeName),
- optional: true
- };
- }
- function arrayOf(elementType) {
- return chain(assertValueType("array"), assertEach(elementType));
- }
- function arrayOfType(typeName) {
- return arrayOf(typeIs(typeName));
- }
- function validateArrayOfType(typeName) {
- return validate$1(arrayOfType(typeName));
- }
- function assertEach(callback) {
- function validator(node, key, val) {
- if (!Array.isArray(val)) return;
- for (var i = 0; i < val.length; i++) {
- var subkey = key + "[" + i + "]";
- var v = val[i];
- callback(node, subkey, v);
- if (process.env.BABEL_TYPES_8_BREAKING) validateChild(node, subkey, v);
- }
- }
- validator.each = callback;
- return validator;
- }
- function assertOneOf() {
- for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
- values[_key] = arguments[_key];
- }
- function validate(node, key, val) {
- if (values.indexOf(val) < 0) {
- throw new TypeError("Property " + key + " expected value to be one of " + JSON.stringify(values) + " but got " + JSON.stringify(val));
- }
- }
- validate.oneOf = values;
- return validate;
- }
- function assertNodeType() {
- for (var _len2 = arguments.length, types = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- types[_key2] = arguments[_key2];
- }
- function validate(node, key, val) {
- for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var type = _ref;
- if (is(type, val)) {
- validateChild(node, key, val);
- return;
- }
- }
- throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " but instead got " + JSON.stringify(val && val.type));
- }
- validate.oneOfNodeTypes = types;
- return validate;
- }
- function assertNodeOrValueType() {
- for (var _len3 = arguments.length, types = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- types[_key3] = arguments[_key3];
- }
- function validate(node, key, val) {
- for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var type = _ref2;
- if (getType(val) === type || is(type, val)) {
- validateChild(node, key, val);
- return;
- }
- }
- throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " but instead got " + JSON.stringify(val && val.type));
- }
- validate.oneOfNodeOrValueTypes = types;
- return validate;
- }
- function assertValueType(type) {
- function validate(node, key, val) {
- var valid = getType(val) === type;
- if (!valid) {
- throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
- }
- }
- validate.type = type;
- return validate;
- }
- function assertShape(shape) {
- function validate(node, key, val) {
- var errors = [];
- for (var _i3 = 0, _Object$keys = Object.keys(shape); _i3 < _Object$keys.length; _i3++) {
- var property = _Object$keys[_i3];
- try {
- validateField(node, property, val[property], shape[property]);
- } catch (error) {
- if (error instanceof TypeError) {
- errors.push(error.message);
- continue;
- }
- throw error;
- }
- }
- if (errors.length) {
- throw new TypeError("Property " + key + " of " + node.type + " expected to have the following:\n" + errors.join("\n"));
- }
- }
- validate.shapeOf = shape;
- return validate;
- }
- function chain() {
- for (var _len4 = arguments.length, fns = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- fns[_key4] = arguments[_key4];
- }
- function validate() {
- for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i4 >= _iterator3.length) break;
- _ref3 = _iterator3[_i4++];
- } else {
- _i4 = _iterator3.next();
- if (_i4.done) break;
- _ref3 = _i4.value;
- }
- var fn = _ref3;
- fn.apply(void 0, arguments);
- }
- }
- validate.chainOf = fns;
- return validate;
- }
- var validTypeOpts = ["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"];
- var validFieldKeys = ["default", "optional", "validate"];
- function defineType(type, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var inherits = opts.inherits && store[opts.inherits] || {};
- var fields = opts.fields;
- if (!fields) {
- fields = {};
- if (inherits.fields) {
- var keys = Object.getOwnPropertyNames(inherits.fields);
- for (var _i5 = 0, _arr = keys; _i5 < _arr.length; _i5++) {
- var key = _arr[_i5];
- var field = inherits.fields[key];
- fields[key] = {
- "default": field["default"],
- optional: field.optional,
- validate: field.validate
- };
- }
- }
- }
- var visitor = opts.visitor || inherits.visitor || [];
- var aliases = opts.aliases || inherits.aliases || [];
- var builder = opts.builder || inherits.builder || opts.visitor || [];
- for (var _i6 = 0, _arr2 = Object.keys(opts); _i6 < _arr2.length; _i6++) {
- var k = _arr2[_i6];
- if (validTypeOpts.indexOf(k) === -1) {
- throw new Error("Unknown type option \"" + k + "\" on " + type);
- }
- }
- if (opts.deprecatedAlias) {
- DEPRECATED_KEYS[opts.deprecatedAlias] = type;
- }
- for (var _i7 = 0, _arr3 = visitor.concat(builder); _i7 < _arr3.length; _i7++) {
- var _key5 = _arr3[_i7];
- fields[_key5] = fields[_key5] || {};
- }
- for (var _i8 = 0, _Object$keys2 = Object.keys(fields); _i8 < _Object$keys2.length; _i8++) {
- var _key6 = _Object$keys2[_i8];
- var _field = fields[_key6];
- if (_field["default"] !== undefined && builder.indexOf(_key6) === -1) {
- _field.optional = true;
- }
- if (_field["default"] === undefined) {
- _field["default"] = null;
- } else if (!_field.validate && _field["default"] != null) {
- _field.validate = assertValueType(getType(_field["default"]));
- }
- for (var _i9 = 0, _arr4 = Object.keys(_field); _i9 < _arr4.length; _i9++) {
- var _k = _arr4[_i9];
- if (validFieldKeys.indexOf(_k) === -1) {
- throw new Error("Unknown field key \"" + _k + "\" on " + type + "." + _key6);
- }
- }
- }
- VISITOR_KEYS[type] = opts.visitor = visitor;
- BUILDER_KEYS[type] = opts.builder = builder;
- NODE_FIELDS[type] = opts.fields = fields;
- ALIAS_KEYS[type] = opts.aliases = aliases;
- aliases.forEach(function (alias) {
- FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
- FLIPPED_ALIAS_KEYS[alias].push(type);
- });
- if (opts.validate) {
- NODE_PARENT_VALIDATIONS[type] = opts.validate;
- }
- store[type] = opts;
- }
- var store = {};
- defineType("ArrayExpression", {
- fields: {
- elements: {
- validate: chain(assertValueType("array"), assertEach(assertNodeOrValueType("null", "Expression", "SpreadElement"))),
- "default": !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined
- }
- },
- visitor: ["elements"],
- aliases: ["Expression"]
- });
- defineType("AssignmentExpression", {
- fields: {
- operator: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return assertValueType("string");
- }
- var identifier = assertOneOf.apply(void 0, ASSIGNMENT_OPERATORS);
- var pattern = assertOneOf("=");
- return function (node, key, val) {
- var validator = is("Pattern", node.left) ? pattern : identifier;
- validator(node, key, val);
- };
- }()
- },
- left: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? assertNodeType("LVal") : assertNodeType("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
- },
- right: {
- validate: assertNodeType("Expression")
- }
- },
- builder: ["operator", "left", "right"],
- visitor: ["left", "right"],
- aliases: ["Expression"]
- });
- defineType("BinaryExpression", {
- builder: ["operator", "left", "right"],
- fields: {
- operator: {
- validate: assertOneOf.apply(void 0, BINARY_OPERATORS)
- },
- left: {
- validate: assertNodeType("Expression")
- },
- right: {
- validate: assertNodeType("Expression")
- }
- },
- visitor: ["left", "right"],
- aliases: ["Binary", "Expression"]
- });
- defineType("InterpreterDirective", {
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("string")
- }
- }
- });
- defineType("Directive", {
- visitor: ["value"],
- fields: {
- value: {
- validate: assertNodeType("DirectiveLiteral")
- }
- }
- });
- defineType("DirectiveLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("string")
- }
- }
- });
- defineType("BlockStatement", {
- builder: ["body", "directives"],
- visitor: ["directives", "body"],
- fields: {
- directives: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Directive"))),
- "default": []
- },
- body: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Statement")))
- }
- },
- aliases: ["Scopable", "BlockParent", "Block", "Statement"]
- });
- defineType("BreakStatement", {
- visitor: ["label"],
- fields: {
- label: {
- validate: assertNodeType("Identifier"),
- optional: true
- }
- },
- aliases: ["Statement", "Terminatorless", "CompletionStatement"]
- });
- defineType("CallExpression", {
- visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
- builder: ["callee", "arguments"],
- aliases: ["Expression"],
- fields: Object.assign({
- callee: {
- validate: assertNodeType("Expression", "V8IntrinsicIdentifier")
- },
- arguments: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Expression", "SpreadElement", "JSXNamespacedName", "ArgumentPlaceholder")))
- }
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- optional: {
- validate: assertOneOf(true, false),
- optional: true
- }
- } : {}, {
- typeArguments: {
- validate: assertNodeType("TypeParameterInstantiation"),
- optional: true
- },
- typeParameters: {
- validate: assertNodeType("TSTypeParameterInstantiation"),
- optional: true
- }
- })
- });
- defineType("CatchClause", {
- visitor: ["param", "body"],
- fields: {
- param: {
- validate: assertNodeType("Identifier", "ArrayPattern", "ObjectPattern"),
- optional: true
- },
- body: {
- validate: assertNodeType("BlockStatement")
- }
- },
- aliases: ["Scopable", "BlockParent"]
- });
- defineType("ConditionalExpression", {
- visitor: ["test", "consequent", "alternate"],
- fields: {
- test: {
- validate: assertNodeType("Expression")
- },
- consequent: {
- validate: assertNodeType("Expression")
- },
- alternate: {
- validate: assertNodeType("Expression")
- }
- },
- aliases: ["Expression", "Conditional"]
- });
- defineType("ContinueStatement", {
- visitor: ["label"],
- fields: {
- label: {
- validate: assertNodeType("Identifier"),
- optional: true
- }
- },
- aliases: ["Statement", "Terminatorless", "CompletionStatement"]
- });
- defineType("DebuggerStatement", {
- aliases: ["Statement"]
- });
- defineType("DoWhileStatement", {
- visitor: ["test", "body"],
- fields: {
- test: {
- validate: assertNodeType("Expression")
- },
- body: {
- validate: assertNodeType("Statement")
- }
- },
- aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
- });
- defineType("EmptyStatement", {
- aliases: ["Statement"]
- });
- defineType("ExpressionStatement", {
- visitor: ["expression"],
- fields: {
- expression: {
- validate: assertNodeType("Expression")
- }
- },
- aliases: ["Statement", "ExpressionWrapper"]
- });
- defineType("File", {
- builder: ["program", "comments", "tokens"],
- visitor: ["program"],
- fields: {
- program: {
- validate: assertNodeType("Program")
- }
- }
- });
- defineType("ForInStatement", {
- visitor: ["left", "right", "body"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
- fields: {
- left: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? assertNodeType("VariableDeclaration", "LVal") : assertNodeType("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern")
- },
- right: {
- validate: assertNodeType("Expression")
- },
- body: {
- validate: assertNodeType("Statement")
- }
- }
- });
- defineType("ForStatement", {
- visitor: ["init", "test", "update", "body"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
- fields: {
- init: {
- validate: assertNodeType("VariableDeclaration", "Expression"),
- optional: true
- },
- test: {
- validate: assertNodeType("Expression"),
- optional: true
- },
- update: {
- validate: assertNodeType("Expression"),
- optional: true
- },
- body: {
- validate: assertNodeType("Statement")
- }
- }
- });
- var functionCommon = {
- params: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Identifier", "Pattern", "RestElement", "TSParameterProperty")))
- },
- generator: {
- "default": false
- },
- async: {
- "default": false
- }
- };
- var functionTypeAnnotationCommon = {
- returnType: {
- validate: assertNodeType("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- typeParameters: {
- validate: assertNodeType("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
- optional: true
- }
- };
- var functionDeclarationCommon = Object.assign({}, functionCommon, {
- declare: {
- validate: assertValueType("boolean"),
- optional: true
- },
- id: {
- validate: assertNodeType("Identifier"),
- optional: true
- }
- });
- defineType("FunctionDeclaration", {
- builder: ["id", "params", "body", "generator", "async"],
- visitor: ["id", "params", "body", "returnType", "typeParameters"],
- fields: Object.assign({}, functionDeclarationCommon, {}, functionTypeAnnotationCommon, {
- body: {
- validate: assertNodeType("BlockStatement")
- }
- }),
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"],
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) return function () {};
- var identifier = assertNodeType("Identifier");
- return function (parent, key, node) {
- if (!is("ExportDefaultDeclaration", parent)) {
- identifier(node, "id", node.id);
- }
- };
- }()
- });
- defineType("FunctionExpression", {
- inherits: "FunctionDeclaration",
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
- fields: Object.assign({}, functionCommon, {}, functionTypeAnnotationCommon, {
- id: {
- validate: assertNodeType("Identifier"),
- optional: true
- },
- body: {
- validate: assertNodeType("BlockStatement")
- }
- })
- });
- var patternLikeCommon = {
- typeAnnotation: {
- validate: assertNodeType("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator")))
- }
- };
- defineType("Identifier", {
- builder: ["name"],
- visitor: ["typeAnnotation", "decorators"],
- aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
- fields: Object.assign({}, patternLikeCommon, {
- name: {
- validate: chain(assertValueType("string"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!utils.keyword.isIdentifierNameES6(val)) {
- throw new TypeError("\"" + val + "\" is not a valid identifier name");
- }
- })
- },
- optional: {
- validate: assertValueType("boolean"),
- optional: true
- }
- }),
- validate: function validate(parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- var match = /\.(\w+)$/.exec(key);
- if (!match) return;
- var parentKey = match[1];
- var nonComp = {
- computed: false
- };
- if (parentKey === "property") {
- if (is("MemberExpression", parent, nonComp)) return;
- if (is("OptionalMemberExpression", parent, nonComp)) return;
- } else if (parentKey === "key") {
- if (is("Property", parent, nonComp)) return;
- if (is("Method", parent, nonComp)) return;
- } else if (parentKey === "exported") {
- if (is("ExportSpecifier", parent)) return;
- } else if (parentKey === "imported") {
- if (is("ImportSpecifier", parent, {
- imported: node
- })) return;
- } else if (parentKey === "meta") {
- if (is("MetaProperty", parent, {
- meta: node
- })) return;
- }
- if (utils.keyword.isReservedWordES6(node.name, false) && node.name !== "this") {
- throw new TypeError("\"" + node.name + "\" is not a valid identifer");
- }
- }
- });
- defineType("IfStatement", {
- visitor: ["test", "consequent", "alternate"],
- aliases: ["Statement", "Conditional"],
- fields: {
- test: {
- validate: assertNodeType("Expression")
- },
- consequent: {
- validate: assertNodeType("Statement")
- },
- alternate: {
- optional: true,
- validate: assertNodeType("Statement")
- }
- }
- });
- defineType("LabeledStatement", {
- visitor: ["label", "body"],
- aliases: ["Statement"],
- fields: {
- label: {
- validate: assertNodeType("Identifier")
- },
- body: {
- validate: assertNodeType("Statement")
- }
- }
- });
- defineType("StringLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("string")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- defineType("NumericLiteral", {
- builder: ["value"],
- deprecatedAlias: "NumberLiteral",
- fields: {
- value: {
- validate: assertValueType("number")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- defineType("NullLiteral", {
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- defineType("BooleanLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("boolean")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- defineType("RegExpLiteral", {
- builder: ["pattern", "flags"],
- deprecatedAlias: "RegexLiteral",
- aliases: ["Expression", "Literal"],
- fields: {
- pattern: {
- validate: assertValueType("string")
- },
- flags: {
- validate: chain(assertValueType("string"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- var invalid = /[^gimsuy]/.exec(val);
- if (invalid) {
- throw new TypeError("\"" + invalid[0] + "\" is not a valid RegExp flag");
- }
- }),
- "default": ""
- }
- }
- });
- defineType("LogicalExpression", {
- builder: ["operator", "left", "right"],
- visitor: ["left", "right"],
- aliases: ["Binary", "Expression"],
- fields: {
- operator: {
- validate: assertOneOf.apply(void 0, LOGICAL_OPERATORS)
- },
- left: {
- validate: assertNodeType("Expression")
- },
- right: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("MemberExpression", {
- builder: ["object", "property", "computed", "optional"],
- visitor: ["object", "property"],
- aliases: ["Expression", "LVal"],
- fields: Object.assign({
- object: {
- validate: assertNodeType("Expression")
- },
- property: {
- validate: function () {
- var normal = assertNodeType("Identifier", "PrivateName");
- var computed = assertNodeType("Expression");
- return function (node, key, val) {
- var validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }()
- },
- computed: {
- "default": false
- }
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- optional: {
- validate: assertOneOf(true, false),
- optional: true
- }
- } : {})
- });
- defineType("NewExpression", {
- inherits: "CallExpression"
- });
- defineType("Program", {
- visitor: ["directives", "body"],
- builder: ["body", "directives", "sourceType", "interpreter"],
- fields: {
- sourceFile: {
- validate: assertValueType("string")
- },
- sourceType: {
- validate: assertOneOf("script", "module"),
- "default": "script"
- },
- interpreter: {
- validate: assertNodeType("InterpreterDirective"),
- "default": null,
- optional: true
- },
- directives: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Directive"))),
- "default": []
- },
- body: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Statement")))
- }
- },
- aliases: ["Scopable", "BlockParent", "Block"]
- });
- defineType("ObjectExpression", {
- visitor: ["properties"],
- aliases: ["Expression"],
- fields: {
- properties: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("ObjectMethod", "ObjectProperty", "SpreadElement")))
- }
- }
- });
- defineType("ObjectMethod", {
- builder: ["kind", "key", "params", "body", "computed", "generator", "async"],
- fields: Object.assign({}, functionCommon, {}, functionTypeAnnotationCommon, {
- kind: Object.assign({
- validate: assertOneOf("method", "get", "set")
- }, !process.env.BABEL_TYPES_8_BREAKING ? {
- "default": "method"
- } : {}),
- computed: {
- "default": false
- },
- key: {
- validate: function () {
- var normal = assertNodeType("Identifier", "StringLiteral", "NumericLiteral");
- var computed = assertNodeType("Expression");
- return function (node, key, val) {
- var validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }()
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- },
- body: {
- validate: assertNodeType("BlockStatement")
- }
- }),
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
- });
- defineType("ObjectProperty", {
- builder: ["key", "value", "computed", "shorthand"].concat(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : []),
- fields: {
- computed: {
- "default": false
- },
- key: {
- validate: function () {
- var normal = assertNodeType("Identifier", "StringLiteral", "NumericLiteral");
- var computed = assertNodeType("Expression");
- return function (node, key, val) {
- var validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }()
- },
- value: {
- validate: assertNodeType("Expression", "PatternLike")
- },
- shorthand: {
- validate: chain(assertValueType("boolean"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.computed) {
- throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true");
- }
- }, function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && !is("Identifier", node.key)) {
- throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier");
- }
- }),
- "default": false
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- },
- visitor: ["key", "value", "decorators"],
- aliases: ["UserWhitespacable", "Property", "ObjectMember"],
- validate: function () {
- var pattern = assertNodeType("Identifier", "Pattern");
- var expression = assertNodeType("Expression");
- return function (parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- var validator = is("ObjectPattern", parent) ? pattern : expression;
- validator(node, "value", node.value);
- };
- }()
- });
- defineType("RestElement", {
- visitor: ["argument", "typeAnnotation"],
- builder: ["argument"],
- aliases: ["LVal", "PatternLike"],
- deprecatedAlias: "RestProperty",
- fields: Object.assign({}, patternLikeCommon, {
- argument: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? assertNodeType("LVal") : assertNodeType("Identifier", "Pattern", "MemberExpression")
- }
- }),
- validate: function validate(parent, key) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- var match = /(\w+)\[(\d+)\]/.exec(key);
- if (!match) throw new Error("Internal Babel error: malformed key.");
- var listKey = match[1],
- index = match[2];
- if (parent[listKey].length > index + 1) {
- throw new TypeError("RestElement must be last element of " + listKey);
- }
- }
- });
- defineType("ReturnStatement", {
- visitor: ["argument"],
- aliases: ["Statement", "Terminatorless", "CompletionStatement"],
- fields: {
- argument: {
- validate: assertNodeType("Expression"),
- optional: true
- }
- }
- });
- defineType("SequenceExpression", {
- visitor: ["expressions"],
- fields: {
- expressions: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Expression")))
- }
- },
- aliases: ["Expression"]
- });
- defineType("ParenthesizedExpression", {
- visitor: ["expression"],
- aliases: ["Expression", "ExpressionWrapper"],
- fields: {
- expression: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("SwitchCase", {
- visitor: ["test", "consequent"],
- fields: {
- test: {
- validate: assertNodeType("Expression"),
- optional: true
- },
- consequent: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Statement")))
- }
- }
- });
- defineType("SwitchStatement", {
- visitor: ["discriminant", "cases"],
- aliases: ["Statement", "BlockParent", "Scopable"],
- fields: {
- discriminant: {
- validate: assertNodeType("Expression")
- },
- cases: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("SwitchCase")))
- }
- }
- });
- defineType("ThisExpression", {
- aliases: ["Expression"]
- });
- defineType("ThrowStatement", {
- visitor: ["argument"],
- aliases: ["Statement", "Terminatorless", "CompletionStatement"],
- fields: {
- argument: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("TryStatement", {
- visitor: ["block", "handler", "finalizer"],
- aliases: ["Statement"],
- fields: {
- block: {
- validate: chain(assertNodeType("BlockStatement"), function (node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!node.handler && !node.finalizer) {
- throw new TypeError("TryStatement expects either a handler or finalizer, or both");
- }
- })
- },
- handler: {
- optional: true,
- validate: assertNodeType("CatchClause")
- },
- finalizer: {
- optional: true,
- validate: assertNodeType("BlockStatement")
- }
- }
- });
- defineType("UnaryExpression", {
- builder: ["operator", "argument", "prefix"],
- fields: {
- prefix: {
- "default": true
- },
- argument: {
- validate: assertNodeType("Expression")
- },
- operator: {
- validate: assertOneOf.apply(void 0, UNARY_OPERATORS)
- }
- },
- visitor: ["argument"],
- aliases: ["UnaryLike", "Expression"]
- });
- defineType("UpdateExpression", {
- builder: ["operator", "argument", "prefix"],
- fields: {
- prefix: {
- "default": false
- },
- argument: {
- validate: !process.env.BABEL_TYPES_8_BREAKING ? assertNodeType("Expression") : assertNodeType("Identifier", "MemberExpression")
- },
- operator: {
- validate: assertOneOf.apply(void 0, UPDATE_OPERATORS)
- }
- },
- visitor: ["argument"],
- aliases: ["Expression"]
- });
- defineType("VariableDeclaration", {
- builder: ["kind", "declarations"],
- visitor: ["declarations"],
- aliases: ["Statement", "Declaration"],
- fields: {
- declare: {
- validate: assertValueType("boolean"),
- optional: true
- },
- kind: {
- validate: assertOneOf("var", "let", "const")
- },
- declarations: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("VariableDeclarator")))
- }
- },
- validate: function validate(parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!is("ForXStatement", parent, {
- left: node
- })) return;
- if (node.declarations.length !== 1) {
- throw new TypeError("Exactly one VariableDeclarator is required in the VariableDeclaration of a " + parent.type);
- }
- }
- });
- defineType("VariableDeclarator", {
- visitor: ["id", "init"],
- fields: {
- id: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return assertNodeType("LVal");
- }
- var normal = assertNodeType("Identifier", "ArrayPattern", "ObjectPattern");
- var without = assertNodeType("Identifier");
- return function (node, key, val) {
- var validator = node.init ? normal : without;
- validator(node, key, val);
- };
- }()
- },
- definite: {
- optional: true,
- validate: assertValueType("boolean")
- },
- init: {
- optional: true,
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("WhileStatement", {
- visitor: ["test", "body"],
- aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
- fields: {
- test: {
- validate: assertNodeType("Expression")
- },
- body: {
- validate: assertNodeType("Statement")
- }
- }
- });
- defineType("WithStatement", {
- visitor: ["object", "body"],
- aliases: ["Statement"],
- fields: {
- object: {
- validate: assertNodeType("Expression")
- },
- body: {
- validate: assertNodeType("Statement")
- }
- }
- });
- defineType("AssignmentPattern", {
- visitor: ["left", "right", "decorators"],
- builder: ["left", "right"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- left: {
- validate: assertNodeType("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression")
- },
- right: {
- validate: assertNodeType("Expression")
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- })
- });
- defineType("ArrayPattern", {
- visitor: ["elements", "typeAnnotation"],
- builder: ["elements"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- elements: {
- validate: chain(assertValueType("array"), assertEach(assertNodeOrValueType("null", "PatternLike")))
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- })
- });
- defineType("ArrowFunctionExpression", {
- builder: ["params", "body", "async"],
- visitor: ["params", "body", "returnType", "typeParameters"],
- aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
- fields: Object.assign({}, functionCommon, {}, functionTypeAnnotationCommon, {
- expression: {
- validate: assertValueType("boolean")
- },
- body: {
- validate: assertNodeType("BlockStatement", "Expression")
- }
- })
- });
- defineType("ClassBody", {
- visitor: ["body"],
- fields: {
- body: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
- }
- }
- });
- defineType("ClassExpression", {
- builder: ["id", "superClass", "body", "decorators"],
- visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
- aliases: ["Scopable", "Class", "Expression", "Pureish"],
- fields: {
- id: {
- validate: assertNodeType("Identifier"),
- optional: true
- },
- typeParameters: {
- validate: assertNodeType("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
- optional: true
- },
- body: {
- validate: assertNodeType("ClassBody")
- },
- superClass: {
- optional: true,
- validate: assertNodeType("Expression")
- },
- superTypeParameters: {
- validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- },
- "implements": {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("TSExpressionWithTypeArguments", "ClassImplements"))),
- optional: true
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- }
- });
- defineType("ClassDeclaration", {
- inherits: "ClassExpression",
- aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
- fields: {
- declare: {
- validate: assertValueType("boolean"),
- optional: true
- },
- "abstract": {
- validate: assertValueType("boolean"),
- optional: true
- }
- },
- validate: function () {
- var identifier = assertNodeType("Identifier");
- return function (parent, key, node) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (!is("ExportDefaultDeclaration", parent)) {
- identifier(node, "id", node.id);
- }
- };
- }()
- });
- defineType("ExportAllDeclaration", {
- visitor: ["source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- source: {
- validate: assertNodeType("StringLiteral")
- }
- }
- });
- defineType("ExportDefaultDeclaration", {
- visitor: ["declaration"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- validate: assertNodeType("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
- }
- }
- });
- defineType("ExportNamedDeclaration", {
- visitor: ["declaration", "specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
- fields: {
- declaration: {
- optional: true,
- validate: chain(assertNodeType("Declaration"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.specifiers.length) {
- throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
- }
- }, function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && node.source) {
- throw new TypeError("Cannot export a declaration from a source");
- }
- })
- },
- specifiers: {
- "default": [],
- validate: chain(assertValueType("array"), assertEach(function () {
- var sourced = assertNodeType("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier");
- var sourceless = assertNodeType("ExportSpecifier");
- if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;
- return function (node, key, val) {
- var validator = node.source ? sourced : sourceless;
- validator(node, key, val);
- };
- }()))
- },
- source: {
- validate: assertNodeType("StringLiteral"),
- optional: true
- },
- exportKind: validateOptional(assertOneOf("type", "value"))
- }
- });
- defineType("ExportSpecifier", {
- visitor: ["local", "exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: assertNodeType("Identifier")
- },
- exported: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("ForOfStatement", {
- visitor: ["left", "right", "body"],
- builder: ["left", "right", "body", "await"],
- aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
- fields: {
- left: {
- validate: function () {
- if (!process.env.BABEL_TYPES_8_BREAKING) {
- return assertNodeType("VariableDeclaration", "LVal");
- }
- var declaration = assertNodeType("VariableDeclaration");
- var lval = assertNodeType("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern");
- return function (node, key, val) {
- if (is("VariableDeclaration", val)) {
- declaration(node, key, val);
- } else {
- lval(node, key, val);
- }
- };
- }()
- },
- right: {
- validate: assertNodeType("Expression")
- },
- body: {
- validate: assertNodeType("Statement")
- },
- "await": {
- "default": false
- }
- }
- });
- defineType("ImportDeclaration", {
- visitor: ["specifiers", "source"],
- aliases: ["Statement", "Declaration", "ModuleDeclaration"],
- fields: {
- specifiers: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
- },
- source: {
- validate: assertNodeType("StringLiteral")
- },
- importKind: {
- validate: assertOneOf("type", "typeof", "value"),
- optional: true
- }
- }
- });
- defineType("ImportDefaultSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("ImportNamespaceSpecifier", {
- visitor: ["local"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("ImportSpecifier", {
- visitor: ["local", "imported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- local: {
- validate: assertNodeType("Identifier")
- },
- imported: {
- validate: assertNodeType("Identifier")
- },
- importKind: {
- validate: assertOneOf("type", "typeof"),
- optional: true
- }
- }
- });
- defineType("MetaProperty", {
- visitor: ["meta", "property"],
- aliases: ["Expression"],
- fields: {
- meta: {
- validate: chain(assertNodeType("Identifier"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- var property;
- switch (val.name) {
- case "function":
- property = "sent";
- break;
- case "new":
- property = "target";
- break;
- case "import":
- property = "meta";
- break;
- }
- if (!is("Identifier", node.property, {
- name: property
- })) {
- throw new TypeError("Unrecognised MetaProperty");
- }
- })
- },
- property: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- var classMethodOrPropertyCommon = {
- "abstract": {
- validate: assertValueType("boolean"),
- optional: true
- },
- accessibility: {
- validate: assertOneOf("public", "private", "protected"),
- optional: true
- },
- "static": {
- "default": false
- },
- computed: {
- "default": false
- },
- optional: {
- validate: assertValueType("boolean"),
- optional: true
- },
- key: {
- validate: chain(function () {
- var normal = assertNodeType("Identifier", "StringLiteral", "NumericLiteral");
- var computed = assertNodeType("Expression");
- return function (node, key, val) {
- var validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }(), assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
- }
- };
- var classMethodOrDeclareMethodCommon = Object.assign({}, functionCommon, {}, classMethodOrPropertyCommon, {
- kind: {
- validate: assertOneOf("get", "set", "method", "constructor"),
- "default": "method"
- },
- access: {
- validate: chain(assertValueType("string"), assertOneOf("public", "private", "protected")),
- optional: true
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- });
- defineType("ClassMethod", {
- aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
- builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"],
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- fields: Object.assign({}, classMethodOrDeclareMethodCommon, {}, functionTypeAnnotationCommon, {
- body: {
- validate: assertNodeType("BlockStatement")
- }
- })
- });
- defineType("ObjectPattern", {
- visitor: ["properties", "typeAnnotation", "decorators"],
- builder: ["properties"],
- aliases: ["Pattern", "PatternLike", "LVal"],
- fields: Object.assign({}, patternLikeCommon, {
- properties: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("RestElement", "ObjectProperty")))
- }
- })
- });
- defineType("SpreadElement", {
- visitor: ["argument"],
- aliases: ["UnaryLike"],
- deprecatedAlias: "SpreadProperty",
- fields: {
- argument: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("Super", {
- aliases: ["Expression"]
- });
- defineType("TaggedTemplateExpression", {
- visitor: ["tag", "quasi"],
- aliases: ["Expression"],
- fields: {
- tag: {
- validate: assertNodeType("Expression")
- },
- quasi: {
- validate: assertNodeType("TemplateLiteral")
- },
- typeParameters: {
- validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- defineType("TemplateElement", {
- builder: ["value", "tail"],
- fields: {
- value: {
- validate: assertShape({
- raw: {
- validate: assertValueType("string")
- },
- cooked: {
- validate: assertValueType("string"),
- optional: true
- }
- })
- },
- tail: {
- "default": false
- }
- }
- });
- defineType("TemplateLiteral", {
- visitor: ["quasis", "expressions"],
- aliases: ["Expression", "Literal"],
- fields: {
- quasis: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("TemplateElement")))
- },
- expressions: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Expression")), function (node, key, val) {
- if (node.quasis.length !== val.length + 1) {
- throw new TypeError("Number of " + node.type + " quasis should be exactly one more than the number of expressions.\nExpected " + (val.length + 1) + " quasis but got " + node.quasis.length);
- }
- })
- }
- }
- });
- defineType("YieldExpression", {
- builder: ["argument", "delegate"],
- visitor: ["argument"],
- aliases: ["Expression", "Terminatorless"],
- fields: {
- delegate: {
- validate: chain(assertValueType("boolean"), function (node, key, val) {
- if (!process.env.BABEL_TYPES_8_BREAKING) return;
- if (val && !node.argument) {
- throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument");
- }
- }),
- "default": false
- },
- argument: {
- optional: true,
- validate: assertNodeType("Expression")
- }
- }
- });
- var defineInterfaceishType = function defineInterfaceishType(name, typeParameterType) {
- if (typeParameterType === void 0) {
- typeParameterType = "TypeParameterDeclaration";
- }
- defineType(name, {
- builder: ["id", "typeParameters", "extends", "body"],
- visitor: ["id", "typeParameters", "extends", "mixins", "implements", "body"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType(typeParameterType),
- "extends": validateOptional(arrayOfType("InterfaceExtends")),
- mixins: validateOptional(arrayOfType("InterfaceExtends")),
- "implements": validateOptional(arrayOfType("ClassImplements")),
- body: validateType("ObjectTypeAnnotation")
- }
- });
- };
- defineType("AnyTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("ArrayTypeAnnotation", {
- visitor: ["elementType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- elementType: validateType("FlowType")
- }
- });
- defineType("BooleanTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("BooleanLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: validate$1(assertValueType("boolean"))
- }
- });
- defineType("NullLiteralTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("ClassImplements", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TypeParameterInstantiation")
- }
- });
- defineInterfaceishType("DeclareClass");
- defineType("DeclareFunction", {
- visitor: ["id"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- predicate: validateOptionalType("DeclaredPredicate")
- }
- });
- defineInterfaceishType("DeclareInterface");
- defineType("DeclareModule", {
- builder: ["id", "body", "kind"],
- visitor: ["id", "body"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType(["Identifier", "StringLiteral"]),
- body: validateType("BlockStatement"),
- kind: validateOptional(assertOneOf("CommonJS", "ES"))
- }
- });
- defineType("DeclareModuleExports", {
- visitor: ["typeAnnotation"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- typeAnnotation: validateType("TypeAnnotation")
- }
- });
- defineType("DeclareTypeAlias", {
- visitor: ["id", "typeParameters", "right"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TypeParameterDeclaration"),
- right: validateType("FlowType")
- }
- });
- defineType("DeclareOpaqueType", {
- visitor: ["id", "typeParameters", "supertype"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TypeParameterDeclaration"),
- supertype: validateOptionalType("FlowType")
- }
- });
- defineType("DeclareVariable", {
- visitor: ["id"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier")
- }
- });
- defineType("DeclareExportDeclaration", {
- visitor: ["declaration", "specifiers", "source"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- declaration: validateOptionalType("Flow"),
- specifiers: validateOptional(arrayOfType(["ExportSpecifier", "ExportNamespaceSpecifier"])),
- source: validateOptionalType("StringLiteral"),
- "default": validateOptional(assertValueType("boolean"))
- }
- });
- defineType("DeclareExportAllDeclaration", {
- visitor: ["source"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- source: validateType("StringLiteral"),
- exportKind: validateOptional(assertOneOf("type", "value"))
- }
- });
- defineType("DeclaredPredicate", {
- visitor: ["value"],
- aliases: ["Flow", "FlowPredicate"],
- fields: {
- value: validateType("Flow")
- }
- });
- defineType("ExistsTypeAnnotation", {
- aliases: ["Flow", "FlowType"]
- });
- defineType("FunctionTypeAnnotation", {
- visitor: ["typeParameters", "params", "rest", "returnType"],
- aliases: ["Flow", "FlowType"],
- fields: {
- typeParameters: validateOptionalType("TypeParameterDeclaration"),
- params: validate$1(arrayOfType("FunctionTypeParam")),
- rest: validateOptionalType("FunctionTypeParam"),
- returnType: validateType("FlowType")
- }
- });
- defineType("FunctionTypeParam", {
- visitor: ["name", "typeAnnotation"],
- aliases: ["Flow"],
- fields: {
- name: validateOptionalType("Identifier"),
- typeAnnotation: validateType("FlowType"),
- optional: validateOptional(assertValueType("boolean"))
- }
- });
- defineType("GenericTypeAnnotation", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow", "FlowType"],
- fields: {
- id: validateType(["Identifier", "QualifiedTypeIdentifier"]),
- typeParameters: validateOptionalType("TypeParameterInstantiation")
- }
- });
- defineType("InferredPredicate", {
- aliases: ["Flow", "FlowPredicate"]
- });
- defineType("InterfaceExtends", {
- visitor: ["id", "typeParameters"],
- aliases: ["Flow"],
- fields: {
- id: validateType(["Identifier", "QualifiedTypeIdentifier"]),
- typeParameters: validateOptionalType("TypeParameterInstantiation")
- }
- });
- defineInterfaceishType("InterfaceDeclaration");
- defineType("InterfaceTypeAnnotation", {
- visitor: ["extends", "body"],
- aliases: ["Flow", "FlowType"],
- fields: {
- "extends": validateOptional(arrayOfType("InterfaceExtends")),
- body: validateType("ObjectTypeAnnotation")
- }
- });
- defineType("IntersectionTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: validate$1(arrayOfType("FlowType"))
- }
- });
- defineType("MixedTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("EmptyTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("NullableTypeAnnotation", {
- visitor: ["typeAnnotation"],
- aliases: ["Flow", "FlowType"],
- fields: {
- typeAnnotation: validateType("FlowType")
- }
- });
- defineType("NumberLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: validate$1(assertValueType("number"))
- }
- });
- defineType("NumberTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("ObjectTypeAnnotation", {
- visitor: ["properties", "indexers", "callProperties", "internalSlots"],
- aliases: ["Flow", "FlowType"],
- builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"],
- fields: {
- properties: validate$1(arrayOfType(["ObjectTypeProperty", "ObjectTypeSpreadProperty"])),
- indexers: validateOptional(arrayOfType("ObjectTypeIndexer")),
- callProperties: validateOptional(arrayOfType("ObjectTypeCallProperty")),
- internalSlots: validateOptional(arrayOfType("ObjectTypeInternalSlot")),
- exact: {
- validate: assertValueType("boolean"),
- "default": false
- },
- inexact: validateOptional(assertValueType("boolean"))
- }
- });
- defineType("ObjectTypeInternalSlot", {
- visitor: ["id", "value", "optional", "static", "method"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- id: validateType("Identifier"),
- value: validateType("FlowType"),
- optional: validate$1(assertValueType("boolean")),
- "static": validate$1(assertValueType("boolean")),
- method: validate$1(assertValueType("boolean"))
- }
- });
- defineType("ObjectTypeCallProperty", {
- visitor: ["value"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- value: validateType("FlowType"),
- "static": validate$1(assertValueType("boolean"))
- }
- });
- defineType("ObjectTypeIndexer", {
- visitor: ["id", "key", "value", "variance"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- id: validateOptionalType("Identifier"),
- key: validateType("FlowType"),
- value: validateType("FlowType"),
- "static": validate$1(assertValueType("boolean")),
- variance: validateOptionalType("Variance")
- }
- });
- defineType("ObjectTypeProperty", {
- visitor: ["key", "value", "variance"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- key: validateType(["Identifier", "StringLiteral"]),
- value: validateType("FlowType"),
- kind: validate$1(assertOneOf("init", "get", "set")),
- "static": validate$1(assertValueType("boolean")),
- proto: validate$1(assertValueType("boolean")),
- optional: validate$1(assertValueType("boolean")),
- variance: validateOptionalType("Variance")
- }
- });
- defineType("ObjectTypeSpreadProperty", {
- visitor: ["argument"],
- aliases: ["Flow", "UserWhitespacable"],
- fields: {
- argument: validateType("FlowType")
- }
- });
- defineType("OpaqueType", {
- visitor: ["id", "typeParameters", "supertype", "impltype"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TypeParameterDeclaration"),
- supertype: validateOptionalType("FlowType"),
- impltype: validateType("FlowType")
- }
- });
- defineType("QualifiedTypeIdentifier", {
- visitor: ["id", "qualification"],
- aliases: ["Flow"],
- fields: {
- id: validateType("Identifier"),
- qualification: validateType(["Identifier", "QualifiedTypeIdentifier"])
- }
- });
- defineType("StringLiteralTypeAnnotation", {
- builder: ["value"],
- aliases: ["Flow", "FlowType"],
- fields: {
- value: validate$1(assertValueType("string"))
- }
- });
- defineType("StringTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("ThisTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("TupleTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: validate$1(arrayOfType("FlowType"))
- }
- });
- defineType("TypeofTypeAnnotation", {
- visitor: ["argument"],
- aliases: ["Flow", "FlowType"],
- fields: {
- argument: validateType("FlowType")
- }
- });
- defineType("TypeAlias", {
- visitor: ["id", "typeParameters", "right"],
- aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
- fields: {
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TypeParameterDeclaration"),
- right: validateType("FlowType")
- }
- });
- defineType("TypeAnnotation", {
- aliases: ["Flow"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: validateType("FlowType")
- }
- });
- defineType("TypeCastExpression", {
- visitor: ["expression", "typeAnnotation"],
- aliases: ["Flow", "ExpressionWrapper", "Expression"],
- fields: {
- expression: validateType("Expression"),
- typeAnnotation: validateType("TypeAnnotation")
- }
- });
- defineType("TypeParameter", {
- aliases: ["Flow"],
- visitor: ["bound", "default", "variance"],
- fields: {
- name: validate$1(assertValueType("string")),
- bound: validateOptionalType("TypeAnnotation"),
- "default": validateOptionalType("FlowType"),
- variance: validateOptionalType("Variance")
- }
- });
- defineType("TypeParameterDeclaration", {
- aliases: ["Flow"],
- visitor: ["params"],
- fields: {
- params: validate$1(arrayOfType("TypeParameter"))
- }
- });
- defineType("TypeParameterInstantiation", {
- aliases: ["Flow"],
- visitor: ["params"],
- fields: {
- params: validate$1(arrayOfType("FlowType"))
- }
- });
- defineType("UnionTypeAnnotation", {
- visitor: ["types"],
- aliases: ["Flow", "FlowType"],
- fields: {
- types: validate$1(arrayOfType("FlowType"))
- }
- });
- defineType("Variance", {
- aliases: ["Flow"],
- builder: ["kind"],
- fields: {
- kind: validate$1(assertOneOf("minus", "plus"))
- }
- });
- defineType("VoidTypeAnnotation", {
- aliases: ["Flow", "FlowType", "FlowBaseAnnotation"]
- });
- defineType("EnumDeclaration", {
- aliases: ["Declaration"],
- visitor: ["id", "body"],
- fields: {
- id: validateType("Identifier"),
- body: validateType(["EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody"])
- }
- });
- defineType("EnumBooleanBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicit: validate$1(assertValueType("boolean")),
- members: validateArrayOfType("EnumBooleanMember")
- }
- });
- defineType("EnumNumberBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicit: validate$1(assertValueType("boolean")),
- members: validateArrayOfType("EnumNumberMember")
- }
- });
- defineType("EnumStringBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- explicit: validate$1(assertValueType("boolean")),
- members: validateArrayOfType(["EnumStringMember", "EnumDefaultedMember"])
- }
- });
- defineType("EnumSymbolBody", {
- aliases: ["EnumBody"],
- visitor: ["members"],
- fields: {
- members: validateArrayOfType("EnumDefaultedMember")
- }
- });
- defineType("EnumBooleanMember", {
- aliases: ["EnumMember"],
- visitor: ["id"],
- fields: {
- id: validateType("Identifier"),
- init: validateType("BooleanLiteral")
- }
- });
- defineType("EnumNumberMember", {
- aliases: ["EnumMember"],
- visitor: ["id", "init"],
- fields: {
- id: validateType("Identifier"),
- init: validateType("NumericLiteral")
- }
- });
- defineType("EnumStringMember", {
- aliases: ["EnumMember"],
- visitor: ["id", "init"],
- fields: {
- id: validateType("Identifier"),
- init: validateType("StringLiteral")
- }
- });
- defineType("EnumDefaultedMember", {
- aliases: ["EnumMember"],
- visitor: ["id"],
- fields: {
- id: validateType("Identifier")
- }
- });
- defineType("JSXAttribute", {
- visitor: ["name", "value"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: assertNodeType("JSXIdentifier", "JSXNamespacedName")
- },
- value: {
- optional: true,
- validate: assertNodeType("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer")
- }
- }
- });
- defineType("JSXClosingElement", {
- visitor: ["name"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: assertNodeType("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
- }
- }
- });
- defineType("JSXElement", {
- builder: ["openingElement", "closingElement", "children", "selfClosing"],
- visitor: ["openingElement", "children", "closingElement"],
- aliases: ["JSX", "Immutable", "Expression"],
- fields: {
- openingElement: {
- validate: assertNodeType("JSXOpeningElement")
- },
- closingElement: {
- optional: true,
- validate: assertNodeType("JSXClosingElement")
- },
- children: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
- }
- }
- });
- defineType("JSXEmptyExpression", {
- aliases: ["JSX"]
- });
- defineType("JSXExpressionContainer", {
- visitor: ["expression"],
- aliases: ["JSX", "Immutable"],
- fields: {
- expression: {
- validate: assertNodeType("Expression", "JSXEmptyExpression")
- }
- }
- });
- defineType("JSXSpreadChild", {
- visitor: ["expression"],
- aliases: ["JSX", "Immutable"],
- fields: {
- expression: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("JSXIdentifier", {
- builder: ["name"],
- aliases: ["JSX"],
- fields: {
- name: {
- validate: assertValueType("string")
- }
- }
- });
- defineType("JSXMemberExpression", {
- visitor: ["object", "property"],
- aliases: ["JSX"],
- fields: {
- object: {
- validate: assertNodeType("JSXMemberExpression", "JSXIdentifier")
- },
- property: {
- validate: assertNodeType("JSXIdentifier")
- }
- }
- });
- defineType("JSXNamespacedName", {
- visitor: ["namespace", "name"],
- aliases: ["JSX"],
- fields: {
- namespace: {
- validate: assertNodeType("JSXIdentifier")
- },
- name: {
- validate: assertNodeType("JSXIdentifier")
- }
- }
- });
- defineType("JSXOpeningElement", {
- builder: ["name", "attributes", "selfClosing"],
- visitor: ["name", "attributes"],
- aliases: ["JSX", "Immutable"],
- fields: {
- name: {
- validate: assertNodeType("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
- },
- selfClosing: {
- "default": false
- },
- attributes: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("JSXAttribute", "JSXSpreadAttribute")))
- },
- typeParameters: {
- validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- defineType("JSXSpreadAttribute", {
- visitor: ["argument"],
- aliases: ["JSX"],
- fields: {
- argument: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("JSXText", {
- aliases: ["JSX", "Immutable"],
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("string")
- }
- }
- });
- defineType("JSXFragment", {
- builder: ["openingFragment", "closingFragment", "children"],
- visitor: ["openingFragment", "children", "closingFragment"],
- aliases: ["JSX", "Immutable", "Expression"],
- fields: {
- openingFragment: {
- validate: assertNodeType("JSXOpeningFragment")
- },
- closingFragment: {
- validate: assertNodeType("JSXClosingFragment")
- },
- children: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment")))
- }
- }
- });
- defineType("JSXOpeningFragment", {
- aliases: ["JSX", "Immutable"]
- });
- defineType("JSXClosingFragment", {
- aliases: ["JSX", "Immutable"]
- });
- var PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"];
- var PLACEHOLDERS_ALIAS = {
- Declaration: ["Statement"],
- Pattern: ["PatternLike", "LVal"]
- };
- for (var _i = 0, _PLACEHOLDERS = PLACEHOLDERS; _i < _PLACEHOLDERS.length; _i++) {
- var type = _PLACEHOLDERS[_i];
- var alias = ALIAS_KEYS[type];
- if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias;
- }
- var PLACEHOLDERS_FLIPPED_ALIAS = {};
- Object.keys(PLACEHOLDERS_ALIAS).forEach(function (type) {
- PLACEHOLDERS_ALIAS[type].forEach(function (alias) {
- if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {
- PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];
- }
- PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);
- });
- });
- defineType("Noop", {
- visitor: []
- });
- defineType("Placeholder", {
- visitor: [],
- builder: ["expectedNode", "name"],
- fields: {
- name: {
- validate: assertNodeType("Identifier")
- },
- expectedNode: {
- validate: assertOneOf.apply(void 0, PLACEHOLDERS)
- }
- }
- });
- defineType("V8IntrinsicIdentifier", {
- builder: ["name"],
- fields: {
- name: {
- validate: assertValueType("string")
- }
- }
- });
- defineType("ArgumentPlaceholder", {});
- defineType("AwaitExpression", {
- builder: ["argument"],
- visitor: ["argument"],
- aliases: ["Expression", "Terminatorless"],
- fields: {
- argument: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("BindExpression", {
- visitor: ["object", "callee"],
- aliases: ["Expression"],
- fields: !process.env.BABEL_TYPES_8_BREAKING ? {} : {
- object: {
- validate: assertNodeType("Expression")
- },
- callee: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("ClassProperty", {
- visitor: ["key", "value", "typeAnnotation", "decorators"],
- builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"],
- aliases: ["Property"],
- fields: Object.assign({}, classMethodOrPropertyCommon, {
- value: {
- validate: assertNodeType("Expression"),
- optional: true
- },
- definite: {
- validate: assertValueType("boolean"),
- optional: true
- },
- typeAnnotation: {
- validate: assertNodeType("TypeAnnotation", "TSTypeAnnotation", "Noop"),
- optional: true
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- },
- readonly: {
- validate: assertValueType("boolean"),
- optional: true
- },
- declare: {
- validate: assertValueType("boolean"),
- optional: true
- }
- })
- });
- defineType("OptionalMemberExpression", {
- builder: ["object", "property", "computed", "optional"],
- visitor: ["object", "property"],
- aliases: ["Expression"],
- fields: {
- object: {
- validate: assertNodeType("Expression")
- },
- property: {
- validate: function () {
- var normal = assertNodeType("Identifier");
- var computed = assertNodeType("Expression");
- return function (node, key, val) {
- var validator = node.computed ? computed : normal;
- validator(node, key, val);
- };
- }()
- },
- computed: {
- "default": false
- },
- optional: {
- validate: assertValueType("boolean")
- }
- }
- });
- defineType("PipelineTopicExpression", {
- builder: ["expression"],
- visitor: ["expression"],
- fields: {
- expression: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("PipelineBareFunction", {
- builder: ["callee"],
- visitor: ["callee"],
- fields: {
- callee: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("PipelinePrimaryTopicReference", {
- aliases: ["Expression"]
- });
- defineType("OptionalCallExpression", {
- visitor: ["callee", "arguments", "typeParameters", "typeArguments"],
- builder: ["callee", "arguments", "optional"],
- aliases: ["Expression"],
- fields: {
- callee: {
- validate: assertNodeType("Expression")
- },
- arguments: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Expression", "SpreadElement", "JSXNamespacedName")))
- },
- optional: {
- validate: assertValueType("boolean")
- },
- typeArguments: {
- validate: assertNodeType("TypeParameterInstantiation"),
- optional: true
- },
- typeParameters: {
- validate: assertNodeType("TSTypeParameterInstantiation"),
- optional: true
- }
- }
- });
- defineType("ClassPrivateProperty", {
- visitor: ["key", "value", "decorators"],
- builder: ["key", "value", "decorators"],
- aliases: ["Property", "Private"],
- fields: {
- key: {
- validate: assertNodeType("PrivateName")
- },
- value: {
- validate: assertNodeType("Expression"),
- optional: true
- },
- decorators: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("Decorator"))),
- optional: true
- }
- }
- });
- defineType("ClassPrivateMethod", {
- builder: ["kind", "key", "params", "body", "static"],
- visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
- aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"],
- fields: Object.assign({}, classMethodOrDeclareMethodCommon, {
- key: {
- validate: assertNodeType("PrivateName")
- },
- body: {
- validate: assertNodeType("BlockStatement")
- }
- })
- });
- defineType("Import", {
- aliases: ["Expression"]
- });
- defineType("Decorator", {
- visitor: ["expression"],
- fields: {
- expression: {
- validate: assertNodeType("Expression")
- }
- }
- });
- defineType("DoExpression", {
- visitor: ["body"],
- aliases: ["Expression"],
- fields: {
- body: {
- validate: assertNodeType("BlockStatement")
- }
- }
- });
- defineType("ExportDefaultSpecifier", {
- visitor: ["exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- exported: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("ExportNamespaceSpecifier", {
- visitor: ["exported"],
- aliases: ["ModuleSpecifier"],
- fields: {
- exported: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("PrivateName", {
- visitor: ["id"],
- aliases: ["Private"],
- fields: {
- id: {
- validate: assertNodeType("Identifier")
- }
- }
- });
- defineType("BigIntLiteral", {
- builder: ["value"],
- fields: {
- value: {
- validate: assertValueType("string")
- }
- },
- aliases: ["Expression", "Pureish", "Literal", "Immutable"]
- });
- var bool = assertValueType("boolean");
- var tSFunctionTypeAnnotationCommon = {
- returnType: {
- validate: assertNodeType("TSTypeAnnotation", "Noop"),
- optional: true
- },
- typeParameters: {
- validate: assertNodeType("TSTypeParameterDeclaration", "Noop"),
- optional: true
- }
- };
- defineType("TSParameterProperty", {
- aliases: ["LVal"],
- visitor: ["parameter"],
- fields: {
- accessibility: {
- validate: assertOneOf("public", "private", "protected"),
- optional: true
- },
- readonly: {
- validate: assertValueType("boolean"),
- optional: true
- },
- parameter: {
- validate: assertNodeType("Identifier", "AssignmentPattern")
- }
- }
- });
- defineType("TSDeclareFunction", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "params", "returnType"],
- fields: Object.assign({}, functionDeclarationCommon, {}, tSFunctionTypeAnnotationCommon)
- });
- defineType("TSDeclareMethod", {
- visitor: ["decorators", "key", "typeParameters", "params", "returnType"],
- fields: Object.assign({}, classMethodOrDeclareMethodCommon, {}, tSFunctionTypeAnnotationCommon)
- });
- defineType("TSQualifiedName", {
- aliases: ["TSEntityName"],
- visitor: ["left", "right"],
- fields: {
- left: validateType("TSEntityName"),
- right: validateType("Identifier")
- }
- });
- var signatureDeclarationCommon = {
- typeParameters: validateOptionalType("TSTypeParameterDeclaration"),
- parameters: validateArrayOfType(["Identifier", "RestElement"]),
- typeAnnotation: validateOptionalType("TSTypeAnnotation")
- };
- var callConstructSignatureDeclaration = {
- aliases: ["TSTypeElement"],
- visitor: ["typeParameters", "parameters", "typeAnnotation"],
- fields: signatureDeclarationCommon
- };
- defineType("TSCallSignatureDeclaration", callConstructSignatureDeclaration);
- defineType("TSConstructSignatureDeclaration", callConstructSignatureDeclaration);
- var namedTypeElementCommon = {
- key: validateType("Expression"),
- computed: validate$1(bool),
- optional: validateOptional(bool)
- };
- defineType("TSPropertySignature", {
- aliases: ["TSTypeElement"],
- visitor: ["key", "typeAnnotation", "initializer"],
- fields: Object.assign({}, namedTypeElementCommon, {
- readonly: validateOptional(bool),
- typeAnnotation: validateOptionalType("TSTypeAnnotation"),
- initializer: validateOptionalType("Expression")
- })
- });
- defineType("TSMethodSignature", {
- aliases: ["TSTypeElement"],
- visitor: ["key", "typeParameters", "parameters", "typeAnnotation"],
- fields: Object.assign({}, signatureDeclarationCommon, {}, namedTypeElementCommon)
- });
- defineType("TSIndexSignature", {
- aliases: ["TSTypeElement"],
- visitor: ["parameters", "typeAnnotation"],
- fields: {
- readonly: validateOptional(bool),
- parameters: validateArrayOfType("Identifier"),
- typeAnnotation: validateOptionalType("TSTypeAnnotation")
- }
- });
- var tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"];
- for (var _i$1 = 0, _tsKeywordTypes = tsKeywordTypes; _i$1 < _tsKeywordTypes.length; _i$1++) {
- var type$1 = _tsKeywordTypes[_i$1];
- defineType(type$1, {
- aliases: ["TSType"],
- visitor: [],
- fields: {}
- });
- }
- defineType("TSThisType", {
- aliases: ["TSType"],
- visitor: [],
- fields: {}
- });
- var fnOrCtr = {
- aliases: ["TSType"],
- visitor: ["typeParameters", "parameters", "typeAnnotation"],
- fields: signatureDeclarationCommon
- };
- defineType("TSFunctionType", fnOrCtr);
- defineType("TSConstructorType", fnOrCtr);
- defineType("TSTypeReference", {
- aliases: ["TSType"],
- visitor: ["typeName", "typeParameters"],
- fields: {
- typeName: validateType("TSEntityName"),
- typeParameters: validateOptionalType("TSTypeParameterInstantiation")
- }
- });
- defineType("TSTypePredicate", {
- aliases: ["TSType"],
- visitor: ["parameterName", "typeAnnotation"],
- builder: ["parameterName", "typeAnnotation", "asserts"],
- fields: {
- parameterName: validateType(["Identifier", "TSThisType"]),
- typeAnnotation: validateOptionalType("TSTypeAnnotation"),
- asserts: validateOptional(bool)
- }
- });
- defineType("TSTypeQuery", {
- aliases: ["TSType"],
- visitor: ["exprName"],
- fields: {
- exprName: validateType(["TSEntityName", "TSImportType"])
- }
- });
- defineType("TSTypeLiteral", {
- aliases: ["TSType"],
- visitor: ["members"],
- fields: {
- members: validateArrayOfType("TSTypeElement")
- }
- });
- defineType("TSArrayType", {
- aliases: ["TSType"],
- visitor: ["elementType"],
- fields: {
- elementType: validateType("TSType")
- }
- });
- defineType("TSTupleType", {
- aliases: ["TSType"],
- visitor: ["elementTypes"],
- fields: {
- elementTypes: validateArrayOfType("TSType")
- }
- });
- defineType("TSOptionalType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: validateType("TSType")
- }
- });
- defineType("TSRestType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: validateType("TSType")
- }
- });
- var unionOrIntersection = {
- aliases: ["TSType"],
- visitor: ["types"],
- fields: {
- types: validateArrayOfType("TSType")
- }
- };
- defineType("TSUnionType", unionOrIntersection);
- defineType("TSIntersectionType", unionOrIntersection);
- defineType("TSConditionalType", {
- aliases: ["TSType"],
- visitor: ["checkType", "extendsType", "trueType", "falseType"],
- fields: {
- checkType: validateType("TSType"),
- extendsType: validateType("TSType"),
- trueType: validateType("TSType"),
- falseType: validateType("TSType")
- }
- });
- defineType("TSInferType", {
- aliases: ["TSType"],
- visitor: ["typeParameter"],
- fields: {
- typeParameter: validateType("TSTypeParameter")
- }
- });
- defineType("TSParenthesizedType", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: validateType("TSType")
- }
- });
- defineType("TSTypeOperator", {
- aliases: ["TSType"],
- visitor: ["typeAnnotation"],
- fields: {
- operator: validate$1(assertValueType("string")),
- typeAnnotation: validateType("TSType")
- }
- });
- defineType("TSIndexedAccessType", {
- aliases: ["TSType"],
- visitor: ["objectType", "indexType"],
- fields: {
- objectType: validateType("TSType"),
- indexType: validateType("TSType")
- }
- });
- defineType("TSMappedType", {
- aliases: ["TSType"],
- visitor: ["typeParameter", "typeAnnotation"],
- fields: {
- readonly: validateOptional(bool),
- typeParameter: validateType("TSTypeParameter"),
- optional: validateOptional(bool),
- typeAnnotation: validateOptionalType("TSType")
- }
- });
- defineType("TSLiteralType", {
- aliases: ["TSType"],
- visitor: ["literal"],
- fields: {
- literal: validateType(["NumericLiteral", "StringLiteral", "BooleanLiteral"])
- }
- });
- defineType("TSExpressionWithTypeArguments", {
- aliases: ["TSType"],
- visitor: ["expression", "typeParameters"],
- fields: {
- expression: validateType("TSEntityName"),
- typeParameters: validateOptionalType("TSTypeParameterInstantiation")
- }
- });
- defineType("TSInterfaceDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "extends", "body"],
- fields: {
- declare: validateOptional(bool),
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TSTypeParameterDeclaration"),
- "extends": validateOptional(arrayOfType("TSExpressionWithTypeArguments")),
- body: validateType("TSInterfaceBody")
- }
- });
- defineType("TSInterfaceBody", {
- visitor: ["body"],
- fields: {
- body: validateArrayOfType("TSTypeElement")
- }
- });
- defineType("TSTypeAliasDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "typeParameters", "typeAnnotation"],
- fields: {
- declare: validateOptional(bool),
- id: validateType("Identifier"),
- typeParameters: validateOptionalType("TSTypeParameterDeclaration"),
- typeAnnotation: validateType("TSType")
- }
- });
- defineType("TSAsExpression", {
- aliases: ["Expression"],
- visitor: ["expression", "typeAnnotation"],
- fields: {
- expression: validateType("Expression"),
- typeAnnotation: validateType("TSType")
- }
- });
- defineType("TSTypeAssertion", {
- aliases: ["Expression"],
- visitor: ["typeAnnotation", "expression"],
- fields: {
- typeAnnotation: validateType("TSType"),
- expression: validateType("Expression")
- }
- });
- defineType("TSEnumDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "members"],
- fields: {
- declare: validateOptional(bool),
- "const": validateOptional(bool),
- id: validateType("Identifier"),
- members: validateArrayOfType("TSEnumMember"),
- initializer: validateOptionalType("Expression")
- }
- });
- defineType("TSEnumMember", {
- visitor: ["id", "initializer"],
- fields: {
- id: validateType(["Identifier", "StringLiteral"]),
- initializer: validateOptionalType("Expression")
- }
- });
- defineType("TSModuleDeclaration", {
- aliases: ["Statement", "Declaration"],
- visitor: ["id", "body"],
- fields: {
- declare: validateOptional(bool),
- global: validateOptional(bool),
- id: validateType(["Identifier", "StringLiteral"]),
- body: validateType(["TSModuleBlock", "TSModuleDeclaration"])
- }
- });
- defineType("TSModuleBlock", {
- aliases: ["Scopable", "Block", "BlockParent"],
- visitor: ["body"],
- fields: {
- body: validateArrayOfType("Statement")
- }
- });
- defineType("TSImportType", {
- aliases: ["TSType"],
- visitor: ["argument", "qualifier", "typeParameters"],
- fields: {
- argument: validateType("StringLiteral"),
- qualifier: validateOptionalType("TSEntityName"),
- typeParameters: validateOptionalType("TSTypeParameterInstantiation")
- }
- });
- defineType("TSImportEqualsDeclaration", {
- aliases: ["Statement"],
- visitor: ["id", "moduleReference"],
- fields: {
- isExport: validate$1(bool),
- id: validateType("Identifier"),
- moduleReference: validateType(["TSEntityName", "TSExternalModuleReference"])
- }
- });
- defineType("TSExternalModuleReference", {
- visitor: ["expression"],
- fields: {
- expression: validateType("StringLiteral")
- }
- });
- defineType("TSNonNullExpression", {
- aliases: ["Expression"],
- visitor: ["expression"],
- fields: {
- expression: validateType("Expression")
- }
- });
- defineType("TSExportAssignment", {
- aliases: ["Statement"],
- visitor: ["expression"],
- fields: {
- expression: validateType("Expression")
- }
- });
- defineType("TSNamespaceExportDeclaration", {
- aliases: ["Statement"],
- visitor: ["id"],
- fields: {
- id: validateType("Identifier")
- }
- });
- defineType("TSTypeAnnotation", {
- visitor: ["typeAnnotation"],
- fields: {
- typeAnnotation: {
- validate: assertNodeType("TSType")
- }
- }
- });
- defineType("TSTypeParameterInstantiation", {
- visitor: ["params"],
- fields: {
- params: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("TSType")))
- }
- }
- });
- defineType("TSTypeParameterDeclaration", {
- visitor: ["params"],
- fields: {
- params: {
- validate: chain(assertValueType("array"), assertEach(assertNodeType("TSTypeParameter")))
- }
- }
- });
- defineType("TSTypeParameter", {
- builder: ["constraint", "default", "name"],
- visitor: ["constraint", "default"],
- fields: {
- name: {
- validate: assertValueType("string")
- },
- constraint: {
- validate: assertNodeType("TSType"),
- optional: true
- },
- "default": {
- validate: assertNodeType("TSType"),
- optional: true
- }
- }
- });
- toFastProperties(VISITOR_KEYS);
- toFastProperties(ALIAS_KEYS);
- toFastProperties(FLIPPED_ALIAS_KEYS);
- toFastProperties(NODE_FIELDS);
- toFastProperties(BUILDER_KEYS);
- toFastProperties(DEPRECATED_KEYS);
- toFastProperties(PLACEHOLDERS_ALIAS);
- toFastProperties(PLACEHOLDERS_FLIPPED_ALIAS);
- var TYPES = Object.keys(VISITOR_KEYS).concat(Object.keys(FLIPPED_ALIAS_KEYS)).concat(Object.keys(DEPRECATED_KEYS));
- function builder(type) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- var keys = BUILDER_KEYS[type];
- var countArgs = args.length;
- if (countArgs > keys.length) {
- throw new Error(type + ": Too many arguments passed. Received " + countArgs + " but can receive no more than " + keys.length);
- }
- var node = {
- type: type
- };
- var i = 0;
- keys.forEach(function (key) {
- var field = NODE_FIELDS[type][key];
- var arg;
- if (i < countArgs) arg = args[i];
- if (arg === undefined) arg = clone_1(field["default"]);
- node[key] = arg;
- i++;
- });
- for (var _i = 0, _Object$keys = Object.keys(node); _i < _Object$keys.length; _i++) {
- var key = _Object$keys[_i];
- validate(node, key, node[key]);
- }
- return node;
- }
- function ArrayExpression() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return builder.apply(void 0, ["ArrayExpression"].concat(args));
- }
- function AssignmentExpression() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return builder.apply(void 0, ["AssignmentExpression"].concat(args));
- }
- function BinaryExpression() {
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- return builder.apply(void 0, ["BinaryExpression"].concat(args));
- }
- function InterpreterDirective() {
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
- }
- return builder.apply(void 0, ["InterpreterDirective"].concat(args));
- }
- function Directive() {
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
- args[_key5] = arguments[_key5];
- }
- return builder.apply(void 0, ["Directive"].concat(args));
- }
- function DirectiveLiteral() {
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
- args[_key6] = arguments[_key6];
- }
- return builder.apply(void 0, ["DirectiveLiteral"].concat(args));
- }
- function BlockStatement() {
- for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
- args[_key7] = arguments[_key7];
- }
- return builder.apply(void 0, ["BlockStatement"].concat(args));
- }
- function BreakStatement() {
- for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
- args[_key8] = arguments[_key8];
- }
- return builder.apply(void 0, ["BreakStatement"].concat(args));
- }
- function CallExpression() {
- for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
- args[_key9] = arguments[_key9];
- }
- return builder.apply(void 0, ["CallExpression"].concat(args));
- }
- function CatchClause() {
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
- args[_key10] = arguments[_key10];
- }
- return builder.apply(void 0, ["CatchClause"].concat(args));
- }
- function ConditionalExpression() {
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
- args[_key11] = arguments[_key11];
- }
- return builder.apply(void 0, ["ConditionalExpression"].concat(args));
- }
- function ContinueStatement() {
- for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
- args[_key12] = arguments[_key12];
- }
- return builder.apply(void 0, ["ContinueStatement"].concat(args));
- }
- function DebuggerStatement() {
- for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
- args[_key13] = arguments[_key13];
- }
- return builder.apply(void 0, ["DebuggerStatement"].concat(args));
- }
- function DoWhileStatement() {
- for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
- args[_key14] = arguments[_key14];
- }
- return builder.apply(void 0, ["DoWhileStatement"].concat(args));
- }
- function EmptyStatement() {
- for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
- args[_key15] = arguments[_key15];
- }
- return builder.apply(void 0, ["EmptyStatement"].concat(args));
- }
- function ExpressionStatement() {
- for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
- args[_key16] = arguments[_key16];
- }
- return builder.apply(void 0, ["ExpressionStatement"].concat(args));
- }
- function File() {
- for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
- args[_key17] = arguments[_key17];
- }
- return builder.apply(void 0, ["File"].concat(args));
- }
- function ForInStatement() {
- for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
- args[_key18] = arguments[_key18];
- }
- return builder.apply(void 0, ["ForInStatement"].concat(args));
- }
- function ForStatement() {
- for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
- args[_key19] = arguments[_key19];
- }
- return builder.apply(void 0, ["ForStatement"].concat(args));
- }
- function FunctionDeclaration() {
- for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
- args[_key20] = arguments[_key20];
- }
- return builder.apply(void 0, ["FunctionDeclaration"].concat(args));
- }
- function FunctionExpression() {
- for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
- args[_key21] = arguments[_key21];
- }
- return builder.apply(void 0, ["FunctionExpression"].concat(args));
- }
- function Identifier() {
- for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
- args[_key22] = arguments[_key22];
- }
- return builder.apply(void 0, ["Identifier"].concat(args));
- }
- function IfStatement() {
- for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
- args[_key23] = arguments[_key23];
- }
- return builder.apply(void 0, ["IfStatement"].concat(args));
- }
- function LabeledStatement() {
- for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
- args[_key24] = arguments[_key24];
- }
- return builder.apply(void 0, ["LabeledStatement"].concat(args));
- }
- function StringLiteral() {
- for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
- args[_key25] = arguments[_key25];
- }
- return builder.apply(void 0, ["StringLiteral"].concat(args));
- }
- function NumericLiteral() {
- for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
- args[_key26] = arguments[_key26];
- }
- return builder.apply(void 0, ["NumericLiteral"].concat(args));
- }
- function NullLiteral() {
- for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
- args[_key27] = arguments[_key27];
- }
- return builder.apply(void 0, ["NullLiteral"].concat(args));
- }
- function BooleanLiteral() {
- for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) {
- args[_key28] = arguments[_key28];
- }
- return builder.apply(void 0, ["BooleanLiteral"].concat(args));
- }
- function RegExpLiteral() {
- for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) {
- args[_key29] = arguments[_key29];
- }
- return builder.apply(void 0, ["RegExpLiteral"].concat(args));
- }
- function LogicalExpression() {
- for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) {
- args[_key30] = arguments[_key30];
- }
- return builder.apply(void 0, ["LogicalExpression"].concat(args));
- }
- function MemberExpression() {
- for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) {
- args[_key31] = arguments[_key31];
- }
- return builder.apply(void 0, ["MemberExpression"].concat(args));
- }
- function NewExpression() {
- for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) {
- args[_key32] = arguments[_key32];
- }
- return builder.apply(void 0, ["NewExpression"].concat(args));
- }
- function Program() {
- for (var _len33 = arguments.length, args = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) {
- args[_key33] = arguments[_key33];
- }
- return builder.apply(void 0, ["Program"].concat(args));
- }
- function ObjectExpression() {
- for (var _len34 = arguments.length, args = new Array(_len34), _key34 = 0; _key34 < _len34; _key34++) {
- args[_key34] = arguments[_key34];
- }
- return builder.apply(void 0, ["ObjectExpression"].concat(args));
- }
- function ObjectMethod() {
- for (var _len35 = arguments.length, args = new Array(_len35), _key35 = 0; _key35 < _len35; _key35++) {
- args[_key35] = arguments[_key35];
- }
- return builder.apply(void 0, ["ObjectMethod"].concat(args));
- }
- function ObjectProperty() {
- for (var _len36 = arguments.length, args = new Array(_len36), _key36 = 0; _key36 < _len36; _key36++) {
- args[_key36] = arguments[_key36];
- }
- return builder.apply(void 0, ["ObjectProperty"].concat(args));
- }
- function RestElement() {
- for (var _len37 = arguments.length, args = new Array(_len37), _key37 = 0; _key37 < _len37; _key37++) {
- args[_key37] = arguments[_key37];
- }
- return builder.apply(void 0, ["RestElement"].concat(args));
- }
- function ReturnStatement() {
- for (var _len38 = arguments.length, args = new Array(_len38), _key38 = 0; _key38 < _len38; _key38++) {
- args[_key38] = arguments[_key38];
- }
- return builder.apply(void 0, ["ReturnStatement"].concat(args));
- }
- function SequenceExpression() {
- for (var _len39 = arguments.length, args = new Array(_len39), _key39 = 0; _key39 < _len39; _key39++) {
- args[_key39] = arguments[_key39];
- }
- return builder.apply(void 0, ["SequenceExpression"].concat(args));
- }
- function ParenthesizedExpression() {
- for (var _len40 = arguments.length, args = new Array(_len40), _key40 = 0; _key40 < _len40; _key40++) {
- args[_key40] = arguments[_key40];
- }
- return builder.apply(void 0, ["ParenthesizedExpression"].concat(args));
- }
- function SwitchCase() {
- for (var _len41 = arguments.length, args = new Array(_len41), _key41 = 0; _key41 < _len41; _key41++) {
- args[_key41] = arguments[_key41];
- }
- return builder.apply(void 0, ["SwitchCase"].concat(args));
- }
- function SwitchStatement() {
- for (var _len42 = arguments.length, args = new Array(_len42), _key42 = 0; _key42 < _len42; _key42++) {
- args[_key42] = arguments[_key42];
- }
- return builder.apply(void 0, ["SwitchStatement"].concat(args));
- }
- function ThisExpression() {
- for (var _len43 = arguments.length, args = new Array(_len43), _key43 = 0; _key43 < _len43; _key43++) {
- args[_key43] = arguments[_key43];
- }
- return builder.apply(void 0, ["ThisExpression"].concat(args));
- }
- function ThrowStatement() {
- for (var _len44 = arguments.length, args = new Array(_len44), _key44 = 0; _key44 < _len44; _key44++) {
- args[_key44] = arguments[_key44];
- }
- return builder.apply(void 0, ["ThrowStatement"].concat(args));
- }
- function TryStatement() {
- for (var _len45 = arguments.length, args = new Array(_len45), _key45 = 0; _key45 < _len45; _key45++) {
- args[_key45] = arguments[_key45];
- }
- return builder.apply(void 0, ["TryStatement"].concat(args));
- }
- function UnaryExpression() {
- for (var _len46 = arguments.length, args = new Array(_len46), _key46 = 0; _key46 < _len46; _key46++) {
- args[_key46] = arguments[_key46];
- }
- return builder.apply(void 0, ["UnaryExpression"].concat(args));
- }
- function UpdateExpression() {
- for (var _len47 = arguments.length, args = new Array(_len47), _key47 = 0; _key47 < _len47; _key47++) {
- args[_key47] = arguments[_key47];
- }
- return builder.apply(void 0, ["UpdateExpression"].concat(args));
- }
- function VariableDeclaration() {
- for (var _len48 = arguments.length, args = new Array(_len48), _key48 = 0; _key48 < _len48; _key48++) {
- args[_key48] = arguments[_key48];
- }
- return builder.apply(void 0, ["VariableDeclaration"].concat(args));
- }
- function VariableDeclarator() {
- for (var _len49 = arguments.length, args = new Array(_len49), _key49 = 0; _key49 < _len49; _key49++) {
- args[_key49] = arguments[_key49];
- }
- return builder.apply(void 0, ["VariableDeclarator"].concat(args));
- }
- function WhileStatement() {
- for (var _len50 = arguments.length, args = new Array(_len50), _key50 = 0; _key50 < _len50; _key50++) {
- args[_key50] = arguments[_key50];
- }
- return builder.apply(void 0, ["WhileStatement"].concat(args));
- }
- function WithStatement() {
- for (var _len51 = arguments.length, args = new Array(_len51), _key51 = 0; _key51 < _len51; _key51++) {
- args[_key51] = arguments[_key51];
- }
- return builder.apply(void 0, ["WithStatement"].concat(args));
- }
- function AssignmentPattern() {
- for (var _len52 = arguments.length, args = new Array(_len52), _key52 = 0; _key52 < _len52; _key52++) {
- args[_key52] = arguments[_key52];
- }
- return builder.apply(void 0, ["AssignmentPattern"].concat(args));
- }
- function ArrayPattern() {
- for (var _len53 = arguments.length, args = new Array(_len53), _key53 = 0; _key53 < _len53; _key53++) {
- args[_key53] = arguments[_key53];
- }
- return builder.apply(void 0, ["ArrayPattern"].concat(args));
- }
- function ArrowFunctionExpression() {
- for (var _len54 = arguments.length, args = new Array(_len54), _key54 = 0; _key54 < _len54; _key54++) {
- args[_key54] = arguments[_key54];
- }
- return builder.apply(void 0, ["ArrowFunctionExpression"].concat(args));
- }
- function ClassBody() {
- for (var _len55 = arguments.length, args = new Array(_len55), _key55 = 0; _key55 < _len55; _key55++) {
- args[_key55] = arguments[_key55];
- }
- return builder.apply(void 0, ["ClassBody"].concat(args));
- }
- function ClassExpression() {
- for (var _len56 = arguments.length, args = new Array(_len56), _key56 = 0; _key56 < _len56; _key56++) {
- args[_key56] = arguments[_key56];
- }
- return builder.apply(void 0, ["ClassExpression"].concat(args));
- }
- function ClassDeclaration() {
- for (var _len57 = arguments.length, args = new Array(_len57), _key57 = 0; _key57 < _len57; _key57++) {
- args[_key57] = arguments[_key57];
- }
- return builder.apply(void 0, ["ClassDeclaration"].concat(args));
- }
- function ExportAllDeclaration() {
- for (var _len58 = arguments.length, args = new Array(_len58), _key58 = 0; _key58 < _len58; _key58++) {
- args[_key58] = arguments[_key58];
- }
- return builder.apply(void 0, ["ExportAllDeclaration"].concat(args));
- }
- function ExportDefaultDeclaration() {
- for (var _len59 = arguments.length, args = new Array(_len59), _key59 = 0; _key59 < _len59; _key59++) {
- args[_key59] = arguments[_key59];
- }
- return builder.apply(void 0, ["ExportDefaultDeclaration"].concat(args));
- }
- function ExportNamedDeclaration() {
- for (var _len60 = arguments.length, args = new Array(_len60), _key60 = 0; _key60 < _len60; _key60++) {
- args[_key60] = arguments[_key60];
- }
- return builder.apply(void 0, ["ExportNamedDeclaration"].concat(args));
- }
- function ExportSpecifier() {
- for (var _len61 = arguments.length, args = new Array(_len61), _key61 = 0; _key61 < _len61; _key61++) {
- args[_key61] = arguments[_key61];
- }
- return builder.apply(void 0, ["ExportSpecifier"].concat(args));
- }
- function ForOfStatement() {
- for (var _len62 = arguments.length, args = new Array(_len62), _key62 = 0; _key62 < _len62; _key62++) {
- args[_key62] = arguments[_key62];
- }
- return builder.apply(void 0, ["ForOfStatement"].concat(args));
- }
- function ImportDeclaration() {
- for (var _len63 = arguments.length, args = new Array(_len63), _key63 = 0; _key63 < _len63; _key63++) {
- args[_key63] = arguments[_key63];
- }
- return builder.apply(void 0, ["ImportDeclaration"].concat(args));
- }
- function ImportDefaultSpecifier() {
- for (var _len64 = arguments.length, args = new Array(_len64), _key64 = 0; _key64 < _len64; _key64++) {
- args[_key64] = arguments[_key64];
- }
- return builder.apply(void 0, ["ImportDefaultSpecifier"].concat(args));
- }
- function ImportNamespaceSpecifier() {
- for (var _len65 = arguments.length, args = new Array(_len65), _key65 = 0; _key65 < _len65; _key65++) {
- args[_key65] = arguments[_key65];
- }
- return builder.apply(void 0, ["ImportNamespaceSpecifier"].concat(args));
- }
- function ImportSpecifier() {
- for (var _len66 = arguments.length, args = new Array(_len66), _key66 = 0; _key66 < _len66; _key66++) {
- args[_key66] = arguments[_key66];
- }
- return builder.apply(void 0, ["ImportSpecifier"].concat(args));
- }
- function MetaProperty() {
- for (var _len67 = arguments.length, args = new Array(_len67), _key67 = 0; _key67 < _len67; _key67++) {
- args[_key67] = arguments[_key67];
- }
- return builder.apply(void 0, ["MetaProperty"].concat(args));
- }
- function ClassMethod() {
- for (var _len68 = arguments.length, args = new Array(_len68), _key68 = 0; _key68 < _len68; _key68++) {
- args[_key68] = arguments[_key68];
- }
- return builder.apply(void 0, ["ClassMethod"].concat(args));
- }
- function ObjectPattern() {
- for (var _len69 = arguments.length, args = new Array(_len69), _key69 = 0; _key69 < _len69; _key69++) {
- args[_key69] = arguments[_key69];
- }
- return builder.apply(void 0, ["ObjectPattern"].concat(args));
- }
- function SpreadElement() {
- for (var _len70 = arguments.length, args = new Array(_len70), _key70 = 0; _key70 < _len70; _key70++) {
- args[_key70] = arguments[_key70];
- }
- return builder.apply(void 0, ["SpreadElement"].concat(args));
- }
- function Super() {
- for (var _len71 = arguments.length, args = new Array(_len71), _key71 = 0; _key71 < _len71; _key71++) {
- args[_key71] = arguments[_key71];
- }
- return builder.apply(void 0, ["Super"].concat(args));
- }
- function TaggedTemplateExpression() {
- for (var _len72 = arguments.length, args = new Array(_len72), _key72 = 0; _key72 < _len72; _key72++) {
- args[_key72] = arguments[_key72];
- }
- return builder.apply(void 0, ["TaggedTemplateExpression"].concat(args));
- }
- function TemplateElement() {
- for (var _len73 = arguments.length, args = new Array(_len73), _key73 = 0; _key73 < _len73; _key73++) {
- args[_key73] = arguments[_key73];
- }
- return builder.apply(void 0, ["TemplateElement"].concat(args));
- }
- function TemplateLiteral() {
- for (var _len74 = arguments.length, args = new Array(_len74), _key74 = 0; _key74 < _len74; _key74++) {
- args[_key74] = arguments[_key74];
- }
- return builder.apply(void 0, ["TemplateLiteral"].concat(args));
- }
- function YieldExpression() {
- for (var _len75 = arguments.length, args = new Array(_len75), _key75 = 0; _key75 < _len75; _key75++) {
- args[_key75] = arguments[_key75];
- }
- return builder.apply(void 0, ["YieldExpression"].concat(args));
- }
- function AnyTypeAnnotation() {
- for (var _len76 = arguments.length, args = new Array(_len76), _key76 = 0; _key76 < _len76; _key76++) {
- args[_key76] = arguments[_key76];
- }
- return builder.apply(void 0, ["AnyTypeAnnotation"].concat(args));
- }
- function ArrayTypeAnnotation() {
- for (var _len77 = arguments.length, args = new Array(_len77), _key77 = 0; _key77 < _len77; _key77++) {
- args[_key77] = arguments[_key77];
- }
- return builder.apply(void 0, ["ArrayTypeAnnotation"].concat(args));
- }
- function BooleanTypeAnnotation() {
- for (var _len78 = arguments.length, args = new Array(_len78), _key78 = 0; _key78 < _len78; _key78++) {
- args[_key78] = arguments[_key78];
- }
- return builder.apply(void 0, ["BooleanTypeAnnotation"].concat(args));
- }
- function BooleanLiteralTypeAnnotation() {
- for (var _len79 = arguments.length, args = new Array(_len79), _key79 = 0; _key79 < _len79; _key79++) {
- args[_key79] = arguments[_key79];
- }
- return builder.apply(void 0, ["BooleanLiteralTypeAnnotation"].concat(args));
- }
- function NullLiteralTypeAnnotation() {
- for (var _len80 = arguments.length, args = new Array(_len80), _key80 = 0; _key80 < _len80; _key80++) {
- args[_key80] = arguments[_key80];
- }
- return builder.apply(void 0, ["NullLiteralTypeAnnotation"].concat(args));
- }
- function ClassImplements() {
- for (var _len81 = arguments.length, args = new Array(_len81), _key81 = 0; _key81 < _len81; _key81++) {
- args[_key81] = arguments[_key81];
- }
- return builder.apply(void 0, ["ClassImplements"].concat(args));
- }
- function DeclareClass() {
- for (var _len82 = arguments.length, args = new Array(_len82), _key82 = 0; _key82 < _len82; _key82++) {
- args[_key82] = arguments[_key82];
- }
- return builder.apply(void 0, ["DeclareClass"].concat(args));
- }
- function DeclareFunction() {
- for (var _len83 = arguments.length, args = new Array(_len83), _key83 = 0; _key83 < _len83; _key83++) {
- args[_key83] = arguments[_key83];
- }
- return builder.apply(void 0, ["DeclareFunction"].concat(args));
- }
- function DeclareInterface() {
- for (var _len84 = arguments.length, args = new Array(_len84), _key84 = 0; _key84 < _len84; _key84++) {
- args[_key84] = arguments[_key84];
- }
- return builder.apply(void 0, ["DeclareInterface"].concat(args));
- }
- function DeclareModule() {
- for (var _len85 = arguments.length, args = new Array(_len85), _key85 = 0; _key85 < _len85; _key85++) {
- args[_key85] = arguments[_key85];
- }
- return builder.apply(void 0, ["DeclareModule"].concat(args));
- }
- function DeclareModuleExports() {
- for (var _len86 = arguments.length, args = new Array(_len86), _key86 = 0; _key86 < _len86; _key86++) {
- args[_key86] = arguments[_key86];
- }
- return builder.apply(void 0, ["DeclareModuleExports"].concat(args));
- }
- function DeclareTypeAlias() {
- for (var _len87 = arguments.length, args = new Array(_len87), _key87 = 0; _key87 < _len87; _key87++) {
- args[_key87] = arguments[_key87];
- }
- return builder.apply(void 0, ["DeclareTypeAlias"].concat(args));
- }
- function DeclareOpaqueType() {
- for (var _len88 = arguments.length, args = new Array(_len88), _key88 = 0; _key88 < _len88; _key88++) {
- args[_key88] = arguments[_key88];
- }
- return builder.apply(void 0, ["DeclareOpaqueType"].concat(args));
- }
- function DeclareVariable() {
- for (var _len89 = arguments.length, args = new Array(_len89), _key89 = 0; _key89 < _len89; _key89++) {
- args[_key89] = arguments[_key89];
- }
- return builder.apply(void 0, ["DeclareVariable"].concat(args));
- }
- function DeclareExportDeclaration() {
- for (var _len90 = arguments.length, args = new Array(_len90), _key90 = 0; _key90 < _len90; _key90++) {
- args[_key90] = arguments[_key90];
- }
- return builder.apply(void 0, ["DeclareExportDeclaration"].concat(args));
- }
- function DeclareExportAllDeclaration() {
- for (var _len91 = arguments.length, args = new Array(_len91), _key91 = 0; _key91 < _len91; _key91++) {
- args[_key91] = arguments[_key91];
- }
- return builder.apply(void 0, ["DeclareExportAllDeclaration"].concat(args));
- }
- function DeclaredPredicate() {
- for (var _len92 = arguments.length, args = new Array(_len92), _key92 = 0; _key92 < _len92; _key92++) {
- args[_key92] = arguments[_key92];
- }
- return builder.apply(void 0, ["DeclaredPredicate"].concat(args));
- }
- function ExistsTypeAnnotation() {
- for (var _len93 = arguments.length, args = new Array(_len93), _key93 = 0; _key93 < _len93; _key93++) {
- args[_key93] = arguments[_key93];
- }
- return builder.apply(void 0, ["ExistsTypeAnnotation"].concat(args));
- }
- function FunctionTypeAnnotation() {
- for (var _len94 = arguments.length, args = new Array(_len94), _key94 = 0; _key94 < _len94; _key94++) {
- args[_key94] = arguments[_key94];
- }
- return builder.apply(void 0, ["FunctionTypeAnnotation"].concat(args));
- }
- function FunctionTypeParam() {
- for (var _len95 = arguments.length, args = new Array(_len95), _key95 = 0; _key95 < _len95; _key95++) {
- args[_key95] = arguments[_key95];
- }
- return builder.apply(void 0, ["FunctionTypeParam"].concat(args));
- }
- function GenericTypeAnnotation() {
- for (var _len96 = arguments.length, args = new Array(_len96), _key96 = 0; _key96 < _len96; _key96++) {
- args[_key96] = arguments[_key96];
- }
- return builder.apply(void 0, ["GenericTypeAnnotation"].concat(args));
- }
- function InferredPredicate() {
- for (var _len97 = arguments.length, args = new Array(_len97), _key97 = 0; _key97 < _len97; _key97++) {
- args[_key97] = arguments[_key97];
- }
- return builder.apply(void 0, ["InferredPredicate"].concat(args));
- }
- function InterfaceExtends() {
- for (var _len98 = arguments.length, args = new Array(_len98), _key98 = 0; _key98 < _len98; _key98++) {
- args[_key98] = arguments[_key98];
- }
- return builder.apply(void 0, ["InterfaceExtends"].concat(args));
- }
- function InterfaceDeclaration() {
- for (var _len99 = arguments.length, args = new Array(_len99), _key99 = 0; _key99 < _len99; _key99++) {
- args[_key99] = arguments[_key99];
- }
- return builder.apply(void 0, ["InterfaceDeclaration"].concat(args));
- }
- function InterfaceTypeAnnotation() {
- for (var _len100 = arguments.length, args = new Array(_len100), _key100 = 0; _key100 < _len100; _key100++) {
- args[_key100] = arguments[_key100];
- }
- return builder.apply(void 0, ["InterfaceTypeAnnotation"].concat(args));
- }
- function IntersectionTypeAnnotation() {
- for (var _len101 = arguments.length, args = new Array(_len101), _key101 = 0; _key101 < _len101; _key101++) {
- args[_key101] = arguments[_key101];
- }
- return builder.apply(void 0, ["IntersectionTypeAnnotation"].concat(args));
- }
- function MixedTypeAnnotation() {
- for (var _len102 = arguments.length, args = new Array(_len102), _key102 = 0; _key102 < _len102; _key102++) {
- args[_key102] = arguments[_key102];
- }
- return builder.apply(void 0, ["MixedTypeAnnotation"].concat(args));
- }
- function EmptyTypeAnnotation() {
- for (var _len103 = arguments.length, args = new Array(_len103), _key103 = 0; _key103 < _len103; _key103++) {
- args[_key103] = arguments[_key103];
- }
- return builder.apply(void 0, ["EmptyTypeAnnotation"].concat(args));
- }
- function NullableTypeAnnotation() {
- for (var _len104 = arguments.length, args = new Array(_len104), _key104 = 0; _key104 < _len104; _key104++) {
- args[_key104] = arguments[_key104];
- }
- return builder.apply(void 0, ["NullableTypeAnnotation"].concat(args));
- }
- function NumberLiteralTypeAnnotation() {
- for (var _len105 = arguments.length, args = new Array(_len105), _key105 = 0; _key105 < _len105; _key105++) {
- args[_key105] = arguments[_key105];
- }
- return builder.apply(void 0, ["NumberLiteralTypeAnnotation"].concat(args));
- }
- function NumberTypeAnnotation() {
- for (var _len106 = arguments.length, args = new Array(_len106), _key106 = 0; _key106 < _len106; _key106++) {
- args[_key106] = arguments[_key106];
- }
- return builder.apply(void 0, ["NumberTypeAnnotation"].concat(args));
- }
- function ObjectTypeAnnotation() {
- for (var _len107 = arguments.length, args = new Array(_len107), _key107 = 0; _key107 < _len107; _key107++) {
- args[_key107] = arguments[_key107];
- }
- return builder.apply(void 0, ["ObjectTypeAnnotation"].concat(args));
- }
- function ObjectTypeInternalSlot() {
- for (var _len108 = arguments.length, args = new Array(_len108), _key108 = 0; _key108 < _len108; _key108++) {
- args[_key108] = arguments[_key108];
- }
- return builder.apply(void 0, ["ObjectTypeInternalSlot"].concat(args));
- }
- function ObjectTypeCallProperty() {
- for (var _len109 = arguments.length, args = new Array(_len109), _key109 = 0; _key109 < _len109; _key109++) {
- args[_key109] = arguments[_key109];
- }
- return builder.apply(void 0, ["ObjectTypeCallProperty"].concat(args));
- }
- function ObjectTypeIndexer() {
- for (var _len110 = arguments.length, args = new Array(_len110), _key110 = 0; _key110 < _len110; _key110++) {
- args[_key110] = arguments[_key110];
- }
- return builder.apply(void 0, ["ObjectTypeIndexer"].concat(args));
- }
- function ObjectTypeProperty() {
- for (var _len111 = arguments.length, args = new Array(_len111), _key111 = 0; _key111 < _len111; _key111++) {
- args[_key111] = arguments[_key111];
- }
- return builder.apply(void 0, ["ObjectTypeProperty"].concat(args));
- }
- function ObjectTypeSpreadProperty() {
- for (var _len112 = arguments.length, args = new Array(_len112), _key112 = 0; _key112 < _len112; _key112++) {
- args[_key112] = arguments[_key112];
- }
- return builder.apply(void 0, ["ObjectTypeSpreadProperty"].concat(args));
- }
- function OpaqueType() {
- for (var _len113 = arguments.length, args = new Array(_len113), _key113 = 0; _key113 < _len113; _key113++) {
- args[_key113] = arguments[_key113];
- }
- return builder.apply(void 0, ["OpaqueType"].concat(args));
- }
- function QualifiedTypeIdentifier() {
- for (var _len114 = arguments.length, args = new Array(_len114), _key114 = 0; _key114 < _len114; _key114++) {
- args[_key114] = arguments[_key114];
- }
- return builder.apply(void 0, ["QualifiedTypeIdentifier"].concat(args));
- }
- function StringLiteralTypeAnnotation() {
- for (var _len115 = arguments.length, args = new Array(_len115), _key115 = 0; _key115 < _len115; _key115++) {
- args[_key115] = arguments[_key115];
- }
- return builder.apply(void 0, ["StringLiteralTypeAnnotation"].concat(args));
- }
- function StringTypeAnnotation() {
- for (var _len116 = arguments.length, args = new Array(_len116), _key116 = 0; _key116 < _len116; _key116++) {
- args[_key116] = arguments[_key116];
- }
- return builder.apply(void 0, ["StringTypeAnnotation"].concat(args));
- }
- function ThisTypeAnnotation() {
- for (var _len117 = arguments.length, args = new Array(_len117), _key117 = 0; _key117 < _len117; _key117++) {
- args[_key117] = arguments[_key117];
- }
- return builder.apply(void 0, ["ThisTypeAnnotation"].concat(args));
- }
- function TupleTypeAnnotation() {
- for (var _len118 = arguments.length, args = new Array(_len118), _key118 = 0; _key118 < _len118; _key118++) {
- args[_key118] = arguments[_key118];
- }
- return builder.apply(void 0, ["TupleTypeAnnotation"].concat(args));
- }
- function TypeofTypeAnnotation() {
- for (var _len119 = arguments.length, args = new Array(_len119), _key119 = 0; _key119 < _len119; _key119++) {
- args[_key119] = arguments[_key119];
- }
- return builder.apply(void 0, ["TypeofTypeAnnotation"].concat(args));
- }
- function TypeAlias() {
- for (var _len120 = arguments.length, args = new Array(_len120), _key120 = 0; _key120 < _len120; _key120++) {
- args[_key120] = arguments[_key120];
- }
- return builder.apply(void 0, ["TypeAlias"].concat(args));
- }
- function TypeAnnotation() {
- for (var _len121 = arguments.length, args = new Array(_len121), _key121 = 0; _key121 < _len121; _key121++) {
- args[_key121] = arguments[_key121];
- }
- return builder.apply(void 0, ["TypeAnnotation"].concat(args));
- }
- function TypeCastExpression() {
- for (var _len122 = arguments.length, args = new Array(_len122), _key122 = 0; _key122 < _len122; _key122++) {
- args[_key122] = arguments[_key122];
- }
- return builder.apply(void 0, ["TypeCastExpression"].concat(args));
- }
- function TypeParameter() {
- for (var _len123 = arguments.length, args = new Array(_len123), _key123 = 0; _key123 < _len123; _key123++) {
- args[_key123] = arguments[_key123];
- }
- return builder.apply(void 0, ["TypeParameter"].concat(args));
- }
- function TypeParameterDeclaration() {
- for (var _len124 = arguments.length, args = new Array(_len124), _key124 = 0; _key124 < _len124; _key124++) {
- args[_key124] = arguments[_key124];
- }
- return builder.apply(void 0, ["TypeParameterDeclaration"].concat(args));
- }
- function TypeParameterInstantiation() {
- for (var _len125 = arguments.length, args = new Array(_len125), _key125 = 0; _key125 < _len125; _key125++) {
- args[_key125] = arguments[_key125];
- }
- return builder.apply(void 0, ["TypeParameterInstantiation"].concat(args));
- }
- function UnionTypeAnnotation() {
- for (var _len126 = arguments.length, args = new Array(_len126), _key126 = 0; _key126 < _len126; _key126++) {
- args[_key126] = arguments[_key126];
- }
- return builder.apply(void 0, ["UnionTypeAnnotation"].concat(args));
- }
- function Variance() {
- for (var _len127 = arguments.length, args = new Array(_len127), _key127 = 0; _key127 < _len127; _key127++) {
- args[_key127] = arguments[_key127];
- }
- return builder.apply(void 0, ["Variance"].concat(args));
- }
- function VoidTypeAnnotation() {
- for (var _len128 = arguments.length, args = new Array(_len128), _key128 = 0; _key128 < _len128; _key128++) {
- args[_key128] = arguments[_key128];
- }
- return builder.apply(void 0, ["VoidTypeAnnotation"].concat(args));
- }
- function EnumDeclaration() {
- for (var _len129 = arguments.length, args = new Array(_len129), _key129 = 0; _key129 < _len129; _key129++) {
- args[_key129] = arguments[_key129];
- }
- return builder.apply(void 0, ["EnumDeclaration"].concat(args));
- }
- function EnumBooleanBody() {
- for (var _len130 = arguments.length, args = new Array(_len130), _key130 = 0; _key130 < _len130; _key130++) {
- args[_key130] = arguments[_key130];
- }
- return builder.apply(void 0, ["EnumBooleanBody"].concat(args));
- }
- function EnumNumberBody() {
- for (var _len131 = arguments.length, args = new Array(_len131), _key131 = 0; _key131 < _len131; _key131++) {
- args[_key131] = arguments[_key131];
- }
- return builder.apply(void 0, ["EnumNumberBody"].concat(args));
- }
- function EnumStringBody() {
- for (var _len132 = arguments.length, args = new Array(_len132), _key132 = 0; _key132 < _len132; _key132++) {
- args[_key132] = arguments[_key132];
- }
- return builder.apply(void 0, ["EnumStringBody"].concat(args));
- }
- function EnumSymbolBody() {
- for (var _len133 = arguments.length, args = new Array(_len133), _key133 = 0; _key133 < _len133; _key133++) {
- args[_key133] = arguments[_key133];
- }
- return builder.apply(void 0, ["EnumSymbolBody"].concat(args));
- }
- function EnumBooleanMember() {
- for (var _len134 = arguments.length, args = new Array(_len134), _key134 = 0; _key134 < _len134; _key134++) {
- args[_key134] = arguments[_key134];
- }
- return builder.apply(void 0, ["EnumBooleanMember"].concat(args));
- }
- function EnumNumberMember() {
- for (var _len135 = arguments.length, args = new Array(_len135), _key135 = 0; _key135 < _len135; _key135++) {
- args[_key135] = arguments[_key135];
- }
- return builder.apply(void 0, ["EnumNumberMember"].concat(args));
- }
- function EnumStringMember() {
- for (var _len136 = arguments.length, args = new Array(_len136), _key136 = 0; _key136 < _len136; _key136++) {
- args[_key136] = arguments[_key136];
- }
- return builder.apply(void 0, ["EnumStringMember"].concat(args));
- }
- function EnumDefaultedMember() {
- for (var _len137 = arguments.length, args = new Array(_len137), _key137 = 0; _key137 < _len137; _key137++) {
- args[_key137] = arguments[_key137];
- }
- return builder.apply(void 0, ["EnumDefaultedMember"].concat(args));
- }
- function JSXAttribute() {
- for (var _len138 = arguments.length, args = new Array(_len138), _key138 = 0; _key138 < _len138; _key138++) {
- args[_key138] = arguments[_key138];
- }
- return builder.apply(void 0, ["JSXAttribute"].concat(args));
- }
- function JSXClosingElement() {
- for (var _len139 = arguments.length, args = new Array(_len139), _key139 = 0; _key139 < _len139; _key139++) {
- args[_key139] = arguments[_key139];
- }
- return builder.apply(void 0, ["JSXClosingElement"].concat(args));
- }
- function JSXElement() {
- for (var _len140 = arguments.length, args = new Array(_len140), _key140 = 0; _key140 < _len140; _key140++) {
- args[_key140] = arguments[_key140];
- }
- return builder.apply(void 0, ["JSXElement"].concat(args));
- }
- function JSXEmptyExpression() {
- for (var _len141 = arguments.length, args = new Array(_len141), _key141 = 0; _key141 < _len141; _key141++) {
- args[_key141] = arguments[_key141];
- }
- return builder.apply(void 0, ["JSXEmptyExpression"].concat(args));
- }
- function JSXExpressionContainer() {
- for (var _len142 = arguments.length, args = new Array(_len142), _key142 = 0; _key142 < _len142; _key142++) {
- args[_key142] = arguments[_key142];
- }
- return builder.apply(void 0, ["JSXExpressionContainer"].concat(args));
- }
- function JSXSpreadChild() {
- for (var _len143 = arguments.length, args = new Array(_len143), _key143 = 0; _key143 < _len143; _key143++) {
- args[_key143] = arguments[_key143];
- }
- return builder.apply(void 0, ["JSXSpreadChild"].concat(args));
- }
- function JSXIdentifier() {
- for (var _len144 = arguments.length, args = new Array(_len144), _key144 = 0; _key144 < _len144; _key144++) {
- args[_key144] = arguments[_key144];
- }
- return builder.apply(void 0, ["JSXIdentifier"].concat(args));
- }
- function JSXMemberExpression() {
- for (var _len145 = arguments.length, args = new Array(_len145), _key145 = 0; _key145 < _len145; _key145++) {
- args[_key145] = arguments[_key145];
- }
- return builder.apply(void 0, ["JSXMemberExpression"].concat(args));
- }
- function JSXNamespacedName() {
- for (var _len146 = arguments.length, args = new Array(_len146), _key146 = 0; _key146 < _len146; _key146++) {
- args[_key146] = arguments[_key146];
- }
- return builder.apply(void 0, ["JSXNamespacedName"].concat(args));
- }
- function JSXOpeningElement() {
- for (var _len147 = arguments.length, args = new Array(_len147), _key147 = 0; _key147 < _len147; _key147++) {
- args[_key147] = arguments[_key147];
- }
- return builder.apply(void 0, ["JSXOpeningElement"].concat(args));
- }
- function JSXSpreadAttribute() {
- for (var _len148 = arguments.length, args = new Array(_len148), _key148 = 0; _key148 < _len148; _key148++) {
- args[_key148] = arguments[_key148];
- }
- return builder.apply(void 0, ["JSXSpreadAttribute"].concat(args));
- }
- function JSXText() {
- for (var _len149 = arguments.length, args = new Array(_len149), _key149 = 0; _key149 < _len149; _key149++) {
- args[_key149] = arguments[_key149];
- }
- return builder.apply(void 0, ["JSXText"].concat(args));
- }
- function JSXFragment() {
- for (var _len150 = arguments.length, args = new Array(_len150), _key150 = 0; _key150 < _len150; _key150++) {
- args[_key150] = arguments[_key150];
- }
- return builder.apply(void 0, ["JSXFragment"].concat(args));
- }
- function JSXOpeningFragment() {
- for (var _len151 = arguments.length, args = new Array(_len151), _key151 = 0; _key151 < _len151; _key151++) {
- args[_key151] = arguments[_key151];
- }
- return builder.apply(void 0, ["JSXOpeningFragment"].concat(args));
- }
- function JSXClosingFragment() {
- for (var _len152 = arguments.length, args = new Array(_len152), _key152 = 0; _key152 < _len152; _key152++) {
- args[_key152] = arguments[_key152];
- }
- return builder.apply(void 0, ["JSXClosingFragment"].concat(args));
- }
- function Noop() {
- for (var _len153 = arguments.length, args = new Array(_len153), _key153 = 0; _key153 < _len153; _key153++) {
- args[_key153] = arguments[_key153];
- }
- return builder.apply(void 0, ["Noop"].concat(args));
- }
- function Placeholder() {
- for (var _len154 = arguments.length, args = new Array(_len154), _key154 = 0; _key154 < _len154; _key154++) {
- args[_key154] = arguments[_key154];
- }
- return builder.apply(void 0, ["Placeholder"].concat(args));
- }
- function V8IntrinsicIdentifier() {
- for (var _len155 = arguments.length, args = new Array(_len155), _key155 = 0; _key155 < _len155; _key155++) {
- args[_key155] = arguments[_key155];
- }
- return builder.apply(void 0, ["V8IntrinsicIdentifier"].concat(args));
- }
- function ArgumentPlaceholder() {
- for (var _len156 = arguments.length, args = new Array(_len156), _key156 = 0; _key156 < _len156; _key156++) {
- args[_key156] = arguments[_key156];
- }
- return builder.apply(void 0, ["ArgumentPlaceholder"].concat(args));
- }
- function AwaitExpression() {
- for (var _len157 = arguments.length, args = new Array(_len157), _key157 = 0; _key157 < _len157; _key157++) {
- args[_key157] = arguments[_key157];
- }
- return builder.apply(void 0, ["AwaitExpression"].concat(args));
- }
- function BindExpression() {
- for (var _len158 = arguments.length, args = new Array(_len158), _key158 = 0; _key158 < _len158; _key158++) {
- args[_key158] = arguments[_key158];
- }
- return builder.apply(void 0, ["BindExpression"].concat(args));
- }
- function ClassProperty() {
- for (var _len159 = arguments.length, args = new Array(_len159), _key159 = 0; _key159 < _len159; _key159++) {
- args[_key159] = arguments[_key159];
- }
- return builder.apply(void 0, ["ClassProperty"].concat(args));
- }
- function OptionalMemberExpression() {
- for (var _len160 = arguments.length, args = new Array(_len160), _key160 = 0; _key160 < _len160; _key160++) {
- args[_key160] = arguments[_key160];
- }
- return builder.apply(void 0, ["OptionalMemberExpression"].concat(args));
- }
- function PipelineTopicExpression() {
- for (var _len161 = arguments.length, args = new Array(_len161), _key161 = 0; _key161 < _len161; _key161++) {
- args[_key161] = arguments[_key161];
- }
- return builder.apply(void 0, ["PipelineTopicExpression"].concat(args));
- }
- function PipelineBareFunction() {
- for (var _len162 = arguments.length, args = new Array(_len162), _key162 = 0; _key162 < _len162; _key162++) {
- args[_key162] = arguments[_key162];
- }
- return builder.apply(void 0, ["PipelineBareFunction"].concat(args));
- }
- function PipelinePrimaryTopicReference() {
- for (var _len163 = arguments.length, args = new Array(_len163), _key163 = 0; _key163 < _len163; _key163++) {
- args[_key163] = arguments[_key163];
- }
- return builder.apply(void 0, ["PipelinePrimaryTopicReference"].concat(args));
- }
- function OptionalCallExpression() {
- for (var _len164 = arguments.length, args = new Array(_len164), _key164 = 0; _key164 < _len164; _key164++) {
- args[_key164] = arguments[_key164];
- }
- return builder.apply(void 0, ["OptionalCallExpression"].concat(args));
- }
- function ClassPrivateProperty() {
- for (var _len165 = arguments.length, args = new Array(_len165), _key165 = 0; _key165 < _len165; _key165++) {
- args[_key165] = arguments[_key165];
- }
- return builder.apply(void 0, ["ClassPrivateProperty"].concat(args));
- }
- function ClassPrivateMethod() {
- for (var _len166 = arguments.length, args = new Array(_len166), _key166 = 0; _key166 < _len166; _key166++) {
- args[_key166] = arguments[_key166];
- }
- return builder.apply(void 0, ["ClassPrivateMethod"].concat(args));
- }
- function Import() {
- for (var _len167 = arguments.length, args = new Array(_len167), _key167 = 0; _key167 < _len167; _key167++) {
- args[_key167] = arguments[_key167];
- }
- return builder.apply(void 0, ["Import"].concat(args));
- }
- function Decorator() {
- for (var _len168 = arguments.length, args = new Array(_len168), _key168 = 0; _key168 < _len168; _key168++) {
- args[_key168] = arguments[_key168];
- }
- return builder.apply(void 0, ["Decorator"].concat(args));
- }
- function DoExpression() {
- for (var _len169 = arguments.length, args = new Array(_len169), _key169 = 0; _key169 < _len169; _key169++) {
- args[_key169] = arguments[_key169];
- }
- return builder.apply(void 0, ["DoExpression"].concat(args));
- }
- function ExportDefaultSpecifier() {
- for (var _len170 = arguments.length, args = new Array(_len170), _key170 = 0; _key170 < _len170; _key170++) {
- args[_key170] = arguments[_key170];
- }
- return builder.apply(void 0, ["ExportDefaultSpecifier"].concat(args));
- }
- function ExportNamespaceSpecifier() {
- for (var _len171 = arguments.length, args = new Array(_len171), _key171 = 0; _key171 < _len171; _key171++) {
- args[_key171] = arguments[_key171];
- }
- return builder.apply(void 0, ["ExportNamespaceSpecifier"].concat(args));
- }
- function PrivateName() {
- for (var _len172 = arguments.length, args = new Array(_len172), _key172 = 0; _key172 < _len172; _key172++) {
- args[_key172] = arguments[_key172];
- }
- return builder.apply(void 0, ["PrivateName"].concat(args));
- }
- function BigIntLiteral() {
- for (var _len173 = arguments.length, args = new Array(_len173), _key173 = 0; _key173 < _len173; _key173++) {
- args[_key173] = arguments[_key173];
- }
- return builder.apply(void 0, ["BigIntLiteral"].concat(args));
- }
- function TSParameterProperty() {
- for (var _len174 = arguments.length, args = new Array(_len174), _key174 = 0; _key174 < _len174; _key174++) {
- args[_key174] = arguments[_key174];
- }
- return builder.apply(void 0, ["TSParameterProperty"].concat(args));
- }
- function TSDeclareFunction() {
- for (var _len175 = arguments.length, args = new Array(_len175), _key175 = 0; _key175 < _len175; _key175++) {
- args[_key175] = arguments[_key175];
- }
- return builder.apply(void 0, ["TSDeclareFunction"].concat(args));
- }
- function TSDeclareMethod() {
- for (var _len176 = arguments.length, args = new Array(_len176), _key176 = 0; _key176 < _len176; _key176++) {
- args[_key176] = arguments[_key176];
- }
- return builder.apply(void 0, ["TSDeclareMethod"].concat(args));
- }
- function TSQualifiedName() {
- for (var _len177 = arguments.length, args = new Array(_len177), _key177 = 0; _key177 < _len177; _key177++) {
- args[_key177] = arguments[_key177];
- }
- return builder.apply(void 0, ["TSQualifiedName"].concat(args));
- }
- function TSCallSignatureDeclaration() {
- for (var _len178 = arguments.length, args = new Array(_len178), _key178 = 0; _key178 < _len178; _key178++) {
- args[_key178] = arguments[_key178];
- }
- return builder.apply(void 0, ["TSCallSignatureDeclaration"].concat(args));
- }
- function TSConstructSignatureDeclaration() {
- for (var _len179 = arguments.length, args = new Array(_len179), _key179 = 0; _key179 < _len179; _key179++) {
- args[_key179] = arguments[_key179];
- }
- return builder.apply(void 0, ["TSConstructSignatureDeclaration"].concat(args));
- }
- function TSPropertySignature() {
- for (var _len180 = arguments.length, args = new Array(_len180), _key180 = 0; _key180 < _len180; _key180++) {
- args[_key180] = arguments[_key180];
- }
- return builder.apply(void 0, ["TSPropertySignature"].concat(args));
- }
- function TSMethodSignature() {
- for (var _len181 = arguments.length, args = new Array(_len181), _key181 = 0; _key181 < _len181; _key181++) {
- args[_key181] = arguments[_key181];
- }
- return builder.apply(void 0, ["TSMethodSignature"].concat(args));
- }
- function TSIndexSignature() {
- for (var _len182 = arguments.length, args = new Array(_len182), _key182 = 0; _key182 < _len182; _key182++) {
- args[_key182] = arguments[_key182];
- }
- return builder.apply(void 0, ["TSIndexSignature"].concat(args));
- }
- function TSAnyKeyword() {
- for (var _len183 = arguments.length, args = new Array(_len183), _key183 = 0; _key183 < _len183; _key183++) {
- args[_key183] = arguments[_key183];
- }
- return builder.apply(void 0, ["TSAnyKeyword"].concat(args));
- }
- function TSBooleanKeyword() {
- for (var _len184 = arguments.length, args = new Array(_len184), _key184 = 0; _key184 < _len184; _key184++) {
- args[_key184] = arguments[_key184];
- }
- return builder.apply(void 0, ["TSBooleanKeyword"].concat(args));
- }
- function TSBigIntKeyword() {
- for (var _len185 = arguments.length, args = new Array(_len185), _key185 = 0; _key185 < _len185; _key185++) {
- args[_key185] = arguments[_key185];
- }
- return builder.apply(void 0, ["TSBigIntKeyword"].concat(args));
- }
- function TSNeverKeyword() {
- for (var _len186 = arguments.length, args = new Array(_len186), _key186 = 0; _key186 < _len186; _key186++) {
- args[_key186] = arguments[_key186];
- }
- return builder.apply(void 0, ["TSNeverKeyword"].concat(args));
- }
- function TSNullKeyword() {
- for (var _len187 = arguments.length, args = new Array(_len187), _key187 = 0; _key187 < _len187; _key187++) {
- args[_key187] = arguments[_key187];
- }
- return builder.apply(void 0, ["TSNullKeyword"].concat(args));
- }
- function TSNumberKeyword() {
- for (var _len188 = arguments.length, args = new Array(_len188), _key188 = 0; _key188 < _len188; _key188++) {
- args[_key188] = arguments[_key188];
- }
- return builder.apply(void 0, ["TSNumberKeyword"].concat(args));
- }
- function TSObjectKeyword() {
- for (var _len189 = arguments.length, args = new Array(_len189), _key189 = 0; _key189 < _len189; _key189++) {
- args[_key189] = arguments[_key189];
- }
- return builder.apply(void 0, ["TSObjectKeyword"].concat(args));
- }
- function TSStringKeyword() {
- for (var _len190 = arguments.length, args = new Array(_len190), _key190 = 0; _key190 < _len190; _key190++) {
- args[_key190] = arguments[_key190];
- }
- return builder.apply(void 0, ["TSStringKeyword"].concat(args));
- }
- function TSSymbolKeyword() {
- for (var _len191 = arguments.length, args = new Array(_len191), _key191 = 0; _key191 < _len191; _key191++) {
- args[_key191] = arguments[_key191];
- }
- return builder.apply(void 0, ["TSSymbolKeyword"].concat(args));
- }
- function TSUndefinedKeyword() {
- for (var _len192 = arguments.length, args = new Array(_len192), _key192 = 0; _key192 < _len192; _key192++) {
- args[_key192] = arguments[_key192];
- }
- return builder.apply(void 0, ["TSUndefinedKeyword"].concat(args));
- }
- function TSUnknownKeyword() {
- for (var _len193 = arguments.length, args = new Array(_len193), _key193 = 0; _key193 < _len193; _key193++) {
- args[_key193] = arguments[_key193];
- }
- return builder.apply(void 0, ["TSUnknownKeyword"].concat(args));
- }
- function TSVoidKeyword() {
- for (var _len194 = arguments.length, args = new Array(_len194), _key194 = 0; _key194 < _len194; _key194++) {
- args[_key194] = arguments[_key194];
- }
- return builder.apply(void 0, ["TSVoidKeyword"].concat(args));
- }
- function TSThisType() {
- for (var _len195 = arguments.length, args = new Array(_len195), _key195 = 0; _key195 < _len195; _key195++) {
- args[_key195] = arguments[_key195];
- }
- return builder.apply(void 0, ["TSThisType"].concat(args));
- }
- function TSFunctionType() {
- for (var _len196 = arguments.length, args = new Array(_len196), _key196 = 0; _key196 < _len196; _key196++) {
- args[_key196] = arguments[_key196];
- }
- return builder.apply(void 0, ["TSFunctionType"].concat(args));
- }
- function TSConstructorType() {
- for (var _len197 = arguments.length, args = new Array(_len197), _key197 = 0; _key197 < _len197; _key197++) {
- args[_key197] = arguments[_key197];
- }
- return builder.apply(void 0, ["TSConstructorType"].concat(args));
- }
- function TSTypeReference() {
- for (var _len198 = arguments.length, args = new Array(_len198), _key198 = 0; _key198 < _len198; _key198++) {
- args[_key198] = arguments[_key198];
- }
- return builder.apply(void 0, ["TSTypeReference"].concat(args));
- }
- function TSTypePredicate() {
- for (var _len199 = arguments.length, args = new Array(_len199), _key199 = 0; _key199 < _len199; _key199++) {
- args[_key199] = arguments[_key199];
- }
- return builder.apply(void 0, ["TSTypePredicate"].concat(args));
- }
- function TSTypeQuery() {
- for (var _len200 = arguments.length, args = new Array(_len200), _key200 = 0; _key200 < _len200; _key200++) {
- args[_key200] = arguments[_key200];
- }
- return builder.apply(void 0, ["TSTypeQuery"].concat(args));
- }
- function TSTypeLiteral() {
- for (var _len201 = arguments.length, args = new Array(_len201), _key201 = 0; _key201 < _len201; _key201++) {
- args[_key201] = arguments[_key201];
- }
- return builder.apply(void 0, ["TSTypeLiteral"].concat(args));
- }
- function TSArrayType() {
- for (var _len202 = arguments.length, args = new Array(_len202), _key202 = 0; _key202 < _len202; _key202++) {
- args[_key202] = arguments[_key202];
- }
- return builder.apply(void 0, ["TSArrayType"].concat(args));
- }
- function TSTupleType() {
- for (var _len203 = arguments.length, args = new Array(_len203), _key203 = 0; _key203 < _len203; _key203++) {
- args[_key203] = arguments[_key203];
- }
- return builder.apply(void 0, ["TSTupleType"].concat(args));
- }
- function TSOptionalType() {
- for (var _len204 = arguments.length, args = new Array(_len204), _key204 = 0; _key204 < _len204; _key204++) {
- args[_key204] = arguments[_key204];
- }
- return builder.apply(void 0, ["TSOptionalType"].concat(args));
- }
- function TSRestType() {
- for (var _len205 = arguments.length, args = new Array(_len205), _key205 = 0; _key205 < _len205; _key205++) {
- args[_key205] = arguments[_key205];
- }
- return builder.apply(void 0, ["TSRestType"].concat(args));
- }
- function TSUnionType() {
- for (var _len206 = arguments.length, args = new Array(_len206), _key206 = 0; _key206 < _len206; _key206++) {
- args[_key206] = arguments[_key206];
- }
- return builder.apply(void 0, ["TSUnionType"].concat(args));
- }
- function TSIntersectionType() {
- for (var _len207 = arguments.length, args = new Array(_len207), _key207 = 0; _key207 < _len207; _key207++) {
- args[_key207] = arguments[_key207];
- }
- return builder.apply(void 0, ["TSIntersectionType"].concat(args));
- }
- function TSConditionalType() {
- for (var _len208 = arguments.length, args = new Array(_len208), _key208 = 0; _key208 < _len208; _key208++) {
- args[_key208] = arguments[_key208];
- }
- return builder.apply(void 0, ["TSConditionalType"].concat(args));
- }
- function TSInferType() {
- for (var _len209 = arguments.length, args = new Array(_len209), _key209 = 0; _key209 < _len209; _key209++) {
- args[_key209] = arguments[_key209];
- }
- return builder.apply(void 0, ["TSInferType"].concat(args));
- }
- function TSParenthesizedType() {
- for (var _len210 = arguments.length, args = new Array(_len210), _key210 = 0; _key210 < _len210; _key210++) {
- args[_key210] = arguments[_key210];
- }
- return builder.apply(void 0, ["TSParenthesizedType"].concat(args));
- }
- function TSTypeOperator() {
- for (var _len211 = arguments.length, args = new Array(_len211), _key211 = 0; _key211 < _len211; _key211++) {
- args[_key211] = arguments[_key211];
- }
- return builder.apply(void 0, ["TSTypeOperator"].concat(args));
- }
- function TSIndexedAccessType() {
- for (var _len212 = arguments.length, args = new Array(_len212), _key212 = 0; _key212 < _len212; _key212++) {
- args[_key212] = arguments[_key212];
- }
- return builder.apply(void 0, ["TSIndexedAccessType"].concat(args));
- }
- function TSMappedType() {
- for (var _len213 = arguments.length, args = new Array(_len213), _key213 = 0; _key213 < _len213; _key213++) {
- args[_key213] = arguments[_key213];
- }
- return builder.apply(void 0, ["TSMappedType"].concat(args));
- }
- function TSLiteralType() {
- for (var _len214 = arguments.length, args = new Array(_len214), _key214 = 0; _key214 < _len214; _key214++) {
- args[_key214] = arguments[_key214];
- }
- return builder.apply(void 0, ["TSLiteralType"].concat(args));
- }
- function TSExpressionWithTypeArguments() {
- for (var _len215 = arguments.length, args = new Array(_len215), _key215 = 0; _key215 < _len215; _key215++) {
- args[_key215] = arguments[_key215];
- }
- return builder.apply(void 0, ["TSExpressionWithTypeArguments"].concat(args));
- }
- function TSInterfaceDeclaration() {
- for (var _len216 = arguments.length, args = new Array(_len216), _key216 = 0; _key216 < _len216; _key216++) {
- args[_key216] = arguments[_key216];
- }
- return builder.apply(void 0, ["TSInterfaceDeclaration"].concat(args));
- }
- function TSInterfaceBody() {
- for (var _len217 = arguments.length, args = new Array(_len217), _key217 = 0; _key217 < _len217; _key217++) {
- args[_key217] = arguments[_key217];
- }
- return builder.apply(void 0, ["TSInterfaceBody"].concat(args));
- }
- function TSTypeAliasDeclaration() {
- for (var _len218 = arguments.length, args = new Array(_len218), _key218 = 0; _key218 < _len218; _key218++) {
- args[_key218] = arguments[_key218];
- }
- return builder.apply(void 0, ["TSTypeAliasDeclaration"].concat(args));
- }
- function TSAsExpression() {
- for (var _len219 = arguments.length, args = new Array(_len219), _key219 = 0; _key219 < _len219; _key219++) {
- args[_key219] = arguments[_key219];
- }
- return builder.apply(void 0, ["TSAsExpression"].concat(args));
- }
- function TSTypeAssertion() {
- for (var _len220 = arguments.length, args = new Array(_len220), _key220 = 0; _key220 < _len220; _key220++) {
- args[_key220] = arguments[_key220];
- }
- return builder.apply(void 0, ["TSTypeAssertion"].concat(args));
- }
- function TSEnumDeclaration() {
- for (var _len221 = arguments.length, args = new Array(_len221), _key221 = 0; _key221 < _len221; _key221++) {
- args[_key221] = arguments[_key221];
- }
- return builder.apply(void 0, ["TSEnumDeclaration"].concat(args));
- }
- function TSEnumMember() {
- for (var _len222 = arguments.length, args = new Array(_len222), _key222 = 0; _key222 < _len222; _key222++) {
- args[_key222] = arguments[_key222];
- }
- return builder.apply(void 0, ["TSEnumMember"].concat(args));
- }
- function TSModuleDeclaration() {
- for (var _len223 = arguments.length, args = new Array(_len223), _key223 = 0; _key223 < _len223; _key223++) {
- args[_key223] = arguments[_key223];
- }
- return builder.apply(void 0, ["TSModuleDeclaration"].concat(args));
- }
- function TSModuleBlock() {
- for (var _len224 = arguments.length, args = new Array(_len224), _key224 = 0; _key224 < _len224; _key224++) {
- args[_key224] = arguments[_key224];
- }
- return builder.apply(void 0, ["TSModuleBlock"].concat(args));
- }
- function TSImportType() {
- for (var _len225 = arguments.length, args = new Array(_len225), _key225 = 0; _key225 < _len225; _key225++) {
- args[_key225] = arguments[_key225];
- }
- return builder.apply(void 0, ["TSImportType"].concat(args));
- }
- function TSImportEqualsDeclaration() {
- for (var _len226 = arguments.length, args = new Array(_len226), _key226 = 0; _key226 < _len226; _key226++) {
- args[_key226] = arguments[_key226];
- }
- return builder.apply(void 0, ["TSImportEqualsDeclaration"].concat(args));
- }
- function TSExternalModuleReference() {
- for (var _len227 = arguments.length, args = new Array(_len227), _key227 = 0; _key227 < _len227; _key227++) {
- args[_key227] = arguments[_key227];
- }
- return builder.apply(void 0, ["TSExternalModuleReference"].concat(args));
- }
- function TSNonNullExpression() {
- for (var _len228 = arguments.length, args = new Array(_len228), _key228 = 0; _key228 < _len228; _key228++) {
- args[_key228] = arguments[_key228];
- }
- return builder.apply(void 0, ["TSNonNullExpression"].concat(args));
- }
- function TSExportAssignment() {
- for (var _len229 = arguments.length, args = new Array(_len229), _key229 = 0; _key229 < _len229; _key229++) {
- args[_key229] = arguments[_key229];
- }
- return builder.apply(void 0, ["TSExportAssignment"].concat(args));
- }
- function TSNamespaceExportDeclaration() {
- for (var _len230 = arguments.length, args = new Array(_len230), _key230 = 0; _key230 < _len230; _key230++) {
- args[_key230] = arguments[_key230];
- }
- return builder.apply(void 0, ["TSNamespaceExportDeclaration"].concat(args));
- }
- function TSTypeAnnotation() {
- for (var _len231 = arguments.length, args = new Array(_len231), _key231 = 0; _key231 < _len231; _key231++) {
- args[_key231] = arguments[_key231];
- }
- return builder.apply(void 0, ["TSTypeAnnotation"].concat(args));
- }
- function TSTypeParameterInstantiation() {
- for (var _len232 = arguments.length, args = new Array(_len232), _key232 = 0; _key232 < _len232; _key232++) {
- args[_key232] = arguments[_key232];
- }
- return builder.apply(void 0, ["TSTypeParameterInstantiation"].concat(args));
- }
- function TSTypeParameterDeclaration() {
- for (var _len233 = arguments.length, args = new Array(_len233), _key233 = 0; _key233 < _len233; _key233++) {
- args[_key233] = arguments[_key233];
- }
- return builder.apply(void 0, ["TSTypeParameterDeclaration"].concat(args));
- }
- function TSTypeParameter() {
- for (var _len234 = arguments.length, args = new Array(_len234), _key234 = 0; _key234 < _len234; _key234++) {
- args[_key234] = arguments[_key234];
- }
- return builder.apply(void 0, ["TSTypeParameter"].concat(args));
- }
- function NumberLiteral() {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- for (var _len235 = arguments.length, args = new Array(_len235), _key235 = 0; _key235 < _len235; _key235++) {
- args[_key235] = arguments[_key235];
- }
- return NumberLiteral.apply(void 0, ["NumberLiteral"].concat(args));
- }
- function RegexLiteral() {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- for (var _len236 = arguments.length, args = new Array(_len236), _key236 = 0; _key236 < _len236; _key236++) {
- args[_key236] = arguments[_key236];
- }
- return RegexLiteral.apply(void 0, ["RegexLiteral"].concat(args));
- }
- function RestProperty() {
- console.trace("The node type RestProperty has been renamed to RestElement");
- for (var _len237 = arguments.length, args = new Array(_len237), _key237 = 0; _key237 < _len237; _key237++) {
- args[_key237] = arguments[_key237];
- }
- return RestProperty.apply(void 0, ["RestProperty"].concat(args));
- }
- function SpreadProperty() {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- for (var _len238 = arguments.length, args = new Array(_len238), _key238 = 0; _key238 < _len238; _key238++) {
- args[_key238] = arguments[_key238];
- }
- return SpreadProperty.apply(void 0, ["SpreadProperty"].concat(args));
- }
- function cleanJSXElementLiteralChild(child, args) {
- var lines = child.value.split(/\r\n|\n|\r/);
- var lastNonEmptyLine = 0;
- for (var i = 0; i < lines.length; i++) {
- if (lines[i].match(/[^ \t]/)) {
- lastNonEmptyLine = i;
- }
- }
- var str = "";
- for (var _i = 0; _i < lines.length; _i++) {
- var line = lines[_i];
- var isFirstLine = _i === 0;
- var isLastLine = _i === lines.length - 1;
- var isLastNonEmptyLine = _i === lastNonEmptyLine;
- var trimmedLine = line.replace(/\t/g, " ");
- if (!isFirstLine) {
- trimmedLine = trimmedLine.replace(/^[ ]+/, "");
- }
- if (!isLastLine) {
- trimmedLine = trimmedLine.replace(/[ ]+$/, "");
- }
- if (trimmedLine) {
- if (!isLastNonEmptyLine) {
- trimmedLine += " ";
- }
- str += trimmedLine;
- }
- }
- if (str) args.push(StringLiteral(str));
- }
- function buildChildren(node) {
- var elements = [];
- for (var i = 0; i < node.children.length; i++) {
- var child = node.children[i];
- if (isJSXText(child)) {
- cleanJSXElementLiteralChild(child, elements);
- continue;
- }
- if (isJSXExpressionContainer(child)) child = child.expression;
- if (isJSXEmptyExpression(child)) continue;
- elements.push(child);
- }
- return elements;
- }
- function isNode(node) {
- return !!(node && VISITOR_KEYS[node.type]);
- }
- function assertNode(node) {
- if (!isNode(node)) {
- var type = node && node.type || JSON.stringify(node);
- throw new TypeError("Not a valid node of type \"" + type + "\"");
- }
- }
- function assert(type, node, opts) {
- if (!is(type, node, opts)) {
- throw new Error("Expected type \"" + type + "\" with option " + JSON.stringify(opts) + ", " + ("but instead got \"" + node.type + "\"."));
- }
- }
- function assertArrayExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ArrayExpression", node, opts);
- }
- function assertAssignmentExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("AssignmentExpression", node, opts);
- }
- function assertBinaryExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BinaryExpression", node, opts);
- }
- function assertInterpreterDirective(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("InterpreterDirective", node, opts);
- }
- function assertDirective(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Directive", node, opts);
- }
- function assertDirectiveLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DirectiveLiteral", node, opts);
- }
- function assertBlockStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BlockStatement", node, opts);
- }
- function assertBreakStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BreakStatement", node, opts);
- }
- function assertCallExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("CallExpression", node, opts);
- }
- function assertCatchClause(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("CatchClause", node, opts);
- }
- function assertConditionalExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ConditionalExpression", node, opts);
- }
- function assertContinueStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ContinueStatement", node, opts);
- }
- function assertDebuggerStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DebuggerStatement", node, opts);
- }
- function assertDoWhileStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DoWhileStatement", node, opts);
- }
- function assertEmptyStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EmptyStatement", node, opts);
- }
- function assertExpressionStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExpressionStatement", node, opts);
- }
- function assertFile(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("File", node, opts);
- }
- function assertForInStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ForInStatement", node, opts);
- }
- function assertForStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ForStatement", node, opts);
- }
- function assertFunctionDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FunctionDeclaration", node, opts);
- }
- function assertFunctionExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FunctionExpression", node, opts);
- }
- function assertIdentifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Identifier", node, opts);
- }
- function assertIfStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("IfStatement", node, opts);
- }
- function assertLabeledStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("LabeledStatement", node, opts);
- }
- function assertStringLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("StringLiteral", node, opts);
- }
- function assertNumericLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NumericLiteral", node, opts);
- }
- function assertNullLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NullLiteral", node, opts);
- }
- function assertBooleanLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BooleanLiteral", node, opts);
- }
- function assertRegExpLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("RegExpLiteral", node, opts);
- }
- function assertLogicalExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("LogicalExpression", node, opts);
- }
- function assertMemberExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("MemberExpression", node, opts);
- }
- function assertNewExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NewExpression", node, opts);
- }
- function assertProgram(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Program", node, opts);
- }
- function assertObjectExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectExpression", node, opts);
- }
- function assertObjectMethod(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectMethod", node, opts);
- }
- function assertObjectProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectProperty", node, opts);
- }
- function assertRestElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("RestElement", node, opts);
- }
- function assertReturnStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ReturnStatement", node, opts);
- }
- function assertSequenceExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("SequenceExpression", node, opts);
- }
- function assertParenthesizedExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ParenthesizedExpression", node, opts);
- }
- function assertSwitchCase(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("SwitchCase", node, opts);
- }
- function assertSwitchStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("SwitchStatement", node, opts);
- }
- function assertThisExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ThisExpression", node, opts);
- }
- function assertThrowStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ThrowStatement", node, opts);
- }
- function assertTryStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TryStatement", node, opts);
- }
- function assertUnaryExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("UnaryExpression", node, opts);
- }
- function assertUpdateExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("UpdateExpression", node, opts);
- }
- function assertVariableDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("VariableDeclaration", node, opts);
- }
- function assertVariableDeclarator(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("VariableDeclarator", node, opts);
- }
- function assertWhileStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("WhileStatement", node, opts);
- }
- function assertWithStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("WithStatement", node, opts);
- }
- function assertAssignmentPattern(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("AssignmentPattern", node, opts);
- }
- function assertArrayPattern(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ArrayPattern", node, opts);
- }
- function assertArrowFunctionExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ArrowFunctionExpression", node, opts);
- }
- function assertClassBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassBody", node, opts);
- }
- function assertClassExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassExpression", node, opts);
- }
- function assertClassDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassDeclaration", node, opts);
- }
- function assertExportAllDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportAllDeclaration", node, opts);
- }
- function assertExportDefaultDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportDefaultDeclaration", node, opts);
- }
- function assertExportNamedDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportNamedDeclaration", node, opts);
- }
- function assertExportSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportSpecifier", node, opts);
- }
- function assertForOfStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ForOfStatement", node, opts);
- }
- function assertImportDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ImportDeclaration", node, opts);
- }
- function assertImportDefaultSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ImportDefaultSpecifier", node, opts);
- }
- function assertImportNamespaceSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ImportNamespaceSpecifier", node, opts);
- }
- function assertImportSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ImportSpecifier", node, opts);
- }
- function assertMetaProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("MetaProperty", node, opts);
- }
- function assertClassMethod(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassMethod", node, opts);
- }
- function assertObjectPattern(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectPattern", node, opts);
- }
- function assertSpreadElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("SpreadElement", node, opts);
- }
- function assertSuper(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Super", node, opts);
- }
- function assertTaggedTemplateExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TaggedTemplateExpression", node, opts);
- }
- function assertTemplateElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TemplateElement", node, opts);
- }
- function assertTemplateLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TemplateLiteral", node, opts);
- }
- function assertYieldExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("YieldExpression", node, opts);
- }
- function assertAnyTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("AnyTypeAnnotation", node, opts);
- }
- function assertArrayTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ArrayTypeAnnotation", node, opts);
- }
- function assertBooleanTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BooleanTypeAnnotation", node, opts);
- }
- function assertBooleanLiteralTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BooleanLiteralTypeAnnotation", node, opts);
- }
- function assertNullLiteralTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NullLiteralTypeAnnotation", node, opts);
- }
- function assertClassImplements(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassImplements", node, opts);
- }
- function assertDeclareClass(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareClass", node, opts);
- }
- function assertDeclareFunction(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareFunction", node, opts);
- }
- function assertDeclareInterface(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareInterface", node, opts);
- }
- function assertDeclareModule(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareModule", node, opts);
- }
- function assertDeclareModuleExports(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareModuleExports", node, opts);
- }
- function assertDeclareTypeAlias(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareTypeAlias", node, opts);
- }
- function assertDeclareOpaqueType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareOpaqueType", node, opts);
- }
- function assertDeclareVariable(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareVariable", node, opts);
- }
- function assertDeclareExportDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareExportDeclaration", node, opts);
- }
- function assertDeclareExportAllDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclareExportAllDeclaration", node, opts);
- }
- function assertDeclaredPredicate(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DeclaredPredicate", node, opts);
- }
- function assertExistsTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExistsTypeAnnotation", node, opts);
- }
- function assertFunctionTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FunctionTypeAnnotation", node, opts);
- }
- function assertFunctionTypeParam(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FunctionTypeParam", node, opts);
- }
- function assertGenericTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("GenericTypeAnnotation", node, opts);
- }
- function assertInferredPredicate(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("InferredPredicate", node, opts);
- }
- function assertInterfaceExtends(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("InterfaceExtends", node, opts);
- }
- function assertInterfaceDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("InterfaceDeclaration", node, opts);
- }
- function assertInterfaceTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("InterfaceTypeAnnotation", node, opts);
- }
- function assertIntersectionTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("IntersectionTypeAnnotation", node, opts);
- }
- function assertMixedTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("MixedTypeAnnotation", node, opts);
- }
- function assertEmptyTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EmptyTypeAnnotation", node, opts);
- }
- function assertNullableTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NullableTypeAnnotation", node, opts);
- }
- function assertNumberLiteralTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NumberLiteralTypeAnnotation", node, opts);
- }
- function assertNumberTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("NumberTypeAnnotation", node, opts);
- }
- function assertObjectTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeAnnotation", node, opts);
- }
- function assertObjectTypeInternalSlot(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeInternalSlot", node, opts);
- }
- function assertObjectTypeCallProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeCallProperty", node, opts);
- }
- function assertObjectTypeIndexer(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeIndexer", node, opts);
- }
- function assertObjectTypeProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeProperty", node, opts);
- }
- function assertObjectTypeSpreadProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectTypeSpreadProperty", node, opts);
- }
- function assertOpaqueType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("OpaqueType", node, opts);
- }
- function assertQualifiedTypeIdentifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("QualifiedTypeIdentifier", node, opts);
- }
- function assertStringLiteralTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("StringLiteralTypeAnnotation", node, opts);
- }
- function assertStringTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("StringTypeAnnotation", node, opts);
- }
- function assertThisTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ThisTypeAnnotation", node, opts);
- }
- function assertTupleTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TupleTypeAnnotation", node, opts);
- }
- function assertTypeofTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeofTypeAnnotation", node, opts);
- }
- function assertTypeAlias(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeAlias", node, opts);
- }
- function assertTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeAnnotation", node, opts);
- }
- function assertTypeCastExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeCastExpression", node, opts);
- }
- function assertTypeParameter(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeParameter", node, opts);
- }
- function assertTypeParameterDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeParameterDeclaration", node, opts);
- }
- function assertTypeParameterInstantiation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TypeParameterInstantiation", node, opts);
- }
- function assertUnionTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("UnionTypeAnnotation", node, opts);
- }
- function assertVariance(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Variance", node, opts);
- }
- function assertVoidTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("VoidTypeAnnotation", node, opts);
- }
- function assertEnumDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumDeclaration", node, opts);
- }
- function assertEnumBooleanBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumBooleanBody", node, opts);
- }
- function assertEnumNumberBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumNumberBody", node, opts);
- }
- function assertEnumStringBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumStringBody", node, opts);
- }
- function assertEnumSymbolBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumSymbolBody", node, opts);
- }
- function assertEnumBooleanMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumBooleanMember", node, opts);
- }
- function assertEnumNumberMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumNumberMember", node, opts);
- }
- function assertEnumStringMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumStringMember", node, opts);
- }
- function assertEnumDefaultedMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumDefaultedMember", node, opts);
- }
- function assertJSXAttribute(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXAttribute", node, opts);
- }
- function assertJSXClosingElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXClosingElement", node, opts);
- }
- function assertJSXElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXElement", node, opts);
- }
- function assertJSXEmptyExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXEmptyExpression", node, opts);
- }
- function assertJSXExpressionContainer(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXExpressionContainer", node, opts);
- }
- function assertJSXSpreadChild(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXSpreadChild", node, opts);
- }
- function assertJSXIdentifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXIdentifier", node, opts);
- }
- function assertJSXMemberExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXMemberExpression", node, opts);
- }
- function assertJSXNamespacedName(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXNamespacedName", node, opts);
- }
- function assertJSXOpeningElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXOpeningElement", node, opts);
- }
- function assertJSXSpreadAttribute(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXSpreadAttribute", node, opts);
- }
- function assertJSXText(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXText", node, opts);
- }
- function assertJSXFragment(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXFragment", node, opts);
- }
- function assertJSXOpeningFragment(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXOpeningFragment", node, opts);
- }
- function assertJSXClosingFragment(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSXClosingFragment", node, opts);
- }
- function assertNoop(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Noop", node, opts);
- }
- function assertPlaceholder(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Placeholder", node, opts);
- }
- function assertV8IntrinsicIdentifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("V8IntrinsicIdentifier", node, opts);
- }
- function assertArgumentPlaceholder(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ArgumentPlaceholder", node, opts);
- }
- function assertAwaitExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("AwaitExpression", node, opts);
- }
- function assertBindExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BindExpression", node, opts);
- }
- function assertClassProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassProperty", node, opts);
- }
- function assertOptionalMemberExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("OptionalMemberExpression", node, opts);
- }
- function assertPipelineTopicExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("PipelineTopicExpression", node, opts);
- }
- function assertPipelineBareFunction(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("PipelineBareFunction", node, opts);
- }
- function assertPipelinePrimaryTopicReference(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("PipelinePrimaryTopicReference", node, opts);
- }
- function assertOptionalCallExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("OptionalCallExpression", node, opts);
- }
- function assertClassPrivateProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassPrivateProperty", node, opts);
- }
- function assertClassPrivateMethod(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ClassPrivateMethod", node, opts);
- }
- function assertImport(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Import", node, opts);
- }
- function assertDecorator(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Decorator", node, opts);
- }
- function assertDoExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("DoExpression", node, opts);
- }
- function assertExportDefaultSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportDefaultSpecifier", node, opts);
- }
- function assertExportNamespaceSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportNamespaceSpecifier", node, opts);
- }
- function assertPrivateName(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("PrivateName", node, opts);
- }
- function assertBigIntLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BigIntLiteral", node, opts);
- }
- function assertTSParameterProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSParameterProperty", node, opts);
- }
- function assertTSDeclareFunction(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSDeclareFunction", node, opts);
- }
- function assertTSDeclareMethod(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSDeclareMethod", node, opts);
- }
- function assertTSQualifiedName(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSQualifiedName", node, opts);
- }
- function assertTSCallSignatureDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSCallSignatureDeclaration", node, opts);
- }
- function assertTSConstructSignatureDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSConstructSignatureDeclaration", node, opts);
- }
- function assertTSPropertySignature(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSPropertySignature", node, opts);
- }
- function assertTSMethodSignature(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSMethodSignature", node, opts);
- }
- function assertTSIndexSignature(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSIndexSignature", node, opts);
- }
- function assertTSAnyKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSAnyKeyword", node, opts);
- }
- function assertTSBooleanKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSBooleanKeyword", node, opts);
- }
- function assertTSBigIntKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSBigIntKeyword", node, opts);
- }
- function assertTSNeverKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSNeverKeyword", node, opts);
- }
- function assertTSNullKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSNullKeyword", node, opts);
- }
- function assertTSNumberKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSNumberKeyword", node, opts);
- }
- function assertTSObjectKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSObjectKeyword", node, opts);
- }
- function assertTSStringKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSStringKeyword", node, opts);
- }
- function assertTSSymbolKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSSymbolKeyword", node, opts);
- }
- function assertTSUndefinedKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSUndefinedKeyword", node, opts);
- }
- function assertTSUnknownKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSUnknownKeyword", node, opts);
- }
- function assertTSVoidKeyword(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSVoidKeyword", node, opts);
- }
- function assertTSThisType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSThisType", node, opts);
- }
- function assertTSFunctionType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSFunctionType", node, opts);
- }
- function assertTSConstructorType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSConstructorType", node, opts);
- }
- function assertTSTypeReference(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeReference", node, opts);
- }
- function assertTSTypePredicate(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypePredicate", node, opts);
- }
- function assertTSTypeQuery(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeQuery", node, opts);
- }
- function assertTSTypeLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeLiteral", node, opts);
- }
- function assertTSArrayType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSArrayType", node, opts);
- }
- function assertTSTupleType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTupleType", node, opts);
- }
- function assertTSOptionalType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSOptionalType", node, opts);
- }
- function assertTSRestType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSRestType", node, opts);
- }
- function assertTSUnionType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSUnionType", node, opts);
- }
- function assertTSIntersectionType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSIntersectionType", node, opts);
- }
- function assertTSConditionalType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSConditionalType", node, opts);
- }
- function assertTSInferType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSInferType", node, opts);
- }
- function assertTSParenthesizedType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSParenthesizedType", node, opts);
- }
- function assertTSTypeOperator(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeOperator", node, opts);
- }
- function assertTSIndexedAccessType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSIndexedAccessType", node, opts);
- }
- function assertTSMappedType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSMappedType", node, opts);
- }
- function assertTSLiteralType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSLiteralType", node, opts);
- }
- function assertTSExpressionWithTypeArguments(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSExpressionWithTypeArguments", node, opts);
- }
- function assertTSInterfaceDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSInterfaceDeclaration", node, opts);
- }
- function assertTSInterfaceBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSInterfaceBody", node, opts);
- }
- function assertTSTypeAliasDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeAliasDeclaration", node, opts);
- }
- function assertTSAsExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSAsExpression", node, opts);
- }
- function assertTSTypeAssertion(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeAssertion", node, opts);
- }
- function assertTSEnumDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSEnumDeclaration", node, opts);
- }
- function assertTSEnumMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSEnumMember", node, opts);
- }
- function assertTSModuleDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSModuleDeclaration", node, opts);
- }
- function assertTSModuleBlock(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSModuleBlock", node, opts);
- }
- function assertTSImportType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSImportType", node, opts);
- }
- function assertTSImportEqualsDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSImportEqualsDeclaration", node, opts);
- }
- function assertTSExternalModuleReference(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSExternalModuleReference", node, opts);
- }
- function assertTSNonNullExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSNonNullExpression", node, opts);
- }
- function assertTSExportAssignment(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSExportAssignment", node, opts);
- }
- function assertTSNamespaceExportDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSNamespaceExportDeclaration", node, opts);
- }
- function assertTSTypeAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeAnnotation", node, opts);
- }
- function assertTSTypeParameterInstantiation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeParameterInstantiation", node, opts);
- }
- function assertTSTypeParameterDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeParameterDeclaration", node, opts);
- }
- function assertTSTypeParameter(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeParameter", node, opts);
- }
- function assertExpression(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Expression", node, opts);
- }
- function assertBinary(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Binary", node, opts);
- }
- function assertScopable(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Scopable", node, opts);
- }
- function assertBlockParent(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("BlockParent", node, opts);
- }
- function assertBlock(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Block", node, opts);
- }
- function assertStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Statement", node, opts);
- }
- function assertTerminatorless(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Terminatorless", node, opts);
- }
- function assertCompletionStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("CompletionStatement", node, opts);
- }
- function assertConditional(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Conditional", node, opts);
- }
- function assertLoop(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Loop", node, opts);
- }
- function assertWhile(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("While", node, opts);
- }
- function assertExpressionWrapper(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExpressionWrapper", node, opts);
- }
- function assertFor(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("For", node, opts);
- }
- function assertForXStatement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ForXStatement", node, opts);
- }
- function assertFunction(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Function", node, opts);
- }
- function assertFunctionParent(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FunctionParent", node, opts);
- }
- function assertPureish(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Pureish", node, opts);
- }
- function assertDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Declaration", node, opts);
- }
- function assertPatternLike(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("PatternLike", node, opts);
- }
- function assertLVal(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("LVal", node, opts);
- }
- function assertTSEntityName(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSEntityName", node, opts);
- }
- function assertLiteral(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Literal", node, opts);
- }
- function assertImmutable(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Immutable", node, opts);
- }
- function assertUserWhitespacable(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("UserWhitespacable", node, opts);
- }
- function assertMethod(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Method", node, opts);
- }
- function assertObjectMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ObjectMember", node, opts);
- }
- function assertProperty(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Property", node, opts);
- }
- function assertUnaryLike(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("UnaryLike", node, opts);
- }
- function assertPattern(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Pattern", node, opts);
- }
- function assertClass(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Class", node, opts);
- }
- function assertModuleDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ModuleDeclaration", node, opts);
- }
- function assertExportDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ExportDeclaration", node, opts);
- }
- function assertModuleSpecifier(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("ModuleSpecifier", node, opts);
- }
- function assertFlow(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Flow", node, opts);
- }
- function assertFlowType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FlowType", node, opts);
- }
- function assertFlowBaseAnnotation(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FlowBaseAnnotation", node, opts);
- }
- function assertFlowDeclaration(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FlowDeclaration", node, opts);
- }
- function assertFlowPredicate(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("FlowPredicate", node, opts);
- }
- function assertEnumBody(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumBody", node, opts);
- }
- function assertEnumMember(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("EnumMember", node, opts);
- }
- function assertJSX(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("JSX", node, opts);
- }
- function assertPrivate(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("Private", node, opts);
- }
- function assertTSTypeElement(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSTypeElement", node, opts);
- }
- function assertTSType(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- assert("TSType", node, opts);
- }
- function assertNumberLiteral(node, opts) {
- console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
- assert("NumberLiteral", node, opts);
- }
- function assertRegexLiteral(node, opts) {
- console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
- assert("RegexLiteral", node, opts);
- }
- function assertRestProperty(node, opts) {
- console.trace("The node type RestProperty has been renamed to RestElement");
- assert("RestProperty", node, opts);
- }
- function assertSpreadProperty(node, opts) {
- console.trace("The node type SpreadProperty has been renamed to SpreadElement");
- assert("SpreadProperty", node, opts);
- }
- function createTypeAnnotationBasedOnTypeof(type) {
- if (type === "string") {
- return StringTypeAnnotation();
- } else if (type === "number") {
- return NumberTypeAnnotation();
- } else if (type === "undefined") {
- return VoidTypeAnnotation();
- } else if (type === "boolean") {
- return BooleanTypeAnnotation();
- } else if (type === "function") {
- return GenericTypeAnnotation(Identifier("Function"));
- } else if (type === "object") {
- return GenericTypeAnnotation(Identifier("Object"));
- } else if (type === "symbol") {
- return GenericTypeAnnotation(Identifier("Symbol"));
- } else {
- throw new Error("Invalid typeof value");
- }
- }
- function removeTypeDuplicates(nodes) {
- var generics = {};
- var bases = {};
- var typeGroups = [];
- var types = [];
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (!node) continue;
- if (types.indexOf(node) >= 0) {
- continue;
- }
- if (isAnyTypeAnnotation(node)) {
- return [node];
- }
- if (isFlowBaseAnnotation(node)) {
- bases[node.type] = node;
- continue;
- }
- if (isUnionTypeAnnotation(node)) {
- if (typeGroups.indexOf(node.types) < 0) {
- nodes = nodes.concat(node.types);
- typeGroups.push(node.types);
- }
- continue;
- }
- if (isGenericTypeAnnotation(node)) {
- var name = node.id.name;
- if (generics[name]) {
- var existing = generics[name];
- if (existing.typeParameters) {
- if (node.typeParameters) {
- existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
- }
- } else {
- existing = node.typeParameters;
- }
- } else {
- generics[name] = node;
- }
- continue;
- }
- types.push(node);
- }
- for (var _i = 0, _Object$keys = Object.keys(bases); _i < _Object$keys.length; _i++) {
- var type = _Object$keys[_i];
- types.push(bases[type]);
- }
- for (var _i2 = 0, _Object$keys2 = Object.keys(generics); _i2 < _Object$keys2.length; _i2++) {
- var _name = _Object$keys2[_i2];
- types.push(generics[_name]);
- }
- return types;
- }
- function createUnionTypeAnnotation(types) {
- var flattened = removeTypeDuplicates(types);
- if (flattened.length === 1) {
- return flattened[0];
- } else {
- return UnionTypeAnnotation(flattened);
- }
- }
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
- function cloneIfNode(obj, deep) {
- if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") {
- return cloneNode(obj, deep);
- }
- return obj;
- }
- function cloneIfNodeOrArray(obj, deep) {
- if (Array.isArray(obj)) {
- return obj.map(function (node) {
- return cloneIfNode(node, deep);
- });
- }
- return cloneIfNode(obj, deep);
- }
- function cloneNode(node, deep) {
- if (deep === void 0) {
- deep = true;
- }
- if (!node) return node;
- var type = node.type;
- var newNode = {
- type: type
- };
- if (type === "Identifier") {
- newNode.name = node.name;
- if (has(node, "optional") && typeof node.optional === "boolean") {
- newNode.optional = node.optional;
- }
- if (has(node, "typeAnnotation")) {
- newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true) : node.typeAnnotation;
- }
- } else if (!has(NODE_FIELDS, type)) {
- throw new Error("Unknown node type: \"" + type + "\"");
- } else {
- for (var _i = 0, _Object$keys = Object.keys(NODE_FIELDS[type]); _i < _Object$keys.length; _i++) {
- var field = _Object$keys[_i];
- if (has(node, field)) {
- newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field];
- }
- }
- }
- if (has(node, "loc")) {
- newNode.loc = node.loc;
- }
- if (has(node, "leadingComments")) {
- newNode.leadingComments = node.leadingComments;
- }
- if (has(node, "innerComments")) {
- newNode.innerComments = node.innerComments;
- }
- if (has(node, "trailingComments")) {
- newNode.trailingComments = node.trailingComments;
- }
- if (has(node, "extra")) {
- newNode.extra = Object.assign({}, node.extra);
- }
- return newNode;
- }
- function clone$1(node) {
- return cloneNode(node, false);
- }
- function cloneDeep(node) {
- return cloneNode(node);
- }
- function cloneWithoutLoc(node) {
- var newNode = clone$1(node);
- newNode.loc = null;
- return newNode;
- }
- function addComments(node, type, comments) {
- if (!comments || !node) return node;
- var key = type + "Comments";
- if (node[key]) {
- if (type === "leading") {
- node[key] = comments.concat(node[key]);
- } else {
- node[key] = node[key].concat(comments);
- }
- } else {
- node[key] = comments;
- }
- return node;
- }
- function addComment(node, type, content, line) {
- return addComments(node, type, [{
- type: line ? "CommentLine" : "CommentBlock",
- value: content
- }]);
- }
- var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED$2);
- return this;
- }
- var _setCacheAdd = setCacheAdd;
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- var _setCacheHas = setCacheHas;
- function SetCache(values) {
- var index = -1,
- length = values == null ? 0 : values.length;
- this.__data__ = new _MapCache();
- while (++index < length) {
- this.add(values[index]);
- }
- }
- SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
- SetCache.prototype.has = _setCacheHas;
- var _SetCache = SetCache;
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index-- : ++index < length) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
- var _baseFindIndex = baseFindIndex;
- function baseIsNaN(value) {
- return value !== value;
- }
- var _baseIsNaN = baseIsNaN;
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1,
- length = array.length;
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
- var _strictIndexOf = strictIndexOf;
- function baseIndexOf(array, value, fromIndex) {
- return value === value ? _strictIndexOf(array, value, fromIndex) : _baseFindIndex(array, _baseIsNaN, fromIndex);
- }
- var _baseIndexOf = baseIndexOf;
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && _baseIndexOf(array, value, 0) > -1;
- }
- var _arrayIncludes = arrayIncludes;
- function arrayIncludesWith(array, value, comparator) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
- var _arrayIncludesWith = arrayIncludesWith;
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- var _cacheHas = cacheHas;
- function noop$1() {}
- var noop_1 = noop$1;
- function setToArray(set) {
- var index = -1,
- result = Array(set.size);
- set.forEach(function (value) {
- result[++index] = value;
- });
- return result;
- }
- var _setToArray = setToArray;
- var INFINITY = 1 / 0;
- var createSet = !(_Set && 1 / _setToArray(new _Set([, -0]))[1] == INFINITY) ? noop_1 : function (values) {
- return new _Set(values);
- };
- var _createSet = createSet;
- var LARGE_ARRAY_SIZE$1 = 200;
- function baseUniq(array, iteratee, comparator) {
- var index = -1,
- includes = _arrayIncludes,
- length = array.length,
- isCommon = true,
- result = [],
- seen = result;
- if (comparator) {
- isCommon = false;
- includes = _arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE$1) {
- var set = iteratee ? null : _createSet(array);
- if (set) {
- return _setToArray(set);
- }
- isCommon = false;
- includes = _cacheHas;
- seen = new _SetCache();
- } else {
- seen = iteratee ? [] : result;
- }
- outer: while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- } else if (!includes(seen, computed, comparator)) {
- if (seen !== result) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
- var _baseUniq = baseUniq;
- function uniq(array) {
- return array && array.length ? _baseUniq(array) : [];
- }
- var uniq_1 = uniq;
- function inherit(key, child, parent) {
- if (child && parent) {
- child[key] = uniq_1([].concat(child[key], parent[key]).filter(Boolean));
- }
- }
- function inheritInnerComments(child, parent) {
- inherit("innerComments", child, parent);
- }
- function inheritLeadingComments(child, parent) {
- inherit("leadingComments", child, parent);
- }
- function inheritTrailingComments(child, parent) {
- inherit("trailingComments", child, parent);
- }
- function inheritsComments(child, parent) {
- inheritTrailingComments(child, parent);
- inheritLeadingComments(child, parent);
- inheritInnerComments(child, parent);
- return child;
- }
- function removeComments(node) {
- COMMENT_KEYS.forEach(function (key) {
- node[key] = null;
- });
- return node;
- }
- var EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS["Expression"];
- var BINARY_TYPES = FLIPPED_ALIAS_KEYS["Binary"];
- var SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS["Scopable"];
- var BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS["BlockParent"];
- var BLOCK_TYPES = FLIPPED_ALIAS_KEYS["Block"];
- var STATEMENT_TYPES = FLIPPED_ALIAS_KEYS["Statement"];
- var TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS["Terminatorless"];
- var COMPLETIONSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS["CompletionStatement"];
- var CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS["Conditional"];
- var LOOP_TYPES = FLIPPED_ALIAS_KEYS["Loop"];
- var WHILE_TYPES = FLIPPED_ALIAS_KEYS["While"];
- var EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS["ExpressionWrapper"];
- var FOR_TYPES = FLIPPED_ALIAS_KEYS["For"];
- var FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS["ForXStatement"];
- var FUNCTION_TYPES = FLIPPED_ALIAS_KEYS["Function"];
- var FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS["FunctionParent"];
- var PUREISH_TYPES = FLIPPED_ALIAS_KEYS["Pureish"];
- var DECLARATION_TYPES = FLIPPED_ALIAS_KEYS["Declaration"];
- var PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS["PatternLike"];
- var LVAL_TYPES = FLIPPED_ALIAS_KEYS["LVal"];
- var TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS["TSEntityName"];
- var LITERAL_TYPES = FLIPPED_ALIAS_KEYS["Literal"];
- var IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS["Immutable"];
- var USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS["UserWhitespacable"];
- var METHOD_TYPES = FLIPPED_ALIAS_KEYS["Method"];
- var OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS["ObjectMember"];
- var PROPERTY_TYPES = FLIPPED_ALIAS_KEYS["Property"];
- var UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS["UnaryLike"];
- var PATTERN_TYPES = FLIPPED_ALIAS_KEYS["Pattern"];
- var CLASS_TYPES = FLIPPED_ALIAS_KEYS["Class"];
- var MODULEDECLARATION_TYPES = FLIPPED_ALIAS_KEYS["ModuleDeclaration"];
- var EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS["ExportDeclaration"];
- var MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS["ModuleSpecifier"];
- var FLOW_TYPES = FLIPPED_ALIAS_KEYS["Flow"];
- var FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS["FlowType"];
- var FLOWBASEANNOTATION_TYPES = FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"];
- var FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS["FlowDeclaration"];
- var FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS["FlowPredicate"];
- var ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS["EnumBody"];
- var ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS["EnumMember"];
- var JSX_TYPES = FLIPPED_ALIAS_KEYS["JSX"];
- var PRIVATE_TYPES = FLIPPED_ALIAS_KEYS["Private"];
- var TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS["TSTypeElement"];
- var TSTYPE_TYPES = FLIPPED_ALIAS_KEYS["TSType"];
- function toBlock(node, parent) {
- if (isBlockStatement(node)) {
- return node;
- }
- var blockNodes = [];
- if (isEmptyStatement(node)) {
- blockNodes = [];
- } else {
- if (!isStatement(node)) {
- if (isFunction(parent)) {
- node = ReturnStatement(node);
- } else {
- node = ExpressionStatement(node);
- }
- }
- blockNodes = [node];
- }
- return BlockStatement(blockNodes);
- }
- function ensureBlock(node, key) {
- if (key === void 0) {
- key = "body";
- }
- return node[key] = toBlock(node[key], node);
- }
- function isValidIdentifier(name, reserved) {
- if (reserved === void 0) {
- reserved = true;
- }
- if (typeof name !== "string") return false;
- if (reserved) {
- if (utils.keyword.isReservedWordES6(name, true)) {
- return false;
- } else if (name === "await") {
- return false;
- }
- }
- return utils.keyword.isIdentifierNameES6(name);
- }
- function toIdentifier(name) {
- name = name + "";
- name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
- name = name.replace(/^[-0-9]+/, "");
- name = name.replace(/[-\s]+(.)?/g, function (match, c) {
- return c ? c.toUpperCase() : "";
- });
- if (!isValidIdentifier(name)) {
- name = "_" + name;
- }
- return name || "_";
- }
- function toBindingIdentifierName(name) {
- name = toIdentifier(name);
- if (name === "eval" || name === "arguments") name = "_" + name;
- return name;
- }
- function toComputedKey(node, key) {
- if (key === void 0) {
- key = node.key || node.property;
- }
- if (!node.computed && isIdentifier(key)) key = StringLiteral(key.name);
- return key;
- }
- function toExpression(node) {
- if (isExpressionStatement(node)) {
- node = node.expression;
- }
- if (isExpression(node)) {
- return node;
- }
- if (isClass(node)) {
- node.type = "ClassExpression";
- } else if (isFunction(node)) {
- node.type = "FunctionExpression";
- }
- if (!isExpression(node)) {
- throw new Error("cannot turn " + node.type + " to an expression");
- }
- return node;
- }
- function traverseFast(node, enter, opts) {
- if (!node) return;
- var keys = VISITOR_KEYS[node.type];
- if (!keys) return;
- opts = opts || {};
- enter(node, opts);
- for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var key = _ref;
- var subNode = node[key];
- if (Array.isArray(subNode)) {
- for (var _iterator2 = subNode, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _node = _ref2;
- traverseFast(_node, enter, opts);
- }
- } else {
- traverseFast(subNode, enter, opts);
- }
- }
- }
- var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
- var CLEAR_KEYS_PLUS_COMMENTS = COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
- function removeProperties(node, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
- for (var _iterator = map, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var key = _ref;
- if (node[key] != null) node[key] = undefined;
- }
- for (var _i2 = 0, _Object$keys = Object.keys(node); _i2 < _Object$keys.length; _i2++) {
- var _key = _Object$keys[_i2];
- if (_key[0] === "_" && node[_key] != null) node[_key] = undefined;
- }
- var symbols = Object.getOwnPropertySymbols(node);
- for (var _iterator2 = symbols, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i3 >= _iterator2.length) break;
- _ref2 = _iterator2[_i3++];
- } else {
- _i3 = _iterator2.next();
- if (_i3.done) break;
- _ref2 = _i3.value;
- }
- var sym = _ref2;
- node[sym] = null;
- }
- }
- function removePropertiesDeep(tree, opts) {
- traverseFast(tree, removeProperties, opts);
- return tree;
- }
- function toKeyAlias(node, key) {
- if (key === void 0) {
- key = node.key;
- }
- var alias;
- if (node.kind === "method") {
- return toKeyAlias.increment() + "";
- } else if (isIdentifier(key)) {
- alias = key.name;
- } else if (isStringLiteral(key)) {
- alias = JSON.stringify(key.value);
- } else {
- alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));
- }
- if (node.computed) {
- alias = "[" + alias + "]";
- }
- if (node["static"]) {
- alias = "static:" + alias;
- }
- return alias;
- }
- toKeyAlias.uid = 0;
- toKeyAlias.increment = function () {
- if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
- return toKeyAlias.uid = 0;
- } else {
- return toKeyAlias.uid++;
- }
- };
- function getBindingIdentifiers(node, duplicates, outerOnly) {
- var search = [].concat(node);
- var ids = Object.create(null);
- while (search.length) {
- var id = search.shift();
- if (!id) continue;
- var keys = getBindingIdentifiers.keys[id.type];
- if (isIdentifier(id)) {
- if (duplicates) {
- var _ids = ids[id.name] = ids[id.name] || [];
- _ids.push(id);
- } else {
- ids[id.name] = id;
- }
- continue;
- }
- if (isExportDeclaration(id)) {
- if (isDeclaration(id.declaration)) {
- search.push(id.declaration);
- }
- continue;
- }
- if (outerOnly) {
- if (isFunctionDeclaration(id)) {
- search.push(id.id);
- continue;
- }
- if (isFunctionExpression(id)) {
- continue;
- }
- }
- if (keys) {
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (id[key]) {
- search = search.concat(id[key]);
- }
- }
- }
- }
- return ids;
- }
- getBindingIdentifiers.keys = {
- DeclareClass: ["id"],
- DeclareFunction: ["id"],
- DeclareModule: ["id"],
- DeclareVariable: ["id"],
- DeclareInterface: ["id"],
- DeclareTypeAlias: ["id"],
- DeclareOpaqueType: ["id"],
- InterfaceDeclaration: ["id"],
- TypeAlias: ["id"],
- OpaqueType: ["id"],
- CatchClause: ["param"],
- LabeledStatement: ["label"],
- UnaryExpression: ["argument"],
- AssignmentExpression: ["left"],
- ImportSpecifier: ["local"],
- ImportNamespaceSpecifier: ["local"],
- ImportDefaultSpecifier: ["local"],
- ImportDeclaration: ["specifiers"],
- ExportSpecifier: ["exported"],
- ExportNamespaceSpecifier: ["exported"],
- ExportDefaultSpecifier: ["exported"],
- FunctionDeclaration: ["id", "params"],
- FunctionExpression: ["id", "params"],
- ArrowFunctionExpression: ["params"],
- ObjectMethod: ["params"],
- ClassMethod: ["params"],
- ForInStatement: ["left"],
- ForOfStatement: ["left"],
- ClassDeclaration: ["id"],
- ClassExpression: ["id"],
- RestElement: ["argument"],
- UpdateExpression: ["argument"],
- ObjectProperty: ["value"],
- AssignmentPattern: ["left"],
- ArrayPattern: ["elements"],
- ObjectPattern: ["properties"],
- VariableDeclaration: ["declarations"],
- VariableDeclarator: ["id"]
- };
- function gatherSequenceExpressions(nodes, scope, declars) {
- var exprs = [];
- var ensureLastUndefined = true;
- for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var node = _ref;
- ensureLastUndefined = false;
- if (isExpression(node)) {
- exprs.push(node);
- } else if (isExpressionStatement(node)) {
- exprs.push(node.expression);
- } else if (isVariableDeclaration(node)) {
- if (node.kind !== "var") return;
- for (var _i2 = 0, _arr = node.declarations; _i2 < _arr.length; _i2++) {
- var declar = _arr[_i2];
- var bindings = getBindingIdentifiers(declar);
- for (var _i3 = 0, _Object$keys = Object.keys(bindings); _i3 < _Object$keys.length; _i3++) {
- var key = _Object$keys[_i3];
- declars.push({
- kind: node.kind,
- id: cloneNode(bindings[key])
- });
- }
- if (declar.init) {
- exprs.push(AssignmentExpression("=", declar.id, declar.init));
- }
- }
- ensureLastUndefined = true;
- } else if (isIfStatement(node)) {
- var consequent = node.consequent ? gatherSequenceExpressions([node.consequent], scope, declars) : scope.buildUndefinedNode();
- var alternate = node.alternate ? gatherSequenceExpressions([node.alternate], scope, declars) : scope.buildUndefinedNode();
- if (!consequent || !alternate) return;
- exprs.push(ConditionalExpression(node.test, consequent, alternate));
- } else if (isBlockStatement(node)) {
- var body = gatherSequenceExpressions(node.body, scope, declars);
- if (!body) return;
- exprs.push(body);
- } else if (isEmptyStatement(node)) {
- ensureLastUndefined = true;
- } else {
- return;
- }
- }
- if (ensureLastUndefined) {
- exprs.push(scope.buildUndefinedNode());
- }
- if (exprs.length === 1) {
- return exprs[0];
- } else {
- return SequenceExpression(exprs);
- }
- }
- function toSequenceExpression(nodes, scope) {
- if (!nodes || !nodes.length) return;
- var declars = [];
- var result = gatherSequenceExpressions(nodes, scope, declars);
- if (!result) return;
- for (var _i = 0, _declars = declars; _i < _declars.length; _i++) {
- var declar = _declars[_i];
- scope.push(declar);
- }
- return result;
- }
- function toStatement(node, ignore) {
- if (isStatement(node)) {
- return node;
- }
- var mustHaveId = false;
- var newType;
- if (isClass(node)) {
- mustHaveId = true;
- newType = "ClassDeclaration";
- } else if (isFunction(node)) {
- mustHaveId = true;
- newType = "FunctionDeclaration";
- } else if (isAssignmentExpression(node)) {
- return ExpressionStatement(node);
- }
- if (mustHaveId && !node.id) {
- newType = false;
- }
- if (!newType) {
- if (ignore) {
- return false;
- } else {
- throw new Error("cannot turn " + node.type + " to a statement");
- }
- }
- node.type = newType;
- return node;
- }
- var objectTag$3 = '[object Object]';
- var funcProto$2 = Function.prototype,
- objectProto$d = Object.prototype;
- var funcToString$2 = funcProto$2.toString;
- var hasOwnProperty$a = objectProto$d.hasOwnProperty;
- var objectCtorString = funcToString$2.call(Object);
- function isPlainObject(value) {
- if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$3) {
- return false;
- }
- var proto = _getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty$a.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString$2.call(Ctor) == objectCtorString;
- }
- var isPlainObject_1 = isPlainObject;
- var regexpTag$3 = '[object RegExp]';
- function baseIsRegExp(value) {
- return isObjectLike_1(value) && _baseGetTag(value) == regexpTag$3;
- }
- var _baseIsRegExp = baseIsRegExp;
- var nodeIsRegExp = _nodeUtil && _nodeUtil.isRegExp;
- var isRegExp = nodeIsRegExp ? _baseUnary(nodeIsRegExp) : _baseIsRegExp;
- var isRegExp_1 = isRegExp;
- function valueToNode(value) {
- if (value === undefined) {
- return Identifier("undefined");
- }
- if (value === true || value === false) {
- return BooleanLiteral(value);
- }
- if (value === null) {
- return NullLiteral();
- }
- if (typeof value === "string") {
- return StringLiteral(value);
- }
- if (typeof value === "number") {
- var result;
- if (Number.isFinite(value)) {
- result = NumericLiteral(Math.abs(value));
- } else {
- var numerator;
- if (Number.isNaN(value)) {
- numerator = NumericLiteral(0);
- } else {
- numerator = NumericLiteral(1);
- }
- result = BinaryExpression("/", numerator, NumericLiteral(0));
- }
- if (value < 0 || Object.is(value, -0)) {
- result = UnaryExpression("-", result);
- }
- return result;
- }
- if (isRegExp_1(value)) {
- var pattern = value.source;
- var flags = value.toString().match(/\/([a-z]+|)$/)[1];
- return RegExpLiteral(pattern, flags);
- }
- if (Array.isArray(value)) {
- return ArrayExpression(value.map(valueToNode));
- }
- if (isPlainObject_1(value)) {
- var props = [];
- for (var _i = 0, _Object$keys = Object.keys(value); _i < _Object$keys.length; _i++) {
- var key = _Object$keys[_i];
- var nodeKey = void 0;
- if (isValidIdentifier(key)) {
- nodeKey = Identifier(key);
- } else {
- nodeKey = StringLiteral(key);
- }
- props.push(ObjectProperty(nodeKey, valueToNode(value[key])));
- }
- return ObjectExpression(props);
- }
- throw new Error("don't know how to turn this value into a node");
- }
- function appendToMemberExpression(member, append, computed) {
- if (computed === void 0) {
- computed = false;
- }
- member.object = MemberExpression(member.object, member.property, member.computed);
- member.property = append;
- member.computed = !!computed;
- return member;
- }
- function inherits(child, parent) {
- if (!child || !parent) return child;
- for (var _i = 0, _arr = INHERIT_KEYS.optional; _i < _arr.length; _i++) {
- var key = _arr[_i];
- if (child[key] == null) {
- child[key] = parent[key];
- }
- }
- for (var _i2 = 0, _Object$keys = Object.keys(parent); _i2 < _Object$keys.length; _i2++) {
- var _key = _Object$keys[_i2];
- if (_key[0] === "_" && _key !== "__clone") child[_key] = parent[_key];
- }
- for (var _i3 = 0, _arr2 = INHERIT_KEYS.force; _i3 < _arr2.length; _i3++) {
- var _key2 = _arr2[_i3];
- child[_key2] = parent[_key2];
- }
- inheritsComments(child, parent);
- return child;
- }
- function prependToMemberExpression(member, prepend) {
- member.object = MemberExpression(prepend, member.object);
- return member;
- }
- function getOuterBindingIdentifiers(node, duplicates) {
- return getBindingIdentifiers(node, duplicates, true);
- }
- function traverse(node, handlers, state) {
- if (typeof handlers === "function") {
- handlers = {
- enter: handlers
- };
- }
- var _ref = handlers,
- enter = _ref.enter,
- exit = _ref.exit;
- traverseSimpleImpl(node, enter, exit, state, []);
- }
- function traverseSimpleImpl(node, enter, exit, state, ancestors) {
- var keys = VISITOR_KEYS[node.type];
- if (!keys) return;
- if (enter) enter(node, ancestors, state);
- for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var key = _ref2;
- var subNode = node[key];
- if (Array.isArray(subNode)) {
- for (var i = 0; i < subNode.length; i++) {
- var child = subNode[i];
- if (!child) continue;
- ancestors.push({
- node: node,
- key: key,
- index: i
- });
- traverseSimpleImpl(child, enter, exit, state, ancestors);
- ancestors.pop();
- }
- } else if (subNode) {
- ancestors.push({
- node: node,
- key: key
- });
- traverseSimpleImpl(subNode, enter, exit, state, ancestors);
- ancestors.pop();
- }
- }
- if (exit) exit(node, ancestors, state);
- }
- function isBinding(node, parent, grandparent) {
- if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") {
- return false;
- }
- var keys = getBindingIdentifiers.keys[parent.type];
- if (keys) {
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- var val = parent[key];
- if (Array.isArray(val)) {
- if (val.indexOf(node) >= 0) return true;
- } else {
- if (val === node) return true;
- }
- }
- }
- return false;
- }
- function isLet(node) {
- return isVariableDeclaration(node) && (node.kind !== "var" || node[BLOCK_SCOPED_SYMBOL]);
- }
- function isBlockScoped(node) {
- return isFunctionDeclaration(node) || isClassDeclaration(node) || isLet(node);
- }
- function isImmutable(node) {
- if (isType(node.type, "Immutable")) return true;
- if (isIdentifier(node)) {
- if (node.name === "undefined") {
- return true;
- } else {
- return false;
- }
- }
- return false;
- }
- function isNodesEquivalent(a, b) {
- if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) {
- return a === b;
- }
- if (a.type !== b.type) {
- return false;
- }
- var fields = Object.keys(NODE_FIELDS[a.type] || a.type);
- var visitorKeys = VISITOR_KEYS[a.type];
- for (var _i = 0, _fields = fields; _i < _fields.length; _i++) {
- var field = _fields[_i];
- if (typeof a[field] !== typeof b[field]) {
- return false;
- }
- if (a[field] == null && b[field] == null) {
- continue;
- } else if (a[field] == null || b[field] == null) {
- return false;
- }
- if (Array.isArray(a[field])) {
- if (!Array.isArray(b[field])) {
- return false;
- }
- if (a[field].length !== b[field].length) {
- return false;
- }
- for (var i = 0; i < a[field].length; i++) {
- if (!isNodesEquivalent(a[field][i], b[field][i])) {
- return false;
- }
- }
- continue;
- }
- if (typeof a[field] === "object" && (!visitorKeys || !visitorKeys.includes(field))) {
- for (var _i2 = 0, _Object$keys = Object.keys(a[field]); _i2 < _Object$keys.length; _i2++) {
- var key = _Object$keys[_i2];
- if (a[field][key] !== b[field][key]) {
- return false;
- }
- }
- continue;
- }
- if (!isNodesEquivalent(a[field], b[field])) {
- return false;
- }
- }
- return true;
- }
- function isReferenced(node, parent, grandparent) {
- switch (parent.type) {
- case "MemberExpression":
- case "JSXMemberExpression":
- case "OptionalMemberExpression":
- if (parent.property === node) {
- return !!parent.computed;
- }
- return parent.object === node;
- case "VariableDeclarator":
- return parent.init === node;
- case "ArrowFunctionExpression":
- return parent.body === node;
- case "ExportSpecifier":
- if (parent.source) {
- return false;
- }
- return parent.local === node;
- case "PrivateName":
- return false;
- case "ObjectProperty":
- case "ClassProperty":
- case "ClassPrivateProperty":
- case "ClassMethod":
- case "ClassPrivateMethod":
- case "ObjectMethod":
- if (parent.key === node) {
- return !!parent.computed;
- }
- if (parent.value === node) {
- return !grandparent || grandparent.type !== "ObjectPattern";
- }
- return true;
- case "ClassDeclaration":
- case "ClassExpression":
- return parent.superClass === node;
- case "AssignmentExpression":
- return parent.right === node;
- case "AssignmentPattern":
- return parent.right === node;
- case "LabeledStatement":
- return false;
- case "CatchClause":
- return false;
- case "RestElement":
- return false;
- case "BreakStatement":
- case "ContinueStatement":
- return false;
- case "FunctionDeclaration":
- case "FunctionExpression":
- return false;
- case "ExportNamespaceSpecifier":
- case "ExportDefaultSpecifier":
- return false;
- case "ImportDefaultSpecifier":
- case "ImportNamespaceSpecifier":
- case "ImportSpecifier":
- return false;
- case "JSXAttribute":
- return false;
- case "ObjectPattern":
- case "ArrayPattern":
- return false;
- case "MetaProperty":
- return false;
- case "ObjectTypeProperty":
- return parent.key !== node;
- case "TSEnumMember":
- return parent.id !== node;
- case "TSPropertySignature":
- if (parent.key === node) {
- return !!parent.computed;
- }
- return true;
- }
- return true;
- }
- function isScope(node, parent) {
- if (isBlockStatement(node) && isFunction(parent, {
- body: node
- })) {
- return false;
- }
- if (isBlockStatement(node) && isCatchClause(parent, {
- body: node
- })) {
- return false;
- }
- if (isPattern(node) && isFunction(parent)) {
- return true;
- }
- return isScopable(node);
- }
- function isSpecifierDefault(specifier) {
- return isImportDefaultSpecifier(specifier) || isIdentifier(specifier.imported || specifier.exported, {
- name: "default"
- });
- }
- var RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]);
- function isValidES3Identifier(name) {
- return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);
- }
- function isVar(node) {
- return isVariableDeclaration(node, {
- kind: "var"
- }) && !node[BLOCK_SCOPED_SYMBOL];
- }
- var react = {
- isReactComponent: isReactComponent,
- isCompatTag: isCompatTag,
- buildChildren: buildChildren
- };
- var t = /*#__PURE__*/Object.freeze({
- __proto__: null,
- react: react,
- assertNode: assertNode,
- createTypeAnnotationBasedOnTypeof: createTypeAnnotationBasedOnTypeof,
- createUnionTypeAnnotation: createUnionTypeAnnotation,
- cloneNode: cloneNode,
- clone: clone$1,
- cloneDeep: cloneDeep,
- cloneWithoutLoc: cloneWithoutLoc,
- addComment: addComment,
- addComments: addComments,
- inheritInnerComments: inheritInnerComments,
- inheritLeadingComments: inheritLeadingComments,
- inheritsComments: inheritsComments,
- inheritTrailingComments: inheritTrailingComments,
- removeComments: removeComments,
- ensureBlock: ensureBlock,
- toBindingIdentifierName: toBindingIdentifierName,
- toBlock: toBlock,
- toComputedKey: toComputedKey,
- toExpression: toExpression,
- toIdentifier: toIdentifier,
- toKeyAlias: toKeyAlias,
- toSequenceExpression: toSequenceExpression,
- toStatement: toStatement,
- valueToNode: valueToNode,
- appendToMemberExpression: appendToMemberExpression,
- inherits: inherits,
- prependToMemberExpression: prependToMemberExpression,
- removeProperties: removeProperties,
- removePropertiesDeep: removePropertiesDeep,
- removeTypeDuplicates: removeTypeDuplicates,
- getBindingIdentifiers: getBindingIdentifiers,
- getOuterBindingIdentifiers: getOuterBindingIdentifiers,
- traverse: traverse,
- traverseFast: traverseFast,
- shallowEqual: shallowEqual,
- is: is,
- isBinding: isBinding,
- isBlockScoped: isBlockScoped,
- isImmutable: isImmutable,
- isLet: isLet,
- isNode: isNode,
- isNodesEquivalent: isNodesEquivalent,
- isPlaceholderType: isPlaceholderType,
- isReferenced: isReferenced,
- isScope: isScope,
- isSpecifierDefault: isSpecifierDefault,
- isType: isType,
- isValidES3Identifier: isValidES3Identifier,
- isValidIdentifier: isValidIdentifier,
- isVar: isVar,
- matchesPattern: matchesPattern,
- validate: validate,
- buildMatchMemberExpression: buildMatchMemberExpression,
- assertArrayExpression: assertArrayExpression,
- assertAssignmentExpression: assertAssignmentExpression,
- assertBinaryExpression: assertBinaryExpression,
- assertInterpreterDirective: assertInterpreterDirective,
- assertDirective: assertDirective,
- assertDirectiveLiteral: assertDirectiveLiteral,
- assertBlockStatement: assertBlockStatement,
- assertBreakStatement: assertBreakStatement,
- assertCallExpression: assertCallExpression,
- assertCatchClause: assertCatchClause,
- assertConditionalExpression: assertConditionalExpression,
- assertContinueStatement: assertContinueStatement,
- assertDebuggerStatement: assertDebuggerStatement,
- assertDoWhileStatement: assertDoWhileStatement,
- assertEmptyStatement: assertEmptyStatement,
- assertExpressionStatement: assertExpressionStatement,
- assertFile: assertFile,
- assertForInStatement: assertForInStatement,
- assertForStatement: assertForStatement,
- assertFunctionDeclaration: assertFunctionDeclaration,
- assertFunctionExpression: assertFunctionExpression,
- assertIdentifier: assertIdentifier,
- assertIfStatement: assertIfStatement,
- assertLabeledStatement: assertLabeledStatement,
- assertStringLiteral: assertStringLiteral,
- assertNumericLiteral: assertNumericLiteral,
- assertNullLiteral: assertNullLiteral,
- assertBooleanLiteral: assertBooleanLiteral,
- assertRegExpLiteral: assertRegExpLiteral,
- assertLogicalExpression: assertLogicalExpression,
- assertMemberExpression: assertMemberExpression,
- assertNewExpression: assertNewExpression,
- assertProgram: assertProgram,
- assertObjectExpression: assertObjectExpression,
- assertObjectMethod: assertObjectMethod,
- assertObjectProperty: assertObjectProperty,
- assertRestElement: assertRestElement,
- assertReturnStatement: assertReturnStatement,
- assertSequenceExpression: assertSequenceExpression,
- assertParenthesizedExpression: assertParenthesizedExpression,
- assertSwitchCase: assertSwitchCase,
- assertSwitchStatement: assertSwitchStatement,
- assertThisExpression: assertThisExpression,
- assertThrowStatement: assertThrowStatement,
- assertTryStatement: assertTryStatement,
- assertUnaryExpression: assertUnaryExpression,
- assertUpdateExpression: assertUpdateExpression,
- assertVariableDeclaration: assertVariableDeclaration,
- assertVariableDeclarator: assertVariableDeclarator,
- assertWhileStatement: assertWhileStatement,
- assertWithStatement: assertWithStatement,
- assertAssignmentPattern: assertAssignmentPattern,
- assertArrayPattern: assertArrayPattern,
- assertArrowFunctionExpression: assertArrowFunctionExpression,
- assertClassBody: assertClassBody,
- assertClassExpression: assertClassExpression,
- assertClassDeclaration: assertClassDeclaration,
- assertExportAllDeclaration: assertExportAllDeclaration,
- assertExportDefaultDeclaration: assertExportDefaultDeclaration,
- assertExportNamedDeclaration: assertExportNamedDeclaration,
- assertExportSpecifier: assertExportSpecifier,
- assertForOfStatement: assertForOfStatement,
- assertImportDeclaration: assertImportDeclaration,
- assertImportDefaultSpecifier: assertImportDefaultSpecifier,
- assertImportNamespaceSpecifier: assertImportNamespaceSpecifier,
- assertImportSpecifier: assertImportSpecifier,
- assertMetaProperty: assertMetaProperty,
- assertClassMethod: assertClassMethod,
- assertObjectPattern: assertObjectPattern,
- assertSpreadElement: assertSpreadElement,
- assertSuper: assertSuper,
- assertTaggedTemplateExpression: assertTaggedTemplateExpression,
- assertTemplateElement: assertTemplateElement,
- assertTemplateLiteral: assertTemplateLiteral,
- assertYieldExpression: assertYieldExpression,
- assertAnyTypeAnnotation: assertAnyTypeAnnotation,
- assertArrayTypeAnnotation: assertArrayTypeAnnotation,
- assertBooleanTypeAnnotation: assertBooleanTypeAnnotation,
- assertBooleanLiteralTypeAnnotation: assertBooleanLiteralTypeAnnotation,
- assertNullLiteralTypeAnnotation: assertNullLiteralTypeAnnotation,
- assertClassImplements: assertClassImplements,
- assertDeclareClass: assertDeclareClass,
- assertDeclareFunction: assertDeclareFunction,
- assertDeclareInterface: assertDeclareInterface,
- assertDeclareModule: assertDeclareModule,
- assertDeclareModuleExports: assertDeclareModuleExports,
- assertDeclareTypeAlias: assertDeclareTypeAlias,
- assertDeclareOpaqueType: assertDeclareOpaqueType,
- assertDeclareVariable: assertDeclareVariable,
- assertDeclareExportDeclaration: assertDeclareExportDeclaration,
- assertDeclareExportAllDeclaration: assertDeclareExportAllDeclaration,
- assertDeclaredPredicate: assertDeclaredPredicate,
- assertExistsTypeAnnotation: assertExistsTypeAnnotation,
- assertFunctionTypeAnnotation: assertFunctionTypeAnnotation,
- assertFunctionTypeParam: assertFunctionTypeParam,
- assertGenericTypeAnnotation: assertGenericTypeAnnotation,
- assertInferredPredicate: assertInferredPredicate,
- assertInterfaceExtends: assertInterfaceExtends,
- assertInterfaceDeclaration: assertInterfaceDeclaration,
- assertInterfaceTypeAnnotation: assertInterfaceTypeAnnotation,
- assertIntersectionTypeAnnotation: assertIntersectionTypeAnnotation,
- assertMixedTypeAnnotation: assertMixedTypeAnnotation,
- assertEmptyTypeAnnotation: assertEmptyTypeAnnotation,
- assertNullableTypeAnnotation: assertNullableTypeAnnotation,
- assertNumberLiteralTypeAnnotation: assertNumberLiteralTypeAnnotation,
- assertNumberTypeAnnotation: assertNumberTypeAnnotation,
- assertObjectTypeAnnotation: assertObjectTypeAnnotation,
- assertObjectTypeInternalSlot: assertObjectTypeInternalSlot,
- assertObjectTypeCallProperty: assertObjectTypeCallProperty,
- assertObjectTypeIndexer: assertObjectTypeIndexer,
- assertObjectTypeProperty: assertObjectTypeProperty,
- assertObjectTypeSpreadProperty: assertObjectTypeSpreadProperty,
- assertOpaqueType: assertOpaqueType,
- assertQualifiedTypeIdentifier: assertQualifiedTypeIdentifier,
- assertStringLiteralTypeAnnotation: assertStringLiteralTypeAnnotation,
- assertStringTypeAnnotation: assertStringTypeAnnotation,
- assertThisTypeAnnotation: assertThisTypeAnnotation,
- assertTupleTypeAnnotation: assertTupleTypeAnnotation,
- assertTypeofTypeAnnotation: assertTypeofTypeAnnotation,
- assertTypeAlias: assertTypeAlias,
- assertTypeAnnotation: assertTypeAnnotation,
- assertTypeCastExpression: assertTypeCastExpression,
- assertTypeParameter: assertTypeParameter,
- assertTypeParameterDeclaration: assertTypeParameterDeclaration,
- assertTypeParameterInstantiation: assertTypeParameterInstantiation,
- assertUnionTypeAnnotation: assertUnionTypeAnnotation,
- assertVariance: assertVariance,
- assertVoidTypeAnnotation: assertVoidTypeAnnotation,
- assertEnumDeclaration: assertEnumDeclaration,
- assertEnumBooleanBody: assertEnumBooleanBody,
- assertEnumNumberBody: assertEnumNumberBody,
- assertEnumStringBody: assertEnumStringBody,
- assertEnumSymbolBody: assertEnumSymbolBody,
- assertEnumBooleanMember: assertEnumBooleanMember,
- assertEnumNumberMember: assertEnumNumberMember,
- assertEnumStringMember: assertEnumStringMember,
- assertEnumDefaultedMember: assertEnumDefaultedMember,
- assertJSXAttribute: assertJSXAttribute,
- assertJSXClosingElement: assertJSXClosingElement,
- assertJSXElement: assertJSXElement,
- assertJSXEmptyExpression: assertJSXEmptyExpression,
- assertJSXExpressionContainer: assertJSXExpressionContainer,
- assertJSXSpreadChild: assertJSXSpreadChild,
- assertJSXIdentifier: assertJSXIdentifier,
- assertJSXMemberExpression: assertJSXMemberExpression,
- assertJSXNamespacedName: assertJSXNamespacedName,
- assertJSXOpeningElement: assertJSXOpeningElement,
- assertJSXSpreadAttribute: assertJSXSpreadAttribute,
- assertJSXText: assertJSXText,
- assertJSXFragment: assertJSXFragment,
- assertJSXOpeningFragment: assertJSXOpeningFragment,
- assertJSXClosingFragment: assertJSXClosingFragment,
- assertNoop: assertNoop,
- assertPlaceholder: assertPlaceholder,
- assertV8IntrinsicIdentifier: assertV8IntrinsicIdentifier,
- assertArgumentPlaceholder: assertArgumentPlaceholder,
- assertAwaitExpression: assertAwaitExpression,
- assertBindExpression: assertBindExpression,
- assertClassProperty: assertClassProperty,
- assertOptionalMemberExpression: assertOptionalMemberExpression,
- assertPipelineTopicExpression: assertPipelineTopicExpression,
- assertPipelineBareFunction: assertPipelineBareFunction,
- assertPipelinePrimaryTopicReference: assertPipelinePrimaryTopicReference,
- assertOptionalCallExpression: assertOptionalCallExpression,
- assertClassPrivateProperty: assertClassPrivateProperty,
- assertClassPrivateMethod: assertClassPrivateMethod,
- assertImport: assertImport,
- assertDecorator: assertDecorator,
- assertDoExpression: assertDoExpression,
- assertExportDefaultSpecifier: assertExportDefaultSpecifier,
- assertExportNamespaceSpecifier: assertExportNamespaceSpecifier,
- assertPrivateName: assertPrivateName,
- assertBigIntLiteral: assertBigIntLiteral,
- assertTSParameterProperty: assertTSParameterProperty,
- assertTSDeclareFunction: assertTSDeclareFunction,
- assertTSDeclareMethod: assertTSDeclareMethod,
- assertTSQualifiedName: assertTSQualifiedName,
- assertTSCallSignatureDeclaration: assertTSCallSignatureDeclaration,
- assertTSConstructSignatureDeclaration: assertTSConstructSignatureDeclaration,
- assertTSPropertySignature: assertTSPropertySignature,
- assertTSMethodSignature: assertTSMethodSignature,
- assertTSIndexSignature: assertTSIndexSignature,
- assertTSAnyKeyword: assertTSAnyKeyword,
- assertTSBooleanKeyword: assertTSBooleanKeyword,
- assertTSBigIntKeyword: assertTSBigIntKeyword,
- assertTSNeverKeyword: assertTSNeverKeyword,
- assertTSNullKeyword: assertTSNullKeyword,
- assertTSNumberKeyword: assertTSNumberKeyword,
- assertTSObjectKeyword: assertTSObjectKeyword,
- assertTSStringKeyword: assertTSStringKeyword,
- assertTSSymbolKeyword: assertTSSymbolKeyword,
- assertTSUndefinedKeyword: assertTSUndefinedKeyword,
- assertTSUnknownKeyword: assertTSUnknownKeyword,
- assertTSVoidKeyword: assertTSVoidKeyword,
- assertTSThisType: assertTSThisType,
- assertTSFunctionType: assertTSFunctionType,
- assertTSConstructorType: assertTSConstructorType,
- assertTSTypeReference: assertTSTypeReference,
- assertTSTypePredicate: assertTSTypePredicate,
- assertTSTypeQuery: assertTSTypeQuery,
- assertTSTypeLiteral: assertTSTypeLiteral,
- assertTSArrayType: assertTSArrayType,
- assertTSTupleType: assertTSTupleType,
- assertTSOptionalType: assertTSOptionalType,
- assertTSRestType: assertTSRestType,
- assertTSUnionType: assertTSUnionType,
- assertTSIntersectionType: assertTSIntersectionType,
- assertTSConditionalType: assertTSConditionalType,
- assertTSInferType: assertTSInferType,
- assertTSParenthesizedType: assertTSParenthesizedType,
- assertTSTypeOperator: assertTSTypeOperator,
- assertTSIndexedAccessType: assertTSIndexedAccessType,
- assertTSMappedType: assertTSMappedType,
- assertTSLiteralType: assertTSLiteralType,
- assertTSExpressionWithTypeArguments: assertTSExpressionWithTypeArguments,
- assertTSInterfaceDeclaration: assertTSInterfaceDeclaration,
- assertTSInterfaceBody: assertTSInterfaceBody,
- assertTSTypeAliasDeclaration: assertTSTypeAliasDeclaration,
- assertTSAsExpression: assertTSAsExpression,
- assertTSTypeAssertion: assertTSTypeAssertion,
- assertTSEnumDeclaration: assertTSEnumDeclaration,
- assertTSEnumMember: assertTSEnumMember,
- assertTSModuleDeclaration: assertTSModuleDeclaration,
- assertTSModuleBlock: assertTSModuleBlock,
- assertTSImportType: assertTSImportType,
- assertTSImportEqualsDeclaration: assertTSImportEqualsDeclaration,
- assertTSExternalModuleReference: assertTSExternalModuleReference,
- assertTSNonNullExpression: assertTSNonNullExpression,
- assertTSExportAssignment: assertTSExportAssignment,
- assertTSNamespaceExportDeclaration: assertTSNamespaceExportDeclaration,
- assertTSTypeAnnotation: assertTSTypeAnnotation,
- assertTSTypeParameterInstantiation: assertTSTypeParameterInstantiation,
- assertTSTypeParameterDeclaration: assertTSTypeParameterDeclaration,
- assertTSTypeParameter: assertTSTypeParameter,
- assertExpression: assertExpression,
- assertBinary: assertBinary,
- assertScopable: assertScopable,
- assertBlockParent: assertBlockParent,
- assertBlock: assertBlock,
- assertStatement: assertStatement,
- assertTerminatorless: assertTerminatorless,
- assertCompletionStatement: assertCompletionStatement,
- assertConditional: assertConditional,
- assertLoop: assertLoop,
- assertWhile: assertWhile,
- assertExpressionWrapper: assertExpressionWrapper,
- assertFor: assertFor,
- assertForXStatement: assertForXStatement,
- assertFunction: assertFunction,
- assertFunctionParent: assertFunctionParent,
- assertPureish: assertPureish,
- assertDeclaration: assertDeclaration,
- assertPatternLike: assertPatternLike,
- assertLVal: assertLVal,
- assertTSEntityName: assertTSEntityName,
- assertLiteral: assertLiteral,
- assertImmutable: assertImmutable,
- assertUserWhitespacable: assertUserWhitespacable,
- assertMethod: assertMethod,
- assertObjectMember: assertObjectMember,
- assertProperty: assertProperty,
- assertUnaryLike: assertUnaryLike,
- assertPattern: assertPattern,
- assertClass: assertClass,
- assertModuleDeclaration: assertModuleDeclaration,
- assertExportDeclaration: assertExportDeclaration,
- assertModuleSpecifier: assertModuleSpecifier,
- assertFlow: assertFlow,
- assertFlowType: assertFlowType,
- assertFlowBaseAnnotation: assertFlowBaseAnnotation,
- assertFlowDeclaration: assertFlowDeclaration,
- assertFlowPredicate: assertFlowPredicate,
- assertEnumBody: assertEnumBody,
- assertEnumMember: assertEnumMember,
- assertJSX: assertJSX,
- assertPrivate: assertPrivate,
- assertTSTypeElement: assertTSTypeElement,
- assertTSType: assertTSType,
- assertNumberLiteral: assertNumberLiteral,
- assertRegexLiteral: assertRegexLiteral,
- assertRestProperty: assertRestProperty,
- assertSpreadProperty: assertSpreadProperty,
- ArrayExpression: ArrayExpression,
- arrayExpression: ArrayExpression,
- AssignmentExpression: AssignmentExpression,
- assignmentExpression: AssignmentExpression,
- BinaryExpression: BinaryExpression,
- binaryExpression: BinaryExpression,
- InterpreterDirective: InterpreterDirective,
- interpreterDirective: InterpreterDirective,
- Directive: Directive,
- directive: Directive,
- DirectiveLiteral: DirectiveLiteral,
- directiveLiteral: DirectiveLiteral,
- BlockStatement: BlockStatement,
- blockStatement: BlockStatement,
- BreakStatement: BreakStatement,
- breakStatement: BreakStatement,
- CallExpression: CallExpression,
- callExpression: CallExpression,
- CatchClause: CatchClause,
- catchClause: CatchClause,
- ConditionalExpression: ConditionalExpression,
- conditionalExpression: ConditionalExpression,
- ContinueStatement: ContinueStatement,
- continueStatement: ContinueStatement,
- DebuggerStatement: DebuggerStatement,
- debuggerStatement: DebuggerStatement,
- DoWhileStatement: DoWhileStatement,
- doWhileStatement: DoWhileStatement,
- EmptyStatement: EmptyStatement,
- emptyStatement: EmptyStatement,
- ExpressionStatement: ExpressionStatement,
- expressionStatement: ExpressionStatement,
- File: File,
- file: File,
- ForInStatement: ForInStatement,
- forInStatement: ForInStatement,
- ForStatement: ForStatement,
- forStatement: ForStatement,
- FunctionDeclaration: FunctionDeclaration,
- functionDeclaration: FunctionDeclaration,
- FunctionExpression: FunctionExpression,
- functionExpression: FunctionExpression,
- Identifier: Identifier,
- identifier: Identifier,
- IfStatement: IfStatement,
- ifStatement: IfStatement,
- LabeledStatement: LabeledStatement,
- labeledStatement: LabeledStatement,
- StringLiteral: StringLiteral,
- stringLiteral: StringLiteral,
- NumericLiteral: NumericLiteral,
- numericLiteral: NumericLiteral,
- NullLiteral: NullLiteral,
- nullLiteral: NullLiteral,
- BooleanLiteral: BooleanLiteral,
- booleanLiteral: BooleanLiteral,
- RegExpLiteral: RegExpLiteral,
- regExpLiteral: RegExpLiteral,
- LogicalExpression: LogicalExpression,
- logicalExpression: LogicalExpression,
- MemberExpression: MemberExpression,
- memberExpression: MemberExpression,
- NewExpression: NewExpression,
- newExpression: NewExpression,
- Program: Program,
- program: Program,
- ObjectExpression: ObjectExpression,
- objectExpression: ObjectExpression,
- ObjectMethod: ObjectMethod,
- objectMethod: ObjectMethod,
- ObjectProperty: ObjectProperty,
- objectProperty: ObjectProperty,
- RestElement: RestElement,
- restElement: RestElement,
- ReturnStatement: ReturnStatement,
- returnStatement: ReturnStatement,
- SequenceExpression: SequenceExpression,
- sequenceExpression: SequenceExpression,
- ParenthesizedExpression: ParenthesizedExpression,
- parenthesizedExpression: ParenthesizedExpression,
- SwitchCase: SwitchCase,
- switchCase: SwitchCase,
- SwitchStatement: SwitchStatement,
- switchStatement: SwitchStatement,
- ThisExpression: ThisExpression,
- thisExpression: ThisExpression,
- ThrowStatement: ThrowStatement,
- throwStatement: ThrowStatement,
- TryStatement: TryStatement,
- tryStatement: TryStatement,
- UnaryExpression: UnaryExpression,
- unaryExpression: UnaryExpression,
- UpdateExpression: UpdateExpression,
- updateExpression: UpdateExpression,
- VariableDeclaration: VariableDeclaration,
- variableDeclaration: VariableDeclaration,
- VariableDeclarator: VariableDeclarator,
- variableDeclarator: VariableDeclarator,
- WhileStatement: WhileStatement,
- whileStatement: WhileStatement,
- WithStatement: WithStatement,
- withStatement: WithStatement,
- AssignmentPattern: AssignmentPattern,
- assignmentPattern: AssignmentPattern,
- ArrayPattern: ArrayPattern,
- arrayPattern: ArrayPattern,
- ArrowFunctionExpression: ArrowFunctionExpression,
- arrowFunctionExpression: ArrowFunctionExpression,
- ClassBody: ClassBody,
- classBody: ClassBody,
- ClassExpression: ClassExpression,
- classExpression: ClassExpression,
- ClassDeclaration: ClassDeclaration,
- classDeclaration: ClassDeclaration,
- ExportAllDeclaration: ExportAllDeclaration,
- exportAllDeclaration: ExportAllDeclaration,
- ExportDefaultDeclaration: ExportDefaultDeclaration,
- exportDefaultDeclaration: ExportDefaultDeclaration,
- ExportNamedDeclaration: ExportNamedDeclaration,
- exportNamedDeclaration: ExportNamedDeclaration,
- ExportSpecifier: ExportSpecifier,
- exportSpecifier: ExportSpecifier,
- ForOfStatement: ForOfStatement,
- forOfStatement: ForOfStatement,
- ImportDeclaration: ImportDeclaration,
- importDeclaration: ImportDeclaration,
- ImportDefaultSpecifier: ImportDefaultSpecifier,
- importDefaultSpecifier: ImportDefaultSpecifier,
- ImportNamespaceSpecifier: ImportNamespaceSpecifier,
- importNamespaceSpecifier: ImportNamespaceSpecifier,
- ImportSpecifier: ImportSpecifier,
- importSpecifier: ImportSpecifier,
- MetaProperty: MetaProperty,
- metaProperty: MetaProperty,
- ClassMethod: ClassMethod,
- classMethod: ClassMethod,
- ObjectPattern: ObjectPattern,
- objectPattern: ObjectPattern,
- SpreadElement: SpreadElement,
- spreadElement: SpreadElement,
- Super: Super,
- 'super': Super,
- TaggedTemplateExpression: TaggedTemplateExpression,
- taggedTemplateExpression: TaggedTemplateExpression,
- TemplateElement: TemplateElement,
- templateElement: TemplateElement,
- TemplateLiteral: TemplateLiteral,
- templateLiteral: TemplateLiteral,
- YieldExpression: YieldExpression,
- yieldExpression: YieldExpression,
- AnyTypeAnnotation: AnyTypeAnnotation,
- anyTypeAnnotation: AnyTypeAnnotation,
- ArrayTypeAnnotation: ArrayTypeAnnotation,
- arrayTypeAnnotation: ArrayTypeAnnotation,
- BooleanTypeAnnotation: BooleanTypeAnnotation,
- booleanTypeAnnotation: BooleanTypeAnnotation,
- BooleanLiteralTypeAnnotation: BooleanLiteralTypeAnnotation,
- booleanLiteralTypeAnnotation: BooleanLiteralTypeAnnotation,
- NullLiteralTypeAnnotation: NullLiteralTypeAnnotation,
- nullLiteralTypeAnnotation: NullLiteralTypeAnnotation,
- ClassImplements: ClassImplements,
- classImplements: ClassImplements,
- DeclareClass: DeclareClass,
- declareClass: DeclareClass,
- DeclareFunction: DeclareFunction,
- declareFunction: DeclareFunction,
- DeclareInterface: DeclareInterface,
- declareInterface: DeclareInterface,
- DeclareModule: DeclareModule,
- declareModule: DeclareModule,
- DeclareModuleExports: DeclareModuleExports,
- declareModuleExports: DeclareModuleExports,
- DeclareTypeAlias: DeclareTypeAlias,
- declareTypeAlias: DeclareTypeAlias,
- DeclareOpaqueType: DeclareOpaqueType,
- declareOpaqueType: DeclareOpaqueType,
- DeclareVariable: DeclareVariable,
- declareVariable: DeclareVariable,
- DeclareExportDeclaration: DeclareExportDeclaration,
- declareExportDeclaration: DeclareExportDeclaration,
- DeclareExportAllDeclaration: DeclareExportAllDeclaration,
- declareExportAllDeclaration: DeclareExportAllDeclaration,
- DeclaredPredicate: DeclaredPredicate,
- declaredPredicate: DeclaredPredicate,
- ExistsTypeAnnotation: ExistsTypeAnnotation,
- existsTypeAnnotation: ExistsTypeAnnotation,
- FunctionTypeAnnotation: FunctionTypeAnnotation,
- functionTypeAnnotation: FunctionTypeAnnotation,
- FunctionTypeParam: FunctionTypeParam,
- functionTypeParam: FunctionTypeParam,
- GenericTypeAnnotation: GenericTypeAnnotation,
- genericTypeAnnotation: GenericTypeAnnotation,
- InferredPredicate: InferredPredicate,
- inferredPredicate: InferredPredicate,
- InterfaceExtends: InterfaceExtends,
- interfaceExtends: InterfaceExtends,
- InterfaceDeclaration: InterfaceDeclaration,
- interfaceDeclaration: InterfaceDeclaration,
- InterfaceTypeAnnotation: InterfaceTypeAnnotation,
- interfaceTypeAnnotation: InterfaceTypeAnnotation,
- IntersectionTypeAnnotation: IntersectionTypeAnnotation,
- intersectionTypeAnnotation: IntersectionTypeAnnotation,
- MixedTypeAnnotation: MixedTypeAnnotation,
- mixedTypeAnnotation: MixedTypeAnnotation,
- EmptyTypeAnnotation: EmptyTypeAnnotation,
- emptyTypeAnnotation: EmptyTypeAnnotation,
- NullableTypeAnnotation: NullableTypeAnnotation,
- nullableTypeAnnotation: NullableTypeAnnotation,
- NumberLiteralTypeAnnotation: NumberLiteralTypeAnnotation,
- numberLiteralTypeAnnotation: NumberLiteralTypeAnnotation,
- NumberTypeAnnotation: NumberTypeAnnotation,
- numberTypeAnnotation: NumberTypeAnnotation,
- ObjectTypeAnnotation: ObjectTypeAnnotation,
- objectTypeAnnotation: ObjectTypeAnnotation,
- ObjectTypeInternalSlot: ObjectTypeInternalSlot,
- objectTypeInternalSlot: ObjectTypeInternalSlot,
- ObjectTypeCallProperty: ObjectTypeCallProperty,
- objectTypeCallProperty: ObjectTypeCallProperty,
- ObjectTypeIndexer: ObjectTypeIndexer,
- objectTypeIndexer: ObjectTypeIndexer,
- ObjectTypeProperty: ObjectTypeProperty,
- objectTypeProperty: ObjectTypeProperty,
- ObjectTypeSpreadProperty: ObjectTypeSpreadProperty,
- objectTypeSpreadProperty: ObjectTypeSpreadProperty,
- OpaqueType: OpaqueType,
- opaqueType: OpaqueType,
- QualifiedTypeIdentifier: QualifiedTypeIdentifier,
- qualifiedTypeIdentifier: QualifiedTypeIdentifier,
- StringLiteralTypeAnnotation: StringLiteralTypeAnnotation,
- stringLiteralTypeAnnotation: StringLiteralTypeAnnotation,
- StringTypeAnnotation: StringTypeAnnotation,
- stringTypeAnnotation: StringTypeAnnotation,
- ThisTypeAnnotation: ThisTypeAnnotation,
- thisTypeAnnotation: ThisTypeAnnotation,
- TupleTypeAnnotation: TupleTypeAnnotation,
- tupleTypeAnnotation: TupleTypeAnnotation,
- TypeofTypeAnnotation: TypeofTypeAnnotation,
- typeofTypeAnnotation: TypeofTypeAnnotation,
- TypeAlias: TypeAlias,
- typeAlias: TypeAlias,
- TypeAnnotation: TypeAnnotation,
- typeAnnotation: TypeAnnotation,
- TypeCastExpression: TypeCastExpression,
- typeCastExpression: TypeCastExpression,
- TypeParameter: TypeParameter,
- typeParameter: TypeParameter,
- TypeParameterDeclaration: TypeParameterDeclaration,
- typeParameterDeclaration: TypeParameterDeclaration,
- TypeParameterInstantiation: TypeParameterInstantiation,
- typeParameterInstantiation: TypeParameterInstantiation,
- UnionTypeAnnotation: UnionTypeAnnotation,
- unionTypeAnnotation: UnionTypeAnnotation,
- Variance: Variance,
- variance: Variance,
- VoidTypeAnnotation: VoidTypeAnnotation,
- voidTypeAnnotation: VoidTypeAnnotation,
- EnumDeclaration: EnumDeclaration,
- enumDeclaration: EnumDeclaration,
- EnumBooleanBody: EnumBooleanBody,
- enumBooleanBody: EnumBooleanBody,
- EnumNumberBody: EnumNumberBody,
- enumNumberBody: EnumNumberBody,
- EnumStringBody: EnumStringBody,
- enumStringBody: EnumStringBody,
- EnumSymbolBody: EnumSymbolBody,
- enumSymbolBody: EnumSymbolBody,
- EnumBooleanMember: EnumBooleanMember,
- enumBooleanMember: EnumBooleanMember,
- EnumNumberMember: EnumNumberMember,
- enumNumberMember: EnumNumberMember,
- EnumStringMember: EnumStringMember,
- enumStringMember: EnumStringMember,
- EnumDefaultedMember: EnumDefaultedMember,
- enumDefaultedMember: EnumDefaultedMember,
- JSXAttribute: JSXAttribute,
- jsxAttribute: JSXAttribute,
- jSXAttribute: JSXAttribute,
- JSXClosingElement: JSXClosingElement,
- jsxClosingElement: JSXClosingElement,
- jSXClosingElement: JSXClosingElement,
- JSXElement: JSXElement,
- jsxElement: JSXElement,
- jSXElement: JSXElement,
- JSXEmptyExpression: JSXEmptyExpression,
- jsxEmptyExpression: JSXEmptyExpression,
- jSXEmptyExpression: JSXEmptyExpression,
- JSXExpressionContainer: JSXExpressionContainer,
- jsxExpressionContainer: JSXExpressionContainer,
- jSXExpressionContainer: JSXExpressionContainer,
- JSXSpreadChild: JSXSpreadChild,
- jsxSpreadChild: JSXSpreadChild,
- jSXSpreadChild: JSXSpreadChild,
- JSXIdentifier: JSXIdentifier,
- jsxIdentifier: JSXIdentifier,
- jSXIdentifier: JSXIdentifier,
- JSXMemberExpression: JSXMemberExpression,
- jsxMemberExpression: JSXMemberExpression,
- jSXMemberExpression: JSXMemberExpression,
- JSXNamespacedName: JSXNamespacedName,
- jsxNamespacedName: JSXNamespacedName,
- jSXNamespacedName: JSXNamespacedName,
- JSXOpeningElement: JSXOpeningElement,
- jsxOpeningElement: JSXOpeningElement,
- jSXOpeningElement: JSXOpeningElement,
- JSXSpreadAttribute: JSXSpreadAttribute,
- jsxSpreadAttribute: JSXSpreadAttribute,
- jSXSpreadAttribute: JSXSpreadAttribute,
- JSXText: JSXText,
- jsxText: JSXText,
- jSXText: JSXText,
- JSXFragment: JSXFragment,
- jsxFragment: JSXFragment,
- jSXFragment: JSXFragment,
- JSXOpeningFragment: JSXOpeningFragment,
- jsxOpeningFragment: JSXOpeningFragment,
- jSXOpeningFragment: JSXOpeningFragment,
- JSXClosingFragment: JSXClosingFragment,
- jsxClosingFragment: JSXClosingFragment,
- jSXClosingFragment: JSXClosingFragment,
- Noop: Noop,
- noop: Noop,
- Placeholder: Placeholder,
- placeholder: Placeholder,
- V8IntrinsicIdentifier: V8IntrinsicIdentifier,
- v8IntrinsicIdentifier: V8IntrinsicIdentifier,
- ArgumentPlaceholder: ArgumentPlaceholder,
- argumentPlaceholder: ArgumentPlaceholder,
- AwaitExpression: AwaitExpression,
- awaitExpression: AwaitExpression,
- BindExpression: BindExpression,
- bindExpression: BindExpression,
- ClassProperty: ClassProperty,
- classProperty: ClassProperty,
- OptionalMemberExpression: OptionalMemberExpression,
- optionalMemberExpression: OptionalMemberExpression,
- PipelineTopicExpression: PipelineTopicExpression,
- pipelineTopicExpression: PipelineTopicExpression,
- PipelineBareFunction: PipelineBareFunction,
- pipelineBareFunction: PipelineBareFunction,
- PipelinePrimaryTopicReference: PipelinePrimaryTopicReference,
- pipelinePrimaryTopicReference: PipelinePrimaryTopicReference,
- OptionalCallExpression: OptionalCallExpression,
- optionalCallExpression: OptionalCallExpression,
- ClassPrivateProperty: ClassPrivateProperty,
- classPrivateProperty: ClassPrivateProperty,
- ClassPrivateMethod: ClassPrivateMethod,
- classPrivateMethod: ClassPrivateMethod,
- Import: Import,
- 'import': Import,
- Decorator: Decorator,
- decorator: Decorator,
- DoExpression: DoExpression,
- doExpression: DoExpression,
- ExportDefaultSpecifier: ExportDefaultSpecifier,
- exportDefaultSpecifier: ExportDefaultSpecifier,
- ExportNamespaceSpecifier: ExportNamespaceSpecifier,
- exportNamespaceSpecifier: ExportNamespaceSpecifier,
- PrivateName: PrivateName,
- privateName: PrivateName,
- BigIntLiteral: BigIntLiteral,
- bigIntLiteral: BigIntLiteral,
- TSParameterProperty: TSParameterProperty,
- tsParameterProperty: TSParameterProperty,
- tSParameterProperty: TSParameterProperty,
- TSDeclareFunction: TSDeclareFunction,
- tsDeclareFunction: TSDeclareFunction,
- tSDeclareFunction: TSDeclareFunction,
- TSDeclareMethod: TSDeclareMethod,
- tsDeclareMethod: TSDeclareMethod,
- tSDeclareMethod: TSDeclareMethod,
- TSQualifiedName: TSQualifiedName,
- tsQualifiedName: TSQualifiedName,
- tSQualifiedName: TSQualifiedName,
- TSCallSignatureDeclaration: TSCallSignatureDeclaration,
- tsCallSignatureDeclaration: TSCallSignatureDeclaration,
- tSCallSignatureDeclaration: TSCallSignatureDeclaration,
- TSConstructSignatureDeclaration: TSConstructSignatureDeclaration,
- tsConstructSignatureDeclaration: TSConstructSignatureDeclaration,
- tSConstructSignatureDeclaration: TSConstructSignatureDeclaration,
- TSPropertySignature: TSPropertySignature,
- tsPropertySignature: TSPropertySignature,
- tSPropertySignature: TSPropertySignature,
- TSMethodSignature: TSMethodSignature,
- tsMethodSignature: TSMethodSignature,
- tSMethodSignature: TSMethodSignature,
- TSIndexSignature: TSIndexSignature,
- tsIndexSignature: TSIndexSignature,
- tSIndexSignature: TSIndexSignature,
- TSAnyKeyword: TSAnyKeyword,
- tsAnyKeyword: TSAnyKeyword,
- tSAnyKeyword: TSAnyKeyword,
- TSBooleanKeyword: TSBooleanKeyword,
- tsBooleanKeyword: TSBooleanKeyword,
- tSBooleanKeyword: TSBooleanKeyword,
- TSBigIntKeyword: TSBigIntKeyword,
- tsBigIntKeyword: TSBigIntKeyword,
- tSBigIntKeyword: TSBigIntKeyword,
- TSNeverKeyword: TSNeverKeyword,
- tsNeverKeyword: TSNeverKeyword,
- tSNeverKeyword: TSNeverKeyword,
- TSNullKeyword: TSNullKeyword,
- tsNullKeyword: TSNullKeyword,
- tSNullKeyword: TSNullKeyword,
- TSNumberKeyword: TSNumberKeyword,
- tsNumberKeyword: TSNumberKeyword,
- tSNumberKeyword: TSNumberKeyword,
- TSObjectKeyword: TSObjectKeyword,
- tsObjectKeyword: TSObjectKeyword,
- tSObjectKeyword: TSObjectKeyword,
- TSStringKeyword: TSStringKeyword,
- tsStringKeyword: TSStringKeyword,
- tSStringKeyword: TSStringKeyword,
- TSSymbolKeyword: TSSymbolKeyword,
- tsSymbolKeyword: TSSymbolKeyword,
- tSSymbolKeyword: TSSymbolKeyword,
- TSUndefinedKeyword: TSUndefinedKeyword,
- tsUndefinedKeyword: TSUndefinedKeyword,
- tSUndefinedKeyword: TSUndefinedKeyword,
- TSUnknownKeyword: TSUnknownKeyword,
- tsUnknownKeyword: TSUnknownKeyword,
- tSUnknownKeyword: TSUnknownKeyword,
- TSVoidKeyword: TSVoidKeyword,
- tsVoidKeyword: TSVoidKeyword,
- tSVoidKeyword: TSVoidKeyword,
- TSThisType: TSThisType,
- tsThisType: TSThisType,
- tSThisType: TSThisType,
- TSFunctionType: TSFunctionType,
- tsFunctionType: TSFunctionType,
- tSFunctionType: TSFunctionType,
- TSConstructorType: TSConstructorType,
- tsConstructorType: TSConstructorType,
- tSConstructorType: TSConstructorType,
- TSTypeReference: TSTypeReference,
- tsTypeReference: TSTypeReference,
- tSTypeReference: TSTypeReference,
- TSTypePredicate: TSTypePredicate,
- tsTypePredicate: TSTypePredicate,
- tSTypePredicate: TSTypePredicate,
- TSTypeQuery: TSTypeQuery,
- tsTypeQuery: TSTypeQuery,
- tSTypeQuery: TSTypeQuery,
- TSTypeLiteral: TSTypeLiteral,
- tsTypeLiteral: TSTypeLiteral,
- tSTypeLiteral: TSTypeLiteral,
- TSArrayType: TSArrayType,
- tsArrayType: TSArrayType,
- tSArrayType: TSArrayType,
- TSTupleType: TSTupleType,
- tsTupleType: TSTupleType,
- tSTupleType: TSTupleType,
- TSOptionalType: TSOptionalType,
- tsOptionalType: TSOptionalType,
- tSOptionalType: TSOptionalType,
- TSRestType: TSRestType,
- tsRestType: TSRestType,
- tSRestType: TSRestType,
- TSUnionType: TSUnionType,
- tsUnionType: TSUnionType,
- tSUnionType: TSUnionType,
- TSIntersectionType: TSIntersectionType,
- tsIntersectionType: TSIntersectionType,
- tSIntersectionType: TSIntersectionType,
- TSConditionalType: TSConditionalType,
- tsConditionalType: TSConditionalType,
- tSConditionalType: TSConditionalType,
- TSInferType: TSInferType,
- tsInferType: TSInferType,
- tSInferType: TSInferType,
- TSParenthesizedType: TSParenthesizedType,
- tsParenthesizedType: TSParenthesizedType,
- tSParenthesizedType: TSParenthesizedType,
- TSTypeOperator: TSTypeOperator,
- tsTypeOperator: TSTypeOperator,
- tSTypeOperator: TSTypeOperator,
- TSIndexedAccessType: TSIndexedAccessType,
- tsIndexedAccessType: TSIndexedAccessType,
- tSIndexedAccessType: TSIndexedAccessType,
- TSMappedType: TSMappedType,
- tsMappedType: TSMappedType,
- tSMappedType: TSMappedType,
- TSLiteralType: TSLiteralType,
- tsLiteralType: TSLiteralType,
- tSLiteralType: TSLiteralType,
- TSExpressionWithTypeArguments: TSExpressionWithTypeArguments,
- tsExpressionWithTypeArguments: TSExpressionWithTypeArguments,
- tSExpressionWithTypeArguments: TSExpressionWithTypeArguments,
- TSInterfaceDeclaration: TSInterfaceDeclaration,
- tsInterfaceDeclaration: TSInterfaceDeclaration,
- tSInterfaceDeclaration: TSInterfaceDeclaration,
- TSInterfaceBody: TSInterfaceBody,
- tsInterfaceBody: TSInterfaceBody,
- tSInterfaceBody: TSInterfaceBody,
- TSTypeAliasDeclaration: TSTypeAliasDeclaration,
- tsTypeAliasDeclaration: TSTypeAliasDeclaration,
- tSTypeAliasDeclaration: TSTypeAliasDeclaration,
- TSAsExpression: TSAsExpression,
- tsAsExpression: TSAsExpression,
- tSAsExpression: TSAsExpression,
- TSTypeAssertion: TSTypeAssertion,
- tsTypeAssertion: TSTypeAssertion,
- tSTypeAssertion: TSTypeAssertion,
- TSEnumDeclaration: TSEnumDeclaration,
- tsEnumDeclaration: TSEnumDeclaration,
- tSEnumDeclaration: TSEnumDeclaration,
- TSEnumMember: TSEnumMember,
- tsEnumMember: TSEnumMember,
- tSEnumMember: TSEnumMember,
- TSModuleDeclaration: TSModuleDeclaration,
- tsModuleDeclaration: TSModuleDeclaration,
- tSModuleDeclaration: TSModuleDeclaration,
- TSModuleBlock: TSModuleBlock,
- tsModuleBlock: TSModuleBlock,
- tSModuleBlock: TSModuleBlock,
- TSImportType: TSImportType,
- tsImportType: TSImportType,
- tSImportType: TSImportType,
- TSImportEqualsDeclaration: TSImportEqualsDeclaration,
- tsImportEqualsDeclaration: TSImportEqualsDeclaration,
- tSImportEqualsDeclaration: TSImportEqualsDeclaration,
- TSExternalModuleReference: TSExternalModuleReference,
- tsExternalModuleReference: TSExternalModuleReference,
- tSExternalModuleReference: TSExternalModuleReference,
- TSNonNullExpression: TSNonNullExpression,
- tsNonNullExpression: TSNonNullExpression,
- tSNonNullExpression: TSNonNullExpression,
- TSExportAssignment: TSExportAssignment,
- tsExportAssignment: TSExportAssignment,
- tSExportAssignment: TSExportAssignment,
- TSNamespaceExportDeclaration: TSNamespaceExportDeclaration,
- tsNamespaceExportDeclaration: TSNamespaceExportDeclaration,
- tSNamespaceExportDeclaration: TSNamespaceExportDeclaration,
- TSTypeAnnotation: TSTypeAnnotation,
- tsTypeAnnotation: TSTypeAnnotation,
- tSTypeAnnotation: TSTypeAnnotation,
- TSTypeParameterInstantiation: TSTypeParameterInstantiation,
- tsTypeParameterInstantiation: TSTypeParameterInstantiation,
- tSTypeParameterInstantiation: TSTypeParameterInstantiation,
- TSTypeParameterDeclaration: TSTypeParameterDeclaration,
- tsTypeParameterDeclaration: TSTypeParameterDeclaration,
- tSTypeParameterDeclaration: TSTypeParameterDeclaration,
- TSTypeParameter: TSTypeParameter,
- tsTypeParameter: TSTypeParameter,
- tSTypeParameter: TSTypeParameter,
- NumberLiteral: NumberLiteral,
- numberLiteral: NumberLiteral,
- RegexLiteral: RegexLiteral,
- regexLiteral: RegexLiteral,
- RestProperty: RestProperty,
- restProperty: RestProperty,
- SpreadProperty: SpreadProperty,
- spreadProperty: SpreadProperty,
- EXPRESSION_TYPES: EXPRESSION_TYPES,
- BINARY_TYPES: BINARY_TYPES,
- SCOPABLE_TYPES: SCOPABLE_TYPES,
- BLOCKPARENT_TYPES: BLOCKPARENT_TYPES,
- BLOCK_TYPES: BLOCK_TYPES,
- STATEMENT_TYPES: STATEMENT_TYPES,
- TERMINATORLESS_TYPES: TERMINATORLESS_TYPES,
- COMPLETIONSTATEMENT_TYPES: COMPLETIONSTATEMENT_TYPES,
- CONDITIONAL_TYPES: CONDITIONAL_TYPES,
- LOOP_TYPES: LOOP_TYPES,
- WHILE_TYPES: WHILE_TYPES,
- EXPRESSIONWRAPPER_TYPES: EXPRESSIONWRAPPER_TYPES,
- FOR_TYPES: FOR_TYPES,
- FORXSTATEMENT_TYPES: FORXSTATEMENT_TYPES,
- FUNCTION_TYPES: FUNCTION_TYPES,
- FUNCTIONPARENT_TYPES: FUNCTIONPARENT_TYPES,
- PUREISH_TYPES: PUREISH_TYPES,
- DECLARATION_TYPES: DECLARATION_TYPES,
- PATTERNLIKE_TYPES: PATTERNLIKE_TYPES,
- LVAL_TYPES: LVAL_TYPES,
- TSENTITYNAME_TYPES: TSENTITYNAME_TYPES,
- LITERAL_TYPES: LITERAL_TYPES,
- IMMUTABLE_TYPES: IMMUTABLE_TYPES,
- USERWHITESPACABLE_TYPES: USERWHITESPACABLE_TYPES,
- METHOD_TYPES: METHOD_TYPES,
- OBJECTMEMBER_TYPES: OBJECTMEMBER_TYPES,
- PROPERTY_TYPES: PROPERTY_TYPES,
- UNARYLIKE_TYPES: UNARYLIKE_TYPES,
- PATTERN_TYPES: PATTERN_TYPES,
- CLASS_TYPES: CLASS_TYPES,
- MODULEDECLARATION_TYPES: MODULEDECLARATION_TYPES,
- EXPORTDECLARATION_TYPES: EXPORTDECLARATION_TYPES,
- MODULESPECIFIER_TYPES: MODULESPECIFIER_TYPES,
- FLOW_TYPES: FLOW_TYPES,
- FLOWTYPE_TYPES: FLOWTYPE_TYPES,
- FLOWBASEANNOTATION_TYPES: FLOWBASEANNOTATION_TYPES,
- FLOWDECLARATION_TYPES: FLOWDECLARATION_TYPES,
- FLOWPREDICATE_TYPES: FLOWPREDICATE_TYPES,
- ENUMBODY_TYPES: ENUMBODY_TYPES,
- ENUMMEMBER_TYPES: ENUMMEMBER_TYPES,
- JSX_TYPES: JSX_TYPES,
- PRIVATE_TYPES: PRIVATE_TYPES,
- TSTYPEELEMENT_TYPES: TSTYPEELEMENT_TYPES,
- TSTYPE_TYPES: TSTYPE_TYPES,
- STATEMENT_OR_BLOCK_KEYS: STATEMENT_OR_BLOCK_KEYS,
- FLATTENABLE_KEYS: FLATTENABLE_KEYS,
- FOR_INIT_KEYS: FOR_INIT_KEYS,
- COMMENT_KEYS: COMMENT_KEYS,
- LOGICAL_OPERATORS: LOGICAL_OPERATORS,
- UPDATE_OPERATORS: UPDATE_OPERATORS,
- BOOLEAN_NUMBER_BINARY_OPERATORS: BOOLEAN_NUMBER_BINARY_OPERATORS,
- EQUALITY_BINARY_OPERATORS: EQUALITY_BINARY_OPERATORS,
- COMPARISON_BINARY_OPERATORS: COMPARISON_BINARY_OPERATORS,
- BOOLEAN_BINARY_OPERATORS: BOOLEAN_BINARY_OPERATORS,
- NUMBER_BINARY_OPERATORS: NUMBER_BINARY_OPERATORS,
- BINARY_OPERATORS: BINARY_OPERATORS,
- ASSIGNMENT_OPERATORS: ASSIGNMENT_OPERATORS,
- BOOLEAN_UNARY_OPERATORS: BOOLEAN_UNARY_OPERATORS,
- NUMBER_UNARY_OPERATORS: NUMBER_UNARY_OPERATORS,
- STRING_UNARY_OPERATORS: STRING_UNARY_OPERATORS,
- UNARY_OPERATORS: UNARY_OPERATORS,
- INHERIT_KEYS: INHERIT_KEYS,
- BLOCK_SCOPED_SYMBOL: BLOCK_SCOPED_SYMBOL,
- NOT_LOCAL_BINDING: NOT_LOCAL_BINDING,
- VISITOR_KEYS: VISITOR_KEYS,
- ALIAS_KEYS: ALIAS_KEYS,
- FLIPPED_ALIAS_KEYS: FLIPPED_ALIAS_KEYS,
- NODE_FIELDS: NODE_FIELDS,
- BUILDER_KEYS: BUILDER_KEYS,
- DEPRECATED_KEYS: DEPRECATED_KEYS,
- NODE_PARENT_VALIDATIONS: NODE_PARENT_VALIDATIONS,
- PLACEHOLDERS: PLACEHOLDERS,
- PLACEHOLDERS_ALIAS: PLACEHOLDERS_ALIAS,
- PLACEHOLDERS_FLIPPED_ALIAS: PLACEHOLDERS_FLIPPED_ALIAS,
- TYPES: TYPES,
- isArrayExpression: isArrayExpression,
- isAssignmentExpression: isAssignmentExpression,
- isBinaryExpression: isBinaryExpression,
- isInterpreterDirective: isInterpreterDirective,
- isDirective: isDirective,
- isDirectiveLiteral: isDirectiveLiteral,
- isBlockStatement: isBlockStatement,
- isBreakStatement: isBreakStatement,
- isCallExpression: isCallExpression,
- isCatchClause: isCatchClause,
- isConditionalExpression: isConditionalExpression,
- isContinueStatement: isContinueStatement,
- isDebuggerStatement: isDebuggerStatement,
- isDoWhileStatement: isDoWhileStatement,
- isEmptyStatement: isEmptyStatement,
- isExpressionStatement: isExpressionStatement,
- isFile: isFile,
- isForInStatement: isForInStatement,
- isForStatement: isForStatement,
- isFunctionDeclaration: isFunctionDeclaration,
- isFunctionExpression: isFunctionExpression,
- isIdentifier: isIdentifier,
- isIfStatement: isIfStatement,
- isLabeledStatement: isLabeledStatement,
- isStringLiteral: isStringLiteral,
- isNumericLiteral: isNumericLiteral,
- isNullLiteral: isNullLiteral,
- isBooleanLiteral: isBooleanLiteral,
- isRegExpLiteral: isRegExpLiteral,
- isLogicalExpression: isLogicalExpression,
- isMemberExpression: isMemberExpression,
- isNewExpression: isNewExpression,
- isProgram: isProgram,
- isObjectExpression: isObjectExpression,
- isObjectMethod: isObjectMethod,
- isObjectProperty: isObjectProperty,
- isRestElement: isRestElement,
- isReturnStatement: isReturnStatement,
- isSequenceExpression: isSequenceExpression,
- isParenthesizedExpression: isParenthesizedExpression,
- isSwitchCase: isSwitchCase,
- isSwitchStatement: isSwitchStatement,
- isThisExpression: isThisExpression,
- isThrowStatement: isThrowStatement,
- isTryStatement: isTryStatement,
- isUnaryExpression: isUnaryExpression,
- isUpdateExpression: isUpdateExpression,
- isVariableDeclaration: isVariableDeclaration,
- isVariableDeclarator: isVariableDeclarator,
- isWhileStatement: isWhileStatement,
- isWithStatement: isWithStatement,
- isAssignmentPattern: isAssignmentPattern,
- isArrayPattern: isArrayPattern,
- isArrowFunctionExpression: isArrowFunctionExpression,
- isClassBody: isClassBody,
- isClassExpression: isClassExpression,
- isClassDeclaration: isClassDeclaration,
- isExportAllDeclaration: isExportAllDeclaration,
- isExportDefaultDeclaration: isExportDefaultDeclaration,
- isExportNamedDeclaration: isExportNamedDeclaration,
- isExportSpecifier: isExportSpecifier,
- isForOfStatement: isForOfStatement,
- isImportDeclaration: isImportDeclaration,
- isImportDefaultSpecifier: isImportDefaultSpecifier,
- isImportNamespaceSpecifier: isImportNamespaceSpecifier,
- isImportSpecifier: isImportSpecifier,
- isMetaProperty: isMetaProperty,
- isClassMethod: isClassMethod,
- isObjectPattern: isObjectPattern,
- isSpreadElement: isSpreadElement,
- isSuper: isSuper,
- isTaggedTemplateExpression: isTaggedTemplateExpression,
- isTemplateElement: isTemplateElement,
- isTemplateLiteral: isTemplateLiteral,
- isYieldExpression: isYieldExpression,
- isAnyTypeAnnotation: isAnyTypeAnnotation,
- isArrayTypeAnnotation: isArrayTypeAnnotation,
- isBooleanTypeAnnotation: isBooleanTypeAnnotation,
- isBooleanLiteralTypeAnnotation: isBooleanLiteralTypeAnnotation,
- isNullLiteralTypeAnnotation: isNullLiteralTypeAnnotation,
- isClassImplements: isClassImplements,
- isDeclareClass: isDeclareClass,
- isDeclareFunction: isDeclareFunction,
- isDeclareInterface: isDeclareInterface,
- isDeclareModule: isDeclareModule,
- isDeclareModuleExports: isDeclareModuleExports,
- isDeclareTypeAlias: isDeclareTypeAlias,
- isDeclareOpaqueType: isDeclareOpaqueType,
- isDeclareVariable: isDeclareVariable,
- isDeclareExportDeclaration: isDeclareExportDeclaration,
- isDeclareExportAllDeclaration: isDeclareExportAllDeclaration,
- isDeclaredPredicate: isDeclaredPredicate,
- isExistsTypeAnnotation: isExistsTypeAnnotation,
- isFunctionTypeAnnotation: isFunctionTypeAnnotation,
- isFunctionTypeParam: isFunctionTypeParam,
- isGenericTypeAnnotation: isGenericTypeAnnotation,
- isInferredPredicate: isInferredPredicate,
- isInterfaceExtends: isInterfaceExtends,
- isInterfaceDeclaration: isInterfaceDeclaration,
- isInterfaceTypeAnnotation: isInterfaceTypeAnnotation,
- isIntersectionTypeAnnotation: isIntersectionTypeAnnotation,
- isMixedTypeAnnotation: isMixedTypeAnnotation,
- isEmptyTypeAnnotation: isEmptyTypeAnnotation,
- isNullableTypeAnnotation: isNullableTypeAnnotation,
- isNumberLiteralTypeAnnotation: isNumberLiteralTypeAnnotation,
- isNumberTypeAnnotation: isNumberTypeAnnotation,
- isObjectTypeAnnotation: isObjectTypeAnnotation,
- isObjectTypeInternalSlot: isObjectTypeInternalSlot,
- isObjectTypeCallProperty: isObjectTypeCallProperty,
- isObjectTypeIndexer: isObjectTypeIndexer,
- isObjectTypeProperty: isObjectTypeProperty,
- isObjectTypeSpreadProperty: isObjectTypeSpreadProperty,
- isOpaqueType: isOpaqueType,
- isQualifiedTypeIdentifier: isQualifiedTypeIdentifier,
- isStringLiteralTypeAnnotation: isStringLiteralTypeAnnotation,
- isStringTypeAnnotation: isStringTypeAnnotation,
- isThisTypeAnnotation: isThisTypeAnnotation,
- isTupleTypeAnnotation: isTupleTypeAnnotation,
- isTypeofTypeAnnotation: isTypeofTypeAnnotation,
- isTypeAlias: isTypeAlias,
- isTypeAnnotation: isTypeAnnotation,
- isTypeCastExpression: isTypeCastExpression,
- isTypeParameter: isTypeParameter,
- isTypeParameterDeclaration: isTypeParameterDeclaration,
- isTypeParameterInstantiation: isTypeParameterInstantiation,
- isUnionTypeAnnotation: isUnionTypeAnnotation,
- isVariance: isVariance,
- isVoidTypeAnnotation: isVoidTypeAnnotation,
- isEnumDeclaration: isEnumDeclaration,
- isEnumBooleanBody: isEnumBooleanBody,
- isEnumNumberBody: isEnumNumberBody,
- isEnumStringBody: isEnumStringBody,
- isEnumSymbolBody: isEnumSymbolBody,
- isEnumBooleanMember: isEnumBooleanMember,
- isEnumNumberMember: isEnumNumberMember,
- isEnumStringMember: isEnumStringMember,
- isEnumDefaultedMember: isEnumDefaultedMember,
- isJSXAttribute: isJSXAttribute,
- isJSXClosingElement: isJSXClosingElement,
- isJSXElement: isJSXElement,
- isJSXEmptyExpression: isJSXEmptyExpression,
- isJSXExpressionContainer: isJSXExpressionContainer,
- isJSXSpreadChild: isJSXSpreadChild,
- isJSXIdentifier: isJSXIdentifier,
- isJSXMemberExpression: isJSXMemberExpression,
- isJSXNamespacedName: isJSXNamespacedName,
- isJSXOpeningElement: isJSXOpeningElement,
- isJSXSpreadAttribute: isJSXSpreadAttribute,
- isJSXText: isJSXText,
- isJSXFragment: isJSXFragment,
- isJSXOpeningFragment: isJSXOpeningFragment,
- isJSXClosingFragment: isJSXClosingFragment,
- isNoop: isNoop,
- isPlaceholder: isPlaceholder,
- isV8IntrinsicIdentifier: isV8IntrinsicIdentifier,
- isArgumentPlaceholder: isArgumentPlaceholder,
- isAwaitExpression: isAwaitExpression,
- isBindExpression: isBindExpression,
- isClassProperty: isClassProperty,
- isOptionalMemberExpression: isOptionalMemberExpression,
- isPipelineTopicExpression: isPipelineTopicExpression,
- isPipelineBareFunction: isPipelineBareFunction,
- isPipelinePrimaryTopicReference: isPipelinePrimaryTopicReference,
- isOptionalCallExpression: isOptionalCallExpression,
- isClassPrivateProperty: isClassPrivateProperty,
- isClassPrivateMethod: isClassPrivateMethod,
- isImport: isImport,
- isDecorator: isDecorator,
- isDoExpression: isDoExpression,
- isExportDefaultSpecifier: isExportDefaultSpecifier,
- isExportNamespaceSpecifier: isExportNamespaceSpecifier,
- isPrivateName: isPrivateName,
- isBigIntLiteral: isBigIntLiteral,
- isTSParameterProperty: isTSParameterProperty,
- isTSDeclareFunction: isTSDeclareFunction,
- isTSDeclareMethod: isTSDeclareMethod,
- isTSQualifiedName: isTSQualifiedName,
- isTSCallSignatureDeclaration: isTSCallSignatureDeclaration,
- isTSConstructSignatureDeclaration: isTSConstructSignatureDeclaration,
- isTSPropertySignature: isTSPropertySignature,
- isTSMethodSignature: isTSMethodSignature,
- isTSIndexSignature: isTSIndexSignature,
- isTSAnyKeyword: isTSAnyKeyword,
- isTSBooleanKeyword: isTSBooleanKeyword,
- isTSBigIntKeyword: isTSBigIntKeyword,
- isTSNeverKeyword: isTSNeverKeyword,
- isTSNullKeyword: isTSNullKeyword,
- isTSNumberKeyword: isTSNumberKeyword,
- isTSObjectKeyword: isTSObjectKeyword,
- isTSStringKeyword: isTSStringKeyword,
- isTSSymbolKeyword: isTSSymbolKeyword,
- isTSUndefinedKeyword: isTSUndefinedKeyword,
- isTSUnknownKeyword: isTSUnknownKeyword,
- isTSVoidKeyword: isTSVoidKeyword,
- isTSThisType: isTSThisType,
- isTSFunctionType: isTSFunctionType,
- isTSConstructorType: isTSConstructorType,
- isTSTypeReference: isTSTypeReference,
- isTSTypePredicate: isTSTypePredicate,
- isTSTypeQuery: isTSTypeQuery,
- isTSTypeLiteral: isTSTypeLiteral,
- isTSArrayType: isTSArrayType,
- isTSTupleType: isTSTupleType,
- isTSOptionalType: isTSOptionalType,
- isTSRestType: isTSRestType,
- isTSUnionType: isTSUnionType,
- isTSIntersectionType: isTSIntersectionType,
- isTSConditionalType: isTSConditionalType,
- isTSInferType: isTSInferType,
- isTSParenthesizedType: isTSParenthesizedType,
- isTSTypeOperator: isTSTypeOperator,
- isTSIndexedAccessType: isTSIndexedAccessType,
- isTSMappedType: isTSMappedType,
- isTSLiteralType: isTSLiteralType,
- isTSExpressionWithTypeArguments: isTSExpressionWithTypeArguments,
- isTSInterfaceDeclaration: isTSInterfaceDeclaration,
- isTSInterfaceBody: isTSInterfaceBody,
- isTSTypeAliasDeclaration: isTSTypeAliasDeclaration,
- isTSAsExpression: isTSAsExpression,
- isTSTypeAssertion: isTSTypeAssertion,
- isTSEnumDeclaration: isTSEnumDeclaration,
- isTSEnumMember: isTSEnumMember,
- isTSModuleDeclaration: isTSModuleDeclaration,
- isTSModuleBlock: isTSModuleBlock,
- isTSImportType: isTSImportType,
- isTSImportEqualsDeclaration: isTSImportEqualsDeclaration,
- isTSExternalModuleReference: isTSExternalModuleReference,
- isTSNonNullExpression: isTSNonNullExpression,
- isTSExportAssignment: isTSExportAssignment,
- isTSNamespaceExportDeclaration: isTSNamespaceExportDeclaration,
- isTSTypeAnnotation: isTSTypeAnnotation,
- isTSTypeParameterInstantiation: isTSTypeParameterInstantiation,
- isTSTypeParameterDeclaration: isTSTypeParameterDeclaration,
- isTSTypeParameter: isTSTypeParameter,
- isExpression: isExpression,
- isBinary: isBinary,
- isScopable: isScopable,
- isBlockParent: isBlockParent,
- isBlock: isBlock,
- isStatement: isStatement,
- isTerminatorless: isTerminatorless,
- isCompletionStatement: isCompletionStatement,
- isConditional: isConditional,
- isLoop: isLoop,
- isWhile: isWhile,
- isExpressionWrapper: isExpressionWrapper,
- isFor: isFor,
- isForXStatement: isForXStatement,
- isFunction: isFunction,
- isFunctionParent: isFunctionParent,
- isPureish: isPureish,
- isDeclaration: isDeclaration,
- isPatternLike: isPatternLike,
- isLVal: isLVal,
- isTSEntityName: isTSEntityName,
- isLiteral: isLiteral,
- isUserWhitespacable: isUserWhitespacable,
- isMethod: isMethod,
- isObjectMember: isObjectMember,
- isProperty: isProperty,
- isUnaryLike: isUnaryLike,
- isPattern: isPattern,
- isClass: isClass,
- isModuleDeclaration: isModuleDeclaration,
- isExportDeclaration: isExportDeclaration,
- isModuleSpecifier: isModuleSpecifier,
- isFlow: isFlow,
- isFlowType: isFlowType,
- isFlowBaseAnnotation: isFlowBaseAnnotation,
- isFlowDeclaration: isFlowDeclaration,
- isFlowPredicate: isFlowPredicate,
- isEnumBody: isEnumBody,
- isEnumMember: isEnumMember,
- isJSX: isJSX,
- isPrivate: isPrivate,
- isTSTypeElement: isTSTypeElement,
- isTSType: isTSType,
- isNumberLiteral: isNumberLiteral,
- isRegexLiteral: isRegexLiteral,
- isRestProperty: isRestProperty,
- isSpreadProperty: isSpreadProperty
- });
- var ReferencedIdentifier = {
- types: ["Identifier", "JSXIdentifier"],
- checkPath: function checkPath(path, opts) {
- var node = path.node,
- parent = path.parent;
- if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) {
- if (isJSXIdentifier(node, opts)) {
- if (react.isCompatTag(node.name)) return false;
- } else {
- return false;
- }
- }
- return isReferenced(node, parent, path.parentPath.parent);
- }
- };
- var ReferencedMemberExpression = {
- types: ["MemberExpression"],
- checkPath: function checkPath(_ref) {
- var node = _ref.node,
- parent = _ref.parent;
- return isMemberExpression(node) && isReferenced(node, parent);
- }
- };
- var BindingIdentifier = {
- types: ["Identifier"],
- checkPath: function checkPath(path) {
- var node = path.node,
- parent = path.parent;
- var grandparent = path.parentPath.parent;
- return isIdentifier(node) && isBinding(node, parent, grandparent);
- }
- };
- var Statement = {
- types: ["Statement"],
- checkPath: function checkPath(_ref2) {
- var node = _ref2.node,
- parent = _ref2.parent;
- if (isStatement(node)) {
- if (isVariableDeclaration(node)) {
- if (isForXStatement(parent, {
- left: node
- })) return false;
- if (isForStatement(parent, {
- init: node
- })) return false;
- }
- return true;
- } else {
- return false;
- }
- }
- };
- var Expression = {
- types: ["Expression"],
- checkPath: function checkPath(path) {
- if (path.isIdentifier()) {
- return path.isReferencedIdentifier();
- } else {
- return isExpression(path.node);
- }
- }
- };
- var Scope = {
- types: ["Scopable", "Pattern"],
- checkPath: function checkPath(path) {
- return isScope(path.node, path.parent);
- }
- };
- var Referenced = {
- checkPath: function checkPath(path) {
- return isReferenced(path.node, path.parent);
- }
- };
- var BlockScoped = {
- checkPath: function checkPath(path) {
- return isBlockScoped(path.node);
- }
- };
- var Var = {
- types: ["VariableDeclaration"],
- checkPath: function checkPath(path) {
- return isVar(path.node);
- }
- };
- var User = {
- checkPath: function checkPath(path) {
- return path.node && !!path.node.loc;
- }
- };
- var Generated = {
- checkPath: function checkPath(path) {
- return !path.isUser();
- }
- };
- var Pure = {
- checkPath: function checkPath(path, opts) {
- return path.scope.isPure(path.node, opts);
- }
- };
- var Flow = {
- types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
- checkPath: function checkPath(_ref3) {
- var node = _ref3.node;
- if (isFlow(node)) {
- return true;
- } else if (isImportDeclaration(node)) {
- return node.importKind === "type" || node.importKind === "typeof";
- } else if (isExportDeclaration(node)) {
- return node.exportKind === "type";
- } else if (isImportSpecifier(node)) {
- return node.importKind === "type" || node.importKind === "typeof";
- } else {
- return false;
- }
- }
- };
- var RestProperty$1 = {
- types: ["RestElement"],
- checkPath: function checkPath(path) {
- return path.parentPath && path.parentPath.isObjectPattern();
- }
- };
- var SpreadProperty$1 = {
- types: ["RestElement"],
- checkPath: function checkPath(path) {
- return path.parentPath && path.parentPath.isObjectExpression();
- }
- };
- var ExistentialTypeParam = {
- types: ["ExistsTypeAnnotation"]
- };
- var NumericLiteralTypeAnnotation = {
- types: ["NumberLiteralTypeAnnotation"]
- };
- var ForAwaitStatement = {
- types: ["ForOfStatement"],
- checkPath: function checkPath(_ref4) {
- var node = _ref4.node;
- return node["await"] === true;
- }
- };
- var virtualTypes = /*#__PURE__*/Object.freeze({
- __proto__: null,
- ReferencedIdentifier: ReferencedIdentifier,
- ReferencedMemberExpression: ReferencedMemberExpression,
- BindingIdentifier: BindingIdentifier,
- Statement: Statement,
- Expression: Expression,
- Scope: Scope,
- Referenced: Referenced,
- BlockScoped: BlockScoped,
- Var: Var,
- User: User,
- Generated: Generated,
- Pure: Pure,
- Flow: Flow,
- RestProperty: RestProperty$1,
- SpreadProperty: SpreadProperty$1,
- ExistentialTypeParam: ExistentialTypeParam,
- NumericLiteralTypeAnnotation: NumericLiteralTypeAnnotation,
- ForAwaitStatement: ForAwaitStatement
- });
- var s = 1000;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var w = d * 7;
- var y = d * 365.25;
- var ms = function (val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options["long"] ? fmtLong(val) : fmtShort(val);
- }
- throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
- };
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
- }
- function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
- }
- function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
- }
- return ms + ' ms';
- }
- function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
- }
- function setup(env) {
- createDebug.debug = createDebug;
- createDebug["default"] = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = ms;
- Object.keys(env).forEach(function (key) {
- createDebug[key] = env[key];
- });
- createDebug.instances = [];
- createDebug.names = [];
- createDebug.skips = [];
- createDebug.formatters = {};
- function selectColor(namespace) {
- var hash = 0;
- for (var i = 0; i < namespace.length; i++) {
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
- hash |= 0;
- }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
- function createDebug(namespace) {
- var prevTime;
- function debug() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- if (!debug.enabled) {
- return;
- }
- var self = debug;
- var curr = Number(new Date());
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
- if (typeof args[0] !== 'string') {
- args.unshift('%O');
- }
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
- if (match === '%%') {
- return match;
- }
- index++;
- var formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- var val = args[index];
- match = formatter.call(self, val);
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- createDebug.formatArgs.call(self, args);
- var logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
- debug.namespace = namespace;
- debug.enabled = createDebug.enabled(namespace);
- debug.useColors = createDebug.useColors();
- debug.color = selectColor(namespace);
- debug.destroy = destroy;
- debug.extend = extend;
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
- createDebug.instances.push(debug);
- return debug;
- }
- function destroy() {
- var index = createDebug.instances.indexOf(this);
- if (index !== -1) {
- createDebug.instances.splice(index, 1);
- return true;
- }
- return false;
- }
- function extend(namespace, delimiter) {
- var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.names = [];
- createDebug.skips = [];
- var i;
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- continue;
- }
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- for (i = 0; i < createDebug.instances.length; i++) {
- var instance = createDebug.instances[i];
- instance.enabled = createDebug.enabled(instance.namespace);
- }
- }
- function disable() {
- var namespaces = [].concat(createDebug.names.map(toNamespace), createDebug.skips.map(toNamespace).map(function (namespace) {
- return '-' + namespace;
- })).join(',');
- createDebug.enable('');
- return namespaces;
- }
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
- var i;
- var len;
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
- function toNamespace(regexp) {
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
- }
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
- createDebug.enable(createDebug.load());
- return createDebug;
- }
- var common = setup;
- var browser$1 = createCommonjsModule(function (module, exports) {
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
- function useColors() {
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
- }
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
- if (!this.useColors) {
- return;
- }
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- lastC = index;
- }
- });
- args.splice(lastC, 0, c);
- }
- function log() {
- var _console;
- return typeof console === 'object' && console.log && (_console = console).log.apply(_console, arguments);
- }
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {}
- }
- function load() {
- var r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {}
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
- return r;
- }
- function localstorage() {
- try {
- return localStorage;
- } catch (error) {}
- }
- module.exports = common(exports);
- var formatters = module.exports.formatters;
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- });
- var browser_1 = browser$1.log;
- var browser_2 = browser$1.formatArgs;
- var browser_3 = browser$1.save;
- var browser_4 = browser$1.load;
- var browser_5 = browser$1.useColors;
- var browser_6 = browser$1.storage;
- var browser_7 = browser$1.colors;
- var stringTag$3 = '[object String]';
- function isString(value) {
- return typeof value == 'string' || !isArray_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag$3;
- }
- var isString_1 = isString;
- var symbolTag$2 = '[object Symbol]';
- function isSymbol(value) {
- return typeof value == 'symbol' || isObjectLike_1(value) && _baseGetTag(value) == symbolTag$2;
- }
- var isSymbol_1 = isSymbol;
- var NAN = 0 / 0;
- var reTrim = /^\s+|\s+$/g;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsOctal = /^0o[0-7]+$/i;
- var freeParseInt = parseInt;
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol_1(value)) {
- return NAN;
- }
- if (isObject_1(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject_1(other) ? other + '' : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- var toNumber_1 = toNumber;
- var INFINITY$1 = 1 / 0,
- MAX_INTEGER = 1.7976931348623157e+308;
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber_1(value);
- if (value === INFINITY$1 || value === -INFINITY$1) {
- var sign = value < 0 ? -1 : 1;
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- var toFinite_1 = toFinite;
- function toInteger(value) {
- var result = toFinite_1(value),
- remainder = result % 1;
- return result === result ? remainder ? result - remainder : result : 0;
- }
- var toInteger_1 = toInteger;
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- var _arrayMap = arrayMap;
- function baseValues(object, props) {
- return _arrayMap(props, function (key) {
- return object[key];
- });
- }
- var _baseValues = baseValues;
- function values(object) {
- return object == null ? [] : _baseValues(object, keys_1(object));
- }
- var values_1 = values;
- var nativeMax = Math.max;
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike_1(collection) ? collection : values_1(collection);
- fromIndex = fromIndex && !guard ? toInteger_1(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString_1(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && _baseIndexOf(collection, value, fromIndex) > -1;
- }
- var includes_1 = includes;
- var MAX_SAFE_INTEGER$2 = 9007199254740991;
- var nativeFloor = Math.floor;
- function baseRepeat(string, n) {
- var result = '';
- if (!string || n < 1 || n > MAX_SAFE_INTEGER$2) {
- return result;
- }
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
- return result;
- }
- var _baseRepeat = baseRepeat;
- function isIterateeCall(value, index, object) {
- if (!isObject_1(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number' ? isArrayLike_1(object) && _isIndex(index, object.length) : type == 'string' && index in object) {
- return eq_1(object[index], value);
- }
- return false;
- }
- var _isIterateeCall = isIterateeCall;
- var INFINITY$2 = 1 / 0;
- var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
- symbolToString = symbolProto$1 ? symbolProto$1.toString : undefined;
- function baseToString(value) {
- if (typeof value == 'string') {
- return value;
- }
- if (isArray_1(value)) {
- return _arrayMap(value, baseToString) + '';
- }
- if (isSymbol_1(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = value + '';
- return result == '0' && 1 / value == -INFINITY$2 ? '-0' : result;
- }
- var _baseToString = baseToString;
- function toString(value) {
- return value == null ? '' : _baseToString(value);
- }
- var toString_1 = toString;
- function repeat(string, n, guard) {
- if (guard ? _isIterateeCall(string, n, guard) : n === undefined) {
- n = 1;
- } else {
- n = toInteger_1(n);
- }
- return _baseRepeat(toString_1(string), n);
- }
- var repeat_1 = repeat;
- var Binding = function () {
- function Binding(_ref) {
- var identifier = _ref.identifier,
- scope = _ref.scope,
- path = _ref.path,
- kind = _ref.kind;
- this.identifier = identifier;
- this.scope = scope;
- this.path = path;
- this.kind = kind;
- this.constantViolations = [];
- this.constant = true;
- this.referencePaths = [];
- this.referenced = false;
- this.references = 0;
- this.clearValue();
- }
- var _proto = Binding.prototype;
- _proto.deoptValue = function deoptValue() {
- this.clearValue();
- this.hasDeoptedValue = true;
- };
- _proto.setValue = function setValue(value) {
- if (this.hasDeoptedValue) return;
- this.hasValue = true;
- this.value = value;
- };
- _proto.clearValue = function clearValue() {
- this.hasDeoptedValue = false;
- this.hasValue = false;
- this.value = null;
- };
- _proto.reassign = function reassign(path) {
- this.constant = false;
- if (this.constantViolations.indexOf(path) !== -1) {
- return;
- }
- this.constantViolations.push(path);
- };
- _proto.reference = function reference(path) {
- if (this.referencePaths.indexOf(path) !== -1) {
- return;
- }
- this.referenced = true;
- this.references++;
- this.referencePaths.push(path);
- };
- _proto.dereference = function dereference() {
- this.references--;
- this.referenced = !!this.references;
- };
- return Binding;
- }();
- function splitExportDeclaration(exportDeclaration) {
- if (!exportDeclaration.isExportDeclaration()) {
- throw new Error("Only export declarations can be splitted.");
- }
- var isDefault = exportDeclaration.isExportDefaultDeclaration();
- var declaration = exportDeclaration.get("declaration");
- var isClassDeclaration = declaration.isClassDeclaration();
- if (isDefault) {
- var standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration;
- var scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;
- var id = declaration.node.id;
- var needBindingRegistration = false;
- if (!id) {
- needBindingRegistration = true;
- id = scope.generateUidIdentifier("default");
- if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) {
- declaration.node.id = cloneNode(id);
- }
- }
- var updatedDeclaration = standaloneDeclaration ? declaration : VariableDeclaration("var", [VariableDeclarator(cloneNode(id), declaration.node)]);
- var updatedExportDeclaration = ExportNamedDeclaration(null, [ExportSpecifier(cloneNode(id), Identifier("default"))]);
- exportDeclaration.insertAfter(updatedExportDeclaration);
- exportDeclaration.replaceWith(updatedDeclaration);
- if (needBindingRegistration) {
- scope.registerDeclaration(exportDeclaration);
- }
- return exportDeclaration;
- }
- if (exportDeclaration.get("specifiers").length > 0) {
- throw new Error("It doesn't make sense to split exported specifiers.");
- }
- var bindingIdentifiers = declaration.getOuterBindingIdentifiers();
- var specifiers = Object.keys(bindingIdentifiers).map(function (name) {
- return ExportSpecifier(Identifier(name), Identifier(name));
- });
- var aliasDeclar = ExportNamedDeclaration(null, specifiers);
- exportDeclaration.insertAfter(aliasDeclar);
- exportDeclaration.replaceWith(declaration.node);
- return exportDeclaration;
- }
- var renameVisitor = {
- ReferencedIdentifier: function ReferencedIdentifier(_ref, state) {
- var node = _ref.node;
- if (node.name === state.oldName) {
- node.name = state.newName;
- }
- },
- Scope: function Scope(path, state) {
- if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
- path.skip();
- }
- },
- "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) {
- var ids = path.getOuterBindingIdentifiers();
- for (var name in ids) {
- if (name === state.oldName) ids[name].name = state.newName;
- }
- }
- };
- var Renamer = function () {
- function Renamer(binding, oldName, newName) {
- this.newName = newName;
- this.oldName = oldName;
- this.binding = binding;
- }
- var _proto = Renamer.prototype;
- _proto.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) {
- var maybeExportDeclar = parentDeclar.parentPath;
- if (!maybeExportDeclar.isExportDeclaration()) {
- return;
- }
- if (maybeExportDeclar.isExportDefaultDeclaration() && !maybeExportDeclar.get("declaration").node.id) {
- return;
- }
- splitExportDeclaration(maybeExportDeclar);
- };
- _proto.maybeConvertFromClassFunctionDeclaration = function maybeConvertFromClassFunctionDeclaration(path) {
- return;
- };
- _proto.maybeConvertFromClassFunctionExpression = function maybeConvertFromClassFunctionExpression(path) {
- return;
- };
- _proto.rename = function rename(block) {
- var binding = this.binding,
- oldName = this.oldName,
- newName = this.newName;
- var scope = binding.scope,
- path = binding.path;
- var parentDeclar = path.find(function (path) {
- return path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression();
- });
- if (parentDeclar) {
- var bindingIds = parentDeclar.getOuterBindingIdentifiers();
- if (bindingIds[oldName] === binding.identifier) {
- this.maybeConvertFromExportDeclaration(parentDeclar);
- }
- }
- scope.traverse(block || scope.block, renameVisitor, this);
- if (!block) {
- scope.removeOwnBinding(oldName);
- scope.bindings[newName] = binding;
- this.binding.identifier.name = newName;
- }
- if (binding.type === "hoisted") ;
- if (parentDeclar) {
- this.maybeConvertFromClassFunctionDeclaration(parentDeclar);
- this.maybeConvertFromClassFunctionExpression(parentDeclar);
- }
- };
- return Renamer;
- }();
- function identity(value) {
- return value;
- }
- var identity_1 = identity;
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- var _apply = apply;
- var nativeMax$1 = Math.max;
- function overRest(func, start, transform) {
- start = nativeMax$1(start === undefined ? func.length - 1 : start, 0);
- return function () {
- var args = arguments,
- index = -1,
- length = nativeMax$1(args.length - start, 0),
- array = Array(length);
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return _apply(func, this, otherArgs);
- };
- }
- var _overRest = overRest;
- function constant(value) {
- return function () {
- return value;
- };
- }
- var constant_1 = constant;
- var baseSetToString = !_defineProperty ? identity_1 : function (func, string) {
- return _defineProperty(func, 'toString', {
- 'configurable': true,
- 'enumerable': false,
- 'value': constant_1(string),
- 'writable': true
- });
- };
- var _baseSetToString = baseSetToString;
- var HOT_COUNT = 800,
- HOT_SPAN = 16;
- var nativeNow = Date.now;
- function shortOut(func) {
- var count = 0,
- lastCalled = 0;
- return function () {
- var stamp = nativeNow(),
- remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined, arguments);
- };
- }
- var _shortOut = shortOut;
- var setToString = _shortOut(_baseSetToString);
- var _setToString = setToString;
- function baseRest(func, start) {
- return _setToString(_overRest(func, start, identity_1), func + '');
- }
- var _baseRest = baseRest;
- var objectProto$e = Object.prototype;
- var hasOwnProperty$b = objectProto$e.hasOwnProperty;
- var defaults = _baseRest(function (object, sources) {
- object = Object(object);
- var index = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined;
- if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- var props = keysIn_1(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
- if (value === undefined || eq_1(value, objectProto$e[key]) && !hasOwnProperty$b.call(object, key)) {
- object[key] = source[key];
- }
- }
- }
- return object;
- });
- var defaults_1 = defaults;
- var builtin = {
- "Array": false,
- "ArrayBuffer": false,
- Atomics: false,
- BigInt: false,
- BigInt64Array: false,
- BigUint64Array: false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- globalThis: false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- SharedArrayBuffer: false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var es5 = {
- "Array": false,
- "Boolean": false,
- constructor: false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- propertyIsEnumerable: false,
- "RangeError": false,
- "ReferenceError": false,
- "RegExp": false,
- "String": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false
- };
- var es2015 = {
- "Array": false,
- "ArrayBuffer": false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var es2017 = {
- "Array": false,
- "ArrayBuffer": false,
- Atomics: false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- SharedArrayBuffer: false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var browser$2 = {
- AbortController: false,
- AbortSignal: false,
- addEventListener: false,
- alert: false,
- AnalyserNode: false,
- Animation: false,
- AnimationEffectReadOnly: false,
- AnimationEffectTiming: false,
- AnimationEffectTimingReadOnly: false,
- AnimationEvent: false,
- AnimationPlaybackEvent: false,
- AnimationTimeline: false,
- applicationCache: false,
- ApplicationCache: false,
- ApplicationCacheErrorEvent: false,
- atob: false,
- Attr: false,
- Audio: false,
- AudioBuffer: false,
- AudioBufferSourceNode: false,
- AudioContext: false,
- AudioDestinationNode: false,
- AudioListener: false,
- AudioNode: false,
- AudioParam: false,
- AudioProcessingEvent: false,
- AudioScheduledSourceNode: false,
- "AudioWorkletGlobalScope ": false,
- AudioWorkletNode: false,
- AudioWorkletProcessor: false,
- BarProp: false,
- BaseAudioContext: false,
- BatteryManager: false,
- BeforeUnloadEvent: false,
- BiquadFilterNode: false,
- Blob: false,
- BlobEvent: false,
- blur: false,
- BroadcastChannel: false,
- btoa: false,
- BudgetService: false,
- ByteLengthQueuingStrategy: false,
- Cache: false,
- caches: false,
- CacheStorage: false,
- cancelAnimationFrame: false,
- cancelIdleCallback: false,
- CanvasCaptureMediaStreamTrack: false,
- CanvasGradient: false,
- CanvasPattern: false,
- CanvasRenderingContext2D: false,
- ChannelMergerNode: false,
- ChannelSplitterNode: false,
- CharacterData: false,
- clearInterval: false,
- clearTimeout: false,
- clientInformation: false,
- ClipboardEvent: false,
- close: false,
- closed: false,
- CloseEvent: false,
- Comment: false,
- CompositionEvent: false,
- confirm: false,
- console: false,
- ConstantSourceNode: false,
- ConvolverNode: false,
- CountQueuingStrategy: false,
- createImageBitmap: false,
- Credential: false,
- CredentialsContainer: false,
- crypto: false,
- Crypto: false,
- CryptoKey: false,
- CSS: false,
- CSSConditionRule: false,
- CSSFontFaceRule: false,
- CSSGroupingRule: false,
- CSSImportRule: false,
- CSSKeyframeRule: false,
- CSSKeyframesRule: false,
- CSSMediaRule: false,
- CSSNamespaceRule: false,
- CSSPageRule: false,
- CSSRule: false,
- CSSRuleList: false,
- CSSStyleDeclaration: false,
- CSSStyleRule: false,
- CSSStyleSheet: false,
- CSSSupportsRule: false,
- CustomElementRegistry: false,
- customElements: false,
- CustomEvent: false,
- DataTransfer: false,
- DataTransferItem: false,
- DataTransferItemList: false,
- defaultstatus: false,
- defaultStatus: false,
- DelayNode: false,
- DeviceMotionEvent: false,
- DeviceOrientationEvent: false,
- devicePixelRatio: false,
- dispatchEvent: false,
- document: false,
- Document: false,
- DocumentFragment: false,
- DocumentType: false,
- DOMError: false,
- DOMException: false,
- DOMImplementation: false,
- DOMMatrix: false,
- DOMMatrixReadOnly: false,
- DOMParser: false,
- DOMPoint: false,
- DOMPointReadOnly: false,
- DOMQuad: false,
- DOMRect: false,
- DOMRectReadOnly: false,
- DOMStringList: false,
- DOMStringMap: false,
- DOMTokenList: false,
- DragEvent: false,
- DynamicsCompressorNode: false,
- Element: false,
- ErrorEvent: false,
- event: false,
- Event: false,
- EventSource: false,
- EventTarget: false,
- external: false,
- fetch: false,
- File: false,
- FileList: false,
- FileReader: false,
- find: false,
- focus: false,
- FocusEvent: false,
- FontFace: false,
- FontFaceSetLoadEvent: false,
- FormData: false,
- frameElement: false,
- frames: false,
- GainNode: false,
- Gamepad: false,
- GamepadButton: false,
- GamepadEvent: false,
- getComputedStyle: false,
- getSelection: false,
- HashChangeEvent: false,
- Headers: false,
- history: false,
- History: false,
- HTMLAllCollection: false,
- HTMLAnchorElement: false,
- HTMLAreaElement: false,
- HTMLAudioElement: false,
- HTMLBaseElement: false,
- HTMLBodyElement: false,
- HTMLBRElement: false,
- HTMLButtonElement: false,
- HTMLCanvasElement: false,
- HTMLCollection: false,
- HTMLContentElement: false,
- HTMLDataElement: false,
- HTMLDataListElement: false,
- HTMLDetailsElement: false,
- HTMLDialogElement: false,
- HTMLDirectoryElement: false,
- HTMLDivElement: false,
- HTMLDListElement: false,
- HTMLDocument: false,
- HTMLElement: false,
- HTMLEmbedElement: false,
- HTMLFieldSetElement: false,
- HTMLFontElement: false,
- HTMLFormControlsCollection: false,
- HTMLFormElement: false,
- HTMLFrameElement: false,
- HTMLFrameSetElement: false,
- HTMLHeadElement: false,
- HTMLHeadingElement: false,
- HTMLHRElement: false,
- HTMLHtmlElement: false,
- HTMLIFrameElement: false,
- HTMLImageElement: false,
- HTMLInputElement: false,
- HTMLLabelElement: false,
- HTMLLegendElement: false,
- HTMLLIElement: false,
- HTMLLinkElement: false,
- HTMLMapElement: false,
- HTMLMarqueeElement: false,
- HTMLMediaElement: false,
- HTMLMenuElement: false,
- HTMLMetaElement: false,
- HTMLMeterElement: false,
- HTMLModElement: false,
- HTMLObjectElement: false,
- HTMLOListElement: false,
- HTMLOptGroupElement: false,
- HTMLOptionElement: false,
- HTMLOptionsCollection: false,
- HTMLOutputElement: false,
- HTMLParagraphElement: false,
- HTMLParamElement: false,
- HTMLPictureElement: false,
- HTMLPreElement: false,
- HTMLProgressElement: false,
- HTMLQuoteElement: false,
- HTMLScriptElement: false,
- HTMLSelectElement: false,
- HTMLShadowElement: false,
- HTMLSlotElement: false,
- HTMLSourceElement: false,
- HTMLSpanElement: false,
- HTMLStyleElement: false,
- HTMLTableCaptionElement: false,
- HTMLTableCellElement: false,
- HTMLTableColElement: false,
- HTMLTableElement: false,
- HTMLTableRowElement: false,
- HTMLTableSectionElement: false,
- HTMLTemplateElement: false,
- HTMLTextAreaElement: false,
- HTMLTimeElement: false,
- HTMLTitleElement: false,
- HTMLTrackElement: false,
- HTMLUListElement: false,
- HTMLUnknownElement: false,
- HTMLVideoElement: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- IdleDeadline: false,
- IIRFilterNode: false,
- Image: false,
- ImageBitmap: false,
- ImageBitmapRenderingContext: false,
- ImageCapture: false,
- ImageData: false,
- indexedDB: false,
- innerHeight: false,
- innerWidth: false,
- InputEvent: false,
- IntersectionObserver: false,
- IntersectionObserverEntry: false,
- "Intl": false,
- isSecureContext: false,
- KeyboardEvent: false,
- KeyframeEffect: false,
- KeyframeEffectReadOnly: false,
- length: false,
- localStorage: false,
- location: true,
- Location: false,
- locationbar: false,
- matchMedia: false,
- MediaDeviceInfo: false,
- MediaDevices: false,
- MediaElementAudioSourceNode: false,
- MediaEncryptedEvent: false,
- MediaError: false,
- MediaKeyMessageEvent: false,
- MediaKeySession: false,
- MediaKeyStatusMap: false,
- MediaKeySystemAccess: false,
- MediaList: false,
- MediaQueryList: false,
- MediaQueryListEvent: false,
- MediaRecorder: false,
- MediaSettingsRange: false,
- MediaSource: false,
- MediaStream: false,
- MediaStreamAudioDestinationNode: false,
- MediaStreamAudioSourceNode: false,
- MediaStreamEvent: false,
- MediaStreamTrack: false,
- MediaStreamTrackEvent: false,
- menubar: false,
- MessageChannel: false,
- MessageEvent: false,
- MessagePort: false,
- MIDIAccess: false,
- MIDIConnectionEvent: false,
- MIDIInput: false,
- MIDIInputMap: false,
- MIDIMessageEvent: false,
- MIDIOutput: false,
- MIDIOutputMap: false,
- MIDIPort: false,
- MimeType: false,
- MimeTypeArray: false,
- MouseEvent: false,
- moveBy: false,
- moveTo: false,
- MutationEvent: false,
- MutationObserver: false,
- MutationRecord: false,
- name: false,
- NamedNodeMap: false,
- NavigationPreloadManager: false,
- navigator: false,
- Navigator: false,
- NetworkInformation: false,
- Node: false,
- NodeFilter: false,
- NodeIterator: false,
- NodeList: false,
- Notification: false,
- OfflineAudioCompletionEvent: false,
- OfflineAudioContext: false,
- offscreenBuffering: false,
- OffscreenCanvas: true,
- onabort: true,
- onafterprint: true,
- onanimationend: true,
- onanimationiteration: true,
- onanimationstart: true,
- onappinstalled: true,
- onauxclick: true,
- onbeforeinstallprompt: true,
- onbeforeprint: true,
- onbeforeunload: true,
- onblur: true,
- oncancel: true,
- oncanplay: true,
- oncanplaythrough: true,
- onchange: true,
- onclick: true,
- onclose: true,
- oncontextmenu: true,
- oncuechange: true,
- ondblclick: true,
- ondevicemotion: true,
- ondeviceorientation: true,
- ondeviceorientationabsolute: true,
- ondrag: true,
- ondragend: true,
- ondragenter: true,
- ondragleave: true,
- ondragover: true,
- ondragstart: true,
- ondrop: true,
- ondurationchange: true,
- onemptied: true,
- onended: true,
- onerror: true,
- onfocus: true,
- ongotpointercapture: true,
- onhashchange: true,
- oninput: true,
- oninvalid: true,
- onkeydown: true,
- onkeypress: true,
- onkeyup: true,
- onlanguagechange: true,
- onload: true,
- onloadeddata: true,
- onloadedmetadata: true,
- onloadstart: true,
- onlostpointercapture: true,
- onmessage: true,
- onmessageerror: true,
- onmousedown: true,
- onmouseenter: true,
- onmouseleave: true,
- onmousemove: true,
- onmouseout: true,
- onmouseover: true,
- onmouseup: true,
- onmousewheel: true,
- onoffline: true,
- ononline: true,
- onpagehide: true,
- onpageshow: true,
- onpause: true,
- onplay: true,
- onplaying: true,
- onpointercancel: true,
- onpointerdown: true,
- onpointerenter: true,
- onpointerleave: true,
- onpointermove: true,
- onpointerout: true,
- onpointerover: true,
- onpointerup: true,
- onpopstate: true,
- onprogress: true,
- onratechange: true,
- onrejectionhandled: true,
- onreset: true,
- onresize: true,
- onscroll: true,
- onsearch: true,
- onseeked: true,
- onseeking: true,
- onselect: true,
- onstalled: true,
- onstorage: true,
- onsubmit: true,
- onsuspend: true,
- ontimeupdate: true,
- ontoggle: true,
- ontransitionend: true,
- onunhandledrejection: true,
- onunload: true,
- onvolumechange: true,
- onwaiting: true,
- onwheel: true,
- open: false,
- openDatabase: false,
- opener: false,
- Option: false,
- origin: false,
- OscillatorNode: false,
- outerHeight: false,
- outerWidth: false,
- PageTransitionEvent: false,
- pageXOffset: false,
- pageYOffset: false,
- PannerNode: false,
- parent: false,
- Path2D: false,
- PaymentAddress: false,
- PaymentRequest: false,
- PaymentRequestUpdateEvent: false,
- PaymentResponse: false,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceLongTaskTiming: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceNavigationTiming: false,
- PerformanceObserver: false,
- PerformanceObserverEntryList: false,
- PerformancePaintTiming: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- PeriodicWave: false,
- Permissions: false,
- PermissionStatus: false,
- personalbar: false,
- PhotoCapabilities: false,
- Plugin: false,
- PluginArray: false,
- PointerEvent: false,
- PopStateEvent: false,
- postMessage: false,
- Presentation: false,
- PresentationAvailability: false,
- PresentationConnection: false,
- PresentationConnectionAvailableEvent: false,
- PresentationConnectionCloseEvent: false,
- PresentationConnectionList: false,
- PresentationReceiver: false,
- PresentationRequest: false,
- print: false,
- ProcessingInstruction: false,
- ProgressEvent: false,
- PromiseRejectionEvent: false,
- prompt: false,
- PushManager: false,
- PushSubscription: false,
- PushSubscriptionOptions: false,
- queueMicrotask: false,
- RadioNodeList: false,
- Range: false,
- ReadableStream: false,
- registerProcessor: false,
- RemotePlayback: false,
- removeEventListener: false,
- Request: false,
- requestAnimationFrame: false,
- requestIdleCallback: false,
- resizeBy: false,
- ResizeObserver: false,
- ResizeObserverEntry: false,
- resizeTo: false,
- Response: false,
- RTCCertificate: false,
- RTCDataChannel: false,
- RTCDataChannelEvent: false,
- RTCDtlsTransport: false,
- RTCIceCandidate: false,
- RTCIceGatherer: false,
- RTCIceTransport: false,
- RTCPeerConnection: false,
- RTCPeerConnectionIceEvent: false,
- RTCRtpContributingSource: false,
- RTCRtpReceiver: false,
- RTCRtpSender: false,
- RTCSctpTransport: false,
- RTCSessionDescription: false,
- RTCStatsReport: false,
- RTCTrackEvent: false,
- screen: false,
- Screen: false,
- screenLeft: false,
- ScreenOrientation: false,
- screenTop: false,
- screenX: false,
- screenY: false,
- ScriptProcessorNode: false,
- scroll: false,
- scrollbars: false,
- scrollBy: false,
- scrollTo: false,
- scrollX: false,
- scrollY: false,
- SecurityPolicyViolationEvent: false,
- Selection: false,
- self: false,
- ServiceWorker: false,
- ServiceWorkerContainer: false,
- ServiceWorkerRegistration: false,
- sessionStorage: false,
- setInterval: false,
- setTimeout: false,
- ShadowRoot: false,
- SharedWorker: false,
- SourceBuffer: false,
- SourceBufferList: false,
- speechSynthesis: false,
- SpeechSynthesisEvent: false,
- SpeechSynthesisUtterance: false,
- StaticRange: false,
- status: false,
- statusbar: false,
- StereoPannerNode: false,
- stop: false,
- Storage: false,
- StorageEvent: false,
- StorageManager: false,
- styleMedia: false,
- StyleSheet: false,
- StyleSheetList: false,
- SubtleCrypto: false,
- SVGAElement: false,
- SVGAngle: false,
- SVGAnimatedAngle: false,
- SVGAnimatedBoolean: false,
- SVGAnimatedEnumeration: false,
- SVGAnimatedInteger: false,
- SVGAnimatedLength: false,
- SVGAnimatedLengthList: false,
- SVGAnimatedNumber: false,
- SVGAnimatedNumberList: false,
- SVGAnimatedPreserveAspectRatio: false,
- SVGAnimatedRect: false,
- SVGAnimatedString: false,
- SVGAnimatedTransformList: false,
- SVGAnimateElement: false,
- SVGAnimateMotionElement: false,
- SVGAnimateTransformElement: false,
- SVGAnimationElement: false,
- SVGCircleElement: false,
- SVGClipPathElement: false,
- SVGComponentTransferFunctionElement: false,
- SVGDefsElement: false,
- SVGDescElement: false,
- SVGDiscardElement: false,
- SVGElement: false,
- SVGEllipseElement: false,
- SVGFEBlendElement: false,
- SVGFEColorMatrixElement: false,
- SVGFEComponentTransferElement: false,
- SVGFECompositeElement: false,
- SVGFEConvolveMatrixElement: false,
- SVGFEDiffuseLightingElement: false,
- SVGFEDisplacementMapElement: false,
- SVGFEDistantLightElement: false,
- SVGFEDropShadowElement: false,
- SVGFEFloodElement: false,
- SVGFEFuncAElement: false,
- SVGFEFuncBElement: false,
- SVGFEFuncGElement: false,
- SVGFEFuncRElement: false,
- SVGFEGaussianBlurElement: false,
- SVGFEImageElement: false,
- SVGFEMergeElement: false,
- SVGFEMergeNodeElement: false,
- SVGFEMorphologyElement: false,
- SVGFEOffsetElement: false,
- SVGFEPointLightElement: false,
- SVGFESpecularLightingElement: false,
- SVGFESpotLightElement: false,
- SVGFETileElement: false,
- SVGFETurbulenceElement: false,
- SVGFilterElement: false,
- SVGForeignObjectElement: false,
- SVGGElement: false,
- SVGGeometryElement: false,
- SVGGradientElement: false,
- SVGGraphicsElement: false,
- SVGImageElement: false,
- SVGLength: false,
- SVGLengthList: false,
- SVGLinearGradientElement: false,
- SVGLineElement: false,
- SVGMarkerElement: false,
- SVGMaskElement: false,
- SVGMatrix: false,
- SVGMetadataElement: false,
- SVGMPathElement: false,
- SVGNumber: false,
- SVGNumberList: false,
- SVGPathElement: false,
- SVGPatternElement: false,
- SVGPoint: false,
- SVGPointList: false,
- SVGPolygonElement: false,
- SVGPolylineElement: false,
- SVGPreserveAspectRatio: false,
- SVGRadialGradientElement: false,
- SVGRect: false,
- SVGRectElement: false,
- SVGScriptElement: false,
- SVGSetElement: false,
- SVGStopElement: false,
- SVGStringList: false,
- SVGStyleElement: false,
- SVGSVGElement: false,
- SVGSwitchElement: false,
- SVGSymbolElement: false,
- SVGTextContentElement: false,
- SVGTextElement: false,
- SVGTextPathElement: false,
- SVGTextPositioningElement: false,
- SVGTitleElement: false,
- SVGTransform: false,
- SVGTransformList: false,
- SVGTSpanElement: false,
- SVGUnitTypes: false,
- SVGUseElement: false,
- SVGViewElement: false,
- TaskAttributionTiming: false,
- Text: false,
- TextDecoder: false,
- TextEncoder: false,
- TextEvent: false,
- TextMetrics: false,
- TextTrack: false,
- TextTrackCue: false,
- TextTrackCueList: false,
- TextTrackList: false,
- TimeRanges: false,
- toolbar: false,
- top: false,
- Touch: false,
- TouchEvent: false,
- TouchList: false,
- TrackEvent: false,
- TransitionEvent: false,
- TreeWalker: false,
- UIEvent: false,
- URL: false,
- URLSearchParams: false,
- ValidityState: false,
- visualViewport: false,
- VisualViewport: false,
- VTTCue: false,
- WaveShaperNode: false,
- WebAssembly: false,
- WebGL2RenderingContext: false,
- WebGLActiveInfo: false,
- WebGLBuffer: false,
- WebGLContextEvent: false,
- WebGLFramebuffer: false,
- WebGLProgram: false,
- WebGLQuery: false,
- WebGLRenderbuffer: false,
- WebGLRenderingContext: false,
- WebGLSampler: false,
- WebGLShader: false,
- WebGLShaderPrecisionFormat: false,
- WebGLSync: false,
- WebGLTexture: false,
- WebGLTransformFeedback: false,
- WebGLUniformLocation: false,
- WebGLVertexArrayObject: false,
- WebSocket: false,
- WheelEvent: false,
- window: false,
- Window: false,
- Worker: false,
- WritableStream: false,
- XMLDocument: false,
- XMLHttpRequest: false,
- XMLHttpRequestEventTarget: false,
- XMLHttpRequestUpload: false,
- XMLSerializer: false,
- XPathEvaluator: false,
- XPathExpression: false,
- XPathResult: false,
- XSLTProcessor: false
- };
- var worker = {
- addEventListener: false,
- applicationCache: false,
- atob: false,
- Blob: false,
- BroadcastChannel: false,
- btoa: false,
- Cache: false,
- caches: false,
- clearInterval: false,
- clearTimeout: false,
- close: true,
- console: false,
- fetch: false,
- FileReaderSync: false,
- FormData: false,
- Headers: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- ImageData: false,
- importScripts: true,
- indexedDB: false,
- location: false,
- MessageChannel: false,
- MessagePort: false,
- name: false,
- navigator: false,
- Notification: false,
- onclose: true,
- onconnect: true,
- onerror: true,
- onlanguagechange: true,
- onmessage: true,
- onoffline: true,
- ononline: true,
- onrejectionhandled: true,
- onunhandledrejection: true,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- postMessage: true,
- "Promise": false,
- queueMicrotask: false,
- removeEventListener: false,
- Request: false,
- Response: false,
- self: true,
- ServiceWorkerRegistration: false,
- setInterval: false,
- setTimeout: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false,
- WebSocket: false,
- Worker: false,
- WorkerGlobalScope: false,
- XMLHttpRequest: false
- };
- var node = {
- __dirname: false,
- __filename: false,
- Buffer: false,
- clearImmediate: false,
- clearInterval: false,
- clearTimeout: false,
- console: false,
- exports: true,
- global: false,
- "Intl": false,
- module: false,
- process: false,
- queueMicrotask: false,
- require: false,
- setImmediate: false,
- setInterval: false,
- setTimeout: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false
- };
- var commonjs = {
- exports: true,
- global: false,
- module: false,
- require: false
- };
- var amd = {
- define: false,
- require: false
- };
- var mocha = {
- after: false,
- afterEach: false,
- before: false,
- beforeEach: false,
- context: false,
- describe: false,
- it: false,
- mocha: false,
- run: false,
- setup: false,
- specify: false,
- suite: false,
- suiteSetup: false,
- suiteTeardown: false,
- teardown: false,
- test: false,
- xcontext: false,
- xdescribe: false,
- xit: false,
- xspecify: false
- };
- var jasmine = {
- afterAll: false,
- afterEach: false,
- beforeAll: false,
- beforeEach: false,
- describe: false,
- expect: false,
- fail: false,
- fdescribe: false,
- fit: false,
- it: false,
- jasmine: false,
- pending: false,
- runs: false,
- spyOn: false,
- spyOnProperty: false,
- waits: false,
- waitsFor: false,
- xdescribe: false,
- xit: false
- };
- var jest = {
- afterAll: false,
- afterEach: false,
- beforeAll: false,
- beforeEach: false,
- describe: false,
- expect: false,
- fdescribe: false,
- fit: false,
- it: false,
- jest: false,
- pit: false,
- require: false,
- test: false,
- xdescribe: false,
- xit: false,
- xtest: false
- };
- var qunit = {
- asyncTest: false,
- deepEqual: false,
- equal: false,
- expect: false,
- module: false,
- notDeepEqual: false,
- notEqual: false,
- notOk: false,
- notPropEqual: false,
- notStrictEqual: false,
- ok: false,
- propEqual: false,
- QUnit: false,
- raises: false,
- start: false,
- stop: false,
- strictEqual: false,
- test: false,
- throws: false
- };
- var phantomjs = {
- console: true,
- exports: true,
- phantom: true,
- require: true,
- WebPage: true
- };
- var couch = {
- emit: false,
- exports: false,
- getRow: false,
- log: false,
- module: false,
- provides: false,
- require: false,
- respond: false,
- send: false,
- start: false,
- sum: false
- };
- var rhino = {
- defineClass: false,
- deserialize: false,
- gc: false,
- help: false,
- importClass: false,
- importPackage: false,
- java: false,
- load: false,
- loadClass: false,
- Packages: false,
- print: false,
- quit: false,
- readFile: false,
- readUrl: false,
- runCommand: false,
- seal: false,
- serialize: false,
- spawn: false,
- sync: false,
- toint32: false,
- version: false
- };
- var nashorn = {
- __DIR__: false,
- __FILE__: false,
- __LINE__: false,
- com: false,
- edu: false,
- exit: false,
- java: false,
- Java: false,
- javafx: false,
- JavaImporter: false,
- javax: false,
- JSAdapter: false,
- load: false,
- loadWithNewGlobal: false,
- org: false,
- Packages: false,
- print: false,
- quit: false
- };
- var wsh = {
- ActiveXObject: true,
- Enumerator: true,
- GetObject: true,
- ScriptEngine: true,
- ScriptEngineBuildVersion: true,
- ScriptEngineMajorVersion: true,
- ScriptEngineMinorVersion: true,
- VBArray: true,
- WScript: true,
- WSH: true,
- XDomainRequest: true
- };
- var jquery = {
- $: false,
- jQuery: false
- };
- var yui = {
- YAHOO: false,
- YAHOO_config: false,
- YUI: false,
- YUI_config: false
- };
- var shelljs = {
- cat: false,
- cd: false,
- chmod: false,
- config: false,
- cp: false,
- dirs: false,
- echo: false,
- env: false,
- error: false,
- exec: false,
- exit: false,
- find: false,
- grep: false,
- ln: false,
- ls: false,
- mkdir: false,
- mv: false,
- popd: false,
- pushd: false,
- pwd: false,
- rm: false,
- sed: false,
- set: false,
- target: false,
- tempdir: false,
- test: false,
- touch: false,
- which: false
- };
- var prototypejs = {
- $: false,
- $$: false,
- $A: false,
- $break: false,
- $continue: false,
- $F: false,
- $H: false,
- $R: false,
- $w: false,
- Abstract: false,
- Ajax: false,
- Autocompleter: false,
- Builder: false,
- Class: false,
- Control: false,
- Draggable: false,
- Draggables: false,
- Droppables: false,
- Effect: false,
- Element: false,
- Enumerable: false,
- Event: false,
- Field: false,
- Form: false,
- Hash: false,
- Insertion: false,
- ObjectRange: false,
- PeriodicalExecuter: false,
- Position: false,
- Prototype: false,
- Scriptaculous: false,
- Selector: false,
- Sortable: false,
- SortableObserver: false,
- Sound: false,
- Template: false,
- Toggle: false,
- Try: false
- };
- var meteor = {
- _: false,
- $: false,
- Accounts: false,
- AccountsClient: false,
- AccountsCommon: false,
- AccountsServer: false,
- App: false,
- Assets: false,
- Blaze: false,
- check: false,
- Cordova: false,
- DDP: false,
- DDPRateLimiter: false,
- DDPServer: false,
- Deps: false,
- EJSON: false,
- Email: false,
- HTTP: false,
- Log: false,
- Match: false,
- Meteor: false,
- Mongo: false,
- MongoInternals: false,
- Npm: false,
- Package: false,
- Plugin: false,
- process: false,
- Random: false,
- ReactiveDict: false,
- ReactiveVar: false,
- Router: false,
- ServiceConfiguration: false,
- Session: false,
- share: false,
- Spacebars: false,
- Template: false,
- Tinytest: false,
- Tracker: false,
- UI: false,
- Utils: false,
- WebApp: false,
- WebAppInternals: false
- };
- var mongo = {
- _isWindows: false,
- _rand: false,
- BulkWriteResult: false,
- cat: false,
- cd: false,
- connect: false,
- db: false,
- getHostName: false,
- getMemInfo: false,
- hostname: false,
- ISODate: false,
- listFiles: false,
- load: false,
- ls: false,
- md5sumFile: false,
- mkdir: false,
- Mongo: false,
- NumberInt: false,
- NumberLong: false,
- ObjectId: false,
- PlanCache: false,
- print: false,
- printjson: false,
- pwd: false,
- quit: false,
- removeFile: false,
- rs: false,
- sh: false,
- UUID: false,
- version: false,
- WriteResult: false
- };
- var applescript = {
- $: false,
- Application: false,
- Automation: false,
- console: false,
- delay: false,
- Library: false,
- ObjC: false,
- ObjectSpecifier: false,
- Path: false,
- Progress: false,
- Ref: false
- };
- var serviceworker = {
- addEventListener: false,
- applicationCache: false,
- atob: false,
- Blob: false,
- BroadcastChannel: false,
- btoa: false,
- Cache: false,
- caches: false,
- CacheStorage: false,
- clearInterval: false,
- clearTimeout: false,
- Client: false,
- clients: false,
- Clients: false,
- close: true,
- console: false,
- ExtendableEvent: false,
- ExtendableMessageEvent: false,
- fetch: false,
- FetchEvent: false,
- FileReaderSync: false,
- FormData: false,
- Headers: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- ImageData: false,
- importScripts: false,
- indexedDB: false,
- location: false,
- MessageChannel: false,
- MessagePort: false,
- name: false,
- navigator: false,
- Notification: false,
- onclose: true,
- onconnect: true,
- onerror: true,
- onfetch: true,
- oninstall: true,
- onlanguagechange: true,
- onmessage: true,
- onmessageerror: true,
- onnotificationclick: true,
- onnotificationclose: true,
- onoffline: true,
- ononline: true,
- onpush: true,
- onpushsubscriptionchange: true,
- onrejectionhandled: true,
- onsync: true,
- onunhandledrejection: true,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- postMessage: true,
- "Promise": false,
- queueMicrotask: false,
- registration: false,
- removeEventListener: false,
- Request: false,
- Response: false,
- self: false,
- ServiceWorker: false,
- ServiceWorkerContainer: false,
- ServiceWorkerGlobalScope: false,
- ServiceWorkerMessageEvent: false,
- ServiceWorkerRegistration: false,
- setInterval: false,
- setTimeout: false,
- skipWaiting: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false,
- WebSocket: false,
- WindowClient: false,
- Worker: false,
- WorkerGlobalScope: false,
- XMLHttpRequest: false
- };
- var atomtest = {
- advanceClock: false,
- fakeClearInterval: false,
- fakeClearTimeout: false,
- fakeSetInterval: false,
- fakeSetTimeout: false,
- resetTimeouts: false,
- waitsForPromise: false
- };
- var embertest = {
- andThen: false,
- click: false,
- currentPath: false,
- currentRouteName: false,
- currentURL: false,
- fillIn: false,
- find: false,
- findAll: false,
- findWithAssert: false,
- keyEvent: false,
- pauseTest: false,
- resumeTest: false,
- triggerEvent: false,
- visit: false,
- wait: false
- };
- var protractor = {
- $: false,
- $$: false,
- browser: false,
- by: false,
- By: false,
- DartObject: false,
- element: false,
- protractor: false
- };
- var webextensions = {
- browser: false,
- chrome: false,
- opr: false
- };
- var greasemonkey = {
- cloneInto: false,
- createObjectIn: false,
- exportFunction: false,
- GM: false,
- GM_addStyle: false,
- GM_deleteValue: false,
- GM_getResourceText: false,
- GM_getResourceURL: false,
- GM_getValue: false,
- GM_info: false,
- GM_listValues: false,
- GM_log: false,
- GM_openInTab: false,
- GM_registerMenuCommand: false,
- GM_setClipboard: false,
- GM_setValue: false,
- GM_xmlhttpRequest: false,
- unsafeWindow: false
- };
- var devtools = {
- $: false,
- $_: false,
- $$: false,
- $0: false,
- $1: false,
- $2: false,
- $3: false,
- $4: false,
- $x: false,
- chrome: false,
- clear: false,
- copy: false,
- debug: false,
- dir: false,
- dirxml: false,
- getEventListeners: false,
- inspect: false,
- keys: false,
- monitor: false,
- monitorEvents: false,
- profile: false,
- profileEnd: false,
- queryObjects: false,
- table: false,
- undebug: false,
- unmonitor: false,
- unmonitorEvents: false,
- values: false
- };
- var globals = {
- builtin: builtin,
- es5: es5,
- es2015: es2015,
- es2017: es2017,
- browser: browser$2,
- worker: worker,
- node: node,
- commonjs: commonjs,
- amd: amd,
- mocha: mocha,
- jasmine: jasmine,
- jest: jest,
- qunit: qunit,
- phantomjs: phantomjs,
- couch: couch,
- rhino: rhino,
- nashorn: nashorn,
- wsh: wsh,
- jquery: jquery,
- yui: yui,
- shelljs: shelljs,
- prototypejs: prototypejs,
- meteor: meteor,
- mongo: mongo,
- applescript: applescript,
- serviceworker: serviceworker,
- atomtest: atomtest,
- embertest: embertest,
- protractor: protractor,
- "shared-node-browser": {
- clearInterval: false,
- clearTimeout: false,
- console: false,
- setInterval: false,
- setTimeout: false,
- URL: false,
- URLSearchParams: false
- },
- webextensions: webextensions,
- greasemonkey: greasemonkey,
- devtools: devtools
- };
- var globals$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- builtin: builtin,
- es5: es5,
- es2015: es2015,
- es2017: es2017,
- browser: browser$2,
- worker: worker,
- node: node,
- commonjs: commonjs,
- amd: amd,
- mocha: mocha,
- jasmine: jasmine,
- jest: jest,
- qunit: qunit,
- phantomjs: phantomjs,
- couch: couch,
- rhino: rhino,
- nashorn: nashorn,
- wsh: wsh,
- jquery: jquery,
- yui: yui,
- shelljs: shelljs,
- prototypejs: prototypejs,
- meteor: meteor,
- mongo: mongo,
- applescript: applescript,
- serviceworker: serviceworker,
- atomtest: atomtest,
- embertest: embertest,
- protractor: protractor,
- webextensions: webextensions,
- greasemonkey: greasemonkey,
- devtools: devtools,
- 'default': globals
- });
- var require$$0 = getCjsExportFromNamespace(globals$1);
- var globals$2 = require$$0;
- var path = new WeakMap();
- var scope = new WeakMap();
- function clear() {
- clearPath();
- clearScope();
- }
- function clearPath() {
- path = new WeakMap();
- }
- function clearScope() {
- scope = new WeakMap();
- }
- var cache = /*#__PURE__*/Object.freeze({
- __proto__: null,
- get path () { return path; },
- get scope () { return scope; },
- clear: clear,
- clearPath: clearPath,
- clearScope: clearScope
- });
- function gatherNodeParts(node, parts) {
- if (isModuleDeclaration(node)) {
- if (node.source) {
- gatherNodeParts(node.source, parts);
- } else if (node.specifiers && node.specifiers.length) {
- for (var _i = 0, _arr = node.specifiers; _i < _arr.length; _i++) {
- var specifier = _arr[_i];
- gatherNodeParts(specifier, parts);
- }
- } else if (node.declaration) {
- gatherNodeParts(node.declaration, parts);
- }
- } else if (isModuleSpecifier(node)) {
- gatherNodeParts(node.local, parts);
- } else if (isMemberExpression(node)) {
- gatherNodeParts(node.object, parts);
- gatherNodeParts(node.property, parts);
- } else if (isIdentifier(node)) {
- parts.push(node.name);
- } else if (isLiteral(node)) {
- parts.push(node.value);
- } else if (isCallExpression(node)) {
- gatherNodeParts(node.callee, parts);
- } else if (isObjectExpression(node) || isObjectPattern(node)) {
- for (var _i2 = 0, _arr2 = node.properties; _i2 < _arr2.length; _i2++) {
- var prop = _arr2[_i2];
- gatherNodeParts(prop.key || prop.argument, parts);
- }
- } else if (isPrivateName(node)) {
- gatherNodeParts(node.id, parts);
- } else if (isThisExpression(node)) {
- parts.push("this");
- } else if (isSuper(node)) {
- parts.push("super");
- }
- }
- var collectorVisitor = {
- For: function For(path) {
- for (var _i3 = 0, _arr3 = FOR_INIT_KEYS; _i3 < _arr3.length; _i3++) {
- var key = _arr3[_i3];
- var declar = path.get(key);
- if (declar.isVar()) {
- var parentScope = path.scope.getFunctionParent() || path.scope.getProgramParent();
- parentScope.registerBinding("var", declar);
- }
- }
- },
- Declaration: function Declaration(path) {
- if (path.isBlockScoped()) return;
- if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) {
- return;
- }
- var parent = path.scope.getFunctionParent() || path.scope.getProgramParent();
- parent.registerDeclaration(path);
- },
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- state.references.push(path);
- },
- ForXStatement: function ForXStatement(path, state) {
- var left = path.get("left");
- if (left.isPattern() || left.isIdentifier()) {
- state.constantViolations.push(path);
- }
- },
- ExportDeclaration: {
- exit: function exit(path) {
- var node = path.node,
- scope = path.scope;
- var declar = node.declaration;
- if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) {
- var id = declar.id;
- if (!id) return;
- var binding = scope.getBinding(id.name);
- if (binding) binding.reference(path);
- } else if (isVariableDeclaration(declar)) {
- for (var _i4 = 0, _arr4 = declar.declarations; _i4 < _arr4.length; _i4++) {
- var decl = _arr4[_i4];
- for (var _i5 = 0, _Object$keys = Object.keys(getBindingIdentifiers(decl)); _i5 < _Object$keys.length; _i5++) {
- var name = _Object$keys[_i5];
- var _binding = scope.getBinding(name);
- if (_binding) _binding.reference(path);
- }
- }
- }
- }
- },
- LabeledStatement: function LabeledStatement(path) {
- path.scope.getProgramParent().addGlobal(path.node);
- path.scope.getBlockParent().registerDeclaration(path);
- },
- AssignmentExpression: function AssignmentExpression(path, state) {
- state.assignments.push(path);
- },
- UpdateExpression: function UpdateExpression(path, state) {
- state.constantViolations.push(path);
- },
- UnaryExpression: function UnaryExpression(path, state) {
- if (path.node.operator === "delete") {
- state.constantViolations.push(path);
- }
- },
- BlockScoped: function BlockScoped(path) {
- var scope = path.scope;
- if (scope.path === path) scope = scope.parent;
- scope.getBlockParent().registerDeclaration(path);
- },
- ClassDeclaration: function ClassDeclaration(path) {
- var id = path.node.id;
- if (!id) return;
- var name = id.name;
- path.scope.bindings[name] = path.scope.getBinding(name);
- },
- Block: function Block(path) {
- var paths = path.get("body");
- for (var _i6 = 0, _arr5 = paths; _i6 < _arr5.length; _i6++) {
- var bodyPath = _arr5[_i6];
- if (bodyPath.isFunctionDeclaration()) {
- path.scope.getBlockParent().registerDeclaration(bodyPath);
- }
- }
- }
- };
- var uid = 0;
- var Scope$1 = function () {
- function Scope(path) {
- var node = path.node;
- var cached = scope.get(node);
- if (cached && cached.path === path) {
- return cached;
- }
- scope.set(node, this);
- this.uid = uid++;
- this.block = node;
- this.path = path;
- this.labels = new Map();
- }
- var _proto = Scope.prototype;
- _proto.traverse = function traverse(node, opts, state) {
- traverse$1(node, opts, this, state, this.path);
- };
- _proto.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier(name) {
- var id = this.generateUidIdentifier(name);
- this.push({
- id: id
- });
- return cloneNode(id);
- };
- _proto.generateUidIdentifier = function generateUidIdentifier(name) {
- return Identifier(this.generateUid(name));
- };
- _proto.generateUid = function generateUid(name) {
- if (name === void 0) {
- name = "temp";
- }
- name = toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
- var uid;
- var i = 0;
- do {
- uid = this._generateUid(name, i);
- i++;
- } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
- var program = this.getProgramParent();
- program.references[uid] = true;
- program.uids[uid] = true;
- return uid;
- };
- _proto._generateUid = function _generateUid(name, i) {
- var id = name;
- if (i > 1) id += i;
- return "_" + id;
- };
- _proto.generateUidBasedOnNode = function generateUidBasedOnNode(parent, defaultName) {
- var node = parent;
- if (isAssignmentExpression(parent)) {
- node = parent.left;
- } else if (isVariableDeclarator(parent)) {
- node = parent.id;
- } else if (isObjectProperty(node) || isObjectMethod(node)) {
- node = node.key;
- }
- var parts = [];
- gatherNodeParts(node, parts);
- var id = parts.join("$");
- id = id.replace(/^_/, "") || defaultName || "ref";
- return this.generateUid(id.slice(0, 20));
- };
- _proto.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) {
- return Identifier(this.generateUidBasedOnNode(parent, defaultName));
- };
- _proto.isStatic = function isStatic(node) {
- if (isThisExpression(node) || isSuper(node)) {
- return true;
- }
- if (isIdentifier(node)) {
- var binding = this.getBinding(node.name);
- if (binding) {
- return binding.constant;
- } else {
- return this.hasBinding(node.name);
- }
- }
- return false;
- };
- _proto.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) {
- if (this.isStatic(node)) {
- return null;
- } else {
- var id = this.generateUidIdentifierBasedOnNode(node);
- if (!dontPush) {
- this.push({
- id: id
- });
- return cloneNode(id);
- }
- return id;
- }
- };
- _proto.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) {
- if (kind === "param") return;
- if (local.kind === "local") return;
- var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
- if (duplicate) {
- throw this.hub.buildError(id, "Duplicate declaration \"" + name + "\"", TypeError);
- }
- };
- _proto.rename = function rename(oldName, newName, block) {
- var binding = this.getBinding(oldName);
- if (binding) {
- newName = newName || this.generateUidIdentifier(oldName).name;
- return new Renamer(binding, oldName, newName).rename(block);
- }
- };
- _proto._renameFromMap = function _renameFromMap(map, oldName, newName, value) {
- if (map[oldName]) {
- map[newName] = value;
- map[oldName] = null;
- }
- };
- _proto.dump = function dump() {
- var sep = repeat_1("-", 60);
- console.log(sep);
- var scope = this;
- do {
- console.log("#", scope.block.type);
- for (var _i7 = 0, _Object$keys2 = Object.keys(scope.bindings); _i7 < _Object$keys2.length; _i7++) {
- var name = _Object$keys2[_i7];
- var binding = scope.bindings[name];
- console.log(" -", name, {
- constant: binding.constant,
- references: binding.references,
- violations: binding.constantViolations.length,
- kind: binding.kind
- });
- }
- } while (scope = scope.parent);
- console.log(sep);
- };
- _proto.toArray = function toArray(node, i) {
- if (isIdentifier(node)) {
- var binding = this.getBinding(node.name);
- if (binding && binding.constant && binding.path.isGenericType("Array")) {
- return node;
- }
- }
- if (isArrayExpression(node)) {
- return node;
- }
- if (isIdentifier(node, {
- name: "arguments"
- })) {
- return CallExpression(MemberExpression(MemberExpression(MemberExpression(Identifier("Array"), Identifier("prototype")), Identifier("slice")), Identifier("call")), [node]);
- }
- var helperName;
- var args = [node];
- if (i === true) {
- helperName = "toConsumableArray";
- } else if (i) {
- args.push(NumericLiteral(i));
- helperName = "slicedToArray";
- } else {
- helperName = "toArray";
- }
- return CallExpression(this.hub.addHelper(helperName), args);
- };
- _proto.hasLabel = function hasLabel(name) {
- return !!this.getLabel(name);
- };
- _proto.getLabel = function getLabel(name) {
- return this.labels.get(name);
- };
- _proto.registerLabel = function registerLabel(path) {
- this.labels.set(path.node.label.name, path);
- };
- _proto.registerDeclaration = function registerDeclaration(path) {
- if (path.isLabeledStatement()) {
- this.registerLabel(path);
- } else if (path.isFunctionDeclaration()) {
- this.registerBinding("hoisted", path.get("id"), path);
- } else if (path.isVariableDeclaration()) {
- var declarations = path.get("declarations");
- for (var _i8 = 0, _arr6 = declarations; _i8 < _arr6.length; _i8++) {
- var declar = _arr6[_i8];
- this.registerBinding(path.node.kind, declar);
- }
- } else if (path.isClassDeclaration()) {
- this.registerBinding("let", path);
- } else if (path.isImportDeclaration()) {
- var specifiers = path.get("specifiers");
- for (var _i9 = 0, _arr7 = specifiers; _i9 < _arr7.length; _i9++) {
- var specifier = _arr7[_i9];
- this.registerBinding("module", specifier);
- }
- } else if (path.isExportDeclaration()) {
- var _declar = path.get("declaration");
- if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) {
- this.registerDeclaration(_declar);
- }
- } else {
- this.registerBinding("unknown", path);
- }
- };
- _proto.buildUndefinedNode = function buildUndefinedNode() {
- return UnaryExpression("void", NumericLiteral(0), true);
- };
- _proto.registerConstantViolation = function registerConstantViolation(path) {
- var ids = path.getBindingIdentifiers();
- for (var _i10 = 0, _Object$keys3 = Object.keys(ids); _i10 < _Object$keys3.length; _i10++) {
- var name = _Object$keys3[_i10];
- var binding = this.getBinding(name);
- if (binding) binding.reassign(path);
- }
- };
- _proto.registerBinding = function registerBinding(kind, path, bindingPath) {
- if (bindingPath === void 0) {
- bindingPath = path;
- }
- if (!kind) throw new ReferenceError("no `kind`");
- if (path.isVariableDeclaration()) {
- var declarators = path.get("declarations");
- for (var _iterator = declarators, _isArray = Array.isArray(_iterator), _i11 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i11 >= _iterator.length) break;
- _ref = _iterator[_i11++];
- } else {
- _i11 = _iterator.next();
- if (_i11.done) break;
- _ref = _i11.value;
- }
- var declar = _ref;
- this.registerBinding(kind, declar);
- }
- return;
- }
- var parent = this.getProgramParent();
- var ids = path.getOuterBindingIdentifiers(true);
- for (var _i12 = 0, _Object$keys4 = Object.keys(ids); _i12 < _Object$keys4.length; _i12++) {
- var name = _Object$keys4[_i12];
- for (var _i13 = 0, _arr8 = ids[name]; _i13 < _arr8.length; _i13++) {
- var id = _arr8[_i13];
- var local = this.getOwnBinding(name);
- if (local) {
- if (local.identifier === id) continue;
- this.checkBlockScopedCollisions(local, kind, name, id);
- }
- parent.references[name] = true;
- if (local) {
- this.registerConstantViolation(bindingPath);
- } else {
- this.bindings[name] = new Binding({
- identifier: id,
- scope: this,
- path: bindingPath,
- kind: kind
- });
- }
- }
- }
- };
- _proto.addGlobal = function addGlobal(node) {
- this.globals[node.name] = node;
- };
- _proto.hasUid = function hasUid(name) {
- var scope = this;
- do {
- if (scope.uids[name]) return true;
- } while (scope = scope.parent);
- return false;
- };
- _proto.hasGlobal = function hasGlobal(name) {
- var scope = this;
- do {
- if (scope.globals[name]) return true;
- } while (scope = scope.parent);
- return false;
- };
- _proto.hasReference = function hasReference(name) {
- var scope = this;
- do {
- if (scope.references[name]) return true;
- } while (scope = scope.parent);
- return false;
- };
- _proto.isPure = function isPure(node, constantsOnly) {
- if (isIdentifier(node)) {
- var binding = this.getBinding(node.name);
- if (!binding) return false;
- if (constantsOnly) return binding.constant;
- return true;
- } else if (isClass(node)) {
- if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
- return false;
- }
- return this.isPure(node.body, constantsOnly);
- } else if (isClassBody(node)) {
- for (var _iterator2 = node.body, _isArray2 = Array.isArray(_iterator2), _i14 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i14 >= _iterator2.length) break;
- _ref2 = _iterator2[_i14++];
- } else {
- _i14 = _iterator2.next();
- if (_i14.done) break;
- _ref2 = _i14.value;
- }
- var method = _ref2;
- if (!this.isPure(method, constantsOnly)) return false;
- }
- return true;
- } else if (isBinary(node)) {
- return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
- } else if (isArrayExpression(node)) {
- for (var _i15 = 0, _arr9 = node.elements; _i15 < _arr9.length; _i15++) {
- var elem = _arr9[_i15];
- if (!this.isPure(elem, constantsOnly)) return false;
- }
- return true;
- } else if (isObjectExpression(node)) {
- for (var _i16 = 0, _arr10 = node.properties; _i16 < _arr10.length; _i16++) {
- var prop = _arr10[_i16];
- if (!this.isPure(prop, constantsOnly)) return false;
- }
- return true;
- } else if (isClassMethod(node)) {
- if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
- if (node.kind === "get" || node.kind === "set") return false;
- return true;
- } else if (isProperty(node)) {
- if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
- return this.isPure(node.value, constantsOnly);
- } else if (isUnaryExpression(node)) {
- return this.isPure(node.argument, constantsOnly);
- } else if (isTaggedTemplateExpression(node)) {
- return matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
- } else if (isTemplateLiteral(node)) {
- for (var _i17 = 0, _arr11 = node.expressions; _i17 < _arr11.length; _i17++) {
- var expression = _arr11[_i17];
- if (!this.isPure(expression, constantsOnly)) return false;
- }
- return true;
- } else {
- return isPureish(node);
- }
- };
- _proto.setData = function setData(key, val) {
- return this.data[key] = val;
- };
- _proto.getData = function getData(key) {
- var scope = this;
- do {
- var data = scope.data[key];
- if (data != null) return data;
- } while (scope = scope.parent);
- };
- _proto.removeData = function removeData(key) {
- var scope = this;
- do {
- var data = scope.data[key];
- if (data != null) scope.data[key] = null;
- } while (scope = scope.parent);
- };
- _proto.init = function init() {
- if (!this.references) this.crawl();
- };
- _proto.crawl = function crawl() {
- var path = this.path;
- this.references = Object.create(null);
- this.bindings = Object.create(null);
- this.globals = Object.create(null);
- this.uids = Object.create(null);
- this.data = Object.create(null);
- if (path.isLoop()) {
- for (var _i18 = 0, _arr12 = FOR_INIT_KEYS; _i18 < _arr12.length; _i18++) {
- var key = _arr12[_i18];
- var node = path.get(key);
- if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
- }
- }
- if (path.isFunctionExpression() && path.has("id")) {
- if (!path.get("id").node[NOT_LOCAL_BINDING]) {
- this.registerBinding("local", path.get("id"), path);
- }
- }
- if (path.isClassExpression() && path.has("id")) {
- if (!path.get("id").node[NOT_LOCAL_BINDING]) {
- this.registerBinding("local", path);
- }
- }
- if (path.isFunction()) {
- var params = path.get("params");
- for (var _iterator3 = params, _isArray3 = Array.isArray(_iterator3), _i19 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i19 >= _iterator3.length) break;
- _ref3 = _iterator3[_i19++];
- } else {
- _i19 = _iterator3.next();
- if (_i19.done) break;
- _ref3 = _i19.value;
- }
- var param = _ref3;
- this.registerBinding("param", param);
- }
- }
- if (path.isCatchClause()) {
- this.registerBinding("let", path);
- }
- var parent = this.getProgramParent();
- if (parent.crawling) return;
- var state = {
- references: [],
- constantViolations: [],
- assignments: []
- };
- this.crawling = true;
- path.traverse(collectorVisitor, state);
- this.crawling = false;
- for (var _iterator4 = state.assignments, _isArray4 = Array.isArray(_iterator4), _i20 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray4) {
- if (_i20 >= _iterator4.length) break;
- _ref4 = _iterator4[_i20++];
- } else {
- _i20 = _iterator4.next();
- if (_i20.done) break;
- _ref4 = _i20.value;
- }
- var _path = _ref4;
- var ids = _path.getBindingIdentifiers();
- var programParent = void 0;
- for (var _i23 = 0, _Object$keys5 = Object.keys(ids); _i23 < _Object$keys5.length; _i23++) {
- var name = _Object$keys5[_i23];
- if (_path.scope.getBinding(name)) continue;
- programParent = programParent || _path.scope.getProgramParent();
- programParent.addGlobal(ids[name]);
- }
- _path.scope.registerConstantViolation(_path);
- }
- for (var _iterator5 = state.references, _isArray5 = Array.isArray(_iterator5), _i21 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray5) {
- if (_i21 >= _iterator5.length) break;
- _ref5 = _iterator5[_i21++];
- } else {
- _i21 = _iterator5.next();
- if (_i21.done) break;
- _ref5 = _i21.value;
- }
- var ref = _ref5;
- var binding = ref.scope.getBinding(ref.node.name);
- if (binding) {
- binding.reference(ref);
- } else {
- ref.scope.getProgramParent().addGlobal(ref.node);
- }
- }
- for (var _iterator6 = state.constantViolations, _isArray6 = Array.isArray(_iterator6), _i22 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray6) {
- if (_i22 >= _iterator6.length) break;
- _ref6 = _iterator6[_i22++];
- } else {
- _i22 = _iterator6.next();
- if (_i22.done) break;
- _ref6 = _i22.value;
- }
- var _path2 = _ref6;
- _path2.scope.registerConstantViolation(_path2);
- }
- };
- _proto.push = function push(opts) {
- var path = this.path;
- if (!path.isBlockStatement() && !path.isProgram()) {
- path = this.getBlockParent().path;
- }
- if (path.isSwitchStatement()) {
- path = (this.getFunctionParent() || this.getProgramParent()).path;
- }
- if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
- path.ensureBlock();
- path = path.get("body");
- }
- var unique = opts.unique;
- var kind = opts.kind || "var";
- var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
- var dataKey = "declaration:" + kind + ":" + blockHoist;
- var declarPath = !unique && path.getData(dataKey);
- if (!declarPath) {
- var declar = VariableDeclaration(kind, []);
- declar._blockHoist = blockHoist;
- var _path$unshiftContaine = path.unshiftContainer("body", [declar]);
- declarPath = _path$unshiftContaine[0];
- if (!unique) path.setData(dataKey, declarPath);
- }
- var declarator = VariableDeclarator(opts.id, opts.init);
- declarPath.node.declarations.push(declarator);
- this.registerBinding(kind, declarPath.get("declarations").pop());
- };
- _proto.getProgramParent = function getProgramParent() {
- var scope = this;
- do {
- if (scope.path.isProgram()) {
- return scope;
- }
- } while (scope = scope.parent);
- throw new Error("Couldn't find a Program");
- };
- _proto.getFunctionParent = function getFunctionParent() {
- var scope = this;
- do {
- if (scope.path.isFunctionParent()) {
- return scope;
- }
- } while (scope = scope.parent);
- return null;
- };
- _proto.getBlockParent = function getBlockParent() {
- var scope = this;
- do {
- if (scope.path.isBlockParent()) {
- return scope;
- }
- } while (scope = scope.parent);
- throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
- };
- _proto.getAllBindings = function getAllBindings() {
- var ids = Object.create(null);
- var scope = this;
- do {
- defaults_1(ids, scope.bindings);
- scope = scope.parent;
- } while (scope);
- return ids;
- };
- _proto.getAllBindingsOfKind = function getAllBindingsOfKind() {
- var ids = Object.create(null);
- for (var _i24 = 0, _arr13 = arguments; _i24 < _arr13.length; _i24++) {
- var kind = _arr13[_i24];
- var scope = this;
- do {
- for (var _i25 = 0, _Object$keys6 = Object.keys(scope.bindings); _i25 < _Object$keys6.length; _i25++) {
- var name = _Object$keys6[_i25];
- var binding = scope.bindings[name];
- if (binding.kind === kind) ids[name] = binding;
- }
- scope = scope.parent;
- } while (scope);
- }
- return ids;
- };
- _proto.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) {
- return this.getBindingIdentifier(name) === node;
- };
- _proto.getBinding = function getBinding(name) {
- var scope = this;
- var previousPath;
- do {
- var binding = scope.getOwnBinding(name);
- if (binding) {
- if (previousPath && previousPath.isPattern() && previousPath.parentPath.isFunction() && binding.kind !== "param") ; else {
- return binding;
- }
- }
- previousPath = scope.path;
- } while (scope = scope.parent);
- };
- _proto.getOwnBinding = function getOwnBinding(name) {
- return this.bindings[name];
- };
- _proto.getBindingIdentifier = function getBindingIdentifier(name) {
- var info = this.getBinding(name);
- return info && info.identifier;
- };
- _proto.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) {
- var binding = this.bindings[name];
- return binding && binding.identifier;
- };
- _proto.hasOwnBinding = function hasOwnBinding(name) {
- return !!this.getOwnBinding(name);
- };
- _proto.hasBinding = function hasBinding(name, noGlobals) {
- if (!name) return false;
- if (this.hasOwnBinding(name)) return true;
- if (this.parentHasBinding(name, noGlobals)) return true;
- if (this.hasUid(name)) return true;
- if (!noGlobals && includes_1(Scope.globals, name)) return true;
- if (!noGlobals && includes_1(Scope.contextVariables, name)) return true;
- return false;
- };
- _proto.parentHasBinding = function parentHasBinding(name, noGlobals) {
- return this.parent && this.parent.hasBinding(name, noGlobals);
- };
- _proto.moveBindingTo = function moveBindingTo(name, scope) {
- var info = this.getBinding(name);
- if (info) {
- info.scope.removeOwnBinding(name);
- info.scope = scope;
- scope.bindings[name] = info;
- }
- };
- _proto.removeOwnBinding = function removeOwnBinding(name) {
- delete this.bindings[name];
- };
- _proto.removeBinding = function removeBinding(name) {
- var info = this.getBinding(name);
- if (info) {
- info.scope.removeOwnBinding(name);
- }
- var scope = this;
- do {
- if (scope.uids[name]) {
- scope.uids[name] = false;
- }
- } while (scope = scope.parent);
- };
- _createClass(Scope, [{
- key: "parent",
- get: function get() {
- var parent = this.path.findParent(function (p) {
- return p.isScope();
- });
- return parent && parent.scope;
- }
- }, {
- key: "parentBlock",
- get: function get() {
- return this.path.parent;
- }
- }, {
- key: "hub",
- get: function get() {
- return this.path.hub;
- }
- }]);
- return Scope;
- }();
- Scope$1.globals = Object.keys(globals$2.builtin);
- Scope$1.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
- var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
- var encode = function (number) {
- if (0 <= number && number < intToCharMap.length) {
- return intToCharMap[number];
- }
- throw new TypeError("Must be between 0 and 63: " + number);
- };
- var decode = function (charCode) {
- var bigA = 65;
- var bigZ = 90;
- var littleA = 97;
- var littleZ = 122;
- var zero = 48;
- var nine = 57;
- var plus = 43;
- var slash = 47;
- var littleOffset = 26;
- var numberOffset = 52;
- if (bigA <= charCode && charCode <= bigZ) {
- return charCode - bigA;
- }
- if (littleA <= charCode && charCode <= littleZ) {
- return charCode - littleA + littleOffset;
- }
- if (zero <= charCode && charCode <= nine) {
- return charCode - zero + numberOffset;
- }
- if (charCode == plus) {
- return 62;
- }
- if (charCode == slash) {
- return 63;
- }
- return -1;
- };
- var base64 = {
- encode: encode,
- decode: decode
- };
- var VLQ_BASE_SHIFT = 5;
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
- var VLQ_BASE_MASK = VLQ_BASE - 1;
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
- function toVLQSigned(aValue) {
- return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
- }
- function fromVLQSigned(aValue) {
- var isNegative = (aValue & 1) === 1;
- var shifted = aValue >> 1;
- return isNegative ? -shifted : shifted;
- }
- var encode$1 = 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) {
- digit |= VLQ_CONTINUATION_BIT;
- }
- encoded += base64.encode(digit);
- } while (vlq > 0);
- return encoded;
- };
- 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$1,
- decode: decode$1
- };
- var util = createCommonjsModule(function (module, exports) {
- 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;
- 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 === '') {
- 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;
- function join(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- if (aPath === "") {
- aPath = ".";
- }
- var aPathUrl = urlParse(aPath);
- var aRootUrl = urlParse(aRoot);
- if (aRootUrl) {
- aRoot = aRootUrl.path || '/';
- }
- if (aPathUrl && !aPathUrl.scheme) {
- if (aRootUrl) {
- aPathUrl.scheme = aRootUrl.scheme;
- }
- return urlGenerate(aPathUrl);
- }
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
- return aPath;
- }
- 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);
- };
- function relative(aRoot, aPath) {
- if (aRoot === "") {
- aRoot = ".";
- }
- aRoot = aRoot.replace(/\/$/, '');
- var level = 0;
- while (aPath.indexOf(aRoot + '/') !== 0) {
- var index = aRoot.lastIndexOf("/");
- if (index < 0) {
- return aPath;
- }
- aRoot = aRoot.slice(0, index);
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
- return aPath;
- }
- ++level;
- }
- 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;
- }
- 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) {
- return false;
- }
- if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || 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;
- }
- 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;
- 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;
- }
- if (aStr2 === null) {
- return -1;
- }
- if (aStr1 > aStr2) {
- return 1;
- }
- return -1;
- }
- 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;
- function parseSourceMapInput(str) {
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
- }
- exports.parseSourceMapInput = parseSourceMapInput;
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
- sourceURL = sourceURL || '';
- if (sourceRoot) {
- if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
- sourceRoot += '/';
- }
- sourceURL = sourceRoot + sourceURL;
- }
- if (sourceMapURL) {
- var parsed = urlParse(sourceMapURL);
- if (!parsed) {
- throw new Error("sourceMapURL could not be parsed");
- }
- if (parsed.path) {
- 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;
- });
- var util_1 = util.getArg;
- var util_2 = util.urlParse;
- var util_3 = util.urlGenerate;
- var util_4 = util.normalize;
- var util_5 = util.join;
- var util_6 = util.isAbsolute;
- var util_7 = util.relative;
- var util_8 = util.toSetString;
- var util_9 = util.fromSetString;
- var util_10 = util.compareByOriginalPositions;
- var util_11 = util.compareByGeneratedPositionsDeflated;
- var util_12 = util.compareByGeneratedPositionsInflated;
- var util_13 = util.parseSourceMapInput;
- var util_14 = util.computeSourceURL;
- var has$1 = Object.prototype.hasOwnProperty;
- var hasNativeMap = typeof Map !== "undefined";
- function ArraySet() {
- this._array = [];
- this._set = hasNativeMap ? new Map() : Object.create(null);
- }
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
- for (var i = 0, len = aArray.length; i < len; i++) {
- set.add(aArray[i], aAllowDuplicates);
- }
- return set;
- };
- ArraySet.prototype.size = function ArraySet_size() {
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
- };
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.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;
- }
- }
- };
- ArraySet.prototype.has = function ArraySet_has(aStr) {
- if (hasNativeMap) {
- return this._set.has(aStr);
- } else {
- var sStr = util.toSetString(aStr);
- return has$1.call(this._set, sStr);
- }
- };
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
- if (hasNativeMap) {
- var idx = this._set.get(aStr);
- if (idx >= 0) {
- return idx;
- }
- } else {
- var sStr = util.toSetString(aStr);
- if (has$1.call(this._set, sStr)) {
- return this._set[sStr];
- }
- }
- throw new Error('"' + aStr + '" is not in the set.');
- };
- ArraySet.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);
- };
- ArraySet.prototype.toArray = function ArraySet_toArray() {
- return this._array.slice();
- };
- var ArraySet_1 = ArraySet;
- var arraySet = {
- ArraySet: ArraySet_1
- };
- function generatedPositionAfter(mappingA, mappingB) {
- var lineA = mappingA.generatedLine;
- var lineB = mappingB.generatedLine;
- var columnA = mappingA.generatedColumn;
- var columnB = mappingB.generatedColumn;
- return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
- }
- function MappingList() {
- this._array = [];
- this._sorted = true;
- this._last = {
- generatedLine: -1,
- generatedColumn: 0
- };
- }
- MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
- this._array.forEach(aCallback, aThisArg);
- };
- MappingList.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);
- }
- };
- MappingList.prototype.toArray = function MappingList_toArray() {
- if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
- this._sorted = true;
- }
- return this._array;
- };
- var MappingList_1 = MappingList;
- var mappingList = {
- MappingList: MappingList_1
- };
- var ArraySet$1 = arraySet.ArraySet;
- var MappingList$1 = mappingList.MappingList;
- function SourceMapGenerator(aArgs) {
- if (!aArgs) {
- aArgs = {};
- }
- this._file = util.getArg(aArgs, 'file', null);
- this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
- this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet$1();
- this._names = new ArraySet$1();
- this._mappings = new MappingList$1();
- this._sourcesContents = null;
- }
- SourceMapGenerator.prototype._version = 3;
- SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
- var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
- 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.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.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;
- };
- SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
- var generated = util.getArg(aArgs, 'generated');
- var original = util.getArg(aArgs, 'original', null);
- var source = util.getArg(aArgs, 'source', null);
- var name = util.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
- });
- };
- SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
- var source = aSourceFile;
- if (this._sourceRoot != null) {
- source = util.relative(this._sourceRoot, source);
- }
- if (aSourceContent != null) {
- if (!this._sourcesContents) {
- this._sourcesContents = Object.create(null);
- }
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
- } else if (this._sourcesContents) {
- delete this._sourcesContents[util.toSetString(source)];
- if (Object.keys(this._sourcesContents).length === 0) {
- this._sourcesContents = null;
- }
- }
- };
- SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
- var sourceFile = aSourceFile;
- 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;
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- var newSources = new ArraySet$1();
- var newNames = new ArraySet$1();
- this._mappings.unsortedForEach(function (mapping) {
- if (mapping.source === sourceFile && mapping.originalLine != null) {
- var original = aSourceMapConsumer.originalPositionFor({
- line: mapping.originalLine,
- column: mapping.originalColumn
- });
- if (original.source != null) {
- mapping.source = original.source;
- if (aSourceMapPath != null) {
- mapping.source = util.join(aSourceMapPath, mapping.source);
- }
- if (sourceRoot != null) {
- mapping.source = util.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;
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aSourceMapPath != null) {
- sourceFile = util.join(aSourceMapPath, sourceFile);
- }
- if (sourceRoot != null) {
- sourceFile = util.relative(sourceRoot, sourceFile);
- }
- this.setSourceContent(sourceFile, content);
- }
- }, this);
- };
- SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
- 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) {
- 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) {
- return;
- } else {
- throw new Error('Invalid mapping: ' + JSON.stringify({
- generated: aGenerated,
- source: aSource,
- original: aOriginal,
- name: aName
- }));
- }
- };
- SourceMapGenerator.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.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;
- 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.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
- return aSources.map(function (source) {
- if (!this._sourcesContents) {
- return null;
- }
- if (aSourceRoot != null) {
- source = util.relative(aSourceRoot, source);
- }
- var key = util.toSetString(source);
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
- }, this);
- };
- SourceMapGenerator.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;
- };
- SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
- return JSON.stringify(this.toJSON());
- };
- var SourceMapGenerator_1 = SourceMapGenerator;
- var sourceMapGenerator = {
- SourceMapGenerator: SourceMapGenerator_1
- };
- var binarySearch = createCommonjsModule(function (module, exports) {
- exports.GREATEST_LOWER_BOUND = 1;
- exports.LEAST_UPPER_BOUND = 2;
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
- if (cmp === 0) {
- return mid;
- } else if (cmp > 0) {
- if (aHigh - mid > 1) {
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
- }
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return aHigh < aHaystack.length ? aHigh : -1;
- } else {
- return mid;
- }
- } else {
- if (mid - aLow > 1) {
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
- }
- if (aBias == exports.LEAST_UPPER_BOUND) {
- return mid;
- } else {
- return aLow < 0 ? -1 : aLow;
- }
- }
- }
- 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;
- }
- while (index - 1 >= 0) {
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
- break;
- }
- --index;
- }
- return index;
- };
- });
- var binarySearch_1 = binarySearch.GREATEST_LOWER_BOUND;
- var binarySearch_2 = binarySearch.LEAST_UPPER_BOUND;
- var binarySearch_3 = binarySearch.search;
- function swap(ary, x, y) {
- var temp = ary[x];
- ary[x] = ary[y];
- ary[y] = temp;
- }
- function randomIntInRange(low, high) {
- return Math.round(low + Math.random() * (high - low));
- }
- function doQuickSort(ary, comparator, p, r) {
- if (p < r) {
- var pivotIndex = randomIntInRange(p, r);
- var i = p - 1;
- swap(ary, pivotIndex, r);
- var pivot = ary[r];
- 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;
- doQuickSort(ary, comparator, p, q - 1);
- doQuickSort(ary, comparator, q + 1, r);
- }
- }
- var quickSort_1 = function (ary, comparator) {
- doQuickSort(ary, comparator, 0, ary.length - 1);
- };
- var quickSort = {
- quickSort: quickSort_1
- };
- var ArraySet$2 = arraySet.ArraySet;
- var quickSort$1 = quickSort.quickSort;
- function SourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
- }
- SourceMapConsumer.fromSourceMap = function (aSourceMap, aSourceMapURL) {
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
- };
- SourceMapConsumer.prototype._version = 3;
- SourceMapConsumer.prototype.__generatedMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
- configurable: true,
- enumerable: true,
- get: function get() {
- if (!this.__generatedMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__generatedMappings;
- }
- });
- SourceMapConsumer.prototype.__originalMappings = null;
- Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
- configurable: true,
- enumerable: true,
- get: function get() {
- if (!this.__originalMappings) {
- this._parseMappings(this._mappings, this.sourceRoot);
- }
- return this.__originalMappings;
- }
- });
- SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
- var c = aStr.charAt(index);
- return c === ";" || c === ",";
- };
- SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
- throw new Error("Subclasses must implement _parseMappings");
- };
- SourceMapConsumer.GENERATED_ORDER = 1;
- SourceMapConsumer.ORIGINAL_ORDER = 2;
- SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
- SourceMapConsumer.LEAST_UPPER_BOUND = 2;
- SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
- var context = aContext || null;
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
- var mappings;
- switch (order) {
- case SourceMapConsumer.GENERATED_ORDER:
- mappings = this._generatedMappings;
- break;
- case SourceMapConsumer.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.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);
- };
- SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
- var line = util.getArg(aArgs, 'line');
- var needle = {
- source: util.getArg(aArgs, 'source'),
- originalLine: line,
- originalColumn: util.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.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (aArgs.column === undefined) {
- var originalLine = mapping.originalLine;
- while (mapping && mapping.originalLine === originalLine) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- } else {
- var originalColumn = mapping.originalColumn;
- while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
- mappings.push({
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- });
- mapping = this._originalMappings[++index];
- }
- }
- }
- return mappings;
- };
- var SourceMapConsumer_1 = SourceMapConsumer;
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- var version = util.getArg(sourceMap, 'version');
- var sources = util.getArg(sourceMap, 'sources');
- var names = util.getArg(sourceMap, 'names', []);
- var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
- var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
- var mappings = util.getArg(sourceMap, 'mappings');
- var file = util.getArg(sourceMap, 'file', null);
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- if (sourceRoot) {
- sourceRoot = util.normalize(sourceRoot);
- }
- sources = sources.map(String).map(util.normalize).map(function (source) {
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
- });
- this._names = ArraySet$2.fromArray(names.map(String), true);
- this._sources = ArraySet$2.fromArray(sources, true);
- this._absoluteSources = this._sources.toArray().map(function (s) {
- return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
- });
- this.sourceRoot = sourceRoot;
- this.sourcesContent = sourcesContent;
- this._mappings = mappings;
- this._sourceMapURL = aSourceMapURL;
- this.file = file;
- }
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
- BasicSourceMapConsumer.prototype._findSourceIndex = function (aSource) {
- var relativeSource = aSource;
- if (this.sourceRoot != null) {
- relativeSource = util.relative(this.sourceRoot, relativeSource);
- }
- if (this._sources.has(relativeSource)) {
- return this._sources.indexOf(relativeSource);
- }
- var i;
- for (i = 0; i < this._absoluteSources.length; ++i) {
- if (this._absoluteSources[i] == aSource) {
- return i;
- }
- }
- return -1;
- };
- BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
- var smc = Object.create(BasicSourceMapConsumer.prototype);
- var names = smc._names = ArraySet$2.fromArray(aSourceMap._names.toArray(), true);
- var sources = smc._sources = ArraySet$2.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.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
- });
- 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$1(smc.__originalMappings, util.compareByOriginalPositions);
- return smc;
- };
- BasicSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
- get: function get() {
- return this._absoluteSources.slice();
- }
- });
- function Mapping() {
- this.generatedLine = 0;
- this.generatedColumn = 0;
- this.source = null;
- this.originalLine = null;
- this.originalColumn = null;
- this.name = null;
- }
- 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;
- 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;
- }
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
- previousGeneratedColumn = mapping.generatedColumn;
- if (segment.length > 1) {
- mapping.source = previousSource + segment[1];
- previousSource += segment[1];
- mapping.originalLine = previousOriginalLine + segment[2];
- previousOriginalLine = mapping.originalLine;
- mapping.originalLine += 1;
- mapping.originalColumn = previousOriginalColumn + segment[3];
- previousOriginalColumn = mapping.originalColumn;
- if (segment.length > 4) {
- mapping.name = previousName + segment[4];
- previousName += segment[4];
- }
- }
- generatedMappings.push(mapping);
- if (typeof mapping.originalLine === 'number') {
- originalMappings.push(mapping);
- }
- }
- }
- quickSort$1(generatedMappings, util.compareByGeneratedPositionsDeflated);
- this.__generatedMappings = generatedMappings;
- quickSort$1(originalMappings, util.compareByOriginalPositions);
- this.__originalMappings = originalMappings;
- };
- BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
- 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);
- };
- BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
- for (var index = 0; index < this._generatedMappings.length; ++index) {
- var mapping = this._generatedMappings[index];
- if (index + 1 < this._generatedMappings.length) {
- var nextMapping = this._generatedMappings[index + 1];
- if (mapping.generatedLine === nextMapping.generatedLine) {
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
- continue;
- }
- }
- mapping.lastGeneratedColumn = Infinity;
- }
- };
- BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
- if (index >= 0) {
- var mapping = this._generatedMappings[index];
- if (mapping.generatedLine === needle.generatedLine) {
- var source = util.getArg(mapping, 'source', null);
- if (source !== null) {
- source = this._sources.at(source);
- source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
- }
- var name = util.getArg(mapping, 'name', null);
- if (name !== null) {
- name = this._names.at(name);
- }
- return {
- source: source,
- line: util.getArg(mapping, 'originalLine', null),
- column: util.getArg(mapping, 'originalColumn', null),
- name: name
- };
- }
- }
- return {
- source: null,
- line: null,
- column: null,
- name: null
- };
- };
- 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;
- });
- };
- 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.relative(this.sourceRoot, relativeSource);
- }
- var url;
- if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
- 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)];
- }
- }
- if (nullOnMissing) {
- return null;
- } else {
- throw new Error('"' + relativeSource + '" is not in the SourceMap.');
- }
- };
- BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
- var source = util.getArg(aArgs, 'source');
- source = this._findSourceIndex(source);
- if (source < 0) {
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- }
- var needle = {
- source: source,
- originalLine: util.getArg(aArgs, 'line'),
- originalColumn: util.getArg(aArgs, 'column')
- };
- var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
- if (index >= 0) {
- var mapping = this._originalMappings[index];
- if (mapping.source === needle.source) {
- return {
- line: util.getArg(mapping, 'generatedLine', null),
- column: util.getArg(mapping, 'generatedColumn', null),
- lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
- };
- }
- }
- return {
- line: null,
- column: null,
- lastColumn: null
- };
- };
- var BasicSourceMapConsumer_1 = BasicSourceMapConsumer;
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
- var sourceMap = aSourceMap;
- if (typeof aSourceMap === 'string') {
- sourceMap = util.parseSourceMapInput(aSourceMap);
- }
- var version = util.getArg(sourceMap, 'version');
- var sections = util.getArg(sourceMap, 'sections');
- if (version != this._version) {
- throw new Error('Unsupported version: ' + version);
- }
- this._sources = new ArraySet$2();
- this._names = new ArraySet$2();
- var lastOffset = {
- line: -1,
- column: 0
- };
- this._sections = sections.map(function (s) {
- if (s.url) {
- throw new Error('Support for url field in sections not implemented.');
- }
- var offset = util.getArg(s, 'offset');
- var offsetLine = util.getArg(offset, 'line');
- var offsetColumn = util.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: {
- generatedLine: offsetLine + 1,
- generatedColumn: offsetColumn + 1
- },
- consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
- };
- });
- }
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
- IndexedSourceMapConsumer.prototype._version = 3;
- Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
- get: function get() {
- 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;
- }
- });
- IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
- var needle = {
- generatedLine: util.getArg(aArgs, 'line'),
- generatedColumn: util.getArg(aArgs, 'column')
- };
- 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
- });
- };
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
- return this._sections.every(function (s) {
- return s.consumer.hasContentsOfAllSources();
- });
- };
- 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.');
- }
- };
- IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
- for (var i = 0; i < this._sections.length; i++) {
- var section = this._sections[i];
- if (section.consumer._findSourceIndex(util.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
- };
- };
- 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.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);
- }
- 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$1(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
- quickSort$1(this.__originalMappings, util.compareByOriginalPositions);
- };
- var IndexedSourceMapConsumer_1 = IndexedSourceMapConsumer;
- var sourceMapConsumer = {
- SourceMapConsumer: SourceMapConsumer_1,
- BasicSourceMapConsumer: BasicSourceMapConsumer_1,
- IndexedSourceMapConsumer: IndexedSourceMapConsumer_1
- };
- var SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
- var REGEX_NEWLINE = /(\r?\n)/;
- var NEWLINE_CODE = 10;
- var isSourceNode = "$$$isSourceNode$$$";
- function SourceNode(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);
- }
- SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
- var node = new SourceNode();
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
- var remainingLinesIndex = 0;
- var shiftNextLine = function shiftNextLine() {
- var lineContents = getNextLine();
- var newLine = getNextLine() || "";
- return lineContents + newLine;
- function getNextLine() {
- return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined;
- }
- };
- var lastGeneratedLine = 1,
- lastGeneratedColumn = 0;
- var lastMapping = null;
- aSourceMapConsumer.eachMapping(function (mapping) {
- if (lastMapping !== null) {
- if (lastGeneratedLine < mapping.generatedLine) {
- addMappingWithCode(lastMapping, shiftNextLine());
- lastGeneratedLine++;
- lastGeneratedColumn = 0;
- } else {
- 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);
- lastMapping = mapping;
- return;
- }
- }
- 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);
- if (remainingLinesIndex < remainingLines.length) {
- if (lastMapping) {
- addMappingWithCode(lastMapping, shiftNextLine());
- }
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
- }
- aSourceMapConsumer.sources.forEach(function (sourceFile) {
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
- if (content != null) {
- if (aRelativePath != null) {
- sourceFile = util.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.join(aRelativePath, mapping.source) : mapping.source;
- node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
- }
- }
- };
- SourceNode.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;
- };
- SourceNode.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;
- };
- SourceNode.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
- });
- }
- }
- }
- };
- SourceNode.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;
- };
- SourceNode.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;
- };
- SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
- };
- SourceNode.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.fromSetString(sources[i]), this.sourceContents[sources[i]]);
- }
- };
- SourceNode.prototype.toString = function SourceNode_toString() {
- var str = "";
- this.walk(function (chunk) {
- str += chunk;
- });
- return str;
- };
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
- var generated = {
- code: "",
- line: 1,
- column: 0
- };
- var map = new SourceMapGenerator$1(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;
- 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;
- var sourceNode = {
- SourceNode: SourceNode_1
- };
- var SourceMapGenerator$2 = sourceMapGenerator.SourceMapGenerator;
- var SourceMapConsumer$1 = sourceMapConsumer.SourceMapConsumer;
- var SourceNode$1 = sourceNode.SourceNode;
- var sourceMap = {
- SourceMapGenerator: SourceMapGenerator$2,
- SourceMapConsumer: SourceMapConsumer$1,
- SourceNode: SourceNode$1
- };
- var SourceMap = function () {
- function SourceMap(opts, code) {
- this._cachedMap = null;
- this._code = code;
- this._opts = opts;
- this._rawMappings = [];
- }
- var _proto = SourceMap.prototype;
- _proto.get = function get() {
- if (!this._cachedMap) {
- var map = this._cachedMap = new sourceMap.SourceMapGenerator({
- sourceRoot: this._opts.sourceRoot
- });
- var code = this._code;
- if (typeof code === "string") {
- map.setSourceContent(this._opts.sourceFileName.replace(/\\/g, "/"), code);
- } else if (typeof code === "object") {
- Object.keys(code).forEach(function (sourceFileName) {
- map.setSourceContent(sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
- });
- }
- this._rawMappings.forEach(function (mapping) {
- return map.addMapping(mapping);
- }, map);
- }
- return this._cachedMap.toJSON();
- };
- _proto.getRawMappings = function getRawMappings() {
- return this._rawMappings.slice();
- };
- _proto.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename, force) {
- if (this._lastGenLine !== generatedLine && line === null) return;
- if (!force && this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
- return;
- }
- this._cachedMap = null;
- this._lastGenLine = generatedLine;
- this._lastSourceLine = line;
- this._lastSourceColumn = column;
- this._rawMappings.push({
- name: identifierName || undefined,
- generated: {
- line: generatedLine,
- column: generatedColumn
- },
- source: line == null ? undefined : (filename || this._opts.sourceFileName).replace(/\\/g, "/"),
- original: line == null ? undefined : {
- line: line,
- column: column
- }
- });
- };
- return SourceMap;
- }();
- function isInteger(value) {
- return typeof value == 'number' && value == toInteger_1(value);
- }
- var isInteger_1 = isInteger;
- var SPACES_RE = /^[ \t]+$/;
- var Buffer = function () {
- function Buffer(map) {
- this._map = null;
- this._buf = [];
- this._last = "";
- this._queue = [];
- this._position = {
- line: 1,
- column: 0
- };
- this._sourcePosition = {
- identifierName: null,
- line: null,
- column: null,
- filename: null
- };
- this._disallowedPop = null;
- this._map = map;
- }
- var _proto = Buffer.prototype;
- _proto.get = function get() {
- this._flush();
- var map = this._map;
- var result = {
- code: this._buf.join("").trimRight(),
- map: null,
- rawMappings: map && map.getRawMappings()
- };
- if (map) {
- Object.defineProperty(result, "map", {
- configurable: true,
- enumerable: true,
- get: function get() {
- return this.map = map.get();
- },
- set: function set(value) {
- Object.defineProperty(this, "map", {
- value: value,
- writable: true
- });
- }
- });
- }
- return result;
- };
- _proto.append = function append(str) {
- this._flush();
- var _this$_sourcePosition = this._sourcePosition,
- line = _this$_sourcePosition.line,
- column = _this$_sourcePosition.column,
- filename = _this$_sourcePosition.filename,
- identifierName = _this$_sourcePosition.identifierName,
- force = _this$_sourcePosition.force;
- this._append(str, line, column, identifierName, filename, force);
- };
- _proto.queue = function queue(str) {
- if (str === "\n") {
- while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
- this._queue.shift();
- }
- }
- var _this$_sourcePosition2 = this._sourcePosition,
- line = _this$_sourcePosition2.line,
- column = _this$_sourcePosition2.column,
- filename = _this$_sourcePosition2.filename,
- identifierName = _this$_sourcePosition2.identifierName,
- force = _this$_sourcePosition2.force;
- this._queue.unshift([str, line, column, identifierName, filename, force]);
- };
- _proto._flush = function _flush() {
- var item;
- while (item = this._queue.pop()) {
- this._append.apply(this, item);
- }
- };
- _proto._append = function _append(str, line, column, identifierName, filename, force) {
- if (this._map && str[0] !== "\n") {
- this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
- }
- this._buf.push(str);
- this._last = str[str.length - 1];
- for (var i = 0; i < str.length; i++) {
- if (str[i] === "\n") {
- this._position.line++;
- this._position.column = 0;
- } else {
- this._position.column++;
- }
- }
- };
- _proto.removeTrailingNewline = function removeTrailingNewline() {
- if (this._queue.length > 0 && this._queue[0][0] === "\n") {
- this._queue.shift();
- }
- };
- _proto.removeLastSemicolon = function removeLastSemicolon() {
- if (this._queue.length > 0 && this._queue[0][0] === ";") {
- this._queue.shift();
- }
- };
- _proto.endsWith = function endsWith(suffix) {
- if (suffix.length === 1) {
- var last;
- if (this._queue.length > 0) {
- var str = this._queue[0][0];
- last = str[str.length - 1];
- } else {
- last = this._last;
- }
- return last === suffix;
- }
- var end = this._last + this._queue.reduce(function (acc, item) {
- return item[0] + acc;
- }, "");
- if (suffix.length <= end.length) {
- return end.slice(-suffix.length) === suffix;
- }
- return false;
- };
- _proto.hasContent = function hasContent() {
- return this._queue.length > 0 || !!this._last;
- };
- _proto.exactSource = function exactSource(loc, cb) {
- this.source("start", loc, true);
- cb();
- this.source("end", loc);
- this._disallowPop("start", loc);
- };
- _proto.source = function source(prop, loc, force) {
- if (prop && !loc) return;
- this._normalizePosition(prop, loc, this._sourcePosition, force);
- };
- _proto.withSource = function withSource(prop, loc, cb) {
- if (!this._map) return cb();
- var originalLine = this._sourcePosition.line;
- var originalColumn = this._sourcePosition.column;
- var originalFilename = this._sourcePosition.filename;
- var originalIdentifierName = this._sourcePosition.identifierName;
- this.source(prop, loc);
- cb();
- if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
- this._sourcePosition.line = originalLine;
- this._sourcePosition.column = originalColumn;
- this._sourcePosition.filename = originalFilename;
- this._sourcePosition.identifierName = originalIdentifierName;
- this._sourcePosition.force = false;
- this._disallowedPop = null;
- }
- };
- _proto._disallowPop = function _disallowPop(prop, loc) {
- if (prop && !loc) return;
- this._disallowedPop = this._normalizePosition(prop, loc);
- };
- _proto._normalizePosition = function _normalizePosition(prop, loc, targetObj, force) {
- var pos = loc ? loc[prop] : null;
- if (targetObj === undefined) {
- targetObj = {
- identifierName: null,
- line: null,
- column: null,
- filename: null,
- force: false
- };
- }
- var origLine = targetObj.line;
- var origColumn = targetObj.column;
- var origFilename = targetObj.filename;
- targetObj.identifierName = prop === "start" && loc && loc.identifierName || null;
- targetObj.line = pos ? pos.line : null;
- targetObj.column = pos ? pos.column : null;
- targetObj.filename = loc && loc.filename || null;
- if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
- targetObj.force = force;
- }
- return targetObj;
- };
- _proto.getCurrentColumn = function getCurrentColumn() {
- var extra = this._queue.reduce(function (acc, item) {
- return item[0] + acc;
- }, "");
- var lastIndex = extra.lastIndexOf("\n");
- return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
- };
- _proto.getCurrentLine = function getCurrentLine() {
- var extra = this._queue.reduce(function (acc, item) {
- return item[0] + acc;
- }, "");
- var count = 0;
- for (var i = 0; i < extra.length; i++) {
- if (extra[i] === "\n") count++;
- }
- return this._position.line + count;
- };
- return Buffer;
- }();
- function crawl(node, state) {
- if (state === void 0) {
- state = {};
- }
- if (isMemberExpression(node)) {
- crawl(node.object, state);
- if (node.computed) crawl(node.property, state);
- } else if (isBinary(node) || isAssignmentExpression(node)) {
- crawl(node.left, state);
- crawl(node.right, state);
- } else if (isCallExpression(node)) {
- state.hasCall = true;
- crawl(node.callee, state);
- } else if (isFunction(node)) {
- state.hasFunction = true;
- } else if (isIdentifier(node)) {
- state.hasHelper = state.hasHelper || isHelper(node.callee);
- }
- return state;
- }
- function isHelper(node) {
- if (isMemberExpression(node)) {
- return isHelper(node.object) || isHelper(node.property);
- } else if (isIdentifier(node)) {
- return node.name === "require" || node.name[0] === "_";
- } else if (isCallExpression(node)) {
- return isHelper(node.callee);
- } else if (isBinary(node) || isAssignmentExpression(node)) {
- return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
- } else {
- return false;
- }
- }
- function isType$1(node) {
- return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node);
- }
- var nodes = {
- AssignmentExpression: function AssignmentExpression(node) {
- var state = crawl(node.right);
- if (state.hasCall && state.hasHelper || state.hasFunction) {
- return {
- before: state.hasFunction,
- after: true
- };
- }
- },
- SwitchCase: function SwitchCase(node, parent) {
- return {
- before: node.consequent.length || parent.cases[0] === node,
- after: !node.consequent.length && parent.cases[parent.cases.length - 1] === node
- };
- },
- LogicalExpression: function LogicalExpression(node) {
- if (isFunction(node.left) || isFunction(node.right)) {
- return {
- after: true
- };
- }
- },
- Literal: function Literal(node) {
- if (node.value === "use strict") {
- return {
- after: true
- };
- }
- },
- CallExpression: function CallExpression(node) {
- if (isFunction(node.callee) || isHelper(node)) {
- return {
- before: true,
- after: true
- };
- }
- },
- VariableDeclaration: function VariableDeclaration(node) {
- for (var i = 0; i < node.declarations.length; i++) {
- var declar = node.declarations[i];
- var enabled = isHelper(declar.id) && !isType$1(declar.init);
- if (!enabled) {
- var state = crawl(declar.init);
- enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
- }
- if (enabled) {
- return {
- before: true,
- after: true
- };
- }
- }
- },
- IfStatement: function IfStatement(node) {
- if (isBlockStatement(node.consequent)) {
- return {
- before: true,
- after: true
- };
- }
- }
- };
- nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) {
- if (parent.properties[0] === node) {
- return {
- before: true
- };
- }
- };
- nodes.ObjectTypeCallProperty = function (node, parent) {
- if (parent.callProperties[0] === node && (!parent.properties || !parent.properties.length)) {
- return {
- before: true
- };
- }
- };
- nodes.ObjectTypeIndexer = function (node, parent) {
- if (parent.indexers[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length)) {
- return {
- before: true
- };
- }
- };
- nodes.ObjectTypeInternalSlot = function (node, parent) {
- if (parent.internalSlots[0] === node && (!parent.properties || !parent.properties.length) && (!parent.callProperties || !parent.callProperties.length) && (!parent.indexers || !parent.indexers.length)) {
- return {
- before: true
- };
- }
- };
- var list = {
- VariableDeclaration: function VariableDeclaration(node) {
- return node.declarations.map(function (decl) {
- return decl.init;
- });
- },
- ArrayExpression: function ArrayExpression(node) {
- return node.elements;
- },
- ObjectExpression: function ObjectExpression(node) {
- return node.properties;
- }
- };
- [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) {
- var type = _ref[0],
- amounts = _ref[1];
- if (typeof amounts === "boolean") {
- amounts = {
- after: amounts,
- before: amounts
- };
- }
- [type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
- nodes[type] = function () {
- return amounts;
- };
- });
- });
- var PRECEDENCE = {
- "||": 0,
- "&&": 1,
- "|": 2,
- "^": 3,
- "&": 4,
- "==": 5,
- "===": 5,
- "!=": 5,
- "!==": 5,
- "<": 6,
- ">": 6,
- "<=": 6,
- ">=": 6,
- "in": 6,
- "instanceof": 6,
- ">>": 7,
- "<<": 7,
- ">>>": 7,
- "+": 8,
- "-": 8,
- "*": 9,
- "/": 9,
- "%": 9,
- "**": 10
- };
- var isClassExtendsClause = function isClassExtendsClause(node, parent) {
- return (isClassDeclaration(parent) || isClassExpression(parent)) && parent.superClass === node;
- };
- function NullableTypeAnnotation$1(node, parent) {
- return isArrayTypeAnnotation(parent);
- }
- function FunctionTypeAnnotation$1(node, parent, printStack) {
- return isUnionTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isArrayTypeAnnotation(parent) || isTypeAnnotation(parent) && isArrowFunctionExpression(printStack[printStack.length - 3]);
- }
- function UpdateExpression$1(node, parent) {
- return isMemberExpression(parent, {
- object: node
- }) || isCallExpression(parent, {
- callee: node
- }) || isNewExpression(parent, {
- callee: node
- }) || isClassExtendsClause(node, parent);
- }
- function ObjectExpression$1(node, parent, printStack) {
- return isFirstInStatement(printStack, {
- considerArrow: true
- });
- }
- function DoExpression$1(node, parent, printStack) {
- return isFirstInStatement(printStack);
- }
- function Binary(node, parent) {
- if (node.operator === "**" && isBinaryExpression(parent, {
- operator: "**"
- })) {
- return parent.left === node;
- }
- if (isClassExtendsClause(node, parent)) {
- return true;
- }
- if ((isCallExpression(parent) || isNewExpression(parent)) && parent.callee === node || isUnaryLike(parent) || isMemberExpression(parent) && parent.object === node || isAwaitExpression(parent)) {
- return true;
- }
- if (isBinary(parent)) {
- var parentOp = parent.operator;
- var parentPos = PRECEDENCE[parentOp];
- var nodeOp = node.operator;
- var nodePos = PRECEDENCE[nodeOp];
- if (parentPos === nodePos && parent.right === node && !isLogicalExpression(parent) || parentPos > nodePos) {
- return true;
- }
- }
- return false;
- }
- function UnionTypeAnnotation$1(node, parent) {
- return isArrayTypeAnnotation(parent) || isNullableTypeAnnotation(parent) || isIntersectionTypeAnnotation(parent) || isUnionTypeAnnotation(parent);
- }
- function TSAsExpression$1() {
- return true;
- }
- function TSTypeAssertion$1() {
- return true;
- }
- function TSUnionType$1(node, parent) {
- return isTSArrayType(parent) || isTSOptionalType(parent) || isTSIntersectionType(parent) || isTSUnionType(parent) || isTSRestType(parent);
- }
- function BinaryExpression$1(node, parent) {
- return node.operator === "in" && (isVariableDeclarator(parent) || isFor(parent));
- }
- function SequenceExpression$1(node, parent) {
- if (isForStatement(parent) || isThrowStatement(parent) || isReturnStatement(parent) || isIfStatement(parent) && parent.test === node || isWhileStatement(parent) && parent.test === node || isForInStatement(parent) && parent.right === node || isSwitchStatement(parent) && parent.discriminant === node || isExpressionStatement(parent) && parent.expression === node) {
- return false;
- }
- return true;
- }
- function YieldExpression$1(node, parent) {
- return isBinary(parent) || isUnaryLike(parent) || isCallExpression(parent) || isMemberExpression(parent) || isNewExpression(parent) || isAwaitExpression(parent) && isYieldExpression(node) || isConditionalExpression(parent) && node === parent.test || isClassExtendsClause(node, parent);
- }
- function ClassExpression$1(node, parent, printStack) {
- return isFirstInStatement(printStack, {
- considerDefaultExports: true
- });
- }
- function UnaryLike(node, parent) {
- return isMemberExpression(parent, {
- object: node
- }) || isCallExpression(parent, {
- callee: node
- }) || isNewExpression(parent, {
- callee: node
- }) || isBinaryExpression(parent, {
- operator: "**",
- left: node
- }) || isClassExtendsClause(node, parent);
- }
- function FunctionExpression$1(node, parent, printStack) {
- return isFirstInStatement(printStack, {
- considerDefaultExports: true
- });
- }
- function ArrowFunctionExpression$1(node, parent) {
- return isExportDeclaration(parent) || ConditionalExpression$1(node, parent);
- }
- function ConditionalExpression$1(node, parent) {
- if (isUnaryLike(parent) || isBinary(parent) || isConditionalExpression(parent, {
- test: node
- }) || isAwaitExpression(parent) || isOptionalMemberExpression(parent) || isTaggedTemplateExpression(parent) || isTSTypeAssertion(parent) || isTSAsExpression(parent)) {
- return true;
- }
- return UnaryLike(node, parent);
- }
- function OptionalMemberExpression$1(node, parent) {
- return isCallExpression(parent) || isMemberExpression(parent);
- }
- function AssignmentExpression$1(node) {
- if (isObjectPattern(node.left)) {
- return true;
- } else {
- return ConditionalExpression$1.apply(void 0, arguments);
- }
- }
- function NewExpression$1(node, parent) {
- return isClassExtendsClause(node, parent);
- }
- function isFirstInStatement(printStack, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$considerArrow = _ref.considerArrow,
- considerArrow = _ref$considerArrow === void 0 ? false : _ref$considerArrow,
- _ref$considerDefaultE = _ref.considerDefaultExports,
- considerDefaultExports = _ref$considerDefaultE === void 0 ? false : _ref$considerDefaultE;
- var i = printStack.length - 1;
- var node = printStack[i];
- i--;
- var parent = printStack[i];
- while (i > 0) {
- if (isExpressionStatement(parent, {
- expression: node
- }) || isTaggedTemplateExpression(parent) || considerDefaultExports && isExportDefaultDeclaration(parent, {
- declaration: node
- }) || considerArrow && isArrowFunctionExpression(parent, {
- body: node
- })) {
- return true;
- }
- if (isCallExpression(parent, {
- callee: node
- }) || isSequenceExpression(parent) && parent.expressions[0] === node || isMemberExpression(parent, {
- object: node
- }) || isConditional(parent, {
- test: node
- }) || isBinary(parent, {
- left: node
- }) || isAssignmentExpression(parent, {
- left: node
- })) {
- node = parent;
- i--;
- parent = printStack[i];
- } else {
- return false;
- }
- }
- return false;
- }
- var parens = /*#__PURE__*/Object.freeze({
- __proto__: null,
- NullableTypeAnnotation: NullableTypeAnnotation$1,
- FunctionTypeAnnotation: FunctionTypeAnnotation$1,
- UpdateExpression: UpdateExpression$1,
- ObjectExpression: ObjectExpression$1,
- DoExpression: DoExpression$1,
- Binary: Binary,
- UnionTypeAnnotation: UnionTypeAnnotation$1,
- IntersectionTypeAnnotation: UnionTypeAnnotation$1,
- TSAsExpression: TSAsExpression$1,
- TSTypeAssertion: TSTypeAssertion$1,
- TSUnionType: TSUnionType$1,
- TSIntersectionType: TSUnionType$1,
- BinaryExpression: BinaryExpression$1,
- SequenceExpression: SequenceExpression$1,
- YieldExpression: YieldExpression$1,
- AwaitExpression: YieldExpression$1,
- ClassExpression: ClassExpression$1,
- UnaryLike: UnaryLike,
- FunctionExpression: FunctionExpression$1,
- ArrowFunctionExpression: ArrowFunctionExpression$1,
- ConditionalExpression: ConditionalExpression$1,
- OptionalMemberExpression: OptionalMemberExpression$1,
- AssignmentExpression: AssignmentExpression$1,
- NewExpression: NewExpression$1
- });
- function expandAliases(obj) {
- var newObj = {};
- function add(type, func) {
- var fn = newObj[type];
- newObj[type] = fn ? function (node, parent, stack) {
- var result = fn(node, parent, stack);
- return result == null ? func(node, parent, stack) : result;
- } : func;
- }
- for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {
- var type = _Object$keys[_i];
- var aliases = FLIPPED_ALIAS_KEYS[type];
- if (aliases) {
- for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i2 >= _iterator.length) break;
- _ref = _iterator[_i2++];
- } else {
- _i2 = _iterator.next();
- if (_i2.done) break;
- _ref = _i2.value;
- }
- var alias = _ref;
- add(alias, obj[type]);
- }
- } else {
- add(type, obj[type]);
- }
- }
- return newObj;
- }
- var expandedParens = expandAliases(parens);
- var expandedWhitespaceNodes = expandAliases(nodes);
- var expandedWhitespaceList = expandAliases(list);
- function find(obj, node, parent, printStack) {
- var fn = obj[node.type];
- return fn ? fn(node, parent, printStack) : null;
- }
- function isOrHasCallExpression(node) {
- if (isCallExpression(node)) {
- return true;
- }
- if (isMemberExpression(node)) {
- return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property);
- } else {
- return false;
- }
- }
- function needsWhitespace(node, parent, type) {
- if (!node) return 0;
- if (isExpressionStatement(node)) {
- node = node.expression;
- }
- var linesInfo = find(expandedWhitespaceNodes, node, parent);
- if (!linesInfo) {
- var items = find(expandedWhitespaceList, node, parent);
- if (items) {
- for (var i = 0; i < items.length; i++) {
- linesInfo = needsWhitespace(items[i], node, type);
- if (linesInfo) break;
- }
- }
- }
- if (typeof linesInfo === "object" && linesInfo !== null) {
- return linesInfo[type] || 0;
- }
- return 0;
- }
- function needsWhitespaceBefore(node, parent) {
- return needsWhitespace(node, parent, "before");
- }
- function needsWhitespaceAfter(node, parent) {
- return needsWhitespace(node, parent, "after");
- }
- function needsParens(node, parent, printStack) {
- if (!parent) return false;
- if (isNewExpression(parent) && parent.callee === node) {
- if (isOrHasCallExpression(node)) return true;
- }
- if (isLogicalExpression(node) && parent.operator === "??") return true;
- return find(expandedParens, node, parent, printStack);
- }
- function TaggedTemplateExpression$1(node) {
- this.print(node.tag, node);
- this.print(node.typeParameters, node);
- this.print(node.quasi, node);
- }
- function TemplateElement$1(node, parent) {
- var isFirst = parent.quasis[0] === node;
- var isLast = parent.quasis[parent.quasis.length - 1] === node;
- var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
- this.token(value);
- }
- function TemplateLiteral$1(node) {
- var quasis = node.quasis;
- for (var i = 0; i < quasis.length; i++) {
- this.print(quasis[i], node);
- if (i + 1 < quasis.length) {
- this.print(node.expressions[i], node);
- }
- }
- }
- function UnaryExpression$1(node) {
- if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
- this.word(node.operator);
- this.space();
- } else {
- this.token(node.operator);
- }
- this.print(node.argument, node);
- }
- function DoExpression$2(node) {
- this.word("do");
- this.space();
- this.print(node.body, node);
- }
- function ParenthesizedExpression$1(node) {
- this.token("(");
- this.print(node.expression, node);
- this.token(")");
- }
- function UpdateExpression$2(node) {
- if (node.prefix) {
- this.token(node.operator);
- this.print(node.argument, node);
- } else {
- this.startTerminatorless(true);
- this.print(node.argument, node);
- this.endTerminatorless();
- this.token(node.operator);
- }
- }
- function ConditionalExpression$2(node) {
- this.print(node.test, node);
- this.space();
- this.token("?");
- this.space();
- this.print(node.consequent, node);
- this.space();
- this.token(":");
- this.space();
- this.print(node.alternate, node);
- }
- function NewExpression$2(node, parent) {
- this.word("new");
- this.space();
- this.print(node.callee, node);
- if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
- callee: node
- }) && !isMemberExpression(parent) && !isNewExpression(parent)) {
- return;
- }
- this.print(node.typeArguments, node);
- this.print(node.typeParameters, node);
- if (node.optional) {
- this.token("?.");
- }
- this.token("(");
- this.printList(node.arguments, node);
- this.token(")");
- }
- function SequenceExpression$2(node) {
- this.printList(node.expressions, node);
- }
- function ThisExpression$1() {
- this.word("this");
- }
- function Super$1() {
- this.word("super");
- }
- function Decorator$1(node) {
- this.token("@");
- this.print(node.expression, node);
- this.newline();
- }
- function OptionalMemberExpression$2(node) {
- this.print(node.object, node);
- if (!node.computed && isMemberExpression(node.property)) {
- throw new TypeError("Got a MemberExpression for MemberExpression property");
- }
- var computed = node.computed;
- if (isLiteral(node.property) && typeof node.property.value === "number") {
- computed = true;
- }
- if (node.optional) {
- this.token("?.");
- }
- if (computed) {
- this.token("[");
- this.print(node.property, node);
- this.token("]");
- } else {
- if (!node.optional) {
- this.token(".");
- }
- this.print(node.property, node);
- }
- }
- function OptionalCallExpression$1(node) {
- this.print(node.callee, node);
- this.print(node.typeArguments, node);
- this.print(node.typeParameters, node);
- if (node.optional) {
- this.token("?.");
- }
- this.token("(");
- this.printList(node.arguments, node);
- this.token(")");
- }
- function CallExpression$1(node) {
- this.print(node.callee, node);
- this.print(node.typeArguments, node);
- this.print(node.typeParameters, node);
- this.token("(");
- this.printList(node.arguments, node);
- this.token(")");
- }
- function Import$1() {
- this.word("import");
- }
- function buildYieldAwait(keyword) {
- return function (node) {
- this.word(keyword);
- if (node.delegate) {
- this.token("*");
- }
- if (node.argument) {
- this.space();
- var terminatorState = this.startTerminatorless();
- this.print(node.argument, node);
- this.endTerminatorless(terminatorState);
- }
- };
- }
- var YieldExpression$2 = buildYieldAwait("yield");
- var AwaitExpression$1 = buildYieldAwait("await");
- function EmptyStatement$1() {
- this.semicolon(true);
- }
- function ExpressionStatement$1(node) {
- this.print(node.expression, node);
- this.semicolon();
- }
- function AssignmentPattern$1(node) {
- this.print(node.left, node);
- if (node.left.optional) this.token("?");
- this.print(node.left.typeAnnotation, node);
- this.space();
- this.token("=");
- this.space();
- this.print(node.right, node);
- }
- function AssignmentExpression$2(node, parent) {
- var parens = this.inForStatementInitCounter && node.operator === "in" && !needsParens(node, parent);
- if (parens) {
- this.token("(");
- }
- this.print(node.left, node);
- this.space();
- if (node.operator === "in" || node.operator === "instanceof") {
- this.word(node.operator);
- } else {
- this.token(node.operator);
- }
- this.space();
- this.print(node.right, node);
- if (parens) {
- this.token(")");
- }
- }
- function BindExpression$1(node) {
- this.print(node.object, node);
- this.token("::");
- this.print(node.callee, node);
- }
- function MemberExpression$1(node) {
- this.print(node.object, node);
- if (!node.computed && isMemberExpression(node.property)) {
- throw new TypeError("Got a MemberExpression for MemberExpression property");
- }
- var computed = node.computed;
- if (isLiteral(node.property) && typeof node.property.value === "number") {
- computed = true;
- }
- if (computed) {
- this.token("[");
- this.print(node.property, node);
- this.token("]");
- } else {
- this.token(".");
- this.print(node.property, node);
- }
- }
- function MetaProperty$1(node) {
- this.print(node.meta, node);
- this.token(".");
- this.print(node.property, node);
- }
- function PrivateName$1(node) {
- this.token("#");
- this.print(node.id, node);
- }
- function V8IntrinsicIdentifier$1(node) {
- this.token("%");
- this.word(node.name);
- }
- function WithStatement$1(node) {
- this.word("with");
- this.space();
- this.token("(");
- this.print(node.object, node);
- this.token(")");
- this.printBlock(node);
- }
- function IfStatement$1(node) {
- this.word("if");
- this.space();
- this.token("(");
- this.print(node.test, node);
- this.token(")");
- this.space();
- var needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent));
- if (needsBlock) {
- this.token("{");
- this.newline();
- this.indent();
- }
- this.printAndIndentOnComments(node.consequent, node);
- if (needsBlock) {
- this.dedent();
- this.newline();
- this.token("}");
- }
- if (node.alternate) {
- if (this.endsWith("}")) this.space();
- this.word("else");
- this.space();
- this.printAndIndentOnComments(node.alternate, node);
- }
- }
- function getLastStatement(statement) {
- if (!isStatement(statement.body)) return statement;
- return getLastStatement(statement.body);
- }
- function ForStatement$1(node) {
- this.word("for");
- this.space();
- this.token("(");
- this.inForStatementInitCounter++;
- this.print(node.init, node);
- this.inForStatementInitCounter--;
- this.token(";");
- if (node.test) {
- this.space();
- this.print(node.test, node);
- }
- this.token(";");
- if (node.update) {
- this.space();
- this.print(node.update, node);
- }
- this.token(")");
- this.printBlock(node);
- }
- function WhileStatement$1(node) {
- this.word("while");
- this.space();
- this.token("(");
- this.print(node.test, node);
- this.token(")");
- this.printBlock(node);
- }
- var buildForXStatement = function buildForXStatement(op) {
- return function (node) {
- this.word("for");
- this.space();
- if (op === "of" && node["await"]) {
- this.word("await");
- this.space();
- }
- this.token("(");
- this.print(node.left, node);
- this.space();
- this.word(op);
- this.space();
- this.print(node.right, node);
- this.token(")");
- this.printBlock(node);
- };
- };
- var ForInStatement$1 = buildForXStatement("in");
- var ForOfStatement$1 = buildForXStatement("of");
- function DoWhileStatement$1(node) {
- this.word("do");
- this.space();
- this.print(node.body, node);
- this.space();
- this.word("while");
- this.space();
- this.token("(");
- this.print(node.test, node);
- this.token(")");
- this.semicolon();
- }
- function buildLabelStatement(prefix, key) {
- if (key === void 0) {
- key = "label";
- }
- return function (node) {
- this.word(prefix);
- var label = node[key];
- if (label) {
- this.space();
- var isLabel = key == "label";
- var terminatorState = this.startTerminatorless(isLabel);
- this.print(label, node);
- this.endTerminatorless(terminatorState);
- }
- this.semicolon();
- };
- }
- var ContinueStatement$1 = buildLabelStatement("continue");
- var ReturnStatement$1 = buildLabelStatement("return", "argument");
- var BreakStatement$1 = buildLabelStatement("break");
- var ThrowStatement$1 = buildLabelStatement("throw", "argument");
- function LabeledStatement$1(node) {
- this.print(node.label, node);
- this.token(":");
- this.space();
- this.print(node.body, node);
- }
- function TryStatement$1(node) {
- this.word("try");
- this.space();
- this.print(node.block, node);
- this.space();
- if (node.handlers) {
- this.print(node.handlers[0], node);
- } else {
- this.print(node.handler, node);
- }
- if (node.finalizer) {
- this.space();
- this.word("finally");
- this.space();
- this.print(node.finalizer, node);
- }
- }
- function CatchClause$1(node) {
- this.word("catch");
- this.space();
- if (node.param) {
- this.token("(");
- this.print(node.param, node);
- this.token(")");
- this.space();
- }
- this.print(node.body, node);
- }
- function SwitchStatement$1(node) {
- this.word("switch");
- this.space();
- this.token("(");
- this.print(node.discriminant, node);
- this.token(")");
- this.space();
- this.token("{");
- this.printSequence(node.cases, node, {
- indent: true,
- addNewlines: function addNewlines(leading, cas) {
- if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
- }
- });
- this.token("}");
- }
- function SwitchCase$1(node) {
- if (node.test) {
- this.word("case");
- this.space();
- this.print(node.test, node);
- this.token(":");
- } else {
- this.word("default");
- this.token(":");
- }
- if (node.consequent.length) {
- this.newline();
- this.printSequence(node.consequent, node, {
- indent: true
- });
- }
- }
- function DebuggerStatement$1() {
- this.word("debugger");
- this.semicolon();
- }
- function variableDeclarationIndent() {
- this.token(",");
- this.newline();
- if (this.endsWith("\n")) for (var i = 0; i < 4; i++) {
- this.space(true);
- }
- }
- function constDeclarationIndent() {
- this.token(",");
- this.newline();
- if (this.endsWith("\n")) for (var i = 0; i < 6; i++) {
- this.space(true);
- }
- }
- function VariableDeclaration$1(node, parent) {
- if (node.declare) {
- this.word("declare");
- this.space();
- }
- this.word(node.kind);
- this.space();
- var hasInits = false;
- if (!isFor(parent)) {
- for (var _i = 0, _arr = node.declarations; _i < _arr.length; _i++) {
- var declar = _arr[_i];
- if (declar.init) {
- hasInits = true;
- }
- }
- }
- var separator;
- if (hasInits) {
- separator = node.kind === "const" ? constDeclarationIndent : variableDeclarationIndent;
- }
- this.printList(node.declarations, node, {
- separator: separator
- });
- if (isFor(parent)) {
- if (parent.left === node || parent.init === node) return;
- }
- this.semicolon();
- }
- function VariableDeclarator$1(node) {
- this.print(node.id, node);
- if (node.definite) this.token("!");
- this.print(node.id.typeAnnotation, node);
- if (node.init) {
- this.space();
- this.token("=");
- this.space();
- this.print(node.init, node);
- }
- }
- function ClassDeclaration$1(node, parent) {
- if (!this.format.decoratorsBeforeExport || !isExportDefaultDeclaration(parent) && !isExportNamedDeclaration(parent)) {
- this.printJoin(node.decorators, node);
- }
- if (node.declare) {
- this.word("declare");
- this.space();
- }
- if (node["abstract"]) {
- this.word("abstract");
- this.space();
- }
- this.word("class");
- if (node.id) {
- this.space();
- this.print(node.id, node);
- }
- this.print(node.typeParameters, node);
- if (node.superClass) {
- this.space();
- this.word("extends");
- this.space();
- this.print(node.superClass, node);
- this.print(node.superTypeParameters, node);
- }
- if (node["implements"]) {
- this.space();
- this.word("implements");
- this.space();
- this.printList(node["implements"], node);
- }
- this.space();
- this.print(node.body, node);
- }
- function ClassBody$1(node) {
- this.token("{");
- this.printInnerComments(node);
- if (node.body.length === 0) {
- this.token("}");
- } else {
- this.newline();
- this.indent();
- this.printSequence(node.body, node);
- this.dedent();
- if (!this.endsWith("\n")) this.newline();
- this.rightBrace();
- }
- }
- function ClassProperty$1(node) {
- this.printJoin(node.decorators, node);
- this.tsPrintClassMemberModifiers(node, true);
- if (node.computed) {
- this.token("[");
- this.print(node.key, node);
- this.token("]");
- } else {
- this._variance(node);
- this.print(node.key, node);
- }
- if (node.optional) {
- this.token("?");
- }
- if (node.definite) {
- this.token("!");
- }
- this.print(node.typeAnnotation, node);
- if (node.value) {
- this.space();
- this.token("=");
- this.space();
- this.print(node.value, node);
- }
- this.semicolon();
- }
- function ClassPrivateProperty$1(node) {
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- this.print(node.key, node);
- this.print(node.typeAnnotation, node);
- if (node.value) {
- this.space();
- this.token("=");
- this.space();
- this.print(node.value, node);
- }
- this.semicolon();
- }
- function ClassMethod$1(node) {
- this._classMethodHead(node);
- this.space();
- this.print(node.body, node);
- }
- function ClassPrivateMethod$1(node) {
- this._classMethodHead(node);
- this.space();
- this.print(node.body, node);
- }
- function _classMethodHead(node) {
- this.printJoin(node.decorators, node);
- this.tsPrintClassMemberModifiers(node, false);
- this._methodHead(node);
- }
- function _params(node) {
- this.print(node.typeParameters, node);
- this.token("(");
- this._parameters(node.params, node);
- this.token(")");
- this.print(node.returnType, node);
- }
- function _parameters(parameters, parent) {
- for (var i = 0; i < parameters.length; i++) {
- this._param(parameters[i], parent);
- if (i < parameters.length - 1) {
- this.token(",");
- this.space();
- }
- }
- }
- function _param(parameter, parent) {
- this.printJoin(parameter.decorators, parameter);
- this.print(parameter, parent);
- if (parameter.optional) this.token("?");
- this.print(parameter.typeAnnotation, parameter);
- }
- function _methodHead(node) {
- var kind = node.kind;
- var key = node.key;
- if (kind === "get" || kind === "set") {
- this.word(kind);
- this.space();
- }
- if (node.async) {
- this.word("async");
- this.space();
- }
- if (kind === "method" || kind === "init") {
- if (node.generator) {
- this.token("*");
- }
- }
- if (node.computed) {
- this.token("[");
- this.print(key, node);
- this.token("]");
- } else {
- this.print(key, node);
- }
- if (node.optional) {
- this.token("?");
- }
- this._params(node);
- }
- function _predicate(node) {
- if (node.predicate) {
- if (!node.returnType) {
- this.token(":");
- }
- this.space();
- this.print(node.predicate, node);
- }
- }
- function _functionHead(node) {
- if (node.async) {
- this.word("async");
- this.space();
- }
- this.word("function");
- if (node.generator) this.token("*");
- this.space();
- if (node.id) {
- this.print(node.id, node);
- }
- this._params(node);
- this._predicate(node);
- }
- function FunctionExpression$2(node) {
- this._functionHead(node);
- this.space();
- this.print(node.body, node);
- }
- function ArrowFunctionExpression$2(node) {
- if (node.async) {
- this.word("async");
- this.space();
- }
- var firstParam = node.params[0];
- if (node.params.length === 1 && isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
- if (this.format.retainLines && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
- this.token("(");
- if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
- this.indent();
- this.print(firstParam, node);
- this.dedent();
- this._catchUp("start", node.body.loc);
- } else {
- this.print(firstParam, node);
- }
- this.token(")");
- } else {
- this.print(firstParam, node);
- }
- } else {
- this._params(node);
- }
- this._predicate(node);
- this.space();
- this.token("=>");
- this.space();
- this.print(node.body, node);
- }
- function hasTypes(node, param) {
- return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
- }
- function ImportSpecifier$1(node) {
- if (node.importKind === "type" || node.importKind === "typeof") {
- this.word(node.importKind);
- this.space();
- }
- this.print(node.imported, node);
- if (node.local && node.local.name !== node.imported.name) {
- this.space();
- this.word("as");
- this.space();
- this.print(node.local, node);
- }
- }
- function ImportDefaultSpecifier$1(node) {
- this.print(node.local, node);
- }
- function ExportDefaultSpecifier$1(node) {
- this.print(node.exported, node);
- }
- function ExportSpecifier$1(node) {
- this.print(node.local, node);
- if (node.exported && node.local.name !== node.exported.name) {
- this.space();
- this.word("as");
- this.space();
- this.print(node.exported, node);
- }
- }
- function ExportNamespaceSpecifier$1(node) {
- this.token("*");
- this.space();
- this.word("as");
- this.space();
- this.print(node.exported, node);
- }
- function ExportAllDeclaration$1(node) {
- this.word("export");
- this.space();
- if (node.exportKind === "type") {
- this.word("type");
- this.space();
- }
- this.token("*");
- this.space();
- this.word("from");
- this.space();
- this.print(node.source, node);
- this.semicolon();
- }
- function ExportNamedDeclaration$1(node) {
- if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
- this.printJoin(node.declaration.decorators, node);
- }
- this.word("export");
- this.space();
- ExportDeclaration.apply(this, arguments);
- }
- function ExportDefaultDeclaration$1(node) {
- if (this.format.decoratorsBeforeExport && isClassDeclaration(node.declaration)) {
- this.printJoin(node.declaration.decorators, node);
- }
- this.word("export");
- this.space();
- this.word("default");
- this.space();
- ExportDeclaration.apply(this, arguments);
- }
- function ExportDeclaration(node) {
- if (node.declaration) {
- var declar = node.declaration;
- this.print(declar, node);
- if (!isStatement(declar)) this.semicolon();
- } else {
- if (node.exportKind === "type") {
- this.word("type");
- this.space();
- }
- var specifiers = node.specifiers.slice(0);
- var hasSpecial = false;
- while (true) {
- var first = specifiers[0];
- if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
- hasSpecial = true;
- this.print(specifiers.shift(), node);
- if (specifiers.length) {
- this.token(",");
- this.space();
- }
- } else {
- break;
- }
- }
- if (specifiers.length || !specifiers.length && !hasSpecial) {
- this.token("{");
- if (specifiers.length) {
- this.space();
- this.printList(specifiers, node);
- this.space();
- }
- this.token("}");
- }
- if (node.source) {
- this.space();
- this.word("from");
- this.space();
- this.print(node.source, node);
- }
- this.semicolon();
- }
- }
- function ImportDeclaration$1(node) {
- this.word("import");
- this.space();
- if (node.importKind === "type" || node.importKind === "typeof") {
- this.word(node.importKind);
- this.space();
- }
- var specifiers = node.specifiers.slice(0);
- if (specifiers && specifiers.length) {
- while (true) {
- var first = specifiers[0];
- if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) {
- this.print(specifiers.shift(), node);
- if (specifiers.length) {
- this.token(",");
- this.space();
- }
- } else {
- break;
- }
- }
- if (specifiers.length) {
- this.token("{");
- this.space();
- this.printList(specifiers, node);
- this.space();
- this.token("}");
- }
- this.space();
- this.word("from");
- this.space();
- }
- this.print(node.source, node);
- this.semicolon();
- }
- function ImportNamespaceSpecifier$1(node) {
- this.token("*");
- this.space();
- this.word("as");
- this.space();
- this.print(node.local, node);
- }
- var lookup = [];
- var revLookup = [];
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
- var inited = false;
- function init() {
- inited = true;
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i];
- revLookup[code.charCodeAt(i)] = i;
- }
- revLookup['-'.charCodeAt(0)] = 62;
- revLookup['_'.charCodeAt(0)] = 63;
- }
- function toByteArray(b64) {
- if (!inited) {
- init();
- }
- var i, j, l, tmp, placeHolders, arr;
- var len = b64.length;
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4');
- }
- placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
- arr = new Arr(len * 3 / 4 - placeHolders);
- l = placeHolders > 0 ? len - 4 : len;
- var L = 0;
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
- tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
- arr[L++] = tmp >> 16 & 0xFF;
- arr[L++] = tmp >> 8 & 0xFF;
- arr[L++] = tmp & 0xFF;
- }
- if (placeHolders === 2) {
- tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
- arr[L++] = tmp & 0xFF;
- } else if (placeHolders === 1) {
- tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
- arr[L++] = tmp >> 8 & 0xFF;
- arr[L++] = tmp & 0xFF;
- }
- return arr;
- }
- function tripletToBase64(num) {
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
- }
- function encodeChunk(uint8, start, end) {
- var tmp;
- var output = [];
- for (var i = start; i < end; i += 3) {
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
- output.push(tripletToBase64(tmp));
- }
- return output.join('');
- }
- function fromByteArray(uint8) {
- if (!inited) {
- init();
- }
- var tmp;
- var len = uint8.length;
- var extraBytes = len % 3;
- var output = '';
- var parts = [];
- var maxChunkLength = 16383;
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
- }
- if (extraBytes === 1) {
- tmp = uint8[len - 1];
- output += lookup[tmp >> 2];
- output += lookup[tmp << 4 & 0x3F];
- output += '==';
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1];
- output += lookup[tmp >> 10];
- output += lookup[tmp >> 4 & 0x3F];
- output += lookup[tmp << 2 & 0x3F];
- output += '=';
- }
- parts.push(output);
- return parts.join('');
- }
- function read(buffer, offset, isLE, mLen, nBytes) {
- var e, m;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var nBits = -7;
- var i = isLE ? nBytes - 1 : 0;
- var d = isLE ? -1 : 1;
- var s = buffer[offset + i];
- i += d;
- e = s & (1 << -nBits) - 1;
- s >>= -nBits;
- nBits += eLen;
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
- m = e & (1 << -nBits) - 1;
- e >>= -nBits;
- nBits += mLen;
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
- if (e === 0) {
- e = 1 - eBias;
- } else if (e === eMax) {
- return m ? NaN : (s ? -1 : 1) * Infinity;
- } else {
- m = m + Math.pow(2, mLen);
- e = e - eBias;
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
- }
- function write(buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c;
- var eLen = nBytes * 8 - mLen - 1;
- var eMax = (1 << eLen) - 1;
- var eBias = eMax >> 1;
- var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
- var i = isLE ? 0 : nBytes - 1;
- var d = isLE ? 1 : -1;
- var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
- value = Math.abs(value);
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0;
- e = eMax;
- } else {
- e = Math.floor(Math.log(value) / Math.LN2);
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--;
- c *= 2;
- }
- if (e + eBias >= 1) {
- value += rt / c;
- } else {
- value += rt * Math.pow(2, 1 - eBias);
- }
- if (value * c >= 2) {
- e++;
- c /= 2;
- }
- if (e + eBias >= eMax) {
- m = 0;
- e = eMax;
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen);
- e = e + eBias;
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
- e = 0;
- }
- }
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
- e = e << mLen | m;
- eLen += mLen;
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
- buffer[offset + i - d] |= s * 128;
- }
- var toString$1 = {}.toString;
- var isArray$1 = Array.isArray || function (arr) {
- return toString$1.call(arr) == '[object Array]';
- };
- var INSPECT_MAX_BYTES = 50;
- Buffer$1.TYPED_ARRAY_SUPPORT = global$1.TYPED_ARRAY_SUPPORT !== undefined ? global$1.TYPED_ARRAY_SUPPORT : true;
- var _kMaxLength = kMaxLength();
- function kMaxLength() {
- return Buffer$1.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
- }
- function createBuffer(that, length) {
- if (kMaxLength() < length) {
- throw new RangeError('Invalid typed array length');
- }
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- that = new Uint8Array(length);
- that.__proto__ = Buffer$1.prototype;
- } else {
- if (that === null) {
- that = new Buffer$1(length);
- }
- that.length = length;
- }
- return that;
- }
- function Buffer$1(arg, encodingOrOffset, length) {
- if (!Buffer$1.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer$1)) {
- return new Buffer$1(arg, encodingOrOffset, length);
- }
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new Error('If encoding is specified then the first argument must be a string');
- }
- return allocUnsafe(this, arg);
- }
- return from(this, arg, encodingOrOffset, length);
- }
- Buffer$1.poolSize = 8192;
- Buffer$1._augment = function (arr) {
- arr.__proto__ = Buffer$1.prototype;
- return arr;
- };
- function from(that, value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number');
- }
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- return fromArrayBuffer(that, value, encodingOrOffset, length);
- }
- if (typeof value === 'string') {
- return fromString(that, value, encodingOrOffset);
- }
- return fromObject(that, value);
- }
- Buffer$1.from = function (value, encodingOrOffset, length) {
- return from(null, value, encodingOrOffset, length);
- };
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- Buffer$1.prototype.__proto__ = Uint8Array.prototype;
- Buffer$1.__proto__ = Uint8Array;
- }
- function assertSize(size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be a number');
- } else if (size < 0) {
- throw new RangeError('"size" argument must not be negative');
- }
- }
- function alloc(that, size, fill, encoding) {
- assertSize(size);
- if (size <= 0) {
- return createBuffer(that, size);
- }
- if (fill !== undefined) {
- return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
- }
- return createBuffer(that, size);
- }
- Buffer$1.alloc = function (size, fill, encoding) {
- return alloc(null, size, fill, encoding);
- };
- function allocUnsafe(that, size) {
- assertSize(size);
- that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
- if (!Buffer$1.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < size; ++i) {
- that[i] = 0;
- }
- }
- return that;
- }
- Buffer$1.allocUnsafe = function (size) {
- return allocUnsafe(null, size);
- };
- Buffer$1.allocUnsafeSlow = function (size) {
- return allocUnsafe(null, size);
- };
- function fromString(that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8';
- }
- if (!Buffer$1.isEncoding(encoding)) {
- throw new TypeError('"encoding" must be a valid string encoding');
- }
- var length = byteLength(string, encoding) | 0;
- that = createBuffer(that, length);
- var actual = that.write(string, encoding);
- if (actual !== length) {
- that = that.slice(0, actual);
- }
- return that;
- }
- function fromArrayLike(that, array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0;
- that = createBuffer(that, length);
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255;
- }
- return that;
- }
- function fromArrayBuffer(that, array, byteOffset, length) {
- array.byteLength;
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('\'offset\' is out of bounds');
- }
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('\'length\' is out of bounds');
- }
- if (byteOffset === undefined && length === undefined) {
- array = new Uint8Array(array);
- } else if (length === undefined) {
- array = new Uint8Array(array, byteOffset);
- } else {
- array = new Uint8Array(array, byteOffset, length);
- }
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- that = array;
- that.__proto__ = Buffer$1.prototype;
- } else {
- that = fromArrayLike(that, array);
- }
- return that;
- }
- function fromObject(that, obj) {
- if (internalIsBuffer(obj)) {
- var len = checked(obj.length) | 0;
- that = createBuffer(that, len);
- if (that.length === 0) {
- return that;
- }
- obj.copy(that, 0, 0, len);
- return that;
- }
- if (obj) {
- if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
- if (typeof obj.length !== 'number' || isnan(obj.length)) {
- return createBuffer(that, 0);
- }
- return fromArrayLike(that, obj);
- }
- if (obj.type === 'Buffer' && isArray$1(obj.data)) {
- return fromArrayLike(that, obj.data);
- }
- }
- throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
- }
- function checked(length) {
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
- }
- return length | 0;
- }
- function SlowBuffer(length) {
- if (+length != length) {
- length = 0;
- }
- return Buffer$1.alloc(+length);
- }
- Buffer$1.isBuffer = isBuffer;
- function internalIsBuffer(b) {
- return !!(b != null && b._isBuffer);
- }
- Buffer$1.compare = function compare(a, b) {
- if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
- throw new TypeError('Arguments must be Buffers');
- }
- 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;
- };
- Buffer$1.isEncoding = function isEncoding(encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true;
- default:
- return false;
- }
- };
- Buffer$1.concat = function concat(list, length) {
- if (!isArray$1(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers');
- }
- if (list.length === 0) {
- return Buffer$1.alloc(0);
- }
- var i;
- if (length === undefined) {
- length = 0;
- for (i = 0; i < list.length; ++i) {
- length += list[i].length;
- }
- }
- var buffer = Buffer$1.allocUnsafe(length);
- var pos = 0;
- for (i = 0; i < list.length; ++i) {
- var buf = list[i];
- if (!internalIsBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers');
- }
- buf.copy(buffer, pos);
- pos += buf.length;
- }
- return buffer;
- };
- function byteLength(string, encoding) {
- if (internalIsBuffer(string)) {
- return string.length;
- }
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
- return string.byteLength;
- }
- if (typeof string !== 'string') {
- string = '' + string;
- }
- var len = string.length;
- if (len === 0) return 0;
- var loweredCase = false;
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len;
- case 'utf8':
- case 'utf-8':
- case undefined:
- return utf8ToBytes(string).length;
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2;
- case 'hex':
- return len >>> 1;
- case 'base64':
- return base64ToBytes(string).length;
- default:
- if (loweredCase) return utf8ToBytes(string).length;
- encoding = ('' + encoding).toLowerCase();
- loweredCase = true;
- }
- }
- }
- Buffer$1.byteLength = byteLength;
- function slowToString(encoding, start, end) {
- var loweredCase = false;
- if (start === undefined || start < 0) {
- start = 0;
- }
- if (start > this.length) {
- return '';
- }
- if (end === undefined || end > this.length) {
- end = this.length;
- }
- if (end <= 0) {
- return '';
- }
- end >>>= 0;
- start >>>= 0;
- if (end <= start) {
- return '';
- }
- if (!encoding) encoding = 'utf8';
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end);
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end);
- case 'ascii':
- return asciiSlice(this, start, end);
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end);
- case 'base64':
- return base64Slice(this, start, end);
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end);
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
- encoding = (encoding + '').toLowerCase();
- loweredCase = true;
- }
- }
- }
- Buffer$1.prototype._isBuffer = true;
- function swap$1(b, n, m) {
- var i = b[n];
- b[n] = b[m];
- b[m] = i;
- }
- Buffer$1.prototype.swap16 = function swap16() {
- var len = this.length;
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits');
- }
- for (var i = 0; i < len; i += 2) {
- swap$1(this, i, i + 1);
- }
- return this;
- };
- Buffer$1.prototype.swap32 = function swap32() {
- var len = this.length;
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits');
- }
- for (var i = 0; i < len; i += 4) {
- swap$1(this, i, i + 3);
- swap$1(this, i + 1, i + 2);
- }
- return this;
- };
- Buffer$1.prototype.swap64 = function swap64() {
- var len = this.length;
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits');
- }
- for (var i = 0; i < len; i += 8) {
- swap$1(this, i, i + 7);
- swap$1(this, i + 1, i + 6);
- swap$1(this, i + 2, i + 5);
- swap$1(this, i + 3, i + 4);
- }
- return this;
- };
- Buffer$1.prototype.toString = function toString() {
- var length = this.length | 0;
- if (length === 0) return '';
- if (arguments.length === 0) return utf8Slice(this, 0, length);
- return slowToString.apply(this, arguments);
- };
- Buffer$1.prototype.equals = function equals(b) {
- if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer');
- if (this === b) return true;
- return Buffer$1.compare(this, b) === 0;
- };
- Buffer$1.prototype.inspect = function inspect() {
- var str = '';
- var max = INSPECT_MAX_BYTES;
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
- if (this.length > max) str += ' ... ';
- }
- return '<Buffer ' + str + '>';
- };
- Buffer$1.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
- if (!internalIsBuffer(target)) {
- throw new TypeError('Argument must be a Buffer');
- }
- if (start === undefined) {
- start = 0;
- }
- if (end === undefined) {
- end = target ? target.length : 0;
- }
- if (thisStart === undefined) {
- thisStart = 0;
- }
- if (thisEnd === undefined) {
- thisEnd = this.length;
- }
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index');
- }
- if (thisStart >= thisEnd && start >= end) {
- return 0;
- }
- if (thisStart >= thisEnd) {
- return -1;
- }
- if (start >= end) {
- return 1;
- }
- start >>>= 0;
- end >>>= 0;
- thisStart >>>= 0;
- thisEnd >>>= 0;
- if (this === target) return 0;
- var x = thisEnd - thisStart;
- var y = end - start;
- var len = Math.min(x, y);
- var thisCopy = this.slice(thisStart, thisEnd);
- var targetCopy = target.slice(start, end);
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i];
- y = targetCopy[i];
- break;
- }
- }
- if (x < y) return -1;
- if (y < x) return 1;
- return 0;
- };
- function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
- if (buffer.length === 0) return -1;
- if (typeof byteOffset === 'string') {
- encoding = byteOffset;
- byteOffset = 0;
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff;
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000;
- }
- byteOffset = +byteOffset;
- if (isNaN(byteOffset)) {
- byteOffset = dir ? 0 : buffer.length - 1;
- }
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
- if (byteOffset >= buffer.length) {
- if (dir) return -1;else byteOffset = buffer.length - 1;
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0;else return -1;
- }
- if (typeof val === 'string') {
- val = Buffer$1.from(val, encoding);
- }
- if (internalIsBuffer(val)) {
- if (val.length === 0) {
- return -1;
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
- } else if (typeof val === 'number') {
- val = val & 0xFF;
- if (Buffer$1.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
- }
- }
- return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
- }
- throw new TypeError('val must be string, number or Buffer');
- }
- function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
- var indexSize = 1;
- var arrLength = arr.length;
- var valLength = val.length;
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase();
- if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1;
- }
- indexSize = 2;
- arrLength /= 2;
- valLength /= 2;
- byteOffset /= 2;
- }
- }
- function read(buf, i) {
- if (indexSize === 1) {
- return buf[i];
- } else {
- return buf.readUInt16BE(i * indexSize);
- }
- }
- var i;
- if (dir) {
- var foundIndex = -1;
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i;
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
- } else {
- if (foundIndex !== -1) i -= i - foundIndex;
- foundIndex = -1;
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
- for (i = byteOffset; i >= 0; i--) {
- var found = true;
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false;
- break;
- }
- }
- if (found) return i;
- }
- }
- return -1;
- }
- Buffer$1.prototype.includes = function includes(val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1;
- };
- Buffer$1.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
- };
- Buffer$1.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
- };
- function hexWrite(buf, string, offset, length) {
- offset = Number(offset) || 0;
- var remaining = buf.length - offset;
- if (!length) {
- length = remaining;
- } else {
- length = Number(length);
- if (length > remaining) {
- length = remaining;
- }
- }
- var strLen = string.length;
- if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
- if (length > strLen / 2) {
- length = strLen / 2;
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16);
- if (isNaN(parsed)) return i;
- buf[offset + i] = parsed;
- }
- return i;
- }
- function utf8Write(buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
- }
- function asciiWrite(buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length);
- }
- function latin1Write(buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length);
- }
- function base64Write(buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length);
- }
- function ucs2Write(buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
- }
- Buffer$1.prototype.write = function write(string, offset, length, encoding) {
- if (offset === undefined) {
- encoding = 'utf8';
- length = this.length;
- offset = 0;
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset;
- length = this.length;
- offset = 0;
- } else if (isFinite(offset)) {
- offset = offset | 0;
- if (isFinite(length)) {
- length = length | 0;
- if (encoding === undefined) encoding = 'utf8';
- } else {
- encoding = length;
- length = undefined;
- }
- } else {
- throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
- }
- var remaining = this.length - offset;
- if (length === undefined || length > remaining) length = remaining;
- if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds');
- }
- if (!encoding) encoding = 'utf8';
- var loweredCase = false;
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length);
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length);
- case 'ascii':
- return asciiWrite(this, string, offset, length);
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length);
- case 'base64':
- return base64Write(this, string, offset, length);
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length);
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
- encoding = ('' + encoding).toLowerCase();
- loweredCase = true;
- }
- }
- };
- Buffer$1.prototype.toJSON = function toJSON() {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- };
- };
- function base64Slice(buf, start, end) {
- if (start === 0 && end === buf.length) {
- return fromByteArray(buf);
- } else {
- return fromByteArray(buf.slice(start, end));
- }
- }
- function utf8Slice(buf, start, end) {
- end = Math.min(buf.length, end);
- var res = [];
- var i = start;
- while (i < end) {
- var firstByte = buf[i];
- var codePoint = null;
- var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint;
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte;
- }
- break;
- case 2:
- secondByte = buf[i + 1];
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint;
- }
- }
- break;
- case 3:
- secondByte = buf[i + 1];
- thirdByte = buf[i + 2];
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint;
- }
- }
- break;
- case 4:
- secondByte = buf[i + 1];
- thirdByte = buf[i + 2];
- fourthByte = buf[i + 3];
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint;
- }
- }
- }
- }
- if (codePoint === null) {
- codePoint = 0xFFFD;
- bytesPerSequence = 1;
- } else if (codePoint > 0xFFFF) {
- codePoint -= 0x10000;
- res.push(codePoint >>> 10 & 0x3FF | 0xD800);
- codePoint = 0xDC00 | codePoint & 0x3FF;
- }
- res.push(codePoint);
- i += bytesPerSequence;
- }
- return decodeCodePointsArray(res);
- }
- var MAX_ARGUMENTS_LENGTH = 0x1000;
- function decodeCodePointsArray(codePoints) {
- var len = codePoints.length;
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints);
- }
- var res = '';
- var i = 0;
- while (i < len) {
- res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
- }
- return res;
- }
- function asciiSlice(buf, start, end) {
- var ret = '';
- end = Math.min(buf.length, end);
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F);
- }
- return ret;
- }
- function latin1Slice(buf, start, end) {
- var ret = '';
- end = Math.min(buf.length, end);
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i]);
- }
- return ret;
- }
- function hexSlice(buf, start, end) {
- var len = buf.length;
- if (!start || start < 0) start = 0;
- if (!end || end < 0 || end > len) end = len;
- var out = '';
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i]);
- }
- return out;
- }
- function utf16leSlice(buf, start, end) {
- var bytes = buf.slice(start, end);
- var res = '';
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
- }
- return res;
- }
- Buffer$1.prototype.slice = function slice(start, end) {
- var len = this.length;
- start = ~~start;
- end = end === undefined ? len : ~~end;
- if (start < 0) {
- start += len;
- if (start < 0) start = 0;
- } else if (start > len) {
- start = len;
- }
- if (end < 0) {
- end += len;
- if (end < 0) end = 0;
- } else if (end > len) {
- end = len;
- }
- if (end < start) end = start;
- var newBuf;
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- newBuf = this.subarray(start, end);
- newBuf.__proto__ = Buffer$1.prototype;
- } else {
- var sliceLen = end - start;
- newBuf = new Buffer$1(sliceLen, undefined);
- for (var i = 0; i < sliceLen; ++i) {
- newBuf[i] = this[i + start];
- }
- }
- return newBuf;
- };
- function checkOffset(offset, ext, length) {
- if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
- }
- Buffer$1.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) checkOffset(offset, byteLength, this.length);
- var val = this[offset];
- var mul = 1;
- var i = 0;
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul;
- }
- return val;
- };
- Buffer$1.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length);
- }
- var val = this[offset + --byteLength];
- var mul = 1;
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul;
- }
- return val;
- };
- Buffer$1.prototype.readUInt8 = function readUInt8(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length);
- return this[offset];
- };
- Buffer$1.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length);
- return this[offset] | this[offset + 1] << 8;
- };
- Buffer$1.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length);
- return this[offset] << 8 | this[offset + 1];
- };
- Buffer$1.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
- };
- Buffer$1.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
- };
- Buffer$1.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) checkOffset(offset, byteLength, this.length);
- var val = this[offset];
- var mul = 1;
- var i = 0;
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul;
- }
- mul *= 0x80;
- if (val >= mul) val -= Math.pow(2, 8 * byteLength);
- return val;
- };
- Buffer$1.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) checkOffset(offset, byteLength, this.length);
- var i = byteLength;
- var mul = 1;
- var val = this[offset + --i];
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul;
- }
- mul *= 0x80;
- if (val >= mul) val -= Math.pow(2, 8 * byteLength);
- return val;
- };
- Buffer$1.prototype.readInt8 = function readInt8(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length);
- if (!(this[offset] & 0x80)) return this[offset];
- return (0xff - this[offset] + 1) * -1;
- };
- Buffer$1.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length);
- var val = this[offset] | this[offset + 1] << 8;
- return val & 0x8000 ? val | 0xFFFF0000 : val;
- };
- Buffer$1.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length);
- var val = this[offset + 1] | this[offset] << 8;
- return val & 0x8000 ? val | 0xFFFF0000 : val;
- };
- Buffer$1.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
- };
- Buffer$1.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
- };
- Buffer$1.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return read(this, offset, true, 23, 4);
- };
- Buffer$1.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length);
- return read(this, offset, false, 23, 4);
- };
- Buffer$1.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length);
- return read(this, offset, true, 52, 8);
- };
- Buffer$1.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length);
- return read(this, offset, false, 52, 8);
- };
- function checkInt(buf, value, offset, ext, max, min) {
- if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
- if (offset + ext > buf.length) throw new RangeError('Index out of range');
- }
- Buffer$1.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
- value = +value;
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1;
- checkInt(this, value, offset, byteLength, maxBytes, 0);
- }
- var mul = 1;
- var i = 0;
- this[offset] = value & 0xFF;
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = value / mul & 0xFF;
- }
- return offset + byteLength;
- };
- Buffer$1.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
- value = +value;
- offset = offset | 0;
- byteLength = byteLength | 0;
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1;
- checkInt(this, value, offset, byteLength, maxBytes, 0);
- }
- var i = byteLength - 1;
- var mul = 1;
- this[offset + i] = value & 0xFF;
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = value / mul & 0xFF;
- }
- return offset + byteLength;
- };
- Buffer$1.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
- if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
- this[offset] = value & 0xff;
- return offset + 1;
- };
- function objectWriteUInt16(buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1;
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
- buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
- }
- }
- Buffer$1.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value & 0xff;
- this[offset + 1] = value >>> 8;
- } else {
- objectWriteUInt16(this, value, offset, true);
- }
- return offset + 2;
- };
- Buffer$1.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value >>> 8;
- this[offset + 1] = value & 0xff;
- } else {
- objectWriteUInt16(this, value, offset, false);
- }
- return offset + 2;
- };
- function objectWriteUInt32(buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1;
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
- buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
- }
- }
- Buffer$1.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = value >>> 24;
- this[offset + 2] = value >>> 16;
- this[offset + 1] = value >>> 8;
- this[offset] = value & 0xff;
- } else {
- objectWriteUInt32(this, value, offset, true);
- }
- return offset + 4;
- };
- Buffer$1.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value >>> 24;
- this[offset + 1] = value >>> 16;
- this[offset + 2] = value >>> 8;
- this[offset + 3] = value & 0xff;
- } else {
- objectWriteUInt32(this, value, offset, false);
- }
- return offset + 4;
- };
- Buffer$1.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1);
- checkInt(this, value, offset, byteLength, limit - 1, -limit);
- }
- var i = 0;
- var mul = 1;
- var sub = 0;
- this[offset] = value & 0xFF;
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1;
- }
- this[offset + i] = (value / mul >> 0) - sub & 0xFF;
- }
- return offset + byteLength;
- };
- Buffer$1.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1);
- checkInt(this, value, offset, byteLength, limit - 1, -limit);
- }
- var i = byteLength - 1;
- var mul = 1;
- var sub = 0;
- this[offset + i] = value & 0xFF;
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1;
- }
- this[offset + i] = (value / mul >> 0) - sub & 0xFF;
- }
- return offset + byteLength;
- };
- Buffer$1.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
- if (!Buffer$1.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
- if (value < 0) value = 0xff + value + 1;
- this[offset] = value & 0xff;
- return offset + 1;
- };
- Buffer$1.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value & 0xff;
- this[offset + 1] = value >>> 8;
- } else {
- objectWriteUInt16(this, value, offset, true);
- }
- return offset + 2;
- };
- Buffer$1.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value >>> 8;
- this[offset + 1] = value & 0xff;
- } else {
- objectWriteUInt16(this, value, offset, false);
- }
- return offset + 2;
- };
- Buffer$1.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value & 0xff;
- this[offset + 1] = value >>> 8;
- this[offset + 2] = value >>> 16;
- this[offset + 3] = value >>> 24;
- } else {
- objectWriteUInt32(this, value, offset, true);
- }
- return offset + 4;
- };
- Buffer$1.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
- value = +value;
- offset = offset | 0;
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
- if (value < 0) value = 0xffffffff + value + 1;
- if (Buffer$1.TYPED_ARRAY_SUPPORT) {
- this[offset] = value >>> 24;
- this[offset + 1] = value >>> 16;
- this[offset + 2] = value >>> 8;
- this[offset + 3] = value & 0xff;
- } else {
- objectWriteUInt32(this, value, offset, false);
- }
- return offset + 4;
- };
- function checkIEEE754(buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range');
- if (offset < 0) throw new RangeError('Index out of range');
- }
- function writeFloat(buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4);
- }
- write(buf, value, offset, littleEndian, 23, 4);
- return offset + 4;
- }
- Buffer$1.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert);
- };
- Buffer$1.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert);
- };
- function writeDouble(buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8);
- }
- write(buf, value, offset, littleEndian, 52, 8);
- return offset + 8;
- }
- Buffer$1.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert);
- };
- Buffer$1.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert);
- };
- Buffer$1.prototype.copy = function copy(target, targetStart, start, end) {
- if (!start) start = 0;
- if (!end && end !== 0) end = this.length;
- if (targetStart >= target.length) targetStart = target.length;
- if (!targetStart) targetStart = 0;
- if (end > 0 && end < start) end = start;
- if (end === start) return 0;
- if (target.length === 0 || this.length === 0) return 0;
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds');
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
- if (end < 0) throw new RangeError('sourceEnd out of bounds');
- if (end > this.length) end = this.length;
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start;
- }
- var len = end - start;
- var i;
- if (this === target && start < targetStart && targetStart < end) {
- for (i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start];
- }
- } else if (len < 1000 || !Buffer$1.TYPED_ARRAY_SUPPORT) {
- for (i = 0; i < len; ++i) {
- target[i + targetStart] = this[i + start];
- }
- } else {
- Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
- }
- return len;
- };
- Buffer$1.prototype.fill = function fill(val, start, end, encoding) {
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start;
- start = 0;
- end = this.length;
- } else if (typeof end === 'string') {
- encoding = end;
- end = this.length;
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0);
- if (code < 256) {
- val = code;
- }
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string');
- }
- if (typeof encoding === 'string' && !Buffer$1.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding);
- }
- } else if (typeof val === 'number') {
- val = val & 255;
- }
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index');
- }
- if (end <= start) {
- return this;
- }
- start = start >>> 0;
- end = end === undefined ? this.length : end >>> 0;
- if (!val) val = 0;
- var i;
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val;
- }
- } else {
- var bytes = internalIsBuffer(val) ? val : utf8ToBytes(new Buffer$1(val, encoding).toString());
- var len = bytes.length;
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len];
- }
- }
- return this;
- };
- var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
- function base64clean(str) {
- str = stringtrim(str).replace(INVALID_BASE64_RE, '');
- if (str.length < 2) return '';
- while (str.length % 4 !== 0) {
- str = str + '=';
- }
- return str;
- }
- function stringtrim(str) {
- if (str.trim) return str.trim();
- return str.replace(/^\s+|\s+$/g, '');
- }
- function toHex(n) {
- if (n < 16) return '0' + n.toString(16);
- return n.toString(16);
- }
- function utf8ToBytes(string, units) {
- units = units || Infinity;
- var codePoint;
- var length = string.length;
- var leadSurrogate = null;
- var bytes = [];
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i);
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- if (!leadSurrogate) {
- if (codePoint > 0xDBFF) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
- continue;
- } else if (i + 1 === length) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
- continue;
- }
- leadSurrogate = codePoint;
- continue;
- }
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
- leadSurrogate = codePoint;
- continue;
- }
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
- } else if (leadSurrogate) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
- }
- leadSurrogate = null;
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break;
- bytes.push(codePoint);
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break;
- bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break;
- bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break;
- bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
- } else {
- throw new Error('Invalid code point');
- }
- }
- return bytes;
- }
- function asciiToBytes(str) {
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- byteArray.push(str.charCodeAt(i) & 0xFF);
- }
- return byteArray;
- }
- function utf16leToBytes(str, units) {
- var c, hi, lo;
- var byteArray = [];
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break;
- c = str.charCodeAt(i);
- hi = c >> 8;
- lo = c % 256;
- byteArray.push(lo);
- byteArray.push(hi);
- }
- return byteArray;
- }
- function base64ToBytes(str) {
- return toByteArray(base64clean(str));
- }
- function blitBuffer(src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if (i + offset >= dst.length || i >= src.length) break;
- dst[i + offset] = src[i];
- }
- return i;
- }
- function isnan(val) {
- return val !== val;
- }
- function isBuffer(obj) {
- return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));
- }
- function isFastBuffer(obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
- }
- function isSlowBuffer(obj) {
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0));
- }
- var bufferEs6 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- INSPECT_MAX_BYTES: INSPECT_MAX_BYTES,
- kMaxLength: _kMaxLength,
- Buffer: Buffer$1,
- SlowBuffer: SlowBuffer,
- isBuffer: isBuffer
- });
- var object = {};
- var hasOwnProperty$c = object.hasOwnProperty;
- var forOwn = function forOwn(object, callback) {
- for (var key in object) {
- if (hasOwnProperty$c.call(object, key)) {
- callback(key, object[key]);
- }
- }
- };
- var extend = function extend(destination, source) {
- if (!source) {
- return destination;
- }
- forOwn(source, function (key, value) {
- destination[key] = value;
- });
- return destination;
- };
- var forEach = function forEach(array, callback) {
- var length = array.length;
- var index = -1;
- while (++index < length) {
- callback(array[index]);
- }
- };
- var toString$2 = object.toString;
- var isArray$2 = Array.isArray;
- var isBuffer$1 = isBuffer;
- var isObject$1 = function isObject(value) {
- return toString$2.call(value) == '[object Object]';
- };
- var isString$1 = function isString(value) {
- return typeof value == 'string' || toString$2.call(value) == '[object String]';
- };
- var isNumber = function isNumber(value) {
- return typeof value == 'number' || toString$2.call(value) == '[object Number]';
- };
- var isFunction$2 = function isFunction(value) {
- return typeof value == 'function';
- };
- var isMap$1 = function isMap(value) {
- return toString$2.call(value) == '[object Map]';
- };
- var isSet$1 = function isSet(value) {
- return toString$2.call(value) == '[object Set]';
- };
- var singleEscapes = {
- '"': '\\"',
- '\'': '\\\'',
- '\\': '\\\\',
- '\b': '\\b',
- '\f': '\\f',
- '\n': '\\n',
- '\r': '\\r',
- '\t': '\\t'
- };
- var regexSingleEscape = /["'\\\b\f\n\r\t]/;
- var regexDigit = /[0-9]/;
- var regexWhitelist = /[ !#-&\(-\[\]-_a-~]/;
- var jsesc = function jsesc(argument, options) {
- var increaseIndentation = function increaseIndentation() {
- oldIndent = indent;
- ++options.indentLevel;
- indent = options.indent.repeat(options.indentLevel);
- };
- var defaults = {
- 'escapeEverything': false,
- 'minimal': false,
- 'isScriptContext': false,
- 'quotes': 'single',
- 'wrap': false,
- 'es6': false,
- 'json': false,
- 'compact': true,
- 'lowercaseHex': false,
- 'numbers': 'decimal',
- 'indent': '\t',
- 'indentLevel': 0,
- '__inline1__': false,
- '__inline2__': false
- };
- var json = options && options.json;
- if (json) {
- defaults.quotes = 'double';
- defaults.wrap = true;
- }
- options = extend(defaults, options);
- if (options.quotes != 'single' && options.quotes != 'double' && options.quotes != 'backtick') {
- options.quotes = 'single';
- }
- var quote = options.quotes == 'double' ? '"' : options.quotes == 'backtick' ? '`' : '\'';
- var compact = options.compact;
- var lowercaseHex = options.lowercaseHex;
- var indent = options.indent.repeat(options.indentLevel);
- var oldIndent = '';
- var inline1 = options.__inline1__;
- var inline2 = options.__inline2__;
- var newLine = compact ? '' : '\n';
- var result;
- var isEmpty = true;
- var useBinNumbers = options.numbers == 'binary';
- var useOctNumbers = options.numbers == 'octal';
- var useDecNumbers = options.numbers == 'decimal';
- var useHexNumbers = options.numbers == 'hexadecimal';
- if (json && argument && isFunction$2(argument.toJSON)) {
- argument = argument.toJSON();
- }
- if (!isString$1(argument)) {
- if (isMap$1(argument)) {
- if (argument.size == 0) {
- return 'new Map()';
- }
- if (!compact) {
- options.__inline1__ = true;
- options.__inline2__ = false;
- }
- return 'new Map(' + jsesc(Array.from(argument), options) + ')';
- }
- if (isSet$1(argument)) {
- if (argument.size == 0) {
- return 'new Set()';
- }
- return 'new Set(' + jsesc(Array.from(argument), options) + ')';
- }
- if (isBuffer$1(argument)) {
- if (argument.length == 0) {
- return 'Buffer.from([])';
- }
- return 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';
- }
- if (isArray$2(argument)) {
- result = [];
- options.wrap = true;
- if (inline1) {
- options.__inline1__ = false;
- options.__inline2__ = true;
- }
- if (!inline2) {
- increaseIndentation();
- }
- forEach(argument, function (value) {
- isEmpty = false;
- if (inline2) {
- options.__inline2__ = false;
- }
- result.push((compact || inline2 ? '' : indent) + jsesc(value, options));
- });
- if (isEmpty) {
- return '[]';
- }
- if (inline2) {
- return '[' + result.join(', ') + ']';
- }
- return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']';
- } else if (isNumber(argument)) {
- if (json) {
- return JSON.stringify(argument);
- }
- if (useDecNumbers) {
- return String(argument);
- }
- if (useHexNumbers) {
- var hexadecimal = argument.toString(16);
- if (!lowercaseHex) {
- hexadecimal = hexadecimal.toUpperCase();
- }
- return '0x' + hexadecimal;
- }
- if (useBinNumbers) {
- return '0b' + argument.toString(2);
- }
- if (useOctNumbers) {
- return '0o' + argument.toString(8);
- }
- } else if (!isObject$1(argument)) {
- if (json) {
- return JSON.stringify(argument) || 'null';
- }
- return String(argument);
- } else {
- result = [];
- options.wrap = true;
- increaseIndentation();
- forOwn(argument, function (key, value) {
- isEmpty = false;
- result.push((compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(value, options));
- });
- if (isEmpty) {
- return '{}';
- }
- return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}';
- }
- }
- var string = argument;
- var index = -1;
- var length = string.length;
- result = '';
- while (++index < length) {
- var character = string.charAt(index);
- if (options.es6) {
- var first = string.charCodeAt(index);
- if (first >= 0xD800 && first <= 0xDBFF && length > index + 1) {
- var second = string.charCodeAt(index + 1);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- var codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- var _hexadecimal2 = codePoint.toString(16);
- if (!lowercaseHex) {
- _hexadecimal2 = _hexadecimal2.toUpperCase();
- }
- result += "\\u{" + _hexadecimal2 + '}';
- ++index;
- continue;
- }
- }
- }
- if (!options.escapeEverything) {
- if (regexWhitelist.test(character)) {
- result += character;
- continue;
- }
- if (character == '"') {
- result += quote == character ? '\\"' : character;
- continue;
- }
- if (character == '`') {
- result += quote == character ? '\\`' : character;
- continue;
- }
- if (character == '\'') {
- result += quote == character ? '\\\'' : character;
- continue;
- }
- }
- if (character == '\0' && !json && !regexDigit.test(string.charAt(index + 1))) {
- result += '\\0';
- continue;
- }
- if (regexSingleEscape.test(character)) {
- result += singleEscapes[character];
- continue;
- }
- var charCode = character.charCodeAt(0);
- if (options.minimal && charCode != 0x2028 && charCode != 0x2029) {
- result += character;
- continue;
- }
- var _hexadecimal = charCode.toString(16);
- if (!lowercaseHex) {
- _hexadecimal = _hexadecimal.toUpperCase();
- }
- var longhand = _hexadecimal.length > 2 || json;
- var escaped = '\\' + (longhand ? 'u' : 'x') + ('0000' + _hexadecimal).slice(longhand ? -4 : -2);
- result += escaped;
- continue;
- }
- if (options.wrap) {
- result = quote + result + quote;
- }
- if (quote == '`') {
- result = result.replace(/\$\{/g, '\\\$\{');
- }
- if (options.isScriptContext) {
- return result.replace(/<\/(script|style)/gi, '<\\/$1').replace(/<!--/g, json ? "\\u003C!--" : '\\x3C!--');
- }
- return result;
- };
- jsesc.version = '2.5.2';
- var jsesc_1 = jsesc;
- function Identifier$1(node) {
- var _this = this;
- this.exactSource(node.loc, function () {
- _this.word(node.name);
- });
- }
- function ArgumentPlaceholder$1() {
- this.token("?");
- }
- function RestElement$1(node) {
- this.token("...");
- this.print(node.argument, node);
- }
- function ObjectExpression$2(node) {
- var props = node.properties;
- this.token("{");
- this.printInnerComments(node);
- if (props.length) {
- this.space();
- this.printList(props, node, {
- indent: true,
- statement: true
- });
- this.space();
- }
- this.token("}");
- }
- function ObjectMethod$1(node) {
- this.printJoin(node.decorators, node);
- this._methodHead(node);
- this.space();
- this.print(node.body, node);
- }
- function ObjectProperty$1(node) {
- this.printJoin(node.decorators, node);
- if (node.computed) {
- this.token("[");
- this.print(node.key, node);
- this.token("]");
- } else {
- if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) {
- this.print(node.value, node);
- return;
- }
- this.print(node.key, node);
- if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) {
- return;
- }
- }
- this.token(":");
- this.space();
- this.print(node.value, node);
- }
- function ArrayExpression$1(node) {
- var elems = node.elements;
- var len = elems.length;
- this.token("[");
- this.printInnerComments(node);
- for (var i = 0; i < elems.length; i++) {
- var elem = elems[i];
- if (elem) {
- if (i > 0) this.space();
- this.print(elem, node);
- if (i < len - 1) this.token(",");
- } else {
- this.token(",");
- }
- }
- this.token("]");
- }
- function RegExpLiteral$1(node) {
- this.word("/" + node.pattern + "/" + node.flags);
- }
- function BooleanLiteral$1(node) {
- this.word(node.value ? "true" : "false");
- }
- function NullLiteral$1() {
- this.word("null");
- }
- function NumericLiteral$1(node) {
- var raw = this.getPossibleRaw(node);
- var value = node.value + "";
- if (raw == null) {
- this.number(value);
- } else if (this.format.minified) {
- this.number(raw.length < value.length ? raw : value);
- } else {
- this.number(raw);
- }
- }
- function StringLiteral$1(node) {
- var raw = this.getPossibleRaw(node);
- if (!this.format.minified && raw != null) {
- this.token(raw);
- return;
- }
- var opts = this.format.jsescOption;
- if (this.format.jsonCompatibleStrings) {
- opts.json = true;
- }
- var val = jsesc_1(node.value, opts);
- return this.token(val);
- }
- function BigIntLiteral$1(node) {
- var raw = this.getPossibleRaw(node);
- if (!this.format.minified && raw != null) {
- this.token(raw);
- return;
- }
- this.token(node.value);
- }
- function PipelineTopicExpression$1(node) {
- this.print(node.expression, node);
- }
- function PipelineBareFunction$1(node) {
- this.print(node.callee, node);
- }
- function PipelinePrimaryTopicReference$1() {
- this.token("#");
- }
- function AnyTypeAnnotation$1() {
- this.word("any");
- }
- function ArrayTypeAnnotation$1(node) {
- this.print(node.elementType, node);
- this.token("[");
- this.token("]");
- }
- function BooleanTypeAnnotation$1() {
- this.word("boolean");
- }
- function BooleanLiteralTypeAnnotation$1(node) {
- this.word(node.value ? "true" : "false");
- }
- function NullLiteralTypeAnnotation$1() {
- this.word("null");
- }
- function DeclareClass$1(node, parent) {
- if (!isDeclareExportDeclaration(parent)) {
- this.word("declare");
- this.space();
- }
- this.word("class");
- this.space();
- this._interfaceish(node);
- }
- function DeclareFunction$1(node, parent) {
- if (!isDeclareExportDeclaration(parent)) {
- this.word("declare");
- this.space();
- }
- this.word("function");
- this.space();
- this.print(node.id, node);
- this.print(node.id.typeAnnotation.typeAnnotation, node);
- if (node.predicate) {
- this.space();
- this.print(node.predicate, node);
- }
- this.semicolon();
- }
- function InferredPredicate$1() {
- this.token("%");
- this.word("checks");
- }
- function DeclaredPredicate$1(node) {
- this.token("%");
- this.word("checks");
- this.token("(");
- this.print(node.value, node);
- this.token(")");
- }
- function DeclareInterface$1(node) {
- this.word("declare");
- this.space();
- this.InterfaceDeclaration(node);
- }
- function DeclareModule$1(node) {
- this.word("declare");
- this.space();
- this.word("module");
- this.space();
- this.print(node.id, node);
- this.space();
- this.print(node.body, node);
- }
- function DeclareModuleExports$1(node) {
- this.word("declare");
- this.space();
- this.word("module");
- this.token(".");
- this.word("exports");
- this.print(node.typeAnnotation, node);
- }
- function DeclareTypeAlias$1(node) {
- this.word("declare");
- this.space();
- this.TypeAlias(node);
- }
- function DeclareOpaqueType$1(node, parent) {
- if (!isDeclareExportDeclaration(parent)) {
- this.word("declare");
- this.space();
- }
- this.OpaqueType(node);
- }
- function DeclareVariable$1(node, parent) {
- if (!isDeclareExportDeclaration(parent)) {
- this.word("declare");
- this.space();
- }
- this.word("var");
- this.space();
- this.print(node.id, node);
- this.print(node.id.typeAnnotation, node);
- this.semicolon();
- }
- function DeclareExportDeclaration$1(node) {
- this.word("declare");
- this.space();
- this.word("export");
- this.space();
- if (node["default"]) {
- this.word("default");
- this.space();
- }
- FlowExportDeclaration.apply(this, arguments);
- }
- function DeclareExportAllDeclaration$1() {
- this.word("declare");
- this.space();
- ExportAllDeclaration$1.apply(this, arguments);
- }
- function EnumDeclaration$1(node) {
- var id = node.id,
- body = node.body;
- this.word("enum");
- this.space();
- this.print(id, node);
- this.print(body, node);
- }
- function enumExplicitType(context, name, hasExplicitType) {
- if (hasExplicitType) {
- context.space();
- context.word("of");
- context.space();
- context.word(name);
- }
- context.space();
- }
- function enumBody(context, node) {
- var members = node.members;
- context.token("{");
- context.indent();
- context.newline();
- for (var _iterator = members, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var member = _ref;
- context.print(member, node);
- context.newline();
- }
- context.dedent();
- context.token("}");
- }
- function EnumBooleanBody$1(node) {
- var explicitType = node.explicitType;
- enumExplicitType(this, "boolean", explicitType);
- enumBody(this, node);
- }
- function EnumNumberBody$1(node) {
- var explicitType = node.explicitType;
- enumExplicitType(this, "number", explicitType);
- enumBody(this, node);
- }
- function EnumStringBody$1(node) {
- var explicitType = node.explicitType;
- enumExplicitType(this, "string", explicitType);
- enumBody(this, node);
- }
- function EnumSymbolBody$1(node) {
- enumExplicitType(this, "symbol", true);
- enumBody(this, node);
- }
- function EnumDefaultedMember$1(node) {
- var id = node.id;
- this.print(id, node);
- this.token(",");
- }
- function enumInitializedMember(context, node) {
- var id = node.id,
- init = node.init;
- context.print(id, node);
- context.space();
- context.token("=");
- context.space();
- context.print(init, node);
- context.token(",");
- }
- function EnumBooleanMember$1(node) {
- enumInitializedMember(this, node);
- }
- function EnumNumberMember$1(node) {
- enumInitializedMember(this, node);
- }
- function EnumStringMember$1(node) {
- enumInitializedMember(this, node);
- }
- function FlowExportDeclaration(node) {
- if (node.declaration) {
- var declar = node.declaration;
- this.print(declar, node);
- if (!isStatement(declar)) this.semicolon();
- } else {
- this.token("{");
- if (node.specifiers.length) {
- this.space();
- this.printList(node.specifiers, node);
- this.space();
- }
- this.token("}");
- if (node.source) {
- this.space();
- this.word("from");
- this.space();
- this.print(node.source, node);
- }
- this.semicolon();
- }
- }
- function ExistsTypeAnnotation$1() {
- this.token("*");
- }
- function FunctionTypeAnnotation$2(node, parent) {
- this.print(node.typeParameters, node);
- this.token("(");
- this.printList(node.params, node);
- if (node.rest) {
- if (node.params.length) {
- this.token(",");
- this.space();
- }
- this.token("...");
- this.print(node.rest, node);
- }
- this.token(")");
- if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
- this.token(":");
- } else {
- this.space();
- this.token("=>");
- }
- this.space();
- this.print(node.returnType, node);
- }
- function FunctionTypeParam$1(node) {
- this.print(node.name, node);
- if (node.optional) this.token("?");
- if (node.name) {
- this.token(":");
- this.space();
- }
- this.print(node.typeAnnotation, node);
- }
- function InterfaceExtends$1(node) {
- this.print(node.id, node);
- this.print(node.typeParameters, node);
- }
- function _interfaceish(node) {
- this.print(node.id, node);
- this.print(node.typeParameters, node);
- if (node["extends"].length) {
- this.space();
- this.word("extends");
- this.space();
- this.printList(node["extends"], node);
- }
- if (node.mixins && node.mixins.length) {
- this.space();
- this.word("mixins");
- this.space();
- this.printList(node.mixins, node);
- }
- if (node["implements"] && node["implements"].length) {
- this.space();
- this.word("implements");
- this.space();
- this.printList(node["implements"], node);
- }
- this.space();
- this.print(node.body, node);
- }
- function _variance(node) {
- if (node.variance) {
- if (node.variance.kind === "plus") {
- this.token("+");
- } else if (node.variance.kind === "minus") {
- this.token("-");
- }
- }
- }
- function InterfaceDeclaration$1(node) {
- this.word("interface");
- this.space();
- this._interfaceish(node);
- }
- function andSeparator() {
- this.space();
- this.token("&");
- this.space();
- }
- function InterfaceTypeAnnotation$1(node) {
- this.word("interface");
- if (node["extends"] && node["extends"].length) {
- this.space();
- this.word("extends");
- this.space();
- this.printList(node["extends"], node);
- }
- this.space();
- this.print(node.body, node);
- }
- function IntersectionTypeAnnotation$1(node) {
- this.printJoin(node.types, node, {
- separator: andSeparator
- });
- }
- function MixedTypeAnnotation$1() {
- this.word("mixed");
- }
- function EmptyTypeAnnotation$1() {
- this.word("empty");
- }
- function NullableTypeAnnotation$2(node) {
- this.token("?");
- this.print(node.typeAnnotation, node);
- }
- function NumberTypeAnnotation$1() {
- this.word("number");
- }
- function StringTypeAnnotation$1() {
- this.word("string");
- }
- function ThisTypeAnnotation$1() {
- this.word("this");
- }
- function TupleTypeAnnotation$1(node) {
- this.token("[");
- this.printList(node.types, node);
- this.token("]");
- }
- function TypeofTypeAnnotation$1(node) {
- this.word("typeof");
- this.space();
- this.print(node.argument, node);
- }
- function TypeAlias$1(node) {
- this.word("type");
- this.space();
- this.print(node.id, node);
- this.print(node.typeParameters, node);
- this.space();
- this.token("=");
- this.space();
- this.print(node.right, node);
- this.semicolon();
- }
- function TypeAnnotation$1(node) {
- this.token(":");
- this.space();
- if (node.optional) this.token("?");
- this.print(node.typeAnnotation, node);
- }
- function TypeParameterInstantiation$1(node) {
- this.token("<");
- this.printList(node.params, node, {});
- this.token(">");
- }
- function TypeParameter$1(node) {
- this._variance(node);
- this.word(node.name);
- if (node.bound) {
- this.print(node.bound, node);
- }
- if (node["default"]) {
- this.space();
- this.token("=");
- this.space();
- this.print(node["default"], node);
- }
- }
- function OpaqueType$1(node) {
- this.word("opaque");
- this.space();
- this.word("type");
- this.space();
- this.print(node.id, node);
- this.print(node.typeParameters, node);
- if (node.supertype) {
- this.token(":");
- this.space();
- this.print(node.supertype, node);
- }
- if (node.impltype) {
- this.space();
- this.token("=");
- this.space();
- this.print(node.impltype, node);
- }
- this.semicolon();
- }
- function ObjectTypeAnnotation$1(node) {
- var _this = this;
- if (node.exact) {
- this.token("{|");
- } else {
- this.token("{");
- }
- var props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []);
- if (props.length) {
- this.space();
- this.printJoin(props, node, {
- addNewlines: function addNewlines(leading) {
- if (leading && !props[0]) return 1;
- },
- indent: true,
- statement: true,
- iterator: function iterator() {
- if (props.length !== 1 || node.inexact) {
- _this.token(",");
- _this.space();
- }
- }
- });
- this.space();
- }
- if (node.inexact) {
- this.indent();
- this.token("...");
- if (props.length) {
- this.newline();
- }
- this.dedent();
- }
- if (node.exact) {
- this.token("|}");
- } else {
- this.token("}");
- }
- }
- function ObjectTypeInternalSlot$1(node) {
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- this.token("[");
- this.token("[");
- this.print(node.id, node);
- this.token("]");
- this.token("]");
- if (node.optional) this.token("?");
- if (!node.method) {
- this.token(":");
- this.space();
- }
- this.print(node.value, node);
- }
- function ObjectTypeCallProperty$1(node) {
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- this.print(node.value, node);
- }
- function ObjectTypeIndexer$1(node) {
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- this._variance(node);
- this.token("[");
- if (node.id) {
- this.print(node.id, node);
- this.token(":");
- this.space();
- }
- this.print(node.key, node);
- this.token("]");
- this.token(":");
- this.space();
- this.print(node.value, node);
- }
- function ObjectTypeProperty$1(node) {
- if (node.proto) {
- this.word("proto");
- this.space();
- }
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- this._variance(node);
- this.print(node.key, node);
- if (node.optional) this.token("?");
- if (!node.method) {
- this.token(":");
- this.space();
- }
- this.print(node.value, node);
- }
- function ObjectTypeSpreadProperty$1(node) {
- this.token("...");
- this.print(node.argument, node);
- }
- function QualifiedTypeIdentifier$1(node) {
- this.print(node.qualification, node);
- this.token(".");
- this.print(node.id, node);
- }
- function orSeparator() {
- this.space();
- this.token("|");
- this.space();
- }
- function UnionTypeAnnotation$2(node) {
- this.printJoin(node.types, node, {
- separator: orSeparator
- });
- }
- function TypeCastExpression$1(node) {
- this.token("(");
- this.print(node.expression, node);
- this.print(node.typeAnnotation, node);
- this.token(")");
- }
- function Variance$1(node) {
- if (node.kind === "plus") {
- this.token("+");
- } else {
- this.token("-");
- }
- }
- function VoidTypeAnnotation$1() {
- this.word("void");
- }
- function File$1(node) {
- if (node.program) {
- this.print(node.program.interpreter, node);
- }
- this.print(node.program, node);
- }
- function Program$1(node) {
- this.printInnerComments(node, false);
- this.printSequence(node.directives, node);
- if (node.directives && node.directives.length) this.newline();
- this.printSequence(node.body, node);
- }
- function BlockStatement$1(node) {
- this.token("{");
- this.printInnerComments(node);
- var hasDirectives = node.directives && node.directives.length;
- if (node.body.length || hasDirectives) {
- this.newline();
- this.printSequence(node.directives, node, {
- indent: true
- });
- if (hasDirectives) this.newline();
- this.printSequence(node.body, node, {
- indent: true
- });
- this.removeTrailingNewline();
- this.source("end", node.loc);
- if (!this.endsWith("\n")) this.newline();
- this.rightBrace();
- } else {
- this.source("end", node.loc);
- this.token("}");
- }
- }
- function Noop$1() {}
- function Directive$1(node) {
- this.print(node.value, node);
- this.semicolon();
- }
- var unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
- var unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
- function DirectiveLiteral$1(node) {
- var raw = this.getPossibleRaw(node);
- if (raw != null) {
- this.token(raw);
- return;
- }
- var value = node.value;
- if (!unescapedDoubleQuoteRE.test(value)) {
- this.token("\"" + value + "\"");
- } else if (!unescapedSingleQuoteRE.test(value)) {
- this.token("'" + value + "'");
- } else {
- throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
- }
- }
- function InterpreterDirective$1(node) {
- this.token("#!" + node.value + "\n");
- }
- function Placeholder$1(node) {
- this.token("%%");
- this.print(node.name);
- this.token("%%");
- if (node.expectedNode === "Statement") {
- this.semicolon();
- }
- }
- function JSXAttribute$1(node) {
- this.print(node.name, node);
- if (node.value) {
- this.token("=");
- this.print(node.value, node);
- }
- }
- function JSXIdentifier$1(node) {
- this.word(node.name);
- }
- function JSXNamespacedName$1(node) {
- this.print(node.namespace, node);
- this.token(":");
- this.print(node.name, node);
- }
- function JSXMemberExpression$1(node) {
- this.print(node.object, node);
- this.token(".");
- this.print(node.property, node);
- }
- function JSXSpreadAttribute$1(node) {
- this.token("{");
- this.token("...");
- this.print(node.argument, node);
- this.token("}");
- }
- function JSXExpressionContainer$1(node) {
- this.token("{");
- this.print(node.expression, node);
- this.token("}");
- }
- function JSXSpreadChild$1(node) {
- this.token("{");
- this.token("...");
- this.print(node.expression, node);
- this.token("}");
- }
- function JSXText$1(node) {
- var raw = this.getPossibleRaw(node);
- if (raw != null) {
- this.token(raw);
- } else {
- this.token(node.value);
- }
- }
- function JSXElement$1(node) {
- var open = node.openingElement;
- this.print(open, node);
- if (open.selfClosing) return;
- this.indent();
- for (var _i = 0, _arr = node.children; _i < _arr.length; _i++) {
- var child = _arr[_i];
- this.print(child, node);
- }
- this.dedent();
- this.print(node.closingElement, node);
- }
- function spaceSeparator() {
- this.space();
- }
- function JSXOpeningElement$1(node) {
- this.token("<");
- this.print(node.name, node);
- this.print(node.typeParameters, node);
- if (node.attributes.length > 0) {
- this.space();
- this.printJoin(node.attributes, node, {
- separator: spaceSeparator
- });
- }
- if (node.selfClosing) {
- this.space();
- this.token("/>");
- } else {
- this.token(">");
- }
- }
- function JSXClosingElement$1(node) {
- this.token("</");
- this.print(node.name, node);
- this.token(">");
- }
- function JSXEmptyExpression$1(node) {
- this.printInnerComments(node);
- }
- function JSXFragment$1(node) {
- this.print(node.openingFragment, node);
- this.indent();
- for (var _i2 = 0, _arr2 = node.children; _i2 < _arr2.length; _i2++) {
- var child = _arr2[_i2];
- this.print(child, node);
- }
- this.dedent();
- this.print(node.closingFragment, node);
- }
- function JSXOpeningFragment$1() {
- this.token("<");
- this.token(">");
- }
- function JSXClosingFragment$1() {
- this.token("</");
- this.token(">");
- }
- function TSTypeAnnotation$1(node) {
- this.token(":");
- this.space();
- if (node.optional) this.token("?");
- this.print(node.typeAnnotation, node);
- }
- function TSTypeParameterInstantiation$1(node) {
- this.token("<");
- this.printList(node.params, node, {});
- this.token(">");
- }
- function TSTypeParameter$1(node) {
- this.word(node.name);
- if (node.constraint) {
- this.space();
- this.word("extends");
- this.space();
- this.print(node.constraint, node);
- }
- if (node["default"]) {
- this.space();
- this.token("=");
- this.space();
- this.print(node["default"], node);
- }
- }
- function TSParameterProperty$1(node) {
- if (node.accessibility) {
- this.word(node.accessibility);
- this.space();
- }
- if (node.readonly) {
- this.word("readonly");
- this.space();
- }
- this._param(node.parameter);
- }
- function TSDeclareFunction$1(node) {
- if (node.declare) {
- this.word("declare");
- this.space();
- }
- this._functionHead(node);
- this.token(";");
- }
- function TSDeclareMethod$1(node) {
- this._classMethodHead(node);
- this.token(";");
- }
- function TSQualifiedName$1(node) {
- this.print(node.left, node);
- this.token(".");
- this.print(node.right, node);
- }
- function TSCallSignatureDeclaration$1(node) {
- this.tsPrintSignatureDeclarationBase(node);
- this.token(";");
- }
- function TSConstructSignatureDeclaration$1(node) {
- this.word("new");
- this.space();
- this.tsPrintSignatureDeclarationBase(node);
- this.token(";");
- }
- function TSPropertySignature$1(node) {
- var readonly = node.readonly,
- initializer = node.initializer;
- if (readonly) {
- this.word("readonly");
- this.space();
- }
- this.tsPrintPropertyOrMethodName(node);
- this.print(node.typeAnnotation, node);
- if (initializer) {
- this.space();
- this.token("=");
- this.space();
- this.print(initializer, node);
- }
- this.token(";");
- }
- function tsPrintPropertyOrMethodName(node) {
- if (node.computed) {
- this.token("[");
- }
- this.print(node.key, node);
- if (node.computed) {
- this.token("]");
- }
- if (node.optional) {
- this.token("?");
- }
- }
- function TSMethodSignature$1(node) {
- this.tsPrintPropertyOrMethodName(node);
- this.tsPrintSignatureDeclarationBase(node);
- this.token(";");
- }
- function TSIndexSignature$1(node) {
- var readonly = node.readonly;
- if (readonly) {
- this.word("readonly");
- this.space();
- }
- this.token("[");
- this._parameters(node.parameters, node);
- this.token("]");
- this.print(node.typeAnnotation, node);
- this.token(";");
- }
- function TSAnyKeyword$1() {
- this.word("any");
- }
- function TSBigIntKeyword$1() {
- this.word("bigint");
- }
- function TSUnknownKeyword$1() {
- this.word("unknown");
- }
- function TSNumberKeyword$1() {
- this.word("number");
- }
- function TSObjectKeyword$1() {
- this.word("object");
- }
- function TSBooleanKeyword$1() {
- this.word("boolean");
- }
- function TSStringKeyword$1() {
- this.word("string");
- }
- function TSSymbolKeyword$1() {
- this.word("symbol");
- }
- function TSVoidKeyword$1() {
- this.word("void");
- }
- function TSUndefinedKeyword$1() {
- this.word("undefined");
- }
- function TSNullKeyword$1() {
- this.word("null");
- }
- function TSNeverKeyword$1() {
- this.word("never");
- }
- function TSThisType$1() {
- this.word("this");
- }
- function TSFunctionType$1(node) {
- this.tsPrintFunctionOrConstructorType(node);
- }
- function TSConstructorType$1(node) {
- this.word("new");
- this.space();
- this.tsPrintFunctionOrConstructorType(node);
- }
- function tsPrintFunctionOrConstructorType(node) {
- var typeParameters = node.typeParameters,
- parameters = node.parameters;
- this.print(typeParameters, node);
- this.token("(");
- this._parameters(parameters, node);
- this.token(")");
- this.space();
- this.token("=>");
- this.space();
- this.print(node.typeAnnotation.typeAnnotation, node);
- }
- function TSTypeReference$1(node) {
- this.print(node.typeName, node);
- this.print(node.typeParameters, node);
- }
- function TSTypePredicate$1(node) {
- if (node.asserts) {
- this.word("asserts");
- this.space();
- }
- this.print(node.parameterName);
- if (node.typeAnnotation) {
- this.space();
- this.word("is");
- this.space();
- this.print(node.typeAnnotation.typeAnnotation);
- }
- }
- function TSTypeQuery$1(node) {
- this.word("typeof");
- this.space();
- this.print(node.exprName);
- }
- function TSTypeLiteral$1(node) {
- this.tsPrintTypeLiteralOrInterfaceBody(node.members, node);
- }
- function tsPrintTypeLiteralOrInterfaceBody(members, node) {
- this.tsPrintBraced(members, node);
- }
- function tsPrintBraced(members, node) {
- this.token("{");
- if (members.length) {
- this.indent();
- this.newline();
- for (var _iterator = members, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var member = _ref;
- this.print(member, node);
- this.newline();
- }
- this.dedent();
- this.rightBrace();
- } else {
- this.token("}");
- }
- }
- function TSArrayType$1(node) {
- this.print(node.elementType, node);
- this.token("[]");
- }
- function TSTupleType$1(node) {
- this.token("[");
- this.printList(node.elementTypes, node);
- this.token("]");
- }
- function TSOptionalType$1(node) {
- this.print(node.typeAnnotation, node);
- this.token("?");
- }
- function TSRestType$1(node) {
- this.token("...");
- this.print(node.typeAnnotation, node);
- }
- function TSUnionType$2(node) {
- this.tsPrintUnionOrIntersectionType(node, "|");
- }
- function TSIntersectionType$1(node) {
- this.tsPrintUnionOrIntersectionType(node, "&");
- }
- function tsPrintUnionOrIntersectionType(node, sep) {
- this.printJoin(node.types, node, {
- separator: function separator() {
- this.space();
- this.token(sep);
- this.space();
- }
- });
- }
- function TSConditionalType$1(node) {
- this.print(node.checkType);
- this.space();
- this.word("extends");
- this.space();
- this.print(node.extendsType);
- this.space();
- this.token("?");
- this.space();
- this.print(node.trueType);
- this.space();
- this.token(":");
- this.space();
- this.print(node.falseType);
- }
- function TSInferType$1(node) {
- this.token("infer");
- this.space();
- this.print(node.typeParameter);
- }
- function TSParenthesizedType$1(node) {
- this.token("(");
- this.print(node.typeAnnotation, node);
- this.token(")");
- }
- function TSTypeOperator$1(node) {
- this.token(node.operator);
- this.space();
- this.print(node.typeAnnotation, node);
- }
- function TSIndexedAccessType$1(node) {
- this.print(node.objectType, node);
- this.token("[");
- this.print(node.indexType, node);
- this.token("]");
- }
- function TSMappedType$1(node) {
- var readonly = node.readonly,
- typeParameter = node.typeParameter,
- optional = node.optional;
- this.token("{");
- this.space();
- if (readonly) {
- tokenIfPlusMinus(this, readonly);
- this.word("readonly");
- this.space();
- }
- this.token("[");
- this.word(typeParameter.name);
- this.space();
- this.word("in");
- this.space();
- this.print(typeParameter.constraint, typeParameter);
- this.token("]");
- if (optional) {
- tokenIfPlusMinus(this, optional);
- this.token("?");
- }
- this.token(":");
- this.space();
- this.print(node.typeAnnotation, node);
- this.space();
- this.token("}");
- }
- function tokenIfPlusMinus(self, tok) {
- if (tok !== true) {
- self.token(tok);
- }
- }
- function TSLiteralType$1(node) {
- this.print(node.literal, node);
- }
- function TSExpressionWithTypeArguments$1(node) {
- this.print(node.expression, node);
- this.print(node.typeParameters, node);
- }
- function TSInterfaceDeclaration$1(node) {
- var declare = node.declare,
- id = node.id,
- typeParameters = node.typeParameters,
- extendz = node["extends"],
- body = node.body;
- if (declare) {
- this.word("declare");
- this.space();
- }
- this.word("interface");
- this.space();
- this.print(id, node);
- this.print(typeParameters, node);
- if (extendz) {
- this.space();
- this.word("extends");
- this.space();
- this.printList(extendz, node);
- }
- this.space();
- this.print(body, node);
- }
- function TSInterfaceBody$1(node) {
- this.tsPrintTypeLiteralOrInterfaceBody(node.body, node);
- }
- function TSTypeAliasDeclaration$1(node) {
- var declare = node.declare,
- id = node.id,
- typeParameters = node.typeParameters,
- typeAnnotation = node.typeAnnotation;
- if (declare) {
- this.word("declare");
- this.space();
- }
- this.word("type");
- this.space();
- this.print(id, node);
- this.print(typeParameters, node);
- this.space();
- this.token("=");
- this.space();
- this.print(typeAnnotation, node);
- this.token(";");
- }
- function TSAsExpression$2(node) {
- var expression = node.expression,
- typeAnnotation = node.typeAnnotation;
- this.print(expression, node);
- this.space();
- this.word("as");
- this.space();
- this.print(typeAnnotation, node);
- }
- function TSTypeAssertion$2(node) {
- var typeAnnotation = node.typeAnnotation,
- expression = node.expression;
- this.token("<");
- this.print(typeAnnotation, node);
- this.token(">");
- this.space();
- this.print(expression, node);
- }
- function TSEnumDeclaration$1(node) {
- var declare = node.declare,
- isConst = node["const"],
- id = node.id,
- members = node.members;
- if (declare) {
- this.word("declare");
- this.space();
- }
- if (isConst) {
- this.word("const");
- this.space();
- }
- this.word("enum");
- this.space();
- this.print(id, node);
- this.space();
- this.tsPrintBraced(members, node);
- }
- function TSEnumMember$1(node) {
- var id = node.id,
- initializer = node.initializer;
- this.print(id, node);
- if (initializer) {
- this.space();
- this.token("=");
- this.space();
- this.print(initializer, node);
- }
- this.token(",");
- }
- function TSModuleDeclaration$1(node) {
- var declare = node.declare,
- id = node.id;
- if (declare) {
- this.word("declare");
- this.space();
- }
- if (!node.global) {
- this.word(id.type === "Identifier" ? "namespace" : "module");
- this.space();
- }
- this.print(id, node);
- if (!node.body) {
- this.token(";");
- return;
- }
- var body = node.body;
- while (body.type === "TSModuleDeclaration") {
- this.token(".");
- this.print(body.id, body);
- body = body.body;
- }
- this.space();
- this.print(body, node);
- }
- function TSModuleBlock$1(node) {
- this.tsPrintBraced(node.body, node);
- }
- function TSImportType$1(node) {
- var argument = node.argument,
- qualifier = node.qualifier,
- typeParameters = node.typeParameters;
- this.word("import");
- this.token("(");
- this.print(argument, node);
- this.token(")");
- if (qualifier) {
- this.token(".");
- this.print(qualifier, node);
- }
- if (typeParameters) {
- this.print(typeParameters, node);
- }
- }
- function TSImportEqualsDeclaration$1(node) {
- var isExport = node.isExport,
- id = node.id,
- moduleReference = node.moduleReference;
- if (isExport) {
- this.word("export");
- this.space();
- }
- this.word("import");
- this.space();
- this.print(id, node);
- this.space();
- this.token("=");
- this.space();
- this.print(moduleReference, node);
- this.token(";");
- }
- function TSExternalModuleReference$1(node) {
- this.token("require(");
- this.print(node.expression, node);
- this.token(")");
- }
- function TSNonNullExpression$1(node) {
- this.print(node.expression, node);
- this.token("!");
- }
- function TSExportAssignment$1(node) {
- this.word("export");
- this.space();
- this.token("=");
- this.space();
- this.print(node.expression, node);
- this.token(";");
- }
- function TSNamespaceExportDeclaration$1(node) {
- this.word("export");
- this.space();
- this.word("as");
- this.space();
- this.word("namespace");
- this.space();
- this.print(node.id, node);
- }
- function tsPrintSignatureDeclarationBase(node) {
- var typeParameters = node.typeParameters,
- parameters = node.parameters;
- this.print(typeParameters, node);
- this.token("(");
- this._parameters(parameters, node);
- this.token(")");
- this.print(node.typeAnnotation, node);
- }
- function tsPrintClassMemberModifiers(node, isField) {
- if (isField && node.declare) {
- this.word("declare");
- this.space();
- }
- if (node.accessibility) {
- this.word(node.accessibility);
- this.space();
- }
- if (node["static"]) {
- this.word("static");
- this.space();
- }
- if (node["abstract"]) {
- this.word("abstract");
- this.space();
- }
- if (isField && node.readonly) {
- this.word("readonly");
- this.space();
- }
- }
- var generatorFunctions = /*#__PURE__*/Object.freeze({
- __proto__: null,
- TaggedTemplateExpression: TaggedTemplateExpression$1,
- TemplateElement: TemplateElement$1,
- TemplateLiteral: TemplateLiteral$1,
- UnaryExpression: UnaryExpression$1,
- DoExpression: DoExpression$2,
- ParenthesizedExpression: ParenthesizedExpression$1,
- UpdateExpression: UpdateExpression$2,
- ConditionalExpression: ConditionalExpression$2,
- NewExpression: NewExpression$2,
- SequenceExpression: SequenceExpression$2,
- ThisExpression: ThisExpression$1,
- Super: Super$1,
- Decorator: Decorator$1,
- OptionalMemberExpression: OptionalMemberExpression$2,
- OptionalCallExpression: OptionalCallExpression$1,
- CallExpression: CallExpression$1,
- Import: Import$1,
- YieldExpression: YieldExpression$2,
- AwaitExpression: AwaitExpression$1,
- EmptyStatement: EmptyStatement$1,
- ExpressionStatement: ExpressionStatement$1,
- AssignmentPattern: AssignmentPattern$1,
- AssignmentExpression: AssignmentExpression$2,
- BindExpression: BindExpression$1,
- BinaryExpression: AssignmentExpression$2,
- LogicalExpression: AssignmentExpression$2,
- MemberExpression: MemberExpression$1,
- MetaProperty: MetaProperty$1,
- PrivateName: PrivateName$1,
- V8IntrinsicIdentifier: V8IntrinsicIdentifier$1,
- WithStatement: WithStatement$1,
- IfStatement: IfStatement$1,
- ForStatement: ForStatement$1,
- WhileStatement: WhileStatement$1,
- ForInStatement: ForInStatement$1,
- ForOfStatement: ForOfStatement$1,
- DoWhileStatement: DoWhileStatement$1,
- ContinueStatement: ContinueStatement$1,
- ReturnStatement: ReturnStatement$1,
- BreakStatement: BreakStatement$1,
- ThrowStatement: ThrowStatement$1,
- LabeledStatement: LabeledStatement$1,
- TryStatement: TryStatement$1,
- CatchClause: CatchClause$1,
- SwitchStatement: SwitchStatement$1,
- SwitchCase: SwitchCase$1,
- DebuggerStatement: DebuggerStatement$1,
- VariableDeclaration: VariableDeclaration$1,
- VariableDeclarator: VariableDeclarator$1,
- ClassDeclaration: ClassDeclaration$1,
- ClassExpression: ClassDeclaration$1,
- ClassBody: ClassBody$1,
- ClassProperty: ClassProperty$1,
- ClassPrivateProperty: ClassPrivateProperty$1,
- ClassMethod: ClassMethod$1,
- ClassPrivateMethod: ClassPrivateMethod$1,
- _classMethodHead: _classMethodHead,
- _params: _params,
- _parameters: _parameters,
- _param: _param,
- _methodHead: _methodHead,
- _predicate: _predicate,
- _functionHead: _functionHead,
- FunctionExpression: FunctionExpression$2,
- FunctionDeclaration: FunctionExpression$2,
- ArrowFunctionExpression: ArrowFunctionExpression$2,
- ImportSpecifier: ImportSpecifier$1,
- ImportDefaultSpecifier: ImportDefaultSpecifier$1,
- ExportDefaultSpecifier: ExportDefaultSpecifier$1,
- ExportSpecifier: ExportSpecifier$1,
- ExportNamespaceSpecifier: ExportNamespaceSpecifier$1,
- ExportAllDeclaration: ExportAllDeclaration$1,
- ExportNamedDeclaration: ExportNamedDeclaration$1,
- ExportDefaultDeclaration: ExportDefaultDeclaration$1,
- ImportDeclaration: ImportDeclaration$1,
- ImportNamespaceSpecifier: ImportNamespaceSpecifier$1,
- Identifier: Identifier$1,
- ArgumentPlaceholder: ArgumentPlaceholder$1,
- RestElement: RestElement$1,
- SpreadElement: RestElement$1,
- ObjectExpression: ObjectExpression$2,
- ObjectPattern: ObjectExpression$2,
- ObjectMethod: ObjectMethod$1,
- ObjectProperty: ObjectProperty$1,
- ArrayExpression: ArrayExpression$1,
- ArrayPattern: ArrayExpression$1,
- RegExpLiteral: RegExpLiteral$1,
- BooleanLiteral: BooleanLiteral$1,
- NullLiteral: NullLiteral$1,
- NumericLiteral: NumericLiteral$1,
- StringLiteral: StringLiteral$1,
- BigIntLiteral: BigIntLiteral$1,
- PipelineTopicExpression: PipelineTopicExpression$1,
- PipelineBareFunction: PipelineBareFunction$1,
- PipelinePrimaryTopicReference: PipelinePrimaryTopicReference$1,
- AnyTypeAnnotation: AnyTypeAnnotation$1,
- ArrayTypeAnnotation: ArrayTypeAnnotation$1,
- BooleanTypeAnnotation: BooleanTypeAnnotation$1,
- BooleanLiteralTypeAnnotation: BooleanLiteralTypeAnnotation$1,
- NullLiteralTypeAnnotation: NullLiteralTypeAnnotation$1,
- DeclareClass: DeclareClass$1,
- DeclareFunction: DeclareFunction$1,
- InferredPredicate: InferredPredicate$1,
- DeclaredPredicate: DeclaredPredicate$1,
- DeclareInterface: DeclareInterface$1,
- DeclareModule: DeclareModule$1,
- DeclareModuleExports: DeclareModuleExports$1,
- DeclareTypeAlias: DeclareTypeAlias$1,
- DeclareOpaqueType: DeclareOpaqueType$1,
- DeclareVariable: DeclareVariable$1,
- DeclareExportDeclaration: DeclareExportDeclaration$1,
- DeclareExportAllDeclaration: DeclareExportAllDeclaration$1,
- EnumDeclaration: EnumDeclaration$1,
- EnumBooleanBody: EnumBooleanBody$1,
- EnumNumberBody: EnumNumberBody$1,
- EnumStringBody: EnumStringBody$1,
- EnumSymbolBody: EnumSymbolBody$1,
- EnumDefaultedMember: EnumDefaultedMember$1,
- EnumBooleanMember: EnumBooleanMember$1,
- EnumNumberMember: EnumNumberMember$1,
- EnumStringMember: EnumStringMember$1,
- ExistsTypeAnnotation: ExistsTypeAnnotation$1,
- FunctionTypeAnnotation: FunctionTypeAnnotation$2,
- FunctionTypeParam: FunctionTypeParam$1,
- InterfaceExtends: InterfaceExtends$1,
- ClassImplements: InterfaceExtends$1,
- GenericTypeAnnotation: InterfaceExtends$1,
- _interfaceish: _interfaceish,
- _variance: _variance,
- InterfaceDeclaration: InterfaceDeclaration$1,
- InterfaceTypeAnnotation: InterfaceTypeAnnotation$1,
- IntersectionTypeAnnotation: IntersectionTypeAnnotation$1,
- MixedTypeAnnotation: MixedTypeAnnotation$1,
- EmptyTypeAnnotation: EmptyTypeAnnotation$1,
- NullableTypeAnnotation: NullableTypeAnnotation$2,
- NumberTypeAnnotation: NumberTypeAnnotation$1,
- StringTypeAnnotation: StringTypeAnnotation$1,
- ThisTypeAnnotation: ThisTypeAnnotation$1,
- TupleTypeAnnotation: TupleTypeAnnotation$1,
- TypeofTypeAnnotation: TypeofTypeAnnotation$1,
- TypeAlias: TypeAlias$1,
- TypeAnnotation: TypeAnnotation$1,
- TypeParameterInstantiation: TypeParameterInstantiation$1,
- TypeParameterDeclaration: TypeParameterInstantiation$1,
- TypeParameter: TypeParameter$1,
- OpaqueType: OpaqueType$1,
- ObjectTypeAnnotation: ObjectTypeAnnotation$1,
- ObjectTypeInternalSlot: ObjectTypeInternalSlot$1,
- ObjectTypeCallProperty: ObjectTypeCallProperty$1,
- ObjectTypeIndexer: ObjectTypeIndexer$1,
- ObjectTypeProperty: ObjectTypeProperty$1,
- ObjectTypeSpreadProperty: ObjectTypeSpreadProperty$1,
- QualifiedTypeIdentifier: QualifiedTypeIdentifier$1,
- UnionTypeAnnotation: UnionTypeAnnotation$2,
- TypeCastExpression: TypeCastExpression$1,
- Variance: Variance$1,
- VoidTypeAnnotation: VoidTypeAnnotation$1,
- NumberLiteralTypeAnnotation: NumericLiteral$1,
- StringLiteralTypeAnnotation: StringLiteral$1,
- File: File$1,
- Program: Program$1,
- BlockStatement: BlockStatement$1,
- Noop: Noop$1,
- Directive: Directive$1,
- DirectiveLiteral: DirectiveLiteral$1,
- InterpreterDirective: InterpreterDirective$1,
- Placeholder: Placeholder$1,
- JSXAttribute: JSXAttribute$1,
- JSXIdentifier: JSXIdentifier$1,
- JSXNamespacedName: JSXNamespacedName$1,
- JSXMemberExpression: JSXMemberExpression$1,
- JSXSpreadAttribute: JSXSpreadAttribute$1,
- JSXExpressionContainer: JSXExpressionContainer$1,
- JSXSpreadChild: JSXSpreadChild$1,
- JSXText: JSXText$1,
- JSXElement: JSXElement$1,
- JSXOpeningElement: JSXOpeningElement$1,
- JSXClosingElement: JSXClosingElement$1,
- JSXEmptyExpression: JSXEmptyExpression$1,
- JSXFragment: JSXFragment$1,
- JSXOpeningFragment: JSXOpeningFragment$1,
- JSXClosingFragment: JSXClosingFragment$1,
- TSTypeAnnotation: TSTypeAnnotation$1,
- TSTypeParameterInstantiation: TSTypeParameterInstantiation$1,
- TSTypeParameterDeclaration: TSTypeParameterInstantiation$1,
- TSTypeParameter: TSTypeParameter$1,
- TSParameterProperty: TSParameterProperty$1,
- TSDeclareFunction: TSDeclareFunction$1,
- TSDeclareMethod: TSDeclareMethod$1,
- TSQualifiedName: TSQualifiedName$1,
- TSCallSignatureDeclaration: TSCallSignatureDeclaration$1,
- TSConstructSignatureDeclaration: TSConstructSignatureDeclaration$1,
- TSPropertySignature: TSPropertySignature$1,
- tsPrintPropertyOrMethodName: tsPrintPropertyOrMethodName,
- TSMethodSignature: TSMethodSignature$1,
- TSIndexSignature: TSIndexSignature$1,
- TSAnyKeyword: TSAnyKeyword$1,
- TSBigIntKeyword: TSBigIntKeyword$1,
- TSUnknownKeyword: TSUnknownKeyword$1,
- TSNumberKeyword: TSNumberKeyword$1,
- TSObjectKeyword: TSObjectKeyword$1,
- TSBooleanKeyword: TSBooleanKeyword$1,
- TSStringKeyword: TSStringKeyword$1,
- TSSymbolKeyword: TSSymbolKeyword$1,
- TSVoidKeyword: TSVoidKeyword$1,
- TSUndefinedKeyword: TSUndefinedKeyword$1,
- TSNullKeyword: TSNullKeyword$1,
- TSNeverKeyword: TSNeverKeyword$1,
- TSThisType: TSThisType$1,
- TSFunctionType: TSFunctionType$1,
- TSConstructorType: TSConstructorType$1,
- tsPrintFunctionOrConstructorType: tsPrintFunctionOrConstructorType,
- TSTypeReference: TSTypeReference$1,
- TSTypePredicate: TSTypePredicate$1,
- TSTypeQuery: TSTypeQuery$1,
- TSTypeLiteral: TSTypeLiteral$1,
- tsPrintTypeLiteralOrInterfaceBody: tsPrintTypeLiteralOrInterfaceBody,
- tsPrintBraced: tsPrintBraced,
- TSArrayType: TSArrayType$1,
- TSTupleType: TSTupleType$1,
- TSOptionalType: TSOptionalType$1,
- TSRestType: TSRestType$1,
- TSUnionType: TSUnionType$2,
- TSIntersectionType: TSIntersectionType$1,
- tsPrintUnionOrIntersectionType: tsPrintUnionOrIntersectionType,
- TSConditionalType: TSConditionalType$1,
- TSInferType: TSInferType$1,
- TSParenthesizedType: TSParenthesizedType$1,
- TSTypeOperator: TSTypeOperator$1,
- TSIndexedAccessType: TSIndexedAccessType$1,
- TSMappedType: TSMappedType$1,
- TSLiteralType: TSLiteralType$1,
- TSExpressionWithTypeArguments: TSExpressionWithTypeArguments$1,
- TSInterfaceDeclaration: TSInterfaceDeclaration$1,
- TSInterfaceBody: TSInterfaceBody$1,
- TSTypeAliasDeclaration: TSTypeAliasDeclaration$1,
- TSAsExpression: TSAsExpression$2,
- TSTypeAssertion: TSTypeAssertion$2,
- TSEnumDeclaration: TSEnumDeclaration$1,
- TSEnumMember: TSEnumMember$1,
- TSModuleDeclaration: TSModuleDeclaration$1,
- TSModuleBlock: TSModuleBlock$1,
- TSImportType: TSImportType$1,
- TSImportEqualsDeclaration: TSImportEqualsDeclaration$1,
- TSExternalModuleReference: TSExternalModuleReference$1,
- TSNonNullExpression: TSNonNullExpression$1,
- TSExportAssignment: TSExportAssignment$1,
- TSNamespaceExportDeclaration: TSNamespaceExportDeclaration$1,
- tsPrintSignatureDeclarationBase: tsPrintSignatureDeclarationBase,
- tsPrintClassMemberModifiers: tsPrintClassMemberModifiers
- });
- var SCIENTIFIC_NOTATION = /e/i;
- var ZERO_DECIMAL_INTEGER = /\.0+$/;
- var NON_DECIMAL_LITERAL = /^0[box]/;
- var Printer = function () {
- function Printer(format, map) {
- this.inForStatementInitCounter = 0;
- this._printStack = [];
- this._indent = 0;
- this._insideAux = false;
- this._printedCommentStarts = {};
- this._parenPushNewlineState = null;
- this._noLineTerminator = false;
- this._printAuxAfterOnNextUserNode = false;
- this._printedComments = new WeakSet();
- this._endsWithInteger = false;
- this._endsWithWord = false;
- this.format = format || {};
- this._buf = new Buffer(map);
- }
- var _proto = Printer.prototype;
- _proto.generate = function generate(ast) {
- this.print(ast);
- this._maybeAddAuxComment();
- return this._buf.get();
- };
- _proto.indent = function indent() {
- if (this.format.compact || this.format.concise) return;
- this._indent++;
- };
- _proto.dedent = function dedent() {
- if (this.format.compact || this.format.concise) return;
- this._indent--;
- };
- _proto.semicolon = function semicolon(force) {
- if (force === void 0) {
- force = false;
- }
- this._maybeAddAuxComment();
- this._append(";", !force);
- };
- _proto.rightBrace = function rightBrace() {
- if (this.format.minified) {
- this._buf.removeLastSemicolon();
- }
- this.token("}");
- };
- _proto.space = function space(force) {
- if (force === void 0) {
- force = false;
- }
- if (this.format.compact) return;
- if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) {
- this._space();
- }
- };
- _proto.word = function word(str) {
- if (this._endsWithWord || this.endsWith("/") && str.indexOf("/") === 0) {
- this._space();
- }
- this._maybeAddAuxComment();
- this._append(str);
- this._endsWithWord = true;
- };
- _proto.number = function number(str) {
- this.word(str);
- this._endsWithInteger = isInteger_1(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
- };
- _proto.token = function token(str) {
- if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) {
- this._space();
- }
- this._maybeAddAuxComment();
- this._append(str);
- };
- _proto.newline = function newline(i) {
- if (this.format.retainLines || this.format.compact) return;
- if (this.format.concise) {
- this.space();
- return;
- }
- if (this.endsWith("\n\n")) return;
- if (typeof i !== "number") i = 1;
- i = Math.min(2, i);
- if (this.endsWith("{\n") || this.endsWith(":\n")) i--;
- if (i <= 0) return;
- for (var j = 0; j < i; j++) {
- this._newline();
- }
- };
- _proto.endsWith = function endsWith(str) {
- return this._buf.endsWith(str);
- };
- _proto.removeTrailingNewline = function removeTrailingNewline() {
- this._buf.removeTrailingNewline();
- };
- _proto.exactSource = function exactSource(loc, cb) {
- this._catchUp("start", loc);
- this._buf.exactSource(loc, cb);
- };
- _proto.source = function source(prop, loc) {
- this._catchUp(prop, loc);
- this._buf.source(prop, loc);
- };
- _proto.withSource = function withSource(prop, loc, cb) {
- this._catchUp(prop, loc);
- this._buf.withSource(prop, loc, cb);
- };
- _proto._space = function _space() {
- this._append(" ", true);
- };
- _proto._newline = function _newline() {
- this._append("\n", true);
- };
- _proto._append = function _append(str, queue) {
- if (queue === void 0) {
- queue = false;
- }
- this._maybeAddParen(str);
- this._maybeIndent(str);
- if (queue) this._buf.queue(str);else this._buf.append(str);
- this._endsWithWord = false;
- this._endsWithInteger = false;
- };
- _proto._maybeIndent = function _maybeIndent(str) {
- if (this._indent && this.endsWith("\n") && str[0] !== "\n") {
- this._buf.queue(this._getIndent());
- }
- };
- _proto._maybeAddParen = function _maybeAddParen(str) {
- var parenPushNewlineState = this._parenPushNewlineState;
- if (!parenPushNewlineState) return;
- this._parenPushNewlineState = null;
- var i;
- for (i = 0; i < str.length && str[i] === " "; i++) {
- continue;
- }
- if (i === str.length) return;
- var cha = str[i];
- if (cha !== "\n") {
- if (cha !== "/") return;
- if (i + 1 === str.length) return;
- var chaPost = str[i + 1];
- if (chaPost !== "/" && chaPost !== "*") return;
- }
- this.token("(");
- this.indent();
- parenPushNewlineState.printed = true;
- };
- _proto._catchUp = function _catchUp(prop, loc) {
- if (!this.format.retainLines) return;
- var pos = loc ? loc[prop] : null;
- if (pos && pos.line !== null) {
- var count = pos.line - this._buf.getCurrentLine();
- for (var i = 0; i < count; i++) {
- this._newline();
- }
- }
- };
- _proto._getIndent = function _getIndent() {
- return repeat_1(this.format.indent.style, this._indent);
- };
- _proto.startTerminatorless = function startTerminatorless(isLabel) {
- if (isLabel === void 0) {
- isLabel = false;
- }
- if (isLabel) {
- this._noLineTerminator = true;
- return null;
- } else {
- return this._parenPushNewlineState = {
- printed: false
- };
- }
- };
- _proto.endTerminatorless = function endTerminatorless(state) {
- this._noLineTerminator = false;
- if (state && state.printed) {
- this.dedent();
- this.newline();
- this.token(")");
- }
- };
- _proto.print = function print(node, parent) {
- var _this = this;
- if (!node) return;
- var oldConcise = this.format.concise;
- if (node._compact) {
- this.format.concise = true;
- }
- var printMethod = this[node.type];
- if (!printMethod) {
- throw new ReferenceError("unknown node of type " + JSON.stringify(node.type) + " with constructor " + JSON.stringify(node && node.constructor.name));
- }
- this._printStack.push(node);
- var oldInAux = this._insideAux;
- this._insideAux = !node.loc;
- this._maybeAddAuxComment(this._insideAux && !oldInAux);
- var needsParens$1 = needsParens(node, parent, this._printStack);
- if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
- needsParens$1 = true;
- }
- if (needsParens$1) this.token("(");
- this._printLeadingComments(node);
- var loc = isProgram(node) || isFile(node) ? null : node.loc;
- this.withSource("start", loc, function () {
- printMethod.call(_this, node, parent);
- });
- this._printTrailingComments(node);
- if (needsParens$1) this.token(")");
- this._printStack.pop();
- this.format.concise = oldConcise;
- this._insideAux = oldInAux;
- };
- _proto._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) {
- if (enteredPositionlessNode) this._printAuxBeforeComment();
- if (!this._insideAux) this._printAuxAfterComment();
- };
- _proto._printAuxBeforeComment = function _printAuxBeforeComment() {
- if (this._printAuxAfterOnNextUserNode) return;
- this._printAuxAfterOnNextUserNode = true;
- var comment = this.format.auxiliaryCommentBefore;
- if (comment) {
- this._printComment({
- type: "CommentBlock",
- value: comment
- });
- }
- };
- _proto._printAuxAfterComment = function _printAuxAfterComment() {
- if (!this._printAuxAfterOnNextUserNode) return;
- this._printAuxAfterOnNextUserNode = false;
- var comment = this.format.auxiliaryCommentAfter;
- if (comment) {
- this._printComment({
- type: "CommentBlock",
- value: comment
- });
- }
- };
- _proto.getPossibleRaw = function getPossibleRaw(node) {
- var extra = node.extra;
- if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
- return extra.raw;
- }
- };
- _proto.printJoin = function printJoin(nodes, parent, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (!nodes || !nodes.length) return;
- if (opts.indent) this.indent();
- var newlineOpts = {
- addNewlines: opts.addNewlines
- };
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- if (!node) continue;
- if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
- this.print(node, parent);
- if (opts.iterator) {
- opts.iterator(node, i);
- }
- if (opts.separator && i < nodes.length - 1) {
- opts.separator.call(this);
- }
- if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
- }
- if (opts.indent) this.dedent();
- };
- _proto.printAndIndentOnComments = function printAndIndentOnComments(node, parent) {
- var indent = node.leadingComments && node.leadingComments.length > 0;
- if (indent) this.indent();
- this.print(node, parent);
- if (indent) this.dedent();
- };
- _proto.printBlock = function printBlock(parent) {
- var node = parent.body;
- if (!isEmptyStatement(node)) {
- this.space();
- }
- this.print(node, parent);
- };
- _proto._printTrailingComments = function _printTrailingComments(node) {
- this._printComments(this._getComments(false, node));
- };
- _proto._printLeadingComments = function _printLeadingComments(node) {
- this._printComments(this._getComments(true, node));
- };
- _proto.printInnerComments = function printInnerComments(node, indent) {
- if (indent === void 0) {
- indent = true;
- }
- if (!node.innerComments || !node.innerComments.length) return;
- if (indent) this.indent();
- this._printComments(node.innerComments);
- if (indent) this.dedent();
- };
- _proto.printSequence = function printSequence(nodes, parent, opts) {
- if (opts === void 0) {
- opts = {};
- }
- opts.statement = true;
- return this.printJoin(nodes, parent, opts);
- };
- _proto.printList = function printList(items, parent, opts) {
- if (opts === void 0) {
- opts = {};
- }
- if (opts.separator == null) {
- opts.separator = commaSeparator;
- }
- return this.printJoin(items, parent, opts);
- };
- _proto._printNewline = function _printNewline(leading, node, parent, opts) {
- if (this.format.retainLines || this.format.compact) return;
- if (this.format.concise) {
- this.space();
- return;
- }
- var lines = 0;
- if (this._buf.hasContent()) {
- if (!leading) lines++;
- if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
- var needs = leading ? needsWhitespaceBefore : needsWhitespaceAfter;
- if (needs(node, parent)) lines++;
- }
- this.newline(lines);
- };
- _proto._getComments = function _getComments(leading, node) {
- return node && (leading ? node.leadingComments : node.trailingComments) || [];
- };
- _proto._printComment = function _printComment(comment) {
- var _this2 = this;
- if (!this.format.shouldPrintComment(comment.value)) return;
- if (comment.ignore) return;
- if (this._printedComments.has(comment)) return;
- this._printedComments.add(comment);
- if (comment.start != null) {
- if (this._printedCommentStarts[comment.start]) return;
- this._printedCommentStarts[comment.start] = true;
- }
- var isBlockComment = comment.type === "CommentBlock";
- this.newline(this._buf.hasContent() && !this._noLineTerminator && isBlockComment ? 1 : 0);
- if (!this.endsWith("[") && !this.endsWith("{")) this.space();
- var val = !isBlockComment && !this._noLineTerminator ? "//" + comment.value + "\n" : "/*" + comment.value + "*/";
- if (isBlockComment && this.format.indent.adjustMultilineComment) {
- var offset = comment.loc && comment.loc.start.column;
- if (offset) {
- var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
- val = val.replace(newlineRegex, "\n");
- }
- var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
- val = val.replace(/\n(?!$)/g, "\n" + repeat_1(" ", indentSize));
- }
- if (this.endsWith("/")) this._space();
- this.withSource("start", comment.loc, function () {
- _this2._append(val);
- });
- this.newline(isBlockComment && !this._noLineTerminator ? 1 : 0);
- };
- _proto._printComments = function _printComments(comments) {
- if (!comments || !comments.length) return;
- for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _comment = _ref;
- this._printComment(_comment);
- }
- };
- return Printer;
- }();
- Object.assign(Printer.prototype, generatorFunctions);
- function commaSeparator() {
- this.token(",");
- this.space();
- }
- var Generator = function (_Printer) {
- _inheritsLoose(Generator, _Printer);
- function Generator(ast, opts, code) {
- var _this;
- if (opts === void 0) {
- opts = {};
- }
- var format = normalizeOptions(code, opts);
- var map = opts.sourceMaps ? new SourceMap(opts, code) : null;
- _this = _Printer.call(this, format, map) || this;
- _this.ast = ast;
- return _this;
- }
- var _proto = Generator.prototype;
- _proto.generate = function generate() {
- return _Printer.prototype.generate.call(this, this.ast);
- };
- return Generator;
- }(Printer);
- function normalizeOptions(code, opts) {
- var format = {
- auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
- auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
- shouldPrintComment: opts.shouldPrintComment,
- retainLines: opts.retainLines,
- retainFunctionParens: opts.retainFunctionParens,
- comments: opts.comments == null || opts.comments,
- compact: opts.compact,
- minified: opts.minified,
- concise: opts.concise,
- jsonCompatibleStrings: opts.jsonCompatibleStrings,
- indent: {
- adjustMultilineComment: true,
- style: " ",
- base: 0
- },
- decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
- jsescOption: Object.assign({
- quotes: "double",
- wrap: true
- }, opts.jsescOption)
- };
- if (format.minified) {
- format.compact = true;
- format.shouldPrintComment = format.shouldPrintComment || function () {
- return format.comments;
- };
- } else {
- format.shouldPrintComment = format.shouldPrintComment || function (value) {
- return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0;
- };
- }
- if (format.compact === "auto") {
- format.compact = code.length > 500000;
- if (format.compact) {
- console.error("[BABEL] Note: The code generator has deoptimised the styling of " + (opts.filename + " as it exceeds the max of " + "500KB" + "."));
- }
- }
- if (format.compact) {
- format.indent.adjustMultilineComment = false;
- }
- return format;
- }
- function generateCode (ast, opts, code) {
- var gen = new Generator(ast, opts, code);
- return gen.generate();
- }
- function findParent(callback) {
- var path = this;
- while (path = path.parentPath) {
- if (callback(path)) return path;
- }
- return null;
- }
- function find$1(callback) {
- var path = this;
- do {
- if (callback(path)) return path;
- } while (path = path.parentPath);
- return null;
- }
- function getFunctionParent() {
- return this.findParent(function (p) {
- return p.isFunction();
- });
- }
- function getStatementParent() {
- var path = this;
- do {
- if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
- break;
- } else {
- path = path.parentPath;
- }
- } while (path);
- if (path && (path.isProgram() || path.isFile())) {
- throw new Error("File/Program node, we can't possibly find a statement parent to this");
- }
- return path;
- }
- function getEarliestCommonAncestorFrom(paths) {
- return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
- var earliest;
- var keys = VISITOR_KEYS[deepest.type];
- for (var _i = 0, _arr = ancestries; _i < _arr.length; _i++) {
- var ancestry = _arr[_i];
- var path = ancestry[i + 1];
- if (!earliest) {
- earliest = path;
- continue;
- }
- if (path.listKey && earliest.listKey === path.listKey) {
- if (path.key < earliest.key) {
- earliest = path;
- continue;
- }
- }
- var earliestKeyIndex = keys.indexOf(earliest.parentKey);
- var currentKeyIndex = keys.indexOf(path.parentKey);
- if (earliestKeyIndex > currentKeyIndex) {
- earliest = path;
- }
- }
- return earliest;
- });
- }
- function getDeepestCommonAncestorFrom(paths, filter) {
- var _this = this;
- if (!paths.length) {
- return this;
- }
- if (paths.length === 1) {
- return paths[0];
- }
- var minDepth = Infinity;
- var lastCommonIndex, lastCommon;
- var ancestries = paths.map(function (path) {
- var ancestry = [];
- do {
- ancestry.unshift(path);
- } while ((path = path.parentPath) && path !== _this);
- if (ancestry.length < minDepth) {
- minDepth = ancestry.length;
- }
- return ancestry;
- });
- var first = ancestries[0];
- depthLoop: for (var i = 0; i < minDepth; i++) {
- var shouldMatch = first[i];
- for (var _i2 = 0, _arr2 = ancestries; _i2 < _arr2.length; _i2++) {
- var ancestry = _arr2[_i2];
- if (ancestry[i] !== shouldMatch) {
- break depthLoop;
- }
- }
- lastCommonIndex = i;
- lastCommon = shouldMatch;
- }
- if (lastCommon) {
- if (filter) {
- return filter(lastCommon, lastCommonIndex, ancestries);
- } else {
- return lastCommon;
- }
- } else {
- throw new Error("Couldn't find intersection");
- }
- }
- function getAncestry() {
- var path = this;
- var paths = [];
- do {
- paths.push(path);
- } while (path = path.parentPath);
- return paths;
- }
- function isAncestor(maybeDescendant) {
- return maybeDescendant.isDescendant(this);
- }
- function isDescendant(maybeAncestor) {
- return !!this.findParent(function (parent) {
- return parent === maybeAncestor;
- });
- }
- function inType() {
- var path = this;
- while (path) {
- for (var _i3 = 0, _arr3 = arguments; _i3 < _arr3.length; _i3++) {
- var type = _arr3[_i3];
- if (path.node.type === type) return true;
- }
- path = path.parentPath;
- }
- return false;
- }
- var NodePath_ancestry = /*#__PURE__*/Object.freeze({
- __proto__: null,
- findParent: findParent,
- find: find$1,
- getFunctionParent: getFunctionParent,
- getStatementParent: getStatementParent,
- getEarliestCommonAncestorFrom: getEarliestCommonAncestorFrom,
- getDeepestCommonAncestorFrom: getDeepestCommonAncestorFrom,
- getAncestry: getAncestry,
- isAncestor: isAncestor,
- isDescendant: isDescendant,
- inType: inType
- });
- function infererReference (node) {
- if (!this.isReferenced()) return;
- var binding = this.scope.getBinding(node.name);
- if (binding) {
- if (binding.identifier.typeAnnotation) {
- return binding.identifier.typeAnnotation;
- } else {
- return getTypeAnnotationBindingConstantViolations(binding, this, node.name);
- }
- }
- if (node.name === "undefined") {
- return VoidTypeAnnotation();
- } else if (node.name === "NaN" || node.name === "Infinity") {
- return NumberTypeAnnotation();
- } else if (node.name === "arguments") ;
- }
- function getTypeAnnotationBindingConstantViolations(binding, path, name) {
- var types = [];
- var functionConstantViolations = [];
- var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
- var testType = getConditionalAnnotation(binding, path, name);
- if (testType) {
- var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
- constantViolations = constantViolations.filter(function (path) {
- return testConstantViolations.indexOf(path) < 0;
- });
- types.push(testType.typeAnnotation);
- }
- if (constantViolations.length) {
- constantViolations = constantViolations.concat(functionConstantViolations);
- for (var _i = 0, _arr = constantViolations; _i < _arr.length; _i++) {
- var violation = _arr[_i];
- types.push(violation.getTypeAnnotation());
- }
- }
- if (types.length) {
- return createUnionTypeAnnotation(types);
- }
- }
- function getConstantViolationsBefore(binding, path, functions) {
- var violations = binding.constantViolations.slice();
- violations.unshift(binding.path);
- return violations.filter(function (violation) {
- violation = violation.resolve();
- var status = violation._guessExecutionStatusRelativeTo(path);
- if (functions && status === "unknown") functions.push(violation);
- return status === "before";
- });
- }
- function inferAnnotationFromBinaryExpression(name, path) {
- var operator = path.node.operator;
- var right = path.get("right").resolve();
- var left = path.get("left").resolve();
- var target;
- if (left.isIdentifier({
- name: name
- })) {
- target = right;
- } else if (right.isIdentifier({
- name: name
- })) {
- target = left;
- }
- if (target) {
- if (operator === "===") {
- return target.getTypeAnnotation();
- }
- if (BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
- return NumberTypeAnnotation();
- }
- return;
- }
- if (operator !== "===" && operator !== "==") return;
- var typeofPath;
- var typePath;
- if (left.isUnaryExpression({
- operator: "typeof"
- })) {
- typeofPath = left;
- typePath = right;
- } else if (right.isUnaryExpression({
- operator: "typeof"
- })) {
- typeofPath = right;
- typePath = left;
- }
- if (!typeofPath) return;
- if (!typeofPath.get("argument").isIdentifier({
- name: name
- })) return;
- typePath = typePath.resolve();
- if (!typePath.isLiteral()) return;
- var typeValue = typePath.node.value;
- if (typeof typeValue !== "string") return;
- return createTypeAnnotationBasedOnTypeof(typeValue);
- }
- function getParentConditionalPath(binding, path, name) {
- var parentPath;
- while (parentPath = path.parentPath) {
- if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
- if (path.key === "test") {
- return;
- }
- return parentPath;
- }
- if (parentPath.isFunction()) {
- if (parentPath.parentPath.scope.getBinding(name) !== binding) return;
- }
- path = parentPath;
- }
- }
- function getConditionalAnnotation(binding, path, name) {
- var ifStatement = getParentConditionalPath(binding, path, name);
- if (!ifStatement) return;
- var test = ifStatement.get("test");
- var paths = [test];
- var types = [];
- for (var i = 0; i < paths.length; i++) {
- var _path = paths[i];
- if (_path.isLogicalExpression()) {
- if (_path.node.operator === "&&") {
- paths.push(_path.get("left"));
- paths.push(_path.get("right"));
- }
- } else if (_path.isBinaryExpression()) {
- var type = inferAnnotationFromBinaryExpression(name, _path);
- if (type) types.push(type);
- }
- }
- if (types.length) {
- return {
- typeAnnotation: createUnionTypeAnnotation(types),
- ifStatement: ifStatement
- };
- }
- return getConditionalAnnotation(ifStatement, name);
- }
- function VariableDeclarator$2() {
- var id = this.get("id");
- if (!id.isIdentifier()) return;
- var init = this.get("init");
- var type = init.getTypeAnnotation();
- if (type && type.type === "AnyTypeAnnotation") {
- if (init.isCallExpression() && init.get("callee").isIdentifier({
- name: "Array"
- }) && !init.scope.hasBinding("Array", true)) {
- type = ArrayExpression$2();
- }
- }
- return type;
- }
- function TypeCastExpression$2(node) {
- return node.typeAnnotation;
- }
- TypeCastExpression$2.validParent = true;
- function NewExpression$3(node) {
- if (this.get("callee").isIdentifier()) {
- return GenericTypeAnnotation(node.callee);
- }
- }
- function TemplateLiteral$2() {
- return StringTypeAnnotation();
- }
- function UnaryExpression$2(node) {
- var operator = node.operator;
- if (operator === "void") {
- return VoidTypeAnnotation();
- } else if (NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
- return NumberTypeAnnotation();
- } else if (STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
- return StringTypeAnnotation();
- } else if (BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
- return BooleanTypeAnnotation();
- }
- }
- function BinaryExpression$2(node) {
- var operator = node.operator;
- if (NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
- return NumberTypeAnnotation();
- } else if (BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
- return BooleanTypeAnnotation();
- } else if (operator === "+") {
- var right = this.get("right");
- var left = this.get("left");
- if (left.isBaseType("number") && right.isBaseType("number")) {
- return NumberTypeAnnotation();
- } else if (left.isBaseType("string") || right.isBaseType("string")) {
- return StringTypeAnnotation();
- }
- return UnionTypeAnnotation([StringTypeAnnotation(), NumberTypeAnnotation()]);
- }
- }
- function LogicalExpression$1() {
- return createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]);
- }
- function ConditionalExpression$3() {
- return createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]);
- }
- function SequenceExpression$3() {
- return this.get("expressions").pop().getTypeAnnotation();
- }
- function ParenthesizedExpression$2() {
- return this.get("expression").getTypeAnnotation();
- }
- function AssignmentExpression$3() {
- return this.get("right").getTypeAnnotation();
- }
- function UpdateExpression$3(node) {
- var operator = node.operator;
- if (operator === "++" || operator === "--") {
- return NumberTypeAnnotation();
- }
- }
- function StringLiteral$2() {
- return StringTypeAnnotation();
- }
- function NumericLiteral$2() {
- return NumberTypeAnnotation();
- }
- function BooleanLiteral$2() {
- return BooleanTypeAnnotation();
- }
- function NullLiteral$2() {
- return NullLiteralTypeAnnotation();
- }
- function RegExpLiteral$2() {
- return GenericTypeAnnotation(Identifier("RegExp"));
- }
- function ObjectExpression$3() {
- return GenericTypeAnnotation(Identifier("Object"));
- }
- function ArrayExpression$2() {
- return GenericTypeAnnotation(Identifier("Array"));
- }
- function RestElement$2() {
- return ArrayExpression$2();
- }
- RestElement$2.validParent = true;
- function Func() {
- return GenericTypeAnnotation(Identifier("Function"));
- }
- var isArrayFrom = buildMatchMemberExpression("Array.from");
- var isObjectKeys = buildMatchMemberExpression("Object.keys");
- var isObjectValues = buildMatchMemberExpression("Object.values");
- var isObjectEntries = buildMatchMemberExpression("Object.entries");
- function CallExpression$2() {
- var callee = this.node.callee;
- if (isObjectKeys(callee)) {
- return ArrayTypeAnnotation(StringTypeAnnotation());
- } else if (isArrayFrom(callee) || isObjectValues(callee)) {
- return ArrayTypeAnnotation(AnyTypeAnnotation());
- } else if (isObjectEntries(callee)) {
- return ArrayTypeAnnotation(TupleTypeAnnotation([StringTypeAnnotation(), AnyTypeAnnotation()]));
- }
- return resolveCall(this.get("callee"));
- }
- function TaggedTemplateExpression$2() {
- return resolveCall(this.get("tag"));
- }
- function resolveCall(callee) {
- callee = callee.resolve();
- if (callee.isFunction()) {
- if (callee.is("async")) {
- if (callee.is("generator")) {
- return GenericTypeAnnotation(Identifier("AsyncIterator"));
- } else {
- return GenericTypeAnnotation(Identifier("Promise"));
- }
- } else {
- if (callee.node.returnType) {
- return callee.node.returnType;
- }
- }
- }
- }
- var inferers = /*#__PURE__*/Object.freeze({
- __proto__: null,
- VariableDeclarator: VariableDeclarator$2,
- TypeCastExpression: TypeCastExpression$2,
- NewExpression: NewExpression$3,
- TemplateLiteral: TemplateLiteral$2,
- UnaryExpression: UnaryExpression$2,
- BinaryExpression: BinaryExpression$2,
- LogicalExpression: LogicalExpression$1,
- ConditionalExpression: ConditionalExpression$3,
- SequenceExpression: SequenceExpression$3,
- ParenthesizedExpression: ParenthesizedExpression$2,
- AssignmentExpression: AssignmentExpression$3,
- UpdateExpression: UpdateExpression$3,
- StringLiteral: StringLiteral$2,
- NumericLiteral: NumericLiteral$2,
- BooleanLiteral: BooleanLiteral$2,
- NullLiteral: NullLiteral$2,
- RegExpLiteral: RegExpLiteral$2,
- ObjectExpression: ObjectExpression$3,
- ArrayExpression: ArrayExpression$2,
- RestElement: RestElement$2,
- FunctionExpression: Func,
- ArrowFunctionExpression: Func,
- FunctionDeclaration: Func,
- ClassExpression: Func,
- ClassDeclaration: Func,
- CallExpression: CallExpression$2,
- TaggedTemplateExpression: TaggedTemplateExpression$2,
- Identifier: infererReference
- });
- function getTypeAnnotation() {
- if (this.typeAnnotation) return this.typeAnnotation;
- var type = this._getTypeAnnotation() || AnyTypeAnnotation();
- if (isTypeAnnotation(type)) type = type.typeAnnotation;
- return this.typeAnnotation = type;
- }
- function _getTypeAnnotation() {
- var node = this.node;
- if (!node) {
- if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
- var declar = this.parentPath.parentPath;
- var declarParent = declar.parentPath;
- if (declar.key === "left" && declarParent.isForInStatement()) {
- return StringTypeAnnotation();
- }
- if (declar.key === "left" && declarParent.isForOfStatement()) {
- return AnyTypeAnnotation();
- }
- return VoidTypeAnnotation();
- } else {
- return;
- }
- }
- if (node.typeAnnotation) {
- return node.typeAnnotation;
- }
- var inferer = inferers[node.type];
- if (inferer) {
- return inferer.call(this, node);
- }
- inferer = inferers[this.parentPath.type];
- if (inferer && inferer.validParent) {
- return this.parentPath.getTypeAnnotation();
- }
- }
- function isBaseType(baseName, soft) {
- return _isBaseType(baseName, this.getTypeAnnotation(), soft);
- }
- function _isBaseType(baseName, type, soft) {
- if (baseName === "string") {
- return isStringTypeAnnotation(type);
- } else if (baseName === "number") {
- return isNumberTypeAnnotation(type);
- } else if (baseName === "boolean") {
- return isBooleanTypeAnnotation(type);
- } else if (baseName === "any") {
- return isAnyTypeAnnotation(type);
- } else if (baseName === "mixed") {
- return isMixedTypeAnnotation(type);
- } else if (baseName === "empty") {
- return isEmptyTypeAnnotation(type);
- } else if (baseName === "void") {
- return isVoidTypeAnnotation(type);
- } else {
- if (soft) {
- return false;
- } else {
- throw new Error("Unknown base type " + baseName);
- }
- }
- }
- function couldBeBaseType(name) {
- var type = this.getTypeAnnotation();
- if (isAnyTypeAnnotation(type)) return true;
- if (isUnionTypeAnnotation(type)) {
- for (var _i = 0, _arr = type.types; _i < _arr.length; _i++) {
- var type2 = _arr[_i];
- if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
- return true;
- }
- }
- return false;
- } else {
- return _isBaseType(name, type, true);
- }
- }
- function baseTypeStrictlyMatches(right) {
- var left = this.getTypeAnnotation();
- right = right.getTypeAnnotation();
- if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) {
- return right.type === left.type;
- }
- }
- function isGenericType(genericName) {
- var type = this.getTypeAnnotation();
- return isGenericTypeAnnotation(type) && isIdentifier(type.id, {
- name: genericName
- });
- }
- var NodePath_inference = /*#__PURE__*/Object.freeze({
- __proto__: null,
- getTypeAnnotation: getTypeAnnotation,
- _getTypeAnnotation: _getTypeAnnotation,
- isBaseType: isBaseType,
- couldBeBaseType: couldBeBaseType,
- baseTypeStrictlyMatches: baseTypeStrictlyMatches,
- isGenericType: isGenericType
- });
- var jsTokens = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g;
- exports.matchToToken = function (match) {
- var token = {
- type: "invalid",
- value: match[0],
- closed: undefined
- };
- if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace";
- return token;
- };
- });
- var jsTokens$1 = unwrapExports(jsTokens);
- var jsTokens_1 = jsTokens.matchToToken;
- var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
- var escapeStringRegexp = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
- return str.replace(matchOperatorsRe, '\\$&');
- };
- var colorName = {
- "aliceblue": [240, 248, 255],
- "antiquewhite": [250, 235, 215],
- "aqua": [0, 255, 255],
- "aquamarine": [127, 255, 212],
- "azure": [240, 255, 255],
- "beige": [245, 245, 220],
- "bisque": [255, 228, 196],
- "black": [0, 0, 0],
- "blanchedalmond": [255, 235, 205],
- "blue": [0, 0, 255],
- "blueviolet": [138, 43, 226],
- "brown": [165, 42, 42],
- "burlywood": [222, 184, 135],
- "cadetblue": [95, 158, 160],
- "chartreuse": [127, 255, 0],
- "chocolate": [210, 105, 30],
- "coral": [255, 127, 80],
- "cornflowerblue": [100, 149, 237],
- "cornsilk": [255, 248, 220],
- "crimson": [220, 20, 60],
- "cyan": [0, 255, 255],
- "darkblue": [0, 0, 139],
- "darkcyan": [0, 139, 139],
- "darkgoldenrod": [184, 134, 11],
- "darkgray": [169, 169, 169],
- "darkgreen": [0, 100, 0],
- "darkgrey": [169, 169, 169],
- "darkkhaki": [189, 183, 107],
- "darkmagenta": [139, 0, 139],
- "darkolivegreen": [85, 107, 47],
- "darkorange": [255, 140, 0],
- "darkorchid": [153, 50, 204],
- "darkred": [139, 0, 0],
- "darksalmon": [233, 150, 122],
- "darkseagreen": [143, 188, 143],
- "darkslateblue": [72, 61, 139],
- "darkslategray": [47, 79, 79],
- "darkslategrey": [47, 79, 79],
- "darkturquoise": [0, 206, 209],
- "darkviolet": [148, 0, 211],
- "deeppink": [255, 20, 147],
- "deepskyblue": [0, 191, 255],
- "dimgray": [105, 105, 105],
- "dimgrey": [105, 105, 105],
- "dodgerblue": [30, 144, 255],
- "firebrick": [178, 34, 34],
- "floralwhite": [255, 250, 240],
- "forestgreen": [34, 139, 34],
- "fuchsia": [255, 0, 255],
- "gainsboro": [220, 220, 220],
- "ghostwhite": [248, 248, 255],
- "gold": [255, 215, 0],
- "goldenrod": [218, 165, 32],
- "gray": [128, 128, 128],
- "green": [0, 128, 0],
- "greenyellow": [173, 255, 47],
- "grey": [128, 128, 128],
- "honeydew": [240, 255, 240],
- "hotpink": [255, 105, 180],
- "indianred": [205, 92, 92],
- "indigo": [75, 0, 130],
- "ivory": [255, 255, 240],
- "khaki": [240, 230, 140],
- "lavender": [230, 230, 250],
- "lavenderblush": [255, 240, 245],
- "lawngreen": [124, 252, 0],
- "lemonchiffon": [255, 250, 205],
- "lightblue": [173, 216, 230],
- "lightcoral": [240, 128, 128],
- "lightcyan": [224, 255, 255],
- "lightgoldenrodyellow": [250, 250, 210],
- "lightgray": [211, 211, 211],
- "lightgreen": [144, 238, 144],
- "lightgrey": [211, 211, 211],
- "lightpink": [255, 182, 193],
- "lightsalmon": [255, 160, 122],
- "lightseagreen": [32, 178, 170],
- "lightskyblue": [135, 206, 250],
- "lightslategray": [119, 136, 153],
- "lightslategrey": [119, 136, 153],
- "lightsteelblue": [176, 196, 222],
- "lightyellow": [255, 255, 224],
- "lime": [0, 255, 0],
- "limegreen": [50, 205, 50],
- "linen": [250, 240, 230],
- "magenta": [255, 0, 255],
- "maroon": [128, 0, 0],
- "mediumaquamarine": [102, 205, 170],
- "mediumblue": [0, 0, 205],
- "mediumorchid": [186, 85, 211],
- "mediumpurple": [147, 112, 219],
- "mediumseagreen": [60, 179, 113],
- "mediumslateblue": [123, 104, 238],
- "mediumspringgreen": [0, 250, 154],
- "mediumturquoise": [72, 209, 204],
- "mediumvioletred": [199, 21, 133],
- "midnightblue": [25, 25, 112],
- "mintcream": [245, 255, 250],
- "mistyrose": [255, 228, 225],
- "moccasin": [255, 228, 181],
- "navajowhite": [255, 222, 173],
- "navy": [0, 0, 128],
- "oldlace": [253, 245, 230],
- "olive": [128, 128, 0],
- "olivedrab": [107, 142, 35],
- "orange": [255, 165, 0],
- "orangered": [255, 69, 0],
- "orchid": [218, 112, 214],
- "palegoldenrod": [238, 232, 170],
- "palegreen": [152, 251, 152],
- "paleturquoise": [175, 238, 238],
- "palevioletred": [219, 112, 147],
- "papayawhip": [255, 239, 213],
- "peachpuff": [255, 218, 185],
- "peru": [205, 133, 63],
- "pink": [255, 192, 203],
- "plum": [221, 160, 221],
- "powderblue": [176, 224, 230],
- "purple": [128, 0, 128],
- "rebeccapurple": [102, 51, 153],
- "red": [255, 0, 0],
- "rosybrown": [188, 143, 143],
- "royalblue": [65, 105, 225],
- "saddlebrown": [139, 69, 19],
- "salmon": [250, 128, 114],
- "sandybrown": [244, 164, 96],
- "seagreen": [46, 139, 87],
- "seashell": [255, 245, 238],
- "sienna": [160, 82, 45],
- "silver": [192, 192, 192],
- "skyblue": [135, 206, 235],
- "slateblue": [106, 90, 205],
- "slategray": [112, 128, 144],
- "slategrey": [112, 128, 144],
- "snow": [255, 250, 250],
- "springgreen": [0, 255, 127],
- "steelblue": [70, 130, 180],
- "tan": [210, 180, 140],
- "teal": [0, 128, 128],
- "thistle": [216, 191, 216],
- "tomato": [255, 99, 71],
- "turquoise": [64, 224, 208],
- "violet": [238, 130, 238],
- "wheat": [245, 222, 179],
- "white": [255, 255, 255],
- "whitesmoke": [245, 245, 245],
- "yellow": [255, 255, 0],
- "yellowgreen": [154, 205, 50]
- };
- var conversions = createCommonjsModule(function (module) {
- var reverseKeywords = {};
- for (var key in colorName) {
- if (colorName.hasOwnProperty(key)) {
- reverseKeywords[colorName[key]] = key;
- }
- }
- var convert = module.exports = {
- rgb: {
- channels: 3,
- labels: 'rgb'
- },
- hsl: {
- channels: 3,
- labels: 'hsl'
- },
- hsv: {
- channels: 3,
- labels: 'hsv'
- },
- hwb: {
- channels: 3,
- labels: 'hwb'
- },
- cmyk: {
- channels: 4,
- labels: 'cmyk'
- },
- xyz: {
- channels: 3,
- labels: 'xyz'
- },
- lab: {
- channels: 3,
- labels: 'lab'
- },
- lch: {
- channels: 3,
- labels: 'lch'
- },
- hex: {
- channels: 1,
- labels: ['hex']
- },
- keyword: {
- channels: 1,
- labels: ['keyword']
- },
- ansi16: {
- channels: 1,
- labels: ['ansi16']
- },
- ansi256: {
- channels: 1,
- labels: ['ansi256']
- },
- hcg: {
- channels: 3,
- labels: ['h', 'c', 'g']
- },
- apple: {
- channels: 3,
- labels: ['r16', 'g16', 'b16']
- },
- gray: {
- channels: 1,
- labels: ['gray']
- }
- };
- for (var model in convert) {
- if (convert.hasOwnProperty(model)) {
- if (!('channels' in convert[model])) {
- throw new Error('missing channels property: ' + model);
- }
- if (!('labels' in convert[model])) {
- throw new Error('missing channel labels property: ' + model);
- }
- if (convert[model].labels.length !== convert[model].channels) {
- throw new Error('channel and label counts mismatch: ' + model);
- }
- var channels = convert[model].channels;
- var labels = convert[model].labels;
- delete convert[model].channels;
- delete convert[model].labels;
- Object.defineProperty(convert[model], 'channels', {
- value: channels
- });
- Object.defineProperty(convert[model], 'labels', {
- value: labels
- });
- }
- }
- convert.rgb.hsl = function (rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var min = Math.min(r, g, b);
- var max = Math.max(r, g, b);
- var delta = max - min;
- var h;
- var s;
- var l;
- if (max === min) {
- h = 0;
- } else if (r === max) {
- h = (g - b) / delta;
- } else if (g === max) {
- h = 2 + (b - r) / delta;
- } else if (b === max) {
- h = 4 + (r - g) / delta;
- }
- h = Math.min(h * 60, 360);
- if (h < 0) {
- h += 360;
- }
- l = (min + max) / 2;
- if (max === min) {
- s = 0;
- } else if (l <= 0.5) {
- s = delta / (max + min);
- } else {
- s = delta / (2 - max - min);
- }
- return [h, s * 100, l * 100];
- };
- convert.rgb.hsv = function (rgb) {
- var rdif;
- var gdif;
- var bdif;
- var h;
- var s;
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var v = Math.max(r, g, b);
- var diff = v - Math.min(r, g, b);
- var diffc = function diffc(c) {
- return (v - c) / 6 / diff + 1 / 2;
- };
- if (diff === 0) {
- h = s = 0;
- } else {
- s = diff / v;
- rdif = diffc(r);
- gdif = diffc(g);
- bdif = diffc(b);
- if (r === v) {
- h = bdif - gdif;
- } else if (g === v) {
- h = 1 / 3 + rdif - bdif;
- } else if (b === v) {
- h = 2 / 3 + gdif - rdif;
- }
- if (h < 0) {
- h += 1;
- } else if (h > 1) {
- h -= 1;
- }
- }
- return [h * 360, s * 100, v * 100];
- };
- convert.rgb.hwb = function (rgb) {
- var r = rgb[0];
- var g = rgb[1];
- var b = rgb[2];
- var h = convert.rgb.hsl(rgb)[0];
- var w = 1 / 255 * Math.min(r, Math.min(g, b));
- b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
- return [h, w * 100, b * 100];
- };
- convert.rgb.cmyk = function (rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var c;
- var m;
- var y;
- var k;
- k = Math.min(1 - r, 1 - g, 1 - b);
- c = (1 - r - k) / (1 - k) || 0;
- m = (1 - g - k) / (1 - k) || 0;
- y = (1 - b - k) / (1 - k) || 0;
- return [c * 100, m * 100, y * 100, k * 100];
- };
- function comparativeDistance(x, y) {
- return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
- }
- convert.rgb.keyword = function (rgb) {
- var reversed = reverseKeywords[rgb];
- if (reversed) {
- return reversed;
- }
- var currentClosestDistance = Infinity;
- var currentClosestKeyword;
- for (var keyword in colorName) {
- if (colorName.hasOwnProperty(keyword)) {
- var value = colorName[keyword];
- var distance = comparativeDistance(rgb, value);
- if (distance < currentClosestDistance) {
- currentClosestDistance = distance;
- currentClosestKeyword = keyword;
- }
- }
- }
- return currentClosestKeyword;
- };
- convert.keyword.rgb = function (keyword) {
- return colorName[keyword];
- };
- convert.rgb.xyz = function (rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
- g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
- b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
- var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
- var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
- var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
- return [x * 100, y * 100, z * 100];
- };
- convert.rgb.lab = function (rgb) {
- var xyz = convert.rgb.xyz(rgb);
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
- x /= 95.047;
- y /= 100;
- z /= 108.883;
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
- l = 116 * y - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
- return [l, a, b];
- };
- convert.hsl.rgb = function (hsl) {
- var h = hsl[0] / 360;
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var t1;
- var t2;
- var t3;
- var rgb;
- var val;
- if (s === 0) {
- val = l * 255;
- return [val, val, val];
- }
- if (l < 0.5) {
- t2 = l * (1 + s);
- } else {
- t2 = l + s - l * s;
- }
- t1 = 2 * l - t2;
- rgb = [0, 0, 0];
- for (var i = 0; i < 3; i++) {
- t3 = h + 1 / 3 * -(i - 1);
- if (t3 < 0) {
- t3++;
- }
- if (t3 > 1) {
- t3--;
- }
- if (6 * t3 < 1) {
- val = t1 + (t2 - t1) * 6 * t3;
- } else if (2 * t3 < 1) {
- val = t2;
- } else if (3 * t3 < 2) {
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
- } else {
- val = t1;
- }
- rgb[i] = val * 255;
- }
- return rgb;
- };
- convert.hsl.hsv = function (hsl) {
- var h = hsl[0];
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var smin = s;
- var lmin = Math.max(l, 0.01);
- var sv;
- var v;
- l *= 2;
- s *= l <= 1 ? l : 2 - l;
- smin *= lmin <= 1 ? lmin : 2 - lmin;
- v = (l + s) / 2;
- sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
- return [h, sv * 100, v * 100];
- };
- convert.hsv.rgb = function (hsv) {
- var h = hsv[0] / 60;
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var hi = Math.floor(h) % 6;
- var f = h - Math.floor(h);
- var p = 255 * v * (1 - s);
- var q = 255 * v * (1 - s * f);
- var t = 255 * v * (1 - s * (1 - f));
- v *= 255;
- switch (hi) {
- case 0:
- return [v, t, p];
- case 1:
- return [q, v, p];
- case 2:
- return [p, v, t];
- case 3:
- return [p, q, v];
- case 4:
- return [t, p, v];
- case 5:
- return [v, p, q];
- }
- };
- convert.hsv.hsl = function (hsv) {
- var h = hsv[0];
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var vmin = Math.max(v, 0.01);
- var lmin;
- var sl;
- var l;
- l = (2 - s) * v;
- lmin = (2 - s) * vmin;
- sl = s * vmin;
- sl /= lmin <= 1 ? lmin : 2 - lmin;
- sl = sl || 0;
- l /= 2;
- return [h, sl * 100, l * 100];
- };
- convert.hwb.rgb = function (hwb) {
- var h = hwb[0] / 360;
- var wh = hwb[1] / 100;
- var bl = hwb[2] / 100;
- var ratio = wh + bl;
- var i;
- var v;
- var f;
- var n;
- if (ratio > 1) {
- wh /= ratio;
- bl /= ratio;
- }
- i = Math.floor(6 * h);
- v = 1 - bl;
- f = 6 * h - i;
- if ((i & 0x01) !== 0) {
- f = 1 - f;
- }
- n = wh + f * (v - wh);
- var r;
- var g;
- var b;
- switch (i) {
- default:
- case 6:
- case 0:
- r = v;
- g = n;
- b = wh;
- break;
- case 1:
- r = n;
- g = v;
- b = wh;
- break;
- case 2:
- r = wh;
- g = v;
- b = n;
- break;
- case 3:
- r = wh;
- g = n;
- b = v;
- break;
- case 4:
- r = n;
- g = wh;
- b = v;
- break;
- case 5:
- r = v;
- g = wh;
- b = n;
- break;
- }
- return [r * 255, g * 255, b * 255];
- };
- convert.cmyk.rgb = function (cmyk) {
- var c = cmyk[0] / 100;
- var m = cmyk[1] / 100;
- var y = cmyk[2] / 100;
- var k = cmyk[3] / 100;
- var r;
- var g;
- var b;
- r = 1 - Math.min(1, c * (1 - k) + k);
- g = 1 - Math.min(1, m * (1 - k) + k);
- b = 1 - Math.min(1, y * (1 - k) + k);
- return [r * 255, g * 255, b * 255];
- };
- convert.xyz.rgb = function (xyz) {
- var x = xyz[0] / 100;
- var y = xyz[1] / 100;
- var z = xyz[2] / 100;
- var r;
- var g;
- var b;
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
- b = x * 0.0557 + y * -0.2040 + z * 1.0570;
- r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r * 12.92;
- g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g * 12.92;
- b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b * 12.92;
- r = Math.min(Math.max(0, r), 1);
- g = Math.min(Math.max(0, g), 1);
- b = Math.min(Math.max(0, b), 1);
- return [r * 255, g * 255, b * 255];
- };
- convert.xyz.lab = function (xyz) {
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
- x /= 95.047;
- y /= 100;
- z /= 108.883;
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
- l = 116 * y - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
- return [l, a, b];
- };
- convert.lab.xyz = function (lab) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var x;
- var y;
- var z;
- y = (l + 16) / 116;
- x = a / 500 + y;
- z = y - b / 200;
- var y2 = Math.pow(y, 3);
- var x2 = Math.pow(x, 3);
- var z2 = Math.pow(z, 3);
- y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
- x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
- z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
- x *= 95.047;
- y *= 100;
- z *= 108.883;
- return [x, y, z];
- };
- convert.lab.lch = function (lab) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var hr;
- var h;
- var c;
- hr = Math.atan2(b, a);
- h = hr * 360 / 2 / Math.PI;
- if (h < 0) {
- h += 360;
- }
- c = Math.sqrt(a * a + b * b);
- return [l, c, h];
- };
- convert.lch.lab = function (lch) {
- var l = lch[0];
- var c = lch[1];
- var h = lch[2];
- var a;
- var b;
- var hr;
- hr = h / 360 * 2 * Math.PI;
- a = c * Math.cos(hr);
- b = c * Math.sin(hr);
- return [l, a, b];
- };
- convert.rgb.ansi16 = function (args) {
- var r = args[0];
- var g = args[1];
- var b = args[2];
- var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
- value = Math.round(value / 50);
- if (value === 0) {
- return 30;
- }
- var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
- if (value === 2) {
- ansi += 60;
- }
- return ansi;
- };
- convert.hsv.ansi16 = function (args) {
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
- };
- convert.rgb.ansi256 = function (args) {
- var r = args[0];
- var g = args[1];
- var b = args[2];
- if (r === g && g === b) {
- if (r < 8) {
- return 16;
- }
- if (r > 248) {
- return 231;
- }
- return Math.round((r - 8) / 247 * 24) + 232;
- }
- var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
- return ansi;
- };
- convert.ansi16.rgb = function (args) {
- var color = args % 10;
- if (color === 0 || color === 7) {
- if (args > 50) {
- color += 3.5;
- }
- color = color / 10.5 * 255;
- return [color, color, color];
- }
- var mult = (~~(args > 50) + 1) * 0.5;
- var r = (color & 1) * mult * 255;
- var g = (color >> 1 & 1) * mult * 255;
- var b = (color >> 2 & 1) * mult * 255;
- return [r, g, b];
- };
- convert.ansi256.rgb = function (args) {
- if (args >= 232) {
- var c = (args - 232) * 10 + 8;
- return [c, c, c];
- }
- args -= 16;
- var rem;
- var r = Math.floor(args / 36) / 5 * 255;
- var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
- var b = rem % 6 / 5 * 255;
- return [r, g, b];
- };
- convert.rgb.hex = function (args) {
- var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF);
- var string = integer.toString(16).toUpperCase();
- return '000000'.substring(string.length) + string;
- };
- convert.hex.rgb = function (args) {
- var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
- if (!match) {
- return [0, 0, 0];
- }
- var colorString = match[0];
- if (match[0].length === 3) {
- colorString = colorString.split('').map(function (_char) {
- return _char + _char;
- }).join('');
- }
- var integer = parseInt(colorString, 16);
- var r = integer >> 16 & 0xFF;
- var g = integer >> 8 & 0xFF;
- var b = integer & 0xFF;
- return [r, g, b];
- };
- convert.rgb.hcg = function (rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var max = Math.max(Math.max(r, g), b);
- var min = Math.min(Math.min(r, g), b);
- var chroma = max - min;
- var grayscale;
- var hue;
- if (chroma < 1) {
- grayscale = min / (1 - chroma);
- } else {
- grayscale = 0;
- }
- if (chroma <= 0) {
- hue = 0;
- } else if (max === r) {
- hue = (g - b) / chroma % 6;
- } else if (max === g) {
- hue = 2 + (b - r) / chroma;
- } else {
- hue = 4 + (r - g) / chroma + 4;
- }
- hue /= 6;
- hue %= 1;
- return [hue * 360, chroma * 100, grayscale * 100];
- };
- convert.hsl.hcg = function (hsl) {
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var c = 1;
- var f = 0;
- if (l < 0.5) {
- c = 2.0 * s * l;
- } else {
- c = 2.0 * s * (1.0 - l);
- }
- if (c < 1.0) {
- f = (l - 0.5 * c) / (1.0 - c);
- }
- return [hsl[0], c * 100, f * 100];
- };
- convert.hsv.hcg = function (hsv) {
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var c = s * v;
- var f = 0;
- if (c < 1.0) {
- f = (v - c) / (1 - c);
- }
- return [hsv[0], c * 100, f * 100];
- };
- convert.hcg.rgb = function (hcg) {
- var h = hcg[0] / 360;
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
- if (c === 0.0) {
- return [g * 255, g * 255, g * 255];
- }
- var pure = [0, 0, 0];
- var hi = h % 1 * 6;
- var v = hi % 1;
- var w = 1 - v;
- var mg = 0;
- switch (Math.floor(hi)) {
- case 0:
- pure[0] = 1;
- pure[1] = v;
- pure[2] = 0;
- break;
- case 1:
- pure[0] = w;
- pure[1] = 1;
- pure[2] = 0;
- break;
- case 2:
- pure[0] = 0;
- pure[1] = 1;
- pure[2] = v;
- break;
- case 3:
- pure[0] = 0;
- pure[1] = w;
- pure[2] = 1;
- break;
- case 4:
- pure[0] = v;
- pure[1] = 0;
- pure[2] = 1;
- break;
- default:
- pure[0] = 1;
- pure[1] = 0;
- pure[2] = w;
- }
- mg = (1.0 - c) * g;
- return [(c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255];
- };
- convert.hcg.hsv = function (hcg) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
- var v = c + g * (1.0 - c);
- var f = 0;
- if (v > 0.0) {
- f = c / v;
- }
- return [hcg[0], f * 100, v * 100];
- };
- convert.hcg.hsl = function (hcg) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
- var l = g * (1.0 - c) + 0.5 * c;
- var s = 0;
- if (l > 0.0 && l < 0.5) {
- s = c / (2 * l);
- } else if (l >= 0.5 && l < 1.0) {
- s = c / (2 * (1 - l));
- }
- return [hcg[0], s * 100, l * 100];
- };
- convert.hcg.hwb = function (hcg) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
- var v = c + g * (1.0 - c);
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
- };
- convert.hwb.hcg = function (hwb) {
- var w = hwb[1] / 100;
- var b = hwb[2] / 100;
- var v = 1 - b;
- var c = v - w;
- var g = 0;
- if (c < 1) {
- g = (v - c) / (1 - c);
- }
- return [hwb[0], c * 100, g * 100];
- };
- convert.apple.rgb = function (apple) {
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
- };
- convert.rgb.apple = function (rgb) {
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
- };
- convert.gray.rgb = function (args) {
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
- };
- convert.gray.hsl = convert.gray.hsv = function (args) {
- return [0, 0, args[0]];
- };
- convert.gray.hwb = function (gray) {
- return [0, 100, gray[0]];
- };
- convert.gray.cmyk = function (gray) {
- return [0, 0, 0, gray[0]];
- };
- convert.gray.lab = function (gray) {
- return [gray[0], 0, 0];
- };
- convert.gray.hex = function (gray) {
- var val = Math.round(gray[0] / 100 * 255) & 0xFF;
- var integer = (val << 16) + (val << 8) + val;
- var string = integer.toString(16).toUpperCase();
- return '000000'.substring(string.length) + string;
- };
- convert.rgb.gray = function (rgb) {
- var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
- return [val / 255 * 100];
- };
- });
- var conversions_1 = conversions.rgb;
- var conversions_2 = conversions.hsl;
- var conversions_3 = conversions.hsv;
- var conversions_4 = conversions.hwb;
- var conversions_5 = conversions.cmyk;
- var conversions_6 = conversions.xyz;
- var conversions_7 = conversions.lab;
- var conversions_8 = conversions.lch;
- var conversions_9 = conversions.hex;
- var conversions_10 = conversions.keyword;
- var conversions_11 = conversions.ansi16;
- var conversions_12 = conversions.ansi256;
- var conversions_13 = conversions.hcg;
- var conversions_14 = conversions.apple;
- var conversions_15 = conversions.gray;
- function buildGraph() {
- var graph = {};
- var models = Object.keys(conversions);
- for (var len = models.length, i = 0; i < len; i++) {
- graph[models[i]] = {
- distance: -1,
- parent: null
- };
- }
- return graph;
- }
- function deriveBFS(fromModel) {
- var graph = buildGraph();
- var queue = [fromModel];
- graph[fromModel].distance = 0;
- while (queue.length) {
- var current = queue.pop();
- var adjacents = Object.keys(conversions[current]);
- for (var len = adjacents.length, i = 0; i < len; i++) {
- var adjacent = adjacents[i];
- var node = graph[adjacent];
- if (node.distance === -1) {
- node.distance = graph[current].distance + 1;
- node.parent = current;
- queue.unshift(adjacent);
- }
- }
- }
- return graph;
- }
- function link(from, to) {
- return function (args) {
- return to(from(args));
- };
- }
- function wrapConversion(toModel, graph) {
- var path = [graph[toModel].parent, toModel];
- var fn = conversions[graph[toModel].parent][toModel];
- var cur = graph[toModel].parent;
- while (graph[cur].parent) {
- path.unshift(graph[cur].parent);
- fn = link(conversions[graph[cur].parent][cur], fn);
- cur = graph[cur].parent;
- }
- fn.conversion = path;
- return fn;
- }
- var route = function (fromModel) {
- var graph = deriveBFS(fromModel);
- var conversion = {};
- var models = Object.keys(graph);
- for (var len = models.length, i = 0; i < len; i++) {
- var toModel = models[i];
- var node = graph[toModel];
- if (node.parent === null) {
- continue;
- }
- conversion[toModel] = wrapConversion(toModel, graph);
- }
- return conversion;
- };
- var convert = {};
- var models = Object.keys(conversions);
- function wrapRaw(fn) {
- var wrappedFn = function wrappedFn(args) {
- if (args === undefined || args === null) {
- return args;
- }
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
- return fn(args);
- };
- if ('conversion' in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
- }
- function wrapRounded(fn) {
- var wrappedFn = function wrappedFn(args) {
- if (args === undefined || args === null) {
- return args;
- }
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
- var result = fn(args);
- if (typeof result === 'object') {
- for (var len = result.length, i = 0; i < len; i++) {
- result[i] = Math.round(result[i]);
- }
- }
- return result;
- };
- if ('conversion' in fn) {
- wrappedFn.conversion = fn.conversion;
- }
- return wrappedFn;
- }
- models.forEach(function (fromModel) {
- convert[fromModel] = {};
- Object.defineProperty(convert[fromModel], 'channels', {
- value: conversions[fromModel].channels
- });
- Object.defineProperty(convert[fromModel], 'labels', {
- value: conversions[fromModel].labels
- });
- var routes = route(fromModel);
- var routeModels = Object.keys(routes);
- routeModels.forEach(function (toModel) {
- var fn = routes[toModel];
- convert[fromModel][toModel] = wrapRounded(fn);
- convert[fromModel][toModel].raw = wrapRaw(fn);
- });
- });
- var colorConvert = convert;
- var ansiStyles = createCommonjsModule(function (module) {
- var wrapAnsi16 = function wrapAnsi16(fn, offset) {
- return function () {
- var code = fn.apply(colorConvert, arguments);
- return "\x1B[" + (code + offset) + "m";
- };
- };
- var wrapAnsi256 = function wrapAnsi256(fn, offset) {
- return function () {
- var code = fn.apply(colorConvert, arguments);
- return "\x1B[" + (38 + offset) + ";5;" + code + "m";
- };
- };
- var wrapAnsi16m = function wrapAnsi16m(fn, offset) {
- return function () {
- var rgb = fn.apply(colorConvert, arguments);
- return "\x1B[" + (38 + offset) + ";2;" + rgb[0] + ";" + rgb[1] + ";" + rgb[2] + "m";
- };
- };
- function assembleStyles() {
- var codes = new Map();
- var styles = {
- modifier: {
- reset: [0, 0],
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
- styles.color.grey = styles.color.gray;
- for (var _i = 0, _Object$keys = Object.keys(styles); _i < _Object$keys.length; _i++) {
- var groupName = _Object$keys[_i];
- var group = styles[groupName];
- for (var _i3 = 0, _Object$keys3 = Object.keys(group); _i3 < _Object$keys3.length; _i3++) {
- var styleName = _Object$keys3[_i3];
- var style = group[styleName];
- styles[styleName] = {
- open: "\x1B[" + style[0] + "m",
- close: "\x1B[" + style[1] + "m"
- };
- group[styleName] = styles[styleName];
- codes.set(style[0], style[1]);
- }
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
- Object.defineProperty(styles, 'codes', {
- value: codes,
- enumerable: false
- });
- }
- var ansi2ansi = function ansi2ansi(n) {
- return n;
- };
- var rgb2rgb = function rgb2rgb(r, g, b) {
- return [r, g, b];
- };
- styles.color.close = "\x1B[39m";
- styles.bgColor.close = "\x1B[49m";
- styles.color.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 0)
- };
- styles.color.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 0)
- };
- styles.color.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 0)
- };
- styles.bgColor.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 10)
- };
- styles.bgColor.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 10)
- };
- styles.bgColor.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 10)
- };
- for (var _i2 = 0, _Object$keys2 = Object.keys(colorConvert); _i2 < _Object$keys2.length; _i2++) {
- var key = _Object$keys2[_i2];
- if (typeof colorConvert[key] !== 'object') {
- continue;
- }
- var suite = colorConvert[key];
- if (key === 'ansi16') {
- key = 'ansi';
- }
- if ('ansi16' in suite) {
- styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
- styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
- }
- if ('ansi256' in suite) {
- styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
- styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
- }
- if ('rgb' in suite) {
- styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
- styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
- }
- }
- return styles;
- }
- Object.defineProperty(module, 'exports', {
- enumerable: true,
- get: assembleStyles
- });
- });
- var browser$3 = {
- stdout: false,
- stderr: false
- };
- var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
- var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
- var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
- var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
- var ESCAPES = new Map([['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', "\x1B"], ['a', "\x07"]]);
- function unescape(c) {
- if (c[0] === 'u' && c.length === 5 || c[0] === 'x' && c.length === 3) {
- return String.fromCharCode(parseInt(c.slice(1), 16));
- }
- return ESCAPES.get(c) || c;
- }
- function parseArguments(name, args) {
- var results = [];
- var chunks = args.trim().split(/\s*,\s*/g);
- var matches;
- for (var _iterator = chunks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var chunk = _ref;
- if (!isNaN(chunk)) {
- results.push(Number(chunk));
- } else if (matches = chunk.match(STRING_REGEX)) {
- results.push(matches[2].replace(ESCAPE_REGEX, function (m, escape, chr) {
- return escape ? unescape(escape) : chr;
- }));
- } else {
- throw new Error("Invalid Chalk template style argument: " + chunk + " (in style '" + name + "')");
- }
- }
- return results;
- }
- function parseStyle(style) {
- STYLE_REGEX.lastIndex = 0;
- var results = [];
- var matches;
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
- var name = matches[1];
- if (matches[2]) {
- var args = parseArguments(name, matches[2]);
- results.push([name].concat(args));
- } else {
- results.push([name]);
- }
- }
- return results;
- }
- function buildStyle(chalk, styles) {
- var enabled = {};
- for (var _iterator2 = styles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var layer = _ref2;
- for (var _iterator3 = layer.styles, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i4 >= _iterator3.length) break;
- _ref3 = _iterator3[_i4++];
- } else {
- _i4 = _iterator3.next();
- if (_i4.done) break;
- _ref3 = _i4.value;
- }
- var style = _ref3;
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
- }
- }
- var current = chalk;
- for (var _i3 = 0, _Object$keys = Object.keys(enabled); _i3 < _Object$keys.length; _i3++) {
- var styleName = _Object$keys[_i3];
- if (Array.isArray(enabled[styleName])) {
- if (!(styleName in current)) {
- throw new Error("Unknown Chalk style: " + styleName);
- }
- if (enabled[styleName].length > 0) {
- current = current[styleName].apply(current, enabled[styleName]);
- } else {
- current = current[styleName];
- }
- }
- }
- return current;
- }
- var templates = function (chalk, tmp) {
- var styles = [];
- var chunks = [];
- var chunk = [];
- tmp.replace(TEMPLATE_REGEX, function (m, escapeChar, inverse, style, close, chr) {
- if (escapeChar) {
- chunk.push(unescape(escapeChar));
- } else if (style) {
- var str = chunk.join('');
- chunk = [];
- chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
- styles.push({
- inverse: inverse,
- styles: parseStyle(style)
- });
- } else if (close) {
- if (styles.length === 0) {
- throw new Error('Found extraneous } in Chalk template literal');
- }
- chunks.push(buildStyle(chalk, styles)(chunk.join('')));
- chunk = [];
- styles.pop();
- } else {
- chunk.push(chr);
- }
- });
- chunks.push(chunk.join(''));
- if (styles.length > 0) {
- var errMsg = "Chalk template literal is missing " + styles.length + " closing bracket" + (styles.length === 1 ? '' : 's') + " (`}`)";
- throw new Error(errMsg);
- }
- return chunks.join('');
- };
- var chalk = createCommonjsModule(function (module) {
- var stdoutColor = browser$3.stdout;
- var isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
- var levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
- var skipModels = new Set(['gray']);
- var styles = Object.create(null);
- function applyOptions(obj, options) {
- options = options || {};
- var scLevel = 0;
- obj.level = options.level === undefined ? scLevel : options.level;
- obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
- }
- function Chalk(options) {
- if (!this || !(this instanceof Chalk) || this.template) {
- var chalk = {};
- applyOptions(chalk, options);
- chalk.template = function () {
- var args = [].slice.call(arguments);
- return chalkTag.apply(null, [chalk.template].concat(args));
- };
- Object.setPrototypeOf(chalk, Chalk.prototype);
- Object.setPrototypeOf(chalk.template, chalk);
- chalk.template.constructor = Chalk;
- return chalk.template;
- }
- applyOptions(this, options);
- }
- if (isSimpleWindowsTerm) {
- ansiStyles.blue.open = "\x1B[94m";
- }
- var _loop = function _loop() {
- var key = _Object$keys[_i];
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
- styles[key] = {
- get: function get() {
- var codes = ansiStyles[key];
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
- }
- };
- };
- for (var _i = 0, _Object$keys = Object.keys(ansiStyles); _i < _Object$keys.length; _i++) {
- _loop();
- }
- styles.visible = {
- get: function get() {
- return build.call(this, this._styles || [], true, 'visible');
- }
- };
- ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
- var _loop2 = function _loop2() {
- var model = _Object$keys2[_i2];
- if (skipModels.has(model)) {
- return "continue";
- }
- styles[model] = {
- get: function get() {
- var level = this.level;
- return function () {
- var open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
- var codes = {
- open: open,
- close: ansiStyles.color.close,
- closeRe: ansiStyles.color.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
- };
- for (var _i2 = 0, _Object$keys2 = Object.keys(ansiStyles.color.ansi); _i2 < _Object$keys2.length; _i2++) {
- var _ret = _loop2();
- if (_ret === "continue") continue;
- }
- ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
- var _loop3 = function _loop3() {
- var model = _Object$keys3[_i3];
- if (skipModels.has(model)) {
- return "continue";
- }
- var bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
- styles[bgModel] = {
- get: function get() {
- var level = this.level;
- return function () {
- var open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
- var codes = {
- open: open,
- close: ansiStyles.bgColor.close,
- closeRe: ansiStyles.bgColor.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
- };
- for (var _i3 = 0, _Object$keys3 = Object.keys(ansiStyles.bgColor.ansi); _i3 < _Object$keys3.length; _i3++) {
- var _ret2 = _loop3();
- if (_ret2 === "continue") continue;
- }
- var proto = Object.defineProperties(function () {}, styles);
- function build(_styles, _empty, key) {
- var builder = function builder() {
- return applyStyle.apply(builder, arguments);
- };
- builder._styles = _styles;
- builder._empty = _empty;
- var self = this;
- Object.defineProperty(builder, 'level', {
- enumerable: true,
- get: function get() {
- return self.level;
- },
- set: function set(level) {
- self.level = level;
- }
- });
- Object.defineProperty(builder, 'enabled', {
- enumerable: true,
- get: function get() {
- return self.enabled;
- },
- set: function set(enabled) {
- self.enabled = enabled;
- }
- });
- builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
- builder.__proto__ = proto;
- return builder;
- }
- function applyStyle() {
- var args = arguments;
- var argsLen = args.length;
- var str = String(arguments[0]);
- if (argsLen === 0) {
- return '';
- }
- if (argsLen > 1) {
- for (var a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
- if (!this.enabled || this.level <= 0 || !str) {
- return this._empty ? '' : str;
- }
- var originalDim = ansiStyles.dim.open;
- if (isSimpleWindowsTerm && this.hasGrey) {
- ansiStyles.dim.open = '';
- }
- for (var _iterator = this._styles.slice().reverse(), _isArray = Array.isArray(_iterator), _i4 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i4 >= _iterator.length) break;
- _ref = _iterator[_i4++];
- } else {
- _i4 = _iterator.next();
- if (_i4.done) break;
- _ref = _i4.value;
- }
- var code = _ref;
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
- str = str.replace(/\r?\n/g, code.close + "$&" + code.open);
- }
- ansiStyles.dim.open = originalDim;
- return str;
- }
- function chalkTag(chalk, strings) {
- if (!Array.isArray(strings)) {
- return [].slice.call(arguments, 1).join(' ');
- }
- var args = [].slice.call(arguments, 2);
- var parts = [strings.raw[0]];
- for (var i = 1; i < strings.length; i++) {
- parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
- parts.push(String(strings.raw[i]));
- }
- return templates(chalk, parts.join(''));
- }
- Object.defineProperties(Chalk.prototype, styles);
- module.exports = Chalk();
- module.exports.supportsColor = stdoutColor;
- module.exports["default"] = module.exports;
- });
- var chalk_1 = chalk.supportsColor;
- function getDefs(chalk) {
- return {
- keyword: chalk.cyan,
- capitalized: chalk.yellow,
- jsx_tag: chalk.yellow,
- punctuator: chalk.yellow,
- number: chalk.magenta,
- string: chalk.green,
- regex: chalk.magenta,
- comment: chalk.grey,
- invalid: chalk.white.bgRed.bold
- };
- }
- var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
- var JSX_TAG = /^[a-z][\w-]*$/i;
- var BRACKET = /^[()[\]{}]$/;
- function getTokenType(match) {
- var _match$slice = match.slice(-2),
- offset = _match$slice[0],
- text = _match$slice[1];
- var token = jsTokens_1(match);
- if (token.type === "name") {
- if (utils.keyword.isReservedWordES6(token.value)) {
- return "keyword";
- }
- if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
- return "jsx_tag";
- }
- if (token.value[0] !== token.value[0].toLowerCase()) {
- return "capitalized";
- }
- }
- if (token.type === "punctuator" && BRACKET.test(token.value)) {
- return "bracket";
- }
- if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
- return "punctuator";
- }
- return token.type;
- }
- function highlightTokens(defs, text) {
- return text.replace(jsTokens$1, function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var type = getTokenType(args);
- var colorize = defs[type];
- if (colorize) {
- return args[0].split(NEWLINE).map(function (str) {
- return colorize(str);
- }).join("\n");
- } else {
- return args[0];
- }
- });
- }
- function shouldHighlight(options) {
- return chalk.supportsColor || options.forceColor;
- }
- function getChalk(options) {
- var chalk$1 = chalk;
- if (options.forceColor) {
- chalk$1 = new chalk.constructor({
- enabled: true,
- level: 1
- });
- }
- return chalk$1;
- }
- function highlight(code, options) {
- if (options === void 0) {
- options = {};
- }
- if (shouldHighlight(options)) {
- var chalk = getChalk(options);
- var defs = getDefs(chalk);
- return highlightTokens(defs, code);
- } else {
- return code;
- }
- }
- function getDefs$1(chalk) {
- return {
- gutter: chalk.grey,
- marker: chalk.red.bold,
- message: chalk.red.bold
- };
- }
- var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
- function getMarkerLines(loc, source, opts) {
- var startLoc = Object.assign({
- column: 0,
- line: -1
- }, loc.start);
- var endLoc = Object.assign({}, startLoc, {}, loc.end);
- var _ref = opts || {},
- _ref$linesAbove = _ref.linesAbove,
- linesAbove = _ref$linesAbove === void 0 ? 2 : _ref$linesAbove,
- _ref$linesBelow = _ref.linesBelow,
- linesBelow = _ref$linesBelow === void 0 ? 3 : _ref$linesBelow;
- var startLine = startLoc.line;
- var startColumn = startLoc.column;
- var endLine = endLoc.line;
- var endColumn = endLoc.column;
- var start = Math.max(startLine - (linesAbove + 1), 0);
- var end = Math.min(source.length, endLine + linesBelow);
- if (startLine === -1) {
- start = 0;
- }
- if (endLine === -1) {
- end = source.length;
- }
- var lineDiff = endLine - startLine;
- var markerLines = {};
- if (lineDiff) {
- for (var i = 0; i <= lineDiff; i++) {
- var lineNumber = i + startLine;
- if (!startColumn) {
- markerLines[lineNumber] = true;
- } else if (i === 0) {
- var sourceLength = source[lineNumber - 1].length;
- markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
- } else if (i === lineDiff) {
- markerLines[lineNumber] = [0, endColumn];
- } else {
- var _sourceLength = source[lineNumber - i].length;
- markerLines[lineNumber] = [0, _sourceLength];
- }
- }
- } else {
- if (startColumn === endColumn) {
- if (startColumn) {
- markerLines[startLine] = [startColumn, 0];
- } else {
- markerLines[startLine] = true;
- }
- } else {
- markerLines[startLine] = [startColumn, endColumn - startColumn];
- }
- }
- return {
- start: start,
- end: end,
- markerLines: markerLines
- };
- }
- function codeFrameColumns(rawLines, loc, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var highlighted = (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);
- var chalk = getChalk(opts);
- var defs = getDefs$1(chalk);
- var maybeHighlight = function maybeHighlight(chalkFn, string) {
- return highlighted ? chalkFn(string) : string;
- };
- var lines = rawLines.split(NEWLINE$1);
- var _getMarkerLines = getMarkerLines(loc, lines, opts),
- start = _getMarkerLines.start,
- end = _getMarkerLines.end,
- markerLines = _getMarkerLines.markerLines;
- var hasColumns = loc.start && typeof loc.start.column === "number";
- var numberMaxWidth = String(end).length;
- var highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;
- var frame = highlightedLines.split(NEWLINE$1).slice(start, end).map(function (line, index) {
- var number = start + 1 + index;
- var paddedNumber = (" " + number).slice(-numberMaxWidth);
- var gutter = " " + paddedNumber + " | ";
- var hasMarker = markerLines[number];
- var lastMarkerLine = !markerLines[number + 1];
- if (hasMarker) {
- var markerLine = "";
- if (Array.isArray(hasMarker)) {
- var markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
- var numberOfMarkers = hasMarker[1] || 1;
- markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
- if (lastMarkerLine && opts.message) {
- markerLine += " " + maybeHighlight(defs.message, opts.message);
- }
- }
- return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
- } else {
- return " " + maybeHighlight(defs.gutter, gutter) + line;
- }
- }).join("\n");
- if (opts.message && !hasColumns) {
- frame = "" + " ".repeat(numberMaxWidth + 1) + opts.message + "\n" + frame;
- }
- if (highlighted) {
- return chalk.reset(frame);
- } else {
- return frame;
- }
- }
- var beforeExpr = true;
- var startsExpr = true;
- var isLoop$1 = true;
- var isAssign = true;
- var prefix = true;
- var postfix = true;
- 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.rightAssociative = !!conf.rightAssociative;
- this.isLoop = !!conf.isLoop;
- this.isAssign = !!conf.isAssign;
- this.prefix = !!conf.prefix;
- this.postfix = !!conf.postfix;
- this.binop = conf.binop != null ? conf.binop : null;
- this.updateContext = null;
- };
- var keywords = new Map();
- function createKeyword(name, options) {
- if (options === void 0) {
- options = {};
- }
- options.keyword = name;
- var token = new TokenType(name, options);
- keywords.set(name, token);
- return token;
- }
- function createBinop(name, binop) {
- return new TokenType(name, {
- beforeExpr: beforeExpr,
- binop: binop
- });
- }
- var types = {
- num: new TokenType("num", {
- startsExpr: startsExpr
- }),
- bigint: new TokenType("bigint", {
- startsExpr: startsExpr
- }),
- regexp: new TokenType("regexp", {
- startsExpr: startsExpr
- }),
- string: new TokenType("string", {
- startsExpr: startsExpr
- }),
- name: new TokenType("name", {
- startsExpr: startsExpr
- }),
- eof: new TokenType("eof"),
- bracketL: new TokenType("[", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- bracketR: new TokenType("]"),
- braceL: new TokenType("{", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- braceBarL: new TokenType("{|", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- braceR: new TokenType("}"),
- braceBarR: new TokenType("|}"),
- parenL: new TokenType("(", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- parenR: new TokenType(")"),
- comma: new TokenType(",", {
- beforeExpr: beforeExpr
- }),
- semi: new TokenType(";", {
- beforeExpr: beforeExpr
- }),
- colon: new TokenType(":", {
- beforeExpr: beforeExpr
- }),
- doubleColon: new TokenType("::", {
- beforeExpr: beforeExpr
- }),
- dot: new TokenType("."),
- question: new TokenType("?", {
- beforeExpr: beforeExpr
- }),
- questionDot: new TokenType("?."),
- arrow: new TokenType("=>", {
- beforeExpr: beforeExpr
- }),
- template: new TokenType("template"),
- ellipsis: new TokenType("...", {
- beforeExpr: beforeExpr
- }),
- backQuote: new TokenType("`", {
- startsExpr: startsExpr
- }),
- dollarBraceL: new TokenType("${", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- at: new TokenType("@"),
- hash: new TokenType("#", {
- startsExpr: startsExpr
- }),
- interpreterDirective: new TokenType("#!..."),
- eq: new TokenType("=", {
- beforeExpr: beforeExpr,
- isAssign: isAssign
- }),
- assign: new TokenType("_=", {
- beforeExpr: beforeExpr,
- isAssign: isAssign
- }),
- incDec: new TokenType("++/--", {
- prefix: prefix,
- postfix: postfix,
- startsExpr: startsExpr
- }),
- bang: new TokenType("!", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- tilde: new TokenType("~", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- pipeline: createBinop("|>", 0),
- nullishCoalescing: createBinop("??", 1),
- logicalOR: createBinop("||", 2),
- logicalAND: createBinop("&&", 3),
- bitwiseOR: createBinop("|", 4),
- bitwiseXOR: createBinop("^", 5),
- bitwiseAND: createBinop("&", 6),
- equality: createBinop("==/!=/===/!==", 7),
- relational: createBinop("</>/<=/>=", 8),
- bitShift: createBinop("<</>>/>>>", 9),
- plusMin: new TokenType("+/-", {
- beforeExpr: beforeExpr,
- binop: 10,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- modulo: new TokenType("%", {
- beforeExpr: beforeExpr,
- binop: 11,
- startsExpr: startsExpr
- }),
- star: createBinop("*", 11),
- slash: createBinop("/", 11),
- exponent: new TokenType("**", {
- beforeExpr: beforeExpr,
- binop: 12,
- rightAssociative: true
- }),
- _break: createKeyword("break"),
- _case: createKeyword("case", {
- beforeExpr: beforeExpr
- }),
- _catch: createKeyword("catch"),
- _continue: createKeyword("continue"),
- _debugger: createKeyword("debugger"),
- _default: createKeyword("default", {
- beforeExpr: beforeExpr
- }),
- _do: createKeyword("do", {
- isLoop: isLoop$1,
- beforeExpr: beforeExpr
- }),
- _else: createKeyword("else", {
- beforeExpr: beforeExpr
- }),
- _finally: createKeyword("finally"),
- _for: createKeyword("for", {
- isLoop: isLoop$1
- }),
- _function: createKeyword("function", {
- startsExpr: startsExpr
- }),
- _if: createKeyword("if"),
- _return: createKeyword("return", {
- beforeExpr: beforeExpr
- }),
- _switch: createKeyword("switch"),
- _throw: createKeyword("throw", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- _try: createKeyword("try"),
- _var: createKeyword("var"),
- _const: createKeyword("const"),
- _while: createKeyword("while", {
- isLoop: isLoop$1
- }),
- _with: createKeyword("with"),
- _new: createKeyword("new", {
- beforeExpr: beforeExpr,
- startsExpr: startsExpr
- }),
- _this: createKeyword("this", {
- startsExpr: startsExpr
- }),
- _super: createKeyword("super", {
- startsExpr: startsExpr
- }),
- _class: createKeyword("class", {
- startsExpr: startsExpr
- }),
- _extends: createKeyword("extends", {
- beforeExpr: beforeExpr
- }),
- _export: createKeyword("export"),
- _import: createKeyword("import", {
- startsExpr: startsExpr
- }),
- _null: createKeyword("null", {
- startsExpr: startsExpr
- }),
- _true: createKeyword("true", {
- startsExpr: startsExpr
- }),
- _false: createKeyword("false", {
- startsExpr: startsExpr
- }),
- _in: createKeyword("in", {
- beforeExpr: beforeExpr,
- binop: 8
- }),
- _instanceof: createKeyword("instanceof", {
- beforeExpr: beforeExpr,
- binop: 8
- }),
- _typeof: createKeyword("typeof", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- _void: createKeyword("void", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- }),
- _delete: createKeyword("delete", {
- beforeExpr: beforeExpr,
- prefix: prefix,
- startsExpr: startsExpr
- })
- };
- var SCOPE_OTHER = 0,
- SCOPE_PROGRAM = 1,
- SCOPE_FUNCTION = 2,
- SCOPE_ASYNC = 4,
- SCOPE_GENERATOR = 8,
- SCOPE_ARROW = 16,
- SCOPE_SIMPLE_CATCH = 32,
- SCOPE_SUPER = 64,
- SCOPE_DIRECT_SUPER = 128,
- SCOPE_CLASS = 256,
- SCOPE_TS_MODULE = 512,
- SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
- function functionFlags(isAsync, isGenerator) {
- return SCOPE_FUNCTION | (isAsync ? SCOPE_ASYNC : 0) | (isGenerator ? SCOPE_GENERATOR : 0);
- }
- var BIND_KIND_VALUE = 1,
- BIND_KIND_TYPE = 2,
- BIND_SCOPE_VAR = 4,
- BIND_SCOPE_LEXICAL = 8,
- BIND_SCOPE_FUNCTION = 16,
- BIND_FLAGS_NONE = 64,
- BIND_FLAGS_CLASS = 128,
- BIND_FLAGS_TS_ENUM = 256,
- BIND_FLAGS_TS_CONST_ENUM = 512,
- BIND_FLAGS_TS_EXPORT_ONLY = 1024;
- var BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
- BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
- BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
- BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,
- BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,
- BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,
- BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,
- BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
- BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,
- BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,
- BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,
- BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;
- var CLASS_ELEMENT_FLAG_STATIC = 4,
- CLASS_ELEMENT_KIND_GETTER = 2,
- CLASS_ELEMENT_KIND_SETTER = 1,
- CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
- var CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
- CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
- CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
- CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
- CLASS_ELEMENT_OTHER = 0;
- function isSimpleProperty(node) {
- return node != null && node.type === "Property" && node.kind === "init" && node.method === false;
- }
- var estree = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class() {
- return _superClass.apply(this, arguments) || this;
- }
- var _proto = _class.prototype;
- _proto.estreeParseRegExpLiteral = function estreeParseRegExpLiteral(_ref) {
- var pattern = _ref.pattern,
- flags = _ref.flags;
- var regex = null;
- try {
- regex = new RegExp(pattern, flags);
- } catch (e) {}
- var node = this.estreeParseLiteral(regex);
- node.regex = {
- pattern: pattern,
- flags: flags
- };
- return node;
- };
- _proto.estreeParseBigIntLiteral = function estreeParseBigIntLiteral(value) {
- var bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null;
- var node = this.estreeParseLiteral(bigInt);
- node.bigint = String(node.value || value);
- return node;
- };
- _proto.estreeParseLiteral = function estreeParseLiteral(value) {
- return this.parseLiteral(value, "Literal");
- };
- _proto.directiveToStmt = function directiveToStmt(directive) {
- var directiveLiteral = directive.value;
- var stmt = this.startNodeAt(directive.start, directive.loc.start);
- var expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
- expression.value = directiveLiteral.value;
- expression.raw = directiveLiteral.extra.raw;
- stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
- stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
- return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
- };
- _proto.initFunction = function initFunction(node, isAsync) {
- _superClass.prototype.initFunction.call(this, node, isAsync);
- node.expression = false;
- };
- _proto.checkDeclaration = function checkDeclaration(node) {
- if (isSimpleProperty(node)) {
- this.checkDeclaration(node.value);
- } else {
- _superClass.prototype.checkDeclaration.call(this, node);
- }
- };
- _proto.checkGetterSetterParams = function checkGetterSetterParams(method) {
- var prop = method;
- var paramCount = prop.kind === "get" ? 0 : 1;
- var start = prop.start;
- if (prop.value.params.length !== paramCount) {
- if (prop.kind === "get") {
- this.raise(start, "getter must not have any formal parameters");
- } else {
- this.raise(start, "setter must have exactly one formal parameter");
- }
- } else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
- this.raise(start, "setter function argument must not be a rest parameter");
- }
- };
- _proto.checkLVal = function checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding) {
- var _this = this;
- if (bindingType === void 0) {
- bindingType = BIND_NONE;
- }
- switch (expr.type) {
- case "ObjectPattern":
- expr.properties.forEach(function (prop) {
- _this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
- });
- break;
- default:
- _superClass.prototype.checkLVal.call(this, expr, bindingType, checkClashes, contextDescription, disallowLetBinding);
- }
- };
- _proto.checkDuplicatedProto = function checkDuplicatedProto(prop, protoRef) {
- if (prop.type === "SpreadElement" || prop.computed || prop.method || prop.shorthand) {
- return;
- }
- var key = prop.key;
- var name = key.type === "Identifier" ? key.name : String(key.value);
- if (name === "__proto__" && prop.kind === "init") {
- if (protoRef.used && !protoRef.start) {
- protoRef.start = key.start;
- }
- protoRef.used = true;
- }
- };
- _proto.isValidDirective = function isValidDirective(stmt) {
- return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
- };
- _proto.stmtToDirective = function stmtToDirective(stmt) {
- var directive = _superClass.prototype.stmtToDirective.call(this, stmt);
- var value = stmt.expression.value;
- directive.value.value = value;
- return directive;
- };
- _proto.parseBlockBody = function parseBlockBody(node, allowDirectives, topLevel, end) {
- var _this2 = this;
- _superClass.prototype.parseBlockBody.call(this, node, allowDirectives, topLevel, end);
- var directiveStatements = node.directives.map(function (d) {
- return _this2.directiveToStmt(d);
- });
- node.body = directiveStatements.concat(node.body);
- delete node.directives;
- };
- _proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
- this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
- if (method.typeParameters) {
- method.value.typeParameters = method.typeParameters;
- delete method.typeParameters;
- }
- classBody.body.push(method);
- };
- _proto.parseExprAtom = function parseExprAtom(refShorthandDefaultPos) {
- switch (this.state.type) {
- case types.num:
- case types.string:
- return this.estreeParseLiteral(this.state.value);
- case types.regexp:
- return this.estreeParseRegExpLiteral(this.state.value);
- case types.bigint:
- return this.estreeParseBigIntLiteral(this.state.value);
- case types._null:
- return this.estreeParseLiteral(null);
- case types._true:
- return this.estreeParseLiteral(true);
- case types._false:
- return this.estreeParseLiteral(false);
- default:
- return _superClass.prototype.parseExprAtom.call(this, refShorthandDefaultPos);
- }
- };
- _proto.parseLiteral = function parseLiteral(value, type, startPos, startLoc) {
- var node = _superClass.prototype.parseLiteral.call(this, value, type, startPos, startLoc);
- node.raw = node.extra.raw;
- delete node.extra;
- return node;
- };
- _proto.parseFunctionBody = function parseFunctionBody(node, allowExpression, isMethod) {
- if (isMethod === void 0) {
- isMethod = false;
- }
- _superClass.prototype.parseFunctionBody.call(this, node, allowExpression, isMethod);
- node.expression = node.body.type !== "BlockStatement";
- };
- _proto.parseMethod = function parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
- if (inClassScope === void 0) {
- inClassScope = false;
- }
- var funcNode = this.startNode();
- funcNode.kind = node.kind;
- funcNode = _superClass.prototype.parseMethod.call(this, funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
- funcNode.type = "FunctionExpression";
- delete funcNode.kind;
- node.value = funcNode;
- type = type === "ClassMethod" ? "MethodDefinition" : type;
- return this.finishNode(node, type);
- };
- _proto.parseObjectMethod = function parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
- var node = _superClass.prototype.parseObjectMethod.call(this, prop, isGenerator, isAsync, isPattern, containsEsc);
- if (node) {
- node.type = "Property";
- if (node.kind === "method") node.kind = "init";
- node.shorthand = false;
- }
- return node;
- };
- _proto.parseObjectProperty = function parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
- var node = _superClass.prototype.parseObjectProperty.call(this, prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
- if (node) {
- node.kind = "init";
- node.type = "Property";
- }
- return node;
- };
- _proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
- if (isSimpleProperty(node)) {
- this.toAssignable(node.value, isBinding, contextDescription);
- return node;
- }
- return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
- };
- _proto.toAssignableObjectExpressionProp = function toAssignableObjectExpressionProp(prop, isBinding, isLast) {
- if (prop.kind === "get" || prop.kind === "set") {
- throw this.raise(prop.key.start, "Object pattern can't contain getter or setter");
- } else if (prop.method) {
- throw this.raise(prop.key.start, "Object pattern can't contain methods");
- } else {
- _superClass.prototype.toAssignableObjectExpressionProp.call(this, prop, isBinding, isLast);
- }
- };
- _proto.finishCallExpression = function finishCallExpression(node, optional) {
- _superClass.prototype.finishCallExpression.call(this, node, optional);
- if (node.callee.type === "Import") {
- node.type = "ImportExpression";
- node.source = node.arguments[0];
- delete node.arguments;
- delete node.callee;
- }
- return node;
- };
- _proto.toReferencedListDeep = function toReferencedListDeep(exprList, isParenthesizedExpr) {
- if (!exprList) {
- return;
- }
- _superClass.prototype.toReferencedListDeep.call(this, exprList, isParenthesizedExpr);
- };
- return _class;
- }(superClass);
- });
- var lineBreak = /\r\n?|[\n\u2028\u2029]/;
- var lineBreakG = new RegExp(lineBreak.source, "g");
- function isNewLine(code) {
- switch (code) {
- case 10:
- case 13:
- case 8232:
- case 8233:
- return true;
- default:
- return false;
- }
- }
- var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
- function isWhitespace(code) {
- switch (code) {
- case 0x0009:
- case 0x000b:
- case 0x000c:
- case 32:
- case 160:
- case 5760:
- case 0x2000:
- case 0x2001:
- case 0x2002:
- case 0x2003:
- case 0x2004:
- case 0x2005:
- case 0x2006:
- case 0x2007:
- case 0x2008:
- case 0x2009:
- case 0x200a:
- case 0x202f:
- case 0x205f:
- case 0x3000:
- case 0xfeff:
- return true;
- default:
- return false;
- }
- }
- var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
- this.token = token;
- this.isExpr = !!isExpr;
- this.preserveSpace = !!preserveSpace;
- this.override = override;
- };
- var types$1 = {
- braceStatement: new TokContext("{", false),
- braceExpression: new TokContext("{", true),
- templateQuasi: new TokContext("${", false),
- parenStatement: new TokContext("(", false),
- parenExpression: new TokContext("(", true),
- template: new TokContext("`", true, true, function (p) {
- return p.readTmplToken();
- }),
- functionExpression: new TokContext("function", true),
- functionStatement: new TokContext("function", false)
- };
- types.parenR.updateContext = types.braceR.updateContext = function () {
- if (this.state.context.length === 1) {
- this.state.exprAllowed = true;
- return;
- }
- var out = this.state.context.pop();
- if (out === types$1.braceStatement && this.curContext().token === "function") {
- out = this.state.context.pop();
- }
- this.state.exprAllowed = !out.isExpr;
- };
- types.name.updateContext = function (prevType) {
- var allowed = false;
- if (prevType !== types.dot) {
- if (this.state.value === "of" && !this.state.exprAllowed || this.state.value === "yield" && this.scope.inGenerator) {
- allowed = true;
- }
- }
- this.state.exprAllowed = allowed;
- if (this.state.isIterator) {
- this.state.isIterator = false;
- }
- };
- types.braceL.updateContext = function (prevType) {
- this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
- this.state.exprAllowed = true;
- };
- types.dollarBraceL.updateContext = function () {
- this.state.context.push(types$1.templateQuasi);
- this.state.exprAllowed = true;
- };
- types.parenL.updateContext = function (prevType) {
- var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
- this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
- this.state.exprAllowed = true;
- };
- types.incDec.updateContext = function () {};
- types._function.updateContext = types._class.updateContext = function (prevType) {
- if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) {
- this.state.context.push(types$1.functionExpression);
- } else {
- this.state.context.push(types$1.functionStatement);
- }
- this.state.exprAllowed = false;
- };
- types.backQuote.updateContext = function () {
- if (this.curContext() === types$1.template) {
- this.state.context.pop();
- } else {
- this.state.context.push(types$1.template);
- }
- this.state.exprAllowed = false;
- };
- var reservedWords = {
- strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
- strictBind: ["eval", "arguments"]
- };
- var reservedWordsStrictSet = new Set(reservedWords.strict);
- var reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
- var isReservedWord = function isReservedWord(word, inModule) {
- return inModule && word === "await" || word === "enum";
- };
- function isStrictReservedWord(word, inModule) {
- return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
- }
- function isStrictBindOnlyReservedWord(word) {
- return reservedWordsStrictBindSet.has(word);
- }
- function isStrictBindReservedWord(word, inModule) {
- return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
- }
- function isKeyword(word) {
- return keywords.has(word);
- }
- var keywordRelationalOperator = /^in(stanceof)?$/;
- 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-\u08BD\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\u0D05-\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-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\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-\uAB67\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\u0B56\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\u0D82\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\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\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;
- 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, 477, 28, 11, 0, 9, 21, 155, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 12, 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, 0, 33, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 0, 161, 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, 270, 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, 754, 9486, 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, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541];
- 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, 525, 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, 4, 9, 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, 232, 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, 19723, 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, 792487, 239];
- function isInAstralSet(code, set) {
- var pos = 0x10000;
- for (var i = 0, length = set.length; i < length; i += 2) {
- pos += set[i];
- if (pos > code) return false;
- pos += set[i + 1];
- if (pos >= code) return true;
- }
- return false;
- }
- function isIdentifierStart(code) {
- if (code < 65) return code === 36;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
- }
- return isInAstralSet(code, astralIdentifierStartCodes);
- }
- function isIteratorStart(current, next) {
- return current === 64 && next === 64;
- }
- function isIdentifierChar(code) {
- if (code < 48) return code === 36;
- if (code < 58) return true;
- if (code < 65) return false;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
- }
- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
- }
- var reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
- function isEsModuleType(bodyElement) {
- return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
- }
- function hasTypeImportKind(node) {
- return node.importKind === "type" || node.importKind === "typeof";
- }
- function isMaybeDefaultImport(state) {
- return (state.type === types.name || !!state.type.keyword) && state.value !== "from";
- }
- var exportSuggestions = {
- "const": "declare export var",
- "let": "declare export var",
- type: "export type",
- "interface": "export interface"
- };
- function partition(list, test) {
- var list1 = [];
- var list2 = [];
- for (var i = 0; i < list.length; i++) {
- (test(list[i], i, list) ? list1 : list2).push(list[i]);
- }
- return [list1, list2];
- }
- var FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
- var flow = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class(options, input) {
- var _this;
- _this = _superClass.call(this, options, input) || this;
- _this.flowPragma = undefined;
- return _this;
- }
- var _proto = _class.prototype;
- _proto.shouldParseTypes = function shouldParseTypes() {
- return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
- };
- _proto.shouldParseEnums = function shouldParseEnums() {
- return !!this.getPluginOption("flow", "enums");
- };
- _proto.finishToken = function finishToken(type, val) {
- if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) {
- if (this.flowPragma === undefined) {
- this.flowPragma = null;
- }
- }
- return _superClass.prototype.finishToken.call(this, type, val);
- };
- _proto.addComment = function addComment(comment) {
- if (this.flowPragma === undefined) {
- var matches = FLOW_PRAGMA_REGEX.exec(comment.value);
- if (!matches) ; else if (matches[1] === "flow") {
- this.flowPragma = "flow";
- } else if (matches[1] === "noflow") {
- this.flowPragma = "noflow";
- } else {
- throw new Error("Unexpected flow pragma");
- }
- }
- return _superClass.prototype.addComment.call(this, comment);
- };
- _proto.flowParseTypeInitialiser = function flowParseTypeInitialiser(tok) {
- var oldInType = this.state.inType;
- this.state.inType = true;
- this.expect(tok || types.colon);
- var type = this.flowParseType();
- this.state.inType = oldInType;
- return type;
- };
- _proto.flowParsePredicate = function flowParsePredicate() {
- var node = this.startNode();
- var moduloLoc = this.state.startLoc;
- var moduloPos = this.state.start;
- this.expect(types.modulo);
- var checksLoc = this.state.startLoc;
- this.expectContextual("checks");
- if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
- this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here.");
- }
- if (this.eat(types.parenL)) {
- node.value = this.parseExpression();
- this.expect(types.parenR);
- return this.finishNode(node, "DeclaredPredicate");
- } else {
- return this.finishNode(node, "InferredPredicate");
- }
- };
- _proto.flowParseTypeAndPredicateInitialiser = function flowParseTypeAndPredicateInitialiser() {
- var oldInType = this.state.inType;
- this.state.inType = true;
- this.expect(types.colon);
- var type = null;
- var predicate = null;
- if (this.match(types.modulo)) {
- this.state.inType = oldInType;
- predicate = this.flowParsePredicate();
- } else {
- type = this.flowParseType();
- this.state.inType = oldInType;
- if (this.match(types.modulo)) {
- predicate = this.flowParsePredicate();
- }
- }
- return [type, predicate];
- };
- _proto.flowParseDeclareClass = function flowParseDeclareClass(node) {
- this.next();
- this.flowParseInterfaceish(node, true);
- return this.finishNode(node, "DeclareClass");
- };
- _proto.flowParseDeclareFunction = function flowParseDeclareFunction(node) {
- this.next();
- var id = node.id = this.parseIdentifier();
- var typeNode = this.startNode();
- var typeContainer = this.startNode();
- if (this.isRelational("<")) {
- typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
- } else {
- typeNode.typeParameters = null;
- }
- this.expect(types.parenL);
- var tmp = this.flowParseFunctionTypeParams();
- typeNode.params = tmp.params;
- typeNode.rest = tmp.rest;
- this.expect(types.parenR);
- var _this$flowParseTypeAn = this.flowParseTypeAndPredicateInitialiser();
- typeNode.returnType = _this$flowParseTypeAn[0];
- node.predicate = _this$flowParseTypeAn[1];
- typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
- id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
- this.resetEndLocation(id);
- this.semicolon();
- return this.finishNode(node, "DeclareFunction");
- };
- _proto.flowParseDeclare = function flowParseDeclare(node, insideModule) {
- if (this.match(types._class)) {
- return this.flowParseDeclareClass(node);
- } else if (this.match(types._function)) {
- return this.flowParseDeclareFunction(node);
- } else if (this.match(types._var)) {
- return this.flowParseDeclareVariable(node);
- } else if (this.eatContextual("module")) {
- if (this.match(types.dot)) {
- return this.flowParseDeclareModuleExports(node);
- } else {
- if (insideModule) {
- this.raise(this.state.lastTokStart, "`declare module` cannot be used inside another `declare module`");
- }
- return this.flowParseDeclareModule(node);
- }
- } else if (this.isContextual("type")) {
- return this.flowParseDeclareTypeAlias(node);
- } else if (this.isContextual("opaque")) {
- return this.flowParseDeclareOpaqueType(node);
- } else if (this.isContextual("interface")) {
- return this.flowParseDeclareInterface(node);
- } else if (this.match(types._export)) {
- return this.flowParseDeclareExportDeclaration(node, insideModule);
- } else {
- throw this.unexpected();
- }
- };
- _proto.flowParseDeclareVariable = function flowParseDeclareVariable(node) {
- this.next();
- node.id = this.flowParseTypeAnnotatableIdentifier(true);
- this.scope.declareName(node.id.name, BIND_VAR, node.id.start);
- this.semicolon();
- return this.finishNode(node, "DeclareVariable");
- };
- _proto.flowParseDeclareModule = function flowParseDeclareModule(node) {
- var _this2 = this;
- this.scope.enter(SCOPE_OTHER);
- if (this.match(types.string)) {
- node.id = this.parseExprAtom();
- } else {
- node.id = this.parseIdentifier();
- }
- var bodyNode = node.body = this.startNode();
- var body = bodyNode.body = [];
- this.expect(types.braceL);
- while (!this.match(types.braceR)) {
- var _bodyNode = this.startNode();
- if (this.match(types._import)) {
- this.next();
- if (!this.isContextual("type") && !this.match(types._typeof)) {
- this.raise(this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`");
- }
- this.parseImport(_bodyNode);
- } else {
- this.expectContextual("declare", "Only declares and type imports are allowed inside declare module");
- _bodyNode = this.flowParseDeclare(_bodyNode, true);
- }
- body.push(_bodyNode);
- }
- this.scope.exit();
- this.expect(types.braceR);
- this.finishNode(bodyNode, "BlockStatement");
- var kind = null;
- var hasModuleExport = false;
- var errorMessage = "Found both `declare module.exports` and `declare export` in the same module. " + "Modules can only have 1 since they are either an ES module or they are a CommonJS module";
- body.forEach(function (bodyElement) {
- if (isEsModuleType(bodyElement)) {
- if (kind === "CommonJS") {
- _this2.raise(bodyElement.start, errorMessage);
- }
- kind = "ES";
- } else if (bodyElement.type === "DeclareModuleExports") {
- if (hasModuleExport) {
- _this2.raise(bodyElement.start, "Duplicate `declare module.exports` statement");
- }
- if (kind === "ES") _this2.raise(bodyElement.start, errorMessage);
- kind = "CommonJS";
- hasModuleExport = true;
- }
- });
- node.kind = kind || "CommonJS";
- return this.finishNode(node, "DeclareModule");
- };
- _proto.flowParseDeclareExportDeclaration = function flowParseDeclareExportDeclaration(node, insideModule) {
- this.expect(types._export);
- if (this.eat(types._default)) {
- if (this.match(types._function) || this.match(types._class)) {
- node.declaration = this.flowParseDeclare(this.startNode());
- } else {
- node.declaration = this.flowParseType();
- this.semicolon();
- }
- node["default"] = true;
- return this.finishNode(node, "DeclareExportDeclaration");
- } else {
- if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
- var label = this.state.value;
- var suggestion = exportSuggestions[label];
- this.unexpected(this.state.start, "`declare export " + label + "` is not supported. Use `" + suggestion + "` instead");
- }
- if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) {
- node.declaration = this.flowParseDeclare(this.startNode());
- node["default"] = false;
- return this.finishNode(node, "DeclareExportDeclaration");
- } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
- node = this.parseExport(node);
- if (node.type === "ExportNamedDeclaration") {
- node.type = "ExportDeclaration";
- node["default"] = false;
- delete node.exportKind;
- }
- node.type = "Declare" + node.type;
- return node;
- }
- }
- throw this.unexpected();
- };
- _proto.flowParseDeclareModuleExports = function flowParseDeclareModuleExports(node) {
- this.next();
- this.expectContextual("exports");
- node.typeAnnotation = this.flowParseTypeAnnotation();
- this.semicolon();
- return this.finishNode(node, "DeclareModuleExports");
- };
- _proto.flowParseDeclareTypeAlias = function flowParseDeclareTypeAlias(node) {
- this.next();
- this.flowParseTypeAlias(node);
- node.type = "DeclareTypeAlias";
- return node;
- };
- _proto.flowParseDeclareOpaqueType = function flowParseDeclareOpaqueType(node) {
- this.next();
- this.flowParseOpaqueType(node, true);
- node.type = "DeclareOpaqueType";
- return node;
- };
- _proto.flowParseDeclareInterface = function flowParseDeclareInterface(node) {
- this.next();
- this.flowParseInterfaceish(node);
- return this.finishNode(node, "DeclareInterface");
- };
- _proto.flowParseInterfaceish = function flowParseInterfaceish(node, isClass) {
- if (isClass === void 0) {
- isClass = false;
- }
- node.id = this.flowParseRestrictedIdentifier(!isClass, true);
- this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- } else {
- node.typeParameters = null;
- }
- node["extends"] = [];
- node["implements"] = [];
- node.mixins = [];
- if (this.eat(types._extends)) {
- do {
- node["extends"].push(this.flowParseInterfaceExtends());
- } while (!isClass && this.eat(types.comma));
- }
- if (this.isContextual("mixins")) {
- this.next();
- do {
- node.mixins.push(this.flowParseInterfaceExtends());
- } while (this.eat(types.comma));
- }
- if (this.isContextual("implements")) {
- this.next();
- do {
- node["implements"].push(this.flowParseInterfaceExtends());
- } while (this.eat(types.comma));
- }
- node.body = this.flowParseObjectType({
- allowStatic: isClass,
- allowExact: false,
- allowSpread: false,
- allowProto: isClass,
- allowInexact: false
- });
- };
- _proto.flowParseInterfaceExtends = function flowParseInterfaceExtends() {
- var node = this.startNode();
- node.id = this.flowParseQualifiedTypeIdentifier();
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterInstantiation();
- } else {
- node.typeParameters = null;
- }
- return this.finishNode(node, "InterfaceExtends");
- };
- _proto.flowParseInterface = function flowParseInterface(node) {
- this.flowParseInterfaceish(node);
- return this.finishNode(node, "InterfaceDeclaration");
- };
- _proto.checkNotUnderscore = function checkNotUnderscore(word) {
- if (word === "_") {
- this.raise(this.state.start, "`_` is only allowed as a type argument to call or new");
- }
- };
- _proto.checkReservedType = function checkReservedType(word, startLoc, declaration) {
- if (!reservedTypes.has(word)) return;
- if (declaration) {
- this.raise(startLoc, "Cannot overwrite reserved type " + word);
- return;
- }
- this.raise(startLoc, "Unexpected reserved type " + word);
- };
- _proto.flowParseRestrictedIdentifier = function flowParseRestrictedIdentifier(liberal, declaration) {
- this.checkReservedType(this.state.value, this.state.start, declaration);
- return this.parseIdentifier(liberal);
- };
- _proto.flowParseTypeAlias = function flowParseTypeAlias(node) {
- node.id = this.flowParseRestrictedIdentifier(false, true);
- this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- } else {
- node.typeParameters = null;
- }
- node.right = this.flowParseTypeInitialiser(types.eq);
- this.semicolon();
- return this.finishNode(node, "TypeAlias");
- };
- _proto.flowParseOpaqueType = function flowParseOpaqueType(node, declare) {
- this.expectContextual("type");
- node.id = this.flowParseRestrictedIdentifier(true, true);
- this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- } else {
- node.typeParameters = null;
- }
- node.supertype = null;
- if (this.match(types.colon)) {
- node.supertype = this.flowParseTypeInitialiser(types.colon);
- }
- node.impltype = null;
- if (!declare) {
- node.impltype = this.flowParseTypeInitialiser(types.eq);
- }
- this.semicolon();
- return this.finishNode(node, "OpaqueType");
- };
- _proto.flowParseTypeParameter = function flowParseTypeParameter(requireDefault) {
- if (requireDefault === void 0) {
- requireDefault = false;
- }
- var nodeStart = this.state.start;
- var node = this.startNode();
- var variance = this.flowParseVariance();
- var ident = this.flowParseTypeAnnotatableIdentifier();
- node.name = ident.name;
- node.variance = variance;
- node.bound = ident.typeAnnotation;
- if (this.match(types.eq)) {
- this.eat(types.eq);
- node["default"] = this.flowParseType();
- } else {
- if (requireDefault) {
- this.raise(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.");
- }
- }
- return this.finishNode(node, "TypeParameter");
- };
- _proto.flowParseTypeParameterDeclaration = function flowParseTypeParameterDeclaration() {
- var oldInType = this.state.inType;
- var node = this.startNode();
- node.params = [];
- this.state.inType = true;
- if (this.isRelational("<") || this.match(types.jsxTagStart)) {
- this.next();
- } else {
- this.unexpected();
- }
- var defaultRequired = false;
- do {
- var typeParameter = this.flowParseTypeParameter(defaultRequired);
- node.params.push(typeParameter);
- if (typeParameter["default"]) {
- defaultRequired = true;
- }
- if (!this.isRelational(">")) {
- this.expect(types.comma);
- }
- } while (!this.isRelational(">"));
- this.expectRelational(">");
- this.state.inType = oldInType;
- return this.finishNode(node, "TypeParameterDeclaration");
- };
- _proto.flowParseTypeParameterInstantiation = function flowParseTypeParameterInstantiation() {
- var node = this.startNode();
- var oldInType = this.state.inType;
- node.params = [];
- this.state.inType = true;
- this.expectRelational("<");
- var oldNoAnonFunctionType = this.state.noAnonFunctionType;
- this.state.noAnonFunctionType = false;
- while (!this.isRelational(">")) {
- node.params.push(this.flowParseType());
- if (!this.isRelational(">")) {
- this.expect(types.comma);
- }
- }
- this.state.noAnonFunctionType = oldNoAnonFunctionType;
- this.expectRelational(">");
- this.state.inType = oldInType;
- return this.finishNode(node, "TypeParameterInstantiation");
- };
- _proto.flowParseTypeParameterInstantiationCallOrNew = function flowParseTypeParameterInstantiationCallOrNew() {
- var node = this.startNode();
- var oldInType = this.state.inType;
- node.params = [];
- this.state.inType = true;
- this.expectRelational("<");
- while (!this.isRelational(">")) {
- node.params.push(this.flowParseTypeOrImplicitInstantiation());
- if (!this.isRelational(">")) {
- this.expect(types.comma);
- }
- }
- this.expectRelational(">");
- this.state.inType = oldInType;
- return this.finishNode(node, "TypeParameterInstantiation");
- };
- _proto.flowParseInterfaceType = function flowParseInterfaceType() {
- var node = this.startNode();
- this.expectContextual("interface");
- node["extends"] = [];
- if (this.eat(types._extends)) {
- do {
- node["extends"].push(this.flowParseInterfaceExtends());
- } while (this.eat(types.comma));
- }
- node.body = this.flowParseObjectType({
- allowStatic: false,
- allowExact: false,
- allowSpread: false,
- allowProto: false,
- allowInexact: false
- });
- return this.finishNode(node, "InterfaceTypeAnnotation");
- };
- _proto.flowParseObjectPropertyKey = function flowParseObjectPropertyKey() {
- return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
- };
- _proto.flowParseObjectTypeIndexer = function flowParseObjectTypeIndexer(node, isStatic, variance) {
- node["static"] = isStatic;
- if (this.lookahead().type === types.colon) {
- node.id = this.flowParseObjectPropertyKey();
- node.key = this.flowParseTypeInitialiser();
- } else {
- node.id = null;
- node.key = this.flowParseType();
- }
- this.expect(types.bracketR);
- node.value = this.flowParseTypeInitialiser();
- node.variance = variance;
- return this.finishNode(node, "ObjectTypeIndexer");
- };
- _proto.flowParseObjectTypeInternalSlot = function flowParseObjectTypeInternalSlot(node, isStatic) {
- node["static"] = isStatic;
- node.id = this.flowParseObjectPropertyKey();
- this.expect(types.bracketR);
- this.expect(types.bracketR);
- if (this.isRelational("<") || this.match(types.parenL)) {
- node.method = true;
- node.optional = false;
- node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
- } else {
- node.method = false;
- if (this.eat(types.question)) {
- node.optional = true;
- }
- node.value = this.flowParseTypeInitialiser();
- }
- return this.finishNode(node, "ObjectTypeInternalSlot");
- };
- _proto.flowParseObjectTypeMethodish = function flowParseObjectTypeMethodish(node) {
- node.params = [];
- node.rest = null;
- node.typeParameters = null;
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- }
- this.expect(types.parenL);
- while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
- node.params.push(this.flowParseFunctionTypeParam());
- if (!this.match(types.parenR)) {
- this.expect(types.comma);
- }
- }
- if (this.eat(types.ellipsis)) {
- node.rest = this.flowParseFunctionTypeParam();
- }
- this.expect(types.parenR);
- node.returnType = this.flowParseTypeInitialiser();
- return this.finishNode(node, "FunctionTypeAnnotation");
- };
- _proto.flowParseObjectTypeCallProperty = function flowParseObjectTypeCallProperty(node, isStatic) {
- var valueNode = this.startNode();
- node["static"] = isStatic;
- node.value = this.flowParseObjectTypeMethodish(valueNode);
- return this.finishNode(node, "ObjectTypeCallProperty");
- };
- _proto.flowParseObjectType = function flowParseObjectType(_ref) {
- var allowStatic = _ref.allowStatic,
- allowExact = _ref.allowExact,
- allowSpread = _ref.allowSpread,
- allowProto = _ref.allowProto,
- allowInexact = _ref.allowInexact;
- var oldInType = this.state.inType;
- this.state.inType = true;
- var nodeStart = this.startNode();
- nodeStart.callProperties = [];
- nodeStart.properties = [];
- nodeStart.indexers = [];
- nodeStart.internalSlots = [];
- var endDelim;
- var exact;
- var inexact = false;
- if (allowExact && this.match(types.braceBarL)) {
- this.expect(types.braceBarL);
- endDelim = types.braceBarR;
- exact = true;
- } else {
- this.expect(types.braceL);
- endDelim = types.braceR;
- exact = false;
- }
- nodeStart.exact = exact;
- while (!this.match(endDelim)) {
- var isStatic = false;
- var protoStart = null;
- var inexactStart = null;
- var node = this.startNode();
- if (allowProto && this.isContextual("proto")) {
- var lookahead = this.lookahead();
- if (lookahead.type !== types.colon && lookahead.type !== types.question) {
- this.next();
- protoStart = this.state.start;
- allowStatic = false;
- }
- }
- if (allowStatic && this.isContextual("static")) {
- var _lookahead = this.lookahead();
- if (_lookahead.type !== types.colon && _lookahead.type !== types.question) {
- this.next();
- isStatic = true;
- }
- }
- var variance = this.flowParseVariance();
- if (this.eat(types.bracketL)) {
- if (protoStart != null) {
- this.unexpected(protoStart);
- }
- if (this.eat(types.bracketL)) {
- if (variance) {
- this.unexpected(variance.start);
- }
- nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
- } else {
- nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
- }
- } else if (this.match(types.parenL) || this.isRelational("<")) {
- if (protoStart != null) {
- this.unexpected(protoStart);
- }
- if (variance) {
- this.unexpected(variance.start);
- }
- nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
- } else {
- var kind = "init";
- if (this.isContextual("get") || this.isContextual("set")) {
- var _lookahead2 = this.lookahead();
- if (_lookahead2.type === types.name || _lookahead2.type === types.string || _lookahead2.type === types.num) {
- kind = this.state.value;
- this.next();
- }
- }
- var propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
- if (propOrInexact === null) {
- inexact = true;
- inexactStart = this.state.lastTokStart;
- } else {
- nodeStart.properties.push(propOrInexact);
- }
- }
- this.flowObjectTypeSemicolon();
- if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) {
- this.raise(inexactStart, "Explicit inexact syntax must appear at the end of an inexact object");
- }
- }
- this.expect(endDelim);
- if (allowSpread) {
- nodeStart.inexact = inexact;
- }
- var out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
- this.state.inType = oldInType;
- return out;
- };
- _proto.flowParseObjectTypeProperty = function flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {
- if (this.eat(types.ellipsis)) {
- var isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR);
- if (isInexactToken) {
- if (!allowSpread) {
- this.raise(this.state.lastTokStart, "Explicit inexact syntax cannot appear in class or interface definitions");
- } else if (!allowInexact) {
- this.raise(this.state.lastTokStart, "Explicit inexact syntax cannot appear inside an explicit exact object type");
- }
- if (variance) {
- this.raise(variance.start, "Explicit inexact syntax cannot have variance");
- }
- return null;
- }
- if (!allowSpread) {
- this.raise(this.state.lastTokStart, "Spread operator cannot appear in class or interface definitions");
- }
- if (protoStart != null) {
- this.unexpected(protoStart);
- }
- if (variance) {
- this.raise(variance.start, "Spread properties cannot have variance");
- }
- node.argument = this.flowParseType();
- return this.finishNode(node, "ObjectTypeSpreadProperty");
- } else {
- node.key = this.flowParseObjectPropertyKey();
- node["static"] = isStatic;
- node.proto = protoStart != null;
- node.kind = kind;
- var optional = false;
- if (this.isRelational("<") || this.match(types.parenL)) {
- node.method = true;
- if (protoStart != null) {
- this.unexpected(protoStart);
- }
- if (variance) {
- this.unexpected(variance.start);
- }
- node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
- if (kind === "get" || kind === "set") {
- this.flowCheckGetterSetterParams(node);
- }
- } else {
- if (kind !== "init") this.unexpected();
- node.method = false;
- if (this.eat(types.question)) {
- optional = true;
- }
- node.value = this.flowParseTypeInitialiser();
- node.variance = variance;
- }
- node.optional = optional;
- return this.finishNode(node, "ObjectTypeProperty");
- }
- };
- _proto.flowCheckGetterSetterParams = function flowCheckGetterSetterParams(property) {
- var paramCount = property.kind === "get" ? 0 : 1;
- var start = property.start;
- var length = property.value.params.length + (property.value.rest ? 1 : 0);
- if (length !== paramCount) {
- if (property.kind === "get") {
- this.raise(start, "getter must not have any formal parameters");
- } else {
- this.raise(start, "setter must have exactly one formal parameter");
- }
- }
- if (property.kind === "set" && property.value.rest) {
- this.raise(start, "setter function argument must not be a rest parameter");
- }
- };
- _proto.flowObjectTypeSemicolon = function flowObjectTypeSemicolon() {
- if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {
- this.unexpected();
- }
- };
- _proto.flowParseQualifiedTypeIdentifier = function flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
- startPos = startPos || this.state.start;
- startLoc = startLoc || this.state.startLoc;
- var node = id || this.flowParseRestrictedIdentifier(true);
- while (this.eat(types.dot)) {
- var node2 = this.startNodeAt(startPos, startLoc);
- node2.qualification = node;
- node2.id = this.flowParseRestrictedIdentifier(true);
- node = this.finishNode(node2, "QualifiedTypeIdentifier");
- }
- return node;
- };
- _proto.flowParseGenericType = function flowParseGenericType(startPos, startLoc, id) {
- var node = this.startNodeAt(startPos, startLoc);
- node.typeParameters = null;
- node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterInstantiation();
- }
- return this.finishNode(node, "GenericTypeAnnotation");
- };
- _proto.flowParseTypeofType = function flowParseTypeofType() {
- var node = this.startNode();
- this.expect(types._typeof);
- node.argument = this.flowParsePrimaryType();
- return this.finishNode(node, "TypeofTypeAnnotation");
- };
- _proto.flowParseTupleType = function flowParseTupleType() {
- var node = this.startNode();
- node.types = [];
- this.expect(types.bracketL);
- while (this.state.pos < this.length && !this.match(types.bracketR)) {
- node.types.push(this.flowParseType());
- if (this.match(types.bracketR)) break;
- this.expect(types.comma);
- }
- this.expect(types.bracketR);
- return this.finishNode(node, "TupleTypeAnnotation");
- };
- _proto.flowParseFunctionTypeParam = function flowParseFunctionTypeParam() {
- var name = null;
- var optional = false;
- var typeAnnotation = null;
- var node = this.startNode();
- var lh = this.lookahead();
- if (lh.type === types.colon || lh.type === types.question) {
- name = this.parseIdentifier();
- if (this.eat(types.question)) {
- optional = true;
- }
- typeAnnotation = this.flowParseTypeInitialiser();
- } else {
- typeAnnotation = this.flowParseType();
- }
- node.name = name;
- node.optional = optional;
- node.typeAnnotation = typeAnnotation;
- return this.finishNode(node, "FunctionTypeParam");
- };
- _proto.reinterpretTypeAsFunctionTypeParam = function reinterpretTypeAsFunctionTypeParam(type) {
- var node = this.startNodeAt(type.start, type.loc.start);
- node.name = null;
- node.optional = false;
- node.typeAnnotation = type;
- return this.finishNode(node, "FunctionTypeParam");
- };
- _proto.flowParseFunctionTypeParams = function flowParseFunctionTypeParams(params) {
- if (params === void 0) {
- params = [];
- }
- var rest = null;
- while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
- params.push(this.flowParseFunctionTypeParam());
- if (!this.match(types.parenR)) {
- this.expect(types.comma);
- }
- }
- if (this.eat(types.ellipsis)) {
- rest = this.flowParseFunctionTypeParam();
- }
- return {
- params: params,
- rest: rest
- };
- };
- _proto.flowIdentToTypeAnnotation = function flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
- switch (id.name) {
- case "any":
- return this.finishNode(node, "AnyTypeAnnotation");
- case "bool":
- case "boolean":
- return this.finishNode(node, "BooleanTypeAnnotation");
- case "mixed":
- return this.finishNode(node, "MixedTypeAnnotation");
- case "empty":
- return this.finishNode(node, "EmptyTypeAnnotation");
- case "number":
- return this.finishNode(node, "NumberTypeAnnotation");
- case "string":
- return this.finishNode(node, "StringTypeAnnotation");
- default:
- this.checkNotUnderscore(id.name);
- return this.flowParseGenericType(startPos, startLoc, id);
- }
- };
- _proto.flowParsePrimaryType = function flowParsePrimaryType() {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var node = this.startNode();
- var tmp;
- var type;
- var isGroupedType = false;
- var oldNoAnonFunctionType = this.state.noAnonFunctionType;
- switch (this.state.type) {
- case types.name:
- if (this.isContextual("interface")) {
- return this.flowParseInterfaceType();
- }
- return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
- case types.braceL:
- return this.flowParseObjectType({
- allowStatic: false,
- allowExact: false,
- allowSpread: true,
- allowProto: false,
- allowInexact: true
- });
- case types.braceBarL:
- return this.flowParseObjectType({
- allowStatic: false,
- allowExact: true,
- allowSpread: true,
- allowProto: false,
- allowInexact: false
- });
- case types.bracketL:
- this.state.noAnonFunctionType = false;
- type = this.flowParseTupleType();
- this.state.noAnonFunctionType = oldNoAnonFunctionType;
- return type;
- case types.relational:
- if (this.state.value === "<") {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- this.expect(types.parenL);
- tmp = this.flowParseFunctionTypeParams();
- node.params = tmp.params;
- node.rest = tmp.rest;
- this.expect(types.parenR);
- this.expect(types.arrow);
- node.returnType = this.flowParseType();
- return this.finishNode(node, "FunctionTypeAnnotation");
- }
- break;
- case types.parenL:
- this.next();
- if (!this.match(types.parenR) && !this.match(types.ellipsis)) {
- if (this.match(types.name)) {
- var token = this.lookahead().type;
- isGroupedType = token !== types.question && token !== types.colon;
- } else {
- isGroupedType = true;
- }
- }
- if (isGroupedType) {
- this.state.noAnonFunctionType = false;
- type = this.flowParseType();
- this.state.noAnonFunctionType = oldNoAnonFunctionType;
- if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {
- this.expect(types.parenR);
- return type;
- } else {
- this.eat(types.comma);
- }
- }
- if (type) {
- tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
- } else {
- tmp = this.flowParseFunctionTypeParams();
- }
- node.params = tmp.params;
- node.rest = tmp.rest;
- this.expect(types.parenR);
- this.expect(types.arrow);
- node.returnType = this.flowParseType();
- node.typeParameters = null;
- return this.finishNode(node, "FunctionTypeAnnotation");
- case types.string:
- return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
- case types._true:
- case types._false:
- node.value = this.match(types._true);
- this.next();
- return this.finishNode(node, "BooleanLiteralTypeAnnotation");
- case types.plusMin:
- if (this.state.value === "-") {
- this.next();
- if (this.match(types.num)) {
- return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start);
- }
- if (this.match(types.bigint)) {
- return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start);
- }
- throw this.raise(this.state.start, "Unexpected token, expected \"number\" or \"bigint\"");
- }
- this.unexpected();
- case types.num:
- return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
- case types.bigint:
- return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
- case types._void:
- this.next();
- return this.finishNode(node, "VoidTypeAnnotation");
- case types._null:
- this.next();
- return this.finishNode(node, "NullLiteralTypeAnnotation");
- case types._this:
- this.next();
- return this.finishNode(node, "ThisTypeAnnotation");
- case types.star:
- this.next();
- return this.finishNode(node, "ExistsTypeAnnotation");
- default:
- if (this.state.type.keyword === "typeof") {
- return this.flowParseTypeofType();
- } else if (this.state.type.keyword) {
- var label = this.state.type.label;
- this.next();
- return _superClass.prototype.createIdentifier.call(this, node, label);
- }
- }
- throw this.unexpected();
- };
- _proto.flowParsePostfixType = function flowParsePostfixType() {
- var startPos = this.state.start,
- startLoc = this.state.startLoc;
- var type = this.flowParsePrimaryType();
- while (this.match(types.bracketL) && !this.canInsertSemicolon()) {
- var node = this.startNodeAt(startPos, startLoc);
- node.elementType = type;
- this.expect(types.bracketL);
- this.expect(types.bracketR);
- type = this.finishNode(node, "ArrayTypeAnnotation");
- }
- return type;
- };
- _proto.flowParsePrefixType = function flowParsePrefixType() {
- var node = this.startNode();
- if (this.eat(types.question)) {
- node.typeAnnotation = this.flowParsePrefixType();
- return this.finishNode(node, "NullableTypeAnnotation");
- } else {
- return this.flowParsePostfixType();
- }
- };
- _proto.flowParseAnonFunctionWithoutParens = function flowParseAnonFunctionWithoutParens() {
- var param = this.flowParsePrefixType();
- if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
- var node = this.startNodeAt(param.start, param.loc.start);
- node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
- node.rest = null;
- node.returnType = this.flowParseType();
- node.typeParameters = null;
- return this.finishNode(node, "FunctionTypeAnnotation");
- }
- return param;
- };
- _proto.flowParseIntersectionType = function flowParseIntersectionType() {
- var node = this.startNode();
- this.eat(types.bitwiseAND);
- var type = this.flowParseAnonFunctionWithoutParens();
- node.types = [type];
- while (this.eat(types.bitwiseAND)) {
- node.types.push(this.flowParseAnonFunctionWithoutParens());
- }
- return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
- };
- _proto.flowParseUnionType = function flowParseUnionType() {
- var node = this.startNode();
- this.eat(types.bitwiseOR);
- var type = this.flowParseIntersectionType();
- node.types = [type];
- while (this.eat(types.bitwiseOR)) {
- node.types.push(this.flowParseIntersectionType());
- }
- return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
- };
- _proto.flowParseType = function flowParseType() {
- var oldInType = this.state.inType;
- this.state.inType = true;
- var type = this.flowParseUnionType();
- this.state.inType = oldInType;
- this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType;
- return type;
- };
- _proto.flowParseTypeOrImplicitInstantiation = function flowParseTypeOrImplicitInstantiation() {
- if (this.state.type === types.name && this.state.value === "_") {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var node = this.parseIdentifier();
- return this.flowParseGenericType(startPos, startLoc, node);
- } else {
- return this.flowParseType();
- }
- };
- _proto.flowParseTypeAnnotation = function flowParseTypeAnnotation() {
- var node = this.startNode();
- node.typeAnnotation = this.flowParseTypeInitialiser();
- return this.finishNode(node, "TypeAnnotation");
- };
- _proto.flowParseTypeAnnotatableIdentifier = function flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
- var ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
- if (this.match(types.colon)) {
- ident.typeAnnotation = this.flowParseTypeAnnotation();
- this.resetEndLocation(ident);
- }
- return ident;
- };
- _proto.typeCastToParameter = function typeCastToParameter(node) {
- node.expression.typeAnnotation = node.typeAnnotation;
- this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
- return node.expression;
- };
- _proto.flowParseVariance = function flowParseVariance() {
- var variance = null;
- if (this.match(types.plusMin)) {
- variance = this.startNode();
- if (this.state.value === "+") {
- variance.kind = "plus";
- } else {
- variance.kind = "minus";
- }
- this.next();
- this.finishNode(variance, "Variance");
- }
- return variance;
- };
- _proto.parseFunctionBody = function parseFunctionBody(node, allowExpressionBody, isMethod) {
- var _this3 = this;
- if (isMethod === void 0) {
- isMethod = false;
- }
- if (allowExpressionBody) {
- return this.forwardNoArrowParamsConversionAt(node, function () {
- return _superClass.prototype.parseFunctionBody.call(_this3, node, true, isMethod);
- });
- }
- return _superClass.prototype.parseFunctionBody.call(this, node, false, isMethod);
- };
- _proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, isMethod) {
- if (isMethod === void 0) {
- isMethod = false;
- }
- if (this.match(types.colon)) {
- var typeNode = this.startNode();
- var _this$flowParseTypeAn2 = this.flowParseTypeAndPredicateInitialiser();
- typeNode.typeAnnotation = _this$flowParseTypeAn2[0];
- node.predicate = _this$flowParseTypeAn2[1];
- node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
- }
- _superClass.prototype.parseFunctionBodyAndFinish.call(this, node, type, isMethod);
- };
- _proto.parseStatement = function parseStatement(context, topLevel) {
- if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
- var node = this.startNode();
- this.next();
- return this.flowParseInterface(node);
- } else if (this.shouldParseEnums() && this.isContextual("enum")) {
- var _node = this.startNode();
- this.next();
- return this.flowParseEnumDeclaration(_node);
- } else {
- var stmt = _superClass.prototype.parseStatement.call(this, context, topLevel);
- if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
- this.flowPragma = null;
- }
- return stmt;
- }
- };
- _proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
- if (expr.type === "Identifier") {
- if (expr.name === "declare") {
- if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) {
- return this.flowParseDeclare(node);
- }
- } else if (this.match(types.name)) {
- if (expr.name === "interface") {
- return this.flowParseInterface(node);
- } else if (expr.name === "type") {
- return this.flowParseTypeAlias(node);
- } else if (expr.name === "opaque") {
- return this.flowParseOpaqueType(node, false);
- }
- }
- }
- return _superClass.prototype.parseExpressionStatement.call(this, node, expr);
- };
- _proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
- return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || _superClass.prototype.shouldParseExportDeclaration.call(this);
- };
- _proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
- if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
- return false;
- }
- return _superClass.prototype.isExportDefaultSpecifier.call(this);
- };
- _proto.parseExportDefaultExpression = function parseExportDefaultExpression() {
- if (this.shouldParseEnums() && this.isContextual("enum")) {
- var node = this.startNode();
- this.next();
- return this.flowParseEnumDeclaration(node);
- }
- return _superClass.prototype.parseExportDefaultExpression.call(this);
- };
- _proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
- var _this4 = this;
- if (!this.match(types.question)) return expr;
- if (refNeedsArrowPos) {
- var result = this.tryParse(function () {
- return _superClass.prototype.parseConditional.call(_this4, expr, noIn, startPos, startLoc);
- });
- if (!result.node) {
- refNeedsArrowPos.start = result.error.pos || this.state.start;
- return expr;
- }
- if (result.error) this.state = result.failState;
- return result.node;
- }
- this.expect(types.question);
- var state = this.state.clone();
- var originalNoArrowAt = this.state.noArrowAt;
- var node = this.startNodeAt(startPos, startLoc);
- var _this$tryParseConditi = this.tryParseConditionalConsequent(),
- consequent = _this$tryParseConditi.consequent,
- failed = _this$tryParseConditi.failed;
- var _this$getArrowLikeExp = this.getArrowLikeExpressions(consequent),
- valid = _this$getArrowLikeExp[0],
- invalid = _this$getArrowLikeExp[1];
- if (failed || invalid.length > 0) {
- var noArrowAt = [].concat(originalNoArrowAt);
- if (invalid.length > 0) {
- this.state = state;
- this.state.noArrowAt = noArrowAt;
- for (var i = 0; i < invalid.length; i++) {
- noArrowAt.push(invalid[i].start);
- }
- var _this$tryParseConditi2 = this.tryParseConditionalConsequent();
- consequent = _this$tryParseConditi2.consequent;
- failed = _this$tryParseConditi2.failed;
- var _this$getArrowLikeExp2 = this.getArrowLikeExpressions(consequent);
- valid = _this$getArrowLikeExp2[0];
- invalid = _this$getArrowLikeExp2[1];
- }
- if (failed && valid.length > 1) {
- this.raise(state.start, "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.");
- }
- if (failed && valid.length === 1) {
- this.state = state;
- this.state.noArrowAt = noArrowAt.concat(valid[0].start);
- var _this$tryParseConditi3 = this.tryParseConditionalConsequent();
- consequent = _this$tryParseConditi3.consequent;
- failed = _this$tryParseConditi3.failed;
- }
- }
- this.getArrowLikeExpressions(consequent, true);
- this.state.noArrowAt = originalNoArrowAt;
- this.expect(types.colon);
- node.test = expr;
- node.consequent = consequent;
- node.alternate = this.forwardNoArrowParamsConversionAt(node, function () {
- return _this4.parseMaybeAssign(noIn, undefined, undefined, undefined);
- });
- return this.finishNode(node, "ConditionalExpression");
- };
- _proto.tryParseConditionalConsequent = function tryParseConditionalConsequent() {
- this.state.noArrowParamsConversionAt.push(this.state.start);
- var consequent = this.parseMaybeAssign();
- var failed = !this.match(types.colon);
- this.state.noArrowParamsConversionAt.pop();
- return {
- consequent: consequent,
- failed: failed
- };
- };
- _proto.getArrowLikeExpressions = function getArrowLikeExpressions(node, disallowInvalid) {
- var _this5 = this;
- var stack = [node];
- var arrows = [];
- while (stack.length !== 0) {
- var _node2 = stack.pop();
- if (_node2.type === "ArrowFunctionExpression") {
- if (_node2.typeParameters || !_node2.returnType) {
- this.finishArrowValidation(_node2);
- } else {
- arrows.push(_node2);
- }
- stack.push(_node2.body);
- } else if (_node2.type === "ConditionalExpression") {
- stack.push(_node2.consequent);
- stack.push(_node2.alternate);
- }
- }
- if (disallowInvalid) {
- arrows.forEach(function (node) {
- return _this5.finishArrowValidation(node);
- });
- return [arrows, []];
- }
- return partition(arrows, function (node) {
- return node.params.every(function (param) {
- return _this5.isAssignable(param, true);
- });
- });
- };
- _proto.finishArrowValidation = function finishArrowValidation(node) {
- var _node$extra;
- this.toAssignableList(node.params, true, "arrow function parameters", (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma);
- this.scope.enter(functionFlags(false, false) | SCOPE_ARROW);
- _superClass.prototype.checkParams.call(this, node, false, true);
- this.scope.exit();
- };
- _proto.forwardNoArrowParamsConversionAt = function forwardNoArrowParamsConversionAt(node, parse) {
- var result;
- if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
- this.state.noArrowParamsConversionAt.push(this.state.start);
- result = parse();
- this.state.noArrowParamsConversionAt.pop();
- } else {
- result = parse();
- }
- return result;
- };
- _proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
- node = _superClass.prototype.parseParenItem.call(this, node, startPos, startLoc);
- if (this.eat(types.question)) {
- node.optional = true;
- this.resetEndLocation(node);
- }
- if (this.match(types.colon)) {
- var typeCastNode = this.startNodeAt(startPos, startLoc);
- typeCastNode.expression = node;
- typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
- return this.finishNode(typeCastNode, "TypeCastExpression");
- }
- return node;
- };
- _proto.assertModuleNodeAllowed = function assertModuleNodeAllowed(node) {
- if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
- return;
- }
- _superClass.prototype.assertModuleNodeAllowed.call(this, node);
- };
- _proto.parseExport = function parseExport(node) {
- var decl = _superClass.prototype.parseExport.call(this, node);
- if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
- decl.exportKind = decl.exportKind || "value";
- }
- return decl;
- };
- _proto.parseExportDeclaration = function parseExportDeclaration(node) {
- if (this.isContextual("type")) {
- node.exportKind = "type";
- var declarationNode = this.startNode();
- this.next();
- if (this.match(types.braceL)) {
- node.specifiers = this.parseExportSpecifiers();
- this.parseExportFrom(node);
- return null;
- } else {
- return this.flowParseTypeAlias(declarationNode);
- }
- } else if (this.isContextual("opaque")) {
- node.exportKind = "type";
- var _declarationNode = this.startNode();
- this.next();
- return this.flowParseOpaqueType(_declarationNode, false);
- } else if (this.isContextual("interface")) {
- node.exportKind = "type";
- var _declarationNode2 = this.startNode();
- this.next();
- return this.flowParseInterface(_declarationNode2);
- } else if (this.shouldParseEnums() && this.isContextual("enum")) {
- node.exportKind = "value";
- var _declarationNode3 = this.startNode();
- this.next();
- return this.flowParseEnumDeclaration(_declarationNode3);
- } else {
- return _superClass.prototype.parseExportDeclaration.call(this, node);
- }
- };
- _proto.eatExportStar = function eatExportStar(node) {
- if (_superClass.prototype.eatExportStar.apply(this, arguments)) return true;
- if (this.isContextual("type") && this.lookahead().type === types.star) {
- node.exportKind = "type";
- this.next();
- this.next();
- return true;
- }
- return false;
- };
- _proto.maybeParseExportNamespaceSpecifier = function maybeParseExportNamespaceSpecifier(node) {
- var pos = this.state.start;
- var hasNamespace = _superClass.prototype.maybeParseExportNamespaceSpecifier.call(this, node);
- if (hasNamespace && node.exportKind === "type") {
- this.unexpected(pos);
- }
- return hasNamespace;
- };
- _proto.parseClassId = function parseClassId(node, isStatement, optionalId) {
- _superClass.prototype.parseClassId.call(this, node, isStatement, optionalId);
- if (this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- }
- };
- _proto.getTokenFromCode = function getTokenFromCode(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (code === 123 && next === 124) {
- return this.finishOp(types.braceBarL, 2);
- } else if (this.state.inType && (code === 62 || code === 60)) {
- return this.finishOp(types.relational, 1);
- } else if (isIteratorStart(code, next)) {
- this.state.isIterator = true;
- return _superClass.prototype.readWord.call(this);
- } else {
- return _superClass.prototype.getTokenFromCode.call(this, code);
- }
- };
- _proto.isAssignable = function isAssignable(node, isBinding) {
- var _this6 = this;
- switch (node.type) {
- case "Identifier":
- case "ObjectPattern":
- case "ArrayPattern":
- case "AssignmentPattern":
- return true;
- case "ObjectExpression":
- {
- var last = node.properties.length - 1;
- return node.properties.every(function (prop, i) {
- return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && _this6.isAssignable(prop);
- });
- }
- case "ObjectProperty":
- return this.isAssignable(node.value);
- case "SpreadElement":
- return this.isAssignable(node.argument);
- case "ArrayExpression":
- return node.elements.every(function (element) {
- return _this6.isAssignable(element);
- });
- case "AssignmentExpression":
- return node.operator === "=";
- case "ParenthesizedExpression":
- case "TypeCastExpression":
- return this.isAssignable(node.expression);
- case "MemberExpression":
- case "OptionalMemberExpression":
- return !isBinding;
- default:
- return false;
- }
- };
- _proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
- if (node.type === "TypeCastExpression") {
- return _superClass.prototype.toAssignable.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
- } else {
- return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
- }
- };
- _proto.toAssignableList = function toAssignableList(exprList, isBinding, contextDescription, trailingCommaPos) {
- for (var i = 0; i < exprList.length; i++) {
- var expr = exprList[i];
- if (expr && expr.type === "TypeCastExpression") {
- exprList[i] = this.typeCastToParameter(expr);
- }
- }
- return _superClass.prototype.toAssignableList.call(this, exprList, isBinding, contextDescription, trailingCommaPos);
- };
- _proto.toReferencedList = function toReferencedList(exprList, isParenthesizedExpr) {
- for (var i = 0; i < exprList.length; i++) {
- var expr = exprList[i];
- if (expr && expr.type === "TypeCastExpression" && (!expr.extra || !expr.extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
- this.raise(expr.typeAnnotation.start, "The type cast expression is expected to be wrapped with parenthesis");
- }
- }
- return exprList;
- };
- _proto.checkLVal = function checkLVal(expr, bindingType, checkClashes, contextDescription) {
- if (bindingType === void 0) {
- bindingType = BIND_NONE;
- }
- if (expr.type !== "TypeCastExpression") {
- return _superClass.prototype.checkLVal.call(this, expr, bindingType, checkClashes, contextDescription);
- }
- };
- _proto.parseClassProperty = function parseClassProperty(node) {
- if (this.match(types.colon)) {
- node.typeAnnotation = this.flowParseTypeAnnotation();
- }
- return _superClass.prototype.parseClassProperty.call(this, node);
- };
- _proto.parseClassPrivateProperty = function parseClassPrivateProperty(node) {
- if (this.match(types.colon)) {
- node.typeAnnotation = this.flowParseTypeAnnotation();
- }
- return _superClass.prototype.parseClassPrivateProperty.call(this, node);
- };
- _proto.isClassMethod = function isClassMethod() {
- return this.isRelational("<") || _superClass.prototype.isClassMethod.call(this);
- };
- _proto.isClassProperty = function isClassProperty() {
- return this.match(types.colon) || _superClass.prototype.isClassProperty.call(this);
- };
- _proto.isNonstaticConstructor = function isNonstaticConstructor(method) {
- return !this.match(types.colon) && _superClass.prototype.isNonstaticConstructor.call(this, method);
- };
- _proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
- if (method.variance) {
- this.unexpected(method.variance.start);
- }
- delete method.variance;
- if (this.isRelational("<")) {
- method.typeParameters = this.flowParseTypeParameterDeclaration();
- }
- _superClass.prototype.pushClassMethod.call(this, classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
- };
- _proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
- if (method.variance) {
- this.unexpected(method.variance.start);
- }
- delete method.variance;
- if (this.isRelational("<")) {
- method.typeParameters = this.flowParseTypeParameterDeclaration();
- }
- _superClass.prototype.pushClassPrivateMethod.call(this, classBody, method, isGenerator, isAsync);
- };
- _proto.parseClassSuper = function parseClassSuper(node) {
- _superClass.prototype.parseClassSuper.call(this, node);
- if (node.superClass && this.isRelational("<")) {
- node.superTypeParameters = this.flowParseTypeParameterInstantiation();
- }
- if (this.isContextual("implements")) {
- this.next();
- var implemented = node["implements"] = [];
- do {
- var _node3 = this.startNode();
- _node3.id = this.flowParseRestrictedIdentifier(true);
- if (this.isRelational("<")) {
- _node3.typeParameters = this.flowParseTypeParameterInstantiation();
- } else {
- _node3.typeParameters = null;
- }
- implemented.push(this.finishNode(_node3, "ClassImplements"));
- } while (this.eat(types.comma));
- }
- };
- _proto.parsePropertyName = function parsePropertyName(node, isPrivateNameAllowed) {
- var variance = this.flowParseVariance();
- var key = _superClass.prototype.parsePropertyName.call(this, node, isPrivateNameAllowed);
- node.variance = variance;
- return key;
- };
- _proto.parseObjPropValue = function parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) {
- if (prop.variance) {
- this.unexpected(prop.variance.start);
- }
- delete prop.variance;
- var typeParameters;
- if (this.isRelational("<")) {
- typeParameters = this.flowParseTypeParameterDeclaration();
- if (!this.match(types.parenL)) this.unexpected();
- }
- _superClass.prototype.parseObjPropValue.call(this, prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc);
- if (typeParameters) {
- (prop.value || prop).typeParameters = typeParameters;
- }
- };
- _proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
- if (this.eat(types.question)) {
- if (param.type !== "Identifier") {
- this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
- }
- param.optional = true;
- }
- if (this.match(types.colon)) {
- param.typeAnnotation = this.flowParseTypeAnnotation();
- }
- this.resetEndLocation(param);
- return param;
- };
- _proto.parseMaybeDefault = function parseMaybeDefault(startPos, startLoc, left) {
- var node = _superClass.prototype.parseMaybeDefault.call(this, startPos, startLoc, left);
- if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
- this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
- }
- return node;
- };
- _proto.shouldParseDefaultImport = function shouldParseDefaultImport(node) {
- if (!hasTypeImportKind(node)) {
- return _superClass.prototype.shouldParseDefaultImport.call(this, node);
- }
- return isMaybeDefaultImport(this.state);
- };
- _proto.parseImportSpecifierLocal = function parseImportSpecifierLocal(node, specifier, type, contextDescription) {
- specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
- this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);
- node.specifiers.push(this.finishNode(specifier, type));
- };
- _proto.maybeParseDefaultImportSpecifier = function maybeParseDefaultImportSpecifier(node) {
- node.importKind = "value";
- var kind = null;
- if (this.match(types._typeof)) {
- kind = "typeof";
- } else if (this.isContextual("type")) {
- kind = "type";
- }
- if (kind) {
- var lh = this.lookahead();
- if (kind === "type" && lh.type === types.star) {
- this.unexpected(lh.start);
- }
- if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) {
- this.next();
- node.importKind = kind;
- }
- }
- return _superClass.prototype.maybeParseDefaultImportSpecifier.call(this, node);
- };
- _proto.parseImportSpecifier = function parseImportSpecifier(node) {
- var specifier = this.startNode();
- var firstIdentLoc = this.state.start;
- var firstIdent = this.parseIdentifier(true);
- var specifierTypeKind = null;
- if (firstIdent.name === "type") {
- specifierTypeKind = "type";
- } else if (firstIdent.name === "typeof") {
- specifierTypeKind = "typeof";
- }
- var isBinding = false;
- if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
- var as_ident = this.parseIdentifier(true);
- if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
- specifier.imported = as_ident;
- specifier.importKind = specifierTypeKind;
- specifier.local = as_ident.__clone();
- } else {
- specifier.imported = firstIdent;
- specifier.importKind = null;
- specifier.local = this.parseIdentifier();
- }
- } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
- specifier.imported = this.parseIdentifier(true);
- specifier.importKind = specifierTypeKind;
- if (this.eatContextual("as")) {
- specifier.local = this.parseIdentifier();
- } else {
- isBinding = true;
- specifier.local = specifier.imported.__clone();
- }
- } else {
- isBinding = true;
- specifier.imported = firstIdent;
- specifier.importKind = null;
- specifier.local = specifier.imported.__clone();
- }
- var nodeIsTypeImport = hasTypeImportKind(node);
- var specifierIsTypeImport = hasTypeImportKind(specifier);
- if (nodeIsTypeImport && specifierIsTypeImport) {
- this.raise(firstIdentLoc, "The `type` and `typeof` keywords on named imports can only be used on regular " + "`import` statements. It cannot be used with `import type` or `import typeof` statements");
- }
- if (nodeIsTypeImport || specifierIsTypeImport) {
- this.checkReservedType(specifier.local.name, specifier.local.start, true);
- }
- if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
- this.checkReservedWord(specifier.local.name, specifier.start, true, true);
- }
- this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier");
- node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
- };
- _proto.parseFunctionParams = function parseFunctionParams(node, allowModifiers) {
- var kind = node.kind;
- if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
- node.typeParameters = this.flowParseTypeParameterDeclaration();
- }
- _superClass.prototype.parseFunctionParams.call(this, node, allowModifiers);
- };
- _proto.parseVarId = function parseVarId(decl, kind) {
- _superClass.prototype.parseVarId.call(this, decl, kind);
- if (this.match(types.colon)) {
- decl.id.typeAnnotation = this.flowParseTypeAnnotation();
- this.resetEndLocation(decl.id);
- }
- };
- _proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
- if (this.match(types.colon)) {
- var oldNoAnonFunctionType = this.state.noAnonFunctionType;
- this.state.noAnonFunctionType = true;
- node.returnType = this.flowParseTypeAnnotation();
- this.state.noAnonFunctionType = oldNoAnonFunctionType;
- }
- return _superClass.prototype.parseAsyncArrowFromCallExpression.call(this, node, call);
- };
- _proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
- return this.match(types.colon) || _superClass.prototype.shouldParseAsyncArrow.call(this);
- };
- _proto.parseMaybeAssign = function parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
- var _this7 = this;
- var state = null;
- var jsx;
- if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) {
- state = this.state.clone();
- jsx = this.tryParse(function () {
- return _superClass.prototype.parseMaybeAssign.call(_this7, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
- }, state);
- if (!jsx.error) return jsx.node;
- var context = this.state.context;
- if (context[context.length - 1] === types$1.j_oTag) {
- context.length -= 2;
- } else if (context[context.length - 1] === types$1.j_expr) {
- context.length -= 1;
- }
- }
- if (jsx && jsx.error || this.isRelational("<")) {
- state = state || this.state.clone();
- var typeParameters;
- var arrow = this.tryParse(function () {
- typeParameters = _this7.flowParseTypeParameterDeclaration();
- var arrowExpression = _this7.forwardNoArrowParamsConversionAt(typeParameters, function () {
- return _superClass.prototype.parseMaybeAssign.call(_this7, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
- });
- arrowExpression.typeParameters = typeParameters;
- _this7.resetStartLocationFromNode(arrowExpression, typeParameters);
- return arrowExpression;
- }, state);
- var arrowExpression = arrow.node && arrow.node.type === "ArrowFunctionExpression" ? arrow.node : null;
- if (!arrow.error && arrowExpression) return arrowExpression;
- if (jsx && jsx.node) {
- this.state = jsx.failState;
- return jsx.node;
- }
- if (arrowExpression) {
- this.state = arrow.failState;
- return arrowExpression;
- }
- if (jsx && jsx.thrown) throw jsx.error;
- if (arrow.thrown) throw arrow.error;
- throw this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration");
- }
- return _superClass.prototype.parseMaybeAssign.call(this, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
- };
- _proto.parseArrow = function parseArrow(node) {
- var _this8 = this;
- if (this.match(types.colon)) {
- var result = this.tryParse(function () {
- var oldNoAnonFunctionType = _this8.state.noAnonFunctionType;
- _this8.state.noAnonFunctionType = true;
- var typeNode = _this8.startNode();
- var _this8$flowParseTypeA = _this8.flowParseTypeAndPredicateInitialiser();
- typeNode.typeAnnotation = _this8$flowParseTypeA[0];
- node.predicate = _this8$flowParseTypeA[1];
- _this8.state.noAnonFunctionType = oldNoAnonFunctionType;
- if (_this8.canInsertSemicolon()) _this8.unexpected();
- if (!_this8.match(types.arrow)) _this8.unexpected();
- return typeNode;
- });
- if (result.thrown) return null;
- if (result.error) this.state = result.failState;
- node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
- }
- return _superClass.prototype.parseArrow.call(this, node);
- };
- _proto.shouldParseArrow = function shouldParseArrow() {
- return this.match(types.colon) || _superClass.prototype.shouldParseArrow.call(this);
- };
- _proto.setArrowFunctionParameters = function setArrowFunctionParameters(node, params) {
- if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
- node.params = params;
- } else {
- _superClass.prototype.setArrowFunctionParameters.call(this, node, params);
- }
- };
- _proto.checkParams = function checkParams(node, allowDuplicates, isArrowFunction) {
- if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
- return;
- }
- return _superClass.prototype.checkParams.apply(this, arguments);
- };
- _proto.parseParenAndDistinguishExpression = function parseParenAndDistinguishExpression(canBeArrow) {
- return _superClass.prototype.parseParenAndDistinguishExpression.call(this, canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
- };
- _proto.parseSubscripts = function parseSubscripts(base, startPos, startLoc, noCalls) {
- var _this9 = this;
- if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
- this.next();
- var node = this.startNodeAt(startPos, startLoc);
- node.callee = base;
- node.arguments = this.parseCallExpressionArguments(types.parenR, false);
- base = this.finishNode(node, "CallExpression");
- } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
- var state = this.state.clone();
- var arrow = this.tryParse(function (abort) {
- return _this9.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort();
- }, state);
- if (!arrow.error && !arrow.aborted) return arrow.node;
- var result = this.tryParse(function () {
- return _superClass.prototype.parseSubscripts.call(_this9, base, startPos, startLoc, noCalls);
- }, state);
- if (result.node && !result.error) return result.node;
- if (arrow.node) {
- this.state = arrow.failState;
- return arrow.node;
- }
- if (result.node) {
- this.state = result.failState;
- return result.node;
- }
- throw arrow.error || result.error;
- }
- return _superClass.prototype.parseSubscripts.call(this, base, startPos, startLoc, noCalls);
- };
- _proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
- var _this10 = this;
- if (this.match(types.questionDot) && this.isLookaheadRelational("<")) {
- subscriptState.optionalChainMember = true;
- if (noCalls) {
- subscriptState.stop = true;
- return base;
- }
- this.next();
- var node = this.startNodeAt(startPos, startLoc);
- node.callee = base;
- node.typeArguments = this.flowParseTypeParameterInstantiation();
- this.expect(types.parenL);
- node.arguments = this.parseCallExpressionArguments(types.parenR, false);
- node.optional = true;
- return this.finishCallExpression(node, true);
- } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
- var _node4 = this.startNodeAt(startPos, startLoc);
- _node4.callee = base;
- var result = this.tryParse(function () {
- _node4.typeArguments = _this10.flowParseTypeParameterInstantiationCallOrNew();
- _this10.expect(types.parenL);
- _node4.arguments = _this10.parseCallExpressionArguments(types.parenR, false);
- if (subscriptState.optionalChainMember) _node4.optional = false;
- return _this10.finishCallExpression(_node4, subscriptState.optionalChainMember);
- });
- if (result.node) {
- if (result.error) this.state = result.failState;
- return result.node;
- }
- }
- return _superClass.prototype.parseSubscript.call(this, base, startPos, startLoc, noCalls, subscriptState);
- };
- _proto.parseNewArguments = function parseNewArguments(node) {
- var _this11 = this;
- var targs = null;
- if (this.shouldParseTypes() && this.isRelational("<")) {
- targs = this.tryParse(function () {
- return _this11.flowParseTypeParameterInstantiationCallOrNew();
- }).node;
- }
- node.typeArguments = targs;
- _superClass.prototype.parseNewArguments.call(this, node);
- };
- _proto.parseAsyncArrowWithTypeParameters = function parseAsyncArrowWithTypeParameters(startPos, startLoc) {
- var node = this.startNodeAt(startPos, startLoc);
- this.parseFunctionParams(node);
- if (!this.parseArrow(node)) return;
- return this.parseArrowExpression(node, undefined, true);
- };
- _proto.readToken_mult_modulo = function readToken_mult_modulo(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (code === 42 && next === 47 && this.state.hasFlowComment) {
- this.state.hasFlowComment = false;
- this.state.pos += 2;
- this.nextToken();
- return;
- }
- _superClass.prototype.readToken_mult_modulo.call(this, code);
- };
- _proto.readToken_pipe_amp = function readToken_pipe_amp(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (code === 124 && next === 125) {
- this.finishOp(types.braceBarR, 2);
- return;
- }
- _superClass.prototype.readToken_pipe_amp.call(this, code);
- };
- _proto.parseTopLevel = function parseTopLevel(file, program) {
- var fileNode = _superClass.prototype.parseTopLevel.call(this, file, program);
- if (this.state.hasFlowComment) {
- this.raise(this.state.pos, "Unterminated flow-comment");
- }
- return fileNode;
- };
- _proto.skipBlockComment = function skipBlockComment() {
- if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
- if (this.state.hasFlowComment) {
- this.unexpected(null, "Cannot have a flow comment inside another flow comment");
- }
- this.hasFlowCommentCompletion();
- this.state.pos += this.skipFlowComment();
- this.state.hasFlowComment = true;
- return;
- }
- if (this.state.hasFlowComment) {
- var end = this.input.indexOf("*-/", this.state.pos += 2);
- if (end === -1) {
- throw this.raise(this.state.pos - 2, "Unterminated comment");
- }
- this.state.pos = end + 3;
- return;
- }
- _superClass.prototype.skipBlockComment.call(this);
- };
- _proto.skipFlowComment = function skipFlowComment() {
- var pos = this.state.pos;
- var shiftToFirstNonWhiteSpace = 2;
- while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
- shiftToFirstNonWhiteSpace++;
- }
- var ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
- var ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
- if (ch2 === 58 && ch3 === 58) {
- return shiftToFirstNonWhiteSpace + 2;
- }
- if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
- return shiftToFirstNonWhiteSpace + 12;
- }
- if (ch2 === 58 && ch3 !== 58) {
- return shiftToFirstNonWhiteSpace;
- }
- return false;
- };
- _proto.hasFlowCommentCompletion = function hasFlowCommentCompletion() {
- var end = this.input.indexOf("*/", this.state.pos);
- if (end === -1) {
- throw this.raise(this.state.pos, "Unterminated comment");
- }
- };
- _proto.flowEnumErrorBooleanMemberNotInitialized = function flowEnumErrorBooleanMemberNotInitialized(pos, _ref2) {
- var enumName = _ref2.enumName,
- memberName = _ref2.memberName;
- this.raise(pos, "Boolean enum members need to be initialized. Use either `" + memberName + " = true,` " + ("or `" + memberName + " = false,` in enum `" + enumName + "`."));
- };
- _proto.flowEnumErrorInvalidMemberName = function flowEnumErrorInvalidMemberName(pos, _ref3) {
- var enumName = _ref3.enumName,
- memberName = _ref3.memberName;
- var suggestion = memberName[0].toUpperCase() + memberName.slice(1);
- this.raise(pos, "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using " + ("`" + memberName + "`, consider using `" + suggestion + "`, in enum `" + enumName + "`."));
- };
- _proto.flowEnumErrorDuplicateMemberName = function flowEnumErrorDuplicateMemberName(pos, _ref4) {
- var enumName = _ref4.enumName,
- memberName = _ref4.memberName;
- this.raise(pos, "Enum member names need to be unique, but the name `" + memberName + "` has already been used " + ("before in enum `" + enumName + "`."));
- };
- _proto.flowEnumErrorInconsistentMemberValues = function flowEnumErrorInconsistentMemberValues(pos, _ref5) {
- var enumName = _ref5.enumName;
- this.raise(pos, "Enum `" + enumName + "` has inconsistent member initializers. Either use no initializers, or " + "consistently use literals (either booleans, numbers, or strings) for all member initializers.");
- };
- _proto.flowEnumErrorInvalidExplicitType = function flowEnumErrorInvalidExplicitType(pos, _ref6) {
- var enumName = _ref6.enumName,
- suppliedType = _ref6.suppliedType;
- var suggestion = "Use one of `boolean`, `number`, `string`, or `symbol` in " + ("enum `" + enumName + "`.");
- var message = suppliedType === null ? "Supplied enum type is not valid. " + suggestion : "Enum type `" + suppliedType + "` is not valid. " + suggestion;
- return this.raise(pos, message);
- };
- _proto.flowEnumErrorInvalidMemberInitializer = function flowEnumErrorInvalidMemberInitializer(pos, _ref7) {
- var enumName = _ref7.enumName,
- explicitType = _ref7.explicitType,
- memberName = _ref7.memberName;
- var message = null;
- switch (explicitType) {
- case "boolean":
- case "number":
- case "string":
- message = "Enum `" + enumName + "` has type `" + explicitType + "`, so the initializer of " + ("`" + memberName + "` needs to be a " + explicitType + " literal.");
- break;
- case "symbol":
- message = "Symbol enum members cannot be initialized. Use `" + memberName + ",` in " + ("enum `" + enumName + "`.");
- break;
- default:
- message = "The enum member initializer for `" + memberName + "` needs to be a literal (either " + ("a boolean, number, or string) in enum `" + enumName + "`.");
- }
- return this.raise(pos, message);
- };
- _proto.flowEnumErrorNumberMemberNotInitialized = function flowEnumErrorNumberMemberNotInitialized(pos, _ref8) {
- var enumName = _ref8.enumName,
- memberName = _ref8.memberName;
- this.raise(pos, "Number enum members need to be initialized, e.g. `" + memberName + " = 1` in enum `" + enumName + "`.");
- };
- _proto.flowEnumErrorStringMemberInconsistentlyInitailized = function flowEnumErrorStringMemberInconsistentlyInitailized(pos, _ref9) {
- var enumName = _ref9.enumName;
- this.raise(pos, "String enum members need to consistently either all use initializers, or use no initializers, " + ("in enum `" + enumName + "`."));
- };
- _proto.flowEnumMemberInit = function flowEnumMemberInit() {
- var _this12 = this;
- var startPos = this.state.start;
- var endOfInit = function endOfInit() {
- return _this12.match(types.comma) || _this12.match(types.braceR);
- };
- switch (this.state.type) {
- case types.num:
- {
- var literal = this.parseLiteral(this.state.value, "NumericLiteral");
- if (endOfInit()) {
- return {
- type: "number",
- pos: literal.start,
- value: literal
- };
- }
- return {
- type: "invalid",
- pos: startPos
- };
- }
- case types.string:
- {
- var _literal = this.parseLiteral(this.state.value, "StringLiteral");
- if (endOfInit()) {
- return {
- type: "string",
- pos: _literal.start,
- value: _literal
- };
- }
- return {
- type: "invalid",
- pos: startPos
- };
- }
- case types._true:
- case types._false:
- {
- var _literal2 = this.parseBooleanLiteral();
- if (endOfInit()) {
- return {
- type: "boolean",
- pos: _literal2.start,
- value: _literal2
- };
- }
- return {
- type: "invalid",
- pos: startPos
- };
- }
- default:
- return {
- type: "invalid",
- pos: startPos
- };
- }
- };
- _proto.flowEnumMemberRaw = function flowEnumMemberRaw() {
- var pos = this.state.start;
- var id = this.parseIdentifier(true);
- var init = this.eat(types.eq) ? this.flowEnumMemberInit() : {
- type: "none",
- pos: pos
- };
- return {
- id: id,
- init: init
- };
- };
- _proto.flowEnumCheckExplicitTypeMismatch = function flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
- var explicitType = context.explicitType;
- if (explicitType === null) {
- return;
- }
- if (explicitType !== expectedType) {
- this.flowEnumErrorInvalidMemberInitializer(pos, context);
- }
- };
- _proto.flowEnumMembers = function flowEnumMembers(_ref10) {
- var enumName = _ref10.enumName,
- explicitType = _ref10.explicitType;
- var seenNames = new Set();
- var members = {
- booleanMembers: [],
- numberMembers: [],
- stringMembers: [],
- defaultedMembers: []
- };
- while (!this.match(types.braceR)) {
- var memberNode = this.startNode();
- var _this$flowEnumMemberR = this.flowEnumMemberRaw(),
- id = _this$flowEnumMemberR.id,
- init = _this$flowEnumMemberR.init;
- var memberName = id.name;
- if (memberName === "") {
- continue;
- }
- if (/^[a-z]/.test(memberName)) {
- this.flowEnumErrorInvalidMemberName(id.start, {
- enumName: enumName,
- memberName: memberName
- });
- }
- if (seenNames.has(memberName)) {
- this.flowEnumErrorDuplicateMemberName(id.start, {
- enumName: enumName,
- memberName: memberName
- });
- }
- seenNames.add(memberName);
- var context = {
- enumName: enumName,
- explicitType: explicitType,
- memberName: memberName
- };
- memberNode.id = id;
- switch (init.type) {
- case "boolean":
- {
- this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
- memberNode.init = init.value;
- members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
- break;
- }
- case "number":
- {
- this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
- memberNode.init = init.value;
- members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
- break;
- }
- case "string":
- {
- this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
- memberNode.init = init.value;
- members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
- break;
- }
- case "invalid":
- {
- throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
- }
- case "none":
- {
- switch (explicitType) {
- case "boolean":
- this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
- break;
- case "number":
- this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
- break;
- default:
- members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
- }
- }
- }
- if (!this.match(types.braceR)) {
- this.expect(types.comma);
- }
- }
- return members;
- };
- _proto.flowEnumStringMembers = function flowEnumStringMembers(initializedMembers, defaultedMembers, _ref11) {
- var enumName = _ref11.enumName;
- if (initializedMembers.length === 0) {
- return defaultedMembers;
- } else if (defaultedMembers.length === 0) {
- return initializedMembers;
- } else if (defaultedMembers.length > initializedMembers.length) {
- for (var _i2 = 0; _i2 < initializedMembers.length; _i2++) {
- var member = initializedMembers[_i2];
- this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
- enumName: enumName
- });
- }
- return defaultedMembers;
- } else {
- for (var _i4 = 0; _i4 < defaultedMembers.length; _i4++) {
- var _member = defaultedMembers[_i4];
- this.flowEnumErrorStringMemberInconsistentlyInitailized(_member.start, {
- enumName: enumName
- });
- }
- return initializedMembers;
- }
- };
- _proto.flowEnumParseExplicitType = function flowEnumParseExplicitType(_ref12) {
- var enumName = _ref12.enumName;
- if (this.eatContextual("of")) {
- if (!this.match(types.name)) {
- throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
- enumName: enumName,
- suppliedType: null
- });
- }
- var value = this.state.value;
- this.next();
- if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
- this.flowEnumErrorInvalidExplicitType(this.state.start, {
- enumName: enumName,
- suppliedType: value
- });
- }
- return value;
- }
- return null;
- };
- _proto.flowEnumBody = function flowEnumBody(node, _ref13) {
- var _this13 = this;
- var enumName = _ref13.enumName,
- nameLoc = _ref13.nameLoc;
- var explicitType = this.flowEnumParseExplicitType({
- enumName: enumName
- });
- this.expect(types.braceL);
- var members = this.flowEnumMembers({
- enumName: enumName,
- explicitType: explicitType
- });
- switch (explicitType) {
- case "boolean":
- node.explicitType = true;
- node.members = members.booleanMembers;
- this.expect(types.braceR);
- return this.finishNode(node, "EnumBooleanBody");
- case "number":
- node.explicitType = true;
- node.members = members.numberMembers;
- this.expect(types.braceR);
- return this.finishNode(node, "EnumNumberBody");
- case "string":
- node.explicitType = true;
- node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
- enumName: enumName
- });
- this.expect(types.braceR);
- return this.finishNode(node, "EnumStringBody");
- case "symbol":
- node.members = members.defaultedMembers;
- this.expect(types.braceR);
- return this.finishNode(node, "EnumSymbolBody");
- default:
- {
- var empty = function empty() {
- node.members = [];
- _this13.expect(types.braceR);
- return _this13.finishNode(node, "EnumStringBody");
- };
- node.explicitType = false;
- var boolsLen = members.booleanMembers.length;
- var numsLen = members.numberMembers.length;
- var strsLen = members.stringMembers.length;
- var defaultedLen = members.defaultedMembers.length;
- if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
- return empty();
- } else if (!boolsLen && !numsLen) {
- node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
- enumName: enumName
- });
- this.expect(types.braceR);
- return this.finishNode(node, "EnumStringBody");
- } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
- for (var _i6 = 0, _members$defaultedMem2 = members.defaultedMembers; _i6 < _members$defaultedMem2.length; _i6++) {
- var member = _members$defaultedMem2[_i6];
- this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
- enumName: enumName,
- memberName: member.id.name
- });
- }
- node.members = members.booleanMembers;
- this.expect(types.braceR);
- return this.finishNode(node, "EnumBooleanBody");
- } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
- for (var _i8 = 0, _members$defaultedMem4 = members.defaultedMembers; _i8 < _members$defaultedMem4.length; _i8++) {
- var _member2 = _members$defaultedMem4[_i8];
- this.flowEnumErrorNumberMemberNotInitialized(_member2.start, {
- enumName: enumName,
- memberName: _member2.id.name
- });
- }
- node.members = members.numberMembers;
- this.expect(types.braceR);
- return this.finishNode(node, "EnumNumberBody");
- } else {
- this.flowEnumErrorInconsistentMemberValues(nameLoc, {
- enumName: enumName
- });
- return empty();
- }
- }
- }
- };
- _proto.flowParseEnumDeclaration = function flowParseEnumDeclaration(node) {
- var id = this.parseIdentifier();
- node.id = id;
- node.body = this.flowEnumBody(this.startNode(), {
- enumName: id.name,
- nameLoc: id.start
- });
- return this.finishNode(node, "EnumDeclaration");
- };
- return _class;
- }(superClass);
- });
- var entities = {
- quot: "\"",
- amp: "&",
- apos: "'",
- lt: "<",
- gt: ">",
- nbsp: "\xA0",
- iexcl: "\xA1",
- cent: "\xA2",
- pound: "\xA3",
- curren: "\xA4",
- yen: "\xA5",
- brvbar: "\xA6",
- sect: "\xA7",
- uml: "\xA8",
- copy: "\xA9",
- ordf: "\xAA",
- laquo: "\xAB",
- not: "\xAC",
- shy: "\xAD",
- reg: "\xAE",
- macr: "\xAF",
- deg: "\xB0",
- plusmn: "\xB1",
- sup2: "\xB2",
- sup3: "\xB3",
- acute: "\xB4",
- micro: "\xB5",
- para: "\xB6",
- middot: "\xB7",
- cedil: "\xB8",
- sup1: "\xB9",
- ordm: "\xBA",
- raquo: "\xBB",
- frac14: "\xBC",
- frac12: "\xBD",
- frac34: "\xBE",
- iquest: "\xBF",
- Agrave: "\xC0",
- Aacute: "\xC1",
- Acirc: "\xC2",
- Atilde: "\xC3",
- Auml: "\xC4",
- Aring: "\xC5",
- AElig: "\xC6",
- Ccedil: "\xC7",
- Egrave: "\xC8",
- Eacute: "\xC9",
- Ecirc: "\xCA",
- Euml: "\xCB",
- Igrave: "\xCC",
- Iacute: "\xCD",
- Icirc: "\xCE",
- Iuml: "\xCF",
- ETH: "\xD0",
- Ntilde: "\xD1",
- Ograve: "\xD2",
- Oacute: "\xD3",
- Ocirc: "\xD4",
- Otilde: "\xD5",
- Ouml: "\xD6",
- times: "\xD7",
- Oslash: "\xD8",
- Ugrave: "\xD9",
- Uacute: "\xDA",
- Ucirc: "\xDB",
- Uuml: "\xDC",
- Yacute: "\xDD",
- THORN: "\xDE",
- szlig: "\xDF",
- agrave: "\xE0",
- aacute: "\xE1",
- acirc: "\xE2",
- atilde: "\xE3",
- auml: "\xE4",
- aring: "\xE5",
- aelig: "\xE6",
- ccedil: "\xE7",
- egrave: "\xE8",
- eacute: "\xE9",
- ecirc: "\xEA",
- euml: "\xEB",
- igrave: "\xEC",
- iacute: "\xED",
- icirc: "\xEE",
- iuml: "\xEF",
- eth: "\xF0",
- ntilde: "\xF1",
- ograve: "\xF2",
- oacute: "\xF3",
- ocirc: "\xF4",
- otilde: "\xF5",
- ouml: "\xF6",
- divide: "\xF7",
- oslash: "\xF8",
- ugrave: "\xF9",
- uacute: "\xFA",
- ucirc: "\xFB",
- uuml: "\xFC",
- yacute: "\xFD",
- thorn: "\xFE",
- yuml: "\xFF",
- OElig: "\u0152",
- oelig: "\u0153",
- Scaron: "\u0160",
- scaron: "\u0161",
- Yuml: "\u0178",
- fnof: "\u0192",
- circ: "\u02C6",
- tilde: "\u02DC",
- Alpha: "\u0391",
- Beta: "\u0392",
- Gamma: "\u0393",
- Delta: "\u0394",
- Epsilon: "\u0395",
- Zeta: "\u0396",
- Eta: "\u0397",
- Theta: "\u0398",
- Iota: "\u0399",
- Kappa: "\u039A",
- Lambda: "\u039B",
- Mu: "\u039C",
- Nu: "\u039D",
- Xi: "\u039E",
- Omicron: "\u039F",
- Pi: "\u03A0",
- Rho: "\u03A1",
- Sigma: "\u03A3",
- Tau: "\u03A4",
- Upsilon: "\u03A5",
- Phi: "\u03A6",
- Chi: "\u03A7",
- Psi: "\u03A8",
- Omega: "\u03A9",
- alpha: "\u03B1",
- beta: "\u03B2",
- gamma: "\u03B3",
- delta: "\u03B4",
- epsilon: "\u03B5",
- zeta: "\u03B6",
- eta: "\u03B7",
- theta: "\u03B8",
- iota: "\u03B9",
- kappa: "\u03BA",
- lambda: "\u03BB",
- mu: "\u03BC",
- nu: "\u03BD",
- xi: "\u03BE",
- omicron: "\u03BF",
- pi: "\u03C0",
- rho: "\u03C1",
- sigmaf: "\u03C2",
- sigma: "\u03C3",
- tau: "\u03C4",
- upsilon: "\u03C5",
- phi: "\u03C6",
- chi: "\u03C7",
- psi: "\u03C8",
- omega: "\u03C9",
- thetasym: "\u03D1",
- upsih: "\u03D2",
- piv: "\u03D6",
- ensp: "\u2002",
- emsp: "\u2003",
- thinsp: "\u2009",
- zwnj: "\u200C",
- zwj: "\u200D",
- lrm: "\u200E",
- rlm: "\u200F",
- ndash: "\u2013",
- mdash: "\u2014",
- lsquo: "\u2018",
- rsquo: "\u2019",
- sbquo: "\u201A",
- ldquo: "\u201C",
- rdquo: "\u201D",
- bdquo: "\u201E",
- dagger: "\u2020",
- Dagger: "\u2021",
- bull: "\u2022",
- hellip: "\u2026",
- permil: "\u2030",
- prime: "\u2032",
- Prime: "\u2033",
- lsaquo: "\u2039",
- rsaquo: "\u203A",
- oline: "\u203E",
- frasl: "\u2044",
- euro: "\u20AC",
- image: "\u2111",
- weierp: "\u2118",
- real: "\u211C",
- trade: "\u2122",
- alefsym: "\u2135",
- larr: "\u2190",
- uarr: "\u2191",
- rarr: "\u2192",
- darr: "\u2193",
- harr: "\u2194",
- crarr: "\u21B5",
- lArr: "\u21D0",
- uArr: "\u21D1",
- rArr: "\u21D2",
- dArr: "\u21D3",
- hArr: "\u21D4",
- forall: "\u2200",
- part: "\u2202",
- exist: "\u2203",
- empty: "\u2205",
- nabla: "\u2207",
- isin: "\u2208",
- notin: "\u2209",
- ni: "\u220B",
- prod: "\u220F",
- sum: "\u2211",
- minus: "\u2212",
- lowast: "\u2217",
- radic: "\u221A",
- prop: "\u221D",
- infin: "\u221E",
- ang: "\u2220",
- and: "\u2227",
- or: "\u2228",
- cap: "\u2229",
- cup: "\u222A",
- "int": "\u222B",
- there4: "\u2234",
- sim: "\u223C",
- cong: "\u2245",
- asymp: "\u2248",
- ne: "\u2260",
- equiv: "\u2261",
- le: "\u2264",
- ge: "\u2265",
- sub: "\u2282",
- sup: "\u2283",
- nsub: "\u2284",
- sube: "\u2286",
- supe: "\u2287",
- oplus: "\u2295",
- otimes: "\u2297",
- perp: "\u22A5",
- sdot: "\u22C5",
- lceil: "\u2308",
- rceil: "\u2309",
- lfloor: "\u230A",
- rfloor: "\u230B",
- lang: "\u2329",
- rang: "\u232A",
- loz: "\u25CA",
- spades: "\u2660",
- clubs: "\u2663",
- hearts: "\u2665",
- diams: "\u2666"
- };
- var HEX_NUMBER = /^[\da-fA-F]+$/;
- var DECIMAL_NUMBER = /^\d+$/;
- types$1.j_oTag = new TokContext("<tag", false);
- types$1.j_cTag = new TokContext("</tag", false);
- types$1.j_expr = new TokContext("<tag>...</tag>", true, true);
- types.jsxName = new TokenType("jsxName");
- types.jsxText = new TokenType("jsxText", {
- beforeExpr: true
- });
- types.jsxTagStart = new TokenType("jsxTagStart", {
- startsExpr: true
- });
- types.jsxTagEnd = new TokenType("jsxTagEnd");
- types.jsxTagStart.updateContext = function () {
- this.state.context.push(types$1.j_expr);
- this.state.context.push(types$1.j_oTag);
- this.state.exprAllowed = false;
- };
- types.jsxTagEnd.updateContext = function (prevType) {
- var out = this.state.context.pop();
- if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {
- this.state.context.pop();
- this.state.exprAllowed = this.curContext() === types$1.j_expr;
- } else {
- this.state.exprAllowed = true;
- }
- };
- function isFragment(object) {
- return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
- }
- function getQualifiedJSXName(object) {
- if (object.type === "JSXIdentifier") {
- return object.name;
- }
- if (object.type === "JSXNamespacedName") {
- return object.namespace.name + ":" + object.name.name;
- }
- if (object.type === "JSXMemberExpression") {
- return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
- }
- throw new Error("Node had unexpected type: " + object.type);
- }
- var jsx = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class() {
- return _superClass.apply(this, arguments) || this;
- }
- var _proto = _class.prototype;
- _proto.jsxReadToken = function jsxReadToken() {
- var out = "";
- var chunkStart = this.state.pos;
- for (;;) {
- if (this.state.pos >= this.length) {
- throw this.raise(this.state.start, "Unterminated JSX contents");
- }
- var ch = this.input.charCodeAt(this.state.pos);
- switch (ch) {
- case 60:
- case 123:
- if (this.state.pos === this.state.start) {
- if (ch === 60 && this.state.exprAllowed) {
- ++this.state.pos;
- return this.finishToken(types.jsxTagStart);
- }
- return _superClass.prototype.getTokenFromCode.call(this, ch);
- }
- out += this.input.slice(chunkStart, this.state.pos);
- return this.finishToken(types.jsxText, out);
- case 38:
- out += this.input.slice(chunkStart, this.state.pos);
- out += this.jsxReadEntity();
- chunkStart = this.state.pos;
- break;
- default:
- if (isNewLine(ch)) {
- out += this.input.slice(chunkStart, this.state.pos);
- out += this.jsxReadNewLine(true);
- chunkStart = this.state.pos;
- } else {
- ++this.state.pos;
- }
- }
- }
- };
- _proto.jsxReadNewLine = function jsxReadNewLine(normalizeCRLF) {
- var ch = this.input.charCodeAt(this.state.pos);
- var out;
- ++this.state.pos;
- if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
- ++this.state.pos;
- out = normalizeCRLF ? "\n" : "\r\n";
- } else {
- out = String.fromCharCode(ch);
- }
- ++this.state.curLine;
- this.state.lineStart = this.state.pos;
- return out;
- };
- _proto.jsxReadString = function jsxReadString(quote) {
- var out = "";
- var chunkStart = ++this.state.pos;
- for (;;) {
- if (this.state.pos >= this.length) {
- throw this.raise(this.state.start, "Unterminated string constant");
- }
- var ch = this.input.charCodeAt(this.state.pos);
- if (ch === quote) break;
- if (ch === 38) {
- out += this.input.slice(chunkStart, this.state.pos);
- out += this.jsxReadEntity();
- chunkStart = this.state.pos;
- } else if (isNewLine(ch)) {
- out += this.input.slice(chunkStart, this.state.pos);
- out += this.jsxReadNewLine(false);
- chunkStart = this.state.pos;
- } else {
- ++this.state.pos;
- }
- }
- out += this.input.slice(chunkStart, this.state.pos++);
- return this.finishToken(types.string, out);
- };
- _proto.jsxReadEntity = function jsxReadEntity() {
- var str = "";
- var count = 0;
- var entity;
- var ch = this.input[this.state.pos];
- var startPos = ++this.state.pos;
- while (this.state.pos < this.length && count++ < 10) {
- ch = this.input[this.state.pos++];
- if (ch === ";") {
- if (str[0] === "#") {
- if (str[1] === "x") {
- str = str.substr(2);
- if (HEX_NUMBER.test(str)) {
- entity = String.fromCodePoint(parseInt(str, 16));
- }
- } else {
- str = str.substr(1);
- if (DECIMAL_NUMBER.test(str)) {
- entity = String.fromCodePoint(parseInt(str, 10));
- }
- }
- } else {
- entity = entities[str];
- }
- break;
- }
- str += ch;
- }
- if (!entity) {
- this.state.pos = startPos;
- return "&";
- }
- return entity;
- };
- _proto.jsxReadWord = function jsxReadWord() {
- var ch;
- var start = this.state.pos;
- do {
- ch = this.input.charCodeAt(++this.state.pos);
- } while (isIdentifierChar(ch) || ch === 45);
- return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
- };
- _proto.jsxParseIdentifier = function jsxParseIdentifier() {
- var node = this.startNode();
- if (this.match(types.jsxName)) {
- node.name = this.state.value;
- } else if (this.state.type.keyword) {
- node.name = this.state.type.keyword;
- } else {
- this.unexpected();
- }
- this.next();
- return this.finishNode(node, "JSXIdentifier");
- };
- _proto.jsxParseNamespacedName = function jsxParseNamespacedName() {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var name = this.jsxParseIdentifier();
- if (!this.eat(types.colon)) return name;
- var node = this.startNodeAt(startPos, startLoc);
- node.namespace = name;
- node.name = this.jsxParseIdentifier();
- return this.finishNode(node, "JSXNamespacedName");
- };
- _proto.jsxParseElementName = function jsxParseElementName() {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var node = this.jsxParseNamespacedName();
- if (node.type === "JSXNamespacedName") {
- return node;
- }
- while (this.eat(types.dot)) {
- var newNode = this.startNodeAt(startPos, startLoc);
- newNode.object = node;
- newNode.property = this.jsxParseIdentifier();
- node = this.finishNode(newNode, "JSXMemberExpression");
- }
- return node;
- };
- _proto.jsxParseAttributeValue = function jsxParseAttributeValue() {
- var node;
- switch (this.state.type) {
- case types.braceL:
- node = this.startNode();
- this.next();
- node = this.jsxParseExpressionContainer(node);
- if (node.expression.type === "JSXEmptyExpression") {
- this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
- }
- return node;
- case types.jsxTagStart:
- case types.string:
- return this.parseExprAtom();
- default:
- throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
- }
- };
- _proto.jsxParseEmptyExpression = function jsxParseEmptyExpression() {
- var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
- return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
- };
- _proto.jsxParseSpreadChild = function jsxParseSpreadChild(node) {
- this.next();
- node.expression = this.parseExpression();
- this.expect(types.braceR);
- return this.finishNode(node, "JSXSpreadChild");
- };
- _proto.jsxParseExpressionContainer = function jsxParseExpressionContainer(node) {
- if (this.match(types.braceR)) {
- node.expression = this.jsxParseEmptyExpression();
- } else {
- node.expression = this.parseExpression();
- }
- this.expect(types.braceR);
- return this.finishNode(node, "JSXExpressionContainer");
- };
- _proto.jsxParseAttribute = function jsxParseAttribute() {
- var node = this.startNode();
- if (this.eat(types.braceL)) {
- this.expect(types.ellipsis);
- node.argument = this.parseMaybeAssign();
- this.expect(types.braceR);
- return this.finishNode(node, "JSXSpreadAttribute");
- }
- node.name = this.jsxParseNamespacedName();
- node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;
- return this.finishNode(node, "JSXAttribute");
- };
- _proto.jsxParseOpeningElementAt = function jsxParseOpeningElementAt(startPos, startLoc) {
- var node = this.startNodeAt(startPos, startLoc);
- if (this.match(types.jsxTagEnd)) {
- this.expect(types.jsxTagEnd);
- return this.finishNode(node, "JSXOpeningFragment");
- }
- node.name = this.jsxParseElementName();
- return this.jsxParseOpeningElementAfterName(node);
- };
- _proto.jsxParseOpeningElementAfterName = function jsxParseOpeningElementAfterName(node) {
- var attributes = [];
- while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {
- attributes.push(this.jsxParseAttribute());
- }
- node.attributes = attributes;
- node.selfClosing = this.eat(types.slash);
- this.expect(types.jsxTagEnd);
- return this.finishNode(node, "JSXOpeningElement");
- };
- _proto.jsxParseClosingElementAt = function jsxParseClosingElementAt(startPos, startLoc) {
- var node = this.startNodeAt(startPos, startLoc);
- if (this.match(types.jsxTagEnd)) {
- this.expect(types.jsxTagEnd);
- return this.finishNode(node, "JSXClosingFragment");
- }
- node.name = this.jsxParseElementName();
- this.expect(types.jsxTagEnd);
- return this.finishNode(node, "JSXClosingElement");
- };
- _proto.jsxParseElementAt = function jsxParseElementAt(startPos, startLoc) {
- var node = this.startNodeAt(startPos, startLoc);
- var children = [];
- var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
- var closingElement = null;
- if (!openingElement.selfClosing) {
- contents: for (;;) {
- switch (this.state.type) {
- case types.jsxTagStart:
- startPos = this.state.start;
- startLoc = this.state.startLoc;
- this.next();
- if (this.eat(types.slash)) {
- closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
- break contents;
- }
- children.push(this.jsxParseElementAt(startPos, startLoc));
- break;
- case types.jsxText:
- children.push(this.parseExprAtom());
- break;
- case types.braceL:
- {
- var _node = this.startNode();
- this.next();
- if (this.match(types.ellipsis)) {
- children.push(this.jsxParseSpreadChild(_node));
- } else {
- children.push(this.jsxParseExpressionContainer(_node));
- }
- break;
- }
- default:
- throw this.unexpected();
- }
- }
- if (isFragment(openingElement) && !isFragment(closingElement)) {
- this.raise(closingElement.start, "Expected corresponding JSX closing tag for <>");
- } else if (!isFragment(openingElement) && isFragment(closingElement)) {
- this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
- } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
- if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
- this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
- }
- }
- }
- if (isFragment(openingElement)) {
- node.openingFragment = openingElement;
- node.closingFragment = closingElement;
- } else {
- node.openingElement = openingElement;
- node.closingElement = closingElement;
- }
- node.children = children;
- if (this.isRelational("<")) {
- throw this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...</>?");
- }
- return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
- };
- _proto.jsxParseElement = function jsxParseElement() {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- this.next();
- return this.jsxParseElementAt(startPos, startLoc);
- };
- _proto.parseExprAtom = function parseExprAtom(refShortHandDefaultPos) {
- if (this.match(types.jsxText)) {
- return this.parseLiteral(this.state.value, "JSXText");
- } else if (this.match(types.jsxTagStart)) {
- return this.jsxParseElement();
- } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
- this.finishToken(types.jsxTagStart);
- return this.jsxParseElement();
- } else {
- return _superClass.prototype.parseExprAtom.call(this, refShortHandDefaultPos);
- }
- };
- _proto.getTokenFromCode = function getTokenFromCode(code) {
- if (this.state.inPropertyName) return _superClass.prototype.getTokenFromCode.call(this, code);
- var context = this.curContext();
- if (context === types$1.j_expr) {
- return this.jsxReadToken();
- }
- if (context === types$1.j_oTag || context === types$1.j_cTag) {
- if (isIdentifierStart(code)) {
- return this.jsxReadWord();
- }
- if (code === 62) {
- ++this.state.pos;
- return this.finishToken(types.jsxTagEnd);
- }
- if ((code === 34 || code === 39) && context === types$1.j_oTag) {
- return this.jsxReadString(code);
- }
- }
- if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
- ++this.state.pos;
- return this.finishToken(types.jsxTagStart);
- }
- return _superClass.prototype.getTokenFromCode.call(this, code);
- };
- _proto.updateContext = function updateContext(prevType) {
- if (this.match(types.braceL)) {
- var curContext = this.curContext();
- if (curContext === types$1.j_oTag) {
- this.state.context.push(types$1.braceExpression);
- } else if (curContext === types$1.j_expr) {
- this.state.context.push(types$1.templateQuasi);
- } else {
- _superClass.prototype.updateContext.call(this, prevType);
- }
- this.state.exprAllowed = true;
- } else if (this.match(types.slash) && prevType === types.jsxTagStart) {
- this.state.context.length -= 2;
- this.state.context.push(types$1.j_cTag);
- this.state.exprAllowed = false;
- } else {
- return _superClass.prototype.updateContext.call(this, prevType);
- }
- };
- return _class;
- }(superClass);
- });
- var Scope$2 = function Scope(flags) {
- this["var"] = [];
- this.lexical = [];
- this.functions = [];
- this.flags = flags;
- };
- var ScopeHandler = function () {
- function ScopeHandler(raise, inModule) {
- this.scopeStack = [];
- this.undefinedExports = new Map();
- this.undefinedPrivateNames = new Map();
- this.raise = raise;
- this.inModule = inModule;
- }
- var _proto = ScopeHandler.prototype;
- _proto.createScope = function createScope(flags) {
- return new Scope$2(flags);
- };
- _proto.enter = function enter(flags) {
- this.scopeStack.push(this.createScope(flags));
- };
- _proto.exit = function exit() {
- this.scopeStack.pop();
- };
- _proto.treatFunctionsAsVarInScope = function treatFunctionsAsVarInScope(scope) {
- return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM);
- };
- _proto.declareName = function declareName(name, bindingType, pos) {
- var scope = this.currentScope();
- if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
- this.checkRedeclarationInScope(scope, name, bindingType, pos);
- if (bindingType & BIND_SCOPE_FUNCTION) {
- scope.functions.push(name);
- } else {
- scope.lexical.push(name);
- }
- if (bindingType & BIND_SCOPE_LEXICAL) {
- this.maybeExportDefined(scope, name);
- }
- } else if (bindingType & BIND_SCOPE_VAR) {
- for (var i = this.scopeStack.length - 1; i >= 0; --i) {
- scope = this.scopeStack[i];
- this.checkRedeclarationInScope(scope, name, bindingType, pos);
- scope["var"].push(name);
- this.maybeExportDefined(scope, name);
- if (scope.flags & SCOPE_VAR) break;
- }
- }
- if (this.inModule && scope.flags & SCOPE_PROGRAM) {
- this.undefinedExports["delete"](name);
- }
- };
- _proto.maybeExportDefined = function maybeExportDefined(scope, name) {
- if (this.inModule && scope.flags & SCOPE_PROGRAM) {
- this.undefinedExports["delete"](name);
- }
- };
- _proto.checkRedeclarationInScope = function checkRedeclarationInScope(scope, name, bindingType, pos) {
- if (this.isRedeclaredInScope(scope, name, bindingType)) {
- this.raise(pos, "Identifier '" + name + "' has already been declared");
- }
- };
- _proto.isRedeclaredInScope = function isRedeclaredInScope(scope, name, bindingType) {
- if (!(bindingType & BIND_KIND_VALUE)) return false;
- if (bindingType & BIND_SCOPE_LEXICAL) {
- return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope["var"].indexOf(name) > -1;
- }
- if (bindingType & BIND_SCOPE_FUNCTION) {
- return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope["var"].indexOf(name) > -1;
- }
- return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1;
- };
- _proto.checkLocalExport = function checkLocalExport(id) {
- if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0]["var"].indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) {
- this.undefinedExports.set(id.name, id.start);
- }
- };
- _proto.currentScope = function currentScope() {
- return this.scopeStack[this.scopeStack.length - 1];
- };
- _proto.currentVarScope = function currentVarScope() {
- for (var i = this.scopeStack.length - 1;; i--) {
- var scope = this.scopeStack[i];
- if (scope.flags & SCOPE_VAR) {
- return scope;
- }
- }
- };
- _proto.currentThisScope = function currentThisScope() {
- for (var i = this.scopeStack.length - 1;; i--) {
- var scope = this.scopeStack[i];
- if ((scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) && !(scope.flags & SCOPE_ARROW)) {
- return scope;
- }
- }
- };
- _createClass(ScopeHandler, [{
- key: "inFunction",
- get: function get() {
- return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
- }
- }, {
- key: "inGenerator",
- get: function get() {
- return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
- }
- }, {
- key: "inAsync",
- get: function get() {
- for (var i = this.scopeStack.length - 1;; i--) {
- var scope = this.scopeStack[i];
- var isVarScope = scope.flags & SCOPE_VAR;
- var isClassScope = scope.flags & SCOPE_CLASS;
- if (isClassScope && !isVarScope) {
- return false;
- } else if (isVarScope) {
- return (scope.flags & SCOPE_ASYNC) > 0;
- }
- }
- }
- }, {
- key: "allowSuper",
- get: function get() {
- return (this.currentThisScope().flags & SCOPE_SUPER) > 0;
- }
- }, {
- key: "allowDirectSuper",
- get: function get() {
- return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
- }
- }, {
- key: "inClass",
- get: function get() {
- return (this.currentThisScope().flags & SCOPE_CLASS) > 0;
- }
- }, {
- key: "inNonArrowFunction",
- get: function get() {
- return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;
- }
- }, {
- key: "treatFunctionsAsVar",
- get: function get() {
- return this.treatFunctionsAsVarInScope(this.currentScope());
- }
- }]);
- return ScopeHandler;
- }();
- var TypeScriptScope = function (_Scope) {
- _inheritsLoose(TypeScriptScope, _Scope);
- function TypeScriptScope() {
- var _this;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- _this = _Scope.call.apply(_Scope, [this].concat(args)) || this;
- _this.types = [];
- _this.enums = [];
- _this.constEnums = [];
- _this.classes = [];
- _this.exportOnlyBindings = [];
- return _this;
- }
- return TypeScriptScope;
- }(Scope$2);
- var TypeScriptScopeHandler = function (_ScopeHandler) {
- _inheritsLoose(TypeScriptScopeHandler, _ScopeHandler);
- function TypeScriptScopeHandler() {
- return _ScopeHandler.apply(this, arguments) || this;
- }
- var _proto = TypeScriptScopeHandler.prototype;
- _proto.createScope = function createScope(flags) {
- return new TypeScriptScope(flags);
- };
- _proto.declareName = function declareName(name, bindingType, pos) {
- var scope = this.currentScope();
- if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
- this.maybeExportDefined(scope, name);
- scope.exportOnlyBindings.push(name);
- return;
- }
- _ScopeHandler.prototype.declareName.apply(this, arguments);
- if (bindingType & BIND_KIND_TYPE) {
- if (!(bindingType & BIND_KIND_VALUE)) {
- this.checkRedeclarationInScope(scope, name, bindingType, pos);
- this.maybeExportDefined(scope, name);
- }
- scope.types.push(name);
- }
- if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);
- if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);
- if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);
- };
- _proto.isRedeclaredInScope = function isRedeclaredInScope(scope, name, bindingType) {
- if (scope.enums.indexOf(name) > -1) {
- if (bindingType & BIND_FLAGS_TS_ENUM) {
- var isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
- var wasConst = scope.constEnums.indexOf(name) > -1;
- return isConst !== wasConst;
- }
- return true;
- }
- if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {
- if (scope.lexical.indexOf(name) > -1) {
- return !!(bindingType & BIND_KIND_VALUE);
- } else {
- return false;
- }
- }
- if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {
- return true;
- }
- return _ScopeHandler.prototype.isRedeclaredInScope.apply(this, arguments);
- };
- _proto.checkLocalExport = function checkLocalExport(id) {
- if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) {
- _ScopeHandler.prototype.checkLocalExport.call(this, id);
- }
- };
- return TypeScriptScopeHandler;
- }(ScopeHandler);
- function nonNull(x) {
- if (x == null) {
- throw new Error("Unexpected " + x + " value.");
- }
- return x;
- }
- function assert$1(x) {
- if (!x) {
- throw new Error("Assert fail");
- }
- }
- function keywordTypeFromName(value) {
- switch (value) {
- case "any":
- return "TSAnyKeyword";
- case "boolean":
- return "TSBooleanKeyword";
- case "bigint":
- return "TSBigIntKeyword";
- case "never":
- return "TSNeverKeyword";
- case "number":
- return "TSNumberKeyword";
- case "object":
- return "TSObjectKeyword";
- case "string":
- return "TSStringKeyword";
- case "symbol":
- return "TSSymbolKeyword";
- case "undefined":
- return "TSUndefinedKeyword";
- case "unknown":
- return "TSUnknownKeyword";
- default:
- return undefined;
- }
- }
- var typescript = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class() {
- return _superClass.apply(this, arguments) || this;
- }
- var _proto = _class.prototype;
- _proto.getScopeHandler = function getScopeHandler() {
- return TypeScriptScopeHandler;
- };
- _proto.tsIsIdentifier = function tsIsIdentifier() {
- return this.match(types.name);
- };
- _proto.tsNextTokenCanFollowModifier = function tsNextTokenCanFollowModifier() {
- this.next();
- return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang);
- };
- _proto.tsParseModifier = function tsParseModifier(allowedModifiers) {
- if (!this.match(types.name)) {
- return undefined;
- }
- var modifier = this.state.value;
- if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
- return modifier;
- }
- return undefined;
- };
- _proto.tsParseModifiers = function tsParseModifiers(allowedModifiers) {
- var modifiers = Object.create(null);
- while (true) {
- var startPos = this.state.start;
- var modifier = this.tsParseModifier(allowedModifiers);
- if (!modifier) break;
- if (Object.hasOwnProperty.call(modifiers, modifier)) {
- this.raise(startPos, "Duplicate modifier: '" + modifier + "'");
- }
- modifiers[modifier] = true;
- }
- return modifiers;
- };
- _proto.tsIsListTerminator = function tsIsListTerminator(kind) {
- switch (kind) {
- case "EnumMembers":
- case "TypeMembers":
- return this.match(types.braceR);
- case "HeritageClauseElement":
- return this.match(types.braceL);
- case "TupleElementTypes":
- return this.match(types.bracketR);
- case "TypeParametersOrArguments":
- return this.isRelational(">");
- }
- throw new Error("Unreachable");
- };
- _proto.tsParseList = function tsParseList(kind, parseElement) {
- var result = [];
- while (!this.tsIsListTerminator(kind)) {
- result.push(parseElement());
- }
- return result;
- };
- _proto.tsParseDelimitedList = function tsParseDelimitedList(kind, parseElement) {
- return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));
- };
- _proto.tsParseDelimitedListWorker = function tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
- var result = [];
- while (true) {
- if (this.tsIsListTerminator(kind)) {
- break;
- }
- var element = parseElement();
- if (element == null) {
- return undefined;
- }
- result.push(element);
- if (this.eat(types.comma)) {
- continue;
- }
- if (this.tsIsListTerminator(kind)) {
- break;
- }
- if (expectSuccess) {
- this.expect(types.comma);
- }
- return undefined;
- }
- return result;
- };
- _proto.tsParseBracketedList = function tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
- if (!skipFirstToken) {
- if (bracket) {
- this.expect(types.bracketL);
- } else {
- this.expectRelational("<");
- }
- }
- var result = this.tsParseDelimitedList(kind, parseElement);
- if (bracket) {
- this.expect(types.bracketR);
- } else {
- this.expectRelational(">");
- }
- return result;
- };
- _proto.tsParseImportType = function tsParseImportType() {
- var node = this.startNode();
- this.expect(types._import);
- this.expect(types.parenL);
- if (!this.match(types.string)) {
- this.raise(this.state.start, "Argument in a type import must be a string literal");
- }
- node.argument = this.parseExprAtom();
- this.expect(types.parenR);
- if (this.eat(types.dot)) {
- node.qualifier = this.tsParseEntityName(true);
- }
- if (this.isRelational("<")) {
- node.typeParameters = this.tsParseTypeArguments();
- }
- return this.finishNode(node, "TSImportType");
- };
- _proto.tsParseEntityName = function tsParseEntityName(allowReservedWords) {
- var entity = this.parseIdentifier();
- while (this.eat(types.dot)) {
- var node = this.startNodeAtNode(entity);
- node.left = entity;
- node.right = this.parseIdentifier(allowReservedWords);
- entity = this.finishNode(node, "TSQualifiedName");
- }
- return entity;
- };
- _proto.tsParseTypeReference = function tsParseTypeReference() {
- var node = this.startNode();
- node.typeName = this.tsParseEntityName(false);
- if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
- node.typeParameters = this.tsParseTypeArguments();
- }
- return this.finishNode(node, "TSTypeReference");
- };
- _proto.tsParseThisTypePredicate = function tsParseThisTypePredicate(lhs) {
- this.next();
- var node = this.startNodeAtNode(lhs);
- node.parameterName = lhs;
- node.typeAnnotation = this.tsParseTypeAnnotation(false);
- return this.finishNode(node, "TSTypePredicate");
- };
- _proto.tsParseThisTypeNode = function tsParseThisTypeNode() {
- var node = this.startNode();
- this.next();
- return this.finishNode(node, "TSThisType");
- };
- _proto.tsParseTypeQuery = function tsParseTypeQuery() {
- var node = this.startNode();
- this.expect(types._typeof);
- if (this.match(types._import)) {
- node.exprName = this.tsParseImportType();
- } else {
- node.exprName = this.tsParseEntityName(true);
- }
- return this.finishNode(node, "TSTypeQuery");
- };
- _proto.tsParseTypeParameter = function tsParseTypeParameter() {
- var node = this.startNode();
- node.name = this.parseIdentifierName(node.start);
- node.constraint = this.tsEatThenParseType(types._extends);
- node["default"] = this.tsEatThenParseType(types.eq);
- return this.finishNode(node, "TSTypeParameter");
- };
- _proto.tsTryParseTypeParameters = function tsTryParseTypeParameters() {
- if (this.isRelational("<")) {
- return this.tsParseTypeParameters();
- }
- };
- _proto.tsParseTypeParameters = function tsParseTypeParameters() {
- var node = this.startNode();
- if (this.isRelational("<") || this.match(types.jsxTagStart)) {
- this.next();
- } else {
- this.unexpected();
- }
- node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
- return this.finishNode(node, "TSTypeParameterDeclaration");
- };
- _proto.tsTryNextParseConstantContext = function tsTryNextParseConstantContext() {
- if (this.lookahead().type === types._const) {
- this.next();
- return this.tsParseTypeReference();
- }
- return null;
- };
- _proto.tsFillSignature = function tsFillSignature(returnToken, signature) {
- var returnTokenRequired = returnToken === types.arrow;
- signature.typeParameters = this.tsTryParseTypeParameters();
- this.expect(types.parenL);
- signature.parameters = this.tsParseBindingListForSignature();
- if (returnTokenRequired) {
- signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
- } else if (this.match(returnToken)) {
- signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
- }
- };
- _proto.tsParseBindingListForSignature = function tsParseBindingListForSignature() {
- var _this = this;
- return this.parseBindingList(types.parenR, 41).map(function (pattern) {
- if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
- _this.raise(pattern.start, "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + ("instead got " + pattern.type));
- }
- return pattern;
- });
- };
- _proto.tsParseTypeMemberSemicolon = function tsParseTypeMemberSemicolon() {
- if (!this.eat(types.comma)) {
- this.semicolon();
- }
- };
- _proto.tsParseSignatureMember = function tsParseSignatureMember(kind, node) {
- this.tsFillSignature(types.colon, node);
- this.tsParseTypeMemberSemicolon();
- return this.finishNode(node, kind);
- };
- _proto.tsIsUnambiguouslyIndexSignature = function tsIsUnambiguouslyIndexSignature() {
- this.next();
- return this.eat(types.name) && this.match(types.colon);
- };
- _proto.tsTryParseIndexSignature = function tsTryParseIndexSignature(node) {
- if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
- return undefined;
- }
- this.expect(types.bracketL);
- var id = this.parseIdentifier();
- id.typeAnnotation = this.tsParseTypeAnnotation();
- this.resetEndLocation(id);
- this.expect(types.bracketR);
- node.parameters = [id];
- var type = this.tsTryParseTypeAnnotation();
- if (type) node.typeAnnotation = type;
- this.tsParseTypeMemberSemicolon();
- return this.finishNode(node, "TSIndexSignature");
- };
- _proto.tsParsePropertyOrMethodSignature = function tsParsePropertyOrMethodSignature(node, readonly) {
- if (this.eat(types.question)) node.optional = true;
- var nodeAny = node;
- if (!readonly && (this.match(types.parenL) || this.isRelational("<"))) {
- var method = nodeAny;
- this.tsFillSignature(types.colon, method);
- this.tsParseTypeMemberSemicolon();
- return this.finishNode(method, "TSMethodSignature");
- } else {
- var property = nodeAny;
- if (readonly) property.readonly = true;
- var type = this.tsTryParseTypeAnnotation();
- if (type) property.typeAnnotation = type;
- this.tsParseTypeMemberSemicolon();
- return this.finishNode(property, "TSPropertySignature");
- }
- };
- _proto.tsParseTypeMember = function tsParseTypeMember() {
- var node = this.startNode();
- if (this.match(types.parenL) || this.isRelational("<")) {
- return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
- }
- if (this.match(types._new)) {
- var id = this.startNode();
- this.next();
- if (this.match(types.parenL) || this.isRelational("<")) {
- return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
- } else {
- node.key = this.createIdentifier(id, "new");
- return this.tsParsePropertyOrMethodSignature(node, false);
- }
- }
- var readonly = !!this.tsParseModifier(["readonly"]);
- var idx = this.tsTryParseIndexSignature(node);
- if (idx) {
- if (readonly) node.readonly = true;
- return idx;
- }
- this.parsePropertyName(node, false);
- return this.tsParsePropertyOrMethodSignature(node, readonly);
- };
- _proto.tsParseTypeLiteral = function tsParseTypeLiteral() {
- var node = this.startNode();
- node.members = this.tsParseObjectTypeMembers();
- return this.finishNode(node, "TSTypeLiteral");
- };
- _proto.tsParseObjectTypeMembers = function tsParseObjectTypeMembers() {
- this.expect(types.braceL);
- var members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
- this.expect(types.braceR);
- return members;
- };
- _proto.tsIsStartOfMappedType = function tsIsStartOfMappedType() {
- this.next();
- if (this.eat(types.plusMin)) {
- return this.isContextual("readonly");
- }
- if (this.isContextual("readonly")) {
- this.next();
- }
- if (!this.match(types.bracketL)) {
- return false;
- }
- this.next();
- if (!this.tsIsIdentifier()) {
- return false;
- }
- this.next();
- return this.match(types._in);
- };
- _proto.tsParseMappedTypeParameter = function tsParseMappedTypeParameter() {
- var node = this.startNode();
- node.name = this.parseIdentifierName(node.start);
- node.constraint = this.tsExpectThenParseType(types._in);
- return this.finishNode(node, "TSTypeParameter");
- };
- _proto.tsParseMappedType = function tsParseMappedType() {
- var node = this.startNode();
- this.expect(types.braceL);
- if (this.match(types.plusMin)) {
- node.readonly = this.state.value;
- this.next();
- this.expectContextual("readonly");
- } else if (this.eatContextual("readonly")) {
- node.readonly = true;
- }
- this.expect(types.bracketL);
- node.typeParameter = this.tsParseMappedTypeParameter();
- this.expect(types.bracketR);
- if (this.match(types.plusMin)) {
- node.optional = this.state.value;
- this.next();
- this.expect(types.question);
- } else if (this.eat(types.question)) {
- node.optional = true;
- }
- node.typeAnnotation = this.tsTryParseType();
- this.semicolon();
- this.expect(types.braceR);
- return this.finishNode(node, "TSMappedType");
- };
- _proto.tsParseTupleType = function tsParseTupleType() {
- var _this2 = this;
- var node = this.startNode();
- node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
- var seenOptionalElement = false;
- node.elementTypes.forEach(function (elementNode) {
- if (elementNode.type === "TSOptionalType") {
- seenOptionalElement = true;
- } else if (seenOptionalElement && elementNode.type !== "TSRestType") {
- _this2.raise(elementNode.start, "A required element cannot follow an optional element.");
- }
- });
- return this.finishNode(node, "TSTupleType");
- };
- _proto.tsParseTupleElementType = function tsParseTupleElementType() {
- if (this.match(types.ellipsis)) {
- var restNode = this.startNode();
- this.next();
- restNode.typeAnnotation = this.tsParseType();
- if (this.match(types.comma) && this.lookaheadCharCode() !== 93) {
- this.raiseRestNotLast(this.state.start);
- }
- return this.finishNode(restNode, "TSRestType");
- }
- var type = this.tsParseType();
- if (this.eat(types.question)) {
- var optionalTypeNode = this.startNodeAtNode(type);
- optionalTypeNode.typeAnnotation = type;
- return this.finishNode(optionalTypeNode, "TSOptionalType");
- }
- return type;
- };
- _proto.tsParseParenthesizedType = function tsParseParenthesizedType() {
- var node = this.startNode();
- this.expect(types.parenL);
- node.typeAnnotation = this.tsParseType();
- this.expect(types.parenR);
- return this.finishNode(node, "TSParenthesizedType");
- };
- _proto.tsParseFunctionOrConstructorType = function tsParseFunctionOrConstructorType(type) {
- var node = this.startNode();
- if (type === "TSConstructorType") {
- this.expect(types._new);
- }
- this.tsFillSignature(types.arrow, node);
- return this.finishNode(node, type);
- };
- _proto.tsParseLiteralTypeNode = function tsParseLiteralTypeNode() {
- var _this3 = this;
- var node = this.startNode();
- node.literal = function () {
- switch (_this3.state.type) {
- case types.num:
- case types.string:
- case types._true:
- case types._false:
- return _this3.parseExprAtom();
- default:
- throw _this3.unexpected();
- }
- }();
- return this.finishNode(node, "TSLiteralType");
- };
- _proto.tsParseTemplateLiteralType = function tsParseTemplateLiteralType() {
- var node = this.startNode();
- var templateNode = this.parseTemplate(false);
- if (templateNode.expressions.length > 0) {
- this.raise(templateNode.expressions[0].start, "Template literal types cannot have any substitution");
- }
- node.literal = templateNode;
- return this.finishNode(node, "TSLiteralType");
- };
- _proto.tsParseThisTypeOrThisTypePredicate = function tsParseThisTypeOrThisTypePredicate() {
- var thisKeyword = this.tsParseThisTypeNode();
- if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
- return this.tsParseThisTypePredicate(thisKeyword);
- } else {
- return thisKeyword;
- }
- };
- _proto.tsParseNonArrayType = function tsParseNonArrayType() {
- switch (this.state.type) {
- case types.name:
- case types._void:
- case types._null:
- {
- var type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
- if (type !== undefined && this.lookaheadCharCode() !== 46) {
- var node = this.startNode();
- this.next();
- return this.finishNode(node, type);
- }
- return this.tsParseTypeReference();
- }
- case types.string:
- case types.num:
- case types._true:
- case types._false:
- return this.tsParseLiteralTypeNode();
- case types.plusMin:
- if (this.state.value === "-") {
- var _node = this.startNode();
- if (this.lookahead().type !== types.num) {
- throw this.unexpected();
- }
- _node.literal = this.parseMaybeUnary();
- return this.finishNode(_node, "TSLiteralType");
- }
- break;
- case types._this:
- return this.tsParseThisTypeOrThisTypePredicate();
- case types._typeof:
- return this.tsParseTypeQuery();
- case types._import:
- return this.tsParseImportType();
- case types.braceL:
- return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
- case types.bracketL:
- return this.tsParseTupleType();
- case types.parenL:
- return this.tsParseParenthesizedType();
- case types.backQuote:
- return this.tsParseTemplateLiteralType();
- }
- throw this.unexpected();
- };
- _proto.tsParseArrayTypeOrHigher = function tsParseArrayTypeOrHigher() {
- var type = this.tsParseNonArrayType();
- while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) {
- if (this.match(types.bracketR)) {
- var node = this.startNodeAtNode(type);
- node.elementType = type;
- this.expect(types.bracketR);
- type = this.finishNode(node, "TSArrayType");
- } else {
- var _node2 = this.startNodeAtNode(type);
- _node2.objectType = type;
- _node2.indexType = this.tsParseType();
- this.expect(types.bracketR);
- type = this.finishNode(_node2, "TSIndexedAccessType");
- }
- }
- return type;
- };
- _proto.tsParseTypeOperator = function tsParseTypeOperator(operator) {
- var node = this.startNode();
- this.expectContextual(operator);
- node.operator = operator;
- node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
- if (operator === "readonly") {
- this.tsCheckTypeAnnotationForReadOnly(node);
- }
- return this.finishNode(node, "TSTypeOperator");
- };
- _proto.tsCheckTypeAnnotationForReadOnly = function tsCheckTypeAnnotationForReadOnly(node) {
- switch (node.typeAnnotation.type) {
- case "TSTupleType":
- case "TSArrayType":
- return;
- default:
- this.raise(node.start, "'readonly' type modifier is only permitted on array and tuple literal types.");
- }
- };
- _proto.tsParseInferType = function tsParseInferType() {
- var node = this.startNode();
- this.expectContextual("infer");
- var typeParameter = this.startNode();
- typeParameter.name = this.parseIdentifierName(typeParameter.start);
- node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
- return this.finishNode(node, "TSInferType");
- };
- _proto.tsParseTypeOperatorOrHigher = function tsParseTypeOperatorOrHigher() {
- var _this4 = this;
- var operator = ["keyof", "unique", "readonly"].find(function (kw) {
- return _this4.isContextual(kw);
- });
- return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
- };
- _proto.tsParseUnionOrIntersectionType = function tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
- this.eat(operator);
- var type = parseConstituentType();
- if (this.match(operator)) {
- var types = [type];
- while (this.eat(operator)) {
- types.push(parseConstituentType());
- }
- var node = this.startNodeAtNode(type);
- node.types = types;
- type = this.finishNode(node, kind);
- }
- return type;
- };
- _proto.tsParseIntersectionTypeOrHigher = function tsParseIntersectionTypeOrHigher() {
- return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND);
- };
- _proto.tsParseUnionTypeOrHigher = function tsParseUnionTypeOrHigher() {
- return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR);
- };
- _proto.tsIsStartOfFunctionType = function tsIsStartOfFunctionType() {
- if (this.isRelational("<")) {
- return true;
- }
- return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
- };
- _proto.tsSkipParameterStart = function tsSkipParameterStart() {
- if (this.match(types.name) || this.match(types._this)) {
- this.next();
- return true;
- }
- if (this.match(types.braceL)) {
- var braceStackCounter = 1;
- this.next();
- while (braceStackCounter > 0) {
- if (this.match(types.braceL)) {
- ++braceStackCounter;
- } else if (this.match(types.braceR)) {
- --braceStackCounter;
- }
- this.next();
- }
- return true;
- }
- if (this.match(types.bracketL)) {
- var _braceStackCounter = 1;
- this.next();
- while (_braceStackCounter > 0) {
- if (this.match(types.bracketL)) {
- ++_braceStackCounter;
- } else if (this.match(types.bracketR)) {
- --_braceStackCounter;
- }
- this.next();
- }
- return true;
- }
- return false;
- };
- _proto.tsIsUnambiguouslyStartOfFunctionType = function tsIsUnambiguouslyStartOfFunctionType() {
- this.next();
- if (this.match(types.parenR) || this.match(types.ellipsis)) {
- return true;
- }
- if (this.tsSkipParameterStart()) {
- if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) {
- return true;
- }
- if (this.match(types.parenR)) {
- this.next();
- if (this.match(types.arrow)) {
- return true;
- }
- }
- }
- return false;
- };
- _proto.tsParseTypeOrTypePredicateAnnotation = function tsParseTypeOrTypePredicateAnnotation(returnToken) {
- var _this5 = this;
- return this.tsInType(function () {
- var t = _this5.startNode();
- _this5.expect(returnToken);
- var asserts = _this5.tsTryParse(_this5.tsParseTypePredicateAsserts.bind(_this5));
- if (asserts && _this5.match(types._this)) {
- var thisTypePredicate = _this5.tsParseThisTypeOrThisTypePredicate();
- if (thisTypePredicate.type === "TSThisType") {
- var _node3 = _this5.startNodeAtNode(t);
- _node3.parameterName = thisTypePredicate;
- _node3.asserts = true;
- thisTypePredicate = _this5.finishNode(_node3, "TSTypePredicate");
- } else {
- thisTypePredicate.asserts = true;
- }
- t.typeAnnotation = thisTypePredicate;
- return _this5.finishNode(t, "TSTypeAnnotation");
- }
- var typePredicateVariable = _this5.tsIsIdentifier() && _this5.tsTryParse(_this5.tsParseTypePredicatePrefix.bind(_this5));
- if (!typePredicateVariable) {
- if (!asserts) {
- return _this5.tsParseTypeAnnotation(false, t);
- }
- var _node4 = _this5.startNodeAtNode(t);
- _node4.parameterName = _this5.parseIdentifier();
- _node4.asserts = asserts;
- t.typeAnnotation = _this5.finishNode(_node4, "TSTypePredicate");
- return _this5.finishNode(t, "TSTypeAnnotation");
- }
- var type = _this5.tsParseTypeAnnotation(false);
- var node = _this5.startNodeAtNode(t);
- node.parameterName = typePredicateVariable;
- node.typeAnnotation = type;
- node.asserts = asserts;
- t.typeAnnotation = _this5.finishNode(node, "TSTypePredicate");
- return _this5.finishNode(t, "TSTypeAnnotation");
- });
- };
- _proto.tsTryParseTypeOrTypePredicateAnnotation = function tsTryParseTypeOrTypePredicateAnnotation() {
- return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined;
- };
- _proto.tsTryParseTypeAnnotation = function tsTryParseTypeAnnotation() {
- return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined;
- };
- _proto.tsTryParseType = function tsTryParseType() {
- return this.tsEatThenParseType(types.colon);
- };
- _proto.tsParseTypePredicatePrefix = function tsParseTypePredicatePrefix() {
- var id = this.parseIdentifier();
- if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
- this.next();
- return id;
- }
- };
- _proto.tsParseTypePredicateAsserts = function tsParseTypePredicateAsserts() {
- if (!this.match(types.name) || this.state.value !== "asserts" || this.hasPrecedingLineBreak()) {
- return false;
- }
- var containsEsc = this.state.containsEsc;
- this.next();
- if (!this.match(types.name) && !this.match(types._this)) {
- return false;
- }
- if (containsEsc) {
- this.raise(this.state.lastTokStart, "Escape sequence in keyword asserts");
- }
- return true;
- };
- _proto.tsParseTypeAnnotation = function tsParseTypeAnnotation(eatColon, t) {
- var _this6 = this;
- if (eatColon === void 0) {
- eatColon = true;
- }
- if (t === void 0) {
- t = this.startNode();
- }
- this.tsInType(function () {
- if (eatColon) _this6.expect(types.colon);
- t.typeAnnotation = _this6.tsParseType();
- });
- return this.finishNode(t, "TSTypeAnnotation");
- };
- _proto.tsParseType = function tsParseType() {
- assert$1(this.state.inType);
- var type = this.tsParseNonConditionalType();
- if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) {
- return type;
- }
- var node = this.startNodeAtNode(type);
- node.checkType = type;
- node.extendsType = this.tsParseNonConditionalType();
- this.expect(types.question);
- node.trueType = this.tsParseType();
- this.expect(types.colon);
- node.falseType = this.tsParseType();
- return this.finishNode(node, "TSConditionalType");
- };
- _proto.tsParseNonConditionalType = function tsParseNonConditionalType() {
- if (this.tsIsStartOfFunctionType()) {
- return this.tsParseFunctionOrConstructorType("TSFunctionType");
- }
- if (this.match(types._new)) {
- return this.tsParseFunctionOrConstructorType("TSConstructorType");
- }
- return this.tsParseUnionTypeOrHigher();
- };
- _proto.tsParseTypeAssertion = function tsParseTypeAssertion() {
- var node = this.startNode();
- var _const = this.tsTryNextParseConstantContext();
- node.typeAnnotation = _const || this.tsNextThenParseType();
- this.expectRelational(">");
- node.expression = this.parseMaybeUnary();
- return this.finishNode(node, "TSTypeAssertion");
- };
- _proto.tsParseHeritageClause = function tsParseHeritageClause(descriptor) {
- var originalStart = this.state.start;
- var delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
- if (!delimitedList.length) {
- this.raise(originalStart, "'" + descriptor + "' list cannot be empty.");
- }
- return delimitedList;
- };
- _proto.tsParseExpressionWithTypeArguments = function tsParseExpressionWithTypeArguments() {
- var node = this.startNode();
- node.expression = this.tsParseEntityName(false);
- if (this.isRelational("<")) {
- node.typeParameters = this.tsParseTypeArguments();
- }
- return this.finishNode(node, "TSExpressionWithTypeArguments");
- };
- _proto.tsParseInterfaceDeclaration = function tsParseInterfaceDeclaration(node) {
- node.id = this.parseIdentifier();
- this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, "typescript interface declaration");
- node.typeParameters = this.tsTryParseTypeParameters();
- if (this.eat(types._extends)) {
- node["extends"] = this.tsParseHeritageClause("extends");
- }
- var body = this.startNode();
- body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
- node.body = this.finishNode(body, "TSInterfaceBody");
- return this.finishNode(node, "TSInterfaceDeclaration");
- };
- _proto.tsParseTypeAliasDeclaration = function tsParseTypeAliasDeclaration(node) {
- node.id = this.parseIdentifier();
- this.checkLVal(node.id, BIND_TS_TYPE, undefined, "typescript type alias");
- node.typeParameters = this.tsTryParseTypeParameters();
- node.typeAnnotation = this.tsExpectThenParseType(types.eq);
- this.semicolon();
- return this.finishNode(node, "TSTypeAliasDeclaration");
- };
- _proto.tsInNoContext = function tsInNoContext(cb) {
- var oldContext = this.state.context;
- this.state.context = [oldContext[0]];
- try {
- return cb();
- } finally {
- this.state.context = oldContext;
- }
- };
- _proto.tsInType = function tsInType(cb) {
- var oldInType = this.state.inType;
- this.state.inType = true;
- try {
- return cb();
- } finally {
- this.state.inType = oldInType;
- }
- };
- _proto.tsEatThenParseType = function tsEatThenParseType(token) {
- return !this.match(token) ? undefined : this.tsNextThenParseType();
- };
- _proto.tsExpectThenParseType = function tsExpectThenParseType(token) {
- var _this7 = this;
- return this.tsDoThenParseType(function () {
- return _this7.expect(token);
- });
- };
- _proto.tsNextThenParseType = function tsNextThenParseType() {
- var _this8 = this;
- return this.tsDoThenParseType(function () {
- return _this8.next();
- });
- };
- _proto.tsDoThenParseType = function tsDoThenParseType(cb) {
- var _this9 = this;
- return this.tsInType(function () {
- cb();
- return _this9.tsParseType();
- });
- };
- _proto.tsParseEnumMember = function tsParseEnumMember() {
- var node = this.startNode();
- node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
- if (this.eat(types.eq)) {
- node.initializer = this.parseMaybeAssign();
- }
- return this.finishNode(node, "TSEnumMember");
- };
- _proto.tsParseEnumDeclaration = function tsParseEnumDeclaration(node, isConst) {
- if (isConst) node["const"] = true;
- node.id = this.parseIdentifier();
- this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, "typescript enum declaration");
- this.expect(types.braceL);
- node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
- this.expect(types.braceR);
- return this.finishNode(node, "TSEnumDeclaration");
- };
- _proto.tsParseModuleBlock = function tsParseModuleBlock() {
- var node = this.startNode();
- this.scope.enter(SCOPE_OTHER);
- this.expect(types.braceL);
- this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR);
- this.scope.exit();
- return this.finishNode(node, "TSModuleBlock");
- };
- _proto.tsParseModuleOrNamespaceDeclaration = function tsParseModuleOrNamespaceDeclaration(node, nested) {
- if (nested === void 0) {
- nested = false;
- }
- node.id = this.parseIdentifier();
- if (!nested) {
- this.checkLVal(node.id, BIND_TS_NAMESPACE, null, "module or namespace declaration");
- }
- if (this.eat(types.dot)) {
- var inner = this.startNode();
- this.tsParseModuleOrNamespaceDeclaration(inner, true);
- node.body = inner;
- } else {
- this.scope.enter(SCOPE_TS_MODULE);
- node.body = this.tsParseModuleBlock();
- this.scope.exit();
- }
- return this.finishNode(node, "TSModuleDeclaration");
- };
- _proto.tsParseAmbientExternalModuleDeclaration = function tsParseAmbientExternalModuleDeclaration(node) {
- if (this.isContextual("global")) {
- node.global = true;
- node.id = this.parseIdentifier();
- } else if (this.match(types.string)) {
- node.id = this.parseExprAtom();
- } else {
- this.unexpected();
- }
- if (this.match(types.braceL)) {
- this.scope.enter(SCOPE_TS_MODULE);
- node.body = this.tsParseModuleBlock();
- this.scope.exit();
- } else {
- this.semicolon();
- }
- return this.finishNode(node, "TSModuleDeclaration");
- };
- _proto.tsParseImportEqualsDeclaration = function tsParseImportEqualsDeclaration(node, isExport) {
- node.isExport = isExport || false;
- node.id = this.parseIdentifier();
- this.checkLVal(node.id, BIND_LEXICAL, undefined, "import equals declaration");
- this.expect(types.eq);
- node.moduleReference = this.tsParseModuleReference();
- this.semicolon();
- return this.finishNode(node, "TSImportEqualsDeclaration");
- };
- _proto.tsIsExternalModuleReference = function tsIsExternalModuleReference() {
- return this.isContextual("require") && this.lookaheadCharCode() === 40;
- };
- _proto.tsParseModuleReference = function tsParseModuleReference() {
- return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
- };
- _proto.tsParseExternalModuleReference = function tsParseExternalModuleReference() {
- var node = this.startNode();
- this.expectContextual("require");
- this.expect(types.parenL);
- if (!this.match(types.string)) {
- throw this.unexpected();
- }
- node.expression = this.parseExprAtom();
- this.expect(types.parenR);
- return this.finishNode(node, "TSExternalModuleReference");
- };
- _proto.tsLookAhead = function tsLookAhead(f) {
- var state = this.state.clone();
- var res = f();
- this.state = state;
- return res;
- };
- _proto.tsTryParseAndCatch = function tsTryParseAndCatch(f) {
- var result = this.tryParse(function (abort) {
- return f() || abort();
- });
- if (result.aborted || !result.node) return undefined;
- if (result.error) this.state = result.failState;
- return result.node;
- };
- _proto.tsTryParse = function tsTryParse(f) {
- var state = this.state.clone();
- var result = f();
- if (result !== undefined && result !== false) {
- return result;
- } else {
- this.state = state;
- return undefined;
- }
- };
- _proto.tsTryParseDeclare = function tsTryParseDeclare(nany) {
- if (this.isLineTerminator()) {
- return;
- }
- var starttype = this.state.type;
- var kind;
- if (this.isContextual("let")) {
- starttype = types._var;
- kind = "let";
- }
- switch (starttype) {
- case types._function:
- return this.parseFunctionStatement(nany, false, true);
- case types._class:
- nany.declare = true;
- return this.parseClass(nany, true, false);
- case types._const:
- if (this.match(types._const) && this.isLookaheadContextual("enum")) {
- this.expect(types._const);
- this.expectContextual("enum");
- return this.tsParseEnumDeclaration(nany, true);
- }
- case types._var:
- kind = kind || this.state.value;
- return this.parseVarStatement(nany, kind);
- case types.name:
- {
- var value = this.state.value;
- if (value === "global") {
- return this.tsParseAmbientExternalModuleDeclaration(nany);
- } else {
- return this.tsParseDeclaration(nany, value, true);
- }
- }
- }
- };
- _proto.tsTryParseExportDeclaration = function tsTryParseExportDeclaration() {
- return this.tsParseDeclaration(this.startNode(), this.state.value, true);
- };
- _proto.tsParseExpressionStatement = function tsParseExpressionStatement(node, expr) {
- switch (expr.name) {
- case "declare":
- {
- var declaration = this.tsTryParseDeclare(node);
- if (declaration) {
- declaration.declare = true;
- return declaration;
- }
- break;
- }
- case "global":
- if (this.match(types.braceL)) {
- this.scope.enter(SCOPE_TS_MODULE);
- var mod = node;
- mod.global = true;
- mod.id = expr;
- mod.body = this.tsParseModuleBlock();
- this.scope.exit();
- return this.finishNode(mod, "TSModuleDeclaration");
- }
- break;
- default:
- return this.tsParseDeclaration(node, expr.name, false);
- }
- };
- _proto.tsParseDeclaration = function tsParseDeclaration(node, value, next) {
- switch (value) {
- case "abstract":
- if (this.tsCheckLineTerminatorAndMatch(types._class, next)) {
- var cls = node;
- cls["abstract"] = true;
- if (next) {
- this.next();
- if (!this.match(types._class)) {
- this.unexpected(null, types._class);
- }
- }
- return this.parseClass(cls, true, false);
- }
- break;
- case "enum":
- if (next || this.match(types.name)) {
- if (next) this.next();
- return this.tsParseEnumDeclaration(node, false);
- }
- break;
- case "interface":
- if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
- if (next) this.next();
- return this.tsParseInterfaceDeclaration(node);
- }
- break;
- case "module":
- if (next) this.next();
- if (this.match(types.string)) {
- return this.tsParseAmbientExternalModuleDeclaration(node);
- } else if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
- return this.tsParseModuleOrNamespaceDeclaration(node);
- }
- break;
- case "namespace":
- if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
- if (next) this.next();
- return this.tsParseModuleOrNamespaceDeclaration(node);
- }
- break;
- case "type":
- if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
- if (next) this.next();
- return this.tsParseTypeAliasDeclaration(node);
- }
- break;
- }
- };
- _proto.tsCheckLineTerminatorAndMatch = function tsCheckLineTerminatorAndMatch(tokenType, next) {
- return (next || this.match(tokenType)) && !this.isLineTerminator();
- };
- _proto.tsTryParseGenericAsyncArrowFunction = function tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
- var _this10 = this;
- if (!this.isRelational("<")) {
- return undefined;
- }
- var res = this.tsTryParseAndCatch(function () {
- var node = _this10.startNodeAt(startPos, startLoc);
- node.typeParameters = _this10.tsParseTypeParameters();
- _superClass.prototype.parseFunctionParams.call(_this10, node);
- node.returnType = _this10.tsTryParseTypeOrTypePredicateAnnotation();
- _this10.expect(types.arrow);
- return node;
- });
- if (!res) {
- return undefined;
- }
- return this.parseArrowExpression(res, null, true);
- };
- _proto.tsParseTypeArguments = function tsParseTypeArguments() {
- var _this11 = this;
- var node = this.startNode();
- node.params = this.tsInType(function () {
- return _this11.tsInNoContext(function () {
- _this11.expectRelational("<");
- return _this11.tsParseDelimitedList("TypeParametersOrArguments", _this11.tsParseType.bind(_this11));
- });
- });
- this.state.exprAllowed = false;
- this.expectRelational(">");
- return this.finishNode(node, "TSTypeParameterInstantiation");
- };
- _proto.tsIsDeclarationStart = function tsIsDeclarationStart() {
- if (this.match(types.name)) {
- switch (this.state.value) {
- case "abstract":
- case "declare":
- case "enum":
- case "interface":
- case "module":
- case "namespace":
- case "type":
- return true;
- }
- }
- return false;
- };
- _proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
- if (this.tsIsDeclarationStart()) return false;
- return _superClass.prototype.isExportDefaultSpecifier.call(this);
- };
- _proto.parseAssignableListItem = function parseAssignableListItem(allowModifiers, decorators) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var accessibility;
- var readonly = false;
- if (allowModifiers) {
- accessibility = this.parseAccessModifier();
- readonly = !!this.tsParseModifier(["readonly"]);
- }
- var left = this.parseMaybeDefault();
- this.parseAssignableListItemTypes(left);
- var elt = this.parseMaybeDefault(left.start, left.loc.start, left);
- if (accessibility || readonly) {
- var pp = this.startNodeAt(startPos, startLoc);
- if (decorators.length) {
- pp.decorators = decorators;
- }
- if (accessibility) pp.accessibility = accessibility;
- if (readonly) pp.readonly = readonly;
- if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
- this.raise(pp.start, "A parameter property may not be declared using a binding pattern.");
- }
- pp.parameter = elt;
- return this.finishNode(pp, "TSParameterProperty");
- }
- if (decorators.length) {
- left.decorators = decorators;
- }
- return elt;
- };
- _proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, isMethod) {
- if (isMethod === void 0) {
- isMethod = false;
- }
- if (this.match(types.colon)) {
- node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
- }
- var bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
- if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) {
- this.finishNode(node, bodilessType);
- return;
- }
- _superClass.prototype.parseFunctionBodyAndFinish.call(this, node, type, isMethod);
- };
- _proto.registerFunctionStatementId = function registerFunctionStatementId(node) {
- if (!node.body && node.id) {
- this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name");
- } else {
- _superClass.prototype.registerFunctionStatementId.apply(this, arguments);
- }
- };
- _proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, state) {
- var _this12 = this;
- if (!this.hasPrecedingLineBreak() && this.match(types.bang)) {
- this.state.exprAllowed = false;
- this.next();
- var nonNullExpression = this.startNodeAt(startPos, startLoc);
- nonNullExpression.expression = base;
- return this.finishNode(nonNullExpression, "TSNonNullExpression");
- }
- if (this.isRelational("<")) {
- var result = this.tsTryParseAndCatch(function () {
- if (!noCalls && _this12.atPossibleAsync(base)) {
- var asyncArrowFn = _this12.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
- if (asyncArrowFn) {
- return asyncArrowFn;
- }
- }
- var node = _this12.startNodeAt(startPos, startLoc);
- node.callee = base;
- var typeArguments = _this12.tsParseTypeArguments();
- if (typeArguments) {
- if (!noCalls && _this12.eat(types.parenL)) {
- node.arguments = _this12.parseCallExpressionArguments(types.parenR, false);
- node.typeParameters = typeArguments;
- return _this12.finishCallExpression(node, state.optionalChainMember);
- } else if (_this12.match(types.backQuote)) {
- return _this12.parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments);
- }
- }
- _this12.unexpected();
- });
- if (result) return result;
- }
- return _superClass.prototype.parseSubscript.call(this, base, startPos, startLoc, noCalls, state);
- };
- _proto.parseNewArguments = function parseNewArguments(node) {
- var _this13 = this;
- if (this.isRelational("<")) {
- var typeParameters = this.tsTryParseAndCatch(function () {
- var args = _this13.tsParseTypeArguments();
- if (!_this13.match(types.parenL)) _this13.unexpected();
- return args;
- });
- if (typeParameters) {
- node.typeParameters = typeParameters;
- }
- }
- _superClass.prototype.parseNewArguments.call(this, node);
- };
- _proto.parseExprOp = function parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
- if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
- var node = this.startNodeAt(leftStartPos, leftStartLoc);
- node.expression = left;
- var _const = this.tsTryNextParseConstantContext();
- if (_const) {
- node.typeAnnotation = _const;
- } else {
- node.typeAnnotation = this.tsNextThenParseType();
- }
- this.finishNode(node, "TSAsExpression");
- return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
- }
- return _superClass.prototype.parseExprOp.call(this, left, leftStartPos, leftStartLoc, minPrec, noIn);
- };
- _proto.checkReservedWord = function checkReservedWord(word, startLoc, checkKeywords, isBinding) {};
- _proto.checkDuplicateExports = function checkDuplicateExports() {};
- _proto.parseImport = function parseImport(node) {
- if (this.match(types.name) && this.lookahead().type === types.eq) {
- return this.tsParseImportEqualsDeclaration(node);
- }
- return _superClass.prototype.parseImport.call(this, node);
- };
- _proto.parseExport = function parseExport(node) {
- if (this.match(types._import)) {
- this.expect(types._import);
- return this.tsParseImportEqualsDeclaration(node, true);
- } else if (this.eat(types.eq)) {
- var assign = node;
- assign.expression = this.parseExpression();
- this.semicolon();
- return this.finishNode(assign, "TSExportAssignment");
- } else if (this.eatContextual("as")) {
- var decl = node;
- this.expectContextual("namespace");
- decl.id = this.parseIdentifier();
- this.semicolon();
- return this.finishNode(decl, "TSNamespaceExportDeclaration");
- } else {
- return _superClass.prototype.parseExport.call(this, node);
- }
- };
- _proto.isAbstractClass = function isAbstractClass() {
- return this.isContextual("abstract") && this.lookahead().type === types._class;
- };
- _proto.parseExportDefaultExpression = function parseExportDefaultExpression() {
- if (this.isAbstractClass()) {
- var cls = this.startNode();
- this.next();
- this.parseClass(cls, true, true);
- cls["abstract"] = true;
- return cls;
- }
- if (this.state.value === "interface") {
- var result = this.tsParseDeclaration(this.startNode(), this.state.value, true);
- if (result) return result;
- }
- return _superClass.prototype.parseExportDefaultExpression.call(this);
- };
- _proto.parseStatementContent = function parseStatementContent(context, topLevel) {
- if (this.state.type === types._const) {
- var ahead = this.lookahead();
- if (ahead.type === types.name && ahead.value === "enum") {
- var node = this.startNode();
- this.expect(types._const);
- this.expectContextual("enum");
- return this.tsParseEnumDeclaration(node, true);
- }
- }
- return _superClass.prototype.parseStatementContent.call(this, context, topLevel);
- };
- _proto.parseAccessModifier = function parseAccessModifier() {
- return this.tsParseModifier(["public", "protected", "private"]);
- };
- _proto.parseClassMember = function parseClassMember(classBody, member, state, constructorAllowsSuper) {
- var accessibility = this.parseAccessModifier();
- if (accessibility) member.accessibility = accessibility;
- _superClass.prototype.parseClassMember.call(this, classBody, member, state, constructorAllowsSuper);
- };
- _proto.parseClassMemberWithIsStatic = function parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
- var modifiers = this.tsParseModifiers(["abstract", "readonly", "declare"]);
- Object.assign(member, modifiers);
- var idx = this.tsTryParseIndexSignature(member);
- if (idx) {
- classBody.body.push(idx);
- if (modifiers["abstract"]) {
- this.raise(member.start, "Index signatures cannot have the 'abstract' modifier");
- }
- if (isStatic) {
- this.raise(member.start, "Index signatures cannot have the 'static' modifier");
- }
- if (member.accessibility) {
- this.raise(member.start, "Index signatures cannot have an accessibility modifier ('" + member.accessibility + "')");
- }
- return;
- }
- _superClass.prototype.parseClassMemberWithIsStatic.call(this, classBody, member, state, isStatic, constructorAllowsSuper);
- };
- _proto.parsePostMemberNameModifiers = function parsePostMemberNameModifiers(methodOrProp) {
- var optional = this.eat(types.question);
- if (optional) methodOrProp.optional = true;
- if (methodOrProp.readonly && this.match(types.parenL)) {
- this.raise(methodOrProp.start, "Class methods cannot have the 'readonly' modifier");
- }
- if (methodOrProp.declare && this.match(types.parenL)) {
- this.raise(methodOrProp.start, "Class methods cannot have the 'declare' modifier");
- }
- };
- _proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
- var decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
- return decl || _superClass.prototype.parseExpressionStatement.call(this, node, expr);
- };
- _proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
- if (this.tsIsDeclarationStart()) return true;
- return _superClass.prototype.shouldParseExportDeclaration.call(this);
- };
- _proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
- var _this14 = this;
- if (!refNeedsArrowPos || !this.match(types.question)) {
- return _superClass.prototype.parseConditional.call(this, expr, noIn, startPos, startLoc, refNeedsArrowPos);
- }
- var result = this.tryParse(function () {
- return _superClass.prototype.parseConditional.call(_this14, expr, noIn, startPos, startLoc);
- });
- if (!result.node) {
- refNeedsArrowPos.start = result.error.pos || this.state.start;
- return expr;
- }
- if (result.error) this.state = result.failState;
- return result.node;
- };
- _proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
- node = _superClass.prototype.parseParenItem.call(this, node, startPos, startLoc);
- if (this.eat(types.question)) {
- node.optional = true;
- this.resetEndLocation(node);
- }
- if (this.match(types.colon)) {
- var typeCastNode = this.startNodeAt(startPos, startLoc);
- typeCastNode.expression = node;
- typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
- return this.finishNode(typeCastNode, "TSTypeCastExpression");
- }
- return node;
- };
- _proto.parseExportDeclaration = function parseExportDeclaration(node) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var isDeclare = this.eatContextual("declare");
- var declaration;
- if (this.match(types.name)) {
- declaration = this.tsTryParseExportDeclaration();
- }
- if (!declaration) {
- declaration = _superClass.prototype.parseExportDeclaration.call(this, node);
- }
- if (declaration && isDeclare) {
- this.resetStartLocation(declaration, startPos, startLoc);
- declaration.declare = true;
- }
- return declaration;
- };
- _proto.parseClassId = function parseClassId(node, isStatement, optionalId) {
- if ((!isStatement || optionalId) && this.isContextual("implements")) {
- return;
- }
- _superClass.prototype.parseClassId.call(this, node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
- var typeParameters = this.tsTryParseTypeParameters();
- if (typeParameters) node.typeParameters = typeParameters;
- };
- _proto.parseClassPropertyAnnotation = function parseClassPropertyAnnotation(node) {
- if (!node.optional && this.eat(types.bang)) {
- node.definite = true;
- }
- var type = this.tsTryParseTypeAnnotation();
- if (type) node.typeAnnotation = type;
- };
- _proto.parseClassProperty = function parseClassProperty(node) {
- this.parseClassPropertyAnnotation(node);
- if (node.declare && this.match(types.equal)) {
- this.raise(this.state.start, "'declare' class fields cannot have an initializer");
- }
- return _superClass.prototype.parseClassProperty.call(this, node);
- };
- _proto.parseClassPrivateProperty = function parseClassPrivateProperty(node) {
- if (node["abstract"]) {
- this.raise(node.start, "Private elements cannot have the 'abstract' modifier.");
- }
- if (node.accessibility) {
- this.raise(node.start, "Private elements cannot have an accessibility modifier ('" + node.accessibility + "')");
- }
- this.parseClassPropertyAnnotation(node);
- return _superClass.prototype.parseClassPrivateProperty.call(this, node);
- };
- _proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
- var typeParameters = this.tsTryParseTypeParameters();
- if (typeParameters) method.typeParameters = typeParameters;
- _superClass.prototype.pushClassMethod.call(this, classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
- };
- _proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
- var typeParameters = this.tsTryParseTypeParameters();
- if (typeParameters) method.typeParameters = typeParameters;
- _superClass.prototype.pushClassPrivateMethod.call(this, classBody, method, isGenerator, isAsync);
- };
- _proto.parseClassSuper = function parseClassSuper(node) {
- _superClass.prototype.parseClassSuper.call(this, node);
- if (node.superClass && this.isRelational("<")) {
- node.superTypeParameters = this.tsParseTypeArguments();
- }
- if (this.eatContextual("implements")) {
- node["implements"] = this.tsParseHeritageClause("implements");
- }
- };
- _proto.parseObjPropValue = function parseObjPropValue(prop) {
- var _superClass$prototype;
- var typeParameters = this.tsTryParseTypeParameters();
- if (typeParameters) prop.typeParameters = typeParameters;
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- (_superClass$prototype = _superClass.prototype.parseObjPropValue).call.apply(_superClass$prototype, [this, prop].concat(args));
- };
- _proto.parseFunctionParams = function parseFunctionParams(node, allowModifiers) {
- var typeParameters = this.tsTryParseTypeParameters();
- if (typeParameters) node.typeParameters = typeParameters;
- _superClass.prototype.parseFunctionParams.call(this, node, allowModifiers);
- };
- _proto.parseVarId = function parseVarId(decl, kind) {
- _superClass.prototype.parseVarId.call(this, decl, kind);
- if (decl.id.type === "Identifier" && this.eat(types.bang)) {
- decl.definite = true;
- }
- var type = this.tsTryParseTypeAnnotation();
- if (type) {
- decl.id.typeAnnotation = type;
- this.resetEndLocation(decl.id);
- }
- };
- _proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
- if (this.match(types.colon)) {
- node.returnType = this.tsParseTypeAnnotation();
- }
- return _superClass.prototype.parseAsyncArrowFromCallExpression.call(this, node, call);
- };
- _proto.parseMaybeAssign = function parseMaybeAssign() {
- var _this15 = this;
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- var state;
- var jsx;
- var typeCast;
- if (this.match(types.jsxTagStart)) {
- state = this.state.clone();
- jsx = this.tryParse(function () {
- var _superClass$prototype2;
- return (_superClass$prototype2 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype2, [_this15].concat(args));
- }, state);
- if (!jsx.error) return jsx.node;
- var context = this.state.context;
- if (context[context.length - 1] === types$1.j_oTag) {
- context.length -= 2;
- } else if (context[context.length - 1] === types$1.j_expr) {
- context.length -= 1;
- }
- }
- if (!(jsx && jsx.error) && !this.isRelational("<")) {
- var _superClass$prototype3;
- return (_superClass$prototype3 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype3, [this].concat(args));
- }
- var typeParameters;
- state = state || this.state.clone();
- var arrow = this.tryParse(function (abort) {
- var _superClass$prototype4;
- typeParameters = _this15.tsParseTypeParameters();
- var expr = (_superClass$prototype4 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype4, [_this15].concat(args));
- if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) {
- abort();
- }
- if (typeParameters && typeParameters.params.length !== 0) {
- _this15.resetStartLocationFromNode(expr, typeParameters);
- }
- expr.typeParameters = typeParameters;
- return expr;
- }, state);
- if (!arrow.error && !arrow.aborted) return arrow.node;
- if (!jsx) {
- assert$1(!this.hasPlugin("jsx"));
- typeCast = this.tryParse(function () {
- var _superClass$prototype5;
- return (_superClass$prototype5 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype5, [_this15].concat(args));
- }, state);
- if (!typeCast.error) return typeCast.node;
- }
- if (jsx && jsx.node) {
- this.state = jsx.failState;
- return jsx.node;
- }
- if (arrow.node) {
- this.state = arrow.failState;
- return arrow.node;
- }
- if (typeCast && typeCast.node) {
- this.state = typeCast.failState;
- return typeCast.node;
- }
- if (jsx && jsx.thrown) throw jsx.error;
- if (arrow.thrown) throw arrow.error;
- if (typeCast && typeCast.thrown) throw typeCast.error;
- throw jsx && jsx.error || arrow.error || typeCast && typeCast.error;
- };
- _proto.parseMaybeUnary = function parseMaybeUnary(refShorthandDefaultPos) {
- if (!this.hasPlugin("jsx") && this.isRelational("<")) {
- return this.tsParseTypeAssertion();
- } else {
- return _superClass.prototype.parseMaybeUnary.call(this, refShorthandDefaultPos);
- }
- };
- _proto.parseArrow = function parseArrow(node) {
- var _this16 = this;
- if (this.match(types.colon)) {
- var result = this.tryParse(function (abort) {
- var returnType = _this16.tsParseTypeOrTypePredicateAnnotation(types.colon);
- if (_this16.canInsertSemicolon() || !_this16.match(types.arrow)) abort();
- return returnType;
- });
- if (result.aborted) return;
- if (!result.thrown) {
- if (result.error) this.state = result.failState;
- node.returnType = result.node;
- }
- }
- return _superClass.prototype.parseArrow.call(this, node);
- };
- _proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
- if (this.eat(types.question)) {
- if (param.type !== "Identifier") {
- this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
- }
- param.optional = true;
- }
- var type = this.tsTryParseTypeAnnotation();
- if (type) param.typeAnnotation = type;
- this.resetEndLocation(param);
- return param;
- };
- _proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
- switch (node.type) {
- case "TSTypeCastExpression":
- return _superClass.prototype.toAssignable.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
- case "TSParameterProperty":
- return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
- case "TSAsExpression":
- case "TSNonNullExpression":
- case "TSTypeAssertion":
- node.expression = this.toAssignable(node.expression, isBinding, contextDescription);
- return node;
- default:
- return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
- }
- };
- _proto.checkLVal = function checkLVal(expr, bindingType, checkClashes, contextDescription) {
- if (bindingType === void 0) {
- bindingType = BIND_NONE;
- }
- switch (expr.type) {
- case "TSTypeCastExpression":
- return;
- case "TSParameterProperty":
- this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property");
- return;
- case "TSAsExpression":
- case "TSNonNullExpression":
- case "TSTypeAssertion":
- this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription);
- return;
- default:
- _superClass.prototype.checkLVal.call(this, expr, bindingType, checkClashes, contextDescription);
- return;
- }
- };
- _proto.parseBindingAtom = function parseBindingAtom() {
- switch (this.state.type) {
- case types._this:
- return this.parseIdentifier(true);
- default:
- return _superClass.prototype.parseBindingAtom.call(this);
- }
- };
- _proto.parseMaybeDecoratorArguments = function parseMaybeDecoratorArguments(expr) {
- if (this.isRelational("<")) {
- var typeArguments = this.tsParseTypeArguments();
- if (this.match(types.parenL)) {
- var call = _superClass.prototype.parseMaybeDecoratorArguments.call(this, expr);
- call.typeParameters = typeArguments;
- return call;
- }
- this.unexpected(this.state.start, types.parenL);
- }
- return _superClass.prototype.parseMaybeDecoratorArguments.call(this, expr);
- };
- _proto.isClassMethod = function isClassMethod() {
- return this.isRelational("<") || _superClass.prototype.isClassMethod.call(this);
- };
- _proto.isClassProperty = function isClassProperty() {
- return this.match(types.bang) || this.match(types.colon) || _superClass.prototype.isClassProperty.call(this);
- };
- _proto.parseMaybeDefault = function parseMaybeDefault() {
- var _superClass$prototype6;
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- var node = (_superClass$prototype6 = _superClass.prototype.parseMaybeDefault).call.apply(_superClass$prototype6, [this].concat(args));
- if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
- this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
- }
- return node;
- };
- _proto.getTokenFromCode = function getTokenFromCode(code) {
- if (this.state.inType && (code === 62 || code === 60)) {
- return this.finishOp(types.relational, 1);
- } else {
- return _superClass.prototype.getTokenFromCode.call(this, code);
- }
- };
- _proto.toAssignableList = function toAssignableList(exprList, isBinding) {
- for (var i = 0; i < exprList.length; i++) {
- var expr = exprList[i];
- if (!expr) continue;
- switch (expr.type) {
- case "TSTypeCastExpression":
- exprList[i] = this.typeCastToParameter(expr);
- break;
- case "TSAsExpression":
- case "TSTypeAssertion":
- if (!isBinding) {
- exprList[i] = this.typeCastToParameter(expr);
- } else {
- this.raise(expr.start, "Unexpected type cast in parameter position.");
- }
- break;
- }
- }
- return _superClass.prototype.toAssignableList.apply(this, arguments);
- };
- _proto.typeCastToParameter = function typeCastToParameter(node) {
- node.expression.typeAnnotation = node.typeAnnotation;
- this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
- return node.expression;
- };
- _proto.toReferencedList = function toReferencedList(exprList, isInParens) {
- for (var i = 0; i < exprList.length; i++) {
- var expr = exprList[i];
- if (expr && expr.type === "TSTypeCastExpression") {
- this.raise(expr.start, "Did not expect a type annotation here.");
- }
- }
- return exprList;
- };
- _proto.shouldParseArrow = function shouldParseArrow() {
- return this.match(types.colon) || _superClass.prototype.shouldParseArrow.call(this);
- };
- _proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
- return this.match(types.colon) || _superClass.prototype.shouldParseAsyncArrow.call(this);
- };
- _proto.canHaveLeadingDecorator = function canHaveLeadingDecorator() {
- return _superClass.prototype.canHaveLeadingDecorator.call(this) || this.isAbstractClass();
- };
- _proto.jsxParseOpeningElementAfterName = function jsxParseOpeningElementAfterName(node) {
- var _this17 = this;
- if (this.isRelational("<")) {
- var typeArguments = this.tsTryParseAndCatch(function () {
- return _this17.tsParseTypeArguments();
- });
- if (typeArguments) node.typeParameters = typeArguments;
- }
- return _superClass.prototype.jsxParseOpeningElementAfterName.call(this, node);
- };
- _proto.getGetterSetterExpectedParamCount = function getGetterSetterExpectedParamCount(method) {
- var baseCount = _superClass.prototype.getGetterSetterExpectedParamCount.call(this, method);
- var firstParam = method.params[0];
- var hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this";
- return hasContextParam ? baseCount + 1 : baseCount;
- };
- return _class;
- }(superClass);
- });
- types.placeholder = new TokenType("%%", {
- startsExpr: true
- });
- var placeholders = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class() {
- return _superClass.apply(this, arguments) || this;
- }
- var _proto = _class.prototype;
- _proto.parsePlaceholder = function parsePlaceholder(expectedNode) {
- if (this.match(types.placeholder)) {
- var node = this.startNode();
- this.next();
- this.assertNoSpace("Unexpected space in placeholder.");
- node.name = _superClass.prototype.parseIdentifier.call(this, true);
- this.assertNoSpace("Unexpected space in placeholder.");
- this.expect(types.placeholder);
- return this.finishPlaceholder(node, expectedNode);
- }
- };
- _proto.finishPlaceholder = function finishPlaceholder(node, expectedNode) {
- var isFinished = !!(node.expectedNode && node.type === "Placeholder");
- node.expectedNode = expectedNode;
- return isFinished ? node : this.finishNode(node, "Placeholder");
- };
- _proto.getTokenFromCode = function getTokenFromCode(code) {
- if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
- return this.finishOp(types.placeholder, 2);
- }
- return _superClass.prototype.getTokenFromCode.apply(this, arguments);
- };
- _proto.parseExprAtom = function parseExprAtom() {
- return this.parsePlaceholder("Expression") || _superClass.prototype.parseExprAtom.apply(this, arguments);
- };
- _proto.parseIdentifier = function parseIdentifier() {
- return this.parsePlaceholder("Identifier") || _superClass.prototype.parseIdentifier.apply(this, arguments);
- };
- _proto.checkReservedWord = function checkReservedWord(word) {
- if (word !== undefined) _superClass.prototype.checkReservedWord.apply(this, arguments);
- };
- _proto.parseBindingAtom = function parseBindingAtom() {
- return this.parsePlaceholder("Pattern") || _superClass.prototype.parseBindingAtom.apply(this, arguments);
- };
- _proto.checkLVal = function checkLVal(expr) {
- if (expr.type !== "Placeholder") _superClass.prototype.checkLVal.apply(this, arguments);
- };
- _proto.toAssignable = function toAssignable(node) {
- if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
- node.expectedNode = "Pattern";
- return node;
- }
- return _superClass.prototype.toAssignable.apply(this, arguments);
- };
- _proto.verifyBreakContinue = function verifyBreakContinue(node) {
- if (node.label && node.label.type === "Placeholder") return;
- _superClass.prototype.verifyBreakContinue.apply(this, arguments);
- };
- _proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
- if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
- return _superClass.prototype.parseExpressionStatement.apply(this, arguments);
- }
- if (this.match(types.colon)) {
- var stmt = node;
- stmt.label = this.finishPlaceholder(expr, "Identifier");
- this.next();
- stmt.body = this.parseStatement("label");
- return this.finishNode(stmt, "LabeledStatement");
- }
- this.semicolon();
- node.name = expr.name;
- return this.finishPlaceholder(node, "Statement");
- };
- _proto.parseBlock = function parseBlock() {
- return this.parsePlaceholder("BlockStatement") || _superClass.prototype.parseBlock.apply(this, arguments);
- };
- _proto.parseFunctionId = function parseFunctionId() {
- return this.parsePlaceholder("Identifier") || _superClass.prototype.parseFunctionId.apply(this, arguments);
- };
- _proto.parseClass = function parseClass(node, isStatement, optionalId) {
- var type = isStatement ? "ClassDeclaration" : "ClassExpression";
- this.next();
- this.takeDecorators(node);
- var placeholder = this.parsePlaceholder("Identifier");
- if (placeholder) {
- if (this.match(types._extends) || this.match(types.placeholder) || this.match(types.braceL)) {
- node.id = placeholder;
- } else if (optionalId || !isStatement) {
- node.id = null;
- node.body = this.finishPlaceholder(placeholder, "ClassBody");
- return this.finishNode(node, type);
- } else {
- this.unexpected(null, "A class name is required");
- }
- } else {
- this.parseClassId(node, isStatement, optionalId);
- }
- this.parseClassSuper(node);
- node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass);
- return this.finishNode(node, type);
- };
- _proto.parseExport = function parseExport(node) {
- var placeholder = this.parsePlaceholder("Identifier");
- if (!placeholder) return _superClass.prototype.parseExport.apply(this, arguments);
- if (!this.isContextual("from") && !this.match(types.comma)) {
- node.specifiers = [];
- node.source = null;
- node.declaration = this.finishPlaceholder(placeholder, "Declaration");
- return this.finishNode(node, "ExportNamedDeclaration");
- }
- this.expectPlugin("exportDefaultFrom");
- var specifier = this.startNode();
- specifier.exported = placeholder;
- node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
- return _superClass.prototype.parseExport.call(this, node);
- };
- _proto.maybeParseExportDefaultSpecifier = function maybeParseExportDefaultSpecifier(node) {
- if (node.specifiers && node.specifiers.length > 0) {
- return true;
- }
- return _superClass.prototype.maybeParseExportDefaultSpecifier.apply(this, arguments);
- };
- _proto.checkExport = function checkExport(node) {
- var specifiers = node.specifiers;
- if (specifiers && specifiers.length) {
- node.specifiers = specifiers.filter(function (node) {
- return node.exported.type === "Placeholder";
- });
- }
- _superClass.prototype.checkExport.call(this, node);
- node.specifiers = specifiers;
- };
- _proto.parseImport = function parseImport(node) {
- var placeholder = this.parsePlaceholder("Identifier");
- if (!placeholder) return _superClass.prototype.parseImport.apply(this, arguments);
- node.specifiers = [];
- if (!this.isContextual("from") && !this.match(types.comma)) {
- node.source = this.finishPlaceholder(placeholder, "StringLiteral");
- this.semicolon();
- return this.finishNode(node, "ImportDeclaration");
- }
- var specifier = this.startNodeAtNode(placeholder);
- specifier.local = placeholder;
- this.finishNode(specifier, "ImportDefaultSpecifier");
- node.specifiers.push(specifier);
- if (this.eat(types.comma)) {
- var hasStarImport = this.maybeParseStarImportSpecifier(node);
- if (!hasStarImport) this.parseNamedImportSpecifiers(node);
- }
- this.expectContextual("from");
- node.source = this.parseImportSource();
- this.semicolon();
- return this.finishNode(node, "ImportDeclaration");
- };
- _proto.parseImportSource = function parseImportSource() {
- return this.parsePlaceholder("StringLiteral") || _superClass.prototype.parseImportSource.apply(this, arguments);
- };
- return _class;
- }(superClass);
- });
- var v8intrinsic = (function (superClass) {
- return function (_superClass) {
- _inheritsLoose(_class, _superClass);
- function _class() {
- return _superClass.apply(this, arguments) || this;
- }
- var _proto = _class.prototype;
- _proto.parseV8Intrinsic = function parseV8Intrinsic() {
- if (this.match(types.modulo)) {
- var v8IntrinsicStart = this.state.start;
- var node = this.startNode();
- this.eat(types.modulo);
- if (this.match(types.name)) {
- var name = this.parseIdentifierName(this.state.start);
- var identifier = this.createIdentifier(node, name);
- identifier.type = "V8IntrinsicIdentifier";
- if (this.match(types.parenL)) {
- return identifier;
- }
- }
- this.unexpected(v8IntrinsicStart);
- }
- };
- _proto.parseExprAtom = function parseExprAtom() {
- return this.parseV8Intrinsic() || _superClass.prototype.parseExprAtom.apply(this, arguments);
- };
- return _class;
- }(superClass);
- });
- function hasPlugin(plugins, name) {
- return plugins.some(function (plugin) {
- if (Array.isArray(plugin)) {
- return plugin[0] === name;
- } else {
- return plugin === name;
- }
- });
- }
- function getPluginOption(plugins, name, option) {
- var plugin = plugins.find(function (plugin) {
- if (Array.isArray(plugin)) {
- return plugin[0] === name;
- } else {
- return plugin === name;
- }
- });
- if (plugin && Array.isArray(plugin)) {
- return plugin[1][option];
- }
- return null;
- }
- var PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"];
- function validatePlugins(plugins) {
- if (hasPlugin(plugins, "decorators")) {
- if (hasPlugin(plugins, "decorators-legacy")) {
- throw new Error("Cannot use the decorators and decorators-legacy plugin together");
- }
- var decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
- if (decoratorsBeforeExport == null) {
- throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
- } else if (typeof decoratorsBeforeExport !== "boolean") {
- throw new Error("'decoratorsBeforeExport' must be a boolean.");
- }
- }
- if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
- throw new Error("Cannot combine flow and typescript plugins.");
- }
- if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
- throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
- }
- if (hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, "pipelineOperator", "proposal"))) {
- throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS.map(function (p) {
- return "'" + p + "'";
- }).join(", "));
- }
- }
- var mixinPlugins = {
- estree: estree,
- jsx: jsx,
- flow: flow,
- typescript: typescript,
- v8intrinsic: v8intrinsic,
- placeholders: placeholders
- };
- var mixinPluginNames = Object.keys(mixinPlugins);
- var defaultOptions = {
- sourceType: "script",
- sourceFilename: undefined,
- startLine: 1,
- allowAwaitOutsideFunction: false,
- allowReturnOutsideFunction: false,
- allowImportExportEverywhere: false,
- allowSuperOutsideMethod: false,
- allowUndeclaredExports: false,
- plugins: [],
- strictMode: null,
- ranges: false,
- tokens: false,
- createParenthesizedExpressions: false,
- errorRecovery: false
- };
- function getOptions(opts) {
- var options = {};
- for (var _i2 = 0, _Object$keys2 = Object.keys(defaultOptions); _i2 < _Object$keys2.length; _i2++) {
- var key = _Object$keys2[_i2];
- options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
- }
- return options;
- }
- var Position = function Position(line, col) {
- this.line = line;
- this.column = col;
- };
- var SourceLocation = function SourceLocation(start, end) {
- this.start = start;
- this.end = end;
- };
- function getLineInfo(input, offset) {
- var line = 1;
- var lineStart = 0;
- var match;
- lineBreakG.lastIndex = 0;
- while ((match = lineBreakG.exec(input)) && match.index < offset) {
- line++;
- lineStart = lineBreakG.lastIndex;
- }
- return new Position(line, offset - lineStart);
- }
- var BaseParser = function () {
- function BaseParser() {
- this.sawUnambiguousESM = false;
- this.ambiguousScriptDifferentAst = false;
- }
- var _proto = BaseParser.prototype;
- _proto.hasPlugin = function hasPlugin(name) {
- return this.plugins.has(name);
- };
- _proto.getPluginOption = function getPluginOption(plugin, name) {
- if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
- };
- return BaseParser;
- }();
- function last(stack) {
- return stack[stack.length - 1];
- }
- var CommentsParser = function (_BaseParser) {
- _inheritsLoose(CommentsParser, _BaseParser);
- function CommentsParser() {
- return _BaseParser.apply(this, arguments) || this;
- }
- var _proto = CommentsParser.prototype;
- _proto.addComment = function addComment(comment) {
- if (this.filename) comment.loc.filename = this.filename;
- this.state.trailingComments.push(comment);
- this.state.leadingComments.push(comment);
- };
- _proto.adjustCommentsAfterTrailingComma = function adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {
- if (this.state.leadingComments.length === 0) {
- return;
- }
- var lastElement = null;
- var i = elements.length;
- while (lastElement === null && i > 0) {
- lastElement = elements[--i];
- }
- if (lastElement === null) {
- return;
- }
- for (var j = 0; j < this.state.leadingComments.length; j++) {
- if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
- this.state.leadingComments.splice(j, 1);
- j--;
- }
- }
- var newTrailingComments = [];
- for (var _i = 0; _i < this.state.leadingComments.length; _i++) {
- var leadingComment = this.state.leadingComments[_i];
- if (leadingComment.end < node.end) {
- newTrailingComments.push(leadingComment);
- if (!takeAllComments) {
- this.state.leadingComments.splice(_i, 1);
- _i--;
- }
- } else {
- if (node.trailingComments === undefined) {
- node.trailingComments = [];
- }
- node.trailingComments.push(leadingComment);
- }
- }
- if (takeAllComments) this.state.leadingComments = [];
- if (newTrailingComments.length > 0) {
- lastElement.trailingComments = newTrailingComments;
- } else if (lastElement.trailingComments !== undefined) {
- lastElement.trailingComments = [];
- }
- };
- _proto.processComment = function processComment(node) {
- if (node.type === "Program" && node.body.length > 0) return;
- var stack = this.state.commentStack;
- var firstChild, lastChild, trailingComments, i, j;
- if (this.state.trailingComments.length > 0) {
- if (this.state.trailingComments[0].start >= node.end) {
- trailingComments = this.state.trailingComments;
- this.state.trailingComments = [];
- } else {
- this.state.trailingComments.length = 0;
- }
- } else if (stack.length > 0) {
- var lastInStack = last(stack);
- if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
- trailingComments = lastInStack.trailingComments;
- delete lastInStack.trailingComments;
- }
- }
- if (stack.length > 0 && last(stack).start >= node.start) {
- firstChild = stack.pop();
- }
- while (stack.length > 0 && last(stack).start >= node.start) {
- lastChild = stack.pop();
- }
- if (!lastChild && firstChild) lastChild = firstChild;
- if (firstChild) {
- switch (node.type) {
- case "ObjectExpression":
- this.adjustCommentsAfterTrailingComma(node, node.properties);
- break;
- case "ObjectPattern":
- this.adjustCommentsAfterTrailingComma(node, node.properties, true);
- break;
- case "CallExpression":
- this.adjustCommentsAfterTrailingComma(node, node.arguments);
- break;
- case "ArrayExpression":
- this.adjustCommentsAfterTrailingComma(node, node.elements);
- break;
- case "ArrayPattern":
- this.adjustCommentsAfterTrailingComma(node, node.elements, true);
- break;
- }
- } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) {
- this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);
- }
- if (lastChild) {
- if (lastChild.leadingComments) {
- if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {
- node.leadingComments = lastChild.leadingComments;
- delete lastChild.leadingComments;
- } else {
- for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
- if (lastChild.leadingComments[i].end <= node.start) {
- node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
- break;
- }
- }
- }
- }
- } else if (this.state.leadingComments.length > 0) {
- if (last(this.state.leadingComments).end <= node.start) {
- if (this.state.commentPreviousNode) {
- for (j = 0; j < this.state.leadingComments.length; j++) {
- if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
- this.state.leadingComments.splice(j, 1);
- j--;
- }
- }
- }
- if (this.state.leadingComments.length > 0) {
- node.leadingComments = this.state.leadingComments;
- this.state.leadingComments = [];
- }
- } else {
- for (i = 0; i < this.state.leadingComments.length; i++) {
- if (this.state.leadingComments[i].end > node.start) {
- break;
- }
- }
- var leadingComments = this.state.leadingComments.slice(0, i);
- if (leadingComments.length) {
- node.leadingComments = leadingComments;
- }
- trailingComments = this.state.leadingComments.slice(i);
- if (trailingComments.length === 0) {
- trailingComments = null;
- }
- }
- }
- this.state.commentPreviousNode = node;
- if (trailingComments) {
- if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
- node.innerComments = trailingComments;
- } else {
- node.trailingComments = trailingComments;
- }
- }
- stack.push(node);
- };
- return CommentsParser;
- }(BaseParser);
- var LocationParser = function (_CommentsParser) {
- _inheritsLoose(LocationParser, _CommentsParser);
- function LocationParser() {
- return _CommentsParser.apply(this, arguments) || this;
- }
- var _proto = LocationParser.prototype;
- _proto.getLocationForPosition = function getLocationForPosition(pos) {
- var loc;
- if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos);
- return loc;
- };
- _proto.raise = function raise(pos, message, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- missingPluginNames = _ref.missingPluginNames,
- code = _ref.code;
- var loc = this.getLocationForPosition(pos);
- message += " (" + loc.line + ":" + loc.column + ")";
- var err = new SyntaxError(message);
- err.pos = pos;
- err.loc = loc;
- if (missingPluginNames) {
- err.missingPlugin = missingPluginNames;
- }
- if (code !== undefined) {
- err.code = code;
- }
- if (this.options.errorRecovery) {
- if (!this.isLookahead) this.state.errors.push(err);
- return err;
- } else {
- throw err;
- }
- };
- return LocationParser;
- }(CommentsParser);
- var State = function () {
- function State() {
- this.errors = [];
- this.potentialArrowAt = -1;
- this.noArrowAt = [];
- this.noArrowParamsConversionAt = [];
- this.inParameters = false;
- this.maybeInArrowParameters = false;
- this.inPipeline = false;
- this.inType = false;
- this.noAnonFunctionType = false;
- this.inPropertyName = false;
- this.hasFlowComment = false;
- this.isIterator = false;
- this.topicContext = {
- maxNumOfResolvableTopics: 0,
- maxTopicIndex: null
- };
- this.soloAwait = false;
- this.inFSharpPipelineDirectBody = false;
- this.labels = [];
- this.decoratorStack = [[]];
- this.yieldPos = -1;
- this.awaitPos = -1;
- this.tokens = [];
- this.comments = [];
- this.trailingComments = [];
- this.leadingComments = [];
- this.commentStack = [];
- this.commentPreviousNode = null;
- this.pos = 0;
- this.lineStart = 0;
- this.type = types.eof;
- this.value = null;
- this.start = 0;
- this.end = 0;
- this.lastTokEndLoc = null;
- this.lastTokStartLoc = null;
- this.lastTokStart = 0;
- this.lastTokEnd = 0;
- this.context = [types$1.braceStatement];
- this.exprAllowed = true;
- this.containsEsc = false;
- this.containsOctal = false;
- this.octalPosition = null;
- this.exportedIdentifiers = [];
- }
- var _proto = State.prototype;
- _proto.init = function init(options) {
- this.strict = options.strictMode === false ? false : options.sourceType === "module";
- this.curLine = options.startLine;
- this.startLoc = this.endLoc = this.curPosition();
- };
- _proto.curPosition = function curPosition() {
- return new Position(this.curLine, this.pos - this.lineStart);
- };
- _proto.clone = function clone(skipArrays) {
- var state = new State();
- var keys = Object.keys(this);
- for (var i = 0, length = keys.length; i < length; i++) {
- var key = keys[i];
- var val = this[key];
- if (!skipArrays && Array.isArray(val)) {
- val = val.slice();
- }
- state[key] = val;
- }
- return state;
- };
- return State;
- }();
- var _isDigit = function isDigit(code) {
- return code >= 48 && code <= 57;
- };
- var VALID_REGEX_FLAGS = new Set(["g", "m", "s", "i", "y", "u"]);
- var forbiddenNumericSeparatorSiblings = {
- decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
- hex: [46, 88, 95, 120]
- };
- var allowedNumericSeparatorSiblings = {};
- allowedNumericSeparatorSiblings.bin = [48, 49];
- allowedNumericSeparatorSiblings.oct = [].concat(allowedNumericSeparatorSiblings.bin, [50, 51, 52, 53, 54, 55]);
- allowedNumericSeparatorSiblings.dec = [].concat(allowedNumericSeparatorSiblings.oct, [56, 57]);
- allowedNumericSeparatorSiblings.hex = [].concat(allowedNumericSeparatorSiblings.dec, [65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]);
- var Token = function Token(state) {
- this.type = state.type;
- this.value = state.value;
- this.start = state.start;
- this.end = state.end;
- this.loc = new SourceLocation(state.startLoc, state.endLoc);
- };
- var Tokenizer = function (_LocationParser) {
- _inheritsLoose(Tokenizer, _LocationParser);
- function Tokenizer(options, input) {
- var _this;
- _this = _LocationParser.call(this) || this;
- _this.state = new State();
- _this.state.init(options);
- _this.input = input;
- _this.length = input.length;
- _this.isLookahead = false;
- return _this;
- }
- var _proto = Tokenizer.prototype;
- _proto.next = function next() {
- if (!this.isLookahead) {
- this.checkKeywordEscapes();
- if (this.options.tokens) {
- this.state.tokens.push(new Token(this.state));
- }
- }
- this.state.lastTokEnd = this.state.end;
- this.state.lastTokStart = this.state.start;
- this.state.lastTokEndLoc = this.state.endLoc;
- this.state.lastTokStartLoc = this.state.startLoc;
- this.nextToken();
- };
- _proto.eat = function eat(type) {
- if (this.match(type)) {
- this.next();
- return true;
- } else {
- return false;
- }
- };
- _proto.match = function match(type) {
- return this.state.type === type;
- };
- _proto.lookahead = function lookahead() {
- var old = this.state;
- this.state = old.clone(true);
- this.isLookahead = true;
- this.next();
- this.isLookahead = false;
- var curr = this.state;
- this.state = old;
- return curr;
- };
- _proto.nextTokenStart = function nextTokenStart() {
- var thisTokEnd = this.state.pos;
- skipWhiteSpace.lastIndex = thisTokEnd;
- var skip = skipWhiteSpace.exec(this.input);
- return thisTokEnd + skip[0].length;
- };
- _proto.lookaheadCharCode = function lookaheadCharCode() {
- return this.input.charCodeAt(this.nextTokenStart());
- };
- _proto.setStrict = function setStrict(strict) {
- this.state.strict = strict;
- if (!this.match(types.num) && !this.match(types.string)) return;
- this.state.pos = this.state.start;
- while (this.state.pos < this.state.lineStart) {
- this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
- --this.state.curLine;
- }
- this.nextToken();
- };
- _proto.curContext = function curContext() {
- return this.state.context[this.state.context.length - 1];
- };
- _proto.nextToken = function nextToken() {
- var curContext = this.curContext();
- if (!curContext || !curContext.preserveSpace) this.skipSpace();
- this.state.containsOctal = false;
- this.state.octalPosition = null;
- this.state.start = this.state.pos;
- this.state.startLoc = this.state.curPosition();
- if (this.state.pos >= this.length) {
- this.finishToken(types.eof);
- return;
- }
- if (curContext.override) {
- curContext.override(this);
- } else {
- this.getTokenFromCode(this.input.codePointAt(this.state.pos));
- }
- };
- _proto.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
- var comment = {
- type: block ? "CommentBlock" : "CommentLine",
- value: text,
- start: start,
- end: end,
- loc: new SourceLocation(startLoc, endLoc)
- };
- if (this.options.tokens) this.state.tokens.push(comment);
- this.state.comments.push(comment);
- this.addComment(comment);
- };
- _proto.skipBlockComment = function skipBlockComment() {
- var startLoc = this.state.curPosition();
- var start = this.state.pos;
- var end = this.input.indexOf("*/", this.state.pos + 2);
- if (end === -1) throw this.raise(start, "Unterminated comment");
- this.state.pos = end + 2;
- lineBreakG.lastIndex = start;
- var match;
- while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
- ++this.state.curLine;
- this.state.lineStart = match.index + match[0].length;
- }
- if (this.isLookahead) return;
- this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
- };
- _proto.skipLineComment = function skipLineComment(startSkip) {
- var start = this.state.pos;
- var startLoc = this.state.curPosition();
- var ch = this.input.charCodeAt(this.state.pos += startSkip);
- if (this.state.pos < this.length) {
- while (!isNewLine(ch) && ++this.state.pos < this.length) {
- ch = this.input.charCodeAt(this.state.pos);
- }
- }
- if (this.isLookahead) return;
- this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
- };
- _proto.skipSpace = function skipSpace() {
- loop: while (this.state.pos < this.length) {
- var ch = this.input.charCodeAt(this.state.pos);
- switch (ch) {
- case 32:
- case 160:
- case 9:
- ++this.state.pos;
- break;
- case 13:
- if (this.input.charCodeAt(this.state.pos + 1) === 10) {
- ++this.state.pos;
- }
- case 10:
- case 8232:
- case 8233:
- ++this.state.pos;
- ++this.state.curLine;
- this.state.lineStart = this.state.pos;
- break;
- case 47:
- switch (this.input.charCodeAt(this.state.pos + 1)) {
- case 42:
- this.skipBlockComment();
- break;
- case 47:
- this.skipLineComment(2);
- break;
- default:
- break loop;
- }
- break;
- default:
- if (isWhitespace(ch)) {
- ++this.state.pos;
- } else {
- break loop;
- }
- }
- }
- };
- _proto.finishToken = function finishToken(type, val) {
- this.state.end = this.state.pos;
- this.state.endLoc = this.state.curPosition();
- var prevType = this.state.type;
- this.state.type = type;
- this.state.value = val;
- if (!this.isLookahead) this.updateContext(prevType);
- };
- _proto.readToken_numberSign = function readToken_numberSign() {
- if (this.state.pos === 0 && this.readToken_interpreter()) {
- return;
- }
- var nextPos = this.state.pos + 1;
- var next = this.input.charCodeAt(nextPos);
- if (next >= 48 && next <= 57) {
- throw this.raise(this.state.pos, "Unexpected digit after hash token");
- }
- if (this.hasPlugin("classPrivateProperties") || this.hasPlugin("classPrivateMethods") || this.getPluginOption("pipelineOperator", "proposal") === "smart") {
- this.finishOp(types.hash, 1);
- } else {
- throw this.raise(this.state.pos, "Unexpected character '#'");
- }
- };
- _proto.readToken_dot = function readToken_dot() {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next >= 48 && next <= 57) {
- this.readNumber(true);
- return;
- }
- if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
- this.state.pos += 3;
- this.finishToken(types.ellipsis);
- } else {
- ++this.state.pos;
- this.finishToken(types.dot);
- }
- };
- _proto.readToken_slash = function readToken_slash() {
- if (this.state.exprAllowed && !this.state.inType) {
- ++this.state.pos;
- this.readRegexp();
- return;
- }
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === 61) {
- this.finishOp(types.assign, 2);
- } else {
- this.finishOp(types.slash, 1);
- }
- };
- _proto.readToken_interpreter = function readToken_interpreter() {
- if (this.state.pos !== 0 || this.length < 2) return false;
- var start = this.state.pos;
- this.state.pos += 1;
- var ch = this.input.charCodeAt(this.state.pos);
- if (ch !== 33) return false;
- while (!isNewLine(ch) && ++this.state.pos < this.length) {
- ch = this.input.charCodeAt(this.state.pos);
- }
- var value = this.input.slice(start + 2, this.state.pos);
- this.finishToken(types.interpreterDirective, value);
- return true;
- };
- _proto.readToken_mult_modulo = function readToken_mult_modulo(code) {
- var type = code === 42 ? types.star : types.modulo;
- var width = 1;
- var next = this.input.charCodeAt(this.state.pos + 1);
- var exprAllowed = this.state.exprAllowed;
- if (code === 42 && next === 42) {
- width++;
- next = this.input.charCodeAt(this.state.pos + 2);
- type = types.exponent;
- }
- if (next === 61 && !exprAllowed) {
- width++;
- type = types.assign;
- }
- this.finishOp(type, width);
- };
- _proto.readToken_pipe_amp = function readToken_pipe_amp(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === code) {
- if (this.input.charCodeAt(this.state.pos + 2) === 61) {
- this.finishOp(types.assign, 3);
- } else {
- this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
- }
- return;
- }
- if (code === 124) {
- if (next === 62) {
- this.finishOp(types.pipeline, 2);
- return;
- }
- }
- if (next === 61) {
- this.finishOp(types.assign, 2);
- return;
- }
- this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
- };
- _proto.readToken_caret = function readToken_caret() {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === 61) {
- this.finishOp(types.assign, 2);
- } else {
- this.finishOp(types.bitwiseXOR, 1);
- }
- };
- _proto.readToken_plus_min = function readToken_plus_min(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === code) {
- if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos)))) {
- this.skipLineComment(3);
- this.skipSpace();
- this.nextToken();
- return;
- }
- this.finishOp(types.incDec, 2);
- return;
- }
- if (next === 61) {
- this.finishOp(types.assign, 2);
- } else {
- this.finishOp(types.plusMin, 1);
- }
- };
- _proto.readToken_lt_gt = function readToken_lt_gt(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- var size = 1;
- if (next === code) {
- size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
- if (this.input.charCodeAt(this.state.pos + size) === 61) {
- this.finishOp(types.assign, size + 1);
- return;
- }
- this.finishOp(types.bitShift, size);
- return;
- }
- if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
- this.skipLineComment(4);
- this.skipSpace();
- this.nextToken();
- return;
- }
- if (next === 61) {
- size = 2;
- }
- this.finishOp(types.relational, size);
- };
- _proto.readToken_eq_excl = function readToken_eq_excl(code) {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === 61) {
- this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
- return;
- }
- if (code === 61 && next === 62) {
- this.state.pos += 2;
- this.finishToken(types.arrow);
- return;
- }
- this.finishOp(code === 61 ? types.eq : types.bang, 1);
- };
- _proto.readToken_question = function readToken_question() {
- var next = this.input.charCodeAt(this.state.pos + 1);
- var next2 = this.input.charCodeAt(this.state.pos + 2);
- if (next === 63 && !this.state.inType) {
- if (next2 === 61) {
- this.finishOp(types.assign, 3);
- } else {
- this.finishOp(types.nullishCoalescing, 2);
- }
- } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
- this.state.pos += 2;
- this.finishToken(types.questionDot);
- } else {
- ++this.state.pos;
- this.finishToken(types.question);
- }
- };
- _proto.getTokenFromCode = function getTokenFromCode(code) {
- switch (code) {
- case 46:
- this.readToken_dot();
- return;
- case 40:
- ++this.state.pos;
- this.finishToken(types.parenL);
- return;
- case 41:
- ++this.state.pos;
- this.finishToken(types.parenR);
- return;
- case 59:
- ++this.state.pos;
- this.finishToken(types.semi);
- return;
- case 44:
- ++this.state.pos;
- this.finishToken(types.comma);
- return;
- case 91:
- ++this.state.pos;
- this.finishToken(types.bracketL);
- return;
- case 93:
- ++this.state.pos;
- this.finishToken(types.bracketR);
- return;
- case 123:
- ++this.state.pos;
- this.finishToken(types.braceL);
- return;
- case 125:
- ++this.state.pos;
- this.finishToken(types.braceR);
- return;
- case 58:
- if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
- this.finishOp(types.doubleColon, 2);
- } else {
- ++this.state.pos;
- this.finishToken(types.colon);
- }
- return;
- case 63:
- this.readToken_question();
- return;
- case 96:
- ++this.state.pos;
- this.finishToken(types.backQuote);
- return;
- case 48:
- {
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (next === 120 || next === 88) {
- this.readRadixNumber(16);
- return;
- }
- if (next === 111 || next === 79) {
- this.readRadixNumber(8);
- return;
- }
- if (next === 98 || next === 66) {
- this.readRadixNumber(2);
- return;
- }
- }
- case 49:
- case 50:
- case 51:
- case 52:
- case 53:
- case 54:
- case 55:
- case 56:
- case 57:
- this.readNumber(false);
- return;
- case 34:
- case 39:
- this.readString(code);
- return;
- case 47:
- this.readToken_slash();
- return;
- case 37:
- case 42:
- this.readToken_mult_modulo(code);
- return;
- case 124:
- case 38:
- this.readToken_pipe_amp(code);
- return;
- case 94:
- this.readToken_caret();
- return;
- case 43:
- case 45:
- this.readToken_plus_min(code);
- return;
- case 60:
- case 62:
- this.readToken_lt_gt(code);
- return;
- case 61:
- case 33:
- this.readToken_eq_excl(code);
- return;
- case 126:
- this.finishOp(types.tilde, 1);
- return;
- case 64:
- ++this.state.pos;
- this.finishToken(types.at);
- return;
- case 35:
- this.readToken_numberSign();
- return;
- case 92:
- this.readWord();
- return;
- default:
- if (isIdentifierStart(code)) {
- this.readWord();
- return;
- }
- }
- throw this.raise(this.state.pos, "Unexpected character '" + String.fromCodePoint(code) + "'");
- };
- _proto.finishOp = function finishOp(type, size) {
- var str = this.input.slice(this.state.pos, this.state.pos + size);
- this.state.pos += size;
- this.finishToken(type, str);
- };
- _proto.readRegexp = function readRegexp() {
- var start = this.state.pos;
- var escaped, inClass;
- for (;;) {
- if (this.state.pos >= this.length) {
- throw this.raise(start, "Unterminated regular expression");
- }
- var ch = this.input.charAt(this.state.pos);
- if (lineBreak.test(ch)) {
- throw this.raise(start, "Unterminated regular expression");
- }
- if (escaped) {
- escaped = false;
- } else {
- if (ch === "[") {
- inClass = true;
- } else if (ch === "]" && inClass) {
- inClass = false;
- } else if (ch === "/" && !inClass) {
- break;
- }
- escaped = ch === "\\";
- }
- ++this.state.pos;
- }
- var content = this.input.slice(start, this.state.pos);
- ++this.state.pos;
- var mods = "";
- while (this.state.pos < this.length) {
- var _char = this.input[this.state.pos];
- var charCode = this.input.codePointAt(this.state.pos);
- if (VALID_REGEX_FLAGS.has(_char)) {
- if (mods.indexOf(_char) > -1) {
- this.raise(this.state.pos + 1, "Duplicate regular expression flag");
- }
- } else if (isIdentifierChar(charCode) || charCode === 92) {
- this.raise(this.state.pos + 1, "Invalid regular expression flag");
- } else {
- break;
- }
- ++this.state.pos;
- mods += _char;
- }
- this.finishToken(types.regexp, {
- pattern: content,
- flags: mods
- });
- };
- _proto.readInt = function readInt(radix, len, forceLen, allowNumSeparator) {
- if (allowNumSeparator === void 0) {
- allowNumSeparator = true;
- }
- var start = this.state.pos;
- var forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
- var allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;
- var invalid = false;
- var total = 0;
- for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
- var code = this.input.charCodeAt(this.state.pos);
- var val = void 0;
- if (this.hasPlugin("numericSeparator")) {
- if (code === 95) {
- var prev = this.input.charCodeAt(this.state.pos - 1);
- var next = this.input.charCodeAt(this.state.pos + 1);
- if (allowedSiblings.indexOf(next) === -1) {
- this.raise(this.state.pos, "A numeric separator is only allowed between two digits");
- } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
- this.raise(this.state.pos, "A numeric separator is only allowed between two digits");
- }
- if (!allowNumSeparator) {
- this.raise(this.state.pos, "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences");
- }
- ++this.state.pos;
- continue;
- }
- }
- if (code >= 97) {
- val = code - 97 + 10;
- } else if (code >= 65) {
- val = code - 65 + 10;
- } else if (_isDigit(code)) {
- val = code - 48;
- } else {
- val = Infinity;
- }
- if (val >= radix) {
- if (this.options.errorRecovery && val <= 9) {
- val = 0;
- this.raise(this.state.start + i + 2, "Expected number in radix " + radix);
- } else if (forceLen) {
- val = 0;
- invalid = true;
- } else {
- break;
- }
- }
- ++this.state.pos;
- total = total * radix + val;
- }
- if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
- return null;
- }
- return total;
- };
- _proto.readRadixNumber = function readRadixNumber(radix) {
- var start = this.state.pos;
- var isBigInt = false;
- this.state.pos += 2;
- var val = this.readInt(radix);
- if (val == null) {
- this.raise(this.state.start + 2, "Expected number in radix " + radix);
- }
- if (this.hasPlugin("bigInt")) {
- if (this.input.charCodeAt(this.state.pos) === 110) {
- ++this.state.pos;
- isBigInt = true;
- }
- }
- if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
- throw this.raise(this.state.pos, "Identifier directly after number");
- }
- if (isBigInt) {
- var str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
- this.finishToken(types.bigint, str);
- return;
- }
- this.finishToken(types.num, val);
- };
- _proto.readNumber = function readNumber(startsWithDot) {
- var start = this.state.pos;
- var isFloat = false;
- var isBigInt = false;
- var isNonOctalDecimalInt = false;
- if (!startsWithDot && this.readInt(10) === null) {
- this.raise(start, "Invalid number");
- }
- var octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
- if (octal) {
- if (this.state.strict) {
- this.raise(start, "Legacy octal literals are not allowed in strict mode");
- }
- if (/[89]/.test(this.input.slice(start, this.state.pos))) {
- octal = false;
- isNonOctalDecimalInt = true;
- }
- }
- var next = this.input.charCodeAt(this.state.pos);
- if (next === 46 && !octal) {
- ++this.state.pos;
- this.readInt(10);
- isFloat = true;
- next = this.input.charCodeAt(this.state.pos);
- }
- if ((next === 69 || next === 101) && !octal) {
- next = this.input.charCodeAt(++this.state.pos);
- if (next === 43 || next === 45) {
- ++this.state.pos;
- }
- if (this.readInt(10) === null) this.raise(start, "Invalid number");
- isFloat = true;
- next = this.input.charCodeAt(this.state.pos);
- }
- if (this.hasPlugin("numericSeparator") && (octal || isNonOctalDecimalInt)) {
- var underscorePos = this.input.slice(start, this.state.pos).indexOf("_");
- if (underscorePos > 0) {
- this.raise(underscorePos + start, "Numeric separator can not be used after leading 0");
- }
- }
- if (this.hasPlugin("bigInt")) {
- if (next === 110) {
- if (isFloat || octal || isNonOctalDecimalInt) {
- this.raise(start, "Invalid BigIntLiteral");
- }
- ++this.state.pos;
- isBigInt = true;
- }
- }
- if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
- throw this.raise(this.state.pos, "Identifier directly after number");
- }
- var str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
- if (isBigInt) {
- this.finishToken(types.bigint, str);
- return;
- }
- var val = octal ? parseInt(str, 8) : parseFloat(str);
- this.finishToken(types.num, val);
- };
- _proto.readCodePoint = function readCodePoint(throwOnInvalid) {
- var ch = this.input.charCodeAt(this.state.pos);
- var code;
- if (ch === 123) {
- var codePos = ++this.state.pos;
- code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid);
- ++this.state.pos;
- if (code !== null && code > 0x10ffff) {
- if (throwOnInvalid) {
- this.raise(codePos, "Code point out of bounds");
- } else {
- return null;
- }
- }
- } else {
- code = this.readHexChar(4, false, throwOnInvalid);
- }
- return code;
- };
- _proto.readString = function readString(quote) {
- var out = "",
- chunkStart = ++this.state.pos;
- for (;;) {
- if (this.state.pos >= this.length) {
- throw this.raise(this.state.start, "Unterminated string constant");
- }
- var ch = this.input.charCodeAt(this.state.pos);
- if (ch === quote) break;
- if (ch === 92) {
- out += this.input.slice(chunkStart, this.state.pos);
- out += this.readEscapedChar(false);
- chunkStart = this.state.pos;
- } else if (ch === 8232 || ch === 8233) {
- ++this.state.pos;
- ++this.state.curLine;
- this.state.lineStart = this.state.pos;
- } else if (isNewLine(ch)) {
- throw this.raise(this.state.start, "Unterminated string constant");
- } else {
- ++this.state.pos;
- }
- }
- out += this.input.slice(chunkStart, this.state.pos++);
- this.finishToken(types.string, out);
- };
- _proto.readTmplToken = function readTmplToken() {
- var out = "",
- chunkStart = this.state.pos,
- containsInvalid = false;
- for (;;) {
- if (this.state.pos >= this.length) {
- throw this.raise(this.state.start, "Unterminated template");
- }
- var ch = this.input.charCodeAt(this.state.pos);
- if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
- if (this.state.pos === this.state.start && this.match(types.template)) {
- if (ch === 36) {
- this.state.pos += 2;
- this.finishToken(types.dollarBraceL);
- return;
- } else {
- ++this.state.pos;
- this.finishToken(types.backQuote);
- return;
- }
- }
- out += this.input.slice(chunkStart, this.state.pos);
- this.finishToken(types.template, containsInvalid ? null : out);
- return;
- }
- if (ch === 92) {
- out += this.input.slice(chunkStart, this.state.pos);
- var escaped = this.readEscapedChar(true);
- if (escaped === null) {
- containsInvalid = true;
- } else {
- out += escaped;
- }
- chunkStart = this.state.pos;
- } else if (isNewLine(ch)) {
- out += this.input.slice(chunkStart, this.state.pos);
- ++this.state.pos;
- switch (ch) {
- case 13:
- if (this.input.charCodeAt(this.state.pos) === 10) {
- ++this.state.pos;
- }
- case 10:
- out += "\n";
- break;
- default:
- out += String.fromCharCode(ch);
- break;
- }
- ++this.state.curLine;
- this.state.lineStart = this.state.pos;
- chunkStart = this.state.pos;
- } else {
- ++this.state.pos;
- }
- }
- };
- _proto.readEscapedChar = function readEscapedChar(inTemplate) {
- var throwOnInvalid = !inTemplate;
- var ch = this.input.charCodeAt(++this.state.pos);
- ++this.state.pos;
- switch (ch) {
- case 110:
- return "\n";
- case 114:
- return "\r";
- case 120:
- {
- var code = this.readHexChar(2, false, throwOnInvalid);
- return code === null ? null : String.fromCharCode(code);
- }
- case 117:
- {
- var _code = this.readCodePoint(throwOnInvalid);
- return _code === null ? null : String.fromCodePoint(_code);
- }
- case 116:
- return "\t";
- case 98:
- return "\b";
- case 118:
- return "\x0B";
- case 102:
- return "\f";
- case 13:
- if (this.input.charCodeAt(this.state.pos) === 10) {
- ++this.state.pos;
- }
- case 10:
- this.state.lineStart = this.state.pos;
- ++this.state.curLine;
- case 8232:
- case 8233:
- return "";
- case 56:
- case 57:
- if (inTemplate) {
- return null;
- }
- default:
- if (ch >= 48 && ch <= 55) {
- var codePos = this.state.pos - 1;
- var octalStr = this.input.substr(this.state.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.state.pos += octalStr.length - 1;
- var next = this.input.charCodeAt(this.state.pos);
- if (octalStr !== "0" || next === 56 || next === 57) {
- if (inTemplate) {
- return null;
- } else if (this.state.strict) {
- this.raise(codePos, "Octal literal in strict mode");
- } else if (!this.state.containsOctal) {
- this.state.containsOctal = true;
- this.state.octalPosition = codePos;
- }
- }
- return String.fromCharCode(octal);
- }
- return String.fromCharCode(ch);
- }
- };
- _proto.readHexChar = function readHexChar(len, forceLen, throwOnInvalid) {
- var codePos = this.state.pos;
- var n = this.readInt(16, len, forceLen, false);
- if (n === null) {
- if (throwOnInvalid) {
- this.raise(codePos, "Bad character escape sequence");
- } else {
- this.state.pos = codePos - 1;
- }
- }
- return n;
- };
- _proto.readWord1 = function readWord1() {
- var word = "";
- this.state.containsEsc = false;
- var start = this.state.pos;
- var chunkStart = this.state.pos;
- while (this.state.pos < this.length) {
- var ch = this.input.codePointAt(this.state.pos);
- if (isIdentifierChar(ch)) {
- this.state.pos += ch <= 0xffff ? 1 : 2;
- } else if (this.state.isIterator && ch === 64) {
- ++this.state.pos;
- } else if (ch === 92) {
- this.state.containsEsc = true;
- word += this.input.slice(chunkStart, this.state.pos);
- var escStart = this.state.pos;
- var identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
- if (this.input.charCodeAt(++this.state.pos) !== 117) {
- this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
- continue;
- }
- ++this.state.pos;
- var esc = this.readCodePoint(true);
- if (esc !== null) {
- if (!identifierCheck(esc)) {
- this.raise(escStart, "Invalid Unicode escape");
- }
- word += String.fromCodePoint(esc);
- }
- chunkStart = this.state.pos;
- } else {
- break;
- }
- }
- return word + this.input.slice(chunkStart, this.state.pos);
- };
- _proto.isIterator = function isIterator(word) {
- return word === "@@iterator" || word === "@@asyncIterator";
- };
- _proto.readWord = function readWord() {
- var word = this.readWord1();
- var type = keywords.get(word) || types.name;
- if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {
- this.raise(this.state.pos, "Invalid identifier " + word);
- }
- this.finishToken(type, word);
- };
- _proto.checkKeywordEscapes = function checkKeywordEscapes() {
- var kw = this.state.type.keyword;
- if (kw && this.state.containsEsc) {
- this.raise(this.state.start, "Escape sequence in keyword " + kw);
- }
- };
- _proto.braceIsBlock = function braceIsBlock(prevType) {
- var parent = this.curContext();
- if (parent === types$1.functionExpression || parent === types$1.functionStatement) {
- return true;
- }
- if (prevType === types.colon && (parent === types$1.braceStatement || parent === types$1.braceExpression)) {
- return !parent.isExpr;
- }
- if (prevType === types._return || prevType === types.name && this.state.exprAllowed) {
- return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.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.braceStatement;
- }
- if (prevType === types._var || prevType === types._const || prevType === types.name) {
- return false;
- }
- if (prevType === types.relational) {
- return true;
- }
- return !this.state.exprAllowed;
- };
- _proto.updateContext = function updateContext(prevType) {
- var type = this.state.type;
- var update;
- if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) {
- this.state.exprAllowed = false;
- } else if (update = type.updateContext) {
- update.call(this, prevType);
- } else {
- this.state.exprAllowed = type.beforeExpr;
- }
- };
- return Tokenizer;
- }(LocationParser);
- var literal = /^('|")((?:\\?.)*?)\1/;
- var UtilParser = function (_Tokenizer) {
- _inheritsLoose(UtilParser, _Tokenizer);
- function UtilParser() {
- return _Tokenizer.apply(this, arguments) || this;
- }
- var _proto = UtilParser.prototype;
- _proto.addExtra = function addExtra(node, key, val) {
- if (!node) return;
- var extra = node.extra = node.extra || {};
- extra[key] = val;
- };
- _proto.isRelational = function isRelational(op) {
- return this.match(types.relational) && this.state.value === op;
- };
- _proto.isLookaheadRelational = function isLookaheadRelational(op) {
- var next = this.nextTokenStart();
- if (this.input.charAt(next) === op) {
- if (next + 1 === this.input.length) {
- return true;
- }
- var afterNext = this.input.charCodeAt(next + 1);
- return afterNext !== op.charCodeAt(0) && afterNext !== 61;
- }
- return false;
- };
- _proto.expectRelational = function expectRelational(op) {
- if (this.isRelational(op)) {
- this.next();
- } else {
- this.unexpected(null, types.relational);
- }
- };
- _proto.isContextual = function isContextual(name) {
- return this.match(types.name) && this.state.value === name && !this.state.containsEsc;
- };
- _proto.isUnparsedContextual = function isUnparsedContextual(nameStart, name) {
- var nameEnd = nameStart + name.length;
- return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar(this.input.charCodeAt(nameEnd)));
- };
- _proto.isLookaheadContextual = function isLookaheadContextual(name) {
- var next = this.nextTokenStart();
- return this.isUnparsedContextual(next, name);
- };
- _proto.eatContextual = function eatContextual(name) {
- return this.isContextual(name) && this.eat(types.name);
- };
- _proto.expectContextual = function expectContextual(name, message) {
- if (!this.eatContextual(name)) this.unexpected(null, message);
- };
- _proto.canInsertSemicolon = function canInsertSemicolon() {
- return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak();
- };
- _proto.hasPrecedingLineBreak = function hasPrecedingLineBreak() {
- return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
- };
- _proto.isLineTerminator = function isLineTerminator() {
- return this.eat(types.semi) || this.canInsertSemicolon();
- };
- _proto.semicolon = function semicolon() {
- if (!this.isLineTerminator()) this.unexpected(null, types.semi);
- };
- _proto.expect = function expect(type, pos) {
- this.eat(type) || this.unexpected(pos, type);
- };
- _proto.assertNoSpace = function assertNoSpace(message) {
- if (message === void 0) {
- message = "Unexpected space.";
- }
- if (this.state.start > this.state.lastTokEnd) {
- this.raise(this.state.lastTokEnd, message);
- }
- };
- _proto.unexpected = function unexpected(pos, messageOrType) {
- if (messageOrType === void 0) {
- messageOrType = "Unexpected token";
- }
- if (typeof messageOrType !== "string") {
- messageOrType = "Unexpected token, expected \"" + messageOrType.label + "\"";
- }
- throw this.raise(pos != null ? pos : this.state.start, messageOrType);
- };
- _proto.expectPlugin = function expectPlugin(name, pos) {
- if (!this.hasPlugin(name)) {
- throw this.raise(pos != null ? pos : this.state.start, "This experimental syntax requires enabling the parser plugin: '" + name + "'", {
- missingPluginNames: [name]
- });
- }
- return true;
- };
- _proto.expectOnePlugin = function expectOnePlugin(names, pos) {
- var _this = this;
- if (!names.some(function (n) {
- return _this.hasPlugin(n);
- })) {
- throw this.raise(pos != null ? pos : this.state.start, "This experimental syntax requires enabling one of the following parser plugin(s): '" + names.join(", ") + "'", {
- missingPluginNames: names
- });
- }
- };
- _proto.checkYieldAwaitInDefaultParams = function checkYieldAwaitInDefaultParams() {
- if (this.state.yieldPos !== -1 && (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos)) {
- this.raise(this.state.yieldPos, "Yield cannot be used as name inside a generator function");
- }
- if (this.state.awaitPos !== -1) {
- this.raise(this.state.awaitPos, "Await cannot be used as name inside an async function");
- }
- };
- _proto.strictDirective = function strictDirective(start) {
- for (;;) {
- skipWhiteSpace.lastIndex = start;
- start += skipWhiteSpace.exec(this.input)[0].length;
- var match = literal.exec(this.input.slice(start));
- if (!match) break;
- if (match[2] === "use strict") return true;
- start += match[0].length;
- skipWhiteSpace.lastIndex = start;
- start += skipWhiteSpace.exec(this.input)[0].length;
- if (this.input[start] === ";") {
- start++;
- }
- }
- return false;
- };
- _proto.tryParse = function tryParse(fn, oldState) {
- if (oldState === void 0) {
- oldState = this.state.clone();
- }
- var abortSignal = {
- node: null
- };
- try {
- var _node = fn(function (node) {
- if (node === void 0) {
- node = null;
- }
- abortSignal.node = node;
- throw abortSignal;
- });
- if (this.state.errors.length > oldState.errors.length) {
- var failState = this.state;
- this.state = oldState;
- return {
- node: _node,
- error: failState.errors[oldState.errors.length],
- thrown: false,
- aborted: false,
- failState: failState
- };
- }
- return {
- node: _node,
- error: null,
- thrown: false,
- aborted: false,
- failState: null
- };
- } catch (error) {
- var _failState = this.state;
- this.state = oldState;
- if (error instanceof SyntaxError) {
- return {
- node: null,
- error: error,
- thrown: true,
- aborted: false,
- failState: _failState
- };
- }
- if (error === abortSignal) {
- return {
- node: abortSignal.node,
- error: null,
- thrown: false,
- aborted: true,
- failState: _failState
- };
- }
- throw error;
- }
- };
- return UtilParser;
- }(Tokenizer);
- var Node = function () {
- function Node(parser, pos, loc) {
- this.type = "";
- this.start = pos;
- this.end = 0;
- this.loc = new SourceLocation(loc);
- if (parser && parser.options.ranges) this.range = [pos, 0];
- if (parser && parser.filename) this.loc.filename = parser.filename;
- }
- var _proto = Node.prototype;
- _proto.__clone = function __clone() {
- var newNode = new Node();
- var keys = Object.keys(this);
- for (var i = 0, length = keys.length; i < length; i++) {
- var _key = keys[i];
- if (_key !== "leadingComments" && _key !== "trailingComments" && _key !== "innerComments") {
- newNode[_key] = this[_key];
- }
- }
- return newNode;
- };
- return Node;
- }();
- var NodeUtils = function (_UtilParser) {
- _inheritsLoose(NodeUtils, _UtilParser);
- function NodeUtils() {
- return _UtilParser.apply(this, arguments) || this;
- }
- var _proto2 = NodeUtils.prototype;
- _proto2.startNode = function startNode() {
- return new Node(this, this.state.start, this.state.startLoc);
- };
- _proto2.startNodeAt = function startNodeAt(pos, loc) {
- return new Node(this, pos, loc);
- };
- _proto2.startNodeAtNode = function startNodeAtNode(type) {
- return this.startNodeAt(type.start, type.loc.start);
- };
- _proto2.finishNode = function finishNode(node, type) {
- return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
- };
- _proto2.finishNodeAt = function finishNodeAt(node, type, pos, loc) {
- if ( node.end > 0) {
- throw new Error("Do not call finishNode*() twice on the same node." + " Instead use resetEndLocation() or change type directly.");
- }
- node.type = type;
- node.end = pos;
- node.loc.end = loc;
- if (this.options.ranges) node.range[1] = pos;
- this.processComment(node);
- return node;
- };
- _proto2.resetStartLocation = function resetStartLocation(node, start, startLoc) {
- node.start = start;
- node.loc.start = startLoc;
- if (this.options.ranges) node.range[0] = start;
- };
- _proto2.resetEndLocation = function resetEndLocation(node, end, endLoc) {
- if (end === void 0) {
- end = this.state.lastTokEnd;
- }
- if (endLoc === void 0) {
- endLoc = this.state.lastTokEndLoc;
- }
- node.end = end;
- node.loc.end = endLoc;
- if (this.options.ranges) node.range[1] = end;
- };
- _proto2.resetStartLocationFromNode = function resetStartLocationFromNode(node, locationNode) {
- this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
- };
- return NodeUtils;
- }(UtilParser);
- var unwrapParenthesizedExpression = function unwrapParenthesizedExpression(node) {
- return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
- };
- var LValParser = function (_NodeUtils) {
- _inheritsLoose(LValParser, _NodeUtils);
- function LValParser() {
- return _NodeUtils.apply(this, arguments) || this;
- }
- var _proto = LValParser.prototype;
- _proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
- var _node$extra3;
- if (node) {
- var _node$extra;
- if (this.options.createParenthesizedExpressions && node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) {
- var parenthesized = unwrapParenthesizedExpression(node);
- if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") {
- this.raise(node.start, "Invalid parenthesized assignment pattern");
- }
- }
- switch (node.type) {
- case "Identifier":
- case "ObjectPattern":
- case "ArrayPattern":
- case "AssignmentPattern":
- break;
- case "ObjectExpression":
- node.type = "ObjectPattern";
- for (var i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
- var _node$extra2;
- var prop = node.properties[i];
- var isLast = i === last;
- this.toAssignableObjectExpressionProp(prop, isBinding, isLast);
- if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) {
- this.raiseRestNotLast(node.extra.trailingComma);
- }
- }
- break;
- case "ObjectProperty":
- this.toAssignable(node.value, isBinding, contextDescription);
- break;
- case "SpreadElement":
- {
- this.checkToRestConversion(node);
- node.type = "RestElement";
- var arg = node.argument;
- this.toAssignable(arg, isBinding, contextDescription);
- break;
- }
- case "ArrayExpression":
- node.type = "ArrayPattern";
- this.toAssignableList(node.elements, isBinding, contextDescription, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma);
- 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, contextDescription);
- break;
- case "ParenthesizedExpression":
- node.expression = this.toAssignable(node.expression, isBinding, contextDescription);
- break;
- }
- }
- return node;
- };
- _proto.toAssignableObjectExpressionProp = function toAssignableObjectExpressionProp(prop, isBinding, isLast) {
- if (prop.type === "ObjectMethod") {
- var error = prop.kind === "get" || prop.kind === "set" ? "Object pattern can't contain getter or setter" : "Object pattern can't contain methods";
- this.raise(prop.key.start, error);
- } else if (prop.type === "SpreadElement" && !isLast) {
- this.raiseRestNotLast(prop.start);
- } else {
- this.toAssignable(prop, isBinding, "object destructuring pattern");
- }
- };
- _proto.toAssignableList = function toAssignableList(exprList, isBinding, contextDescription, trailingCommaPos) {
- var end = exprList.length;
- if (end) {
- var last = exprList[end - 1];
- if (last && last.type === "RestElement") {
- --end;
- } else if (last && last.type === "SpreadElement") {
- last.type = "RestElement";
- var arg = last.argument;
- this.toAssignable(arg, isBinding, contextDescription);
- if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
- this.unexpected(arg.start);
- }
- if (trailingCommaPos) {
- this.raiseTrailingCommaAfterRest(trailingCommaPos);
- }
- --end;
- }
- }
- for (var i = 0; i < end; i++) {
- var elt = exprList[i];
- if (elt) {
- this.toAssignable(elt, isBinding, contextDescription);
- if (elt.type === "RestElement") {
- this.raiseRestNotLast(elt.start);
- }
- }
- }
- return exprList;
- };
- _proto.toReferencedList = function toReferencedList(exprList, isParenthesizedExpr) {
- return exprList;
- };
- _proto.toReferencedListDeep = function toReferencedListDeep(exprList, isParenthesizedExpr) {
- this.toReferencedList(exprList, isParenthesizedExpr);
- for (var _i2 = 0; _i2 < exprList.length; _i2++) {
- var expr = exprList[_i2];
- if (expr && expr.type === "ArrayExpression") {
- this.toReferencedListDeep(expr.elements);
- }
- }
- };
- _proto.parseSpread = function parseSpread(refShorthandDefaultPos, refNeedsArrowPos) {
- var node = this.startNode();
- this.next();
- node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos, undefined, refNeedsArrowPos);
- return this.finishNode(node, "SpreadElement");
- };
- _proto.parseRestBinding = function parseRestBinding() {
- var node = this.startNode();
- this.next();
- node.argument = this.parseBindingAtom();
- return this.finishNode(node, "RestElement");
- };
- _proto.parseBindingAtom = function parseBindingAtom() {
- switch (this.state.type) {
- case types.bracketL:
- {
- var node = this.startNode();
- this.next();
- node.elements = this.parseBindingList(types.bracketR, 93, true);
- return this.finishNode(node, "ArrayPattern");
- }
- case types.braceL:
- return this.parseObj(true);
- }
- return this.parseIdentifier();
- };
- _proto.parseBindingList = function parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
- var elts = [];
- var first = true;
- while (!this.eat(close)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma);
- }
- if (allowEmpty && this.match(types.comma)) {
- elts.push(null);
- } else if (this.eat(close)) {
- break;
- } else if (this.match(types.ellipsis)) {
- elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
- this.checkCommaAfterRest(closeCharCode);
- this.expect(close);
- break;
- } else {
- var decorators = [];
- if (this.match(types.at) && this.hasPlugin("decorators")) {
- this.raise(this.state.start, "Stage 2 decorators cannot be used to decorate parameters");
- }
- while (this.match(types.at)) {
- decorators.push(this.parseDecorator());
- }
- elts.push(this.parseAssignableListItem(allowModifiers, decorators));
- }
- }
- return elts;
- };
- _proto.parseAssignableListItem = function parseAssignableListItem(allowModifiers, decorators) {
- var left = this.parseMaybeDefault();
- this.parseAssignableListItemTypes(left);
- var elt = this.parseMaybeDefault(left.start, left.loc.start, left);
- if (decorators.length) {
- left.decorators = decorators;
- }
- return elt;
- };
- _proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
- return param;
- };
- _proto.parseMaybeDefault = function parseMaybeDefault(startPos, startLoc, left) {
- startLoc = startLoc || this.state.startLoc;
- startPos = startPos || this.state.start;
- left = left || this.parseBindingAtom();
- if (!this.eat(types.eq)) return left;
- var node = this.startNodeAt(startPos, startLoc);
- node.left = left;
- node.right = this.parseMaybeAssign();
- return this.finishNode(node, "AssignmentPattern");
- };
- _proto.checkLVal = function checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding, strictModeChanged) {
- if (bindingType === void 0) {
- bindingType = BIND_NONE;
- }
- if (strictModeChanged === void 0) {
- strictModeChanged = false;
- }
- switch (expr.type) {
- case "Identifier":
- if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(expr.name, this.inModule) : isStrictBindOnlyReservedWord(expr.name))) {
- this.raise(expr.start, (bindingType === BIND_NONE ? "Assigning to" : "Binding") + " '" + expr.name + "' in strict mode");
- }
- if (checkClashes) {
- var _key = "_" + expr.name;
- if (checkClashes[_key]) {
- this.raise(expr.start, "Argument name clash");
- } else {
- checkClashes[_key] = true;
- }
- }
- if (disallowLetBinding && expr.name === "let") {
- this.raise(expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations.");
- }
- if (!(bindingType & BIND_NONE)) {
- this.scope.declareName(expr.name, bindingType, expr.start);
- }
- break;
- case "MemberExpression":
- if (bindingType !== BIND_NONE) {
- this.raise(expr.start, "Binding member expression");
- }
- break;
- case "ObjectPattern":
- for (var _i4 = 0, _expr$properties2 = expr.properties; _i4 < _expr$properties2.length; _i4++) {
- var prop = _expr$properties2[_i4];
- if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue;
- this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
- }
- break;
- case "ArrayPattern":
- for (var _i6 = 0, _expr$elements2 = expr.elements; _i6 < _expr$elements2.length; _i6++) {
- var elem = _expr$elements2[_i6];
- if (elem) {
- this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern", disallowLetBinding);
- }
- }
- break;
- case "AssignmentPattern":
- this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern");
- break;
- case "RestElement":
- this.checkLVal(expr.argument, bindingType, checkClashes, "rest element");
- break;
- case "ParenthesizedExpression":
- this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression");
- break;
- default:
- {
- var message = (bindingType === BIND_NONE ? "Invalid" : "Binding invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : "expression");
- this.raise(expr.start, message);
- }
- }
- };
- _proto.checkToRestConversion = function checkToRestConversion(node) {
- if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
- this.raise(node.argument.start, "Invalid rest operator's argument");
- }
- };
- _proto.checkCommaAfterRest = function checkCommaAfterRest(close) {
- if (this.match(types.comma)) {
- if (this.lookaheadCharCode() === close) {
- this.raiseTrailingCommaAfterRest(this.state.start);
- } else {
- this.raiseRestNotLast(this.state.start);
- }
- }
- };
- _proto.raiseRestNotLast = function raiseRestNotLast(pos) {
- throw this.raise(pos, "Rest element must be last element");
- };
- _proto.raiseTrailingCommaAfterRest = function raiseTrailingCommaAfterRest(pos) {
- this.raise(pos, "Unexpected trailing comma after rest element");
- };
- return LValParser;
- }(NodeUtils);
- var ExpressionParser = function (_LValParser) {
- _inheritsLoose(ExpressionParser, _LValParser);
- function ExpressionParser() {
- return _LValParser.apply(this, arguments) || this;
- }
- var _proto = ExpressionParser.prototype;
- _proto.checkDuplicatedProto = function checkDuplicatedProto(prop, protoRef) {
- if (prop.type === "SpreadElement" || prop.computed || prop.kind || prop.shorthand) {
- return;
- }
- var key = prop.key;
- var name = key.type === "Identifier" ? key.name : String(key.value);
- if (name === "__proto__") {
- if (protoRef.used && !protoRef.start) {
- protoRef.start = key.start;
- }
- protoRef.used = true;
- }
- };
- _proto.getExpression = function getExpression() {
- var scopeFlags = SCOPE_PROGRAM;
- if (this.hasPlugin("topLevelAwait") && this.inModule) {
- scopeFlags |= SCOPE_ASYNC;
- }
- this.scope.enter(scopeFlags);
- this.nextToken();
- var expr = this.parseExpression();
- if (!this.match(types.eof)) {
- this.unexpected();
- }
- expr.comments = this.state.comments;
- expr.errors = this.state.errors;
- return expr;
- };
- _proto.parseExpression = function parseExpression(noIn, refShorthandDefaultPos) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
- if (this.match(types.comma)) {
- var _node = this.startNodeAt(startPos, startLoc);
- _node.expressions = [expr];
- while (this.eat(types.comma)) {
- _node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
- }
- this.toReferencedList(_node.expressions);
- return this.finishNode(_node, "SequenceExpression");
- }
- return expr;
- };
- _proto.parseMaybeAssign = function parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- if (this.isContextual("yield")) {
- if (this.scope.inGenerator) {
- var _left = this.parseYield(noIn);
- if (afterLeftParse) {
- _left = afterLeftParse.call(this, _left, startPos, startLoc);
- }
- return _left;
- } else {
- this.state.exprAllowed = false;
- }
- }
- var failOnShorthandAssign;
- if (refShorthandDefaultPos) {
- failOnShorthandAssign = false;
- } else {
- refShorthandDefaultPos = {
- start: 0
- };
- failOnShorthandAssign = true;
- }
- if (this.match(types.parenL) || this.match(types.name)) {
- this.state.potentialArrowAt = this.state.start;
- }
- var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos);
- if (afterLeftParse) {
- left = afterLeftParse.call(this, left, startPos, startLoc);
- }
- if (this.state.type.isAssign) {
- var _node2 = this.startNodeAt(startPos, startLoc);
- var operator = this.state.value;
- _node2.operator = operator;
- if (operator === "??=") {
- this.expectPlugin("logicalAssignment");
- }
- if (operator === "||=" || operator === "&&=") {
- this.expectPlugin("logicalAssignment");
- }
- _node2.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left;
- if (refShorthandDefaultPos.start >= _node2.left.start) {
- refShorthandDefaultPos.start = 0;
- }
- this.checkLVal(left, undefined, undefined, "assignment expression");
- this.next();
- _node2.right = this.parseMaybeAssign(noIn);
- return this.finishNode(_node2, "AssignmentExpression");
- } else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
- this.unexpected(refShorthandDefaultPos.start);
- }
- return left;
- };
- _proto.parseMaybeConditional = function parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var potentialArrowAt = this.state.potentialArrowAt;
- var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
- if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
- return expr;
- }
- if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
- return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
- };
- _proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
- if (this.eat(types.question)) {
- var _node3 = this.startNodeAt(startPos, startLoc);
- _node3.test = expr;
- _node3.consequent = this.parseMaybeAssign();
- this.expect(types.colon);
- _node3.alternate = this.parseMaybeAssign(noIn);
- return this.finishNode(_node3, "ConditionalExpression");
- }
- return expr;
- };
- _proto.parseExprOps = function parseExprOps(noIn, refShorthandDefaultPos) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var potentialArrowAt = this.state.potentialArrowAt;
- var expr = this.parseMaybeUnary(refShorthandDefaultPos);
- if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
- return expr;
- }
- if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
- return expr;
- }
- return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
- };
- _proto.parseExprOp = function parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
- var prec = this.state.type.binop;
- if (prec != null && (!noIn || !this.match(types._in))) {
- if (prec > minPrec) {
- var operator = this.state.value;
- if (operator === "|>" && this.state.inFSharpPipelineDirectBody) {
- return left;
- }
- var _node4 = this.startNodeAt(leftStartPos, leftStartLoc);
- _node4.left = left;
- _node4.operator = operator;
- if (operator === "**" && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) {
- this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
- }
- var op = this.state.type;
- if (op === types.pipeline) {
- this.expectPlugin("pipelineOperator");
- this.state.inPipeline = true;
- this.checkPipelineAtInfixOperator(left, leftStartPos);
- }
- this.next();
- if (op === types.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
- if (this.match(types.name) && this.state.value === "await" && this.scope.inAsync) {
- throw this.raise(this.state.start, "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal");
- }
- }
- _node4.right = this.parseExprOpRightExpr(op, prec, noIn);
- if (op === types.nullishCoalescing) {
- if (left.type === "LogicalExpression" && left.operator !== "??" && !(left.extra && left.extra.parenthesized)) {
- throw this.raise(left.start, "Nullish coalescing operator(??) requires parens when mixing with logical operators");
- } else if (_node4.right.type === "LogicalExpression" && _node4.right.operator !== "??" && !(_node4.right.extra && _node4.right.extra.parenthesized)) {
- throw this.raise(_node4.right.start, "Nullish coalescing operator(??) requires parens when mixing with logical operators");
- }
- }
- this.finishNode(_node4, op === types.logicalOR || op === types.logicalAND || op === types.nullishCoalescing ? "LogicalExpression" : "BinaryExpression");
- return this.parseExprOp(_node4, leftStartPos, leftStartLoc, minPrec, noIn);
- }
- }
- return left;
- };
- _proto.parseExprOpRightExpr = function parseExprOpRightExpr(op, prec, noIn) {
- var _this = this;
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- switch (op) {
- case types.pipeline:
- switch (this.getPluginOption("pipelineOperator", "proposal")) {
- case "smart":
- return this.withTopicPermittingContext(function () {
- return _this.parseSmartPipelineBody(_this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc);
- });
- case "fsharp":
- return this.withSoloAwaitPermittingContext(function () {
- return _this.parseFSharpPipelineBody(prec, noIn);
- });
- }
- default:
- return this.parseExprOpBaseRightExpr(op, prec, noIn);
- }
- };
- _proto.parseExprOpBaseRightExpr = function parseExprOpBaseRightExpr(op, prec, noIn) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
- };
- _proto.parseMaybeUnary = function parseMaybeUnary(refShorthandDefaultPos) {
- if (this.isContextual("await") && this.isAwaitAllowed()) {
- return this.parseAwait();
- } else if (this.state.type.prefix) {
- var _node5 = this.startNode();
- var update = this.match(types.incDec);
- _node5.operator = this.state.value;
- _node5.prefix = true;
- if (_node5.operator === "throw") {
- this.expectPlugin("throwExpressions");
- }
- this.next();
- _node5.argument = this.parseMaybeUnary();
- if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
- this.unexpected(refShorthandDefaultPos.start);
- }
- if (update) {
- this.checkLVal(_node5.argument, undefined, undefined, "prefix operation");
- } else if (this.state.strict && _node5.operator === "delete") {
- var arg = _node5.argument;
- if (arg.type === "Identifier") {
- this.raise(_node5.start, "Deleting local variable in strict mode");
- } else if (arg.type === "MemberExpression" && arg.property.type === "PrivateName") {
- this.raise(_node5.start, "Deleting a private field is not allowed");
- }
- }
- return this.finishNode(_node5, update ? "UpdateExpression" : "UnaryExpression");
- }
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var expr = this.parseExprSubscripts(refShorthandDefaultPos);
- if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
- while (this.state.type.postfix && !this.canInsertSemicolon()) {
- var _node6 = this.startNodeAt(startPos, startLoc);
- _node6.operator = this.state.value;
- _node6.prefix = false;
- _node6.argument = expr;
- this.checkLVal(expr, undefined, undefined, "postfix operation");
- this.next();
- expr = this.finishNode(_node6, "UpdateExpression");
- }
- return expr;
- };
- _proto.parseExprSubscripts = function parseExprSubscripts(refShorthandDefaultPos) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var potentialArrowAt = this.state.potentialArrowAt;
- var expr = this.parseExprAtom(refShorthandDefaultPos);
- if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
- return expr;
- }
- if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
- return expr;
- }
- return this.parseSubscripts(expr, startPos, startLoc);
- };
- _proto.parseSubscripts = function parseSubscripts(base, startPos, startLoc, noCalls) {
- var state = {
- optionalChainMember: false,
- maybeAsyncArrow: this.atPossibleAsync(base),
- stop: false
- };
- do {
- base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
- state.maybeAsyncArrow = false;
- } while (!state.stop);
- return base;
- };
- _proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, state) {
- if (!noCalls && this.eat(types.doubleColon)) {
- var _node7 = this.startNodeAt(startPos, startLoc);
- _node7.object = base;
- _node7.callee = this.parseNoCallExpr();
- state.stop = true;
- return this.parseSubscripts(this.finishNode(_node7, "BindExpression"), startPos, startLoc, noCalls);
- }
- var optional = false;
- if (this.match(types.questionDot)) {
- state.optionalChainMember = optional = true;
- if (noCalls && this.lookaheadCharCode() === 40) {
- state.stop = true;
- return base;
- }
- this.next();
- }
- var computed = this.eat(types.bracketL);
- if (optional && !this.match(types.parenL) && !this.match(types.backQuote) || computed || this.eat(types.dot)) {
- var _node8 = this.startNodeAt(startPos, startLoc);
- _node8.object = base;
- _node8.property = computed ? this.parseExpression() : optional ? this.parseIdentifier(true) : this.parseMaybePrivateName(true);
- _node8.computed = computed;
- if (_node8.property.type === "PrivateName") {
- if (_node8.object.type === "Super") {
- this.raise(startPos, "Private fields can't be accessed on super");
- }
- this.classScope.usePrivateName(_node8.property.id.name, _node8.property.start);
- }
- if (computed) {
- this.expect(types.bracketR);
- }
- if (state.optionalChainMember) {
- _node8.optional = optional;
- return this.finishNode(_node8, "OptionalMemberExpression");
- } else {
- return this.finishNode(_node8, "MemberExpression");
- }
- } else if (!noCalls && this.match(types.parenL)) {
- var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- this.state.maybeInArrowParameters = true;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- this.next();
- var _node9 = this.startNodeAt(startPos, startLoc);
- _node9.callee = base;
- if (optional) {
- _node9.optional = true;
- _node9.arguments = this.parseCallExpressionArguments(types.parenR, false);
- } else {
- _node9.arguments = this.parseCallExpressionArguments(types.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", _node9);
- }
- this.finishCallExpression(_node9, state.optionalChainMember);
- if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
- state.stop = true;
- _node9 = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node9);
- this.checkYieldAwaitInDefaultParams();
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- } else {
- this.toReferencedListDeep(_node9.arguments);
- if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
- if (!this.isAwaitAllowed() && !oldMaybeInArrowParameters || oldAwaitPos !== -1) {
- this.state.awaitPos = oldAwaitPos;
- }
- }
- this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
- return _node9;
- } else if (this.match(types.backQuote)) {
- return this.parseTaggedTemplateExpression(startPos, startLoc, base, state);
- } else {
- state.stop = true;
- return base;
- }
- };
- _proto.parseTaggedTemplateExpression = function parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments) {
- var node = this.startNodeAt(startPos, startLoc);
- node.tag = base;
- node.quasi = this.parseTemplate(true);
- if (typeArguments) node.typeParameters = typeArguments;
- if (state.optionalChainMember) {
- this.raise(startPos, "Tagged Template Literals are not allowed in optionalChain");
- }
- return this.finishNode(node, "TaggedTemplateExpression");
- };
- _proto.atPossibleAsync = function atPossibleAsync(base) {
- return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async";
- };
- _proto.finishCallExpression = function finishCallExpression(node, optional) {
- if (node.callee.type === "Import") {
- if (node.arguments.length !== 1) {
- this.raise(node.start, "import() requires exactly one argument");
- } else {
- var importArg = node.arguments[0];
- if (importArg && importArg.type === "SpreadElement") {
- this.raise(importArg.start, "... is not allowed in import()");
- }
- }
- }
- return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
- };
- _proto.parseCallExpressionArguments = function parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) {
- var elts = [];
- var innerParenStart;
- var first = true;
- var oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
- this.state.inFSharpPipelineDirectBody = false;
- while (!this.eat(close)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma);
- if (this.match(close)) {
- if (dynamicImport) {
- this.raise(this.state.lastTokStart, "Trailing comma is disallowed inside import(...) arguments");
- }
- if (nodeForExtra) {
- this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
- }
- this.next();
- break;
- }
- }
- if (this.match(types.parenL) && !innerParenStart) {
- innerParenStart = this.state.start;
- }
- elts.push(this.parseExprListItem(false, possibleAsyncArrow ? {
- start: 0
- } : undefined, possibleAsyncArrow ? {
- start: 0
- } : undefined, allowPlaceholder));
- }
- if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
- this.unexpected();
- }
- this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
- return elts;
- };
- _proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
- return this.match(types.arrow) && !this.canInsertSemicolon();
- };
- _proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
- var _call$extra;
- this.expect(types.arrow);
- this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
- return node;
- };
- _proto.parseNoCallExpr = function parseNoCallExpr() {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
- };
- _proto.parseExprAtom = function parseExprAtom(refShorthandDefaultPos) {
- if (this.state.type === types.slash) this.readRegexp();
- var canBeArrow = this.state.potentialArrowAt === this.state.start;
- var node;
- switch (this.state.type) {
- case types._super:
- node = this.startNode();
- this.next();
- if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
- this.raise(node.start, "super() is only valid inside a class constructor of a subclass. " + "Maybe a typo in the method name ('constructor') or not extending another class?");
- } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
- this.raise(node.start, "super is only allowed in object methods and classes");
- }
- if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
- this.raise(node.start, "super can only be used with function calls (i.e. super()) or " + "in property accesses (i.e. super.prop or super[prop])");
- }
- return this.finishNode(node, "Super");
- case types._import:
- node = this.startNode();
- this.next();
- if (this.match(types.dot)) {
- return this.parseImportMetaProperty(node);
- }
- if (!this.match(types.parenL)) {
- this.raise(this.state.lastTokStart, "import can only be used in import() or import.meta");
- }
- return this.finishNode(node, "Import");
- case types._this:
- node = this.startNode();
- this.next();
- return this.finishNode(node, "ThisExpression");
- case types.name:
- {
- node = this.startNode();
- var containsEsc = this.state.containsEsc;
- var id = this.parseIdentifier();
- if (!containsEsc && id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
- var last = this.state.context.length - 1;
- if (this.state.context[last] !== types$1.functionStatement) {
- throw new Error("Internal error");
- }
- this.state.context[last] = types$1.functionExpression;
- this.next();
- return this.parseFunction(node, undefined, true);
- } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types.name) && !this.canInsertSemicolon()) {
- var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- this.state.maybeInArrowParameters = true;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- var params = [this.parseIdentifier()];
- this.expect(types.arrow);
- this.checkYieldAwaitInDefaultParams();
- this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- this.parseArrowExpression(node, params, true);
- return node;
- }
- if (canBeArrow && this.match(types.arrow) && !this.canInsertSemicolon()) {
- this.next();
- this.parseArrowExpression(node, [id], false);
- return node;
- }
- return id;
- }
- case types._do:
- {
- this.expectPlugin("doExpressions");
- var _node10 = this.startNode();
- this.next();
- var oldLabels = this.state.labels;
- this.state.labels = [];
- _node10.body = this.parseBlock();
- this.state.labels = oldLabels;
- return this.finishNode(_node10, "DoExpression");
- }
- case types.regexp:
- {
- var value = this.state.value;
- node = this.parseLiteral(value.value, "RegExpLiteral");
- node.pattern = value.pattern;
- node.flags = value.flags;
- return node;
- }
- case types.num:
- return this.parseLiteral(this.state.value, "NumericLiteral");
- case types.bigint:
- return this.parseLiteral(this.state.value, "BigIntLiteral");
- case types.string:
- return this.parseLiteral(this.state.value, "StringLiteral");
- case types._null:
- node = this.startNode();
- this.next();
- return this.finishNode(node, "NullLiteral");
- case types._true:
- case types._false:
- return this.parseBooleanLiteral();
- case types.parenL:
- return this.parseParenAndDistinguishExpression(canBeArrow);
- case types.bracketL:
- {
- var oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
- this.state.inFSharpPipelineDirectBody = false;
- node = this.startNode();
- this.next();
- node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos, node);
- if (!this.state.maybeInArrowParameters) {
- this.toReferencedList(node.elements);
- }
- this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
- return this.finishNode(node, "ArrayExpression");
- }
- case types.braceL:
- {
- var _oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
- this.state.inFSharpPipelineDirectBody = false;
- var ret = this.parseObj(false, refShorthandDefaultPos);
- this.state.inFSharpPipelineDirectBody = _oldInFSharpPipelineDirectBody;
- return ret;
- }
- case types._function:
- return this.parseFunctionExpression();
- case types.at:
- this.parseDecorators();
- case types._class:
- node = this.startNode();
- this.takeDecorators(node);
- return this.parseClass(node, false);
- case types._new:
- return this.parseNew();
- case types.backQuote:
- return this.parseTemplate(false);
- case types.doubleColon:
- {
- node = this.startNode();
- this.next();
- node.object = null;
- var callee = node.callee = this.parseNoCallExpr();
- if (callee.type === "MemberExpression") {
- return this.finishNode(node, "BindExpression");
- } else {
- throw this.raise(callee.start, "Binding should be performed on object property.");
- }
- }
- case types.hash:
- {
- if (this.state.inPipeline) {
- node = this.startNode();
- if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") {
- this.raise(node.start, "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.");
- }
- this.next();
- if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
- this.raise(node.start, "Topic reference was used in a lexical context without topic binding");
- }
- this.registerTopicReference();
- return this.finishNode(node, "PipelinePrimaryTopicReference");
- }
- }
- default:
- throw this.unexpected();
- }
- };
- _proto.parseBooleanLiteral = function parseBooleanLiteral() {
- var node = this.startNode();
- node.value = this.match(types._true);
- this.next();
- return this.finishNode(node, "BooleanLiteral");
- };
- _proto.parseMaybePrivateName = function parseMaybePrivateName(isPrivateNameAllowed) {
- var isPrivate = this.match(types.hash);
- if (isPrivate) {
- this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]);
- if (!isPrivateNameAllowed) {
- this.raise(this.state.pos, "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).");
- }
- var _node11 = this.startNode();
- this.next();
- this.assertNoSpace("Unexpected space between # and identifier");
- _node11.id = this.parseIdentifier(true);
- return this.finishNode(_node11, "PrivateName");
- } else {
- return this.parseIdentifier(true);
- }
- };
- _proto.parseFunctionExpression = function parseFunctionExpression() {
- var node = this.startNode();
- var meta = this.startNode();
- this.next();
- meta = this.createIdentifier(meta, "function");
- if (this.scope.inGenerator && this.eat(types.dot)) {
- return this.parseMetaProperty(node, meta, "sent");
- }
- return this.parseFunction(node);
- };
- _proto.parseMetaProperty = function parseMetaProperty(node, meta, propertyName) {
- node.meta = meta;
- if (meta.name === "function" && propertyName === "sent") {
- if (this.isContextual(propertyName)) {
- this.expectPlugin("functionSent");
- } else if (!this.hasPlugin("functionSent")) {
- this.unexpected();
- }
- }
- var containsEsc = this.state.containsEsc;
- node.property = this.parseIdentifier(true);
- if (node.property.name !== propertyName || containsEsc) {
- this.raise(node.property.start, "The only valid meta property for " + meta.name + " is " + meta.name + "." + propertyName);
- }
- return this.finishNode(node, "MetaProperty");
- };
- _proto.parseImportMetaProperty = function parseImportMetaProperty(node) {
- var id = this.createIdentifier(this.startNodeAtNode(node), "import");
- this.expect(types.dot);
- if (this.isContextual("meta")) {
- this.expectPlugin("importMeta");
- if (!this.inModule) {
- this.raise(id.start, "import.meta may appear only with 'sourceType: \"module\"'", {
- code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
- });
- }
- this.sawUnambiguousESM = true;
- } else if (!this.hasPlugin("importMeta")) {
- this.raise(id.start, "Dynamic imports require a parameter: import('a.js')");
- }
- return this.parseMetaProperty(node, id, "meta");
- };
- _proto.parseLiteral = function parseLiteral(value, type, startPos, startLoc) {
- startPos = startPos || this.state.start;
- startLoc = startLoc || this.state.startLoc;
- var node = this.startNodeAt(startPos, startLoc);
- this.addExtra(node, "rawValue", value);
- this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
- node.value = value;
- this.next();
- return this.finishNode(node, type);
- };
- _proto.parseParenAndDistinguishExpression = function parseParenAndDistinguishExpression(canBeArrow) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var val;
- this.expect(types.parenL);
- var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- var oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
- this.state.maybeInArrowParameters = true;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- this.state.inFSharpPipelineDirectBody = false;
- var innerStartPos = this.state.start;
- var innerStartLoc = this.state.startLoc;
- var exprList = [];
- var refShorthandDefaultPos = {
- start: 0
- };
- var refNeedsArrowPos = {
- start: 0
- };
- var first = true;
- var spreadStart;
- var optionalCommaStart;
- while (!this.match(types.parenR)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma, refNeedsArrowPos.start || null);
- if (this.match(types.parenR)) {
- optionalCommaStart = this.state.start;
- break;
- }
- }
- if (this.match(types.ellipsis)) {
- var spreadNodeStartPos = this.state.start;
- var spreadNodeStartLoc = this.state.startLoc;
- spreadStart = this.state.start;
- exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
- this.checkCommaAfterRest(41);
- break;
- } else {
- exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos));
- }
- }
- var innerEndPos = this.state.start;
- var innerEndLoc = this.state.startLoc;
- this.expect(types.parenR);
- this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
- this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
- var arrowNode = this.startNodeAt(startPos, startLoc);
- if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
- this.checkYieldAwaitInDefaultParams();
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- for (var _i2 = 0; _i2 < exprList.length; _i2++) {
- var param = exprList[_i2];
- if (param.extra && param.extra.parenthesized) {
- this.unexpected(param.extra.parenStart);
- }
- }
- this.parseArrowExpression(arrowNode, exprList, false);
- return arrowNode;
- }
- if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
- if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos;
- if (!exprList.length) {
- this.unexpected(this.state.lastTokStart);
- }
- if (optionalCommaStart) this.unexpected(optionalCommaStart);
- if (spreadStart) this.unexpected(spreadStart);
- if (refShorthandDefaultPos.start) {
- this.unexpected(refShorthandDefaultPos.start);
- }
- if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
- this.toReferencedListDeep(exprList, true);
- if (exprList.length > 1) {
- val = this.startNodeAt(innerStartPos, innerStartLoc);
- val.expressions = exprList;
- this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
- } else {
- val = exprList[0];
- }
- if (!this.options.createParenthesizedExpressions) {
- this.addExtra(val, "parenthesized", true);
- this.addExtra(val, "parenStart", startPos);
- return val;
- }
- var parenExpression = this.startNodeAt(startPos, startLoc);
- parenExpression.expression = val;
- this.finishNode(parenExpression, "ParenthesizedExpression");
- return parenExpression;
- };
- _proto.shouldParseArrow = function shouldParseArrow() {
- return !this.canInsertSemicolon();
- };
- _proto.parseArrow = function parseArrow(node) {
- if (this.eat(types.arrow)) {
- return node;
- }
- };
- _proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
- return node;
- };
- _proto.parseNew = function parseNew() {
- var node = this.startNode();
- var meta = this.startNode();
- this.next();
- meta = this.createIdentifier(meta, "new");
- if (this.eat(types.dot)) {
- var metaProp = this.parseMetaProperty(node, meta, "target");
- if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
- var error = "new.target can only be used in functions";
- if (this.hasPlugin("classProperties")) {
- error += " or class properties";
- }
- this.raise(metaProp.start, error);
- }
- return metaProp;
- }
- node.callee = this.parseNoCallExpr();
- if (node.callee.type === "Import") {
- this.raise(node.callee.start, "Cannot use new with import(...)");
- } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") {
- this.raise(this.state.lastTokEnd, "constructors in/after an Optional Chain are not allowed");
- } else if (this.eat(types.questionDot)) {
- this.raise(this.state.start, "constructors in/after an Optional Chain are not allowed");
- }
- this.parseNewArguments(node);
- return this.finishNode(node, "NewExpression");
- };
- _proto.parseNewArguments = function parseNewArguments(node) {
- if (this.eat(types.parenL)) {
- var args = this.parseExprList(types.parenR);
- this.toReferencedList(args);
- node.arguments = args;
- } else {
- node.arguments = [];
- }
- };
- _proto.parseTemplateElement = function parseTemplateElement(isTagged) {
- var elem = this.startNode();
- if (this.state.value === null) {
- if (!isTagged) {
- this.raise(this.state.start + 1, "Invalid escape sequence in template");
- }
- }
- elem.value = {
- raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
- cooked: this.state.value
- };
- this.next();
- elem.tail = this.match(types.backQuote);
- return this.finishNode(elem, "TemplateElement");
- };
- _proto.parseTemplate = function parseTemplate(isTagged) {
- var node = this.startNode();
- this.next();
- node.expressions = [];
- var curElt = this.parseTemplateElement(isTagged);
- node.quasis = [curElt];
- while (!curElt.tail) {
- this.expect(types.dollarBraceL);
- node.expressions.push(this.parseExpression());
- this.expect(types.braceR);
- node.quasis.push(curElt = this.parseTemplateElement(isTagged));
- }
- this.next();
- return this.finishNode(node, "TemplateLiteral");
- };
- _proto.parseObj = function parseObj(isPattern, refShorthandDefaultPos) {
- var propHash = Object.create(null);
- var first = true;
- var node = this.startNode();
- node.properties = [];
- this.next();
- while (!this.eat(types.braceR)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma);
- if (this.match(types.braceR)) {
- this.addExtra(node, "trailingComma", this.state.lastTokStart);
- this.next();
- break;
- }
- }
- var prop = this.parseObjectMember(isPattern, refShorthandDefaultPos);
- if (!isPattern) this.checkDuplicatedProto(prop, propHash);
- if (prop.shorthand) {
- this.addExtra(prop, "shorthand", true);
- }
- node.properties.push(prop);
- }
- if (!this.match(types.eq) && propHash.start !== undefined) {
- this.raise(propHash.start, "Redefinition of __proto__ property");
- }
- return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
- };
- _proto.isAsyncProp = function isAsyncProp(prop) {
- return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.match(types.name) || this.match(types.num) || this.match(types.string) || this.match(types.bracketL) || this.state.type.keyword || this.match(types.star)) && !this.hasPrecedingLineBreak();
- };
- _proto.parseObjectMember = function parseObjectMember(isPattern, refShorthandDefaultPos) {
- var decorators = [];
- if (this.match(types.at)) {
- if (this.hasPlugin("decorators")) {
- this.raise(this.state.start, "Stage 2 decorators disallow object literal property decorators");
- }
- while (this.match(types.at)) {
- decorators.push(this.parseDecorator());
- }
- }
- var prop = this.startNode();
- var isGenerator = false;
- var isAsync = false;
- var startPos;
- var startLoc;
- if (this.match(types.ellipsis)) {
- if (decorators.length) this.unexpected();
- if (isPattern) {
- this.next();
- prop.argument = this.parseIdentifier();
- this.checkCommaAfterRest(125);
- return this.finishNode(prop, "RestElement");
- }
- return this.parseSpread();
- }
- if (decorators.length) {
- prop.decorators = decorators;
- decorators = [];
- }
- prop.method = false;
- if (isPattern || refShorthandDefaultPos) {
- startPos = this.state.start;
- startLoc = this.state.startLoc;
- }
- if (!isPattern) {
- isGenerator = this.eat(types.star);
- }
- var containsEsc = this.state.containsEsc;
- this.parsePropertyName(prop, false);
- if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) {
- isAsync = true;
- isGenerator = this.eat(types.star);
- this.parsePropertyName(prop, false);
- } else {
- isAsync = false;
- }
- this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc);
- return prop;
- };
- _proto.isGetterOrSetterMethod = function isGetterOrSetterMethod(prop, isPattern) {
- return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || this.match(types.num) || this.match(types.bracketL) || this.match(types.name) || !!this.state.type.keyword);
- };
- _proto.getGetterSetterExpectedParamCount = function getGetterSetterExpectedParamCount(method) {
- return method.kind === "get" ? 0 : 1;
- };
- _proto.checkGetterSetterParams = function checkGetterSetterParams(method) {
- var paramCount = this.getGetterSetterExpectedParamCount(method);
- var start = method.start;
- if (method.params.length !== paramCount) {
- if (method.kind === "get") {
- this.raise(start, "getter must not have any formal parameters");
- } else {
- this.raise(start, "setter must have exactly one formal parameter");
- }
- }
- if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") {
- this.raise(start, "setter function argument must not be a rest parameter");
- }
- };
- _proto.parseObjectMethod = function parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
- if (isAsync || isGenerator || this.match(types.parenL)) {
- if (isPattern) this.unexpected();
- prop.kind = "method";
- prop.method = true;
- return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
- }
- if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) {
- if (isGenerator || isAsync) this.unexpected();
- prop.kind = prop.key.name;
- this.parsePropertyName(prop, false);
- this.parseMethod(prop, false, false, false, false, "ObjectMethod");
- this.checkGetterSetterParams(prop);
- return prop;
- }
- };
- _proto.parseObjectProperty = function parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
- prop.shorthand = false;
- if (this.eat(types.colon)) {
- prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
- return this.finishNode(prop, "ObjectProperty");
- }
- if (!prop.computed && prop.key.type === "Identifier") {
- this.checkReservedWord(prop.key.name, prop.key.start, true, true);
- if (isPattern) {
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
- } else if (this.match(types.eq) && refShorthandDefaultPos) {
- if (!refShorthandDefaultPos.start) {
- refShorthandDefaultPos.start = this.state.start;
- }
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
- } else {
- prop.value = prop.key.__clone();
- }
- prop.shorthand = true;
- return this.finishNode(prop, "ObjectProperty");
- }
- };
- _proto.parseObjPropValue = function parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) {
- var node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
- if (!node) this.unexpected();
- return node;
- };
- _proto.parsePropertyName = function parsePropertyName(prop, isPrivateNameAllowed) {
- if (this.eat(types.bracketL)) {
- prop.computed = true;
- prop.key = this.parseMaybeAssign();
- this.expect(types.bracketR);
- } else {
- var oldInPropertyName = this.state.inPropertyName;
- this.state.inPropertyName = true;
- prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
- if (prop.key.type !== "PrivateName") {
- prop.computed = false;
- }
- this.state.inPropertyName = oldInPropertyName;
- }
- return prop.key;
- };
- _proto.initFunction = function initFunction(node, isAsync) {
- node.id = null;
- node.generator = false;
- node.async = !!isAsync;
- };
- _proto.parseMethod = function parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
- if (inClassScope === void 0) {
- inClassScope = false;
- }
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- this.initFunction(node, isAsync);
- node.generator = !!isGenerator;
- var allowModifiers = isConstructor;
- this.scope.enter(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
- this.parseFunctionParams(node, allowModifiers);
- this.parseFunctionBodyAndFinish(node, type, true);
- this.scope.exit();
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- return node;
- };
- _proto.parseArrowExpression = function parseArrowExpression(node, params, isAsync, trailingCommaPos) {
- this.scope.enter(functionFlags(isAsync, false) | SCOPE_ARROW);
- this.initFunction(node, isAsync);
- var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- this.state.maybeInArrowParameters = false;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- if (params) this.setArrowFunctionParameters(node, params, trailingCommaPos);
- this.parseFunctionBody(node, true);
- this.scope.exit();
- this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- return this.finishNode(node, "ArrowFunctionExpression");
- };
- _proto.setArrowFunctionParameters = function setArrowFunctionParameters(node, params, trailingCommaPos) {
- node.params = this.toAssignableList(params, true, "arrow function parameters", trailingCommaPos);
- };
- _proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, isMethod) {
- if (isMethod === void 0) {
- isMethod = false;
- }
- this.parseFunctionBody(node, false, isMethod);
- this.finishNode(node, type);
- };
- _proto.parseFunctionBody = function parseFunctionBody(node, allowExpression, isMethod) {
- if (isMethod === void 0) {
- isMethod = false;
- }
- var isExpression = allowExpression && !this.match(types.braceL);
- var oldStrict = this.state.strict;
- var useStrict = false;
- var oldInParameters = this.state.inParameters;
- this.state.inParameters = false;
- if (isExpression) {
- node.body = this.parseMaybeAssign();
- this.checkParams(node, false, allowExpression, false);
- } else {
- var nonSimple = !this.isSimpleParamList(node.params);
- if (!oldStrict || nonSimple) {
- useStrict = this.strictDirective(this.state.end);
- if (useStrict && nonSimple) {
- var errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
- this.raise(errorPos, "Illegal 'use strict' directive in function with non-simple parameter list");
- }
- }
- var oldLabels = this.state.labels;
- this.state.labels = [];
- if (useStrict) this.state.strict = true;
- this.checkParams(node, !oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple, allowExpression, !oldStrict && useStrict);
- node.body = this.parseBlock(true, false);
- this.state.labels = oldLabels;
- }
- this.state.inParameters = oldInParameters;
- if (this.state.strict && node.id) {
- this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name", undefined, !oldStrict && useStrict);
- }
- this.state.strict = oldStrict;
- };
- _proto.isSimpleParamList = function isSimpleParamList(params) {
- for (var i = 0, len = params.length; i < len; i++) {
- if (params[i].type !== "Identifier") return false;
- }
- return true;
- };
- _proto.checkParams = function checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged) {
- if (strictModeChanged === void 0) {
- strictModeChanged = true;
- }
- var nameHash = Object.create(null);
- for (var i = 0; i < node.params.length; i++) {
- this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, "function parameter list", undefined, strictModeChanged);
- }
- };
- _proto.parseExprList = function parseExprList(close, allowEmpty, refShorthandDefaultPos, nodeForExtra) {
- var elts = [];
- var first = true;
- while (!this.eat(close)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma);
- if (this.match(close)) {
- if (nodeForExtra) {
- this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
- }
- this.next();
- break;
- }
- }
- elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos));
- }
- return elts;
- };
- _proto.parseExprListItem = function parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos, allowPlaceholder) {
- var elt;
- if (allowEmpty && this.match(types.comma)) {
- elt = null;
- } else if (this.match(types.ellipsis)) {
- var spreadNodeStartPos = this.state.start;
- var spreadNodeStartLoc = this.state.startLoc;
- elt = this.parseParenItem(this.parseSpread(refShorthandDefaultPos, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);
- } else if (this.match(types.question)) {
- this.expectPlugin("partialApplication");
- if (!allowPlaceholder) {
- this.raise(this.state.start, "Unexpected argument placeholder");
- }
- var _node12 = this.startNode();
- this.next();
- elt = this.finishNode(_node12, "ArgumentPlaceholder");
- } else {
- elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos);
- }
- return elt;
- };
- _proto.parseIdentifier = function parseIdentifier(liberal) {
- var node = this.startNode();
- var name = this.parseIdentifierName(node.start, liberal);
- return this.createIdentifier(node, name);
- };
- _proto.createIdentifier = function createIdentifier(node, name) {
- node.name = name;
- node.loc.identifierName = name;
- return this.finishNode(node, "Identifier");
- };
- _proto.parseIdentifierName = function parseIdentifierName(pos, liberal) {
- var name;
- if (this.match(types.name)) {
- name = this.state.value;
- } else if (this.state.type.keyword) {
- name = this.state.type.keyword;
- if ((name === "class" || name === "function") && (this.state.lastTokEnd !== this.state.lastTokStart + 1 || this.input.charCodeAt(this.state.lastTokStart) !== 46)) {
- this.state.context.pop();
- }
- } else {
- throw this.unexpected();
- }
- if (liberal) {
- this.state.type = types.name;
- } else {
- this.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false);
- }
- this.next();
- return name;
- };
- _proto.checkReservedWord = function checkReservedWord(word, startLoc, checkKeywords, isBinding) {
- if (this.scope.inGenerator && word === "yield") {
- this.raise(startLoc, "Can not use 'yield' as identifier inside a generator");
- return;
- }
- if (word === "await") {
- if (this.scope.inAsync) {
- this.raise(startLoc, "Can not use 'await' as identifier inside an async function");
- return;
- }
- if (this.state.awaitPos === -1 && (this.state.maybeInArrowParameters || this.isAwaitAllowed())) {
- this.state.awaitPos = this.state.start;
- }
- }
- if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") {
- this.raise(startLoc, "'arguments' is not allowed in class field initializer");
- return;
- }
- if (checkKeywords && isKeyword(word)) {
- this.raise(startLoc, "Unexpected keyword '" + word + "'");
- return;
- }
- var reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
- if (reservedTest(word, this.inModule)) {
- if (!this.scope.inAsync && word === "await") {
- this.raise(startLoc, "Can not use keyword 'await' outside an async function");
- } else {
- this.raise(startLoc, "Unexpected reserved word '" + word + "'");
- }
- }
- };
- _proto.isAwaitAllowed = function isAwaitAllowed() {
- if (this.scope.inFunction) return this.scope.inAsync;
- if (this.options.allowAwaitOutsideFunction) return true;
- if (this.hasPlugin("topLevelAwait")) {
- return this.inModule && this.scope.inAsync;
- }
- return false;
- };
- _proto.parseAwait = function parseAwait() {
- var node = this.startNode();
- this.next();
- if (this.state.inParameters) {
- this.raise(node.start, "await is not allowed in async function parameters");
- } else if (this.state.awaitPos === -1) {
- this.state.awaitPos = node.start;
- }
- if (this.eat(types.star)) {
- this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
- }
- if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
- if (this.hasPrecedingLineBreak() || this.match(types.plusMin) || this.match(types.parenL) || this.match(types.bracketL) || this.match(types.backQuote) || this.match(types.regexp) || this.match(types.slash) || this.hasPlugin("v8intrinsic") && this.match(types.modulo)) {
- this.ambiguousScriptDifferentAst = true;
- } else {
- this.sawUnambiguousESM = true;
- }
- }
- if (!this.state.soloAwait) {
- node.argument = this.parseMaybeUnary();
- }
- return this.finishNode(node, "AwaitExpression");
- };
- _proto.parseYield = function parseYield(noIn) {
- var node = this.startNode();
- if (this.state.inParameters) {
- this.raise(node.start, "yield is not allowed in generator parameters");
- } else if (this.state.yieldPos === -1) {
- this.state.yieldPos = node.start;
- }
- this.next();
- if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) {
- node.delegate = false;
- node.argument = null;
- } else {
- node.delegate = this.eat(types.star);
- node.argument = this.parseMaybeAssign(noIn);
- }
- return this.finishNode(node, "YieldExpression");
- };
- _proto.checkPipelineAtInfixOperator = function checkPipelineAtInfixOperator(left, leftStartPos) {
- if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
- if (left.type === "SequenceExpression") {
- this.raise(leftStartPos, "Pipeline head should not be a comma-separated sequence expression");
- }
- }
- };
- _proto.parseSmartPipelineBody = function parseSmartPipelineBody(childExpression, startPos, startLoc) {
- var pipelineStyle = this.checkSmartPipelineBodyStyle(childExpression);
- this.checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos);
- return this.parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc);
- };
- _proto.checkSmartPipelineBodyEarlyErrors = function checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos) {
- if (this.match(types.arrow)) {
- throw this.raise(this.state.start, "Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized");
- } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") {
- this.raise(startPos, "Pipeline body may not be a comma-separated sequence expression");
- }
- };
- _proto.parseSmartPipelineBodyInStyle = function parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc) {
- var bodyNode = this.startNodeAt(startPos, startLoc);
- switch (pipelineStyle) {
- case "PipelineBareFunction":
- bodyNode.callee = childExpression;
- break;
- case "PipelineBareConstructor":
- bodyNode.callee = childExpression.callee;
- break;
- case "PipelineBareAwaitedFunction":
- bodyNode.callee = childExpression.argument;
- break;
- case "PipelineTopicExpression":
- if (!this.topicReferenceWasUsedInCurrentTopicContext()) {
- this.raise(startPos, "Pipeline is in topic style but does not use topic reference");
- }
- bodyNode.expression = childExpression;
- break;
- default:
- throw new Error("Internal @babel/parser error: Unknown pipeline style (" + pipelineStyle + ")");
- }
- return this.finishNode(bodyNode, pipelineStyle);
- };
- _proto.checkSmartPipelineBodyStyle = function checkSmartPipelineBodyStyle(expression) {
- switch (expression.type) {
- default:
- return this.isSimpleReference(expression) ? "PipelineBareFunction" : "PipelineTopicExpression";
- }
- };
- _proto.isSimpleReference = function isSimpleReference(expression) {
- switch (expression.type) {
- case "MemberExpression":
- return !expression.computed && this.isSimpleReference(expression.object);
- case "Identifier":
- return true;
- default:
- return false;
- }
- };
- _proto.withTopicPermittingContext = function withTopicPermittingContext(callback) {
- var outerContextTopicState = this.state.topicContext;
- this.state.topicContext = {
- maxNumOfResolvableTopics: 1,
- maxTopicIndex: null
- };
- try {
- return callback();
- } finally {
- this.state.topicContext = outerContextTopicState;
- }
- };
- _proto.withTopicForbiddingContext = function withTopicForbiddingContext(callback) {
- var outerContextTopicState = this.state.topicContext;
- this.state.topicContext = {
- maxNumOfResolvableTopics: 0,
- maxTopicIndex: null
- };
- try {
- return callback();
- } finally {
- this.state.topicContext = outerContextTopicState;
- }
- };
- _proto.withSoloAwaitPermittingContext = function withSoloAwaitPermittingContext(callback) {
- var outerContextSoloAwaitState = this.state.soloAwait;
- this.state.soloAwait = true;
- try {
- return callback();
- } finally {
- this.state.soloAwait = outerContextSoloAwaitState;
- }
- };
- _proto.registerTopicReference = function registerTopicReference() {
- this.state.topicContext.maxTopicIndex = 0;
- };
- _proto.primaryTopicReferenceIsAllowedInCurrentTopicContext = function primaryTopicReferenceIsAllowedInCurrentTopicContext() {
- return this.state.topicContext.maxNumOfResolvableTopics >= 1;
- };
- _proto.topicReferenceWasUsedInCurrentTopicContext = function topicReferenceWasUsedInCurrentTopicContext() {
- return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
- };
- _proto.parseFSharpPipelineBody = function parseFSharpPipelineBody(prec, noIn) {
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- this.state.potentialArrowAt = this.state.start;
- var oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
- this.state.inFSharpPipelineDirectBody = true;
- var ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn);
- this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
- return ret;
- };
- return ExpressionParser;
- }(LValParser);
- var loopLabel = {
- kind: "loop"
- },
- switchLabel = {
- kind: "switch"
- };
- var FUNC_NO_FLAGS = 0,
- FUNC_STATEMENT = 1,
- FUNC_HANGING_STATEMENT = 2,
- FUNC_NULLABLE_ID = 4;
- var StatementParser = function (_ExpressionParser) {
- _inheritsLoose(StatementParser, _ExpressionParser);
- function StatementParser() {
- return _ExpressionParser.apply(this, arguments) || this;
- }
- var _proto = StatementParser.prototype;
- _proto.parseTopLevel = function parseTopLevel(file, program) {
- program.sourceType = this.options.sourceType;
- program.interpreter = this.parseInterpreterDirective();
- this.parseBlockBody(program, true, true, types.eof);
- if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
- for (var _i2 = 0, _Array$from2 = Array.from(this.scope.undefinedExports); _i2 < _Array$from2.length; _i2++) {
- var _Array$from2$_i = _Array$from2[_i2],
- name = _Array$from2$_i[0];
- var pos = this.scope.undefinedExports.get(name);
- this.raise(pos, "Export '" + name + "' is not defined");
- }
- }
- file.program = this.finishNode(program, "Program");
- file.comments = this.state.comments;
- if (this.options.tokens) file.tokens = this.state.tokens;
- return this.finishNode(file, "File");
- };
- _proto.stmtToDirective = function stmtToDirective(stmt) {
- var expr = stmt.expression;
- var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
- var directive = this.startNodeAt(stmt.start, stmt.loc.start);
- var raw = this.input.slice(expr.start, expr.end);
- var val = directiveLiteral.value = raw.slice(1, -1);
- this.addExtra(directiveLiteral, "raw", raw);
- this.addExtra(directiveLiteral, "rawValue", val);
- directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
- return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
- };
- _proto.parseInterpreterDirective = function parseInterpreterDirective() {
- if (!this.match(types.interpreterDirective)) {
- return null;
- }
- var node = this.startNode();
- node.value = this.state.value;
- this.next();
- return this.finishNode(node, "InterpreterDirective");
- };
- _proto.isLet = function isLet(context) {
- if (!this.isContextual("let")) {
- return false;
- }
- var next = this.nextTokenStart();
- var nextCh = this.input.charCodeAt(next);
- if (nextCh === 91) return true;
- if (context) return false;
- if (nextCh === 123) return true;
- if (isIdentifierStart(nextCh)) {
- var pos = next + 1;
- while (isIdentifierChar(this.input.charCodeAt(pos))) {
- ++pos;
- }
- var ident = this.input.slice(next, pos);
- if (!keywordRelationalOperator.test(ident)) return true;
- }
- return false;
- };
- _proto.parseStatement = function parseStatement(context, topLevel) {
- if (this.match(types.at)) {
- this.parseDecorators(true);
- }
- return this.parseStatementContent(context, topLevel);
- };
- _proto.parseStatementContent = function parseStatementContent(context, topLevel) {
- var starttype = this.state.type;
- var node = this.startNode();
- var kind;
- if (this.isLet(context)) {
- starttype = types._var;
- kind = "let";
- }
- 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:
- if (this.lookaheadCharCode() === 46) break;
- if (context) {
- if (this.state.strict) {
- this.raise(this.state.start, "In strict mode code, functions can only be declared at top level or inside a block");
- } else if (context !== "if" && context !== "label") {
- this.raise(this.state.start, "In non-strict mode code, functions can only be declared at top level, " + "inside a block, or as the body of an if statement");
- }
- }
- 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.state.value;
- if (context && kind !== "var") {
- this.raise(this.state.start, "Lexical declaration cannot appear in a single-statement context");
- }
- 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();
- case types.semi:
- return this.parseEmptyStatement(node);
- case types._export:
- case types._import:
- {
- var nextTokenCharCode = this.lookaheadCharCode();
- if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
- break;
- }
- if (!this.options.allowImportExportEverywhere && !topLevel) {
- this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
- }
- this.next();
- var result;
- if (starttype === types._import) {
- result = this.parseImport(node);
- if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
- this.sawUnambiguousESM = true;
- }
- } else {
- result = this.parseExport(node);
- if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
- this.sawUnambiguousESM = true;
- }
- }
- this.assertModuleNodeAllowed(node);
- return result;
- }
- default:
- {
- if (this.isAsyncFunction()) {
- if (context) {
- this.raise(this.state.start, "Async functions can only be declared at the top level or inside a block");
- }
- this.next();
- return this.parseFunctionStatement(node, true, !context);
- }
- }
- }
- var maybeName = this.state.value;
- var 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);
- }
- };
- _proto.assertModuleNodeAllowed = function assertModuleNodeAllowed(node) {
- if (!this.options.allowImportExportEverywhere && !this.inModule) {
- this.raise(node.start, "'import' and 'export' may appear only with 'sourceType: \"module\"'", {
- code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
- });
- }
- };
- _proto.takeDecorators = function takeDecorators(node) {
- var decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
- if (decorators.length) {
- node.decorators = decorators;
- this.resetStartLocationFromNode(node, decorators[0]);
- this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
- }
- };
- _proto.canHaveLeadingDecorator = function canHaveLeadingDecorator() {
- return this.match(types._class);
- };
- _proto.parseDecorators = function parseDecorators(allowExport) {
- var currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
- while (this.match(types.at)) {
- var decorator = this.parseDecorator();
- currentContextDecorators.push(decorator);
- }
- if (this.match(types._export)) {
- if (!allowExport) {
- this.unexpected();
- }
- if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
- this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. " + "Please use `export @dec class` instead.");
- }
- } else if (!this.canHaveLeadingDecorator()) {
- throw this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
- }
- };
- _proto.parseDecorator = function parseDecorator() {
- this.expectOnePlugin(["decorators-legacy", "decorators"]);
- var node = this.startNode();
- this.next();
- if (this.hasPlugin("decorators")) {
- this.state.decoratorStack.push([]);
- var startPos = this.state.start;
- var startLoc = this.state.startLoc;
- var expr;
- if (this.eat(types.parenL)) {
- expr = this.parseExpression();
- this.expect(types.parenR);
- } else {
- expr = this.parseIdentifier(false);
- while (this.eat(types.dot)) {
- var _node = this.startNodeAt(startPos, startLoc);
- _node.object = expr;
- _node.property = this.parseIdentifier(true);
- _node.computed = false;
- expr = this.finishNode(_node, "MemberExpression");
- }
- }
- node.expression = this.parseMaybeDecoratorArguments(expr);
- this.state.decoratorStack.pop();
- } else {
- node.expression = this.parseExprSubscripts();
- }
- return this.finishNode(node, "Decorator");
- };
- _proto.parseMaybeDecoratorArguments = function parseMaybeDecoratorArguments(expr) {
- if (this.eat(types.parenL)) {
- var node = this.startNodeAtNode(expr);
- node.callee = expr;
- node.arguments = this.parseCallExpressionArguments(types.parenR, false);
- this.toReferencedList(node.arguments);
- return this.finishNode(node, "CallExpression");
- }
- return expr;
- };
- _proto.parseBreakContinueStatement = function parseBreakContinueStatement(node, keyword) {
- var isBreak = keyword === "break";
- this.next();
- if (this.isLineTerminator()) {
- node.label = null;
- } else {
- node.label = this.parseIdentifier();
- this.semicolon();
- }
- this.verifyBreakContinue(node, keyword);
- return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
- };
- _proto.verifyBreakContinue = function verifyBreakContinue(node, keyword) {
- var isBreak = keyword === "break";
- var i;
- for (i = 0; i < this.state.labels.length; ++i) {
- var lab = this.state.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.state.labels.length) {
- this.raise(node.start, "Unsyntactic " + keyword);
- }
- };
- _proto.parseDebuggerStatement = function parseDebuggerStatement(node) {
- this.next();
- this.semicolon();
- return this.finishNode(node, "DebuggerStatement");
- };
- _proto.parseHeaderExpression = function parseHeaderExpression() {
- this.expect(types.parenL);
- var val = this.parseExpression();
- this.expect(types.parenR);
- return val;
- };
- _proto.parseDoStatement = function parseDoStatement(node) {
- var _this = this;
- this.next();
- this.state.labels.push(loopLabel);
- node.body = this.withTopicForbiddingContext(function () {
- return _this.parseStatement("do");
- });
- this.state.labels.pop();
- this.expect(types._while);
- node.test = this.parseHeaderExpression();
- this.eat(types.semi);
- return this.finishNode(node, "DoWhileStatement");
- };
- _proto.parseForStatement = function parseForStatement(node) {
- this.next();
- this.state.labels.push(loopLabel);
- var awaitAt = -1;
- if (this.isAwaitAllowed() && this.eatContextual("await")) {
- awaitAt = this.state.lastTokStart;
- }
- this.scope.enter(SCOPE_OTHER);
- this.expect(types.parenL);
- if (this.match(types.semi)) {
- if (awaitAt > -1) {
- this.unexpected(awaitAt);
- }
- return this.parseFor(node, null);
- }
- var isLet = this.isLet();
- if (this.match(types._var) || this.match(types._const) || isLet) {
- var _init = this.startNode();
- var kind = isLet ? "let" : this.state.value;
- this.next();
- this.parseVar(_init, true, kind);
- this.finishNode(_init, "VariableDeclaration");
- if ((this.match(types._in) || this.isContextual("of")) && _init.declarations.length === 1) {
- return this.parseForIn(node, _init, awaitAt);
- }
- if (awaitAt > -1) {
- this.unexpected(awaitAt);
- }
- return this.parseFor(node, _init);
- }
- var refShorthandDefaultPos = {
- start: 0
- };
- var init = this.parseExpression(true, refShorthandDefaultPos);
- if (this.match(types._in) || this.isContextual("of")) {
- var description = this.isContextual("of") ? "for-of statement" : "for-in statement";
- this.toAssignable(init, undefined, description);
- this.checkLVal(init, undefined, undefined, description);
- return this.parseForIn(node, init, awaitAt);
- } else if (refShorthandDefaultPos.start) {
- this.unexpected(refShorthandDefaultPos.start);
- }
- if (awaitAt > -1) {
- this.unexpected(awaitAt);
- }
- return this.parseFor(node, init);
- };
- _proto.parseFunctionStatement = function parseFunctionStatement(node, isAsync, declarationPosition) {
- this.next();
- return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);
- };
- _proto.parseIfStatement = function parseIfStatement(node) {
- this.next();
- node.test = this.parseHeaderExpression();
- node.consequent = this.parseStatement("if");
- node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
- return this.finishNode(node, "IfStatement");
- };
- _proto.parseReturnStatement = function parseReturnStatement(node) {
- if (!this.scope.inFunction && !this.options.allowReturnOutsideFunction) {
- this.raise(this.state.start, "'return' outside of function");
- }
- this.next();
- if (this.isLineTerminator()) {
- node.argument = null;
- } else {
- node.argument = this.parseExpression();
- this.semicolon();
- }
- return this.finishNode(node, "ReturnStatement");
- };
- _proto.parseSwitchStatement = function parseSwitchStatement(node) {
- this.next();
- node.discriminant = this.parseHeaderExpression();
- var cases = node.cases = [];
- this.expect(types.braceL);
- this.state.labels.push(switchLabel);
- this.scope.enter(SCOPE_OTHER);
- var cur;
- for (var sawDefault; !this.match(types.braceR);) {
- if (this.match(types._case) || this.match(types._default)) {
- var isCase = this.match(types._case);
- if (cur) this.finishNode(cur, "SwitchCase");
- cases.push(cur = this.startNode());
- cur.consequent = [];
- this.next();
- if (isCase) {
- cur.test = this.parseExpression();
- } else {
- if (sawDefault) {
- this.raise(this.state.lastTokStart, "Multiple default clauses");
- }
- sawDefault = true;
- cur.test = null;
- }
- this.expect(types.colon);
- } else {
- if (cur) {
- cur.consequent.push(this.parseStatement(null));
- } else {
- this.unexpected();
- }
- }
- }
- this.scope.exit();
- if (cur) this.finishNode(cur, "SwitchCase");
- this.next();
- this.state.labels.pop();
- return this.finishNode(node, "SwitchStatement");
- };
- _proto.parseThrowStatement = function parseThrowStatement(node) {
- this.next();
- if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) {
- this.raise(this.state.lastTokEnd, "Illegal newline after throw");
- }
- node.argument = this.parseExpression();
- this.semicolon();
- return this.finishNode(node, "ThrowStatement");
- };
- _proto.parseTryStatement = function parseTryStatement(node) {
- var _this2 = this;
- this.next();
- node.block = this.parseBlock();
- node.handler = null;
- if (this.match(types._catch)) {
- var clause = this.startNode();
- this.next();
- if (this.match(types.parenL)) {
- this.expect(types.parenL);
- clause.param = this.parseBindingAtom();
- var simple = clause.param.type === "Identifier";
- this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);
- this.checkLVal(clause.param, BIND_LEXICAL, null, "catch clause");
- this.expect(types.parenR);
- } else {
- clause.param = null;
- this.scope.enter(SCOPE_OTHER);
- }
- clause.body = this.withTopicForbiddingContext(function () {
- return _this2.parseBlock(false, false);
- });
- this.scope.exit();
- 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");
- };
- _proto.parseVarStatement = function parseVarStatement(node, kind) {
- this.next();
- this.parseVar(node, false, kind);
- this.semicolon();
- return this.finishNode(node, "VariableDeclaration");
- };
- _proto.parseWhileStatement = function parseWhileStatement(node) {
- var _this3 = this;
- this.next();
- node.test = this.parseHeaderExpression();
- this.state.labels.push(loopLabel);
- node.body = this.withTopicForbiddingContext(function () {
- return _this3.parseStatement("while");
- });
- this.state.labels.pop();
- return this.finishNode(node, "WhileStatement");
- };
- _proto.parseWithStatement = function parseWithStatement(node) {
- var _this4 = this;
- if (this.state.strict) {
- this.raise(this.state.start, "'with' in strict mode");
- }
- this.next();
- node.object = this.parseHeaderExpression();
- node.body = this.withTopicForbiddingContext(function () {
- return _this4.parseStatement("with");
- });
- return this.finishNode(node, "WithStatement");
- };
- _proto.parseEmptyStatement = function parseEmptyStatement(node) {
- this.next();
- return this.finishNode(node, "EmptyStatement");
- };
- _proto.parseLabeledStatement = function parseLabeledStatement(node, maybeName, expr, context) {
- for (var _i4 = 0, _this$state$labels2 = this.state.labels; _i4 < _this$state$labels2.length; _i4++) {
- var label = _this$state$labels2[_i4];
- if (label.name === maybeName) {
- this.raise(expr.start, "Label '" + maybeName + "' is already declared");
- }
- }
- var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
- for (var i = this.state.labels.length - 1; i >= 0; i--) {
- var _label = this.state.labels[i];
- if (_label.statementStart === node.start) {
- _label.statementStart = this.state.start;
- _label.kind = kind;
- } else {
- break;
- }
- }
- this.state.labels.push({
- name: maybeName,
- kind: kind,
- statementStart: this.state.start
- });
- node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
- this.state.labels.pop();
- node.label = expr;
- return this.finishNode(node, "LabeledStatement");
- };
- _proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
- node.expression = expr;
- this.semicolon();
- return this.finishNode(node, "ExpressionStatement");
- };
- _proto.parseBlock = function parseBlock(allowDirectives, createNewLexicalScope) {
- if (allowDirectives === void 0) {
- allowDirectives = false;
- }
- if (createNewLexicalScope === void 0) {
- createNewLexicalScope = true;
- }
- var node = this.startNode();
- this.expect(types.braceL);
- if (createNewLexicalScope) {
- this.scope.enter(SCOPE_OTHER);
- }
- this.parseBlockBody(node, allowDirectives, false, types.braceR);
- if (createNewLexicalScope) {
- this.scope.exit();
- }
- return this.finishNode(node, "BlockStatement");
- };
- _proto.isValidDirective = function isValidDirective(stmt) {
- return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
- };
- _proto.parseBlockBody = function parseBlockBody(node, allowDirectives, topLevel, end) {
- var body = node.body = [];
- var directives = node.directives = [];
- this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end);
- };
- _proto.parseBlockOrModuleBlockBody = function parseBlockOrModuleBlockBody(body, directives, topLevel, end) {
- var parsedNonDirective = false;
- var oldStrict;
- var octalPosition;
- while (!this.eat(end)) {
- if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
- octalPosition = this.state.octalPosition;
- }
- var stmt = this.parseStatement(null, topLevel);
- if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
- var directive = this.stmtToDirective(stmt);
- directives.push(directive);
- if (oldStrict === undefined && directive.value.value === "use strict") {
- oldStrict = this.state.strict;
- this.setStrict(true);
- if (octalPosition) {
- this.raise(octalPosition, "Octal literal in strict mode");
- }
- }
- continue;
- }
- parsedNonDirective = true;
- body.push(stmt);
- }
- if (oldStrict === false) {
- this.setStrict(false);
- }
- };
- _proto.parseFor = function parseFor(node, init) {
- var _this5 = this;
- node.init = init;
- this.expect(types.semi);
- node.test = this.match(types.semi) ? null : this.parseExpression();
- this.expect(types.semi);
- node.update = this.match(types.parenR) ? null : this.parseExpression();
- this.expect(types.parenR);
- node.body = this.withTopicForbiddingContext(function () {
- return _this5.parseStatement("for");
- });
- this.scope.exit();
- this.state.labels.pop();
- return this.finishNode(node, "ForStatement");
- };
- _proto.parseForIn = function parseForIn(node, init, awaitAt) {
- var _this6 = this;
- var isForIn = this.match(types._in);
- this.next();
- if (isForIn) {
- if (awaitAt > -1) this.unexpected(awaitAt);
- } else {
- node["await"] = awaitAt > -1;
- }
- if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.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");
- } else if (init.type === "AssignmentPattern") {
- this.raise(init.start, "Invalid left-hand side in for-loop");
- }
- node.left = init;
- node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
- this.expect(types.parenR);
- node.body = this.withTopicForbiddingContext(function () {
- return _this6.parseStatement("for");
- });
- this.scope.exit();
- this.state.labels.pop();
- return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
- };
- _proto.parseVar = function parseVar(node, isFor, kind) {
- var declarations = node.declarations = [];
- var isTypescript = this.hasPlugin("typescript");
- 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.match(types._in) || this.isContextual("of"))) {
- if (!isTypescript) {
- this.unexpected();
- }
- } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
- this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
- }
- decl.init = null;
- }
- declarations.push(this.finishNode(decl, "VariableDeclarator"));
- if (!this.eat(types.comma)) break;
- }
- return node;
- };
- _proto.parseVarId = function parseVarId(decl, kind) {
- decl.id = this.parseBindingAtom();
- this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration", kind !== "var");
- };
- _proto.parseFunction = function parseFunction(node, statement, isAsync) {
- var _this7 = this;
- if (statement === void 0) {
- statement = FUNC_NO_FLAGS;
- }
- if (isAsync === void 0) {
- isAsync = false;
- }
- var isStatement = statement & FUNC_STATEMENT;
- var isHangingStatement = statement & FUNC_HANGING_STATEMENT;
- var requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
- this.initFunction(node, isAsync);
- if (this.match(types.star) && isHangingStatement) {
- this.raise(this.state.start, "Generators can only be declared at the top level or inside a block");
- }
- node.generator = this.eat(types.star);
- if (isStatement) {
- node.id = this.parseFunctionId(requireId);
- }
- var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
- var oldYieldPos = this.state.yieldPos;
- var oldAwaitPos = this.state.awaitPos;
- this.state.maybeInArrowParameters = false;
- this.state.yieldPos = -1;
- this.state.awaitPos = -1;
- this.scope.enter(functionFlags(node.async, node.generator));
- if (!isStatement) {
- node.id = this.parseFunctionId();
- }
- this.parseFunctionParams(node);
- this.withTopicForbiddingContext(function () {
- _this7.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
- });
- this.scope.exit();
- if (isStatement && !isHangingStatement) {
- this.registerFunctionStatementId(node);
- }
- this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
- this.state.yieldPos = oldYieldPos;
- this.state.awaitPos = oldAwaitPos;
- return node;
- };
- _proto.parseFunctionId = function parseFunctionId(requireId) {
- return requireId || this.match(types.name) ? this.parseIdentifier() : null;
- };
- _proto.parseFunctionParams = function parseFunctionParams(node, allowModifiers) {
- var oldInParameters = this.state.inParameters;
- this.state.inParameters = true;
- this.expect(types.parenL);
- node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers);
- this.state.inParameters = oldInParameters;
- this.checkYieldAwaitInDefaultParams();
- };
- _proto.registerFunctionStatementId = function registerFunctionStatementId(node) {
- if (!node.id) return;
- this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);
- };
- _proto.parseClass = function parseClass(node, isStatement, optionalId) {
- this.next();
- this.takeDecorators(node);
- var oldStrict = this.state.strict;
- this.state.strict = true;
- this.parseClassId(node, isStatement, optionalId);
- this.parseClassSuper(node);
- node.body = this.parseClassBody(!!node.superClass);
- this.state.strict = oldStrict;
- return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
- };
- _proto.isClassProperty = function isClassProperty() {
- return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR);
- };
- _proto.isClassMethod = function isClassMethod() {
- return this.match(types.parenL);
- };
- _proto.isNonstaticConstructor = function isNonstaticConstructor(method) {
- return !method.computed && !method["static"] && (method.key.name === "constructor" || method.key.value === "constructor");
- };
- _proto.parseClassBody = function parseClassBody(constructorAllowsSuper) {
- var _this8 = this;
- this.classScope.enter();
- var state = {
- hadConstructor: false
- };
- var decorators = [];
- var classBody = this.startNode();
- classBody.body = [];
- this.expect(types.braceL);
- this.withTopicForbiddingContext(function () {
- while (!_this8.eat(types.braceR)) {
- if (_this8.eat(types.semi)) {
- if (decorators.length > 0) {
- throw _this8.raise(_this8.state.lastTokEnd, "Decorators must not be followed by a semicolon");
- }
- continue;
- }
- if (_this8.match(types.at)) {
- decorators.push(_this8.parseDecorator());
- continue;
- }
- var member = _this8.startNode();
- if (decorators.length) {
- member.decorators = decorators;
- _this8.resetStartLocationFromNode(member, decorators[0]);
- decorators = [];
- }
- _this8.parseClassMember(classBody, member, state, constructorAllowsSuper);
- if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
- _this8.raise(member.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?");
- }
- }
- });
- if (decorators.length) {
- throw this.raise(this.state.start, "You have trailing decorators with no method");
- }
- this.classScope.exit();
- return this.finishNode(classBody, "ClassBody");
- };
- _proto.parseClassMember = function parseClassMember(classBody, member, state, constructorAllowsSuper) {
- var isStatic = false;
- var containsEsc = this.state.containsEsc;
- if (this.match(types.name) && this.state.value === "static") {
- var key = this.parseIdentifier(true);
- if (this.isClassMethod()) {
- var method = member;
- method.kind = "method";
- method.computed = false;
- method.key = key;
- method["static"] = false;
- this.pushClassMethod(classBody, method, false, false, false, false);
- return;
- } else if (this.isClassProperty()) {
- var prop = member;
- prop.computed = false;
- prop.key = key;
- prop["static"] = false;
- classBody.body.push(this.parseClassProperty(prop));
- return;
- } else if (containsEsc) {
- throw this.unexpected();
- }
- isStatic = true;
- }
- this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
- };
- _proto.parseClassMemberWithIsStatic = function parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
- var publicMethod = member;
- var privateMethod = member;
- var publicProp = member;
- var privateProp = member;
- var method = publicMethod;
- var publicMember = publicMethod;
- member["static"] = isStatic;
- if (this.eat(types.star)) {
- method.kind = "method";
- this.parseClassPropertyName(method);
- if (method.key.type === "PrivateName") {
- this.pushClassPrivateMethod(classBody, privateMethod, true, false);
- return;
- }
- if (this.isNonstaticConstructor(publicMethod)) {
- this.raise(publicMethod.key.start, "Constructor can't be a generator");
- }
- this.pushClassMethod(classBody, publicMethod, true, false, false, false);
- return;
- }
- var containsEsc = this.state.containsEsc;
- var key = this.parseClassPropertyName(member);
- var isPrivate = key.type === "PrivateName";
- var isSimple = key.type === "Identifier";
- var maybeQuestionTokenStart = this.state.start;
- this.parsePostMemberNameModifiers(publicMember);
- if (this.isClassMethod()) {
- method.kind = "method";
- if (isPrivate) {
- this.pushClassPrivateMethod(classBody, privateMethod, false, false);
- return;
- }
- var isConstructor = this.isNonstaticConstructor(publicMethod);
- var allowsDirectSuper = false;
- if (isConstructor) {
- publicMethod.kind = "constructor";
- if (state.hadConstructor && !this.hasPlugin("typescript")) {
- this.raise(key.start, "Duplicate constructor in the same class");
- }
- state.hadConstructor = true;
- allowsDirectSuper = constructorAllowsSuper;
- }
- this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
- } else if (this.isClassProperty()) {
- if (isPrivate) {
- this.pushClassPrivateProperty(classBody, privateProp);
- } else {
- this.pushClassProperty(classBody, publicProp);
- }
- } else if (isSimple && key.name === "async" && !containsEsc && !this.isLineTerminator()) {
- var isGenerator = this.eat(types.star);
- if (publicMember.optional) {
- this.unexpected(maybeQuestionTokenStart);
- }
- method.kind = "method";
- this.parseClassPropertyName(method);
- this.parsePostMemberNameModifiers(publicMember);
- if (method.key.type === "PrivateName") {
- this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
- } else {
- if (this.isNonstaticConstructor(publicMethod)) {
- this.raise(publicMethod.key.start, "Constructor can't be an async function");
- }
- this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
- }
- } else if (isSimple && (key.name === "get" || key.name === "set") && !containsEsc && !(this.match(types.star) && this.isLineTerminator())) {
- method.kind = key.name;
- this.parseClassPropertyName(publicMethod);
- if (method.key.type === "PrivateName") {
- this.pushClassPrivateMethod(classBody, privateMethod, false, false);
- } else {
- if (this.isNonstaticConstructor(publicMethod)) {
- this.raise(publicMethod.key.start, "Constructor can't have get/set modifier");
- }
- this.pushClassMethod(classBody, publicMethod, false, false, false, false);
- }
- this.checkGetterSetterParams(publicMethod);
- } else if (this.isLineTerminator()) {
- if (isPrivate) {
- this.pushClassPrivateProperty(classBody, privateProp);
- } else {
- this.pushClassProperty(classBody, publicProp);
- }
- } else {
- this.unexpected();
- }
- };
- _proto.parseClassPropertyName = function parseClassPropertyName(member) {
- var key = this.parsePropertyName(member, true);
- if (!member.computed && member["static"] && (key.name === "prototype" || key.value === "prototype")) {
- this.raise(key.start, "Classes may not have static property named prototype");
- }
- if (key.type === "PrivateName" && key.id.name === "constructor") {
- this.raise(key.start, "Classes may not have a private field named '#constructor'");
- }
- return key;
- };
- _proto.pushClassProperty = function pushClassProperty(classBody, prop) {
- if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
- this.raise(prop.key.start, "Classes may not have a field named 'constructor'");
- }
- classBody.body.push(this.parseClassProperty(prop));
- };
- _proto.pushClassPrivateProperty = function pushClassPrivateProperty(classBody, prop) {
- this.expectPlugin("classPrivateProperties", prop.key.start);
- var node = this.parseClassPrivateProperty(prop);
- classBody.body.push(node);
- this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start);
- };
- _proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
- classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
- };
- _proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
- this.expectPlugin("classPrivateMethods", method.key.start);
- var node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
- classBody.body.push(node);
- var kind = node.kind === "get" ? node["static"] ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node["static"] ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
- this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start);
- };
- _proto.parsePostMemberNameModifiers = function parsePostMemberNameModifiers(methodOrProp) {};
- _proto.parseAccessModifier = function parseAccessModifier() {
- return undefined;
- };
- _proto.parseClassPrivateProperty = function parseClassPrivateProperty(node) {
- this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
- node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null;
- this.semicolon();
- this.scope.exit();
- return this.finishNode(node, "ClassPrivateProperty");
- };
- _proto.parseClassProperty = function parseClassProperty(node) {
- if (!node.typeAnnotation) {
- this.expectPlugin("classProperties");
- }
- this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
- if (this.match(types.eq)) {
- this.expectPlugin("classProperties");
- this.next();
- node.value = this.parseMaybeAssign();
- } else {
- node.value = null;
- }
- this.semicolon();
- this.scope.exit();
- return this.finishNode(node, "ClassProperty");
- };
- _proto.parseClassId = function parseClassId(node, isStatement, optionalId, bindingType) {
- if (bindingType === void 0) {
- bindingType = BIND_CLASS;
- }
- if (this.match(types.name)) {
- node.id = this.parseIdentifier();
- if (isStatement) {
- this.checkLVal(node.id, bindingType, undefined, "class name");
- }
- } else {
- if (optionalId || !isStatement) {
- node.id = null;
- } else {
- this.unexpected(null, "A class name is required");
- }
- }
- };
- _proto.parseClassSuper = function parseClassSuper(node) {
- node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
- };
- _proto.parseExport = function parseExport(node) {
- var hasDefault = this.maybeParseExportDefaultSpecifier(node);
- var parseAfterDefault = !hasDefault || this.eat(types.comma);
- var hasStar = parseAfterDefault && this.eatExportStar(node);
- var hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
- var parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types.comma));
- var isFromRequired = hasDefault || hasStar;
- if (hasStar && !hasNamespace) {
- if (hasDefault) this.unexpected();
- this.parseExportFrom(node, true);
- return this.finishNode(node, "ExportAllDeclaration");
- }
- var hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
- if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
- throw this.unexpected(null, types.braceL);
- }
- var hasDeclaration;
- if (isFromRequired || hasSpecifiers) {
- hasDeclaration = false;
- this.parseExportFrom(node, isFromRequired);
- } else {
- hasDeclaration = this.maybeParseExportDeclaration(node);
- }
- if (isFromRequired || hasSpecifiers || hasDeclaration) {
- this.checkExport(node, true, false, !!node.source);
- return this.finishNode(node, "ExportNamedDeclaration");
- }
- if (this.eat(types._default)) {
- node.declaration = this.parseExportDefaultExpression();
- this.checkExport(node, true, true);
- return this.finishNode(node, "ExportDefaultDeclaration");
- }
- throw this.unexpected(null, types.braceL);
- };
- _proto.eatExportStar = function eatExportStar(node) {
- return this.eat(types.star);
- };
- _proto.maybeParseExportDefaultSpecifier = function maybeParseExportDefaultSpecifier(node) {
- if (this.isExportDefaultSpecifier()) {
- this.expectPlugin("exportDefaultFrom");
- var specifier = this.startNode();
- specifier.exported = this.parseIdentifier(true);
- node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
- return true;
- }
- return false;
- };
- _proto.maybeParseExportNamespaceSpecifier = function maybeParseExportNamespaceSpecifier(node) {
- if (this.isContextual("as")) {
- if (!node.specifiers) node.specifiers = [];
- var specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
- this.next();
- specifier.exported = this.parseIdentifier(true);
- node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
- return true;
- }
- return false;
- };
- _proto.maybeParseExportNamedSpecifiers = function maybeParseExportNamedSpecifiers(node) {
- if (this.match(types.braceL)) {
- var _node$specifiers;
- if (!node.specifiers) node.specifiers = [];
- (_node$specifiers = node.specifiers).push.apply(_node$specifiers, this.parseExportSpecifiers());
- node.source = null;
- node.declaration = null;
- return true;
- }
- return false;
- };
- _proto.maybeParseExportDeclaration = function maybeParseExportDeclaration(node) {
- if (this.shouldParseExportDeclaration()) {
- if (this.isContextual("async")) {
- var next = this.nextTokenStart();
- if (!this.isUnparsedContextual(next, "function")) {
- this.unexpected(next, "Unexpected token, expected \"function\"");
- }
- }
- node.specifiers = [];
- node.source = null;
- node.declaration = this.parseExportDeclaration(node);
- return true;
- }
- return false;
- };
- _proto.isAsyncFunction = function isAsyncFunction() {
- if (!this.isContextual("async")) return false;
- var next = this.nextTokenStart();
- return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
- };
- _proto.parseExportDefaultExpression = function parseExportDefaultExpression() {
- var expr = this.startNode();
- var isAsync = this.isAsyncFunction();
- if (this.match(types._function) || isAsync) {
- this.next();
- if (isAsync) {
- this.next();
- }
- return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
- } else if (this.match(types._class)) {
- return this.parseClass(expr, true, true);
- } else if (this.match(types.at)) {
- if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
- this.raise(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
- }
- this.parseDecorators(false);
- return this.parseClass(expr, true, true);
- } else if (this.match(types._const) || this.match(types._var) || this.isLet()) {
- throw this.raise(this.state.start, "Only expressions, functions or classes are allowed as the `default` export.");
- } else {
- var res = this.parseMaybeAssign();
- this.semicolon();
- return res;
- }
- };
- _proto.parseExportDeclaration = function parseExportDeclaration(node) {
- return this.parseStatement(null);
- };
- _proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
- if (this.match(types.name)) {
- return this.state.value !== "async" && this.state.value !== "let";
- }
- if (!this.match(types._default)) {
- return false;
- }
- var next = this.nextTokenStart();
- return this.input.charCodeAt(next) === 44 || this.isUnparsedContextual(next, "from");
- };
- _proto.parseExportFrom = function parseExportFrom(node, expect) {
- if (this.eatContextual("from")) {
- node.source = this.parseImportSource();
- this.checkExport(node);
- } else {
- if (expect) {
- this.unexpected();
- } else {
- node.source = null;
- }
- }
- this.semicolon();
- };
- _proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
- if (this.match(types.at)) {
- this.expectOnePlugin(["decorators", "decorators-legacy"]);
- if (this.hasPlugin("decorators")) {
- if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
- this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
- } else {
- return true;
- }
- }
- }
- return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isLet() || this.isAsyncFunction();
- };
- _proto.checkExport = function checkExport(node, checkNames, isDefault, isFrom) {
- if (checkNames) {
- if (isDefault) {
- this.checkDuplicateExports(node, "default");
- } else if (node.specifiers && node.specifiers.length) {
- for (var _i6 = 0, _node$specifiers3 = node.specifiers; _i6 < _node$specifiers3.length; _i6++) {
- var specifier = _node$specifiers3[_i6];
- this.checkDuplicateExports(specifier, specifier.exported.name);
- if (!isFrom && specifier.local) {
- this.checkReservedWord(specifier.local.name, specifier.local.start, true, false);
- this.scope.checkLocalExport(specifier.local);
- }
- }
- } else if (node.declaration) {
- if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
- var id = node.declaration.id;
- if (!id) throw new Error("Assertion failure");
- this.checkDuplicateExports(node, id.name);
- } else if (node.declaration.type === "VariableDeclaration") {
- for (var _i8 = 0, _node$declaration$dec2 = node.declaration.declarations; _i8 < _node$declaration$dec2.length; _i8++) {
- var declaration = _node$declaration$dec2[_i8];
- this.checkDeclaration(declaration.id);
- }
- }
- }
- }
- var currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
- if (currentContextDecorators.length) {
- var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
- if (!node.declaration || !isClass) {
- throw this.raise(node.start, "You can only use decorators on an export when exporting a class");
- }
- this.takeDecorators(node.declaration);
- }
- };
- _proto.checkDeclaration = function checkDeclaration(node) {
- if (node.type === "Identifier") {
- this.checkDuplicateExports(node, node.name);
- } else if (node.type === "ObjectPattern") {
- for (var _i10 = 0, _node$properties2 = node.properties; _i10 < _node$properties2.length; _i10++) {
- var prop = _node$properties2[_i10];
- this.checkDeclaration(prop);
- }
- } else if (node.type === "ArrayPattern") {
- for (var _i12 = 0, _node$elements2 = node.elements; _i12 < _node$elements2.length; _i12++) {
- var elem = _node$elements2[_i12];
- if (elem) {
- this.checkDeclaration(elem);
- }
- }
- } else if (node.type === "ObjectProperty") {
- this.checkDeclaration(node.value);
- } else if (node.type === "RestElement") {
- this.checkDeclaration(node.argument);
- } else if (node.type === "AssignmentPattern") {
- this.checkDeclaration(node.left);
- }
- };
- _proto.checkDuplicateExports = function checkDuplicateExports(node, name) {
- if (this.state.exportedIdentifiers.indexOf(name) > -1) {
- this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique.");
- }
- this.state.exportedIdentifiers.push(name);
- };
- _proto.parseExportSpecifiers = function parseExportSpecifiers() {
- var nodes = [];
- var first = true;
- this.expect(types.braceL);
- while (!this.eat(types.braceR)) {
- if (first) {
- first = false;
- } else {
- this.expect(types.comma);
- if (this.eat(types.braceR)) break;
- }
- var node = this.startNode();
- node.local = this.parseIdentifier(true);
- node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
- nodes.push(this.finishNode(node, "ExportSpecifier"));
- }
- return nodes;
- };
- _proto.parseImport = function parseImport(node) {
- node.specifiers = [];
- if (!this.match(types.string)) {
- var hasDefault = this.maybeParseDefaultImportSpecifier(node);
- var parseNext = !hasDefault || this.eat(types.comma);
- var hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
- if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
- this.expectContextual("from");
- }
- node.source = this.parseImportSource();
- this.semicolon();
- return this.finishNode(node, "ImportDeclaration");
- };
- _proto.parseImportSource = function parseImportSource() {
- if (!this.match(types.string)) this.unexpected();
- return this.parseExprAtom();
- };
- _proto.shouldParseDefaultImport = function shouldParseDefaultImport(node) {
- return this.match(types.name);
- };
- _proto.parseImportSpecifierLocal = function parseImportSpecifierLocal(node, specifier, type, contextDescription) {
- specifier.local = this.parseIdentifier();
- this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);
- node.specifiers.push(this.finishNode(specifier, type));
- };
- _proto.maybeParseDefaultImportSpecifier = function maybeParseDefaultImportSpecifier(node) {
- if (this.shouldParseDefaultImport(node)) {
- this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
- return true;
- }
- return false;
- };
- _proto.maybeParseStarImportSpecifier = function maybeParseStarImportSpecifier(node) {
- if (this.match(types.star)) {
- var specifier = this.startNode();
- this.next();
- this.expectContextual("as");
- this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
- return true;
- }
- return false;
- };
- _proto.parseNamedImportSpecifiers = function parseNamedImportSpecifiers(node) {
- var first = true;
- this.expect(types.braceL);
- while (!this.eat(types.braceR)) {
- if (first) {
- first = false;
- } else {
- if (this.eat(types.colon)) {
- throw this.raise(this.state.start, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import.");
- }
- this.expect(types.comma);
- if (this.eat(types.braceR)) break;
- }
- this.parseImportSpecifier(node);
- }
- };
- _proto.parseImportSpecifier = function parseImportSpecifier(node) {
- var specifier = this.startNode();
- specifier.imported = this.parseIdentifier(true);
- if (this.eatContextual("as")) {
- specifier.local = this.parseIdentifier();
- } else {
- this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
- specifier.local = specifier.imported.__clone();
- }
- this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier");
- node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
- };
- return StatementParser;
- }(ExpressionParser);
- var ClassScope = function ClassScope() {
- this.privateNames = new Set();
- this.loneAccessors = new Map();
- this.undefinedPrivateNames = new Map();
- };
- var ClassScopeHandler = function () {
- function ClassScopeHandler(raise) {
- this.stack = [];
- this.undefinedPrivateNames = new Map();
- this.raise = raise;
- }
- var _proto = ClassScopeHandler.prototype;
- _proto.current = function current() {
- return this.stack[this.stack.length - 1];
- };
- _proto.enter = function enter() {
- this.stack.push(new ClassScope());
- };
- _proto.exit = function exit() {
- var oldClassScope = this.stack.pop();
- var current = this.current();
- for (var _i2 = 0, _Array$from2 = Array.from(oldClassScope.undefinedPrivateNames); _i2 < _Array$from2.length; _i2++) {
- var _Array$from2$_i = _Array$from2[_i2],
- name = _Array$from2$_i[0],
- pos = _Array$from2$_i[1];
- if (current) {
- if (!current.undefinedPrivateNames.has(name)) {
- current.undefinedPrivateNames.set(name, pos);
- }
- } else {
- this.raiseUndeclaredPrivateName(name, pos);
- }
- }
- };
- _proto.declarePrivateName = function declarePrivateName(name, elementType, pos) {
- var classScope = this.current();
- var redefined = classScope.privateNames.has(name);
- if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
- var accessor = redefined && classScope.loneAccessors.get(name);
- if (accessor) {
- var oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
- var newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
- var oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
- var newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
- redefined = oldKind === newKind || oldStatic !== newStatic;
- if (!redefined) classScope.loneAccessors["delete"](name);
- } else if (!redefined) {
- classScope.loneAccessors.set(name, elementType);
- }
- }
- if (redefined) {
- this.raise(pos, "Duplicate private name #" + name);
- }
- classScope.privateNames.add(name);
- classScope.undefinedPrivateNames["delete"](name);
- };
- _proto.usePrivateName = function usePrivateName(name, pos) {
- var classScope;
- for (var _i4 = 0, _this$stack2 = this.stack; _i4 < _this$stack2.length; _i4++) {
- classScope = _this$stack2[_i4];
- if (classScope.privateNames.has(name)) return;
- }
- if (classScope) {
- classScope.undefinedPrivateNames.set(name, pos);
- } else {
- this.raiseUndeclaredPrivateName(name, pos);
- }
- };
- _proto.raiseUndeclaredPrivateName = function raiseUndeclaredPrivateName(name, pos) {
- this.raise(pos, "Private name #" + name + " is not defined");
- };
- return ClassScopeHandler;
- }();
- var Parser = function (_StatementParser) {
- _inheritsLoose(Parser, _StatementParser);
- function Parser(options, input) {
- var _this;
- options = getOptions(options);
- _this = _StatementParser.call(this, options, input) || this;
- var ScopeHandler = _this.getScopeHandler();
- _this.options = options;
- _this.inModule = _this.options.sourceType === "module";
- _this.scope = new ScopeHandler(_this.raise.bind(_assertThisInitialized(_this)), _this.inModule);
- _this.classScope = new ClassScopeHandler(_this.raise.bind(_assertThisInitialized(_this)));
- _this.plugins = pluginsMap(_this.options.plugins);
- _this.filename = options.sourceFilename;
- return _this;
- }
- var _proto = Parser.prototype;
- _proto.getScopeHandler = function getScopeHandler() {
- return ScopeHandler;
- };
- _proto.parse = function parse() {
- var scopeFlags = SCOPE_PROGRAM;
- if (this.hasPlugin("topLevelAwait") && this.inModule) {
- scopeFlags |= SCOPE_ASYNC;
- }
- this.scope.enter(scopeFlags);
- var file = this.startNode();
- var program = this.startNode();
- this.nextToken();
- file.errors = null;
- this.parseTopLevel(file, program);
- file.errors = this.state.errors;
- return file;
- };
- return Parser;
- }(StatementParser);
- function pluginsMap(plugins) {
- var pluginMap = new Map();
- for (var _i2 = 0; _i2 < plugins.length; _i2++) {
- var plugin = plugins[_i2];
- var _ref = Array.isArray(plugin) ? plugin : [plugin, {}],
- name = _ref[0],
- options = _ref[1];
- if (!pluginMap.has(name)) pluginMap.set(name, options || {});
- }
- return pluginMap;
- }
- function parse$1(input, options) {
- if (options && options.sourceType === "unambiguous") {
- options = Object.assign({}, options);
- try {
- options.sourceType = "module";
- var parser = getParser(options, input);
- var ast = parser.parse();
- if (parser.sawUnambiguousESM) {
- return ast;
- }
- if (parser.ambiguousScriptDifferentAst) {
- try {
- options.sourceType = "script";
- return getParser(options, input).parse();
- } catch (_unused) {}
- } else {
- ast.program.sourceType = "script";
- }
- return ast;
- } catch (moduleError) {
- try {
- options.sourceType = "script";
- return getParser(options, input).parse();
- } catch (_unused2) {}
- throw moduleError;
- }
- } else {
- return getParser(options, input).parse();
- }
- }
- function getParser(options, input) {
- var cls = Parser;
- if (options && options.plugins) {
- validatePlugins(options.plugins);
- cls = getParserClass(options.plugins);
- }
- return new cls(options, input);
- }
- var parserClassCache = {};
- function getParserClass(pluginsFromOptions) {
- var pluginList = mixinPluginNames.filter(function (name) {
- return hasPlugin(pluginsFromOptions, name);
- });
- var key = pluginList.join("/");
- var cls = parserClassCache[key];
- if (!cls) {
- cls = Parser;
- for (var _i2 = 0; _i2 < pluginList.length; _i2++) {
- var plugin = pluginList[_i2];
- cls = mixinPlugins[plugin](cls);
- }
- parserClassCache[key] = cls;
- }
- return cls;
- }
- var hoistVariablesVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- VariableDeclaration: function VariableDeclaration(path) {
- if (path.node.kind !== "var") return;
- var bindings = path.getBindingIdentifiers();
- for (var _i = 0, _Object$keys = Object.keys(bindings); _i < _Object$keys.length; _i++) {
- var key = _Object$keys[_i];
- path.scope.push({
- id: bindings[key]
- });
- }
- var exprs = [];
- for (var _i2 = 0, _arr = path.node.declarations; _i2 < _arr.length; _i2++) {
- var declar = _arr[_i2];
- if (declar.init) {
- exprs.push(ExpressionStatement(AssignmentExpression("=", declar.id, declar.init)));
- }
- }
- path.replaceWithMultiple(exprs);
- }
- };
- function replaceWithMultiple(nodes) {
- this.resync();
- nodes = this._verifyNodeList(nodes);
- inheritLeadingComments(nodes[0], this.node);
- inheritTrailingComments(nodes[nodes.length - 1], this.node);
- this.node = this.container[this.key] = null;
- var paths = this.insertAfter(nodes);
- if (this.node) {
- this.requeue();
- } else {
- this.remove();
- }
- return paths;
- }
- function replaceWithSourceString(replacement) {
- this.resync();
- try {
- replacement = "(" + replacement + ")";
- replacement = parse$1(replacement);
- } catch (err) {
- var loc = err.loc;
- if (loc) {
- err.message += " - make sure this is an expression.\n" + codeFrameColumns(replacement, {
- start: {
- line: loc.line,
- column: loc.column + 1
- }
- });
- err.code = "BABEL_REPLACE_SOURCE_ERROR";
- }
- throw err;
- }
- replacement = replacement.program.body[0].expression;
- traverse$1.removeProperties(replacement);
- return this.replaceWith(replacement);
- }
- function replaceWith(replacement) {
- this.resync();
- if (this.removed) {
- throw new Error("You can't replace this node, we've already removed it");
- }
- if (replacement instanceof NodePath) {
- replacement = replacement.node;
- }
- if (!replacement) {
- throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
- }
- if (this.node === replacement) {
- return [this];
- }
- if (this.isProgram() && !isProgram(replacement)) {
- throw new Error("You can only replace a Program root node with another Program node");
- }
- if (Array.isArray(replacement)) {
- throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
- }
- if (typeof replacement === "string") {
- throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
- }
- var nodePath = "";
- if (this.isNodeType("Statement") && isExpression(replacement)) {
- if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) {
- replacement = ExpressionStatement(replacement);
- nodePath = "expression";
- }
- }
- if (this.isNodeType("Expression") && isStatement(replacement)) {
- if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
- return this.replaceExpressionWithStatements([replacement]);
- }
- }
- var oldNode = this.node;
- if (oldNode) {
- inheritsComments(replacement, oldNode);
- removeComments(oldNode);
- }
- this._replaceWith(replacement);
- this.type = replacement.type;
- this.setScope();
- this.requeue();
- return [nodePath ? this.get(nodePath) : this];
- }
- function _replaceWith(node) {
- if (!this.container) {
- throw new ReferenceError("Container is falsy");
- }
- if (this.inList) {
- validate(this.parent, this.key, [node]);
- } else {
- validate(this.parent, this.key, node);
- }
- this.debug("Replace with " + (node && node.type));
- this.node = this.container[this.key] = node;
- }
- function replaceExpressionWithStatements(nodes) {
- this.resync();
- var toSequenceExpression$1 = toSequenceExpression(nodes, this.scope);
- if (toSequenceExpression$1) {
- return this.replaceWith(toSequenceExpression$1)[0].get("expressions");
- }
- var functionParent = this.getFunctionParent();
- var isParentAsync = functionParent && functionParent.is("async");
- var container = ArrowFunctionExpression([], BlockStatement(nodes));
- this.replaceWith(CallExpression(container, []));
- this.traverse(hoistVariablesVisitor);
- var completionRecords = this.get("callee").getCompletionRecords();
- for (var _iterator = completionRecords, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i3 >= _iterator.length) break;
- _ref = _iterator[_i3++];
- } else {
- _i3 = _iterator.next();
- if (_i3.done) break;
- _ref = _i3.value;
- }
- var path = _ref;
- if (!path.isExpressionStatement()) continue;
- var loop = path.findParent(function (path) {
- return path.isLoop();
- });
- if (loop) {
- var uid = loop.getData("expressionReplacementReturnUid");
- if (!uid) {
- var _callee = this.get("callee");
- uid = _callee.scope.generateDeclaredUidIdentifier("ret");
- _callee.get("body").pushContainer("body", ReturnStatement(cloneNode(uid)));
- loop.setData("expressionReplacementReturnUid", uid);
- } else {
- uid = Identifier(uid.name);
- }
- path.get("expression").replaceWith(AssignmentExpression("=", cloneNode(uid), path.node.expression));
- } else {
- path.replaceWith(ReturnStatement(path.node.expression));
- }
- }
- var callee = this.get("callee");
- callee.arrowFunctionToExpression();
- if (isParentAsync && traverse$1.hasType(this.get("callee.body").node, "AwaitExpression", FUNCTION_TYPES)) {
- callee.set("async", true);
- this.replaceWith(AwaitExpression(this.node));
- }
- return callee.get("body.body");
- }
- function replaceInline(nodes) {
- this.resync();
- if (Array.isArray(nodes)) {
- if (Array.isArray(this.container)) {
- nodes = this._verifyNodeList(nodes);
- var paths = this._containerInsertAfter(nodes);
- this.remove();
- return paths;
- } else {
- return this.replaceWithMultiple(nodes);
- }
- } else {
- return this.replaceWith(nodes);
- }
- }
- var NodePath_replacement = /*#__PURE__*/Object.freeze({
- __proto__: null,
- replaceWithMultiple: replaceWithMultiple,
- replaceWithSourceString: replaceWithSourceString,
- replaceWith: replaceWith,
- _replaceWith: _replaceWith,
- replaceExpressionWithStatements: replaceExpressionWithStatements,
- replaceInline: replaceInline
- });
- var VALID_CALLEES = ["String", "Number", "Math"];
- var INVALID_METHODS = ["random"];
- function evaluateTruthy() {
- var res = this.evaluate();
- if (res.confident) return !!res.value;
- }
- function deopt(path, state) {
- if (!state.confident) return;
- state.deoptPath = path;
- state.confident = false;
- }
- function evaluateCached(path, state) {
- var node = path.node;
- var seen = state.seen;
- if (seen.has(node)) {
- var existing = seen.get(node);
- if (existing.resolved) {
- return existing.value;
- } else {
- deopt(path, state);
- return;
- }
- } else {
- var item = {
- resolved: false
- };
- seen.set(node, item);
- var val = _evaluate(path, state);
- if (state.confident) {
- item.resolved = true;
- item.value = val;
- }
- return val;
- }
- }
- function _evaluate(path, state) {
- if (!state.confident) return;
- var node = path.node;
- if (path.isSequenceExpression()) {
- var exprs = path.get("expressions");
- return evaluateCached(exprs[exprs.length - 1], state);
- }
- if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
- return node.value;
- }
- if (path.isNullLiteral()) {
- return null;
- }
- if (path.isTemplateLiteral()) {
- return evaluateQuasis(path, node.quasis, state);
- }
- if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) {
- var object = path.get("tag.object");
- var name = object.node.name;
- var property = path.get("tag.property");
- if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name, true) && property.isIdentifier && property.node.name === "raw") {
- return evaluateQuasis(path, node.quasi.quasis, state, true);
- }
- }
- if (path.isConditionalExpression()) {
- var testResult = evaluateCached(path.get("test"), state);
- if (!state.confident) return;
- if (testResult) {
- return evaluateCached(path.get("consequent"), state);
- } else {
- return evaluateCached(path.get("alternate"), state);
- }
- }
- if (path.isExpressionWrapper()) {
- return evaluateCached(path.get("expression"), state);
- }
- if (path.isMemberExpression() && !path.parentPath.isCallExpression({
- callee: node
- })) {
- var _property = path.get("property");
- var _object = path.get("object");
- if (_object.isLiteral() && _property.isIdentifier()) {
- var value = _object.node.value;
- var type = typeof value;
- if (type === "number" || type === "string") {
- return value[_property.node.name];
- }
- }
- }
- if (path.isReferencedIdentifier()) {
- var binding = path.scope.getBinding(node.name);
- if (binding && binding.constantViolations.length > 0) {
- return deopt(binding.path, state);
- }
- if (binding && path.node.start < binding.path.node.end) {
- return deopt(binding.path, state);
- }
- if (binding && binding.hasValue) {
- return binding.value;
- } else {
- if (node.name === "undefined") {
- return binding ? deopt(binding.path, state) : undefined;
- } else if (node.name === "Infinity") {
- return binding ? deopt(binding.path, state) : Infinity;
- } else if (node.name === "NaN") {
- return binding ? deopt(binding.path, state) : NaN;
- }
- var resolved = path.resolve();
- if (resolved === path) {
- return deopt(path, state);
- } else {
- return evaluateCached(resolved, state);
- }
- }
- }
- if (path.isUnaryExpression({
- prefix: true
- })) {
- if (node.operator === "void") {
- return undefined;
- }
- var argument = path.get("argument");
- if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
- return "function";
- }
- var arg = evaluateCached(argument, state);
- if (!state.confident) return;
- switch (node.operator) {
- case "!":
- return !arg;
- case "+":
- return +arg;
- case "-":
- return -arg;
- case "~":
- return ~arg;
- case "typeof":
- return typeof arg;
- }
- }
- if (path.isArrayExpression()) {
- var arr = [];
- var elems = path.get("elements");
- for (var _iterator = elems, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var elem = _ref;
- var elemValue = elem.evaluate();
- if (elemValue.confident) {
- arr.push(elemValue.value);
- } else {
- return deopt(elem, state);
- }
- }
- return arr;
- }
- if (path.isObjectExpression()) {
- var obj = {};
- var props = path.get("properties");
- for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var prop = _ref2;
- if (prop.isObjectMethod() || prop.isSpreadElement()) {
- return deopt(prop, state);
- }
- var keyPath = prop.get("key");
- var key = keyPath;
- if (prop.node.computed) {
- key = key.evaluate();
- if (!key.confident) {
- return deopt(keyPath, state);
- }
- key = key.value;
- } else if (key.isIdentifier()) {
- key = key.node.name;
- } else {
- key = key.node.value;
- }
- var valuePath = prop.get("value");
- var _value = valuePath.evaluate();
- if (!_value.confident) {
- return deopt(valuePath, state);
- }
- _value = _value.value;
- obj[key] = _value;
- }
- return obj;
- }
- if (path.isLogicalExpression()) {
- var wasConfident = state.confident;
- var left = evaluateCached(path.get("left"), state);
- var leftConfident = state.confident;
- state.confident = wasConfident;
- var right = evaluateCached(path.get("right"), state);
- var rightConfident = state.confident;
- switch (node.operator) {
- case "||":
- state.confident = leftConfident && (!!left || rightConfident);
- if (!state.confident) return;
- return left || right;
- case "&&":
- state.confident = leftConfident && (!left || rightConfident);
- if (!state.confident) return;
- return left && right;
- }
- }
- if (path.isBinaryExpression()) {
- var _left = evaluateCached(path.get("left"), state);
- if (!state.confident) return;
- var _right = evaluateCached(path.get("right"), state);
- if (!state.confident) return;
- switch (node.operator) {
- case "-":
- return _left - _right;
- case "+":
- return _left + _right;
- case "/":
- return _left / _right;
- case "*":
- return _left * _right;
- case "%":
- return _left % _right;
- case "**":
- return Math.pow(_left, _right);
- case "<":
- return _left < _right;
- case ">":
- return _left > _right;
- case "<=":
- return _left <= _right;
- case ">=":
- return _left >= _right;
- case "==":
- return _left == _right;
- case "!=":
- return _left != _right;
- case "===":
- return _left === _right;
- case "!==":
- return _left !== _right;
- case "|":
- return _left | _right;
- case "&":
- return _left & _right;
- case "^":
- return _left ^ _right;
- case "<<":
- return _left << _right;
- case ">>":
- return _left >> _right;
- case ">>>":
- return _left >>> _right;
- }
- }
- if (path.isCallExpression()) {
- var callee = path.get("callee");
- var context;
- var func;
- if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
- func = global$1[node.callee.name];
- }
- if (callee.isMemberExpression()) {
- var _object2 = callee.get("object");
- var _property2 = callee.get("property");
- if (_object2.isIdentifier() && _property2.isIdentifier() && VALID_CALLEES.indexOf(_object2.node.name) >= 0 && INVALID_METHODS.indexOf(_property2.node.name) < 0) {
- context = global$1[_object2.node.name];
- func = context[_property2.node.name];
- }
- if (_object2.isLiteral() && _property2.isIdentifier()) {
- var _type = typeof _object2.node.value;
- if (_type === "string" || _type === "number") {
- context = _object2.node.value;
- func = context[_property2.node.name];
- }
- }
- }
- if (func) {
- var args = path.get("arguments").map(function (arg) {
- return evaluateCached(arg, state);
- });
- if (!state.confident) return;
- return func.apply(context, args);
- }
- }
- deopt(path, state);
- }
- function evaluateQuasis(path, quasis, state, raw) {
- if (raw === void 0) {
- raw = false;
- }
- var str = "";
- var i = 0;
- var exprs = path.get("expressions");
- for (var _iterator3 = quasis, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
- var elem = _ref3;
- if (!state.confident) break;
- str += raw ? elem.value.raw : elem.value.cooked;
- var expr = exprs[i++];
- if (expr) str += String(evaluateCached(expr, state));
- }
- if (!state.confident) return;
- return str;
- }
- function evaluate() {
- var state = {
- confident: true,
- deoptPath: null,
- seen: new Map()
- };
- var value = evaluateCached(this, state);
- if (!state.confident) value = undefined;
- return {
- confident: state.confident,
- deopt: state.deoptPath,
- value: value
- };
- }
- var NodePath_evaluation = /*#__PURE__*/Object.freeze({
- __proto__: null,
- evaluateTruthy: evaluateTruthy,
- evaluate: evaluate
- });
- function getFunctionArity (node) {
- var params = node.params;
- for (var i = 0; i < params.length; i++) {
- var param = params[i];
- if (isAssignmentPattern(param) || isRestElement(param)) {
- return i;
- }
- }
- return params.length;
- }
- function makeStatementFormatter(fn) {
- return {
- code: function code(str) {
- return "/* @babel/template */;\n" + str;
- },
- validate: function validate() {},
- unwrap: function unwrap(ast) {
- return fn(ast.program.body.slice(1));
- }
- };
- }
- var smart = makeStatementFormatter(function (body) {
- if (body.length > 1) {
- return body;
- } else {
- return body[0];
- }
- });
- var statements = makeStatementFormatter(function (body) {
- return body;
- });
- var statement = makeStatementFormatter(function (body) {
- if (body.length === 0) {
- throw new Error("Found nothing to return.");
- }
- if (body.length > 1) {
- throw new Error("Found multiple statements but wanted one");
- }
- return body[0];
- });
- var expression = {
- code: function code(str) {
- return "(\n" + str + "\n)";
- },
- validate: function validate(_ref) {
- var program = _ref.program;
- if (program.body.length > 1) {
- throw new Error("Found multiple statements but wanted one");
- }
- var expression = program.body[0].expression;
- if (expression.start === 0) {
- throw new Error("Parse result included parens.");
- }
- },
- unwrap: function unwrap(ast) {
- return ast.program.body[0].expression;
- }
- };
- var program = {
- code: function code(str) {
- return str;
- },
- validate: function validate() {},
- unwrap: function unwrap(ast) {
- return ast.program;
- }
- };
- function merge(a, b) {
- var _b$placeholderWhiteli = b.placeholderWhitelist,
- placeholderWhitelist = _b$placeholderWhiteli === void 0 ? a.placeholderWhitelist : _b$placeholderWhiteli,
- _b$placeholderPattern = b.placeholderPattern,
- placeholderPattern = _b$placeholderPattern === void 0 ? a.placeholderPattern : _b$placeholderPattern,
- _b$preserveComments = b.preserveComments,
- preserveComments = _b$preserveComments === void 0 ? a.preserveComments : _b$preserveComments,
- _b$syntacticPlacehold = b.syntacticPlaceholders,
- syntacticPlaceholders = _b$syntacticPlacehold === void 0 ? a.syntacticPlaceholders : _b$syntacticPlacehold;
- return {
- parser: Object.assign({}, a.parser, {}, b.parser),
- placeholderWhitelist: placeholderWhitelist,
- placeholderPattern: placeholderPattern,
- preserveComments: preserveComments,
- syntacticPlaceholders: syntacticPlaceholders
- };
- }
- function validate$2(opts) {
- if (opts != null && typeof opts !== "object") {
- throw new Error("Unknown template options.");
- }
- var _ref = opts || {},
- placeholderWhitelist = _ref.placeholderWhitelist,
- placeholderPattern = _ref.placeholderPattern,
- preserveComments = _ref.preserveComments,
- syntacticPlaceholders = _ref.syntacticPlaceholders,
- parser = _objectWithoutPropertiesLoose(_ref, ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"]);
- if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
- throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");
- }
- if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) {
- throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");
- }
- if (preserveComments != null && typeof preserveComments !== "boolean") {
- throw new Error("'.preserveComments' must be a boolean, null, or undefined");
- }
- if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") {
- throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");
- }
- if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) {
- throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
- }
- return {
- parser: parser,
- placeholderWhitelist: placeholderWhitelist || undefined,
- placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
- preserveComments: preserveComments == null ? false : preserveComments,
- syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders
- };
- }
- function normalizeReplacements(replacements) {
- if (Array.isArray(replacements)) {
- return replacements.reduce(function (acc, replacement, i) {
- acc["$" + i] = replacement;
- return acc;
- }, {});
- } else if (typeof replacements === "object" || replacements == null) {
- return replacements || undefined;
- }
- throw new Error("Template replacements must be an array, object, null, or undefined");
- }
- var PATTERN = /^[_$A-Z0-9]+$/;
- function parseAndBuildMetadata(formatter, code, opts) {
- var ast = parseWithCodeFrame(code, opts.parser);
- var placeholderWhitelist = opts.placeholderWhitelist,
- placeholderPattern = opts.placeholderPattern,
- preserveComments = opts.preserveComments,
- syntacticPlaceholders = opts.syntacticPlaceholders;
- removePropertiesDeep(ast, {
- preserveComments: preserveComments
- });
- formatter.validate(ast);
- var syntactic = {
- placeholders: [],
- placeholderNames: new Set()
- };
- var legacy = {
- placeholders: [],
- placeholderNames: new Set()
- };
- var isLegacyRef = {
- value: undefined
- };
- traverse(ast, placeholderVisitorHandler, {
- syntactic: syntactic,
- legacy: legacy,
- isLegacyRef: isLegacyRef,
- placeholderWhitelist: placeholderWhitelist,
- placeholderPattern: placeholderPattern,
- syntacticPlaceholders: syntacticPlaceholders
- });
- return Object.assign({
- ast: ast
- }, isLegacyRef.value ? legacy : syntactic);
- }
- function placeholderVisitorHandler(node, ancestors, state) {
- var name;
- if (isPlaceholder(node)) {
- if (state.syntacticPlaceholders === false) {
- throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false.");
- } else {
- name = node.name.name;
- state.isLegacyRef.value = false;
- }
- } else if (state.isLegacyRef.value === false || state.syntacticPlaceholders) {
- return;
- } else if (isIdentifier(node) || isJSXIdentifier(node)) {
- name = node.name;
- state.isLegacyRef.value = true;
- } else if (isStringLiteral(node)) {
- name = node.value;
- state.isLegacyRef.value = true;
- } else {
- return;
- }
- if (!state.isLegacyRef.value && (state.placeholderPattern != null || state.placeholderWhitelist != null)) {
- throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'");
- }
- if (state.isLegacyRef.value && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && (!state.placeholderWhitelist || !state.placeholderWhitelist.has(name))) {
- return;
- }
- ancestors = ancestors.slice();
- var _ancestors = ancestors[ancestors.length - 1],
- parent = _ancestors.node,
- key = _ancestors.key;
- var type;
- if (isStringLiteral(node) || isPlaceholder(node, {
- expectedNode: "StringLiteral"
- })) {
- type = "string";
- } else if (isNewExpression(parent) && key === "arguments" || isCallExpression(parent) && key === "arguments" || isFunction(parent) && key === "params") {
- type = "param";
- } else if (isExpressionStatement(parent) && !isPlaceholder(node)) {
- type = "statement";
- ancestors = ancestors.slice(0, -1);
- } else if (isStatement(node) && isPlaceholder(node)) {
- type = "statement";
- } else {
- type = "other";
- }
- var _ref = state.isLegacyRef.value ? state.legacy : state.syntactic,
- placeholders = _ref.placeholders,
- placeholderNames = _ref.placeholderNames;
- placeholders.push({
- name: name,
- type: type,
- resolve: function resolve(ast) {
- return resolveAncestors(ast, ancestors);
- },
- isDuplicate: placeholderNames.has(name)
- });
- placeholderNames.add(name);
- }
- function resolveAncestors(ast, ancestors) {
- var parent = ast;
- for (var i = 0; i < ancestors.length - 1; i++) {
- var _ancestors$i = ancestors[i],
- _key = _ancestors$i.key,
- _index = _ancestors$i.index;
- if (_index === undefined) {
- parent = parent[_key];
- } else {
- parent = parent[_key][_index];
- }
- }
- var _ancestors2 = ancestors[ancestors.length - 1],
- key = _ancestors2.key,
- index = _ancestors2.index;
- return {
- parent: parent,
- key: key,
- index: index
- };
- }
- function parseWithCodeFrame(code, parserOpts) {
- parserOpts = Object.assign({
- allowReturnOutsideFunction: true,
- allowSuperOutsideMethod: true,
- sourceType: "module"
- }, parserOpts, {
- plugins: (parserOpts.plugins || []).concat("placeholders")
- });
- try {
- return parse$1(code, parserOpts);
- } catch (err) {
- var loc = err.loc;
- if (loc) {
- err.message += "\n" + codeFrameColumns(code, {
- start: loc
- });
- err.code = "BABEL_TEMPLATE_PARSE_ERROR";
- }
- throw err;
- }
- }
- function populatePlaceholders(metadata, replacements) {
- var ast = cloneNode(metadata.ast);
- if (replacements) {
- metadata.placeholders.forEach(function (placeholder) {
- if (!Object.prototype.hasOwnProperty.call(replacements, placeholder.name)) {
- var placeholderName = placeholder.name;
- throw new Error("Error: No substitution given for \"" + placeholderName + "\". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['" + placeholderName + "'])}\n - { placeholderPattern: /^" + placeholderName + "$/ }");
- }
- });
- Object.keys(replacements).forEach(function (key) {
- if (!metadata.placeholderNames.has(key)) {
- throw new Error("Unknown substitution \"" + key + "\" given");
- }
- });
- }
- metadata.placeholders.slice().reverse().forEach(function (placeholder) {
- try {
- applyReplacement(placeholder, ast, replacements && replacements[placeholder.name] || null);
- } catch (e) {
- e.message = "@babel/template placeholder \"" + placeholder.name + "\": " + e.message;
- throw e;
- }
- });
- return ast;
- }
- function applyReplacement(placeholder, ast, replacement) {
- if (placeholder.isDuplicate) {
- if (Array.isArray(replacement)) {
- replacement = replacement.map(function (node) {
- return cloneNode(node);
- });
- } else if (typeof replacement === "object") {
- replacement = cloneNode(replacement);
- }
- }
- var _placeholder$resolve = placeholder.resolve(ast),
- parent = _placeholder$resolve.parent,
- key = _placeholder$resolve.key,
- index = _placeholder$resolve.index;
- if (placeholder.type === "string") {
- if (typeof replacement === "string") {
- replacement = StringLiteral(replacement);
- }
- if (!replacement || !isStringLiteral(replacement)) {
- throw new Error("Expected string substitution");
- }
- } else if (placeholder.type === "statement") {
- if (index === undefined) {
- if (!replacement) {
- replacement = EmptyStatement();
- } else if (Array.isArray(replacement)) {
- replacement = BlockStatement(replacement);
- } else if (typeof replacement === "string") {
- replacement = ExpressionStatement(Identifier(replacement));
- } else if (!isStatement(replacement)) {
- replacement = ExpressionStatement(replacement);
- }
- } else {
- if (replacement && !Array.isArray(replacement)) {
- if (typeof replacement === "string") {
- replacement = Identifier(replacement);
- }
- if (!isStatement(replacement)) {
- replacement = ExpressionStatement(replacement);
- }
- }
- }
- } else if (placeholder.type === "param") {
- if (typeof replacement === "string") {
- replacement = Identifier(replacement);
- }
- if (index === undefined) throw new Error("Assertion failure.");
- } else {
- if (typeof replacement === "string") {
- replacement = Identifier(replacement);
- }
- if (Array.isArray(replacement)) {
- throw new Error("Cannot replace single expression with an array.");
- }
- }
- if (index === undefined) {
- validate(parent, key, replacement);
- parent[key] = replacement;
- } else {
- var items = parent[key].slice();
- if (placeholder.type === "statement" || placeholder.type === "param") {
- if (replacement == null) {
- items.splice(index, 1);
- } else if (Array.isArray(replacement)) {
- items.splice.apply(items, [index, 1].concat(replacement));
- } else {
- items[index] = replacement;
- }
- } else {
- items[index] = replacement;
- }
- validate(parent, key, items);
- parent[key] = items;
- }
- }
- function stringTemplate(formatter, code, opts) {
- code = formatter.code(code);
- var metadata;
- return function (arg) {
- var replacements = normalizeReplacements(arg);
- if (!metadata) metadata = parseAndBuildMetadata(formatter, code, opts);
- return formatter.unwrap(populatePlaceholders(metadata, replacements));
- };
- }
- function literalTemplate(formatter, tpl, opts) {
- var _buildLiteralData = buildLiteralData(formatter, tpl, opts),
- metadata = _buildLiteralData.metadata,
- names = _buildLiteralData.names;
- return function (arg) {
- var defaultReplacements = arg.reduce(function (acc, replacement, i) {
- acc[names[i]] = replacement;
- return acc;
- }, {});
- return function (arg) {
- var replacements = normalizeReplacements(arg);
- if (replacements) {
- Object.keys(replacements).forEach(function (key) {
- if (Object.prototype.hasOwnProperty.call(defaultReplacements, key)) {
- throw new Error("Unexpected replacement overlap.");
- }
- });
- }
- return formatter.unwrap(populatePlaceholders(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements));
- };
- };
- }
- function buildLiteralData(formatter, tpl, opts) {
- var names;
- var nameSet;
- var metadata;
- var prefix = "";
- do {
- prefix += "$";
- var result = buildTemplateCode(tpl, prefix);
- names = result.names;
- nameSet = new Set(names);
- metadata = parseAndBuildMetadata(formatter, formatter.code(result.code), {
- parser: opts.parser,
- placeholderWhitelist: new Set(result.names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])),
- placeholderPattern: opts.placeholderPattern,
- preserveComments: opts.preserveComments,
- syntacticPlaceholders: opts.syntacticPlaceholders
- });
- } while (metadata.placeholders.some(function (placeholder) {
- return placeholder.isDuplicate && nameSet.has(placeholder.name);
- }));
- return {
- metadata: metadata,
- names: names
- };
- }
- function buildTemplateCode(tpl, prefix) {
- var names = [];
- var code = tpl[0];
- for (var i = 1; i < tpl.length; i++) {
- var value = "" + prefix + (i - 1);
- names.push(value);
- code += value + tpl[i];
- }
- return {
- names: names,
- code: code
- };
- }
- var NO_PLACEHOLDER = validate$2({
- placeholderPattern: false
- });
- function createTemplateBuilder(formatter, defaultOpts) {
- var templateFnCache = new WeakMap();
- var templateAstCache = new WeakMap();
- var cachedOpts = defaultOpts || validate$2(null);
- return Object.assign(function (tpl) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- if (typeof tpl === "string") {
- if (args.length > 1) throw new Error("Unexpected extra params.");
- return extendedTrace(stringTemplate(formatter, tpl, merge(cachedOpts, validate$2(args[0]))));
- } else if (Array.isArray(tpl)) {
- var builder = templateFnCache.get(tpl);
- if (!builder) {
- builder = literalTemplate(formatter, tpl, cachedOpts);
- templateFnCache.set(tpl, builder);
- }
- return extendedTrace(builder(args));
- } else if (typeof tpl === "object" && tpl) {
- if (args.length > 0) throw new Error("Unexpected extra params.");
- return createTemplateBuilder(formatter, merge(cachedOpts, validate$2(tpl)));
- }
- throw new Error("Unexpected template param " + typeof tpl);
- }, {
- ast: function ast(tpl) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- if (typeof tpl === "string") {
- if (args.length > 1) throw new Error("Unexpected extra params.");
- return stringTemplate(formatter, tpl, merge(merge(cachedOpts, validate$2(args[0])), NO_PLACEHOLDER))();
- } else if (Array.isArray(tpl)) {
- var builder = templateAstCache.get(tpl);
- if (!builder) {
- builder = literalTemplate(formatter, tpl, merge(cachedOpts, NO_PLACEHOLDER));
- templateAstCache.set(tpl, builder);
- }
- return builder(args)();
- }
- throw new Error("Unexpected template param " + typeof tpl);
- }
- });
- }
- function extendedTrace(fn) {
- var rootStack = "";
- try {
- throw new Error();
- } catch (error) {
- if (error.stack) {
- rootStack = error.stack.split("\n").slice(3).join("\n");
- }
- }
- return function (arg) {
- try {
- return fn(arg);
- } catch (err) {
- err.stack += "\n =============\n" + rootStack;
- throw err;
- }
- };
- }
- var smart$1 = createTemplateBuilder(smart);
- var statement$1 = createTemplateBuilder(statement);
- var statements$1 = createTemplateBuilder(statements);
- var expression$1 = createTemplateBuilder(expression);
- var program$1 = createTemplateBuilder(program);
- var template = Object.assign(smart$1.bind(undefined), {
- smart: smart$1,
- statement: statement$1,
- statements: statements$1,
- expression: expression$1,
- program: program$1,
- ast: smart$1.ast
- });
- var buildPropertyMethodAssignmentWrapper = template("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
- var buildGeneratorPropertyMethodAssignmentWrapper = template("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
- var visitor = {
- "ReferencedIdentifier|BindingIdentifier": function ReferencedIdentifierBindingIdentifier(path, state) {
- if (path.node.name !== state.name) return;
- var localDeclar = path.scope.getBindingIdentifier(state.name);
- if (localDeclar !== state.outerDeclar) return;
- state.selfReference = true;
- path.stop();
- }
- };
- function getNameFromLiteralId(id) {
- if (isNullLiteral(id)) {
- return "null";
- }
- if (isRegExpLiteral(id)) {
- return "_" + id.pattern + "_" + id.flags;
- }
- if (isTemplateLiteral(id)) {
- return id.quasis.map(function (quasi) {
- return quasi.value.raw;
- }).join("");
- }
- if (id.value !== undefined) {
- return id.value + "";
- }
- return "";
- }
- function wrap(state, method, id, scope) {
- if (state.selfReference) {
- if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
- scope.rename(id.name);
- } else {
- if (!isFunction(method)) return;
- var build = buildPropertyMethodAssignmentWrapper;
- if (method.generator) {
- build = buildGeneratorPropertyMethodAssignmentWrapper;
- }
- var _template = build({
- FUNCTION: method,
- FUNCTION_ID: id,
- FUNCTION_KEY: scope.generateUidIdentifier(id.name)
- }).expression;
- var params = _template.callee.body.body[0].params;
- for (var i = 0, len = getFunctionArity(method); i < len; i++) {
- params.push(scope.generateUidIdentifier("x"));
- }
- return _template;
- }
- }
- method.id = id;
- scope.getProgramParent().references[id.name] = true;
- }
- function visit(node, name, scope) {
- var state = {
- selfAssignment: false,
- selfReference: false,
- outerDeclar: scope.getBindingIdentifier(name),
- references: [],
- name: name
- };
- var binding = scope.getOwnBinding(name);
- if (binding) {
- if (binding.kind === "param") {
- state.selfReference = true;
- }
- } else if (state.outerDeclar || scope.hasGlobal(name)) {
- scope.traverse(node, visitor, state);
- }
- return state;
- }
- function nameFunction (_ref, localBinding) {
- var node = _ref.node,
- parent = _ref.parent,
- scope = _ref.scope,
- id = _ref.id;
- if (localBinding === void 0) {
- localBinding = false;
- }
- if (node.id) return;
- if ((isObjectProperty(parent) || isObjectMethod(parent, {
- kind: "method"
- })) && (!parent.computed || isLiteral(parent.key))) {
- id = parent.key;
- } else if (isVariableDeclarator(parent)) {
- id = parent.id;
- if (isIdentifier(id) && !localBinding) {
- var binding = scope.parent.getBinding(id.name);
- if (binding && binding.constant && scope.getBinding(id.name) === binding) {
- node.id = cloneNode(id);
- node.id[NOT_LOCAL_BINDING] = true;
- return;
- }
- }
- } else if (isAssignmentExpression(parent)) {
- id = parent.left;
- } else if (!id) {
- return;
- }
- var name;
- if (id && isLiteral(id)) {
- name = getNameFromLiteralId(id);
- } else if (id && isIdentifier(id)) {
- name = id.name;
- }
- if (name === undefined) {
- return;
- }
- name = toBindingIdentifierName(name);
- id = Identifier(name);
- id[NOT_LOCAL_BINDING] = true;
- var state = visit(node, name, scope);
- return wrap(state, node, id, scope) || node;
- }
- function toComputedKey$1() {
- var node = this.node;
- var key;
- if (this.isMemberExpression()) {
- key = node.property;
- } else if (this.isProperty() || this.isMethod()) {
- key = node.key;
- } else {
- throw new ReferenceError("todo");
- }
- if (!node.computed) {
- if (isIdentifier(key)) key = StringLiteral(key.name);
- }
- return key;
- }
- function ensureBlock$1() {
- var body = this.get("body");
- var bodyNode = body.node;
- if (Array.isArray(body)) {
- throw new Error("Can't convert array path to a block statement");
- }
- if (!bodyNode) {
- throw new Error("Can't convert node without a body");
- }
- if (body.isBlockStatement()) {
- return bodyNode;
- }
- var statements = [];
- var stringPath = "body";
- var key;
- var listKey;
- if (body.isStatement()) {
- listKey = "body";
- key = 0;
- statements.push(body.node);
- } else {
- stringPath += ".body.0";
- if (this.isFunction()) {
- key = "argument";
- statements.push(ReturnStatement(body.node));
- } else {
- key = "expression";
- statements.push(ExpressionStatement(body.node));
- }
- }
- this.node.body = BlockStatement(statements);
- var parentPath = this.get(stringPath);
- body.setup(parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key);
- return this.node;
- }
- function arrowFunctionToShadowed() {
- if (!this.isArrowFunctionExpression()) return;
- this.arrowFunctionToExpression();
- }
- function unwrapFunctionEnvironment() {
- if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) {
- throw this.buildCodeFrameError("Can only unwrap the environment of a function.");
- }
- hoistFunctionEnvironment(this);
- }
- function arrowFunctionToExpression(_temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$allowInsertArrow = _ref.allowInsertArrow,
- allowInsertArrow = _ref$allowInsertArrow === void 0 ? true : _ref$allowInsertArrow,
- _ref$specCompliant = _ref.specCompliant,
- specCompliant = _ref$specCompliant === void 0 ? false : _ref$specCompliant;
- if (!this.isArrowFunctionExpression()) {
- throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression.");
- }
- var thisBinding = hoistFunctionEnvironment(this, specCompliant, allowInsertArrow);
- this.ensureBlock();
- this.node.type = "FunctionExpression";
- if (specCompliant) {
- var checkBinding = thisBinding ? null : this.parentPath.scope.generateUidIdentifier("arrowCheckId");
- if (checkBinding) {
- this.parentPath.scope.push({
- id: checkBinding,
- init: ObjectExpression([])
- });
- }
- this.get("body").unshiftContainer("body", ExpressionStatement(CallExpression(this.hub.addHelper("newArrowCheck"), [ThisExpression(), checkBinding ? Identifier(checkBinding.name) : Identifier(thisBinding)])));
- this.replaceWith(CallExpression(MemberExpression(nameFunction(this, true) || this.node, Identifier("bind")), [checkBinding ? Identifier(checkBinding.name) : ThisExpression()]));
- }
- }
- function hoistFunctionEnvironment(fnPath, specCompliant, allowInsertArrow) {
- if (specCompliant === void 0) {
- specCompliant = false;
- }
- if (allowInsertArrow === void 0) {
- allowInsertArrow = true;
- }
- var thisEnvFn = fnPath.findParent(function (p) {
- return p.isFunction() && !p.isArrowFunctionExpression() || p.isProgram() || p.isClassProperty({
- "static": false
- });
- });
- var inConstructor = thisEnvFn && thisEnvFn.node.kind === "constructor";
- if (thisEnvFn.isClassProperty()) {
- throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");
- }
- var _getScopeInformation = getScopeInformation(fnPath),
- thisPaths = _getScopeInformation.thisPaths,
- argumentsPaths = _getScopeInformation.argumentsPaths,
- newTargetPaths = _getScopeInformation.newTargetPaths,
- superProps = _getScopeInformation.superProps,
- superCalls = _getScopeInformation.superCalls;
- if (inConstructor && superCalls.length > 0) {
- if (!allowInsertArrow) {
- throw superCalls[0].buildCodeFrameError("Unable to handle nested super() usage in arrow");
- }
- var allSuperCalls = [];
- thisEnvFn.traverse({
- Function: function Function(child) {
- if (child.isArrowFunctionExpression()) return;
- child.skip();
- },
- ClassProperty: function ClassProperty(child) {
- child.skip();
- },
- CallExpression: function CallExpression(child) {
- if (!child.get("callee").isSuper()) return;
- allSuperCalls.push(child);
- }
- });
- var superBinding = getSuperBinding(thisEnvFn);
- allSuperCalls.forEach(function (superCall) {
- var callee = Identifier(superBinding);
- callee.loc = superCall.node.callee.loc;
- superCall.get("callee").replaceWith(callee);
- });
- }
- if (argumentsPaths.length > 0) {
- var argumentsBinding = getBinding(thisEnvFn, "arguments", function () {
- return Identifier("arguments");
- });
- argumentsPaths.forEach(function (argumentsChild) {
- var argsRef = Identifier(argumentsBinding);
- argsRef.loc = argumentsChild.node.loc;
- argumentsChild.replaceWith(argsRef);
- });
- }
- if (newTargetPaths.length > 0) {
- var newTargetBinding = getBinding(thisEnvFn, "newtarget", function () {
- return MetaProperty(Identifier("new"), Identifier("target"));
- });
- newTargetPaths.forEach(function (targetChild) {
- var targetRef = Identifier(newTargetBinding);
- targetRef.loc = targetChild.node.loc;
- targetChild.replaceWith(targetRef);
- });
- }
- if (superProps.length > 0) {
- if (!allowInsertArrow) {
- throw superProps[0].buildCodeFrameError("Unable to handle nested super.prop usage");
- }
- var flatSuperProps = superProps.reduce(function (acc, superProp) {
- return acc.concat(standardizeSuperProperty(superProp));
- }, []);
- flatSuperProps.forEach(function (superProp) {
- var key = superProp.node.computed ? "" : superProp.get("property").node.name;
- var isAssignment = superProp.parentPath.isAssignmentExpression({
- left: superProp.node
- });
- var isCall = superProp.parentPath.isCallExpression({
- callee: superProp.node
- });
- var superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
- var args = [];
- if (superProp.node.computed) {
- args.push(superProp.get("property").node);
- }
- if (isAssignment) {
- var value = superProp.parentPath.node.right;
- args.push(value);
- }
- var call = CallExpression(Identifier(superBinding), args);
- if (isCall) {
- superProp.parentPath.unshiftContainer("arguments", ThisExpression());
- superProp.replaceWith(MemberExpression(call, Identifier("call")));
- thisPaths.push(superProp.parentPath.get("arguments.0"));
- } else if (isAssignment) {
- superProp.parentPath.replaceWith(call);
- } else {
- superProp.replaceWith(call);
- }
- });
- }
- var thisBinding;
- if (thisPaths.length > 0 || specCompliant) {
- thisBinding = getThisBinding(thisEnvFn, inConstructor);
- if (!specCompliant || inConstructor && hasSuperClass(thisEnvFn)) {
- thisPaths.forEach(function (thisChild) {
- var thisRef = thisChild.isJSX() ? JSXIdentifier(thisBinding) : Identifier(thisBinding);
- thisRef.loc = thisChild.node.loc;
- thisChild.replaceWith(thisRef);
- });
- if (specCompliant) thisBinding = null;
- }
- }
- return thisBinding;
- }
- function standardizeSuperProperty(superProp) {
- if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") {
- var assignmentPath = superProp.parentPath;
- var op = assignmentPath.node.operator.slice(0, -1);
- var value = assignmentPath.node.right;
- assignmentPath.node.operator = "=";
- if (superProp.node.computed) {
- var tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
- assignmentPath.get("left").replaceWith(MemberExpression(superProp.node.object, AssignmentExpression("=", tmp, superProp.node.property), true));
- assignmentPath.get("right").replaceWith(BinaryExpression(op, MemberExpression(superProp.node.object, Identifier(tmp.name), true), value));
- } else {
- assignmentPath.get("left").replaceWith(MemberExpression(superProp.node.object, superProp.node.property));
- assignmentPath.get("right").replaceWith(BinaryExpression(op, MemberExpression(superProp.node.object, Identifier(superProp.node.property.name)), value));
- }
- return [assignmentPath.get("left"), assignmentPath.get("right").get("left")];
- } else if (superProp.parentPath.isUpdateExpression()) {
- var updateExpr = superProp.parentPath;
- var _tmp = superProp.scope.generateDeclaredUidIdentifier("tmp");
- var computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null;
- var parts = [AssignmentExpression("=", _tmp, MemberExpression(superProp.node.object, computedKey ? AssignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), AssignmentExpression("=", MemberExpression(superProp.node.object, computedKey ? Identifier(computedKey.name) : superProp.node.property, superProp.node.computed), BinaryExpression("+", Identifier(_tmp.name), NumericLiteral(1)))];
- if (!superProp.parentPath.node.prefix) {
- parts.push(Identifier(_tmp.name));
- }
- updateExpr.replaceWith(SequenceExpression(parts));
- var left = updateExpr.get("expressions.0.right");
- var right = updateExpr.get("expressions.1.left");
- return [left, right];
- }
- return [superProp];
- }
- function hasSuperClass(thisEnvFn) {
- return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass;
- }
- function getThisBinding(thisEnvFn, inConstructor) {
- return getBinding(thisEnvFn, "this", function (thisBinding) {
- if (!inConstructor || !hasSuperClass(thisEnvFn)) return ThisExpression();
- var supers = new WeakSet();
- thisEnvFn.traverse({
- Function: function Function(child) {
- if (child.isArrowFunctionExpression()) return;
- child.skip();
- },
- ClassProperty: function ClassProperty(child) {
- child.skip();
- },
- CallExpression: function CallExpression(child) {
- if (!child.get("callee").isSuper()) return;
- if (supers.has(child.node)) return;
- supers.add(child.node);
- child.replaceWithMultiple([child.node, AssignmentExpression("=", Identifier(thisBinding), Identifier("this"))]);
- }
- });
- });
- }
- function getSuperBinding(thisEnvFn) {
- return getBinding(thisEnvFn, "supercall", function () {
- var argsBinding = thisEnvFn.scope.generateUidIdentifier("args");
- return ArrowFunctionExpression([RestElement(argsBinding)], CallExpression(Super(), [SpreadElement(Identifier(argsBinding.name))]));
- });
- }
- function getSuperPropBinding(thisEnvFn, isAssignment, propName) {
- var op = isAssignment ? "set" : "get";
- return getBinding(thisEnvFn, "superprop_" + op + ":" + (propName || ""), function () {
- var argsList = [];
- var fnBody;
- if (propName) {
- fnBody = MemberExpression(Super(), Identifier(propName));
- } else {
- var method = thisEnvFn.scope.generateUidIdentifier("prop");
- argsList.unshift(method);
- fnBody = MemberExpression(Super(), Identifier(method.name), true);
- }
- if (isAssignment) {
- var valueIdent = thisEnvFn.scope.generateUidIdentifier("value");
- argsList.push(valueIdent);
- fnBody = AssignmentExpression("=", fnBody, Identifier(valueIdent.name));
- }
- return ArrowFunctionExpression(argsList, fnBody);
- });
- }
- function getBinding(thisEnvFn, key, init) {
- var cacheKey = "binding:" + key;
- var data = thisEnvFn.getData(cacheKey);
- if (!data) {
- var id = thisEnvFn.scope.generateUidIdentifier(key);
- data = id.name;
- thisEnvFn.setData(cacheKey, data);
- thisEnvFn.scope.push({
- id: id,
- init: init(data)
- });
- }
- return data;
- }
- function getScopeInformation(fnPath) {
- var thisPaths = [];
- var argumentsPaths = [];
- var newTargetPaths = [];
- var superProps = [];
- var superCalls = [];
- fnPath.traverse({
- ClassProperty: function ClassProperty(child) {
- child.skip();
- },
- Function: function Function(child) {
- if (child.isArrowFunctionExpression()) return;
- child.skip();
- },
- ThisExpression: function ThisExpression(child) {
- thisPaths.push(child);
- },
- JSXIdentifier: function JSXIdentifier(child) {
- if (child.node.name !== "this") return;
- if (!child.parentPath.isJSXMemberExpression({
- object: child.node
- }) && !child.parentPath.isJSXOpeningElement({
- name: child.node
- })) {
- return;
- }
- thisPaths.push(child);
- },
- CallExpression: function CallExpression(child) {
- if (child.get("callee").isSuper()) superCalls.push(child);
- },
- MemberExpression: function MemberExpression(child) {
- if (child.get("object").isSuper()) superProps.push(child);
- },
- ReferencedIdentifier: function ReferencedIdentifier(child) {
- if (child.node.name !== "arguments") return;
- argumentsPaths.push(child);
- },
- MetaProperty: function MetaProperty(child) {
- if (!child.get("meta").isIdentifier({
- name: "new"
- })) return;
- if (!child.get("property").isIdentifier({
- name: "target"
- })) return;
- newTargetPaths.push(child);
- }
- });
- return {
- thisPaths: thisPaths,
- argumentsPaths: argumentsPaths,
- newTargetPaths: newTargetPaths,
- superProps: superProps,
- superCalls: superCalls
- };
- }
- var NodePath_conversion = /*#__PURE__*/Object.freeze({
- __proto__: null,
- toComputedKey: toComputedKey$1,
- ensureBlock: ensureBlock$1,
- arrowFunctionToShadowed: arrowFunctionToShadowed,
- unwrapFunctionEnvironment: unwrapFunctionEnvironment,
- arrowFunctionToExpression: arrowFunctionToExpression
- });
- function matchesPattern$1(pattern, allowPartial) {
- return matchesPattern(this.node, pattern, allowPartial);
- }
- function has$2(key) {
- var val = this.node && this.node[key];
- if (val && Array.isArray(val)) {
- return !!val.length;
- } else {
- return !!val;
- }
- }
- function isStatic() {
- return this.scope.isStatic(this.node);
- }
- var is$1 = has$2;
- function isnt(key) {
- return !this.has(key);
- }
- function equals(key, value) {
- return this.node[key] === value;
- }
- function isNodeType(type) {
- return isType(this.type, type);
- }
- function canHaveVariableDeclarationOrExpression() {
- return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
- }
- function canSwapBetweenExpressionAndStatement(replacement) {
- if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
- return false;
- }
- if (this.isExpression()) {
- return isBlockStatement(replacement);
- } else if (this.isBlockStatement()) {
- return isExpression(replacement);
- }
- return false;
- }
- function isCompletionRecord(allowInsideFunction) {
- var path = this;
- var first = true;
- do {
- var container = path.container;
- if (path.isFunction() && !first) {
- return !!allowInsideFunction;
- }
- first = false;
- if (Array.isArray(container) && path.key !== container.length - 1) {
- return false;
- }
- } while ((path = path.parentPath) && !path.isProgram());
- return true;
- }
- function isStatementOrBlock() {
- if (this.parentPath.isLabeledStatement() || isBlockStatement(this.container)) {
- return false;
- } else {
- return includes_1(STATEMENT_OR_BLOCK_KEYS, this.key);
- }
- }
- function referencesImport(moduleSource, importName) {
- if (!this.isReferencedIdentifier()) return false;
- var binding = this.scope.getBinding(this.node.name);
- if (!binding || binding.kind !== "module") return false;
- var path = binding.path;
- var parent = path.parentPath;
- if (!parent.isImportDeclaration()) return false;
- if (parent.node.source.value === moduleSource) {
- if (!importName) return true;
- } else {
- return false;
- }
- if (path.isImportDefaultSpecifier() && importName === "default") {
- return true;
- }
- if (path.isImportNamespaceSpecifier() && importName === "*") {
- return true;
- }
- if (path.isImportSpecifier() && path.node.imported.name === importName) {
- return true;
- }
- return false;
- }
- function getSource() {
- var node = this.node;
- if (node.end) {
- var code = this.hub.getCode();
- if (code) return code.slice(node.start, node.end);
- }
- return "";
- }
- function willIMaybeExecuteBefore(target) {
- return this._guessExecutionStatusRelativeTo(target) !== "after";
- }
- function getOuterFunction(path) {
- return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path;
- }
- function isExecutionUncertain(type, key) {
- switch (type) {
- case "LogicalExpression":
- return key === "right";
- case "ConditionalExpression":
- case "IfStatement":
- return key === "consequent" || key === "alternate";
- case "WhileStatement":
- case "DoWhileStatement":
- case "ForInStatement":
- case "ForOfStatement":
- return key === "body";
- case "ForStatement":
- return key === "body" || key === "update";
- case "SwitchStatement":
- return key === "cases";
- case "TryStatement":
- return key === "handler";
- case "AssignmentPattern":
- return key === "right";
- case "OptionalMemberExpression":
- return key === "property";
- case "OptionalCallExpression":
- return key === "arguments";
- default:
- return false;
- }
- }
- function isExecutionUncertainInList(paths, maxIndex) {
- for (var i = 0; i < maxIndex; i++) {
- var path = paths[i];
- if (isExecutionUncertain(path.parent.type, path.parentKey)) {
- return true;
- }
- }
- return false;
- }
- function _guessExecutionStatusRelativeTo(target) {
- var funcParent = {
- "this": getOuterFunction(this),
- target: getOuterFunction(target)
- };
- if (funcParent.target.node !== funcParent["this"].node) {
- return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
- }
- var paths = {
- target: target.getAncestry(),
- "this": this.getAncestry()
- };
- if (paths.target.indexOf(this) >= 0) return "after";
- if (paths["this"].indexOf(target) >= 0) return "before";
- var commonPath;
- var commonIndex = {
- target: 0,
- "this": 0
- };
- while (!commonPath && commonIndex["this"] < paths["this"].length) {
- var path = paths["this"][commonIndex["this"]];
- commonIndex.target = paths.target.indexOf(path);
- if (commonIndex.target >= 0) {
- commonPath = path;
- } else {
- commonIndex["this"]++;
- }
- }
- if (!commonPath) {
- throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program.");
- }
- if (isExecutionUncertainInList(paths["this"], commonIndex["this"] - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) {
- return "unknown";
- }
- var divergence = {
- "this": paths["this"][commonIndex["this"] - 1],
- target: paths.target[commonIndex.target - 1]
- };
- if (divergence.target.listKey && divergence["this"].listKey && divergence.target.container === divergence["this"].container) {
- return divergence.target.key > divergence["this"].key ? "before" : "after";
- }
- var keys = VISITOR_KEYS[commonPath.type];
- var keyPosition = {
- "this": keys.indexOf(divergence["this"].parentKey),
- target: keys.indexOf(divergence.target.parentKey)
- };
- return keyPosition.target > keyPosition["this"] ? "before" : "after";
- }
- var executionOrderCheckedNodes = new WeakSet();
- function _guessExecutionStatusRelativeToDifferentFunctions(target) {
- if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
- return "unknown";
- }
- var binding = target.scope.getBinding(target.node.id.name);
- if (!binding.references) return "before";
- var referencePaths = binding.referencePaths;
- var allStatus;
- for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var path = _ref;
- var childOfFunction = !!path.find(function (path) {
- return path.node === target.node;
- });
- if (childOfFunction) continue;
- if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
- return "unknown";
- }
- if (executionOrderCheckedNodes.has(path.node)) continue;
- executionOrderCheckedNodes.add(path.node);
- var status = this._guessExecutionStatusRelativeTo(path);
- executionOrderCheckedNodes["delete"](path.node);
- if (allStatus && allStatus !== status) {
- return "unknown";
- } else {
- allStatus = status;
- }
- }
- return allStatus;
- }
- function resolve(dangerous, resolved) {
- return this._resolve(dangerous, resolved) || this;
- }
- function _resolve(dangerous, resolved) {
- if (resolved && resolved.indexOf(this) >= 0) return;
- resolved = resolved || [];
- resolved.push(this);
- if (this.isVariableDeclarator()) {
- if (this.get("id").isIdentifier()) {
- return this.get("init").resolve(dangerous, resolved);
- }
- } else if (this.isReferencedIdentifier()) {
- var binding = this.scope.getBinding(this.node.name);
- if (!binding) return;
- if (!binding.constant) return;
- if (binding.kind === "module") return;
- if (binding.path !== this) {
- var ret = binding.path.resolve(dangerous, resolved);
- if (this.find(function (parent) {
- return parent.node === ret.node;
- })) return;
- return ret;
- }
- } else if (this.isTypeCastExpression()) {
- return this.get("expression").resolve(dangerous, resolved);
- } else if (dangerous && this.isMemberExpression()) {
- var targetKey = this.toComputedKey();
- if (!isLiteral(targetKey)) return;
- var targetName = targetKey.value;
- var target = this.get("object").resolve(dangerous, resolved);
- if (target.isObjectExpression()) {
- var props = target.get("properties");
- for (var _i2 = 0, _arr = props; _i2 < _arr.length; _i2++) {
- var prop = _arr[_i2];
- if (!prop.isProperty()) continue;
- var key = prop.get("key");
- var match = prop.isnt("computed") && key.isIdentifier({
- name: targetName
- });
- match = match || key.isLiteral({
- value: targetName
- });
- if (match) return prop.get("value").resolve(dangerous, resolved);
- }
- } else if (target.isArrayExpression() && !isNaN(+targetName)) {
- var elems = target.get("elements");
- var elem = elems[targetName];
- if (elem) return elem.resolve(dangerous, resolved);
- }
- }
- }
- function isConstantExpression() {
- if (this.isIdentifier()) {
- var binding = this.scope.getBinding(this.node.name);
- if (!binding) return false;
- return binding.constant;
- }
- if (this.isLiteral()) {
- if (this.isRegExpLiteral()) {
- return false;
- }
- if (this.isTemplateLiteral()) {
- return this.get("expressions").every(function (expression) {
- return expression.isConstantExpression();
- });
- }
- return true;
- }
- if (this.isUnaryExpression()) {
- if (this.get("operator").node !== "void") {
- return false;
- }
- return this.get("argument").isConstantExpression();
- }
- if (this.isBinaryExpression()) {
- return this.get("left").isConstantExpression() && this.get("right").isConstantExpression();
- }
- return false;
- }
- function isInStrictMode() {
- var start = this.isProgram() ? this : this.parentPath;
- var strictParent = start.find(function (path) {
- if (path.isProgram({
- sourceType: "module"
- })) return true;
- if (path.isClass()) return true;
- if (!path.isProgram() && !path.isFunction()) return false;
- if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) {
- return false;
- }
- var node = path.node;
- if (path.isFunction()) node = node.body;
- for (var _iterator2 = node.directives, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i3 >= _iterator2.length) break;
- _ref2 = _iterator2[_i3++];
- } else {
- _i3 = _iterator2.next();
- if (_i3.done) break;
- _ref2 = _i3.value;
- }
- var directive = _ref2;
- if (directive.value.value === "use strict") {
- return true;
- }
- }
- });
- return !!strictParent;
- }
- var NodePath_introspection = /*#__PURE__*/Object.freeze({
- __proto__: null,
- matchesPattern: matchesPattern$1,
- has: has$2,
- isStatic: isStatic,
- is: is$1,
- isnt: isnt,
- equals: equals,
- isNodeType: isNodeType,
- canHaveVariableDeclarationOrExpression: canHaveVariableDeclarationOrExpression,
- canSwapBetweenExpressionAndStatement: canSwapBetweenExpressionAndStatement,
- isCompletionRecord: isCompletionRecord,
- isStatementOrBlock: isStatementOrBlock,
- referencesImport: referencesImport,
- getSource: getSource,
- willIMaybeExecuteBefore: willIMaybeExecuteBefore,
- _guessExecutionStatusRelativeTo: _guessExecutionStatusRelativeTo,
- _guessExecutionStatusRelativeToDifferentFunctions: _guessExecutionStatusRelativeToDifferentFunctions,
- resolve: resolve,
- _resolve: _resolve,
- isConstantExpression: isConstantExpression,
- isInStrictMode: isInStrictMode
- });
- function call(key) {
- var opts = this.opts;
- this.debug(key);
- if (this.node) {
- if (this._call(opts[key])) return true;
- }
- if (this.node) {
- return this._call(opts[this.node.type] && opts[this.node.type][key]);
- }
- return false;
- }
- function _call(fns) {
- if (!fns) return false;
- for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var fn = _ref;
- if (!fn) continue;
- var node = this.node;
- if (!node) return true;
- var ret = fn.call(this.state, this, this.state);
- if (ret && typeof ret === "object" && typeof ret.then === "function") {
- throw new Error("You appear to be using a plugin with an async traversal visitor, " + "which your current version of Babel does not support. " + "If you're using a published plugin, you may need to upgrade " + "your @babel/core version.");
- }
- if (ret) {
- throw new Error("Unexpected return value from visitor method " + fn);
- }
- if (this.node !== node) return true;
- if (this._traverseFlags > 0) return true;
- }
- return false;
- }
- function isBlacklisted() {
- var blacklist = this.opts.blacklist;
- return blacklist && blacklist.indexOf(this.node.type) > -1;
- }
- function visit$1() {
- if (!this.node) {
- return false;
- }
- if (this.isBlacklisted()) {
- return false;
- }
- if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {
- return false;
- }
- if (this.shouldSkip || this.call("enter") || this.shouldSkip) {
- this.debug("Skip...");
- return this.shouldStop;
- }
- this.debug("Recursing into...");
- traverse$1.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
- this.call("exit");
- return this.shouldStop;
- }
- function skip() {
- this.shouldSkip = true;
- }
- function skipKey(key) {
- if (this.skipKeys == null) {
- this.skipKeys = {};
- }
- this.skipKeys[key] = true;
- }
- function stop() {
- this._traverseFlags |= SHOULD_SKIP | SHOULD_STOP;
- }
- function setScope() {
- if (this.opts && this.opts.noScope) return;
- var path = this.parentPath;
- var target;
- while (path && !target) {
- if (path.opts && path.opts.noScope) return;
- target = path.scope;
- path = path.parentPath;
- }
- this.scope = this.getScope(target);
- if (this.scope) this.scope.init();
- }
- function setContext(context) {
- if (this.skipKeys != null) {
- this.skipKeys = {};
- }
- this._traverseFlags = 0;
- if (context) {
- this.context = context;
- this.state = context.state;
- this.opts = context.opts;
- }
- this.setScope();
- return this;
- }
- function resync() {
- if (this.removed) return;
- this._resyncParent();
- this._resyncList();
- this._resyncKey();
- }
- function _resyncParent() {
- if (this.parentPath) {
- this.parent = this.parentPath.node;
- }
- }
- function _resyncKey() {
- if (!this.container) return;
- if (this.node === this.container[this.key]) return;
- if (Array.isArray(this.container)) {
- for (var i = 0; i < this.container.length; i++) {
- if (this.container[i] === this.node) {
- return this.setKey(i);
- }
- }
- } else {
- for (var _i2 = 0, _Object$keys = Object.keys(this.container); _i2 < _Object$keys.length; _i2++) {
- var key = _Object$keys[_i2];
- if (this.container[key] === this.node) {
- return this.setKey(key);
- }
- }
- }
- this.key = null;
- }
- function _resyncList() {
- if (!this.parent || !this.inList) return;
- var newContainer = this.parent[this.listKey];
- if (this.container === newContainer) return;
- this.container = newContainer || null;
- }
- function _resyncRemoved() {
- if (this.key == null || !this.container || this.container[this.key] !== this.node) {
- this._markRemoved();
- }
- }
- function popContext() {
- this.contexts.pop();
- if (this.contexts.length > 0) {
- this.setContext(this.contexts[this.contexts.length - 1]);
- } else {
- this.setContext(undefined);
- }
- }
- function pushContext(context) {
- this.contexts.push(context);
- this.setContext(context);
- }
- function setup$1(parentPath, container, listKey, key) {
- this.listKey = listKey;
- this.container = container;
- this.parentPath = parentPath || this.parentPath;
- this.setKey(key);
- }
- function setKey(key) {
- this.key = key;
- this.node = this.container[this.key];
- this.type = this.node && this.node.type;
- }
- function requeue(pathToQueue) {
- if (pathToQueue === void 0) {
- pathToQueue = this;
- }
- if (pathToQueue.removed) return;
- var contexts = this.contexts;
- for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i3 >= _iterator2.length) break;
- _ref2 = _iterator2[_i3++];
- } else {
- _i3 = _iterator2.next();
- if (_i3.done) break;
- _ref2 = _i3.value;
- }
- var context = _ref2;
- context.maybeQueue(pathToQueue);
- }
- }
- function _getQueueContexts() {
- var path = this;
- var contexts = this.contexts;
- while (!contexts.length) {
- path = path.parentPath;
- if (!path) break;
- contexts = path.contexts;
- }
- return contexts;
- }
- var NodePath_context = /*#__PURE__*/Object.freeze({
- __proto__: null,
- call: call,
- _call: _call,
- isBlacklisted: isBlacklisted,
- visit: visit$1,
- skip: skip,
- skipKey: skipKey,
- stop: stop,
- setScope: setScope,
- setContext: setContext,
- resync: resync,
- _resyncParent: _resyncParent,
- _resyncKey: _resyncKey,
- _resyncList: _resyncList,
- _resyncRemoved: _resyncRemoved,
- popContext: popContext,
- pushContext: pushContext,
- setup: setup$1,
- setKey: setKey,
- requeue: requeue,
- _getQueueContexts: _getQueueContexts
- });
- var hooks = [function (self, parent) {
- var removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
- if (removeParent) {
- parent.remove();
- return true;
- }
- }, function (self, parent) {
- if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
- parent.replaceWith(parent.node.expressions[0]);
- return true;
- }
- }, function (self, parent) {
- if (parent.isBinary()) {
- if (self.key === "left") {
- parent.replaceWith(parent.node.right);
- } else {
- parent.replaceWith(parent.node.left);
- }
- return true;
- }
- }, function (self, parent) {
- if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
- self.replaceWith({
- type: "BlockStatement",
- body: []
- });
- return true;
- }
- }];
- function remove() {
- this._assertUnremoved();
- this.resync();
- this._removeFromScope();
- if (this._callRemovalHooks()) {
- this._markRemoved();
- return;
- }
- this.shareCommentsWithSiblings();
- this._remove();
- this._markRemoved();
- }
- function _removeFromScope() {
- var _this = this;
- var bindings = this.getBindingIdentifiers();
- Object.keys(bindings).forEach(function (name) {
- return _this.scope.removeBinding(name);
- });
- }
- function _callRemovalHooks() {
- for (var _i = 0, _arr = hooks; _i < _arr.length; _i++) {
- var fn = _arr[_i];
- if (fn(this, this.parentPath)) return true;
- }
- }
- function _remove() {
- if (Array.isArray(this.container)) {
- this.container.splice(this.key, 1);
- this.updateSiblingKeys(this.key, -1);
- } else {
- this._replaceWith(null);
- }
- }
- function _markRemoved() {
- this._traverseFlags |= SHOULD_SKIP | REMOVED;
- this.node = null;
- }
- function _assertUnremoved() {
- if (this.removed) {
- throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
- }
- }
- var NodePath_removal = /*#__PURE__*/Object.freeze({
- __proto__: null,
- remove: remove,
- _removeFromScope: _removeFromScope,
- _callRemovalHooks: _callRemovalHooks,
- _remove: _remove,
- _markRemoved: _markRemoved,
- _assertUnremoved: _assertUnremoved
- });
- var referenceVisitor = {
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
- return;
- }
- if (path.node.name === "this") {
- var scope = path.scope;
- do {
- if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) {
- break;
- }
- } while (scope = scope.parent);
- if (scope) state.breakOnScopePaths.push(scope.path);
- }
- var binding = path.scope.getBinding(path.node.name);
- if (!binding) return;
- for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var violation = _ref;
- if (violation.scope !== binding.path.scope) {
- state.mutableBinding = true;
- path.stop();
- return;
- }
- }
- if (binding !== state.scope.getBinding(path.node.name)) return;
- state.bindings[path.node.name] = binding;
- }
- };
- var PathHoister = function () {
- function PathHoister(path, scope) {
- this.breakOnScopePaths = [];
- this.bindings = {};
- this.mutableBinding = false;
- this.scopes = [];
- this.scope = scope;
- this.path = path;
- this.attachAfter = false;
- }
- var _proto = PathHoister.prototype;
- _proto.isCompatibleScope = function isCompatibleScope(scope) {
- for (var _i2 = 0, _Object$keys = Object.keys(this.bindings); _i2 < _Object$keys.length; _i2++) {
- var key = _Object$keys[_i2];
- var binding = this.bindings[key];
- if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
- return false;
- }
- }
- return true;
- };
- _proto.getCompatibleScopes = function getCompatibleScopes() {
- var scope = this.path.scope;
- do {
- if (this.isCompatibleScope(scope)) {
- this.scopes.push(scope);
- } else {
- break;
- }
- if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {
- break;
- }
- } while (scope = scope.parent);
- };
- _proto.getAttachmentPath = function getAttachmentPath() {
- var path = this._getAttachmentPath();
- if (!path) return;
- var targetScope = path.scope;
- if (targetScope.path === path) {
- targetScope = path.scope.parent;
- }
- if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
- for (var _i3 = 0, _Object$keys2 = Object.keys(this.bindings); _i3 < _Object$keys2.length; _i3++) {
- var name = _Object$keys2[_i3];
- if (!targetScope.hasOwnBinding(name)) continue;
- var binding = this.bindings[name];
- if (binding.kind === "param" || binding.path.parentKey === "params") {
- continue;
- }
- var bindingParentPath = this.getAttachmentParentForPath(binding.path);
- if (bindingParentPath.key >= path.key) {
- this.attachAfter = true;
- path = binding.path;
- for (var _i4 = 0, _arr = binding.constantViolations; _i4 < _arr.length; _i4++) {
- var violationPath = _arr[_i4];
- if (this.getAttachmentParentForPath(violationPath).key > path.key) {
- path = violationPath;
- }
- }
- }
- }
- }
- return path;
- };
- _proto._getAttachmentPath = function _getAttachmentPath() {
- var scopes = this.scopes;
- var scope = scopes.pop();
- if (!scope) return;
- if (scope.path.isFunction()) {
- if (this.hasOwnParamBindings(scope)) {
- if (this.scope === scope) return;
- var bodies = scope.path.get("body").get("body");
- for (var i = 0; i < bodies.length; i++) {
- if (bodies[i].node._blockHoist) continue;
- return bodies[i];
- }
- } else {
- return this.getNextScopeAttachmentParent();
- }
- } else if (scope.path.isProgram()) {
- return this.getNextScopeAttachmentParent();
- }
- };
- _proto.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() {
- var scope = this.scopes.pop();
- if (scope) return this.getAttachmentParentForPath(scope.path);
- };
- _proto.getAttachmentParentForPath = function getAttachmentParentForPath(path) {
- do {
- if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
- return path;
- }
- } while (path = path.parentPath);
- };
- _proto.hasOwnParamBindings = function hasOwnParamBindings(scope) {
- for (var _i5 = 0, _Object$keys3 = Object.keys(this.bindings); _i5 < _Object$keys3.length; _i5++) {
- var name = _Object$keys3[_i5];
- if (!scope.hasOwnBinding(name)) continue;
- var binding = this.bindings[name];
- if (binding.kind === "param" && binding.constant) return true;
- }
- return false;
- };
- _proto.run = function run() {
- this.path.traverse(referenceVisitor, this);
- if (this.mutableBinding) return;
- this.getCompatibleScopes();
- var attachTo = this.getAttachmentPath();
- if (!attachTo) return;
- if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
- var uid = attachTo.scope.generateUidIdentifier("ref");
- var declarator = VariableDeclarator(uid, this.path.node);
- var insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
- var _attachTo$insertFn = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : VariableDeclaration("var", [declarator])]),
- attached = _attachTo$insertFn[0];
- var parent = this.path.parentPath;
- if (parent.isJSXElement() && this.path.container === parent.node.children) {
- uid = JSXExpressionContainer(uid);
- }
- this.path.replaceWith(cloneNode(uid));
- return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init");
- };
- return PathHoister;
- }();
- function insertBefore(nodes) {
- this._assertUnremoved();
- nodes = this._verifyNodeList(nodes);
- var parentPath = this.parentPath;
- if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
- return parentPath.insertBefore(nodes);
- } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
- if (this.node) nodes.push(this.node);
- return this.replaceExpressionWithStatements(nodes);
- } else if (Array.isArray(this.container)) {
- return this._containerInsertBefore(nodes);
- } else if (this.isStatementOrBlock()) {
- var shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
- this.replaceWith(BlockStatement(shouldInsertCurrentNode ? [this.node] : []));
- return this.unshiftContainer("body", nodes);
- } else {
- throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
- }
- }
- function _containerInsert(from, nodes) {
- var _this$container;
- this.updateSiblingKeys(from, nodes.length);
- var paths = [];
- (_this$container = this.container).splice.apply(_this$container, [from, 0].concat(nodes));
- for (var i = 0; i < nodes.length; i++) {
- var to = from + i;
- var path = this.getSibling(to);
- paths.push(path);
- if (this.context && this.context.queue) {
- path.pushContext(this.context);
- }
- }
- var contexts = this._getQueueContexts();
- for (var _i = 0, _paths = paths; _i < _paths.length; _i++) {
- var _path = _paths[_i];
- _path.setScope();
- _path.debug("Inserted.");
- for (var _iterator = contexts, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i2 >= _iterator.length) break;
- _ref = _iterator[_i2++];
- } else {
- _i2 = _iterator.next();
- if (_i2.done) break;
- _ref = _i2.value;
- }
- var context = _ref;
- context.maybeQueue(_path, true);
- }
- }
- return paths;
- }
- function _containerInsertBefore(nodes) {
- return this._containerInsert(this.key, nodes);
- }
- function _containerInsertAfter(nodes) {
- return this._containerInsert(this.key + 1, nodes);
- }
- function insertAfter(nodes) {
- this._assertUnremoved();
- nodes = this._verifyNodeList(nodes);
- var parentPath = this.parentPath;
- if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || parentPath.isExportNamedDeclaration() || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) {
- return parentPath.insertAfter(nodes.map(function (node) {
- return isExpression(node) ? ExpressionStatement(node) : node;
- }));
- } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") {
- if (this.node) {
- var scope = this.scope;
- if (parentPath.isMethod({
- computed: true,
- key: this.node
- })) {
- scope = scope.parent;
- }
- var temp = scope.generateDeclaredUidIdentifier();
- nodes.unshift(ExpressionStatement(AssignmentExpression("=", cloneNode(temp), this.node)));
- nodes.push(ExpressionStatement(cloneNode(temp)));
- }
- return this.replaceExpressionWithStatements(nodes);
- } else if (Array.isArray(this.container)) {
- return this._containerInsertAfter(nodes);
- } else if (this.isStatementOrBlock()) {
- var shouldInsertCurrentNode = this.node && (!this.isExpressionStatement() || this.node.expression != null);
- this.replaceWith(BlockStatement(shouldInsertCurrentNode ? [this.node] : []));
- return this.pushContainer("body", nodes);
- } else {
- throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?");
- }
- }
- function updateSiblingKeys(fromIndex, incrementBy) {
- if (!this.parent) return;
- var paths = path.get(this.parent);
- for (var i = 0; i < paths.length; i++) {
- var path$1 = paths[i];
- if (path$1.key >= fromIndex) {
- path$1.key += incrementBy;
- }
- }
- }
- function _verifyNodeList(nodes) {
- if (!nodes) {
- return [];
- }
- if (nodes.constructor !== Array) {
- nodes = [nodes];
- }
- for (var i = 0; i < nodes.length; i++) {
- var node = nodes[i];
- var msg = void 0;
- if (!node) {
- msg = "has falsy node";
- } else if (typeof node !== "object") {
- msg = "contains a non-object node";
- } else if (!node.type) {
- msg = "without a type";
- } else if (node instanceof NodePath) {
- msg = "has a NodePath when it expected a raw object";
- }
- if (msg) {
- var type = Array.isArray(node) ? "array" : typeof node;
- throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type);
- }
- }
- return nodes;
- }
- function unshiftContainer(listKey, nodes) {
- this._assertUnremoved();
- nodes = this._verifyNodeList(nodes);
- var path = NodePath.get({
- parentPath: this,
- parent: this.node,
- container: this.node[listKey],
- listKey: listKey,
- key: 0
- });
- return path._containerInsertBefore(nodes);
- }
- function pushContainer(listKey, nodes) {
- this._assertUnremoved();
- nodes = this._verifyNodeList(nodes);
- var container = this.node[listKey];
- var path = NodePath.get({
- parentPath: this,
- parent: this.node,
- container: container,
- listKey: listKey,
- key: container.length
- });
- return path.replaceWithMultiple(nodes);
- }
- function hoist(scope) {
- if (scope === void 0) {
- scope = this.scope;
- }
- var hoister = new PathHoister(this, scope);
- return hoister.run();
- }
- var NodePath_modification = /*#__PURE__*/Object.freeze({
- __proto__: null,
- insertBefore: insertBefore,
- _containerInsert: _containerInsert,
- _containerInsertBefore: _containerInsertBefore,
- _containerInsertAfter: _containerInsertAfter,
- insertAfter: insertAfter,
- updateSiblingKeys: updateSiblingKeys,
- _verifyNodeList: _verifyNodeList,
- unshiftContainer: unshiftContainer,
- pushContainer: pushContainer,
- hoist: hoist
- });
- function getOpposite() {
- if (this.key === "left") {
- return this.getSibling("right");
- } else if (this.key === "right") {
- return this.getSibling("left");
- }
- }
- function addCompletionRecords(path, paths) {
- if (path) return paths.concat(path.getCompletionRecords());
- return paths;
- }
- function completionRecordForSwitch(cases, paths) {
- var isLastCaseWithConsequent = true;
- for (var i = cases.length - 1; i >= 0; i--) {
- var switchCase = cases[i];
- var consequent = switchCase.get("consequent");
- var breakStatement = void 0;
- findBreak: for (var _iterator = consequent, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var statement = _ref;
- if (statement.isBlockStatement()) {
- for (var _iterator2 = statement.get("body"), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var statementInBlock = _ref2;
- if (statementInBlock.isBreakStatement()) {
- breakStatement = statementInBlock;
- break findBreak;
- }
- }
- } else if (statement.isBreakStatement()) {
- breakStatement = statement;
- break;
- }
- }
- if (breakStatement) {
- while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) {
- breakStatement = breakStatement.parentPath;
- }
- var prevSibling = breakStatement.getPrevSibling();
- if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) {
- paths = addCompletionRecords(prevSibling, paths);
- breakStatement.remove();
- } else {
- breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());
- paths = addCompletionRecords(breakStatement, paths);
- }
- } else if (isLastCaseWithConsequent) {
- (function () {
- var statementFinder = function statementFinder(statement) {
- return !statement.isBlockStatement() || statement.get("body").some(statementFinder);
- };
- var hasConsequent = consequent.some(statementFinder);
- if (hasConsequent) {
- paths = addCompletionRecords(consequent[consequent.length - 1], paths);
- isLastCaseWithConsequent = false;
- }
- })();
- }
- }
- return paths;
- }
- function getCompletionRecords() {
- var paths = [];
- if (this.isIfStatement()) {
- paths = addCompletionRecords(this.get("consequent"), paths);
- paths = addCompletionRecords(this.get("alternate"), paths);
- } else if (this.isDoExpression() || this.isFor() || this.isWhile()) {
- paths = addCompletionRecords(this.get("body"), paths);
- } else if (this.isProgram() || this.isBlockStatement()) {
- paths = addCompletionRecords(this.get("body").pop(), paths);
- } else if (this.isFunction()) {
- return this.get("body").getCompletionRecords();
- } else if (this.isTryStatement()) {
- paths = addCompletionRecords(this.get("block"), paths);
- paths = addCompletionRecords(this.get("handler"), paths);
- } else if (this.isCatchClause()) {
- paths = addCompletionRecords(this.get("body"), paths);
- } else if (this.isSwitchStatement()) {
- paths = completionRecordForSwitch(this.get("cases"), paths);
- } else {
- paths.push(this);
- }
- return paths;
- }
- function getSibling(key) {
- return NodePath.get({
- parentPath: this.parentPath,
- parent: this.parent,
- container: this.container,
- listKey: this.listKey,
- key: key
- });
- }
- function getPrevSibling() {
- return this.getSibling(this.key - 1);
- }
- function getNextSibling() {
- return this.getSibling(this.key + 1);
- }
- function getAllNextSiblings() {
- var _key = this.key;
- var sibling = this.getSibling(++_key);
- var siblings = [];
- while (sibling.node) {
- siblings.push(sibling);
- sibling = this.getSibling(++_key);
- }
- return siblings;
- }
- function getAllPrevSiblings() {
- var _key = this.key;
- var sibling = this.getSibling(--_key);
- var siblings = [];
- while (sibling.node) {
- siblings.push(sibling);
- sibling = this.getSibling(--_key);
- }
- return siblings;
- }
- function get(key, context) {
- if (context === true) context = this.context;
- var parts = key.split(".");
- if (parts.length === 1) {
- return this._getKey(key, context);
- } else {
- return this._getPattern(parts, context);
- }
- }
- function _getKey(key, context) {
- var _this = this;
- var node = this.node;
- var container = node[key];
- if (Array.isArray(container)) {
- return container.map(function (_, i) {
- return NodePath.get({
- listKey: key,
- parentPath: _this,
- parent: node,
- container: container,
- key: i
- }).setContext(context);
- });
- } else {
- return NodePath.get({
- parentPath: this,
- parent: node,
- container: node,
- key: key
- }).setContext(context);
- }
- }
- function _getPattern(parts, context) {
- var path = this;
- for (var _iterator3 = parts, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
- var part = _ref3;
- if (part === ".") {
- path = path.parentPath;
- } else {
- if (Array.isArray(path)) {
- path = path[part];
- } else {
- path = path.get(part, context);
- }
- }
- }
- return path;
- }
- function getBindingIdentifiers$1(duplicates) {
- return getBindingIdentifiers(this.node, duplicates);
- }
- function getOuterBindingIdentifiers$1(duplicates) {
- return getOuterBindingIdentifiers(this.node, duplicates);
- }
- function getBindingIdentifierPaths(duplicates, outerOnly) {
- if (duplicates === void 0) {
- duplicates = false;
- }
- if (outerOnly === void 0) {
- outerOnly = false;
- }
- var path = this;
- var search = [].concat(path);
- var ids = Object.create(null);
- while (search.length) {
- var id = search.shift();
- if (!id) continue;
- if (!id.node) continue;
- var keys = getBindingIdentifiers.keys[id.node.type];
- if (id.isIdentifier()) {
- if (duplicates) {
- var _ids = ids[id.node.name] = ids[id.node.name] || [];
- _ids.push(id);
- } else {
- ids[id.node.name] = id;
- }
- continue;
- }
- if (id.isExportDeclaration()) {
- var declaration = id.get("declaration");
- if (declaration.isDeclaration()) {
- search.push(declaration);
- }
- continue;
- }
- if (outerOnly) {
- if (id.isFunctionDeclaration()) {
- search.push(id.get("id"));
- continue;
- }
- if (id.isFunctionExpression()) {
- continue;
- }
- }
- if (keys) {
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- var child = id.get(key);
- if (Array.isArray(child) || child.node) {
- search = search.concat(child);
- }
- }
- }
- }
- return ids;
- }
- function getOuterBindingIdentifierPaths(duplicates) {
- return this.getBindingIdentifierPaths(duplicates, true);
- }
- var NodePath_family = /*#__PURE__*/Object.freeze({
- __proto__: null,
- getOpposite: getOpposite,
- getCompletionRecords: getCompletionRecords,
- getSibling: getSibling,
- getPrevSibling: getPrevSibling,
- getNextSibling: getNextSibling,
- getAllNextSiblings: getAllNextSiblings,
- getAllPrevSiblings: getAllPrevSiblings,
- get: get,
- _getKey: _getKey,
- _getPattern: _getPattern,
- getBindingIdentifiers: getBindingIdentifiers$1,
- getOuterBindingIdentifiers: getOuterBindingIdentifiers$1,
- getBindingIdentifierPaths: getBindingIdentifierPaths,
- getOuterBindingIdentifierPaths: getOuterBindingIdentifierPaths
- });
- function shareCommentsWithSiblings() {
- if (typeof this.key === "string") return;
- var node = this.node;
- if (!node) return;
- var trailing = node.trailingComments;
- var leading = node.leadingComments;
- if (!trailing && !leading) return;
- var prev = this.getSibling(this.key - 1);
- var next = this.getSibling(this.key + 1);
- var hasPrev = Boolean(prev.node);
- var hasNext = Boolean(next.node);
- if (hasPrev && hasNext) ; else if (hasPrev) {
- prev.addComments("trailing", trailing);
- } else if (hasNext) {
- next.addComments("leading", leading);
- }
- }
- function addComment$1(type, content, line) {
- addComment(this.node, type, content, line);
- }
- function addComments$1(type, comments) {
- addComments(this.node, type, comments);
- }
- var NodePath_comments = /*#__PURE__*/Object.freeze({
- __proto__: null,
- shareCommentsWithSiblings: shareCommentsWithSiblings,
- addComment: addComment$1,
- addComments: addComments$1
- });
- var _debug = browser$1("babel");
- var REMOVED = 1 << 0;
- var SHOULD_STOP = 1 << 1;
- var SHOULD_SKIP = 1 << 2;
- var NodePath = function () {
- function NodePath(hub, parent) {
- this.parent = parent;
- this.hub = hub;
- this.contexts = [];
- this.data = null;
- this._traverseFlags = 0;
- this.state = null;
- this.opts = null;
- this.skipKeys = null;
- this.parentPath = null;
- this.context = null;
- this.container = null;
- this.listKey = null;
- this.key = null;
- this.node = null;
- this.scope = null;
- this.type = null;
- }
- NodePath.get = function get(_ref) {
- var hub = _ref.hub,
- parentPath = _ref.parentPath,
- parent = _ref.parent,
- container = _ref.container,
- listKey = _ref.listKey,
- key = _ref.key;
- if (!hub && parentPath) {
- hub = parentPath.hub;
- }
- if (!parent) {
- throw new Error("To get a node path the parent needs to exist");
- }
- var targetNode = container[key];
- var paths = path.get(parent) || [];
- if (!path.has(parent)) {
- path.set(parent, paths);
- }
- var path$1;
- for (var i = 0; i < paths.length; i++) {
- var pathCheck = paths[i];
- if (pathCheck.node === targetNode) {
- path$1 = pathCheck;
- break;
- }
- }
- if (!path$1) {
- path$1 = new NodePath(hub, parent);
- paths.push(path$1);
- }
- path$1.setup(parentPath, container, listKey, key);
- return path$1;
- };
- var _proto = NodePath.prototype;
- _proto.getScope = function getScope(scope) {
- return this.isScope() ? new Scope$1(this) : scope;
- };
- _proto.setData = function setData(key, val) {
- if (this.data == null) {
- this.data = Object.create(null);
- }
- return this.data[key] = val;
- };
- _proto.getData = function getData(key, def) {
- if (this.data == null) {
- this.data = Object.create(null);
- }
- var val = this.data[key];
- if (val === undefined && def !== undefined) val = this.data[key] = def;
- return val;
- };
- _proto.buildCodeFrameError = function buildCodeFrameError(msg, Error) {
- if (Error === void 0) {
- Error = SyntaxError;
- }
- return this.hub.buildError(this.node, msg, Error);
- };
- _proto.traverse = function traverse(visitor, state) {
- traverse$1(this.node, visitor, this.scope, state, this);
- };
- _proto.set = function set(key, node) {
- validate(this.node, key, node);
- this.node[key] = node;
- };
- _proto.getPathLocation = function getPathLocation() {
- var parts = [];
- var path = this;
- do {
- var key = path.key;
- if (path.inList) key = path.listKey + "[" + key + "]";
- parts.unshift(key);
- } while (path = path.parentPath);
- return parts.join(".");
- };
- _proto.debug = function debug(message) {
- if (!_debug.enabled) return;
- _debug(this.getPathLocation() + " " + this.type + ": " + message);
- };
- _proto.toString = function toString() {
- return generateCode(this.node).code;
- };
- _createClass(NodePath, [{
- key: "inList",
- get: function get() {
- return !!this.listKey;
- },
- set: function set(inList) {
- if (!inList) {
- this.listKey = null;
- }
- }
- }, {
- key: "parentKey",
- get: function get() {
- return this.listKey || this.key;
- }
- }, {
- key: "shouldSkip",
- get: function get() {
- return !!(this._traverseFlags & SHOULD_SKIP);
- },
- set: function set(v) {
- if (v) {
- this._traverseFlags |= SHOULD_SKIP;
- } else {
- this._traverseFlags &= ~SHOULD_SKIP;
- }
- }
- }, {
- key: "shouldStop",
- get: function get() {
- return !!(this._traverseFlags & SHOULD_STOP);
- },
- set: function set(v) {
- if (v) {
- this._traverseFlags |= SHOULD_STOP;
- } else {
- this._traverseFlags &= ~SHOULD_STOP;
- }
- }
- }, {
- key: "removed",
- get: function get() {
- return !!(this._traverseFlags & REMOVED);
- },
- set: function set(v) {
- if (v) {
- this._traverseFlags |= REMOVED;
- } else {
- this._traverseFlags &= ~REMOVED;
- }
- }
- }]);
- return NodePath;
- }();
- Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
- var _loop = function _loop() {
- var type = _arr[_i$2];
- var typeKey = "is" + type;
- var fn = t[typeKey];
- NodePath.prototype[typeKey] = function (opts) {
- return fn(this.node, opts);
- };
- NodePath.prototype["assert" + type] = function (opts) {
- if (!fn(this.node, opts)) {
- throw new TypeError("Expected node path of type " + type);
- }
- };
- };
- for (var _i$2 = 0, _arr = TYPES; _i$2 < _arr.length; _i$2++) {
- _loop();
- }
- var _loop2 = function _loop2() {
- var type = _Object$keys[_i2];
- if (type[0] === "_") return "continue";
- if (TYPES.indexOf(type) < 0) TYPES.push(type);
- var virtualType = virtualTypes[type];
- NodePath.prototype["is" + type] = function (opts) {
- return virtualType.checkPath(this, opts);
- };
- };
- for (var _i2 = 0, _Object$keys = Object.keys(virtualTypes); _i2 < _Object$keys.length; _i2++) {
- var _ret = _loop2();
- if (_ret === "continue") continue;
- }
- var TraversalContext = function () {
- function TraversalContext(scope, opts, state, parentPath) {
- this.queue = null;
- this.parentPath = parentPath;
- this.scope = scope;
- this.state = state;
- this.opts = opts;
- }
- var _proto = TraversalContext.prototype;
- _proto.shouldVisit = function shouldVisit(node) {
- var opts = this.opts;
- if (opts.enter || opts.exit) return true;
- if (opts[node.type]) return true;
- var keys = VISITOR_KEYS[node.type];
- if (!keys || !keys.length) return false;
- for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var key = _ref;
- if (node[key]) return true;
- }
- return false;
- };
- _proto.create = function create(node, obj, key, listKey) {
- return NodePath.get({
- parentPath: this.parentPath,
- parent: node,
- container: obj,
- key: key,
- listKey: listKey
- });
- };
- _proto.maybeQueue = function maybeQueue(path, notPriority) {
- if (this.trap) {
- throw new Error("Infinite cycle detected");
- }
- if (this.queue) {
- if (notPriority) {
- this.queue.push(path);
- } else {
- this.priorityQueue.push(path);
- }
- }
- };
- _proto.visitMultiple = function visitMultiple(container, parent, listKey) {
- if (container.length === 0) return false;
- var queue = [];
- for (var key = 0; key < container.length; key++) {
- var node = container[key];
- if (node && this.shouldVisit(node)) {
- queue.push(this.create(parent, container, key, listKey));
- }
- }
- return this.visitQueue(queue);
- };
- _proto.visitSingle = function visitSingle(node, key) {
- if (this.shouldVisit(node[key])) {
- return this.visitQueue([this.create(node, node, key)]);
- } else {
- return false;
- }
- };
- _proto.visitQueue = function visitQueue(queue) {
- this.queue = queue;
- this.priorityQueue = [];
- var visited = [];
- var stop = false;
- for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var path = _ref2;
- path.resync();
- if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
- path.pushContext(this);
- }
- if (path.key === null) continue;
- if (visited.indexOf(path.node) >= 0) continue;
- visited.push(path.node);
- if (path.visit()) {
- stop = true;
- break;
- }
- if (this.priorityQueue.length) {
- stop = this.visitQueue(this.priorityQueue);
- this.priorityQueue = [];
- this.queue = queue;
- if (stop) break;
- }
- }
- for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
- var _path = _ref3;
- _path.popContext();
- }
- this.queue = null;
- return stop;
- };
- _proto.visit = function visit(node, key) {
- var nodes = node[key];
- if (!nodes) return false;
- if (Array.isArray(nodes)) {
- return this.visitMultiple(nodes, node, key);
- } else {
- return this.visitSingle(node, key);
- }
- };
- return TraversalContext;
- }();
- function explode(visitor) {
- if (visitor._exploded) return visitor;
- visitor._exploded = true;
- for (var _i = 0, _Object$keys = Object.keys(visitor); _i < _Object$keys.length; _i++) {
- var nodeType = _Object$keys[_i];
- if (shouldIgnoreKey(nodeType)) continue;
- var parts = nodeType.split("|");
- if (parts.length === 1) continue;
- var fns = visitor[nodeType];
- delete visitor[nodeType];
- for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i5 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i5 >= _iterator.length) break;
- _ref = _iterator[_i5++];
- } else {
- _i5 = _iterator.next();
- if (_i5.done) break;
- _ref = _i5.value;
- }
- var part = _ref;
- visitor[part] = fns;
- }
- }
- verify(visitor);
- delete visitor.__esModule;
- ensureEntranceObjects(visitor);
- ensureCallbackArrays(visitor);
- for (var _i2 = 0, _arr = Object.keys(visitor); _i2 < _arr.length; _i2++) {
- var _nodeType = _arr[_i2];
- if (shouldIgnoreKey(_nodeType)) continue;
- var wrapper = virtualTypes[_nodeType];
- if (!wrapper) continue;
- var _fns = visitor[_nodeType];
- for (var _i6 = 0, _Object$keys4 = Object.keys(_fns); _i6 < _Object$keys4.length; _i6++) {
- var _type = _Object$keys4[_i6];
- _fns[_type] = wrapCheck(wrapper, _fns[_type]);
- }
- delete visitor[_nodeType];
- if (wrapper.types) {
- for (var _i7 = 0, _arr2 = wrapper.types; _i7 < _arr2.length; _i7++) {
- var type = _arr2[_i7];
- if (visitor[type]) {
- mergePair(visitor[type], _fns);
- } else {
- visitor[type] = _fns;
- }
- }
- } else {
- mergePair(visitor, _fns);
- }
- }
- for (var _i3 = 0, _Object$keys2 = Object.keys(visitor); _i3 < _Object$keys2.length; _i3++) {
- var _nodeType2 = _Object$keys2[_i3];
- if (shouldIgnoreKey(_nodeType2)) continue;
- var _fns2 = visitor[_nodeType2];
- var aliases = FLIPPED_ALIAS_KEYS[_nodeType2];
- var deprecratedKey = DEPRECATED_KEYS[_nodeType2];
- if (deprecratedKey) {
- console.trace("Visitor defined for " + _nodeType2 + " but it has been renamed to " + deprecratedKey);
- aliases = [deprecratedKey];
- }
- if (!aliases) continue;
- delete visitor[_nodeType2];
- for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i8 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i8 >= _iterator2.length) break;
- _ref2 = _iterator2[_i8++];
- } else {
- _i8 = _iterator2.next();
- if (_i8.done) break;
- _ref2 = _i8.value;
- }
- var alias = _ref2;
- var existing = visitor[alias];
- if (existing) {
- mergePair(existing, _fns2);
- } else {
- visitor[alias] = clone_1(_fns2);
- }
- }
- }
- for (var _i4 = 0, _Object$keys3 = Object.keys(visitor); _i4 < _Object$keys3.length; _i4++) {
- var _nodeType3 = _Object$keys3[_i4];
- if (shouldIgnoreKey(_nodeType3)) continue;
- ensureCallbackArrays(visitor[_nodeType3]);
- }
- return visitor;
- }
- function verify(visitor) {
- if (visitor._verified) return;
- if (typeof visitor === "function") {
- throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
- }
- for (var _i9 = 0, _Object$keys5 = Object.keys(visitor); _i9 < _Object$keys5.length; _i9++) {
- var nodeType = _Object$keys5[_i9];
- if (nodeType === "enter" || nodeType === "exit") {
- validateVisitorMethods(nodeType, visitor[nodeType]);
- }
- if (shouldIgnoreKey(nodeType)) continue;
- if (TYPES.indexOf(nodeType) < 0) {
- throw new Error("You gave us a visitor for the node type " + nodeType + " but it's not a valid type");
- }
- var visitors = visitor[nodeType];
- if (typeof visitors === "object") {
- for (var _i10 = 0, _Object$keys6 = Object.keys(visitors); _i10 < _Object$keys6.length; _i10++) {
- var visitorKey = _Object$keys6[_i10];
- if (visitorKey === "enter" || visitorKey === "exit") {
- validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]);
- } else {
- throw new Error("You passed `traverse()` a visitor object with the property " + (nodeType + " that has the invalid property " + visitorKey));
- }
- }
- }
- }
- visitor._verified = true;
- }
- function validateVisitorMethods(path, val) {
- var fns = [].concat(val);
- for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i11 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i11 >= _iterator3.length) break;
- _ref3 = _iterator3[_i11++];
- } else {
- _i11 = _iterator3.next();
- if (_i11.done) break;
- _ref3 = _i11.value;
- }
- var fn = _ref3;
- if (typeof fn !== "function") {
- throw new TypeError("Non-function found defined in " + path + " with type " + typeof fn);
- }
- }
- }
- function merge$1(visitors, states, wrapper) {
- if (states === void 0) {
- states = [];
- }
- var rootVisitor = {};
- for (var i = 0; i < visitors.length; i++) {
- var visitor = visitors[i];
- var state = states[i];
- explode(visitor);
- for (var _i12 = 0, _Object$keys7 = Object.keys(visitor); _i12 < _Object$keys7.length; _i12++) {
- var type = _Object$keys7[_i12];
- var visitorType = visitor[type];
- if (state || wrapper) {
- visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
- }
- var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
- mergePair(nodeVisitor, visitorType);
- }
- }
- return rootVisitor;
- }
- function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
- var newVisitor = {};
- var _loop = function _loop() {
- var key = _Object$keys8[_i13];
- var fns = oldVisitor[key];
- if (!Array.isArray(fns)) return "continue";
- fns = fns.map(function (fn) {
- var newFn = fn;
- if (state) {
- newFn = function newFn(path) {
- return fn.call(state, path, state);
- };
- }
- if (wrapper) {
- newFn = wrapper(state.key, key, newFn);
- }
- if (newFn !== fn) {
- newFn.toString = function () {
- return fn.toString();
- };
- }
- return newFn;
- });
- newVisitor[key] = fns;
- };
- for (var _i13 = 0, _Object$keys8 = Object.keys(oldVisitor); _i13 < _Object$keys8.length; _i13++) {
- var _ret = _loop();
- if (_ret === "continue") continue;
- }
- return newVisitor;
- }
- function ensureEntranceObjects(obj) {
- for (var _i14 = 0, _Object$keys9 = Object.keys(obj); _i14 < _Object$keys9.length; _i14++) {
- var key = _Object$keys9[_i14];
- if (shouldIgnoreKey(key)) continue;
- var fns = obj[key];
- if (typeof fns === "function") {
- obj[key] = {
- enter: fns
- };
- }
- }
- }
- function ensureCallbackArrays(obj) {
- if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
- if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
- }
- function wrapCheck(wrapper, fn) {
- var newFn = function newFn(path) {
- if (wrapper.checkPath(path)) {
- return fn.apply(this, arguments);
- }
- };
- newFn.toString = function () {
- return fn.toString();
- };
- return newFn;
- }
- function shouldIgnoreKey(key) {
- if (key[0] === "_") return true;
- if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
- if (key === "blacklist" || key === "noScope" || key === "skipKeys") {
- return true;
- }
- return false;
- }
- function mergePair(dest, src) {
- for (var _i15 = 0, _Object$keys10 = Object.keys(src); _i15 < _Object$keys10.length; _i15++) {
- var key = _Object$keys10[_i15];
- dest[key] = [].concat(dest[key] || [], src[key]);
- }
- }
- var visitors = /*#__PURE__*/Object.freeze({
- __proto__: null,
- explode: explode,
- verify: verify,
- merge: merge$1
- });
- function traverse$1(parent, opts, scope, state, parentPath) {
- if (!parent) return;
- if (!opts) opts = {};
- if (!opts.noScope && !scope) {
- if (parent.type !== "Program" && parent.type !== "File") {
- throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + ("Instead of that you tried to traverse a " + parent.type + " node without ") + "passing scope and parentPath.");
- }
- }
- if (!VISITOR_KEYS[parent.type]) {
- return;
- }
- explode(opts);
- traverse$1.node(parent, opts, scope, state, parentPath);
- }
- traverse$1.visitors = visitors;
- traverse$1.verify = verify;
- traverse$1.explode = explode;
- traverse$1.cheap = function (node, enter) {
- return traverseFast(node, enter);
- };
- traverse$1.node = function (node, opts, scope, state, parentPath, skipKeys) {
- var keys = VISITOR_KEYS[node.type];
- if (!keys) return;
- var context = new TraversalContext(scope, opts, state, parentPath);
- for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var key = _ref;
- if (skipKeys && skipKeys[key]) continue;
- if (context.visit(node, key)) return;
- }
- };
- traverse$1.clearNode = function (node, opts) {
- removeProperties(node, opts);
- path["delete"](node);
- };
- traverse$1.removeProperties = function (tree, opts) {
- traverseFast(tree, traverse$1.clearNode, opts);
- return tree;
- };
- function hasBlacklistedType(path, state) {
- if (path.node.type === state.type) {
- state.has = true;
- path.stop();
- }
- }
- traverse$1.hasType = function (tree, type, blacklistTypes) {
- if (includes_1(blacklistTypes, tree.type)) return false;
- if (tree.type === type) return true;
- var state = {
- has: false,
- type: type
- };
- traverse$1(tree, {
- noScope: true,
- blacklist: blacklistTypes,
- enter: hasBlacklistedType
- }, null, state);
- return state.has;
- };
- traverse$1.cache = cache;
- function _templateObject73() {
- var data = _taggedTemplateLiteralLoose(["\n import wrapNativeSuper from \"wrapNativeSuper\";\n import getPrototypeOf from \"getPrototypeOf\";\n import possibleConstructorReturn from \"possibleConstructorReturn\";\n import inherits from \"inherits\";\n\n export default function _wrapRegExp(re, groups) {\n _wrapRegExp = function(re, groups) {\n return new BabelRegExp(re, undefined, groups);\n };\n\n var _RegExp = wrapNativeSuper(RegExp);\n var _super = RegExp.prototype;\n var _groups = new WeakMap();\n\n function BabelRegExp(re, flags, groups) {\n var _this = _RegExp.call(this, re, flags);\n // if the regex is recreated with 'g' flag\n _groups.set(_this, groups || _groups.get(re));\n return _this;\n }\n inherits(BabelRegExp, _RegExp);\n\n BabelRegExp.prototype.exec = function(str) {\n var result = _super.exec.call(this, str);\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this);\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)>/g, function(_, name) {\n return \"$\" + groups[name];\n })\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return _super[Symbol.replace].call(\n this,\n str,\n function() {\n var args = [];\n args.push.apply(args, arguments);\n if (typeof args[args.length - 1] !== \"object\") {\n // Modern engines already pass result.groups as the last arg.\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n }\n );\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n }\n\n function buildGroups(result, re) {\n // NOTE: This function should return undefined if there are no groups,\n // but in that case Babel doesn't add the wrapper anyway.\n\n var g = _groups.get(re);\n return Object.keys(g).reduce(function(groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments);\n }\n"], ["\n import wrapNativeSuper from \"wrapNativeSuper\";\n import getPrototypeOf from \"getPrototypeOf\";\n import possibleConstructorReturn from \"possibleConstructorReturn\";\n import inherits from \"inherits\";\n\n export default function _wrapRegExp(re, groups) {\n _wrapRegExp = function(re, groups) {\n return new BabelRegExp(re, undefined, groups);\n };\n\n var _RegExp = wrapNativeSuper(RegExp);\n var _super = RegExp.prototype;\n var _groups = new WeakMap();\n\n function BabelRegExp(re, flags, groups) {\n var _this = _RegExp.call(this, re, flags);\n // if the regex is recreated with 'g' flag\n _groups.set(_this, groups || _groups.get(re));\n return _this;\n }\n inherits(BabelRegExp, _RegExp);\n\n BabelRegExp.prototype.exec = function(str) {\n var result = _super.exec.call(this, str);\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n if (typeof substitution === \"string\") {\n var groups = _groups.get(this);\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\\\$<([^>]+)>/g, function(_, name) {\n return \"$\" + groups[name];\n })\n );\n } else if (typeof substitution === \"function\") {\n var _this = this;\n return _super[Symbol.replace].call(\n this,\n str,\n function() {\n var args = [];\n args.push.apply(args, arguments);\n if (typeof args[args.length - 1] !== \"object\") {\n // Modern engines already pass result.groups as the last arg.\n args.push(buildGroups(args, _this));\n }\n return substitution.apply(this, args);\n }\n );\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n }\n\n function buildGroups(result, re) {\n // NOTE: This function should return undefined if there are no groups,\n // but in that case Babel doesn't add the wrapper anyway.\n\n var g = _groups.get(re);\n return Object.keys(g).reduce(function(groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments);\n }\n"]);
- _templateObject73 = function _templateObject73() {
- return data;
- };
- return data;
- }
- function _templateObject72() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateMethodSet() {\n throw new TypeError(\"attempted to reassign private method\");\n }\n"]);
- _templateObject72 = function _templateObject72() {
- return data;
- };
- return data;
- }
- function _templateObject71() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateMethodGet(receiver, privateSet, fn) {\n if (!privateSet.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return fn;\n }\n"]);
- _templateObject71 = function _templateObject71() {
- return data;
- };
- return data;
- }
- function _templateObject70() {
- var data = _taggedTemplateLiteralLoose(["\n import toArray from \"toArray\";\n import toPropertyKey from \"toPropertyKey\";\n\n // These comments are stripped by @babel/template\n /*::\n type PropertyDescriptor =\n | {\n value: any,\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n }\n | {\n get?: () => any,\n set?: (v: any) => void,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type FieldDescriptor ={\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type Placement = \"static\" | \"prototype\" | \"own\";\n type Key = string | symbol; // PrivateName is not supported yet.\n\n type ElementDescriptor =\n | {\n kind: \"method\",\n key: Key,\n placement: Placement,\n descriptor: PropertyDescriptor\n }\n | {\n kind: \"field\",\n key: Key,\n placement: Placement,\n descriptor: FieldDescriptor,\n initializer?: () => any,\n };\n\n // This is exposed to the user code\n type ElementObjectInput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n };\n\n // This is exposed to the user code\n type ElementObjectOutput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n extras?: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n // This is exposed to the user code\n type ClassObject = {\n [@@toStringTag]?: \"Descriptor\",\n kind: \"class\",\n elements: ElementDescriptor[],\n };\n\n type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput;\n type ClassDecorator = (descriptor: ClassObject) => ?ClassObject;\n type ClassFinisher = <A, B>(cl: Class<A>) => Class<B>;\n\n // Only used by Babel in the transform output, not part of the spec.\n type ElementDefinition =\n | {\n kind: \"method\",\n value: any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n }\n | {\n kind: \"field\",\n value: () => any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n };\n\n declare function ClassFactory<C>(initialize: (instance: C) => void): {\n F: Class<C>,\n d: ElementDefinition[]\n }\n\n */\n\n /*::\n // Various combinations with/without extras and with one or many finishers\n\n type ElementFinisherExtras = {\n element: ElementDescriptor,\n finisher?: ClassFinisher,\n extras?: ElementDescriptor[],\n };\n\n type ElementFinishersExtras = {\n element: ElementDescriptor,\n finishers: ClassFinisher[],\n extras: ElementDescriptor[],\n };\n\n type ElementsFinisher = {\n elements: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n type ElementsFinishers = {\n elements: ElementDescriptor[],\n finishers: ClassFinisher[],\n };\n\n */\n\n /*::\n\n type Placements = {\n static: Key[],\n prototype: Key[],\n own: Key[],\n };\n\n */\n\n // ClassDefinitionEvaluation (Steps 26-*)\n export default function _decorate(\n decorators /*: ClassDecorator[] */,\n factory /*: ClassFactory */,\n superClass /*: ?Class<*> */,\n mixins /*: ?Array<Function> */,\n ) /*: Class<*> */ {\n var api = _getDecoratorsApi();\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators,\n );\n\n api.initializeClassElements(r.F, decorated.elements);\n\n return api.runClassFinishers(r.F, decorated.finishers);\n }\n\n function _getDecoratorsApi() {\n _getDecoratorsApi = function() {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [[\"method\"], [\"field\"]],\n\n // InitializeInstanceElements\n initializeInstanceElements: function(\n /*::<C>*/ O /*: C */,\n elements /*: ElementDescriptor[] */,\n ) {\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (element.kind === kind && element.placement === \"own\") {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n\n // InitializeClassElements\n initializeClassElements: function(\n /*::<C>*/ F /*: Class<C> */,\n elements /*: ElementDescriptor[] */,\n ) {\n var proto = F.prototype;\n\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n var placement = element.placement;\n if (\n element.kind === kind &&\n (placement === \"static\" || placement === \"prototype\")\n ) {\n var receiver = placement === \"static\" ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n\n // DefineClassElement\n defineClassElement: function(\n /*::<C>*/ receiver /*: C | Class<C> */,\n element /*: ElementDescriptor */,\n ) {\n var descriptor /*: PropertyDescriptor */ = element.descriptor;\n if (element.kind === \"field\") {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver),\n };\n }\n Object.defineProperty(receiver, element.key, descriptor);\n },\n\n // DecorateClass\n decorateClass: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var newElements /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n var placements /*: Placements */ = {\n static: [],\n prototype: [],\n own: [],\n };\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n this.addElementPlacement(element, placements);\n }, this);\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (!_hasDecorators(element)) return newElements.push(element);\n\n var elementFinishersExtras /*: ElementFinishersExtras */ = this.decorateElement(\n element,\n placements,\n );\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return { elements: newElements, finishers: finishers };\n }\n\n var result /*: ElementsFinishers */ = this.decorateConstructor(\n newElements,\n decorators,\n );\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n\n return result;\n },\n\n // AddElementPlacement\n addElementPlacement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n silent /*: boolean */,\n ) {\n var keys = placements[element.placement];\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError(\"Duplicated element (\" + element.key + \")\");\n }\n keys.push(element.key);\n },\n\n // DecorateElement\n decorateElement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n ) /*: ElementFinishersExtras */ {\n var extras /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n\n for (\n var decorators = element.decorators, i = decorators.length - 1;\n i >= 0;\n i--\n ) {\n // (inlined) RemoveElementPlacement\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n\n var elementObject /*: ElementObjectInput */ = this.fromElementDescriptor(\n element,\n );\n var elementFinisherExtras /*: ElementFinisherExtras */ = this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) /*: ElementObjectOutput */ ||\n elementObject,\n );\n\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras /*: ElementDescriptor[] | void */ =\n elementFinisherExtras.extras;\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n extras.push.apply(extras, newExtras);\n }\n }\n\n return { element: element, finishers: finishers, extras: extras };\n },\n\n // DecorateConstructor\n decorateConstructor: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var finishers /*: ClassFinisher[] */ = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj /*: ClassObject */ = this.fromClassDescriptor(elements);\n var elementsAndFinisher /*: ElementsFinisher */ = this.toClassDescriptor(\n (0, decorators[i])(obj) /*: ClassObject */ || obj,\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n \"Duplicated element (\" + elements[j].key + \")\",\n );\n }\n }\n }\n }\n }\n\n return { elements: elements, finishers: finishers };\n },\n\n // FromElementDescriptor\n fromElementDescriptor: function(\n element /*: ElementDescriptor */,\n ) /*: ElementObject */ {\n var obj /*: ElementObject */ = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor,\n };\n\n var desc = {\n value: \"Descriptor\",\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n if (element.kind === \"field\") obj.initializer = element.initializer;\n\n return obj;\n },\n\n // ToElementDescriptors\n toElementDescriptors: function(\n elementObjects /*: ElementObject[] */,\n ) /*: ElementDescriptor[] */ {\n if (elementObjects === undefined) return;\n return toArray(elementObjects).map(function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(elementObject, \"finisher\", \"An element descriptor\");\n this.disallowProperty(elementObject, \"extras\", \"An element descriptor\");\n return element;\n }, this);\n },\n\n // ToElementDescriptor\n toElementDescriptor: function(\n elementObject /*: ElementObject */,\n ) /*: ElementDescriptor */ {\n var kind = String(elementObject.kind);\n if (kind !== \"method\" && kind !== \"field\") {\n throw new TypeError(\n 'An element descriptor\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"',\n );\n }\n\n var key = toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n if (\n placement !== \"static\" &&\n placement !== \"prototype\" &&\n placement !== \"own\"\n ) {\n throw new TypeError(\n 'An element descriptor\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"',\n );\n }\n\n var descriptor /*: PropertyDescriptor */ = elementObject.descriptor;\n\n this.disallowProperty(elementObject, \"elements\", \"An element descriptor\");\n\n var element /*: ElementDescriptor */ = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor),\n };\n\n if (kind !== \"field\") {\n this.disallowProperty(elementObject, \"initializer\", \"A method descriptor\");\n } else {\n this.disallowProperty(\n descriptor,\n \"get\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"set\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"value\",\n \"The property descriptor of a field descriptor\",\n );\n\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n\n toElementFinisherExtras: function(\n elementObject /*: ElementObject */,\n ) /*: ElementFinisherExtras */ {\n var element /*: ElementDescriptor */ = this.toElementDescriptor(\n elementObject,\n );\n var finisher /*: ClassFinisher */ = _optionalCallableProperty(\n elementObject,\n \"finisher\",\n );\n var extras /*: ElementDescriptors[] */ = this.toElementDescriptors(\n elementObject.extras,\n );\n\n return { element: element, finisher: finisher, extras: extras };\n },\n\n // FromClassDescriptor\n fromClassDescriptor: function(\n elements /*: ElementDescriptor[] */,\n ) /*: ClassObject */ {\n var obj = {\n kind: \"class\",\n elements: elements.map(this.fromElementDescriptor, this),\n };\n\n var desc = { value: \"Descriptor\", configurable: true };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n return obj;\n },\n\n // ToClassDescriptor\n toClassDescriptor: function(\n obj /*: ClassObject */,\n ) /*: ElementsFinisher */ {\n var kind = String(obj.kind);\n if (kind !== \"class\") {\n throw new TypeError(\n 'A class descriptor\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"',\n );\n }\n\n this.disallowProperty(obj, \"key\", \"A class descriptor\");\n this.disallowProperty(obj, \"placement\", \"A class descriptor\");\n this.disallowProperty(obj, \"descriptor\", \"A class descriptor\");\n this.disallowProperty(obj, \"initializer\", \"A class descriptor\");\n this.disallowProperty(obj, \"extras\", \"A class descriptor\");\n\n var finisher = _optionalCallableProperty(obj, \"finisher\");\n var elements = this.toElementDescriptors(obj.elements);\n\n return { elements: elements, finisher: finisher };\n },\n\n // RunClassFinishers\n runClassFinishers: function(\n constructor /*: Class<*> */,\n finishers /*: ClassFinisher[] */,\n ) /*: Class<*> */ {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor);\n if (newConstructor !== undefined) {\n // NOTE: This should check if IsConstructor(newConstructor) is false.\n if (typeof newConstructor !== \"function\") {\n throw new TypeError(\"Finishers must return a constructor.\");\n }\n constructor = newConstructor;\n }\n }\n return constructor;\n },\n\n disallowProperty: function(obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(objectType + \" can't have a .\" + name + \" property.\");\n }\n }\n };\n\n return api;\n }\n\n // ClassElementEvaluation\n function _createElementDescriptor(\n def /*: ElementDefinition */,\n ) /*: ElementDescriptor */ {\n var key = toPropertyKey(def.key);\n\n var descriptor /*: PropertyDescriptor */;\n if (def.kind === \"method\") {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === \"get\") {\n descriptor = { get: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"set\") {\n descriptor = { set: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"field\") {\n descriptor = { configurable: true, writable: true, enumerable: true };\n }\n\n var element /*: ElementDescriptor */ = {\n kind: def.kind === \"field\" ? \"field\" : \"method\",\n key: key,\n placement: def.static\n ? \"static\"\n : def.kind === \"field\"\n ? \"own\"\n : \"prototype\",\n descriptor: descriptor,\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === \"field\") element.initializer = def.value;\n\n return element;\n }\n\n // CoalesceGetterSetter\n function _coalesceGetterSetter(\n element /*: ElementDescriptor */,\n other /*: ElementDescriptor */,\n ) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n }\n\n // CoalesceClassElements\n function _coalesceClassElements(\n elements /*: ElementDescriptor[] */,\n ) /*: ElementDescriptor[] */ {\n var newElements /*: ElementDescriptor[] */ = [];\n\n var isSameElement = function(\n other /*: ElementDescriptor */,\n ) /*: boolean */ {\n return (\n other.kind === \"method\" &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element /*: ElementDescriptor */ = elements[i];\n var other /*: ElementDescriptor */;\n\n if (\n element.kind === \"method\" &&\n (other = newElements.find(isSameElement))\n ) {\n if (\n _isDataDescriptor(element.descriptor) ||\n _isDataDescriptor(other.descriptor)\n ) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n \"Duplicated methods (\" + element.key + \") can't be decorated.\",\n );\n }\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n \"the same property (\" +\n element.key +\n \").\",\n );\n }\n other.decorators = element.decorators;\n }\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n }\n\n function _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ {\n return element.decorators && element.decorators.length;\n }\n\n function _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ {\n return (\n desc !== undefined &&\n !(desc.value === undefined && desc.writable === undefined)\n );\n }\n\n function _optionalCallableProperty /*::<T>*/(\n obj /*: T */,\n name /*: $Keys<T> */,\n ) /*: ?Function */ {\n var value = obj[name];\n if (value !== undefined && typeof value !== \"function\") {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n return value;\n }\n\n"], ["\n import toArray from \"toArray\";\n import toPropertyKey from \"toPropertyKey\";\n\n // These comments are stripped by @babel/template\n /*::\n type PropertyDescriptor =\n | {\n value: any,\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n }\n | {\n get?: () => any,\n set?: (v: any) => void,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type FieldDescriptor ={\n writable: boolean,\n configurable: boolean,\n enumerable: boolean,\n };\n\n type Placement = \"static\" | \"prototype\" | \"own\";\n type Key = string | symbol; // PrivateName is not supported yet.\n\n type ElementDescriptor =\n | {\n kind: \"method\",\n key: Key,\n placement: Placement,\n descriptor: PropertyDescriptor\n }\n | {\n kind: \"field\",\n key: Key,\n placement: Placement,\n descriptor: FieldDescriptor,\n initializer?: () => any,\n };\n\n // This is exposed to the user code\n type ElementObjectInput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n };\n\n // This is exposed to the user code\n type ElementObjectOutput = ElementDescriptor & {\n [@@toStringTag]?: \"Descriptor\"\n extras?: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n // This is exposed to the user code\n type ClassObject = {\n [@@toStringTag]?: \"Descriptor\",\n kind: \"class\",\n elements: ElementDescriptor[],\n };\n\n type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput;\n type ClassDecorator = (descriptor: ClassObject) => ?ClassObject;\n type ClassFinisher = <A, B>(cl: Class<A>) => Class<B>;\n\n // Only used by Babel in the transform output, not part of the spec.\n type ElementDefinition =\n | {\n kind: \"method\",\n value: any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n }\n | {\n kind: \"field\",\n value: () => any,\n key: Key,\n static?: boolean,\n decorators?: ElementDecorator[],\n };\n\n declare function ClassFactory<C>(initialize: (instance: C) => void): {\n F: Class<C>,\n d: ElementDefinition[]\n }\n\n */\n\n /*::\n // Various combinations with/without extras and with one or many finishers\n\n type ElementFinisherExtras = {\n element: ElementDescriptor,\n finisher?: ClassFinisher,\n extras?: ElementDescriptor[],\n };\n\n type ElementFinishersExtras = {\n element: ElementDescriptor,\n finishers: ClassFinisher[],\n extras: ElementDescriptor[],\n };\n\n type ElementsFinisher = {\n elements: ElementDescriptor[],\n finisher?: ClassFinisher,\n };\n\n type ElementsFinishers = {\n elements: ElementDescriptor[],\n finishers: ClassFinisher[],\n };\n\n */\n\n /*::\n\n type Placements = {\n static: Key[],\n prototype: Key[],\n own: Key[],\n };\n\n */\n\n // ClassDefinitionEvaluation (Steps 26-*)\n export default function _decorate(\n decorators /*: ClassDecorator[] */,\n factory /*: ClassFactory */,\n superClass /*: ?Class<*> */,\n mixins /*: ?Array<Function> */,\n ) /*: Class<*> */ {\n var api = _getDecoratorsApi();\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators,\n );\n\n api.initializeClassElements(r.F, decorated.elements);\n\n return api.runClassFinishers(r.F, decorated.finishers);\n }\n\n function _getDecoratorsApi() {\n _getDecoratorsApi = function() {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [[\"method\"], [\"field\"]],\n\n // InitializeInstanceElements\n initializeInstanceElements: function(\n /*::<C>*/ O /*: C */,\n elements /*: ElementDescriptor[] */,\n ) {\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (element.kind === kind && element.placement === \"own\") {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n\n // InitializeClassElements\n initializeClassElements: function(\n /*::<C>*/ F /*: Class<C> */,\n elements /*: ElementDescriptor[] */,\n ) {\n var proto = F.prototype;\n\n [\"method\", \"field\"].forEach(function(kind) {\n elements.forEach(function(element /*: ElementDescriptor */) {\n var placement = element.placement;\n if (\n element.kind === kind &&\n (placement === \"static\" || placement === \"prototype\")\n ) {\n var receiver = placement === \"static\" ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n\n // DefineClassElement\n defineClassElement: function(\n /*::<C>*/ receiver /*: C | Class<C> */,\n element /*: ElementDescriptor */,\n ) {\n var descriptor /*: PropertyDescriptor */ = element.descriptor;\n if (element.kind === \"field\") {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver),\n };\n }\n Object.defineProperty(receiver, element.key, descriptor);\n },\n\n // DecorateClass\n decorateClass: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var newElements /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n var placements /*: Placements */ = {\n static: [],\n prototype: [],\n own: [],\n };\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n this.addElementPlacement(element, placements);\n }, this);\n\n elements.forEach(function(element /*: ElementDescriptor */) {\n if (!_hasDecorators(element)) return newElements.push(element);\n\n var elementFinishersExtras /*: ElementFinishersExtras */ = this.decorateElement(\n element,\n placements,\n );\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return { elements: newElements, finishers: finishers };\n }\n\n var result /*: ElementsFinishers */ = this.decorateConstructor(\n newElements,\n decorators,\n );\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n\n return result;\n },\n\n // AddElementPlacement\n addElementPlacement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n silent /*: boolean */,\n ) {\n var keys = placements[element.placement];\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError(\"Duplicated element (\" + element.key + \")\");\n }\n keys.push(element.key);\n },\n\n // DecorateElement\n decorateElement: function(\n element /*: ElementDescriptor */,\n placements /*: Placements */,\n ) /*: ElementFinishersExtras */ {\n var extras /*: ElementDescriptor[] */ = [];\n var finishers /*: ClassFinisher[] */ = [];\n\n for (\n var decorators = element.decorators, i = decorators.length - 1;\n i >= 0;\n i--\n ) {\n // (inlined) RemoveElementPlacement\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n\n var elementObject /*: ElementObjectInput */ = this.fromElementDescriptor(\n element,\n );\n var elementFinisherExtras /*: ElementFinisherExtras */ = this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) /*: ElementObjectOutput */ ||\n elementObject,\n );\n\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras /*: ElementDescriptor[] | void */ =\n elementFinisherExtras.extras;\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n extras.push.apply(extras, newExtras);\n }\n }\n\n return { element: element, finishers: finishers, extras: extras };\n },\n\n // DecorateConstructor\n decorateConstructor: function(\n elements /*: ElementDescriptor[] */,\n decorators /*: ClassDecorator[] */,\n ) /*: ElementsFinishers */ {\n var finishers /*: ClassFinisher[] */ = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj /*: ClassObject */ = this.fromClassDescriptor(elements);\n var elementsAndFinisher /*: ElementsFinisher */ = this.toClassDescriptor(\n (0, decorators[i])(obj) /*: ClassObject */ || obj,\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n \"Duplicated element (\" + elements[j].key + \")\",\n );\n }\n }\n }\n }\n }\n\n return { elements: elements, finishers: finishers };\n },\n\n // FromElementDescriptor\n fromElementDescriptor: function(\n element /*: ElementDescriptor */,\n ) /*: ElementObject */ {\n var obj /*: ElementObject */ = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor,\n };\n\n var desc = {\n value: \"Descriptor\",\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n if (element.kind === \"field\") obj.initializer = element.initializer;\n\n return obj;\n },\n\n // ToElementDescriptors\n toElementDescriptors: function(\n elementObjects /*: ElementObject[] */,\n ) /*: ElementDescriptor[] */ {\n if (elementObjects === undefined) return;\n return toArray(elementObjects).map(function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(elementObject, \"finisher\", \"An element descriptor\");\n this.disallowProperty(elementObject, \"extras\", \"An element descriptor\");\n return element;\n }, this);\n },\n\n // ToElementDescriptor\n toElementDescriptor: function(\n elementObject /*: ElementObject */,\n ) /*: ElementDescriptor */ {\n var kind = String(elementObject.kind);\n if (kind !== \"method\" && kind !== \"field\") {\n throw new TypeError(\n 'An element descriptor\\\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"',\n );\n }\n\n var key = toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n if (\n placement !== \"static\" &&\n placement !== \"prototype\" &&\n placement !== \"own\"\n ) {\n throw new TypeError(\n 'An element descriptor\\\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"',\n );\n }\n\n var descriptor /*: PropertyDescriptor */ = elementObject.descriptor;\n\n this.disallowProperty(elementObject, \"elements\", \"An element descriptor\");\n\n var element /*: ElementDescriptor */ = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor),\n };\n\n if (kind !== \"field\") {\n this.disallowProperty(elementObject, \"initializer\", \"A method descriptor\");\n } else {\n this.disallowProperty(\n descriptor,\n \"get\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"set\",\n \"The property descriptor of a field descriptor\",\n );\n this.disallowProperty(\n descriptor,\n \"value\",\n \"The property descriptor of a field descriptor\",\n );\n\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n\n toElementFinisherExtras: function(\n elementObject /*: ElementObject */,\n ) /*: ElementFinisherExtras */ {\n var element /*: ElementDescriptor */ = this.toElementDescriptor(\n elementObject,\n );\n var finisher /*: ClassFinisher */ = _optionalCallableProperty(\n elementObject,\n \"finisher\",\n );\n var extras /*: ElementDescriptors[] */ = this.toElementDescriptors(\n elementObject.extras,\n );\n\n return { element: element, finisher: finisher, extras: extras };\n },\n\n // FromClassDescriptor\n fromClassDescriptor: function(\n elements /*: ElementDescriptor[] */,\n ) /*: ClassObject */ {\n var obj = {\n kind: \"class\",\n elements: elements.map(this.fromElementDescriptor, this),\n };\n\n var desc = { value: \"Descriptor\", configurable: true };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n\n return obj;\n },\n\n // ToClassDescriptor\n toClassDescriptor: function(\n obj /*: ClassObject */,\n ) /*: ElementsFinisher */ {\n var kind = String(obj.kind);\n if (kind !== \"class\") {\n throw new TypeError(\n 'A class descriptor\\\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"',\n );\n }\n\n this.disallowProperty(obj, \"key\", \"A class descriptor\");\n this.disallowProperty(obj, \"placement\", \"A class descriptor\");\n this.disallowProperty(obj, \"descriptor\", \"A class descriptor\");\n this.disallowProperty(obj, \"initializer\", \"A class descriptor\");\n this.disallowProperty(obj, \"extras\", \"A class descriptor\");\n\n var finisher = _optionalCallableProperty(obj, \"finisher\");\n var elements = this.toElementDescriptors(obj.elements);\n\n return { elements: elements, finisher: finisher };\n },\n\n // RunClassFinishers\n runClassFinishers: function(\n constructor /*: Class<*> */,\n finishers /*: ClassFinisher[] */,\n ) /*: Class<*> */ {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor);\n if (newConstructor !== undefined) {\n // NOTE: This should check if IsConstructor(newConstructor) is false.\n if (typeof newConstructor !== \"function\") {\n throw new TypeError(\"Finishers must return a constructor.\");\n }\n constructor = newConstructor;\n }\n }\n return constructor;\n },\n\n disallowProperty: function(obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(objectType + \" can't have a .\" + name + \" property.\");\n }\n }\n };\n\n return api;\n }\n\n // ClassElementEvaluation\n function _createElementDescriptor(\n def /*: ElementDefinition */,\n ) /*: ElementDescriptor */ {\n var key = toPropertyKey(def.key);\n\n var descriptor /*: PropertyDescriptor */;\n if (def.kind === \"method\") {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === \"get\") {\n descriptor = { get: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"set\") {\n descriptor = { set: def.value, configurable: true, enumerable: false };\n } else if (def.kind === \"field\") {\n descriptor = { configurable: true, writable: true, enumerable: true };\n }\n\n var element /*: ElementDescriptor */ = {\n kind: def.kind === \"field\" ? \"field\" : \"method\",\n key: key,\n placement: def.static\n ? \"static\"\n : def.kind === \"field\"\n ? \"own\"\n : \"prototype\",\n descriptor: descriptor,\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === \"field\") element.initializer = def.value;\n\n return element;\n }\n\n // CoalesceGetterSetter\n function _coalesceGetterSetter(\n element /*: ElementDescriptor */,\n other /*: ElementDescriptor */,\n ) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n }\n\n // CoalesceClassElements\n function _coalesceClassElements(\n elements /*: ElementDescriptor[] */,\n ) /*: ElementDescriptor[] */ {\n var newElements /*: ElementDescriptor[] */ = [];\n\n var isSameElement = function(\n other /*: ElementDescriptor */,\n ) /*: boolean */ {\n return (\n other.kind === \"method\" &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element /*: ElementDescriptor */ = elements[i];\n var other /*: ElementDescriptor */;\n\n if (\n element.kind === \"method\" &&\n (other = newElements.find(isSameElement))\n ) {\n if (\n _isDataDescriptor(element.descriptor) ||\n _isDataDescriptor(other.descriptor)\n ) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n \"Duplicated methods (\" + element.key + \") can't be decorated.\",\n );\n }\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n \"the same property (\" +\n element.key +\n \").\",\n );\n }\n other.decorators = element.decorators;\n }\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n }\n\n function _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ {\n return element.decorators && element.decorators.length;\n }\n\n function _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ {\n return (\n desc !== undefined &&\n !(desc.value === undefined && desc.writable === undefined)\n );\n }\n\n function _optionalCallableProperty /*::<T>*/(\n obj /*: T */,\n name /*: $Keys<T> */,\n ) /*: ?Function */ {\n var value = obj[name];\n if (value !== undefined && typeof value !== \"function\") {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n return value;\n }\n\n"]);
- _templateObject70 = function _templateObject70() {
- return data;
- };
- return data;
- }
- function _templateObject69() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classStaticPrivateMethodSet() {\n throw new TypeError(\"attempted to set read only static private field\");\n }\n"]);
- _templateObject69 = function _templateObject69() {
- return data;
- };
- return data;
- }
- function _templateObject68() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n return method;\n }\n"]);
- _templateObject68 = function _templateObject68() {
- return data;
- };
- return data;
- }
- function _templateObject67() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n descriptor.value = value;\n }\n\n return value;\n }\n"]);
- _templateObject67 = function _templateObject67() {
- return data;
- };
- return data;
- }
- function _templateObject66() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {\n if (receiver !== classConstructor) {\n throw new TypeError(\"Private static access of wrong provenance\");\n }\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n }\n"]);
- _templateObject66 = function _templateObject66() {
- return data;
- };
- return data;
- }
- function _templateObject65() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateFieldDestructureSet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n var descriptor = privateMap.get(receiver);\n if (descriptor.set) {\n if (!(\"__destrObj\" in descriptor)) {\n descriptor.__destrObj = {\n set value(v) {\n descriptor.set.call(receiver, v)\n },\n };\n }\n return descriptor.__destrObj;\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n return descriptor;\n }\n }\n"]);
- _templateObject65 = function _templateObject65() {
- return data;
- };
- return data;
- }
- function _templateObject64() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = privateMap.get(receiver);\n if (!descriptor) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n // This should only throw in strict mode, but class bodies are\n // always strict and private fields can only be used inside\n // class bodies.\n throw new TypeError(\"attempted to set read only private field\");\n }\n\n descriptor.value = value;\n }\n\n return value;\n }\n"]);
- _templateObject64 = function _templateObject64() {
- return data;
- };
- return data;
- }
- function _templateObject63() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = privateMap.get(receiver);\n if (!descriptor) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n return descriptor.value;\n }\n"]);
- _templateObject63 = function _templateObject63() {
- return data;
- };
- return data;
- }
- function _templateObject62() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classPrivateFieldBase(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError(\"attempted to use private field on non-instance\");\n }\n return receiver;\n }\n"]);
- _templateObject62 = function _templateObject62() {
- return data;
- };
- return data;
- }
- function _templateObject61() {
- var data = _taggedTemplateLiteralLoose(["\n var id = 0;\n export default function _classPrivateFieldKey(name) {\n return \"__private_\" + (id++) + \"_\" + name;\n }\n"]);
- _templateObject61 = function _templateObject61() {
- return data;
- };
- return data;
- }
- function _templateObject60() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){\n var desc = {};\n Object.keys(descriptor).forEach(function(key){\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n if ('value' in desc || desc.initializer){\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function(desc, decorator){\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0){\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0){\n // This is a hack to avoid this being processed by 'transform-runtime'.\n // See issue #9.\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n"]);
- _templateObject60 = function _templateObject60() {
- return data;
- };
- return data;
- }
- function _templateObject59() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _initializerDefineProperty(target, property, descriptor, context){\n if (!descriptor) return;\n\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n"]);
- _templateObject59 = function _templateObject59() {
- return data;
- };
- return data;
- }
- function _templateObject58() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _initializerWarningHelper(descriptor, context){\n throw new Error(\n 'Decorating class property failed. Please ensure that ' +\n 'proposal-class-properties is enabled and runs after the decorators transform.'\n );\n }\n"]);
- _templateObject58 = function _templateObject58() {
- return data;
- };
- return data;
- }
- function _templateObject57() {
- var data = _taggedTemplateLiteralLoose(["\n import toPrimitive from \"toPrimitive\";\n\n export default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n }\n"]);
- _templateObject57 = function _templateObject57() {
- return data;
- };
- return data;
- }
- function _templateObject56() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _toPrimitive(\n input,\n hint /*: \"default\" | \"string\" | \"number\" | void */\n ) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n }\n"]);
- _templateObject56 = function _templateObject56() {
- return data;
- };
- return data;
- }
- function _templateObject55() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _skipFirstGeneratorNext(fn) {\n return function () {\n var it = fn.apply(this, arguments);\n it.next();\n return it;\n }\n }\n"]);
- _templateObject55 = function _templateObject55() {
- return data;
- };
- return data;
- }
- function _templateObject54() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n"]);
- _templateObject54 = function _templateObject54() {
- return data;
- };
- return data;
- }
- function _templateObject53() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }\n"]);
- _templateObject53 = function _templateObject53() {
- return data;
- };
- return data;
- }
- function _templateObject52() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _iterableToArrayLimitLoose(arr, i) {\n if (!(\n Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\"\n )) { return }\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n }\n"]);
- _templateObject52 = function _templateObject52() {
- return data;
- };
- return data;
- }
- function _templateObject51() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _iterableToArrayLimit(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliance is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n if (!(\n Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\"\n )) { return }\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n"], ["\n export default function _iterableToArrayLimit(arr, i) {\n // this is an expanded form of \\`for...of\\` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliance is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n if (!(\n Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\"\n )) { return }\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n"]);
- _templateObject51 = function _templateObject51() {
- return data;
- };
- return data;
- }
- function _templateObject50() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _iterableToArray(iter) {\n if (\n Symbol.iterator in Object(iter) ||\n Object.prototype.toString.call(iter) === \"[object Arguments]\"\n ) return Array.from(iter);\n }\n"]);
- _templateObject50 = function _templateObject50() {
- return data;
- };
- return data;
- }
- function _templateObject49() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n"]);
- _templateObject49 = function _templateObject49() {
- return data;
- };
- return data;
- }
- function _templateObject48() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n }\n }\n"]);
- _templateObject48 = function _templateObject48() {
- return data;
- };
- return data;
- }
- function _templateObject47() {
- var data = _taggedTemplateLiteralLoose(["\n import arrayWithoutHoles from \"arrayWithoutHoles\";\n import iterableToArray from \"iterableToArray\";\n import nonIterableSpread from \"nonIterableSpread\";\n\n export default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n }\n"]);
- _templateObject47 = function _templateObject47() {
- return data;
- };
- return data;
- }
- function _templateObject46() {
- var data = _taggedTemplateLiteralLoose(["\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArray from \"iterableToArray\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest();\n }\n"]);
- _templateObject46 = function _templateObject46() {
- return data;
- };
- return data;
- }
- function _templateObject45() {
- var data = _taggedTemplateLiteralLoose(["\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArrayLimitLoose from \"iterableToArrayLimitLoose\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _slicedToArrayLoose(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || nonIterableRest();\n }\n"]);
- _templateObject45 = function _templateObject45() {
- return data;
- };
- return data;
- }
- function _templateObject44() {
- var data = _taggedTemplateLiteralLoose(["\n import arrayWithHoles from \"arrayWithHoles\";\n import iterableToArrayLimit from \"iterableToArrayLimit\";\n import nonIterableRest from \"nonIterableRest\";\n\n export default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n }\n"]);
- _templateObject44 = function _templateObject44() {
- return data;
- };
- return data;
- }
- function _templateObject43() {
- var data = _taggedTemplateLiteralLoose(["\n import undef from \"temporalUndefined\";\n import err from \"tdz\";\n\n export default function _temporalRef(val, name) {\n return val === undef ? err(name) : val;\n }\n"]);
- _templateObject43 = function _templateObject43() {
- return data;
- };
- return data;
- }
- function _templateObject42() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _tdzError(name) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n }\n"]);
- _templateObject42 = function _templateObject42() {
- return data;
- };
- return data;
- }
- function _templateObject41() {
- var data = _taggedTemplateLiteralLoose(["\n // This function isn't mean to be called, but to be used as a reference.\n // We can't use a normal object because it isn't hoisted.\n export default function _temporalUndefined() {}\n"]);
- _templateObject41 = function _templateObject41() {
- return data;
- };
- return data;
- }
- function _templateObject40() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classNameTDZError(name) {\n throw new Error(\"Class \\\"\" + name + \"\\\" cannot be referenced in computed property keys.\");\n }\n"], ["\n export default function _classNameTDZError(name) {\n throw new Error(\"Class \\\\\"\" + name + \"\\\\\" cannot be referenced in computed property keys.\");\n }\n"]);
- _templateObject40 = function _templateObject40() {
- return data;
- };
- return data;
- }
- function _templateObject39() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _readOnlyError(name) {\n throw new Error(\"\\\"\" + name + \"\\\" is read-only\");\n }\n"], ["\n export default function _readOnlyError(name) {\n throw new Error(\"\\\\\"\" + name + \"\\\\\" is read-only\");\n }\n"]);
- _templateObject39 = function _templateObject39() {
- return data;
- };
- return data;
- }
- function _templateObject38() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) { raw = strings.slice(0); }\n strings.raw = raw;\n return strings;\n }\n"]);
- _templateObject38 = function _templateObject38() {
- return data;
- };
- return data;
- }
- function _templateObject37() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) { raw = strings.slice(0); }\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n }\n"]);
- _templateObject37 = function _templateObject37() {
- return data;
- };
- return data;
- }
- function _templateObject36() {
- var data = _taggedTemplateLiteralLoose(["\n import superPropBase from \"superPropBase\";\n import defineProperty from \"defineProperty\";\n\n function set(target, property, value, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.set) {\n set = Reflect.set;\n } else {\n set = function set(target, property, value, receiver) {\n var base = superPropBase(target, property);\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n } else if (!desc.writable) {\n // Both getter and non-writable fall into this.\n return false;\n }\n }\n\n // Without a super that defines the property, spec boils down to\n // \"define on receiver\" for some reason.\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n if (desc) {\n if (!desc.writable) {\n // Setter, getter, and non-writable fall into this.\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n // Avoid setters that may be defined on Sub's prototype, but not on\n // the instance.\n defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n }\n\n export default function _set(target, property, value, receiver, isStrict) {\n var s = set(target, property, value, receiver || target);\n if (!s && isStrict) {\n throw new Error('failed to set property');\n }\n\n return value;\n }\n"]);
- _templateObject36 = function _templateObject36() {
- return data;
- };
- return data;
- }
- function _templateObject35() {
- var data = _taggedTemplateLiteralLoose(["\n import superPropBase from \"superPropBase\";\n\n export default function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n\n if (!base) return;\n\n var desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n return _get(target, property, receiver || target);\n }\n"]);
- _templateObject35 = function _templateObject35() {
- return data;
- };
- return data;
- }
- function _templateObject34() {
- var data = _taggedTemplateLiteralLoose(["\n import getPrototypeOf from \"getPrototypeOf\";\n\n export default function _superPropBase(object, property) {\n // Yes, this throws if object is null to being with, that's on purpose.\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n return object;\n }\n"]);
- _templateObject34 = function _templateObject34() {
- return data;
- };
- return data;
- }
- function _templateObject33() {
- var data = _taggedTemplateLiteralLoose(["\n import assertThisInitialized from \"assertThisInitialized\";\n\n export default function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n return assertThisInitialized(self);\n }\n"]);
- _templateObject33 = function _templateObject33() {
- return data;
- };
- return data;
- }
- function _templateObject32() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n }\n"]);
- _templateObject32 = function _templateObject32() {
- return data;
- };
- return data;
- }
- function _templateObject31() {
- var data = _taggedTemplateLiteralLoose(["\n import objectWithoutPropertiesLoose from \"objectWithoutPropertiesLoose\";\n\n export default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n"]);
- _templateObject31 = function _templateObject31() {
- return data;
- };
- return data;
- }
- function _templateObject30() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n"]);
- _templateObject30 = function _templateObject30() {
- return data;
- };
- return data;
- }
- function _templateObject29() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _objectDestructuringEmpty(obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n }\n"]);
- _templateObject29 = function _templateObject29() {
- return data;
- };
- return data;
- }
- function _templateObject28() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n }\n"]);
- _templateObject28 = function _templateObject28() {
- return data;
- };
- return data;
- }
- function _templateObject27() {
- var data = _taggedTemplateLiteralLoose(["\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n\n var cache = new WeakMap();\n _getRequireWildcardCache = function () { return cache; };\n return cache;\n }\n\n export default function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || (typeof obj !== \"object\" && typeof obj !== \"function\")) {\n return { default: obj }\n }\n\n var cache = _getRequireWildcardCache();\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor\n ? Object.getOwnPropertyDescriptor(obj, key)\n : null;\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n newObj.default = obj;\n if (cache) {\n cache.set(obj, newObj);\n }\n return newObj;\n }\n"]);
- _templateObject27 = function _templateObject27() {
- return data;
- };
- return data;
- }
- function _templateObject26() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n }\n"]);
- _templateObject26 = function _templateObject26() {
- return data;
- };
- return data;
- }
- function _templateObject25() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n }\n"]);
- _templateObject25 = function _templateObject25() {
- return data;
- };
- return data;
- }
- function _templateObject24() {
- var data = _taggedTemplateLiteralLoose(["\n import getPrototypeOf from \"getPrototypeOf\";\n import setPrototypeOf from \"setPrototypeOf\";\n import isNativeFunction from \"isNativeFunction\";\n import construct from \"construct\";\n\n export default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor)\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n }\n });\n\n return setPrototypeOf(Wrapper, Class);\n }\n\n return _wrapNativeSuper(Class)\n }\n"]);
- _templateObject24 = function _templateObject24() {
- return data;
- };
- return data;
- }
- function _templateObject23() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _isNativeFunction(fn) {\n // Note: This function returns \"true\" for core-js functions.\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n"]);
- _templateObject23 = function _templateObject23() {
- return data;
- };
- return data;
- }
- function _templateObject22() {
- var data = _taggedTemplateLiteralLoose(["\n import setPrototypeOf from \"setPrototypeOf\";\n\n function isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n\n // core-js@3\n if (Reflect.construct.sham) return false;\n\n // Proxy can't be polyfilled. Every browser implemented\n // proxies before or at the same time as Reflect.construct,\n // so if they support Proxy they also support Reflect.construct.\n if (typeof Proxy === \"function\") return true;\n\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Date object.\n Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n export default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n // NOTE: If Parent !== Class, the correct __proto__ is set *after*\n // calling the constructor.\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n // Avoid issues with Class being present but undefined when it wasn't\n // present in the original call.\n return _construct.apply(null, arguments);\n }\n"]);
- _templateObject22 = function _templateObject22() {
- return data;
- };
- return data;
- }
- function _templateObject21() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n }\n"]);
- _templateObject21 = function _templateObject21() {
- return data;
- };
- return data;
- }
- function _templateObject20() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf\n ? Object.getPrototypeOf\n : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n"]);
- _templateObject20 = function _templateObject20() {
- return data;
- };
- return data;
- }
- function _templateObject19() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n"]);
- _templateObject19 = function _templateObject19() {
- return data;
- };
- return data;
- }
- function _templateObject18() {
- var data = _taggedTemplateLiteralLoose(["\n import setPrototypeOf from \"setPrototypeOf\";\n\n export default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n }\n"]);
- _templateObject18 = function _templateObject18() {
- return data;
- };
- return data;
- }
- function _templateObject17() {
- var data = _taggedTemplateLiteralLoose(["\n import defineProperty from \"defineProperty\";\n\n // This function is different to \"Reflect.ownKeys\". The enumerableOnly\n // filters on symbol properties only. Returned string properties are always\n // enumerable. It is good to use in objectSpread.\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n }\n\n export default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = (arguments[i] != null) ? arguments[i] : {};\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(\n target,\n key,\n Object.getOwnPropertyDescriptor(source, key)\n );\n });\n }\n }\n return target;\n }\n"]);
- _templateObject17 = function _templateObject17() {
- return data;
- };
- return data;
- }
- function _templateObject16() {
- var data = _taggedTemplateLiteralLoose(["\n import defineProperty from \"defineProperty\";\n\n export default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = (arguments[i] != null) ? Object(arguments[i]) : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n ownKeys.forEach(function(key) {\n defineProperty(target, key, source[key]);\n });\n }\n return target;\n }\n"]);
- _templateObject16 = function _templateObject16() {
- return data;
- };
- return data;
- }
- function _templateObject15() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n"]);
- _templateObject15 = function _templateObject15() {
- return data;
- };
- return data;
- }
- function _templateObject14() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _defineProperty(obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n }\n"]);
- _templateObject14 = function _templateObject14() {
- return data;
- };
- return data;
- }
- function _templateObject13() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _defaults(obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n }\n"]);
- _templateObject13 = function _templateObject13() {
- return data;
- };
- return data;
- }
- function _templateObject12() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _defineEnumerableProperties(obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n\n // Symbols are not enumerated over by for-in loops. If native\n // Symbols are available, fetch all of the descs object's own\n // symbol properties and define them on our target object too.\n if (Object.getOwnPropertySymbols) {\n var objectSymbols = Object.getOwnPropertySymbols(descs);\n for (var i = 0; i < objectSymbols.length; i++) {\n var sym = objectSymbols[i];\n var desc = descs[sym];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, sym, desc);\n }\n }\n return obj;\n }\n"]);
- _templateObject12 = function _templateObject12() {
- return data;
- };
- return data;
- }
- function _templateObject11() {
- var data = _taggedTemplateLiteralLoose(["\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n export default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n"]);
- _templateObject11 = function _templateObject11() {
- return data;
- };
- return data;
- }
- function _templateObject10() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n"]);
- _templateObject10 = function _templateObject10() {
- return data;
- };
- return data;
- }
- function _templateObject9() {
- var data = _taggedTemplateLiteralLoose(["\n function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n }\n\n export default function _asyncToGenerator(fn) {\n return function () {\n var self = this, args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n }\n"]);
- _templateObject9 = function _templateObject9() {
- return data;
- };
- return data;
- }
- function _templateObject8() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _asyncGeneratorDelegate(inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"return\", value);\n };\n }\n\n return iter;\n }\n"]);
- _templateObject8 = function _templateObject8() {
- return data;
- };
- return data;
- }
- function _templateObject7() {
- var data = _taggedTemplateLiteralLoose(["\n import AwaitValue from \"AwaitValue\";\n\n export default function _awaitAsyncGenerator(value) {\n return new AwaitValue(value);\n }\n"]);
- _templateObject7 = function _templateObject7() {
- return data;
- };
- return data;
- }
- function _templateObject6() {
- var data = _taggedTemplateLiteralLoose(["\n import AsyncGenerator from \"AsyncGenerator\";\n\n export default function _wrapAsyncGenerator(fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n }\n"]);
- _templateObject6 = function _templateObject6() {
- return data;
- };
- return data;
- }
- function _templateObject5() {
- var data = _taggedTemplateLiteralLoose(["\n import AwaitValue from \"AwaitValue\";\n\n export default function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null,\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n var wrappedAwait = value instanceof AwaitValue;\n\n Promise.resolve(wrappedAwait ? value.wrapped : value).then(\n function (arg) {\n if (wrappedAwait) {\n resume(key === \"return\" ? \"return\" : \"next\", arg);\n return\n }\n\n settle(result.done ? \"return\" : \"normal\", arg);\n },\n function (err) { resume(\"throw\", err); });\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n"]);
- _templateObject5 = function _templateObject5() {
- return data;
- };
- return data;
- }
- function _templateObject4() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _AwaitValue(value) {\n this.wrapped = value;\n }\n"]);
- _templateObject4 = function _templateObject4() {
- return data;
- };
- return data;
- }
- function _templateObject3() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _asyncIterator(iterable) {\n var method\n if (typeof Symbol !== \"undefined\") {\n if (Symbol.asyncIterator) {\n method = iterable[Symbol.asyncIterator]\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n method = iterable[Symbol.iterator]\n if (method != null) return method.call(iterable);\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n }\n"]);
- _templateObject3 = function _templateObject3() {
- return data;
- };
- return data;
- }
- function _templateObject2() {
- var data = _taggedTemplateLiteralLoose(["\n var REACT_ELEMENT_TYPE;\n\n export default function _createRawReactElement(type, props, key, children) {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE = (\n typeof Symbol === \"function\" && Symbol[\"for\"] && Symbol[\"for\"](\"react.element\")\n ) || 0xeac7;\n }\n\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {\n children: void 0,\n };\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n }\n"]);
- _templateObject2 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject() {
- var data = _taggedTemplateLiteralLoose(["\n export default function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) { return typeof obj; };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n"]);
- _templateObject = function _templateObject() {
- return data;
- };
- return data;
- }
- var helpers = Object.create(null);
- var helper = function helper(minVersion) {
- return function (tpl) {
- return {
- minVersion: minVersion,
- ast: function ast() {
- return template.program.ast(tpl);
- }
- };
- };
- };
- helpers["typeof"] = helper("7.0.0-beta.0")(_templateObject());
- helpers.jsx = helper("7.0.0-beta.0")(_templateObject2());
- helpers.asyncIterator = helper("7.0.0-beta.0")(_templateObject3());
- helpers.AwaitValue = helper("7.0.0-beta.0")(_templateObject4());
- helpers.AsyncGenerator = helper("7.0.0-beta.0")(_templateObject5());
- helpers.wrapAsyncGenerator = helper("7.0.0-beta.0")(_templateObject6());
- helpers.awaitAsyncGenerator = helper("7.0.0-beta.0")(_templateObject7());
- helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")(_templateObject8());
- helpers.asyncToGenerator = helper("7.0.0-beta.0")(_templateObject9());
- helpers.classCallCheck = helper("7.0.0-beta.0")(_templateObject10());
- helpers.createClass = helper("7.0.0-beta.0")(_templateObject11());
- helpers.defineEnumerableProperties = helper("7.0.0-beta.0")(_templateObject12());
- helpers.defaults = helper("7.0.0-beta.0")(_templateObject13());
- helpers.defineProperty = helper("7.0.0-beta.0")(_templateObject14());
- helpers["extends"] = helper("7.0.0-beta.0")(_templateObject15());
- helpers.objectSpread = helper("7.0.0-beta.0")(_templateObject16());
- helpers.objectSpread2 = helper("7.5.0")(_templateObject17());
- helpers.inherits = helper("7.0.0-beta.0")(_templateObject18());
- helpers.inheritsLoose = helper("7.0.0-beta.0")(_templateObject19());
- helpers.getPrototypeOf = helper("7.0.0-beta.0")(_templateObject20());
- helpers.setPrototypeOf = helper("7.0.0-beta.0")(_templateObject21());
- helpers.construct = helper("7.0.0-beta.0")(_templateObject22());
- helpers.isNativeFunction = helper("7.0.0-beta.0")(_templateObject23());
- helpers.wrapNativeSuper = helper("7.0.0-beta.0")(_templateObject24());
- helpers["instanceof"] = helper("7.0.0-beta.0")(_templateObject25());
- helpers.interopRequireDefault = helper("7.0.0-beta.0")(_templateObject26());
- helpers.interopRequireWildcard = helper("7.0.0-beta.0")(_templateObject27());
- helpers.newArrowCheck = helper("7.0.0-beta.0")(_templateObject28());
- helpers.objectDestructuringEmpty = helper("7.0.0-beta.0")(_templateObject29());
- helpers.objectWithoutPropertiesLoose = helper("7.0.0-beta.0")(_templateObject30());
- helpers.objectWithoutProperties = helper("7.0.0-beta.0")(_templateObject31());
- helpers.assertThisInitialized = helper("7.0.0-beta.0")(_templateObject32());
- helpers.possibleConstructorReturn = helper("7.0.0-beta.0")(_templateObject33());
- helpers.superPropBase = helper("7.0.0-beta.0")(_templateObject34());
- helpers.get = helper("7.0.0-beta.0")(_templateObject35());
- helpers.set = helper("7.0.0-beta.0")(_templateObject36());
- helpers.taggedTemplateLiteral = helper("7.0.0-beta.0")(_templateObject37());
- helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")(_templateObject38());
- helpers.readOnlyError = helper("7.0.0-beta.0")(_templateObject39());
- helpers.classNameTDZError = helper("7.0.0-beta.0")(_templateObject40());
- helpers.temporalUndefined = helper("7.0.0-beta.0")(_templateObject41());
- helpers.tdz = helper("7.5.5")(_templateObject42());
- helpers.temporalRef = helper("7.0.0-beta.0")(_templateObject43());
- helpers.slicedToArray = helper("7.0.0-beta.0")(_templateObject44());
- helpers.slicedToArrayLoose = helper("7.0.0-beta.0")(_templateObject45());
- helpers.toArray = helper("7.0.0-beta.0")(_templateObject46());
- helpers.toConsumableArray = helper("7.0.0-beta.0")(_templateObject47());
- helpers.arrayWithoutHoles = helper("7.0.0-beta.0")(_templateObject48());
- helpers.arrayWithHoles = helper("7.0.0-beta.0")(_templateObject49());
- helpers.iterableToArray = helper("7.0.0-beta.0")(_templateObject50());
- helpers.iterableToArrayLimit = helper("7.0.0-beta.0")(_templateObject51());
- helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")(_templateObject52());
- helpers.nonIterableSpread = helper("7.0.0-beta.0")(_templateObject53());
- helpers.nonIterableRest = helper("7.0.0-beta.0")(_templateObject54());
- helpers.skipFirstGeneratorNext = helper("7.0.0-beta.0")(_templateObject55());
- helpers.toPrimitive = helper("7.1.5")(_templateObject56());
- helpers.toPropertyKey = helper("7.1.5")(_templateObject57());
- helpers.initializerWarningHelper = helper("7.0.0-beta.0")(_templateObject58());
- helpers.initializerDefineProperty = helper("7.0.0-beta.0")(_templateObject59());
- helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")(_templateObject60());
- helpers.classPrivateFieldLooseKey = helper("7.0.0-beta.0")(_templateObject61());
- helpers.classPrivateFieldLooseBase = helper("7.0.0-beta.0")(_templateObject62());
- helpers.classPrivateFieldGet = helper("7.0.0-beta.0")(_templateObject63());
- helpers.classPrivateFieldSet = helper("7.0.0-beta.0")(_templateObject64());
- helpers.classPrivateFieldDestructureSet = helper("7.4.4")(_templateObject65());
- helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")(_templateObject66());
- helpers.classStaticPrivateFieldSpecSet = helper("7.0.2")(_templateObject67());
- helpers.classStaticPrivateMethodGet = helper("7.3.2")(_templateObject68());
- helpers.classStaticPrivateMethodSet = helper("7.3.2")(_templateObject69());
- helpers.decorate = helper("7.1.5")(_templateObject70());
- helpers.classPrivateMethodGet = helper("7.1.6")(_templateObject71());
- helpers.classPrivateMethodSet = helper("7.1.6")(_templateObject72());
- helpers.wrapRegExp = helper("7.2.6")(_templateObject73());
- function makePath(path) {
- var parts = [];
- for (; path.parentPath; path = path.parentPath) {
- parts.push(path.key);
- if (path.inList) parts.push(path.listKey);
- }
- return parts.reverse().join(".");
- }
- function getHelperMetadata(file) {
- var globals = new Set();
- var localBindingNames = new Set();
- var dependencies = new Map();
- var exportName;
- var exportPath;
- var exportBindingAssignments = [];
- var importPaths = [];
- var importBindingsReferences = [];
- traverse$1(file, {
- ImportDeclaration: function ImportDeclaration(child) {
- var name = child.node.source.value;
- if (!helpers[name]) {
- throw child.buildCodeFrameError("Unknown helper " + name);
- }
- if (child.get("specifiers").length !== 1 || !child.get("specifiers.0").isImportDefaultSpecifier()) {
- throw child.buildCodeFrameError("Helpers can only import a default value");
- }
- var bindingIdentifier = child.node.specifiers[0].local;
- dependencies.set(bindingIdentifier, name);
- importPaths.push(makePath(child));
- },
- ExportDefaultDeclaration: function ExportDefaultDeclaration(child) {
- var decl = child.get("declaration");
- if (decl.isFunctionDeclaration()) {
- if (!decl.node.id) {
- throw decl.buildCodeFrameError("Helpers should give names to their exported func declaration");
- }
- exportName = decl.node.id.name;
- }
- exportPath = makePath(child);
- },
- ExportAllDeclaration: function ExportAllDeclaration(child) {
- throw child.buildCodeFrameError("Helpers can only export default");
- },
- ExportNamedDeclaration: function ExportNamedDeclaration(child) {
- throw child.buildCodeFrameError("Helpers can only export default");
- },
- Statement: function Statement(child) {
- if (child.isModuleDeclaration()) return;
- child.skip();
- }
- });
- traverse$1(file, {
- Program: function Program(path) {
- var bindings = path.scope.getAllBindings();
- Object.keys(bindings).forEach(function (name) {
- if (name === exportName) return;
- if (dependencies.has(bindings[name].identifier)) return;
- localBindingNames.add(name);
- });
- },
- ReferencedIdentifier: function ReferencedIdentifier(child) {
- var name = child.node.name;
- var binding = child.scope.getBinding(name, true);
- if (!binding) {
- globals.add(name);
- } else if (dependencies.has(binding.identifier)) {
- importBindingsReferences.push(makePath(child));
- }
- },
- AssignmentExpression: function AssignmentExpression(child) {
- var left = child.get("left");
- if (!(exportName in left.getBindingIdentifiers())) return;
- if (!left.isIdentifier()) {
- throw left.buildCodeFrameError("Only simple assignments to exports are allowed in helpers");
- }
- var binding = child.scope.getBinding(exportName);
- if (binding && binding.scope.path.isProgram()) {
- exportBindingAssignments.push(makePath(child));
- }
- }
- });
- if (!exportPath) throw new Error("Helpers must default-export something.");
- exportBindingAssignments.reverse();
- return {
- globals: Array.from(globals),
- localBindingNames: Array.from(localBindingNames),
- dependencies: dependencies,
- exportBindingAssignments: exportBindingAssignments,
- exportPath: exportPath,
- exportName: exportName,
- importBindingsReferences: importBindingsReferences,
- importPaths: importPaths
- };
- }
- function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
- if (localBindings && !id) {
- throw new Error("Unexpected local bindings for module-based helpers.");
- }
- if (!id) return;
- var localBindingNames = metadata.localBindingNames,
- dependencies = metadata.dependencies,
- exportBindingAssignments = metadata.exportBindingAssignments,
- exportPath = metadata.exportPath,
- exportName = metadata.exportName,
- importBindingsReferences = metadata.importBindingsReferences,
- importPaths = metadata.importPaths;
- var dependenciesRefs = {};
- dependencies.forEach(function (name, id) {
- dependenciesRefs[id.name] = typeof getDependency === "function" && getDependency(name) || id;
- });
- var toRename = {};
- var bindings = new Set(localBindings || []);
- localBindingNames.forEach(function (name) {
- var newName = name;
- while (bindings.has(newName)) {
- newName = "_" + newName;
- }
- if (newName !== name) toRename[name] = newName;
- });
- if (id.type === "Identifier" && exportName !== id.name) {
- toRename[exportName] = id.name;
- }
- traverse$1(file, {
- Program: function Program(path) {
- var exp = path.get(exportPath);
- var imps = importPaths.map(function (p) {
- return path.get(p);
- });
- var impsBindingRefs = importBindingsReferences.map(function (p) {
- return path.get(p);
- });
- var decl = exp.get("declaration");
- if (id.type === "Identifier") {
- if (decl.isFunctionDeclaration()) {
- exp.replaceWith(decl);
- } else {
- exp.replaceWith(VariableDeclaration("var", [VariableDeclarator(id, decl.node)]));
- }
- } else if (id.type === "MemberExpression") {
- if (decl.isFunctionDeclaration()) {
- exportBindingAssignments.forEach(function (assignPath) {
- var assign = path.get(assignPath);
- assign.replaceWith(AssignmentExpression("=", id, assign.node));
- });
- exp.replaceWith(decl);
- path.pushContainer("body", ExpressionStatement(AssignmentExpression("=", id, Identifier(exportName))));
- } else {
- exp.replaceWith(ExpressionStatement(AssignmentExpression("=", id, decl.node)));
- }
- } else {
- throw new Error("Unexpected helper format.");
- }
- Object.keys(toRename).forEach(function (name) {
- path.scope.rename(name, toRename[name]);
- });
- for (var _iterator = imps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _path = _ref;
- _path.remove();
- }
- for (var _iterator2 = impsBindingRefs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _path2 = _ref2;
- var node = cloneNode(dependenciesRefs[_path2.node.name]);
- _path2.replaceWith(node);
- }
- path.stop();
- }
- });
- }
- var helperData = Object.create(null);
- function loadHelper(name) {
- if (!helperData[name]) {
- var helper = helpers[name];
- if (!helper) {
- throw Object.assign(new ReferenceError("Unknown helper " + name), {
- code: "BABEL_HELPER_UNKNOWN",
- helper: name
- });
- }
- var fn = function fn() {
- return File(helper.ast());
- };
- var metadata = getHelperMetadata(fn());
- helperData[name] = {
- build: function build(getDependency, id, localBindings) {
- var file = fn();
- permuteHelperAST(file, metadata, id, localBindings, getDependency);
- return {
- nodes: file.program.body,
- globals: metadata.globals
- };
- },
- minVersion: function minVersion() {
- return helper.minVersion;
- },
- dependencies: metadata.dependencies
- };
- }
- return helperData[name];
- }
- function get$1(name, getDependency, id, localBindings) {
- return loadHelper(name).build(getDependency, id, localBindings);
- }
- function minVersion(name) {
- return loadHelper(name).minVersion();
- }
- function getDependencies(name) {
- return Array.from(loadHelper(name).dependencies.values());
- }
- function ensure(name) {
- loadHelper(name);
- }
- var list$1 = Object.keys(helpers).map(function (name) {
- return name.replace(/^_/, "");
- }).filter(function (name) {
- return name !== "__esModule";
- });
- var semver = createCommonjsModule(function (module, exports) {
- exports = module.exports = SemVer;
- var debug;
- if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
- debug = function debug() {
- var args = Array.prototype.slice.call(arguments, 0);
- args.unshift('SEMVER');
- console.log.apply(console, args);
- };
- } else {
- debug = function debug() {};
- }
- exports.SEMVER_SPEC_VERSION = '2.0.0';
- var MAX_LENGTH = 256;
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
- var MAX_SAFE_COMPONENT_LENGTH = 16;
- var re = exports.re = [];
- var src = exports.src = [];
- var t = exports.tokens = {};
- var R = 0;
- function tok(n) {
- t[n] = R++;
- }
- tok('NUMERICIDENTIFIER');
- src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*';
- tok('NUMERICIDENTIFIERLOOSE');
- src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+';
- tok('NONNUMERICIDENTIFIER');
- src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
- tok('MAINVERSION');
- src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')\\.' + '(' + src[t.NUMERICIDENTIFIER] + ')';
- tok('MAINVERSIONLOOSE');
- src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')';
- tok('PRERELEASEIDENTIFIER');
- src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] + '|' + src[t.NONNUMERICIDENTIFIER] + ')';
- tok('PRERELEASEIDENTIFIERLOOSE');
- src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] + '|' + src[t.NONNUMERICIDENTIFIER] + ')';
- tok('PRERELEASE');
- src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] + '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))';
- tok('PRERELEASELOOSE');
- src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))';
- tok('BUILDIDENTIFIER');
- src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
- tok('BUILD');
- src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] + '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))';
- tok('FULL');
- tok('FULLPLAIN');
- src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] + src[t.PRERELEASE] + '?' + src[t.BUILD] + '?';
- src[t.FULL] = '^' + src[t.FULLPLAIN] + '$';
- tok('LOOSEPLAIN');
- src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + '?' + src[t.BUILD] + '?';
- tok('LOOSE');
- src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$';
- tok('GTLT');
- src[t.GTLT] = '((?:<|>)?=?)';
- tok('XRANGEIDENTIFIERLOOSE');
- src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
- tok('XRANGEIDENTIFIER');
- src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*';
- tok('XRANGEPLAIN');
- src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' + '(?:' + src[t.PRERELEASE] + ')?' + src[t.BUILD] + '?' + ')?)?';
- tok('XRANGEPLAINLOOSE');
- src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[t.PRERELEASELOOSE] + ')?' + src[t.BUILD] + '?' + ')?)?';
- tok('XRANGE');
- src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$';
- tok('XRANGELOOSE');
- src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$';
- tok('COERCE');
- src[t.COERCE] = '(^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])';
- tok('COERCERTL');
- re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g');
- tok('LONETILDE');
- src[t.LONETILDE] = '(?:~>?)';
- tok('TILDETRIM');
- src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+';
- re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g');
- var tildeTrimReplace = '$1~';
- tok('TILDE');
- src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$';
- tok('TILDELOOSE');
- src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$';
- tok('LONECARET');
- src[t.LONECARET] = '(?:\\^)';
- tok('CARETTRIM');
- src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+';
- re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g');
- var caretTrimReplace = '$1^';
- tok('CARET');
- src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$';
- tok('CARETLOOSE');
- src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$';
- tok('COMPARATORLOOSE');
- src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$';
- tok('COMPARATOR');
- src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$';
- tok('COMPARATORTRIM');
- src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')';
- re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g');
- var comparatorTrimReplace = '$1$2$3';
- tok('HYPHENRANGE');
- src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAIN] + ')' + '\\s*$';
- tok('HYPHENRANGELOOSE');
- src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[t.XRANGEPLAINLOOSE] + ')' + '\\s*$';
- tok('STAR');
- src[t.STAR] = '(<|>)?=?\\s*\\*';
- for (var i = 0; i < R; i++) {
- debug(i, src[i]);
- if (!re[i]) {
- re[i] = new RegExp(src[i]);
- }
- }
- exports.parse = parse;
- function parse(version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof SemVer) {
- return version;
- }
- if (typeof version !== 'string') {
- return null;
- }
- if (version.length > MAX_LENGTH) {
- return null;
- }
- var r = options.loose ? re[t.LOOSE] : re[t.FULL];
- if (!r.test(version)) {
- return null;
- }
- try {
- return new SemVer(version, options);
- } catch (er) {
- return null;
- }
- }
- exports.valid = valid;
- function valid(version, options) {
- var v = parse(version, options);
- return v ? v.version : null;
- }
- exports.clean = clean;
- function clean(version, options) {
- var s = parse(version.trim().replace(/^[=v]+/, ''), options);
- return s ? s.version : null;
- }
- exports.SemVer = SemVer;
- function SemVer(version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof SemVer) {
- if (version.loose === options.loose) {
- return version;
- } else {
- version = version.version;
- }
- } else if (typeof version !== 'string') {
- throw new TypeError('Invalid Version: ' + version);
- }
- if (version.length > MAX_LENGTH) {
- throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters');
- }
- if (!(this instanceof SemVer)) {
- return new SemVer(version, options);
- }
- debug('SemVer', version, options);
- this.options = options;
- this.loose = !!options.loose;
- var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
- if (!m) {
- throw new TypeError('Invalid Version: ' + version);
- }
- this.raw = version;
- this.major = +m[1];
- this.minor = +m[2];
- this.patch = +m[3];
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
- throw new TypeError('Invalid major version');
- }
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
- throw new TypeError('Invalid minor version');
- }
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
- throw new TypeError('Invalid patch version');
- }
- if (!m[4]) {
- this.prerelease = [];
- } else {
- this.prerelease = m[4].split('.').map(function (id) {
- if (/^[0-9]+$/.test(id)) {
- var num = +id;
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
- return num;
- }
- }
- return id;
- });
- }
- this.build = m[5] ? m[5].split('.') : [];
- this.format();
- }
- SemVer.prototype.format = function () {
- this.version = this.major + '.' + this.minor + '.' + this.patch;
- if (this.prerelease.length) {
- this.version += '-' + this.prerelease.join('.');
- }
- return this.version;
- };
- SemVer.prototype.toString = function () {
- return this.version;
- };
- SemVer.prototype.compare = function (other) {
- debug('SemVer.compare', this.version, this.options, other);
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- return this.compareMain(other) || this.comparePre(other);
- };
- SemVer.prototype.compareMain = function (other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
- };
- SemVer.prototype.comparePre = function (other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- if (this.prerelease.length && !other.prerelease.length) {
- return -1;
- } else if (!this.prerelease.length && other.prerelease.length) {
- return 1;
- } else if (!this.prerelease.length && !other.prerelease.length) {
- return 0;
- }
- var i = 0;
- do {
- var a = this.prerelease[i];
- var b = other.prerelease[i];
- debug('prerelease compare', i, a, b);
- if (a === undefined && b === undefined) {
- return 0;
- } else if (b === undefined) {
- return 1;
- } else if (a === undefined) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers(a, b);
- }
- } while (++i);
- };
- SemVer.prototype.compareBuild = function (other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- var i = 0;
- do {
- var a = this.build[i];
- var b = other.build[i];
- debug('prerelease compare', i, a, b);
- if (a === undefined && b === undefined) {
- return 0;
- } else if (b === undefined) {
- return 1;
- } else if (a === undefined) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers(a, b);
- }
- } while (++i);
- };
- SemVer.prototype.inc = function (release, identifier) {
- switch (release) {
- case 'premajor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor = 0;
- this.major++;
- this.inc('pre', identifier);
- break;
- case 'preminor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor++;
- this.inc('pre', identifier);
- break;
- case 'prepatch':
- this.prerelease.length = 0;
- this.inc('patch', identifier);
- this.inc('pre', identifier);
- break;
- case 'prerelease':
- if (this.prerelease.length === 0) {
- this.inc('patch', identifier);
- }
- this.inc('pre', identifier);
- break;
- case 'major':
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
- this.major++;
- }
- this.minor = 0;
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'minor':
- if (this.patch !== 0 || this.prerelease.length === 0) {
- this.minor++;
- }
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'patch':
- if (this.prerelease.length === 0) {
- this.patch++;
- }
- this.prerelease = [];
- break;
- case 'pre':
- if (this.prerelease.length === 0) {
- this.prerelease = [0];
- } else {
- var i = this.prerelease.length;
- while (--i >= 0) {
- if (typeof this.prerelease[i] === 'number') {
- this.prerelease[i]++;
- i = -2;
- }
- }
- if (i === -1) {
- this.prerelease.push(0);
- }
- }
- if (identifier) {
- if (this.prerelease[0] === identifier) {
- if (isNaN(this.prerelease[1])) {
- this.prerelease = [identifier, 0];
- }
- } else {
- this.prerelease = [identifier, 0];
- }
- }
- break;
- default:
- throw new Error('invalid increment argument: ' + release);
- }
- this.format();
- this.raw = this.version;
- return this;
- };
- exports.inc = inc;
- function inc(version, release, loose, identifier) {
- if (typeof loose === 'string') {
- identifier = loose;
- loose = undefined;
- }
- try {
- return new SemVer(version, loose).inc(release, identifier).version;
- } catch (er) {
- return null;
- }
- }
- exports.diff = diff;
- function diff(version1, version2) {
- if (eq(version1, version2)) {
- return null;
- } else {
- var v1 = parse(version1);
- var v2 = parse(version2);
- var prefix = '';
- if (v1.prerelease.length || v2.prerelease.length) {
- prefix = 'pre';
- var defaultResult = 'prerelease';
- }
- for (var key in v1) {
- if (key === 'major' || key === 'minor' || key === 'patch') {
- if (v1[key] !== v2[key]) {
- return prefix + key;
- }
- }
- }
- return defaultResult;
- }
- }
- exports.compareIdentifiers = compareIdentifiers;
- var numeric = /^[0-9]+$/;
- function compareIdentifiers(a, b) {
- var anum = numeric.test(a);
- var bnum = numeric.test(b);
- if (anum && bnum) {
- a = +a;
- b = +b;
- }
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
- }
- exports.rcompareIdentifiers = rcompareIdentifiers;
- function rcompareIdentifiers(a, b) {
- return compareIdentifiers(b, a);
- }
- exports.major = major;
- function major(a, loose) {
- return new SemVer(a, loose).major;
- }
- exports.minor = minor;
- function minor(a, loose) {
- return new SemVer(a, loose).minor;
- }
- exports.patch = patch;
- function patch(a, loose) {
- return new SemVer(a, loose).patch;
- }
- exports.compare = compare;
- function compare(a, b, loose) {
- return new SemVer(a, loose).compare(new SemVer(b, loose));
- }
- exports.compareLoose = compareLoose;
- function compareLoose(a, b) {
- return compare(a, b, true);
- }
- exports.compareBuild = compareBuild;
- function compareBuild(a, b, loose) {
- var versionA = new SemVer(a, loose);
- var versionB = new SemVer(b, loose);
- return versionA.compare(versionB) || versionA.compareBuild(versionB);
- }
- exports.rcompare = rcompare;
- function rcompare(a, b, loose) {
- return compare(b, a, loose);
- }
- exports.sort = sort;
- function sort(list, loose) {
- return list.sort(function (a, b) {
- return exports.compareBuild(a, b, loose);
- });
- }
- exports.rsort = rsort;
- function rsort(list, loose) {
- return list.sort(function (a, b) {
- return exports.compareBuild(b, a, loose);
- });
- }
- exports.gt = gt;
- function gt(a, b, loose) {
- return compare(a, b, loose) > 0;
- }
- exports.lt = lt;
- function lt(a, b, loose) {
- return compare(a, b, loose) < 0;
- }
- exports.eq = eq;
- function eq(a, b, loose) {
- return compare(a, b, loose) === 0;
- }
- exports.neq = neq;
- function neq(a, b, loose) {
- return compare(a, b, loose) !== 0;
- }
- exports.gte = gte;
- function gte(a, b, loose) {
- return compare(a, b, loose) >= 0;
- }
- exports.lte = lte;
- function lte(a, b, loose) {
- return compare(a, b, loose) <= 0;
- }
- exports.cmp = cmp;
- function cmp(a, op, b, loose) {
- switch (op) {
- case '===':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- return a === b;
- case '!==':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- return a !== b;
- case '':
- case '=':
- case '==':
- return eq(a, b, loose);
- case '!=':
- return neq(a, b, loose);
- case '>':
- return gt(a, b, loose);
- case '>=':
- return gte(a, b, loose);
- case '<':
- return lt(a, b, loose);
- case '<=':
- return lte(a, b, loose);
- default:
- throw new TypeError('Invalid operator: ' + op);
- }
- }
- exports.Comparator = Comparator;
- function Comparator(comp, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (comp instanceof Comparator) {
- if (comp.loose === !!options.loose) {
- return comp;
- } else {
- comp = comp.value;
- }
- }
- if (!(this instanceof Comparator)) {
- return new Comparator(comp, options);
- }
- debug('comparator', comp, options);
- this.options = options;
- this.loose = !!options.loose;
- this.parse(comp);
- if (this.semver === ANY) {
- this.value = '';
- } else {
- this.value = this.operator + this.semver.version;
- }
- debug('comp', this);
- }
- var ANY = {};
- Comparator.prototype.parse = function (comp) {
- var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
- var m = comp.match(r);
- if (!m) {
- throw new TypeError('Invalid comparator: ' + comp);
- }
- this.operator = m[1] !== undefined ? m[1] : '';
- if (this.operator === '=') {
- this.operator = '';
- }
- if (!m[2]) {
- this.semver = ANY;
- } else {
- this.semver = new SemVer(m[2], this.options.loose);
- }
- };
- Comparator.prototype.toString = function () {
- return this.value;
- };
- Comparator.prototype.test = function (version) {
- debug('Comparator.test', version, this.options.loose);
- if (this.semver === ANY || version === ANY) {
- return true;
- }
- if (typeof version === 'string') {
- try {
- version = new SemVer(version, this.options);
- } catch (er) {
- return false;
- }
- }
- return cmp(version, this.operator, this.semver, this.options);
- };
- Comparator.prototype.intersects = function (comp, options) {
- if (!(comp instanceof Comparator)) {
- throw new TypeError('a Comparator is required');
- }
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- var rangeTmp;
- if (this.operator === '') {
- if (this.value === '') {
- return true;
- }
- rangeTmp = new Range(comp.value, options);
- return satisfies(this.value, rangeTmp, options);
- } else if (comp.operator === '') {
- if (comp.value === '') {
- return true;
- }
- rangeTmp = new Range(this.value, options);
- return satisfies(comp.semver, rangeTmp, options);
- }
- var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>');
- var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<');
- var sameSemVer = this.semver.version === comp.semver.version;
- var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=');
- var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && (this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<');
- var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && (this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>');
- return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
- };
- exports.Range = Range;
- function Range(range, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (range instanceof Range) {
- if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
- return range;
- } else {
- return new Range(range.raw, options);
- }
- }
- if (range instanceof Comparator) {
- return new Range(range.value, options);
- }
- if (!(this instanceof Range)) {
- return new Range(range, options);
- }
- this.options = options;
- this.loose = !!options.loose;
- this.includePrerelease = !!options.includePrerelease;
- this.raw = range;
- this.set = range.split(/\s*\|\|\s*/).map(function (range) {
- return this.parseRange(range.trim());
- }, this).filter(function (c) {
- return c.length;
- });
- if (!this.set.length) {
- throw new TypeError('Invalid SemVer Range: ' + range);
- }
- this.format();
- }
- Range.prototype.format = function () {
- this.range = this.set.map(function (comps) {
- return comps.join(' ').trim();
- }).join('||').trim();
- return this.range;
- };
- Range.prototype.toString = function () {
- return this.range;
- };
- Range.prototype.parseRange = function (range) {
- var loose = this.options.loose;
- range = range.trim();
- var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
- range = range.replace(hr, hyphenReplace);
- debug('hyphen replace', range);
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
- debug('comparator trim', range, re[t.COMPARATORTRIM]);
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
- range = range.split(/\s+/).join(' ');
- var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
- var set = range.split(' ').map(function (comp) {
- return parseComparator(comp, this.options);
- }, this).join(' ').split(/\s+/);
- if (this.options.loose) {
- set = set.filter(function (comp) {
- return !!comp.match(compRe);
- });
- }
- set = set.map(function (comp) {
- return new Comparator(comp, this.options);
- }, this);
- return set;
- };
- Range.prototype.intersects = function (range, options) {
- if (!(range instanceof Range)) {
- throw new TypeError('a Range is required');
- }
- return this.set.some(function (thisComparators) {
- return isSatisfiable(thisComparators, options) && range.set.some(function (rangeComparators) {
- return isSatisfiable(rangeComparators, options) && thisComparators.every(function (thisComparator) {
- return rangeComparators.every(function (rangeComparator) {
- return thisComparator.intersects(rangeComparator, options);
- });
- });
- });
- });
- };
- function isSatisfiable(comparators, options) {
- var result = true;
- var remainingComparators = comparators.slice();
- var testComparator = remainingComparators.pop();
- while (result && remainingComparators.length) {
- result = remainingComparators.every(function (otherComparator) {
- return testComparator.intersects(otherComparator, options);
- });
- testComparator = remainingComparators.pop();
- }
- return result;
- }
- exports.toComparators = toComparators;
- function toComparators(range, options) {
- return new Range(range, options).set.map(function (comp) {
- return comp.map(function (c) {
- return c.value;
- }).join(' ').trim().split(' ');
- });
- }
- function parseComparator(comp, options) {
- debug('comp', comp, options);
- comp = replaceCarets(comp, options);
- debug('caret', comp);
- comp = replaceTildes(comp, options);
- debug('tildes', comp);
- comp = replaceXRanges(comp, options);
- debug('xrange', comp);
- comp = replaceStars(comp, options);
- debug('stars', comp);
- return comp;
- }
- function isX(id) {
- return !id || id.toLowerCase() === 'x' || id === '*';
- }
- function replaceTildes(comp, options) {
- return comp.trim().split(/\s+/).map(function (comp) {
- return replaceTilde(comp, options);
- }).join(' ');
- }
- function replaceTilde(comp, options) {
- var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
- return comp.replace(r, function (_, M, m, p, pr) {
- debug('tilde', comp, _, M, m, p, pr);
- var ret;
- if (isX(M)) {
- ret = '';
- } else if (isX(m)) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
- } else if (isX(p)) {
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
- } else if (pr) {
- debug('replaceTilde pr', pr);
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0';
- } else {
- ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0';
- }
- debug('tilde return', ret);
- return ret;
- });
- }
- function replaceCarets(comp, options) {
- return comp.trim().split(/\s+/).map(function (comp) {
- return replaceCaret(comp, options);
- }).join(' ');
- }
- function replaceCaret(comp, options) {
- debug('caret', comp, options);
- var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
- return comp.replace(r, function (_, M, m, p, pr) {
- debug('caret', comp, _, M, m, p, pr);
- var ret;
- if (isX(M)) {
- ret = '';
- } else if (isX(m)) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
- } else if (isX(p)) {
- if (M === '0') {
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
- } else {
- ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
- }
- } else if (pr) {
- debug('replaceCaret pr', pr);
- if (M === '0') {
- if (m === '0') {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1);
- } else {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0';
- }
- } else {
- ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0';
- }
- } else {
- debug('no pr');
- if (M === '0') {
- if (m === '0') {
- ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1);
- } else {
- ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0';
- }
- } else {
- ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0';
- }
- }
- debug('caret return', ret);
- return ret;
- });
- }
- function replaceXRanges(comp, options) {
- debug('replaceXRanges', comp, options);
- return comp.split(/\s+/).map(function (comp) {
- return replaceXRange(comp, options);
- }).join(' ');
- }
- function replaceXRange(comp, options) {
- comp = comp.trim();
- var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
- return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
- var xM = isX(M);
- var xm = xM || isX(m);
- var xp = xm || isX(p);
- var anyX = xp;
- if (gtlt === '=' && anyX) {
- gtlt = '';
- }
- pr = options.includePrerelease ? '-0' : '';
- if (xM) {
- if (gtlt === '>' || gtlt === '<') {
- ret = '<0.0.0-0';
- } else {
- ret = '*';
- }
- } else if (gtlt && anyX) {
- if (xm) {
- m = 0;
- }
- p = 0;
- if (gtlt === '>') {
- gtlt = '>=';
- if (xm) {
- M = +M + 1;
- m = 0;
- p = 0;
- } else {
- m = +m + 1;
- p = 0;
- }
- } else if (gtlt === '<=') {
- gtlt = '<';
- if (xm) {
- M = +M + 1;
- } else {
- m = +m + 1;
- }
- }
- ret = gtlt + M + '.' + m + '.' + p + pr;
- } else if (xm) {
- ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr;
- } else if (xp) {
- ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr;
- }
- debug('xRange return', ret);
- return ret;
- });
- }
- function replaceStars(comp, options) {
- debug('replaceStars', comp, options);
- return comp.trim().replace(re[t.STAR], '');
- }
- function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
- if (isX(fM)) {
- from = '';
- } else if (isX(fm)) {
- from = '>=' + fM + '.0.0';
- } else if (isX(fp)) {
- from = '>=' + fM + '.' + fm + '.0';
- } else {
- from = '>=' + from;
- }
- if (isX(tM)) {
- to = '';
- } else if (isX(tm)) {
- to = '<' + (+tM + 1) + '.0.0';
- } else if (isX(tp)) {
- to = '<' + tM + '.' + (+tm + 1) + '.0';
- } else if (tpr) {
- to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
- } else {
- to = '<=' + to;
- }
- return (from + ' ' + to).trim();
- }
- Range.prototype.test = function (version) {
- if (!version) {
- return false;
- }
- if (typeof version === 'string') {
- try {
- version = new SemVer(version, this.options);
- } catch (er) {
- return false;
- }
- }
- for (var i = 0; i < this.set.length; i++) {
- if (testSet(this.set[i], version, this.options)) {
- return true;
- }
- }
- return false;
- };
- function testSet(set, version, options) {
- for (var i = 0; i < set.length; i++) {
- if (!set[i].test(version)) {
- return false;
- }
- }
- if (version.prerelease.length && !options.includePrerelease) {
- for (i = 0; i < set.length; i++) {
- debug(set[i].semver);
- if (set[i].semver === ANY) {
- continue;
- }
- if (set[i].semver.prerelease.length > 0) {
- var allowed = set[i].semver;
- if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
- return true;
- }
- }
- }
- return false;
- }
- return true;
- }
- exports.satisfies = satisfies;
- function satisfies(version, range, options) {
- try {
- range = new Range(range, options);
- } catch (er) {
- return false;
- }
- return range.test(version);
- }
- exports.maxSatisfying = maxSatisfying;
- function maxSatisfying(versions, range, options) {
- var max = null;
- var maxSV = null;
- try {
- var rangeObj = new Range(range, options);
- } catch (er) {
- return null;
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) {
- if (!max || maxSV.compare(v) === -1) {
- max = v;
- maxSV = new SemVer(max, options);
- }
- }
- });
- return max;
- }
- exports.minSatisfying = minSatisfying;
- function minSatisfying(versions, range, options) {
- var min = null;
- var minSV = null;
- try {
- var rangeObj = new Range(range, options);
- } catch (er) {
- return null;
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) {
- if (!min || minSV.compare(v) === 1) {
- min = v;
- minSV = new SemVer(min, options);
- }
- }
- });
- return min;
- }
- exports.minVersion = minVersion;
- function minVersion(range, loose) {
- range = new Range(range, loose);
- var minver = new SemVer('0.0.0');
- if (range.test(minver)) {
- return minver;
- }
- minver = new SemVer('0.0.0-0');
- if (range.test(minver)) {
- return minver;
- }
- minver = null;
- for (var i = 0; i < range.set.length; ++i) {
- var comparators = range.set[i];
- comparators.forEach(function (comparator) {
- var compver = new SemVer(comparator.semver.version);
- switch (comparator.operator) {
- case '>':
- if (compver.prerelease.length === 0) {
- compver.patch++;
- } else {
- compver.prerelease.push(0);
- }
- compver.raw = compver.format();
- case '':
- case '>=':
- if (!minver || gt(minver, compver)) {
- minver = compver;
- }
- break;
- case '<':
- case '<=':
- break;
- default:
- throw new Error('Unexpected operation: ' + comparator.operator);
- }
- });
- }
- if (minver && range.test(minver)) {
- return minver;
- }
- return null;
- }
- exports.validRange = validRange;
- function validRange(range, options) {
- try {
- return new Range(range, options).range || '*';
- } catch (er) {
- return null;
- }
- }
- exports.ltr = ltr;
- function ltr(version, range, options) {
- return outside(version, range, '<', options);
- }
- exports.gtr = gtr;
- function gtr(version, range, options) {
- return outside(version, range, '>', options);
- }
- exports.outside = outside;
- function outside(version, range, hilo, options) {
- version = new SemVer(version, options);
- range = new Range(range, options);
- var gtfn, ltefn, ltfn, comp, ecomp;
- switch (hilo) {
- case '>':
- gtfn = gt;
- ltefn = lte;
- ltfn = lt;
- comp = '>';
- ecomp = '>=';
- break;
- case '<':
- gtfn = lt;
- ltefn = gte;
- ltfn = gt;
- comp = '<';
- ecomp = '<=';
- break;
- default:
- throw new TypeError('Must provide a hilo val of "<" or ">"');
- }
- if (satisfies(version, range, options)) {
- return false;
- }
- for (var i = 0; i < range.set.length; ++i) {
- var comparators = range.set[i];
- var high = null;
- var low = null;
- comparators.forEach(function (comparator) {
- if (comparator.semver === ANY) {
- comparator = new Comparator('>=0.0.0');
- }
- high = high || comparator;
- low = low || comparator;
- if (gtfn(comparator.semver, high.semver, options)) {
- high = comparator;
- } else if (ltfn(comparator.semver, low.semver, options)) {
- low = comparator;
- }
- });
- if (high.operator === comp || high.operator === ecomp) {
- return false;
- }
- if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
- return false;
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
- return false;
- }
- }
- return true;
- }
- exports.prerelease = prerelease;
- function prerelease(version, options) {
- var parsed = parse(version, options);
- return parsed && parsed.prerelease.length ? parsed.prerelease : null;
- }
- exports.intersects = intersects;
- function intersects(r1, r2, options) {
- r1 = new Range(r1, options);
- r2 = new Range(r2, options);
- return r1.intersects(r2);
- }
- exports.coerce = coerce;
- function coerce(version, options) {
- if (version instanceof SemVer) {
- return version;
- }
- if (typeof version === 'number') {
- version = String(version);
- }
- if (typeof version !== 'string') {
- return null;
- }
- options = options || {};
- var match = null;
- if (!options.rtl) {
- match = version.match(re[t.COERCE]);
- } else {
- var next;
- while ((next = re[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
- match = next;
- }
- re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
- }
- re[t.COERCERTL].lastIndex = -1;
- }
- if (match === null) {
- return null;
- }
- return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options);
- }
- });
- var semver_1 = semver.SEMVER_SPEC_VERSION;
- var semver_2 = semver.re;
- var semver_3 = semver.src;
- var semver_4 = semver.tokens;
- var semver_5 = semver.parse;
- var semver_6 = semver.valid;
- var semver_7 = semver.clean;
- var semver_8 = semver.SemVer;
- var semver_9 = semver.inc;
- var semver_10 = semver.diff;
- var semver_11 = semver.compareIdentifiers;
- var semver_12 = semver.rcompareIdentifiers;
- var semver_13 = semver.major;
- var semver_14 = semver.minor;
- var semver_15 = semver.patch;
- var semver_16 = semver.compare;
- var semver_17 = semver.compareLoose;
- var semver_18 = semver.compareBuild;
- var semver_19 = semver.rcompare;
- var semver_20 = semver.sort;
- var semver_21 = semver.rsort;
- var semver_22 = semver.gt;
- var semver_23 = semver.lt;
- var semver_24 = semver.eq;
- var semver_25 = semver.neq;
- var semver_26 = semver.gte;
- var semver_27 = semver.lte;
- var semver_28 = semver.cmp;
- var semver_29 = semver.Comparator;
- var semver_30 = semver.Range;
- var semver_31 = semver.toComparators;
- var semver_32 = semver.satisfies;
- var semver_33 = semver.maxSatisfying;
- var semver_34 = semver.minSatisfying;
- var semver_35 = semver.minVersion;
- var semver_36 = semver.validRange;
- var semver_37 = semver.ltr;
- var semver_38 = semver.gtr;
- var semver_39 = semver.outside;
- var semver_40 = semver.prerelease;
- var semver_41 = semver.intersects;
- var semver_42 = semver.coerce;
- var errorVisitor = {
- enter: function enter(path, state) {
- var loc = path.node.loc;
- if (loc) {
- state.loc = loc;
- path.stop();
- }
- }
- };
- var File$2 = function () {
- function File(options, _ref) {
- var _this = this;
- var code = _ref.code,
- ast = _ref.ast,
- inputMap = _ref.inputMap;
- this._map = new Map();
- this.declarations = {};
- this.path = null;
- this.ast = {};
- this.metadata = {};
- this.code = "";
- this.inputMap = null;
- this.hub = {
- file: this,
- getCode: function getCode() {
- return _this.code;
- },
- getScope: function getScope() {
- return _this.scope;
- },
- addHelper: this.addHelper.bind(this),
- buildError: this.buildCodeFrameError.bind(this)
- };
- this.opts = options;
- this.code = code;
- this.ast = ast;
- this.inputMap = inputMap;
- this.path = NodePath.get({
- hub: this.hub,
- parentPath: null,
- parent: this.ast,
- container: this.ast,
- key: "program"
- }).setContext();
- this.scope = this.path.scope;
- }
- var _proto = File.prototype;
- _proto.set = function set(key, val) {
- if (key === "helpersNamespace") {
- throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'.");
- }
- this._map.set(key, val);
- };
- _proto.get = function get(key) {
- return this._map.get(key);
- };
- _proto.has = function has(key) {
- return this._map.has(key);
- };
- _proto.getModuleName = function getModuleName() {
- var _this$opts = this.opts,
- filename = _this$opts.filename,
- _this$opts$filenameRe = _this$opts.filenameRelative,
- filenameRelative = _this$opts$filenameRe === void 0 ? filename : _this$opts$filenameRe,
- moduleId = _this$opts.moduleId,
- _this$opts$moduleIds = _this$opts.moduleIds,
- moduleIds = _this$opts$moduleIds === void 0 ? !!moduleId : _this$opts$moduleIds,
- getModuleId = _this$opts.getModuleId,
- sourceRootTmp = _this$opts.sourceRoot,
- _this$opts$moduleRoot = _this$opts.moduleRoot,
- moduleRoot = _this$opts$moduleRoot === void 0 ? sourceRootTmp : _this$opts$moduleRoot,
- _this$opts$sourceRoot = _this$opts.sourceRoot,
- sourceRoot = _this$opts$sourceRoot === void 0 ? moduleRoot : _this$opts$sourceRoot;
- if (!moduleIds) return null;
- if (moduleId != null && !getModuleId) {
- return moduleId;
- }
- var moduleName = moduleRoot != null ? moduleRoot + "/" : "";
- if (filenameRelative) {
- var sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
- moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.(\w*?)$/, "");
- }
- moduleName = moduleName.replace(/\\/g, "/");
- if (getModuleId) {
- return getModuleId(moduleName) || moduleName;
- } else {
- return moduleName;
- }
- };
- _proto.addImport = function addImport() {
- throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");
- };
- _proto.availableHelper = function availableHelper(name, versionRange) {
- var minVersion$1;
- try {
- minVersion$1 = minVersion(name);
- } catch (err) {
- if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
- return false;
- }
- if (typeof versionRange !== "string") return true;
- if (semver.valid(versionRange)) versionRange = "^" + versionRange;
- return !semver.intersects("<" + minVersion$1, versionRange) && !semver.intersects(">=8.0.0", versionRange);
- };
- _proto.addHelper = function addHelper(name) {
- var _this2 = this;
- var declar = this.declarations[name];
- if (declar) return cloneNode(declar);
- var generator = this.get("helperGenerator");
- if (generator) {
- var res = generator(name);
- if (res) return res;
- }
- ensure(name);
- var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
- var dependencies = {};
- for (var _iterator = getDependencies(name), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var dep = _ref2;
- dependencies[dep] = this.addHelper(dep);
- }
- var _helpers$get = get$1(name, function (dep) {
- return dependencies[dep];
- }, uid, Object.keys(this.scope.getAllBindings())),
- nodes = _helpers$get.nodes,
- globals = _helpers$get.globals;
- globals.forEach(function (name) {
- if (_this2.path.scope.hasBinding(name, true)) {
- _this2.path.scope.rename(name);
- }
- });
- nodes.forEach(function (node) {
- node._compact = true;
- });
- this.path.unshiftContainer("body", nodes);
- this.path.get("body").forEach(function (path) {
- if (nodes.indexOf(path.node) === -1) return;
- if (path.isVariableDeclaration()) _this2.scope.registerDeclaration(path);
- });
- return uid;
- };
- _proto.addTemplateObject = function addTemplateObject() {
- throw new Error("This function has been moved into the template literal transform itself.");
- };
- _proto.buildCodeFrameError = function buildCodeFrameError(node, msg, Error) {
- if (Error === void 0) {
- Error = SyntaxError;
- }
- var loc = node && (node.loc || node._loc);
- if (!loc && node) {
- var state = {
- loc: null
- };
- traverse$1(node, errorVisitor, this.scope, state);
- loc = state.loc;
- var txt = "This is an error on an internal node. Probably an internal error.";
- if (loc) txt += " Location has been estimated.";
- msg += " (" + txt + ")";
- }
- if (loc) {
- var _this$opts$highlightC = this.opts.highlightCode,
- highlightCode = _this$opts$highlightC === void 0 ? true : _this$opts$highlightC;
- msg += "\n" + codeFrameColumns(this.code, {
- start: {
- line: loc.start.line,
- column: loc.start.column + 1
- },
- end: loc.end && loc.start.line === loc.end.line ? {
- line: loc.end.line,
- column: loc.end.column + 1
- } : undefined
- }, {
- highlightCode: highlightCode
- });
- }
- return new Error(msg);
- };
- _createClass(File, [{
- key: "shebang",
- get: function get() {
- var interpreter = this.path.node.interpreter;
- return interpreter ? interpreter.value : "";
- },
- set: function set(value) {
- if (value) {
- this.path.get("interpreter").replaceWith(InterpreterDirective(value));
- } else {
- this.path.get("interpreter").remove();
- }
- }
- }]);
- return File;
- }();
- function _templateObject$1() {
- var data = _taggedTemplateLiteralLoose(["\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n "]);
- _templateObject$1 = function _templateObject() {
- return data;
- };
- return data;
- }
- var buildUmdWrapper = function buildUmdWrapper(replacements) {
- return template(_templateObject$1())(replacements);
- };
- function buildGlobal(whitelist) {
- var namespace = Identifier("babelHelpers");
- var body = [];
- var container = FunctionExpression(null, [Identifier("global")], BlockStatement(body));
- var tree = Program([ExpressionStatement(CallExpression(container, [ConditionalExpression(BinaryExpression("===", UnaryExpression("typeof", Identifier("global")), StringLiteral("undefined")), Identifier("self"), Identifier("global"))]))]);
- body.push(VariableDeclaration("var", [VariableDeclarator(namespace, AssignmentExpression("=", MemberExpression(Identifier("global"), namespace), ObjectExpression([])))]));
- buildHelpers(body, namespace, whitelist);
- return tree;
- }
- function buildModule(whitelist) {
- var body = [];
- var refs = buildHelpers(body, null, whitelist);
- body.unshift(ExportNamedDeclaration(null, Object.keys(refs).map(function (name) {
- return ExportSpecifier(cloneNode(refs[name]), Identifier(name));
- })));
- return Program(body, [], "module");
- }
- function buildUmd(whitelist) {
- var namespace = Identifier("babelHelpers");
- var body = [];
- body.push(VariableDeclaration("var", [VariableDeclarator(namespace, Identifier("global"))]));
- buildHelpers(body, namespace, whitelist);
- return Program([buildUmdWrapper({
- FACTORY_PARAMETERS: Identifier("global"),
- BROWSER_ARGUMENTS: AssignmentExpression("=", MemberExpression(Identifier("root"), namespace), ObjectExpression([])),
- COMMON_ARGUMENTS: Identifier("exports"),
- AMD_ARGUMENTS: ArrayExpression([StringLiteral("exports")]),
- FACTORY_BODY: body,
- UMD_ROOT: Identifier("this")
- })]);
- }
- function buildVar(whitelist) {
- var namespace = Identifier("babelHelpers");
- var body = [];
- body.push(VariableDeclaration("var", [VariableDeclarator(namespace, ObjectExpression([]))]));
- var tree = Program(body);
- buildHelpers(body, namespace, whitelist);
- body.push(ExpressionStatement(namespace));
- return tree;
- }
- function buildHelpers(body, namespace, whitelist) {
- var getHelperReference = function getHelperReference(name) {
- return namespace ? MemberExpression(namespace, Identifier(name)) : Identifier("_" + name);
- };
- var refs = {};
- list$1.forEach(function (name) {
- if (whitelist && whitelist.indexOf(name) < 0) return;
- var ref = refs[name] = getHelperReference(name);
- var _helpers$get = get$1(name, getHelperReference, ref),
- nodes = _helpers$get.nodes;
- body.push.apply(body, nodes);
- });
- return refs;
- }
- function babelBuildExternalHelpers (whitelist, outputType) {
- if (outputType === void 0) {
- outputType = "global";
- }
- var tree;
- var build = {
- global: buildGlobal,
- module: buildModule,
- umd: buildUmd,
- "var": buildVar
- }[outputType];
- if (build) {
- tree = build(whitelist);
- } else {
- throw new Error("Unsupported output type " + outputType);
- }
- return generateCode(tree).code;
- }
- var runtime_1 = createCommonjsModule(function (module) {
- var runtime = function (exports) {
- var Op = Object.prototype;
- var hasOwn = Op.hasOwnProperty;
- var undefined$1;
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
- function wrap(innerFn, outerFn, self, tryLocsList) {
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
- var generator = Object.create(protoGenerator.prototype);
- var context = new Context(tryLocsList || []);
- generator._invoke = makeInvokeMethod(innerFn, self, context);
- return generator;
- }
- exports.wrap = wrap;
- function tryCatch(fn, obj, arg) {
- try {
- return {
- type: "normal",
- arg: fn.call(obj, arg)
- };
- } catch (err) {
- return {
- type: "throw",
- arg: err
- };
- }
- }
- var GenStateSuspendedStart = "suspendedStart";
- var GenStateSuspendedYield = "suspendedYield";
- var GenStateExecuting = "executing";
- var GenStateCompleted = "completed";
- var ContinueSentinel = {};
- function Generator() {}
- function GeneratorFunction() {}
- function GeneratorFunctionPrototype() {}
- var IteratorPrototype = {};
- IteratorPrototype[iteratorSymbol] = function () {
- return this;
- };
- var getProto = Object.getPrototypeOf;
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
- IteratorPrototype = NativeIteratorPrototype;
- }
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
- GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction";
- function defineIteratorMethods(prototype) {
- ["next", "throw", "return"].forEach(function (method) {
- prototype[method] = function (arg) {
- return this._invoke(method, arg);
- };
- });
- }
- exports.isGeneratorFunction = function (genFun) {
- var ctor = typeof genFun === "function" && genFun.constructor;
- return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
- };
- exports.mark = function (genFun) {
- if (Object.setPrototypeOf) {
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
- } else {
- genFun.__proto__ = GeneratorFunctionPrototype;
- if (!(toStringTagSymbol in genFun)) {
- genFun[toStringTagSymbol] = "GeneratorFunction";
- }
- }
- genFun.prototype = Object.create(Gp);
- return genFun;
- };
- exports.awrap = function (arg) {
- return {
- __await: arg
- };
- };
- function AsyncIterator(generator) {
- function invoke(method, arg, resolve, reject) {
- var record = tryCatch(generator[method], generator, arg);
- if (record.type === "throw") {
- reject(record.arg);
- } else {
- var result = record.arg;
- var value = result.value;
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
- return Promise.resolve(value.__await).then(function (value) {
- invoke("next", value, resolve, reject);
- }, function (err) {
- invoke("throw", err, resolve, reject);
- });
- }
- return Promise.resolve(value).then(function (unwrapped) {
- result.value = unwrapped;
- resolve(result);
- }, function (error) {
- return invoke("throw", error, resolve, reject);
- });
- }
- }
- var previousPromise;
- function enqueue(method, arg) {
- function callInvokeWithMethodAndArg() {
- return new Promise(function (resolve, reject) {
- invoke(method, arg, resolve, reject);
- });
- }
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
- }
- this._invoke = enqueue;
- }
- defineIteratorMethods(AsyncIterator.prototype);
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
- return this;
- };
- exports.AsyncIterator = AsyncIterator;
- exports.async = function (innerFn, outerFn, self, tryLocsList) {
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList));
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
- return result.done ? result.value : iter.next();
- });
- };
- function makeInvokeMethod(innerFn, self, context) {
- var state = GenStateSuspendedStart;
- return function invoke(method, arg) {
- if (state === GenStateExecuting) {
- throw new Error("Generator is already running");
- }
- if (state === GenStateCompleted) {
- if (method === "throw") {
- throw arg;
- }
- return doneResult();
- }
- context.method = method;
- context.arg = arg;
- while (true) {
- var delegate = context.delegate;
- if (delegate) {
- var delegateResult = maybeInvokeDelegate(delegate, context);
- if (delegateResult) {
- if (delegateResult === ContinueSentinel) continue;
- return delegateResult;
- }
- }
- if (context.method === "next") {
- context.sent = context._sent = context.arg;
- } else if (context.method === "throw") {
- if (state === GenStateSuspendedStart) {
- state = GenStateCompleted;
- throw context.arg;
- }
- context.dispatchException(context.arg);
- } else if (context.method === "return") {
- context.abrupt("return", context.arg);
- }
- state = GenStateExecuting;
- var record = tryCatch(innerFn, self, context);
- if (record.type === "normal") {
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
- if (record.arg === ContinueSentinel) {
- continue;
- }
- return {
- value: record.arg,
- done: context.done
- };
- } else if (record.type === "throw") {
- state = GenStateCompleted;
- context.method = "throw";
- context.arg = record.arg;
- }
- }
- };
- }
- function maybeInvokeDelegate(delegate, context) {
- var method = delegate.iterator[context.method];
- if (method === undefined$1) {
- context.delegate = null;
- if (context.method === "throw") {
- if (delegate.iterator["return"]) {
- context.method = "return";
- context.arg = undefined$1;
- maybeInvokeDelegate(delegate, context);
- if (context.method === "throw") {
- return ContinueSentinel;
- }
- }
- context.method = "throw";
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
- }
- return ContinueSentinel;
- }
- var record = tryCatch(method, delegate.iterator, context.arg);
- if (record.type === "throw") {
- context.method = "throw";
- context.arg = record.arg;
- context.delegate = null;
- return ContinueSentinel;
- }
- var info = record.arg;
- if (!info) {
- context.method = "throw";
- context.arg = new TypeError("iterator result is not an object");
- context.delegate = null;
- return ContinueSentinel;
- }
- if (info.done) {
- context[delegate.resultName] = info.value;
- context.next = delegate.nextLoc;
- if (context.method !== "return") {
- context.method = "next";
- context.arg = undefined$1;
- }
- } else {
- return info;
- }
- context.delegate = null;
- return ContinueSentinel;
- }
- defineIteratorMethods(Gp);
- Gp[toStringTagSymbol] = "Generator";
- Gp[iteratorSymbol] = function () {
- return this;
- };
- Gp.toString = function () {
- return "[object Generator]";
- };
- function pushTryEntry(locs) {
- var entry = {
- tryLoc: locs[0]
- };
- if (1 in locs) {
- entry.catchLoc = locs[1];
- }
- if (2 in locs) {
- entry.finallyLoc = locs[2];
- entry.afterLoc = locs[3];
- }
- this.tryEntries.push(entry);
- }
- function resetTryEntry(entry) {
- var record = entry.completion || {};
- record.type = "normal";
- delete record.arg;
- entry.completion = record;
- }
- function Context(tryLocsList) {
- this.tryEntries = [{
- tryLoc: "root"
- }];
- tryLocsList.forEach(pushTryEntry, this);
- this.reset(true);
- }
- exports.keys = function (object) {
- var keys = [];
- for (var key in object) {
- keys.push(key);
- }
- keys.reverse();
- return function next() {
- while (keys.length) {
- var key = keys.pop();
- if (key in object) {
- next.value = key;
- next.done = false;
- return next;
- }
- }
- next.done = true;
- return next;
- };
- };
- function values(iterable) {
- if (iterable) {
- var iteratorMethod = iterable[iteratorSymbol];
- if (iteratorMethod) {
- return iteratorMethod.call(iterable);
- }
- if (typeof iterable.next === "function") {
- return iterable;
- }
- if (!isNaN(iterable.length)) {
- var i = -1,
- next = function next() {
- while (++i < iterable.length) {
- if (hasOwn.call(iterable, i)) {
- next.value = iterable[i];
- next.done = false;
- return next;
- }
- }
- next.value = undefined$1;
- next.done = true;
- return next;
- };
- return next.next = next;
- }
- }
- return {
- next: doneResult
- };
- }
- exports.values = values;
- function doneResult() {
- return {
- value: undefined$1,
- done: true
- };
- }
- Context.prototype = {
- constructor: Context,
- reset: function reset(skipTempReset) {
- this.prev = 0;
- this.next = 0;
- this.sent = this._sent = undefined$1;
- this.done = false;
- this.delegate = null;
- this.method = "next";
- this.arg = undefined$1;
- this.tryEntries.forEach(resetTryEntry);
- if (!skipTempReset) {
- for (var name in this) {
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
- this[name] = undefined$1;
- }
- }
- }
- },
- stop: function stop() {
- this.done = true;
- var rootEntry = this.tryEntries[0];
- var rootRecord = rootEntry.completion;
- if (rootRecord.type === "throw") {
- throw rootRecord.arg;
- }
- return this.rval;
- },
- dispatchException: function dispatchException(exception) {
- if (this.done) {
- throw exception;
- }
- var context = this;
- function handle(loc, caught) {
- record.type = "throw";
- record.arg = exception;
- context.next = loc;
- if (caught) {
- context.method = "next";
- context.arg = undefined$1;
- }
- return !!caught;
- }
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- var record = entry.completion;
- if (entry.tryLoc === "root") {
- return handle("end");
- }
- if (entry.tryLoc <= this.prev) {
- var hasCatch = hasOwn.call(entry, "catchLoc");
- var hasFinally = hasOwn.call(entry, "finallyLoc");
- if (hasCatch && hasFinally) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- } else if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else if (hasCatch) {
- if (this.prev < entry.catchLoc) {
- return handle(entry.catchLoc, true);
- }
- } else if (hasFinally) {
- if (this.prev < entry.finallyLoc) {
- return handle(entry.finallyLoc);
- }
- } else {
- throw new Error("try statement without catch or finally");
- }
- }
- }
- },
- abrupt: function abrupt(type, arg) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
- var finallyEntry = entry;
- break;
- }
- }
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
- finallyEntry = null;
- }
- var record = finallyEntry ? finallyEntry.completion : {};
- record.type = type;
- record.arg = arg;
- if (finallyEntry) {
- this.method = "next";
- this.next = finallyEntry.finallyLoc;
- return ContinueSentinel;
- }
- return this.complete(record);
- },
- complete: function complete(record, afterLoc) {
- if (record.type === "throw") {
- throw record.arg;
- }
- if (record.type === "break" || record.type === "continue") {
- this.next = record.arg;
- } else if (record.type === "return") {
- this.rval = this.arg = record.arg;
- this.method = "return";
- this.next = "end";
- } else if (record.type === "normal" && afterLoc) {
- this.next = afterLoc;
- }
- return ContinueSentinel;
- },
- finish: function finish(finallyLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.finallyLoc === finallyLoc) {
- this.complete(entry.completion, entry.afterLoc);
- resetTryEntry(entry);
- return ContinueSentinel;
- }
- }
- },
- "catch": function _catch(tryLoc) {
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
- var entry = this.tryEntries[i];
- if (entry.tryLoc === tryLoc) {
- var record = entry.completion;
- if (record.type === "throw") {
- var thrown = record.arg;
- resetTryEntry(entry);
- }
- return thrown;
- }
- }
- throw new Error("illegal catch attempt");
- },
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
- this.delegate = {
- iterator: values(iterable),
- resultName: resultName,
- nextLoc: nextLoc
- };
- if (this.method === "next") {
- this.arg = undefined$1;
- }
- return ContinueSentinel;
- }
- };
- return exports;
- }( module.exports );
- try {
- regeneratorRuntime = runtime;
- } catch (accidentalStrictMode) {
- Function("r", "regeneratorRuntime = r")(runtime);
- }
- });
- var regenerator = runtime_1;
- var _marked = regenerator.mark(findConfigUpwards),
- _marked2 = regenerator.mark(findPackageData),
- _marked3 = regenerator.mark(findRelativeConfig),
- _marked4 = regenerator.mark(findRootConfig),
- _marked5 = regenerator.mark(loadConfig);
- function findConfigUpwards(rootDir) {
- return regenerator.wrap(function findConfigUpwards$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.abrupt("return", null);
- case 1:
- case "end":
- return _context.stop();
- }
- }
- }, _marked);
- }
- function findPackageData(filepath) {
- return regenerator.wrap(function findPackageData$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- return _context2.abrupt("return", {
- filepath: filepath,
- directories: [],
- pkg: null,
- isPackage: false
- });
- case 1:
- case "end":
- return _context2.stop();
- }
- }
- }, _marked2);
- }
- function findRelativeConfig(pkgData, envName, caller) {
- return regenerator.wrap(function findRelativeConfig$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- return _context3.abrupt("return", {
- pkg: null,
- config: null,
- ignore: null
- });
- case 1:
- case "end":
- return _context3.stop();
- }
- }
- }, _marked3);
- }
- function findRootConfig(dirname, envName, caller) {
- return regenerator.wrap(function findRootConfig$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- return _context4.abrupt("return", null);
- case 1:
- case "end":
- return _context4.stop();
- }
- }
- }, _marked4);
- }
- function loadConfig(name, dirname, envName, caller) {
- return regenerator.wrap(function loadConfig$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- throw new Error("Cannot load " + name + " relative to " + dirname + " in a browser");
- case 1:
- case "end":
- return _context5.stop();
- }
- }
- }, _marked5);
- }
- var ROOT_CONFIG_FILENAMES = [];
- function resolvePlugin(name, dirname) {
- return null;
- }
- function resolvePreset(name, dirname) {
- return null;
- }
- function loadPlugin(name, dirname) {
- throw new Error("Cannot load plugin " + name + " relative to " + dirname + " in a browser");
- }
- function loadPreset(name, dirname) {
- throw new Error("Cannot load preset " + name + " relative to " + dirname + " in a browser");
- }
- var version$1 = "7.8.3";
- function getEnv(defaultValue) {
- if (defaultValue === void 0) {
- defaultValue = "development";
- }
- return process.env.BABEL_ENV || undefined || defaultValue;
- }
- function normalizeArray(parts, allowAboveRoot) {
- var up = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var last = parts[i];
- if (last === '.') {
- parts.splice(i, 1);
- } else if (last === '..') {
- parts.splice(i, 1);
- up++;
- } else if (up) {
- parts.splice(i, 1);
- up--;
- }
- }
- if (allowAboveRoot) {
- for (; up--; up) {
- parts.unshift('..');
- }
- }
- return parts;
- }
- var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
- var splitPath = function splitPath(filename) {
- return splitPathRe.exec(filename).slice(1);
- };
- function resolve$1() {
- var resolvedPath = '',
- resolvedAbsolute = false;
- for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
- var path = i >= 0 ? arguments[i] : '/';
- if (typeof path !== 'string') {
- throw new TypeError('Arguments to path.resolve must be strings');
- } else if (!path) {
- continue;
- }
- resolvedPath = path + '/' + resolvedPath;
- resolvedAbsolute = path.charAt(0) === '/';
- }
- resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) {
- return !!p;
- }), !resolvedAbsolute).join('/');
- return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
- }
- function normalize(path) {
- var isPathAbsolute = isAbsolute(path),
- trailingSlash = substr(path, -1) === '/';
- path = normalizeArray(filter(path.split('/'), function (p) {
- return !!p;
- }), !isPathAbsolute).join('/');
- if (!path && !isPathAbsolute) {
- path = '.';
- }
- if (path && trailingSlash) {
- path += '/';
- }
- return (isPathAbsolute ? '/' : '') + path;
- }
- function isAbsolute(path) {
- return path.charAt(0) === '/';
- }
- function join() {
- var paths = Array.prototype.slice.call(arguments, 0);
- return normalize(filter(paths, function (p, index) {
- if (typeof p !== 'string') {
- throw new TypeError('Arguments to path.join must be strings');
- }
- return p;
- }).join('/'));
- }
- function relative(from, to) {
- from = resolve$1(from).substr(1);
- to = resolve$1(to).substr(1);
- function trim(arr) {
- var start = 0;
- for (; start < arr.length; start++) {
- if (arr[start] !== '') break;
- }
- var end = arr.length - 1;
- for (; end >= 0; end--) {
- if (arr[end] !== '') break;
- }
- if (start > end) return [];
- return arr.slice(start, end - start + 1);
- }
- var fromParts = trim(from.split('/'));
- var toParts = trim(to.split('/'));
- var length = Math.min(fromParts.length, toParts.length);
- var samePartsLength = length;
- for (var i = 0; i < length; i++) {
- if (fromParts[i] !== toParts[i]) {
- samePartsLength = i;
- break;
- }
- }
- var outputParts = [];
- for (var i = samePartsLength; i < fromParts.length; i++) {
- outputParts.push('..');
- }
- outputParts = outputParts.concat(toParts.slice(samePartsLength));
- return outputParts.join('/');
- }
- var sep = '/';
- var delimiter = ':';
- function dirname(path) {
- var result = splitPath(path),
- root = result[0],
- dir = result[1];
- if (!root && !dir) {
- return '.';
- }
- if (dir) {
- dir = dir.substr(0, dir.length - 1);
- }
- return root + dir;
- }
- function basename(path, ext) {
- var f = splitPath(path)[2];
- if (ext && f.substr(-1 * ext.length) === ext) {
- f = f.substr(0, f.length - ext.length);
- }
- return f;
- }
- function extname(path) {
- return splitPath(path)[3];
- }
- var path$1 = {
- extname: extname,
- basename: basename,
- dirname: dirname,
- sep: sep,
- delimiter: delimiter,
- relative: relative,
- join: join,
- isAbsolute: isAbsolute,
- normalize: normalize,
- resolve: resolve$1
- };
- function filter(xs, f) {
- if (xs.filter) return xs.filter(f);
- var res = [];
- for (var i = 0; i < xs.length; i++) {
- if (f(xs[i], i, xs)) res.push(xs[i]);
- }
- return res;
- }
- var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) {
- return str.substr(start, len);
- } : function (str, start, len) {
- if (start < 0) start = str.length + start;
- return str.substr(start, len);
- };
- var GENSYNC_START = Symbol["for"]("gensync:v1:start");
- var GENSYNC_SUSPEND = Symbol["for"]("gensync:v1:suspend");
- var GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START";
- var GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND";
- var GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR";
- var GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY";
- var GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK";
- var gensync = Object.assign(function gensync(optsOrFn) {
- var genFn = optsOrFn;
- if (typeof optsOrFn !== "function") {
- genFn = newGenerator(optsOrFn);
- } else {
- genFn = wrapGenerator(optsOrFn);
- }
- return Object.assign(genFn, makeFunctionAPI(genFn));
- }, {
- all: buildOperation({
- name: "all",
- arity: 1,
- sync: function sync(args) {
- var items = Array.from(args[0]);
- return items.map(function (item) {
- return evaluateSync(item);
- });
- },
- async: function async(args, resolve, reject) {
- var items = Array.from(args[0]);
- var count = 0;
- var results = items.map(function () {
- return undefined;
- });
- items.forEach(function (item, i) {
- evaluateAsync(item, function (val) {
- results[i] = val;
- count += 1;
- if (count === results.length) resolve(results);
- }, reject);
- });
- }
- }),
- race: buildOperation({
- name: "race",
- arity: 1,
- sync: function sync(args) {
- var items = Array.from(args[0]);
- if (items.length === 0) {
- throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
- }
- return evaluateSync(items[0]);
- },
- async: function async(args, resolve, reject) {
- var items = Array.from(args[0]);
- if (items.length === 0) {
- throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY);
- }
- for (var _i = 0, _items = items; _i < _items.length; _i++) {
- var item = _items[_i];
- evaluateAsync(item, resolve, reject);
- }
- }
- })
- });
- function makeFunctionAPI(genFn) {
- var fns = {
- sync: function sync() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return evaluateSync(genFn.apply(this, args));
- },
- async: function async() {
- var _this = this;
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return new Promise(function (resolve, reject) {
- evaluateAsync(genFn.apply(_this, args), resolve, reject);
- });
- },
- errback: function errback() {
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
- args[_key3] = arguments[_key3];
- }
- var cb = args.pop();
- if (typeof cb !== "function") {
- throw makeError("Asynchronous function called without callback", GENSYNC_ERRBACK_NO_CALLBACK);
- }
- var gen;
- try {
- gen = genFn.apply(this, args);
- } catch (err) {
- cb(err);
- return;
- }
- evaluateAsync(gen, function (val) {
- return cb(undefined, val);
- }, function (err) {
- return cb(err);
- });
- }
- };
- return fns;
- }
- function assertTypeof(type, name, value, allowUndefined) {
- if (typeof value === type || allowUndefined && typeof value === "undefined") {
- return;
- }
- var msg;
- if (allowUndefined) {
- msg = "Expected opts." + name + " to be either a " + type + ", or undefined.";
- } else {
- msg = "Expected opts." + name + " to be a " + type + ".";
- }
- throw makeError(msg, GENSYNC_OPTIONS_ERROR);
- }
- function makeError(msg, code) {
- return Object.assign(new Error(msg), {
- code: code
- });
- }
- function newGenerator(_ref) {
- var name = _ref.name,
- arity = _ref.arity,
- _sync = _ref.sync,
- _async = _ref.async,
- errback = _ref.errback;
- assertTypeof("string", "name", name, true);
- assertTypeof("number", "arity", arity, true);
- assertTypeof("function", "sync", _sync);
- assertTypeof("function", "async", _async, true);
- assertTypeof("function", "errback", errback, true);
- if (_async && errback) {
- throw makeError("Expected one of either opts.async or opts.errback, but got _both_.", GENSYNC_OPTIONS_ERROR);
- }
- if (typeof name !== "string") {
- var fnName;
- if (errback && errback.name && errback.name !== "errback") {
- fnName = errback.name;
- }
- if (_async && _async.name && _async.name !== "async") {
- fnName = _async.name.replace(/Async$/, "");
- }
- if (_sync && _sync.name && _sync.name !== "sync") {
- fnName = _sync.name.replace(/Sync$/, "");
- }
- if (typeof fnName === "string") {
- name = fnName;
- }
- }
- if (typeof arity !== "number") {
- arity = _sync.length;
- }
- return buildOperation({
- name: name,
- arity: arity,
- sync: function sync(args) {
- return _sync.apply(this, args);
- },
- async: function async(args, resolve, reject) {
- if (_async) {
- _async.apply(this, args).then(resolve, reject);
- } else if (errback) {
- errback.call.apply(errback, [this].concat(args, [function (err, value) {
- if (err == null) resolve(value);else reject(err);
- }]));
- } else {
- resolve(_sync.apply(this, args));
- }
- }
- });
- }
- function wrapGenerator(genFn) {
- return setFunctionMetadata(genFn.name, genFn.length, function () {
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
- args[_key4] = arguments[_key4];
- }
- return genFn.apply(this, args);
- });
- }
- function buildOperation(_ref2) {
- var name = _ref2.name,
- arity = _ref2.arity,
- sync = _ref2.sync,
- async = _ref2.async;
- return setFunctionMetadata(name, arity, regenerator.mark(function _callee() {
- var resume,
- _len5,
- args,
- _key5,
- result,
- _args = arguments;
- return regenerator.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _context.next = 2;
- return GENSYNC_START;
- case 2:
- resume = _context.sent;
- for (_len5 = _args.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
- args[_key5] = _args[_key5];
- }
- if (resume) {
- _context.next = 6;
- break;
- }
- return _context.abrupt("return", sync.call(this, args));
- case 6:
- try {
- async.call(this, args, function (value) {
- if (result) return;
- result = {
- value: value
- };
- resume();
- }, function (err) {
- if (result) return;
- result = {
- err: err
- };
- resume();
- });
- } catch (err) {
- result = {
- err: err
- };
- resume();
- }
- _context.next = 9;
- return GENSYNC_SUSPEND;
- case 9:
- if (!result.hasOwnProperty("err")) {
- _context.next = 11;
- break;
- }
- throw result.err;
- case 11:
- return _context.abrupt("return", result.value);
- case 12:
- case "end":
- return _context.stop();
- }
- }
- }, _callee, this);
- }));
- }
- function evaluateSync(gen) {
- var value;
- while (!(_gen$next = gen.next(), value = _gen$next.value, _gen$next).done) {
- var _gen$next;
- assertStart(value, gen);
- }
- return value;
- }
- function evaluateAsync(gen, resolve, reject) {
- (function step() {
- try {
- var value;
- var _loop = function _loop() {
- assertStart(value, gen);
- var sync = true;
- var didSyncResume = false;
- var out = gen.next(function () {
- if (sync) {
- didSyncResume = true;
- } else {
- step();
- }
- });
- sync = false;
- assertSuspend(out, gen);
- if (!didSyncResume) {
- return {
- v: void 0
- };
- }
- };
- while (!(_gen$next2 = gen.next(), value = _gen$next2.value, _gen$next2).done) {
- var _gen$next2;
- var _ret = _loop();
- if (typeof _ret === "object") return _ret.v;
- }
- return resolve(value);
- } catch (err) {
- return reject(err);
- }
- })();
- }
- function assertStart(value, gen) {
- if (value === GENSYNC_START) return;
- throwError(gen, makeError("Got unexpected yielded value in gensync generator: " + JSON.stringify(value) + ". Did you perhaps mean to use 'yield*' instead of 'yield'?", GENSYNC_EXPECTED_START));
- }
- function assertSuspend(_ref3, gen) {
- var value = _ref3.value,
- done = _ref3.done;
- if (!done && value === GENSYNC_SUSPEND) return;
- throwError(gen, makeError(done ? "Unexpected generator completion. If you get this, it is probably a gensync bug." : "Expected GENSYNC_SUSPEND, got " + JSON.stringify(value) + ". If you get this, it is probably a gensync bug.", GENSYNC_EXPECTED_SUSPEND));
- }
- function throwError(gen, err) {
- if (gen["throw"]) gen["throw"](err);
- throw err;
- }
- function setFunctionMetadata(name, arity, fn) {
- if (typeof name === "string") {
- var nameDesc = Object.getOwnPropertyDescriptor(fn, "name");
- if (!nameDesc || nameDesc.configurable) {
- Object.defineProperty(fn, "name", Object.assign(nameDesc || {}, {
- configurable: true,
- value: name
- }));
- }
- }
- if (typeof arity === "number") {
- var lengthDesc = Object.getOwnPropertyDescriptor(fn, "length");
- if (!lengthDesc || lengthDesc.configurable) {
- Object.defineProperty(fn, "length", Object.assign(lengthDesc || {}, {
- configurable: true,
- value: arity
- }));
- }
- }
- return fn;
- }
- var id = function id(x) {
- return x;
- };
- var runGenerator = gensync(regenerator.mark(function _callee(item) {
- return regenerator.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(item, "t0", 1);
- case 1:
- return _context.abrupt("return", _context.t0);
- case 2:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- var isAsync = gensync({
- sync: function sync() {
- return false;
- },
- errback: function errback(cb) {
- return cb(null, true);
- }
- });
- function maybeAsync(fn, message) {
- return gensync({
- sync: function sync() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var result = fn.apply(this, args);
- if (isThenable(result)) throw new Error(message);
- return result;
- },
- async: function async() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
- return Promise.resolve(fn.apply(this, args));
- }
- });
- }
- var withKind = gensync({
- sync: function sync(cb) {
- return cb("sync");
- },
- async: function async(cb) {
- return cb("async");
- }
- });
- function forwardAsync(action, cb) {
- var g = gensync(action);
- return withKind(function (kind) {
- var adapted = g[kind];
- return cb(adapted);
- });
- }
- var onFirstPause = gensync({
- name: "onFirstPause",
- arity: 2,
- sync: function sync(item) {
- return runGenerator.sync(item);
- },
- errback: function errback(item, firstPause, cb) {
- var completed = false;
- runGenerator.errback(item, function (err, value) {
- completed = true;
- cb(err, value);
- });
- if (!completed) {
- firstPause();
- }
- }
- });
- var waitFor = gensync({
- sync: id,
- async: id
- });
- function isThenable(val) {
- return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
- }
- function mergeOptions(target, source) {
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
- var k = _Object$keys[_i];
- if (k === "parserOpts" && source.parserOpts) {
- var parserOpts = source.parserOpts;
- var targetObj = target.parserOpts = target.parserOpts || {};
- mergeDefaultFields(targetObj, parserOpts);
- } else if (k === "generatorOpts" && source.generatorOpts) {
- var generatorOpts = source.generatorOpts;
- var _targetObj = target.generatorOpts = target.generatorOpts || {};
- mergeDefaultFields(_targetObj, generatorOpts);
- } else {
- var val = source[k];
- if (val !== undefined) target[k] = val;
- }
- }
- }
- function mergeDefaultFields(target, source) {
- for (var _i2 = 0, _Object$keys2 = Object.keys(source); _i2 < _Object$keys2.length; _i2++) {
- var k = _Object$keys2[_i2];
- var val = source[k];
- if (val !== undefined) target[k] = val;
- }
- }
- function isIterableIterator(value) {
- return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function";
- }
- var _marked$1 = regenerator.mark(genTrue),
- _marked2$1 = regenerator.mark(getCachedValue),
- _marked3$1 = regenerator.mark(getCachedValueOrWait);
- var synchronize = function synchronize(gen) {
- return gensync(gen).sync;
- };
- function genTrue(data) {
- return regenerator.wrap(function genTrue$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.abrupt("return", true);
- case 1:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$1);
- }
- function makeWeakCache(handler) {
- return makeCachedFunction(WeakMap, handler);
- }
- function makeWeakCacheSync(handler) {
- return synchronize(makeWeakCache(handler));
- }
- function makeStrongCache(handler) {
- return makeCachedFunction(Map, handler);
- }
- function makeStrongCacheSync(handler) {
- return synchronize(makeStrongCache(handler));
- }
- function makeCachedFunction(CallCache, handler) {
- var callCacheSync = new CallCache();
- var callCacheAsync = new CallCache();
- var futureCache = new CallCache();
- return regenerator.mark(function cachedFunction(arg, data) {
- var asyncContext, callCache, cached, cache, handlerResult, finishLock, value, gen;
- return regenerator.wrap(function cachedFunction$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- return _context2.delegateYield(isAsync(), "t0", 1);
- case 1:
- asyncContext = _context2.t0;
- callCache = asyncContext ? callCacheAsync : callCacheSync;
- return _context2.delegateYield(getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data), "t1", 4);
- case 4:
- cached = _context2.t1;
- if (!cached.valid) {
- _context2.next = 7;
- break;
- }
- return _context2.abrupt("return", cached.value);
- case 7:
- cache = new CacheConfigurator(data);
- handlerResult = handler(arg, cache);
- if (!isIterableIterator(handlerResult)) {
- _context2.next = 15;
- break;
- }
- gen = handlerResult;
- return _context2.delegateYield(onFirstPause(gen, function () {
- finishLock = setupAsyncLocks(cache, futureCache, arg);
- }), "t2", 12);
- case 12:
- value = _context2.t2;
- _context2.next = 16;
- break;
- case 15:
- value = handlerResult;
- case 16:
- updateFunctionCache(callCache, cache, arg, value);
- if (finishLock) {
- futureCache["delete"](arg);
- finishLock.release(value);
- }
- return _context2.abrupt("return", value);
- case 19:
- case "end":
- return _context2.stop();
- }
- }
- }, cachedFunction);
- });
- }
- function getCachedValue(cache, arg, data) {
- var cachedValue, _iterator, _isArray, _i, _ref, _ref2, _value, valid;
- return regenerator.wrap(function getCachedValue$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- cachedValue = cache.get(arg);
- if (!cachedValue) {
- _context3.next = 19;
- break;
- }
- _iterator = cachedValue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
- case 3:
- if (!_isArray) {
- _context3.next = 9;
- break;
- }
- if (!(_i >= _iterator.length)) {
- _context3.next = 6;
- break;
- }
- return _context3.abrupt("break", 19);
- case 6:
- _ref = _iterator[_i++];
- _context3.next = 13;
- break;
- case 9:
- _i = _iterator.next();
- if (!_i.done) {
- _context3.next = 12;
- break;
- }
- return _context3.abrupt("break", 19);
- case 12:
- _ref = _i.value;
- case 13:
- _ref2 = _ref, _value = _ref2.value, valid = _ref2.valid;
- return _context3.delegateYield(valid(data), "t0", 15);
- case 15:
- if (!_context3.t0) {
- _context3.next = 17;
- break;
- }
- return _context3.abrupt("return", {
- valid: true,
- value: _value
- });
- case 17:
- _context3.next = 3;
- break;
- case 19:
- return _context3.abrupt("return", {
- valid: false,
- value: null
- });
- case 20:
- case "end":
- return _context3.stop();
- }
- }
- }, _marked2$1);
- }
- function getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) {
- var cached, _cached, _value2;
- return regenerator.wrap(function getCachedValueOrWait$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- return _context4.delegateYield(getCachedValue(callCache, arg, data), "t0", 1);
- case 1:
- cached = _context4.t0;
- if (!cached.valid) {
- _context4.next = 4;
- break;
- }
- return _context4.abrupt("return", cached);
- case 4:
- if (!asyncContext) {
- _context4.next = 11;
- break;
- }
- return _context4.delegateYield(getCachedValue(futureCache, arg, data), "t1", 6);
- case 6:
- _cached = _context4.t1;
- if (!_cached.valid) {
- _context4.next = 11;
- break;
- }
- return _context4.delegateYield(waitFor(_cached.value.promise), "t2", 9);
- case 9:
- _value2 = _context4.t2;
- return _context4.abrupt("return", {
- valid: true,
- value: _value2
- });
- case 11:
- return _context4.abrupt("return", {
- valid: false,
- value: null
- });
- case 12:
- case "end":
- return _context4.stop();
- }
- }
- }, _marked3$1);
- }
- function setupAsyncLocks(config, futureCache, arg) {
- var finishLock = new Lock();
- updateFunctionCache(futureCache, config, arg, finishLock);
- return finishLock;
- }
- function updateFunctionCache(cache, config, arg, value) {
- if (!config.configured()) config.forever();
- var cachedValue = cache.get(arg);
- config.deactivate();
- switch (config.mode()) {
- case "forever":
- cachedValue = [{
- value: value,
- valid: genTrue
- }];
- cache.set(arg, cachedValue);
- break;
- case "invalidate":
- cachedValue = [{
- value: value,
- valid: config.validator()
- }];
- cache.set(arg, cachedValue);
- break;
- case "valid":
- if (cachedValue) {
- cachedValue.push({
- value: value,
- valid: config.validator()
- });
- } else {
- cachedValue = [{
- value: value,
- valid: config.validator()
- }];
- cache.set(arg, cachedValue);
- }
- }
- }
- var CacheConfigurator = function () {
- function CacheConfigurator(data) {
- this._active = true;
- this._never = false;
- this._forever = false;
- this._invalidate = false;
- this._configured = false;
- this._pairs = [];
- this._data = data;
- }
- var _proto = CacheConfigurator.prototype;
- _proto.simple = function simple() {
- return makeSimpleConfigurator(this);
- };
- _proto.mode = function mode() {
- if (this._never) return "never";
- if (this._forever) return "forever";
- if (this._invalidate) return "invalidate";
- return "valid";
- };
- _proto.forever = function forever() {
- if (!this._active) {
- throw new Error("Cannot change caching after evaluation has completed.");
- }
- if (this._never) {
- throw new Error("Caching has already been configured with .never()");
- }
- this._forever = true;
- this._configured = true;
- };
- _proto.never = function never() {
- if (!this._active) {
- throw new Error("Cannot change caching after evaluation has completed.");
- }
- if (this._forever) {
- throw new Error("Caching has already been configured with .forever()");
- }
- this._never = true;
- this._configured = true;
- };
- _proto.using = function using(handler) {
- var _this = this;
- if (!this._active) {
- throw new Error("Cannot change caching after evaluation has completed.");
- }
- if (this._never || this._forever) {
- throw new Error("Caching has already been configured with .never or .forever()");
- }
- this._configured = true;
- var key = handler(this._data);
- var fn = maybeAsync(handler, "You appear to be using an async cache handler, but Babel has been called synchronously");
- if (isThenable(key)) {
- return key.then(function (key) {
- _this._pairs.push([key, fn]);
- return key;
- });
- }
- this._pairs.push([key, fn]);
- return key;
- };
- _proto.invalidate = function invalidate(handler) {
- this._invalidate = true;
- return this.using(handler);
- };
- _proto.validator = function validator() {
- var pairs = this._pairs;
- return regenerator.mark(function _callee(data) {
- var _iterator2, _isArray2, _i2, _ref3, _ref4, key, fn;
- return regenerator.wrap(function _callee$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- _iterator2 = pairs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();
- case 1:
- if (!_isArray2) {
- _context5.next = 7;
- break;
- }
- if (!(_i2 >= _iterator2.length)) {
- _context5.next = 4;
- break;
- }
- return _context5.abrupt("break", 19);
- case 4:
- _ref3 = _iterator2[_i2++];
- _context5.next = 11;
- break;
- case 7:
- _i2 = _iterator2.next();
- if (!_i2.done) {
- _context5.next = 10;
- break;
- }
- return _context5.abrupt("break", 19);
- case 10:
- _ref3 = _i2.value;
- case 11:
- _ref4 = _ref3, key = _ref4[0], fn = _ref4[1];
- _context5.t0 = key;
- return _context5.delegateYield(fn(data), "t1", 14);
- case 14:
- _context5.t2 = _context5.t1;
- if (!(_context5.t0 !== _context5.t2)) {
- _context5.next = 17;
- break;
- }
- return _context5.abrupt("return", false);
- case 17:
- _context5.next = 1;
- break;
- case 19:
- return _context5.abrupt("return", true);
- case 20:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee);
- });
- };
- _proto.deactivate = function deactivate() {
- this._active = false;
- };
- _proto.configured = function configured() {
- return this._configured;
- };
- return CacheConfigurator;
- }();
- function makeSimpleConfigurator(cache) {
- function cacheFn(val) {
- if (typeof val === "boolean") {
- if (val) cache.forever();else cache.never();
- return;
- }
- return cache.using(function () {
- return assertSimpleType(val());
- });
- }
- cacheFn.forever = function () {
- return cache.forever();
- };
- cacheFn.never = function () {
- return cache.never();
- };
- cacheFn.using = function (cb) {
- return cache.using(function () {
- return assertSimpleType(cb());
- });
- };
- cacheFn.invalidate = function (cb) {
- return cache.invalidate(function () {
- return assertSimpleType(cb());
- });
- };
- return cacheFn;
- }
- function assertSimpleType(value) {
- if (isThenable(value)) {
- throw new Error("You appear to be using an async cache handler, " + "which your current version of Babel does not support. " + "We may add support for this in the future, " + "but if you're on the most recent version of @babel/core and still " + "seeing this error, then you'll need to synchronously handle your caching logic.");
- }
- if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
- throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
- }
- return value;
- }
- var Lock = function () {
- function Lock() {
- var _this2 = this;
- this.released = false;
- this.promise = new Promise(function (resolve) {
- _this2._resolve = resolve;
- });
- }
- var _proto2 = Lock.prototype;
- _proto2.release = function release(value) {
- this.released = true;
- this._resolve(value);
- };
- return Lock;
- }();
- function isEqualDescriptor(a, b) {
- return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved);
- }
- function createCachedDescriptors(dirname, options, alias) {
- var plugins = options.plugins,
- presets = options.presets,
- passPerPreset = options.passPerPreset;
- return {
- options: options,
- plugins: plugins ? function () {
- return createCachedPluginDescriptors(plugins, dirname)(alias);
- } : function () {
- return [];
- },
- presets: presets ? function () {
- return createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset);
- } : function () {
- return [];
- }
- };
- }
- function createUncachedDescriptors(dirname, options, alias) {
- var _plugins;
- var _presets;
- return {
- options: options,
- plugins: function plugins() {
- if (!_plugins) {
- _plugins = createPluginDescriptors(options.plugins || [], dirname, alias);
- }
- return _plugins;
- },
- presets: function presets() {
- if (!_presets) {
- _presets = createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset);
- }
- return _presets;
- }
- };
- }
- var PRESET_DESCRIPTOR_CACHE = new WeakMap();
- var createCachedPresetDescriptors = makeWeakCacheSync(function (items, cache) {
- var dirname = cache.using(function (dir) {
- return dir;
- });
- return makeStrongCacheSync(function (alias) {
- return makeStrongCacheSync(function (passPerPreset) {
- return createPresetDescriptors(items, dirname, alias, passPerPreset).map(function (desc) {
- return loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc);
- });
- });
- });
- });
- var PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
- var createCachedPluginDescriptors = makeWeakCacheSync(function (items, cache) {
- var dirname = cache.using(function (dir) {
- return dir;
- });
- return makeStrongCacheSync(function (alias) {
- return createPluginDescriptors(items, dirname, alias).map(function (desc) {
- return loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc);
- });
- });
- });
- var DEFAULT_OPTIONS = {};
- function loadCachedDescriptor(cache, desc) {
- var value = desc.value,
- _desc$options = desc.options,
- options = _desc$options === void 0 ? DEFAULT_OPTIONS : _desc$options;
- if (options === false) return desc;
- var cacheByOptions = cache.get(value);
- if (!cacheByOptions) {
- cacheByOptions = new WeakMap();
- cache.set(value, cacheByOptions);
- }
- var possibilities = cacheByOptions.get(options);
- if (!possibilities) {
- possibilities = [];
- cacheByOptions.set(options, possibilities);
- }
- if (possibilities.indexOf(desc) === -1) {
- var matches = possibilities.filter(function (possibility) {
- return isEqualDescriptor(possibility, desc);
- });
- if (matches.length > 0) {
- return matches[0];
- }
- possibilities.push(desc);
- }
- return desc;
- }
- function createPresetDescriptors(items, dirname, alias, passPerPreset) {
- return createDescriptors("preset", items, dirname, alias, passPerPreset);
- }
- function createPluginDescriptors(items, dirname, alias) {
- return createDescriptors("plugin", items, dirname, alias);
- }
- function createDescriptors(type, items, dirname, alias, ownPass) {
- var descriptors = items.map(function (item, index) {
- return createDescriptor(item, dirname, {
- type: type,
- alias: alias + "$" + index,
- ownPass: !!ownPass
- });
- });
- assertNoDuplicates(descriptors);
- return descriptors;
- }
- function createDescriptor(pair, dirname, _ref) {
- var type = _ref.type,
- alias = _ref.alias,
- ownPass = _ref.ownPass;
- var desc = getItemDescriptor(pair);
- if (desc) {
- return desc;
- }
- var name;
- var options;
- var value = pair;
- if (Array.isArray(value)) {
- if (value.length === 3) {
- var _value = value;
- value = _value[0];
- options = _value[1];
- name = _value[2];
- } else {
- var _value2 = value;
- value = _value2[0];
- options = _value2[1];
- }
- }
- var file = undefined;
- var filepath = null;
- if (typeof value === "string") {
- if (typeof type !== "string") {
- throw new Error("To resolve a string-based item, the type of item must be given");
- }
- var resolver = type === "plugin" ? loadPlugin : loadPreset;
- var request = value;
- var _resolver = resolver(value, dirname);
- filepath = _resolver.filepath;
- value = _resolver.value;
- file = {
- request: request,
- resolved: filepath
- };
- }
- if (!value) {
- throw new Error("Unexpected falsy value: " + String(value));
- }
- if (typeof value === "object" && value.__esModule) {
- if (value["default"]) {
- value = value["default"];
- } else {
- throw new Error("Must export a default export when using ES6 modules.");
- }
- }
- if (typeof value !== "object" && typeof value !== "function") {
- throw new Error("Unsupported format: " + typeof value + ". Expected an object or a function.");
- }
- if (filepath !== null && typeof value === "object" && value) {
- throw new Error("Plugin/Preset files are not allowed to export objects, only functions. In " + filepath);
- }
- return {
- name: name,
- alias: filepath || alias,
- value: value,
- options: options,
- dirname: dirname,
- ownPass: ownPass,
- file: file
- };
- }
- function assertNoDuplicates(items) {
- var map = new Map();
- var _loop2 = function _loop2() {
- if (_isArray) {
- if (_i >= _iterator.length) return "break";
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) return "break";
- _ref2 = _i.value;
- }
- var item = _ref2;
- if (typeof item.value !== "function") return "continue";
- var nameMap = map.get(item.value);
- if (!nameMap) {
- nameMap = new Set();
- map.set(item.value, nameMap);
- }
- if (nameMap.has(item.name)) {
- var conflicts = items.filter(function (i) {
- return i.value === item.value;
- });
- throw new Error(["Duplicate plugin/preset detected.", "If you'd like to use two separate instances of a plugin,", "they need separate names, e.g.", "", " plugins: [", " ['some-plugin', {}],", " ['some-plugin', {}, 'some unique name'],", " ]", "", "Duplicates detected are:", "" + JSON.stringify(conflicts, null, 2)].join("\n"));
- }
- nameMap.add(item.name);
- };
- _loop: for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- var _ret = _loop2();
- switch (_ret) {
- case "break":
- break _loop;
- case "continue":
- continue;
- }
- }
- }
- function createItemFromDescriptor(desc) {
- return new ConfigItem(desc);
- }
- function createConfigItem(value, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$dirname = _ref.dirname,
- dirname = _ref$dirname === void 0 ? "." : _ref$dirname,
- type = _ref.type;
- var descriptor = createDescriptor(value, path$1.resolve(dirname), {
- type: type,
- alias: "programmatic item"
- });
- return createItemFromDescriptor(descriptor);
- }
- function getItemDescriptor(item) {
- if (item instanceof ConfigItem) {
- return item._descriptor;
- }
- return undefined;
- }
- var ConfigItem = function ConfigItem(descriptor) {
- this._descriptor = descriptor;
- Object.defineProperty(this, "_descriptor", {
- enumerable: false
- });
- this.value = this._descriptor.value;
- this.options = this._descriptor.options;
- this.dirname = this._descriptor.dirname;
- this.name = this._descriptor.name;
- this.file = this._descriptor.file ? {
- request: this._descriptor.file.request,
- resolved: this._descriptor.file.resolved
- } : undefined;
- Object.freeze(this);
- };
- Object.freeze(ConfigItem.prototype);
- var Plugin = function Plugin(plugin, options, key) {
- this.key = plugin.name || key;
- this.manipulateOptions = plugin.manipulateOptions;
- this.post = plugin.post;
- this.pre = plugin.pre;
- this.visitor = plugin.visitor || {};
- this.parserOverride = plugin.parserOverride;
- this.generatorOverride = plugin.generatorOverride;
- this.options = options;
- };
- var s$1 = 1000;
- var m$1 = s$1 * 60;
- var h$1 = m$1 * 60;
- var d$1 = h$1 * 24;
- var w$1 = d$1 * 7;
- var y$1 = d$1 * 365.25;
- var ms$1 = function (val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse$2(val);
- } else if (type === 'number' && isFinite(val)) {
- return options["long"] ? fmtLong$1(val) : fmtShort$1(val);
- }
- throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
- };
- function parse$2(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y$1;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w$1;
- case 'days':
- case 'day':
- case 'd':
- return n * d$1;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h$1;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m$1;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s$1;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
- }
- function fmtShort$1(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d$1) {
- return Math.round(ms / d$1) + 'd';
- }
- if (msAbs >= h$1) {
- return Math.round(ms / h$1) + 'h';
- }
- if (msAbs >= m$1) {
- return Math.round(ms / m$1) + 'm';
- }
- if (msAbs >= s$1) {
- return Math.round(ms / s$1) + 's';
- }
- return ms + 'ms';
- }
- function fmtLong$1(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d$1) {
- return plural$1(ms, msAbs, d$1, 'day');
- }
- if (msAbs >= h$1) {
- return plural$1(ms, msAbs, h$1, 'hour');
- }
- if (msAbs >= m$1) {
- return plural$1(ms, msAbs, m$1, 'minute');
- }
- if (msAbs >= s$1) {
- return plural$1(ms, msAbs, s$1, 'second');
- }
- return ms + ' ms';
- }
- function plural$1(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
- }
- function setup$2(env) {
- createDebug.debug = createDebug;
- createDebug["default"] = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = ms$1;
- Object.keys(env).forEach(function (key) {
- createDebug[key] = env[key];
- });
- createDebug.instances = [];
- createDebug.names = [];
- createDebug.skips = [];
- createDebug.formatters = {};
- function selectColor(namespace) {
- var hash = 0;
- for (var i = 0; i < namespace.length; i++) {
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
- hash |= 0;
- }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
- function createDebug(namespace) {
- var prevTime;
- function debug() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- if (!debug.enabled) {
- return;
- }
- var self = debug;
- var curr = Number(new Date());
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
- if (typeof args[0] !== 'string') {
- args.unshift('%O');
- }
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
- if (match === '%%') {
- return match;
- }
- index++;
- var formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- var val = args[index];
- match = formatter.call(self, val);
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- createDebug.formatArgs.call(self, args);
- var logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
- debug.namespace = namespace;
- debug.enabled = createDebug.enabled(namespace);
- debug.useColors = createDebug.useColors();
- debug.color = selectColor(namespace);
- debug.destroy = destroy;
- debug.extend = extend;
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
- createDebug.instances.push(debug);
- return debug;
- }
- function destroy() {
- var index = createDebug.instances.indexOf(this);
- if (index !== -1) {
- createDebug.instances.splice(index, 1);
- return true;
- }
- return false;
- }
- function extend(namespace, delimiter) {
- var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.names = [];
- createDebug.skips = [];
- var i;
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- continue;
- }
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- for (i = 0; i < createDebug.instances.length; i++) {
- var instance = createDebug.instances[i];
- instance.enabled = createDebug.enabled(instance.namespace);
- }
- }
- function disable() {
- var namespaces = [].concat(createDebug.names.map(toNamespace), createDebug.skips.map(toNamespace).map(function (namespace) {
- return '-' + namespace;
- })).join(',');
- createDebug.enable('');
- return namespaces;
- }
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
- var i;
- var len;
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
- function toNamespace(regexp) {
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
- }
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
- createDebug.enable(createDebug.load());
- return createDebug;
- }
- var common$1 = setup$2;
- var browser$4 = createCommonjsModule(function (module, exports) {
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
- function useColors() {
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- }
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
- }
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
- if (!this.useColors) {
- return;
- }
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit');
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- lastC = index;
- }
- });
- args.splice(lastC, 0, c);
- }
- function log() {
- var _console;
- return typeof console === 'object' && console.log && (_console = console).log.apply(_console, arguments);
- }
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {}
- }
- function load() {
- var r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {}
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
- return r;
- }
- function localstorage() {
- try {
- return localStorage;
- } catch (error) {}
- }
- module.exports = common$1(exports);
- var formatters = module.exports.formatters;
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- });
- var browser_1$1 = browser$4.log;
- var browser_2$1 = browser$4.formatArgs;
- var browser_3$1 = browser$4.save;
- var browser_4$1 = browser$4.load;
- var browser_5$1 = browser$4.useColors;
- var browser_6$1 = browser$4.storage;
- var browser_7$1 = browser$4.colors;
- var removed = {
- auxiliaryComment: {
- message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
- },
- blacklist: {
- message: "Put the specific transforms you want in the `plugins` option"
- },
- breakConfig: {
- message: "This is not a necessary option in Babel 6"
- },
- experimental: {
- message: "Put the specific transforms you want in the `plugins` option"
- },
- externalHelpers: {
- message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/"
- },
- extra: {
- message: ""
- },
- jsxPragma: {
- message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
- },
- loose: {
- message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option."
- },
- metadataUsedHelpers: {
- message: "Not required anymore as this is enabled by default"
- },
- modules: {
- message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules"
- },
- nonStandard: {
- message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
- },
- optional: {
- message: "Put the specific transforms you want in the `plugins` option"
- },
- sourceMapName: {
- message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves."
- },
- stage: {
- message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
- },
- whitelist: {
- message: "Put the specific transforms you want in the `plugins` option"
- },
- resolveModuleSource: {
- version: 6,
- message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options"
- },
- metadata: {
- version: 6,
- message: "Generated plugin metadata is always included in the output result"
- },
- sourceMapTarget: {
- version: 6,
- message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves."
- }
- };
- function msg(loc) {
- switch (loc.type) {
- case "root":
- return "";
- case "env":
- return msg(loc.parent) + ".env[\"" + loc.name + "\"]";
- case "overrides":
- return msg(loc.parent) + ".overrides[" + loc.index + "]";
- case "option":
- return msg(loc.parent) + "." + loc.name;
- case "access":
- return msg(loc.parent) + "[" + JSON.stringify(loc.name) + "]";
- default:
- throw new Error("Assertion failure: Unknown type " + loc.type);
- }
- }
- function access(loc, name) {
- return {
- type: "access",
- name: name,
- parent: loc
- };
- }
- function assertRootMode(loc, value) {
- if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
- throw new Error(msg(loc) + " must be a \"root\", \"upward\", \"upward-optional\" or undefined");
- }
- return value;
- }
- function assertSourceMaps(loc, value) {
- if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
- throw new Error(msg(loc) + " must be a boolean, \"inline\", \"both\", or undefined");
- }
- return value;
- }
- function assertCompact(loc, value) {
- if (value !== undefined && typeof value !== "boolean" && value !== "auto") {
- throw new Error(msg(loc) + " must be a boolean, \"auto\", or undefined");
- }
- return value;
- }
- function assertSourceType(loc, value) {
- if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") {
- throw new Error(msg(loc) + " must be \"module\", \"script\", \"unambiguous\", or undefined");
- }
- return value;
- }
- function assertCallerMetadata(loc, value) {
- var obj = assertObject(loc, value);
- if (obj) {
- if (typeof obj["name"] !== "string") {
- throw new Error(msg(loc) + " set but does not contain \"name\" property string");
- }
- for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {
- var prop = _Object$keys[_i];
- var propLoc = access(loc, prop);
- var _value = obj[prop];
- if (_value != null && typeof _value !== "boolean" && typeof _value !== "string" && typeof _value !== "number") {
- throw new Error(msg(propLoc) + " must be null, undefined, a boolean, a string, or a number.");
- }
- }
- }
- return value;
- }
- function assertInputSourceMap(loc, value) {
- if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) {
- throw new Error(msg(loc) + " must be a boolean, object, or undefined");
- }
- return value;
- }
- function assertString(loc, value) {
- if (value !== undefined && typeof value !== "string") {
- throw new Error(msg(loc) + " must be a string, or undefined");
- }
- return value;
- }
- function assertFunction$1(loc, value) {
- if (value !== undefined && typeof value !== "function") {
- throw new Error(msg(loc) + " must be a function, or undefined");
- }
- return value;
- }
- function assertBoolean(loc, value) {
- if (value !== undefined && typeof value !== "boolean") {
- throw new Error(msg(loc) + " must be a boolean, or undefined");
- }
- return value;
- }
- function assertObject(loc, value) {
- if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) {
- throw new Error(msg(loc) + " must be an object, or undefined");
- }
- return value;
- }
- function assertArray(loc, value) {
- if (value != null && !Array.isArray(value)) {
- throw new Error(msg(loc) + " must be an array, or undefined");
- }
- return value;
- }
- function assertIgnoreList(loc, value) {
- var arr = assertArray(loc, value);
- if (arr) {
- arr.forEach(function (item, i) {
- return assertIgnoreItem(access(loc, i), item);
- });
- }
- return arr;
- }
- function assertIgnoreItem(loc, value) {
- if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) {
- throw new Error(msg(loc) + " must be an array of string/Function/RegExp values, or undefined");
- }
- return value;
- }
- function assertConfigApplicableTest(loc, value) {
- if (value === undefined) return value;
- if (Array.isArray(value)) {
- value.forEach(function (item, i) {
- if (!checkValidTest(item)) {
- throw new Error(msg(access(loc, i)) + " must be a string/Function/RegExp.");
- }
- });
- } else if (!checkValidTest(value)) {
- throw new Error(msg(loc) + " must be a string/Function/RegExp, or an array of those");
- }
- return value;
- }
- function checkValidTest(value) {
- return typeof value === "string" || typeof value === "function" || value instanceof RegExp;
- }
- function assertConfigFileSearch(loc, value) {
- if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") {
- throw new Error(msg(loc) + " must be a undefined, a boolean, a string, " + ("got " + JSON.stringify(value)));
- }
- return value;
- }
- function assertBabelrcSearch(loc, value) {
- if (value === undefined || typeof value === "boolean") return value;
- if (Array.isArray(value)) {
- value.forEach(function (item, i) {
- if (!checkValidTest(item)) {
- throw new Error(msg(access(loc, i)) + " must be a string/Function/RegExp.");
- }
- });
- } else if (!checkValidTest(value)) {
- throw new Error(msg(loc) + " must be a undefined, a boolean, a string/Function/RegExp " + ("or an array of those, got " + JSON.stringify(value)));
- }
- return value;
- }
- function assertPluginList(loc, value) {
- var arr = assertArray(loc, value);
- if (arr) {
- arr.forEach(function (item, i) {
- return assertPluginItem(access(loc, i), item);
- });
- }
- return arr;
- }
- function assertPluginItem(loc, value) {
- if (Array.isArray(value)) {
- if (value.length === 0) {
- throw new Error(msg(loc) + " must include an object");
- }
- if (value.length > 3) {
- throw new Error(msg(loc) + " may only be a two-tuple or three-tuple");
- }
- assertPluginTarget(access(loc, 0), value[0]);
- if (value.length > 1) {
- var opts = value[1];
- if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) {
- throw new Error(msg(access(loc, 1)) + " must be an object, false, or undefined");
- }
- }
- if (value.length === 3) {
- var name = value[2];
- if (name !== undefined && typeof name !== "string") {
- throw new Error(msg(access(loc, 2)) + " must be a string, or undefined");
- }
- }
- } else {
- assertPluginTarget(loc, value);
- }
- return value;
- }
- function assertPluginTarget(loc, value) {
- if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") {
- throw new Error(msg(loc) + " must be a string, object, function");
- }
- return value;
- }
- var ROOT_VALIDATORS = {
- cwd: assertString,
- root: assertString,
- rootMode: assertRootMode,
- configFile: assertConfigFileSearch,
- caller: assertCallerMetadata,
- filename: assertString,
- filenameRelative: assertString,
- code: assertBoolean,
- ast: assertBoolean,
- envName: assertString
- };
- var BABELRC_VALIDATORS = {
- babelrc: assertBoolean,
- babelrcRoots: assertBabelrcSearch
- };
- var NONPRESET_VALIDATORS = {
- "extends": assertString,
- ignore: assertIgnoreList,
- only: assertIgnoreList
- };
- var COMMON_VALIDATORS = {
- inputSourceMap: assertInputSourceMap,
- presets: assertPluginList,
- plugins: assertPluginList,
- passPerPreset: assertBoolean,
- env: assertEnvSet,
- overrides: assertOverridesList,
- test: assertConfigApplicableTest,
- include: assertConfigApplicableTest,
- exclude: assertConfigApplicableTest,
- retainLines: assertBoolean,
- comments: assertBoolean,
- shouldPrintComment: assertFunction$1,
- compact: assertCompact,
- minified: assertBoolean,
- auxiliaryCommentBefore: assertString,
- auxiliaryCommentAfter: assertString,
- sourceType: assertSourceType,
- wrapPluginVisitorMethod: assertFunction$1,
- highlightCode: assertBoolean,
- sourceMaps: assertSourceMaps,
- sourceMap: assertSourceMaps,
- sourceFileName: assertString,
- sourceRoot: assertString,
- getModuleId: assertFunction$1,
- moduleRoot: assertString,
- moduleIds: assertBoolean,
- moduleId: assertString,
- parserOpts: assertObject,
- generatorOpts: assertObject
- };
- function getSource$1(loc) {
- return loc.type === "root" ? loc.source : getSource$1(loc.parent);
- }
- function validate$3(type, opts) {
- return validateNested({
- type: "root",
- source: type
- }, opts);
- }
- function validateNested(loc, opts) {
- var type = getSource$1(loc);
- assertNoDuplicateSourcemap(opts);
- Object.keys(opts).forEach(function (key) {
- var optLoc = {
- type: "option",
- name: key,
- parent: loc
- };
- if (type === "preset" && NONPRESET_VALIDATORS[key]) {
- throw new Error(msg(optLoc) + " is not allowed in preset options");
- }
- if (type !== "arguments" && ROOT_VALIDATORS[key]) {
- throw new Error(msg(optLoc) + " is only allowed in root programmatic options");
- }
- if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) {
- if (type === "babelrcfile" || type === "extendsfile") {
- throw new Error(msg(optLoc) + " is not allowed in .babelrc or \"extends\"ed files, only in root programmatic options, " + "or babel.config.js/config file options");
- }
- throw new Error(msg(optLoc) + " is only allowed in root programmatic options, or babel.config.js/config file options");
- }
- var validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError;
- validator(optLoc, opts[key]);
- });
- return opts;
- }
- function throwUnknownError(loc) {
- var key = loc.name;
- if (removed[key]) {
- var _removed$key = removed[key],
- message = _removed$key.message,
- _removed$key$version = _removed$key.version,
- version = _removed$key$version === void 0 ? 5 : _removed$key$version;
- throw new ReferenceError("Using removed Babel " + version + " option: " + msg(loc) + " - " + message);
- } else {
- var unknownOptErr = "Unknown option: " + msg(loc) + ". Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.";
- throw new ReferenceError(unknownOptErr);
- }
- }
- function has$3(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
- }
- function assertNoDuplicateSourcemap(opts) {
- if (has$3(opts, "sourceMap") && has$3(opts, "sourceMaps")) {
- throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");
- }
- }
- function assertEnvSet(loc, value) {
- if (loc.parent.type === "env") {
- throw new Error(msg(loc) + " is not allowed inside of another .env block");
- }
- var parent = loc.parent;
- var obj = assertObject(loc, value);
- if (obj) {
- for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {
- var envName = _Object$keys[_i];
- var env = assertObject(access(loc, envName), obj[envName]);
- if (!env) continue;
- var envLoc = {
- type: "env",
- name: envName,
- parent: parent
- };
- validateNested(envLoc, env);
- }
- }
- return obj;
- }
- function assertOverridesList(loc, value) {
- if (loc.parent.type === "env") {
- throw new Error(msg(loc) + " is not allowed inside an .env block");
- }
- if (loc.parent.type === "overrides") {
- throw new Error(msg(loc) + " is not allowed inside an .overrides block");
- }
- var parent = loc.parent;
- var arr = assertArray(loc, value);
- if (arr) {
- for (var _iterator = arr.entries(), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i2 >= _iterator.length) break;
- _ref = _iterator[_i2++];
- } else {
- _i2 = _iterator.next();
- if (_i2.done) break;
- _ref = _i2.value;
- }
- var _ref2 = _ref,
- index = _ref2[0],
- item = _ref2[1];
- var objLoc = access(loc, index);
- var env = assertObject(objLoc, item);
- if (!env) throw new Error(msg(objLoc) + " must be an object");
- var overridesLoc = {
- type: "overrides",
- index: index,
- parent: parent
- };
- validateNested(overridesLoc, env);
- }
- }
- return arr;
- }
- var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar$1.source);
- function escapeRegExp(string) {
- string = toString_1(string);
- return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar$1, '\\$&') : string;
- }
- var escapeRegExp_1 = escapeRegExp;
- var sep$1 = "\\" + path$1.sep;
- var endSep = "(?:" + sep$1 + "|$)";
- var substitution = "[^" + sep$1 + "]+";
- var starPat = "(?:" + substitution + sep$1 + ")";
- var starPatLast = "(?:" + substitution + endSep + ")";
- var starStarPat = starPat + "*?";
- var starStarPatLast = starPat + "*?" + starPatLast + "?";
- function pathToPattern(pattern, dirname) {
- var parts = path$1.resolve(dirname, pattern).split(path$1.sep);
- return new RegExp(["^"].concat(parts.map(function (part, i) {
- var last = i === parts.length - 1;
- if (part === "**") return last ? starStarPatLast : starStarPat;
- if (part === "*") return last ? starPatLast : starPat;
- if (part.indexOf("*.") === 0) {
- return substitution + escapeRegExp_1(part.slice(1)) + (last ? endSep : sep$1);
- }
- return escapeRegExp_1(part) + (last ? endSep : sep$1);
- })).join(""));
- }
- var _marked$2 = regenerator.mark(buildPresetChain),
- _marked2$2 = regenerator.mark(buildRootChain),
- _marked3$2 = regenerator.mark(mergeExtendsChain);
- var debug = browser$4("babel:config:config-chain");
- function buildPresetChain(arg, context) {
- var chain;
- return regenerator.wrap(function buildPresetChain$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(buildPresetChainWalker(arg, context), "t0", 1);
- case 1:
- chain = _context.t0;
- if (chain) {
- _context.next = 4;
- break;
- }
- return _context.abrupt("return", null);
- case 4:
- return _context.abrupt("return", {
- plugins: dedupDescriptors(chain.plugins),
- presets: dedupDescriptors(chain.presets),
- options: chain.options.map(function (o) {
- return normalizeOptions$1(o);
- })
- });
- case 5:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$2);
- }
- var buildPresetChainWalker = makeChainWalker({
- init: function init(arg) {
- return arg;
- },
- root: function root(preset) {
- return loadPresetDescriptors(preset);
- },
- env: function env(preset, envName) {
- return loadPresetEnvDescriptors(preset)(envName);
- },
- overrides: function overrides(preset, index) {
- return loadPresetOverridesDescriptors(preset)(index);
- },
- overridesEnv: function overridesEnv(preset, index, envName) {
- return loadPresetOverridesEnvDescriptors(preset)(index)(envName);
- }
- });
- var loadPresetDescriptors = makeWeakCacheSync(function (preset) {
- return buildRootDescriptors(preset, preset.alias, createUncachedDescriptors);
- });
- var loadPresetEnvDescriptors = makeWeakCacheSync(function (preset) {
- return makeStrongCacheSync(function (envName) {
- return buildEnvDescriptors(preset, preset.alias, createUncachedDescriptors, envName);
- });
- });
- var loadPresetOverridesDescriptors = makeWeakCacheSync(function (preset) {
- return makeStrongCacheSync(function (index) {
- return buildOverrideDescriptors(preset, preset.alias, createUncachedDescriptors, index);
- });
- });
- var loadPresetOverridesEnvDescriptors = makeWeakCacheSync(function (preset) {
- return makeStrongCacheSync(function (index) {
- return makeStrongCacheSync(function (envName) {
- return buildOverrideEnvDescriptors(preset, preset.alias, createUncachedDescriptors, index, envName);
- });
- });
- });
- function buildRootChain(opts, context) {
- var programmaticChain, configFile, babelrc, babelrcRoots, babelrcRootsDirectory, configFileChain, validatedFile, result, pkgData, ignoreFile, babelrcFile, fileChain, _ref, _result, chain;
- return regenerator.wrap(function buildRootChain$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- return _context2.delegateYield(loadProgrammaticChain({
- options: opts,
- dirname: context.cwd
- }, context), "t0", 1);
- case 1:
- programmaticChain = _context2.t0;
- if (programmaticChain) {
- _context2.next = 4;
- break;
- }
- return _context2.abrupt("return", null);
- case 4:
- if (!(typeof opts.configFile === "string")) {
- _context2.next = 9;
- break;
- }
- return _context2.delegateYield(loadConfig(opts.configFile, context.cwd, context.envName, context.caller), "t1", 6);
- case 6:
- configFile = _context2.t1;
- _context2.next = 12;
- break;
- case 9:
- if (!(opts.configFile !== false)) {
- _context2.next = 12;
- break;
- }
- return _context2.delegateYield(findRootConfig(context.root, context.envName, context.caller), "t2", 11);
- case 11:
- configFile = _context2.t2;
- case 12:
- babelrc = opts.babelrc, babelrcRoots = opts.babelrcRoots;
- babelrcRootsDirectory = context.cwd;
- configFileChain = emptyChain();
- if (!configFile) {
- _context2.next = 24;
- break;
- }
- validatedFile = validateConfigFile(configFile);
- return _context2.delegateYield(loadFileChain(validatedFile, context), "t3", 18);
- case 18:
- result = _context2.t3;
- if (result) {
- _context2.next = 21;
- break;
- }
- return _context2.abrupt("return", null);
- case 21:
- if (babelrc === undefined) {
- babelrc = validatedFile.options.babelrc;
- }
- if (babelrcRoots === undefined) {
- babelrcRootsDirectory = validatedFile.dirname;
- babelrcRoots = validatedFile.options.babelrcRoots;
- }
- mergeChain(configFileChain, result);
- case 24:
- if (!(typeof context.filename === "string")) {
- _context2.next = 29;
- break;
- }
- return _context2.delegateYield(findPackageData(context.filename), "t5", 26);
- case 26:
- _context2.t4 = _context2.t5;
- _context2.next = 30;
- break;
- case 29:
- _context2.t4 = null;
- case 30:
- pkgData = _context2.t4;
- fileChain = emptyChain();
- if (!((babelrc === true || babelrc === undefined) && pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory))) {
- _context2.next = 45;
- break;
- }
- return _context2.delegateYield(findRelativeConfig(pkgData, context.envName, context.caller), "t6", 34);
- case 34:
- _ref = _context2.t6;
- ignoreFile = _ref.ignore;
- babelrcFile = _ref.config;
- if (!(ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname))) {
- _context2.next = 39;
- break;
- }
- return _context2.abrupt("return", null);
- case 39:
- if (!babelrcFile) {
- _context2.next = 45;
- break;
- }
- return _context2.delegateYield(loadFileChain(validateBabelrcFile(babelrcFile), context), "t7", 41);
- case 41:
- _result = _context2.t7;
- if (_result) {
- _context2.next = 44;
- break;
- }
- return _context2.abrupt("return", null);
- case 44:
- mergeChain(fileChain, _result);
- case 45:
- chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
- return _context2.abrupt("return", {
- plugins: dedupDescriptors(chain.plugins),
- presets: dedupDescriptors(chain.presets),
- options: chain.options.map(function (o) {
- return normalizeOptions$1(o);
- }),
- ignore: ignoreFile || undefined,
- babelrc: babelrcFile || undefined,
- config: configFile || undefined
- });
- case 47:
- case "end":
- return _context2.stop();
- }
- }
- }, _marked2$2);
- }
- function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
- if (typeof babelrcRoots === "boolean") return babelrcRoots;
- var absoluteRoot = context.root;
- if (babelrcRoots === undefined) {
- return pkgData.directories.indexOf(absoluteRoot) !== -1;
- }
- var babelrcPatterns = babelrcRoots;
- if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];
- babelrcPatterns = babelrcPatterns.map(function (pat) {
- return typeof pat === "string" ? path$1.resolve(babelrcRootsDirectory, pat) : pat;
- });
- if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
- return pkgData.directories.indexOf(absoluteRoot) !== -1;
- }
- return babelrcPatterns.some(function (pat) {
- if (typeof pat === "string") {
- pat = pathToPattern(pat, babelrcRootsDirectory);
- }
- return pkgData.directories.some(function (directory) {
- return matchPattern(pat, babelrcRootsDirectory, directory, context);
- });
- });
- }
- var validateConfigFile = makeWeakCacheSync(function (file) {
- return {
- filepath: file.filepath,
- dirname: file.dirname,
- options: validate$3("configfile", file.options)
- };
- });
- var validateBabelrcFile = makeWeakCacheSync(function (file) {
- return {
- filepath: file.filepath,
- dirname: file.dirname,
- options: validate$3("babelrcfile", file.options)
- };
- });
- var validateExtendFile = makeWeakCacheSync(function (file) {
- return {
- filepath: file.filepath,
- dirname: file.dirname,
- options: validate$3("extendsfile", file.options)
- };
- });
- var loadProgrammaticChain = makeChainWalker({
- root: function root(input) {
- return buildRootDescriptors(input, "base", createCachedDescriptors);
- },
- env: function env(input, envName) {
- return buildEnvDescriptors(input, "base", createCachedDescriptors, envName);
- },
- overrides: function overrides(input, index) {
- return buildOverrideDescriptors(input, "base", createCachedDescriptors, index);
- },
- overridesEnv: function overridesEnv(input, index, envName) {
- return buildOverrideEnvDescriptors(input, "base", createCachedDescriptors, index, envName);
- }
- });
- var loadFileChain = makeChainWalker({
- root: function root(file) {
- return loadFileDescriptors(file);
- },
- env: function env(file, envName) {
- return loadFileEnvDescriptors(file)(envName);
- },
- overrides: function overrides(file, index) {
- return loadFileOverridesDescriptors(file)(index);
- },
- overridesEnv: function overridesEnv(file, index, envName) {
- return loadFileOverridesEnvDescriptors(file)(index)(envName);
- }
- });
- var loadFileDescriptors = makeWeakCacheSync(function (file) {
- return buildRootDescriptors(file, file.filepath, createUncachedDescriptors);
- });
- var loadFileEnvDescriptors = makeWeakCacheSync(function (file) {
- return makeStrongCacheSync(function (envName) {
- return buildEnvDescriptors(file, file.filepath, createUncachedDescriptors, envName);
- });
- });
- var loadFileOverridesDescriptors = makeWeakCacheSync(function (file) {
- return makeStrongCacheSync(function (index) {
- return buildOverrideDescriptors(file, file.filepath, createUncachedDescriptors, index);
- });
- });
- var loadFileOverridesEnvDescriptors = makeWeakCacheSync(function (file) {
- return makeStrongCacheSync(function (index) {
- return makeStrongCacheSync(function (envName) {
- return buildOverrideEnvDescriptors(file, file.filepath, createUncachedDescriptors, index, envName);
- });
- });
- });
- function buildRootDescriptors(_ref2, alias, descriptors) {
- var dirname = _ref2.dirname,
- options = _ref2.options;
- return descriptors(dirname, options, alias);
- }
- function buildEnvDescriptors(_ref3, alias, descriptors, envName) {
- var dirname = _ref3.dirname,
- options = _ref3.options;
- var opts = options.env && options.env[envName];
- return opts ? descriptors(dirname, opts, alias + ".env[\"" + envName + "\"]") : null;
- }
- function buildOverrideDescriptors(_ref4, alias, descriptors, index) {
- var dirname = _ref4.dirname,
- options = _ref4.options;
- var opts = options.overrides && options.overrides[index];
- if (!opts) throw new Error("Assertion failure - missing override");
- return descriptors(dirname, opts, alias + ".overrides[" + index + "]");
- }
- function buildOverrideEnvDescriptors(_ref5, alias, descriptors, index, envName) {
- var dirname = _ref5.dirname,
- options = _ref5.options;
- var override = options.overrides && options.overrides[index];
- if (!override) throw new Error("Assertion failure - missing override");
- var opts = override.env && override.env[envName];
- return opts ? descriptors(dirname, opts, alias + ".overrides[" + index + "].env[\"" + envName + "\"]") : null;
- }
- function makeChainWalker(_ref6) {
- var root = _ref6.root,
- env = _ref6.env,
- overrides = _ref6.overrides,
- overridesEnv = _ref6.overridesEnv;
- return regenerator.mark(function _callee(input, context, files) {
- var dirname, flattenedConfigs, rootOpts, envOpts, chain, _i, _flattenedConfigs, op;
- return regenerator.wrap(function _callee$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- if (files === void 0) {
- files = new Set();
- }
- dirname = input.dirname;
- flattenedConfigs = [];
- rootOpts = root(input);
- if (configIsApplicable(rootOpts, dirname, context)) {
- flattenedConfigs.push(rootOpts);
- envOpts = env(input, context.envName);
- if (envOpts && configIsApplicable(envOpts, dirname, context)) {
- flattenedConfigs.push(envOpts);
- }
- (rootOpts.options.overrides || []).forEach(function (_, index) {
- var overrideOps = overrides(input, index);
- if (configIsApplicable(overrideOps, dirname, context)) {
- flattenedConfigs.push(overrideOps);
- var overrideEnvOpts = overridesEnv(input, index, context.envName);
- if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context)) {
- flattenedConfigs.push(overrideEnvOpts);
- }
- }
- });
- }
- if (!flattenedConfigs.some(function (_ref7) {
- var _ref7$options = _ref7.options,
- ignore = _ref7$options.ignore,
- only = _ref7$options.only;
- return shouldIgnore(context, ignore, only, dirname);
- })) {
- _context3.next = 7;
- break;
- }
- return _context3.abrupt("return", null);
- case 7:
- chain = emptyChain();
- _i = 0, _flattenedConfigs = flattenedConfigs;
- case 9:
- if (!(_i < _flattenedConfigs.length)) {
- _context3.next = 18;
- break;
- }
- op = _flattenedConfigs[_i];
- return _context3.delegateYield(mergeExtendsChain(chain, op.options, dirname, context, files), "t0", 12);
- case 12:
- if (_context3.t0) {
- _context3.next = 14;
- break;
- }
- return _context3.abrupt("return", null);
- case 14:
- mergeChainOpts(chain, op);
- case 15:
- _i++;
- _context3.next = 9;
- break;
- case 18:
- return _context3.abrupt("return", chain);
- case 19:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee);
- });
- }
- function mergeExtendsChain(chain, opts, dirname, context, files) {
- var file, fileChain;
- return regenerator.wrap(function mergeExtendsChain$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- if (!(opts["extends"] === undefined)) {
- _context4.next = 2;
- break;
- }
- return _context4.abrupt("return", true);
- case 2:
- return _context4.delegateYield(loadConfig(opts["extends"], dirname, context.envName, context.caller), "t0", 3);
- case 3:
- file = _context4.t0;
- if (!files.has(file)) {
- _context4.next = 6;
- break;
- }
- throw new Error("Configuration cycle detected loading " + file.filepath + ".\n" + "File already loaded following the config chain:\n" + Array.from(files, function (file) {
- return " - " + file.filepath;
- }).join("\n"));
- case 6:
- files.add(file);
- return _context4.delegateYield(loadFileChain(validateExtendFile(file), context, files), "t1", 8);
- case 8:
- fileChain = _context4.t1;
- files["delete"](file);
- if (fileChain) {
- _context4.next = 12;
- break;
- }
- return _context4.abrupt("return", false);
- case 12:
- mergeChain(chain, fileChain);
- return _context4.abrupt("return", true);
- case 14:
- case "end":
- return _context4.stop();
- }
- }
- }, _marked3$2);
- }
- function mergeChain(target, source) {
- var _target$options, _target$plugins, _target$presets;
- (_target$options = target.options).push.apply(_target$options, source.options);
- (_target$plugins = target.plugins).push.apply(_target$plugins, source.plugins);
- (_target$presets = target.presets).push.apply(_target$presets, source.presets);
- return target;
- }
- function mergeChainOpts(target, _ref8) {
- var _target$plugins2, _target$presets2;
- var options = _ref8.options,
- plugins = _ref8.plugins,
- presets = _ref8.presets;
- target.options.push(options);
- (_target$plugins2 = target.plugins).push.apply(_target$plugins2, plugins());
- (_target$presets2 = target.presets).push.apply(_target$presets2, presets());
- return target;
- }
- function emptyChain() {
- return {
- options: [],
- presets: [],
- plugins: []
- };
- }
- function normalizeOptions$1(opts) {
- var options = Object.assign({}, opts);
- delete options["extends"];
- delete options.env;
- delete options.overrides;
- delete options.plugins;
- delete options.presets;
- delete options.passPerPreset;
- delete options.ignore;
- delete options.only;
- delete options.test;
- delete options.include;
- delete options.exclude;
- if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) {
- options.sourceMaps = options.sourceMap;
- delete options.sourceMap;
- }
- return options;
- }
- function dedupDescriptors(items) {
- var map = new Map();
- var descriptors = [];
- for (var _iterator = items, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref9;
- if (_isArray) {
- if (_i2 >= _iterator.length) break;
- _ref9 = _iterator[_i2++];
- } else {
- _i2 = _iterator.next();
- if (_i2.done) break;
- _ref9 = _i2.value;
- }
- var item = _ref9;
- if (typeof item.value === "function") {
- var fnKey = item.value;
- var nameMap = map.get(fnKey);
- if (!nameMap) {
- nameMap = new Map();
- map.set(fnKey, nameMap);
- }
- var desc = nameMap.get(item.name);
- if (!desc) {
- desc = {
- value: item
- };
- descriptors.push(desc);
- if (!item.ownPass) nameMap.set(item.name, desc);
- } else {
- desc.value = item;
- }
- } else {
- descriptors.push({
- value: item
- });
- }
- }
- return descriptors.reduce(function (acc, desc) {
- acc.push(desc.value);
- return acc;
- }, []);
- }
- function configIsApplicable(_ref10, dirname, context) {
- var options = _ref10.options;
- return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname));
- }
- function configFieldIsApplicable(context, test, dirname) {
- var patterns = Array.isArray(test) ? test : [test];
- return matchesPatterns(context, patterns, dirname);
- }
- function shouldIgnore(context, ignore, only, dirname) {
- if (ignore && matchesPatterns(context, ignore, dirname)) {
- debug("Ignored %o because it matched one of %O from %o", context.filename, ignore, dirname);
- return true;
- }
- if (only && !matchesPatterns(context, only, dirname)) {
- debug("Ignored %o because it failed to match one of %O from %o", context.filename, only, dirname);
- return true;
- }
- return false;
- }
- function matchesPatterns(context, patterns, dirname) {
- return patterns.some(function (pattern) {
- return matchPattern(pattern, dirname, context.filename, context);
- });
- }
- function matchPattern(pattern, dirname, pathToTest, context) {
- if (typeof pattern === "function") {
- return !!pattern(pathToTest, {
- dirname: dirname,
- envName: context.envName,
- caller: context.caller
- });
- }
- if (typeof pathToTest !== "string") {
- throw new Error("Configuration contains string/RegExp pattern, but no filename was passed to Babel");
- }
- if (typeof pattern === "string") {
- pattern = pathToPattern(pattern, dirname);
- }
- return pattern.test(pathToTest);
- }
- var VALIDATORS = {
- name: assertString,
- manipulateOptions: assertFunction$1,
- pre: assertFunction$1,
- post: assertFunction$1,
- inherits: assertFunction$1,
- visitor: assertVisitorMap,
- parserOverride: assertFunction$1,
- generatorOverride: assertFunction$1
- };
- function assertVisitorMap(key, value) {
- var obj = assertObject(key, value);
- if (obj) {
- Object.keys(obj).forEach(function (prop) {
- return assertVisitorHandler(prop, obj[prop]);
- });
- if (obj.enter || obj.exit) {
- throw new Error("." + key + " cannot contain catch-all \"enter\" or \"exit\" handlers. Please target individual nodes.");
- }
- }
- return obj;
- }
- function assertVisitorHandler(key, value) {
- if (value && typeof value === "object") {
- Object.keys(value).forEach(function (handler) {
- if (handler !== "enter" && handler !== "exit") {
- throw new Error(".visitor[\"" + key + "\"] may only have .enter and/or .exit handlers.");
- }
- });
- } else if (typeof value !== "function") {
- throw new Error(".visitor[\"" + key + "\"] must be a function");
- }
- return value;
- }
- function validatePluginObject(obj) {
- var rootPath = {
- type: "root",
- source: "plugin"
- };
- Object.keys(obj).forEach(function (key) {
- var validator = VALIDATORS[key];
- var optLoc = {
- type: "option",
- name: key,
- parent: rootPath
- };
- if (validator) validator(optLoc, obj[key]);else throw new Error("." + key + " is not a valid Plugin property");
- });
- return obj;
- }
- function makeAPI(cache) {
- var env = function env(value) {
- return cache.using(function (data) {
- if (typeof value === "undefined") return data.envName;
- if (typeof value === "function") {
- return assertSimpleType(value(data.envName));
- }
- if (!Array.isArray(value)) value = [value];
- return value.some(function (entry) {
- if (typeof entry !== "string") {
- throw new Error("Unexpected non-string value");
- }
- return entry === data.envName;
- });
- });
- };
- var caller = function caller(cb) {
- return cache.using(function (data) {
- return assertSimpleType(cb(data.caller));
- });
- };
- return {
- version: version$1,
- cache: cache.simple(),
- env: env,
- async: function async() {
- return false;
- },
- caller: caller,
- assertVersion: assertVersion,
- tokTypes: undefined
- };
- }
- function assertVersion(range) {
- if (typeof range === "number") {
- if (!Number.isInteger(range)) {
- throw new Error("Expected string or integer value.");
- }
- range = "^" + range + ".0.0-0";
- }
- if (typeof range !== "string") {
- throw new Error("Expected string or integer value.");
- }
- if (semver.satisfies(version$1, range)) return;
- var limit = Error.stackTraceLimit;
- if (typeof limit === "number" && limit < 25) {
- Error.stackTraceLimit = 25;
- }
- var err = new Error("Requires Babel \"" + range + "\", but was loaded with \"" + version$1 + "\". " + "If you are sure you have a compatible version of @babel/core, " + "it is likely that something in your build process is loading the " + "wrong version. Inspect the stack trace of this error to look for " + "the first entry that doesn't mention \"@babel/core\" or \"babel-core\" " + "to see what is calling Babel.");
- if (typeof limit === "number") {
- Error.stackTraceLimit = limit;
- }
- throw Object.assign(err, {
- code: "BABEL_VERSION_UNSUPPORTED",
- version: version$1,
- range: range
- });
- }
- var _marked$3 = regenerator.mark(resolveRootMode),
- _marked2$3 = regenerator.mark(loadPrivatePartialConfig);
- function resolveRootMode(rootDir, rootMode) {
- var upwardRootDir, _upwardRootDir;
- return regenerator.wrap(function resolveRootMode$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- _context.t0 = rootMode;
- _context.next = _context.t0 === "root" ? 3 : _context.t0 === "upward-optional" ? 4 : _context.t0 === "upward" ? 7 : 12;
- break;
- case 3:
- return _context.abrupt("return", rootDir);
- case 4:
- return _context.delegateYield(findConfigUpwards(), "t1", 5);
- case 5:
- upwardRootDir = _context.t1;
- return _context.abrupt("return", upwardRootDir === null ? rootDir : upwardRootDir);
- case 7:
- return _context.delegateYield(findConfigUpwards(), "t2", 8);
- case 8:
- _upwardRootDir = _context.t2;
- if (!(_upwardRootDir !== null)) {
- _context.next = 11;
- break;
- }
- return _context.abrupt("return", _upwardRootDir);
- case 11:
- throw Object.assign(new Error("Babel was run with rootMode:\"upward\" but a root could not " + ("be found when searching upward from \"" + rootDir + "\".\n") + "One of the following config files must be in the directory tree: " + ("\"" + ROOT_CONFIG_FILENAMES.join(", ") + "\".")), {
- code: "BABEL_ROOT_NOT_FOUND",
- dirname: rootDir
- });
- case 12:
- throw new Error("Assertion failure - unknown rootMode value.");
- case 13:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$3);
- }
- function loadPrivatePartialConfig(inputOpts) {
- var args, _args$envName, envName, _args$cwd, cwd, _args$root, rootDir, _args$rootMode, rootMode, caller, absoluteCwd, absoluteRootDir, context, configChain, options;
- return regenerator.wrap(function loadPrivatePartialConfig$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- if (!(inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts)))) {
- _context2.next = 2;
- break;
- }
- throw new Error("Babel options must be an object, null, or undefined");
- case 2:
- args = inputOpts ? validate$3("arguments", inputOpts) : {};
- _args$envName = args.envName, envName = _args$envName === void 0 ? getEnv() : _args$envName, _args$cwd = args.cwd, cwd = _args$cwd === void 0 ? "." : _args$cwd, _args$root = args.root, rootDir = _args$root === void 0 ? "." : _args$root, _args$rootMode = args.rootMode, rootMode = _args$rootMode === void 0 ? "root" : _args$rootMode, caller = args.caller;
- absoluteCwd = path$1.resolve(cwd);
- return _context2.delegateYield(resolveRootMode(path$1.resolve(absoluteCwd, rootDir), rootMode), "t0", 6);
- case 6:
- absoluteRootDir = _context2.t0;
- context = {
- filename: typeof args.filename === "string" ? path$1.resolve(cwd, args.filename) : undefined,
- cwd: absoluteCwd,
- root: absoluteRootDir,
- envName: envName,
- caller: caller
- };
- return _context2.delegateYield(buildRootChain(args, context), "t1", 9);
- case 9:
- configChain = _context2.t1;
- if (configChain) {
- _context2.next = 12;
- break;
- }
- return _context2.abrupt("return", null);
- case 12:
- options = {};
- configChain.options.forEach(function (opts) {
- mergeOptions(options, opts);
- });
- options.babelrc = false;
- options.configFile = false;
- options.passPerPreset = false;
- options.envName = context.envName;
- options.cwd = context.cwd;
- options.root = context.root;
- options.filename = typeof context.filename === "string" ? context.filename : undefined;
- options.plugins = configChain.plugins.map(function (descriptor) {
- return createItemFromDescriptor(descriptor);
- });
- options.presets = configChain.presets.map(function (descriptor) {
- return createItemFromDescriptor(descriptor);
- });
- return _context2.abrupt("return", {
- options: options,
- context: context,
- ignore: configChain.ignore,
- babelrc: configChain.babelrc,
- config: configChain.config
- });
- case 24:
- case "end":
- return _context2.stop();
- }
- }
- }, _marked2$3);
- }
- var loadPartialConfig = gensync(regenerator.mark(function _callee(inputOpts) {
- var result, options, babelrc, ignore, config;
- return regenerator.wrap(function _callee$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- return _context3.delegateYield(loadPrivatePartialConfig(inputOpts), "t0", 1);
- case 1:
- result = _context3.t0;
- if (result) {
- _context3.next = 4;
- break;
- }
- return _context3.abrupt("return", null);
- case 4:
- options = result.options, babelrc = result.babelrc, ignore = result.ignore, config = result.config;
- (options.plugins || []).forEach(function (item) {
- if (item.value instanceof Plugin) {
- throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()");
- }
- });
- return _context3.abrupt("return", new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined));
- case 7:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee);
- }));
- var PartialConfig = function () {
- function PartialConfig(options, babelrc, ignore, config) {
- this.options = options;
- this.babelignore = ignore;
- this.babelrc = babelrc;
- this.config = config;
- Object.freeze(this);
- }
- var _proto = PartialConfig.prototype;
- _proto.hasFilesystemConfig = function hasFilesystemConfig() {
- return this.babelrc !== undefined || this.config !== undefined;
- };
- return PartialConfig;
- }();
- Object.freeze(PartialConfig.prototype);
- var _marked$4 = regenerator.mark(loadPluginDescriptor),
- _marked2$4 = regenerator.mark(loadPresetDescriptor);
- var loadConfig$1 = gensync(regenerator.mark(function loadFullConfig(inputOpts) {
- var result, options, context, optionDefaults, passes, plugins, presets, ignored, opts;
- return regenerator.wrap(function loadFullConfig$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- return _context2.delegateYield(loadPrivatePartialConfig(inputOpts), "t0", 1);
- case 1:
- result = _context2.t0;
- if (result) {
- _context2.next = 4;
- break;
- }
- return _context2.abrupt("return", null);
- case 4:
- options = result.options, context = result.context;
- optionDefaults = {};
- passes = [[]];
- _context2.prev = 7;
- plugins = options.plugins, presets = options.presets;
- if (!(!plugins || !presets)) {
- _context2.next = 11;
- break;
- }
- throw new Error("Assertion failure - plugins and presets exist");
- case 11:
- return _context2.delegateYield(regenerator.mark(function recurseDescriptors(config, pass) {
- var plugins, _iterator, _isArray, _i, _ref, descriptor, presets, _iterator2, _isArray2, _i2, _ref2, _descriptor, _iterator3, _isArray3, _i3, _ref3, _ref4, preset, _pass, _ignored;
- return regenerator.wrap(function recurseDescriptors$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- plugins = [];
- _iterator = config.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
- case 2:
- if (!_isArray) {
- _context.next = 8;
- break;
- }
- if (!(_i >= _iterator.length)) {
- _context.next = 5;
- break;
- }
- return _context.abrupt("break", 20);
- case 5:
- _ref = _iterator[_i++];
- _context.next = 12;
- break;
- case 8:
- _i = _iterator.next();
- if (!_i.done) {
- _context.next = 11;
- break;
- }
- return _context.abrupt("break", 20);
- case 11:
- _ref = _i.value;
- case 12:
- descriptor = _ref;
- if (!(descriptor.options !== false)) {
- _context.next = 18;
- break;
- }
- _context.t0 = plugins;
- return _context.delegateYield(loadPluginDescriptor(descriptor, context), "t1", 16);
- case 16:
- _context.t2 = _context.t1;
- _context.t0.push.call(_context.t0, _context.t2);
- case 18:
- _context.next = 2;
- break;
- case 20:
- presets = [];
- _iterator2 = config.presets, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();
- case 22:
- if (!_isArray2) {
- _context.next = 28;
- break;
- }
- if (!(_i2 >= _iterator2.length)) {
- _context.next = 25;
- break;
- }
- return _context.abrupt("break", 42);
- case 25:
- _ref2 = _iterator2[_i2++];
- _context.next = 32;
- break;
- case 28:
- _i2 = _iterator2.next();
- if (!_i2.done) {
- _context.next = 31;
- break;
- }
- return _context.abrupt("break", 42);
- case 31:
- _ref2 = _i2.value;
- case 32:
- _descriptor = _ref2;
- if (!(_descriptor.options !== false)) {
- _context.next = 40;
- break;
- }
- _context.t3 = presets;
- return _context.delegateYield(loadPresetDescriptor(_descriptor, context), "t4", 36);
- case 36:
- _context.t5 = _context.t4;
- _context.t6 = _descriptor.ownPass ? [] : pass;
- _context.t7 = {
- preset: _context.t5,
- pass: _context.t6
- };
- _context.t3.push.call(_context.t3, _context.t7);
- case 40:
- _context.next = 22;
- break;
- case 42:
- if (!(presets.length > 0)) {
- _context.next = 65;
- break;
- }
- passes.splice.apply(passes, [1, 0].concat(presets.map(function (o) {
- return o.pass;
- }).filter(function (p) {
- return p !== pass;
- })));
- _iterator3 = presets, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();
- case 45:
- if (!_isArray3) {
- _context.next = 51;
- break;
- }
- if (!(_i3 >= _iterator3.length)) {
- _context.next = 48;
- break;
- }
- return _context.abrupt("break", 65);
- case 48:
- _ref3 = _iterator3[_i3++];
- _context.next = 55;
- break;
- case 51:
- _i3 = _iterator3.next();
- if (!_i3.done) {
- _context.next = 54;
- break;
- }
- return _context.abrupt("break", 65);
- case 54:
- _ref3 = _i3.value;
- case 55:
- _ref4 = _ref3, preset = _ref4.preset, _pass = _ref4.pass;
- if (preset) {
- _context.next = 58;
- break;
- }
- return _context.abrupt("return", true);
- case 58:
- return _context.delegateYield(recurseDescriptors({
- plugins: preset.plugins,
- presets: preset.presets
- }, _pass), "t8", 59);
- case 59:
- _ignored = _context.t8;
- if (!_ignored) {
- _context.next = 62;
- break;
- }
- return _context.abrupt("return", true);
- case 62:
- preset.options.forEach(function (opts) {
- mergeOptions(optionDefaults, opts);
- });
- case 63:
- _context.next = 45;
- break;
- case 65:
- if (plugins.length > 0) {
- pass.unshift.apply(pass, plugins);
- }
- case 66:
- case "end":
- return _context.stop();
- }
- }
- }, recurseDescriptors);
- })({
- plugins: plugins.map(function (item) {
- var desc = getItemDescriptor(item);
- if (!desc) {
- throw new Error("Assertion failure - must be config item");
- }
- return desc;
- }),
- presets: presets.map(function (item) {
- var desc = getItemDescriptor(item);
- if (!desc) {
- throw new Error("Assertion failure - must be config item");
- }
- return desc;
- })
- }, passes[0]), "t1", 12);
- case 12:
- ignored = _context2.t1;
- if (!ignored) {
- _context2.next = 15;
- break;
- }
- return _context2.abrupt("return", null);
- case 15:
- _context2.next = 21;
- break;
- case 17:
- _context2.prev = 17;
- _context2.t2 = _context2["catch"](7);
- if (!/^\[BABEL\]/.test(_context2.t2.message)) {
- _context2.t2.message = "[BABEL] " + (context.filename || "unknown") + ": " + _context2.t2.message;
- }
- throw _context2.t2;
- case 21:
- opts = optionDefaults;
- mergeOptions(opts, options);
- opts.plugins = passes[0];
- opts.presets = passes.slice(1).filter(function (plugins) {
- return plugins.length > 0;
- }).map(function (plugins) {
- return {
- plugins: plugins
- };
- });
- opts.passPerPreset = opts.presets.length > 0;
- return _context2.abrupt("return", {
- options: opts,
- passes: passes
- });
- case 27:
- case "end":
- return _context2.stop();
- }
- }
- }, loadFullConfig, null, [[7, 17]]);
- }));
- var loadDescriptor = makeWeakCache(regenerator.mark(function _callee(_ref5, cache) {
- var value, options, dirname, alias, item, api;
- return regenerator.wrap(function _callee$(_context3) {
- while (1) {
- switch (_context3.prev = _context3.next) {
- case 0:
- value = _ref5.value, options = _ref5.options, dirname = _ref5.dirname, alias = _ref5.alias;
- if (!(options === false)) {
- _context3.next = 3;
- break;
- }
- throw new Error("Assertion failure");
- case 3:
- options = options || {};
- item = value;
- if (!(typeof value === "function")) {
- _context3.next = 15;
- break;
- }
- api = Object.assign({}, context, {}, makeAPI(cache));
- _context3.prev = 7;
- item = value(api, options, dirname);
- _context3.next = 15;
- break;
- case 11:
- _context3.prev = 11;
- _context3.t0 = _context3["catch"](7);
- if (alias) {
- _context3.t0.message += " (While processing: " + JSON.stringify(alias) + ")";
- }
- throw _context3.t0;
- case 15:
- if (!(!item || typeof item !== "object")) {
- _context3.next = 17;
- break;
- }
- throw new Error("Plugin/Preset did not return an object.");
- case 17:
- if (!(typeof item.then === "function")) {
- _context3.next = 20;
- break;
- }
- return _context3.delegateYield([], "t1", 19);
- case 19:
- throw new Error("You appear to be using an async plugin, " + "which your current version of Babel does not support. " + "If you're using a published plugin, " + "you may need to upgrade your @babel/core version.");
- case 20:
- return _context3.abrupt("return", {
- value: item,
- options: options,
- dirname: dirname,
- alias: alias
- });
- case 21:
- case "end":
- return _context3.stop();
- }
- }
- }, _callee, null, [[7, 11]]);
- }));
- function loadPluginDescriptor(descriptor, context) {
- return regenerator.wrap(function loadPluginDescriptor$(_context4) {
- while (1) {
- switch (_context4.prev = _context4.next) {
- case 0:
- if (!(descriptor.value instanceof Plugin)) {
- _context4.next = 4;
- break;
- }
- if (!descriptor.options) {
- _context4.next = 3;
- break;
- }
- throw new Error("Passed options to an existing Plugin instance will not work.");
- case 3:
- return _context4.abrupt("return", descriptor.value);
- case 4:
- _context4.t0 = instantiatePlugin;
- return _context4.delegateYield(loadDescriptor(descriptor, context), "t1", 6);
- case 6:
- _context4.t2 = _context4.t1;
- _context4.t3 = context;
- return _context4.delegateYield((0, _context4.t0)(_context4.t2, _context4.t3), "t4", 9);
- case 9:
- return _context4.abrupt("return", _context4.t4);
- case 10:
- case "end":
- return _context4.stop();
- }
- }
- }, _marked$4);
- }
- var instantiatePlugin = makeWeakCache(regenerator.mark(function _callee2(_ref6, cache) {
- var value, options, dirname, alias, pluginObj, plugin, inheritsDescriptor, inherits;
- return regenerator.wrap(function _callee2$(_context5) {
- while (1) {
- switch (_context5.prev = _context5.next) {
- case 0:
- value = _ref6.value, options = _ref6.options, dirname = _ref6.dirname, alias = _ref6.alias;
- pluginObj = validatePluginObject(value);
- plugin = Object.assign({}, pluginObj);
- if (plugin.visitor) {
- plugin.visitor = traverse$1.explode(Object.assign({}, plugin.visitor));
- }
- if (!plugin.inherits) {
- _context5.next = 12;
- break;
- }
- inheritsDescriptor = {
- name: undefined,
- alias: alias + "$inherits",
- value: plugin.inherits,
- options: options,
- dirname: dirname
- };
- return _context5.delegateYield(forwardAsync(loadPluginDescriptor, function (run) {
- return cache.invalidate(function (data) {
- return run(inheritsDescriptor, data);
- });
- }), "t0", 7);
- case 7:
- inherits = _context5.t0;
- plugin.pre = chain$1(inherits.pre, plugin.pre);
- plugin.post = chain$1(inherits.post, plugin.post);
- plugin.manipulateOptions = chain$1(inherits.manipulateOptions, plugin.manipulateOptions);
- plugin.visitor = traverse$1.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
- case 12:
- return _context5.abrupt("return", new Plugin(plugin, options, alias));
- case 13:
- case "end":
- return _context5.stop();
- }
- }
- }, _callee2);
- }));
- var validateIfOptionNeedsFilename = function validateIfOptionNeedsFilename(options, descriptor) {
- if (options.test || options.include || options.exclude) {
- var formattedPresetName = descriptor.name ? "\"" + descriptor.name + "\"" : "/* your preset */";
- throw new Error(["Preset " + formattedPresetName + " requires a filename to be set when babel is called directly,", "```", "babel.transform(code, { filename: 'file.ts', presets: [" + formattedPresetName + "] });", "```", "See https://babeljs.io/docs/en/options#filename for more information."].join("\n"));
- }
- };
- var validatePreset = function validatePreset(preset, context, descriptor) {
- if (!context.filename) {
- var options = preset.options;
- validateIfOptionNeedsFilename(options, descriptor);
- if (options.overrides) {
- options.overrides.forEach(function (overrideOptions) {
- return validateIfOptionNeedsFilename(overrideOptions, descriptor);
- });
- }
- }
- };
- function loadPresetDescriptor(descriptor, context) {
- var preset;
- return regenerator.wrap(function loadPresetDescriptor$(_context6) {
- while (1) {
- switch (_context6.prev = _context6.next) {
- case 0:
- _context6.t0 = instantiatePreset;
- return _context6.delegateYield(loadDescriptor(descriptor, context), "t1", 2);
- case 2:
- _context6.t2 = _context6.t1;
- preset = (0, _context6.t0)(_context6.t2);
- validatePreset(preset, context, descriptor);
- return _context6.delegateYield(buildPresetChain(preset, context), "t3", 6);
- case 6:
- return _context6.abrupt("return", _context6.t3);
- case 7:
- case "end":
- return _context6.stop();
- }
- }
- }, _marked2$4);
- }
- var instantiatePreset = makeWeakCacheSync(function (_ref7) {
- var value = _ref7.value,
- dirname = _ref7.dirname,
- alias = _ref7.alias;
- return {
- options: validate$3("preset", value),
- alias: alias,
- dirname: dirname
- };
- });
- function chain$1(a, b) {
- var fns = [a, b].filter(Boolean);
- if (fns.length <= 1) return fns[0];
- return function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- for (var _iterator4 = fns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref8;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref8 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref8 = _i4.value;
- }
- var fn = _ref8;
- fn.apply(this, args);
- }
- };
- }
- var loadOptionsRunner = gensync(regenerator.mark(function _callee(opts) {
- var config;
- return regenerator.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(loadConfig$1(opts), "t0", 1);
- case 1:
- config = _context.t0;
- return _context.abrupt("return", config ? config.options : null);
- case 3:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- var maybeErrback = function maybeErrback(runner) {
- return function (opts, callback) {
- if (callback === undefined && typeof opts === "function") {
- callback = opts;
- opts = undefined;
- }
- return callback ? runner.errback(opts, callback) : runner.sync(opts);
- };
- };
- var loadPartialConfig$1 = maybeErrback(loadPartialConfig);
- var loadPartialConfigSync = loadPartialConfig.sync;
- var loadPartialConfigAsync = loadPartialConfig.async;
- var loadOptions = maybeErrback(loadOptionsRunner);
- var loadOptionsSync = loadOptionsRunner.sync;
- var loadOptionsAsync = loadOptionsRunner.async;
- var PluginPass = function () {
- function PluginPass(file, key, options) {
- this._map = new Map();
- this.key = key;
- this.file = file;
- this.opts = options || {};
- this.cwd = file.opts.cwd;
- this.filename = file.opts.filename;
- }
- var _proto = PluginPass.prototype;
- _proto.set = function set(key, val) {
- this._map.set(key, val);
- };
- _proto.get = function get(key) {
- return this._map.get(key);
- };
- _proto.availableHelper = function availableHelper(name, versionRange) {
- return this.file.availableHelper(name, versionRange);
- };
- _proto.addHelper = function addHelper(name) {
- return this.file.addHelper(name);
- };
- _proto.addImport = function addImport() {
- return this.file.addImport();
- };
- _proto.getModuleName = function getModuleName() {
- return this.file.getModuleName();
- };
- _proto.buildCodeFrameError = function buildCodeFrameError(node, msg, Error) {
- return this.file.buildCodeFrameError(node, msg, Error);
- };
- return PluginPass;
- }();
- var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
- function isFlattenable(value) {
- return isArray_1(value) || isArguments_1(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- var _isFlattenable = isFlattenable;
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1,
- length = array.length;
- predicate || (predicate = _isFlattenable);
- result || (result = []);
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- _arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
- var _baseFlatten = baseFlatten;
- function arraySome(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
- var _arraySome = arraySome;
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- arrLength = array.length,
- othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var stacked = stack.get(array);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var index = -1,
- result = true,
- seen = bitmask & COMPARE_UNORDERED_FLAG ? new _SetCache() : undefined;
- stack.set(array, other);
- stack.set(other, array);
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- if (seen) {
- if (!_arraySome(other, function (othValue, othIndex) {
- if (!_cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- result = false;
- break;
- }
- }
- stack['delete'](array);
- stack['delete'](other);
- return result;
- }
- var _equalArrays = equalArrays;
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
- map.forEach(function (value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- var _mapToArray = mapToArray;
- var COMPARE_PARTIAL_FLAG$1 = 1,
- COMPARE_UNORDERED_FLAG$1 = 2;
- var boolTag$3 = '[object Boolean]',
- dateTag$3 = '[object Date]',
- errorTag$2 = '[object Error]',
- mapTag$5 = '[object Map]',
- numberTag$3 = '[object Number]',
- regexpTag$4 = '[object RegExp]',
- setTag$5 = '[object Set]',
- stringTag$4 = '[object String]',
- symbolTag$3 = '[object Symbol]';
- var arrayBufferTag$3 = '[object ArrayBuffer]',
- dataViewTag$4 = '[object DataView]';
- var symbolProto$2 = _Symbol ? _Symbol.prototype : undefined,
- symbolValueOf$1 = symbolProto$2 ? symbolProto$2.valueOf : undefined;
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag$4:
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag$3:
- if (object.byteLength != other.byteLength || !equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
- return false;
- }
- return true;
- case boolTag$3:
- case dateTag$3:
- case numberTag$3:
- return eq_1(+object, +other);
- case errorTag$2:
- return object.name == other.name && object.message == other.message;
- case regexpTag$4:
- case stringTag$4:
- return object == other + '';
- case mapTag$5:
- var convert = _mapToArray;
- case setTag$5:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1;
- convert || (convert = _setToArray);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG$1;
- stack.set(object, other);
- var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack['delete'](object);
- return result;
- case symbolTag$3:
- if (symbolValueOf$1) {
- return symbolValueOf$1.call(object) == symbolValueOf$1.call(other);
- }
- }
- return false;
- }
- var _equalByTag = equalByTag;
- var COMPARE_PARTIAL_FLAG$2 = 1;
- var objectProto$f = Object.prototype;
- var hasOwnProperty$d = objectProto$f.hasOwnProperty;
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2,
- objProps = _getAllKeys(object),
- objLength = objProps.length,
- othProps = _getAllKeys(other),
- othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty$d.call(other, key))) {
- return false;
- }
- }
- var stacked = stack.get(object);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
- }
- if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
- if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack['delete'](object);
- stack['delete'](other);
- return result;
- }
- var _equalObjects = equalObjects;
- var COMPARE_PARTIAL_FLAG$3 = 1;
- var argsTag$3 = '[object Arguments]',
- arrayTag$2 = '[object Array]',
- objectTag$4 = '[object Object]';
- var objectProto$g = Object.prototype;
- var hasOwnProperty$e = objectProto$g.hasOwnProperty;
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray_1(object),
- othIsArr = isArray_1(other),
- objTag = objIsArr ? arrayTag$2 : _getTag(object),
- othTag = othIsArr ? arrayTag$2 : _getTag(other);
- objTag = objTag == argsTag$3 ? objectTag$4 : objTag;
- othTag = othTag == argsTag$3 ? objectTag$4 : othTag;
- var objIsObj = objTag == objectTag$4,
- othIsObj = othTag == objectTag$4,
- isSameTag = objTag == othTag;
- if (isSameTag && isBuffer_1(object)) {
- if (!isBuffer_1(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new _Stack());
- return objIsArr || isTypedArray_1(object) ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack) : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG$3)) {
- var objIsWrapped = objIsObj && hasOwnProperty$e.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty$e.call(other, '__wrapped__');
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object,
- othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new _Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new _Stack());
- return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
- var _baseIsEqualDeep = baseIsEqualDeep;
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike_1(value) && !isObjectLike_1(other)) {
- return value !== value && other !== other;
- }
- return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- var _baseIsEqual = baseIsEqual;
- var COMPARE_PARTIAL_FLAG$4 = 1,
- COMPARE_UNORDERED_FLAG$2 = 2;
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (index--) {
- var data = matchData[index];
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var stack = new _Stack();
- if (customizer) {
- var result = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result === undefined ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$4 | COMPARE_UNORDERED_FLAG$2, customizer, stack) : result)) {
- return false;
- }
- }
- }
- return true;
- }
- var _baseIsMatch = baseIsMatch;
- function isStrictComparable(value) {
- return value === value && !isObject_1(value);
- }
- var _isStrictComparable = isStrictComparable;
- function getMatchData(object) {
- var result = keys_1(object),
- length = result.length;
- while (length--) {
- var key = result[length],
- value = object[key];
- result[length] = [key, value, _isStrictComparable(value)];
- }
- return result;
- }
- var _getMatchData = getMatchData;
- function matchesStrictComparable(key, srcValue) {
- return function (object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
- };
- }
- var _matchesStrictComparable = matchesStrictComparable;
- function baseMatches(source) {
- var matchData = _getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function (object) {
- return object === source || _baseIsMatch(object, source, matchData);
- };
- }
- var _baseMatches = baseMatches;
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/;
- function isKey(value, object) {
- if (isArray_1(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol_1(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
- }
- var _isKey = isKey;
- var FUNC_ERROR_TEXT = 'Expected a function';
- function memoize(func, resolver) {
- if (typeof func != 'function' || resolver != null && typeof resolver != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function memoized() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result) || cache;
- return result;
- };
- memoized.cache = new (memoize.Cache || _MapCache)();
- return memoized;
- }
- memoize.Cache = _MapCache;
- var memoize_1 = memoize;
- var MAX_MEMOIZE_SIZE = 500;
- function memoizeCapped(func) {
- var result = memoize_1(func, function (key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
- var cache = result.cache;
- return result;
- }
- var _memoizeCapped = memoizeCapped;
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- var reEscapeChar = /\\(\\)?/g;
- var stringToPath = _memoizeCapped(function (string) {
- var result = [];
- if (string.charCodeAt(0) === 46) {
- result.push('');
- }
- string.replace(rePropName, function (match, number, quote, subString) {
- result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match);
- });
- return result;
- });
- var _stringToPath = stringToPath;
- function castPath(value, object) {
- if (isArray_1(value)) {
- return value;
- }
- return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
- }
- var _castPath = castPath;
- var INFINITY$3 = 1 / 0;
- function toKey(value) {
- if (typeof value == 'string' || isSymbol_1(value)) {
- return value;
- }
- var result = value + '';
- return result == '0' && 1 / value == -INFINITY$3 ? '-0' : result;
- }
- var _toKey = toKey;
- function baseGet(object, path) {
- path = _castPath(path, object);
- var index = 0,
- length = path.length;
- while (object != null && index < length) {
- object = object[_toKey(path[index++])];
- }
- return index && index == length ? object : undefined;
- }
- var _baseGet = baseGet;
- function get$2(object, path, defaultValue) {
- var result = object == null ? undefined : _baseGet(object, path);
- return result === undefined ? defaultValue : result;
- }
- var get_1 = get$2;
- function baseHasIn(object, key) {
- return object != null && key in Object(object);
- }
- var _baseHasIn = baseHasIn;
- function hasPath(object, path, hasFunc) {
- path = _castPath(path, object);
- var index = -1,
- length = path.length,
- result = false;
- while (++index < length) {
- var key = _toKey(path[index]);
- if (!(result = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result || ++index != length) {
- return result;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength_1(length) && _isIndex(key, length) && (isArray_1(object) || isArguments_1(object));
- }
- var _hasPath = hasPath;
- function hasIn(object, path) {
- return object != null && _hasPath(object, path, _baseHasIn);
- }
- var hasIn_1 = hasIn;
- var COMPARE_PARTIAL_FLAG$5 = 1,
- COMPARE_UNORDERED_FLAG$3 = 2;
- function baseMatchesProperty(path, srcValue) {
- if (_isKey(path) && _isStrictComparable(srcValue)) {
- return _matchesStrictComparable(_toKey(path), srcValue);
- }
- return function (object) {
- var objValue = get_1(object, path);
- return objValue === undefined && objValue === srcValue ? hasIn_1(object, path) : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$5 | COMPARE_UNORDERED_FLAG$3);
- };
- }
- var _baseMatchesProperty = baseMatchesProperty;
- function baseProperty(key) {
- return function (object) {
- return object == null ? undefined : object[key];
- };
- }
- var _baseProperty = baseProperty;
- function basePropertyDeep(path) {
- return function (object) {
- return _baseGet(object, path);
- };
- }
- var _basePropertyDeep = basePropertyDeep;
- function property(path) {
- return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
- }
- var property_1 = property;
- function baseIteratee(value) {
- if (typeof value == 'function') {
- return value;
- }
- if (value == null) {
- return identity_1;
- }
- if (typeof value == 'object') {
- return isArray_1(value) ? _baseMatchesProperty(value[0], value[1]) : _baseMatches(value);
- }
- return property_1(value);
- }
- var _baseIteratee = baseIteratee;
- function createBaseFor(fromRight) {
- return function (object, iteratee, keysFunc) {
- var index = -1,
- iterable = Object(object),
- props = keysFunc(object),
- length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
- var _createBaseFor = createBaseFor;
- var baseFor = _createBaseFor();
- var _baseFor = baseFor;
- function baseForOwn(object, iteratee) {
- return object && _baseFor(object, iteratee, keys_1);
- }
- var _baseForOwn = baseForOwn;
- function createBaseEach(eachFunc, fromRight) {
- return function (collection, iteratee) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike_1(collection)) {
- return eachFunc(collection, iteratee);
- }
- var length = collection.length,
- index = fromRight ? length : -1,
- iterable = Object(collection);
- while (fromRight ? index-- : ++index < length) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- var _createBaseEach = createBaseEach;
- var baseEach = _createBaseEach(_baseForOwn);
- var _baseEach = baseEach;
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike_1(collection) ? Array(collection.length) : [];
- _baseEach(collection, function (value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
- var _baseMap = baseMap;
- function baseSortBy(array, comparer) {
- var length = array.length;
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
- var _baseSortBy = baseSortBy;
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined,
- valIsNull = value === null,
- valIsReflexive = value === value,
- valIsSymbol = isSymbol_1(value);
- var othIsDefined = other !== undefined,
- othIsNull = other === null,
- othIsReflexive = other === other,
- othIsSymbol = isSymbol_1(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
- return 1;
- }
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- var _compareAscending = compareAscending;
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
- while (++index < length) {
- var result = _compareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * (order == 'desc' ? -1 : 1);
- }
- }
- return object.index - other.index;
- }
- var _compareMultiple = compareMultiple;
- function baseOrderBy(collection, iteratees, orders) {
- var index = -1;
- iteratees = _arrayMap(iteratees.length ? iteratees : [identity_1], _baseUnary(_baseIteratee));
- var result = _baseMap(collection, function (value, key, collection) {
- var criteria = _arrayMap(iteratees, function (iteratee) {
- return iteratee(value);
- });
- return {
- 'criteria': criteria,
- 'index': ++index,
- 'value': value
- };
- });
- return _baseSortBy(result, function (object, other) {
- return _compareMultiple(object, other, orders);
- });
- }
- var _baseOrderBy = baseOrderBy;
- var sortBy = _baseRest(function (collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
- });
- var sortBy_1 = sortBy;
- var LOADED_PLUGIN;
- function loadBlockHoistPlugin() {
- if (!LOADED_PLUGIN) {
- var config = loadConfig$1.sync({
- babelrc: false,
- configFile: false,
- plugins: [blockHoistPlugin]
- });
- LOADED_PLUGIN = config ? config.passes[0][0] : undefined;
- if (!LOADED_PLUGIN) throw new Error("Assertion failure");
- }
- return LOADED_PLUGIN;
- }
- var blockHoistPlugin = {
- name: "internal.blockHoist",
- visitor: {
- Block: {
- exit: function exit(_ref) {
- var node = _ref.node;
- var hasChange = false;
- for (var i = 0; i < node.body.length; i++) {
- var bodyNode = node.body[i];
- if (bodyNode && bodyNode._blockHoist != null) {
- hasChange = true;
- break;
- }
- }
- if (!hasChange) return;
- node.body = sortBy_1(node.body, function (bodyNode) {
- var priority = bodyNode && bodyNode._blockHoist;
- if (priority == null) priority = 1;
- if (priority === true) priority = 2;
- return -1 * priority;
- });
- }
- }
- }
- };
- function normalizeOptions$2(config) {
- var _config$options = config.options,
- filename = _config$options.filename,
- cwd = _config$options.cwd,
- _config$options$filen = _config$options.filenameRelative,
- filenameRelative = _config$options$filen === void 0 ? typeof filename === "string" ? path$1.relative(cwd, filename) : "unknown" : _config$options$filen,
- _config$options$sourc = _config$options.sourceType,
- sourceType = _config$options$sourc === void 0 ? "module" : _config$options$sourc,
- inputSourceMap = _config$options.inputSourceMap,
- _config$options$sourc2 = _config$options.sourceMaps,
- sourceMaps = _config$options$sourc2 === void 0 ? !!inputSourceMap : _config$options$sourc2,
- moduleRoot = _config$options.moduleRoot,
- _config$options$sourc3 = _config$options.sourceRoot,
- sourceRoot = _config$options$sourc3 === void 0 ? moduleRoot : _config$options$sourc3,
- _config$options$sourc4 = _config$options.sourceFileName,
- sourceFileName = _config$options$sourc4 === void 0 ? path$1.basename(filenameRelative) : _config$options$sourc4,
- _config$options$comme = _config$options.comments,
- comments = _config$options$comme === void 0 ? true : _config$options$comme,
- _config$options$compa = _config$options.compact,
- compact = _config$options$compa === void 0 ? "auto" : _config$options$compa;
- var opts = config.options;
- var options = Object.assign({}, opts, {
- parserOpts: Object.assign({
- sourceType: path$1.extname(filenameRelative) === ".mjs" ? "module" : sourceType,
- sourceFileName: filename,
- plugins: []
- }, opts.parserOpts),
- generatorOpts: Object.assign({
- filename: filename,
- auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
- auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
- retainLines: opts.retainLines,
- comments: comments,
- shouldPrintComment: opts.shouldPrintComment,
- compact: compact,
- minified: opts.minified,
- sourceMaps: sourceMaps,
- sourceRoot: sourceRoot,
- sourceFileName: sourceFileName
- }, opts.generatorOpts)
- });
- for (var _iterator = config.passes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var plugins = _ref;
- for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var plugin = _ref2;
- if (plugin.manipulateOptions) {
- plugin.manipulateOptions(options, options.parserOpts);
- }
- }
- }
- return options;
- }
- var fs = {};
- var CLONE_DEEP_FLAG$1 = 1,
- CLONE_SYMBOLS_FLAG$2 = 4;
- function cloneDeep$1(value) {
- return _baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$2);
- }
- var cloneDeep_1 = cloneDeep$1;
- var _nodeResolve_empty = {};
- var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': _nodeResolve_empty
- });
- var safeBuffer = createCommonjsModule(function (module, exports) {
- var Buffer = bufferEs6.Buffer;
- function copyProps(src, dst) {
- for (var key in src) {
- dst[key] = src[key];
- }
- }
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
- module.exports = bufferEs6;
- } else {
- copyProps(bufferEs6, exports);
- exports.Buffer = SafeBuffer;
- }
- function SafeBuffer(arg, encodingOrOffset, length) {
- return Buffer(arg, encodingOrOffset, length);
- }
- copyProps(Buffer, SafeBuffer);
- SafeBuffer.from = function (arg, encodingOrOffset, length) {
- if (typeof arg === 'number') {
- throw new TypeError('Argument must not be a number');
- }
- return Buffer(arg, encodingOrOffset, length);
- };
- SafeBuffer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number');
- }
- var buf = Buffer(size);
- if (fill !== undefined) {
- if (typeof encoding === 'string') {
- buf.fill(fill, encoding);
- } else {
- buf.fill(fill);
- }
- } else {
- buf.fill(0);
- }
- return buf;
- };
- SafeBuffer.allocUnsafe = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number');
- }
- return Buffer(size);
- };
- SafeBuffer.allocUnsafeSlow = function (size) {
- if (typeof size !== 'number') {
- throw new TypeError('Argument must be a number');
- }
- return bufferEs6.SlowBuffer(size);
- };
- });
- var safeBuffer_1 = safeBuffer.Buffer;
- var path$2 = getCjsExportFromNamespace(_nodeResolve_empty$1);
- var convertSourceMap = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, 'commentRegex', {
- get: function getCommentRegex() {
- return /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
- }
- });
- Object.defineProperty(exports, 'mapFileCommentRegex', {
- get: function getMapFileCommentRegex() {
- return /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"`]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg;
- }
- });
- function decodeBase64(base64) {
- return safeBuffer.Buffer.from(base64, 'base64').toString();
- }
- function stripComment(sm) {
- return sm.split(',').pop();
- }
- function readFromFileMap(sm, dir) {
- var r = exports.mapFileCommentRegex.exec(sm);
- var filename = r[1] || r[2];
- var filepath = path$1.resolve(dir, filename);
- try {
- return path$2.readFileSync(filepath, 'utf8');
- } catch (e) {
- throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
- }
- }
- function Converter(sm, opts) {
- opts = opts || {};
- if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
- if (opts.hasComment) sm = stripComment(sm);
- if (opts.isEncoded) sm = decodeBase64(sm);
- if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
- this.sourcemap = sm;
- }
- Converter.prototype.toJSON = function (space) {
- return JSON.stringify(this.sourcemap, null, space);
- };
- Converter.prototype.toBase64 = function () {
- var json = this.toJSON();
- return safeBuffer.Buffer.from(json, 'utf8').toString('base64');
- };
- Converter.prototype.toComment = function (options) {
- var base64 = this.toBase64();
- var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
- return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
- };
- Converter.prototype.toObject = function () {
- return JSON.parse(this.toJSON());
- };
- Converter.prototype.addProperty = function (key, value) {
- if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
- return this.setProperty(key, value);
- };
- Converter.prototype.setProperty = function (key, value) {
- this.sourcemap[key] = value;
- return this;
- };
- Converter.prototype.getProperty = function (key) {
- return this.sourcemap[key];
- };
- exports.fromObject = function (obj) {
- return new Converter(obj);
- };
- exports.fromJSON = function (json) {
- return new Converter(json, {
- isJSON: true
- });
- };
- exports.fromBase64 = function (base64) {
- return new Converter(base64, {
- isEncoded: true
- });
- };
- exports.fromComment = function (comment) {
- comment = comment.replace(/^\/\*/g, '//').replace(/\*\/$/g, '');
- return new Converter(comment, {
- isEncoded: true,
- hasComment: true
- });
- };
- exports.fromMapFileComment = function (comment, dir) {
- return new Converter(comment, {
- commentFileDir: dir,
- isFileComment: true,
- isJSON: true
- });
- };
- exports.fromSource = function (content) {
- var m = content.match(exports.commentRegex);
- return m ? exports.fromComment(m.pop()) : null;
- };
- exports.fromMapFileSource = function (content, dir) {
- var m = content.match(exports.mapFileCommentRegex);
- return m ? exports.fromMapFileComment(m.pop(), dir) : null;
- };
- exports.removeComments = function (src) {
- return src.replace(exports.commentRegex, '');
- };
- exports.removeMapFileComments = function (src) {
- return src.replace(exports.mapFileCommentRegex, '');
- };
- exports.generateMapFileComment = function (file, options) {
- var data = 'sourceMappingURL=' + file;
- return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
- };
- });
- var convertSourceMap_1 = convertSourceMap.fromObject;
- var convertSourceMap_2 = convertSourceMap.fromJSON;
- var convertSourceMap_3 = convertSourceMap.fromBase64;
- var convertSourceMap_4 = convertSourceMap.fromComment;
- var convertSourceMap_5 = convertSourceMap.fromMapFileComment;
- var convertSourceMap_6 = convertSourceMap.fromSource;
- var convertSourceMap_7 = convertSourceMap.fromMapFileSource;
- var convertSourceMap_8 = convertSourceMap.removeComments;
- var convertSourceMap_9 = convertSourceMap.removeMapFileComments;
- var convertSourceMap_10 = convertSourceMap.generateMapFileComment;
- var pluginNameMap = {
- classProperties: {
- syntax: {
- name: "@babel/plugin-syntax-class-properties",
- url: "https://git.io/vb4yQ"
- },
- transform: {
- name: "@babel/plugin-proposal-class-properties",
- url: "https://git.io/vb4SL"
- }
- },
- decorators: {
- syntax: {
- name: "@babel/plugin-syntax-decorators",
- url: "https://git.io/vb4y9"
- },
- transform: {
- name: "@babel/plugin-proposal-decorators",
- url: "https://git.io/vb4ST"
- }
- },
- doExpressions: {
- syntax: {
- name: "@babel/plugin-syntax-do-expressions",
- url: "https://git.io/vb4yh"
- },
- transform: {
- name: "@babel/plugin-proposal-do-expressions",
- url: "https://git.io/vb4S3"
- }
- },
- dynamicImport: {
- syntax: {
- name: "@babel/plugin-syntax-dynamic-import",
- url: "https://git.io/vb4Sv"
- }
- },
- exportDefaultFrom: {
- syntax: {
- name: "@babel/plugin-syntax-export-default-from",
- url: "https://git.io/vb4SO"
- },
- transform: {
- name: "@babel/plugin-proposal-export-default-from",
- url: "https://git.io/vb4yH"
- }
- },
- exportNamespaceFrom: {
- syntax: {
- name: "@babel/plugin-syntax-export-namespace-from",
- url: "https://git.io/vb4Sf"
- },
- transform: {
- name: "@babel/plugin-proposal-export-namespace-from",
- url: "https://git.io/vb4SG"
- }
- },
- flow: {
- syntax: {
- name: "@babel/plugin-syntax-flow",
- url: "https://git.io/vb4yb"
- },
- transform: {
- name: "@babel/plugin-transform-flow-strip-types",
- url: "https://git.io/vb49g"
- }
- },
- functionBind: {
- syntax: {
- name: "@babel/plugin-syntax-function-bind",
- url: "https://git.io/vb4y7"
- },
- transform: {
- name: "@babel/plugin-proposal-function-bind",
- url: "https://git.io/vb4St"
- }
- },
- functionSent: {
- syntax: {
- name: "@babel/plugin-syntax-function-sent",
- url: "https://git.io/vb4yN"
- },
- transform: {
- name: "@babel/plugin-proposal-function-sent",
- url: "https://git.io/vb4SZ"
- }
- },
- importMeta: {
- syntax: {
- name: "@babel/plugin-syntax-import-meta",
- url: "https://git.io/vbKK6"
- }
- },
- jsx: {
- syntax: {
- name: "@babel/plugin-syntax-jsx",
- url: "https://git.io/vb4yA"
- },
- transform: {
- name: "@babel/plugin-transform-react-jsx",
- url: "https://git.io/vb4yd"
- }
- },
- logicalAssignment: {
- syntax: {
- name: "@babel/plugin-syntax-logical-assignment-operators",
- url: "https://git.io/vAlBp"
- },
- transform: {
- name: "@babel/plugin-proposal-logical-assignment-operators",
- url: "https://git.io/vAlRe"
- }
- },
- numericSeparator: {
- syntax: {
- name: "@babel/plugin-syntax-numeric-separator",
- url: "https://git.io/vb4Sq"
- },
- transform: {
- name: "@babel/plugin-proposal-numeric-separator",
- url: "https://git.io/vb4yS"
- }
- },
- optionalChaining: {
- syntax: {
- name: "@babel/plugin-syntax-optional-chaining",
- url: "https://git.io/vb4Sc"
- },
- transform: {
- name: "@babel/plugin-proposal-optional-chaining",
- url: "https://git.io/vb4Sk"
- }
- },
- pipelineOperator: {
- syntax: {
- name: "@babel/plugin-syntax-pipeline-operator",
- url: "https://git.io/vb4yj"
- },
- transform: {
- name: "@babel/plugin-proposal-pipeline-operator",
- url: "https://git.io/vb4SU"
- }
- },
- throwExpressions: {
- syntax: {
- name: "@babel/plugin-syntax-throw-expressions",
- url: "https://git.io/vb4SJ"
- },
- transform: {
- name: "@babel/plugin-proposal-throw-expressions",
- url: "https://git.io/vb4yF"
- }
- },
- typescript: {
- syntax: {
- name: "@babel/plugin-syntax-typescript",
- url: "https://git.io/vb4SC"
- },
- transform: {
- name: "@babel/plugin-transform-typescript",
- url: "https://git.io/vb4Sm"
- }
- },
- asyncGenerators: {
- syntax: {
- name: "@babel/plugin-syntax-async-generators",
- url: "https://git.io/vb4SY"
- },
- transform: {
- name: "@babel/plugin-proposal-async-generator-functions",
- url: "https://git.io/vb4yp"
- }
- },
- nullishCoalescingOperator: {
- syntax: {
- name: "@babel/plugin-syntax-nullish-coalescing-operator",
- url: "https://git.io/vb4yx"
- },
- transform: {
- name: "@babel/plugin-proposal-nullish-coalescing-operator",
- url: "https://git.io/vb4Se"
- }
- },
- objectRestSpread: {
- syntax: {
- name: "@babel/plugin-syntax-object-rest-spread",
- url: "https://git.io/vb4y5"
- },
- transform: {
- name: "@babel/plugin-proposal-object-rest-spread",
- url: "https://git.io/vb4Ss"
- }
- },
- optionalCatchBinding: {
- syntax: {
- name: "@babel/plugin-syntax-optional-catch-binding",
- url: "https://git.io/vb4Sn"
- },
- transform: {
- name: "@babel/plugin-proposal-optional-catch-binding",
- url: "https://git.io/vb4SI"
- }
- }
- };
- var getNameURLCombination = function getNameURLCombination(_ref) {
- var name = _ref.name,
- url = _ref.url;
- return name + " (" + url + ")";
- };
- function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {
- var helpMessage = "Support for the experimental syntax '" + missingPluginName + "' isn't currently enabled " + ("(" + loc.line + ":" + (loc.column + 1) + "):\n\n") + codeFrame;
- var pluginInfo = pluginNameMap[missingPluginName];
- if (pluginInfo) {
- var syntaxPlugin = pluginInfo.syntax,
- transformPlugin = pluginInfo.transform;
- if (syntaxPlugin) {
- if (transformPlugin) {
- var transformPluginInfo = getNameURLCombination(transformPlugin);
- helpMessage += "\n\nAdd " + transformPluginInfo + " to the 'plugins' section of your Babel config " + "to enable transformation.";
- } else {
- var syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
- helpMessage += "\n\nAdd " + syntaxPluginInfo + " to the 'plugins' section of your Babel config " + "to enable parsing.";
- }
- }
- }
- return helpMessage;
- }
- var _marked$5 = regenerator.mark(parser);
- function parser(pluginPasses, _ref, code) {
- var parserOpts, _ref$highlightCode, highlightCode, _ref$filename, filename, results, _iterator, _isArray, _i, _ref2, plugins, _iterator2, _isArray2, _i2, _ref3, plugin, parserOverride, ast, loc, missingPlugin, codeFrame;
- return regenerator.wrap(function parser$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- parserOpts = _ref.parserOpts, _ref$highlightCode = _ref.highlightCode, highlightCode = _ref$highlightCode === void 0 ? true : _ref$highlightCode, _ref$filename = _ref.filename, filename = _ref$filename === void 0 ? "unknown" : _ref$filename;
- _context.prev = 1;
- results = [];
- _iterator = pluginPasses, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
- case 4:
- if (!_isArray) {
- _context.next = 10;
- break;
- }
- if (!(_i >= _iterator.length)) {
- _context.next = 7;
- break;
- }
- return _context.abrupt("break", 33);
- case 7:
- _ref2 = _iterator[_i++];
- _context.next = 14;
- break;
- case 10:
- _i = _iterator.next();
- if (!_i.done) {
- _context.next = 13;
- break;
- }
- return _context.abrupt("break", 33);
- case 13:
- _ref2 = _i.value;
- case 14:
- plugins = _ref2;
- _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();
- case 16:
- if (!_isArray2) {
- _context.next = 22;
- break;
- }
- if (!(_i2 >= _iterator2.length)) {
- _context.next = 19;
- break;
- }
- return _context.abrupt("break", 31);
- case 19:
- _ref3 = _iterator2[_i2++];
- _context.next = 26;
- break;
- case 22:
- _i2 = _iterator2.next();
- if (!_i2.done) {
- _context.next = 25;
- break;
- }
- return _context.abrupt("break", 31);
- case 25:
- _ref3 = _i2.value;
- case 26:
- plugin = _ref3;
- parserOverride = plugin.parserOverride;
- if (parserOverride) {
- ast = parserOverride(code, parserOpts, parse$1);
- if (ast !== undefined) results.push(ast);
- }
- case 29:
- _context.next = 16;
- break;
- case 31:
- _context.next = 4;
- break;
- case 33:
- if (!(results.length === 0)) {
- _context.next = 37;
- break;
- }
- return _context.abrupt("return", parse$1(code, parserOpts));
- case 37:
- if (!(results.length === 1)) {
- _context.next = 42;
- break;
- }
- return _context.delegateYield([], "t0", 39);
- case 39:
- if (!(typeof results[0].then === "function")) {
- _context.next = 41;
- break;
- }
- throw new Error("You appear to be using an async parser plugin, " + "which your current version of Babel does not support. " + "If you're using a published plugin, you may need to upgrade " + "your @babel/core version.");
- case 41:
- return _context.abrupt("return", results[0]);
- case 42:
- throw new Error("More than one plugin attempted to override parsing.");
- case 45:
- _context.prev = 45;
- _context.t1 = _context["catch"](1);
- if (_context.t1.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") {
- _context.t1.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file.";
- }
- loc = _context.t1.loc, missingPlugin = _context.t1.missingPlugin;
- if (loc) {
- codeFrame = codeFrameColumns(code, {
- start: {
- line: loc.line,
- column: loc.column + 1
- }
- }, {
- highlightCode: highlightCode
- });
- if (missingPlugin) {
- _context.t1.message = filename + ": " + generateMissingPluginMessage(missingPlugin[0], loc, codeFrame);
- } else {
- _context.t1.message = filename + ": " + _context.t1.message + "\n\n" + codeFrame;
- }
- _context.t1.code = "BABEL_PARSE_ERROR";
- }
- throw _context.t1;
- case 51:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$5, null, [[1, 45]]);
- }
- var _marked$6 = regenerator.mark(normalizeFile);
- var debug$1 = browser$4("babel:transform:file");
- var LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000;
- function normalizeFile(pluginPasses, options, code, ast) {
- var inputMap, lastComment, _lastComment, match, inputMapContent;
- return regenerator.wrap(function normalizeFile$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- code = "" + (code || "");
- if (!ast) {
- _context.next = 11;
- break;
- }
- if (!(ast.type === "Program")) {
- _context.next = 6;
- break;
- }
- ast = File(ast, [], []);
- _context.next = 8;
- break;
- case 6:
- if (!(ast.type !== "File")) {
- _context.next = 8;
- break;
- }
- throw new Error("AST root must be a Program or File node");
- case 8:
- ast = cloneDeep_1(ast);
- _context.next = 13;
- break;
- case 11:
- return _context.delegateYield(parser(pluginPasses, options, code), "t0", 12);
- case 12:
- ast = _context.t0;
- case 13:
- inputMap = null;
- if (options.inputSourceMap !== false) {
- if (typeof options.inputSourceMap === "object") {
- inputMap = convertSourceMap.fromObject(options.inputSourceMap);
- }
- if (!inputMap) {
- lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);
- if (lastComment) {
- try {
- inputMap = convertSourceMap.fromComment(lastComment);
- } catch (err) {
- debug$1("discarding unknown inline input sourcemap", err);
- }
- }
- }
- if (!inputMap) {
- _lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);
- if (typeof options.filename === "string" && _lastComment) {
- try {
- match = EXTERNAL_SOURCEMAP_REGEX.exec(_lastComment);
- inputMapContent = fs.readFileSync(path$1.resolve(path$1.dirname(options.filename), match[1]));
- if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) {
- debug$1("skip merging input map > 1 MB");
- } else {
- inputMap = convertSourceMap.fromJSON(inputMapContent);
- }
- } catch (err) {
- debug$1("discarding unknown file input sourcemap", err);
- }
- } else if (_lastComment) {
- debug$1("discarding un-loadable file input sourcemap");
- }
- }
- }
- return _context.abrupt("return", new File$2(options, {
- code: code,
- ast: ast,
- inputMap: inputMap
- }));
- case 16:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$6);
- }
- var INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/;
- var EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/;
- function extractCommentsFromList(regex, comments, lastComment) {
- if (comments) {
- comments = comments.filter(function (_ref) {
- var value = _ref.value;
- if (regex.test(value)) {
- lastComment = value;
- return false;
- }
- return true;
- });
- }
- return [comments, lastComment];
- }
- function extractComments(regex, ast) {
- var lastComment = null;
- traverseFast(ast, function (node) {
- var _extractCommentsFromL = extractCommentsFromList(regex, node.leadingComments, lastComment);
- node.leadingComments = _extractCommentsFromL[0];
- lastComment = _extractCommentsFromL[1];
- var _extractCommentsFromL2 = extractCommentsFromList(regex, node.innerComments, lastComment);
- node.innerComments = _extractCommentsFromL2[0];
- lastComment = _extractCommentsFromL2[1];
- var _extractCommentsFromL3 = extractCommentsFromList(regex, node.trailingComments, lastComment);
- node.trailingComments = _extractCommentsFromL3[0];
- lastComment = _extractCommentsFromL3[1];
- });
- return lastComment;
- }
- function mergeSourceMap(inputMap, map) {
- var input = buildMappingData(inputMap);
- var output = buildMappingData(map);
- var mergedGenerator = new sourceMap.SourceMapGenerator();
- for (var _iterator = input.sources, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _ref3 = _ref,
- source = _ref3.source;
- if (typeof source.content === "string") {
- mergedGenerator.setSourceContent(source.path, source.content);
- }
- }
- if (output.sources.length === 1) {
- var defaultSource = output.sources[0];
- var insertedMappings = new Map();
- eachInputGeneratedRange(input, function (generated, original, source) {
- eachOverlappingGeneratedOutputRange(defaultSource, generated, function (item) {
- var key = makeMappingKey(item);
- if (insertedMappings.has(key)) return;
- insertedMappings.set(key, item);
- mergedGenerator.addMapping({
- source: source.path,
- original: {
- line: original.line,
- column: original.columnStart
- },
- generated: {
- line: item.line,
- column: item.columnStart
- },
- name: original.name
- });
- });
- });
- for (var _iterator2 = insertedMappings.values(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var item = _ref2;
- if (item.columnEnd === Infinity) {
- continue;
- }
- var clearItem = {
- line: item.line,
- columnStart: item.columnEnd
- };
- var key = makeMappingKey(clearItem);
- if (insertedMappings.has(key)) {
- continue;
- }
- mergedGenerator.addMapping({
- generated: {
- line: clearItem.line,
- column: clearItem.columnStart
- }
- });
- }
- }
- var result = mergedGenerator.toJSON();
- if (typeof input.sourceRoot === "string") {
- result.sourceRoot = input.sourceRoot;
- }
- return result;
- }
- function makeMappingKey(item) {
- return item.line + "/" + item.columnStart;
- }
- function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {
- var overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange);
- for (var _iterator3 = overlappingOriginal, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref4 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref4 = _i3.value;
- }
- var _ref5 = _ref4,
- generated = _ref5.generated;
- for (var _iterator4 = generated, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref6 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref6 = _i4.value;
- }
- var item = _ref6;
- callback(item);
- }
- }
- }
- function filterApplicableOriginalRanges(_ref7, _ref8) {
- var mappings = _ref7.mappings;
- var line = _ref8.line,
- columnStart = _ref8.columnStart,
- columnEnd = _ref8.columnEnd;
- return filterSortedArray(mappings, function (_ref9) {
- var outOriginal = _ref9.original;
- if (line > outOriginal.line) return -1;
- if (line < outOriginal.line) return 1;
- if (columnStart >= outOriginal.columnEnd) return -1;
- if (columnEnd <= outOriginal.columnStart) return 1;
- return 0;
- });
- }
- function eachInputGeneratedRange(map, callback) {
- for (var _iterator5 = map.sources, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref10;
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref10 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref10 = _i5.value;
- }
- var _ref11 = _ref10,
- source = _ref11.source,
- mappings = _ref11.mappings;
- for (var _iterator6 = mappings, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref12;
- if (_isArray6) {
- if (_i6 >= _iterator6.length) break;
- _ref12 = _iterator6[_i6++];
- } else {
- _i6 = _iterator6.next();
- if (_i6.done) break;
- _ref12 = _i6.value;
- }
- var _ref13 = _ref12,
- original = _ref13.original,
- generated = _ref13.generated;
- for (var _iterator7 = generated, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
- var _ref14;
- if (_isArray7) {
- if (_i7 >= _iterator7.length) break;
- _ref14 = _iterator7[_i7++];
- } else {
- _i7 = _iterator7.next();
- if (_i7.done) break;
- _ref14 = _i7.value;
- }
- var item = _ref14;
- callback(item, original, source);
- }
- }
- }
- }
- function buildMappingData(map) {
- var consumer = new sourceMap.SourceMapConsumer(Object.assign({}, map, {
- sourceRoot: null
- }));
- var sources = new Map();
- var mappings = new Map();
- var last = null;
- consumer.computeColumnSpans();
- consumer.eachMapping(function (m) {
- if (m.originalLine === null) return;
- var source = sources.get(m.source);
- if (!source) {
- source = {
- path: m.source,
- content: consumer.sourceContentFor(m.source, true)
- };
- sources.set(m.source, source);
- }
- var sourceData = mappings.get(source);
- if (!sourceData) {
- sourceData = {
- source: source,
- mappings: []
- };
- mappings.set(source, sourceData);
- }
- var obj = {
- line: m.originalLine,
- columnStart: m.originalColumn,
- columnEnd: Infinity,
- name: m.name
- };
- if (last && last.source === source && last.mapping.line === m.originalLine) {
- last.mapping.columnEnd = m.originalColumn;
- }
- last = {
- source: source,
- mapping: obj
- };
- sourceData.mappings.push({
- original: obj,
- generated: consumer.allGeneratedPositionsFor({
- source: m.source,
- line: m.originalLine,
- column: m.originalColumn
- }).map(function (item) {
- return {
- line: item.line,
- columnStart: item.column,
- columnEnd: item.lastColumn + 1
- };
- })
- });
- }, null, sourceMap.SourceMapConsumer.ORIGINAL_ORDER);
- return {
- file: map.file,
- sourceRoot: map.sourceRoot,
- sources: Array.from(mappings.values())
- };
- }
- function findInsertionLocation(array, callback) {
- var left = 0;
- var right = array.length;
- while (left < right) {
- var mid = Math.floor((left + right) / 2);
- var item = array[mid];
- var result = callback(item);
- if (result === 0) {
- left = mid;
- break;
- }
- if (result >= 0) {
- right = mid;
- } else {
- left = mid + 1;
- }
- }
- var i = left;
- if (i < array.length) {
- while (i >= 0 && callback(array[i]) >= 0) {
- i--;
- }
- return i + 1;
- }
- return i;
- }
- function filterSortedArray(array, callback) {
- var start = findInsertionLocation(array, callback);
- var results = [];
- for (var i = start; i < array.length && callback(array[i]) === 0; i++) {
- results.push(array[i]);
- }
- return results;
- }
- function generateCode$1(pluginPasses, file) {
- var opts = file.opts,
- ast = file.ast,
- code = file.code,
- inputMap = file.inputMap;
- var results = [];
- for (var _iterator = pluginPasses, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var plugins = _ref;
- for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var plugin = _ref2;
- var generatorOverride = plugin.generatorOverride;
- if (generatorOverride) {
- var _result2 = generatorOverride(ast, opts.generatorOpts, code, generateCode);
- if (_result2 !== undefined) results.push(_result2);
- }
- }
- }
- var result;
- if (results.length === 0) {
- result = generateCode(ast, opts.generatorOpts, code);
- } else if (results.length === 1) {
- result = results[0];
- if (typeof result.then === "function") {
- throw new Error("You appear to be using an async codegen plugin, " + "which your current version of Babel does not support. " + "If you're using a published plugin, " + "you may need to upgrade your @babel/core version.");
- }
- } else {
- throw new Error("More than one plugin attempted to override codegen.");
- }
- var _result = result,
- outputCode = _result.code,
- outputMap = _result.map;
- if (outputMap && inputMap) {
- outputMap = mergeSourceMap(inputMap.toObject(), outputMap);
- }
- if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
- outputCode += "\n" + convertSourceMap.fromObject(outputMap).toComment();
- }
- if (opts.sourceMaps === "inline") {
- outputMap = null;
- }
- return {
- outputCode: outputCode,
- outputMap: outputMap
- };
- }
- var _marked$7 = regenerator.mark(run),
- _marked2$5 = regenerator.mark(transformFile);
- function run(config, code, ast) {
- var file, opts, _opts$filename, outputCode, outputMap, _generateCode, _opts$filename2;
- return regenerator.wrap(function run$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(normalizeFile(config.passes, normalizeOptions$2(config), code, ast), "t0", 1);
- case 1:
- file = _context.t0;
- opts = file.opts;
- _context.prev = 3;
- return _context.delegateYield(transformFile(file, config.passes), "t1", 5);
- case 5:
- _context.next = 12;
- break;
- case 7:
- _context.prev = 7;
- _context.t2 = _context["catch"](3);
- _context.t2.message = ((_opts$filename = opts.filename) != null ? _opts$filename : "unknown") + ": " + _context.t2.message;
- if (!_context.t2.code) {
- _context.t2.code = "BABEL_TRANSFORM_ERROR";
- }
- throw _context.t2;
- case 12:
- _context.prev = 12;
- if (opts.code !== false) {
- _generateCode = generateCode$1(config.passes, file);
- outputCode = _generateCode.outputCode;
- outputMap = _generateCode.outputMap;
- }
- _context.next = 21;
- break;
- case 16:
- _context.prev = 16;
- _context.t3 = _context["catch"](12);
- _context.t3.message = ((_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown") + ": " + _context.t3.message;
- if (!_context.t3.code) {
- _context.t3.code = "BABEL_GENERATE_ERROR";
- }
- throw _context.t3;
- case 21:
- return _context.abrupt("return", {
- metadata: file.metadata,
- options: opts,
- ast: opts.ast === true ? file.ast : null,
- code: outputCode === undefined ? null : outputCode,
- map: outputMap === undefined ? null : outputMap,
- sourceType: file.ast.program.sourceType
- });
- case 22:
- case "end":
- return _context.stop();
- }
- }
- }, _marked$7, null, [[3, 7], [12, 16]]);
- }
- function transformFile(file, pluginPasses) {
- var _iterator, _isArray, _i, _ref, pluginPairs, passPairs, passes, visitors, _iterator2, _isArray2, _i2, _ref2, plugin, pass, _i3, _passPairs, _passPairs$_i, _plugin, _pass, fn, result, visitor, _i4, _passPairs2, _passPairs2$_i, _plugin2, _pass2, _fn, _result;
- return regenerator.wrap(function transformFile$(_context2) {
- while (1) {
- switch (_context2.prev = _context2.next) {
- case 0:
- _iterator = pluginPasses, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();
- case 1:
- if (!_isArray) {
- _context2.next = 7;
- break;
- }
- if (!(_i >= _iterator.length)) {
- _context2.next = 4;
- break;
- }
- return _context2.abrupt("break", 61);
- case 4:
- _ref = _iterator[_i++];
- _context2.next = 11;
- break;
- case 7:
- _i = _iterator.next();
- if (!_i.done) {
- _context2.next = 10;
- break;
- }
- return _context2.abrupt("break", 61);
- case 10:
- _ref = _i.value;
- case 11:
- pluginPairs = _ref;
- passPairs = [];
- passes = [];
- visitors = [];
- _iterator2 = pluginPairs.concat([loadBlockHoistPlugin()]), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();
- case 16:
- if (!_isArray2) {
- _context2.next = 22;
- break;
- }
- if (!(_i2 >= _iterator2.length)) {
- _context2.next = 19;
- break;
- }
- return _context2.abrupt("break", 33);
- case 19:
- _ref2 = _iterator2[_i2++];
- _context2.next = 26;
- break;
- case 22:
- _i2 = _iterator2.next();
- if (!_i2.done) {
- _context2.next = 25;
- break;
- }
- return _context2.abrupt("break", 33);
- case 25:
- _ref2 = _i2.value;
- case 26:
- plugin = _ref2;
- pass = new PluginPass(file, plugin.key, plugin.options);
- passPairs.push([plugin, pass]);
- passes.push(pass);
- visitors.push(plugin.visitor);
- case 31:
- _context2.next = 16;
- break;
- case 33:
- _i3 = 0, _passPairs = passPairs;
- case 34:
- if (!(_i3 < _passPairs.length)) {
- _context2.next = 45;
- break;
- }
- _passPairs$_i = _passPairs[_i3], _plugin = _passPairs$_i[0], _pass = _passPairs$_i[1];
- fn = _plugin.pre;
- if (!fn) {
- _context2.next = 42;
- break;
- }
- result = fn.call(_pass, file);
- return _context2.delegateYield([], "t0", 40);
- case 40:
- if (!isThenable$1(result)) {
- _context2.next = 42;
- break;
- }
- throw new Error("You appear to be using an plugin with an async .pre, " + "which your current version of Babel does not support. " + "If you're using a published plugin, you may need to upgrade " + "your @babel/core version.");
- case 42:
- _i3++;
- _context2.next = 34;
- break;
- case 45:
- visitor = traverse$1.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
- traverse$1(file.ast, visitor, file.scope);
- _i4 = 0, _passPairs2 = passPairs;
- case 48:
- if (!(_i4 < _passPairs2.length)) {
- _context2.next = 59;
- break;
- }
- _passPairs2$_i = _passPairs2[_i4], _plugin2 = _passPairs2$_i[0], _pass2 = _passPairs2$_i[1];
- _fn = _plugin2.post;
- if (!_fn) {
- _context2.next = 56;
- break;
- }
- _result = _fn.call(_pass2, file);
- return _context2.delegateYield([], "t1", 54);
- case 54:
- if (!isThenable$1(_result)) {
- _context2.next = 56;
- break;
- }
- throw new Error("You appear to be using an plugin with an async .post, " + "which your current version of Babel does not support. " + "If you're using a published plugin, you may need to upgrade " + "your @babel/core version.");
- case 56:
- _i4++;
- _context2.next = 48;
- break;
- case 59:
- _context2.next = 1;
- break;
- case 61:
- case "end":
- return _context2.stop();
- }
- }
- }, _marked2$5);
- }
- function isThenable$1(val) {
- return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
- }
- var transformRunner = gensync(regenerator.mark(function transform(code, opts) {
- var config;
- return regenerator.wrap(function transform$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(loadConfig$1(opts), "t0", 1);
- case 1:
- config = _context.t0;
- if (!(config === null)) {
- _context.next = 4;
- break;
- }
- return _context.abrupt("return", null);
- case 4:
- return _context.delegateYield(run(config, code), "t1", 5);
- case 5:
- return _context.abrupt("return", _context.t1);
- case 6:
- case "end":
- return _context.stop();
- }
- }
- }, transform);
- }));
- var transform = function transform(code, opts, callback) {
- if (typeof opts === "function") {
- callback = opts;
- opts = undefined;
- }
- if (callback === undefined) return transformRunner.sync(code, opts);
- transformRunner.errback(code, opts, callback);
- };
- var transformSync = transformRunner.sync;
- var transformAsync = transformRunner.async;
- var transformFile$1 = function transformFile(filename, opts, callback) {
- if (typeof opts === "function") {
- callback = opts;
- }
- callback(new Error("Transforming files is not supported in browsers"), null);
- };
- function transformFileSync() {
- throw new Error("Transforming files is not supported in browsers");
- }
- function transformFileAsync() {
- return Promise.reject(new Error("Transforming files is not supported in browsers"));
- }
- var transformFromAstRunner = gensync(regenerator.mark(function _callee(ast, code, opts) {
- var config;
- return regenerator.wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(loadConfig$1(opts), "t0", 1);
- case 1:
- config = _context.t0;
- if (!(config === null)) {
- _context.next = 4;
- break;
- }
- return _context.abrupt("return", null);
- case 4:
- if (ast) {
- _context.next = 6;
- break;
- }
- throw new Error("No AST given");
- case 6:
- return _context.delegateYield(run(config, code, ast), "t1", 7);
- case 7:
- return _context.abrupt("return", _context.t1);
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- var transformFromAst = function transformFromAst(ast, code, opts, callback) {
- if (typeof opts === "function") {
- callback = opts;
- opts = undefined;
- }
- if (callback === undefined) {
- return transformFromAstRunner.sync(ast, code, opts);
- }
- transformFromAstRunner.errback(ast, code, opts, callback);
- };
- var transformFromAstSync = transformFromAstRunner.sync;
- var transformFromAstAsync = transformFromAstRunner.async;
- var parseRunner = gensync(regenerator.mark(function parse(code, opts) {
- var config;
- return regenerator.wrap(function parse$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- return _context.delegateYield(loadConfig$1(opts), "t0", 1);
- case 1:
- config = _context.t0;
- if (!(config === null)) {
- _context.next = 4;
- break;
- }
- return _context.abrupt("return", null);
- case 4:
- return _context.delegateYield(parser(config.passes, normalizeOptions$2(config), code), "t1", 5);
- case 5:
- return _context.abrupt("return", _context.t1);
- case 6:
- case "end":
- return _context.stop();
- }
- }
- }, parse);
- }));
- var parse$3 = function parse(code, opts, callback) {
- if (typeof opts === "function") {
- callback = opts;
- opts = undefined;
- }
- if (callback === undefined) return parseRunner.sync(code, opts);
- parseRunner.errback(code, opts, callback);
- };
- var parseSync = parseRunner.sync;
- var parseAsync = parseRunner.async;
- var DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs"]);
- var OptionManager = function () {
- function OptionManager() {}
- var _proto = OptionManager.prototype;
- _proto.init = function init(opts) {
- return loadOptions(opts);
- };
- return OptionManager;
- }();
- function Plugin$1(alias) {
- throw new Error("The (" + alias + ") Babel 5 plugin is being run with an unsupported Babel version.");
- }
- function declare(builder) {
- return function (api, options, dirname) {
- if (!api.assertVersion) {
- api = Object.assign(copyApiObject(api), {
- assertVersion: function assertVersion(range) {
- throwVersionError(range, api.version);
- }
- });
- }
- return builder(api, options || {}, dirname);
- };
- }
- function copyApiObject(api) {
- var proto = null;
- if (typeof api.version === "string" && /^7\./.test(api.version)) {
- proto = Object.getPrototypeOf(api);
- if (proto && (!has$4(proto, "version") || !has$4(proto, "transform") || !has$4(proto, "template") || !has$4(proto, "types"))) {
- proto = null;
- }
- }
- return Object.assign({}, proto, {}, api);
- }
- function has$4(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
- }
- function throwVersionError(range, version) {
- if (typeof range === "number") {
- if (!Number.isInteger(range)) {
- throw new Error("Expected string or integer value.");
- }
- range = "^" + range + ".0.0-0";
- }
- if (typeof range !== "string") {
- throw new Error("Expected string or integer value.");
- }
- var limit = Error.stackTraceLimit;
- if (typeof limit === "number" && limit < 25) {
- Error.stackTraceLimit = 25;
- }
- var err;
- if (version.slice(0, 2) === "7.") {
- err = new Error("Requires Babel \"^7.0.0-beta.41\", but was loaded with \"" + version + "\". " + "You'll need to update your @babel/core version.");
- } else {
- err = new Error("Requires Babel \"" + range + "\", but was loaded with \"" + version + "\". " + "If you are sure you have a compatible version of @babel/core, " + "it is likely that something in your build process is loading the " + "wrong version. Inspect the stack trace of this error to look for " + "the first entry that doesn't mention \"@babel/core\" or \"babel-core\" " + "to see what is calling Babel.");
- }
- if (typeof limit === "number") {
- Error.stackTraceLimit = limit;
- }
- throw Object.assign(err, {
- code: "BABEL_VERSION_UNSUPPORTED",
- version: version,
- range: range
- });
- }
- var src = /*#__PURE__*/Object.freeze({
- __proto__: null,
- declare: declare
- });
- var externalHelpers = declare(function (api, options) {
- api.assertVersion(7);
- var _options$helperVersio = options.helperVersion,
- helperVersion = _options$helperVersio === void 0 ? "7.0.0-beta.0" : _options$helperVersio,
- _options$whitelist = options.whitelist,
- whitelist = _options$whitelist === void 0 ? false : _options$whitelist;
- if (whitelist !== false && (!Array.isArray(whitelist) || whitelist.some(function (w) {
- return typeof w !== "string";
- }))) {
- throw new Error(".whitelist must be undefined, false, or an array of strings");
- }
- var helperWhitelist = whitelist ? new Set(whitelist) : null;
- return {
- name: "external-helpers",
- pre: function pre(file) {
- file.set("helperGenerator", function (name) {
- if (file.availableHelper && !file.availableHelper(name, helperVersion)) {
- return;
- }
- if (helperWhitelist && !helperWhitelist.has(name)) return;
- return MemberExpression(Identifier("babelHelpers"), Identifier(name));
- });
- }
- };
- });
- var _helperPluginUtils = getCjsExportFromNamespace(src);
- var lib = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-async-generators",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("asyncGenerators");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxAsyncGenerators = unwrapExports(lib);
- var syntaxClassProperties = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-class-properties",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("classProperties", "classPrivateProperties", "classPrivateMethods");
- }
- };
- });
- var syntaxDecorators = declare(function (api, options) {
- api.assertVersion(7);
- var _options$legacy = options.legacy,
- legacy = _options$legacy === void 0 ? false : _options$legacy;
- if (typeof legacy !== "boolean") {
- throw new Error("'legacy' must be a boolean.");
- }
- var decoratorsBeforeExport = options.decoratorsBeforeExport;
- if (decoratorsBeforeExport === undefined) {
- if (!legacy) {
- throw new Error("The '@babel/plugin-syntax-decorators' plugin requires a" + " 'decoratorsBeforeExport' option, whose value must be a boolean." + " If you want to use the legacy decorators semantics, you can set" + " the 'legacy: true' option.");
- }
- } else {
- if (legacy) {
- throw new Error("'decoratorsBeforeExport' can't be used with legacy decorators.");
- }
- if (typeof decoratorsBeforeExport !== "boolean") {
- throw new Error("'decoratorsBeforeExport' must be a boolean.");
- }
- }
- return {
- name: "syntax-decorators",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push(legacy ? "decorators-legacy" : ["decorators", {
- decoratorsBeforeExport: decoratorsBeforeExport
- }]);
- }
- };
- });
- var syntaxDoExpressions = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-do-expressions",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("doExpressions");
- }
- };
- });
- var lib$1 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-dynamic-import",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("dynamicImport");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxDynamicImport = unwrapExports(lib$1);
- var syntaxExportDefaultFrom = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-export-default-from",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("exportDefaultFrom");
- }
- };
- });
- var syntaxExportNamespaceFrom = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-export-namespace-from",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("exportNamespaceFrom");
- }
- };
- });
- var syntaxFlow = declare(function (api, options) {
- api.assertVersion(7);
- var all = options.all,
- enums = options.enums;
- if (typeof all !== "boolean" && typeof all !== "undefined") {
- throw new Error(".all must be a boolean, or undefined");
- }
- if (typeof enums !== "boolean" && typeof enums !== "undefined") {
- throw new Error(".enums must be a boolean, or undefined");
- }
- return {
- name: "syntax-flow",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- if (parserOpts.plugins.some(function (p) {
- return (Array.isArray(p) ? p[0] : p) === "typescript";
- })) {
- return;
- }
- parserOpts.plugins.push(["flow", {
- all: all,
- enums: enums
- }]);
- }
- };
- });
- var syntaxFunctionBind = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-function-bind",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("functionBind");
- }
- };
- });
- var syntaxFunctionSent = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-function-sent",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("functionSent");
- }
- };
- });
- var syntaxImportMeta = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-import-meta",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("importMeta");
- }
- };
- });
- var syntaxJsx = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-jsx",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- if (parserOpts.plugins.some(function (p) {
- return (Array.isArray(p) ? p[0] : p) === "typescript";
- })) {
- return;
- }
- parserOpts.plugins.push("jsx");
- }
- };
- });
- var lib$2 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-object-rest-spread",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("objectRestSpread");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxObjectRestSpread = unwrapExports(lib$2);
- var lib$3 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-optional-catch-binding",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("optionalCatchBinding");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxOptionalCatchBinding = unwrapExports(lib$3);
- var proposals = ["minimal", "smart", "fsharp"];
- var syntaxPipelineOperator = declare(function (api, _ref) {
- var proposal = _ref.proposal;
- api.assertVersion(7);
- if (typeof proposal !== "string" || !proposals.includes(proposal)) {
- throw new Error("The pipeline operator plugin requires a 'proposal' option." + "'proposal' must be one of: " + proposals.join(", ") + ". More details: https://babeljs.io/docs/en/next/babel-plugin-proposal-pipeline-operator");
- }
- return {
- name: "syntax-pipeline-operator",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push(["pipelineOperator", {
- proposal: proposal
- }]);
- }
- };
- });
- var syntaxTopLevelAwait = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-top-level-await",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("topLevelAwait");
- }
- };
- });
- function removePlugin(plugins, name) {
- var indices = [];
- plugins.forEach(function (plugin, i) {
- var n = Array.isArray(plugin) ? plugin[0] : plugin;
- if (n === name) {
- indices.unshift(i);
- }
- });
- for (var _i = 0, _indices = indices; _i < _indices.length; _i++) {
- var i = _indices[_i];
- plugins.splice(i, 1);
- }
- }
- var syntaxTypescript = declare(function (api, _ref) {
- var isTSX = _ref.isTSX;
- api.assertVersion(7);
- return {
- name: "syntax-typescript",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- var plugins = parserOpts.plugins;
- removePlugin(plugins, "flow");
- removePlugin(plugins, "jsx");
- parserOpts.plugins.push("typescript", "classProperties", "objectRestSpread");
- if (isTSX) {
- parserOpts.plugins.push("jsx");
- }
- }
- };
- });
- var buildAnonymousExpressionWrapper = template.expression("\n (function () {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })()\n");
- var buildNamedExpressionWrapper = template.expression("\n (function () {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })()\n");
- var buildDeclarationWrapper = template("\n function NAME(PARAMS) { return REF.apply(this, arguments); }\n function REF() {\n REF = FUNCTION;\n return REF.apply(this, arguments);\n }\n");
- function classOrObjectMethod(path, callId) {
- var node = path.node;
- var body = node.body;
- var container = FunctionExpression(null, [], BlockStatement(body.body), true);
- body.body = [ReturnStatement(CallExpression(CallExpression(callId, [container]), []))];
- node.async = false;
- node.generator = false;
- path.get("body.body.0.argument.callee.arguments.0").unwrapFunctionEnvironment();
- }
- function plainFunction(path, callId) {
- var node = path.node;
- var isDeclaration = path.isFunctionDeclaration();
- var functionId = node.id;
- var wrapper = isDeclaration ? buildDeclarationWrapper : functionId ? buildNamedExpressionWrapper : buildAnonymousExpressionWrapper;
- if (path.isArrowFunctionExpression()) {
- path.arrowFunctionToExpression();
- }
- node.id = null;
- if (isDeclaration) {
- node.type = "FunctionExpression";
- }
- var built = CallExpression(callId, [node]);
- var container = wrapper({
- NAME: functionId || null,
- REF: path.scope.generateUidIdentifier(functionId ? functionId.name : "ref"),
- FUNCTION: built,
- PARAMS: node.params.reduce(function (acc, param) {
- acc.done = acc.done || isAssignmentPattern(param) || isRestElement(param);
- if (!acc.done) {
- acc.params.push(path.scope.generateUidIdentifier("x"));
- }
- return acc;
- }, {
- params: [],
- done: false
- }).params
- });
- if (isDeclaration) {
- path.replaceWith(container[0]);
- path.insertAfter(container[1]);
- } else {
- var retFunction = container.callee.body.body[1].argument;
- if (!functionId) {
- nameFunction({
- node: retFunction,
- parent: path.parent,
- scope: path.scope
- });
- }
- if (!retFunction || retFunction.id || node.params.length) {
- path.replaceWith(container);
- } else {
- path.replaceWith(built);
- }
- }
- }
- function wrapFunction(path, callId) {
- if (path.isClassMethod() || path.isObjectMethod()) {
- classOrObjectMethod(path, callId);
- } else {
- plainFunction(path, callId);
- }
- }
- var PURE_ANNOTATION = "#__PURE__";
- var isPureAnnotated = function isPureAnnotated(_ref) {
- var leadingComments = _ref.leadingComments;
- return !!leadingComments && leadingComments.some(function (comment) {
- return /[@#]__PURE__/.test(comment.value);
- });
- };
- function annotateAsPure(pathOrNode) {
- var node = pathOrNode.node || pathOrNode;
- if (isPureAnnotated(node)) {
- return;
- }
- addComment(node, "leading", PURE_ANNOTATION);
- }
- var awaitVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- AwaitExpression: function AwaitExpression(path, _ref) {
- var wrapAwait = _ref.wrapAwait;
- var argument = path.get("argument");
- if (path.parentPath.isYieldExpression()) {
- path.replaceWith(argument.node);
- return;
- }
- path.replaceWith(YieldExpression(wrapAwait ? CallExpression(cloneNode(wrapAwait), [argument.node]) : argument.node));
- }
- };
- function remapAsyncToGenerator (path, helpers) {
- path.traverse(awaitVisitor, {
- wrapAwait: helpers.wrapAwait
- });
- var isIIFE = checkIsIIFE(path);
- path.node.async = false;
- path.node.generator = true;
- wrapFunction(path, cloneNode(helpers.wrapAsync));
- var isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();
- if (!isProperty && !isIIFE && path.isExpression()) {
- annotateAsPure(path);
- }
- function checkIsIIFE(path) {
- if (path.parentPath.isCallExpression({
- callee: path.node
- })) {
- return true;
- }
- var parentPath = path.parentPath;
- if (parentPath.isMemberExpression() && isIdentifier(parentPath.node.property, {
- name: "bind"
- })) {
- var bindCall = parentPath.parentPath;
- return bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({
- callee: bindCall.node
- });
- }
- return false;
- }
- }
- var lib$4 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-async-generators",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("asyncGenerators");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxAsyncGenerators$1 = unwrapExports(lib$4);
- var buildForAwait = template("\n async function wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = await ITERATOR_KEY.next(),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = await STEP_KEY.value,\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n await ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n");
- function rewriteForAwait (path, _ref) {
- var getAsyncIterator = _ref.getAsyncIterator;
- var node = path.node,
- scope = path.scope,
- parent = path.parent;
- var stepKey = scope.generateUidIdentifier("step");
- var stepValue = scope.generateUidIdentifier("value");
- var left = node.left;
- var declar;
- if (isIdentifier(left) || isPattern(left) || isMemberExpression(left)) {
- declar = ExpressionStatement(AssignmentExpression("=", left, stepValue));
- } else if (isVariableDeclaration(left)) {
- declar = VariableDeclaration(left.kind, [VariableDeclarator(left.declarations[0].id, stepValue)]);
- }
- var template = buildForAwait({
- ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"),
- ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"),
- ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"),
- ITERATOR_KEY: scope.generateUidIdentifier("iterator"),
- GET_ITERATOR: getAsyncIterator,
- OBJECT: node.right,
- STEP_VALUE: stepValue,
- STEP_KEY: stepKey
- });
- template = template.body.body;
- var isLabeledParent = isLabeledStatement(parent);
- var tryBody = template[3].block.body;
- var loop = tryBody[0];
- if (isLabeledParent) {
- tryBody[0] = LabeledStatement(parent.label, loop);
- }
- return {
- replaceParent: isLabeledParent,
- node: template,
- declar: declar,
- loop: loop
- };
- }
- var proposalAsyncGeneratorFunctions = declare(function (api) {
- api.assertVersion(7);
- var yieldStarVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- YieldExpression: function YieldExpression(_ref, state) {
- var node = _ref.node;
- if (!node.delegate) return;
- var callee = state.addHelper("asyncGeneratorDelegate");
- node.argument = CallExpression(callee, [CallExpression(state.addHelper("asyncIterator"), [node.argument]), state.addHelper("awaitAsyncGenerator")]);
- }
- };
- var forAwaitVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- ForOfStatement: function ForOfStatement(path, _ref2) {
- var file = _ref2.file;
- var node = path.node;
- if (!node["await"]) return;
- var build = rewriteForAwait(path, {
- getAsyncIterator: file.addHelper("asyncIterator")
- });
- var declar = build.declar,
- loop = build.loop;
- var block = loop.body;
- path.ensureBlock();
- if (declar) {
- block.body.push(declar);
- }
- block.body = block.body.concat(node.body.body);
- inherits(loop, node);
- inherits(loop.body, node.body);
- if (build.replaceParent) {
- path.parentPath.replaceWithMultiple(build.node);
- } else {
- path.replaceWithMultiple(build.node);
- }
- }
- };
- var visitor = {
- Function: function Function(path, state) {
- if (!path.node.async) return;
- path.traverse(forAwaitVisitor, state);
- if (!path.node.generator) return;
- path.traverse(yieldStarVisitor, state);
- remapAsyncToGenerator(path, {
- wrapAsync: state.addHelper("wrapAsyncGenerator"),
- wrapAwait: state.addHelper("awaitAsyncGenerator")
- });
- }
- };
- return {
- name: "proposal-async-generator-functions",
- inherits: syntaxAsyncGenerators$1,
- visitor: {
- Program: function Program(path, state) {
- path.traverse(visitor, state);
- }
- }
- };
- });
- var AssignmentMemoiser = function () {
- function AssignmentMemoiser() {
- this._map = new WeakMap();
- }
- var _proto = AssignmentMemoiser.prototype;
- _proto.has = function has(key) {
- return this._map.has(key);
- };
- _proto.get = function get(key) {
- if (!this.has(key)) return;
- var record = this._map.get(key);
- var value = record.value;
- record.count--;
- if (record.count === 0) {
- return AssignmentExpression("=", value, key);
- }
- return value;
- };
- _proto.set = function set(key, value, count) {
- return this._map.set(key, {
- count: count,
- value: value
- });
- };
- return AssignmentMemoiser;
- }();
- var handle = {
- memoise: function memoise() {},
- handle: function handle(member) {
- var node = member.node,
- parent = member.parent,
- parentPath = member.parentPath;
- if (parentPath.isUpdateExpression({
- argument: node
- })) {
- var operator = parent.operator,
- prefix = parent.prefix;
- this.memoise(member, 2);
- var value = BinaryExpression(operator[0], UnaryExpression("+", this.get(member)), NumericLiteral(1));
- if (prefix) {
- parentPath.replaceWith(this.set(member, value));
- } else {
- var scope = member.scope;
- var ref = scope.generateUidIdentifierBasedOnNode(node);
- scope.push({
- id: ref
- });
- value.left = AssignmentExpression("=", cloneNode(ref), value.left);
- parentPath.replaceWith(SequenceExpression([this.set(member, value), cloneNode(ref)]));
- }
- return;
- }
- if (parentPath.isAssignmentExpression({
- left: node
- })) {
- var _operator = parent.operator,
- right = parent.right;
- var _value = right;
- if (_operator !== "=") {
- this.memoise(member, 2);
- _value = BinaryExpression(_operator.slice(0, -1), this.get(member), _value);
- }
- parentPath.replaceWith(this.set(member, _value));
- return;
- }
- if (parentPath.isCallExpression({
- callee: node
- })) {
- var args = parent.arguments;
- parentPath.replaceWith(this.call(member, args));
- return;
- }
- if (parentPath.isObjectProperty({
- value: node
- }) && parentPath.parentPath.isObjectPattern() || parentPath.isAssignmentPattern({
- left: node
- }) && parentPath.parentPath.isObjectProperty({
- value: parent
- }) && parentPath.parentPath.parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isAssignmentPattern({
- left: node
- }) && parentPath.parentPath.isArrayPattern() || parentPath.isRestElement()) {
- member.replaceWith(this.destructureSet(member));
- return;
- }
- member.replaceWith(this.get(member));
- }
- };
- function memberExpressionToFunctions(path, visitor, state) {
- path.traverse(visitor, Object.assign({}, handle, {}, state, {
- memoiser: new AssignmentMemoiser()
- }));
- }
- function optimiseCall (callee, thisNode, args) {
- if (args.length === 1 && isSpreadElement(args[0]) && isIdentifier(args[0].argument, {
- name: "arguments"
- })) {
- return CallExpression(MemberExpression(callee, Identifier("apply")), [thisNode, args[0].argument]);
- } else {
- return CallExpression(MemberExpression(callee, Identifier("call")), [thisNode].concat(args));
- }
- }
- function getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {
- objectRef = cloneNode(objectRef);
- var targetRef = isStatic || isPrivateMethod ? objectRef : MemberExpression(objectRef, Identifier("prototype"));
- return CallExpression(file.addHelper("getPrototypeOf"), [targetRef]);
- }
- function skipAllButComputedKey(path) {
- if (!path.node.computed) {
- path.skip();
- return;
- }
- var keys = VISITOR_KEYS[path.type];
- for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var key = _ref;
- if (key !== "key") path.skipKey(key);
- }
- }
- var environmentVisitor = {
- TypeAnnotation: function TypeAnnotation(path) {
- path.skip();
- },
- Function: function Function(path) {
- if (path.isMethod()) return;
- if (path.isArrowFunctionExpression()) return;
- path.skip();
- },
- "Method|ClassProperty|ClassPrivateProperty": function MethodClassPropertyClassPrivateProperty(path) {
- skipAllButComputedKey(path);
- }
- };
- var visitor$1 = traverse$1.visitors.merge([environmentVisitor, {
- Super: function Super(path, state) {
- var node = path.node,
- parentPath = path.parentPath;
- if (!parentPath.isMemberExpression({
- object: node
- })) return;
- state.handle(parentPath);
- }
- }]);
- var specHandlers = {
- memoise: function memoise(superMember, count) {
- var scope = superMember.scope,
- node = superMember.node;
- var computed = node.computed,
- property = node.property;
- if (!computed) {
- return;
- }
- var memo = scope.maybeGenerateMemoised(property);
- if (!memo) {
- return;
- }
- this.memoiser.set(property, memo, count);
- },
- prop: function prop(superMember) {
- var _superMember$node = superMember.node,
- computed = _superMember$node.computed,
- property = _superMember$node.property;
- if (this.memoiser.has(property)) {
- return cloneNode(this.memoiser.get(property));
- }
- if (computed) {
- return cloneNode(property);
- }
- return StringLiteral(property.name);
- },
- get: function get(superMember) {
- return CallExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod), this.prop(superMember), ThisExpression()]);
- },
- set: function set(superMember, value) {
- return CallExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file, this.isPrivateMethod), this.prop(superMember), value, ThisExpression(), BooleanLiteral(superMember.isInStrictMode())]);
- },
- destructureSet: function destructureSet(superMember) {
- throw superMember.buildCodeFrameError("Destructuring to a super field is not supported yet.");
- },
- call: function call(superMember, args) {
- return optimiseCall(this.get(superMember), ThisExpression(), args);
- }
- };
- var looseHandlers = Object.assign({}, specHandlers, {
- prop: function prop(superMember) {
- var property = superMember.node.property;
- if (this.memoiser.has(property)) {
- return cloneNode(this.memoiser.get(property));
- }
- return cloneNode(property);
- },
- get: function get(superMember) {
- var isStatic = this.isStatic,
- superRef = this.superRef;
- var computed = superMember.node.computed;
- var prop = this.prop(superMember);
- var object;
- if (isStatic) {
- object = superRef ? cloneNode(superRef) : MemberExpression(Identifier("Function"), Identifier("prototype"));
- } else {
- object = superRef ? MemberExpression(cloneNode(superRef), Identifier("prototype")) : MemberExpression(Identifier("Object"), Identifier("prototype"));
- }
- return MemberExpression(object, prop, computed);
- },
- set: function set(superMember, value) {
- var computed = superMember.node.computed;
- var prop = this.prop(superMember);
- return AssignmentExpression("=", MemberExpression(ThisExpression(), prop, computed), value);
- },
- destructureSet: function destructureSet(superMember) {
- var computed = superMember.node.computed;
- var prop = this.prop(superMember);
- return MemberExpression(ThisExpression(), prop, computed);
- }
- });
- var ReplaceSupers = function () {
- function ReplaceSupers(opts) {
- var path = opts.methodPath;
- this.methodPath = path;
- this.isStatic = path.isObjectMethod() || path.node["static"];
- this.isPrivateMethod = path.isPrivate() && path.isMethod();
- this.file = opts.file;
- this.superRef = opts.superRef;
- this.isLoose = opts.isLoose;
- this.opts = opts;
- }
- var _proto = ReplaceSupers.prototype;
- _proto.getObjectRef = function getObjectRef() {
- return cloneNode(this.opts.objectRef || this.opts.getObjectRef());
- };
- _proto.replace = function replace() {
- var handler = this.isLoose ? looseHandlers : specHandlers;
- memberExpressionToFunctions(this.methodPath, visitor$1, Object.assign({
- file: this.file,
- isStatic: this.isStatic,
- isPrivateMethod: this.isPrivateMethod,
- getObjectRef: this.getObjectRef.bind(this),
- superRef: this.superRef
- }, handler));
- };
- return ReplaceSupers;
- }();
- function assertFieldTransformed(path) {
- if (path.node.declare) {
- throw path.buildCodeFrameError("TypeScript 'declare' fields must first be transformed by " + "@babel/plugin-transform-typescript.\n" + "If you have already enabled that plugin (or '@babel/preset-typescript'), make sure " + "that it runs before any plugin related to additional class features:\n" + " - @babel/plugin-proposal-class-properties\n" + " - @babel/plugin-proposal-private-methods\n" + " - @babel/plugin-proposal-decorators");
- }
- }
- function _templateObject15$1() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(", ", ", ", {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ", "\n });\n "]);
- _templateObject15$1 = function _templateObject15() {
- return data;
- };
- return data;
- }
- function _templateObject14$1() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(", ", ", ", {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ", ",\n set: ", "\n })\n "]);
- _templateObject14$1 = function _templateObject14() {
- return data;
- };
- return data;
- }
- function _templateObject13$1() {
- var data = _taggedTemplateLiteralLoose(["", ".add(", ")"]);
- _templateObject13$1 = function _templateObject13() {
- return data;
- };
- return data;
- }
- function _templateObject12$1() {
- var data = _taggedTemplateLiteralLoose(["\n ", ".set(", ", {\n get: ", ",\n set: ", "\n });\n "]);
- _templateObject12$1 = function _templateObject12() {
- return data;
- };
- return data;
- }
- function _templateObject11$1() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(", ", ", ", {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ", ",\n set: ", "\n });\n "]);
- _templateObject11$1 = function _templateObject11() {
- return data;
- };
- return data;
- }
- function _templateObject10$1() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(", ", ", ", {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ", "\n });\n "]);
- _templateObject10$1 = function _templateObject10() {
- return data;
- };
- return data;
- }
- function _templateObject9$1() {
- var data = _taggedTemplateLiteralLoose(["\n var ", " = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ", "\n };\n "]);
- _templateObject9$1 = function _templateObject9() {
- return data;
- };
- return data;
- }
- function _templateObject8$1() {
- var data = _taggedTemplateLiteralLoose(["\n var ", " = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ", ",\n set: ", "\n }\n "]);
- _templateObject8$1 = function _templateObject8() {
- return data;
- };
- return data;
- }
- function _templateObject7$1() {
- var data = _taggedTemplateLiteralLoose(["", ".set(", ", {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ", ",\n })"]);
- _templateObject7$1 = function _templateObject7() {
- return data;
- };
- return data;
- }
- function _templateObject6$1() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(", ", ", ", {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ", "\n });\n "]);
- _templateObject6$1 = function _templateObject6() {
- return data;
- };
- return data;
- }
- function _templateObject5$1() {
- var data = _taggedTemplateLiteralLoose(["BASE(REF, PROP)[PROP]"]);
- _templateObject5$1 = function _templateObject5() {
- return data;
- };
- return data;
- }
- function _templateObject4$1() {
- var data = _taggedTemplateLiteralLoose(["var ", " = new WeakMap();"]);
- _templateObject4$1 = function _templateObject4() {
- return data;
- };
- return data;
- }
- function _templateObject3$1() {
- var data = _taggedTemplateLiteralLoose(["var ", " = new WeakSet();"]);
- _templateObject3$1 = function _templateObject3() {
- return data;
- };
- return data;
- }
- function _templateObject2$1() {
- var data = _taggedTemplateLiteralLoose(["var ", " = new WeakMap();"]);
- _templateObject2$1 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject$2() {
- var data = _taggedTemplateLiteralLoose(["\n var ", " = ", "(\"", "\")\n "]);
- _templateObject$2 = function _templateObject() {
- return data;
- };
- return data;
- }
- function buildPrivateNamesMap(props) {
- var privateNamesMap = new Map();
- for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var prop = _ref;
- var isPrivate = prop.isPrivate();
- var isMethod = !prop.isProperty();
- var isInstance = !prop.node["static"];
- if (isPrivate) {
- var name = prop.node.key.id.name;
- var update = privateNamesMap.has(name) ? privateNamesMap.get(name) : {
- id: prop.scope.generateUidIdentifier(name),
- "static": !isInstance,
- method: isMethod
- };
- if (prop.node.kind === "get") {
- update.getId = prop.scope.generateUidIdentifier("get_" + name);
- } else if (prop.node.kind === "set") {
- update.setId = prop.scope.generateUidIdentifier("set_" + name);
- } else if (prop.node.kind === "method") {
- update.methodId = prop.scope.generateUidIdentifier(name);
- }
- privateNamesMap.set(name, update);
- }
- }
- return privateNamesMap;
- }
- function buildPrivateNamesNodes(privateNamesMap, loose, state) {
- var initNodes = [];
- for (var _iterator2 = privateNamesMap, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _ref3 = _ref2,
- name = _ref3[0],
- value = _ref3[1];
- var id = value.id,
- isStatic = value["static"],
- isMethod = value.method,
- getId = value.getId,
- setId = value.setId;
- var isAccessor = getId || setId;
- if (loose) {
- initNodes.push(template.statement.ast(_templateObject$2(), id, state.addHelper("classPrivateFieldLooseKey"), name));
- } else if (isMethod && !isStatic) {
- if (isAccessor) {
- initNodes.push(template.statement.ast(_templateObject2$1(), id));
- } else {
- initNodes.push(template.statement.ast(_templateObject3$1(), id));
- }
- } else if (!isStatic) {
- initNodes.push(template.statement.ast(_templateObject4$1(), id));
- }
- }
- return initNodes;
- }
- var privateNameVisitor = {
- PrivateName: function PrivateName(path) {
- var privateNamesMap = this.privateNamesMap;
- var node = path.node,
- parentPath = path.parentPath;
- if (!parentPath.isMemberExpression({
- property: node
- })) return;
- if (!privateNamesMap.has(node.id.name)) return;
- this.handle(parentPath);
- },
- Class: function Class(path) {
- var privateNamesMap = this.privateNamesMap;
- var body = path.get("body.body");
- for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref4 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref4 = _i3.value;
- }
- var prop = _ref4;
- if (!prop.isPrivate()) {
- continue;
- }
- if (!privateNamesMap.has(prop.node.key.id.name)) continue;
- path.traverse(privateNameInnerVisitor, this);
- path.skip();
- break;
- }
- }
- };
- var privateNameInnerVisitor = traverse$1.visitors.merge([{
- PrivateName: privateNameVisitor.PrivateName
- }, environmentVisitor]);
- var privateNameHandlerSpec = {
- memoise: function memoise(member, count) {
- var scope = member.scope;
- var object = member.node.object;
- var memo = scope.maybeGenerateMemoised(object);
- if (!memo) {
- return;
- }
- this.memoiser.set(object, memo, count);
- },
- receiver: function receiver(member) {
- var object = member.node.object;
- if (this.memoiser.has(object)) {
- return cloneNode(this.memoiser.get(object));
- }
- return cloneNode(object);
- },
- get: function get(member) {
- var classRef = this.classRef,
- privateNamesMap = this.privateNamesMap,
- file = this.file;
- var name = member.node.property.id.name;
- var _privateNamesMap$get = privateNamesMap.get(name),
- id = _privateNamesMap$get.id,
- isStatic = _privateNamesMap$get["static"],
- isMethod = _privateNamesMap$get.method,
- methodId = _privateNamesMap$get.methodId,
- getId = _privateNamesMap$get.getId,
- setId = _privateNamesMap$get.setId;
- var isAccessor = getId || setId;
- if (isStatic) {
- var helperName = isMethod && !isAccessor ? "classStaticPrivateMethodGet" : "classStaticPrivateFieldSpecGet";
- return CallExpression(file.addHelper(helperName), [this.receiver(member), cloneNode(classRef), cloneNode(id)]);
- }
- if (isMethod) {
- if (isAccessor) {
- return CallExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), cloneNode(id)]);
- }
- return CallExpression(file.addHelper("classPrivateMethodGet"), [this.receiver(member), cloneNode(id), cloneNode(methodId)]);
- }
- return CallExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), cloneNode(id)]);
- },
- set: function set(member, value) {
- var classRef = this.classRef,
- privateNamesMap = this.privateNamesMap,
- file = this.file;
- var name = member.node.property.id.name;
- var _privateNamesMap$get2 = privateNamesMap.get(name),
- id = _privateNamesMap$get2.id,
- isStatic = _privateNamesMap$get2["static"],
- isMethod = _privateNamesMap$get2.method,
- setId = _privateNamesMap$get2.setId,
- getId = _privateNamesMap$get2.getId;
- var isAccessor = getId || setId;
- if (isStatic) {
- var helperName = isMethod && !isAccessor ? "classStaticPrivateMethodSet" : "classStaticPrivateFieldSpecSet";
- return CallExpression(file.addHelper(helperName), [this.receiver(member), cloneNode(classRef), cloneNode(id), value]);
- }
- if (isMethod) {
- if (setId) {
- return CallExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), cloneNode(id), value]);
- }
- return CallExpression(file.addHelper("classPrivateMethodSet"), []);
- }
- return CallExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), cloneNode(id), value]);
- },
- destructureSet: function destructureSet(member) {
- var privateNamesMap = this.privateNamesMap,
- file = this.file;
- var name = member.node.property.id.name;
- var _privateNamesMap$get3 = privateNamesMap.get(name),
- id = _privateNamesMap$get3.id;
- return MemberExpression(CallExpression(file.addHelper("classPrivateFieldDestructureSet"), [this.receiver(member), cloneNode(id)]), Identifier("value"));
- },
- call: function call(member, args) {
- this.memoise(member, 1);
- return optimiseCall(this.get(member), this.receiver(member), args);
- }
- };
- var privateNameHandlerLoose = {
- handle: function handle(member) {
- var privateNamesMap = this.privateNamesMap,
- file = this.file;
- var object = member.node.object;
- var name = member.node.property.id.name;
- member.replaceWith(template.expression(_templateObject5$1())({
- BASE: file.addHelper("classPrivateFieldLooseBase"),
- REF: object,
- PROP: privateNamesMap.get(name).id
- }));
- }
- };
- function transformPrivateNamesUsage(ref, path, privateNamesMap, loose, state) {
- var body = path.get("body");
- if (loose) {
- body.traverse(privateNameVisitor, Object.assign({
- privateNamesMap: privateNamesMap,
- file: state
- }, privateNameHandlerLoose));
- } else {
- memberExpressionToFunctions(body, privateNameVisitor, Object.assign({
- privateNamesMap: privateNamesMap,
- classRef: ref,
- file: state
- }, privateNameHandlerSpec));
- }
- }
- function buildPrivateFieldInitLoose(ref, prop, privateNamesMap) {
- var _privateNamesMap$get4 = privateNamesMap.get(prop.node.key.id.name),
- id = _privateNamesMap$get4.id;
- var value = prop.node.value || prop.scope.buildUndefinedNode();
- return template.statement.ast(_templateObject6$1(), ref, id, value);
- }
- function buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap) {
- var _privateNamesMap$get5 = privateNamesMap.get(prop.node.key.id.name),
- id = _privateNamesMap$get5.id;
- var value = prop.node.value || prop.scope.buildUndefinedNode();
- return template.statement.ast(_templateObject7$1(), id, ref, value);
- }
- function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {
- var privateName = privateNamesMap.get(prop.node.key.id.name);
- var id = privateName.id,
- getId = privateName.getId,
- setId = privateName.setId,
- initAdded = privateName.initAdded;
- var isAccessor = getId || setId;
- if (!prop.isProperty() && (initAdded || !isAccessor)) return;
- if (isAccessor) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- initAdded: true
- }));
- return template.statement.ast(_templateObject8$1(), id.name, getId ? getId.name : prop.scope.buildUndefinedNode(), setId ? setId.name : prop.scope.buildUndefinedNode());
- }
- var value = prop.node.value || prop.scope.buildUndefinedNode();
- return template.statement.ast(_templateObject9$1(), id, value);
- }
- function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {
- var privateName = privateNamesMap.get(prop.node.key.id.name);
- var methodId = privateName.methodId,
- id = privateName.id,
- getId = privateName.getId,
- setId = privateName.setId,
- initAdded = privateName.initAdded;
- if (initAdded) return;
- if (methodId) {
- return template.statement.ast(_templateObject10$1(), ref, id, methodId.name);
- }
- var isAccessor = getId || setId;
- if (isAccessor) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- initAdded: true
- }));
- return template.statement.ast(_templateObject11$1(), ref, id, getId ? getId.name : prop.scope.buildUndefinedNode(), setId ? setId.name : prop.scope.buildUndefinedNode());
- }
- }
- function buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap) {
- var privateName = privateNamesMap.get(prop.node.key.id.name);
- var id = privateName.id,
- getId = privateName.getId,
- setId = privateName.setId,
- initAdded = privateName.initAdded;
- if (initAdded) return;
- var isAccessor = getId || setId;
- if (isAccessor) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- initAdded: true
- }));
- return template.statement.ast(_templateObject12$1(), id, ref, getId ? getId.name : prop.scope.buildUndefinedNode(), setId ? setId.name : prop.scope.buildUndefinedNode());
- }
- return template.statement.ast(_templateObject13$1(), id, ref);
- }
- function buildPublicFieldInitLoose(ref, prop) {
- var _prop$node = prop.node,
- key = _prop$node.key,
- computed = _prop$node.computed;
- var value = prop.node.value || prop.scope.buildUndefinedNode();
- return ExpressionStatement(AssignmentExpression("=", MemberExpression(ref, key, computed || isLiteral(key)), value));
- }
- function buildPublicFieldInitSpec(ref, prop, state) {
- var _prop$node2 = prop.node,
- key = _prop$node2.key,
- computed = _prop$node2.computed;
- var value = prop.node.value || prop.scope.buildUndefinedNode();
- return ExpressionStatement(CallExpression(state.addHelper("defineProperty"), [ref, computed || isLiteral(key) ? key : StringLiteral(key.name), value]));
- }
- function buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) {
- var privateName = privateNamesMap.get(prop.node.key.id.name);
- var id = privateName.id,
- methodId = privateName.methodId,
- getId = privateName.getId,
- setId = privateName.setId,
- initAdded = privateName.initAdded;
- if (initAdded) return;
- var isAccessor = getId || setId;
- if (isAccessor) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- initAdded: true
- }));
- return template.statement.ast(_templateObject14$1(), ref, id, getId ? getId.name : prop.scope.buildUndefinedNode(), setId ? setId.name : prop.scope.buildUndefinedNode());
- }
- return template.statement.ast(_templateObject15$1(), ref, id, methodId.name);
- }
- function buildPrivateMethodDeclaration(prop, privateNamesMap, loose) {
- if (loose === void 0) {
- loose = false;
- }
- var privateName = privateNamesMap.get(prop.node.key.id.name);
- var id = privateName.id,
- methodId = privateName.methodId,
- getId = privateName.getId,
- setId = privateName.setId,
- getterDeclared = privateName.getterDeclared,
- setterDeclared = privateName.setterDeclared,
- isStatic = privateName["static"];
- var _prop$node3 = prop.node,
- params = _prop$node3.params,
- body = _prop$node3.body,
- generator = _prop$node3.generator,
- async = _prop$node3.async;
- var methodValue = FunctionExpression(methodId, params, body, generator, async);
- var isGetter = getId && !getterDeclared && params.length === 0;
- var isSetter = setId && !setterDeclared && params.length > 0;
- if (isGetter) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- getterDeclared: true
- }));
- return VariableDeclaration("var", [VariableDeclarator(getId, methodValue)]);
- }
- if (isSetter) {
- privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, {
- setterDeclared: true
- }));
- return VariableDeclaration("var", [VariableDeclarator(setId, methodValue)]);
- }
- if (isStatic && !loose) {
- return VariableDeclaration("var", [VariableDeclarator(id, FunctionExpression(id, params, body, generator, async))]);
- }
- return VariableDeclaration("var", [VariableDeclarator(methodId, methodValue)]);
- }
- var thisContextVisitor = traverse$1.visitors.merge([{
- ThisExpression: function ThisExpression(path, state) {
- state.needsClassRef = true;
- path.replaceWith(cloneNode(state.classRef));
- }
- }, environmentVisitor]);
- function replaceThisContext(path, ref, superRef, file, loose) {
- var state = {
- classRef: ref,
- needsClassRef: false
- };
- var replacer = new ReplaceSupers({
- methodPath: path,
- isLoose: loose,
- superRef: superRef,
- file: file,
- getObjectRef: function getObjectRef() {
- state.needsClassRef = true;
- return path.node["static"] ? ref : MemberExpression(ref, Identifier("prototype"));
- }
- });
- replacer.replace();
- if (path.isProperty()) {
- path.traverse(thisContextVisitor, state);
- }
- return state.needsClassRef;
- }
- function buildFieldsInitNodes(ref, superRef, props, privateNamesMap, state, loose) {
- var staticNodes = [];
- var instanceNodes = [];
- var needsClassRef = false;
- for (var _iterator4 = props, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref5 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref5 = _i4.value;
- }
- var prop = _ref5;
- assertFieldTransformed(prop);
- var isStatic = prop.node["static"];
- var isInstance = !isStatic;
- var isPrivate = prop.isPrivate();
- var isPublic = !isPrivate;
- var isField = prop.isProperty();
- var isMethod = !isField;
- if (isStatic || isMethod && isPrivate) {
- var replaced = replaceThisContext(prop, ref, superRef, state, loose);
- needsClassRef = needsClassRef || replaced;
- }
- switch (true) {
- case isStatic && isPrivate && isField && loose:
- needsClassRef = true;
- staticNodes.push(buildPrivateFieldInitLoose(cloneNode(ref), prop, privateNamesMap));
- break;
- case isStatic && isPrivate && isField && !loose:
- needsClassRef = true;
- staticNodes.push(buildPrivateStaticFieldInitSpec(prop, privateNamesMap));
- break;
- case isStatic && isPublic && isField && loose:
- needsClassRef = true;
- staticNodes.push(buildPublicFieldInitLoose(cloneNode(ref), prop));
- break;
- case isStatic && isPublic && isField && !loose:
- needsClassRef = true;
- staticNodes.push(buildPublicFieldInitSpec(cloneNode(ref), prop, state));
- break;
- case isInstance && isPrivate && isField && loose:
- instanceNodes.push(buildPrivateFieldInitLoose(ThisExpression(), prop, privateNamesMap));
- break;
- case isInstance && isPrivate && isField && !loose:
- instanceNodes.push(buildPrivateInstanceFieldInitSpec(ThisExpression(), prop, privateNamesMap));
- break;
- case isInstance && isPrivate && isMethod && loose:
- instanceNodes.unshift(buildPrivateMethodInitLoose(ThisExpression(), prop, privateNamesMap));
- staticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, loose));
- break;
- case isInstance && isPrivate && isMethod && !loose:
- instanceNodes.unshift(buildPrivateInstanceMethodInitSpec(ThisExpression(), prop, privateNamesMap));
- staticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, loose));
- break;
- case isStatic && isPrivate && isMethod && !loose:
- needsClassRef = true;
- staticNodes.push(buildPrivateStaticFieldInitSpec(prop, privateNamesMap));
- staticNodes.unshift(buildPrivateMethodDeclaration(prop, privateNamesMap, loose));
- break;
- case isStatic && isPrivate && isMethod && loose:
- needsClassRef = true;
- staticNodes.push(buildPrivateStaticMethodInitLoose(cloneNode(ref), prop, state, privateNamesMap));
- staticNodes.unshift(buildPrivateMethodDeclaration(prop, privateNamesMap, loose));
- break;
- case isInstance && isPublic && isField && loose:
- instanceNodes.push(buildPublicFieldInitLoose(ThisExpression(), prop));
- break;
- case isInstance && isPublic && isField && !loose:
- instanceNodes.push(buildPublicFieldInitSpec(ThisExpression(), prop, state));
- break;
- default:
- throw new Error("Unreachable.");
- }
- }
- return {
- staticNodes: staticNodes.filter(Boolean),
- instanceNodes: instanceNodes.filter(Boolean),
- wrapClass: function wrapClass(path) {
- for (var _iterator5 = props, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref6 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref6 = _i5.value;
- }
- var prop = _ref6;
- prop.remove();
- }
- if (!needsClassRef) return path;
- if (path.isClassExpression()) {
- path.scope.push({
- id: ref
- });
- path.replaceWith(AssignmentExpression("=", cloneNode(ref), path.node));
- } else if (!path.node.id) {
- path.node.id = ref;
- }
- return path;
- }
- };
- }
- function _templateObject4$2() {
- var data = _taggedTemplateLiteralLoose(["", "(this)"]);
- _templateObject4$2 = function _templateObject4() {
- return data;
- };
- return data;
- }
- function _templateObject3$2() {
- var data = _taggedTemplateLiteralLoose(["let ", " = ", ""]);
- _templateObject3$2 = function _templateObject3() {
- return data;
- };
- return data;
- }
- function _templateObject2$2() {
- var data = _taggedTemplateLiteralLoose(["\n ", "(\n ", ",\n function (", ", ", ") {\n ", "\n return { F: ", ", d: ", " };\n },\n ", "\n )\n "]);
- _templateObject2$2 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject$3() {
- var data = _taggedTemplateLiteralLoose(["return ", ""]);
- _templateObject$3 = function _templateObject() {
- return data;
- };
- return data;
- }
- function hasOwnDecorators(node) {
- return !!(node.decorators && node.decorators.length);
- }
- function hasDecorators(node) {
- return hasOwnDecorators(node) || node.body.body.some(hasOwnDecorators);
- }
- function prop(key, value) {
- if (!value) return null;
- return ObjectProperty(Identifier(key), value);
- }
- function method(key, body) {
- return ObjectMethod("method", Identifier(key), [], BlockStatement(body));
- }
- function takeDecorators(node) {
- var result;
- if (node.decorators && node.decorators.length > 0) {
- result = ArrayExpression(node.decorators.map(function (decorator) {
- return decorator.expression;
- }));
- }
- node.decorators = undefined;
- return result;
- }
- function getKey(node) {
- if (node.computed) {
- return node.key;
- } else if (isIdentifier(node.key)) {
- return StringLiteral(node.key.name);
- } else {
- return StringLiteral(String(node.key.value));
- }
- }
- function extractElementDescriptor(classRef, superRef, path) {
- var node = path.node,
- scope = path.scope;
- var isMethod = path.isClassMethod();
- if (path.isPrivate()) {
- throw path.buildCodeFrameError("Private " + (isMethod ? "methods" : "fields") + " in decorated classes are not supported yet.");
- }
- new ReplaceSupers({
- methodPath: path,
- methodNode: node,
- objectRef: classRef,
- isStatic: node["static"],
- superRef: superRef,
- scope: scope,
- file: this
- }, true).replace();
- var properties = [prop("kind", StringLiteral(isMethod ? node.kind : "field")), prop("decorators", takeDecorators(node)), prop("static", node["static"] && BooleanLiteral(true)), prop("key", getKey(node))].filter(Boolean);
- if (isMethod) {
- var id = node.computed ? null : node.key;
- toExpression(node);
- properties.push(prop("value", nameFunction({
- node: node,
- id: id,
- scope: scope
- }) || node));
- } else if (node.value) {
- properties.push(method("value", template.statements.ast(_templateObject$3(), node.value)));
- } else {
- properties.push(prop("value", scope.buildUndefinedNode()));
- }
- path.remove();
- return ObjectExpression(properties);
- }
- function addDecorateHelper(file) {
- try {
- return file.addHelper("decorate");
- } catch (err) {
- if (err.code === "BABEL_HELPER_UNKNOWN") {
- err.message += "\n '@babel/plugin-transform-decorators' in non-legacy mode" + " requires '@babel/core' version ^7.0.2 and you appear to be using" + " an older version.";
- }
- throw err;
- }
- }
- function buildDecoratedClass(ref, path, elements, file) {
- var node = path.node,
- scope = path.scope;
- var initializeId = scope.generateUidIdentifier("initialize");
- var isDeclaration = node.id && path.isDeclaration();
- var isStrict = path.isInStrictMode();
- var superClass = node.superClass;
- node.type = "ClassDeclaration";
- if (!node.id) node.id = cloneNode(ref);
- var superId;
- if (superClass) {
- superId = scope.generateUidIdentifierBasedOnNode(node.superClass, "super");
- node.superClass = superId;
- }
- var classDecorators = takeDecorators(node);
- var definitions = ArrayExpression(elements.map(extractElementDescriptor.bind(file, node.id, superId)));
- var replacement = template.expression.ast(_templateObject2$2(), addDecorateHelper(file), classDecorators || NullLiteral(), initializeId, superClass ? superId : null, node, cloneNode(node.id), definitions, superClass);
- var classPathDesc = "arguments.1.body.body.0";
- if (!isStrict) {
- replacement.arguments[1].body.directives.push(Directive(DirectiveLiteral("use strict")));
- }
- if (isDeclaration) {
- replacement = template.ast(_templateObject3$2(), ref, replacement);
- classPathDesc = "declarations.0.init." + classPathDesc;
- }
- return {
- instanceNodes: [template.statement.ast(_templateObject4$2(), initializeId)],
- wrapClass: function wrapClass(path) {
- path.replaceWith(replacement);
- return path.get(classPathDesc);
- }
- };
- }
- function _templateObject$4() {
- var data = _taggedTemplateLiteralLoose(["super(...args)"]);
- _templateObject$4 = function _templateObject() {
- return data;
- };
- return data;
- }
- var findBareSupers = traverse$1.visitors.merge([{
- Super: function Super(path) {
- var node = path.node,
- parentPath = path.parentPath;
- if (parentPath.isCallExpression({
- callee: node
- })) {
- this.push(parentPath);
- }
- }
- }, environmentVisitor]);
- var referenceVisitor$1 = {
- "TSTypeAnnotation|TypeAnnotation": function TSTypeAnnotationTypeAnnotation(path) {
- path.skip();
- },
- ReferencedIdentifier: function ReferencedIdentifier(path) {
- if (this.scope.hasOwnBinding(path.node.name)) {
- this.scope.rename(path.node.name);
- path.skip();
- }
- }
- };
- var classFieldDefinitionEvaluationTDZVisitor = traverse$1.visitors.merge([{
- ReferencedIdentifier: function ReferencedIdentifier(path) {
- if (this.classBinding && this.classBinding === path.scope.getBinding(path.node.name)) {
- var classNameTDZError = this.file.addHelper("classNameTDZError");
- var throwNode = CallExpression(classNameTDZError, [StringLiteral(path.node.name)]);
- path.replaceWith(SequenceExpression([throwNode, path.node]));
- path.skip();
- }
- }
- }, environmentVisitor]);
- function injectInitialization(path, constructor, nodes, renamer) {
- if (!nodes.length) return;
- var isDerived = !!path.node.superClass;
- if (!constructor) {
- var newConstructor = ClassMethod("constructor", Identifier("constructor"), [], BlockStatement([]));
- if (isDerived) {
- newConstructor.params = [RestElement(Identifier("args"))];
- newConstructor.body.body.push(template.statement.ast(_templateObject$4()));
- }
- var _path$get$unshiftCont = path.get("body").unshiftContainer("body", newConstructor);
- constructor = _path$get$unshiftCont[0];
- }
- if (renamer) {
- renamer(referenceVisitor$1, {
- scope: constructor.scope
- });
- }
- if (isDerived) {
- var bareSupers = [];
- constructor.traverse(findBareSupers, bareSupers);
- for (var _i = 0, _bareSupers = bareSupers; _i < _bareSupers.length; _i++) {
- var bareSuper = _bareSupers[_i];
- bareSuper.insertAfter(nodes);
- }
- } else {
- constructor.get("body").unshiftContainer("body", nodes);
- }
- }
- function extractComputedKeys(ref, path, computedPaths, file) {
- var declarations = [];
- for (var _iterator = computedPaths, _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i2 >= _iterator.length) break;
- _ref = _iterator[_i2++];
- } else {
- _i2 = _iterator.next();
- if (_i2.done) break;
- _ref = _i2.value;
- }
- var computedPath = _ref;
- computedPath.traverse(classFieldDefinitionEvaluationTDZVisitor, {
- classBinding: path.node.id && path.scope.getBinding(path.node.id.name),
- file: file
- });
- var computedNode = computedPath.node;
- if (!computedPath.get("key").isConstantExpression()) {
- var ident = path.scope.generateUidIdentifierBasedOnNode(computedNode.key);
- path.scope.push({
- id: ident,
- kind: "let"
- });
- declarations.push(ExpressionStatement(AssignmentExpression("=", cloneNode(ident), computedNode.key)));
- computedNode.key = cloneNode(ident);
- }
- }
- return declarations;
- }
- var FEATURES = Object.freeze({
- fields: 1 << 1,
- privateMethods: 1 << 2,
- decorators: 1 << 3
- });
- var featuresKey = "@babel/plugin-class-features/featuresKey";
- var looseKey = "@babel/plugin-class-features/looseKey";
- function enableFeature(file, feature, loose) {
- if (!hasFeature(file, feature)) {
- file.set(featuresKey, file.get(featuresKey) | feature);
- if (loose) file.set(looseKey, file.get(looseKey) | feature);
- }
- }
- function hasFeature(file, feature) {
- return !!(file.get(featuresKey) & feature);
- }
- function isLoose(file, feature) {
- return !!(file.get(looseKey) & feature);
- }
- function verifyUsedFeatures(path, file) {
- if (hasOwnDecorators(path.node)) {
- if (!hasFeature(file, FEATURES.decorators)) {
- throw path.buildCodeFrameError("Decorators are not enabled." + "\nIf you are using " + '["@babel/plugin-proposal-decorators", { "legacy": true }], ' + 'make sure it comes *before* "@babel/plugin-proposal-class-properties" ' + "and enable loose mode, like so:\n" + '\t["@babel/plugin-proposal-decorators", { "legacy": true }]\n' + '\t["@babel/plugin-proposal-class-properties", { "loose": true }]');
- }
- if (path.isPrivate()) {
- throw path.buildCodeFrameError("Private " + (path.isClassMethod() ? "methods" : "fields") + " in decorated classes are not supported yet.");
- }
- }
- if (path.isPrivate() && path.isMethod()) {
- if (!hasFeature(file, FEATURES.privateMethods)) {
- throw path.buildCodeFrameError("Class private methods are not enabled.");
- }
- }
- if (hasFeature(file, FEATURES.privateMethods) && hasFeature(file, FEATURES.fields) && isLoose(file, FEATURES.privateMethods) !== isLoose(file, FEATURES.fields)) {
- throw path.buildCodeFrameError("'loose' mode configuration must be the same for both @babel/plugin-proposal-class-properties " + "and @babel/plugin-proposal-private-methods");
- }
- if (path.isProperty()) {
- if (!hasFeature(file, FEATURES.fields)) {
- throw path.buildCodeFrameError("Class fields are not enabled.");
- }
- }
- }
- var name = "@babel/helper-create-class-features-plugin";
- var version$2 = "7.8.3";
- var author = "The Babel Team (https://babeljs.io/team)";
- var license = "MIT";
- var description = "Compile class public and private fields, private methods and decorators to ES6";
- var repository = "https://github.com/babel/babel/tree/master/packages/babel-helper-create-class-features-plugin";
- var main = "lib/index.js";
- var publishConfig = {
- access: "public"
- };
- var keywords$1 = [
- "babel",
- "babel-plugin"
- ];
- var dependencies = {
- "@babel/helper-function-name": "^7.8.3",
- "@babel/helper-member-expression-to-functions": "^7.8.3",
- "@babel/helper-optimise-call-expression": "^7.8.3",
- "@babel/helper-plugin-utils": "^7.8.3",
- "@babel/helper-replace-supers": "^7.8.3",
- "@babel/helper-split-export-declaration": "^7.8.3"
- };
- var peerDependencies = {
- "@babel/core": "^7.0.0"
- };
- var devDependencies = {
- "@babel/core": "^7.8.3",
- "@babel/helper-plugin-test-runner": "^7.8.3"
- };
- var gitHead = "a7620bd266ae1345975767bbc7abf09034437017";
- var pkg = {
- name: name,
- version: version$2,
- author: author,
- license: license,
- description: description,
- repository: repository,
- main: main,
- publishConfig: publishConfig,
- keywords: keywords$1,
- dependencies: dependencies,
- peerDependencies: peerDependencies,
- devDependencies: devDependencies,
- gitHead: gitHead
- };
- var version$3 = pkg.version.split(".").reduce(function (v, x) {
- return v * 1e5 + +x;
- }, 0);
- var versionKey = "@babel/plugin-class-features/version";
- function createClassFeaturePlugin(_ref) {
- var name = _ref.name,
- feature = _ref.feature,
- loose = _ref.loose,
- manipulateOptions = _ref.manipulateOptions;
- return {
- name: name,
- manipulateOptions: manipulateOptions,
- pre: function pre() {
- enableFeature(this.file, feature, loose);
- if (!this.file.get(versionKey) || this.file.get(versionKey) < version$3) {
- this.file.set(versionKey, version$3);
- }
- },
- visitor: {
- Class: function Class(path, state) {
- if (this.file.get(versionKey) !== version$3) return;
- verifyUsedFeatures(path, this.file);
- var loose = isLoose(this.file, feature);
- var constructor;
- var isDecorated = hasOwnDecorators(path.node);
- var props = [];
- var elements = [];
- var computedPaths = [];
- var privateNames = new Set();
- var body = path.get("body");
- for (var _iterator = body.get("body"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var _path = _ref2;
- verifyUsedFeatures(_path, this.file);
- if (_path.node.computed) {
- computedPaths.push(_path);
- }
- if (_path.isPrivate()) {
- var _name = _path.node.key.id.name;
- var getName = "get " + _name;
- var setName = "set " + _name;
- if (_path.node.kind === "get") {
- if (privateNames.has(getName) || privateNames.has(_name) && !privateNames.has(setName)) {
- throw _path.buildCodeFrameError("Duplicate private field");
- }
- privateNames.add(getName).add(_name);
- } else if (_path.node.kind === "set") {
- if (privateNames.has(setName) || privateNames.has(_name) && !privateNames.has(getName)) {
- throw _path.buildCodeFrameError("Duplicate private field");
- }
- privateNames.add(setName).add(_name);
- } else {
- if (privateNames.has(_name) && !privateNames.has(getName) && !privateNames.has(setName) || privateNames.has(_name) && (privateNames.has(getName) || privateNames.has(setName))) {
- throw _path.buildCodeFrameError("Duplicate private field");
- }
- privateNames.add(_name);
- }
- }
- if (_path.isClassMethod({
- kind: "constructor"
- })) {
- constructor = _path;
- } else {
- elements.push(_path);
- if (_path.isProperty() || _path.isPrivate()) {
- props.push(_path);
- }
- }
- if (!isDecorated) isDecorated = hasOwnDecorators(_path.node);
- }
- if (!props.length && !isDecorated) return;
- var ref;
- if (path.isClassExpression() || !path.node.id) {
- nameFunction(path);
- ref = path.scope.generateUidIdentifier("class");
- } else {
- ref = path.node.id;
- }
- var privateNamesMap = buildPrivateNamesMap(props);
- var privateNamesNodes = buildPrivateNamesNodes(privateNamesMap, loose, state);
- transformPrivateNamesUsage(ref, path, privateNamesMap, loose, state);
- var keysNodes, staticNodes, instanceNodes, wrapClass;
- if (isDecorated) {
- staticNodes = keysNodes = [];
- var _buildDecoratedClass = buildDecoratedClass(ref, path, elements, this.file);
- instanceNodes = _buildDecoratedClass.instanceNodes;
- wrapClass = _buildDecoratedClass.wrapClass;
- } else {
- keysNodes = extractComputedKeys(ref, path, computedPaths, this.file);
- var _buildFieldsInitNodes = buildFieldsInitNodes(ref, path.node.superClass, props, privateNamesMap, state, loose);
- staticNodes = _buildFieldsInitNodes.staticNodes;
- instanceNodes = _buildFieldsInitNodes.instanceNodes;
- wrapClass = _buildFieldsInitNodes.wrapClass;
- }
- if (instanceNodes.length > 0) {
- injectInitialization(path, constructor, instanceNodes, function (referenceVisitor, state) {
- if (isDecorated) return;
- for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref3 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref3 = _i2.value;
- }
- var prop = _ref3;
- if (prop.node["static"]) continue;
- prop.traverse(referenceVisitor, state);
- }
- });
- }
- path = wrapClass(path);
- path.insertBefore(keysNodes);
- path.insertAfter([].concat(privateNamesNodes, staticNodes));
- },
- PrivateName: function PrivateName(path) {
- if (this.file.get(versionKey) !== version$3) return;
- throw path.buildCodeFrameError("Unknown PrivateName \"" + path + "\"");
- },
- ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
- if (this.file.get(versionKey) !== version$3) return;
- var decl = path.get("declaration");
- if (decl.isClassDeclaration() && hasDecorators(decl.node)) {
- if (decl.node.id) {
- splitExportDeclaration(path);
- } else {
- decl.node.type = "ClassExpression";
- }
- }
- }
- }
- };
- }
- var proposalClassProperties = declare(function (api, options) {
- api.assertVersion(7);
- return createClassFeaturePlugin({
- name: "proposal-class-properties",
- feature: FEATURES.fields,
- loose: options.loose,
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("classProperties", "classPrivateProperties");
- }
- });
- });
- var buildClassDecorator = template("\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n");
- var buildClassPrototype = template("\n CLASS_REF.prototype;\n");
- var buildGetDescriptor = template("\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n");
- var buildGetObjectInitializer = template("\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n");
- var WARNING_CALLS = new WeakSet();
- function applyEnsureOrdering(path) {
- var decorators = (path.isClass() ? [path].concat(path.get("body.body")) : path.get("properties")).reduce(function (acc, prop) {
- return acc.concat(prop.node.decorators || []);
- }, []);
- var identDecorators = decorators.filter(function (decorator) {
- return !isIdentifier(decorator.expression);
- });
- if (identDecorators.length === 0) return;
- return SequenceExpression(identDecorators.map(function (decorator) {
- var expression = decorator.expression;
- var id = decorator.expression = path.scope.generateDeclaredUidIdentifier("dec");
- return AssignmentExpression("=", id, expression);
- }).concat([path.node]));
- }
- function applyClassDecorators(classPath) {
- if (!hasClassDecorators(classPath.node)) return;
- var decorators = classPath.node.decorators || [];
- classPath.node.decorators = null;
- var name = classPath.scope.generateDeclaredUidIdentifier("class");
- return decorators.map(function (dec) {
- return dec.expression;
- }).reverse().reduce(function (acc, decorator) {
- return buildClassDecorator({
- CLASS_REF: cloneNode(name),
- DECORATOR: cloneNode(decorator),
- INNER: acc
- }).expression;
- }, classPath.node);
- }
- function hasClassDecorators(classNode) {
- return !!(classNode.decorators && classNode.decorators.length);
- }
- function applyMethodDecorators(path, state) {
- if (!hasMethodDecorators(path.node.body.body)) return;
- return applyTargetDecorators(path, state, path.node.body.body);
- }
- function hasMethodDecorators(body) {
- return body.some(function (node) {
- return node.decorators && node.decorators.length;
- });
- }
- function applyObjectDecorators(path, state) {
- if (!hasMethodDecorators(path.node.properties)) return;
- return applyTargetDecorators(path, state, path.node.properties);
- }
- function applyTargetDecorators(path, state, decoratedProps) {
- var name = path.scope.generateDeclaredUidIdentifier(path.isClass() ? "class" : "obj");
- var exprs = decoratedProps.reduce(function (acc, node) {
- var decorators = node.decorators || [];
- node.decorators = null;
- if (decorators.length === 0) return acc;
- if (node.computed) {
- throw path.buildCodeFrameError("Computed method/property decorators are not yet supported.");
- }
- var property = isLiteral(node.key) ? node.key : StringLiteral(node.key.name);
- var target = path.isClass() && !node["static"] ? buildClassPrototype({
- CLASS_REF: name
- }).expression : name;
- if (isClassProperty(node, {
- "static": false
- })) {
- var descriptor = path.scope.generateDeclaredUidIdentifier("descriptor");
- var initializer = node.value ? FunctionExpression(null, [], BlockStatement([ReturnStatement(node.value)])) : NullLiteral();
- node.value = CallExpression(state.addHelper("initializerWarningHelper"), [descriptor, ThisExpression()]);
- WARNING_CALLS.add(node.value);
- acc = acc.concat([AssignmentExpression("=", descriptor, CallExpression(state.addHelper("applyDecoratedDescriptor"), [cloneNode(target), cloneNode(property), ArrayExpression(decorators.map(function (dec) {
- return cloneNode(dec.expression);
- })), ObjectExpression([ObjectProperty(Identifier("configurable"), BooleanLiteral(true)), ObjectProperty(Identifier("enumerable"), BooleanLiteral(true)), ObjectProperty(Identifier("writable"), BooleanLiteral(true)), ObjectProperty(Identifier("initializer"), initializer)])]))]);
- } else {
- acc = acc.concat(CallExpression(state.addHelper("applyDecoratedDescriptor"), [cloneNode(target), cloneNode(property), ArrayExpression(decorators.map(function (dec) {
- return cloneNode(dec.expression);
- })), isObjectProperty(node) || isClassProperty(node, {
- "static": true
- }) ? buildGetObjectInitializer({
- TEMP: path.scope.generateDeclaredUidIdentifier("init"),
- TARGET: cloneNode(target),
- PROPERTY: cloneNode(property)
- }).expression : buildGetDescriptor({
- TARGET: cloneNode(target),
- PROPERTY: cloneNode(property)
- }).expression, cloneNode(target)]));
- }
- return acc;
- }, []);
- return SequenceExpression([AssignmentExpression("=", cloneNode(name), path.node), SequenceExpression(exprs), cloneNode(name)]);
- }
- function decoratedClassToExpression(_ref) {
- var node = _ref.node,
- scope = _ref.scope;
- if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {
- return;
- }
- var ref = node.id ? cloneNode(node.id) : scope.generateUidIdentifier("class");
- return VariableDeclaration("let", [VariableDeclarator(ref, toExpression(node))]);
- }
- var legacyVisitor = {
- ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
- var decl = path.get("declaration");
- if (!decl.isClassDeclaration()) return;
- var replacement = decoratedClassToExpression(decl);
- if (replacement) {
- var _path$replaceWithMult = path.replaceWithMultiple([replacement, ExportNamedDeclaration(null, [ExportSpecifier(cloneNode(replacement.declarations[0].id), Identifier("default"))])]),
- varDeclPath = _path$replaceWithMult[0];
- if (!decl.node.id) {
- path.scope.registerDeclaration(varDeclPath);
- }
- }
- },
- ClassDeclaration: function ClassDeclaration(path) {
- var replacement = decoratedClassToExpression(path);
- if (replacement) {
- path.replaceWith(replacement);
- }
- },
- ClassExpression: function ClassExpression(path, state) {
- var decoratedClass = applyEnsureOrdering(path) || applyClassDecorators(path) || applyMethodDecorators(path, state);
- if (decoratedClass) path.replaceWith(decoratedClass);
- },
- ObjectExpression: function ObjectExpression(path, state) {
- var decoratedObject = applyEnsureOrdering(path) || applyObjectDecorators(path, state);
- if (decoratedObject) path.replaceWith(decoratedObject);
- },
- AssignmentExpression: function AssignmentExpression(path, state) {
- if (!WARNING_CALLS.has(path.node.right)) return;
- path.replaceWith(CallExpression(state.addHelper("initializerDefineProperty"), [cloneNode(path.get("left.object").node), StringLiteral(path.get("left.property").node.name || path.get("left.property").node.value), cloneNode(path.get("right.arguments")[0].node), cloneNode(path.get("right.arguments")[1].node)]));
- },
- CallExpression: function CallExpression$1(path, state) {
- if (path.node.arguments.length !== 3) return;
- if (!WARNING_CALLS.has(path.node.arguments[2])) return;
- if (path.node.callee.name !== state.addHelper("defineProperty").name) {
- return;
- }
- path.replaceWith(CallExpression(state.addHelper("initializerDefineProperty"), [cloneNode(path.get("arguments")[0].node), cloneNode(path.get("arguments")[1].node), cloneNode(path.get("arguments.2.arguments")[0].node), cloneNode(path.get("arguments.2.arguments")[1].node)]));
- }
- };
- var proposalDecorators = declare(function (api, options) {
- api.assertVersion(7);
- var _options$legacy = options.legacy,
- legacy = _options$legacy === void 0 ? false : _options$legacy;
- if (typeof legacy !== "boolean") {
- throw new Error("'legacy' must be a boolean.");
- }
- var decoratorsBeforeExport = options.decoratorsBeforeExport;
- if (decoratorsBeforeExport === undefined) {
- if (!legacy) {
- throw new Error("The decorators plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you want to use the legacy" + " decorators semantics, you can set the 'legacy: true' option.");
- }
- } else {
- if (legacy) {
- throw new Error("'decoratorsBeforeExport' can't be used with legacy decorators.");
- }
- if (typeof decoratorsBeforeExport !== "boolean") {
- throw new Error("'decoratorsBeforeExport' must be a boolean.");
- }
- }
- if (legacy) {
- return {
- name: "proposal-decorators",
- inherits: syntaxDecorators,
- manipulateOptions: function manipulateOptions(_ref) {
- var generatorOpts = _ref.generatorOpts;
- generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
- },
- visitor: legacyVisitor
- };
- }
- return createClassFeaturePlugin({
- name: "proposal-decorators",
- feature: FEATURES.decorators,
- manipulateOptions: function manipulateOptions(_ref2) {
- var generatorOpts = _ref2.generatorOpts,
- parserOpts = _ref2.parserOpts;
- parserOpts.plugins.push(["decorators", {
- decoratorsBeforeExport: decoratorsBeforeExport
- }]);
- generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;
- }
- });
- });
- var proposalDoExpressions = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-do-expressions",
- inherits: syntaxDoExpressions,
- visitor: {
- DoExpression: {
- exit: function exit(path) {
- var body = path.node.body.body;
- if (body.length) {
- path.replaceExpressionWithStatements(body);
- } else {
- path.replaceWith(path.scope.buildUndefinedNode());
- }
- }
- }
- }
- };
- });
- var lib$5 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-dynamic-import",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("dynamicImport");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxDynamicImport$1 = unwrapExports(lib$5);
- var version$4 = "7.8.3";
- var SUPPORTED_MODULES = ["commonjs", "amd", "systemjs"];
- var MODULES_NOT_FOUND = "@babel/plugin-proposal-dynamic-import depends on a modules\ntransform plugin. Supported plugins are:\n - @babel/plugin-transform-modules-commonjs ^7.4.0\n - @babel/plugin-transform-modules-amd ^7.4.0\n - @babel/plugin-transform-modules-systemjs ^7.4.0\n\nIf you are using Webpack or Rollup and thus don't want\nBabel to transpile your imports and exports, you can use\nthe @babel/plugin-syntax-dynamic-import plugin and let your\nbundler handle dynamic imports.\n";
- var proposalDynamicImport = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-dynamic-import",
- inherits: syntaxDynamicImport$1,
- pre: function pre() {
- this.file.set("@babel/plugin-proposal-dynamic-import", version$4);
- },
- visitor: {
- Program: function Program() {
- var modules = this.file.get("@babel/plugin-transform-modules-*");
- if (!SUPPORTED_MODULES.includes(modules)) {
- throw new Error(MODULES_NOT_FOUND);
- }
- }
- }
- };
- });
- var proposalExportDefaultFrom = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-export-default-from",
- inherits: syntaxExportDefaultFrom,
- visitor: {
- ExportNamedDeclaration: function ExportNamedDeclaration$1(path) {
- var node = path.node,
- scope = path.scope;
- var specifiers = node.specifiers;
- if (!isExportDefaultSpecifier(specifiers[0])) return;
- var specifier = specifiers.shift();
- var exported = specifier.exported;
- var uid = scope.generateUidIdentifier(exported.name);
- var nodes = [ImportDeclaration([ImportDefaultSpecifier(uid)], cloneNode(node.source)), ExportNamedDeclaration(null, [ExportSpecifier(cloneNode(uid), exported)])];
- if (specifiers.length >= 1) {
- nodes.push(node);
- }
- var _path$replaceWithMult = path.replaceWithMultiple(nodes),
- importDeclaration = _path$replaceWithMult[0];
- path.scope.registerDeclaration(importDeclaration);
- }
- }
- };
- });
- var proposalExportNamespaceFrom = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-export-namespace-from",
- inherits: syntaxExportNamespaceFrom,
- visitor: {
- ExportNamedDeclaration: function ExportNamedDeclaration$1(path) {
- var node = path.node,
- scope = path.scope;
- var specifiers = node.specifiers;
- var index = isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;
- if (!isExportNamespaceSpecifier(specifiers[index])) return;
- var nodes = [];
- if (index === 1) {
- nodes.push(ExportNamedDeclaration(null, [specifiers.shift()], node.source));
- }
- var specifier = specifiers.shift();
- var exported = specifier.exported;
- var uid = scope.generateUidIdentifier(exported.name);
- nodes.push(ImportDeclaration([ImportNamespaceSpecifier(uid)], cloneNode(node.source)), ExportNamedDeclaration(null, [ExportSpecifier(cloneNode(uid), exported)]));
- if (node.specifiers.length >= 1) {
- nodes.push(node);
- }
- var _path$replaceWithMult = path.replaceWithMultiple(nodes),
- importDeclaration = _path$replaceWithMult[0];
- path.scope.registerDeclaration(importDeclaration);
- }
- }
- };
- });
- var proposalFunctionBind = declare(function (api) {
- api.assertVersion(7);
- function getTempId(scope) {
- var id = scope.path.getData("functionBind");
- if (id) return id;
- id = scope.generateDeclaredUidIdentifier("context");
- return scope.path.setData("functionBind", id);
- }
- function getStaticContext(bind, scope) {
- var object = bind.object || bind.callee.object;
- return scope.isStatic(object) && object;
- }
- function inferBindContext(bind, scope) {
- var staticContext = getStaticContext(bind, scope);
- if (staticContext) return cloneNode(staticContext);
- var tempId = getTempId(scope);
- if (bind.object) {
- bind.callee = SequenceExpression([AssignmentExpression("=", tempId, bind.object), bind.callee]);
- } else {
- bind.callee.object = AssignmentExpression("=", tempId, bind.callee.object);
- }
- return tempId;
- }
- return {
- name: "proposal-function-bind",
- inherits: syntaxFunctionBind,
- visitor: {
- CallExpression: function CallExpression(_ref) {
- var node = _ref.node,
- scope = _ref.scope;
- var bind = node.callee;
- if (!isBindExpression(bind)) return;
- var context = inferBindContext(bind, scope);
- node.callee = MemberExpression(bind.callee, Identifier("call"));
- node.arguments.unshift(context);
- },
- BindExpression: function BindExpression(path) {
- var node = path.node,
- scope = path.scope;
- var context = inferBindContext(node, scope);
- path.replaceWith(CallExpression(MemberExpression(node.callee, Identifier("bind")), [context]));
- }
- }
- };
- });
- var proposalFunctionSent = declare(function (api) {
- api.assertVersion(7);
- var isFunctionSent = function isFunctionSent(node) {
- return isIdentifier(node.meta, {
- name: "function"
- }) && isIdentifier(node.property, {
- name: "sent"
- });
- };
- var hasBeenReplaced = function hasBeenReplaced(node, sentId) {
- return isAssignmentExpression(node) && isIdentifier(node.left, {
- name: sentId
- });
- };
- var yieldVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- YieldExpression: function YieldExpression(path) {
- if (!hasBeenReplaced(path.parent, this.sentId)) {
- path.replaceWith(AssignmentExpression("=", Identifier(this.sentId), path.node));
- }
- },
- MetaProperty: function MetaProperty(path) {
- if (isFunctionSent(path.node)) {
- path.replaceWith(Identifier(this.sentId));
- }
- }
- };
- return {
- name: "proposal-function-sent",
- inherits: syntaxFunctionSent,
- visitor: {
- MetaProperty: function MetaProperty(path, state) {
- if (!isFunctionSent(path.node)) return;
- var fnPath = path.getFunctionParent();
- if (!fnPath.node.generator) {
- throw new Error("Parent generator function not found");
- }
- var sentId = path.scope.generateUid("function.sent");
- fnPath.traverse(yieldVisitor, {
- sentId: sentId
- });
- fnPath.node.body.body.unshift(VariableDeclaration("let", [VariableDeclarator(Identifier(sentId), YieldExpression())]));
- wrapFunction(fnPath, state.addHelper("skipFirstGeneratorNext"));
- }
- }
- };
- });
- var lib$6 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-json-strings",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("jsonStrings");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxJsonStrings = unwrapExports(lib$6);
- var proposalJsonStrings = declare(function (api) {
- api.assertVersion(7);
- var regex = /(\\*)([\u2028\u2029])/g;
- function replace(match, escapes, separator) {
- var isEscaped = escapes.length % 2 === 1;
- if (isEscaped) return match;
- return escapes + "\\u" + separator.charCodeAt(0).toString(16);
- }
- return {
- name: "proposal-json-strings",
- inherits: syntaxJsonStrings,
- visitor: {
- "DirectiveLiteral|StringLiteral": function DirectiveLiteralStringLiteral(_ref) {
- var node = _ref.node;
- var extra = node.extra;
- if (!extra || !extra.raw) return;
- extra.raw = extra.raw.replace(regex, replace);
- }
- }
- };
- });
- var syntaxLogicalAssignmentOperators = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-logical-assignment-operators",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("logicalAssignment");
- }
- };
- });
- var proposalLogicalAssignmentOperators = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-logical-assignment-operators",
- inherits: syntaxLogicalAssignmentOperators,
- visitor: {
- AssignmentExpression: function AssignmentExpression$1(path) {
- var node = path.node,
- scope = path.scope;
- var operator = node.operator,
- left = node.left,
- right = node.right;
- if (operator !== "||=" && operator !== "&&=" && operator !== "??=") {
- return;
- }
- var lhs = cloneNode(left);
- if (isMemberExpression(left)) {
- var object = left.object,
- property = left.property,
- computed = left.computed;
- var memo = scope.maybeGenerateMemoised(object);
- if (memo) {
- left.object = memo;
- lhs.object = AssignmentExpression("=", cloneNode(memo), object);
- }
- if (computed) {
- var _memo = scope.maybeGenerateMemoised(property);
- if (_memo) {
- left.property = _memo;
- lhs.property = AssignmentExpression("=", cloneNode(_memo), property);
- }
- }
- }
- path.replaceWith(LogicalExpression(operator.slice(0, -1), lhs, AssignmentExpression("=", left, right)));
- }
- }
- };
- });
- var lib$7 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-nullish-coalescing-operator",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("nullishCoalescingOperator");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxNullishCoalescingOperator = unwrapExports(lib$7);
- var proposalNullishCoalescingOperator = declare(function (api, _ref) {
- var _ref$loose = _ref.loose,
- loose = _ref$loose === void 0 ? false : _ref$loose;
- api.assertVersion(7);
- return {
- name: "proposal-nullish-coalescing-operator",
- inherits: syntaxNullishCoalescingOperator,
- visitor: {
- LogicalExpression: function LogicalExpression$1(path) {
- var node = path.node,
- scope = path.scope;
- if (node.operator !== "??") {
- return;
- }
- var ref = scope.maybeGenerateMemoised(node.left);
- var assignment;
- if (ref === null) {
- ref = node.left;
- assignment = cloneNode(node.left);
- } else {
- assignment = AssignmentExpression("=", ref, node.left);
- }
- path.replaceWith(ConditionalExpression(loose ? BinaryExpression("!=", assignment, NullLiteral()) : LogicalExpression("&&", BinaryExpression("!==", assignment, NullLiteral()), BinaryExpression("!==", cloneNode(ref), scope.buildUndefinedNode())), cloneNode(ref), node.right));
- }
- }
- };
- });
- var syntaxNumericSeparator = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-numeric-separator",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("numericSeparator");
- }
- };
- });
- var proposalNumericSeparator = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-numeric-separator",
- inherits: syntaxNumericSeparator,
- visitor: {
- NumericLiteral: function NumericLiteral(_ref) {
- var node = _ref.node;
- var extra = node.extra;
- if (extra && /_/.test(extra.raw)) {
- extra.raw = extra.raw.replace(/_/g, "");
- }
- }
- }
- };
- });
- var lib$8 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-object-rest-spread",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("objectRestSpread");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxObjectRestSpread$1 = unwrapExports(lib$8);
- var ZERO_REFS = function () {
- var node = Identifier("a");
- var property = ObjectProperty(Identifier("key"), node);
- var pattern = ObjectPattern([property]);
- return isReferenced(node, property, pattern) ? 1 : 0;
- }();
- var proposalObjectRestSpread = declare(function (api, opts) {
- api.assertVersion(7);
- var _opts$useBuiltIns = opts.useBuiltIns,
- useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
- _opts$loose = opts.loose,
- loose = _opts$loose === void 0 ? false : _opts$loose;
- if (typeof loose !== "boolean") {
- throw new Error(".loose must be a boolean, or undefined");
- }
- function getExtendsHelper(file) {
- return useBuiltIns ? MemberExpression(Identifier("Object"), Identifier("assign")) : file.addHelper("extends");
- }
- function hasRestElement(path) {
- var foundRestElement = false;
- visitRestElements(path, function (restElement) {
- foundRestElement = true;
- restElement.stop();
- });
- return foundRestElement;
- }
- function hasObjectPatternRestElement(path) {
- var foundRestElement = false;
- visitRestElements(path, function (restElement) {
- if (restElement.parentPath.isObjectPattern()) {
- foundRestElement = true;
- restElement.stop();
- }
- });
- return foundRestElement;
- }
- function visitRestElements(path, visitor) {
- path.traverse({
- Expression: function Expression(path) {
- var parentType = path.parent.type;
- if (parentType === "AssignmentPattern" && path.key === "right" || parentType === "ObjectProperty" && path.parent.computed && path.key === "key") {
- path.skip();
- }
- },
- RestElement: visitor
- });
- }
- function hasSpread(node) {
- for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var prop = _ref;
- if (isSpreadElement(prop)) {
- return true;
- }
- }
- return false;
- }
- function extractNormalizedKeys(path) {
- var props = path.node.properties;
- var keys = [];
- var allLiteral = true;
- for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var prop = _ref2;
- if (isIdentifier(prop.key) && !prop.computed) {
- keys.push(StringLiteral(prop.key.name));
- } else if (isTemplateLiteral(prop.key)) {
- keys.push(cloneNode(prop.key));
- } else if (isLiteral(prop.key)) {
- keys.push(StringLiteral(String(prop.key.value)));
- } else {
- keys.push(cloneNode(prop.key));
- allLiteral = false;
- }
- }
- return {
- keys: keys,
- allLiteral: allLiteral
- };
- }
- function replaceImpureComputedKeys(properties, scope) {
- var impureComputedPropertyDeclarators = [];
- for (var _iterator3 = properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
- var propPath = _ref3;
- var key = propPath.get("key");
- if (propPath.node.computed && !key.isPure()) {
- var name = scope.generateUidBasedOnNode(key.node);
- var declarator = VariableDeclarator(Identifier(name), key.node);
- impureComputedPropertyDeclarators.push(declarator);
- key.replaceWith(Identifier(name));
- }
- }
- return impureComputedPropertyDeclarators;
- }
- function removeUnusedExcludedKeys(path) {
- var bindings = path.getOuterBindingIdentifierPaths();
- Object.keys(bindings).forEach(function (bindingName) {
- var bindingParentPath = bindings[bindingName].parentPath;
- if (path.scope.getBinding(bindingName).references > ZERO_REFS || !bindingParentPath.isObjectProperty()) {
- return;
- }
- bindingParentPath.remove();
- });
- }
- function createObjectSpread(path, file, objRef) {
- var props = path.get("properties");
- var last = props[props.length - 1];
- assertRestElement(last.node);
- var restElement = cloneNode(last.node);
- last.remove();
- var impureComputedPropertyDeclarators = replaceImpureComputedKeys(path.get("properties"), path.scope);
- var _extractNormalizedKey = extractNormalizedKeys(path),
- keys = _extractNormalizedKey.keys,
- allLiteral = _extractNormalizedKey.allLiteral;
- if (keys.length === 0) {
- return [impureComputedPropertyDeclarators, restElement.argument, CallExpression(getExtendsHelper(file), [ObjectExpression([]), cloneNode(objRef)])];
- }
- var keyExpression;
- if (!allLiteral) {
- keyExpression = CallExpression(MemberExpression(ArrayExpression(keys), Identifier("map")), [file.addHelper("toPropertyKey")]);
- } else {
- keyExpression = ArrayExpression(keys);
- }
- return [impureComputedPropertyDeclarators, restElement.argument, CallExpression(file.addHelper("objectWithoutProperties" + (loose ? "Loose" : "")), [cloneNode(objRef), keyExpression])];
- }
- function replaceRestElement(parentPath, paramPath) {
- if (paramPath.isAssignmentPattern()) {
- replaceRestElement(parentPath, paramPath.get("left"));
- return;
- }
- if (paramPath.isArrayPattern() && hasRestElement(paramPath)) {
- var elements = paramPath.get("elements");
- for (var i = 0; i < elements.length; i++) {
- replaceRestElement(parentPath, elements[i]);
- }
- }
- if (paramPath.isObjectPattern() && hasRestElement(paramPath)) {
- var uid = parentPath.scope.generateUidIdentifier("ref");
- var declar = VariableDeclaration("let", [VariableDeclarator(paramPath.node, uid)]);
- parentPath.ensureBlock();
- parentPath.get("body").unshiftContainer("body", declar);
- paramPath.replaceWith(cloneNode(uid));
- }
- }
- return {
- name: "proposal-object-rest-spread",
- inherits: syntaxObjectRestSpread$1,
- visitor: {
- Function: function Function(path) {
- var params = path.get("params");
- for (var i = params.length - 1; i >= 0; i--) {
- replaceRestElement(params[i].parentPath, params[i]);
- }
- },
- VariableDeclarator: function VariableDeclarator$1(path, file) {
- if (!path.get("id").isObjectPattern()) {
- return;
- }
- var insertionPath = path;
- var originalPath = path;
- visitRestElements(path.get("id"), function (path) {
- if (!path.parentPath.isObjectPattern()) {
- return;
- }
- if (originalPath.node.id.properties.length > 1 && !isIdentifier(originalPath.node.init)) {
- var initRef = path.scope.generateUidIdentifierBasedOnNode(originalPath.node.init, "ref");
- originalPath.insertBefore(VariableDeclarator(initRef, originalPath.node.init));
- originalPath.replaceWith(VariableDeclarator(originalPath.node.id, cloneNode(initRef)));
- return;
- }
- var ref = originalPath.node.init;
- var refPropertyPath = [];
- var kind;
- path.findParent(function (path) {
- if (path.isObjectProperty()) {
- refPropertyPath.unshift(path);
- } else if (path.isVariableDeclarator()) {
- kind = path.parentPath.node.kind;
- return true;
- }
- });
- var impureObjRefComputedDeclarators = replaceImpureComputedKeys(refPropertyPath, path.scope);
- refPropertyPath.forEach(function (prop) {
- var node = prop.node;
- ref = MemberExpression(ref, cloneNode(node.key), node.computed);
- });
- var objectPatternPath = path.findParent(function (path) {
- return path.isObjectPattern();
- });
- var _createObjectSpread = createObjectSpread(objectPatternPath, file, ref),
- impureComputedPropertyDeclarators = _createObjectSpread[0],
- argument = _createObjectSpread[1],
- callExpression = _createObjectSpread[2];
- if (loose) {
- removeUnusedExcludedKeys(objectPatternPath);
- }
- assertIdentifier(argument);
- insertionPath.insertBefore(impureComputedPropertyDeclarators);
- insertionPath.insertBefore(impureObjRefComputedDeclarators);
- insertionPath.insertAfter(VariableDeclarator(argument, callExpression));
- insertionPath = insertionPath.getSibling(insertionPath.key + 1);
- path.scope.registerBinding(kind, insertionPath);
- if (objectPatternPath.node.properties.length === 0) {
- objectPatternPath.findParent(function (path) {
- return path.isObjectProperty() || path.isVariableDeclarator();
- }).remove();
- }
- });
- },
- ExportNamedDeclaration: function ExportNamedDeclaration$1(path) {
- var declaration = path.get("declaration");
- if (!declaration.isVariableDeclaration()) return;
- var hasRest = declaration.get("declarations").some(function (path) {
- return hasRestElement(path.get("id"));
- });
- if (!hasRest) return;
- var specifiers = [];
- for (var _i4 = 0, _Object$keys = Object.keys(path.getOuterBindingIdentifiers(path)); _i4 < _Object$keys.length; _i4++) {
- var name = _Object$keys[_i4];
- specifiers.push(ExportSpecifier(Identifier(name), Identifier(name)));
- }
- path.replaceWith(declaration.node);
- path.insertAfter(ExportNamedDeclaration(null, specifiers));
- },
- CatchClause: function CatchClause(path) {
- var paramPath = path.get("param");
- replaceRestElement(paramPath.parentPath, paramPath);
- },
- AssignmentExpression: function AssignmentExpression$1(path, file) {
- var leftPath = path.get("left");
- if (leftPath.isObjectPattern() && hasRestElement(leftPath)) {
- var nodes = [];
- var refName = path.scope.generateUidBasedOnNode(path.node.right, "ref");
- nodes.push(VariableDeclaration("var", [VariableDeclarator(Identifier(refName), path.node.right)]));
- var _createObjectSpread2 = createObjectSpread(leftPath, file, Identifier(refName)),
- impureComputedPropertyDeclarators = _createObjectSpread2[0],
- argument = _createObjectSpread2[1],
- callExpression = _createObjectSpread2[2];
- if (impureComputedPropertyDeclarators.length > 0) {
- nodes.push(VariableDeclaration("var", impureComputedPropertyDeclarators));
- }
- var nodeWithoutSpread = cloneNode(path.node);
- nodeWithoutSpread.right = Identifier(refName);
- nodes.push(ExpressionStatement(nodeWithoutSpread));
- nodes.push(toStatement(AssignmentExpression("=", argument, callExpression)));
- nodes.push(ExpressionStatement(Identifier(refName)));
- path.replaceWithMultiple(nodes);
- }
- },
- ForXStatement: function ForXStatement(path) {
- var node = path.node,
- scope = path.scope;
- var leftPath = path.get("left");
- var left = node.left;
- if (!hasObjectPatternRestElement(leftPath)) {
- return;
- }
- if (!isVariableDeclaration(left)) {
- var temp = scope.generateUidIdentifier("ref");
- node.left = VariableDeclaration("var", [VariableDeclarator(temp)]);
- path.ensureBlock();
- if (node.body.body.length === 0 && path.isCompletionRecord()) {
- node.body.body.unshift(ExpressionStatement(scope.buildUndefinedNode()));
- }
- node.body.body.unshift(ExpressionStatement(AssignmentExpression("=", left, cloneNode(temp))));
- } else {
- var pattern = left.declarations[0].id;
- var key = scope.generateUidIdentifier("ref");
- node.left = VariableDeclaration(left.kind, [VariableDeclarator(key, null)]);
- path.ensureBlock();
- node.body.body.unshift(VariableDeclaration(node.left.kind, [VariableDeclarator(pattern, cloneNode(key))]));
- }
- },
- ArrayPattern: function ArrayPattern(path) {
- var objectPatterns = [];
- visitRestElements(path, function (path) {
- if (!path.parentPath.isObjectPattern()) {
- return;
- }
- var objectPattern = path.parentPath;
- var uid = path.scope.generateUidIdentifier("ref");
- objectPatterns.push(VariableDeclarator(objectPattern.node, uid));
- objectPattern.replaceWith(cloneNode(uid));
- path.skip();
- });
- if (objectPatterns.length > 0) {
- var statementPath = path.getStatementParent();
- statementPath.insertAfter(VariableDeclaration(statementPath.node.kind || "var", objectPatterns));
- }
- },
- ObjectExpression: function ObjectExpression$1(path, file) {
- if (!hasSpread(path.node)) return;
- var args = [];
- var props = [];
- function push() {
- args.push(ObjectExpression(props));
- props = [];
- }
- for (var _i5 = 0, _arr = path.node.properties; _i5 < _arr.length; _i5++) {
- var prop = _arr[_i5];
- if (isSpreadElement(prop)) {
- push();
- args.push(prop.argument);
- } else {
- props.push(prop);
- }
- }
- if (props.length) {
- push();
- }
- var helper;
- if (loose) {
- helper = getExtendsHelper(file);
- } else {
- try {
- helper = file.addHelper("objectSpread2");
- } catch (_unused) {
- this.file.declarations["objectSpread2"] = null;
- helper = file.addHelper("objectSpread");
- }
- }
- path.replaceWith(CallExpression(helper, args));
- }
- }
- };
- });
- var lib$9 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-optional-catch-binding",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("optionalCatchBinding");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxOptionalCatchBinding$1 = unwrapExports(lib$9);
- var proposalOptionalCatchBinding = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-optional-catch-binding",
- inherits: syntaxOptionalCatchBinding$1,
- visitor: {
- CatchClause: function CatchClause(path) {
- if (!path.node.param) {
- var uid = path.scope.generateUidIdentifier("unused");
- var paramPath = path.get("param");
- paramPath.replaceWith(uid);
- }
- }
- }
- };
- });
- var lib$a = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-optional-chaining",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("optionalChaining");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxOptionalChaining = unwrapExports(lib$a);
- var proposalOptionalChaining = declare(function (api, options) {
- api.assertVersion(7);
- var _options$loose = options.loose,
- loose = _options$loose === void 0 ? false : _options$loose;
- return {
- name: "proposal-optional-chaining",
- inherits: syntaxOptionalChaining,
- visitor: {
- "OptionalCallExpression|OptionalMemberExpression": function OptionalCallExpressionOptionalMemberExpression(path) {
- var parentPath = path.parentPath,
- scope = path.scope;
- var isDeleteOperation = false;
- var optionals = [];
- var optionalPath = path;
- while (optionalPath.isOptionalMemberExpression() || optionalPath.isOptionalCallExpression()) {
- var _optionalPath = optionalPath,
- node = _optionalPath.node;
- if (node.optional) {
- optionals.push(node);
- }
- if (optionalPath.isOptionalMemberExpression()) {
- optionalPath.node.type = "MemberExpression";
- optionalPath = optionalPath.get("object");
- } else if (optionalPath.isOptionalCallExpression()) {
- optionalPath.node.type = "CallExpression";
- optionalPath = optionalPath.get("callee");
- }
- }
- var replacementPath = path;
- if (parentPath.isUnaryExpression({
- operator: "delete"
- })) {
- replacementPath = parentPath;
- isDeleteOperation = true;
- }
- for (var i = optionals.length - 1; i >= 0; i--) {
- var _node = optionals[i];
- var isCall = isCallExpression(_node);
- var replaceKey = isCall ? "callee" : "object";
- var chain = _node[replaceKey];
- var ref = void 0;
- var check = void 0;
- if (loose && isCall) {
- check = ref = chain;
- } else {
- ref = scope.maybeGenerateMemoised(chain);
- if (ref) {
- check = AssignmentExpression("=", cloneNode(ref), chain);
- _node[replaceKey] = ref;
- } else {
- check = ref = chain;
- }
- }
- if (isCall && isMemberExpression(chain)) {
- if (loose) {
- _node.callee = chain;
- } else {
- var object = chain.object;
- var context = scope.maybeGenerateMemoised(object);
- if (context) {
- chain.object = AssignmentExpression("=", context, object);
- } else if (isSuper(object)) {
- context = ThisExpression();
- } else {
- context = object;
- }
- _node.arguments.unshift(cloneNode(context));
- _node.callee = MemberExpression(_node.callee, Identifier("call"));
- }
- }
- replacementPath.replaceWith(ConditionalExpression(loose ? BinaryExpression("==", cloneNode(check), NullLiteral()) : LogicalExpression("||", BinaryExpression("===", cloneNode(check), NullLiteral()), BinaryExpression("===", cloneNode(ref), scope.buildUndefinedNode())), isDeleteOperation ? BooleanLiteral(true) : scope.buildUndefinedNode(), replacementPath.node));
- replacementPath = replacementPath.get("alternate");
- }
- }
- }
- };
- });
- var buildOptimizedSequenceExpression = function buildOptimizedSequenceExpression(_ref) {
- var assign = _ref.assign,
- call = _ref.call,
- path = _ref.path;
- var placeholderNode = assign.left,
- pipelineLeft = assign.right;
- var calledExpression = call.callee;
- var optimizeArrow = isArrowFunctionExpression(calledExpression) && isExpression(calledExpression.body) && !calledExpression.async && !calledExpression.generator;
- var param;
- if (optimizeArrow) {
- var params = calledExpression.params;
- if (params.length === 1 && isIdentifier(params[0])) {
- param = params[0];
- } else if (params.length > 0) {
- optimizeArrow = false;
- }
- } else if (isIdentifier(calledExpression, {
- name: "eval"
- })) {
- var evalSequence = SequenceExpression([NumericLiteral(0), calledExpression]);
- call.callee = evalSequence;
- path.scope.push({
- id: placeholderNode
- });
- return SequenceExpression([assign, call]);
- }
- if (optimizeArrow && !param) {
- return SequenceExpression([pipelineLeft, calledExpression.body]);
- }
- path.scope.push({
- id: placeholderNode
- });
- if (param) {
- path.get("right").scope.rename(param.name, placeholderNode.name);
- return SequenceExpression([assign, calledExpression.body]);
- }
- return SequenceExpression([assign, call]);
- };
- var minimalVisitor = {
- BinaryExpression: function BinaryExpression(path) {
- var scope = path.scope,
- node = path.node;
- var operator = node.operator,
- left = node.left,
- right = node.right;
- if (operator !== "|>") return;
- var placeholder = scope.generateUidIdentifierBasedOnNode(left);
- var call = CallExpression(right, [cloneNode(placeholder)]);
- path.replaceWith(buildOptimizedSequenceExpression({
- assign: AssignmentExpression("=", cloneNode(placeholder), left),
- call: call,
- path: path
- }));
- }
- };
- var updateTopicReferenceVisitor = {
- PipelinePrimaryTopicReference: function PipelinePrimaryTopicReference(path) {
- path.replaceWith(this.topicId);
- },
- PipelineTopicExpression: function PipelineTopicExpression(path) {
- path.skip();
- }
- };
- var smartVisitor = {
- BinaryExpression: function BinaryExpression(path) {
- var scope = path.scope;
- var node = path.node;
- var operator = node.operator,
- left = node.left,
- right = node.right;
- if (operator !== "|>") return;
- var placeholder = scope.generateUidIdentifierBasedOnNode(left);
- scope.push({
- id: placeholder
- });
- var call;
- if (isPipelineTopicExpression(right)) {
- path.get("right").traverse(updateTopicReferenceVisitor, {
- topicId: placeholder
- });
- call = right.expression;
- } else {
- var callee = right.callee;
- if (isIdentifier(callee, {
- name: "eval"
- })) {
- callee = SequenceExpression([NumericLiteral(0), callee]);
- }
- call = CallExpression(callee, [cloneNode(placeholder)]);
- }
- path.replaceWith(SequenceExpression([AssignmentExpression("=", cloneNode(placeholder), left), call]));
- }
- };
- var fsharpVisitor = {
- BinaryExpression: function BinaryExpression(path) {
- var scope = path.scope,
- node = path.node;
- var operator = node.operator,
- left = node.left,
- right = node.right;
- if (operator !== "|>") return;
- var placeholder = scope.generateUidIdentifierBasedOnNode(left);
- var call = right.type === "AwaitExpression" ? AwaitExpression(cloneNode(placeholder)) : CallExpression(right, [cloneNode(placeholder)]);
- var sequence = buildOptimizedSequenceExpression({
- assign: AssignmentExpression("=", cloneNode(placeholder), left),
- call: call,
- path: path
- });
- path.replaceWith(sequence);
- }
- };
- var visitorsPerProposal = {
- minimal: minimalVisitor,
- smart: smartVisitor,
- fsharp: fsharpVisitor
- };
- var proposalPipelineOperator = declare(function (api, options) {
- api.assertVersion(7);
- return {
- name: "proposal-pipeline-operator",
- inherits: syntaxPipelineOperator,
- visitor: visitorsPerProposal[options.proposal]
- };
- });
- var proposalPrivateMethods = declare(function (api, options) {
- api.assertVersion(7);
- return createClassFeaturePlugin({
- name: "proposal-private-methods",
- feature: FEATURES.privateMethods,
- loose: options.loose,
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("classPrivateMethods");
- }
- });
- });
- var syntaxThrowExpressions = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-throw-expressions",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("throwExpressions");
- }
- };
- });
- var proposalThrowExpressions = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "proposal-throw-expressions",
- inherits: syntaxThrowExpressions,
- visitor: {
- UnaryExpression: function UnaryExpression(path) {
- var _path$node = path.node,
- operator = _path$node.operator,
- argument = _path$node.argument;
- if (operator !== "throw") return;
- var arrow = FunctionExpression(null, [Identifier("e")], BlockStatement([ThrowStatement(Identifier("e"))]));
- path.replaceWith(CallExpression(arrow, [argument]));
- }
- }
- };
- });
- var regjsgen = createCommonjsModule(function (module, exports) {
- (function () {
- var objectTypes = {
- 'function': true,
- 'object': true
- };
- var root = objectTypes[typeof window] && window || this;
- var freeExports = objectTypes['object'] && exports && !exports.nodeType && exports;
- var hasFreeModule = objectTypes['object'] && module && !module.nodeType;
- var freeGlobal = freeExports && hasFreeModule && typeof commonjsGlobal == 'object' && commonjsGlobal;
- if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
- root = freeGlobal;
- }
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- function fromCodePoint() {
- var codePoint = Number(arguments[0]);
- if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || Math.floor(codePoint) != codePoint) {
- throw RangeError('Invalid code point: ' + codePoint);
- }
- if (codePoint <= 0xFFFF) {
- return String.fromCharCode(codePoint);
- } else {
- codePoint -= 0x10000;
- var highSurrogate = (codePoint >> 10) + 0xD800;
- var lowSurrogate = codePoint % 0x400 + 0xDC00;
- return String.fromCharCode(highSurrogate, lowSurrogate);
- }
- }
- var assertTypeRegexMap = {};
- function assertType(type, expected) {
- if (expected.indexOf('|') == -1) {
- if (type == expected) {
- return;
- }
- throw Error('Invalid node type: ' + type + '; expected type: ' + expected);
- }
- expected = hasOwnProperty.call(assertTypeRegexMap, expected) ? assertTypeRegexMap[expected] : assertTypeRegexMap[expected] = RegExp('^(?:' + expected + ')$');
- if (expected.test(type)) {
- return;
- }
- throw Error('Invalid node type: ' + type + '; expected types: ' + expected);
- }
- function generate(node) {
- var type = node.type;
- if (hasOwnProperty.call(generators, type)) {
- return generators[type](node);
- }
- throw Error('Invalid node type: ' + type);
- }
- function generateAlternative(node) {
- assertType(node.type, 'alternative');
- var terms = node.body,
- i = -1,
- length = terms.length,
- result = '';
- while (++i < length) {
- result += generateTerm(terms[i]);
- }
- return result;
- }
- function generateAnchor(node) {
- assertType(node.type, 'anchor');
- switch (node.kind) {
- case 'start':
- return '^';
- case 'end':
- return '$';
- case 'boundary':
- return '\\b';
- case 'not-boundary':
- return '\\B';
- default:
- throw Error('Invalid assertion');
- }
- }
- function generateAtom(node) {
- assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');
- return generate(node);
- }
- function generateCharacterClass(node) {
- assertType(node.type, 'characterClass');
- var classRanges = node.body,
- i = -1,
- length = classRanges.length,
- result = '';
- if (node.negative) {
- result += '^';
- }
- while (++i < length) {
- result += generateClassAtom(classRanges[i]);
- }
- return '[' + result + ']';
- }
- function generateCharacterClassEscape(node) {
- assertType(node.type, 'characterClassEscape');
- return '\\' + node.value;
- }
- function generateUnicodePropertyEscape(node) {
- assertType(node.type, 'unicodePropertyEscape');
- return '\\' + (node.negative ? 'P' : 'p') + '{' + node.value + '}';
- }
- function generateCharacterClassRange(node) {
- assertType(node.type, 'characterClassRange');
- var min = node.min,
- max = node.max;
- if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {
- throw Error('Invalid character class range');
- }
- return generateClassAtom(min) + '-' + generateClassAtom(max);
- }
- function generateClassAtom(node) {
- assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');
- return generate(node);
- }
- function generateDisjunction(node) {
- assertType(node.type, 'disjunction');
- var body = node.body,
- i = -1,
- length = body.length,
- result = '';
- while (++i < length) {
- if (i != 0) {
- result += '|';
- }
- result += generate(body[i]);
- }
- return result;
- }
- function generateDot(node) {
- assertType(node.type, 'dot');
- return '.';
- }
- function generateGroup(node) {
- assertType(node.type, 'group');
- var result = '';
- switch (node.behavior) {
- case 'normal':
- if (node.name) {
- result += '?<' + generateIdentifier(node.name) + '>';
- }
- break;
- case 'ignore':
- result += '?:';
- break;
- case 'lookahead':
- result += '?=';
- break;
- case 'negativeLookahead':
- result += '?!';
- break;
- case 'lookbehind':
- result += '?<=';
- break;
- case 'negativeLookbehind':
- result += '?<!';
- break;
- default:
- throw Error('Invalid behaviour: ' + node.behaviour);
- }
- var body = node.body,
- i = -1,
- length = body.length;
- while (++i < length) {
- result += generate(body[i]);
- }
- return '(' + result + ')';
- }
- function generateIdentifier(node) {
- assertType(node.type, 'identifier');
- return node.value;
- }
- function generateQuantifier(node) {
- assertType(node.type, 'quantifier');
- var quantifier = '',
- min = node.min,
- max = node.max;
- if (max == null) {
- if (min == 0) {
- quantifier = '*';
- } else if (min == 1) {
- quantifier = '+';
- } else {
- quantifier = '{' + min + ',}';
- }
- } else if (min == max) {
- quantifier = '{' + min + '}';
- } else if (min == 0 && max == 1) {
- quantifier = '?';
- } else {
- quantifier = '{' + min + ',' + max + '}';
- }
- if (!node.greedy) {
- quantifier += '?';
- }
- return generateAtom(node.body[0]) + quantifier;
- }
- function generateReference(node) {
- assertType(node.type, 'reference');
- if (node.matchIndex) {
- return '\\' + node.matchIndex;
- }
- if (node.name) {
- return '\\k<' + generateIdentifier(node.name) + '>';
- }
- throw new Error('Unknown reference type');
- }
- function generateTerm(node) {
- assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|unicodePropertyEscape|value|dot');
- return generate(node);
- }
- function generateValue(node) {
- assertType(node.type, 'value');
- var kind = node.kind,
- codePoint = node.codePoint;
- if (typeof codePoint != 'number') {
- throw new Error('Invalid code point: ' + codePoint);
- }
- switch (kind) {
- case 'controlLetter':
- return '\\c' + fromCodePoint(codePoint + 64);
- case 'hexadecimalEscape':
- return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);
- case 'identifier':
- return '\\' + fromCodePoint(codePoint);
- case 'null':
- return '\\' + codePoint;
- case 'octal':
- return '\\' + codePoint.toString(8);
- case 'singleEscape':
- switch (codePoint) {
- case 0x0008:
- return '\\b';
- case 0x0009:
- return '\\t';
- case 0x000A:
- return '\\n';
- case 0x000B:
- return '\\v';
- case 0x000C:
- return '\\f';
- case 0x000D:
- return '\\r';
- default:
- throw Error('Invalid code point: ' + codePoint);
- }
- case 'symbol':
- return fromCodePoint(codePoint);
- case 'unicodeEscape':
- return "\\u" + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);
- case 'unicodeCodePointEscape':
- return "\\u{" + codePoint.toString(16).toUpperCase() + '}';
- default:
- throw Error('Unsupported node kind: ' + kind);
- }
- }
- var generators = {
- 'alternative': generateAlternative,
- 'anchor': generateAnchor,
- 'characterClass': generateCharacterClass,
- 'characterClassEscape': generateCharacterClassEscape,
- 'characterClassRange': generateCharacterClassRange,
- 'unicodePropertyEscape': generateUnicodePropertyEscape,
- 'disjunction': generateDisjunction,
- 'dot': generateDot,
- 'group': generateGroup,
- 'quantifier': generateQuantifier,
- 'reference': generateReference,
- 'value': generateValue
- };
- var regjsgen = {
- 'generate': generate
- };
- if (freeExports && hasFreeModule) {
- freeExports.generate = generate;
- } else {
- root.regjsgen = regjsgen;
- }
- }).call(commonjsGlobal);
- });
- var parser$1 = createCommonjsModule(function (module) {
- (function () {
- var fromCodePoint = String.fromCodePoint || function () {
- var stringFromCharCode = String.fromCharCode;
- var floor = Math.floor;
- return function fromCodePoint() {
- var MAX_SIZE = 0x4000;
- var codeUnits = [];
- var highSurrogate;
- var lowSurrogate;
- var index = -1;
- var length = arguments.length;
- if (!length) {
- return '';
- }
- var result = '';
- while (++index < length) {
- var codePoint = Number(arguments[index]);
- if (!isFinite(codePoint) || codePoint < 0 || codePoint > 0x10FFFF || floor(codePoint) != codePoint) {
- throw RangeError('Invalid code point: ' + codePoint);
- }
- if (codePoint <= 0xFFFF) {
- codeUnits.push(codePoint);
- } else {
- codePoint -= 0x10000;
- highSurrogate = (codePoint >> 10) + 0xD800;
- lowSurrogate = codePoint % 0x400 + 0xDC00;
- codeUnits.push(highSurrogate, lowSurrogate);
- }
- if (index + 1 == length || codeUnits.length > MAX_SIZE) {
- result += stringFromCharCode.apply(null, codeUnits);
- codeUnits.length = 0;
- }
- }
- return result;
- };
- }();
- function parse(str, flags, features) {
- if (!features) {
- features = {};
- }
- function addRaw(node) {
- node.raw = str.substring(node.range[0], node.range[1]);
- return node;
- }
- function updateRawStart(node, start) {
- node.range[0] = start;
- return addRaw(node);
- }
- function createAnchor(kind, rawLength) {
- return addRaw({
- type: 'anchor',
- kind: kind,
- range: [pos - rawLength, pos]
- });
- }
- function createValue(kind, codePoint, from, to) {
- return addRaw({
- type: 'value',
- kind: kind,
- codePoint: codePoint,
- range: [from, to]
- });
- }
- function createEscaped(kind, codePoint, value, fromOffset) {
- fromOffset = fromOffset || 0;
- return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);
- }
- function createCharacter(matches) {
- var _char = matches[0];
- var first = _char.charCodeAt(0);
- if (hasUnicodeFlag) {
- var second;
- if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {
- second = lookahead().charCodeAt(0);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- pos++;
- return createValue('symbol', (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, pos - 2, pos);
- }
- }
- }
- return createValue('symbol', first, pos - 1, pos);
- }
- function createDisjunction(alternatives, from, to) {
- return addRaw({
- type: 'disjunction',
- body: alternatives,
- range: [from, to]
- });
- }
- function createDot() {
- return addRaw({
- type: 'dot',
- range: [pos - 1, pos]
- });
- }
- function createCharacterClassEscape(value) {
- return addRaw({
- type: 'characterClassEscape',
- value: value,
- range: [pos - 2, pos]
- });
- }
- function createReference(matchIndex) {
- return addRaw({
- type: 'reference',
- matchIndex: parseInt(matchIndex, 10),
- range: [pos - 1 - matchIndex.length, pos]
- });
- }
- function createNamedReference(name) {
- return addRaw({
- type: 'reference',
- name: name,
- range: [name.range[0] - 3, pos]
- });
- }
- function createGroup(behavior, disjunction, from, to) {
- return addRaw({
- type: 'group',
- behavior: behavior,
- body: disjunction,
- range: [from, to]
- });
- }
- function createQuantifier(min, max, from, to) {
- if (to == null) {
- from = pos - 1;
- to = pos;
- }
- return addRaw({
- type: 'quantifier',
- min: min,
- max: max,
- greedy: true,
- body: null,
- range: [from, to]
- });
- }
- function createAlternative(terms, from, to) {
- return addRaw({
- type: 'alternative',
- body: terms,
- range: [from, to]
- });
- }
- function createCharacterClass(classRanges, negative, from, to) {
- return addRaw({
- type: 'characterClass',
- body: classRanges,
- negative: negative,
- range: [from, to]
- });
- }
- function createClassRange(min, max, from, to) {
- if (min.codePoint > max.codePoint) {
- bail('invalid range in character class', min.raw + '-' + max.raw, from, to);
- }
- return addRaw({
- type: 'characterClassRange',
- min: min,
- max: max,
- range: [from, to]
- });
- }
- function flattenBody(body) {
- if (body.type === 'alternative') {
- return body.body;
- } else {
- return [body];
- }
- }
- function incr(amount) {
- amount = amount || 1;
- var res = str.substring(pos, pos + amount);
- pos += amount || 1;
- return res;
- }
- function skip(value) {
- if (!match(value)) {
- bail('character', value);
- }
- }
- function match(value) {
- if (str.indexOf(value, pos) === pos) {
- return incr(value.length);
- }
- }
- function lookahead() {
- return str[pos];
- }
- function current(value) {
- return str.indexOf(value, pos) === pos;
- }
- function next(value) {
- return str[pos + 1] === value;
- }
- function matchReg(regExp) {
- var subStr = str.substring(pos);
- var res = subStr.match(regExp);
- if (res) {
- res.range = [];
- res.range[0] = pos;
- incr(res[0].length);
- res.range[1] = pos;
- }
- return res;
- }
- function parseDisjunction() {
- var res = [],
- from = pos;
- res.push(parseAlternative());
- while (match('|')) {
- res.push(parseAlternative());
- }
- if (res.length === 1) {
- return res[0];
- }
- return createDisjunction(res, from, pos);
- }
- function parseAlternative() {
- var res = [],
- from = pos;
- var term;
- while (term = parseTerm()) {
- res.push(term);
- }
- if (res.length === 1) {
- return res[0];
- }
- return createAlternative(res, from, pos);
- }
- function parseTerm() {
- if (pos >= str.length || current('|') || current(')')) {
- return null;
- }
- var anchor = parseAnchor();
- if (anchor) {
- return anchor;
- }
- var atom = parseAtom();
- if (!atom) {
- bail('Expected atom');
- }
- var quantifier = parseQuantifier() || false;
- if (quantifier) {
- quantifier.body = flattenBody(atom);
- updateRawStart(quantifier, atom.range[0]);
- return quantifier;
- }
- return atom;
- }
- function parseGroup(matchA, typeA, matchB, typeB) {
- var type = null,
- from = pos;
- if (match(matchA)) {
- type = typeA;
- } else if (match(matchB)) {
- type = typeB;
- } else {
- return false;
- }
- return finishGroup(type, from);
- }
- function finishGroup(type, from) {
- var body = parseDisjunction();
- if (!body) {
- bail('Expected disjunction');
- }
- skip(')');
- var group = createGroup(type, flattenBody(body), from, pos);
- if (type == 'normal') {
- if (firstIteration) {
- closedCaptureCounter++;
- }
- }
- return group;
- }
- function parseAnchor() {
- if (match('^')) {
- return createAnchor('start', 1);
- } else if (match('$')) {
- return createAnchor('end', 1);
- } else if (match('\\b')) {
- return createAnchor('boundary', 2);
- } else if (match('\\B')) {
- return createAnchor('not-boundary', 2);
- } else {
- return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');
- }
- }
- function parseQuantifier() {
- var res,
- from = pos;
- var quantifier;
- var min, max;
- if (match('*')) {
- quantifier = createQuantifier(0);
- } else if (match('+')) {
- quantifier = createQuantifier(1);
- } else if (match('?')) {
- quantifier = createQuantifier(0, 1);
- } else if (res = matchReg(/^\{([0-9]+)\}/)) {
- min = parseInt(res[1], 10);
- quantifier = createQuantifier(min, min, res.range[0], res.range[1]);
- } else if (res = matchReg(/^\{([0-9]+),\}/)) {
- min = parseInt(res[1], 10);
- quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);
- } else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) {
- min = parseInt(res[1], 10);
- max = parseInt(res[2], 10);
- if (min > max) {
- bail('numbers out of order in {} quantifier', '', from, pos);
- }
- quantifier = createQuantifier(min, max, res.range[0], res.range[1]);
- }
- if (quantifier) {
- if (match('?')) {
- quantifier.greedy = false;
- quantifier.range[1] += 1;
- }
- }
- return quantifier;
- }
- function parseAtom() {
- var res;
- if (res = matchReg(/^[^^$\\.*+?(){[|]/)) {
- return createCharacter(res);
- } else if (match('.')) {
- return createDot();
- } else if (match('\\')) {
- res = parseAtomEscape();
- if (!res) {
- if (!hasUnicodeFlag && lookahead() == 'c') {
- return createValue('symbol', 92, pos - 1, pos);
- }
- bail('atomEscape');
- }
- return res;
- } else if (res = parseCharacterClass()) {
- return res;
- } else if (features.lookbehind && (res = parseGroup('(?<=', 'lookbehind', '(?<!', 'negativeLookbehind'))) {
- return res;
- } else if (features.namedGroups && match("(?<")) {
- var name = parseIdentifier();
- skip(">");
- var group = finishGroup("normal", name.range[0] - 3);
- group.name = name;
- return group;
- } else {
- return parseGroup('(?:', 'ignore', '(', 'normal');
- }
- }
- function parseUnicodeSurrogatePairEscape(firstEscape) {
- if (hasUnicodeFlag) {
- var first, second;
- if (firstEscape.kind == 'unicodeEscape' && (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && current('\\') && next('u')) {
- var prevPos = pos;
- pos++;
- var secondEscape = parseClassEscape();
- if (secondEscape.kind == 'unicodeEscape' && (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {
- firstEscape.range[1] = secondEscape.range[1];
- firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- firstEscape.type = 'value';
- firstEscape.kind = 'unicodeCodePointEscape';
- addRaw(firstEscape);
- } else {
- pos = prevPos;
- }
- }
- }
- return firstEscape;
- }
- function parseClassEscape() {
- return parseAtomEscape(true);
- }
- function parseAtomEscape(insideCharacterClass) {
- var res,
- from = pos;
- res = parseDecimalEscape() || parseNamedReference();
- if (res) {
- return res;
- }
- if (insideCharacterClass) {
- if (match('b')) {
- return createEscaped('singleEscape', 0x0008, '\\b');
- } else if (match('B')) {
- bail('\\B not possible inside of CharacterClass', '', from);
- } else if (!hasUnicodeFlag && (res = matchReg(/^c([0-9])/))) {
- return createEscaped('controlLetter', res[1] + 16, res[1], 2);
- }
- if (match('-') && hasUnicodeFlag) {
- return createEscaped('singleEscape', 0x002d, '\\-');
- }
- }
- res = parseCharacterEscape();
- return res;
- }
- function parseDecimalEscape() {
- var res, match;
- if (res = matchReg(/^(?!0)\d+/)) {
- match = res[0];
- var refIdx = parseInt(res[0], 10);
- if (refIdx <= closedCaptureCounter) {
- return createReference(res[0]);
- } else {
- backrefDenied.push(refIdx);
- incr(-res[0].length);
- if (res = matchReg(/^[0-7]{1,3}/)) {
- return createEscaped('octal', parseInt(res[0], 8), res[0], 1);
- } else {
- res = createCharacter(matchReg(/^[89]/));
- return updateRawStart(res, res.range[0] - 1);
- }
- }
- } else if (res = matchReg(/^[0-7]{1,3}/)) {
- match = res[0];
- if (/^0{1,3}$/.test(match)) {
- return createEscaped('null', 0x0000, '0', match.length + 1);
- } else {
- return createEscaped('octal', parseInt(match, 8), match, 1);
- }
- } else if (res = matchReg(/^[dDsSwW]/)) {
- return createCharacterClassEscape(res[0]);
- }
- return false;
- }
- function parseNamedReference() {
- if (features.namedGroups && matchReg(/^k<(?=.*?>)/)) {
- var name = parseIdentifier();
- skip('>');
- return createNamedReference(name);
- }
- }
- function parseRegExpUnicodeEscapeSequence() {
- var res;
- if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {
- return parseUnicodeSurrogatePairEscape(createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2));
- } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) {
- return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);
- }
- }
- function parseCharacterEscape() {
- var res;
- var from = pos;
- if (res = matchReg(/^[fnrtv]/)) {
- var codePoint = 0;
- switch (res[0]) {
- case 't':
- codePoint = 0x009;
- break;
- case 'n':
- codePoint = 0x00A;
- break;
- case 'v':
- codePoint = 0x00B;
- break;
- case 'f':
- codePoint = 0x00C;
- break;
- case 'r':
- codePoint = 0x00D;
- break;
- }
- return createEscaped('singleEscape', codePoint, '\\' + res[0]);
- } else if (res = matchReg(/^c([a-zA-Z])/)) {
- return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);
- } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {
- return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);
- } else if (res = parseRegExpUnicodeEscapeSequence()) {
- if (!res || res.codePoint > 0x10FFFF) {
- bail('Invalid escape sequence', null, from, pos);
- }
- return res;
- } else if (features.unicodePropertyEscape && hasUnicodeFlag && (res = matchReg(/^([pP])\{([^\}]+)\}/))) {
- return addRaw({
- type: 'unicodePropertyEscape',
- negative: res[1] === 'P',
- value: res[2],
- range: [res.range[0] - 1, res.range[1]],
- raw: res[0]
- });
- } else {
- return parseIdentityEscape();
- }
- }
- function parseIdentifierAtom(check) {
- var ch = lookahead();
- var from = pos;
- if (ch === '\\') {
- incr();
- var esc = parseRegExpUnicodeEscapeSequence();
- if (!esc || !check(esc.codePoint)) {
- bail('Invalid escape sequence', null, from, pos);
- }
- return fromCodePoint(esc.codePoint);
- }
- var code = ch.charCodeAt(0);
- if (code >= 0xD800 && code <= 0xDBFF) {
- ch += str[pos + 1];
- var second = ch.charCodeAt(1);
- if (second >= 0xDC00 && second <= 0xDFFF) {
- code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
- }
- }
- if (!check(code)) return;
- incr();
- if (code > 0xFFFF) incr();
- return ch;
- }
- function parseIdentifier() {
- var start = pos;
- var res = parseIdentifierAtom(isIdentifierStart);
- if (!res) {
- bail('Invalid identifier');
- }
- var ch;
- while (ch = parseIdentifierAtom(isIdentifierPart)) {
- res += ch;
- }
- return addRaw({
- type: 'identifier',
- value: res,
- range: [start, pos]
- });
- }
- function isIdentifierStart(ch) {
- var NonAsciiIdentifierStart = /[\$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\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-\u08BD\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\u0D05-\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\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-\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-\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-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\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-\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\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\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-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\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[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\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\uDD00-\uDD43]|\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\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
- return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 0x80 && NonAsciiIdentifierStart.test(fromCodePoint(ch));
- }
- function isIdentifierPart(ch) {
- var NonAsciiIdentifierPartOnly = /[0-9_\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\u0B56\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\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EB9\u0EBB\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\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\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200C\u200D\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\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]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD30-\uDD39\uDF46-\uDF50]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC66-\uDC6F\uDC7F-\uDC82\uDCB0-\uDCBA\uDCF0-\uDCF9\uDD00-\uDD02\uDD27-\uDD34\uDD36-\uDD3F\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDD0-\uDDD9\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC50-\uDC59\uDC5E\uDCB0-\uDCC3\uDCD0-\uDCD9\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDE50-\uDE59\uDEAB-\uDEB7\uDEC0-\uDEC9\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC2C-\uDC3A\uDCE0-\uDCE9\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC50-\uDC59\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD50-\uDD59\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDDA0-\uDDA9\uDEF3-\uDEF6]|\uD81A[\uDE60-\uDE69\uDEF0-\uDEF4\uDF30-\uDF36\uDF50-\uDF59]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD50-\uDD59]|\uDB40[\uDD00-\uDDEF]/;
- return isIdentifierStart(ch) || ch >= 48 && ch <= 57 || ch >= 0x80 && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch));
- }
- function parseIdentityEscape() {
- var tmp;
- var l = lookahead();
- if (hasUnicodeFlag && /[\^\$\.\*\+\?\(\)\\\[\]\{\}\|\/]/.test(l) || !hasUnicodeFlag && l !== "c") {
- if (l === "k" && features.lookbehind) {
- return null;
- }
- tmp = incr();
- return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);
- }
- return null;
- }
- function parseCharacterClass() {
- var res,
- from = pos;
- if (res = matchReg(/^\[\^/)) {
- res = parseClassRanges();
- skip(']');
- return createCharacterClass(res, true, from, pos);
- } else if (match('[')) {
- res = parseClassRanges();
- skip(']');
- return createCharacterClass(res, false, from, pos);
- }
- return null;
- }
- function parseClassRanges() {
- var res;
- if (current(']')) {
- return [];
- } else {
- res = parseNonemptyClassRanges();
- if (!res) {
- bail('nonEmptyClassRanges');
- }
- return res;
- }
- }
- function parseHelperClassRanges(atom) {
- var from, to, res;
- if (current('-') && !next(']')) {
- skip('-');
- res = parseClassAtom();
- if (!res) {
- bail('classAtom');
- }
- to = pos;
- var classRanges = parseClassRanges();
- if (!classRanges) {
- bail('classRanges');
- }
- from = atom.range[0];
- if (classRanges.type === 'empty') {
- return [createClassRange(atom, res, from, to)];
- }
- return [createClassRange(atom, res, from, to)].concat(classRanges);
- }
- res = parseNonemptyClassRangesNoDash();
- if (!res) {
- bail('nonEmptyClassRangesNoDash');
- }
- return [atom].concat(res);
- }
- function parseNonemptyClassRanges() {
- var atom = parseClassAtom();
- if (!atom) {
- bail('classAtom');
- }
- if (current(']')) {
- return [atom];
- }
- return parseHelperClassRanges(atom);
- }
- function parseNonemptyClassRangesNoDash() {
- var res = parseClassAtom();
- if (!res) {
- bail('classAtom');
- }
- if (current(']')) {
- return res;
- }
- return parseHelperClassRanges(res);
- }
- function parseClassAtom() {
- if (match('-')) {
- return createCharacter('-');
- } else {
- return parseClassAtomNoDash();
- }
- }
- function parseClassAtomNoDash() {
- var res;
- if (res = matchReg(/^[^\\\]-]/)) {
- return createCharacter(res[0]);
- } else if (match('\\')) {
- res = parseClassEscape();
- if (!res) {
- bail('classEscape');
- }
- return parseUnicodeSurrogatePairEscape(res);
- }
- }
- function bail(message, details, from, to) {
- from = from == null ? pos : from;
- to = to == null ? from : to;
- var contextStart = Math.max(0, from - 10);
- var contextEnd = Math.min(to + 10, str.length);
- var context = ' ' + str.substring(contextStart, contextEnd);
- var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';
- throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer);
- }
- var backrefDenied = [];
- var closedCaptureCounter = 0;
- var firstIteration = true;
- var hasUnicodeFlag = (flags || "").indexOf("u") !== -1;
- var pos = 0;
- str = String(str);
- if (str === '') {
- str = '(?:)';
- }
- var result = parseDisjunction();
- if (result.range[1] !== str.length) {
- bail('Could not parse entire input - got stuck', '', result.range[1]);
- }
- for (var i = 0; i < backrefDenied.length; i++) {
- if (backrefDenied[i] <= closedCaptureCounter) {
- pos = 0;
- firstIteration = false;
- return parseDisjunction();
- }
- }
- return result;
- }
- var regjsparser = {
- parse: parse
- };
- if ( module.exports) {
- module.exports = regjsparser;
- } else {
- window.regjsparser = regjsparser;
- }
- })();
- });
- var regenerate = createCommonjsModule(function (module, exports) {
- (function (root) {
- var freeExports = exports;
- var freeModule = module && module.exports == freeExports && module;
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
- root = freeGlobal;
- }
- var ERRORS = {
- 'rangeOrder': "A range\u2019s `stop` value must be greater than or equal " + 'to the `start` value.',
- 'codePointRange': 'Invalid code point value. Code points range from ' + 'U+000000 to U+10FFFF.'
- };
- var HIGH_SURROGATE_MIN = 0xD800;
- var HIGH_SURROGATE_MAX = 0xDBFF;
- var LOW_SURROGATE_MIN = 0xDC00;
- var LOW_SURROGATE_MAX = 0xDFFF;
- var regexNull = /\\x00([^0123456789]|$)/g;
- var object = {};
- var hasOwnProperty = object.hasOwnProperty;
- var extend = function extend(destination, source) {
- var key;
- for (key in source) {
- if (hasOwnProperty.call(source, key)) {
- destination[key] = source[key];
- }
- }
- return destination;
- };
- var forEach = function forEach(array, callback) {
- var index = -1;
- var length = array.length;
- while (++index < length) {
- callback(array[index], index);
- }
- };
- var toString = object.toString;
- var isArray = function isArray(value) {
- return toString.call(value) == '[object Array]';
- };
- var isNumber = function isNumber(value) {
- return typeof value == 'number' || toString.call(value) == '[object Number]';
- };
- var zeroes = '0000';
- var pad = function pad(number, totalCharacters) {
- var string = String(number);
- return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string;
- };
- var hex = function hex(number) {
- return Number(number).toString(16).toUpperCase();
- };
- var slice = [].slice;
- var dataFromCodePoints = function dataFromCodePoints(codePoints) {
- var index = -1;
- var length = codePoints.length;
- var max = length - 1;
- var result = [];
- var isStart = true;
- var tmp;
- var previous = 0;
- while (++index < length) {
- tmp = codePoints[index];
- if (isStart) {
- result.push(tmp);
- previous = tmp;
- isStart = false;
- } else {
- if (tmp == previous + 1) {
- if (index != max) {
- previous = tmp;
- continue;
- } else {
- isStart = true;
- result.push(tmp + 1);
- }
- } else {
- result.push(previous + 1, tmp);
- previous = tmp;
- }
- }
- }
- if (!isStart) {
- result.push(tmp + 1);
- }
- return result;
- };
- var dataRemove = function dataRemove(data, codePoint) {
- var index = 0;
- var start;
- var end;
- var length = data.length;
- while (index < length) {
- start = data[index];
- end = data[index + 1];
- if (codePoint >= start && codePoint < end) {
- if (codePoint == start) {
- if (end == start + 1) {
- data.splice(index, 2);
- return data;
- } else {
- data[index] = codePoint + 1;
- return data;
- }
- } else if (codePoint == end - 1) {
- data[index + 1] = codePoint;
- return data;
- } else {
- data.splice(index, 2, start, codePoint, codePoint + 1, end);
- return data;
- }
- }
- index += 2;
- }
- return data;
- };
- var dataRemoveRange = function dataRemoveRange(data, rangeStart, rangeEnd) {
- if (rangeEnd < rangeStart) {
- throw Error(ERRORS.rangeOrder);
- }
- var index = 0;
- var start;
- var end;
- while (index < data.length) {
- start = data[index];
- end = data[index + 1] - 1;
- if (start > rangeEnd) {
- return data;
- }
- if (rangeStart <= start && rangeEnd >= end) {
- data.splice(index, 2);
- continue;
- }
- if (rangeStart >= start && rangeEnd < end) {
- if (rangeStart == start) {
- data[index] = rangeEnd + 1;
- data[index + 1] = end + 1;
- return data;
- }
- data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
- return data;
- }
- if (rangeStart >= start && rangeStart <= end) {
- data[index + 1] = rangeStart;
- } else if (rangeEnd >= start && rangeEnd <= end) {
- data[index] = rangeEnd + 1;
- return data;
- }
- index += 2;
- }
- return data;
- };
- var dataAdd = function dataAdd(data, codePoint) {
- var index = 0;
- var start;
- var end;
- var lastIndex = null;
- var length = data.length;
- if (codePoint < 0x0 || codePoint > 0x10FFFF) {
- throw RangeError(ERRORS.codePointRange);
- }
- while (index < length) {
- start = data[index];
- end = data[index + 1];
- if (codePoint >= start && codePoint < end) {
- return data;
- }
- if (codePoint == start - 1) {
- data[index] = codePoint;
- return data;
- }
- if (start > codePoint) {
- data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1);
- return data;
- }
- if (codePoint == end) {
- if (codePoint + 1 == data[index + 2]) {
- data.splice(index, 4, start, data[index + 3]);
- return data;
- }
- data[index + 1] = codePoint + 1;
- return data;
- }
- lastIndex = index;
- index += 2;
- }
- data.push(codePoint, codePoint + 1);
- return data;
- };
- var dataAddData = function dataAddData(dataA, dataB) {
- var index = 0;
- var start;
- var end;
- var data = dataA.slice();
- var length = dataB.length;
- while (index < length) {
- start = dataB[index];
- end = dataB[index + 1] - 1;
- if (start == end) {
- data = dataAdd(data, start);
- } else {
- data = dataAddRange(data, start, end);
- }
- index += 2;
- }
- return data;
- };
- var dataRemoveData = function dataRemoveData(dataA, dataB) {
- var index = 0;
- var start;
- var end;
- var data = dataA.slice();
- var length = dataB.length;
- while (index < length) {
- start = dataB[index];
- end = dataB[index + 1] - 1;
- if (start == end) {
- data = dataRemove(data, start);
- } else {
- data = dataRemoveRange(data, start, end);
- }
- index += 2;
- }
- return data;
- };
- var dataAddRange = function dataAddRange(data, rangeStart, rangeEnd) {
- if (rangeEnd < rangeStart) {
- throw Error(ERRORS.rangeOrder);
- }
- if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) {
- throw RangeError(ERRORS.codePointRange);
- }
- var index = 0;
- var start;
- var end;
- var added = false;
- var length = data.length;
- while (index < length) {
- start = data[index];
- end = data[index + 1];
- if (added) {
- if (start == rangeEnd + 1) {
- data.splice(index - 1, 2);
- return data;
- }
- if (start > rangeEnd) {
- return data;
- }
- if (start >= rangeStart && start <= rangeEnd) {
- if (end > rangeStart && end - 1 <= rangeEnd) {
- data.splice(index, 2);
- index -= 2;
- } else {
- data.splice(index - 1, 2);
- index -= 2;
- }
- }
- } else if (start == rangeEnd + 1) {
- data[index] = rangeStart;
- return data;
- } else if (start > rangeEnd) {
- data.splice(index, 0, rangeStart, rangeEnd + 1);
- return data;
- } else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
- return data;
- } else if (rangeStart >= start && rangeStart < end || end == rangeStart) {
- data[index + 1] = rangeEnd + 1;
- added = true;
- } else if (rangeStart <= start && rangeEnd + 1 >= end) {
- data[index] = rangeStart;
- data[index + 1] = rangeEnd + 1;
- added = true;
- }
- index += 2;
- }
- if (!added) {
- data.push(rangeStart, rangeEnd + 1);
- }
- return data;
- };
- var dataContains = function dataContains(data, codePoint) {
- var index = 0;
- var length = data.length;
- var start = data[index];
- var end = data[length - 1];
- if (length >= 2) {
- if (codePoint < start || codePoint > end) {
- return false;
- }
- }
- while (index < length) {
- start = data[index];
- end = data[index + 1];
- if (codePoint >= start && codePoint < end) {
- return true;
- }
- index += 2;
- }
- return false;
- };
- var dataIntersection = function dataIntersection(data, codePoints) {
- var index = 0;
- var length = codePoints.length;
- var codePoint;
- var result = [];
- while (index < length) {
- codePoint = codePoints[index];
- if (dataContains(data, codePoint)) {
- result.push(codePoint);
- }
- ++index;
- }
- return dataFromCodePoints(result);
- };
- var dataIsEmpty = function dataIsEmpty(data) {
- return !data.length;
- };
- var dataIsSingleton = function dataIsSingleton(data) {
- return data.length == 2 && data[0] + 1 == data[1];
- };
- var dataToArray = function dataToArray(data) {
- var index = 0;
- var start;
- var end;
- var result = [];
- var length = data.length;
- while (index < length) {
- start = data[index];
- end = data[index + 1];
- while (start < end) {
- result.push(start);
- ++start;
- }
- index += 2;
- }
- return result;
- };
- var floor = Math.floor;
- var highSurrogate = function highSurrogate(codePoint) {
- return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10);
- };
- var lowSurrogate = function lowSurrogate(codePoint) {
- return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10);
- };
- var stringFromCharCode = String.fromCharCode;
- var codePointToString = function codePointToString(codePoint) {
- var string;
- if (codePoint == 0x09) {
- string = '\\t';
- } else if (codePoint == 0x0A) {
- string = '\\n';
- } else if (codePoint == 0x0C) {
- string = '\\f';
- } else if (codePoint == 0x0D) {
- string = '\\r';
- } else if (codePoint == 0x2D) {
- string = '\\x2D';
- } else if (codePoint == 0x5C) {
- string = '\\\\';
- } else if (codePoint == 0x24 || codePoint >= 0x28 && codePoint <= 0x2B || codePoint == 0x2E || codePoint == 0x2F || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) {
- string = '\\' + stringFromCharCode(codePoint);
- } else if (codePoint >= 0x20 && codePoint <= 0x7E) {
- string = stringFromCharCode(codePoint);
- } else if (codePoint <= 0xFF) {
- string = '\\x' + pad(hex(codePoint), 2);
- } else {
- string = "\\u" + pad(hex(codePoint), 4);
- }
- return string;
- };
- var codePointToStringUnicode = function codePointToStringUnicode(codePoint) {
- if (codePoint <= 0xFFFF) {
- return codePointToString(codePoint);
- }
- return "\\u{" + codePoint.toString(16).toUpperCase() + '}';
- };
- var symbolToCodePoint = function symbolToCodePoint(symbol) {
- var length = symbol.length;
- var first = symbol.charCodeAt(0);
- var second;
- if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1) {
- second = symbol.charCodeAt(1);
- return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;
- }
- return first;
- };
- var createBMPCharacterClasses = function createBMPCharacterClasses(data) {
- var result = '';
- var index = 0;
- var start;
- var end;
- var length = data.length;
- if (dataIsSingleton(data)) {
- return codePointToString(data[0]);
- }
- while (index < length) {
- start = data[index];
- end = data[index + 1] - 1;
- if (start == end) {
- result += codePointToString(start);
- } else if (start + 1 == end) {
- result += codePointToString(start) + codePointToString(end);
- } else {
- result += codePointToString(start) + '-' + codePointToString(end);
- }
- index += 2;
- }
- return '[' + result + ']';
- };
- var createUnicodeCharacterClasses = function createUnicodeCharacterClasses(data) {
- var result = '';
- var index = 0;
- var start;
- var end;
- var length = data.length;
- if (dataIsSingleton(data)) {
- return codePointToStringUnicode(data[0]);
- }
- while (index < length) {
- start = data[index];
- end = data[index + 1] - 1;
- if (start == end) {
- result += codePointToStringUnicode(start);
- } else if (start + 1 == end) {
- result += codePointToStringUnicode(start) + codePointToStringUnicode(end);
- } else {
- result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);
- }
- index += 2;
- }
- return '[' + result + ']';
- };
- var splitAtBMP = function splitAtBMP(data) {
- var loneHighSurrogates = [];
- var loneLowSurrogates = [];
- var bmp = [];
- var astral = [];
- var index = 0;
- var start;
- var end;
- var length = data.length;
- while (index < length) {
- start = data[index];
- end = data[index + 1] - 1;
- if (start < HIGH_SURROGATE_MIN) {
- if (end < HIGH_SURROGATE_MIN) {
- bmp.push(start, end + 1);
- }
- if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
- bmp.push(start, HIGH_SURROGATE_MIN);
- loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
- }
- if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
- bmp.push(start, HIGH_SURROGATE_MIN);
- loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
- loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
- }
- if (end > LOW_SURROGATE_MAX) {
- bmp.push(start, HIGH_SURROGATE_MIN);
- loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
- loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
- if (end <= 0xFFFF) {
- bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
- } else {
- bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
- astral.push(0xFFFF + 1, end + 1);
- }
- }
- } else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
- if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
- loneHighSurrogates.push(start, end + 1);
- }
- if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
- loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
- loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
- }
- if (end > LOW_SURROGATE_MAX) {
- loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
- loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
- if (end <= 0xFFFF) {
- bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
- } else {
- bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
- astral.push(0xFFFF + 1, end + 1);
- }
- }
- } else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {
- if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
- loneLowSurrogates.push(start, end + 1);
- }
- if (end > LOW_SURROGATE_MAX) {
- loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);
- if (end <= 0xFFFF) {
- bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
- } else {
- bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
- astral.push(0xFFFF + 1, end + 1);
- }
- }
- } else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {
- if (end <= 0xFFFF) {
- bmp.push(start, end + 1);
- } else {
- bmp.push(start, 0xFFFF + 1);
- astral.push(0xFFFF + 1, end + 1);
- }
- } else {
- astral.push(start, end + 1);
- }
- index += 2;
- }
- return {
- 'loneHighSurrogates': loneHighSurrogates,
- 'loneLowSurrogates': loneLowSurrogates,
- 'bmp': bmp,
- 'astral': astral
- };
- };
- var optimizeSurrogateMappings = function optimizeSurrogateMappings(surrogateMappings) {
- var result = [];
- var tmpLow = [];
- var addLow = false;
- var mapping;
- var nextMapping;
- var highSurrogates;
- var lowSurrogates;
- var nextHighSurrogates;
- var nextLowSurrogates;
- var index = -1;
- var length = surrogateMappings.length;
- while (++index < length) {
- mapping = surrogateMappings[index];
- nextMapping = surrogateMappings[index + 1];
- if (!nextMapping) {
- result.push(mapping);
- continue;
- }
- highSurrogates = mapping[0];
- lowSurrogates = mapping[1];
- nextHighSurrogates = nextMapping[0];
- nextLowSurrogates = nextMapping[1];
- tmpLow = lowSurrogates;
- while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) {
- if (dataIsSingleton(nextLowSurrogates)) {
- tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);
- } else {
- tmpLow = dataAddRange(tmpLow, nextLowSurrogates[0], nextLowSurrogates[1] - 1);
- }
- ++index;
- mapping = surrogateMappings[index];
- highSurrogates = mapping[0];
- lowSurrogates = mapping[1];
- nextMapping = surrogateMappings[index + 1];
- nextHighSurrogates = nextMapping && nextMapping[0];
- nextLowSurrogates = nextMapping && nextMapping[1];
- addLow = true;
- }
- result.push([highSurrogates, addLow ? tmpLow : lowSurrogates]);
- addLow = false;
- }
- return optimizeByLowSurrogates(result);
- };
- var optimizeByLowSurrogates = function optimizeByLowSurrogates(surrogateMappings) {
- if (surrogateMappings.length == 1) {
- return surrogateMappings;
- }
- var index = -1;
- var innerIndex = -1;
- while (++index < surrogateMappings.length) {
- var mapping = surrogateMappings[index];
- var lowSurrogates = mapping[1];
- var lowSurrogateStart = lowSurrogates[0];
- var lowSurrogateEnd = lowSurrogates[1];
- innerIndex = index;
- while (++innerIndex < surrogateMappings.length) {
- var otherMapping = surrogateMappings[innerIndex];
- var otherLowSurrogates = otherMapping[1];
- var otherLowSurrogateStart = otherLowSurrogates[0];
- var otherLowSurrogateEnd = otherLowSurrogates[1];
- if (lowSurrogateStart == otherLowSurrogateStart && lowSurrogateEnd == otherLowSurrogateEnd) {
- if (dataIsSingleton(otherMapping[0])) {
- mapping[0] = dataAdd(mapping[0], otherMapping[0][0]);
- } else {
- mapping[0] = dataAddRange(mapping[0], otherMapping[0][0], otherMapping[0][1] - 1);
- }
- surrogateMappings.splice(innerIndex, 1);
- --innerIndex;
- }
- }
- }
- return surrogateMappings;
- };
- var surrogateSet = function surrogateSet(data) {
- if (!data.length) {
- return [];
- }
- var index = 0;
- var start;
- var end;
- var startHigh;
- var startLow;
- var endHigh;
- var endLow;
- var surrogateMappings = [];
- var length = data.length;
- while (index < length) {
- start = data[index];
- end = data[index + 1] - 1;
- startHigh = highSurrogate(start);
- startLow = lowSurrogate(start);
- endHigh = highSurrogate(end);
- endLow = lowSurrogate(end);
- var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;
- var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;
- var complete = false;
- if (startHigh == endHigh || startsWithLowestLowSurrogate && endsWithHighestLowSurrogate) {
- surrogateMappings.push([[startHigh, endHigh + 1], [startLow, endLow + 1]]);
- complete = true;
- } else {
- surrogateMappings.push([[startHigh, startHigh + 1], [startLow, LOW_SURROGATE_MAX + 1]]);
- }
- if (!complete && startHigh + 1 < endHigh) {
- if (endsWithHighestLowSurrogate) {
- surrogateMappings.push([[startHigh + 1, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
- complete = true;
- } else {
- surrogateMappings.push([[startHigh + 1, endHigh], [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]]);
- }
- }
- if (!complete) {
- surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
- }
- index += 2;
- }
- return optimizeSurrogateMappings(surrogateMappings);
- };
- var createSurrogateCharacterClasses = function createSurrogateCharacterClasses(surrogateMappings) {
- var result = [];
- forEach(surrogateMappings, function (surrogateMapping) {
- var highSurrogates = surrogateMapping[0];
- var lowSurrogates = surrogateMapping[1];
- result.push(createBMPCharacterClasses(highSurrogates) + createBMPCharacterClasses(lowSurrogates));
- });
- return result.join('|');
- };
- var createCharacterClassesFromData = function createCharacterClassesFromData(data, bmpOnly, hasUnicodeFlag) {
- if (hasUnicodeFlag) {
- return createUnicodeCharacterClasses(data);
- }
- var result = [];
- var parts = splitAtBMP(data);
- var loneHighSurrogates = parts.loneHighSurrogates;
- var loneLowSurrogates = parts.loneLowSurrogates;
- var bmp = parts.bmp;
- var astral = parts.astral;
- var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);
- var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);
- var surrogateMappings = surrogateSet(astral);
- if (bmpOnly) {
- bmp = dataAddData(bmp, loneHighSurrogates);
- hasLoneHighSurrogates = false;
- bmp = dataAddData(bmp, loneLowSurrogates);
- hasLoneLowSurrogates = false;
- }
- if (!dataIsEmpty(bmp)) {
- result.push(createBMPCharacterClasses(bmp));
- }
- if (surrogateMappings.length) {
- result.push(createSurrogateCharacterClasses(surrogateMappings));
- }
- if (hasLoneHighSurrogates) {
- result.push(createBMPCharacterClasses(loneHighSurrogates) + "(?![\\uDC00-\\uDFFF])");
- }
- if (hasLoneLowSurrogates) {
- result.push("(?:[^\\uD800-\\uDBFF]|^)" + createBMPCharacterClasses(loneLowSurrogates));
- }
- return result.join('|');
- };
- var regenerate = function regenerate(value) {
- if (arguments.length > 1) {
- value = slice.call(arguments);
- }
- if (this instanceof regenerate) {
- this.data = [];
- return value ? this.add(value) : this;
- }
- return new regenerate().add(value);
- };
- regenerate.version = '1.3.3';
- var proto = regenerate.prototype;
- extend(proto, {
- 'add': function add(value) {
- var $this = this;
- if (value == null) {
- return $this;
- }
- if (value instanceof regenerate) {
- $this.data = dataAddData($this.data, value.data);
- return $this;
- }
- if (arguments.length > 1) {
- value = slice.call(arguments);
- }
- if (isArray(value)) {
- forEach(value, function (item) {
- $this.add(item);
- });
- return $this;
- }
- $this.data = dataAdd($this.data, isNumber(value) ? value : symbolToCodePoint(value));
- return $this;
- },
- 'remove': function remove(value) {
- var $this = this;
- if (value == null) {
- return $this;
- }
- if (value instanceof regenerate) {
- $this.data = dataRemoveData($this.data, value.data);
- return $this;
- }
- if (arguments.length > 1) {
- value = slice.call(arguments);
- }
- if (isArray(value)) {
- forEach(value, function (item) {
- $this.remove(item);
- });
- return $this;
- }
- $this.data = dataRemove($this.data, isNumber(value) ? value : symbolToCodePoint(value));
- return $this;
- },
- 'addRange': function addRange(start, end) {
- var $this = this;
- $this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end));
- return $this;
- },
- 'removeRange': function removeRange(start, end) {
- var $this = this;
- var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);
- var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);
- $this.data = dataRemoveRange($this.data, startCodePoint, endCodePoint);
- return $this;
- },
- 'intersection': function intersection(argument) {
- var $this = this;
- var array = argument instanceof regenerate ? dataToArray(argument.data) : argument;
- $this.data = dataIntersection($this.data, array);
- return $this;
- },
- 'contains': function contains(codePoint) {
- return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint));
- },
- 'clone': function clone() {
- var set = new regenerate();
- set.data = this.data.slice(0);
- return set;
- },
- 'toString': function toString(options) {
- var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false);
- if (!result) {
- return '[]';
- }
- return result.replace(regexNull, '\\0$1');
- },
- 'toRegExp': function toRegExp(flags) {
- var pattern = this.toString(flags && flags.indexOf('u') != -1 ? {
- 'hasUnicodeFlag': true
- } : null);
- return RegExp(pattern, flags || '');
- },
- 'valueOf': function valueOf() {
- return dataToArray(this.data);
- }
- });
- proto.toArray = proto.valueOf;
- if (freeExports && !freeExports.nodeType) {
- if (freeModule) {
- freeModule.exports = regenerate;
- } else {
- freeExports.regenerate = regenerate;
- }
- } else {
- root.regenerate = regenerate;
- }
- })(commonjsGlobal);
- });
- var unicodeCanonicalPropertyNamesEcmascript = new Set(['General_Category', 'Script', 'Script_Extensions', 'Alphabetic', 'Any', 'ASCII', 'ASCII_Hex_Digit', 'Assigned', 'Bidi_Control', 'Bidi_Mirrored', 'Case_Ignorable', 'Cased', 'Changes_When_Casefolded', 'Changes_When_Casemapped', 'Changes_When_Lowercased', 'Changes_When_NFKC_Casefolded', 'Changes_When_Titlecased', 'Changes_When_Uppercased', 'Dash', 'Default_Ignorable_Code_Point', 'Deprecated', 'Diacritic', 'Emoji', 'Emoji_Component', 'Emoji_Modifier', 'Emoji_Modifier_Base', 'Emoji_Presentation', 'Extended_Pictographic', 'Extender', 'Grapheme_Base', 'Grapheme_Extend', 'Hex_Digit', 'ID_Continue', 'ID_Start', 'Ideographic', 'IDS_Binary_Operator', 'IDS_Trinary_Operator', 'Join_Control', 'Logical_Order_Exception', 'Lowercase', 'Math', 'Noncharacter_Code_Point', 'Pattern_Syntax', 'Pattern_White_Space', 'Quotation_Mark', 'Radical', 'Regional_Indicator', 'Sentence_Terminal', 'Soft_Dotted', 'Terminal_Punctuation', 'Unified_Ideograph', 'Uppercase', 'Variation_Selector', 'White_Space', 'XID_Continue', 'XID_Start']);
- var unicodePropertyAliasesEcmascript = new Map([['scx', 'Script_Extensions'], ['sc', 'Script'], ['gc', 'General_Category'], ['AHex', 'ASCII_Hex_Digit'], ['Alpha', 'Alphabetic'], ['Bidi_C', 'Bidi_Control'], ['Bidi_M', 'Bidi_Mirrored'], ['Cased', 'Cased'], ['CI', 'Case_Ignorable'], ['CWCF', 'Changes_When_Casefolded'], ['CWCM', 'Changes_When_Casemapped'], ['CWKCF', 'Changes_When_NFKC_Casefolded'], ['CWL', 'Changes_When_Lowercased'], ['CWT', 'Changes_When_Titlecased'], ['CWU', 'Changes_When_Uppercased'], ['Dash', 'Dash'], ['Dep', 'Deprecated'], ['DI', 'Default_Ignorable_Code_Point'], ['Dia', 'Diacritic'], ['Ext', 'Extender'], ['Gr_Base', 'Grapheme_Base'], ['Gr_Ext', 'Grapheme_Extend'], ['Hex', 'Hex_Digit'], ['IDC', 'ID_Continue'], ['Ideo', 'Ideographic'], ['IDS', 'ID_Start'], ['IDSB', 'IDS_Binary_Operator'], ['IDST', 'IDS_Trinary_Operator'], ['Join_C', 'Join_Control'], ['LOE', 'Logical_Order_Exception'], ['Lower', 'Lowercase'], ['Math', 'Math'], ['NChar', 'Noncharacter_Code_Point'], ['Pat_Syn', 'Pattern_Syntax'], ['Pat_WS', 'Pattern_White_Space'], ['QMark', 'Quotation_Mark'], ['Radical', 'Radical'], ['RI', 'Regional_Indicator'], ['SD', 'Soft_Dotted'], ['STerm', 'Sentence_Terminal'], ['Term', 'Terminal_Punctuation'], ['UIdeo', 'Unified_Ideograph'], ['Upper', 'Uppercase'], ['VS', 'Variation_Selector'], ['WSpace', 'White_Space'], ['space', 'White_Space'], ['XIDC', 'XID_Continue'], ['XIDS', 'XID_Start']]);
- var matchProperty = function matchProperty(property) {
- if (unicodeCanonicalPropertyNamesEcmascript.has(property)) {
- return property;
- }
- if (unicodePropertyAliasesEcmascript.has(property)) {
- return unicodePropertyAliasesEcmascript.get(property);
- }
- throw new Error("Unknown property: " + property);
- };
- var unicodeMatchPropertyEcmascript = matchProperty;
- var mappings = new Map([['General_Category', new Map([['C', 'Other'], ['Cc', 'Control'], ['cntrl', 'Control'], ['Cf', 'Format'], ['Cn', 'Unassigned'], ['Co', 'Private_Use'], ['Cs', 'Surrogate'], ['L', 'Letter'], ['LC', 'Cased_Letter'], ['Ll', 'Lowercase_Letter'], ['Lm', 'Modifier_Letter'], ['Lo', 'Other_Letter'], ['Lt', 'Titlecase_Letter'], ['Lu', 'Uppercase_Letter'], ['M', 'Mark'], ['Combining_Mark', 'Mark'], ['Mc', 'Spacing_Mark'], ['Me', 'Enclosing_Mark'], ['Mn', 'Nonspacing_Mark'], ['N', 'Number'], ['Nd', 'Decimal_Number'], ['digit', 'Decimal_Number'], ['Nl', 'Letter_Number'], ['No', 'Other_Number'], ['P', 'Punctuation'], ['punct', 'Punctuation'], ['Pc', 'Connector_Punctuation'], ['Pd', 'Dash_Punctuation'], ['Pe', 'Close_Punctuation'], ['Pf', 'Final_Punctuation'], ['Pi', 'Initial_Punctuation'], ['Po', 'Other_Punctuation'], ['Ps', 'Open_Punctuation'], ['S', 'Symbol'], ['Sc', 'Currency_Symbol'], ['Sk', 'Modifier_Symbol'], ['Sm', 'Math_Symbol'], ['So', 'Other_Symbol'], ['Z', 'Separator'], ['Zl', 'Line_Separator'], ['Zp', 'Paragraph_Separator'], ['Zs', 'Space_Separator'], ['Other', 'Other'], ['Control', 'Control'], ['Format', 'Format'], ['Unassigned', 'Unassigned'], ['Private_Use', 'Private_Use'], ['Surrogate', 'Surrogate'], ['Letter', 'Letter'], ['Cased_Letter', 'Cased_Letter'], ['Lowercase_Letter', 'Lowercase_Letter'], ['Modifier_Letter', 'Modifier_Letter'], ['Other_Letter', 'Other_Letter'], ['Titlecase_Letter', 'Titlecase_Letter'], ['Uppercase_Letter', 'Uppercase_Letter'], ['Mark', 'Mark'], ['Spacing_Mark', 'Spacing_Mark'], ['Enclosing_Mark', 'Enclosing_Mark'], ['Nonspacing_Mark', 'Nonspacing_Mark'], ['Number', 'Number'], ['Decimal_Number', 'Decimal_Number'], ['Letter_Number', 'Letter_Number'], ['Other_Number', 'Other_Number'], ['Punctuation', 'Punctuation'], ['Connector_Punctuation', 'Connector_Punctuation'], ['Dash_Punctuation', 'Dash_Punctuation'], ['Close_Punctuation', 'Close_Punctuation'], ['Final_Punctuation', 'Final_Punctuation'], ['Initial_Punctuation', 'Initial_Punctuation'], ['Other_Punctuation', 'Other_Punctuation'], ['Open_Punctuation', 'Open_Punctuation'], ['Symbol', 'Symbol'], ['Currency_Symbol', 'Currency_Symbol'], ['Modifier_Symbol', 'Modifier_Symbol'], ['Math_Symbol', 'Math_Symbol'], ['Other_Symbol', 'Other_Symbol'], ['Separator', 'Separator'], ['Line_Separator', 'Line_Separator'], ['Paragraph_Separator', 'Paragraph_Separator'], ['Space_Separator', 'Space_Separator']])], ['Script', new Map([['Adlm', 'Adlam'], ['Aghb', 'Caucasian_Albanian'], ['Ahom', 'Ahom'], ['Arab', 'Arabic'], ['Armi', 'Imperial_Aramaic'], ['Armn', 'Armenian'], ['Avst', 'Avestan'], ['Bali', 'Balinese'], ['Bamu', 'Bamum'], ['Bass', 'Bassa_Vah'], ['Batk', 'Batak'], ['Beng', 'Bengali'], ['Bhks', 'Bhaiksuki'], ['Bopo', 'Bopomofo'], ['Brah', 'Brahmi'], ['Brai', 'Braille'], ['Bugi', 'Buginese'], ['Buhd', 'Buhid'], ['Cakm', 'Chakma'], ['Cans', 'Canadian_Aboriginal'], ['Cari', 'Carian'], ['Cham', 'Cham'], ['Cher', 'Cherokee'], ['Copt', 'Coptic'], ['Qaac', 'Coptic'], ['Cprt', 'Cypriot'], ['Cyrl', 'Cyrillic'], ['Deva', 'Devanagari'], ['Dogr', 'Dogra'], ['Dsrt', 'Deseret'], ['Dupl', 'Duployan'], ['Egyp', 'Egyptian_Hieroglyphs'], ['Elba', 'Elbasan'], ['Elym', 'Elymaic'], ['Ethi', 'Ethiopic'], ['Geor', 'Georgian'], ['Glag', 'Glagolitic'], ['Gong', 'Gunjala_Gondi'], ['Gonm', 'Masaram_Gondi'], ['Goth', 'Gothic'], ['Gran', 'Grantha'], ['Grek', 'Greek'], ['Gujr', 'Gujarati'], ['Guru', 'Gurmukhi'], ['Hang', 'Hangul'], ['Hani', 'Han'], ['Hano', 'Hanunoo'], ['Hatr', 'Hatran'], ['Hebr', 'Hebrew'], ['Hira', 'Hiragana'], ['Hluw', 'Anatolian_Hieroglyphs'], ['Hmng', 'Pahawh_Hmong'], ['Hmnp', 'Nyiakeng_Puachue_Hmong'], ['Hrkt', 'Katakana_Or_Hiragana'], ['Hung', 'Old_Hungarian'], ['Ital', 'Old_Italic'], ['Java', 'Javanese'], ['Kali', 'Kayah_Li'], ['Kana', 'Katakana'], ['Khar', 'Kharoshthi'], ['Khmr', 'Khmer'], ['Khoj', 'Khojki'], ['Knda', 'Kannada'], ['Kthi', 'Kaithi'], ['Lana', 'Tai_Tham'], ['Laoo', 'Lao'], ['Latn', 'Latin'], ['Lepc', 'Lepcha'], ['Limb', 'Limbu'], ['Lina', 'Linear_A'], ['Linb', 'Linear_B'], ['Lisu', 'Lisu'], ['Lyci', 'Lycian'], ['Lydi', 'Lydian'], ['Mahj', 'Mahajani'], ['Maka', 'Makasar'], ['Mand', 'Mandaic'], ['Mani', 'Manichaean'], ['Marc', 'Marchen'], ['Medf', 'Medefaidrin'], ['Mend', 'Mende_Kikakui'], ['Merc', 'Meroitic_Cursive'], ['Mero', 'Meroitic_Hieroglyphs'], ['Mlym', 'Malayalam'], ['Modi', 'Modi'], ['Mong', 'Mongolian'], ['Mroo', 'Mro'], ['Mtei', 'Meetei_Mayek'], ['Mult', 'Multani'], ['Mymr', 'Myanmar'], ['Nand', 'Nandinagari'], ['Narb', 'Old_North_Arabian'], ['Nbat', 'Nabataean'], ['Newa', 'Newa'], ['Nkoo', 'Nko'], ['Nshu', 'Nushu'], ['Ogam', 'Ogham'], ['Olck', 'Ol_Chiki'], ['Orkh', 'Old_Turkic'], ['Orya', 'Oriya'], ['Osge', 'Osage'], ['Osma', 'Osmanya'], ['Palm', 'Palmyrene'], ['Pauc', 'Pau_Cin_Hau'], ['Perm', 'Old_Permic'], ['Phag', 'Phags_Pa'], ['Phli', 'Inscriptional_Pahlavi'], ['Phlp', 'Psalter_Pahlavi'], ['Phnx', 'Phoenician'], ['Plrd', 'Miao'], ['Prti', 'Inscriptional_Parthian'], ['Rjng', 'Rejang'], ['Rohg', 'Hanifi_Rohingya'], ['Runr', 'Runic'], ['Samr', 'Samaritan'], ['Sarb', 'Old_South_Arabian'], ['Saur', 'Saurashtra'], ['Sgnw', 'SignWriting'], ['Shaw', 'Shavian'], ['Shrd', 'Sharada'], ['Sidd', 'Siddham'], ['Sind', 'Khudawadi'], ['Sinh', 'Sinhala'], ['Sogd', 'Sogdian'], ['Sogo', 'Old_Sogdian'], ['Sora', 'Sora_Sompeng'], ['Soyo', 'Soyombo'], ['Sund', 'Sundanese'], ['Sylo', 'Syloti_Nagri'], ['Syrc', 'Syriac'], ['Tagb', 'Tagbanwa'], ['Takr', 'Takri'], ['Tale', 'Tai_Le'], ['Talu', 'New_Tai_Lue'], ['Taml', 'Tamil'], ['Tang', 'Tangut'], ['Tavt', 'Tai_Viet'], ['Telu', 'Telugu'], ['Tfng', 'Tifinagh'], ['Tglg', 'Tagalog'], ['Thaa', 'Thaana'], ['Thai', 'Thai'], ['Tibt', 'Tibetan'], ['Tirh', 'Tirhuta'], ['Ugar', 'Ugaritic'], ['Vaii', 'Vai'], ['Wara', 'Warang_Citi'], ['Wcho', 'Wancho'], ['Xpeo', 'Old_Persian'], ['Xsux', 'Cuneiform'], ['Yiii', 'Yi'], ['Zanb', 'Zanabazar_Square'], ['Zinh', 'Inherited'], ['Qaai', 'Inherited'], ['Zyyy', 'Common'], ['Zzzz', 'Unknown'], ['Adlam', 'Adlam'], ['Caucasian_Albanian', 'Caucasian_Albanian'], ['Arabic', 'Arabic'], ['Imperial_Aramaic', 'Imperial_Aramaic'], ['Armenian', 'Armenian'], ['Avestan', 'Avestan'], ['Balinese', 'Balinese'], ['Bamum', 'Bamum'], ['Bassa_Vah', 'Bassa_Vah'], ['Batak', 'Batak'], ['Bengali', 'Bengali'], ['Bhaiksuki', 'Bhaiksuki'], ['Bopomofo', 'Bopomofo'], ['Brahmi', 'Brahmi'], ['Braille', 'Braille'], ['Buginese', 'Buginese'], ['Buhid', 'Buhid'], ['Chakma', 'Chakma'], ['Canadian_Aboriginal', 'Canadian_Aboriginal'], ['Carian', 'Carian'], ['Cherokee', 'Cherokee'], ['Coptic', 'Coptic'], ['Cypriot', 'Cypriot'], ['Cyrillic', 'Cyrillic'], ['Devanagari', 'Devanagari'], ['Dogra', 'Dogra'], ['Deseret', 'Deseret'], ['Duployan', 'Duployan'], ['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'], ['Elbasan', 'Elbasan'], ['Elymaic', 'Elymaic'], ['Ethiopic', 'Ethiopic'], ['Georgian', 'Georgian'], ['Glagolitic', 'Glagolitic'], ['Gunjala_Gondi', 'Gunjala_Gondi'], ['Masaram_Gondi', 'Masaram_Gondi'], ['Gothic', 'Gothic'], ['Grantha', 'Grantha'], ['Greek', 'Greek'], ['Gujarati', 'Gujarati'], ['Gurmukhi', 'Gurmukhi'], ['Hangul', 'Hangul'], ['Han', 'Han'], ['Hanunoo', 'Hanunoo'], ['Hatran', 'Hatran'], ['Hebrew', 'Hebrew'], ['Hiragana', 'Hiragana'], ['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'], ['Pahawh_Hmong', 'Pahawh_Hmong'], ['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'], ['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'], ['Old_Hungarian', 'Old_Hungarian'], ['Old_Italic', 'Old_Italic'], ['Javanese', 'Javanese'], ['Kayah_Li', 'Kayah_Li'], ['Katakana', 'Katakana'], ['Kharoshthi', 'Kharoshthi'], ['Khmer', 'Khmer'], ['Khojki', 'Khojki'], ['Kannada', 'Kannada'], ['Kaithi', 'Kaithi'], ['Tai_Tham', 'Tai_Tham'], ['Lao', 'Lao'], ['Latin', 'Latin'], ['Lepcha', 'Lepcha'], ['Limbu', 'Limbu'], ['Linear_A', 'Linear_A'], ['Linear_B', 'Linear_B'], ['Lycian', 'Lycian'], ['Lydian', 'Lydian'], ['Mahajani', 'Mahajani'], ['Makasar', 'Makasar'], ['Mandaic', 'Mandaic'], ['Manichaean', 'Manichaean'], ['Marchen', 'Marchen'], ['Medefaidrin', 'Medefaidrin'], ['Mende_Kikakui', 'Mende_Kikakui'], ['Meroitic_Cursive', 'Meroitic_Cursive'], ['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'], ['Malayalam', 'Malayalam'], ['Mongolian', 'Mongolian'], ['Mro', 'Mro'], ['Meetei_Mayek', 'Meetei_Mayek'], ['Multani', 'Multani'], ['Myanmar', 'Myanmar'], ['Nandinagari', 'Nandinagari'], ['Old_North_Arabian', 'Old_North_Arabian'], ['Nabataean', 'Nabataean'], ['Nko', 'Nko'], ['Nushu', 'Nushu'], ['Ogham', 'Ogham'], ['Ol_Chiki', 'Ol_Chiki'], ['Old_Turkic', 'Old_Turkic'], ['Oriya', 'Oriya'], ['Osage', 'Osage'], ['Osmanya', 'Osmanya'], ['Palmyrene', 'Palmyrene'], ['Pau_Cin_Hau', 'Pau_Cin_Hau'], ['Old_Permic', 'Old_Permic'], ['Phags_Pa', 'Phags_Pa'], ['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'], ['Psalter_Pahlavi', 'Psalter_Pahlavi'], ['Phoenician', 'Phoenician'], ['Miao', 'Miao'], ['Inscriptional_Parthian', 'Inscriptional_Parthian'], ['Rejang', 'Rejang'], ['Hanifi_Rohingya', 'Hanifi_Rohingya'], ['Runic', 'Runic'], ['Samaritan', 'Samaritan'], ['Old_South_Arabian', 'Old_South_Arabian'], ['Saurashtra', 'Saurashtra'], ['SignWriting', 'SignWriting'], ['Shavian', 'Shavian'], ['Sharada', 'Sharada'], ['Siddham', 'Siddham'], ['Khudawadi', 'Khudawadi'], ['Sinhala', 'Sinhala'], ['Sogdian', 'Sogdian'], ['Old_Sogdian', 'Old_Sogdian'], ['Sora_Sompeng', 'Sora_Sompeng'], ['Soyombo', 'Soyombo'], ['Sundanese', 'Sundanese'], ['Syloti_Nagri', 'Syloti_Nagri'], ['Syriac', 'Syriac'], ['Tagbanwa', 'Tagbanwa'], ['Takri', 'Takri'], ['Tai_Le', 'Tai_Le'], ['New_Tai_Lue', 'New_Tai_Lue'], ['Tamil', 'Tamil'], ['Tangut', 'Tangut'], ['Tai_Viet', 'Tai_Viet'], ['Telugu', 'Telugu'], ['Tifinagh', 'Tifinagh'], ['Tagalog', 'Tagalog'], ['Thaana', 'Thaana'], ['Tibetan', 'Tibetan'], ['Tirhuta', 'Tirhuta'], ['Ugaritic', 'Ugaritic'], ['Vai', 'Vai'], ['Warang_Citi', 'Warang_Citi'], ['Wancho', 'Wancho'], ['Old_Persian', 'Old_Persian'], ['Cuneiform', 'Cuneiform'], ['Yi', 'Yi'], ['Zanabazar_Square', 'Zanabazar_Square'], ['Inherited', 'Inherited'], ['Common', 'Common'], ['Unknown', 'Unknown']])], ['Script_Extensions', new Map([['Adlm', 'Adlam'], ['Aghb', 'Caucasian_Albanian'], ['Ahom', 'Ahom'], ['Arab', 'Arabic'], ['Armi', 'Imperial_Aramaic'], ['Armn', 'Armenian'], ['Avst', 'Avestan'], ['Bali', 'Balinese'], ['Bamu', 'Bamum'], ['Bass', 'Bassa_Vah'], ['Batk', 'Batak'], ['Beng', 'Bengali'], ['Bhks', 'Bhaiksuki'], ['Bopo', 'Bopomofo'], ['Brah', 'Brahmi'], ['Brai', 'Braille'], ['Bugi', 'Buginese'], ['Buhd', 'Buhid'], ['Cakm', 'Chakma'], ['Cans', 'Canadian_Aboriginal'], ['Cari', 'Carian'], ['Cham', 'Cham'], ['Cher', 'Cherokee'], ['Copt', 'Coptic'], ['Qaac', 'Coptic'], ['Cprt', 'Cypriot'], ['Cyrl', 'Cyrillic'], ['Deva', 'Devanagari'], ['Dogr', 'Dogra'], ['Dsrt', 'Deseret'], ['Dupl', 'Duployan'], ['Egyp', 'Egyptian_Hieroglyphs'], ['Elba', 'Elbasan'], ['Elym', 'Elymaic'], ['Ethi', 'Ethiopic'], ['Geor', 'Georgian'], ['Glag', 'Glagolitic'], ['Gong', 'Gunjala_Gondi'], ['Gonm', 'Masaram_Gondi'], ['Goth', 'Gothic'], ['Gran', 'Grantha'], ['Grek', 'Greek'], ['Gujr', 'Gujarati'], ['Guru', 'Gurmukhi'], ['Hang', 'Hangul'], ['Hani', 'Han'], ['Hano', 'Hanunoo'], ['Hatr', 'Hatran'], ['Hebr', 'Hebrew'], ['Hira', 'Hiragana'], ['Hluw', 'Anatolian_Hieroglyphs'], ['Hmng', 'Pahawh_Hmong'], ['Hmnp', 'Nyiakeng_Puachue_Hmong'], ['Hrkt', 'Katakana_Or_Hiragana'], ['Hung', 'Old_Hungarian'], ['Ital', 'Old_Italic'], ['Java', 'Javanese'], ['Kali', 'Kayah_Li'], ['Kana', 'Katakana'], ['Khar', 'Kharoshthi'], ['Khmr', 'Khmer'], ['Khoj', 'Khojki'], ['Knda', 'Kannada'], ['Kthi', 'Kaithi'], ['Lana', 'Tai_Tham'], ['Laoo', 'Lao'], ['Latn', 'Latin'], ['Lepc', 'Lepcha'], ['Limb', 'Limbu'], ['Lina', 'Linear_A'], ['Linb', 'Linear_B'], ['Lisu', 'Lisu'], ['Lyci', 'Lycian'], ['Lydi', 'Lydian'], ['Mahj', 'Mahajani'], ['Maka', 'Makasar'], ['Mand', 'Mandaic'], ['Mani', 'Manichaean'], ['Marc', 'Marchen'], ['Medf', 'Medefaidrin'], ['Mend', 'Mende_Kikakui'], ['Merc', 'Meroitic_Cursive'], ['Mero', 'Meroitic_Hieroglyphs'], ['Mlym', 'Malayalam'], ['Modi', 'Modi'], ['Mong', 'Mongolian'], ['Mroo', 'Mro'], ['Mtei', 'Meetei_Mayek'], ['Mult', 'Multani'], ['Mymr', 'Myanmar'], ['Nand', 'Nandinagari'], ['Narb', 'Old_North_Arabian'], ['Nbat', 'Nabataean'], ['Newa', 'Newa'], ['Nkoo', 'Nko'], ['Nshu', 'Nushu'], ['Ogam', 'Ogham'], ['Olck', 'Ol_Chiki'], ['Orkh', 'Old_Turkic'], ['Orya', 'Oriya'], ['Osge', 'Osage'], ['Osma', 'Osmanya'], ['Palm', 'Palmyrene'], ['Pauc', 'Pau_Cin_Hau'], ['Perm', 'Old_Permic'], ['Phag', 'Phags_Pa'], ['Phli', 'Inscriptional_Pahlavi'], ['Phlp', 'Psalter_Pahlavi'], ['Phnx', 'Phoenician'], ['Plrd', 'Miao'], ['Prti', 'Inscriptional_Parthian'], ['Rjng', 'Rejang'], ['Rohg', 'Hanifi_Rohingya'], ['Runr', 'Runic'], ['Samr', 'Samaritan'], ['Sarb', 'Old_South_Arabian'], ['Saur', 'Saurashtra'], ['Sgnw', 'SignWriting'], ['Shaw', 'Shavian'], ['Shrd', 'Sharada'], ['Sidd', 'Siddham'], ['Sind', 'Khudawadi'], ['Sinh', 'Sinhala'], ['Sogd', 'Sogdian'], ['Sogo', 'Old_Sogdian'], ['Sora', 'Sora_Sompeng'], ['Soyo', 'Soyombo'], ['Sund', 'Sundanese'], ['Sylo', 'Syloti_Nagri'], ['Syrc', 'Syriac'], ['Tagb', 'Tagbanwa'], ['Takr', 'Takri'], ['Tale', 'Tai_Le'], ['Talu', 'New_Tai_Lue'], ['Taml', 'Tamil'], ['Tang', 'Tangut'], ['Tavt', 'Tai_Viet'], ['Telu', 'Telugu'], ['Tfng', 'Tifinagh'], ['Tglg', 'Tagalog'], ['Thaa', 'Thaana'], ['Thai', 'Thai'], ['Tibt', 'Tibetan'], ['Tirh', 'Tirhuta'], ['Ugar', 'Ugaritic'], ['Vaii', 'Vai'], ['Wara', 'Warang_Citi'], ['Wcho', 'Wancho'], ['Xpeo', 'Old_Persian'], ['Xsux', 'Cuneiform'], ['Yiii', 'Yi'], ['Zanb', 'Zanabazar_Square'], ['Zinh', 'Inherited'], ['Qaai', 'Inherited'], ['Zyyy', 'Common'], ['Zzzz', 'Unknown'], ['Adlam', 'Adlam'], ['Caucasian_Albanian', 'Caucasian_Albanian'], ['Arabic', 'Arabic'], ['Imperial_Aramaic', 'Imperial_Aramaic'], ['Armenian', 'Armenian'], ['Avestan', 'Avestan'], ['Balinese', 'Balinese'], ['Bamum', 'Bamum'], ['Bassa_Vah', 'Bassa_Vah'], ['Batak', 'Batak'], ['Bengali', 'Bengali'], ['Bhaiksuki', 'Bhaiksuki'], ['Bopomofo', 'Bopomofo'], ['Brahmi', 'Brahmi'], ['Braille', 'Braille'], ['Buginese', 'Buginese'], ['Buhid', 'Buhid'], ['Chakma', 'Chakma'], ['Canadian_Aboriginal', 'Canadian_Aboriginal'], ['Carian', 'Carian'], ['Cherokee', 'Cherokee'], ['Coptic', 'Coptic'], ['Cypriot', 'Cypriot'], ['Cyrillic', 'Cyrillic'], ['Devanagari', 'Devanagari'], ['Dogra', 'Dogra'], ['Deseret', 'Deseret'], ['Duployan', 'Duployan'], ['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'], ['Elbasan', 'Elbasan'], ['Elymaic', 'Elymaic'], ['Ethiopic', 'Ethiopic'], ['Georgian', 'Georgian'], ['Glagolitic', 'Glagolitic'], ['Gunjala_Gondi', 'Gunjala_Gondi'], ['Masaram_Gondi', 'Masaram_Gondi'], ['Gothic', 'Gothic'], ['Grantha', 'Grantha'], ['Greek', 'Greek'], ['Gujarati', 'Gujarati'], ['Gurmukhi', 'Gurmukhi'], ['Hangul', 'Hangul'], ['Han', 'Han'], ['Hanunoo', 'Hanunoo'], ['Hatran', 'Hatran'], ['Hebrew', 'Hebrew'], ['Hiragana', 'Hiragana'], ['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'], ['Pahawh_Hmong', 'Pahawh_Hmong'], ['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'], ['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'], ['Old_Hungarian', 'Old_Hungarian'], ['Old_Italic', 'Old_Italic'], ['Javanese', 'Javanese'], ['Kayah_Li', 'Kayah_Li'], ['Katakana', 'Katakana'], ['Kharoshthi', 'Kharoshthi'], ['Khmer', 'Khmer'], ['Khojki', 'Khojki'], ['Kannada', 'Kannada'], ['Kaithi', 'Kaithi'], ['Tai_Tham', 'Tai_Tham'], ['Lao', 'Lao'], ['Latin', 'Latin'], ['Lepcha', 'Lepcha'], ['Limbu', 'Limbu'], ['Linear_A', 'Linear_A'], ['Linear_B', 'Linear_B'], ['Lycian', 'Lycian'], ['Lydian', 'Lydian'], ['Mahajani', 'Mahajani'], ['Makasar', 'Makasar'], ['Mandaic', 'Mandaic'], ['Manichaean', 'Manichaean'], ['Marchen', 'Marchen'], ['Medefaidrin', 'Medefaidrin'], ['Mende_Kikakui', 'Mende_Kikakui'], ['Meroitic_Cursive', 'Meroitic_Cursive'], ['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'], ['Malayalam', 'Malayalam'], ['Mongolian', 'Mongolian'], ['Mro', 'Mro'], ['Meetei_Mayek', 'Meetei_Mayek'], ['Multani', 'Multani'], ['Myanmar', 'Myanmar'], ['Nandinagari', 'Nandinagari'], ['Old_North_Arabian', 'Old_North_Arabian'], ['Nabataean', 'Nabataean'], ['Nko', 'Nko'], ['Nushu', 'Nushu'], ['Ogham', 'Ogham'], ['Ol_Chiki', 'Ol_Chiki'], ['Old_Turkic', 'Old_Turkic'], ['Oriya', 'Oriya'], ['Osage', 'Osage'], ['Osmanya', 'Osmanya'], ['Palmyrene', 'Palmyrene'], ['Pau_Cin_Hau', 'Pau_Cin_Hau'], ['Old_Permic', 'Old_Permic'], ['Phags_Pa', 'Phags_Pa'], ['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'], ['Psalter_Pahlavi', 'Psalter_Pahlavi'], ['Phoenician', 'Phoenician'], ['Miao', 'Miao'], ['Inscriptional_Parthian', 'Inscriptional_Parthian'], ['Rejang', 'Rejang'], ['Hanifi_Rohingya', 'Hanifi_Rohingya'], ['Runic', 'Runic'], ['Samaritan', 'Samaritan'], ['Old_South_Arabian', 'Old_South_Arabian'], ['Saurashtra', 'Saurashtra'], ['SignWriting', 'SignWriting'], ['Shavian', 'Shavian'], ['Sharada', 'Sharada'], ['Siddham', 'Siddham'], ['Khudawadi', 'Khudawadi'], ['Sinhala', 'Sinhala'], ['Sogdian', 'Sogdian'], ['Old_Sogdian', 'Old_Sogdian'], ['Sora_Sompeng', 'Sora_Sompeng'], ['Soyombo', 'Soyombo'], ['Sundanese', 'Sundanese'], ['Syloti_Nagri', 'Syloti_Nagri'], ['Syriac', 'Syriac'], ['Tagbanwa', 'Tagbanwa'], ['Takri', 'Takri'], ['Tai_Le', 'Tai_Le'], ['New_Tai_Lue', 'New_Tai_Lue'], ['Tamil', 'Tamil'], ['Tangut', 'Tangut'], ['Tai_Viet', 'Tai_Viet'], ['Telugu', 'Telugu'], ['Tifinagh', 'Tifinagh'], ['Tagalog', 'Tagalog'], ['Thaana', 'Thaana'], ['Tibetan', 'Tibetan'], ['Tirhuta', 'Tirhuta'], ['Ugaritic', 'Ugaritic'], ['Vai', 'Vai'], ['Warang_Citi', 'Warang_Citi'], ['Wancho', 'Wancho'], ['Old_Persian', 'Old_Persian'], ['Cuneiform', 'Cuneiform'], ['Yi', 'Yi'], ['Zanabazar_Square', 'Zanabazar_Square'], ['Inherited', 'Inherited'], ['Common', 'Common'], ['Unknown', 'Unknown']])]]);
- var matchPropertyValue = function matchPropertyValue(property, value) {
- var aliasToValue = mappings.get(property);
- if (!aliasToValue) {
- throw new Error("Unknown property `" + property + "`.");
- }
- var canonicalValue = aliasToValue.get(value);
- if (canonicalValue) {
- return canonicalValue;
- }
- throw new Error("Unknown value `" + value + "` for property `" + property + "`.");
- };
- var unicodeMatchPropertyValueEcmascript = matchPropertyValue;
- var iuMappings = new Map([[0x4B, 0x212A], [0x53, 0x17F], [0x6B, 0x212A], [0x73, 0x17F], [0xB5, 0x39C], [0xC5, 0x212B], [0xDF, 0x1E9E], [0xE5, 0x212B], [0x17F, 0x53], [0x1C4, 0x1C5], [0x1C5, 0x1C4], [0x1C7, 0x1C8], [0x1C8, 0x1C7], [0x1CA, 0x1CB], [0x1CB, 0x1CA], [0x1F1, 0x1F2], [0x1F2, 0x1F1], [0x26A, 0xA7AE], [0x282, 0xA7C5], [0x29D, 0xA7B2], [0x345, 0x1FBE], [0x392, 0x3D0], [0x395, 0x3F5], [0x398, 0x3F4], [0x399, 0x1FBE], [0x39A, 0x3F0], [0x39C, 0xB5], [0x3A0, 0x3D6], [0x3A1, 0x3F1], [0x3A3, 0x3C2], [0x3A6, 0x3D5], [0x3A9, 0x2126], [0x3B8, 0x3F4], [0x3C2, 0x3A3], [0x3C9, 0x2126], [0x3D0, 0x392], [0x3D1, 0x3F4], [0x3D5, 0x3A6], [0x3D6, 0x3A0], [0x3F0, 0x39A], [0x3F1, 0x3A1], [0x3F4, [0x398, 0x3D1, 0x3B8]], [0x3F5, 0x395], [0x412, 0x1C80], [0x414, 0x1C81], [0x41E, 0x1C82], [0x421, 0x1C83], [0x422, 0x1C85], [0x42A, 0x1C86], [0x432, 0x1C80], [0x434, 0x1C81], [0x43E, 0x1C82], [0x441, 0x1C83], [0x442, [0x1C84, 0x1C85]], [0x44A, 0x1C86], [0x462, 0x1C87], [0x463, 0x1C87], [0x10D0, 0x1C90], [0x10D1, 0x1C91], [0x10D2, 0x1C92], [0x10D3, 0x1C93], [0x10D4, 0x1C94], [0x10D5, 0x1C95], [0x10D6, 0x1C96], [0x10D7, 0x1C97], [0x10D8, 0x1C98], [0x10D9, 0x1C99], [0x10DA, 0x1C9A], [0x10DB, 0x1C9B], [0x10DC, 0x1C9C], [0x10DD, 0x1C9D], [0x10DE, 0x1C9E], [0x10DF, 0x1C9F], [0x10E0, 0x1CA0], [0x10E1, 0x1CA1], [0x10E2, 0x1CA2], [0x10E3, 0x1CA3], [0x10E4, 0x1CA4], [0x10E5, 0x1CA5], [0x10E6, 0x1CA6], [0x10E7, 0x1CA7], [0x10E8, 0x1CA8], [0x10E9, 0x1CA9], [0x10EA, 0x1CAA], [0x10EB, 0x1CAB], [0x10EC, 0x1CAC], [0x10ED, 0x1CAD], [0x10EE, 0x1CAE], [0x10EF, 0x1CAF], [0x10F0, 0x1CB0], [0x10F1, 0x1CB1], [0x10F2, 0x1CB2], [0x10F3, 0x1CB3], [0x10F4, 0x1CB4], [0x10F5, 0x1CB5], [0x10F6, 0x1CB6], [0x10F7, 0x1CB7], [0x10F8, 0x1CB8], [0x10F9, 0x1CB9], [0x10FA, 0x1CBA], [0x10FD, 0x1CBD], [0x10FE, 0x1CBE], [0x10FF, 0x1CBF], [0x13A0, 0xAB70], [0x13A1, 0xAB71], [0x13A2, 0xAB72], [0x13A3, 0xAB73], [0x13A4, 0xAB74], [0x13A5, 0xAB75], [0x13A6, 0xAB76], [0x13A7, 0xAB77], [0x13A8, 0xAB78], [0x13A9, 0xAB79], [0x13AA, 0xAB7A], [0x13AB, 0xAB7B], [0x13AC, 0xAB7C], [0x13AD, 0xAB7D], [0x13AE, 0xAB7E], [0x13AF, 0xAB7F], [0x13B0, 0xAB80], [0x13B1, 0xAB81], [0x13B2, 0xAB82], [0x13B3, 0xAB83], [0x13B4, 0xAB84], [0x13B5, 0xAB85], [0x13B6, 0xAB86], [0x13B7, 0xAB87], [0x13B8, 0xAB88], [0x13B9, 0xAB89], [0x13BA, 0xAB8A], [0x13BB, 0xAB8B], [0x13BC, 0xAB8C], [0x13BD, 0xAB8D], [0x13BE, 0xAB8E], [0x13BF, 0xAB8F], [0x13C0, 0xAB90], [0x13C1, 0xAB91], [0x13C2, 0xAB92], [0x13C3, 0xAB93], [0x13C4, 0xAB94], [0x13C5, 0xAB95], [0x13C6, 0xAB96], [0x13C7, 0xAB97], [0x13C8, 0xAB98], [0x13C9, 0xAB99], [0x13CA, 0xAB9A], [0x13CB, 0xAB9B], [0x13CC, 0xAB9C], [0x13CD, 0xAB9D], [0x13CE, 0xAB9E], [0x13CF, 0xAB9F], [0x13D0, 0xABA0], [0x13D1, 0xABA1], [0x13D2, 0xABA2], [0x13D3, 0xABA3], [0x13D4, 0xABA4], [0x13D5, 0xABA5], [0x13D6, 0xABA6], [0x13D7, 0xABA7], [0x13D8, 0xABA8], [0x13D9, 0xABA9], [0x13DA, 0xABAA], [0x13DB, 0xABAB], [0x13DC, 0xABAC], [0x13DD, 0xABAD], [0x13DE, 0xABAE], [0x13DF, 0xABAF], [0x13E0, 0xABB0], [0x13E1, 0xABB1], [0x13E2, 0xABB2], [0x13E3, 0xABB3], [0x13E4, 0xABB4], [0x13E5, 0xABB5], [0x13E6, 0xABB6], [0x13E7, 0xABB7], [0x13E8, 0xABB8], [0x13E9, 0xABB9], [0x13EA, 0xABBA], [0x13EB, 0xABBB], [0x13EC, 0xABBC], [0x13ED, 0xABBD], [0x13EE, 0xABBE], [0x13EF, 0xABBF], [0x13F0, 0x13F8], [0x13F1, 0x13F9], [0x13F2, 0x13FA], [0x13F3, 0x13FB], [0x13F4, 0x13FC], [0x13F5, 0x13FD], [0x13F8, 0x13F0], [0x13F9, 0x13F1], [0x13FA, 0x13F2], [0x13FB, 0x13F3], [0x13FC, 0x13F4], [0x13FD, 0x13F5], [0x1C80, [0x412, 0x432]], [0x1C81, [0x414, 0x434]], [0x1C82, [0x41E, 0x43E]], [0x1C83, [0x421, 0x441]], [0x1C84, [0x1C85, 0x442]], [0x1C85, [0x422, 0x1C84, 0x442]], [0x1C86, [0x42A, 0x44A]], [0x1C87, [0x462, 0x463]], [0x1C88, [0xA64A, 0xA64B]], [0x1C90, 0x10D0], [0x1C91, 0x10D1], [0x1C92, 0x10D2], [0x1C93, 0x10D3], [0x1C94, 0x10D4], [0x1C95, 0x10D5], [0x1C96, 0x10D6], [0x1C97, 0x10D7], [0x1C98, 0x10D8], [0x1C99, 0x10D9], [0x1C9A, 0x10DA], [0x1C9B, 0x10DB], [0x1C9C, 0x10DC], [0x1C9D, 0x10DD], [0x1C9E, 0x10DE], [0x1C9F, 0x10DF], [0x1CA0, 0x10E0], [0x1CA1, 0x10E1], [0x1CA2, 0x10E2], [0x1CA3, 0x10E3], [0x1CA4, 0x10E4], [0x1CA5, 0x10E5], [0x1CA6, 0x10E6], [0x1CA7, 0x10E7], [0x1CA8, 0x10E8], [0x1CA9, 0x10E9], [0x1CAA, 0x10EA], [0x1CAB, 0x10EB], [0x1CAC, 0x10EC], [0x1CAD, 0x10ED], [0x1CAE, 0x10EE], [0x1CAF, 0x10EF], [0x1CB0, 0x10F0], [0x1CB1, 0x10F1], [0x1CB2, 0x10F2], [0x1CB3, 0x10F3], [0x1CB4, 0x10F4], [0x1CB5, 0x10F5], [0x1CB6, 0x10F6], [0x1CB7, 0x10F7], [0x1CB8, 0x10F8], [0x1CB9, 0x10F9], [0x1CBA, 0x10FA], [0x1CBD, 0x10FD], [0x1CBE, 0x10FE], [0x1CBF, 0x10FF], [0x1D8E, 0xA7C6], [0x1E60, 0x1E9B], [0x1E9B, 0x1E60], [0x1E9E, 0xDF], [0x1F80, 0x1F88], [0x1F81, 0x1F89], [0x1F82, 0x1F8A], [0x1F83, 0x1F8B], [0x1F84, 0x1F8C], [0x1F85, 0x1F8D], [0x1F86, 0x1F8E], [0x1F87, 0x1F8F], [0x1F88, 0x1F80], [0x1F89, 0x1F81], [0x1F8A, 0x1F82], [0x1F8B, 0x1F83], [0x1F8C, 0x1F84], [0x1F8D, 0x1F85], [0x1F8E, 0x1F86], [0x1F8F, 0x1F87], [0x1F90, 0x1F98], [0x1F91, 0x1F99], [0x1F92, 0x1F9A], [0x1F93, 0x1F9B], [0x1F94, 0x1F9C], [0x1F95, 0x1F9D], [0x1F96, 0x1F9E], [0x1F97, 0x1F9F], [0x1F98, 0x1F90], [0x1F99, 0x1F91], [0x1F9A, 0x1F92], [0x1F9B, 0x1F93], [0x1F9C, 0x1F94], [0x1F9D, 0x1F95], [0x1F9E, 0x1F96], [0x1F9F, 0x1F97], [0x1FA0, 0x1FA8], [0x1FA1, 0x1FA9], [0x1FA2, 0x1FAA], [0x1FA3, 0x1FAB], [0x1FA4, 0x1FAC], [0x1FA5, 0x1FAD], [0x1FA6, 0x1FAE], [0x1FA7, 0x1FAF], [0x1FA8, 0x1FA0], [0x1FA9, 0x1FA1], [0x1FAA, 0x1FA2], [0x1FAB, 0x1FA3], [0x1FAC, 0x1FA4], [0x1FAD, 0x1FA5], [0x1FAE, 0x1FA6], [0x1FAF, 0x1FA7], [0x1FB3, 0x1FBC], [0x1FBC, 0x1FB3], [0x1FBE, [0x345, 0x399]], [0x1FC3, 0x1FCC], [0x1FCC, 0x1FC3], [0x1FF3, 0x1FFC], [0x1FFC, 0x1FF3], [0x2126, [0x3A9, 0x3C9]], [0x212A, 0x4B], [0x212B, [0xC5, 0xE5]], [0xA64A, 0x1C88], [0xA64B, 0x1C88], [0xA794, 0xA7C4], [0xA7AE, 0x26A], [0xA7B2, 0x29D], [0xA7B3, 0xAB53], [0xA7B4, 0xA7B5], [0xA7B5, 0xA7B4], [0xA7B6, 0xA7B7], [0xA7B7, 0xA7B6], [0xA7B8, 0xA7B9], [0xA7B9, 0xA7B8], [0xA7BA, 0xA7BB], [0xA7BB, 0xA7BA], [0xA7BC, 0xA7BD], [0xA7BD, 0xA7BC], [0xA7BE, 0xA7BF], [0xA7BF, 0xA7BE], [0xA7C2, 0xA7C3], [0xA7C3, 0xA7C2], [0xA7C4, 0xA794], [0xA7C5, 0x282], [0xA7C6, 0x1D8E], [0xAB53, 0xA7B3], [0xAB70, 0x13A0], [0xAB71, 0x13A1], [0xAB72, 0x13A2], [0xAB73, 0x13A3], [0xAB74, 0x13A4], [0xAB75, 0x13A5], [0xAB76, 0x13A6], [0xAB77, 0x13A7], [0xAB78, 0x13A8], [0xAB79, 0x13A9], [0xAB7A, 0x13AA], [0xAB7B, 0x13AB], [0xAB7C, 0x13AC], [0xAB7D, 0x13AD], [0xAB7E, 0x13AE], [0xAB7F, 0x13AF], [0xAB80, 0x13B0], [0xAB81, 0x13B1], [0xAB82, 0x13B2], [0xAB83, 0x13B3], [0xAB84, 0x13B4], [0xAB85, 0x13B5], [0xAB86, 0x13B6], [0xAB87, 0x13B7], [0xAB88, 0x13B8], [0xAB89, 0x13B9], [0xAB8A, 0x13BA], [0xAB8B, 0x13BB], [0xAB8C, 0x13BC], [0xAB8D, 0x13BD], [0xAB8E, 0x13BE], [0xAB8F, 0x13BF], [0xAB90, 0x13C0], [0xAB91, 0x13C1], [0xAB92, 0x13C2], [0xAB93, 0x13C3], [0xAB94, 0x13C4], [0xAB95, 0x13C5], [0xAB96, 0x13C6], [0xAB97, 0x13C7], [0xAB98, 0x13C8], [0xAB99, 0x13C9], [0xAB9A, 0x13CA], [0xAB9B, 0x13CB], [0xAB9C, 0x13CC], [0xAB9D, 0x13CD], [0xAB9E, 0x13CE], [0xAB9F, 0x13CF], [0xABA0, 0x13D0], [0xABA1, 0x13D1], [0xABA2, 0x13D2], [0xABA3, 0x13D3], [0xABA4, 0x13D4], [0xABA5, 0x13D5], [0xABA6, 0x13D6], [0xABA7, 0x13D7], [0xABA8, 0x13D8], [0xABA9, 0x13D9], [0xABAA, 0x13DA], [0xABAB, 0x13DB], [0xABAC, 0x13DC], [0xABAD, 0x13DD], [0xABAE, 0x13DE], [0xABAF, 0x13DF], [0xABB0, 0x13E0], [0xABB1, 0x13E1], [0xABB2, 0x13E2], [0xABB3, 0x13E3], [0xABB4, 0x13E4], [0xABB5, 0x13E5], [0xABB6, 0x13E6], [0xABB7, 0x13E7], [0xABB8, 0x13E8], [0xABB9, 0x13E9], [0xABBA, 0x13EA], [0xABBB, 0x13EB], [0xABBC, 0x13EC], [0xABBD, 0x13ED], [0xABBE, 0x13EE], [0xABBF, 0x13EF], [0x10400, 0x10428], [0x10401, 0x10429], [0x10402, 0x1042A], [0x10403, 0x1042B], [0x10404, 0x1042C], [0x10405, 0x1042D], [0x10406, 0x1042E], [0x10407, 0x1042F], [0x10408, 0x10430], [0x10409, 0x10431], [0x1040A, 0x10432], [0x1040B, 0x10433], [0x1040C, 0x10434], [0x1040D, 0x10435], [0x1040E, 0x10436], [0x1040F, 0x10437], [0x10410, 0x10438], [0x10411, 0x10439], [0x10412, 0x1043A], [0x10413, 0x1043B], [0x10414, 0x1043C], [0x10415, 0x1043D], [0x10416, 0x1043E], [0x10417, 0x1043F], [0x10418, 0x10440], [0x10419, 0x10441], [0x1041A, 0x10442], [0x1041B, 0x10443], [0x1041C, 0x10444], [0x1041D, 0x10445], [0x1041E, 0x10446], [0x1041F, 0x10447], [0x10420, 0x10448], [0x10421, 0x10449], [0x10422, 0x1044A], [0x10423, 0x1044B], [0x10424, 0x1044C], [0x10425, 0x1044D], [0x10426, 0x1044E], [0x10427, 0x1044F], [0x10428, 0x10400], [0x10429, 0x10401], [0x1042A, 0x10402], [0x1042B, 0x10403], [0x1042C, 0x10404], [0x1042D, 0x10405], [0x1042E, 0x10406], [0x1042F, 0x10407], [0x10430, 0x10408], [0x10431, 0x10409], [0x10432, 0x1040A], [0x10433, 0x1040B], [0x10434, 0x1040C], [0x10435, 0x1040D], [0x10436, 0x1040E], [0x10437, 0x1040F], [0x10438, 0x10410], [0x10439, 0x10411], [0x1043A, 0x10412], [0x1043B, 0x10413], [0x1043C, 0x10414], [0x1043D, 0x10415], [0x1043E, 0x10416], [0x1043F, 0x10417], [0x10440, 0x10418], [0x10441, 0x10419], [0x10442, 0x1041A], [0x10443, 0x1041B], [0x10444, 0x1041C], [0x10445, 0x1041D], [0x10446, 0x1041E], [0x10447, 0x1041F], [0x10448, 0x10420], [0x10449, 0x10421], [0x1044A, 0x10422], [0x1044B, 0x10423], [0x1044C, 0x10424], [0x1044D, 0x10425], [0x1044E, 0x10426], [0x1044F, 0x10427], [0x104B0, 0x104D8], [0x104B1, 0x104D9], [0x104B2, 0x104DA], [0x104B3, 0x104DB], [0x104B4, 0x104DC], [0x104B5, 0x104DD], [0x104B6, 0x104DE], [0x104B7, 0x104DF], [0x104B8, 0x104E0], [0x104B9, 0x104E1], [0x104BA, 0x104E2], [0x104BB, 0x104E3], [0x104BC, 0x104E4], [0x104BD, 0x104E5], [0x104BE, 0x104E6], [0x104BF, 0x104E7], [0x104C0, 0x104E8], [0x104C1, 0x104E9], [0x104C2, 0x104EA], [0x104C3, 0x104EB], [0x104C4, 0x104EC], [0x104C5, 0x104ED], [0x104C6, 0x104EE], [0x104C7, 0x104EF], [0x104C8, 0x104F0], [0x104C9, 0x104F1], [0x104CA, 0x104F2], [0x104CB, 0x104F3], [0x104CC, 0x104F4], [0x104CD, 0x104F5], [0x104CE, 0x104F6], [0x104CF, 0x104F7], [0x104D0, 0x104F8], [0x104D1, 0x104F9], [0x104D2, 0x104FA], [0x104D3, 0x104FB], [0x104D8, 0x104B0], [0x104D9, 0x104B1], [0x104DA, 0x104B2], [0x104DB, 0x104B3], [0x104DC, 0x104B4], [0x104DD, 0x104B5], [0x104DE, 0x104B6], [0x104DF, 0x104B7], [0x104E0, 0x104B8], [0x104E1, 0x104B9], [0x104E2, 0x104BA], [0x104E3, 0x104BB], [0x104E4, 0x104BC], [0x104E5, 0x104BD], [0x104E6, 0x104BE], [0x104E7, 0x104BF], [0x104E8, 0x104C0], [0x104E9, 0x104C1], [0x104EA, 0x104C2], [0x104EB, 0x104C3], [0x104EC, 0x104C4], [0x104ED, 0x104C5], [0x104EE, 0x104C6], [0x104EF, 0x104C7], [0x104F0, 0x104C8], [0x104F1, 0x104C9], [0x104F2, 0x104CA], [0x104F3, 0x104CB], [0x104F4, 0x104CC], [0x104F5, 0x104CD], [0x104F6, 0x104CE], [0x104F7, 0x104CF], [0x104F8, 0x104D0], [0x104F9, 0x104D1], [0x104FA, 0x104D2], [0x104FB, 0x104D3], [0x10C80, 0x10CC0], [0x10C81, 0x10CC1], [0x10C82, 0x10CC2], [0x10C83, 0x10CC3], [0x10C84, 0x10CC4], [0x10C85, 0x10CC5], [0x10C86, 0x10CC6], [0x10C87, 0x10CC7], [0x10C88, 0x10CC8], [0x10C89, 0x10CC9], [0x10C8A, 0x10CCA], [0x10C8B, 0x10CCB], [0x10C8C, 0x10CCC], [0x10C8D, 0x10CCD], [0x10C8E, 0x10CCE], [0x10C8F, 0x10CCF], [0x10C90, 0x10CD0], [0x10C91, 0x10CD1], [0x10C92, 0x10CD2], [0x10C93, 0x10CD3], [0x10C94, 0x10CD4], [0x10C95, 0x10CD5], [0x10C96, 0x10CD6], [0x10C97, 0x10CD7], [0x10C98, 0x10CD8], [0x10C99, 0x10CD9], [0x10C9A, 0x10CDA], [0x10C9B, 0x10CDB], [0x10C9C, 0x10CDC], [0x10C9D, 0x10CDD], [0x10C9E, 0x10CDE], [0x10C9F, 0x10CDF], [0x10CA0, 0x10CE0], [0x10CA1, 0x10CE1], [0x10CA2, 0x10CE2], [0x10CA3, 0x10CE3], [0x10CA4, 0x10CE4], [0x10CA5, 0x10CE5], [0x10CA6, 0x10CE6], [0x10CA7, 0x10CE7], [0x10CA8, 0x10CE8], [0x10CA9, 0x10CE9], [0x10CAA, 0x10CEA], [0x10CAB, 0x10CEB], [0x10CAC, 0x10CEC], [0x10CAD, 0x10CED], [0x10CAE, 0x10CEE], [0x10CAF, 0x10CEF], [0x10CB0, 0x10CF0], [0x10CB1, 0x10CF1], [0x10CB2, 0x10CF2], [0x10CC0, 0x10C80], [0x10CC1, 0x10C81], [0x10CC2, 0x10C82], [0x10CC3, 0x10C83], [0x10CC4, 0x10C84], [0x10CC5, 0x10C85], [0x10CC6, 0x10C86], [0x10CC7, 0x10C87], [0x10CC8, 0x10C88], [0x10CC9, 0x10C89], [0x10CCA, 0x10C8A], [0x10CCB, 0x10C8B], [0x10CCC, 0x10C8C], [0x10CCD, 0x10C8D], [0x10CCE, 0x10C8E], [0x10CCF, 0x10C8F], [0x10CD0, 0x10C90], [0x10CD1, 0x10C91], [0x10CD2, 0x10C92], [0x10CD3, 0x10C93], [0x10CD4, 0x10C94], [0x10CD5, 0x10C95], [0x10CD6, 0x10C96], [0x10CD7, 0x10C97], [0x10CD8, 0x10C98], [0x10CD9, 0x10C99], [0x10CDA, 0x10C9A], [0x10CDB, 0x10C9B], [0x10CDC, 0x10C9C], [0x10CDD, 0x10C9D], [0x10CDE, 0x10C9E], [0x10CDF, 0x10C9F], [0x10CE0, 0x10CA0], [0x10CE1, 0x10CA1], [0x10CE2, 0x10CA2], [0x10CE3, 0x10CA3], [0x10CE4, 0x10CA4], [0x10CE5, 0x10CA5], [0x10CE6, 0x10CA6], [0x10CE7, 0x10CA7], [0x10CE8, 0x10CA8], [0x10CE9, 0x10CA9], [0x10CEA, 0x10CAA], [0x10CEB, 0x10CAB], [0x10CEC, 0x10CAC], [0x10CED, 0x10CAD], [0x10CEE, 0x10CAE], [0x10CEF, 0x10CAF], [0x10CF0, 0x10CB0], [0x10CF1, 0x10CB1], [0x10CF2, 0x10CB2], [0x118A0, 0x118C0], [0x118A1, 0x118C1], [0x118A2, 0x118C2], [0x118A3, 0x118C3], [0x118A4, 0x118C4], [0x118A5, 0x118C5], [0x118A6, 0x118C6], [0x118A7, 0x118C7], [0x118A8, 0x118C8], [0x118A9, 0x118C9], [0x118AA, 0x118CA], [0x118AB, 0x118CB], [0x118AC, 0x118CC], [0x118AD, 0x118CD], [0x118AE, 0x118CE], [0x118AF, 0x118CF], [0x118B0, 0x118D0], [0x118B1, 0x118D1], [0x118B2, 0x118D2], [0x118B3, 0x118D3], [0x118B4, 0x118D4], [0x118B5, 0x118D5], [0x118B6, 0x118D6], [0x118B7, 0x118D7], [0x118B8, 0x118D8], [0x118B9, 0x118D9], [0x118BA, 0x118DA], [0x118BB, 0x118DB], [0x118BC, 0x118DC], [0x118BD, 0x118DD], [0x118BE, 0x118DE], [0x118BF, 0x118DF], [0x118C0, 0x118A0], [0x118C1, 0x118A1], [0x118C2, 0x118A2], [0x118C3, 0x118A3], [0x118C4, 0x118A4], [0x118C5, 0x118A5], [0x118C6, 0x118A6], [0x118C7, 0x118A7], [0x118C8, 0x118A8], [0x118C9, 0x118A9], [0x118CA, 0x118AA], [0x118CB, 0x118AB], [0x118CC, 0x118AC], [0x118CD, 0x118AD], [0x118CE, 0x118AE], [0x118CF, 0x118AF], [0x118D0, 0x118B0], [0x118D1, 0x118B1], [0x118D2, 0x118B2], [0x118D3, 0x118B3], [0x118D4, 0x118B4], [0x118D5, 0x118B5], [0x118D6, 0x118B6], [0x118D7, 0x118B7], [0x118D8, 0x118B8], [0x118D9, 0x118B9], [0x118DA, 0x118BA], [0x118DB, 0x118BB], [0x118DC, 0x118BC], [0x118DD, 0x118BD], [0x118DE, 0x118BE], [0x118DF, 0x118BF], [0x16E40, 0x16E60], [0x16E41, 0x16E61], [0x16E42, 0x16E62], [0x16E43, 0x16E63], [0x16E44, 0x16E64], [0x16E45, 0x16E65], [0x16E46, 0x16E66], [0x16E47, 0x16E67], [0x16E48, 0x16E68], [0x16E49, 0x16E69], [0x16E4A, 0x16E6A], [0x16E4B, 0x16E6B], [0x16E4C, 0x16E6C], [0x16E4D, 0x16E6D], [0x16E4E, 0x16E6E], [0x16E4F, 0x16E6F], [0x16E50, 0x16E70], [0x16E51, 0x16E71], [0x16E52, 0x16E72], [0x16E53, 0x16E73], [0x16E54, 0x16E74], [0x16E55, 0x16E75], [0x16E56, 0x16E76], [0x16E57, 0x16E77], [0x16E58, 0x16E78], [0x16E59, 0x16E79], [0x16E5A, 0x16E7A], [0x16E5B, 0x16E7B], [0x16E5C, 0x16E7C], [0x16E5D, 0x16E7D], [0x16E5E, 0x16E7E], [0x16E5F, 0x16E7F], [0x16E60, 0x16E40], [0x16E61, 0x16E41], [0x16E62, 0x16E42], [0x16E63, 0x16E43], [0x16E64, 0x16E44], [0x16E65, 0x16E45], [0x16E66, 0x16E46], [0x16E67, 0x16E47], [0x16E68, 0x16E48], [0x16E69, 0x16E49], [0x16E6A, 0x16E4A], [0x16E6B, 0x16E4B], [0x16E6C, 0x16E4C], [0x16E6D, 0x16E4D], [0x16E6E, 0x16E4E], [0x16E6F, 0x16E4F], [0x16E70, 0x16E50], [0x16E71, 0x16E51], [0x16E72, 0x16E52], [0x16E73, 0x16E53], [0x16E74, 0x16E54], [0x16E75, 0x16E55], [0x16E76, 0x16E56], [0x16E77, 0x16E57], [0x16E78, 0x16E58], [0x16E79, 0x16E59], [0x16E7A, 0x16E5A], [0x16E7B, 0x16E5B], [0x16E7C, 0x16E5C], [0x16E7D, 0x16E5D], [0x16E7E, 0x16E5E], [0x16E7F, 0x16E5F], [0x1E900, 0x1E922], [0x1E901, 0x1E923], [0x1E902, 0x1E924], [0x1E903, 0x1E925], [0x1E904, 0x1E926], [0x1E905, 0x1E927], [0x1E906, 0x1E928], [0x1E907, 0x1E929], [0x1E908, 0x1E92A], [0x1E909, 0x1E92B], [0x1E90A, 0x1E92C], [0x1E90B, 0x1E92D], [0x1E90C, 0x1E92E], [0x1E90D, 0x1E92F], [0x1E90E, 0x1E930], [0x1E90F, 0x1E931], [0x1E910, 0x1E932], [0x1E911, 0x1E933], [0x1E912, 0x1E934], [0x1E913, 0x1E935], [0x1E914, 0x1E936], [0x1E915, 0x1E937], [0x1E916, 0x1E938], [0x1E917, 0x1E939], [0x1E918, 0x1E93A], [0x1E919, 0x1E93B], [0x1E91A, 0x1E93C], [0x1E91B, 0x1E93D], [0x1E91C, 0x1E93E], [0x1E91D, 0x1E93F], [0x1E91E, 0x1E940], [0x1E91F, 0x1E941], [0x1E920, 0x1E942], [0x1E921, 0x1E943], [0x1E922, 0x1E900], [0x1E923, 0x1E901], [0x1E924, 0x1E902], [0x1E925, 0x1E903], [0x1E926, 0x1E904], [0x1E927, 0x1E905], [0x1E928, 0x1E906], [0x1E929, 0x1E907], [0x1E92A, 0x1E908], [0x1E92B, 0x1E909], [0x1E92C, 0x1E90A], [0x1E92D, 0x1E90B], [0x1E92E, 0x1E90C], [0x1E92F, 0x1E90D], [0x1E930, 0x1E90E], [0x1E931, 0x1E90F], [0x1E932, 0x1E910], [0x1E933, 0x1E911], [0x1E934, 0x1E912], [0x1E935, 0x1E913], [0x1E936, 0x1E914], [0x1E937, 0x1E915], [0x1E938, 0x1E916], [0x1E939, 0x1E917], [0x1E93A, 0x1E918], [0x1E93B, 0x1E919], [0x1E93C, 0x1E91A], [0x1E93D, 0x1E91B], [0x1E93E, 0x1E91C], [0x1E93F, 0x1E91D], [0x1E940, 0x1E91E], [0x1E941, 0x1E91F], [0x1E942, 0x1E920], [0x1E943, 0x1E921]]);
- var REGULAR = new Map([['d', regenerate().addRange(0x30, 0x39)], ['D', regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0xFFFF)], ['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029)], ['S', regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0xFFFF)], ['w', regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A)], ['W', regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0xFFFF)]]);
- var UNICODE = new Map([['d', regenerate().addRange(0x30, 0x39)], ['D', regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF)], ['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029)], ['S', regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF)], ['w', regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A)], ['W', regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF)]]);
- var UNICODE_IGNORE_CASE = new Map([['d', regenerate().addRange(0x30, 0x39)], ['D', regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF)], ['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029)], ['S', regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF)], ['w', regenerate(0x5F, 0x17F, 0x212A).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A)], ['W', regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x17E).addRange(0x180, 0x2129).addRange(0x212B, 0x10FFFF)]]);
- var characterClassEscapeSets = {
- REGULAR: REGULAR,
- UNICODE: UNICODE,
- UNICODE_IGNORE_CASE: UNICODE_IGNORE_CASE
- };
- var generate = regjsgen.generate;
- var parse$4 = parser$1.parse;
- var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);
- var BMP_SET = regenerate().addRange(0x0, 0xFFFF);
- var DOT_SET_UNICODE = UNICODE_SET.clone().remove(0x000A, 0x000D, 0x2028, 0x2029);
- var getCharacterClassEscapeSet = function getCharacterClassEscapeSet(character, unicode, ignoreCase) {
- if (unicode) {
- if (ignoreCase) {
- return characterClassEscapeSets.UNICODE_IGNORE_CASE.get(character);
- }
- return characterClassEscapeSets.UNICODE.get(character);
- }
- return characterClassEscapeSets.REGULAR.get(character);
- };
- var getUnicodeDotSet = function getUnicodeDotSet(dotAll) {
- return dotAll ? UNICODE_SET : DOT_SET_UNICODE;
- };
- var getUnicodePropertyValueSet = function getUnicodePropertyValueSet(property, value) {
- var path = value ? property + "/" + value : "Binary_Property/" + property;
- try {
- return commonjsRequire("regenerate-unicode-properties/" + path + ".js");
- } catch (exception) {
- throw new Error("Failed to recognize value `" + value + "` for property " + ("`" + property + "`."));
- }
- };
- var handleLoneUnicodePropertyNameOrValue = function handleLoneUnicodePropertyNameOrValue(value) {
- try {
- var _property = 'General_Category';
- var category = unicodeMatchPropertyValueEcmascript(_property, value);
- return getUnicodePropertyValueSet(_property, category);
- } catch (exception) {}
- var property = unicodeMatchPropertyEcmascript(value);
- return getUnicodePropertyValueSet(property);
- };
- var getUnicodePropertyEscapeSet = function getUnicodePropertyEscapeSet(value, isNegative) {
- var parts = value.split('=');
- var firstPart = parts[0];
- var set;
- if (parts.length == 1) {
- set = handleLoneUnicodePropertyNameOrValue(firstPart);
- } else {
- var property = unicodeMatchPropertyEcmascript(firstPart);
- var _value = unicodeMatchPropertyValueEcmascript(property, parts[1]);
- set = getUnicodePropertyValueSet(property, _value);
- }
- if (isNegative) {
- return UNICODE_SET.clone().remove(set);
- }
- return set.clone();
- };
- regenerate.prototype.iuAddRange = function (min, max) {
- var $this = this;
- do {
- var folded = caseFold(min);
- if (folded) {
- $this.add(folded);
- }
- } while (++min <= max);
- return $this;
- };
- var update = function update(item, pattern) {
- var tree = parse$4(pattern, config$1.useUnicodeFlag ? 'u' : '');
- switch (tree.type) {
- case 'characterClass':
- case 'group':
- case 'value':
- break;
- default:
- tree = wrap$1(tree, pattern);
- }
- Object.assign(item, tree);
- };
- var wrap$1 = function wrap(tree, pattern) {
- return {
- 'type': 'group',
- 'behavior': 'ignore',
- 'body': [tree],
- 'raw': "(?:" + pattern + ")"
- };
- };
- var caseFold = function caseFold(codePoint) {
- return iuMappings.get(codePoint) || false;
- };
- var processCharacterClass = function processCharacterClass(characterClassItem, regenerateOptions) {
- var set = regenerate();
- for (var _iterator = characterClassItem.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var item = _ref;
- switch (item.type) {
- case 'value':
- set.add(item.codePoint);
- if (config$1.ignoreCase && config$1.unicode && !config$1.useUnicodeFlag) {
- var folded = caseFold(item.codePoint);
- if (folded) {
- set.add(folded);
- }
- }
- break;
- case 'characterClassRange':
- var min = item.min.codePoint;
- var max = item.max.codePoint;
- set.addRange(min, max);
- if (config$1.ignoreCase && config$1.unicode && !config$1.useUnicodeFlag) {
- set.iuAddRange(min, max);
- }
- break;
- case 'characterClassEscape':
- set.add(getCharacterClassEscapeSet(item.value, config$1.unicode, config$1.ignoreCase));
- break;
- case 'unicodePropertyEscape':
- set.add(getUnicodePropertyEscapeSet(item.value, item.negative));
- break;
- default:
- throw new Error("Unknown term type: " + item.type);
- }
- }
- if (characterClassItem.negative) {
- set = (config$1.unicode ? UNICODE_SET : BMP_SET).clone().remove(set);
- }
- update(characterClassItem, set.toString(regenerateOptions));
- return characterClassItem;
- };
- var updateNamedReference = function updateNamedReference(item, index) {
- delete item.name;
- item.matchIndex = index;
- };
- var assertNoUnmatchedReferences = function assertNoUnmatchedReferences(groups) {
- var unmatchedReferencesNames = Object.keys(groups.unmatchedReferences);
- if (unmatchedReferencesNames.length > 0) {
- throw new Error("Unknown group names: " + unmatchedReferencesNames);
- }
- };
- var processTerm = function processTerm(item, regenerateOptions, groups) {
- switch (item.type) {
- case 'dot':
- if (config$1.unicode) {
- update(item, getUnicodeDotSet(config$1.dotAll).toString(regenerateOptions));
- } else if (config$1.dotAll) {
- update(item, '[\\s\\S]');
- }
- break;
- case 'characterClass':
- item = processCharacterClass(item, regenerateOptions);
- break;
- case 'unicodePropertyEscape':
- update(item, getUnicodePropertyEscapeSet(item.value, item.negative).toString(regenerateOptions));
- break;
- case 'characterClassEscape':
- update(item, getCharacterClassEscapeSet(item.value, config$1.unicode, config$1.ignoreCase).toString(regenerateOptions));
- break;
- case 'group':
- if (item.behavior == 'normal') {
- groups.lastIndex++;
- }
- if (item.name) {
- var name = item.name.value;
- if (groups.names[name]) {
- throw new Error("Multiple groups with the same name (" + name + ") are not allowed.");
- }
- var index = groups.lastIndex;
- delete item.name;
- groups.names[name] = index;
- if (groups.onNamedGroup) {
- groups.onNamedGroup.call(null, name, index);
- }
- if (groups.unmatchedReferences[name]) {
- groups.unmatchedReferences[name].forEach(function (reference) {
- updateNamedReference(reference, index);
- });
- delete groups.unmatchedReferences[name];
- }
- }
- case 'alternative':
- case 'disjunction':
- case 'quantifier':
- item.body = item.body.map(function (term) {
- return processTerm(term, regenerateOptions, groups);
- });
- break;
- case 'value':
- var codePoint = item.codePoint;
- var set = regenerate(codePoint);
- if (config$1.ignoreCase && config$1.unicode && !config$1.useUnicodeFlag) {
- var folded = caseFold(codePoint);
- if (folded) {
- set.add(folded);
- }
- }
- update(item, set.toString(regenerateOptions));
- break;
- case 'reference':
- if (item.name) {
- var _name = item.name.value;
- var _index = groups.names[_name];
- if (_index) {
- updateNamedReference(item, _index);
- break;
- }
- if (!groups.unmatchedReferences[_name]) {
- groups.unmatchedReferences[_name] = [];
- }
- groups.unmatchedReferences[_name].push(item);
- }
- break;
- case 'anchor':
- case 'empty':
- case 'group':
- break;
- default:
- throw new Error("Unknown term type: " + item.type);
- }
- return item;
- };
- var config$1 = {
- 'ignoreCase': false,
- 'unicode': false,
- 'dotAll': false,
- 'useUnicodeFlag': false
- };
- var rewritePattern = function rewritePattern(pattern, flags, options) {
- var regjsparserFeatures = {
- 'unicodePropertyEscape': options && options.unicodePropertyEscape,
- 'namedGroups': options && options.namedGroup,
- 'lookbehind': options && options.lookbehind
- };
- config$1.ignoreCase = flags && flags.includes('i');
- config$1.unicode = flags && flags.includes('u');
- var supportDotAllFlag = options && options.dotAllFlag;
- config$1.dotAll = supportDotAllFlag && flags && flags.includes('s');
- config$1.useUnicodeFlag = options && options.useUnicodeFlag;
- var regenerateOptions = {
- 'hasUnicodeFlag': config$1.useUnicodeFlag,
- 'bmpOnly': !config$1.unicode
- };
- var groups = {
- 'onNamedGroup': options && options.onNamedGroup,
- 'lastIndex': 0,
- 'names': Object.create(null),
- 'unmatchedReferences': Object.create(null)
- };
- var tree = parse$4(pattern, flags, regjsparserFeatures);
- processTerm(tree, regenerateOptions, groups);
- assertNoUnmatchedReferences(groups);
- return generate(tree);
- };
- var rewritePattern_1 = rewritePattern;
- var FEATURES$1 = Object.freeze({
- unicodeFlag: 1 << 0,
- dotAllFlag: 1 << 1,
- unicodePropertyEscape: 1 << 2,
- namedCaptureGroups: 1 << 3
- });
- var featuresKey$1 = "@babel/plugin-regexp-features/featuresKey";
- var runtimeKey = "@babel/plugin-regexp-features/runtimeKey";
- function enableFeature$1(features, feature) {
- return features | feature;
- }
- function hasFeature$1(features, feature) {
- return !!(features & feature);
- }
- function generateRegexpuOptions(node, features) {
- var useUnicodeFlag = false,
- dotAllFlag = false,
- unicodePropertyEscape = false,
- namedGroup = false;
- var flags = node.flags,
- pattern = node.pattern;
- var flagsIncludesU = flags.includes("u");
- if (flagsIncludesU) {
- if (!hasFeature$1(features, FEATURES$1.unicodeFlag)) {
- useUnicodeFlag = true;
- }
- if (hasFeature$1(features, FEATURES$1.unicodePropertyEscape) && /\\[pP]{/.test(pattern)) {
- unicodePropertyEscape = true;
- }
- }
- if (hasFeature$1(features, FEATURES$1.dotAllFlag) && flags.indexOf("s") >= 0) {
- dotAllFlag = true;
- }
- if (hasFeature$1(features, FEATURES$1.namedCaptureGroups) && /\(\?<(?![=!])/.test(pattern)) {
- namedGroup = true;
- }
- if (!namedGroup && !unicodePropertyEscape && !dotAllFlag && (!flagsIncludesU || useUnicodeFlag)) {
- return null;
- }
- if (flagsIncludesU && flags.indexOf("s") >= 0) {
- dotAllFlag = true;
- }
- return {
- useUnicodeFlag: useUnicodeFlag,
- onNamedGroup: function onNamedGroup() {},
- namedGroup: namedGroup,
- unicodePropertyEscape: unicodePropertyEscape,
- dotAllFlag: dotAllFlag,
- lookbehind: true
- };
- }
- var name$1 = "@babel/helper-create-regexp-features-plugin";
- var version$5 = "7.8.3";
- var author$1 = "The Babel Team (https://babeljs.io/team)";
- var license$1 = "MIT";
- var description$1 = "Compile ESNext Regular Expressions to ES5";
- var repository$1 = {
- type: "git",
- url: "https://github.com/babel/babel",
- directory: "packages/babel-helper-create-regexp-features-plugin"
- };
- var main$1 = "lib/index.js";
- var publishConfig$1 = {
- access: "public"
- };
- var keywords$2 = [
- "babel",
- "babel-plugin"
- ];
- var dependencies$1 = {
- "@babel/helper-regex": "^7.8.3",
- "regexpu-core": "^4.6.0"
- };
- var peerDependencies$1 = {
- "@babel/core": "^7.0.0"
- };
- var devDependencies$1 = {
- "@babel/core": "^7.8.3",
- "@babel/helper-plugin-test-runner": "^7.8.3"
- };
- var gitHead$1 = "a7620bd266ae1345975767bbc7abf09034437017";
- var pkg$1 = {
- name: name$1,
- version: version$5,
- author: author$1,
- license: license$1,
- description: description$1,
- repository: repository$1,
- main: main$1,
- publishConfig: publishConfig$1,
- keywords: keywords$2,
- dependencies: dependencies$1,
- peerDependencies: peerDependencies$1,
- devDependencies: devDependencies$1,
- gitHead: gitHead$1
- };
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1,
- length = array.length;
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- var _baseIndexOfWith = baseIndexOfWith;
- var arrayProto$1 = Array.prototype;
- var splice$1 = arrayProto$1.splice;
- function basePullAll(array, values, iteratee, comparator) {
- var indexOf = comparator ? _baseIndexOfWith : _baseIndexOf,
- index = -1,
- length = values.length,
- seen = array;
- if (array === values) {
- values = _copyArray(values);
- }
- if (iteratee) {
- seen = _arrayMap(array, _baseUnary(iteratee));
- }
- while (++index < length) {
- var fromIndex = 0,
- value = values[index],
- computed = iteratee ? iteratee(value) : value;
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice$1.call(seen, fromIndex, 1);
- }
- splice$1.call(array, fromIndex, 1);
- }
- }
- return array;
- }
- var _basePullAll = basePullAll;
- function pullAll(array, values) {
- return array && array.length && values && values.length ? _basePullAll(array, values) : array;
- }
- var pullAll_1 = pullAll;
- var pull = _baseRest(pullAll_1);
- var pull_1 = pull;
- function is$2(node, flag) {
- return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0;
- }
- function pullFlag(node, flag) {
- var flags = node.flags.split("");
- if (node.flags.indexOf(flag) < 0) return;
- pull_1(flags, flag);
- node.flags = flags.join("");
- }
- var version$6 = pkg$1.version.split(".").reduce(function (v, x) {
- return v * 1e5 + +x;
- }, 0);
- var versionKey$1 = "@babel/plugin-regexp-features/version";
- function createRegExpFeaturePlugin(_ref) {
- var name = _ref.name,
- feature = _ref.feature,
- _ref$options = _ref.options,
- options = _ref$options === void 0 ? {} : _ref$options;
- return {
- name: name,
- pre: function pre() {
- var _file$get;
- var file = this.file;
- var features = (_file$get = file.get(featuresKey$1)) != null ? _file$get : 0;
- var newFeatures = enableFeature$1(features, FEATURES$1[feature]);
- var useUnicodeFlag = options.useUnicodeFlag,
- _options$runtime = options.runtime,
- runtime = _options$runtime === void 0 ? true : _options$runtime;
- if (useUnicodeFlag === false) {
- newFeatures = enableFeature$1(newFeatures, FEATURES$1.unicodeFlag);
- }
- if (newFeatures !== features) {
- file.set(featuresKey$1, newFeatures);
- }
- if (!runtime) {
- file.set(runtimeKey, false);
- }
- if (!file.has(versionKey$1) || file.get(versionKey$1) < version$6) {
- file.set(versionKey$1, version$6);
- }
- },
- visitor: {
- RegExpLiteral: function RegExpLiteral(path) {
- var _file$get2;
- var node = path.node;
- var file = this.file;
- var features = file.get(featuresKey$1);
- var runtime = (_file$get2 = file.get(runtimeKey)) != null ? _file$get2 : true;
- var regexpuOptions = generateRegexpuOptions(node, features);
- if (regexpuOptions === null) {
- return;
- }
- var namedCaptureGroups = {};
- if (regexpuOptions.namedGroup) {
- regexpuOptions.onNamedGroup = function (name, index) {
- namedCaptureGroups[name] = index;
- };
- }
- node.pattern = rewritePattern_1(node.pattern, node.flags, regexpuOptions);
- if (regexpuOptions.namedGroup && Object.keys(namedCaptureGroups).length > 0 && runtime && !isRegExpTest(path)) {
- path.replaceWith(CallExpression(this.addHelper("wrapRegExp"), [node, valueToNode(namedCaptureGroups)]));
- }
- if (hasFeature$1(features, FEATURES$1.unicodeFlag)) {
- pullFlag(node, "u");
- }
- if (hasFeature$1(features, FEATURES$1.dotAllFlag)) {
- pullFlag(node, "s");
- }
- }
- }
- };
- }
- function isRegExpTest(path) {
- return path.parentPath.isMemberExpression({
- object: path.node,
- computed: false
- }) && path.parentPath.get("property").isIdentifier({
- name: "test"
- });
- }
- var proposalUnicodePropertyRegex = declare(function (api, options) {
- api.assertVersion(7);
- var _options$useUnicodeFl = options.useUnicodeFlag,
- useUnicodeFlag = _options$useUnicodeFl === void 0 ? true : _options$useUnicodeFl;
- if (typeof useUnicodeFlag !== "boolean") {
- throw new Error(".useUnicodeFlag must be a boolean, or undefined");
- }
- return createRegExpFeaturePlugin({
- name: "proposal-unicode-property-regex",
- feature: "unicodePropertyEscape",
- options: {
- useUnicodeFlag: useUnicodeFlag
- }
- });
- });
- var inherits$1;
- if (typeof Object.create === 'function') {
- inherits$1 = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor;
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
- } else {
- inherits$1 = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor;
- var TempCtor = function TempCtor() {};
- TempCtor.prototype = superCtor.prototype;
- ctor.prototype = new TempCtor();
- ctor.prototype.constructor = ctor;
- };
- }
- var inherits$2 = inherits$1;
- var formatRegExp = /%[sdj%]/g;
- function format(f) {
- if (!isString$2(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$2(x)) {
- str += ' ' + x;
- } else {
- str += ' ' + inspect(x);
- }
- }
- return str;
- }
- function deprecate(fn, msg) {
- if (isUndefined(global$1.process)) {
- return function () {
- return 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;
- function debuglog(set) {
- if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || '';
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
- var pid = 0;
- debugs[set] = function () {
- var msg = format.apply(null, arguments);
- console.error('%s %d: %s', set, pid, msg);
- };
- } else {
- debugs[set] = function () {};
- }
- }
- return debugs[set];
- }
- function inspect(obj, opts) {
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- ctx.showHidden = opts;
- } else if (opts) {
- _extend(ctx, opts);
- }
- 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);
- }
- 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]
- };
- inspect.styles = {
- 'special': 'cyan',
- 'number': 'yellow',
- 'boolean': 'yellow',
- 'undefined': 'grey',
- 'null': 'bold',
- 'string': 'green',
- 'date': 'magenta',
- 'regexp': 'red'
- };
- function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
- if (style) {
- return "\x1B[" + inspect.colors[style][0] + 'm' + str + "\x1B[" + 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) {
- if (ctx.customInspect && value && isFunction$3(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString$2(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
- if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
- return formatError(value);
- }
- if (keys.length === 0) {
- if (isFunction$3(value)) {
- var name = value.name ? ': ' + value.name : '';
- return ctx.stylize('[Function' + name + ']', 'special');
- }
- if (isRegExp$1(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 = ['{', '}'];
- if (isArray$3(value)) {
- array = true;
- braces = ['[', ']'];
- }
- if (isFunction$3(value)) {
- var n = value.name ? ': ' + value.name : '';
- base = ' [Function' + n + ']';
- }
- if (isRegExp$1(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
- 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$1(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$2(value)) {
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
- }
- if (isNumber$1(value)) return ctx.stylize('' + value, 'number');
- if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');
- 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$f(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$f(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];
- }
- function isArray$3(ar) {
- return Array.isArray(ar);
- }
- function isBoolean(arg) {
- return typeof arg === 'boolean';
- }
- function isNull(arg) {
- return arg === null;
- }
- function isNullOrUndefined(arg) {
- return arg == null;
- }
- function isNumber$1(arg) {
- return typeof arg === 'number';
- }
- function isString$2(arg) {
- return typeof arg === 'string';
- }
- function isSymbol$1(arg) {
- return typeof arg === 'symbol';
- }
- function isUndefined(arg) {
- return arg === void 0;
- }
- function isRegExp$1(re) {
- return isObject$2(re) && objectToString$1(re) === '[object RegExp]';
- }
- function isObject$2(arg) {
- return typeof arg === 'object' && arg !== null;
- }
- function isDate(d) {
- return isObject$2(d) && objectToString$1(d) === '[object Date]';
- }
- function isError(e) {
- return isObject$2(e) && (objectToString$1(e) === '[object Error]' || e instanceof Error);
- }
- function isFunction$3(arg) {
- return typeof arg === 'function';
- }
- function isPrimitive(arg) {
- return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || typeof arg === 'undefined';
- }
- function isBuffer$2(maybeBuf) {
- return isBuffer(maybeBuf);
- }
- function objectToString$1(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'];
- 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(' ');
- }
- function log() {
- console.log('%s - %s', timestamp(), format.apply(null, arguments));
- }
- function _extend(origin, add) {
- if (!add || !isObject$2(add)) return origin;
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
- }
- function hasOwnProperty$f(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- }
- var _util = {
- inherits: inherits$2,
- _extend: _extend,
- log: log,
- isBuffer: isBuffer$2,
- isPrimitive: isPrimitive,
- isFunction: isFunction$3,
- isError: isError,
- isDate: isDate,
- isObject: isObject$2,
- isRegExp: isRegExp$1,
- isUndefined: isUndefined,
- isSymbol: isSymbol$1,
- isString: isString$2,
- isNumber: isNumber$1,
- isNullOrUndefined: isNullOrUndefined,
- isNull: isNull,
- isBoolean: isBoolean,
- isArray: isArray$3,
- inspect: inspect,
- deprecate: deprecate,
- format: format,
- debuglog: debuglog
- };
- 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;
- }
- var hasOwn = Object.prototype.hasOwnProperty;
- var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- if (hasOwn.call(obj, key)) keys.push(key);
- }
- return keys;
- };
- var pSlice = Array.prototype.slice;
- var _functionsHaveNames;
- function functionsHaveNames() {
- if (typeof _functionsHaveNames !== 'undefined') {
- return _functionsHaveNames;
- }
- return _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 global$1.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;
- }
- function assert$2(value, message) {
- if (!value) fail(value, true, message, '==', ok);
- }
- var regex = /\s*function\s+([^\(\s]*)\s*/;
- function getName(func) {
- if (!isFunction$3(func)) {
- return;
- }
- if (functionsHaveNames()) {
- return func.name;
- }
- var str = func.toString();
- var match = str.match(regex);
- return match && match[1];
- }
- assert$2.AssertionError = 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 {
- var err = new Error();
- if (err.stack) {
- var out = err.stack;
- var fn_name = getName(stackStartFunction);
- var idx = out.indexOf('\n' + fn_name);
- if (idx >= 0) {
- var next_line = out.indexOf('\n', idx + 1);
- out = out.substring(next_line + 1);
- }
- this.stack = out;
- }
- }
- }
- inherits$2(AssertionError, Error);
- function truncate(s, n) {
- if (typeof s === 'string') {
- return s.length < n ? s : s.slice(0, n);
- } else {
- return s;
- }
- }
- function inspect$1(something) {
- if (functionsHaveNames() || !isFunction$3(something)) {
- return inspect(something);
- }
- var rawname = getName(something);
- var name = rawname ? ': ' + rawname : '';
- return '[Function' + name + ']';
- }
- function getMessage(self) {
- return truncate(inspect$1(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect$1(self.expected), 128);
- }
- function fail(actual, expected, message, operator, stackStartFunction) {
- throw new AssertionError({
- message: message,
- actual: actual,
- expected: expected,
- operator: operator,
- stackStartFunction: stackStartFunction
- });
- }
- assert$2.fail = fail;
- function ok(value, message) {
- if (!value) fail(value, true, message, '==', ok);
- }
- assert$2.ok = ok;
- assert$2.equal = equal;
- function equal(actual, expected, message) {
- if (actual != expected) fail(actual, expected, message, '==', equal);
- }
- assert$2.notEqual = notEqual;
- function notEqual(actual, expected, message) {
- if (actual == expected) {
- fail(actual, expected, message, '!=', notEqual);
- }
- }
- assert$2.deepEqual = deepEqual;
- function deepEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, 'deepEqual', deepEqual);
- }
- }
- assert$2.deepStrictEqual = deepStrictEqual;
- function deepStrictEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);
- }
- }
- function _deepEqual(actual, expected, strict, memos) {
- if (actual === expected) {
- return true;
- } else if (isBuffer(actual) && isBuffer(expected)) {
- return compare(actual, expected) === 0;
- } else if (isDate(actual) && isDate(expected)) {
- return actual.getTime() === expected.getTime();
- } else if (isRegExp$1(actual) && isRegExp$1(expected)) {
- return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase;
- } else if ((actual === null || typeof actual !== 'object') && (expected === null || typeof expected !== 'object')) {
- return strict ? actual === expected : actual == expected;
- } 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;
- } 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$1(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 (isPrimitive(a) || isPrimitive(b)) return a === b;
- if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;
- var aIsArgs = isArguments$1(a);
- var bIsArgs = isArguments$1(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;
- if (ka.length !== kb.length) return false;
- ka.sort();
- kb.sort();
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] !== kb[i]) return false;
- }
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false;
- }
- return true;
- }
- assert$2.notDeepEqual = notDeepEqual;
- function notDeepEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, false)) {
- fail(actual, expected, message, 'notDeepEqual', notDeepEqual);
- }
- }
- assert$2.notDeepStrictEqual = notDeepStrictEqual;
- function notDeepStrictEqual(actual, expected, message) {
- if (_deepEqual(actual, expected, true)) {
- fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
- }
- }
- assert$2.strictEqual = strictEqual;
- function strictEqual(actual, expected, message) {
- if (actual !== expected) {
- fail(actual, expected, message, '===', strictEqual);
- }
- }
- assert$2.notStrictEqual = notStrictEqual;
- function notStrictEqual(actual, expected, message) {
- if (actual === expected) {
- fail(actual, expected, message, '!==', 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) {}
- 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 && 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;
- }
- }
- assert$2["throws"] = _throws2;
- function _throws2(block, error, message) {
- _throws(true, block, error, message);
- }
- assert$2.doesNotThrow = doesNotThrow;
- function doesNotThrow(block, error, message) {
- _throws(false, block, error, message);
- }
- assert$2.ifError = ifError;
- function ifError(err) {
- if (err) throw err;
- }
- var ImportBuilder = function () {
- function ImportBuilder(importedSource, scope, hub) {
- this._statements = [];
- this._resultName = null;
- this._scope = null;
- this._hub = null;
- this._scope = scope;
- this._hub = hub;
- this._importedSource = importedSource;
- }
- var _proto = ImportBuilder.prototype;
- _proto.done = function done() {
- return {
- statements: this._statements,
- resultName: this._resultName
- };
- };
- _proto["import"] = function _import() {
- this._statements.push(ImportDeclaration([], StringLiteral(this._importedSource)));
- return this;
- };
- _proto.require = function require() {
- this._statements.push(ExpressionStatement(CallExpression(Identifier("require"), [StringLiteral(this._importedSource)])));
- return this;
- };
- _proto.namespace = function namespace(name) {
- if (name === void 0) {
- name = "namespace";
- }
- name = this._scope.generateUidIdentifier(name);
- var statement = this._statements[this._statements.length - 1];
- assert$2(statement.type === "ImportDeclaration");
- assert$2(statement.specifiers.length === 0);
- statement.specifiers = [ImportNamespaceSpecifier(name)];
- this._resultName = cloneNode(name);
- return this;
- };
- _proto["default"] = function _default(name) {
- name = this._scope.generateUidIdentifier(name);
- var statement = this._statements[this._statements.length - 1];
- assert$2(statement.type === "ImportDeclaration");
- assert$2(statement.specifiers.length === 0);
- statement.specifiers = [ImportDefaultSpecifier(name)];
- this._resultName = cloneNode(name);
- return this;
- };
- _proto.named = function named(name, importName) {
- if (importName === "default") return this["default"](name);
- name = this._scope.generateUidIdentifier(name);
- var statement = this._statements[this._statements.length - 1];
- assert$2(statement.type === "ImportDeclaration");
- assert$2(statement.specifiers.length === 0);
- statement.specifiers = [ImportSpecifier(name, Identifier(importName))];
- this._resultName = cloneNode(name);
- return this;
- };
- _proto["var"] = function _var(name) {
- name = this._scope.generateUidIdentifier(name);
- var statement = this._statements[this._statements.length - 1];
- if (statement.type !== "ExpressionStatement") {
- assert$2(this._resultName);
- statement = ExpressionStatement(this._resultName);
- this._statements.push(statement);
- }
- this._statements[this._statements.length - 1] = VariableDeclaration("var", [VariableDeclarator(name, statement.expression)]);
- this._resultName = cloneNode(name);
- return this;
- };
- _proto.defaultInterop = function defaultInterop() {
- return this._interop(this._hub.addHelper("interopRequireDefault"));
- };
- _proto.wildcardInterop = function wildcardInterop() {
- return this._interop(this._hub.addHelper("interopRequireWildcard"));
- };
- _proto._interop = function _interop(callee) {
- var statement = this._statements[this._statements.length - 1];
- if (statement.type === "ExpressionStatement") {
- statement.expression = CallExpression(callee, [statement.expression]);
- } else if (statement.type === "VariableDeclaration") {
- assert$2(statement.declarations.length === 1);
- statement.declarations[0].init = CallExpression(callee, [statement.declarations[0].init]);
- } else {
- assert$2.fail("Unexpected type.");
- }
- return this;
- };
- _proto.prop = function prop(name) {
- var statement = this._statements[this._statements.length - 1];
- if (statement.type === "ExpressionStatement") {
- statement.expression = MemberExpression(statement.expression, Identifier(name));
- } else if (statement.type === "VariableDeclaration") {
- assert$2(statement.declarations.length === 1);
- statement.declarations[0].init = MemberExpression(statement.declarations[0].init, Identifier(name));
- } else {
- assert$2.fail("Unexpected type:" + statement.type);
- }
- return this;
- };
- _proto.read = function read(name) {
- this._resultName = MemberExpression(this._resultName, Identifier(name));
- };
- return ImportBuilder;
- }();
- function isModule(path) {
- var sourceType = path.node.sourceType;
- if (sourceType !== "module" && sourceType !== "script") {
- throw path.buildCodeFrameError("Unknown sourceType \"" + sourceType + "\", cannot transform.");
- }
- return path.node.sourceType === "module";
- }
- var ImportInjector = function () {
- function ImportInjector(path, importedSource, opts) {
- this._defaultOpts = {
- importedSource: null,
- importedType: "commonjs",
- importedInterop: "babel",
- importingInterop: "babel",
- ensureLiveReference: false,
- ensureNoContext: false
- };
- var programPath = path.find(function (p) {
- return p.isProgram();
- });
- this._programPath = programPath;
- this._programScope = programPath.scope;
- this._hub = programPath.hub;
- this._defaultOpts = this._applyDefaults(importedSource, opts, true);
- }
- var _proto = ImportInjector.prototype;
- _proto.addDefault = function addDefault(importedSourceIn, opts) {
- return this.addNamed("default", importedSourceIn, opts);
- };
- _proto.addNamed = function addNamed(importName, importedSourceIn, opts) {
- assert$2(typeof importName === "string");
- return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName);
- };
- _proto.addNamespace = function addNamespace(importedSourceIn, opts) {
- return this._generateImport(this._applyDefaults(importedSourceIn, opts), null);
- };
- _proto.addSideEffect = function addSideEffect(importedSourceIn, opts) {
- return this._generateImport(this._applyDefaults(importedSourceIn, opts), false);
- };
- _proto._applyDefaults = function _applyDefaults(importedSource, opts, isInit) {
- if (isInit === void 0) {
- isInit = false;
- }
- var optsList = [];
- if (typeof importedSource === "string") {
- optsList.push({
- importedSource: importedSource
- });
- optsList.push(opts);
- } else {
- assert$2(!opts, "Unexpected secondary arguments.");
- optsList.push(importedSource);
- }
- var newOpts = Object.assign({}, this._defaultOpts);
- var _loop = function _loop() {
- var opts = _optsList[_i];
- if (!opts) return "continue";
- Object.keys(newOpts).forEach(function (key) {
- if (opts[key] !== undefined) newOpts[key] = opts[key];
- });
- if (!isInit) {
- if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;
- if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;
- }
- };
- for (var _i = 0, _optsList = optsList; _i < _optsList.length; _i++) {
- var _ret = _loop();
- if (_ret === "continue") continue;
- }
- return newOpts;
- };
- _proto._generateImport = function _generateImport(opts, importName) {
- var isDefault = importName === "default";
- var isNamed = !!importName && !isDefault;
- var isNamespace = importName === null;
- var importedSource = opts.importedSource,
- importedType = opts.importedType,
- importedInterop = opts.importedInterop,
- importingInterop = opts.importingInterop,
- ensureLiveReference = opts.ensureLiveReference,
- ensureNoContext = opts.ensureNoContext,
- nameHint = opts.nameHint,
- blockHoist = opts.blockHoist;
- var name = nameHint || importName;
- var isMod = isModule(this._programPath);
- var isModuleForNode = isMod && importingInterop === "node";
- var isModuleForBabel = isMod && importingInterop === "babel";
- var builder = new ImportBuilder(importedSource, this._programScope, this._hub);
- if (importedType === "es6") {
- if (!isModuleForNode && !isModuleForBabel) {
- throw new Error("Cannot import an ES6 module from CommonJS");
- }
- builder["import"]();
- if (isNamespace) {
- builder.namespace(nameHint || importedSource);
- } else if (isDefault || isNamed) {
- builder.named(name, importName);
- }
- } else if (importedType !== "commonjs") {
- throw new Error("Unexpected interopType \"" + importedType + "\"");
- } else if (importedInterop === "babel") {
- if (isModuleForNode) {
- name = name !== "default" ? name : importedSource;
- var es6Default = importedSource + "$es6Default";
- builder["import"]();
- if (isNamespace) {
- builder["default"](es6Default)["var"](name || importedSource).wildcardInterop();
- } else if (isDefault) {
- if (ensureLiveReference) {
- builder["default"](es6Default)["var"](name || importedSource).defaultInterop().read("default");
- } else {
- builder["default"](es6Default)["var"](name).defaultInterop().prop(importName);
- }
- } else if (isNamed) {
- builder["default"](es6Default).read(importName);
- }
- } else if (isModuleForBabel) {
- builder["import"]();
- if (isNamespace) {
- builder.namespace(name || importedSource);
- } else if (isDefault || isNamed) {
- builder.named(name, importName);
- }
- } else {
- builder.require();
- if (isNamespace) {
- builder["var"](name || importedSource).wildcardInterop();
- } else if ((isDefault || isNamed) && ensureLiveReference) {
- if (isDefault) {
- name = name !== "default" ? name : importedSource;
- builder["var"](name).read(importName);
- builder.defaultInterop();
- } else {
- builder["var"](importedSource).read(importName);
- }
- } else if (isDefault) {
- builder["var"](name).defaultInterop().prop(importName);
- } else if (isNamed) {
- builder["var"](name).prop(importName);
- }
- }
- } else if (importedInterop === "compiled") {
- if (isModuleForNode) {
- builder["import"]();
- if (isNamespace) {
- builder["default"](name || importedSource);
- } else if (isDefault || isNamed) {
- builder["default"](importedSource).read(name);
- }
- } else if (isModuleForBabel) {
- builder["import"]();
- if (isNamespace) {
- builder.namespace(name || importedSource);
- } else if (isDefault || isNamed) {
- builder.named(name, importName);
- }
- } else {
- builder.require();
- if (isNamespace) {
- builder["var"](name || importedSource);
- } else if (isDefault || isNamed) {
- if (ensureLiveReference) {
- builder["var"](importedSource).read(name);
- } else {
- builder.prop(importName)["var"](name);
- }
- }
- }
- } else if (importedInterop === "uncompiled") {
- if (isDefault && ensureLiveReference) {
- throw new Error("No live reference for commonjs default");
- }
- if (isModuleForNode) {
- builder["import"]();
- if (isNamespace) {
- builder["default"](name || importedSource);
- } else if (isDefault) {
- builder["default"](name);
- } else if (isNamed) {
- builder["default"](importedSource).read(name);
- }
- } else if (isModuleForBabel) {
- builder["import"]();
- if (isNamespace) {
- builder["default"](name || importedSource);
- } else if (isDefault) {
- builder["default"](name);
- } else if (isNamed) {
- builder.named(name, importName);
- }
- } else {
- builder.require();
- if (isNamespace) {
- builder["var"](name || importedSource);
- } else if (isDefault) {
- builder["var"](name);
- } else if (isNamed) {
- if (ensureLiveReference) {
- builder["var"](importedSource).read(name);
- } else {
- builder["var"](name).prop(importName);
- }
- }
- }
- } else {
- throw new Error("Unknown importedInterop \"" + importedInterop + "\".");
- }
- var _builder$done = builder.done(),
- statements = _builder$done.statements,
- resultName = _builder$done.resultName;
- this._insertStatements(statements, blockHoist);
- if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") {
- return SequenceExpression([NumericLiteral(0), resultName]);
- }
- return resultName;
- };
- _proto._insertStatements = function _insertStatements(statements, blockHoist) {
- if (blockHoist === void 0) {
- blockHoist = 3;
- }
- statements.forEach(function (node) {
- node._blockHoist = blockHoist;
- });
- var targetPath = this._programPath.get("body").find(function (p) {
- var val = p.node._blockHoist;
- return Number.isFinite(val) && val < 4;
- });
- if (targetPath) {
- targetPath.insertBefore(statements);
- } else {
- this._programPath.unshiftContainer("body", statements);
- }
- };
- return ImportInjector;
- }();
- function addDefault(path, importedSource, opts) {
- return new ImportInjector(path).addDefault(importedSource, opts);
- }
- function addNamed(path, name, importedSource, opts) {
- return new ImportInjector(path).addNamed(name, importedSource, opts);
- }
- function addSideEffect(path, importedSource, opts) {
- return new ImportInjector(path).addSideEffect(importedSource, opts);
- }
- var transformAsyncToGenerator = declare(function (api, options) {
- api.assertVersion(7);
- var method = options.method,
- module = options.module;
- if (method && module) {
- return {
- name: "transform-async-to-generator",
- visitor: {
- Function: function Function(path, state) {
- if (!path.node.async || path.node.generator) return;
- var wrapAsync = state.methodWrapper;
- if (wrapAsync) {
- wrapAsync = cloneNode(wrapAsync);
- } else {
- wrapAsync = state.methodWrapper = addNamed(path, method, module);
- }
- remapAsyncToGenerator(path, {
- wrapAsync: wrapAsync
- });
- }
- }
- };
- }
- return {
- name: "transform-async-to-generator",
- visitor: {
- Function: function Function(path, state) {
- if (!path.node.async || path.node.generator) return;
- remapAsyncToGenerator(path, {
- wrapAsync: state.addHelper("asyncToGenerator")
- });
- }
- }
- };
- });
- var transformArrowFunctions = declare(function (api, options) {
- api.assertVersion(7);
- var spec = options.spec;
- return {
- name: "transform-arrow-functions",
- visitor: {
- ArrowFunctionExpression: function ArrowFunctionExpression(path) {
- if (!path.isArrowFunctionExpression()) return;
- path.arrowFunctionToExpression({
- allowInsertArrow: false,
- specCompliant: !!spec
- });
- }
- }
- };
- });
- var transformBlockScopedFunctions = declare(function (api) {
- api.assertVersion(7);
- function statementList(key, path) {
- var paths = path.get(key);
- for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _path = _ref;
- var func = _path.node;
- if (!_path.isFunctionDeclaration()) continue;
- var declar = VariableDeclaration("let", [VariableDeclarator(func.id, toExpression(func))]);
- declar._blockHoist = 2;
- func.id = null;
- _path.replaceWith(declar);
- }
- }
- return {
- name: "transform-block-scoped-functions",
- visitor: {
- BlockStatement: function BlockStatement(path) {
- var node = path.node,
- parent = path.parent;
- if (isFunction(parent, {
- body: node
- }) || isExportDeclaration(parent)) {
- return;
- }
- statementList("body", path);
- },
- SwitchCase: function SwitchCase(path) {
- statementList("consequent", path);
- }
- }
- };
- });
- function _templateObject$5() {
- var data = _taggedTemplateLiteralLoose(["", "(\"", "\")"]);
- _templateObject$5 = function _templateObject() {
- return data;
- };
- return data;
- }
- function getTDZStatus(refPath, bindingPath) {
- var executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath);
- if (executionStatus === "before") {
- return "outside";
- } else if (executionStatus === "after") {
- return "inside";
- } else {
- return "maybe";
- }
- }
- function buildTDZAssert(node, state) {
- return CallExpression(state.addHelper("temporalRef"), [node, StringLiteral(node.name)]);
- }
- function isReference(node, scope, state) {
- var declared = state.letReferences[node.name];
- if (!declared) return false;
- return scope.getBindingIdentifier(node.name) === declared;
- }
- var visitor$2 = {
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- if (!state.tdzEnabled) return;
- var node = path.node,
- parent = path.parent,
- scope = path.scope;
- if (path.parentPath.isFor({
- left: node
- })) return;
- if (!isReference(node, scope, state)) return;
- var bindingPath = scope.getBinding(node.name).path;
- if (bindingPath.isFunctionDeclaration()) return;
- var status = getTDZStatus(path, bindingPath);
- if (status === "outside") return;
- if (status === "maybe") {
- var assert = buildTDZAssert(node, state);
- bindingPath.parent._tdzThis = true;
- path.skip();
- if (path.parentPath.isUpdateExpression()) {
- if (parent._ignoreBlockScopingTDZ) return;
- path.parentPath.replaceWith(SequenceExpression([assert, parent]));
- } else {
- path.replaceWith(assert);
- }
- } else if (status === "inside") {
- path.replaceWith(template.ast(_templateObject$5(), state.addHelper("tdz"), node.name));
- }
- },
- AssignmentExpression: {
- exit: function exit(path, state) {
- if (!state.tdzEnabled) return;
- var node = path.node;
- if (node._ignoreBlockScopingTDZ) return;
- var nodes = [];
- var ids = path.getBindingIdentifiers();
- for (var _i = 0, _Object$keys = Object.keys(ids); _i < _Object$keys.length; _i++) {
- var name = _Object$keys[_i];
- var id = ids[name];
- if (isReference(id, path.scope, state)) {
- nodes.push(id);
- }
- }
- if (nodes.length) {
- node._ignoreBlockScopingTDZ = true;
- nodes.push(node);
- path.replaceWithMultiple(nodes.map(function (n) {
- return ExpressionStatement(n);
- }));
- }
- }
- }
- };
- function createAssigner(assigner) {
- return _baseRest(function (object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
- customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
- if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
- var _createAssigner = createAssigner;
- var assignIn = _createAssigner(function (object, source) {
- _copyObject(source, keysIn_1(source), object);
- });
- var assignIn_1 = assignIn;
- var extend$1 = assignIn_1;
- var DONE = new WeakSet();
- var transformBlockScoping = declare(function (api, opts) {
- api.assertVersion(7);
- var _opts$throwIfClosureR = opts.throwIfClosureRequired,
- throwIfClosureRequired = _opts$throwIfClosureR === void 0 ? false : _opts$throwIfClosureR,
- _opts$tdz = opts.tdz,
- tdzEnabled = _opts$tdz === void 0 ? false : _opts$tdz;
- if (typeof throwIfClosureRequired !== "boolean") {
- throw new Error(".throwIfClosureRequired must be a boolean, or undefined");
- }
- if (typeof tdzEnabled !== "boolean") {
- throw new Error(".tdz must be a boolean, or undefined");
- }
- return {
- name: "transform-block-scoping",
- visitor: {
- VariableDeclaration: function VariableDeclaration(path) {
- var node = path.node,
- parent = path.parent,
- scope = path.scope;
- if (!isBlockScoped$1(node)) return;
- convertBlockScopedToVar(path, null, parent, scope, true);
- if (node._tdzThis) {
- var nodes = [node];
- for (var i = 0; i < node.declarations.length; i++) {
- var decl = node.declarations[i];
- var assign = AssignmentExpression("=", decl.id, decl.init || scope.buildUndefinedNode());
- assign._ignoreBlockScopingTDZ = true;
- nodes.push(ExpressionStatement(assign));
- decl.init = this.addHelper("temporalUndefined");
- }
- node._blockHoist = 2;
- if (path.isCompletionRecord()) {
- nodes.push(ExpressionStatement(scope.buildUndefinedNode()));
- }
- path.replaceWithMultiple(nodes);
- }
- },
- Loop: function Loop(path, state) {
- var parent = path.parent,
- scope = path.scope;
- path.ensureBlock();
- var blockScoping = new BlockScoping(path, path.get("body"), parent, scope, throwIfClosureRequired, tdzEnabled, state);
- var replace = blockScoping.run();
- if (replace) path.replaceWith(replace);
- },
- CatchClause: function CatchClause(path, state) {
- var parent = path.parent,
- scope = path.scope;
- var blockScoping = new BlockScoping(null, path.get("body"), parent, scope, throwIfClosureRequired, tdzEnabled, state);
- blockScoping.run();
- },
- "BlockStatement|SwitchStatement|Program": function BlockStatementSwitchStatementProgram(path, state) {
- if (!ignoreBlock(path)) {
- var blockScoping = new BlockScoping(null, path, path.parent, path.scope, throwIfClosureRequired, tdzEnabled, state);
- blockScoping.run();
- }
- }
- }
- };
- });
- function ignoreBlock(path) {
- return isLoop(path.parent) || isCatchClause(path.parent);
- }
- var buildRetCheck = template("\n if (typeof RETURN === \"object\") return RETURN.v;\n");
- function isBlockScoped$1(node) {
- if (!isVariableDeclaration(node)) return false;
- if (node[BLOCK_SCOPED_SYMBOL]) return true;
- if (node.kind !== "let" && node.kind !== "const") return false;
- return true;
- }
- function isInLoop(path) {
- var loopOrFunctionParent = path.find(function (path) {
- return path.isLoop() || path.isFunction();
- });
- return loopOrFunctionParent && loopOrFunctionParent.isLoop();
- }
- function convertBlockScopedToVar(path, node, parent, scope, moveBindingsToParent) {
- if (moveBindingsToParent === void 0) {
- moveBindingsToParent = false;
- }
- if (!node) {
- node = path.node;
- }
- if (isInLoop(path) && !isFor(parent)) {
- for (var i = 0; i < node.declarations.length; i++) {
- var declar = node.declarations[i];
- declar.init = declar.init || scope.buildUndefinedNode();
- }
- }
- node[BLOCK_SCOPED_SYMBOL] = true;
- node.kind = "var";
- if (moveBindingsToParent) {
- var parentScope = scope.getFunctionParent() || scope.getProgramParent();
- for (var _i = 0, _Object$keys = Object.keys(path.getBindingIdentifiers()); _i < _Object$keys.length; _i++) {
- var name = _Object$keys[_i];
- var binding = scope.getOwnBinding(name);
- if (binding) binding.kind = "var";
- scope.moveBindingTo(name, parentScope);
- }
- }
- }
- function isVar$1(node) {
- return isVariableDeclaration(node, {
- kind: "var"
- }) && !isBlockScoped$1(node);
- }
- var letReferenceBlockVisitor = traverse$1.visitors.merge([{
- Loop: {
- enter: function enter(path, state) {
- state.loopDepth++;
- },
- exit: function exit(path, state) {
- state.loopDepth--;
- }
- },
- Function: function Function(path, state) {
- if (state.loopDepth > 0) {
- path.traverse(letReferenceFunctionVisitor, state);
- } else {
- path.traverse(visitor$2, state);
- }
- return path.skip();
- }
- }, visitor$2]);
- var letReferenceFunctionVisitor = traverse$1.visitors.merge([{
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- var ref = state.letReferences[path.node.name];
- if (!ref) return;
- var localBinding = path.scope.getBindingIdentifier(path.node.name);
- if (localBinding && localBinding !== ref) return;
- state.closurify = true;
- }
- }, visitor$2]);
- var hoistVarDeclarationsVisitor = {
- enter: function enter(path, self) {
- var node = path.node,
- parent = path.parent;
- if (path.isForStatement()) {
- if (isVar$1(node.init)) {
- var nodes = self.pushDeclar(node.init);
- if (nodes.length === 1) {
- node.init = nodes[0];
- } else {
- node.init = SequenceExpression(nodes);
- }
- }
- } else if (path.isFor()) {
- if (isVar$1(node.left)) {
- self.pushDeclar(node.left);
- node.left = node.left.declarations[0].id;
- }
- } else if (isVar$1(node)) {
- path.replaceWithMultiple(self.pushDeclar(node).map(function (expr) {
- return ExpressionStatement(expr);
- }));
- } else if (path.isFunction()) {
- return path.skip();
- }
- }
- };
- var loopLabelVisitor = {
- LabeledStatement: function LabeledStatement(_ref, state) {
- var node = _ref.node;
- state.innerLabels.push(node.label.name);
- }
- };
- var continuationVisitor = {
- enter: function enter(path, state) {
- if (path.isAssignmentExpression() || path.isUpdateExpression()) {
- for (var _i2 = 0, _Object$keys2 = Object.keys(path.getBindingIdentifiers()); _i2 < _Object$keys2.length; _i2++) {
- var name = _Object$keys2[_i2];
- if (state.outsideReferences[name] !== path.scope.getBindingIdentifier(name)) {
- continue;
- }
- state.reassignments[name] = true;
- }
- } else if (path.isReturnStatement()) {
- state.returnStatements.push(path);
- }
- }
- };
- function loopNodeTo(node) {
- if (isBreakStatement(node)) {
- return "break";
- } else if (isContinueStatement(node)) {
- return "continue";
- }
- }
- var loopVisitor = {
- Loop: function Loop(path, state) {
- var oldIgnoreLabeless = state.ignoreLabeless;
- state.ignoreLabeless = true;
- path.traverse(loopVisitor, state);
- state.ignoreLabeless = oldIgnoreLabeless;
- path.skip();
- },
- Function: function Function(path) {
- path.skip();
- },
- SwitchCase: function SwitchCase(path, state) {
- var oldInSwitchCase = state.inSwitchCase;
- state.inSwitchCase = true;
- path.traverse(loopVisitor, state);
- state.inSwitchCase = oldInSwitchCase;
- path.skip();
- },
- "BreakStatement|ContinueStatement|ReturnStatement": function BreakStatementContinueStatementReturnStatement(path, state) {
- var node = path.node,
- scope = path.scope;
- if (node[this.LOOP_IGNORE]) return;
- var replace;
- var loopText = loopNodeTo(node);
- if (loopText) {
- if (node.label) {
- if (state.innerLabels.indexOf(node.label.name) >= 0) {
- return;
- }
- loopText = loopText + "|" + node.label.name;
- } else {
- if (state.ignoreLabeless) return;
- if (isBreakStatement(node) && state.inSwitchCase) return;
- }
- state.hasBreakContinue = true;
- state.map[loopText] = node;
- replace = StringLiteral(loopText);
- }
- if (path.isReturnStatement()) {
- state.hasReturn = true;
- replace = ObjectExpression([ObjectProperty(Identifier("v"), node.argument || scope.buildUndefinedNode())]);
- }
- if (replace) {
- replace = ReturnStatement(replace);
- replace[this.LOOP_IGNORE] = true;
- path.skip();
- path.replaceWith(inherits(replace, node));
- }
- }
- };
- var BlockScoping = function () {
- function BlockScoping(loopPath, blockPath, parent, scope, throwIfClosureRequired, tdzEnabled, state) {
- this.parent = parent;
- this.scope = scope;
- this.state = state;
- this.throwIfClosureRequired = throwIfClosureRequired;
- this.tdzEnabled = tdzEnabled;
- this.blockPath = blockPath;
- this.block = blockPath.node;
- this.outsideLetReferences = Object.create(null);
- this.hasLetReferences = false;
- this.letReferences = Object.create(null);
- this.body = [];
- if (loopPath) {
- this.loopParent = loopPath.parent;
- this.loopLabel = isLabeledStatement(this.loopParent) && this.loopParent.label;
- this.loopPath = loopPath;
- this.loop = loopPath.node;
- }
- }
- var _proto = BlockScoping.prototype;
- _proto.run = function run() {
- var block = this.block;
- if (DONE.has(block)) return;
- DONE.add(block);
- var needsClosure = this.getLetReferences();
- this.checkConstants();
- if (isFunction(this.parent) || isProgram(this.block)) {
- this.updateScopeInfo();
- return;
- }
- if (!this.hasLetReferences) return;
- if (needsClosure) {
- this.wrapClosure();
- } else {
- this.remap();
- }
- this.updateScopeInfo(needsClosure);
- if (this.loopLabel && !isLabeledStatement(this.loopParent)) {
- return LabeledStatement(this.loopLabel, this.loop);
- }
- };
- _proto.checkConstants = function checkConstants() {
- var scope = this.scope;
- var state = this.state;
- for (var _i3 = 0, _Object$keys3 = Object.keys(scope.bindings); _i3 < _Object$keys3.length; _i3++) {
- var name = _Object$keys3[_i3];
- var binding = scope.bindings[name];
- if (binding.kind !== "const") continue;
- for (var _i4 = 0, _arr = binding.constantViolations; _i4 < _arr.length; _i4++) {
- var violation = _arr[_i4];
- var readOnlyError = state.addHelper("readOnlyError");
- var throwNode = CallExpression(readOnlyError, [StringLiteral(name)]);
- if (violation.isAssignmentExpression()) {
- violation.get("right").replaceWith(SequenceExpression([throwNode, violation.get("right").node]));
- } else if (violation.isUpdateExpression()) {
- violation.replaceWith(SequenceExpression([throwNode, violation.node]));
- } else if (violation.isForXStatement()) {
- violation.ensureBlock();
- violation.node.body.body.unshift(ExpressionStatement(throwNode));
- }
- }
- }
- };
- _proto.updateScopeInfo = function updateScopeInfo(wrappedInClosure) {
- var blockScope = this.blockPath.scope;
- var parentScope = blockScope.getFunctionParent() || blockScope.getProgramParent();
- var letRefs = this.letReferences;
- for (var _i5 = 0, _Object$keys4 = Object.keys(letRefs); _i5 < _Object$keys4.length; _i5++) {
- var key = _Object$keys4[_i5];
- var ref = letRefs[key];
- var binding = blockScope.getBinding(ref.name);
- if (!binding) continue;
- if (binding.kind === "let" || binding.kind === "const") {
- binding.kind = "var";
- if (wrappedInClosure) {
- if (blockScope.hasOwnBinding(ref.name)) {
- blockScope.removeBinding(ref.name);
- }
- } else {
- blockScope.moveBindingTo(ref.name, parentScope);
- }
- }
- }
- };
- _proto.remap = function remap() {
- var letRefs = this.letReferences;
- var outsideLetRefs = this.outsideLetReferences;
- var scope = this.scope;
- var blockPathScope = this.blockPath.scope;
- for (var _i6 = 0, _Object$keys5 = Object.keys(letRefs); _i6 < _Object$keys5.length; _i6++) {
- var key = _Object$keys5[_i6];
- var ref = letRefs[key];
- if (scope.parentHasBinding(key) || scope.hasGlobal(key)) {
- if (scope.hasOwnBinding(key)) {
- scope.rename(ref.name);
- }
- if (blockPathScope.hasOwnBinding(key)) {
- blockPathScope.rename(ref.name);
- }
- }
- }
- for (var _i7 = 0, _Object$keys6 = Object.keys(outsideLetRefs); _i7 < _Object$keys6.length; _i7++) {
- var _key = _Object$keys6[_i7];
- var _ref2 = letRefs[_key];
- if (isInLoop(this.blockPath) && blockPathScope.hasOwnBinding(_key)) {
- blockPathScope.rename(_ref2.name);
- }
- }
- };
- _proto.wrapClosure = function wrapClosure() {
- if (this.throwIfClosureRequired) {
- throw this.blockPath.buildCodeFrameError("Compiling let/const in this block would add a closure " + "(throwIfClosureRequired).");
- }
- var block = this.block;
- var outsideRefs = this.outsideLetReferences;
- if (this.loop) {
- for (var _i8 = 0, _Object$keys7 = Object.keys(outsideRefs); _i8 < _Object$keys7.length; _i8++) {
- var name = _Object$keys7[_i8];
- var id = outsideRefs[name];
- if (this.scope.hasGlobal(id.name) || this.scope.parentHasBinding(id.name)) {
- delete outsideRefs[id.name];
- delete this.letReferences[id.name];
- this.scope.rename(id.name);
- this.letReferences[id.name] = id;
- outsideRefs[id.name] = id;
- }
- }
- }
- this.has = this.checkLoop();
- this.hoistVarDeclarations();
- var args = values_1(outsideRefs).map(function (id) {
- return cloneNode(id);
- });
- var params = args.map(function (id) {
- return cloneNode(id);
- });
- var isSwitch = this.blockPath.isSwitchStatement();
- var fn = FunctionExpression(null, params, BlockStatement(isSwitch ? [block] : block.body));
- this.addContinuations(fn);
- var call = CallExpression(NullLiteral(), args);
- var basePath = ".callee";
- var hasYield = traverse$1.hasType(fn.body, "YieldExpression", FUNCTION_TYPES);
- if (hasYield) {
- fn.generator = true;
- call = YieldExpression(call, true);
- basePath = ".argument" + basePath;
- }
- var hasAsync = traverse$1.hasType(fn.body, "AwaitExpression", FUNCTION_TYPES);
- if (hasAsync) {
- fn.async = true;
- call = AwaitExpression(call);
- basePath = ".argument" + basePath;
- }
- var placeholderPath;
- var index;
- if (this.has.hasReturn || this.has.hasBreakContinue) {
- var ret = this.scope.generateUid("ret");
- this.body.push(VariableDeclaration("var", [VariableDeclarator(Identifier(ret), call)]));
- placeholderPath = "declarations.0.init" + basePath;
- index = this.body.length - 1;
- this.buildHas(ret);
- } else {
- this.body.push(ExpressionStatement(call));
- placeholderPath = "expression" + basePath;
- index = this.body.length - 1;
- }
- var callPath;
- if (isSwitch) {
- var _this$blockPath = this.blockPath,
- parentPath = _this$blockPath.parentPath,
- listKey = _this$blockPath.listKey,
- key = _this$blockPath.key;
- this.blockPath.replaceWithMultiple(this.body);
- callPath = parentPath.get(listKey)[key + index];
- } else {
- block.body = this.body;
- callPath = this.blockPath.get("body")[index];
- }
- var placeholder = callPath.get(placeholderPath);
- var fnPath;
- if (this.loop) {
- var loopId = this.scope.generateUid("loop");
- var p = this.loopPath.insertBefore(VariableDeclaration("var", [VariableDeclarator(Identifier(loopId), fn)]));
- placeholder.replaceWith(Identifier(loopId));
- fnPath = p[0].get("declarations.0.init");
- } else {
- placeholder.replaceWith(fn);
- fnPath = placeholder;
- }
- fnPath.unwrapFunctionEnvironment();
- };
- _proto.addContinuations = function addContinuations(fn) {
- var _this = this;
- var state = {
- reassignments: {},
- returnStatements: [],
- outsideReferences: this.outsideLetReferences
- };
- this.scope.traverse(fn, continuationVisitor, state);
- var _loop = function _loop(i) {
- var param = fn.params[i];
- if (!state.reassignments[param.name]) return "continue";
- var paramName = param.name;
- var newParamName = _this.scope.generateUid(param.name);
- fn.params[i] = Identifier(newParamName);
- _this.scope.rename(paramName, newParamName, fn);
- state.returnStatements.forEach(function (returnStatement) {
- returnStatement.insertBefore(ExpressionStatement(AssignmentExpression("=", Identifier(paramName), Identifier(newParamName))));
- });
- fn.body.body.push(ExpressionStatement(AssignmentExpression("=", Identifier(paramName), Identifier(newParamName))));
- };
- for (var i = 0; i < fn.params.length; i++) {
- var _ret = _loop(i);
- if (_ret === "continue") continue;
- }
- };
- _proto.getLetReferences = function getLetReferences() {
- var _this2 = this;
- var block = this.block;
- var declarators = [];
- if (this.loop) {
- var init = this.loop.left || this.loop.init;
- if (isBlockScoped$1(init)) {
- declarators.push(init);
- extend$1(this.outsideLetReferences, getBindingIdentifiers(init));
- }
- }
- var addDeclarationsFromChild = function addDeclarationsFromChild(path, node) {
- node = node || path.node;
- if (isClassDeclaration(node) || isFunctionDeclaration(node) || isBlockScoped$1(node)) {
- if (isBlockScoped$1(node)) {
- convertBlockScopedToVar(path, node, block, _this2.scope);
- }
- declarators = declarators.concat(node.declarations || node);
- }
- if (isLabeledStatement(node)) {
- addDeclarationsFromChild(path.get("body"), node.body);
- }
- };
- if (block.body) {
- var declarPaths = this.blockPath.get("body");
- for (var i = 0; i < block.body.length; i++) {
- addDeclarationsFromChild(declarPaths[i]);
- }
- }
- if (block.cases) {
- var _declarPaths = this.blockPath.get("cases");
- for (var _i9 = 0; _i9 < block.cases.length; _i9++) {
- var consequents = block.cases[_i9].consequent;
- for (var j = 0; j < consequents.length; j++) {
- var declar = consequents[j];
- addDeclarationsFromChild(_declarPaths[_i9], declar);
- }
- }
- }
- for (var _i10 = 0; _i10 < declarators.length; _i10++) {
- var _declar = declarators[_i10];
- var keys = getBindingIdentifiers(_declar, false, true);
- extend$1(this.letReferences, keys);
- this.hasLetReferences = true;
- }
- if (!this.hasLetReferences) return;
- var state = {
- letReferences: this.letReferences,
- closurify: false,
- loopDepth: 0,
- tdzEnabled: this.tdzEnabled,
- addHelper: function addHelper(name) {
- return _this2.state.addHelper(name);
- }
- };
- if (isInLoop(this.blockPath)) {
- state.loopDepth++;
- }
- this.blockPath.traverse(letReferenceBlockVisitor, state);
- return state.closurify;
- };
- _proto.checkLoop = function checkLoop() {
- var state = {
- hasBreakContinue: false,
- ignoreLabeless: false,
- inSwitchCase: false,
- innerLabels: [],
- hasReturn: false,
- isLoop: !!this.loop,
- map: {},
- LOOP_IGNORE: Symbol()
- };
- this.blockPath.traverse(loopLabelVisitor, state);
- this.blockPath.traverse(loopVisitor, state);
- return state;
- };
- _proto.hoistVarDeclarations = function hoistVarDeclarations() {
- this.blockPath.traverse(hoistVarDeclarationsVisitor, this);
- };
- _proto.pushDeclar = function pushDeclar(node) {
- var declars = [];
- var names = getBindingIdentifiers(node);
- for (var _i11 = 0, _Object$keys8 = Object.keys(names); _i11 < _Object$keys8.length; _i11++) {
- var name = _Object$keys8[_i11];
- declars.push(VariableDeclarator(names[name]));
- }
- this.body.push(VariableDeclaration(node.kind, declars));
- var replace = [];
- for (var i = 0; i < node.declarations.length; i++) {
- var declar = node.declarations[i];
- if (!declar.init) continue;
- var expr = AssignmentExpression("=", cloneNode(declar.id), cloneNode(declar.init));
- replace.push(inherits(expr, declar));
- }
- return replace;
- };
- _proto.buildHas = function buildHas(ret) {
- var body = this.body;
- var retCheck;
- var has = this.has;
- var cases = [];
- if (has.hasReturn) {
- retCheck = buildRetCheck({
- RETURN: Identifier(ret)
- });
- }
- if (has.hasBreakContinue) {
- for (var _i12 = 0, _Object$keys9 = Object.keys(has.map); _i12 < _Object$keys9.length; _i12++) {
- var key = _Object$keys9[_i12];
- cases.push(SwitchCase(StringLiteral(key), [has.map[key]]));
- }
- if (has.hasReturn) {
- cases.push(SwitchCase(null, [retCheck]));
- }
- if (cases.length === 1) {
- var single = cases[0];
- body.push(IfStatement(BinaryExpression("===", Identifier(ret), single.test), single.consequent[0]));
- } else {
- if (this.loop) {
- for (var i = 0; i < cases.length; i++) {
- var caseConsequent = cases[i].consequent[0];
- if (isBreakStatement(caseConsequent) && !caseConsequent.label) {
- if (!this.loopLabel) {
- this.loopLabel = this.scope.generateUidIdentifier("loop");
- }
- caseConsequent.label = cloneNode(this.loopLabel);
- }
- }
- }
- body.push(SwitchStatement(Identifier(ret), cases));
- }
- } else {
- if (has.hasReturn) {
- body.push(retCheck);
- }
- }
- };
- return BlockScoping;
- }();
- var builtin$1 = {
- "Array": false,
- "ArrayBuffer": false,
- Atomics: false,
- BigInt: false,
- BigInt64Array: false,
- BigUint64Array: false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- globalThis: false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- SharedArrayBuffer: false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var es5$1 = {
- "Array": false,
- "Boolean": false,
- constructor: false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- propertyIsEnumerable: false,
- "RangeError": false,
- "ReferenceError": false,
- "RegExp": false,
- "String": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false
- };
- var es2015$1 = {
- "Array": false,
- "ArrayBuffer": false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var es2017$1 = {
- "Array": false,
- "ArrayBuffer": false,
- Atomics: false,
- "Boolean": false,
- constructor: false,
- "DataView": false,
- "Date": false,
- "decodeURI": false,
- "decodeURIComponent": false,
- "encodeURI": false,
- "encodeURIComponent": false,
- "Error": false,
- "escape": false,
- "eval": false,
- "EvalError": false,
- "Float32Array": false,
- "Float64Array": false,
- "Function": false,
- hasOwnProperty: false,
- "Infinity": false,
- "Int16Array": false,
- "Int32Array": false,
- "Int8Array": false,
- "isFinite": false,
- "isNaN": false,
- isPrototypeOf: false,
- "JSON": false,
- "Map": false,
- "Math": false,
- "NaN": false,
- "Number": false,
- "Object": false,
- "parseFloat": false,
- "parseInt": false,
- "Promise": false,
- propertyIsEnumerable: false,
- "Proxy": false,
- "RangeError": false,
- "ReferenceError": false,
- "Reflect": false,
- "RegExp": false,
- "Set": false,
- SharedArrayBuffer: false,
- "String": false,
- "Symbol": false,
- "SyntaxError": false,
- toLocaleString: false,
- toString: false,
- "TypeError": false,
- "Uint16Array": false,
- "Uint32Array": false,
- "Uint8Array": false,
- "Uint8ClampedArray": false,
- "undefined": false,
- "unescape": false,
- "URIError": false,
- valueOf: false,
- "WeakMap": false,
- "WeakSet": false
- };
- var browser$5 = {
- AbortController: false,
- AbortSignal: false,
- addEventListener: false,
- alert: false,
- AnalyserNode: false,
- Animation: false,
- AnimationEffectReadOnly: false,
- AnimationEffectTiming: false,
- AnimationEffectTimingReadOnly: false,
- AnimationEvent: false,
- AnimationPlaybackEvent: false,
- AnimationTimeline: false,
- applicationCache: false,
- ApplicationCache: false,
- ApplicationCacheErrorEvent: false,
- atob: false,
- Attr: false,
- Audio: false,
- AudioBuffer: false,
- AudioBufferSourceNode: false,
- AudioContext: false,
- AudioDestinationNode: false,
- AudioListener: false,
- AudioNode: false,
- AudioParam: false,
- AudioProcessingEvent: false,
- AudioScheduledSourceNode: false,
- "AudioWorkletGlobalScope ": false,
- AudioWorkletNode: false,
- AudioWorkletProcessor: false,
- BarProp: false,
- BaseAudioContext: false,
- BatteryManager: false,
- BeforeUnloadEvent: false,
- BiquadFilterNode: false,
- Blob: false,
- BlobEvent: false,
- blur: false,
- BroadcastChannel: false,
- btoa: false,
- BudgetService: false,
- ByteLengthQueuingStrategy: false,
- Cache: false,
- caches: false,
- CacheStorage: false,
- cancelAnimationFrame: false,
- cancelIdleCallback: false,
- CanvasCaptureMediaStreamTrack: false,
- CanvasGradient: false,
- CanvasPattern: false,
- CanvasRenderingContext2D: false,
- ChannelMergerNode: false,
- ChannelSplitterNode: false,
- CharacterData: false,
- clearInterval: false,
- clearTimeout: false,
- clientInformation: false,
- ClipboardEvent: false,
- close: false,
- closed: false,
- CloseEvent: false,
- Comment: false,
- CompositionEvent: false,
- confirm: false,
- console: false,
- ConstantSourceNode: false,
- ConvolverNode: false,
- CountQueuingStrategy: false,
- createImageBitmap: false,
- Credential: false,
- CredentialsContainer: false,
- crypto: false,
- Crypto: false,
- CryptoKey: false,
- CSS: false,
- CSSConditionRule: false,
- CSSFontFaceRule: false,
- CSSGroupingRule: false,
- CSSImportRule: false,
- CSSKeyframeRule: false,
- CSSKeyframesRule: false,
- CSSMediaRule: false,
- CSSNamespaceRule: false,
- CSSPageRule: false,
- CSSRule: false,
- CSSRuleList: false,
- CSSStyleDeclaration: false,
- CSSStyleRule: false,
- CSSStyleSheet: false,
- CSSSupportsRule: false,
- CustomElementRegistry: false,
- customElements: false,
- CustomEvent: false,
- DataTransfer: false,
- DataTransferItem: false,
- DataTransferItemList: false,
- defaultstatus: false,
- defaultStatus: false,
- DelayNode: false,
- DeviceMotionEvent: false,
- DeviceOrientationEvent: false,
- devicePixelRatio: false,
- dispatchEvent: false,
- document: false,
- Document: false,
- DocumentFragment: false,
- DocumentType: false,
- DOMError: false,
- DOMException: false,
- DOMImplementation: false,
- DOMMatrix: false,
- DOMMatrixReadOnly: false,
- DOMParser: false,
- DOMPoint: false,
- DOMPointReadOnly: false,
- DOMQuad: false,
- DOMRect: false,
- DOMRectReadOnly: false,
- DOMStringList: false,
- DOMStringMap: false,
- DOMTokenList: false,
- DragEvent: false,
- DynamicsCompressorNode: false,
- Element: false,
- ErrorEvent: false,
- event: false,
- Event: false,
- EventSource: false,
- EventTarget: false,
- external: false,
- fetch: false,
- File: false,
- FileList: false,
- FileReader: false,
- find: false,
- focus: false,
- FocusEvent: false,
- FontFace: false,
- FontFaceSetLoadEvent: false,
- FormData: false,
- frameElement: false,
- frames: false,
- GainNode: false,
- Gamepad: false,
- GamepadButton: false,
- GamepadEvent: false,
- getComputedStyle: false,
- getSelection: false,
- HashChangeEvent: false,
- Headers: false,
- history: false,
- History: false,
- HTMLAllCollection: false,
- HTMLAnchorElement: false,
- HTMLAreaElement: false,
- HTMLAudioElement: false,
- HTMLBaseElement: false,
- HTMLBodyElement: false,
- HTMLBRElement: false,
- HTMLButtonElement: false,
- HTMLCanvasElement: false,
- HTMLCollection: false,
- HTMLContentElement: false,
- HTMLDataElement: false,
- HTMLDataListElement: false,
- HTMLDetailsElement: false,
- HTMLDialogElement: false,
- HTMLDirectoryElement: false,
- HTMLDivElement: false,
- HTMLDListElement: false,
- HTMLDocument: false,
- HTMLElement: false,
- HTMLEmbedElement: false,
- HTMLFieldSetElement: false,
- HTMLFontElement: false,
- HTMLFormControlsCollection: false,
- HTMLFormElement: false,
- HTMLFrameElement: false,
- HTMLFrameSetElement: false,
- HTMLHeadElement: false,
- HTMLHeadingElement: false,
- HTMLHRElement: false,
- HTMLHtmlElement: false,
- HTMLIFrameElement: false,
- HTMLImageElement: false,
- HTMLInputElement: false,
- HTMLLabelElement: false,
- HTMLLegendElement: false,
- HTMLLIElement: false,
- HTMLLinkElement: false,
- HTMLMapElement: false,
- HTMLMarqueeElement: false,
- HTMLMediaElement: false,
- HTMLMenuElement: false,
- HTMLMetaElement: false,
- HTMLMeterElement: false,
- HTMLModElement: false,
- HTMLObjectElement: false,
- HTMLOListElement: false,
- HTMLOptGroupElement: false,
- HTMLOptionElement: false,
- HTMLOptionsCollection: false,
- HTMLOutputElement: false,
- HTMLParagraphElement: false,
- HTMLParamElement: false,
- HTMLPictureElement: false,
- HTMLPreElement: false,
- HTMLProgressElement: false,
- HTMLQuoteElement: false,
- HTMLScriptElement: false,
- HTMLSelectElement: false,
- HTMLShadowElement: false,
- HTMLSlotElement: false,
- HTMLSourceElement: false,
- HTMLSpanElement: false,
- HTMLStyleElement: false,
- HTMLTableCaptionElement: false,
- HTMLTableCellElement: false,
- HTMLTableColElement: false,
- HTMLTableElement: false,
- HTMLTableRowElement: false,
- HTMLTableSectionElement: false,
- HTMLTemplateElement: false,
- HTMLTextAreaElement: false,
- HTMLTimeElement: false,
- HTMLTitleElement: false,
- HTMLTrackElement: false,
- HTMLUListElement: false,
- HTMLUnknownElement: false,
- HTMLVideoElement: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- IdleDeadline: false,
- IIRFilterNode: false,
- Image: false,
- ImageBitmap: false,
- ImageBitmapRenderingContext: false,
- ImageCapture: false,
- ImageData: false,
- indexedDB: false,
- innerHeight: false,
- innerWidth: false,
- InputEvent: false,
- IntersectionObserver: false,
- IntersectionObserverEntry: false,
- "Intl": false,
- isSecureContext: false,
- KeyboardEvent: false,
- KeyframeEffect: false,
- KeyframeEffectReadOnly: false,
- length: false,
- localStorage: false,
- location: true,
- Location: false,
- locationbar: false,
- matchMedia: false,
- MediaDeviceInfo: false,
- MediaDevices: false,
- MediaElementAudioSourceNode: false,
- MediaEncryptedEvent: false,
- MediaError: false,
- MediaKeyMessageEvent: false,
- MediaKeySession: false,
- MediaKeyStatusMap: false,
- MediaKeySystemAccess: false,
- MediaList: false,
- MediaQueryList: false,
- MediaQueryListEvent: false,
- MediaRecorder: false,
- MediaSettingsRange: false,
- MediaSource: false,
- MediaStream: false,
- MediaStreamAudioDestinationNode: false,
- MediaStreamAudioSourceNode: false,
- MediaStreamEvent: false,
- MediaStreamTrack: false,
- MediaStreamTrackEvent: false,
- menubar: false,
- MessageChannel: false,
- MessageEvent: false,
- MessagePort: false,
- MIDIAccess: false,
- MIDIConnectionEvent: false,
- MIDIInput: false,
- MIDIInputMap: false,
- MIDIMessageEvent: false,
- MIDIOutput: false,
- MIDIOutputMap: false,
- MIDIPort: false,
- MimeType: false,
- MimeTypeArray: false,
- MouseEvent: false,
- moveBy: false,
- moveTo: false,
- MutationEvent: false,
- MutationObserver: false,
- MutationRecord: false,
- name: false,
- NamedNodeMap: false,
- NavigationPreloadManager: false,
- navigator: false,
- Navigator: false,
- NetworkInformation: false,
- Node: false,
- NodeFilter: false,
- NodeIterator: false,
- NodeList: false,
- Notification: false,
- OfflineAudioCompletionEvent: false,
- OfflineAudioContext: false,
- offscreenBuffering: false,
- OffscreenCanvas: true,
- onabort: true,
- onafterprint: true,
- onanimationend: true,
- onanimationiteration: true,
- onanimationstart: true,
- onappinstalled: true,
- onauxclick: true,
- onbeforeinstallprompt: true,
- onbeforeprint: true,
- onbeforeunload: true,
- onblur: true,
- oncancel: true,
- oncanplay: true,
- oncanplaythrough: true,
- onchange: true,
- onclick: true,
- onclose: true,
- oncontextmenu: true,
- oncuechange: true,
- ondblclick: true,
- ondevicemotion: true,
- ondeviceorientation: true,
- ondeviceorientationabsolute: true,
- ondrag: true,
- ondragend: true,
- ondragenter: true,
- ondragleave: true,
- ondragover: true,
- ondragstart: true,
- ondrop: true,
- ondurationchange: true,
- onemptied: true,
- onended: true,
- onerror: true,
- onfocus: true,
- ongotpointercapture: true,
- onhashchange: true,
- oninput: true,
- oninvalid: true,
- onkeydown: true,
- onkeypress: true,
- onkeyup: true,
- onlanguagechange: true,
- onload: true,
- onloadeddata: true,
- onloadedmetadata: true,
- onloadstart: true,
- onlostpointercapture: true,
- onmessage: true,
- onmessageerror: true,
- onmousedown: true,
- onmouseenter: true,
- onmouseleave: true,
- onmousemove: true,
- onmouseout: true,
- onmouseover: true,
- onmouseup: true,
- onmousewheel: true,
- onoffline: true,
- ononline: true,
- onpagehide: true,
- onpageshow: true,
- onpause: true,
- onplay: true,
- onplaying: true,
- onpointercancel: true,
- onpointerdown: true,
- onpointerenter: true,
- onpointerleave: true,
- onpointermove: true,
- onpointerout: true,
- onpointerover: true,
- onpointerup: true,
- onpopstate: true,
- onprogress: true,
- onratechange: true,
- onrejectionhandled: true,
- onreset: true,
- onresize: true,
- onscroll: true,
- onsearch: true,
- onseeked: true,
- onseeking: true,
- onselect: true,
- onstalled: true,
- onstorage: true,
- onsubmit: true,
- onsuspend: true,
- ontimeupdate: true,
- ontoggle: true,
- ontransitionend: true,
- onunhandledrejection: true,
- onunload: true,
- onvolumechange: true,
- onwaiting: true,
- onwheel: true,
- open: false,
- openDatabase: false,
- opener: false,
- Option: false,
- origin: false,
- OscillatorNode: false,
- outerHeight: false,
- outerWidth: false,
- PageTransitionEvent: false,
- pageXOffset: false,
- pageYOffset: false,
- PannerNode: false,
- parent: false,
- Path2D: false,
- PaymentAddress: false,
- PaymentRequest: false,
- PaymentRequestUpdateEvent: false,
- PaymentResponse: false,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceLongTaskTiming: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceNavigationTiming: false,
- PerformanceObserver: false,
- PerformanceObserverEntryList: false,
- PerformancePaintTiming: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- PeriodicWave: false,
- Permissions: false,
- PermissionStatus: false,
- personalbar: false,
- PhotoCapabilities: false,
- Plugin: false,
- PluginArray: false,
- PointerEvent: false,
- PopStateEvent: false,
- postMessage: false,
- Presentation: false,
- PresentationAvailability: false,
- PresentationConnection: false,
- PresentationConnectionAvailableEvent: false,
- PresentationConnectionCloseEvent: false,
- PresentationConnectionList: false,
- PresentationReceiver: false,
- PresentationRequest: false,
- print: false,
- ProcessingInstruction: false,
- ProgressEvent: false,
- PromiseRejectionEvent: false,
- prompt: false,
- PushManager: false,
- PushSubscription: false,
- PushSubscriptionOptions: false,
- queueMicrotask: false,
- RadioNodeList: false,
- Range: false,
- ReadableStream: false,
- registerProcessor: false,
- RemotePlayback: false,
- removeEventListener: false,
- Request: false,
- requestAnimationFrame: false,
- requestIdleCallback: false,
- resizeBy: false,
- ResizeObserver: false,
- ResizeObserverEntry: false,
- resizeTo: false,
- Response: false,
- RTCCertificate: false,
- RTCDataChannel: false,
- RTCDataChannelEvent: false,
- RTCDtlsTransport: false,
- RTCIceCandidate: false,
- RTCIceGatherer: false,
- RTCIceTransport: false,
- RTCPeerConnection: false,
- RTCPeerConnectionIceEvent: false,
- RTCRtpContributingSource: false,
- RTCRtpReceiver: false,
- RTCRtpSender: false,
- RTCSctpTransport: false,
- RTCSessionDescription: false,
- RTCStatsReport: false,
- RTCTrackEvent: false,
- screen: false,
- Screen: false,
- screenLeft: false,
- ScreenOrientation: false,
- screenTop: false,
- screenX: false,
- screenY: false,
- ScriptProcessorNode: false,
- scroll: false,
- scrollbars: false,
- scrollBy: false,
- scrollTo: false,
- scrollX: false,
- scrollY: false,
- SecurityPolicyViolationEvent: false,
- Selection: false,
- self: false,
- ServiceWorker: false,
- ServiceWorkerContainer: false,
- ServiceWorkerRegistration: false,
- sessionStorage: false,
- setInterval: false,
- setTimeout: false,
- ShadowRoot: false,
- SharedWorker: false,
- SourceBuffer: false,
- SourceBufferList: false,
- speechSynthesis: false,
- SpeechSynthesisEvent: false,
- SpeechSynthesisUtterance: false,
- StaticRange: false,
- status: false,
- statusbar: false,
- StereoPannerNode: false,
- stop: false,
- Storage: false,
- StorageEvent: false,
- StorageManager: false,
- styleMedia: false,
- StyleSheet: false,
- StyleSheetList: false,
- SubtleCrypto: false,
- SVGAElement: false,
- SVGAngle: false,
- SVGAnimatedAngle: false,
- SVGAnimatedBoolean: false,
- SVGAnimatedEnumeration: false,
- SVGAnimatedInteger: false,
- SVGAnimatedLength: false,
- SVGAnimatedLengthList: false,
- SVGAnimatedNumber: false,
- SVGAnimatedNumberList: false,
- SVGAnimatedPreserveAspectRatio: false,
- SVGAnimatedRect: false,
- SVGAnimatedString: false,
- SVGAnimatedTransformList: false,
- SVGAnimateElement: false,
- SVGAnimateMotionElement: false,
- SVGAnimateTransformElement: false,
- SVGAnimationElement: false,
- SVGCircleElement: false,
- SVGClipPathElement: false,
- SVGComponentTransferFunctionElement: false,
- SVGDefsElement: false,
- SVGDescElement: false,
- SVGDiscardElement: false,
- SVGElement: false,
- SVGEllipseElement: false,
- SVGFEBlendElement: false,
- SVGFEColorMatrixElement: false,
- SVGFEComponentTransferElement: false,
- SVGFECompositeElement: false,
- SVGFEConvolveMatrixElement: false,
- SVGFEDiffuseLightingElement: false,
- SVGFEDisplacementMapElement: false,
- SVGFEDistantLightElement: false,
- SVGFEDropShadowElement: false,
- SVGFEFloodElement: false,
- SVGFEFuncAElement: false,
- SVGFEFuncBElement: false,
- SVGFEFuncGElement: false,
- SVGFEFuncRElement: false,
- SVGFEGaussianBlurElement: false,
- SVGFEImageElement: false,
- SVGFEMergeElement: false,
- SVGFEMergeNodeElement: false,
- SVGFEMorphologyElement: false,
- SVGFEOffsetElement: false,
- SVGFEPointLightElement: false,
- SVGFESpecularLightingElement: false,
- SVGFESpotLightElement: false,
- SVGFETileElement: false,
- SVGFETurbulenceElement: false,
- SVGFilterElement: false,
- SVGForeignObjectElement: false,
- SVGGElement: false,
- SVGGeometryElement: false,
- SVGGradientElement: false,
- SVGGraphicsElement: false,
- SVGImageElement: false,
- SVGLength: false,
- SVGLengthList: false,
- SVGLinearGradientElement: false,
- SVGLineElement: false,
- SVGMarkerElement: false,
- SVGMaskElement: false,
- SVGMatrix: false,
- SVGMetadataElement: false,
- SVGMPathElement: false,
- SVGNumber: false,
- SVGNumberList: false,
- SVGPathElement: false,
- SVGPatternElement: false,
- SVGPoint: false,
- SVGPointList: false,
- SVGPolygonElement: false,
- SVGPolylineElement: false,
- SVGPreserveAspectRatio: false,
- SVGRadialGradientElement: false,
- SVGRect: false,
- SVGRectElement: false,
- SVGScriptElement: false,
- SVGSetElement: false,
- SVGStopElement: false,
- SVGStringList: false,
- SVGStyleElement: false,
- SVGSVGElement: false,
- SVGSwitchElement: false,
- SVGSymbolElement: false,
- SVGTextContentElement: false,
- SVGTextElement: false,
- SVGTextPathElement: false,
- SVGTextPositioningElement: false,
- SVGTitleElement: false,
- SVGTransform: false,
- SVGTransformList: false,
- SVGTSpanElement: false,
- SVGUnitTypes: false,
- SVGUseElement: false,
- SVGViewElement: false,
- TaskAttributionTiming: false,
- Text: false,
- TextDecoder: false,
- TextEncoder: false,
- TextEvent: false,
- TextMetrics: false,
- TextTrack: false,
- TextTrackCue: false,
- TextTrackCueList: false,
- TextTrackList: false,
- TimeRanges: false,
- toolbar: false,
- top: false,
- Touch: false,
- TouchEvent: false,
- TouchList: false,
- TrackEvent: false,
- TransitionEvent: false,
- TreeWalker: false,
- UIEvent: false,
- URL: false,
- URLSearchParams: false,
- ValidityState: false,
- visualViewport: false,
- VisualViewport: false,
- VTTCue: false,
- WaveShaperNode: false,
- WebAssembly: false,
- WebGL2RenderingContext: false,
- WebGLActiveInfo: false,
- WebGLBuffer: false,
- WebGLContextEvent: false,
- WebGLFramebuffer: false,
- WebGLProgram: false,
- WebGLQuery: false,
- WebGLRenderbuffer: false,
- WebGLRenderingContext: false,
- WebGLSampler: false,
- WebGLShader: false,
- WebGLShaderPrecisionFormat: false,
- WebGLSync: false,
- WebGLTexture: false,
- WebGLTransformFeedback: false,
- WebGLUniformLocation: false,
- WebGLVertexArrayObject: false,
- WebSocket: false,
- WheelEvent: false,
- window: false,
- Window: false,
- Worker: false,
- WritableStream: false,
- XMLDocument: false,
- XMLHttpRequest: false,
- XMLHttpRequestEventTarget: false,
- XMLHttpRequestUpload: false,
- XMLSerializer: false,
- XPathEvaluator: false,
- XPathExpression: false,
- XPathResult: false,
- XSLTProcessor: false
- };
- var worker$1 = {
- addEventListener: false,
- applicationCache: false,
- atob: false,
- Blob: false,
- BroadcastChannel: false,
- btoa: false,
- Cache: false,
- caches: false,
- clearInterval: false,
- clearTimeout: false,
- close: true,
- console: false,
- fetch: false,
- FileReaderSync: false,
- FormData: false,
- Headers: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- ImageData: false,
- importScripts: true,
- indexedDB: false,
- location: false,
- MessageChannel: false,
- MessagePort: false,
- name: false,
- navigator: false,
- Notification: false,
- onclose: true,
- onconnect: true,
- onerror: true,
- onlanguagechange: true,
- onmessage: true,
- onoffline: true,
- ononline: true,
- onrejectionhandled: true,
- onunhandledrejection: true,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- postMessage: true,
- "Promise": false,
- queueMicrotask: false,
- removeEventListener: false,
- Request: false,
- Response: false,
- self: true,
- ServiceWorkerRegistration: false,
- setInterval: false,
- setTimeout: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false,
- WebSocket: false,
- Worker: false,
- WorkerGlobalScope: false,
- XMLHttpRequest: false
- };
- var node$1 = {
- __dirname: false,
- __filename: false,
- Buffer: false,
- clearImmediate: false,
- clearInterval: false,
- clearTimeout: false,
- console: false,
- exports: true,
- global: false,
- "Intl": false,
- module: false,
- process: false,
- queueMicrotask: false,
- require: false,
- setImmediate: false,
- setInterval: false,
- setTimeout: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false
- };
- var commonjs$1 = {
- exports: true,
- global: false,
- module: false,
- require: false
- };
- var amd$1 = {
- define: false,
- require: false
- };
- var mocha$1 = {
- after: false,
- afterEach: false,
- before: false,
- beforeEach: false,
- context: false,
- describe: false,
- it: false,
- mocha: false,
- run: false,
- setup: false,
- specify: false,
- suite: false,
- suiteSetup: false,
- suiteTeardown: false,
- teardown: false,
- test: false,
- xcontext: false,
- xdescribe: false,
- xit: false,
- xspecify: false
- };
- var jasmine$1 = {
- afterAll: false,
- afterEach: false,
- beforeAll: false,
- beforeEach: false,
- describe: false,
- expect: false,
- fail: false,
- fdescribe: false,
- fit: false,
- it: false,
- jasmine: false,
- pending: false,
- runs: false,
- spyOn: false,
- spyOnProperty: false,
- waits: false,
- waitsFor: false,
- xdescribe: false,
- xit: false
- };
- var jest$1 = {
- afterAll: false,
- afterEach: false,
- beforeAll: false,
- beforeEach: false,
- describe: false,
- expect: false,
- fdescribe: false,
- fit: false,
- it: false,
- jest: false,
- pit: false,
- require: false,
- test: false,
- xdescribe: false,
- xit: false,
- xtest: false
- };
- var qunit$1 = {
- asyncTest: false,
- deepEqual: false,
- equal: false,
- expect: false,
- module: false,
- notDeepEqual: false,
- notEqual: false,
- notOk: false,
- notPropEqual: false,
- notStrictEqual: false,
- ok: false,
- propEqual: false,
- QUnit: false,
- raises: false,
- start: false,
- stop: false,
- strictEqual: false,
- test: false,
- throws: false
- };
- var phantomjs$1 = {
- console: true,
- exports: true,
- phantom: true,
- require: true,
- WebPage: true
- };
- var couch$1 = {
- emit: false,
- exports: false,
- getRow: false,
- log: false,
- module: false,
- provides: false,
- require: false,
- respond: false,
- send: false,
- start: false,
- sum: false
- };
- var rhino$1 = {
- defineClass: false,
- deserialize: false,
- gc: false,
- help: false,
- importClass: false,
- importPackage: false,
- java: false,
- load: false,
- loadClass: false,
- Packages: false,
- print: false,
- quit: false,
- readFile: false,
- readUrl: false,
- runCommand: false,
- seal: false,
- serialize: false,
- spawn: false,
- sync: false,
- toint32: false,
- version: false
- };
- var nashorn$1 = {
- __DIR__: false,
- __FILE__: false,
- __LINE__: false,
- com: false,
- edu: false,
- exit: false,
- java: false,
- Java: false,
- javafx: false,
- JavaImporter: false,
- javax: false,
- JSAdapter: false,
- load: false,
- loadWithNewGlobal: false,
- org: false,
- Packages: false,
- print: false,
- quit: false
- };
- var wsh$1 = {
- ActiveXObject: true,
- Enumerator: true,
- GetObject: true,
- ScriptEngine: true,
- ScriptEngineBuildVersion: true,
- ScriptEngineMajorVersion: true,
- ScriptEngineMinorVersion: true,
- VBArray: true,
- WScript: true,
- WSH: true,
- XDomainRequest: true
- };
- var jquery$1 = {
- $: false,
- jQuery: false
- };
- var yui$1 = {
- YAHOO: false,
- YAHOO_config: false,
- YUI: false,
- YUI_config: false
- };
- var shelljs$1 = {
- cat: false,
- cd: false,
- chmod: false,
- config: false,
- cp: false,
- dirs: false,
- echo: false,
- env: false,
- error: false,
- exec: false,
- exit: false,
- find: false,
- grep: false,
- ln: false,
- ls: false,
- mkdir: false,
- mv: false,
- popd: false,
- pushd: false,
- pwd: false,
- rm: false,
- sed: false,
- set: false,
- target: false,
- tempdir: false,
- test: false,
- touch: false,
- which: false
- };
- var prototypejs$1 = {
- $: false,
- $$: false,
- $A: false,
- $break: false,
- $continue: false,
- $F: false,
- $H: false,
- $R: false,
- $w: false,
- Abstract: false,
- Ajax: false,
- Autocompleter: false,
- Builder: false,
- Class: false,
- Control: false,
- Draggable: false,
- Draggables: false,
- Droppables: false,
- Effect: false,
- Element: false,
- Enumerable: false,
- Event: false,
- Field: false,
- Form: false,
- Hash: false,
- Insertion: false,
- ObjectRange: false,
- PeriodicalExecuter: false,
- Position: false,
- Prototype: false,
- Scriptaculous: false,
- Selector: false,
- Sortable: false,
- SortableObserver: false,
- Sound: false,
- Template: false,
- Toggle: false,
- Try: false
- };
- var meteor$1 = {
- _: false,
- $: false,
- Accounts: false,
- AccountsClient: false,
- AccountsCommon: false,
- AccountsServer: false,
- App: false,
- Assets: false,
- Blaze: false,
- check: false,
- Cordova: false,
- DDP: false,
- DDPRateLimiter: false,
- DDPServer: false,
- Deps: false,
- EJSON: false,
- Email: false,
- HTTP: false,
- Log: false,
- Match: false,
- Meteor: false,
- Mongo: false,
- MongoInternals: false,
- Npm: false,
- Package: false,
- Plugin: false,
- process: false,
- Random: false,
- ReactiveDict: false,
- ReactiveVar: false,
- Router: false,
- ServiceConfiguration: false,
- Session: false,
- share: false,
- Spacebars: false,
- Template: false,
- Tinytest: false,
- Tracker: false,
- UI: false,
- Utils: false,
- WebApp: false,
- WebAppInternals: false
- };
- var mongo$1 = {
- _isWindows: false,
- _rand: false,
- BulkWriteResult: false,
- cat: false,
- cd: false,
- connect: false,
- db: false,
- getHostName: false,
- getMemInfo: false,
- hostname: false,
- ISODate: false,
- listFiles: false,
- load: false,
- ls: false,
- md5sumFile: false,
- mkdir: false,
- Mongo: false,
- NumberInt: false,
- NumberLong: false,
- ObjectId: false,
- PlanCache: false,
- print: false,
- printjson: false,
- pwd: false,
- quit: false,
- removeFile: false,
- rs: false,
- sh: false,
- UUID: false,
- version: false,
- WriteResult: false
- };
- var applescript$1 = {
- $: false,
- Application: false,
- Automation: false,
- console: false,
- delay: false,
- Library: false,
- ObjC: false,
- ObjectSpecifier: false,
- Path: false,
- Progress: false,
- Ref: false
- };
- var serviceworker$1 = {
- addEventListener: false,
- applicationCache: false,
- atob: false,
- Blob: false,
- BroadcastChannel: false,
- btoa: false,
- Cache: false,
- caches: false,
- CacheStorage: false,
- clearInterval: false,
- clearTimeout: false,
- Client: false,
- clients: false,
- Clients: false,
- close: true,
- console: false,
- ExtendableEvent: false,
- ExtendableMessageEvent: false,
- fetch: false,
- FetchEvent: false,
- FileReaderSync: false,
- FormData: false,
- Headers: false,
- IDBCursor: false,
- IDBCursorWithValue: false,
- IDBDatabase: false,
- IDBFactory: false,
- IDBIndex: false,
- IDBKeyRange: false,
- IDBObjectStore: false,
- IDBOpenDBRequest: false,
- IDBRequest: false,
- IDBTransaction: false,
- IDBVersionChangeEvent: false,
- ImageData: false,
- importScripts: false,
- indexedDB: false,
- location: false,
- MessageChannel: false,
- MessagePort: false,
- name: false,
- navigator: false,
- Notification: false,
- onclose: true,
- onconnect: true,
- onerror: true,
- onfetch: true,
- oninstall: true,
- onlanguagechange: true,
- onmessage: true,
- onmessageerror: true,
- onnotificationclick: true,
- onnotificationclose: true,
- onoffline: true,
- ononline: true,
- onpush: true,
- onpushsubscriptionchange: true,
- onrejectionhandled: true,
- onsync: true,
- onunhandledrejection: true,
- performance: false,
- Performance: false,
- PerformanceEntry: false,
- PerformanceMark: false,
- PerformanceMeasure: false,
- PerformanceNavigation: false,
- PerformanceResourceTiming: false,
- PerformanceTiming: false,
- postMessage: true,
- "Promise": false,
- queueMicrotask: false,
- registration: false,
- removeEventListener: false,
- Request: false,
- Response: false,
- self: false,
- ServiceWorker: false,
- ServiceWorkerContainer: false,
- ServiceWorkerGlobalScope: false,
- ServiceWorkerMessageEvent: false,
- ServiceWorkerRegistration: false,
- setInterval: false,
- setTimeout: false,
- skipWaiting: false,
- TextDecoder: false,
- TextEncoder: false,
- URL: false,
- URLSearchParams: false,
- WebSocket: false,
- WindowClient: false,
- Worker: false,
- WorkerGlobalScope: false,
- XMLHttpRequest: false
- };
- var atomtest$1 = {
- advanceClock: false,
- fakeClearInterval: false,
- fakeClearTimeout: false,
- fakeSetInterval: false,
- fakeSetTimeout: false,
- resetTimeouts: false,
- waitsForPromise: false
- };
- var embertest$1 = {
- andThen: false,
- click: false,
- currentPath: false,
- currentRouteName: false,
- currentURL: false,
- fillIn: false,
- find: false,
- findAll: false,
- findWithAssert: false,
- keyEvent: false,
- pauseTest: false,
- resumeTest: false,
- triggerEvent: false,
- visit: false,
- wait: false
- };
- var protractor$1 = {
- $: false,
- $$: false,
- browser: false,
- by: false,
- By: false,
- DartObject: false,
- element: false,
- protractor: false
- };
- var webextensions$1 = {
- browser: false,
- chrome: false,
- opr: false
- };
- var greasemonkey$1 = {
- cloneInto: false,
- createObjectIn: false,
- exportFunction: false,
- GM: false,
- GM_addStyle: false,
- GM_deleteValue: false,
- GM_getResourceText: false,
- GM_getResourceURL: false,
- GM_getValue: false,
- GM_info: false,
- GM_listValues: false,
- GM_log: false,
- GM_openInTab: false,
- GM_registerMenuCommand: false,
- GM_setClipboard: false,
- GM_setValue: false,
- GM_xmlhttpRequest: false,
- unsafeWindow: false
- };
- var devtools$1 = {
- $: false,
- $_: false,
- $$: false,
- $0: false,
- $1: false,
- $2: false,
- $3: false,
- $4: false,
- $x: false,
- chrome: false,
- clear: false,
- copy: false,
- debug: false,
- dir: false,
- dirxml: false,
- getEventListeners: false,
- inspect: false,
- keys: false,
- monitor: false,
- monitorEvents: false,
- profile: false,
- profileEnd: false,
- queryObjects: false,
- table: false,
- undebug: false,
- unmonitor: false,
- unmonitorEvents: false,
- values: false
- };
- var globals$3 = {
- builtin: builtin$1,
- es5: es5$1,
- es2015: es2015$1,
- es2017: es2017$1,
- browser: browser$5,
- worker: worker$1,
- node: node$1,
- commonjs: commonjs$1,
- amd: amd$1,
- mocha: mocha$1,
- jasmine: jasmine$1,
- jest: jest$1,
- qunit: qunit$1,
- phantomjs: phantomjs$1,
- couch: couch$1,
- rhino: rhino$1,
- nashorn: nashorn$1,
- wsh: wsh$1,
- jquery: jquery$1,
- yui: yui$1,
- shelljs: shelljs$1,
- prototypejs: prototypejs$1,
- meteor: meteor$1,
- mongo: mongo$1,
- applescript: applescript$1,
- serviceworker: serviceworker$1,
- atomtest: atomtest$1,
- embertest: embertest$1,
- protractor: protractor$1,
- "shared-node-browser": {
- clearInterval: false,
- clearTimeout: false,
- console: false,
- setInterval: false,
- setTimeout: false,
- URL: false,
- URLSearchParams: false
- },
- webextensions: webextensions$1,
- greasemonkey: greasemonkey$1,
- devtools: devtools$1
- };
- var globals$4 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- builtin: builtin$1,
- es5: es5$1,
- es2015: es2015$1,
- es2017: es2017$1,
- browser: browser$5,
- worker: worker$1,
- node: node$1,
- commonjs: commonjs$1,
- amd: amd$1,
- mocha: mocha$1,
- jasmine: jasmine$1,
- jest: jest$1,
- qunit: qunit$1,
- phantomjs: phantomjs$1,
- couch: couch$1,
- rhino: rhino$1,
- nashorn: nashorn$1,
- wsh: wsh$1,
- jquery: jquery$1,
- yui: yui$1,
- shelljs: shelljs$1,
- prototypejs: prototypejs$1,
- meteor: meteor$1,
- mongo: mongo$1,
- applescript: applescript$1,
- serviceworker: serviceworker$1,
- atomtest: atomtest$1,
- embertest: embertest$1,
- protractor: protractor$1,
- webextensions: webextensions$1,
- greasemonkey: greasemonkey$1,
- devtools: devtools$1,
- 'default': globals$3
- });
- var require$$0$1 = getCjsExportFromNamespace(globals$4);
- var globals$5 = require$$0$1;
- var objectProto$h = Object.prototype;
- var hasOwnProperty$g = objectProto$h.hasOwnProperty;
- function baseHas(object, key) {
- return object != null && hasOwnProperty$g.call(object, key);
- }
- var _baseHas = baseHas;
- function has$5(object, path) {
- return object != null && _hasPath(object, path, _baseHas);
- }
- var has_1 = has$5;
- function toKind(node) {
- if (isClassMethod(node) || isObjectMethod(node)) {
- if (node.kind === "get" || node.kind === "set") {
- return node.kind;
- }
- }
- return "value";
- }
- function push(mutatorMap, node, kind, file, scope) {
- var alias = toKeyAlias(node);
- var map = {};
- if (has_1(mutatorMap, alias)) map = mutatorMap[alias];
- mutatorMap[alias] = map;
- map._inherits = map._inherits || [];
- map._inherits.push(node);
- map._key = node.key;
- if (node.computed) {
- map._computed = true;
- }
- if (node.decorators) {
- var decorators = map.decorators = map.decorators || ArrayExpression([]);
- decorators.elements = decorators.elements.concat(node.decorators.map(function (dec) {
- return dec.expression;
- }).reverse());
- }
- if (map.value || map.initializer) {
- throw file.buildCodeFrameError(node, "Key conflict with sibling node");
- }
- var key, value;
- if (isObjectProperty(node) || isObjectMethod(node) || isClassMethod(node)) {
- key = toComputedKey(node, node.key);
- }
- if (isProperty(node)) {
- value = node.value;
- } else if (isObjectMethod(node) || isClassMethod(node)) {
- value = FunctionExpression(null, node.params, node.body, node.generator, node.async);
- value.returnType = node.returnType;
- }
- var inheritedKind = toKind(node);
- if (!kind || inheritedKind !== "value") {
- kind = inheritedKind;
- }
- if (scope && isStringLiteral(key) && (kind === "value" || kind === "initializer") && isFunctionExpression(value)) {
- value = nameFunction({
- id: key,
- node: value,
- scope: scope
- });
- }
- if (value) {
- inheritsComments(value, node);
- map[kind] = value;
- }
- return map;
- }
- function toComputedObjectFromClass(obj) {
- var objExpr = ArrayExpression([]);
- for (var i = 0; i < obj.properties.length; i++) {
- var prop = obj.properties[i];
- var val = prop.value;
- val.properties.unshift(ObjectProperty(Identifier("key"), toComputedKey(prop)));
- objExpr.elements.push(val);
- }
- return objExpr;
- }
- function toClassObject(mutatorMap) {
- var objExpr = ObjectExpression([]);
- Object.keys(mutatorMap).forEach(function (mutatorMapKey) {
- var map = mutatorMap[mutatorMapKey];
- var mapNode = ObjectExpression([]);
- var propNode = ObjectProperty(map._key, mapNode, map._computed);
- Object.keys(map).forEach(function (key) {
- var node = map[key];
- if (key[0] === "_") return;
- var prop = ObjectProperty(Identifier(key), node);
- inheritsComments(prop, node);
- removeComments(node);
- mapNode.properties.push(prop);
- });
- objExpr.properties.push(propNode);
- });
- return objExpr;
- }
- function toDefineObject(mutatorMap) {
- Object.keys(mutatorMap).forEach(function (key) {
- var map = mutatorMap[key];
- if (map.value) map.writable = BooleanLiteral(true);
- map.configurable = BooleanLiteral(true);
- map.enumerable = BooleanLiteral(true);
- });
- return toClassObject(mutatorMap);
- }
- function _templateObject$6() {
- var data = _taggedTemplateLiteralLoose(["\n (function () {\n super(...arguments);\n })\n "]);
- _templateObject$6 = function _templateObject() {
- return data;
- };
- return data;
- }
- function buildConstructor(classRef, constructorBody, node) {
- var func = FunctionDeclaration(cloneNode(classRef), [], constructorBody);
- inherits(func, node);
- return func;
- }
- function transformClass(path, file, builtinClasses, isLoose) {
- var classState = {
- parent: undefined,
- scope: undefined,
- node: undefined,
- path: undefined,
- file: undefined,
- classId: undefined,
- classRef: undefined,
- superName: undefined,
- superReturns: [],
- isDerived: false,
- extendsNative: false,
- construct: undefined,
- constructorBody: undefined,
- userConstructor: undefined,
- userConstructorPath: undefined,
- hasConstructor: false,
- instancePropBody: [],
- instancePropRefs: {},
- staticPropBody: [],
- body: [],
- superThises: [],
- pushedConstructor: false,
- pushedInherits: false,
- protoAlias: null,
- isLoose: false,
- hasInstanceDescriptors: false,
- hasStaticDescriptors: false,
- instanceMutatorMap: {},
- staticMutatorMap: {}
- };
- var setState = function setState(newState) {
- Object.assign(classState, newState);
- };
- var findThisesVisitor = traverse$1.visitors.merge([environmentVisitor, {
- ThisExpression: function ThisExpression(path) {
- classState.superThises.push(path);
- }
- }]);
- function pushToMap(node, enumerable, kind, scope) {
- if (kind === void 0) {
- kind = "value";
- }
- var mutatorMap;
- if (node["static"]) {
- setState({
- hasStaticDescriptors: true
- });
- mutatorMap = classState.staticMutatorMap;
- } else {
- setState({
- hasInstanceDescriptors: true
- });
- mutatorMap = classState.instanceMutatorMap;
- }
- var map = push(mutatorMap, node, kind, classState.file, scope);
- if (enumerable) {
- map.enumerable = BooleanLiteral(true);
- }
- return map;
- }
- function maybeCreateConstructor() {
- var hasConstructor = false;
- var paths = classState.path.get("body.body");
- for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _path = _ref;
- hasConstructor = _path.equals("kind", "constructor");
- if (hasConstructor) break;
- }
- if (hasConstructor) return;
- var params, body;
- if (classState.isDerived) {
- var _constructor = template.expression.ast(_templateObject$6());
- params = _constructor.params;
- body = _constructor.body;
- } else {
- params = [];
- body = BlockStatement([]);
- }
- classState.path.get("body").unshiftContainer("body", ClassMethod("constructor", Identifier("constructor"), params, body));
- }
- function buildBody() {
- maybeCreateConstructor();
- pushBody();
- verifyConstructor();
- if (classState.userConstructor) {
- var constructorBody = classState.constructorBody,
- userConstructor = classState.userConstructor,
- construct = classState.construct;
- constructorBody.body = constructorBody.body.concat(userConstructor.body.body);
- inherits(construct, userConstructor);
- inherits(constructorBody, userConstructor.body);
- }
- pushDescriptors();
- }
- function pushBody() {
- var classBodyPaths = classState.path.get("body.body");
- for (var _iterator2 = classBodyPaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _path2 = _ref2;
- var node = _path2.node;
- if (_path2.isClassProperty()) {
- throw _path2.buildCodeFrameError("Missing class properties transform.");
- }
- if (node.decorators) {
- throw _path2.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");
- }
- if (isClassMethod(node)) {
- (function () {
- var isConstructor = node.kind === "constructor";
- var replaceSupers = new ReplaceSupers({
- methodPath: _path2,
- objectRef: classState.classRef,
- superRef: classState.superName,
- isLoose: classState.isLoose,
- file: classState.file
- });
- replaceSupers.replace();
- var superReturns = [];
- _path2.traverse(traverse$1.visitors.merge([environmentVisitor, {
- ReturnStatement: function ReturnStatement(path) {
- if (!path.getFunctionParent().isArrowFunctionExpression()) {
- superReturns.push(path);
- }
- }
- }]));
- if (isConstructor) {
- pushConstructor(superReturns, node, _path2);
- } else {
- pushMethod(node, _path2);
- }
- })();
- }
- }
- }
- function clearDescriptors() {
- setState({
- hasInstanceDescriptors: false,
- hasStaticDescriptors: false,
- instanceMutatorMap: {},
- staticMutatorMap: {}
- });
- }
- function pushDescriptors() {
- pushInheritsToBody();
- var body = classState.body;
- var instanceProps;
- var staticProps;
- if (classState.hasInstanceDescriptors) {
- instanceProps = toClassObject(classState.instanceMutatorMap);
- }
- if (classState.hasStaticDescriptors) {
- staticProps = toClassObject(classState.staticMutatorMap);
- }
- if (instanceProps || staticProps) {
- if (instanceProps) {
- instanceProps = toComputedObjectFromClass(instanceProps);
- }
- if (staticProps) {
- staticProps = toComputedObjectFromClass(staticProps);
- }
- var args = [cloneNode(classState.classRef), NullLiteral(), NullLiteral()];
- if (instanceProps) args[1] = instanceProps;
- if (staticProps) args[2] = staticProps;
- var lastNonNullIndex = 0;
- for (var i = 0; i < args.length; i++) {
- if (!isNullLiteral(args[i])) lastNonNullIndex = i;
- }
- args = args.slice(0, lastNonNullIndex + 1);
- body.push(ExpressionStatement(CallExpression(classState.file.addHelper("createClass"), args)));
- }
- clearDescriptors();
- }
- function wrapSuperCall(bareSuper, superRef, thisRef, body) {
- var bareSuperNode = bareSuper.node;
- var call;
- if (classState.isLoose) {
- bareSuperNode.arguments.unshift(ThisExpression());
- if (bareSuperNode.arguments.length === 2 && isSpreadElement(bareSuperNode.arguments[1]) && isIdentifier(bareSuperNode.arguments[1].argument, {
- name: "arguments"
- })) {
- bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;
- bareSuperNode.callee = MemberExpression(cloneNode(superRef), Identifier("apply"));
- } else {
- bareSuperNode.callee = MemberExpression(cloneNode(superRef), Identifier("call"));
- }
- call = LogicalExpression("||", bareSuperNode, ThisExpression());
- } else {
- bareSuperNode = optimiseCall(CallExpression(classState.file.addHelper("getPrototypeOf"), [cloneNode(classState.classRef)]), ThisExpression(), bareSuperNode.arguments);
- call = CallExpression(classState.file.addHelper("possibleConstructorReturn"), [ThisExpression(), bareSuperNode]);
- }
- if (bareSuper.parentPath.isExpressionStatement() && bareSuper.parentPath.container === body.node.body && body.node.body.length - 1 === bareSuper.parentPath.key) {
- if (classState.superThises.length) {
- call = AssignmentExpression("=", thisRef(), call);
- }
- bareSuper.parentPath.replaceWith(ReturnStatement(call));
- } else {
- bareSuper.replaceWith(AssignmentExpression("=", thisRef(), call));
- }
- }
- function verifyConstructor() {
- if (!classState.isDerived) return;
- var path = classState.userConstructorPath;
- var body = path.get("body");
- path.traverse(findThisesVisitor);
- var _thisRef = function thisRef() {
- var ref = path.scope.generateDeclaredUidIdentifier("this");
- _thisRef = function thisRef() {
- return cloneNode(ref);
- };
- return ref;
- };
- for (var _iterator3 = classState.superThises, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
- var thisPath = _ref3;
- var node = thisPath.node,
- parentPath = thisPath.parentPath;
- if (parentPath.isMemberExpression({
- object: node
- })) {
- thisPath.replaceWith(_thisRef());
- continue;
- }
- thisPath.replaceWith(CallExpression(classState.file.addHelper("assertThisInitialized"), [_thisRef()]));
- }
- var bareSupers = new Set();
- path.traverse(traverse$1.visitors.merge([environmentVisitor, {
- Super: function Super(path) {
- var node = path.node,
- parentPath = path.parentPath;
- if (parentPath.isCallExpression({
- callee: node
- })) {
- bareSupers.add(parentPath);
- }
- }
- }]));
- var guaranteedSuperBeforeFinish = !!bareSupers.size;
- for (var _iterator4 = bareSupers, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref4 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref4 = _i4.value;
- }
- var bareSuper = _ref4;
- wrapSuperCall(bareSuper, classState.superName, _thisRef, body);
- if (guaranteedSuperBeforeFinish) {
- bareSuper.find(function (parentPath) {
- if (parentPath === path) {
- return true;
- }
- if (parentPath.isLoop() || parentPath.isConditional() || parentPath.isArrowFunctionExpression()) {
- guaranteedSuperBeforeFinish = false;
- return true;
- }
- });
- }
- }
- var wrapReturn;
- if (classState.isLoose) {
- wrapReturn = function wrapReturn(returnArg) {
- var thisExpr = CallExpression(classState.file.addHelper("assertThisInitialized"), [_thisRef()]);
- return returnArg ? LogicalExpression("||", returnArg, thisExpr) : thisExpr;
- };
- } else {
- wrapReturn = function wrapReturn(returnArg) {
- return CallExpression(classState.file.addHelper("possibleConstructorReturn"), [_thisRef()].concat(returnArg || []));
- };
- }
- var bodyPaths = body.get("body");
- if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) {
- body.pushContainer("body", ReturnStatement(guaranteedSuperBeforeFinish ? _thisRef() : wrapReturn()));
- }
- for (var _iterator5 = classState.superReturns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref5 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref5 = _i5.value;
- }
- var returnPath = _ref5;
- returnPath.get("argument").replaceWith(wrapReturn(returnPath.node.argument));
- }
- }
- function pushMethod(node, path) {
- var scope = path ? path.scope : classState.scope;
- if (node.kind === "method") {
- if (processMethod(node, scope)) return;
- }
- pushToMap(node, false, null, scope);
- }
- function processMethod(node, scope) {
- if (classState.isLoose && !node.decorators) {
- var classRef = classState.classRef;
- if (!node["static"]) {
- insertProtoAliasOnce();
- classRef = classState.protoAlias;
- }
- var methodName = MemberExpression(cloneNode(classRef), node.key, node.computed || isLiteral(node.key));
- var func = FunctionExpression(null, node.params, node.body, node.generator, node.async);
- inherits(func, node);
- var key = toComputedKey(node, node.key);
- if (isStringLiteral(key)) {
- func = nameFunction({
- node: func,
- id: key,
- scope: scope
- });
- }
- var expr = ExpressionStatement(AssignmentExpression("=", methodName, func));
- inheritsComments(expr, node);
- classState.body.push(expr);
- return true;
- }
- return false;
- }
- function insertProtoAliasOnce() {
- if (classState.protoAlias === null) {
- setState({
- protoAlias: classState.scope.generateUidIdentifier("proto")
- });
- var classProto = MemberExpression(classState.classRef, Identifier("prototype"));
- var protoDeclaration = VariableDeclaration("var", [VariableDeclarator(classState.protoAlias, classProto)]);
- classState.body.push(protoDeclaration);
- }
- }
- function pushConstructor(superReturns, method, path) {
- if (path.scope.hasOwnBinding(classState.classRef.name)) {
- path.scope.rename(classState.classRef.name);
- }
- setState({
- userConstructorPath: path,
- userConstructor: method,
- hasConstructor: true,
- superReturns: superReturns
- });
- var construct = classState.construct;
- inheritsComments(construct, method);
- construct.params = method.params;
- inherits(construct.body, method.body);
- construct.body.directives = method.body.directives;
- pushConstructorToBody();
- }
- function pushConstructorToBody() {
- if (classState.pushedConstructor) return;
- classState.pushedConstructor = true;
- if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) {
- pushDescriptors();
- }
- classState.body.push(classState.construct);
- pushInheritsToBody();
- }
- function pushInheritsToBody() {
- if (!classState.isDerived || classState.pushedInherits) return;
- setState({
- pushedInherits: true
- });
- classState.body.unshift(ExpressionStatement(CallExpression(classState.file.addHelper(classState.isLoose ? "inheritsLoose" : "inherits"), [cloneNode(classState.classRef), cloneNode(classState.superName)])));
- }
- function setupClosureParamsArgs() {
- var superName = classState.superName;
- var closureParams = [];
- var closureArgs = [];
- if (classState.isDerived) {
- var arg = classState.extendsNative ? CallExpression(classState.file.addHelper("wrapNativeSuper"), [cloneNode(superName)]) : cloneNode(superName);
- var param = classState.scope.generateUidIdentifierBasedOnNode(superName);
- closureParams.push(param);
- closureArgs.push(arg);
- setState({
- superName: cloneNode(param)
- });
- }
- return {
- closureParams: closureParams,
- closureArgs: closureArgs
- };
- }
- function classTransformer(path, file, builtinClasses, isLoose) {
- setState({
- parent: path.parent,
- scope: path.scope,
- node: path.node,
- path: path,
- file: file,
- isLoose: isLoose
- });
- setState({
- classId: classState.node.id,
- classRef: classState.node.id ? Identifier(classState.node.id.name) : classState.scope.generateUidIdentifier("class"),
- superName: classState.node.superClass,
- isDerived: !!classState.node.superClass,
- constructorBody: BlockStatement([])
- });
- setState({
- extendsNative: classState.isDerived && builtinClasses.has(classState.superName.name) && !classState.scope.hasBinding(classState.superName.name, true)
- });
- var classRef = classState.classRef,
- node = classState.node,
- constructorBody = classState.constructorBody;
- setState({
- construct: buildConstructor(classRef, constructorBody, node)
- });
- var body = classState.body;
- var _setupClosureParamsAr = setupClosureParamsArgs(),
- closureParams = _setupClosureParamsAr.closureParams,
- closureArgs = _setupClosureParamsAr.closureArgs;
- buildBody();
- if (!classState.isLoose) {
- constructorBody.body.unshift(ExpressionStatement(CallExpression(classState.file.addHelper("classCallCheck"), [ThisExpression(), cloneNode(classState.classRef)])));
- }
- body = body.concat(classState.staticPropBody.map(function (fn) {
- return fn(cloneNode(classState.classRef));
- }));
- var isStrict = path.isInStrictMode();
- var constructorOnly = classState.classId && body.length === 1;
- if (constructorOnly && !isStrict) {
- for (var _iterator6 = classState.construct.params, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray6) {
- if (_i6 >= _iterator6.length) break;
- _ref6 = _iterator6[_i6++];
- } else {
- _i6 = _iterator6.next();
- if (_i6.done) break;
- _ref6 = _i6.value;
- }
- var param = _ref6;
- if (!isIdentifier(param)) {
- constructorOnly = false;
- break;
- }
- }
- }
- var directives = constructorOnly ? body[0].body.directives : [];
- if (!isStrict) {
- directives.push(Directive(DirectiveLiteral("use strict")));
- }
- if (constructorOnly) {
- return toExpression(body[0]);
- }
- body.push(ReturnStatement(cloneNode(classState.classRef)));
- var container = ArrowFunctionExpression(closureParams, BlockStatement(body, directives));
- return CallExpression(container, closureArgs);
- }
- return classTransformer(path, file, builtinClasses, isLoose);
- }
- var getBuiltinClasses = function getBuiltinClasses(category) {
- return Object.keys(globals$5[category]).filter(function (name) {
- return /^[A-Z]/.test(name);
- });
- };
- var builtinClasses = new Set([].concat(getBuiltinClasses("builtin"), getBuiltinClasses("browser")));
- var transformClasses = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose;
- var VISITED = Symbol();
- return {
- name: "transform-classes",
- visitor: {
- ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
- if (!path.get("declaration").isClassDeclaration()) return;
- splitExportDeclaration(path);
- },
- ClassDeclaration: function ClassDeclaration(path) {
- var node = path.node;
- var ref = node.id || path.scope.generateUidIdentifier("class");
- path.replaceWith(VariableDeclaration("let", [VariableDeclarator(ref, toExpression(node))]));
- },
- ClassExpression: function ClassExpression(path, state) {
- var node = path.node;
- if (node[VISITED]) return;
- var inferred = nameFunction(path);
- if (inferred && inferred !== node) {
- path.replaceWith(inferred);
- return;
- }
- node[VISITED] = true;
- path.replaceWith(transformClass(path, state.file, builtinClasses, loose));
- if (path.isCallExpression()) {
- annotateAsPure(path);
- if (path.get("callee").isArrowFunctionExpression()) {
- path.get("callee").arrowFunctionToExpression();
- }
- }
- }
- }
- };
- });
- var transformComputedProperties = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose;
- var pushComputedProps = loose ? pushComputedPropsLoose : pushComputedPropsSpec;
- var buildMutatorMapAssign = template("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n ");
- function getValue(prop) {
- if (isObjectProperty(prop)) {
- return prop.value;
- } else if (isObjectMethod(prop)) {
- return FunctionExpression(null, prop.params, prop.body, prop.generator, prop.async);
- }
- }
- function pushAssign(objId, prop, body) {
- if (prop.kind === "get" && prop.kind === "set") {
- pushMutatorDefine(objId, prop);
- } else {
- body.push(ExpressionStatement(AssignmentExpression("=", MemberExpression(cloneNode(objId), prop.key, prop.computed || isLiteral(prop.key)), getValue(prop))));
- }
- }
- function pushMutatorDefine(_ref, prop) {
- var body = _ref.body,
- getMutatorId = _ref.getMutatorId,
- scope = _ref.scope;
- var key = !prop.computed && isIdentifier(prop.key) ? StringLiteral(prop.key.name) : prop.key;
- var maybeMemoise = scope.maybeGenerateMemoised(key);
- if (maybeMemoise) {
- body.push(ExpressionStatement(AssignmentExpression("=", maybeMemoise, key)));
- key = maybeMemoise;
- }
- body.push.apply(body, buildMutatorMapAssign({
- MUTATOR_MAP_REF: getMutatorId(),
- KEY: cloneNode(key),
- VALUE: getValue(prop),
- KIND: Identifier(prop.kind)
- }));
- }
- function pushComputedPropsLoose(info) {
- for (var _iterator = info.computedProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var prop = _ref2;
- if (prop.kind === "get" || prop.kind === "set") {
- pushMutatorDefine(info, prop);
- } else {
- pushAssign(cloneNode(info.objId), prop, info.body);
- }
- }
- }
- function pushComputedPropsSpec(info) {
- var objId = info.objId,
- body = info.body,
- computedProps = info.computedProps,
- state = info.state;
- for (var _iterator2 = computedProps, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref3 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref3 = _i2.value;
- }
- var prop = _ref3;
- var key = toComputedKey(prop);
- if (prop.kind === "get" || prop.kind === "set") {
- pushMutatorDefine(info, prop);
- } else if (isStringLiteral(key, {
- value: "__proto__"
- })) {
- pushAssign(objId, prop, body);
- } else {
- if (computedProps.length === 1) {
- return CallExpression(state.addHelper("defineProperty"), [info.initPropExpression, key, getValue(prop)]);
- } else {
- body.push(ExpressionStatement(CallExpression(state.addHelper("defineProperty"), [cloneNode(objId), key, getValue(prop)])));
- }
- }
- }
- }
- return {
- name: "transform-computed-properties",
- visitor: {
- ObjectExpression: {
- exit: function exit(path, state) {
- var node = path.node,
- parent = path.parent,
- scope = path.scope;
- var hasComputed = false;
- for (var _i3 = 0, _arr = node.properties; _i3 < _arr.length; _i3++) {
- var prop = _arr[_i3];
- hasComputed = prop.computed === true;
- if (hasComputed) break;
- }
- if (!hasComputed) return;
- var initProps = [];
- var computedProps = [];
- var foundComputed = false;
- for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray3) {
- if (_i4 >= _iterator3.length) break;
- _ref4 = _iterator3[_i4++];
- } else {
- _i4 = _iterator3.next();
- if (_i4.done) break;
- _ref4 = _i4.value;
- }
- var _prop = _ref4;
- if (_prop.computed) {
- foundComputed = true;
- }
- if (foundComputed) {
- computedProps.push(_prop);
- } else {
- initProps.push(_prop);
- }
- }
- var objId = scope.generateUidIdentifierBasedOnNode(parent);
- var initPropExpression = ObjectExpression(initProps);
- var body = [];
- body.push(VariableDeclaration("var", [VariableDeclarator(objId, initPropExpression)]));
- var mutatorRef;
- var getMutatorId = function getMutatorId() {
- if (!mutatorRef) {
- mutatorRef = scope.generateUidIdentifier("mutatorMap");
- body.push(VariableDeclaration("var", [VariableDeclarator(mutatorRef, ObjectExpression([]))]));
- }
- return cloneNode(mutatorRef);
- };
- var single = pushComputedProps({
- scope: scope,
- objId: objId,
- body: body,
- computedProps: computedProps,
- initPropExpression: initPropExpression,
- getMutatorId: getMutatorId,
- state: state
- });
- if (mutatorRef) {
- body.push(ExpressionStatement(CallExpression(state.addHelper("defineEnumerableProperties"), [cloneNode(objId), cloneNode(mutatorRef)])));
- }
- if (single) {
- path.replaceWith(single);
- } else {
- body.push(ExpressionStatement(cloneNode(objId)));
- path.replaceWithMultiple(body);
- }
- }
- }
- }
- };
- });
- var transformDestructuring = declare(function (api, options) {
- api.assertVersion(7);
- var _options$loose = options.loose,
- loose = _options$loose === void 0 ? false : _options$loose,
- _options$useBuiltIns = options.useBuiltIns,
- useBuiltIns = _options$useBuiltIns === void 0 ? false : _options$useBuiltIns;
- if (typeof loose !== "boolean") {
- throw new Error(".loose must be a boolean or undefined");
- }
- var arrayOnlySpread = loose;
- function getExtendsHelper(file) {
- return useBuiltIns ? MemberExpression(Identifier("Object"), Identifier("assign")) : file.addHelper("extends");
- }
- function variableDeclarationHasPattern(node) {
- for (var _i = 0, _arr = node.declarations; _i < _arr.length; _i++) {
- var declar = _arr[_i];
- if (isPattern(declar.id)) {
- return true;
- }
- }
- return false;
- }
- function hasRest(pattern) {
- for (var _i2 = 0, _arr2 = pattern.elements; _i2 < _arr2.length; _i2++) {
- var elem = _arr2[_i2];
- if (isRestElement(elem)) {
- return true;
- }
- }
- return false;
- }
- function hasObjectRest(pattern) {
- for (var _i3 = 0, _arr3 = pattern.properties; _i3 < _arr3.length; _i3++) {
- var elem = _arr3[_i3];
- if (isRestElement(elem)) {
- return true;
- }
- }
- return false;
- }
- var STOP_TRAVERSAL = {};
- var arrayUnpackVisitor = function arrayUnpackVisitor(node, ancestors, state) {
- if (!ancestors.length) {
- return;
- }
- if (isIdentifier(node) && isReferenced(node, ancestors[ancestors.length - 1]) && state.bindings[node.name]) {
- state.deopt = true;
- throw STOP_TRAVERSAL;
- }
- };
- var DestructuringTransformer = function () {
- function DestructuringTransformer(opts) {
- this.blockHoist = opts.blockHoist;
- this.operator = opts.operator;
- this.arrays = {};
- this.nodes = opts.nodes || [];
- this.scope = opts.scope;
- this.kind = opts.kind;
- this.arrayOnlySpread = opts.arrayOnlySpread;
- this.addHelper = opts.addHelper;
- }
- var _proto = DestructuringTransformer.prototype;
- _proto.buildVariableAssignment = function buildVariableAssignment(id, init) {
- var op = this.operator;
- if (isMemberExpression(id)) op = "=";
- var node;
- if (op) {
- node = ExpressionStatement(AssignmentExpression(op, id, cloneNode(init) || this.scope.buildUndefinedNode()));
- } else {
- node = VariableDeclaration(this.kind, [VariableDeclarator(id, cloneNode(init))]);
- }
- node._blockHoist = this.blockHoist;
- return node;
- };
- _proto.buildVariableDeclaration = function buildVariableDeclaration(id, init) {
- var declar = VariableDeclaration("var", [VariableDeclarator(cloneNode(id), cloneNode(init))]);
- declar._blockHoist = this.blockHoist;
- return declar;
- };
- _proto.push = function push(id, _init) {
- var init = cloneNode(_init);
- if (isObjectPattern(id)) {
- this.pushObjectPattern(id, init);
- } else if (isArrayPattern(id)) {
- this.pushArrayPattern(id, init);
- } else if (isAssignmentPattern(id)) {
- this.pushAssignmentPattern(id, init);
- } else {
- this.nodes.push(this.buildVariableAssignment(id, init));
- }
- };
- _proto.toArray = function toArray(node, count) {
- if (this.arrayOnlySpread || isIdentifier(node) && this.arrays[node.name]) {
- return node;
- } else {
- return this.scope.toArray(node, count);
- }
- };
- _proto.pushAssignmentPattern = function pushAssignmentPattern(_ref, valueRef) {
- var left = _ref.left,
- right = _ref.right;
- var tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);
- this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));
- var tempConditional = ConditionalExpression(BinaryExpression("===", cloneNode(tempId), this.scope.buildUndefinedNode()), right, cloneNode(tempId));
- if (isPattern(left)) {
- var patternId;
- var node;
- if (this.kind === "const") {
- patternId = this.scope.generateUidIdentifier(tempId.name);
- node = this.buildVariableDeclaration(patternId, tempConditional);
- } else {
- patternId = tempId;
- node = ExpressionStatement(AssignmentExpression("=", cloneNode(tempId), tempConditional));
- }
- this.nodes.push(node);
- this.push(left, patternId);
- } else {
- this.nodes.push(this.buildVariableAssignment(left, tempConditional));
- }
- };
- _proto.pushObjectRest = function pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {
- var keys = [];
- var allLiteral = true;
- for (var i = 0; i < pattern.properties.length; i++) {
- var prop = pattern.properties[i];
- if (i >= spreadPropIndex) break;
- if (isRestElement(prop)) continue;
- var key = prop.key;
- if (isIdentifier(key) && !prop.computed) {
- keys.push(StringLiteral(key.name));
- } else if (isTemplateLiteral(prop.key)) {
- keys.push(cloneNode(prop.key));
- } else if (isLiteral(key)) {
- keys.push(StringLiteral(String(key.value)));
- } else {
- keys.push(cloneNode(key));
- allLiteral = false;
- }
- }
- var value;
- if (keys.length === 0) {
- value = CallExpression(getExtendsHelper(this), [ObjectExpression([]), cloneNode(objRef)]);
- } else {
- var keyExpression = ArrayExpression(keys);
- if (!allLiteral) {
- keyExpression = CallExpression(MemberExpression(keyExpression, Identifier("map")), [this.addHelper("toPropertyKey")]);
- }
- value = CallExpression(this.addHelper("objectWithoutProperties" + (loose ? "Loose" : "")), [cloneNode(objRef), keyExpression]);
- }
- this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));
- };
- _proto.pushObjectProperty = function pushObjectProperty(prop, propRef) {
- if (isLiteral(prop.key)) prop.computed = true;
- var pattern = prop.value;
- var objRef = MemberExpression(cloneNode(propRef), prop.key, prop.computed);
- if (isPattern(pattern)) {
- this.push(pattern, objRef);
- } else {
- this.nodes.push(this.buildVariableAssignment(pattern, objRef));
- }
- };
- _proto.pushObjectPattern = function pushObjectPattern(pattern, objRef) {
- if (!pattern.properties.length) {
- this.nodes.push(ExpressionStatement(CallExpression(this.addHelper("objectDestructuringEmpty"), [objRef])));
- }
- if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {
- var temp = this.scope.generateUidIdentifierBasedOnNode(objRef);
- this.nodes.push(this.buildVariableDeclaration(temp, objRef));
- objRef = temp;
- }
- if (hasObjectRest(pattern)) {
- var copiedPattern;
- for (var i = 0; i < pattern.properties.length; i++) {
- var prop = pattern.properties[i];
- if (isRestElement(prop)) {
- break;
- }
- var key = prop.key;
- if (prop.computed && !this.scope.isPure(key)) {
- var name = this.scope.generateUidIdentifierBasedOnNode(key);
- this.nodes.push(this.buildVariableDeclaration(name, key));
- if (!copiedPattern) {
- copiedPattern = pattern = Object.assign({}, pattern, {
- properties: pattern.properties.slice()
- });
- }
- copiedPattern.properties[i] = Object.assign({}, copiedPattern.properties[i], {
- key: name
- });
- }
- }
- }
- for (var _i4 = 0; _i4 < pattern.properties.length; _i4++) {
- var _prop = pattern.properties[_i4];
- if (isRestElement(_prop)) {
- this.pushObjectRest(pattern, objRef, _prop, _i4);
- } else {
- this.pushObjectProperty(_prop, objRef);
- }
- }
- };
- _proto.canUnpackArrayPattern = function canUnpackArrayPattern(pattern, arr) {
- if (!isArrayExpression(arr)) return false;
- if (pattern.elements.length > arr.elements.length) return;
- if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) {
- return false;
- }
- for (var _i5 = 0, _arr4 = pattern.elements; _i5 < _arr4.length; _i5++) {
- var elem = _arr4[_i5];
- if (!elem) return false;
- if (isMemberExpression(elem)) return false;
- }
- for (var _i6 = 0, _arr5 = arr.elements; _i6 < _arr5.length; _i6++) {
- var _elem = _arr5[_i6];
- if (isSpreadElement(_elem)) return false;
- if (isCallExpression(_elem)) return false;
- if (isMemberExpression(_elem)) return false;
- }
- var bindings = getBindingIdentifiers(pattern);
- var state = {
- deopt: false,
- bindings: bindings
- };
- try {
- traverse(arr, arrayUnpackVisitor, state);
- } catch (e) {
- if (e !== STOP_TRAVERSAL) throw e;
- }
- return !state.deopt;
- };
- _proto.pushUnpackedArrayPattern = function pushUnpackedArrayPattern(pattern, arr) {
- for (var i = 0; i < pattern.elements.length; i++) {
- var elem = pattern.elements[i];
- if (isRestElement(elem)) {
- this.push(elem.argument, ArrayExpression(arr.elements.slice(i)));
- } else {
- this.push(elem, arr.elements[i]);
- }
- }
- };
- _proto.pushArrayPattern = function pushArrayPattern(pattern, arrayRef) {
- if (!pattern.elements) return;
- if (this.canUnpackArrayPattern(pattern, arrayRef)) {
- return this.pushUnpackedArrayPattern(pattern, arrayRef);
- }
- var count = !hasRest(pattern) && pattern.elements.length;
- var toArray = this.toArray(arrayRef, count);
- if (isIdentifier(toArray)) {
- arrayRef = toArray;
- } else {
- arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);
- this.arrays[arrayRef.name] = true;
- this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));
- }
- for (var i = 0; i < pattern.elements.length; i++) {
- var elem = pattern.elements[i];
- if (!elem) continue;
- var elemRef = void 0;
- if (isRestElement(elem)) {
- elemRef = this.toArray(arrayRef);
- elemRef = CallExpression(MemberExpression(elemRef, Identifier("slice")), [NumericLiteral(i)]);
- elem = elem.argument;
- } else {
- elemRef = MemberExpression(arrayRef, NumericLiteral(i), true);
- }
- this.push(elem, elemRef);
- }
- };
- _proto.init = function init(pattern, ref) {
- if (!isArrayExpression(ref) && !isMemberExpression(ref)) {
- var memo = this.scope.maybeGenerateMemoised(ref, true);
- if (memo) {
- this.nodes.push(this.buildVariableDeclaration(memo, cloneNode(ref)));
- ref = memo;
- }
- }
- this.push(pattern, ref);
- return this.nodes;
- };
- return DestructuringTransformer;
- }();
- return {
- name: "transform-destructuring",
- visitor: {
- ExportNamedDeclaration: function ExportNamedDeclaration$1(path) {
- var declaration = path.get("declaration");
- if (!declaration.isVariableDeclaration()) return;
- if (!variableDeclarationHasPattern(declaration.node)) return;
- var specifiers = [];
- for (var _i7 = 0, _Object$keys = Object.keys(path.getOuterBindingIdentifiers(path)); _i7 < _Object$keys.length; _i7++) {
- var name = _Object$keys[_i7];
- specifiers.push(ExportSpecifier(Identifier(name), Identifier(name)));
- }
- path.replaceWith(declaration.node);
- path.insertAfter(ExportNamedDeclaration(null, specifiers));
- },
- ForXStatement: function ForXStatement(path) {
- var _this = this;
- var node = path.node,
- scope = path.scope;
- var left = node.left;
- if (isPattern(left)) {
- var temp = scope.generateUidIdentifier("ref");
- node.left = VariableDeclaration("var", [VariableDeclarator(temp)]);
- path.ensureBlock();
- if (node.body.body.length === 0 && path.isCompletionRecord()) {
- node.body.body.unshift(ExpressionStatement(scope.buildUndefinedNode()));
- }
- node.body.body.unshift(ExpressionStatement(AssignmentExpression("=", left, temp)));
- return;
- }
- if (!isVariableDeclaration(left)) return;
- var pattern = left.declarations[0].id;
- if (!isPattern(pattern)) return;
- var key = scope.generateUidIdentifier("ref");
- node.left = VariableDeclaration(left.kind, [VariableDeclarator(key, null)]);
- var nodes = [];
- var destructuring = new DestructuringTransformer({
- kind: left.kind,
- scope: scope,
- nodes: nodes,
- arrayOnlySpread: arrayOnlySpread,
- addHelper: function addHelper(name) {
- return _this.addHelper(name);
- }
- });
- destructuring.init(pattern, key);
- path.ensureBlock();
- var block = node.body;
- block.body = nodes.concat(block.body);
- },
- CatchClause: function CatchClause(_ref2) {
- var _this2 = this;
- var node = _ref2.node,
- scope = _ref2.scope;
- var pattern = node.param;
- if (!isPattern(pattern)) return;
- var ref = scope.generateUidIdentifier("ref");
- node.param = ref;
- var nodes = [];
- var destructuring = new DestructuringTransformer({
- kind: "let",
- scope: scope,
- nodes: nodes,
- arrayOnlySpread: arrayOnlySpread,
- addHelper: function addHelper(name) {
- return _this2.addHelper(name);
- }
- });
- destructuring.init(pattern, ref);
- node.body.body = nodes.concat(node.body.body);
- },
- AssignmentExpression: function AssignmentExpression(path) {
- var _this3 = this;
- var node = path.node,
- scope = path.scope;
- if (!isPattern(node.left)) return;
- var nodes = [];
- var destructuring = new DestructuringTransformer({
- operator: node.operator,
- scope: scope,
- nodes: nodes,
- arrayOnlySpread: arrayOnlySpread,
- addHelper: function addHelper(name) {
- return _this3.addHelper(name);
- }
- });
- var ref;
- if (path.isCompletionRecord() || !path.parentPath.isExpressionStatement()) {
- ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref");
- nodes.push(VariableDeclaration("var", [VariableDeclarator(ref, node.right)]));
- if (isArrayExpression(node.right)) {
- destructuring.arrays[ref.name] = true;
- }
- }
- destructuring.init(node.left, ref || node.right);
- if (ref) {
- if (path.parentPath.isArrowFunctionExpression()) {
- path.replaceWith(BlockStatement([]));
- nodes.push(ReturnStatement(cloneNode(ref)));
- } else {
- nodes.push(ExpressionStatement(cloneNode(ref)));
- }
- }
- path.replaceWithMultiple(nodes);
- },
- VariableDeclaration: function VariableDeclaration(path) {
- var _this4 = this;
- var node = path.node,
- scope = path.scope,
- parent = path.parent;
- if (isForXStatement(parent)) return;
- if (!parent || !path.container) return;
- if (!variableDeclarationHasPattern(node)) return;
- var nodeKind = node.kind;
- var nodes = [];
- var declar;
- for (var i = 0; i < node.declarations.length; i++) {
- declar = node.declarations[i];
- var patternId = declar.init;
- var pattern = declar.id;
- var destructuring = new DestructuringTransformer({
- blockHoist: node._blockHoist,
- nodes: nodes,
- scope: scope,
- kind: node.kind,
- arrayOnlySpread: arrayOnlySpread,
- addHelper: function addHelper(name) {
- return _this4.addHelper(name);
- }
- });
- if (isPattern(pattern)) {
- destructuring.init(pattern, patternId);
- if (+i !== node.declarations.length - 1) {
- inherits(nodes[nodes.length - 1], declar);
- }
- } else {
- nodes.push(inherits(destructuring.buildVariableAssignment(declar.id, cloneNode(declar.init)), declar));
- }
- }
- var tail = null;
- var nodesOut = [];
- for (var _i8 = 0, _nodes = nodes; _i8 < _nodes.length; _i8++) {
- var _node = _nodes[_i8];
- if (tail !== null && isVariableDeclaration(_node)) {
- var _tail$declarations;
- (_tail$declarations = tail.declarations).push.apply(_tail$declarations, _node.declarations);
- } else {
- _node.kind = nodeKind;
- nodesOut.push(_node);
- tail = isVariableDeclaration(_node) ? _node : null;
- }
- }
- for (var _i9 = 0, _nodesOut = nodesOut; _i9 < _nodesOut.length; _i9++) {
- var nodeOut = _nodesOut[_i9];
- if (!nodeOut.declarations) continue;
- for (var _iterator = nodeOut.declarations, _isArray = Array.isArray(_iterator), _i10 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray) {
- if (_i10 >= _iterator.length) break;
- _ref3 = _iterator[_i10++];
- } else {
- _i10 = _iterator.next();
- if (_i10.done) break;
- _ref3 = _i10.value;
- }
- var declaration = _ref3;
- var name = declaration.id.name;
- if (scope.bindings[name]) {
- scope.bindings[name].kind = nodeOut.kind;
- }
- }
- }
- if (nodesOut.length === 1) {
- path.replaceWith(nodesOut[0]);
- } else {
- path.replaceWithMultiple(nodesOut);
- }
- }
- }
- };
- });
- var transformDotallRegex = declare(function (api) {
- api.assertVersion(7);
- return createRegExpFeaturePlugin({
- name: "transform-dotall-regex",
- feature: "dotAllFlag"
- });
- });
- function getName$1(key) {
- if (isIdentifier(key)) {
- return key.name;
- }
- return key.value.toString();
- }
- var transformDuplicateKeys = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-duplicate-keys",
- visitor: {
- ObjectExpression: function ObjectExpression(path) {
- var node = path.node;
- var plainProps = node.properties.filter(function (prop) {
- return !isSpreadElement(prop) && !prop.computed;
- });
- var alreadySeenData = Object.create(null);
- var alreadySeenGetters = Object.create(null);
- var alreadySeenSetters = Object.create(null);
- for (var _iterator = plainProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var prop = _ref;
- var name = getName$1(prop.key);
- var isDuplicate = false;
- switch (prop.kind) {
- case "get":
- if (alreadySeenData[name] || alreadySeenGetters[name]) {
- isDuplicate = true;
- }
- alreadySeenGetters[name] = true;
- break;
- case "set":
- if (alreadySeenData[name] || alreadySeenSetters[name]) {
- isDuplicate = true;
- }
- alreadySeenSetters[name] = true;
- break;
- default:
- if (alreadySeenData[name] || alreadySeenGetters[name] || alreadySeenSetters[name]) {
- isDuplicate = true;
- }
- alreadySeenData[name] = true;
- }
- if (isDuplicate) {
- prop.computed = true;
- prop.key = StringLiteral(name);
- }
- }
- }
- }
- };
- });
- function getObjRef(node, nodes, file, scope) {
- var ref;
- if (isSuper(node)) {
- return node;
- } else if (isIdentifier(node)) {
- if (scope.hasBinding(node.name)) {
- return node;
- } else {
- ref = node;
- }
- } else if (isMemberExpression(node)) {
- ref = node.object;
- if (isSuper(ref) || isIdentifier(ref) && scope.hasBinding(ref.name)) {
- return ref;
- }
- } else {
- throw new Error("We can't explode this node type " + node.type);
- }
- var temp = scope.generateUidIdentifierBasedOnNode(ref);
- scope.push({
- id: temp
- });
- nodes.push(AssignmentExpression("=", cloneNode(temp), cloneNode(ref)));
- return temp;
- }
- function getPropRef(node, nodes, file, scope) {
- var prop = node.property;
- var key = toComputedKey(node, prop);
- if (isLiteral(key) && isPureish(key)) return key;
- var temp = scope.generateUidIdentifierBasedOnNode(prop);
- scope.push({
- id: temp
- });
- nodes.push(AssignmentExpression("=", cloneNode(temp), cloneNode(prop)));
- return temp;
- }
- function explode$1 (node, nodes, file, scope, allowedSingleIdent) {
- var obj;
- if (isIdentifier(node) && allowedSingleIdent) {
- obj = node;
- } else {
- obj = getObjRef(node, nodes, file, scope);
- }
- var ref, uid;
- if (isIdentifier(node)) {
- ref = cloneNode(node);
- uid = obj;
- } else {
- var prop = getPropRef(node, nodes, file, scope);
- var computed = node.computed || isLiteral(prop);
- uid = MemberExpression(cloneNode(obj), cloneNode(prop), computed);
- ref = MemberExpression(cloneNode(obj), cloneNode(prop), computed);
- }
- return {
- uid: uid,
- ref: ref
- };
- }
- function build (opts) {
- var build = opts.build,
- operator = opts.operator;
- return {
- AssignmentExpression: function AssignmentExpression$1(path) {
- var node = path.node,
- scope = path.scope;
- if (node.operator !== operator + "=") return;
- var nodes = [];
- var exploded = explode$1(node.left, nodes, this, scope);
- nodes.push(AssignmentExpression("=", exploded.ref, build(exploded.uid, node.right)));
- path.replaceWith(SequenceExpression(nodes));
- },
- BinaryExpression: function BinaryExpression(path) {
- var node = path.node;
- if (node.operator === operator) {
- path.replaceWith(build(node.left, node.right));
- }
- }
- };
- }
- var transformExponentialOperator = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-exponentiation-operator",
- visitor: build({
- operator: "**",
- build: function build(left, right) {
- return CallExpression(MemberExpression(Identifier("Math"), Identifier("pow")), [left, right]);
- }
- })
- };
- });
- var transformFlowComments = declare(function (api) {
- api.assertVersion(7);
- function commentFromString(comment) {
- return typeof comment === "string" ? {
- type: "CommentBlock",
- value: comment
- } : comment;
- }
- function attachComment(_ref) {
- var ofPath = _ref.ofPath,
- toPath = _ref.toPath,
- _ref$where = _ref.where,
- where = _ref$where === void 0 ? "trailing" : _ref$where,
- _ref$optional = _ref.optional,
- optional = _ref$optional === void 0 ? false : _ref$optional,
- _ref$comments = _ref.comments,
- comments = _ref$comments === void 0 ? generateComment(ofPath, optional) : _ref$comments,
- _ref$keepType = _ref.keepType,
- keepType = _ref$keepType === void 0 ? false : _ref$keepType;
- if (!toPath || !toPath.node) {
- toPath = ofPath.getPrevSibling();
- where = "trailing";
- }
- if (!toPath.node) {
- toPath = ofPath.getNextSibling();
- where = "leading";
- }
- if (!toPath.node) {
- toPath = ofPath.parentPath;
- where = "inner";
- }
- if (!Array.isArray(comments)) {
- comments = [comments];
- }
- comments = comments.map(commentFromString);
- if (!keepType && ofPath && ofPath.node) {
- var node = ofPath.node;
- var parent = ofPath.parentPath;
- var prev = ofPath.getPrevSibling();
- var next = ofPath.getNextSibling();
- var isSingleChild = !(prev.node || next.node);
- var leading = node.leadingComments;
- var trailing = node.trailingComments;
- if (isSingleChild && leading) {
- parent.addComments("inner", leading);
- }
- toPath.addComments(where, comments);
- ofPath.remove();
- if (isSingleChild && trailing) {
- parent.addComments("inner", trailing);
- }
- } else {
- toPath.addComments(where, comments);
- }
- }
- function wrapInFlowComment(path) {
- attachComment({
- ofPath: path,
- comments: generateComment(path, path.parent.optional)
- });
- }
- function generateComment(path, optional) {
- var comment = path.getSource().replace(/\*-\//g, "*-ESCAPED/").replace(/\*\//g, "*-/");
- if (optional) comment = "?" + comment;
- if (comment[0] !== ":") comment = ":: " + comment;
- return comment;
- }
- function isTypeImport(importKind) {
- return importKind === "type" || importKind === "typeof";
- }
- return {
- name: "transform-flow-comments",
- inherits: syntaxFlow,
- visitor: {
- TypeCastExpression: function TypeCastExpression(path) {
- var node = path.node;
- attachComment({
- ofPath: path.get("typeAnnotation"),
- toPath: path.get("expression"),
- keepType: true
- });
- path.replaceWith(ParenthesizedExpression(node.expression));
- },
- Identifier: function Identifier(path) {
- if (path.parentPath.isFlow()) return;
- var node = path.node;
- if (node.typeAnnotation) {
- attachComment({
- ofPath: path.get("typeAnnotation"),
- toPath: path,
- optional: node.optional || node.typeAnnotation.optional
- });
- if (node.optional) {
- node.optional = false;
- }
- } else if (node.optional) {
- attachComment({
- toPath: path,
- comments: ":: ?"
- });
- node.optional = false;
- }
- },
- AssignmentPattern: {
- exit: function exit(_ref2) {
- var node = _ref2.node;
- var left = node.left;
- if (left.optional) {
- left.optional = false;
- }
- }
- },
- Function: function Function(path) {
- if (path.isDeclareFunction()) return;
- var node = path.node;
- if (node.typeParameters) {
- attachComment({
- ofPath: path.get("typeParameters"),
- toPath: path.get("id"),
- optional: node.typeParameters.optional
- });
- }
- if (node.returnType) {
- attachComment({
- ofPath: path.get("returnType"),
- toPath: path.get("body"),
- where: "leading",
- optional: node.returnType.typeAnnotation.optional
- });
- }
- },
- ClassProperty: function ClassProperty(path) {
- var node = path.node;
- if (!node.value) {
- wrapInFlowComment(path);
- } else if (node.typeAnnotation) {
- attachComment({
- ofPath: path.get("typeAnnotation"),
- toPath: path.get("key"),
- optional: node.typeAnnotation.optional
- });
- }
- },
- ExportNamedDeclaration: function ExportNamedDeclaration(path) {
- var node = path.node;
- if (node.exportKind !== "type" && !isFlow(node.declaration)) {
- return;
- }
- wrapInFlowComment(path);
- },
- ImportDeclaration: function ImportDeclaration(path) {
- var node = path.node;
- if (isTypeImport(node.importKind)) {
- wrapInFlowComment(path);
- return;
- }
- var typeSpecifiers = node.specifiers.filter(function (specifier) {
- return isTypeImport(specifier.importKind);
- });
- var nonTypeSpecifiers = node.specifiers.filter(function (specifier) {
- return !isTypeImport(specifier.importKind);
- });
- node.specifiers = nonTypeSpecifiers;
- if (typeSpecifiers.length > 0) {
- var typeImportNode = cloneNode(node);
- typeImportNode.specifiers = typeSpecifiers;
- var comment = ":: " + generateCode(typeImportNode).code;
- if (nonTypeSpecifiers.length > 0) {
- attachComment({
- toPath: path,
- comments: comment
- });
- } else {
- attachComment({
- ofPath: path,
- comments: comment
- });
- }
- }
- },
- ObjectPattern: function ObjectPattern(path) {
- var node = path.node;
- if (node.typeAnnotation) {
- attachComment({
- ofPath: path.get("typeAnnotation"),
- toPath: path,
- optional: node.optional || node.typeAnnotation.optional
- });
- }
- },
- Flow: function Flow(path) {
- wrapInFlowComment(path);
- },
- Class: function Class(path) {
- var node = path.node;
- var comments = [];
- if (node.typeParameters) {
- var typeParameters = path.get("typeParameters");
- comments.push(generateComment(typeParameters, node.typeParameters.optional));
- var trailingComments = node.typeParameters.trailingComments;
- if (trailingComments) {
- var _comments;
- (_comments = comments).push.apply(_comments, trailingComments);
- }
- typeParameters.remove();
- }
- if (node.superClass) {
- if (comments.length > 0) {
- attachComment({
- toPath: path.get("id"),
- comments: comments
- });
- comments = [];
- }
- if (node.superTypeParameters) {
- var superTypeParameters = path.get("superTypeParameters");
- comments.push(generateComment(superTypeParameters, superTypeParameters.node.optional));
- superTypeParameters.remove();
- }
- }
- if (node["implements"]) {
- var impls = path.get("implements");
- var comment = "implements " + impls.map(function (impl) {
- return generateComment(impl).replace(/^:: /, "");
- }).join(", ");
- delete node["implements"];
- if (comments.length === 1) {
- comments[0] += " " + comment;
- } else {
- comments.push(":: " + comment);
- }
- }
- if (comments.length > 0) {
- attachComment({
- toPath: path.get("body"),
- where: "leading",
- comments: comments
- });
- }
- }
- }
- };
- });
- var transformFlowStripTypes = declare(function (api) {
- api.assertVersion(7);
- var FLOW_DIRECTIVE = /(@flow(\s+(strict(-local)?|weak))?|@noflow)/;
- var skipStrip = false;
- return {
- name: "transform-flow-strip-types",
- inherits: syntaxFlow,
- visitor: {
- Program: function Program(path, _ref) {
- var comments = _ref.file.ast.comments,
- opts = _ref.opts;
- skipStrip = false;
- var directiveFound = false;
- if (comments) {
- for (var _i = 0, _arr = comments; _i < _arr.length; _i++) {
- var comment = _arr[_i];
- if (FLOW_DIRECTIVE.test(comment.value)) {
- directiveFound = true;
- comment.value = comment.value.replace(FLOW_DIRECTIVE, "");
- if (!comment.value.replace(/\*/g, "").trim()) {
- comment.ignore = true;
- }
- }
- }
- }
- if (!directiveFound && opts.requireDirective) {
- skipStrip = true;
- }
- },
- ImportDeclaration: function ImportDeclaration(path) {
- if (skipStrip) return;
- if (!path.node.specifiers.length) return;
- var typeCount = 0;
- path.node.specifiers.forEach(function (_ref2) {
- var importKind = _ref2.importKind;
- if (importKind === "type" || importKind === "typeof") {
- typeCount++;
- }
- });
- if (typeCount === path.node.specifiers.length) {
- path.remove();
- }
- },
- Flow: function Flow(path) {
- if (skipStrip) {
- throw path.buildCodeFrameError("A @flow directive is required when using Flow annotations with " + "the `requireDirective` option.");
- }
- path.remove();
- },
- ClassProperty: function ClassProperty(path) {
- if (skipStrip) return;
- path.node.variance = null;
- path.node.typeAnnotation = null;
- if (!path.node.value) path.remove();
- },
- ClassPrivateProperty: function ClassPrivateProperty(path) {
- if (skipStrip) return;
- path.node.typeAnnotation = null;
- },
- Class: function Class(path) {
- if (skipStrip) return;
- path.node["implements"] = null;
- path.get("body.body").forEach(function (child) {
- if (child.isClassProperty()) {
- child.node.typeAnnotation = null;
- if (!child.node.value) child.remove();
- }
- });
- },
- AssignmentPattern: function AssignmentPattern(_ref3) {
- var node = _ref3.node;
- if (skipStrip) return;
- node.left.optional = false;
- },
- Function: function Function(_ref4) {
- var node = _ref4.node;
- if (skipStrip) return;
- for (var i = 0; i < node.params.length; i++) {
- var param = node.params[i];
- param.optional = false;
- if (param.type === "AssignmentPattern") {
- param.left.optional = false;
- }
- }
- node.predicate = null;
- },
- TypeCastExpression: function TypeCastExpression(path) {
- if (skipStrip) return;
- var node = path.node;
- do {
- node = node.expression;
- } while (isTypeCastExpression(node));
- path.replaceWith(node);
- },
- CallExpression: function CallExpression(_ref5) {
- var node = _ref5.node;
- if (skipStrip) return;
- node.typeArguments = null;
- },
- OptionalCallExpression: function OptionalCallExpression(_ref6) {
- var node = _ref6.node;
- if (skipStrip) return;
- node.typeArguments = null;
- },
- NewExpression: function NewExpression(_ref7) {
- var node = _ref7.node;
- if (skipStrip) return;
- node.typeArguments = null;
- }
- }
- };
- });
- var transformForOf = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose,
- assumeArray = options.assumeArray;
- if (loose === true && assumeArray === true) {
- throw new Error("The loose and assumeArray options cannot be used together in @babel/plugin-transform-for-of");
- }
- if (assumeArray) {
- return {
- name: "transform-for-of",
- visitor: {
- ForOfStatement: function ForOfStatement(path) {
- var scope = path.scope;
- var _path$node = path.node,
- left = _path$node.left,
- right = _path$node.right,
- body = _path$node.body;
- var i = scope.generateUidIdentifier("i");
- var array = scope.maybeGenerateMemoised(right, true);
- var inits = [VariableDeclarator(i, NumericLiteral(0))];
- if (array) {
- inits.push(VariableDeclarator(array, right));
- } else {
- array = right;
- }
- var item = MemberExpression(cloneNode(array), cloneNode(i), true);
- var assignment;
- if (isVariableDeclaration(left)) {
- assignment = left;
- assignment.declarations[0].init = item;
- } else {
- assignment = ExpressionStatement(AssignmentExpression("=", left, item));
- }
- var block = toBlock(body);
- block.body.unshift(assignment);
- path.replaceWith(ForStatement(VariableDeclaration("let", inits), BinaryExpression("<", cloneNode(i), MemberExpression(cloneNode(array), Identifier("length"))), UpdateExpression("++", cloneNode(i)), block));
- }
- }
- };
- }
- var pushComputedProps = loose ? pushComputedPropsLoose : pushComputedPropsSpec;
- var buildForOfArray = template("\n for (var KEY = 0, NAME = ARR; KEY < NAME.length; KEY++) BODY;\n ");
- var buildForOfLoose = template("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n INTERMEDIATE;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n ");
- var buildForOf = template("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY;\n !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done);\n ITERATOR_COMPLETION = true\n ) {}\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");
- function _ForOfStatementArray(path) {
- var node = path.node,
- scope = path.scope;
- var right = scope.generateUidIdentifierBasedOnNode(node.right, "arr");
- var iterationKey = scope.generateUidIdentifier("i");
- var loop = buildForOfArray({
- BODY: node.body,
- KEY: iterationKey,
- NAME: right,
- ARR: node.right
- });
- inherits(loop, node);
- ensureBlock(loop);
- var iterationValue = MemberExpression(cloneNode(right), cloneNode(iterationKey), true);
- var left = node.left;
- if (isVariableDeclaration(left)) {
- left.declarations[0].init = iterationValue;
- loop.body.body.unshift(left);
- } else {
- loop.body.body.unshift(ExpressionStatement(AssignmentExpression("=", left, iterationValue)));
- }
- if (path.parentPath.isLabeledStatement()) {
- loop = LabeledStatement(path.parentPath.node.label, loop);
- }
- return [loop];
- }
- function replaceWithArray(path) {
- if (path.parentPath.isLabeledStatement()) {
- path.parentPath.replaceWithMultiple(_ForOfStatementArray(path));
- } else {
- path.replaceWithMultiple(_ForOfStatementArray(path));
- }
- }
- return {
- name: "transform-for-of",
- visitor: {
- ForOfStatement: function ForOfStatement(path, state) {
- var right = path.get("right");
- if (right.isArrayExpression() || right.isGenericType("Array") || isArrayTypeAnnotation(right.getTypeAnnotation())) {
- replaceWithArray(path);
- return;
- }
- var node = path.node;
- var build = pushComputedProps(path, state);
- var declar = build.declar;
- var loop = build.loop;
- var block = loop.body;
- path.ensureBlock();
- if (declar) {
- block.body.push(declar);
- }
- block.body = block.body.concat(node.body.body);
- inherits(loop, node);
- inherits(loop.body, node.body);
- if (build.replaceParent) {
- path.parentPath.replaceWithMultiple(build.node);
- path.remove();
- } else {
- path.replaceWithMultiple(build.node);
- }
- }
- }
- };
- function pushComputedPropsLoose(path, file) {
- var node = path.node,
- scope = path.scope,
- parent = path.parent;
- var left = node.left;
- var declar, id, intermediate;
- if (isIdentifier(left) || isPattern(left) || isMemberExpression(left)) {
- id = left;
- intermediate = null;
- } else if (isVariableDeclaration(left)) {
- id = scope.generateUidIdentifier("ref");
- declar = VariableDeclaration(left.kind, [VariableDeclarator(left.declarations[0].id, Identifier(id.name))]);
- intermediate = VariableDeclaration("var", [VariableDeclarator(Identifier(id.name))]);
- } else {
- throw file.buildCodeFrameError(left, "Unknown node type " + left.type + " in ForStatement");
- }
- var iteratorKey = scope.generateUidIdentifier("iterator");
- var isArrayKey = scope.generateUidIdentifier("isArray");
- var loop = buildForOfLoose({
- LOOP_OBJECT: iteratorKey,
- IS_ARRAY: isArrayKey,
- OBJECT: node.right,
- INDEX: scope.generateUidIdentifier("i"),
- ID: id,
- INTERMEDIATE: intermediate
- });
- var isLabeledParent = isLabeledStatement(parent);
- var labeled;
- if (isLabeledParent) {
- labeled = LabeledStatement(parent.label, loop);
- }
- return {
- replaceParent: isLabeledParent,
- declar: declar,
- node: labeled || loop,
- loop: loop
- };
- }
- function pushComputedPropsSpec(path, file) {
- var node = path.node,
- scope = path.scope,
- parent = path.parent;
- var left = node.left;
- var declar;
- var stepKey = scope.generateUid("step");
- var stepValue = MemberExpression(Identifier(stepKey), Identifier("value"));
- if (isIdentifier(left) || isPattern(left) || isMemberExpression(left)) {
- declar = ExpressionStatement(AssignmentExpression("=", left, stepValue));
- } else if (isVariableDeclaration(left)) {
- declar = VariableDeclaration(left.kind, [VariableDeclarator(left.declarations[0].id, stepValue)]);
- } else {
- throw file.buildCodeFrameError(left, "Unknown node type " + left.type + " in ForStatement");
- }
- var template = buildForOf({
- ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"),
- ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"),
- ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"),
- ITERATOR_KEY: scope.generateUidIdentifier("iterator"),
- STEP_KEY: Identifier(stepKey),
- OBJECT: node.right
- });
- var isLabeledParent = isLabeledStatement(parent);
- var tryBody = template[3].block.body;
- var loop = tryBody[0];
- if (isLabeledParent) {
- tryBody[0] = LabeledStatement(parent.label, loop);
- }
- return {
- replaceParent: isLabeledParent,
- declar: declar,
- loop: loop,
- node: template
- };
- }
- });
- var transformFunctionName = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-function-name",
- visitor: {
- FunctionExpression: {
- exit: function exit(path) {
- if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
- var replacement = nameFunction(path);
- if (replacement) path.replaceWith(replacement);
- }
- }
- },
- ObjectProperty: function ObjectProperty(path) {
- var value = path.get("value");
- if (value.isFunction()) {
- var newNode = nameFunction(value);
- if (newNode) value.replaceWith(newNode);
- }
- }
- }
- };
- });
- var transformInstanceof = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-instanceof",
- visitor: {
- BinaryExpression: function BinaryExpression(path) {
- var node = path.node;
- if (node.operator === "instanceof") {
- var helper = this.addHelper("instanceof");
- var isUnderHelper = path.findParent(function (path) {
- return path.isVariableDeclarator() && path.node.id === helper || path.isFunctionDeclaration() && path.node.id && path.node.id.name === helper.name;
- });
- if (isUnderHelper) {
- return;
- } else {
- path.replaceWith(CallExpression(helper, [node.left, node.right]));
- }
- }
- }
- }
- };
- });
- var transformJscript = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-jscript",
- visitor: {
- FunctionExpression: {
- exit: function exit(path) {
- var node = path.node;
- if (!node.id) return;
- path.replaceWith(CallExpression(FunctionExpression(null, [], BlockStatement([toStatement(node), ReturnStatement(cloneNode(node.id))])), []));
- }
- }
- }
- };
- });
- var transformLiterals = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-literals",
- visitor: {
- NumericLiteral: function NumericLiteral(_ref) {
- var node = _ref.node;
- if (node.extra && /^0[ob]/i.test(node.extra.raw)) {
- node.extra = undefined;
- }
- },
- StringLiteral: function StringLiteral(_ref2) {
- var node = _ref2.node;
- if (node.extra && /\\[u]/gi.test(node.extra.raw)) {
- node.extra = undefined;
- }
- }
- }
- };
- });
- var transformMemberExpressionLiterals = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-member-expression-literals",
- visitor: {
- MemberExpression: {
- exit: function exit(_ref) {
- var node = _ref.node;
- var prop = node.property;
- if (!node.computed && isIdentifier(prop) && !isValidES3Identifier(prop.name)) {
- node.property = StringLiteral(prop.name);
- node.computed = true;
- }
- }
- }
- }
- };
- });
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
- var _baseSlice = baseSlice;
- var nativeCeil = Math.ceil,
- nativeMax$2 = Math.max;
- function chunk(array, size, guard) {
- if (guard ? _isIterateeCall(array, size, guard) : size === undefined) {
- size = 1;
- } else {
- size = nativeMax$2(toInteger_1(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0,
- resIndex = 0,
- result = Array(nativeCeil(length / size));
- while (index < length) {
- result[resIndex++] = _baseSlice(array, index, index += size);
- }
- return result;
- }
- var chunk_1 = chunk;
- function rewriteThis(programPath) {
- programPath.traverse(rewriteThisVisitor);
- }
- var rewriteThisVisitor = {
- ThisExpression: function ThisExpression(path) {
- path.replaceWith(path.scope.buildUndefinedNode());
- },
- Function: function Function(path) {
- if (!path.isArrowFunctionExpression()) path.skip();
- },
- ClassProperty: function ClassProperty(path) {
- path.skip();
- },
- ClassPrivateProperty: function ClassPrivateProperty(path) {
- path.skip();
- }
- };
- function simplifyAccess(path, bindingNames) {
- path.traverse(simpleAssignmentVisitor, {
- scope: path.scope,
- bindingNames: bindingNames,
- seen: new WeakSet()
- });
- }
- var simpleAssignmentVisitor = {
- UpdateExpression: {
- exit: function exit(path) {
- var scope = this.scope,
- bindingNames = this.bindingNames;
- var arg = path.get("argument");
- if (!arg.isIdentifier()) return;
- var localName = arg.node.name;
- if (!bindingNames.has(localName)) return;
- if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
- return;
- }
- if (path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) {
- var operator = path.node.operator == "++" ? "+=" : "-=";
- path.replaceWith(AssignmentExpression(operator, arg.node, NumericLiteral(1)));
- } else if (path.node.prefix) {
- path.replaceWith(AssignmentExpression("=", Identifier(localName), BinaryExpression(path.node.operator[0], UnaryExpression("+", arg.node), NumericLiteral(1))));
- } else {
- var old = path.scope.generateUidIdentifierBasedOnNode(arg.node, "old");
- var varName = old.name;
- path.scope.push({
- id: old
- });
- var binary = BinaryExpression(path.node.operator[0], Identifier(varName), NumericLiteral(1));
- path.replaceWith(SequenceExpression([AssignmentExpression("=", Identifier(varName), UnaryExpression("+", arg.node)), AssignmentExpression("=", cloneNode(arg.node), binary), Identifier(varName)]));
- }
- }
- },
- AssignmentExpression: {
- exit: function exit(path) {
- var scope = this.scope,
- seen = this.seen,
- bindingNames = this.bindingNames;
- if (path.node.operator === "=") return;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- var left = path.get("left");
- if (!left.isIdentifier()) return;
- var localName = left.node.name;
- if (!bindingNames.has(localName)) return;
- if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
- return;
- }
- path.node.right = BinaryExpression(path.node.operator.slice(0, -1), cloneNode(path.node.left), path.node.right);
- path.node.operator = "=";
- }
- }
- };
- function _templateObject$7() {
- var data = _taggedTemplateLiteralLoose(["\n (function() {\n throw new Error('\"' + '", "' + '\" is read-only.');\n })()\n "]);
- _templateObject$7 = function _templateObject() {
- return data;
- };
- return data;
- }
- function rewriteLiveReferences(programPath, metadata) {
- var imported = new Map();
- var exported = new Map();
- var requeueInParent = function requeueInParent(path) {
- programPath.requeue(path);
- };
- for (var _iterator = metadata.source, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _ref4 = _ref,
- source = _ref4[0],
- data = _ref4[1];
- for (var _iterator3 = data.imports, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref5 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref5 = _i3.value;
- }
- var _ref7 = _ref5,
- localName = _ref7[0],
- importName = _ref7[1];
- imported.set(localName, [source, importName, null]);
- }
- for (var _iterator4 = data.importsNamespace, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref6 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref6 = _i4.value;
- }
- var _localName = _ref6;
- imported.set(_localName, [source, null, _localName]);
- }
- }
- for (var _iterator2 = metadata.local, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _exportMeta;
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _ref8 = _ref2,
- local = _ref8[0],
- _data = _ref8[1];
- var exportMeta = exported.get(local);
- if (!exportMeta) {
- exportMeta = [];
- exported.set(local, exportMeta);
- }
- (_exportMeta = exportMeta).push.apply(_exportMeta, _data.names);
- }
- programPath.traverse(rewriteBindingInitVisitor, {
- metadata: metadata,
- requeueInParent: requeueInParent,
- scope: programPath.scope,
- exported: exported
- });
- simplifyAccess(programPath, new Set([].concat(Array.from(imported.keys()), Array.from(exported.keys()))));
- programPath.traverse(rewriteReferencesVisitor, {
- seen: new WeakSet(),
- metadata: metadata,
- requeueInParent: requeueInParent,
- scope: programPath.scope,
- imported: imported,
- exported: exported,
- buildImportReference: function buildImportReference(_ref3, identNode) {
- var source = _ref3[0],
- importName = _ref3[1],
- localName = _ref3[2];
- var meta = metadata.source.get(source);
- if (localName) {
- if (meta.lazy) identNode = CallExpression(identNode, []);
- return identNode;
- }
- var namespace = Identifier(meta.name);
- if (meta.lazy) namespace = CallExpression(namespace, []);
- return MemberExpression(namespace, Identifier(importName));
- }
- });
- }
- var rewriteBindingInitVisitor = {
- Scope: function Scope(path) {
- path.skip();
- },
- ClassDeclaration: function ClassDeclaration(path) {
- var requeueInParent = this.requeueInParent,
- exported = this.exported,
- metadata = this.metadata;
- var id = path.node.id;
- if (!id) throw new Error("Expected class to have a name");
- var localName = id.name;
- var exportNames = exported.get(localName) || [];
- if (exportNames.length > 0) {
- var statement = ExpressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, Identifier(localName)));
- statement._blockHoist = path.node._blockHoist;
- requeueInParent(path.insertAfter(statement)[0]);
- }
- },
- VariableDeclaration: function VariableDeclaration(path) {
- var requeueInParent = this.requeueInParent,
- exported = this.exported,
- metadata = this.metadata;
- Object.keys(path.getOuterBindingIdentifiers()).forEach(function (localName) {
- var exportNames = exported.get(localName) || [];
- if (exportNames.length > 0) {
- var statement = ExpressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, Identifier(localName)));
- statement._blockHoist = path.node._blockHoist;
- requeueInParent(path.insertAfter(statement)[0]);
- }
- });
- }
- };
- var buildBindingExportAssignmentExpression = function buildBindingExportAssignmentExpression(metadata, exportNames, localExpr) {
- return (exportNames || []).reduce(function (expr, exportName) {
- return AssignmentExpression("=", MemberExpression(Identifier(metadata.exportName), Identifier(exportName)), expr);
- }, localExpr);
- };
- var buildImportThrow = function buildImportThrow(localName) {
- return template.expression.ast(_templateObject$7(), localName);
- };
- var rewriteReferencesVisitor = {
- ReferencedIdentifier: function ReferencedIdentifier(path) {
- var seen = this.seen,
- buildImportReference = this.buildImportReference,
- scope = this.scope,
- imported = this.imported,
- requeueInParent = this.requeueInParent;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- var localName = path.node.name;
- var localBinding = path.scope.getBinding(localName);
- var rootBinding = scope.getBinding(localName);
- if (rootBinding !== localBinding) return;
- var importData = imported.get(localName);
- if (importData) {
- var ref = buildImportReference(importData, path.node);
- ref.loc = path.node.loc;
- if ((path.parentPath.isCallExpression({
- callee: path.node
- }) || path.parentPath.isOptionalCallExpression({
- callee: path.node
- }) || path.parentPath.isTaggedTemplateExpression({
- tag: path.node
- })) && isMemberExpression(ref)) {
- path.replaceWith(SequenceExpression([NumericLiteral(0), ref]));
- } else if (path.isJSXIdentifier() && isMemberExpression(ref)) {
- var object = ref.object,
- property = ref.property;
- path.replaceWith(JSXMemberExpression(JSXIdentifier(object.name), JSXIdentifier(property.name)));
- } else {
- path.replaceWith(ref);
- }
- requeueInParent(path);
- path.skip();
- }
- },
- AssignmentExpression: {
- exit: function exit(path) {
- var _this = this;
- var scope = this.scope,
- seen = this.seen,
- imported = this.imported,
- exported = this.exported,
- requeueInParent = this.requeueInParent,
- buildImportReference = this.buildImportReference;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- var left = path.get("left");
- if (left.isMemberExpression()) return;
- if (left.isIdentifier()) {
- var localName = left.node.name;
- if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
- return;
- }
- var exportedNames = exported.get(localName);
- var importData = imported.get(localName);
- if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
- assert$2(path.node.operator === "=", "Path was not simplified");
- var assignment = path.node;
- if (importData) {
- assignment.left = buildImportReference(importData, assignment.left);
- assignment.right = SequenceExpression([assignment.right, buildImportThrow(localName)]);
- }
- path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, assignment));
- requeueInParent(path);
- }
- } else {
- var ids = left.getOuterBindingIdentifiers();
- var programScopeIds = Object.keys(ids).filter(function (localName) {
- return scope.getBinding(localName) === path.scope.getBinding(localName);
- });
- var id = programScopeIds.find(function (localName) {
- return imported.has(localName);
- });
- if (id) {
- path.node.right = SequenceExpression([path.node.right, buildImportThrow(id)]);
- }
- var items = [];
- programScopeIds.forEach(function (localName) {
- var exportedNames = exported.get(localName) || [];
- if (exportedNames.length > 0) {
- items.push(buildBindingExportAssignmentExpression(_this.metadata, exportedNames, Identifier(localName)));
- }
- });
- if (items.length > 0) {
- var node = SequenceExpression(items);
- if (path.parentPath.isExpressionStatement()) {
- node = ExpressionStatement(node);
- node._blockHoist = path.parentPath.node._blockHoist;
- }
- var statement = path.insertAfter(node)[0];
- requeueInParent(statement);
- }
- }
- }
- }
- };
- function hasExports(metadata) {
- return metadata.hasExports;
- }
- function isSideEffectImport(source) {
- return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
- }
- function normalizeModuleAndLoadMetadata(programPath, exportName, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$noInterop = _ref.noInterop,
- noInterop = _ref$noInterop === void 0 ? false : _ref$noInterop,
- _ref$loose = _ref.loose,
- loose = _ref$loose === void 0 ? false : _ref$loose,
- _ref$lazy = _ref.lazy,
- lazy = _ref$lazy === void 0 ? false : _ref$lazy,
- _ref$esNamespaceOnly = _ref.esNamespaceOnly,
- esNamespaceOnly = _ref$esNamespaceOnly === void 0 ? false : _ref$esNamespaceOnly;
- if (!exportName) {
- exportName = programPath.scope.generateUidIdentifier("exports").name;
- }
- nameAnonymousExports(programPath);
- var _getModuleMetadata = getModuleMetadata(programPath, {
- loose: loose,
- lazy: lazy
- }),
- local = _getModuleMetadata.local,
- source = _getModuleMetadata.source,
- hasExports = _getModuleMetadata.hasExports;
- removeModuleDeclarations(programPath);
- for (var _iterator = source, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var _ref3 = _ref2,
- metadata = _ref3[1];
- if (metadata.importsNamespace.size > 0) {
- metadata.name = metadata.importsNamespace.values().next().value;
- }
- if (noInterop) metadata.interop = "none";else if (esNamespaceOnly) {
- if (metadata.interop === "namespace") {
- metadata.interop = "default";
- }
- }
- }
- return {
- exportName: exportName,
- exportNameListName: null,
- hasExports: hasExports,
- local: local,
- source: source
- };
- }
- function getModuleMetadata(programPath, _ref4) {
- var loose = _ref4.loose,
- lazy = _ref4.lazy;
- var localData = getLocalExportMetadata(programPath, loose);
- var sourceData = new Map();
- var getData = function getData(sourceNode) {
- var source = sourceNode.value;
- var data = sourceData.get(source);
- if (!data) {
- data = {
- name: programPath.scope.generateUidIdentifier(basename(source, extname(source))).name,
- interop: "none",
- loc: null,
- imports: new Map(),
- importsNamespace: new Set(),
- reexports: new Map(),
- reexportNamespace: new Set(),
- reexportAll: null,
- lazy: false
- };
- sourceData.set(source, data);
- }
- return data;
- };
- var hasExports = false;
- programPath.get("body").forEach(function (child) {
- if (child.isImportDeclaration()) {
- var data = getData(child.node.source);
- if (!data.loc) data.loc = child.node.loc;
- child.get("specifiers").forEach(function (spec) {
- if (spec.isImportDefaultSpecifier()) {
- var localName = spec.get("local").node.name;
- data.imports.set(localName, "default");
- var reexport = localData.get(localName);
- if (reexport) {
- localData["delete"](localName);
- reexport.names.forEach(function (name) {
- data.reexports.set(name, "default");
- });
- }
- } else if (spec.isImportNamespaceSpecifier()) {
- var _localName = spec.get("local").node.name;
- data.importsNamespace.add(_localName);
- var _reexport = localData.get(_localName);
- if (_reexport) {
- localData["delete"](_localName);
- _reexport.names.forEach(function (name) {
- data.reexportNamespace.add(name);
- });
- }
- } else if (spec.isImportSpecifier()) {
- var importName = spec.get("imported").node.name;
- var _localName2 = spec.get("local").node.name;
- data.imports.set(_localName2, importName);
- var _reexport2 = localData.get(_localName2);
- if (_reexport2) {
- localData["delete"](_localName2);
- _reexport2.names.forEach(function (name) {
- data.reexports.set(name, importName);
- });
- }
- }
- });
- } else if (child.isExportAllDeclaration()) {
- hasExports = true;
- var _data = getData(child.node.source);
- if (!_data.loc) _data.loc = child.node.loc;
- _data.reexportAll = {
- loc: child.node.loc
- };
- } else if (child.isExportNamedDeclaration() && child.node.source) {
- hasExports = true;
- var _data2 = getData(child.node.source);
- if (!_data2.loc) _data2.loc = child.node.loc;
- child.get("specifiers").forEach(function (spec) {
- if (!spec.isExportSpecifier()) {
- throw spec.buildCodeFrameError("Unexpected export specifier type");
- }
- var importName = spec.get("local").node.name;
- var exportName = spec.get("exported").node.name;
- _data2.reexports.set(exportName, importName);
- if (exportName === "__esModule") {
- throw exportName.buildCodeFrameError('Illegal export "__esModule".');
- }
- });
- } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
- hasExports = true;
- }
- });
- for (var _iterator2 = sourceData.values(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref5 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref5 = _i2.value;
- }
- var metadata = _ref5;
- var needsDefault = false;
- var needsNamed = false;
- if (metadata.importsNamespace.size > 0) {
- needsDefault = true;
- needsNamed = true;
- }
- if (metadata.reexportAll) {
- needsNamed = true;
- }
- for (var _iterator4 = metadata.imports.values(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref7;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref7 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref7 = _i4.value;
- }
- var importName = _ref7;
- if (importName === "default") needsDefault = true;else needsNamed = true;
- }
- for (var _iterator5 = metadata.reexports.values(), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref8;
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref8 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref8 = _i5.value;
- }
- var _importName = _ref8;
- if (_importName === "default") needsDefault = true;else needsNamed = true;
- }
- if (needsDefault && needsNamed) {
- metadata.interop = "namespace";
- } else if (needsDefault) {
- metadata.interop = "default";
- }
- }
- for (var _iterator3 = sourceData, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref6 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref6 = _i3.value;
- }
- var _ref9 = _ref6,
- source = _ref9[0],
- _metadata = _ref9[1];
- if (lazy !== false && !(isSideEffectImport(_metadata) || _metadata.reexportAll)) {
- if (lazy === true) {
- _metadata.lazy = !/\./.test(source);
- } else if (Array.isArray(lazy)) {
- _metadata.lazy = lazy.indexOf(source) !== -1;
- } else if (typeof lazy === "function") {
- _metadata.lazy = lazy(source);
- } else {
- throw new Error(".lazy must be a boolean, string array, or function");
- }
- }
- }
- return {
- hasExports: hasExports,
- local: localData,
- source: sourceData
- };
- }
- function getLocalExportMetadata(programPath, loose) {
- var bindingKindLookup = new Map();
- programPath.get("body").forEach(function (child) {
- var kind;
- if (child.isImportDeclaration()) {
- kind = "import";
- } else {
- if (child.isExportDefaultDeclaration()) child = child.get("declaration");
- if (child.isExportNamedDeclaration()) {
- if (child.node.declaration) {
- child = child.get("declaration");
- } else if (loose && child.node.source && child.get("source").isStringLiteral()) {
- child.node.specifiers.forEach(function (specifier) {
- bindingKindLookup.set(specifier.local.name, "block");
- });
- return;
- }
- }
- if (child.isFunctionDeclaration()) {
- kind = "hoisted";
- } else if (child.isClassDeclaration()) {
- kind = "block";
- } else if (child.isVariableDeclaration({
- kind: "var"
- })) {
- kind = "var";
- } else if (child.isVariableDeclaration()) {
- kind = "block";
- } else {
- return;
- }
- }
- Object.keys(child.getOuterBindingIdentifiers()).forEach(function (name) {
- bindingKindLookup.set(name, kind);
- });
- });
- var localMetadata = new Map();
- var getLocalMetadata = function getLocalMetadata(idPath) {
- var localName = idPath.node.name;
- var metadata = localMetadata.get(localName);
- if (!metadata) {
- var kind = bindingKindLookup.get(localName);
- if (kind === undefined) {
- throw idPath.buildCodeFrameError("Exporting local \"" + localName + "\", which is not declared.");
- }
- metadata = {
- names: [],
- kind: kind
- };
- localMetadata.set(localName, metadata);
- }
- return metadata;
- };
- programPath.get("body").forEach(function (child) {
- if (child.isExportNamedDeclaration() && (loose || !child.node.source)) {
- if (child.node.declaration) {
- var declaration = child.get("declaration");
- var ids = declaration.getOuterBindingIdentifierPaths();
- Object.keys(ids).forEach(function (name) {
- if (name === "__esModule") {
- throw declaration.buildCodeFrameError('Illegal export "__esModule".');
- }
- getLocalMetadata(ids[name]).names.push(name);
- });
- } else {
- child.get("specifiers").forEach(function (spec) {
- var local = spec.get("local");
- var exported = spec.get("exported");
- if (exported.node.name === "__esModule") {
- throw exported.buildCodeFrameError('Illegal export "__esModule".');
- }
- getLocalMetadata(local).names.push(exported.node.name);
- });
- }
- } else if (child.isExportDefaultDeclaration()) {
- var _declaration = child.get("declaration");
- if (_declaration.isFunctionDeclaration() || _declaration.isClassDeclaration()) {
- getLocalMetadata(_declaration.get("id")).names.push("default");
- } else {
- throw _declaration.buildCodeFrameError("Unexpected default expression export.");
- }
- }
- });
- return localMetadata;
- }
- function nameAnonymousExports(programPath) {
- programPath.get("body").forEach(function (child) {
- if (!child.isExportDefaultDeclaration()) return;
- splitExportDeclaration(child);
- });
- }
- function removeModuleDeclarations(programPath) {
- programPath.get("body").forEach(function (child) {
- if (child.isImportDeclaration()) {
- child.remove();
- } else if (child.isExportNamedDeclaration()) {
- if (child.node.declaration) {
- child.node.declaration._blockHoist = child.node._blockHoist;
- child.replaceWith(child.node.declaration);
- } else {
- child.remove();
- }
- } else if (child.isExportDefaultDeclaration()) {
- var declaration = child.get("declaration");
- if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
- declaration._blockHoist = child.node._blockHoist;
- child.replaceWith(declaration);
- } else {
- throw declaration.buildCodeFrameError("Unexpected default expression export.");
- }
- } else if (child.isExportAllDeclaration()) {
- child.remove();
- }
- });
- }
- function _templateObject11$2() {
- var data = _taggedTemplateLiteralLoose(["EXPORTS.NAME = VALUE"]);
- _templateObject11$2 = function _templateObject11() {
- return data;
- };
- return data;
- }
- function _templateObject10$2() {
- var data = _taggedTemplateLiteralLoose(["\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n "]);
- _templateObject10$2 = function _templateObject10() {
- return data;
- };
- return data;
- }
- function _templateObject9$2() {
- var data = _taggedTemplateLiteralLoose(["\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n "]);
- _templateObject9$2 = function _templateObject9() {
- return data;
- };
- return data;
- }
- function _templateObject8$2() {
- var data = _taggedTemplateLiteralLoose(["\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n "]);
- _templateObject8$2 = function _templateObject8() {
- return data;
- };
- return data;
- }
- function _templateObject7$2() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n "]);
- _templateObject7$2 = function _templateObject7() {
- return data;
- };
- return data;
- }
- function _templateObject6$2() {
- var data = _taggedTemplateLiteralLoose(["\n EXPORTS.__esModule = true;\n "]);
- _templateObject6$2 = function _templateObject6() {
- return data;
- };
- return data;
- }
- function _templateObject5$2() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"EXPORT_NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE.IMPORT_NAME;\n },\n });\n "]);
- _templateObject5$2 = function _templateObject5() {
- return data;
- };
- return data;
- }
- function _templateObject4$3() {
- var data = _taggedTemplateLiteralLoose(["EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;"]);
- _templateObject4$3 = function _templateObject4() {
- return data;
- };
- return data;
- }
- function _templateObject3$3() {
- var data = _taggedTemplateLiteralLoose(["EXPORTS.NAME = NAMESPACE;"]);
- _templateObject3$3 = function _templateObject3() {
- return data;
- };
- return data;
- }
- function _templateObject2$3() {
- var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n "]);
- _templateObject2$3 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject$8() {
- var data = _taggedTemplateLiteralLoose(["var NAME = SOURCE;"]);
- _templateObject$8 = function _templateObject() {
- return data;
- };
- return data;
- }
- function rewriteModuleStatementsAndPrepareHeader(path, _ref) {
- var exportName = _ref.exportName,
- strict = _ref.strict,
- allowTopLevelThis = _ref.allowTopLevelThis,
- strictMode = _ref.strictMode,
- loose = _ref.loose,
- noInterop = _ref.noInterop,
- lazy = _ref.lazy,
- esNamespaceOnly = _ref.esNamespaceOnly;
- assert$2(isModule(path), "Cannot process module statements in a script");
- path.node.sourceType = "script";
- var meta = normalizeModuleAndLoadMetadata(path, exportName, {
- noInterop: noInterop,
- loose: loose,
- lazy: lazy,
- esNamespaceOnly: esNamespaceOnly
- });
- if (!allowTopLevelThis) {
- rewriteThis(path);
- }
- rewriteLiveReferences(path, meta);
- if (strictMode !== false) {
- var hasStrict = path.node.directives.some(function (directive) {
- return directive.value.value === "use strict";
- });
- if (!hasStrict) {
- path.unshiftContainer("directives", Directive(DirectiveLiteral("use strict")));
- }
- }
- var headers = [];
- if (hasExports(meta) && !strict) {
- headers.push(buildESModuleHeader(meta, loose));
- }
- var nameList = buildExportNameListDeclaration(path, meta);
- if (nameList) {
- meta.exportNameListName = nameList.name;
- headers.push(nameList.statement);
- }
- headers.push.apply(headers, buildExportInitializationStatements(path, meta, loose));
- return {
- meta: meta,
- headers: headers
- };
- }
- function ensureStatementsHoisted(statements) {
- statements.forEach(function (header) {
- header._blockHoist = 3;
- });
- }
- function wrapInterop(programPath, expr, type) {
- if (type === "none") {
- return null;
- }
- var helper;
- if (type === "default") {
- helper = "interopRequireDefault";
- } else if (type === "namespace") {
- helper = "interopRequireWildcard";
- } else {
- throw new Error("Unknown interop: " + type);
- }
- return CallExpression(programPath.hub.addHelper(helper), [expr]);
- }
- function buildNamespaceInitStatements(metadata, sourceMetadata, loose) {
- if (loose === void 0) {
- loose = false;
- }
- var statements = [];
- var srcNamespace = Identifier(sourceMetadata.name);
- if (sourceMetadata.lazy) srcNamespace = CallExpression(srcNamespace, []);
- for (var _iterator = sourceMetadata.importsNamespace, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var localName = _ref2;
- if (localName === sourceMetadata.name) continue;
- statements.push(template.statement(_templateObject$8())({
- NAME: localName,
- SOURCE: cloneNode(srcNamespace)
- }));
- }
- if (loose) {
- statements.push.apply(statements, buildReexportsFromMeta(metadata, sourceMetadata, loose));
- }
- for (var _iterator2 = sourceMetadata.reexportNamespace, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref3 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref3 = _i2.value;
- }
- var exportName = _ref3;
- statements.push((sourceMetadata.lazy ? template.statement(_templateObject2$3()) : template.statement(_templateObject3$3()))({
- EXPORTS: metadata.exportName,
- NAME: exportName,
- NAMESPACE: cloneNode(srcNamespace)
- }));
- }
- if (sourceMetadata.reexportAll) {
- var statement = buildNamespaceReexport(metadata, cloneNode(srcNamespace), loose);
- statement.loc = sourceMetadata.reexportAll.loc;
- statements.push(statement);
- }
- return statements;
- }
- var getTemplateForReexport = function getTemplateForReexport(loose) {
- return loose ? template.statement(_templateObject4$3()) : template(_templateObject5$2());
- };
- var buildReexportsFromMeta = function buildReexportsFromMeta(meta, metadata, loose) {
- var namespace = metadata.lazy ? CallExpression(Identifier(metadata.name), []) : Identifier(metadata.name);
- var templateForCurrentMode = getTemplateForReexport(loose);
- return Array.from(metadata.reexports, function (_ref4) {
- var exportName = _ref4[0],
- importName = _ref4[1];
- return templateForCurrentMode({
- EXPORTS: meta.exportName,
- EXPORT_NAME: exportName,
- NAMESPACE: cloneNode(namespace),
- IMPORT_NAME: importName
- });
- });
- };
- function buildESModuleHeader(metadata, enumerable) {
- if (enumerable === void 0) {
- enumerable = false;
- }
- return (enumerable ? template.statement(_templateObject6$2()) : template.statement(_templateObject7$2()))({
- EXPORTS: metadata.exportName
- });
- }
- function buildNamespaceReexport(metadata, namespace, loose) {
- return (loose ? template.statement(_templateObject8$2()) : template.statement(_templateObject9$2()))({
- NAMESPACE: namespace,
- EXPORTS: metadata.exportName,
- VERIFY_NAME_LIST: metadata.exportNameListName ? template(_templateObject10$2())({
- EXPORTS_LIST: metadata.exportNameListName
- }) : null
- });
- }
- function buildExportNameListDeclaration(programPath, metadata) {
- var exportedVars = Object.create(null);
- for (var _iterator3 = metadata.local.values(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref5 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref5 = _i3.value;
- }
- var data = _ref5;
- for (var _iterator5 = data.names, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref7;
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref7 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref7 = _i5.value;
- }
- var _name = _ref7;
- exportedVars[_name] = true;
- }
- }
- var hasReexport = false;
- for (var _iterator4 = metadata.source.values(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref6 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref6 = _i4.value;
- }
- var _data = _ref6;
- for (var _iterator6 = _data.reexports.keys(), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref8;
- if (_isArray6) {
- if (_i6 >= _iterator6.length) break;
- _ref8 = _iterator6[_i6++];
- } else {
- _i6 = _iterator6.next();
- if (_i6.done) break;
- _ref8 = _i6.value;
- }
- var exportName = _ref8;
- exportedVars[exportName] = true;
- }
- for (var _iterator7 = _data.reexportNamespace, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
- var _ref9;
- if (_isArray7) {
- if (_i7 >= _iterator7.length) break;
- _ref9 = _iterator7[_i7++];
- } else {
- _i7 = _iterator7.next();
- if (_i7.done) break;
- _ref9 = _i7.value;
- }
- var _exportName = _ref9;
- exportedVars[_exportName] = true;
- }
- hasReexport = hasReexport || _data.reexportAll;
- }
- if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
- var name = programPath.scope.generateUidIdentifier("exportNames");
- delete exportedVars["default"];
- return {
- name: name.name,
- statement: VariableDeclaration("var", [VariableDeclarator(name, valueToNode(exportedVars))])
- };
- }
- function buildExportInitializationStatements(programPath, metadata, loose) {
- if (loose === void 0) {
- loose = false;
- }
- var initStatements = [];
- var exportNames = [];
- for (var _iterator8 = metadata.local, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
- var _ref10;
- if (_isArray8) {
- if (_i8 >= _iterator8.length) break;
- _ref10 = _iterator8[_i8++];
- } else {
- _i8 = _iterator8.next();
- if (_i8.done) break;
- _ref10 = _i8.value;
- }
- var _ref12 = _ref10,
- localName = _ref12[0],
- data = _ref12[1];
- if (data.kind === "import") ; else if (data.kind === "hoisted") {
- initStatements.push(buildInitStatement(metadata, data.names, Identifier(localName)));
- } else {
- exportNames.push.apply(exportNames, data.names);
- }
- }
- for (var _iterator9 = metadata.source.values(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
- var _ref11;
- if (_isArray9) {
- if (_i9 >= _iterator9.length) break;
- _ref11 = _iterator9[_i9++];
- } else {
- _i9 = _iterator9.next();
- if (_i9.done) break;
- _ref11 = _i9.value;
- }
- var _data2 = _ref11;
- if (!loose) {
- initStatements.push.apply(initStatements, buildReexportsFromMeta(metadata, _data2, loose));
- }
- for (var _iterator10 = _data2.reexportNamespace, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
- var _ref13;
- if (_isArray10) {
- if (_i10 >= _iterator10.length) break;
- _ref13 = _iterator10[_i10++];
- } else {
- _i10 = _iterator10.next();
- if (_i10.done) break;
- _ref13 = _i10.value;
- }
- var exportName = _ref13;
- exportNames.push(exportName);
- }
- }
- initStatements.push.apply(initStatements, chunk_1(exportNames, 100).map(function (members) {
- return buildInitStatement(metadata, members, programPath.scope.buildUndefinedNode());
- }));
- return initStatements;
- }
- function buildInitStatement(metadata, exportNames, initExpr) {
- return ExpressionStatement(exportNames.reduce(function (acc, exportName) {
- return template.expression(_templateObject11$2())({
- EXPORTS: metadata.exportName,
- NAME: exportName,
- VALUE: acc
- });
- }, initExpr));
- }
- var utils$1 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.getImportSource = getImportSource;
- exports.createDynamicImportTransform = createDynamicImportTransform;
- function _slicedToArray(arr, i) {
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
- }
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
- }
- function _iterableToArrayLimit(arr, i) {
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
- }
- function getImportSource(t, callNode) {
- var importArguments = callNode.arguments;
- var _importArguments = _slicedToArray(importArguments, 1),
- importPath = _importArguments[0];
- var isString = t.isStringLiteral(importPath) || t.isTemplateLiteral(importPath);
- if (isString) {
- t.removeComments(importPath);
- return importPath;
- }
- return t.templateLiteral([t.templateElement({
- raw: '',
- cooked: ''
- }), t.templateElement({
- raw: '',
- cooked: ''
- }, true)], importArguments);
- }
- function createDynamicImportTransform(_ref) {
- var template = _ref.template,
- t = _ref.types;
- var buildImport = template('Promise.resolve().then(() => MODULE)');
- return function (context, path) {
- var requireCall = t.callExpression(t.identifier('require'), [getImportSource(t, path.parent)]);
- var _context$opts$noInter = context.opts.noInterop,
- noInterop = _context$opts$noInter === undefined ? false : _context$opts$noInter;
- var MODULE = noInterop === true ? requireCall : t.callExpression(context.addHelper('interopRequireWildcard'), [requireCall]);
- var newImport = buildImport({
- MODULE: MODULE
- });
- path.parentPath.replaceWith(newImport);
- };
- }
- });
- unwrapExports(utils$1);
- var utils_1$1 = utils$1.getImportSource;
- var utils_2$1 = utils$1.createDynamicImportTransform;
- var utils$2 = utils$1;
- var utils_1$2 = utils$2.createDynamicImportTransform;
- var utils_2$2 = utils$2.getImportSource;
- function _templateObject$9() {
- var data = _taggedTemplateLiteralLoose(["\n new Promise((", ", ", ") =>\n ", "(\n [", "],\n imported => ", "(", "),\n ", "\n )\n )"]);
- _templateObject$9 = function _templateObject() {
- return data;
- };
- return data;
- }
- var buildWrapper = template("\n define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {\n })\n");
- var buildAnonymousWrapper = template("\n define([\"require\"], function(REQUIRE) {\n })\n");
- function injectWrapper(path, wrapper) {
- var _path$node = path.node,
- body = _path$node.body,
- directives = _path$node.directives;
- path.node.directives = [];
- path.node.body = [];
- var amdWrapper = path.pushContainer("body", wrapper)[0];
- var amdFactory = amdWrapper.get("expression.arguments").filter(function (arg) {
- return arg.isFunctionExpression();
- })[0].get("body");
- amdFactory.pushContainer("directives", directives);
- amdFactory.pushContainer("body", body);
- }
- var transformModulesAmd = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose,
- allowTopLevelThis = options.allowTopLevelThis,
- strict = options.strict,
- strictMode = options.strictMode,
- noInterop = options.noInterop;
- return {
- name: "transform-modules-amd",
- pre: function pre() {
- this.file.set("@babel/plugin-transform-modules-*", "amd");
- },
- visitor: {
- CallExpression: function CallExpression(path, state) {
- if (!this.file.has("@babel/plugin-proposal-dynamic-import")) return;
- if (!path.get("callee").isImport()) return;
- var requireId = state.requireId,
- resolveId = state.resolveId,
- rejectId = state.rejectId;
- if (!requireId) {
- requireId = path.scope.generateUidIdentifier("require");
- state.requireId = requireId;
- }
- if (!resolveId || !rejectId) {
- resolveId = path.scope.generateUidIdentifier("resolve");
- rejectId = path.scope.generateUidIdentifier("reject");
- state.resolveId = resolveId;
- state.rejectId = rejectId;
- }
- var result = Identifier("imported");
- if (!noInterop) result = wrapInterop(path, result, "namespace");
- path.replaceWith(template.expression.ast(_templateObject$9(), resolveId, rejectId, requireId, utils_2$2(t, path.node), resolveId, result, rejectId));
- },
- Program: {
- exit: function exit(path, _ref) {
- var requireId = _ref.requireId;
- if (!isModule(path)) {
- if (requireId) {
- injectWrapper(path, buildAnonymousWrapper({
- REQUIRE: requireId
- }));
- }
- return;
- }
- var amdArgs = [];
- var importNames = [];
- if (requireId) {
- amdArgs.push(StringLiteral("require"));
- importNames.push(requireId);
- }
- var moduleName = this.getModuleName();
- if (moduleName) moduleName = StringLiteral(moduleName);
- var _rewriteModuleStateme = rewriteModuleStatementsAndPrepareHeader(path, {
- loose: loose,
- strict: strict,
- strictMode: strictMode,
- allowTopLevelThis: allowTopLevelThis,
- noInterop: noInterop
- }),
- meta = _rewriteModuleStateme.meta,
- headers = _rewriteModuleStateme.headers;
- if (hasExports(meta)) {
- amdArgs.push(StringLiteral("exports"));
- importNames.push(Identifier(meta.exportName));
- }
- for (var _iterator = meta.source, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var _ref3 = _ref2,
- source = _ref3[0],
- metadata = _ref3[1];
- amdArgs.push(StringLiteral(source));
- importNames.push(Identifier(metadata.name));
- if (!isSideEffectImport(metadata)) {
- var interop = wrapInterop(path, Identifier(metadata.name), metadata.interop);
- if (interop) {
- var header = ExpressionStatement(AssignmentExpression("=", Identifier(metadata.name), interop));
- header.loc = metadata.loc;
- headers.push(header);
- }
- }
- headers.push.apply(headers, buildNamespaceInitStatements(meta, metadata, loose));
- }
- ensureStatementsHoisted(headers);
- path.unshiftContainer("body", headers);
- injectWrapper(path, buildWrapper({
- MODULE_NAME: moduleName,
- AMD_ARGUMENTS: ArrayExpression(amdArgs),
- IMPORT_NAMES: importNames
- }));
- }
- }
- }
- };
- });
- function _templateObject3$4() {
- var data = _taggedTemplateLiteralLoose(["\n var ", " = ", ";\n "]);
- _templateObject3$4 = function _templateObject3() {
- return data;
- };
- return data;
- }
- function _templateObject2$4() {
- var data = _taggedTemplateLiteralLoose(["\n function ", "() {\n const data = ", ";\n ", " = function(){ return data; };\n return data;\n }\n "]);
- _templateObject2$4 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject$a() {
- var data = _taggedTemplateLiteralLoose(["\n (function(){\n throw new Error(\n \"The CommonJS '\" + \"", "\" + \"' variable is not available in ES6 modules.\" +\n \"Consider setting setting sourceType:script or sourceType:unambiguous in your \" +\n \"Babel config for this file.\");\n })()\n "]);
- _templateObject$a = function _templateObject() {
- return data;
- };
- return data;
- }
- var transformModulesCommonjs = declare(function (api, options) {
- api.assertVersion(7);
- var transformImportCall = utils_1$2(api);
- var loose = options.loose,
- _options$strictNamesp = options.strictNamespace,
- strictNamespace = _options$strictNamesp === void 0 ? false : _options$strictNamesp,
- _options$mjsStrictNam = options.mjsStrictNamespace,
- mjsStrictNamespace = _options$mjsStrictNam === void 0 ? true : _options$mjsStrictNam,
- allowTopLevelThis = options.allowTopLevelThis,
- strict = options.strict,
- strictMode = options.strictMode,
- noInterop = options.noInterop,
- _options$lazy = options.lazy,
- lazy = _options$lazy === void 0 ? false : _options$lazy,
- _options$allowCommonJ = options.allowCommonJSExports,
- allowCommonJSExports = _options$allowCommonJ === void 0 ? true : _options$allowCommonJ;
- if (typeof lazy !== "boolean" && typeof lazy !== "function" && (!Array.isArray(lazy) || !lazy.every(function (item) {
- return typeof item === "string";
- }))) {
- throw new Error(".lazy must be a boolean, array of strings, or a function");
- }
- if (typeof strictNamespace !== "boolean") {
- throw new Error(".strictNamespace must be a boolean, or undefined");
- }
- if (typeof mjsStrictNamespace !== "boolean") {
- throw new Error(".mjsStrictNamespace must be a boolean, or undefined");
- }
- var getAssertion = function getAssertion(localName) {
- return template.expression.ast(_templateObject$a(), localName);
- };
- var moduleExportsVisitor = {
- ReferencedIdentifier: function ReferencedIdentifier(path) {
- var localName = path.node.name;
- if (localName !== "module" && localName !== "exports") return;
- var localBinding = path.scope.getBinding(localName);
- var rootBinding = this.scope.getBinding(localName);
- if (rootBinding !== localBinding || path.parentPath.isObjectProperty({
- value: path.node
- }) && path.parentPath.parentPath.isObjectPattern() || path.parentPath.isAssignmentExpression({
- left: path.node
- }) || path.isAssignmentExpression({
- left: path.node
- })) {
- return;
- }
- path.replaceWith(getAssertion(localName));
- },
- AssignmentExpression: function AssignmentExpression(path) {
- var _this = this;
- var left = path.get("left");
- if (left.isIdentifier()) {
- var localName = path.node.name;
- if (localName !== "module" && localName !== "exports") return;
- var localBinding = path.scope.getBinding(localName);
- var rootBinding = this.scope.getBinding(localName);
- if (rootBinding !== localBinding) return;
- var right = path.get("right");
- right.replaceWith(SequenceExpression([right.node, getAssertion(localName)]));
- } else if (left.isPattern()) {
- var ids = left.getOuterBindingIdentifiers();
- var _localName = Object.keys(ids).filter(function (localName) {
- if (localName !== "module" && localName !== "exports") return false;
- return _this.scope.getBinding(localName) === path.scope.getBinding(localName);
- })[0];
- if (_localName) {
- var _right = path.get("right");
- _right.replaceWith(SequenceExpression([_right.node, getAssertion(_localName)]));
- }
- }
- }
- };
- return {
- name: "transform-modules-commonjs",
- pre: function pre() {
- this.file.set("@babel/plugin-transform-modules-*", "commonjs");
- },
- visitor: {
- CallExpression: function CallExpression(path) {
- if (!this.file.has("@babel/plugin-proposal-dynamic-import")) return;
- if (!path.get("callee").isImport()) return;
- var scope = path.scope;
- do {
- scope.rename("require");
- } while (scope = scope.parent);
- transformImportCall(this, path.get("callee"));
- },
- Program: {
- exit: function exit(path, state) {
- if (!isModule(path)) return;
- path.scope.rename("exports");
- path.scope.rename("module");
- path.scope.rename("require");
- path.scope.rename("__filename");
- path.scope.rename("__dirname");
- if (!allowCommonJSExports) {
- simplifyAccess(path, new Set(["module", "exports"]));
- path.traverse(moduleExportsVisitor, {
- scope: path.scope
- });
- }
- var moduleName = this.getModuleName();
- if (moduleName) moduleName = StringLiteral(moduleName);
- var _rewriteModuleStateme = rewriteModuleStatementsAndPrepareHeader(path, {
- exportName: "exports",
- loose: loose,
- strict: strict,
- strictMode: strictMode,
- allowTopLevelThis: allowTopLevelThis,
- noInterop: noInterop,
- lazy: lazy,
- esNamespaceOnly: typeof state.filename === "string" && /\.mjs$/.test(state.filename) ? mjsStrictNamespace : strictNamespace
- }),
- meta = _rewriteModuleStateme.meta,
- headers = _rewriteModuleStateme.headers;
- for (var _iterator = meta.source, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _ref2 = _ref,
- source = _ref2[0],
- metadata = _ref2[1];
- var loadExpr = CallExpression(Identifier("require"), [StringLiteral(source)]);
- var header = void 0;
- if (isSideEffectImport(metadata)) {
- if (metadata.lazy) throw new Error("Assertion failure");
- header = ExpressionStatement(loadExpr);
- } else {
- var init = wrapInterop(path, loadExpr, metadata.interop) || loadExpr;
- if (metadata.lazy) {
- header = template.ast(_templateObject2$4(), metadata.name, init, metadata.name);
- } else {
- header = template.ast(_templateObject3$4(), metadata.name, init);
- }
- }
- header.loc = metadata.loc;
- headers.push(header);
- headers.push.apply(headers, buildNamespaceInitStatements(meta, metadata, loose));
- }
- ensureStatementsHoisted(headers);
- path.unshiftContainer("body", headers);
- }
- }
- }
- };
- });
- var visitor$3 = {
- Scope: function Scope(path, state) {
- if (state.kind === "let") path.skip();
- },
- Function: function Function(path) {
- path.skip();
- },
- VariableDeclaration: function VariableDeclaration(path, state) {
- if (state.kind && path.node.kind !== state.kind) return;
- var nodes = [];
- var declarations = path.get("declarations");
- var firstId;
- for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var declar = _ref;
- firstId = declar.node.id;
- if (declar.node.init) {
- nodes.push(ExpressionStatement(AssignmentExpression("=", declar.node.id, declar.node.init)));
- }
- for (var _i2 = 0, _Object$keys = Object.keys(declar.getBindingIdentifiers()); _i2 < _Object$keys.length; _i2++) {
- var name = _Object$keys[_i2];
- state.emit(Identifier(name), name, declar.node.init !== null);
- }
- }
- if (path.parentPath.isFor({
- left: path.node
- })) {
- path.replaceWith(firstId);
- } else {
- path.replaceWithMultiple(nodes);
- }
- }
- };
- function hoistVariables (path, emit, kind) {
- if (kind === void 0) {
- kind = "var";
- }
- path.traverse(visitor$3, {
- kind: kind,
- emit: emit
- });
- }
- var buildTemplate = template("\n SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: SETTERS,\n execute: function () {\n BODY;\n }\n };\n });\n");
- var buildExportAll = template("\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n");
- var MISSING_PLUGIN_WARNING = "WARNING: Dynamic import() transformation must be enabled using the\n @babel/plugin-proposal-dynamic-import plugin. Babel 8 will\n no longer transform import() without using that plugin.\n";
- function constructExportCall(path, exportIdent, exportNames, exportValues, exportStarTarget) {
- var statements = [];
- if (exportNames.length === 1) {
- statements.push(ExpressionStatement(CallExpression(exportIdent, [StringLiteral(exportNames[0]), exportValues[0]])));
- } else if (!exportStarTarget) {
- var objectProperties = [];
- for (var i = 0; i < exportNames.length; i++) {
- var exportName = exportNames[i];
- var exportValue = exportValues[i];
- objectProperties.push(ObjectProperty(Identifier(exportName), exportValue));
- }
- statements.push(ExpressionStatement(CallExpression(exportIdent, [ObjectExpression(objectProperties)])));
- } else {
- var exportObj = path.scope.generateUid("exportObj");
- statements.push(VariableDeclaration("var", [VariableDeclarator(Identifier(exportObj), ObjectExpression([]))]));
- statements.push(buildExportAll({
- KEY: path.scope.generateUidIdentifier("key"),
- EXPORT_OBJ: Identifier(exportObj),
- TARGET: exportStarTarget
- }));
- for (var _i = 0; _i < exportNames.length; _i++) {
- var _exportName = exportNames[_i];
- var _exportValue = exportValues[_i];
- statements.push(ExpressionStatement(AssignmentExpression("=", MemberExpression(Identifier(exportObj), Identifier(_exportName)), _exportValue)));
- }
- statements.push(ExpressionStatement(CallExpression(exportIdent, [Identifier(exportObj)])));
- }
- return statements;
- }
- var transformModulesSystemjs = declare(function (api, options) {
- api.assertVersion(7);
- var _options$systemGlobal = options.systemGlobal,
- systemGlobal = _options$systemGlobal === void 0 ? "System" : _options$systemGlobal,
- _options$allowTopLeve = options.allowTopLevelThis,
- allowTopLevelThis = _options$allowTopLeve === void 0 ? false : _options$allowTopLeve;
- var IGNORE_REASSIGNMENT_SYMBOL = Symbol();
- var reassignmentVisitor = {
- "AssignmentExpression|UpdateExpression": function AssignmentExpressionUpdateExpression(path) {
- if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;
- path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;
- var arg = path.get(path.isAssignmentExpression() ? "left" : "argument");
- if (arg.isObjectPattern() || arg.isArrayPattern()) {
- var exprs = [path.node];
- for (var _i2 = 0, _Object$keys = Object.keys(arg.getBindingIdentifiers()); _i2 < _Object$keys.length; _i2++) {
- var _name = _Object$keys[_i2];
- if (this.scope.getBinding(_name) !== path.scope.getBinding(_name)) {
- return;
- }
- var _exportedNames = this.exports[_name];
- if (!_exportedNames) return;
- for (var _iterator = _exportedNames, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i3 >= _iterator.length) break;
- _ref = _iterator[_i3++];
- } else {
- _i3 = _iterator.next();
- if (_i3.done) break;
- _ref = _i3.value;
- }
- var exportedName = _ref;
- exprs.push(this.buildCall(exportedName, Identifier(_name)).expression);
- }
- }
- path.replaceWith(SequenceExpression(exprs));
- return;
- }
- if (!arg.isIdentifier()) return;
- var name = arg.node.name;
- if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
- var exportedNames = this.exports[name];
- if (!exportedNames) return;
- var node = path.node;
- var isPostUpdateExpression = path.isUpdateExpression({
- prefix: false
- });
- if (isPostUpdateExpression) {
- node = BinaryExpression(node.operator[0], UnaryExpression("+", cloneNode(node.argument)), NumericLiteral(1));
- }
- for (var _iterator2 = exportedNames, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i4 >= _iterator2.length) break;
- _ref2 = _iterator2[_i4++];
- } else {
- _i4 = _iterator2.next();
- if (_i4.done) break;
- _ref2 = _i4.value;
- }
- var _exportedName = _ref2;
- node = this.buildCall(_exportedName, node).expression;
- }
- if (isPostUpdateExpression) {
- node = SequenceExpression([node, path.node]);
- }
- path.replaceWith(node);
- }
- };
- return {
- name: "transform-modules-systemjs",
- pre: function pre() {
- this.file.set("@babel/plugin-transform-modules-*", "systemjs");
- },
- visitor: {
- CallExpression: function CallExpression$1(path, state) {
- if (isImport(path.node.callee)) {
- if (!this.file.has("@babel/plugin-proposal-dynamic-import")) {
- console.warn(MISSING_PLUGIN_WARNING);
- }
- path.replaceWith(CallExpression(MemberExpression(Identifier(state.contextIdent), Identifier("import")), [utils_2$2(t, path.node)]));
- }
- },
- MetaProperty: function MetaProperty(path, state) {
- if (path.node.meta.name === "import" && path.node.property.name === "meta") {
- path.replaceWith(MemberExpression(Identifier(state.contextIdent), Identifier("meta")));
- }
- },
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- if (path.node.name === "__moduleName" && !path.scope.hasBinding("__moduleName")) {
- path.replaceWith(MemberExpression(Identifier(state.contextIdent), Identifier("id")));
- }
- },
- Program: {
- enter: function enter(path, state) {
- state.contextIdent = path.scope.generateUid("context");
- if (!allowTopLevelThis) {
- rewriteThis(path);
- }
- },
- exit: function exit(path, state) {
- var undefinedIdent = path.scope.buildUndefinedNode();
- var exportIdent = path.scope.generateUid("export");
- var contextIdent = state.contextIdent;
- var exportMap = Object.create(null);
- var modules = [];
- var beforeBody = [];
- var setters = [];
- var sources = [];
- var variableIds = [];
- var removedPaths = [];
- function addExportName(key, val) {
- exportMap[key] = exportMap[key] || [];
- exportMap[key].push(val);
- }
- function pushModule(source, key, specifiers) {
- var module;
- modules.forEach(function (m) {
- if (m.key === source) {
- module = m;
- }
- });
- if (!module) {
- modules.push(module = {
- key: source,
- imports: [],
- exports: []
- });
- }
- module[key] = module[key].concat(specifiers);
- }
- function buildExportCall(name, val) {
- return ExpressionStatement(CallExpression(Identifier(exportIdent), [StringLiteral(name), val]));
- }
- var exportNames = [];
- var exportValues = [];
- var body = path.get("body");
- for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i5 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray3) {
- if (_i5 >= _iterator3.length) break;
- _ref3 = _iterator3[_i5++];
- } else {
- _i5 = _iterator3.next();
- if (_i5.done) break;
- _ref3 = _i5.value;
- }
- var _path = _ref3;
- if (_path.isFunctionDeclaration()) {
- beforeBody.push(_path.node);
- removedPaths.push(_path);
- } else if (_path.isClassDeclaration()) {
- variableIds.push(_path.node.id);
- _path.replaceWith(ExpressionStatement(AssignmentExpression("=", cloneNode(_path.node.id), toExpression(_path.node))));
- } else if (_path.isImportDeclaration()) {
- var source = _path.node.source.value;
- pushModule(source, "imports", _path.node.specifiers);
- for (var _i9 = 0, _Object$keys2 = Object.keys(_path.getBindingIdentifiers()); _i9 < _Object$keys2.length; _i9++) {
- var name = _Object$keys2[_i9];
- _path.scope.removeBinding(name);
- variableIds.push(Identifier(name));
- }
- _path.remove();
- } else if (_path.isExportAllDeclaration()) {
- pushModule(_path.node.source.value, "exports", _path.node);
- _path.remove();
- } else if (_path.isExportDefaultDeclaration()) {
- var declar = _path.get("declaration");
- var id = declar.node.id;
- if (declar.isClassDeclaration()) {
- if (id) {
- exportNames.push("default");
- exportValues.push(undefinedIdent);
- variableIds.push(id);
- addExportName(id.name, "default");
- _path.replaceWith(ExpressionStatement(AssignmentExpression("=", cloneNode(id), toExpression(declar.node))));
- } else {
- exportNames.push("default");
- exportValues.push(toExpression(declar.node));
- removedPaths.push(_path);
- }
- } else if (declar.isFunctionDeclaration()) {
- if (id) {
- beforeBody.push(declar.node);
- exportNames.push("default");
- exportValues.push(cloneNode(id));
- addExportName(id.name, "default");
- } else {
- exportNames.push("default");
- exportValues.push(toExpression(declar.node));
- }
- removedPaths.push(_path);
- } else {
- _path.replaceWith(buildExportCall("default", declar.node));
- }
- } else if (_path.isExportNamedDeclaration()) {
- var _declar = _path.get("declaration");
- if (_declar.node) {
- _path.replaceWith(_declar);
- if (_path.isFunction()) {
- var node = _declar.node;
- var _name2 = node.id.name;
- addExportName(_name2, _name2);
- beforeBody.push(node);
- exportNames.push(_name2);
- exportValues.push(cloneNode(node.id));
- removedPaths.push(_path);
- } else if (_path.isClass()) {
- var _name3 = _declar.node.id.name;
- exportNames.push(_name3);
- exportValues.push(undefinedIdent);
- variableIds.push(_declar.node.id);
- _path.replaceWith(ExpressionStatement(AssignmentExpression("=", cloneNode(_declar.node.id), toExpression(_declar.node))));
- addExportName(_name3, _name3);
- } else {
- for (var _i10 = 0, _Object$keys3 = Object.keys(_declar.getBindingIdentifiers()); _i10 < _Object$keys3.length; _i10++) {
- var _name4 = _Object$keys3[_i10];
- addExportName(_name4, _name4);
- }
- }
- } else {
- var specifiers = _path.node.specifiers;
- if (specifiers && specifiers.length) {
- if (_path.node.source) {
- pushModule(_path.node.source.value, "exports", specifiers);
- _path.remove();
- } else {
- var nodes = [];
- for (var _iterator6 = specifiers, _isArray6 = Array.isArray(_iterator6), _i11 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray6) {
- if (_i11 >= _iterator6.length) break;
- _ref6 = _iterator6[_i11++];
- } else {
- _i11 = _iterator6.next();
- if (_i11.done) break;
- _ref6 = _i11.value;
- }
- var specifier = _ref6;
- var binding = _path.scope.getBinding(specifier.local.name);
- if (binding && isFunctionDeclaration(binding.path.node)) {
- exportNames.push(specifier.exported.name);
- exportValues.push(cloneNode(specifier.local));
- } else if (!binding) {
- nodes.push(buildExportCall(specifier.exported.name, specifier.local));
- }
- addExportName(specifier.local.name, specifier.exported.name);
- }
- _path.replaceWithMultiple(nodes);
- }
- } else {
- _path.remove();
- }
- }
- }
- }
- modules.forEach(function (specifiers) {
- var setterBody = [];
- var target = path.scope.generateUid(specifiers.key);
- for (var _iterator4 = specifiers.imports, _isArray4 = Array.isArray(_iterator4), _i6 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray4) {
- if (_i6 >= _iterator4.length) break;
- _ref4 = _iterator4[_i6++];
- } else {
- _i6 = _iterator4.next();
- if (_i6.done) break;
- _ref4 = _i6.value;
- }
- var specifier = _ref4;
- if (isImportNamespaceSpecifier(specifier)) {
- setterBody.push(ExpressionStatement(AssignmentExpression("=", specifier.local, Identifier(target))));
- } else if (isImportDefaultSpecifier(specifier)) {
- specifier = ImportSpecifier(specifier.local, Identifier("default"));
- }
- if (isImportSpecifier(specifier)) {
- setterBody.push(ExpressionStatement(AssignmentExpression("=", specifier.local, MemberExpression(Identifier(target), specifier.imported))));
- }
- }
- if (specifiers.exports.length) {
- var _exportNames = [];
- var _exportValues = [];
- var hasExportStar = false;
- for (var _iterator5 = specifiers.exports, _isArray5 = Array.isArray(_iterator5), _i7 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray5) {
- if (_i7 >= _iterator5.length) break;
- _ref5 = _iterator5[_i7++];
- } else {
- _i7 = _iterator5.next();
- if (_i7.done) break;
- _ref5 = _i7.value;
- }
- var node = _ref5;
- if (isExportAllDeclaration(node)) {
- hasExportStar = true;
- } else if (isExportSpecifier(node)) {
- _exportNames.push(node.exported.name);
- _exportValues.push(MemberExpression(Identifier(target), node.local));
- }
- }
- setterBody = setterBody.concat(constructExportCall(path, Identifier(exportIdent), _exportNames, _exportValues, hasExportStar ? Identifier(target) : null));
- }
- sources.push(StringLiteral(specifiers.key));
- setters.push(FunctionExpression(null, [Identifier(target)], BlockStatement(setterBody)));
- });
- var moduleName = this.getModuleName();
- if (moduleName) moduleName = StringLiteral(moduleName);
- hoistVariables(path, function (id, name, hasInit) {
- variableIds.push(id);
- if (!hasInit) {
- exportNames.push(name);
- exportValues.push(undefinedIdent);
- }
- }, null);
- if (variableIds.length) {
- beforeBody.unshift(VariableDeclaration("var", variableIds.map(function (id) {
- return VariableDeclarator(id);
- })));
- }
- if (exportNames.length) {
- beforeBody = beforeBody.concat(constructExportCall(path, Identifier(exportIdent), exportNames, exportValues, null));
- }
- path.traverse(reassignmentVisitor, {
- exports: exportMap,
- buildCall: buildExportCall,
- scope: path.scope
- });
- for (var _i8 = 0, _removedPaths = removedPaths; _i8 < _removedPaths.length; _i8++) {
- var _path2 = _removedPaths[_i8];
- _path2.remove();
- }
- path.node.body = [buildTemplate({
- SYSTEM_REGISTER: MemberExpression(Identifier(systemGlobal), Identifier("register")),
- BEFORE_BODY: beforeBody,
- MODULE_NAME: moduleName,
- SETTERS: ArrayExpression(setters),
- SOURCES: ArrayExpression(sources),
- BODY: path.node.body,
- EXPORT_IDENTIFIER: Identifier(exportIdent),
- CONTEXT_IDENTIFIER: Identifier(contextIdent)
- })];
- }
- }
- }
- };
- });
- var buildPrerequisiteAssignment = template("\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n");
- var buildWrapper$1 = template("\n (function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== \"undefined\") {\n factory(COMMONJS_ARGUMENTS);\n } else {\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n\n GLOBAL_TO_ASSIGN;\n }\n })(\n typeof globalThis !== \"undefined\" ? globalThis\n : typeof self !== \"undefined\" ? self\n : this,\n function(IMPORT_NAMES) {\n })\n");
- var transformModulesUmd = declare(function (api, options) {
- api.assertVersion(7);
- var globals = options.globals,
- exactGlobals = options.exactGlobals,
- loose = options.loose,
- allowTopLevelThis = options.allowTopLevelThis,
- strict = options.strict,
- strictMode = options.strictMode,
- noInterop = options.noInterop;
- function buildBrowserInit(browserGlobals, exactGlobals, filename, moduleName) {
- var moduleNameOrBasename = moduleName ? moduleName.value : basename(filename, extname(filename));
- var globalToAssign = MemberExpression(Identifier("global"), Identifier(toIdentifier(moduleNameOrBasename)));
- var initAssignments = [];
- if (exactGlobals) {
- var globalName = browserGlobals[moduleNameOrBasename];
- if (globalName) {
- initAssignments = [];
- var members = globalName.split(".");
- globalToAssign = members.slice(1).reduce(function (accum, curr) {
- initAssignments.push(buildPrerequisiteAssignment({
- GLOBAL_REFERENCE: cloneNode(accum)
- }));
- return MemberExpression(accum, Identifier(curr));
- }, MemberExpression(Identifier("global"), Identifier(members[0])));
- }
- }
- initAssignments.push(ExpressionStatement(AssignmentExpression("=", globalToAssign, MemberExpression(Identifier("mod"), Identifier("exports")))));
- return initAssignments;
- }
- function buildBrowserArg(browserGlobals, exactGlobals, source) {
- var memberExpression;
- if (exactGlobals) {
- var globalRef = browserGlobals[source];
- if (globalRef) {
- memberExpression = globalRef.split(".").reduce(function (accum, curr) {
- return MemberExpression(accum, Identifier(curr));
- }, Identifier("global"));
- } else {
- memberExpression = MemberExpression(Identifier("global"), Identifier(toIdentifier(source)));
- }
- } else {
- var requireName = basename(source, extname(source));
- var globalName = browserGlobals[requireName] || requireName;
- memberExpression = MemberExpression(Identifier("global"), Identifier(toIdentifier(globalName)));
- }
- return memberExpression;
- }
- return {
- name: "transform-modules-umd",
- visitor: {
- Program: {
- exit: function exit(path) {
- if (!isModule(path)) return;
- var browserGlobals = globals || {};
- var moduleName = this.getModuleName();
- if (moduleName) moduleName = StringLiteral(moduleName);
- var _rewriteModuleStateme = rewriteModuleStatementsAndPrepareHeader(path, {
- loose: loose,
- strict: strict,
- strictMode: strictMode,
- allowTopLevelThis: allowTopLevelThis,
- noInterop: noInterop
- }),
- meta = _rewriteModuleStateme.meta,
- headers = _rewriteModuleStateme.headers;
- var amdArgs = [];
- var commonjsArgs = [];
- var browserArgs = [];
- var importNames = [];
- if (hasExports(meta)) {
- amdArgs.push(StringLiteral("exports"));
- commonjsArgs.push(Identifier("exports"));
- browserArgs.push(MemberExpression(Identifier("mod"), Identifier("exports")));
- importNames.push(Identifier(meta.exportName));
- }
- for (var _iterator = meta.source, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var _ref2 = _ref,
- source = _ref2[0],
- metadata = _ref2[1];
- amdArgs.push(StringLiteral(source));
- commonjsArgs.push(CallExpression(Identifier("require"), [StringLiteral(source)]));
- browserArgs.push(buildBrowserArg(browserGlobals, exactGlobals, source));
- importNames.push(Identifier(metadata.name));
- if (!isSideEffectImport(metadata)) {
- var interop = wrapInterop(path, Identifier(metadata.name), metadata.interop);
- if (interop) {
- var header = ExpressionStatement(AssignmentExpression("=", Identifier(metadata.name), interop));
- header.loc = meta.loc;
- headers.push(header);
- }
- }
- headers.push.apply(headers, buildNamespaceInitStatements(meta, metadata, loose));
- }
- ensureStatementsHoisted(headers);
- path.unshiftContainer("body", headers);
- var _path$node = path.node,
- body = _path$node.body,
- directives = _path$node.directives;
- path.node.directives = [];
- path.node.body = [];
- var umdWrapper = path.pushContainer("body", [buildWrapper$1({
- MODULE_NAME: moduleName,
- AMD_ARGUMENTS: ArrayExpression(amdArgs),
- COMMONJS_ARGUMENTS: commonjsArgs,
- BROWSER_ARGUMENTS: browserArgs,
- IMPORT_NAMES: importNames,
- GLOBAL_TO_ASSIGN: buildBrowserInit(browserGlobals, exactGlobals, this.filename || "unknown", moduleName)
- })])[0];
- var umdFactory = umdWrapper.get("expression.arguments")[1].get("body");
- umdFactory.pushContainer("directives", directives);
- umdFactory.pushContainer("body", body);
- }
- }
- }
- };
- });
- function transformNamedCapturingGroupsRegex (core, options) {
- var _options$runtime = options.runtime,
- runtime = _options$runtime === void 0 ? true : _options$runtime;
- if (typeof runtime !== "boolean") {
- throw new Error("The 'runtime' option must be boolean");
- }
- return createRegExpFeaturePlugin({
- name: "transform-named-capturing-groups-regex",
- feature: "namedCaptureGroups",
- options: {
- runtime: runtime
- }
- });
- }
- var transformNewTarget = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-new-target",
- visitor: {
- MetaProperty: function MetaProperty(path) {
- var meta = path.get("meta");
- var property = path.get("property");
- var scope = path.scope;
- if (meta.isIdentifier({
- name: "new"
- }) && property.isIdentifier({
- name: "target"
- })) {
- var func = path.findParent(function (path) {
- if (path.isClass()) return true;
- if (path.isFunction() && !path.isArrowFunctionExpression()) {
- if (path.isClassMethod({
- kind: "constructor"
- })) {
- return false;
- }
- return true;
- }
- return false;
- });
- if (!func) {
- throw path.buildCodeFrameError("new.target must be under a (non-arrow) function or a class.");
- }
- var node = func.node;
- if (!node.id) {
- if (func.isMethod()) {
- path.replaceWith(scope.buildUndefinedNode());
- return;
- }
- node.id = scope.generateUidIdentifier("target");
- }
- var _constructor = MemberExpression(ThisExpression(), Identifier("constructor"));
- if (func.isClass()) {
- path.replaceWith(_constructor);
- return;
- }
- path.replaceWith(ConditionalExpression(BinaryExpression("instanceof", ThisExpression(), cloneNode(node.id)), _constructor, scope.buildUndefinedNode()));
- }
- }
- }
- };
- });
- var transformObjectAssign = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-object-assign",
- visitor: {
- CallExpression: function CallExpression(path, file) {
- if (path.get("callee").matchesPattern("Object.assign")) {
- path.node.callee = file.addHelper("extends");
- }
- }
- }
- };
- });
- function replacePropertySuper(path, getObjectRef, file) {
- var replaceSupers = new ReplaceSupers({
- getObjectRef: getObjectRef,
- methodPath: path,
- file: file
- });
- replaceSupers.replace();
- }
- var transformObjectSuper = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-object-super",
- visitor: {
- ObjectExpression: function ObjectExpression(path, state) {
- var objectRef;
- var getObjectRef = function getObjectRef() {
- return objectRef = objectRef || path.scope.generateUidIdentifier("obj");
- };
- path.get("properties").forEach(function (propPath) {
- if (!propPath.isMethod()) return;
- replacePropertySuper(propPath, getObjectRef, state);
- });
- if (objectRef) {
- path.scope.push({
- id: cloneNode(objectRef)
- });
- path.replaceWith(AssignmentExpression("=", cloneNode(objectRef), path.node));
- }
- }
- }
- };
- });
- var transformObjectSetPrototypeOfToAssign = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-object-set-prototype-of-to-assign",
- visitor: {
- CallExpression: function CallExpression(path, file) {
- if (path.get("callee").matchesPattern("Object.setPrototypeOf")) {
- path.node.callee = file.addHelper("defaults");
- }
- }
- }
- };
- });
- var visitor$4 = {
- enter: function enter(path, state) {
- if (path.isThisExpression()) {
- state.foundThis = true;
- }
- if (path.isReferencedIdentifier({
- name: "arguments"
- })) {
- state.foundArguments = true;
- }
- },
- Function: function Function(path) {
- path.skip();
- }
- };
- function callDelegate (path, scope) {
- if (scope === void 0) {
- scope = path.scope;
- }
- var node = path.node;
- var container = FunctionExpression(null, [], node.body, node.generator, node.async);
- var callee = container;
- var args = [];
- hoistVariables(path, function (id) {
- return scope.push({
- id: id
- });
- });
- var state = {
- foundThis: false,
- foundArguments: false
- };
- path.traverse(visitor$4, state);
- if (state.foundArguments || state.foundThis) {
- callee = MemberExpression(container, Identifier("apply"));
- args = [];
- if (state.foundThis) {
- args.push(ThisExpression());
- }
- if (state.foundArguments) {
- if (!state.foundThis) args.push(NullLiteral());
- args.push(Identifier("arguments"));
- }
- }
- var call = CallExpression(callee, args);
- if (node.generator) call = YieldExpression(call, true);
- return ReturnStatement(call);
- }
- var buildDefaultParam = template("\n let VARIABLE_NAME =\n arguments.length > ARGUMENT_KEY && arguments[ARGUMENT_KEY] !== undefined ?\n arguments[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n");
- var buildLooseDefaultParam = template("\n if (ASSIGNMENT_IDENTIFIER === UNDEFINED) {\n ASSIGNMENT_IDENTIFIER = DEFAULT_VALUE;\n }\n");
- var buildLooseDestructuredDefaultParam = template("\n let ASSIGNMENT_IDENTIFIER = PARAMETER_NAME === UNDEFINED ? DEFAULT_VALUE : PARAMETER_NAME ;\n");
- var buildSafeArgumentsAccess = template("\n let $0 = arguments.length > $1 ? arguments[$1] : undefined;\n");
- function isSafeBinding(scope, node) {
- if (!scope.hasOwnBinding(node.name)) return true;
- var _scope$getOwnBinding = scope.getOwnBinding(node.name),
- kind = _scope$getOwnBinding.kind;
- return kind === "param" || kind === "local";
- }
- var iifeVisitor = {
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- var scope = path.scope,
- node = path.node;
- if (node.name === "eval" || !isSafeBinding(scope, node) || !isSafeBinding(state.scope, node)) {
- state.iife = true;
- path.stop();
- }
- },
- Scope: function Scope(path) {
- path.skip();
- }
- };
- function convertFunctionParams(path, loose) {
- var node = path.node,
- scope = path.scope;
- var state = {
- iife: false,
- scope: scope
- };
- var body = [];
- var params = path.get("params");
- var firstOptionalIndex = null;
- for (var i = 0; i < params.length; i++) {
- var param = params[i];
- var paramIsAssignmentPattern = param.isAssignmentPattern();
- if (paramIsAssignmentPattern && (loose || node.kind === "set")) {
- var left = param.get("left");
- var right = param.get("right");
- var undefinedNode = scope.buildUndefinedNode();
- if (left.isIdentifier()) {
- body.push(buildLooseDefaultParam({
- ASSIGNMENT_IDENTIFIER: cloneNode(left.node),
- DEFAULT_VALUE: right.node,
- UNDEFINED: undefinedNode
- }));
- param.replaceWith(left.node);
- } else if (left.isObjectPattern() || left.isArrayPattern()) {
- var paramName = scope.generateUidIdentifier();
- body.push(buildLooseDestructuredDefaultParam({
- ASSIGNMENT_IDENTIFIER: left.node,
- DEFAULT_VALUE: right.node,
- PARAMETER_NAME: cloneNode(paramName),
- UNDEFINED: undefinedNode
- }));
- param.replaceWith(paramName);
- }
- } else if (paramIsAssignmentPattern) {
- if (firstOptionalIndex === null) firstOptionalIndex = i;
- var _left = param.get("left");
- var _right = param.get("right");
- if (!state.iife) {
- if (_right.isIdentifier() && !isSafeBinding(scope, _right.node)) {
- state.iife = true;
- } else {
- _right.traverse(iifeVisitor, state);
- }
- }
- var defNode = buildDefaultParam({
- VARIABLE_NAME: _left.node,
- DEFAULT_VALUE: _right.node,
- ARGUMENT_KEY: NumericLiteral(i)
- });
- body.push(defNode);
- } else if (firstOptionalIndex !== null) {
- var _defNode = buildSafeArgumentsAccess([param.node, NumericLiteral(i)]);
- body.push(_defNode);
- } else if (param.isObjectPattern() || param.isArrayPattern()) {
- var uid = path.scope.generateUidIdentifier("ref");
- var _defNode2 = VariableDeclaration("let", [VariableDeclarator(param.node, uid)]);
- body.push(_defNode2);
- param.replaceWith(cloneNode(uid));
- }
- if (!state.iife && !param.isIdentifier()) {
- param.traverse(iifeVisitor, state);
- }
- }
- if (body.length === 0) return false;
- if (firstOptionalIndex !== null) {
- node.params = node.params.slice(0, firstOptionalIndex);
- }
- path.ensureBlock();
- if (state.iife) {
- body.push(callDelegate(path, scope));
- path.set("body", BlockStatement(body));
- } else {
- path.get("body").unshiftContainer("body", body);
- }
- return true;
- }
- var buildRest = template("\n for (var LEN = ARGUMENTS.length,\n ARRAY = new Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n");
- var restIndex = template("\n (INDEX < OFFSET || ARGUMENTS.length <= INDEX) ? undefined : ARGUMENTS[INDEX]\n");
- var restIndexImpure = template("\n REF = INDEX, (REF < OFFSET || ARGUMENTS.length <= REF) ? undefined : ARGUMENTS[REF]\n");
- var restLength = template("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n");
- function referencesRest(path, state) {
- if (path.node.name === state.name) {
- return path.scope.bindingIdentifierEquals(state.name, state.outerBinding);
- }
- return false;
- }
- var memberExpressionOptimisationVisitor = {
- Scope: function Scope(path, state) {
- if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) {
- path.skip();
- }
- },
- Flow: function Flow(path) {
- if (path.isTypeCastExpression()) return;
- path.skip();
- },
- Function: function Function(path, state) {
- var oldNoOptimise = state.noOptimise;
- state.noOptimise = true;
- path.traverse(memberExpressionOptimisationVisitor, state);
- state.noOptimise = oldNoOptimise;
- path.skip();
- },
- ReferencedIdentifier: function ReferencedIdentifier(path, state) {
- var node = path.node;
- if (node.name === "arguments") {
- state.deopted = true;
- }
- if (!referencesRest(path, state)) return;
- if (state.noOptimise) {
- state.deopted = true;
- } else {
- var parentPath = path.parentPath;
- if (parentPath.listKey === "params" && parentPath.key < state.offset) {
- return;
- }
- if (parentPath.isMemberExpression({
- object: node
- })) {
- var grandparentPath = parentPath.parentPath;
- var argsOptEligible = !state.deopted && !(grandparentPath.isAssignmentExpression() && parentPath.node === grandparentPath.node.left || grandparentPath.isLVal() || grandparentPath.isForXStatement() || grandparentPath.isUpdateExpression() || grandparentPath.isUnaryExpression({
- operator: "delete"
- }) || (grandparentPath.isCallExpression() || grandparentPath.isNewExpression()) && parentPath.node === grandparentPath.node.callee);
- if (argsOptEligible) {
- if (parentPath.node.computed) {
- if (parentPath.get("property").isBaseType("number")) {
- state.candidates.push({
- cause: "indexGetter",
- path: path
- });
- return;
- }
- } else if (parentPath.node.property.name === "length") {
- state.candidates.push({
- cause: "lengthGetter",
- path: path
- });
- return;
- }
- }
- }
- if (state.offset === 0 && parentPath.isSpreadElement()) {
- var call = parentPath.parentPath;
- if (call.isCallExpression() && call.node.arguments.length === 1) {
- state.candidates.push({
- cause: "argSpread",
- path: path
- });
- return;
- }
- }
- state.references.push(path);
- }
- },
- BindingIdentifier: function BindingIdentifier(path, state) {
- if (referencesRest(path, state)) {
- state.deopted = true;
- }
- }
- };
- function hasRest(node) {
- var length = node.params.length;
- return length > 0 && isRestElement(node.params[length - 1]);
- }
- function optimiseIndexGetter(path, argsId, offset) {
- var offsetLiteral = NumericLiteral(offset);
- var index;
- if (isNumericLiteral(path.parent.property)) {
- index = NumericLiteral(path.parent.property.value + offset);
- } else if (offset === 0) {
- index = path.parent.property;
- } else {
- index = BinaryExpression("+", path.parent.property, cloneNode(offsetLiteral));
- }
- var scope = path.scope;
- if (!scope.isPure(index)) {
- var temp = scope.generateUidIdentifierBasedOnNode(index);
- scope.push({
- id: temp,
- kind: "var"
- });
- path.parentPath.replaceWith(restIndexImpure({
- ARGUMENTS: argsId,
- OFFSET: offsetLiteral,
- INDEX: index,
- REF: cloneNode(temp)
- }));
- } else {
- var parentPath = path.parentPath;
- parentPath.replaceWith(restIndex({
- ARGUMENTS: argsId,
- OFFSET: offsetLiteral,
- INDEX: index
- }));
- var offsetTestPath = parentPath.get("test").get("left");
- var valRes = offsetTestPath.evaluate();
- if (valRes.confident) {
- if (valRes.value === true) {
- parentPath.replaceWith(parentPath.scope.buildUndefinedNode());
- } else {
- parentPath.get("test").replaceWith(parentPath.get("test").get("right"));
- }
- }
- }
- }
- function optimiseLengthGetter(path, argsId, offset) {
- if (offset) {
- path.parentPath.replaceWith(restLength({
- ARGUMENTS: argsId,
- OFFSET: NumericLiteral(offset)
- }));
- } else {
- path.replaceWith(argsId);
- }
- }
- function convertFunctionRest(path) {
- var node = path.node,
- scope = path.scope;
- if (!hasRest(node)) return false;
- var rest = node.params.pop().argument;
- var argsId = Identifier("arguments");
- if (isPattern(rest)) {
- var pattern = rest;
- rest = scope.generateUidIdentifier("ref");
- var declar = VariableDeclaration("let", [VariableDeclarator(pattern, rest)]);
- node.body.body.unshift(declar);
- }
- var state = {
- references: [],
- offset: node.params.length,
- argumentsNode: argsId,
- outerBinding: scope.getBindingIdentifier(rest.name),
- candidates: [],
- name: rest.name,
- deopted: false
- };
- path.traverse(memberExpressionOptimisationVisitor, state);
- if (!state.deopted && !state.references.length) {
- for (var _i = 0, _arr = state.candidates; _i < _arr.length; _i++) {
- var _arr$_i = _arr[_i],
- _path = _arr$_i.path,
- cause = _arr$_i.cause;
- var clonedArgsId = cloneNode(argsId);
- switch (cause) {
- case "indexGetter":
- optimiseIndexGetter(_path, clonedArgsId, state.offset);
- break;
- case "lengthGetter":
- optimiseLengthGetter(_path, clonedArgsId, state.offset);
- break;
- default:
- _path.replaceWith(clonedArgsId);
- }
- }
- return true;
- }
- state.references = state.references.concat(state.candidates.map(function (_ref) {
- var path = _ref.path;
- return path;
- }));
- var start = NumericLiteral(node.params.length);
- var key = scope.generateUidIdentifier("key");
- var len = scope.generateUidIdentifier("len");
- var arrKey, arrLen;
- if (node.params.length) {
- arrKey = BinaryExpression("-", cloneNode(key), cloneNode(start));
- arrLen = ConditionalExpression(BinaryExpression(">", cloneNode(len), cloneNode(start)), BinaryExpression("-", cloneNode(len), cloneNode(start)), NumericLiteral(0));
- } else {
- arrKey = Identifier(key.name);
- arrLen = Identifier(len.name);
- }
- var loop = buildRest({
- ARGUMENTS: argsId,
- ARRAY_KEY: arrKey,
- ARRAY_LEN: arrLen,
- START: start,
- ARRAY: rest,
- KEY: key,
- LEN: len
- });
- if (state.deopted) {
- node.body.body.unshift(loop);
- } else {
- var target = path.getEarliestCommonAncestorFrom(state.references).getStatementParent();
- target.findParent(function (path) {
- if (path.isLoop()) {
- target = path;
- } else {
- return path.isFunction();
- }
- });
- target.insertBefore(loop);
- }
- return true;
- }
- var transformParameters = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose;
- return {
- name: "transform-parameters",
- visitor: {
- Function: function Function(path) {
- if (path.isArrowFunctionExpression() && path.get("params").some(function (param) {
- return param.isRestElement() || param.isAssignmentPattern();
- })) {
- path.arrowFunctionToExpression();
- }
- var convertedRest = convertFunctionRest(path);
- var convertedParams = convertFunctionParams(path, loose);
- if (convertedRest || convertedParams) {
- path.scope.crawl();
- }
- }
- }
- };
- });
- var transformPropertyLiterals = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-property-literals",
- visitor: {
- ObjectProperty: {
- exit: function exit(_ref) {
- var node = _ref.node;
- var key = node.key;
- if (!node.computed && isIdentifier(key) && !isValidES3Identifier(key.name)) {
- node.key = StringLiteral(key.name);
- }
- }
- }
- }
- };
- });
- var transformPropertyMutators = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-property-mutators",
- visitor: {
- ObjectExpression: function ObjectExpression(path, file) {
- var node = path.node;
- var hasAny = false;
- for (var _i = 0, _arr = node.properties; _i < _arr.length; _i++) {
- var prop = _arr[_i];
- if (prop.kind === "get" || prop.kind === "set") {
- hasAny = true;
- break;
- }
- }
- if (!hasAny) return;
- var mutatorMap = {};
- node.properties = node.properties.filter(function (prop) {
- if (!prop.computed && (prop.kind === "get" || prop.kind === "set")) {
- push(mutatorMap, prop, null, file);
- return false;
- } else {
- return true;
- }
- });
- path.replaceWith(CallExpression(MemberExpression(Identifier("Object"), Identifier("defineProperties")), [node, toDefineObject(mutatorMap)]));
- }
- }
- };
- });
- var transformProtoToAssign = declare(function (api) {
- api.assertVersion(7);
- function isProtoKey(node) {
- return isLiteral(toComputedKey(node, node.key), {
- value: "__proto__"
- });
- }
- function isProtoAssignmentExpression(node) {
- var left = node.left;
- return isMemberExpression(left) && isLiteral(toComputedKey(left, left.property), {
- value: "__proto__"
- });
- }
- function buildDefaultsCallExpression(expr, ref, file) {
- return ExpressionStatement(CallExpression(file.addHelper("defaults"), [ref, expr.right]));
- }
- return {
- name: "transform-proto-to-assign",
- visitor: {
- AssignmentExpression: function AssignmentExpression$1(path, file) {
- if (!isProtoAssignmentExpression(path.node)) return;
- var nodes = [];
- var left = path.node.left.object;
- var temp = path.scope.maybeGenerateMemoised(left);
- if (temp) {
- nodes.push(ExpressionStatement(AssignmentExpression("=", temp, left)));
- }
- nodes.push(buildDefaultsCallExpression(path.node, cloneNode(temp || left), file));
- if (temp) nodes.push(cloneNode(temp));
- path.replaceWithMultiple(nodes);
- },
- ExpressionStatement: function ExpressionStatement(path, file) {
- var expr = path.node.expression;
- if (!isAssignmentExpression(expr, {
- operator: "="
- })) return;
- if (isProtoAssignmentExpression(expr)) {
- path.replaceWith(buildDefaultsCallExpression(expr, expr.left.object, file));
- }
- },
- ObjectExpression: function ObjectExpression$1(path, file) {
- var proto;
- var node = path.node;
- for (var _i = 0, _arr = node.properties; _i < _arr.length; _i++) {
- var prop = _arr[_i];
- if (isProtoKey(prop)) {
- proto = prop.value;
- pull_1(node.properties, prop);
- }
- }
- if (proto) {
- var args = [ObjectExpression([]), proto];
- if (node.properties.length) args.push(node);
- path.replaceWith(CallExpression(file.addHelper("extends"), args));
- }
- }
- }
- };
- });
- var transformReactConstantElements = declare(function (api, options) {
- api.assertVersion(7);
- var allowMutablePropsOnTags = options.allowMutablePropsOnTags;
- if (allowMutablePropsOnTags != null && !Array.isArray(allowMutablePropsOnTags)) {
- throw new Error(".allowMutablePropsOnTags must be an array, null, or undefined.");
- }
- var HOISTED = new WeakSet();
- var immutabilityVisitor = {
- enter: function enter(path, state) {
- var stop = function stop() {
- state.isImmutable = false;
- path.stop();
- };
- if (path.isJSXClosingElement()) {
- path.skip();
- return;
- }
- if (path.isJSXIdentifier({
- name: "ref"
- }) && path.parentPath.isJSXAttribute({
- name: path.node
- })) {
- return stop();
- }
- if (path.isJSXIdentifier() || path.isIdentifier() || path.isJSXMemberExpression()) {
- return;
- }
- if (!path.isImmutable()) {
- if (path.isPure()) {
- var expressionResult = path.evaluate();
- if (expressionResult.confident) {
- var value = expressionResult.value;
- var isMutable = !state.mutablePropsAllowed && value && typeof value === "object" || typeof value === "function";
- if (!isMutable) {
- path.skip();
- return;
- }
- } else if (isIdentifier(expressionResult.deopt)) {
- return;
- }
- }
- stop();
- }
- }
- };
- return {
- name: "transform-react-constant-elements",
- visitor: {
- JSXElement: function JSXElement(path) {
- if (HOISTED.has(path.node)) return;
- HOISTED.add(path.node);
- var state = {
- isImmutable: true
- };
- if (allowMutablePropsOnTags != null) {
- var namePath = path.get("openingElement.name");
- while (namePath.isJSXMemberExpression()) {
- namePath = namePath.get("property");
- }
- var elementName = namePath.node.name;
- state.mutablePropsAllowed = allowMutablePropsOnTags.indexOf(elementName) > -1;
- }
- path.traverse(immutabilityVisitor, state);
- if (state.isImmutable) {
- var hoisted = path.hoist();
- if (hoisted) {
- annotateAsPure(hoisted);
- }
- }
- }
- }
- };
- });
- var transformReactDisplayName = declare(function (api) {
- api.assertVersion(7);
- function addDisplayName(id, call) {
- var props = call.arguments[0].properties;
- var safe = true;
- for (var i = 0; i < props.length; i++) {
- var prop = props[i];
- var key = toComputedKey(prop);
- if (isLiteral(key, {
- value: "displayName"
- })) {
- safe = false;
- break;
- }
- }
- if (safe) {
- props.unshift(ObjectProperty(Identifier("displayName"), StringLiteral(id)));
- }
- }
- var isCreateClassCallExpression = buildMatchMemberExpression("React.createClass");
- var isCreateClassAddon = function isCreateClassAddon(callee) {
- return callee.name === "createReactClass";
- };
- function isCreateClass(node) {
- if (!node || !isCallExpression(node)) return false;
- if (!isCreateClassCallExpression(node.callee) && !isCreateClassAddon(node.callee)) {
- return false;
- }
- var args = node.arguments;
- if (args.length !== 1) return false;
- var first = args[0];
- if (!isObjectExpression(first)) return false;
- return true;
- }
- return {
- name: "transform-react-display-name",
- visitor: {
- ExportDefaultDeclaration: function ExportDefaultDeclaration(_ref, state) {
- var node = _ref.node;
- if (isCreateClass(node.declaration)) {
- var filename = state.filename || "unknown";
- var displayName = path$1.basename(filename, path$1.extname(filename));
- if (displayName === "index") {
- displayName = path$1.basename(path$1.dirname(filename));
- }
- addDisplayName(displayName, node.declaration);
- }
- },
- CallExpression: function CallExpression(path) {
- var node = path.node;
- if (!isCreateClass(node)) return;
- var id;
- path.find(function (path) {
- if (path.isAssignmentExpression()) {
- id = path.node.left;
- } else if (path.isObjectProperty()) {
- id = path.node.key;
- } else if (path.isVariableDeclarator()) {
- id = path.node.id;
- } else if (path.isStatement()) {
- return true;
- }
- if (id) return true;
- });
- if (!id) return;
- if (isMemberExpression(id)) {
- id = id.property;
- }
- if (isIdentifier(id)) {
- addDisplayName(id.name, node);
- }
- }
- }
- };
- });
- function helper$1 (opts) {
- var visitor = {};
- visitor.JSXNamespacedName = function (path) {
- if (opts.throwIfNamespace) {
- throw path.buildCodeFrameError("Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning.");
- }
- };
- visitor.JSXSpreadChild = function (path) {
- throw path.buildCodeFrameError("Spread children are not supported in React.");
- };
- visitor.JSXElement = {
- exit: function exit(path, file) {
- var callExpr = buildElementCall(path, file);
- if (callExpr) {
- path.replaceWith(inherits(callExpr, path.node));
- }
- }
- };
- visitor.JSXFragment = {
- exit: function exit(path, file) {
- if (opts.compat) {
- throw path.buildCodeFrameError("Fragment tags are only supported in React 16 and up.");
- }
- var callExpr = buildFragmentCall(path, file);
- if (callExpr) {
- path.replaceWith(inherits(callExpr, path.node));
- }
- }
- };
- return visitor;
- function convertJSXIdentifier(node, parent) {
- if (isJSXIdentifier(node)) {
- if (node.name === "this" && isReferenced(node, parent)) {
- return ThisExpression();
- } else if (utils.keyword.isIdentifierNameES6(node.name)) {
- node.type = "Identifier";
- } else {
- return StringLiteral(node.name);
- }
- } else if (isJSXMemberExpression(node)) {
- return MemberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node));
- } else if (isJSXNamespacedName(node)) {
- return StringLiteral(node.namespace.name + ":" + node.name.name);
- }
- return node;
- }
- function convertAttributeValue(node) {
- if (isJSXExpressionContainer(node)) {
- return node.expression;
- } else {
- return node;
- }
- }
- function convertAttribute(node) {
- var value = convertAttributeValue(node.value || BooleanLiteral(true));
- if (isJSXSpreadAttribute(node)) {
- return SpreadElement(node.argument);
- }
- if (isStringLiteral(value) && !isJSXExpressionContainer(node.value)) {
- var _value$extra;
- value.value = value.value.replace(/\n\s+/g, " ");
- (_value$extra = value.extra) == null ? true : delete _value$extra.raw;
- }
- if (isJSXNamespacedName(node.name)) {
- node.name = StringLiteral(node.name.namespace.name + ":" + node.name.name.name);
- } else if (utils.keyword.isIdentifierNameES6(node.name.name)) {
- node.name.type = "Identifier";
- } else {
- node.name = StringLiteral(node.name.name);
- }
- return inherits(ObjectProperty(node.name, value), node);
- }
- function buildElementCall(path, file) {
- if (opts.filter && !opts.filter(path.node, file)) return;
- var openingPath = path.get("openingElement");
- openingPath.parent.children = react.buildChildren(openingPath.parent);
- var tagExpr = convertJSXIdentifier(openingPath.node.name, openingPath.node);
- var args = [];
- var tagName;
- if (isIdentifier(tagExpr)) {
- tagName = tagExpr.name;
- } else if (isLiteral(tagExpr)) {
- tagName = tagExpr.value;
- }
- var state = {
- tagExpr: tagExpr,
- tagName: tagName,
- args: args
- };
- if (opts.pre) {
- opts.pre(state, file);
- }
- var attribs = openingPath.node.attributes;
- if (attribs.length) {
- attribs = buildOpeningElementAttributes(attribs, file);
- } else {
- attribs = NullLiteral();
- }
- args.push.apply(args, [attribs].concat(path.node.children));
- if (opts.post) {
- opts.post(state, file);
- }
- return state.call || CallExpression(state.callee, args);
- }
- function pushProps(_props, objs) {
- if (!_props.length) return _props;
- objs.push(ObjectExpression(_props));
- return [];
- }
- function buildOpeningElementAttributes(attribs, file) {
- var _props = [];
- var objs = [];
- var _file$opts$useSpread = file.opts.useSpread,
- useSpread = _file$opts$useSpread === void 0 ? false : _file$opts$useSpread;
- if (typeof useSpread !== "boolean") {
- throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useSpread (defaults to false)");
- }
- var useBuiltIns = file.opts.useBuiltIns || false;
- if (typeof useBuiltIns !== "boolean") {
- throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useBuiltIns (defaults to false)");
- }
- if (useSpread && useBuiltIns) {
- throw new Error("transform-react-jsx currently only accepts useBuiltIns or useSpread " + "but not both");
- }
- if (useSpread) {
- var props = attribs.map(convertAttribute);
- return ObjectExpression(props);
- }
- while (attribs.length) {
- var prop = attribs.shift();
- if (isJSXSpreadAttribute(prop)) {
- _props = pushProps(_props, objs);
- objs.push(prop.argument);
- } else {
- _props.push(convertAttribute(prop));
- }
- }
- pushProps(_props, objs);
- if (objs.length === 1) {
- attribs = objs[0];
- } else {
- if (!isObjectExpression(objs[0])) {
- objs.unshift(ObjectExpression([]));
- }
- var helper = useBuiltIns ? MemberExpression(Identifier("Object"), Identifier("assign")) : file.addHelper("extends");
- attribs = CallExpression(helper, objs);
- }
- return attribs;
- }
- function buildFragmentCall(path, file) {
- if (opts.filter && !opts.filter(path.node, file)) return;
- var openingPath = path.get("openingElement");
- openingPath.parent.children = react.buildChildren(openingPath.parent);
- var args = [];
- var tagName = null;
- var tagExpr = file.get("jsxFragIdentifier")();
- var state = {
- tagExpr: tagExpr,
- tagName: tagName,
- args: args
- };
- if (opts.pre) {
- opts.pre(state, file);
- }
- args.push.apply(args, [NullLiteral()].concat(path.node.children));
- if (opts.post) {
- opts.post(state, file);
- }
- file.set("usedFragment", true);
- return state.call || CallExpression(state.callee, args);
- }
- }
- var transformReactInlineElements = declare(function (api) {
- api.assertVersion(7);
- function hasRefOrSpread(attrs) {
- for (var i = 0; i < attrs.length; i++) {
- var attr = attrs[i];
- if (isJSXSpreadAttribute(attr)) return true;
- if (isJSXAttributeOfName(attr, "ref")) return true;
- }
- return false;
- }
- function isJSXAttributeOfName(attr, name) {
- return isJSXAttribute(attr) && isJSXIdentifier(attr.name, {
- name: name
- });
- }
- var visitor = helper$1({
- filter: function filter(node) {
- return node.openingElement && !hasRefOrSpread(node.openingElement.attributes);
- },
- pre: function pre(state) {
- var tagName = state.tagName;
- var args = state.args;
- if (react.isCompatTag(tagName)) {
- args.push(StringLiteral(tagName));
- } else {
- args.push(state.tagExpr);
- }
- },
- post: function post(state, pass) {
- state.callee = pass.addHelper("jsx");
- var props = state.args[1];
- var hasKey = false;
- if (isObjectExpression(props)) {
- var keyIndex = props.properties.findIndex(function (prop) {
- return isIdentifier(prop.key, {
- name: "key"
- });
- });
- if (keyIndex > -1) {
- state.args.splice(2, 0, props.properties[keyIndex].value);
- props.properties.splice(keyIndex, 1);
- hasKey = true;
- }
- } else if (isNullLiteral(props)) {
- state.args.splice(1, 1, ObjectExpression([]));
- }
- if (!hasKey && state.args.length > 2) {
- state.args.splice(2, 0, UnaryExpression("void", NumericLiteral(0)));
- }
- }
- });
- return {
- name: "transform-react-inline-elements",
- visitor: visitor
- };
- });
- var transformReactJSX = declare(function (api, options) {
- api.assertVersion(7);
- var THROW_IF_NAMESPACE = options.throwIfNamespace === undefined ? true : !!options.throwIfNamespace;
- var PRAGMA_DEFAULT = options.pragma || "React.createElement";
- var PRAGMA_FRAG_DEFAULT = options.pragmaFrag || "React.Fragment";
- var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
- var JSX_FRAG_ANNOTATION_REGEX = /\*?\s*@jsxFrag\s+([^\s]+)/;
- var createIdentifierParser = function createIdentifierParser(id) {
- return function () {
- return id.split(".").map(function (name) {
- return Identifier(name);
- }).reduce(function (object, property) {
- return MemberExpression(object, property);
- });
- };
- };
- var visitor = helper$1({
- pre: function pre(state) {
- var tagName = state.tagName;
- var args = state.args;
- if (react.isCompatTag(tagName)) {
- args.push(StringLiteral(tagName));
- } else {
- args.push(state.tagExpr);
- }
- },
- post: function post(state, pass) {
- state.callee = pass.get("jsxIdentifier")();
- },
- throwIfNamespace: THROW_IF_NAMESPACE
- });
- visitor.Program = {
- enter: function enter(path, state) {
- var file = state.file;
- var pragma = PRAGMA_DEFAULT;
- var pragmaFrag = PRAGMA_FRAG_DEFAULT;
- var pragmaSet = !!options.pragma;
- var pragmaFragSet = !!options.pragmaFrag;
- if (file.ast.comments) {
- for (var _i = 0, _arr = file.ast.comments; _i < _arr.length; _i++) {
- var comment = _arr[_i];
- var jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);
- if (jsxMatches) {
- pragma = jsxMatches[1];
- pragmaSet = true;
- }
- var jsxFragMatches = JSX_FRAG_ANNOTATION_REGEX.exec(comment.value);
- if (jsxFragMatches) {
- pragmaFrag = jsxFragMatches[1];
- pragmaFragSet = true;
- }
- }
- }
- state.set("jsxIdentifier", createIdentifierParser(pragma));
- state.set("jsxFragIdentifier", createIdentifierParser(pragmaFrag));
- state.set("usedFragment", false);
- state.set("pragmaSet", pragmaSet);
- state.set("pragmaFragSet", pragmaFragSet);
- },
- exit: function exit(path, state) {
- if (state.get("pragmaSet") && state.get("usedFragment") && !state.get("pragmaFragSet")) {
- throw new Error("transform-react-jsx: pragma has been set but " + "pragmaFrag has not been set");
- }
- }
- };
- visitor.JSXAttribute = function (path) {
- if (isJSXElement(path.node.value)) {
- path.node.value = JSXExpressionContainer(path.node.value);
- }
- };
- return {
- name: "transform-react-jsx",
- inherits: syntaxJsx,
- visitor: visitor
- };
- });
- var transformReactJsxCompat = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-react-jsx-compat",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("jsx");
- },
- visitor: helper$1({
- pre: function pre(state) {
- state.callee = state.tagExpr;
- },
- post: function post(state) {
- if (react.isCompatTag(state.tagName)) {
- state.call = CallExpression(MemberExpression(MemberExpression(Identifier("React"), Identifier("DOM")), state.tagExpr, isLiteral(state.tagExpr)), state.args);
- }
- },
- compat: true
- })
- };
- });
- var TRACE_ID = "__self";
- var transformReactJSXSelf = declare(function (api) {
- api.assertVersion(7);
- var visitor = {
- JSXOpeningElement: function JSXOpeningElement(_ref) {
- var node = _ref.node;
- var id = JSXIdentifier(TRACE_ID);
- var trace = ThisExpression();
- node.attributes.push(JSXAttribute(id, JSXExpressionContainer(trace)));
- }
- };
- return {
- name: "transform-react-jsx-self",
- visitor: visitor
- };
- });
- var TRACE_ID$1 = "__source";
- var FILE_NAME_VAR = "_jsxFileName";
- var transformReactJSXSource = declare(function (api) {
- api.assertVersion(7);
- function makeTrace(fileNameIdentifier, lineNumber) {
- var fileLineLiteral = lineNumber != null ? NumericLiteral(lineNumber) : NullLiteral();
- var fileNameProperty = ObjectProperty(Identifier("fileName"), fileNameIdentifier);
- var lineNumberProperty = ObjectProperty(Identifier("lineNumber"), fileLineLiteral);
- return ObjectExpression([fileNameProperty, lineNumberProperty]);
- }
- var visitor = {
- JSXOpeningElement: function JSXOpeningElement(path, state) {
- var id = JSXIdentifier(TRACE_ID$1);
- var location = path.container.openingElement.loc;
- if (!location) {
- return;
- }
- var attributes = path.container.openingElement.attributes;
- for (var i = 0; i < attributes.length; i++) {
- var name = attributes[i].name;
- if (name && name.name === TRACE_ID$1) {
- return;
- }
- }
- if (!state.fileNameIdentifier) {
- var fileName = state.filename || "";
- var fileNameIdentifier = path.scope.generateUidIdentifier(FILE_NAME_VAR);
- var scope = path.hub.getScope();
- if (scope) {
- scope.push({
- id: fileNameIdentifier,
- init: StringLiteral(fileName)
- });
- }
- state.fileNameIdentifier = fileNameIdentifier;
- }
- var trace = makeTrace(state.fileNameIdentifier, location.start.line);
- attributes.push(JSXAttribute(id, JSXExpressionContainer(trace)));
- }
- };
- return {
- name: "transform-react-jsx-source",
- visitor: visitor
- };
- });
- var util$1 = createCommonjsModule(function (module, exports) {
- exports.__esModule = true;
- exports.wrapWithTypes = wrapWithTypes;
- exports.getTypes = getTypes;
- exports.runtimeProperty = runtimeProperty;
- exports.isReference = isReference;
- exports.replaceWithOrRemove = replaceWithOrRemove;
- var currentTypes = null;
- function wrapWithTypes(types, fn) {
- return function () {
- var oldTypes = currentTypes;
- currentTypes = types;
- try {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return fn.apply(this, args);
- } finally {
- currentTypes = oldTypes;
- }
- };
- }
- function getTypes() {
- return currentTypes;
- }
- function runtimeProperty(name) {
- var t = getTypes();
- return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false);
- }
- function isReference(path) {
- return path.isReferenced() || path.parentPath.isAssignmentExpression({
- left: path.node
- });
- }
- function replaceWithOrRemove(path, replacement) {
- if (replacement) {
- path.replaceWith(replacement);
- } else {
- path.remove();
- }
- }
- });
- unwrapExports(util$1);
- var util_1$1 = util$1.wrapWithTypes;
- var util_2$1 = util$1.getTypes;
- var util_3$1 = util$1.runtimeProperty;
- var util_4$1 = util$1.isReference;
- var util_5$1 = util$1.replaceWithOrRemove;
- var hoist$1 = createCommonjsModule(function (module, exports) {
- var util = _interopRequireWildcard(util$1);
- function _interopRequireWildcard(obj) {
- if (obj && obj.__esModule) {
- return obj;
- } else {
- var newObj = {};
- if (obj != null) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
- if (desc.get || desc.set) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
- }
- }
- }
- newObj["default"] = obj;
- return newObj;
- }
- }
- var hasOwn = Object.prototype.hasOwnProperty;
- exports.hoist = function (funPath) {
- var t = util.getTypes();
- t.assertFunction(funPath.node);
- var vars = {};
- function varDeclToExpr(_ref, includeIdentifiers) {
- var vdec = _ref.node,
- scope = _ref.scope;
- t.assertVariableDeclaration(vdec);
- var exprs = [];
- vdec.declarations.forEach(function (dec) {
- vars[dec.id.name] = t.identifier(dec.id.name);
- scope.removeBinding(dec.id.name);
- if (dec.init) {
- exprs.push(t.assignmentExpression("=", dec.id, dec.init));
- } else if (includeIdentifiers) {
- exprs.push(dec.id);
- }
- });
- if (exprs.length === 0) return null;
- if (exprs.length === 1) return exprs[0];
- return t.sequenceExpression(exprs);
- }
- funPath.get("body").traverse({
- VariableDeclaration: {
- exit: function exit(path) {
- var expr = varDeclToExpr(path, false);
- if (expr === null) {
- path.remove();
- } else {
- util.replaceWithOrRemove(path, t.expressionStatement(expr));
- }
- path.skip();
- }
- },
- ForStatement: function ForStatement(path) {
- var init = path.get("init");
- if (init.isVariableDeclaration()) {
- util.replaceWithOrRemove(init, varDeclToExpr(init, false));
- }
- },
- ForXStatement: function ForXStatement(path) {
- var left = path.get("left");
- if (left.isVariableDeclaration()) {
- util.replaceWithOrRemove(left, varDeclToExpr(left, true));
- }
- },
- FunctionDeclaration: function FunctionDeclaration(path) {
- var node = path.node;
- vars[node.id.name] = node.id;
- var assignment = t.expressionStatement(t.assignmentExpression("=", t.clone(node.id), t.functionExpression(path.scope.generateUidIdentifierBasedOnNode(node), node.params, node.body, node.generator, node.expression)));
- if (path.parentPath.isBlockStatement()) {
- path.parentPath.unshiftContainer("body", assignment);
- path.remove();
- } else {
- util.replaceWithOrRemove(path, assignment);
- }
- path.scope.removeBinding(node.id.name);
- path.skip();
- },
- FunctionExpression: function FunctionExpression(path) {
- path.skip();
- },
- ArrowFunctionExpression: function ArrowFunctionExpression(path) {
- path.skip();
- }
- });
- var paramNames = {};
- funPath.get("params").forEach(function (paramPath) {
- var param = paramPath.node;
- if (t.isIdentifier(param)) {
- paramNames[param.name] = param;
- }
- });
- var declarations = [];
- Object.keys(vars).forEach(function (name) {
- if (!hasOwn.call(paramNames, name)) {
- declarations.push(t.variableDeclarator(vars[name], null));
- }
- });
- if (declarations.length === 0) {
- return null;
- }
- return t.variableDeclaration("var", declarations);
- };
- });
- unwrapExports(hoist$1);
- var hoist_1 = hoist$1.hoist;
- var leap = createCommonjsModule(function (module, exports) {
- var _assert = _interopRequireDefault(assert$2);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- function Entry() {
- _assert["default"].ok(this instanceof Entry);
- }
- function FunctionEntry(returnLoc) {
- Entry.call(this);
- (0, util$1.getTypes)().assertLiteral(returnLoc);
- this.returnLoc = returnLoc;
- }
- (0, _util.inherits)(FunctionEntry, Entry);
- exports.FunctionEntry = FunctionEntry;
- function LoopEntry(breakLoc, continueLoc, label) {
- Entry.call(this);
- var t = (0, util$1.getTypes)();
- t.assertLiteral(breakLoc);
- t.assertLiteral(continueLoc);
- if (label) {
- t.assertIdentifier(label);
- } else {
- label = null;
- }
- this.breakLoc = breakLoc;
- this.continueLoc = continueLoc;
- this.label = label;
- }
- (0, _util.inherits)(LoopEntry, Entry);
- exports.LoopEntry = LoopEntry;
- function SwitchEntry(breakLoc) {
- Entry.call(this);
- (0, util$1.getTypes)().assertLiteral(breakLoc);
- this.breakLoc = breakLoc;
- }
- (0, _util.inherits)(SwitchEntry, Entry);
- exports.SwitchEntry = SwitchEntry;
- function TryEntry(firstLoc, catchEntry, finallyEntry) {
- Entry.call(this);
- var t = (0, util$1.getTypes)();
- t.assertLiteral(firstLoc);
- if (catchEntry) {
- _assert["default"].ok(catchEntry instanceof CatchEntry);
- } else {
- catchEntry = null;
- }
- if (finallyEntry) {
- _assert["default"].ok(finallyEntry instanceof FinallyEntry);
- } else {
- finallyEntry = null;
- }
- _assert["default"].ok(catchEntry || finallyEntry);
- this.firstLoc = firstLoc;
- this.catchEntry = catchEntry;
- this.finallyEntry = finallyEntry;
- }
- (0, _util.inherits)(TryEntry, Entry);
- exports.TryEntry = TryEntry;
- function CatchEntry(firstLoc, paramId) {
- Entry.call(this);
- var t = (0, util$1.getTypes)();
- t.assertLiteral(firstLoc);
- t.assertIdentifier(paramId);
- this.firstLoc = firstLoc;
- this.paramId = paramId;
- }
- (0, _util.inherits)(CatchEntry, Entry);
- exports.CatchEntry = CatchEntry;
- function FinallyEntry(firstLoc, afterLoc) {
- Entry.call(this);
- var t = (0, util$1.getTypes)();
- t.assertLiteral(firstLoc);
- t.assertLiteral(afterLoc);
- this.firstLoc = firstLoc;
- this.afterLoc = afterLoc;
- }
- (0, _util.inherits)(FinallyEntry, Entry);
- exports.FinallyEntry = FinallyEntry;
- function LabeledEntry(breakLoc, label) {
- Entry.call(this);
- var t = (0, util$1.getTypes)();
- t.assertLiteral(breakLoc);
- t.assertIdentifier(label);
- this.breakLoc = breakLoc;
- this.label = label;
- }
- (0, _util.inherits)(LabeledEntry, Entry);
- exports.LabeledEntry = LabeledEntry;
- function LeapManager(emitter) {
- _assert["default"].ok(this instanceof LeapManager);
- _assert["default"].ok(emitter instanceof emit$1.Emitter);
- this.emitter = emitter;
- this.entryStack = [new FunctionEntry(emitter.finalLoc)];
- }
- var LMp = LeapManager.prototype;
- exports.LeapManager = LeapManager;
- LMp.withEntry = function (entry, callback) {
- _assert["default"].ok(entry instanceof Entry);
- this.entryStack.push(entry);
- try {
- callback.call(this.emitter);
- } finally {
- var popped = this.entryStack.pop();
- _assert["default"].strictEqual(popped, entry);
- }
- };
- LMp._findLeapLocation = function (property, label) {
- for (var i = this.entryStack.length - 1; i >= 0; --i) {
- var entry = this.entryStack[i];
- var loc = entry[property];
- if (loc) {
- if (label) {
- if (entry.label && entry.label.name === label.name) {
- return loc;
- }
- } else if (entry instanceof LabeledEntry) ; else {
- return loc;
- }
- }
- }
- return null;
- };
- LMp.getBreakLoc = function (label) {
- return this._findLeapLocation("breakLoc", label);
- };
- LMp.getContinueLoc = function (label) {
- return this._findLeapLocation("continueLoc", label);
- };
- });
- unwrapExports(leap);
- var leap_1 = leap.FunctionEntry;
- var leap_2 = leap.LoopEntry;
- var leap_3 = leap.SwitchEntry;
- var leap_4 = leap.TryEntry;
- var leap_5 = leap.CatchEntry;
- var leap_6 = leap.FinallyEntry;
- var leap_7 = leap.LabeledEntry;
- var leap_8 = leap.LeapManager;
- var originalObject = Object;
- var originalDefProp = Object.defineProperty;
- var originalCreate = Object.create;
- function defProp(obj, name, value) {
- if (originalDefProp) try {
- originalDefProp.call(originalObject, obj, name, {
- value: value
- });
- } catch (definePropertyIsBrokenInIE8) {
- obj[name] = value;
- } else {
- obj[name] = value;
- }
- }
- function makeSafeToCall(fun) {
- if (fun) {
- defProp(fun, "call", fun.call);
- defProp(fun, "apply", fun.apply);
- }
- return fun;
- }
- makeSafeToCall(originalDefProp);
- makeSafeToCall(originalCreate);
- var hasOwn$1 = makeSafeToCall(Object.prototype.hasOwnProperty);
- var numToStr = makeSafeToCall(Number.prototype.toString);
- var strSlice = makeSafeToCall(String.prototype.slice);
- var cloner = function cloner() {};
- function create(prototype) {
- if (originalCreate) {
- return originalCreate.call(originalObject, prototype);
- }
- cloner.prototype = prototype || null;
- return new cloner();
- }
- var rand = Math.random;
- var uniqueKeys = create(null);
- function makeUniqueKey() {
- do {
- var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2));
- } while (hasOwn$1.call(uniqueKeys, uniqueKey));
- return uniqueKeys[uniqueKey] = uniqueKey;
- }
- function internString(str) {
- var obj = {};
- obj[str] = true;
- return Object.keys(obj)[0];
- }
- var makeUniqueKey_1 = makeUniqueKey;
- var originalGetOPNs = Object.getOwnPropertyNames;
- Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
- for (var names = originalGetOPNs(object), src = 0, dst = 0, len = names.length; src < len; ++src) {
- if (!hasOwn$1.call(uniqueKeys, names[src])) {
- if (src > dst) {
- names[dst] = names[src];
- }
- ++dst;
- }
- }
- names.length = dst;
- return names;
- };
- function defaultCreatorFn(object) {
- return create(null);
- }
- function makeAccessor(secretCreatorFn) {
- var brand = makeUniqueKey();
- var passkey = create(null);
- secretCreatorFn = secretCreatorFn || defaultCreatorFn;
- function register(object) {
- var secret;
- function vault(key, forget) {
- if (key === passkey) {
- return forget ? secret = null : secret || (secret = secretCreatorFn(object));
- }
- }
- defProp(object, brand, vault);
- }
- function accessor(object) {
- if (!hasOwn$1.call(object, brand)) register(object);
- return object[brand](passkey);
- }
- accessor.forget = function (object) {
- if (hasOwn$1.call(object, brand)) object[brand](passkey, true);
- };
- return accessor;
- }
- var makeAccessor_1 = makeAccessor;
- var _private = {
- makeUniqueKey: makeUniqueKey_1,
- makeAccessor: makeAccessor_1
- };
- var meta = createCommonjsModule(function (module, exports) {
- var _assert = _interopRequireDefault(assert$2);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- var m = (0, _private.makeAccessor)();
- var hasOwn = Object.prototype.hasOwnProperty;
- function makePredicate(propertyName, knownTypes) {
- function onlyChildren(node) {
- var t = (0, util$1.getTypes)();
- t.assertNode(node);
- var result = false;
- function check(child) {
- if (result) ; else if (Array.isArray(child)) {
- child.some(check);
- } else if (t.isNode(child)) {
- _assert["default"].strictEqual(result, false);
- result = predicate(child);
- }
- return result;
- }
- var keys = t.VISITOR_KEYS[node.type];
- if (keys) {
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- var child = node[key];
- check(child);
- }
- }
- return result;
- }
- function predicate(node) {
- (0, util$1.getTypes)().assertNode(node);
- var meta = m(node);
- if (hasOwn.call(meta, propertyName)) return meta[propertyName];
- if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false;
- if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true;
- return meta[propertyName] = onlyChildren(node);
- }
- predicate.onlyChildren = onlyChildren;
- return predicate;
- }
- var opaqueTypes = {
- FunctionExpression: true,
- ArrowFunctionExpression: true
- };
- var sideEffectTypes = {
- CallExpression: true,
- ForInStatement: true,
- UnaryExpression: true,
- BinaryExpression: true,
- AssignmentExpression: true,
- UpdateExpression: true,
- NewExpression: true
- };
- var leapTypes = {
- YieldExpression: true,
- BreakStatement: true,
- ContinueStatement: true,
- ReturnStatement: true,
- ThrowStatement: true
- };
- for (var type in leapTypes) {
- if (hasOwn.call(leapTypes, type)) {
- sideEffectTypes[type] = leapTypes[type];
- }
- }
- exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes);
- exports.containsLeap = makePredicate("containsLeap", leapTypes);
- });
- unwrapExports(meta);
- var meta_1 = meta.hasSideEffects;
- var meta_2 = meta.containsLeap;
- var emit$1 = createCommonjsModule(function (module, exports) {
- var _assert = _interopRequireDefault(assert$2);
- var leap$1 = _interopRequireWildcard(leap);
- var meta$1 = _interopRequireWildcard(meta);
- var util = _interopRequireWildcard(util$1);
- function _interopRequireWildcard(obj) {
- if (obj && obj.__esModule) {
- return obj;
- } else {
- var newObj = {};
- if (obj != null) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
- if (desc.get || desc.set) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
- }
- }
- }
- newObj["default"] = obj;
- return newObj;
- }
- }
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- var hasOwn = Object.prototype.hasOwnProperty;
- function Emitter(contextId) {
- _assert["default"].ok(this instanceof Emitter);
- util.getTypes().assertIdentifier(contextId);
- this.nextTempId = 0;
- this.contextId = contextId;
- this.listing = [];
- this.marked = [true];
- this.insertedLocs = new Set();
- this.finalLoc = this.loc();
- this.tryEntries = [];
- this.leapManager = new leap$1.LeapManager(this);
- }
- var Ep = Emitter.prototype;
- exports.Emitter = Emitter;
- Ep.loc = function () {
- var l = util.getTypes().numericLiteral(-1);
- this.insertedLocs.add(l);
- return l;
- };
- Ep.getInsertedLocs = function () {
- return this.insertedLocs;
- };
- Ep.getContextId = function () {
- return util.getTypes().clone(this.contextId);
- };
- Ep.mark = function (loc) {
- util.getTypes().assertLiteral(loc);
- var index = this.listing.length;
- if (loc.value === -1) {
- loc.value = index;
- } else {
- _assert["default"].strictEqual(loc.value, index);
- }
- this.marked[index] = true;
- return loc;
- };
- Ep.emit = function (node) {
- var t = util.getTypes();
- if (t.isExpression(node)) {
- node = t.expressionStatement(node);
- }
- t.assertStatement(node);
- this.listing.push(node);
- };
- Ep.emitAssign = function (lhs, rhs) {
- this.emit(this.assign(lhs, rhs));
- return lhs;
- };
- Ep.assign = function (lhs, rhs) {
- var t = util.getTypes();
- return t.expressionStatement(t.assignmentExpression("=", t.cloneDeep(lhs), rhs));
- };
- Ep.contextProperty = function (name, computed) {
- var t = util.getTypes();
- return t.memberExpression(this.getContextId(), computed ? t.stringLiteral(name) : t.identifier(name), !!computed);
- };
- Ep.stop = function (rval) {
- if (rval) {
- this.setReturnValue(rval);
- }
- this.jump(this.finalLoc);
- };
- Ep.setReturnValue = function (valuePath) {
- util.getTypes().assertExpression(valuePath.value);
- this.emitAssign(this.contextProperty("rval"), this.explodeExpression(valuePath));
- };
- Ep.clearPendingException = function (tryLoc, assignee) {
- var t = util.getTypes();
- t.assertLiteral(tryLoc);
- var catchCall = t.callExpression(this.contextProperty("catch", true), [t.clone(tryLoc)]);
- if (assignee) {
- this.emitAssign(assignee, catchCall);
- } else {
- this.emit(catchCall);
- }
- };
- Ep.jump = function (toLoc) {
- this.emitAssign(this.contextProperty("next"), toLoc);
- this.emit(util.getTypes().breakStatement());
- };
- Ep.jumpIf = function (test, toLoc) {
- var t = util.getTypes();
- t.assertExpression(test);
- t.assertLiteral(toLoc);
- this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
- };
- Ep.jumpIfNot = function (test, toLoc) {
- var t = util.getTypes();
- t.assertExpression(test);
- t.assertLiteral(toLoc);
- var negatedTest;
- if (t.isUnaryExpression(test) && test.operator === "!") {
- negatedTest = test.argument;
- } else {
- negatedTest = t.unaryExpression("!", test);
- }
- this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty("next"), toLoc), t.breakStatement()])));
- };
- Ep.makeTempVar = function () {
- return this.contextProperty("t" + this.nextTempId++);
- };
- Ep.getContextFunction = function (id) {
- var t = util.getTypes();
- return t.functionExpression(id || null, [this.getContextId()], t.blockStatement([this.getDispatchLoop()]), false, false);
- };
- Ep.getDispatchLoop = function () {
- var self = this;
- var t = util.getTypes();
- var cases = [];
- var current;
- var alreadyEnded = false;
- self.listing.forEach(function (stmt, i) {
- if (self.marked.hasOwnProperty(i)) {
- cases.push(t.switchCase(t.numericLiteral(i), current = []));
- alreadyEnded = false;
- }
- if (!alreadyEnded) {
- current.push(stmt);
- if (t.isCompletionStatement(stmt)) alreadyEnded = true;
- }
- });
- this.finalLoc.value = this.listing.length;
- cases.push(t.switchCase(this.finalLoc, []), t.switchCase(t.stringLiteral("end"), [t.returnStatement(t.callExpression(this.contextProperty("stop"), []))]));
- return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression("=", this.contextProperty("prev"), this.contextProperty("next")), cases));
- };
- Ep.getTryLocsList = function () {
- if (this.tryEntries.length === 0) {
- return null;
- }
- var t = util.getTypes();
- var lastLocValue = 0;
- return t.arrayExpression(this.tryEntries.map(function (tryEntry) {
- var thisLocValue = tryEntry.firstLoc.value;
- _assert["default"].ok(thisLocValue >= lastLocValue, "try entries out of order");
- lastLocValue = thisLocValue;
- var ce = tryEntry.catchEntry;
- var fe = tryEntry.finallyEntry;
- var locs = [tryEntry.firstLoc, ce ? ce.firstLoc : null];
- if (fe) {
- locs[2] = fe.firstLoc;
- locs[3] = fe.afterLoc;
- }
- return t.arrayExpression(locs.map(function (loc) {
- return loc && t.clone(loc);
- }));
- }));
- };
- Ep.explode = function (path, ignoreResult) {
- var t = util.getTypes();
- var node = path.node;
- var self = this;
- t.assertNode(node);
- if (t.isDeclaration(node)) throw getDeclError(node);
- if (t.isStatement(node)) return self.explodeStatement(path);
- if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult);
- switch (node.type) {
- case "Program":
- return path.get("body").map(self.explodeStatement, self);
- case "VariableDeclarator":
- throw getDeclError(node);
- case "Property":
- case "SwitchCase":
- case "CatchClause":
- throw new Error(node.type + " nodes should be handled by their parents");
- default:
- throw new Error("unknown Node of type " + JSON.stringify(node.type));
- }
- };
- function getDeclError(node) {
- return new Error("all declarations should have been transformed into " + "assignments before the Exploder began its work: " + JSON.stringify(node));
- }
- Ep.explodeStatement = function (path, labelId) {
- var t = util.getTypes();
- var stmt = path.node;
- var self = this;
- var before, after, head;
- t.assertStatement(stmt);
- if (labelId) {
- t.assertIdentifier(labelId);
- } else {
- labelId = null;
- }
- if (t.isBlockStatement(stmt)) {
- path.get("body").forEach(function (path) {
- self.explodeStatement(path);
- });
- return;
- }
- if (!meta$1.containsLeap(stmt)) {
- self.emit(stmt);
- return;
- }
- switch (stmt.type) {
- case "ExpressionStatement":
- self.explodeExpression(path.get("expression"), true);
- break;
- case "LabeledStatement":
- after = this.loc();
- self.leapManager.withEntry(new leap$1.LabeledEntry(after, stmt.label), function () {
- self.explodeStatement(path.get("body"), stmt.label);
- });
- self.mark(after);
- break;
- case "WhileStatement":
- before = this.loc();
- after = this.loc();
- self.mark(before);
- self.jumpIfNot(self.explodeExpression(path.get("test")), after);
- self.leapManager.withEntry(new leap$1.LoopEntry(after, before, labelId), function () {
- self.explodeStatement(path.get("body"));
- });
- self.jump(before);
- self.mark(after);
- break;
- case "DoWhileStatement":
- var first = this.loc();
- var test = this.loc();
- after = this.loc();
- self.mark(first);
- self.leapManager.withEntry(new leap$1.LoopEntry(after, test, labelId), function () {
- self.explode(path.get("body"));
- });
- self.mark(test);
- self.jumpIf(self.explodeExpression(path.get("test")), first);
- self.mark(after);
- break;
- case "ForStatement":
- head = this.loc();
- var update = this.loc();
- after = this.loc();
- if (stmt.init) {
- self.explode(path.get("init"), true);
- }
- self.mark(head);
- if (stmt.test) {
- self.jumpIfNot(self.explodeExpression(path.get("test")), after);
- }
- self.leapManager.withEntry(new leap$1.LoopEntry(after, update, labelId), function () {
- self.explodeStatement(path.get("body"));
- });
- self.mark(update);
- if (stmt.update) {
- self.explode(path.get("update"), true);
- }
- self.jump(head);
- self.mark(after);
- break;
- case "TypeCastExpression":
- return self.explodeExpression(path.get("expression"));
- case "ForInStatement":
- head = this.loc();
- after = this.loc();
- var keyIterNextFn = self.makeTempVar();
- self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty("keys"), [self.explodeExpression(path.get("right"))]));
- self.mark(head);
- var keyInfoTmpVar = self.makeTempVar();
- self.jumpIf(t.memberExpression(t.assignmentExpression("=", keyInfoTmpVar, t.callExpression(t.cloneDeep(keyIterNextFn), [])), t.identifier("done"), false), after);
- self.emitAssign(stmt.left, t.memberExpression(t.cloneDeep(keyInfoTmpVar), t.identifier("value"), false));
- self.leapManager.withEntry(new leap$1.LoopEntry(after, head, labelId), function () {
- self.explodeStatement(path.get("body"));
- });
- self.jump(head);
- self.mark(after);
- break;
- case "BreakStatement":
- self.emitAbruptCompletion({
- type: "break",
- target: self.leapManager.getBreakLoc(stmt.label)
- });
- break;
- case "ContinueStatement":
- self.emitAbruptCompletion({
- type: "continue",
- target: self.leapManager.getContinueLoc(stmt.label)
- });
- break;
- case "SwitchStatement":
- var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get("discriminant")));
- after = this.loc();
- var defaultLoc = this.loc();
- var condition = defaultLoc;
- var caseLocs = [];
- var cases = stmt.cases || [];
- for (var i = cases.length - 1; i >= 0; --i) {
- var c = cases[i];
- t.assertSwitchCase(c);
- if (c.test) {
- condition = t.conditionalExpression(t.binaryExpression("===", t.cloneDeep(disc), c.test), caseLocs[i] = this.loc(), condition);
- } else {
- caseLocs[i] = defaultLoc;
- }
- }
- var discriminant = path.get("discriminant");
- util.replaceWithOrRemove(discriminant, condition);
- self.jump(self.explodeExpression(discriminant));
- self.leapManager.withEntry(new leap$1.SwitchEntry(after), function () {
- path.get("cases").forEach(function (casePath) {
- var i = casePath.key;
- self.mark(caseLocs[i]);
- casePath.get("consequent").forEach(function (path) {
- self.explodeStatement(path);
- });
- });
- });
- self.mark(after);
- if (defaultLoc.value === -1) {
- self.mark(defaultLoc);
- _assert["default"].strictEqual(after.value, defaultLoc.value);
- }
- break;
- case "IfStatement":
- var elseLoc = stmt.alternate && this.loc();
- after = this.loc();
- self.jumpIfNot(self.explodeExpression(path.get("test")), elseLoc || after);
- self.explodeStatement(path.get("consequent"));
- if (elseLoc) {
- self.jump(after);
- self.mark(elseLoc);
- self.explodeStatement(path.get("alternate"));
- }
- self.mark(after);
- break;
- case "ReturnStatement":
- self.emitAbruptCompletion({
- type: "return",
- value: self.explodeExpression(path.get("argument"))
- });
- break;
- case "WithStatement":
- throw new Error("WithStatement not supported in generator functions.");
- case "TryStatement":
- after = this.loc();
- var handler = stmt.handler;
- var catchLoc = handler && this.loc();
- var catchEntry = catchLoc && new leap$1.CatchEntry(catchLoc, handler.param);
- var finallyLoc = stmt.finalizer && this.loc();
- var finallyEntry = finallyLoc && new leap$1.FinallyEntry(finallyLoc, after);
- var tryEntry = new leap$1.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry);
- self.tryEntries.push(tryEntry);
- self.updateContextPrevLoc(tryEntry.firstLoc);
- self.leapManager.withEntry(tryEntry, function () {
- self.explodeStatement(path.get("block"));
- if (catchLoc) {
- if (finallyLoc) {
- self.jump(finallyLoc);
- } else {
- self.jump(after);
- }
- self.updateContextPrevLoc(self.mark(catchLoc));
- var bodyPath = path.get("handler.body");
- var safeParam = self.makeTempVar();
- self.clearPendingException(tryEntry.firstLoc, safeParam);
- bodyPath.traverse(catchParamVisitor, {
- getSafeParam: function getSafeParam() {
- return t.cloneDeep(safeParam);
- },
- catchParamName: handler.param.name
- });
- self.leapManager.withEntry(catchEntry, function () {
- self.explodeStatement(bodyPath);
- });
- }
- if (finallyLoc) {
- self.updateContextPrevLoc(self.mark(finallyLoc));
- self.leapManager.withEntry(finallyEntry, function () {
- self.explodeStatement(path.get("finalizer"));
- });
- self.emit(t.returnStatement(t.callExpression(self.contextProperty("finish"), [finallyEntry.firstLoc])));
- }
- });
- self.mark(after);
- break;
- case "ThrowStatement":
- self.emit(t.throwStatement(self.explodeExpression(path.get("argument"))));
- break;
- default:
- throw new Error("unknown Statement of type " + JSON.stringify(stmt.type));
- }
- };
- var catchParamVisitor = {
- Identifier: function Identifier(path, state) {
- if (path.node.name === state.catchParamName && util.isReference(path)) {
- util.replaceWithOrRemove(path, state.getSafeParam());
- }
- },
- Scope: function Scope(path, state) {
- if (path.scope.hasOwnBinding(state.catchParamName)) {
- path.skip();
- }
- }
- };
- Ep.emitAbruptCompletion = function (record) {
- if (!isValidCompletion(record)) {
- _assert["default"].ok(false, "invalid completion record: " + JSON.stringify(record));
- }
- _assert["default"].notStrictEqual(record.type, "normal", "normal completions are not abrupt");
- var t = util.getTypes();
- var abruptArgs = [t.stringLiteral(record.type)];
- if (record.type === "break" || record.type === "continue") {
- t.assertLiteral(record.target);
- abruptArgs[1] = this.insertedLocs.has(record.target) ? record.target : t.cloneDeep(record.target);
- } else if (record.type === "return" || record.type === "throw") {
- if (record.value) {
- t.assertExpression(record.value);
- abruptArgs[1] = this.insertedLocs.has(record.value) ? record.value : t.cloneDeep(record.value);
- }
- }
- this.emit(t.returnStatement(t.callExpression(this.contextProperty("abrupt"), abruptArgs)));
- };
- function isValidCompletion(record) {
- var type = record.type;
- if (type === "normal") {
- return !hasOwn.call(record, "target");
- }
- if (type === "break" || type === "continue") {
- return !hasOwn.call(record, "value") && util.getTypes().isLiteral(record.target);
- }
- if (type === "return" || type === "throw") {
- return hasOwn.call(record, "value") && !hasOwn.call(record, "target");
- }
- return false;
- }
- Ep.getUnmarkedCurrentLoc = function () {
- return util.getTypes().numericLiteral(this.listing.length);
- };
- Ep.updateContextPrevLoc = function (loc) {
- var t = util.getTypes();
- if (loc) {
- t.assertLiteral(loc);
- if (loc.value === -1) {
- loc.value = this.listing.length;
- } else {
- _assert["default"].strictEqual(loc.value, this.listing.length);
- }
- } else {
- loc = this.getUnmarkedCurrentLoc();
- }
- this.emitAssign(this.contextProperty("prev"), loc);
- };
- Ep.explodeExpression = function (path, ignoreResult) {
- var t = util.getTypes();
- var expr = path.node;
- if (expr) {
- t.assertExpression(expr);
- } else {
- return expr;
- }
- var self = this;
- var result;
- var after;
- function finish(expr) {
- t.assertExpression(expr);
- if (ignoreResult) {
- self.emit(expr);
- } else {
- return expr;
- }
- }
- if (!meta$1.containsLeap(expr)) {
- return finish(expr);
- }
- var hasLeapingChildren = meta$1.containsLeap.onlyChildren(expr);
- function explodeViaTempVar(tempVar, childPath, ignoreChildResult) {
- _assert["default"].ok(!ignoreChildResult || !tempVar, "Ignoring the result of a child expression but forcing it to " + "be assigned to a temporary variable?");
- var result = self.explodeExpression(childPath, ignoreChildResult);
- if (ignoreChildResult) ; else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) {
- result = self.emitAssign(tempVar || self.makeTempVar(), result);
- }
- return result;
- }
- switch (expr.type) {
- case "MemberExpression":
- return finish(t.memberExpression(self.explodeExpression(path.get("object")), expr.computed ? explodeViaTempVar(null, path.get("property")) : expr.property, expr.computed));
- case "CallExpression":
- var calleePath = path.get("callee");
- var argsPath = path.get("arguments");
- var newCallee;
- var newArgs = [];
- var hasLeapingArgs = false;
- argsPath.forEach(function (argPath) {
- hasLeapingArgs = hasLeapingArgs || meta$1.containsLeap(argPath.node);
- });
- if (t.isMemberExpression(calleePath.node)) {
- if (hasLeapingArgs) {
- var newObject = explodeViaTempVar(self.makeTempVar(), calleePath.get("object"));
- var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get("property")) : calleePath.node.property;
- newArgs.unshift(newObject);
- newCallee = t.memberExpression(t.memberExpression(t.cloneDeep(newObject), newProperty, calleePath.node.computed), t.identifier("call"), false);
- } else {
- newCallee = self.explodeExpression(calleePath);
- }
- } else {
- newCallee = explodeViaTempVar(null, calleePath);
- if (t.isMemberExpression(newCallee)) {
- newCallee = t.sequenceExpression([t.numericLiteral(0), t.cloneDeep(newCallee)]);
- }
- }
- argsPath.forEach(function (argPath) {
- newArgs.push(explodeViaTempVar(null, argPath));
- });
- return finish(t.callExpression(newCallee, newArgs.map(function (arg) {
- return t.cloneDeep(arg);
- })));
- case "NewExpression":
- return finish(t.newExpression(explodeViaTempVar(null, path.get("callee")), path.get("arguments").map(function (argPath) {
- return explodeViaTempVar(null, argPath);
- })));
- case "ObjectExpression":
- return finish(t.objectExpression(path.get("properties").map(function (propPath) {
- if (propPath.isObjectProperty()) {
- return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get("value")), propPath.node.computed);
- } else {
- return propPath.node;
- }
- })));
- case "ArrayExpression":
- return finish(t.arrayExpression(path.get("elements").map(function (elemPath) {
- return explodeViaTempVar(null, elemPath);
- })));
- case "SequenceExpression":
- var lastIndex = expr.expressions.length - 1;
- path.get("expressions").forEach(function (exprPath) {
- if (exprPath.key === lastIndex) {
- result = self.explodeExpression(exprPath, ignoreResult);
- } else {
- self.explodeExpression(exprPath, true);
- }
- });
- return result;
- case "LogicalExpression":
- after = this.loc();
- if (!ignoreResult) {
- result = self.makeTempVar();
- }
- var left = explodeViaTempVar(result, path.get("left"));
- if (expr.operator === "&&") {
- self.jumpIfNot(left, after);
- } else {
- _assert["default"].strictEqual(expr.operator, "||");
- self.jumpIf(left, after);
- }
- explodeViaTempVar(result, path.get("right"), ignoreResult);
- self.mark(after);
- return result;
- case "ConditionalExpression":
- var elseLoc = this.loc();
- after = this.loc();
- var test = self.explodeExpression(path.get("test"));
- self.jumpIfNot(test, elseLoc);
- if (!ignoreResult) {
- result = self.makeTempVar();
- }
- explodeViaTempVar(result, path.get("consequent"), ignoreResult);
- self.jump(after);
- self.mark(elseLoc);
- explodeViaTempVar(result, path.get("alternate"), ignoreResult);
- self.mark(after);
- return result;
- case "UnaryExpression":
- return finish(t.unaryExpression(expr.operator, self.explodeExpression(path.get("argument")), !!expr.prefix));
- case "BinaryExpression":
- return finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get("left")), explodeViaTempVar(null, path.get("right"))));
- case "AssignmentExpression":
- if (expr.operator === "=") {
- return finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get("left")), self.explodeExpression(path.get("right"))));
- }
- var lhs = self.explodeExpression(path.get("left"));
- var temp = self.emitAssign(self.makeTempVar(), lhs);
- return finish(t.assignmentExpression("=", t.cloneDeep(lhs), t.assignmentExpression(expr.operator, t.cloneDeep(temp), self.explodeExpression(path.get("right")))));
- case "UpdateExpression":
- return finish(t.updateExpression(expr.operator, self.explodeExpression(path.get("argument")), expr.prefix));
- case "YieldExpression":
- after = this.loc();
- var arg = expr.argument && self.explodeExpression(path.get("argument"));
- if (arg && expr.delegate) {
- var _result = self.makeTempVar();
- var _ret = t.returnStatement(t.callExpression(self.contextProperty("delegateYield"), [arg, t.stringLiteral(_result.property.name), after]));
- _ret.loc = expr.loc;
- self.emit(_ret);
- self.mark(after);
- return _result;
- }
- self.emitAssign(self.contextProperty("next"), after);
- var ret = t.returnStatement(t.cloneDeep(arg) || null);
- ret.loc = expr.loc;
- self.emit(ret);
- self.mark(after);
- return self.contextProperty("sent");
- default:
- throw new Error("unknown Expression of type " + JSON.stringify(expr.type));
- }
- };
- });
- unwrapExports(emit$1);
- var emit_1 = emit$1.Emitter;
- var replaceShorthandObjectMethod_1 = createCommonjsModule(function (module, exports) {
- exports.__esModule = true;
- exports["default"] = replaceShorthandObjectMethod;
- var util = _interopRequireWildcard(util$1);
- function _interopRequireWildcard(obj) {
- if (obj && obj.__esModule) {
- return obj;
- } else {
- var newObj = {};
- if (obj != null) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
- if (desc.get || desc.set) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
- }
- }
- }
- newObj["default"] = obj;
- return newObj;
- }
- }
- function replaceShorthandObjectMethod(path) {
- var t = util.getTypes();
- if (!path.node || !t.isFunction(path.node)) {
- throw new Error("replaceShorthandObjectMethod can only be called on Function AST node paths.");
- }
- if (!t.isObjectMethod(path.node)) {
- return path;
- }
- if (!path.node.generator) {
- return path;
- }
- var parameters = path.node.params.map(function (param) {
- return t.cloneDeep(param);
- });
- var functionExpression = t.functionExpression(null, parameters, t.cloneDeep(path.node.body), path.node.generator, path.node.async);
- util.replaceWithOrRemove(path, t.objectProperty(t.cloneDeep(path.node.key), functionExpression, path.node.computed, false));
- return path.get("value");
- }
- });
- unwrapExports(replaceShorthandObjectMethod_1);
- var visit$2 = createCommonjsModule(function (module, exports) {
- var _assert = _interopRequireDefault(assert$2);
- var _replaceShorthandObjectMethod = _interopRequireDefault(replaceShorthandObjectMethod_1);
- var util = _interopRequireWildcard(util$1);
- function _interopRequireWildcard(obj) {
- if (obj && obj.__esModule) {
- return obj;
- } else {
- var newObj = {};
- if (obj != null) {
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
- if (desc.get || desc.set) {
- Object.defineProperty(newObj, key, desc);
- } else {
- newObj[key] = obj[key];
- }
- }
- }
- }
- newObj["default"] = obj;
- return newObj;
- }
- }
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- exports.getVisitor = function (_ref) {
- var t = _ref.types;
- return {
- Method: function Method(path, state) {
- var node = path.node;
- if (!shouldRegenerate(node, state)) return;
- var container = t.functionExpression(null, [], t.cloneNode(node.body, false), node.generator, node.async);
- path.get("body").set("body", [t.returnStatement(t.callExpression(container, []))]);
- node.async = false;
- node.generator = false;
- path.get("body.body.0.argument.callee").unwrapFunctionEnvironment();
- },
- Function: {
- exit: util.wrapWithTypes(t, function (path, state) {
- var node = path.node;
- if (!shouldRegenerate(node, state)) return;
- path = (0, _replaceShorthandObjectMethod["default"])(path);
- node = path.node;
- var contextId = path.scope.generateUidIdentifier("context");
- var argsId = path.scope.generateUidIdentifier("args");
- path.ensureBlock();
- var bodyBlockPath = path.get("body");
- if (node.async) {
- bodyBlockPath.traverse(awaitVisitor);
- }
- bodyBlockPath.traverse(functionSentVisitor, {
- context: contextId
- });
- var outerBody = [];
- var innerBody = [];
- bodyBlockPath.get("body").forEach(function (childPath) {
- var node = childPath.node;
- if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {
- outerBody.push(node);
- } else if (node && node._blockHoist != null) {
- outerBody.push(node);
- } else {
- innerBody.push(node);
- }
- });
- if (outerBody.length > 0) {
- bodyBlockPath.node.body = innerBody;
- }
- var outerFnExpr = getOuterFnExpr(path);
- t.assertIdentifier(node.id);
- var innerFnId = t.identifier(node.id.name + "$");
- var vars = (0, hoist$1.hoist)(path);
- var context = {
- usesThis: false,
- usesArguments: false,
- getArgsId: function getArgsId() {
- return t.clone(argsId);
- }
- };
- path.traverse(argumentsThisVisitor, context);
- if (context.usesArguments) {
- vars = vars || t.variableDeclaration("var", []);
- var argumentIdentifier = t.identifier("arguments");
- argumentIdentifier._shadowedFunctionLiteral = path;
- vars.declarations.push(t.variableDeclarator(t.clone(argsId), argumentIdentifier));
- }
- var emitter = new emit$1.Emitter(contextId);
- emitter.explode(path.get("body"));
- if (vars && vars.declarations.length > 0) {
- outerBody.push(vars);
- }
- var wrapArgs = [emitter.getContextFunction(innerFnId)];
- var tryLocsList = emitter.getTryLocsList();
- if (node.generator) {
- wrapArgs.push(outerFnExpr);
- } else if (context.usesThis || tryLocsList) {
- wrapArgs.push(t.nullLiteral());
- }
- if (context.usesThis) {
- wrapArgs.push(t.thisExpression());
- } else if (tryLocsList) {
- wrapArgs.push(t.nullLiteral());
- }
- if (tryLocsList) {
- wrapArgs.push(tryLocsList);
- }
- var wrapCall = t.callExpression(util.runtimeProperty(node.async ? "async" : "wrap"), wrapArgs);
- outerBody.push(t.returnStatement(wrapCall));
- node.body = t.blockStatement(outerBody);
- path.get("body.body").forEach(function (p) {
- return p.scope.registerDeclaration(p);
- });
- var oldDirectives = bodyBlockPath.node.directives;
- if (oldDirectives) {
- node.body.directives = oldDirectives;
- }
- var wasGeneratorFunction = node.generator;
- if (wasGeneratorFunction) {
- node.generator = false;
- }
- if (node.async) {
- node.async = false;
- }
- if (wasGeneratorFunction && t.isExpression(node)) {
- util.replaceWithOrRemove(path, t.callExpression(util.runtimeProperty("mark"), [node]));
- path.addComment("leading", "#__PURE__");
- }
- var insertedLocs = emitter.getInsertedLocs();
- path.traverse({
- NumericLiteral: function NumericLiteral(path) {
- if (!insertedLocs.has(path.node)) {
- return;
- }
- path.replaceWith(t.numericLiteral(path.node.value));
- }
- });
- path.requeue();
- })
- }
- };
- };
- function shouldRegenerate(node, state) {
- if (node.generator) {
- if (node.async) {
- return state.opts.asyncGenerators !== false;
- } else {
- return state.opts.generators !== false;
- }
- } else if (node.async) {
- return state.opts.async !== false;
- } else {
- return false;
- }
- }
- function getOuterFnExpr(funPath) {
- var t = util.getTypes();
- var node = funPath.node;
- t.assertFunction(node);
- if (!node.id) {
- node.id = funPath.scope.parent.generateUidIdentifier("callee");
- }
- if (node.generator && t.isFunctionDeclaration(node)) {
- return getMarkedFunctionId(funPath);
- }
- return t.clone(node.id);
- }
- var getMarkInfo = (0, _private.makeAccessor)();
- function getMarkedFunctionId(funPath) {
- var t = util.getTypes();
- var node = funPath.node;
- t.assertIdentifier(node.id);
- var blockPath = funPath.findParent(function (path) {
- return path.isProgram() || path.isBlockStatement();
- });
- if (!blockPath) {
- return node.id;
- }
- var block = blockPath.node;
- _assert["default"].ok(Array.isArray(block.body));
- var info = getMarkInfo(block);
- if (!info.decl) {
- info.decl = t.variableDeclaration("var", []);
- blockPath.unshiftContainer("body", info.decl);
- info.declPath = blockPath.get("body.0");
- }
- _assert["default"].strictEqual(info.declPath.node, info.decl);
- var markedId = blockPath.scope.generateUidIdentifier("marked");
- var markCallExp = t.callExpression(util.runtimeProperty("mark"), [t.clone(node.id)]);
- var index = info.decl.declarations.push(t.variableDeclarator(markedId, markCallExp)) - 1;
- var markCallExpPath = info.declPath.get("declarations." + index + ".init");
- _assert["default"].strictEqual(markCallExpPath.node, markCallExp);
- markCallExpPath.addComment("leading", "#__PURE__");
- return t.clone(markedId);
- }
- var argumentsThisVisitor = {
- "FunctionExpression|FunctionDeclaration|Method": function FunctionExpressionFunctionDeclarationMethod(path) {
- path.skip();
- },
- Identifier: function Identifier(path, state) {
- if (path.node.name === "arguments" && util.isReference(path)) {
- util.replaceWithOrRemove(path, state.getArgsId());
- state.usesArguments = true;
- }
- },
- ThisExpression: function ThisExpression(path, state) {
- state.usesThis = true;
- }
- };
- var functionSentVisitor = {
- MetaProperty: function MetaProperty(path) {
- var node = path.node;
- if (node.meta.name === "function" && node.property.name === "sent") {
- var t = util.getTypes();
- util.replaceWithOrRemove(path, t.memberExpression(t.clone(this.context), t.identifier("_sent")));
- }
- }
- };
- var awaitVisitor = {
- Function: function Function(path) {
- path.skip();
- },
- AwaitExpression: function AwaitExpression(path) {
- var t = util.getTypes();
- var argument = path.node.argument;
- util.replaceWithOrRemove(path, t.yieldExpression(t.callExpression(util.runtimeProperty("awrap"), [argument]), false));
- }
- };
- });
- unwrapExports(visit$2);
- var visit_1 = visit$2.getVisitor;
- var lib$b = createCommonjsModule(function (module, exports) {
- exports.__esModule = true;
- exports["default"] = _default;
- function _default(context) {
- var plugin = {
- visitor: (0, visit$2.getVisitor)(context)
- };
- var version = context && context.version;
- if (version && parseInt(version, 10) >= 7) {
- plugin.name = "regenerator-transform";
- }
- return plugin;
- }
- });
- var transformRegenerator = unwrapExports(lib$b);
- var transformReservedWords = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-reserved-words",
- visitor: {
- "BindingIdentifier|ReferencedIdentifier": function BindingIdentifierReferencedIdentifier(path) {
- if (!isValidES3Identifier(path.node.name)) {
- path.scope.rename(path.node.name);
- }
- }
- }
- };
- });
- var caller = function () {
- 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(function (module) {
- var isWindows = process.platform === 'win32';
- var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
- var splitTailRe = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
- var win32 = {};
- function win32SplitPath(filename) {
- var result = splitDeviceRe.exec(filename),
- device = (result[1] || '') + (result[2] || ''),
- tail = result[3] || '';
- var result2 = splitTailRe.exec(tail),
- dir = result2[1],
- basename = result2[2],
- ext = result2[3];
- return [device, dir, basename, ext];
- }
- 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 !== 4) {
- throw new TypeError("Invalid path '" + pathString + "'");
- }
- return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
- base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
- };
- };
- var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{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 !== 4) {
- throw new TypeError("Invalid path '" + pathString + "'");
- }
- allParts[1] = allParts[1] || '';
- allParts[2] = allParts[2] || '';
- allParts[3] = allParts[3] || '';
- return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
- base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
- };
- };
- if (isWindows) module.exports = win32.parse;else module.exports = posix.parse;
- module.exports.posix = posix.parse;
- module.exports.win32 = win32.parse;
- });
- var pathParse_1 = pathParse.posix;
- var pathParse_2 = pathParse.win32;
- var parse$5 = path$1.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$5(absoluteStart);
- while (parsed.dir !== paths[paths.length - 1]) {
- paths.push(parsed.dir);
- parsed = parse$5(parsed.dir);
- }
- return paths.reduce(function (dirs, aPath) {
- return dirs.concat(modules.map(function (moduleDir) {
- return path$1.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$3 = function (x, opts) {
- return opts || {};
- };
- var assert$3 = true;
- var async_hooks = ">= 8";
- var buffer_ieee754 = "< 0.9.7";
- var buffer = true;
- var child_process = true;
- var cluster = true;
- var console$1 = true;
- var constants = true;
- var crypto = true;
- var _debug_agent = ">= 1 && < 8";
- var _debugger = "< 8";
- var dgram = true;
- var dns = true;
- var domain = true;
- var events = true;
- var freelist = "< 6";
- var fs$1 = true;
- var _http_agent = ">= 0.11.1";
- var _http_client = ">= 0.11.1";
- var _http_common = ">= 0.11.1";
- var _http_incoming = ">= 0.11.1";
- var _http_outgoing = ">= 0.11.1";
- var _http_server = ">= 0.11.1";
- var http = true;
- var http2 = ">= 8.8";
- var https = true;
- var inspector = ">= 8.0.0";
- var _linklist = "< 8";
- var module = true;
- var net = true;
- var os = true;
- var path$3 = true;
- var perf_hooks = ">= 8.5";
- var process$1 = ">= 1";
- var punycode = true;
- var querystring = true;
- var readline = true;
- var repl = true;
- var smalloc = ">= 0.11.5 && < 3";
- var _stream_duplex = ">= 0.9.4";
- var _stream_transform = ">= 0.9.4";
- var _stream_wrap = ">= 1.4.1";
- var _stream_passthrough = ">= 0.9.4";
- var _stream_readable = ">= 0.9.4";
- var _stream_writable = ">= 0.9.4";
- var stream = true;
- var string_decoder = true;
- var sys = true;
- var timers = true;
- var _tls_common = ">= 0.11.13";
- var _tls_legacy = ">= 0.11.3 && < 10";
- var _tls_wrap = ">= 0.11.3";
- var tls = true;
- var trace_events = ">= 10";
- var tty = true;
- var url = true;
- var util$2 = true;
- var v8 = ">= 1";
- var vm = true;
- var wasi = ">= 13.4 && < 13.5";
- var worker_threads = ">= 11.7";
- var zlib = true;
- var core = {
- assert: assert$3,
- async_hooks: async_hooks,
- buffer_ieee754: buffer_ieee754,
- buffer: buffer,
- child_process: child_process,
- cluster: cluster,
- console: console$1,
- constants: constants,
- crypto: crypto,
- _debug_agent: _debug_agent,
- _debugger: _debugger,
- dgram: dgram,
- dns: dns,
- domain: domain,
- events: events,
- freelist: freelist,
- fs: fs$1,
- "fs/promises": ">= 10 && < 10.1",
- _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,
- 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$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,
- string_decoder: string_decoder,
- sys: sys,
- timers: timers,
- _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,
- "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 core$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- assert: assert$3,
- async_hooks: async_hooks,
- buffer_ieee754: buffer_ieee754,
- buffer: buffer,
- child_process: child_process,
- cluster: cluster,
- console: console$1,
- constants: constants,
- crypto: crypto,
- _debug_agent: _debug_agent,
- _debugger: _debugger,
- dgram: dgram,
- dns: dns,
- domain: domain,
- events: events,
- freelist: freelist,
- fs: fs$1,
- _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,
- net: net,
- os: os,
- path: path$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,
- string_decoder: string_decoder,
- sys: sys,
- timers: timers,
- _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,
- v8: v8,
- vm: vm,
- wasi: wasi,
- worker_threads: worker_threads,
- zlib: zlib,
- 'default': core
- });
- var data = getCjsExportFromNamespace(core$1);
- 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 = Number(current[i] || 0);
- var ver = Number(versionParts[i] || 0);
- if (cur === ver) {
- 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$2 = {};
- for (var mod in data) {
- if (Object.prototype.hasOwnProperty.call(data, mod)) {
- core$2[mod] = versionIncluded(data[mod]);
- }
- }
- var core_1 = core$2;
- var isCore = function isCore(x) {
- return Object.prototype.hasOwnProperty.call(core_1, x);
- };
- var defaultIsFile = function isFile(file, cb) {
- fs.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 = function isDirectory(dir, cb) {
- fs.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 maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) {
- if (opts && opts.preserveSymlinks === false) {
- fs.realpath(x, function (realPathErr, realPath) {
- if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);else cb(null, realPathErr ? x : realPath);
- });
- } else {
- cb(null, x);
- }
- };
- 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 nextTick(function () {
- cb(err);
- });
- }
- opts = normalizeOptions$3(x, opts);
- var isFile = opts.isFile || defaultIsFile;
- var isDirectory = opts.isDirectory || defaultIsDir;
- var readFile = opts.readFile || fs.readFile;
- var extensions = opts.extensions || ['.js'];
- var basedir = opts.basedir || path$1.dirname(caller());
- var parent = opts.filename || basedir;
- opts.paths = opts.paths || [];
- var absoluteStart = path$1.resolve(basedir);
- maybeUnwrapSymlink(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$1.resolve(basedir, x);
- if (x === '..' || x.slice(-1) === '/') res += '/';
- if (/\/$/.test(x) && res === basedir) {
- loadAsDirectory(res, opts["package"], onfile);
- } else loadAsFile(res, opts["package"], onfile);
- } else if (isCore(x)) {
- return cb(null, x);
- } else loadNodeModules(x, basedir, function (err, n, pkg) {
- if (err) cb(err);else if (n) {
- return maybeUnwrapSymlink(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) {
- maybeUnwrapSymlink(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$1.dirname(file), onpkg);
- function onpkg(err, pkg_, dir) {
- pkg = pkg_;
- if (err) return cb(err);
- if (dir && pkg && opts.pathFilter) {
- var rfile = path$1.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$1.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);
- maybeUnwrapSymlink(dir, opts, function (unwrapErr, pkgdir) {
- if (unwrapErr) return loadpkg(path$1.dirname(dir), cb);
- var pkgfile = path$1.join(pkgdir, 'package.json');
- isFile(pkgfile, function (err, ex) {
- if (!ex) return loadpkg(path$1.dirname(dir), cb);
- readFile(pkgfile, function (err, body) {
- if (err) cb(err);
- try {
- var pkg = JSON.parse(body);
- } catch (jsonErr) {}
- 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"];
- }
- maybeUnwrapSymlink(x, opts, function (unwrapErr, pkgdir) {
- if (unwrapErr) return cb(unwrapErr);
- var pkgfile = path$1.join(pkgdir, 'package.json');
- isFile(pkgfile, function (err, ex) {
- if (err) return cb(err);
- if (!ex) return loadAsFile(path$1.join(x, 'index'), fpkg, cb);
- readFile(pkgfile, function (err, body) {
- if (err) return cb(err);
- try {
- var pkg = JSON.parse(body);
- } catch (jsonErr) {}
- 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$1.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$1.join(x, 'index'), pkg, cb);
- var dir = path$1.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$1.join(x, 'index'), pkg, cb);
- });
- });
- return;
- }
- loadAsFile(path$1.join(x, '/index'), pkg, cb);
- });
- });
- });
- }
- function processDirs(cb, dirs) {
- if (dirs.length === 0) return cb(null, undefined);
- var dir = dirs[0];
- isDirectory(dir, isdir);
- function isdir(err, isdir) {
- if (err) return cb(err);
- if (!isdir) return processDirs(cb, dirs.slice(1));
- var file = path$1.join(dir, x);
- loadAsFile(file, opts["package"], onfile);
- }
- function onfile(err, m, pkg) {
- if (err) return cb(err);
- if (m) return cb(null, m, pkg);
- loadAsDirectory(path$1.join(dir, x), 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) {
- processDirs(cb, nodeModulesPaths(start, opts, x));
- }
- };
- var defaultIsFile$1 = function isFile(file) {
- try {
- var stat = fs.statSync(file);
- } catch (e) {
- if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
- throw e;
- }
- return stat.isFile() || stat.isFIFO();
- };
- var defaultIsDir$1 = function isDirectory(dir) {
- try {
- var stat = fs.statSync(dir);
- } catch (e) {
- if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
- throw e;
- }
- return stat.isDirectory();
- };
- var maybeUnwrapSymlink$1 = function maybeUnwrapSymlink(x, opts) {
- if (opts && opts.preserveSymlinks === false) {
- try {
- return fs.realpathSync(x);
- } catch (realPathErr) {
- if (realPathErr.code !== 'ENOENT') {
- throw realPathErr;
- }
- }
- }
- return x;
- };
- var sync = function (x, options) {
- if (typeof x !== 'string') {
- throw new TypeError('Path must be a string.');
- }
- var opts = normalizeOptions$3(x, options);
- var isFile = opts.isFile || defaultIsFile$1;
- var readFileSync = opts.readFileSync || fs.readFileSync;
- var isDirectory = opts.isDirectory || defaultIsDir$1;
- var extensions = opts.extensions || ['.js'];
- var basedir = opts.basedir || path$1.dirname(caller());
- var parent = opts.filename || basedir;
- opts.paths = opts.paths || [];
- var absoluteStart = maybeUnwrapSymlink$1(path$1.resolve(basedir), opts);
- if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
- var res = path$1.resolve(absoluteStart, x);
- if (x === '..' || x.slice(-1) === '/') res += '/';
- var m = loadAsFileSync(res) || loadAsDirectorySync(res);
- if (m) return maybeUnwrapSymlink$1(m, opts);
- } else if (isCore(x)) {
- return x;
- } else {
- var n = loadNodeModulesSync(x, absoluteStart);
- if (n) return maybeUnwrapSymlink$1(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$1.dirname(x));
- if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
- var rfile = path$1.relative(pkg.dir, x);
- var r = opts.pathFilter(pkg.pkg, x, rfile);
- if (r) {
- x = path$1.resolve(pkg.dir, r);
- }
- }
- 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$1.join(maybeUnwrapSymlink$1(dir, opts), 'package.json');
- if (!isFile(pkgfile)) {
- return loadpkg(path$1.dirname(dir));
- }
- var body = readFileSync(pkgfile);
- try {
- var pkg = JSON.parse(body);
- } catch (jsonErr) {}
- if (pkg && opts.packageFilter) {
- pkg = opts.packageFilter(pkg, dir);
- }
- return {
- pkg: pkg,
- dir: dir
- };
- }
- function loadAsDirectorySync(x) {
- var pkgfile = path$1.join(maybeUnwrapSymlink$1(x, opts), '/package.json');
- if (isFile(pkgfile)) {
- try {
- var body = readFileSync(pkgfile, 'UTF8');
- var pkg = JSON.parse(body);
- } catch (e) {}
- if (pkg && opts.packageFilter) {
- pkg = opts.packageFilter(pkg, x);
- }
- 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$1.resolve(x, pkg.main));
- if (m) return m;
- var n = loadAsDirectorySync(path$1.resolve(x, pkg.main));
- if (n) return n;
- } catch (e) {}
- }
- }
- return loadAsFileSync(path$1.join(x, '/index'));
- }
- function loadNodeModulesSync(x, start) {
- var dirs = nodeModulesPaths(start, opts, x);
- for (var i = 0; i < dirs.length; i++) {
- var dir = dirs[i];
- if (isDirectory(dir)) {
- var m = loadAsFileSync(path$1.join(dir, '/', x));
- if (m) return m;
- var n = loadAsDirectorySync(path$1.join(dir, '/', x));
- if (n) return n;
- }
- }
- }
- };
- var resolve$2 = createCommonjsModule(function (module, exports) {
- async.core = core_1;
- async.isCore = isCore;
- async.sync = sync;
- module.exports = async;
- });
- function hasMinVersion(minVersion, runtimeVersion) {
- if (!runtimeVersion) return true;
- if (semver.valid(runtimeVersion)) runtimeVersion = "^" + runtimeVersion;
- return !semver.intersects("<" + minVersion, runtimeVersion) && !semver.intersects(">=8.0.0", runtimeVersion);
- }
- function typeAnnotationToString(node) {
- switch (node.type) {
- case "GenericTypeAnnotation":
- if (isIdentifier(node.id, {
- name: "Array"
- })) return "array";
- break;
- case "StringTypeAnnotation":
- return "string";
- }
- }
- var getCoreJS2Definitions = (function (runtimeVersion) {
- var includeMathModule = hasMinVersion("7.0.1", runtimeVersion);
- return {
- BuiltIns: {
- Symbol: {
- stable: true,
- path: "symbol"
- },
- Promise: {
- stable: true,
- path: "promise"
- },
- Map: {
- stable: true,
- path: "map"
- },
- WeakMap: {
- stable: true,
- path: "weak-map"
- },
- Set: {
- stable: true,
- path: "set"
- },
- WeakSet: {
- stable: true,
- path: "weak-set"
- },
- setImmediate: {
- stable: true,
- path: "set-immediate"
- },
- clearImmediate: {
- stable: true,
- path: "clear-immediate"
- },
- parseFloat: {
- stable: true,
- path: "parse-float"
- },
- parseInt: {
- stable: true,
- path: "parse-int"
- }
- },
- StaticProperties: Object.assign({
- Array: {
- from: {
- stable: true,
- path: "array/from"
- },
- isArray: {
- stable: true,
- path: "array/is-array"
- },
- of: {
- stable: true,
- path: "array/of"
- }
- },
- JSON: {
- stringify: {
- stable: true,
- path: "json/stringify"
- }
- },
- Object: {
- assign: {
- stable: true,
- path: "object/assign"
- },
- create: {
- stable: true,
- path: "object/create"
- },
- defineProperties: {
- stable: true,
- path: "object/define-properties"
- },
- defineProperty: {
- stable: true,
- path: "object/define-property"
- },
- entries: {
- stable: true,
- path: "object/entries"
- },
- freeze: {
- stable: true,
- path: "object/freeze"
- },
- getOwnPropertyDescriptor: {
- stable: true,
- path: "object/get-own-property-descriptor"
- },
- getOwnPropertyDescriptors: {
- stable: true,
- path: "object/get-own-property-descriptors"
- },
- getOwnPropertyNames: {
- stable: true,
- path: "object/get-own-property-names"
- },
- getOwnPropertySymbols: {
- stable: true,
- path: "object/get-own-property-symbols"
- },
- getPrototypeOf: {
- stable: true,
- path: "object/get-prototype-of"
- },
- isExtensible: {
- stable: true,
- path: "object/is-extensible"
- },
- isFrozen: {
- stable: true,
- path: "object/is-frozen"
- },
- isSealed: {
- stable: true,
- path: "object/is-sealed"
- },
- is: {
- stable: true,
- path: "object/is"
- },
- keys: {
- stable: true,
- path: "object/keys"
- },
- preventExtensions: {
- stable: true,
- path: "object/prevent-extensions"
- },
- seal: {
- stable: true,
- path: "object/seal"
- },
- setPrototypeOf: {
- stable: true,
- path: "object/set-prototype-of"
- },
- values: {
- stable: true,
- path: "object/values"
- }
- }
- }, includeMathModule ? {
- Math: {
- acosh: {
- stable: true,
- path: "math/acosh"
- },
- asinh: {
- stable: true,
- path: "math/asinh"
- },
- atanh: {
- stable: true,
- path: "math/atanh"
- },
- cbrt: {
- stable: true,
- path: "math/cbrt"
- },
- clz32: {
- stable: true,
- path: "math/clz32"
- },
- cosh: {
- stable: true,
- path: "math/cosh"
- },
- expm1: {
- stable: true,
- path: "math/expm1"
- },
- fround: {
- stable: true,
- path: "math/fround"
- },
- hypot: {
- stable: true,
- path: "math/hypot"
- },
- imul: {
- stable: true,
- path: "math/imul"
- },
- log10: {
- stable: true,
- path: "math/log10"
- },
- log1p: {
- stable: true,
- path: "math/log1p"
- },
- log2: {
- stable: true,
- path: "math/log2"
- },
- sign: {
- stable: true,
- path: "math/sign"
- },
- sinh: {
- stable: true,
- path: "math/sinh"
- },
- tanh: {
- stable: true,
- path: "math/tanh"
- },
- trunc: {
- stable: true,
- path: "math/trunc"
- }
- }
- } : {}, {
- Symbol: {
- "for": {
- stable: true,
- path: "symbol/for"
- },
- hasInstance: {
- stable: true,
- path: "symbol/has-instance"
- },
- isConcatSpreadable: {
- stable: true,
- path: "symbol/is-concat-spreadable"
- },
- iterator: {
- stable: true,
- path: "symbol/iterator"
- },
- keyFor: {
- stable: true,
- path: "symbol/key-for"
- },
- match: {
- stable: true,
- path: "symbol/match"
- },
- replace: {
- stable: true,
- path: "symbol/replace"
- },
- search: {
- stable: true,
- path: "symbol/search"
- },
- species: {
- stable: true,
- path: "symbol/species"
- },
- split: {
- stable: true,
- path: "symbol/split"
- },
- toPrimitive: {
- stable: true,
- path: "symbol/to-primitive"
- },
- toStringTag: {
- stable: true,
- path: "symbol/to-string-tag"
- },
- unscopables: {
- stable: true,
- path: "symbol/unscopables"
- }
- },
- String: {
- at: {
- stable: true,
- path: "string/at"
- },
- fromCodePoint: {
- stable: true,
- path: "string/from-code-point"
- },
- raw: {
- stable: true,
- path: "string/raw"
- }
- },
- Number: {
- EPSILON: {
- stable: true,
- path: "number/epsilon"
- },
- isFinite: {
- stable: true,
- path: "number/is-finite"
- },
- isInteger: {
- stable: true,
- path: "number/is-integer"
- },
- isNaN: {
- stable: true,
- path: "number/is-nan"
- },
- isSafeInteger: {
- stable: true,
- path: "number/is-safe-integer"
- },
- MAX_SAFE_INTEGER: {
- stable: true,
- path: "number/max-safe-integer"
- },
- MIN_SAFE_INTEGER: {
- stable: true,
- path: "number/min-safe-integer"
- },
- parseFloat: {
- stable: true,
- path: "number/parse-float"
- },
- parseInt: {
- stable: true,
- path: "number/parse-int"
- }
- },
- Reflect: {
- apply: {
- stable: true,
- path: "reflect/apply"
- },
- construct: {
- stable: true,
- path: "reflect/construct"
- },
- defineProperty: {
- stable: true,
- path: "reflect/define-property"
- },
- deleteProperty: {
- stable: true,
- path: "reflect/delete-property"
- },
- getOwnPropertyDescriptor: {
- stable: true,
- path: "reflect/get-own-property-descriptor"
- },
- getPrototypeOf: {
- stable: true,
- path: "reflect/get-prototype-of"
- },
- get: {
- stable: true,
- path: "reflect/get"
- },
- has: {
- stable: true,
- path: "reflect/has"
- },
- isExtensible: {
- stable: true,
- path: "reflect/is-extensible"
- },
- ownKeys: {
- stable: true,
- path: "reflect/own-keys"
- },
- preventExtensions: {
- stable: true,
- path: "reflect/prevent-extensions"
- },
- setPrototypeOf: {
- stable: true,
- path: "reflect/set-prototype-of"
- },
- set: {
- stable: true,
- path: "reflect/set"
- }
- },
- Date: {
- now: {
- stable: true,
- path: "date/now"
- }
- }
- })
- };
- });
- var getCoreJS3Definitions = (function () {
- return {
- BuiltIns: {
- AggregateError: {
- stable: false,
- path: "aggregate-error"
- },
- Map: {
- stable: true,
- path: "map"
- },
- Observable: {
- stable: false,
- path: "observable"
- },
- Promise: {
- stable: true,
- path: "promise"
- },
- Set: {
- stable: true,
- path: "set"
- },
- Symbol: {
- stable: true,
- path: "symbol"
- },
- URL: {
- stable: true,
- path: "url"
- },
- URLSearchParams: {
- stable: true,
- path: "url-search-params"
- },
- WeakMap: {
- stable: true,
- path: "weak-map"
- },
- WeakSet: {
- stable: true,
- path: "weak-set"
- },
- clearImmediate: {
- stable: true,
- path: "clear-immediate"
- },
- compositeKey: {
- stable: false,
- path: "composite-key"
- },
- compositeSymbol: {
- stable: false,
- path: "composite-symbol"
- },
- globalThis: {
- stable: false,
- path: "global-this"
- },
- parseFloat: {
- stable: true,
- path: "parse-float"
- },
- parseInt: {
- stable: true,
- path: "parse-int"
- },
- queueMicrotask: {
- stable: true,
- path: "queue-microtask"
- },
- setImmediate: {
- stable: true,
- path: "set-immediate"
- },
- setInterval: {
- stable: true,
- path: "set-interval"
- },
- setTimeout: {
- stable: true,
- path: "set-timeout"
- }
- },
- StaticProperties: {
- Array: {
- from: {
- stable: true,
- path: "array/from"
- },
- isArray: {
- stable: true,
- path: "array/is-array"
- },
- of: {
- stable: true,
- path: "array/of"
- }
- },
- Date: {
- now: {
- stable: true,
- path: "date/now"
- }
- },
- JSON: {
- stringify: {
- stable: true,
- path: "json/stringify"
- }
- },
- Math: {
- DEG_PER_RAD: {
- stable: false,
- path: "math/deg-per-rad"
- },
- RAD_PER_DEG: {
- stable: false,
- path: "math/rad-per-deg"
- },
- acosh: {
- stable: true,
- path: "math/acosh"
- },
- asinh: {
- stable: true,
- path: "math/asinh"
- },
- atanh: {
- stable: true,
- path: "math/atanh"
- },
- cbrt: {
- stable: true,
- path: "math/cbrt"
- },
- clamp: {
- stable: false,
- path: "math/clamp"
- },
- clz32: {
- stable: true,
- path: "math/clz32"
- },
- cosh: {
- stable: true,
- path: "math/cosh"
- },
- degrees: {
- stable: false,
- path: "math/degrees"
- },
- expm1: {
- stable: true,
- path: "math/expm1"
- },
- fround: {
- stable: true,
- path: "math/fround"
- },
- fscale: {
- stable: false,
- path: "math/fscale"
- },
- hypot: {
- stable: true,
- path: "math/hypot"
- },
- iaddh: {
- stable: false,
- path: "math/iaddh"
- },
- imul: {
- stable: true,
- path: "math/imul"
- },
- imulh: {
- stable: false,
- path: "math/imulh"
- },
- isubh: {
- stable: false,
- path: "math/isubh"
- },
- log10: {
- stable: true,
- path: "math/log10"
- },
- log1p: {
- stable: true,
- path: "math/log1p"
- },
- log2: {
- stable: true,
- path: "math/log2"
- },
- radians: {
- stable: false,
- path: "math/radians"
- },
- scale: {
- stable: false,
- path: "math/scale"
- },
- seededPRNG: {
- stable: false,
- path: "math/seeded-prng"
- },
- sign: {
- stable: true,
- path: "math/sign"
- },
- signbit: {
- stable: false,
- path: "math/signbit"
- },
- sinh: {
- stable: true,
- path: "math/sinh"
- },
- tanh: {
- stable: true,
- path: "math/tanh"
- },
- trunc: {
- stable: true,
- path: "math/trunc"
- },
- umulh: {
- stable: false,
- path: "math/umulh"
- }
- },
- Number: {
- EPSILON: {
- stable: true,
- path: "number/epsilon"
- },
- MAX_SAFE_INTEGER: {
- stable: true,
- path: "number/max-safe-integer"
- },
- MIN_SAFE_INTEGER: {
- stable: true,
- path: "number/min-safe-integer"
- },
- fromString: {
- stable: false,
- path: "number/from-string"
- },
- isFinite: {
- stable: true,
- path: "number/is-finite"
- },
- isInteger: {
- stable: true,
- path: "number/is-integer"
- },
- isNaN: {
- stable: true,
- path: "number/is-nan"
- },
- isSafeInteger: {
- stable: true,
- path: "number/is-safe-integer"
- },
- parseFloat: {
- stable: true,
- path: "number/parse-float"
- },
- parseInt: {
- stable: true,
- path: "number/parse-int"
- }
- },
- Object: {
- assign: {
- stable: true,
- path: "object/assign"
- },
- create: {
- stable: true,
- path: "object/create"
- },
- defineProperties: {
- stable: true,
- path: "object/define-properties"
- },
- defineProperty: {
- stable: true,
- path: "object/define-property"
- },
- entries: {
- stable: true,
- path: "object/entries"
- },
- freeze: {
- stable: true,
- path: "object/freeze"
- },
- fromEntries: {
- stable: true,
- path: "object/from-entries"
- },
- getOwnPropertyDescriptor: {
- stable: true,
- path: "object/get-own-property-descriptor"
- },
- getOwnPropertyDescriptors: {
- stable: true,
- path: "object/get-own-property-descriptors"
- },
- getOwnPropertyNames: {
- stable: true,
- path: "object/get-own-property-names"
- },
- getOwnPropertySymbols: {
- stable: true,
- path: "object/get-own-property-symbols"
- },
- getPrototypeOf: {
- stable: true,
- path: "object/get-prototype-of"
- },
- isExtensible: {
- stable: true,
- path: "object/is-extensible"
- },
- isFrozen: {
- stable: true,
- path: "object/is-frozen"
- },
- isSealed: {
- stable: true,
- path: "object/is-sealed"
- },
- is: {
- stable: true,
- path: "object/is"
- },
- keys: {
- stable: true,
- path: "object/keys"
- },
- preventExtensions: {
- stable: true,
- path: "object/prevent-extensions"
- },
- seal: {
- stable: true,
- path: "object/seal"
- },
- setPrototypeOf: {
- stable: true,
- path: "object/set-prototype-of"
- },
- values: {
- stable: true,
- path: "object/values"
- }
- },
- Reflect: {
- apply: {
- stable: true,
- path: "reflect/apply"
- },
- construct: {
- stable: true,
- path: "reflect/construct"
- },
- defineMetadata: {
- stable: false,
- path: "reflect/define-metadata"
- },
- defineProperty: {
- stable: true,
- path: "reflect/define-property"
- },
- deleteMetadata: {
- stable: false,
- path: "reflect/delete-metadata"
- },
- deleteProperty: {
- stable: true,
- path: "reflect/delete-property"
- },
- getMetadata: {
- stable: false,
- path: "reflect/get-metadata"
- },
- getMetadataKeys: {
- stable: false,
- path: "reflect/get-metadata-keys"
- },
- getOwnMetadata: {
- stable: false,
- path: "reflect/get-own-metadata"
- },
- getOwnMetadataKeys: {
- stable: false,
- path: "reflect/get-own-metadata-keys"
- },
- getOwnPropertyDescriptor: {
- stable: true,
- path: "reflect/get-own-property-descriptor"
- },
- getPrototypeOf: {
- stable: true,
- path: "reflect/get-prototype-of"
- },
- get: {
- stable: true,
- path: "reflect/get"
- },
- has: {
- stable: true,
- path: "reflect/has"
- },
- hasMetadata: {
- stable: false,
- path: "reflect/has-metadata"
- },
- hasOwnMetadata: {
- stable: false,
- path: "reflect/has-own-metadata"
- },
- isExtensible: {
- stable: true,
- path: "reflect/is-extensible"
- },
- metadata: {
- stable: false,
- path: "reflect/metadata"
- },
- ownKeys: {
- stable: true,
- path: "reflect/own-keys"
- },
- preventExtensions: {
- stable: true,
- path: "reflect/prevent-extensions"
- },
- set: {
- stable: true,
- path: "reflect/set"
- },
- setPrototypeOf: {
- stable: true,
- path: "reflect/set-prototype-of"
- }
- },
- String: {
- fromCodePoint: {
- stable: true,
- path: "string/from-code-point"
- },
- raw: {
- stable: true,
- path: "string/raw"
- }
- },
- Symbol: {
- asyncIterator: {
- stable: true,
- path: "symbol/async-iterator"
- },
- dispose: {
- stable: false,
- path: "symbol/dispose"
- },
- "for": {
- stable: true,
- path: "symbol/for"
- },
- hasInstance: {
- stable: true,
- path: "symbol/has-instance"
- },
- isConcatSpreadable: {
- stable: true,
- path: "symbol/is-concat-spreadable"
- },
- iterator: {
- stable: true,
- path: "symbol/iterator"
- },
- keyFor: {
- stable: true,
- path: "symbol/key-for"
- },
- match: {
- stable: true,
- path: "symbol/match"
- },
- observable: {
- stable: false,
- path: "symbol/observable"
- },
- patternMatch: {
- stable: false,
- path: "symbol/pattern-match"
- },
- replace: {
- stable: true,
- path: "symbol/replace"
- },
- search: {
- stable: true,
- path: "symbol/search"
- },
- species: {
- stable: true,
- path: "symbol/species"
- },
- split: {
- stable: true,
- path: "symbol/split"
- },
- toPrimitive: {
- stable: true,
- path: "symbol/to-primitive"
- },
- toStringTag: {
- stable: true,
- path: "symbol/to-string-tag"
- },
- unscopables: {
- stable: true,
- path: "symbol/unscopables"
- }
- }
- },
- InstanceProperties: {
- at: {
- stable: false,
- path: "at"
- },
- bind: {
- stable: true,
- path: "bind"
- },
- codePointAt: {
- stable: true,
- path: "code-point-at"
- },
- codePoints: {
- stable: false,
- path: "code-points"
- },
- concat: {
- stable: true,
- path: "concat",
- types: ["array"]
- },
- copyWithin: {
- stable: true,
- path: "copy-within"
- },
- endsWith: {
- stable: true,
- path: "ends-with"
- },
- entries: {
- stable: true,
- path: "entries"
- },
- every: {
- stable: true,
- path: "every"
- },
- fill: {
- stable: true,
- path: "fill"
- },
- filter: {
- stable: true,
- path: "filter"
- },
- find: {
- stable: true,
- path: "find"
- },
- findIndex: {
- stable: true,
- path: "find-index"
- },
- flags: {
- stable: true,
- path: "flags"
- },
- flatMap: {
- stable: true,
- path: "flat-map"
- },
- flat: {
- stable: true,
- path: "flat"
- },
- forEach: {
- stable: true,
- path: "for-each"
- },
- includes: {
- stable: true,
- path: "includes"
- },
- indexOf: {
- stable: true,
- path: "index-of"
- },
- keys: {
- stable: true,
- path: "keys"
- },
- lastIndexOf: {
- stable: true,
- path: "last-index-of"
- },
- map: {
- stable: true,
- path: "map"
- },
- matchAll: {
- stable: false,
- path: "match-all"
- },
- padEnd: {
- stable: true,
- path: "pad-end"
- },
- padStart: {
- stable: true,
- path: "pad-start"
- },
- reduce: {
- stable: true,
- path: "reduce"
- },
- reduceRight: {
- stable: true,
- path: "reduce-right"
- },
- repeat: {
- stable: true,
- path: "repeat"
- },
- replaceAll: {
- stable: false,
- path: "replace-all"
- },
- reverse: {
- stable: true,
- path: "reverse"
- },
- slice: {
- stable: true,
- path: "slice"
- },
- some: {
- stable: true,
- path: "some"
- },
- sort: {
- stable: true,
- path: "sort"
- },
- splice: {
- stable: true,
- path: "splice"
- },
- startsWith: {
- stable: true,
- path: "starts-with"
- },
- trim: {
- stable: true,
- path: "trim"
- },
- trimEnd: {
- stable: true,
- path: "trim-end"
- },
- trimLeft: {
- stable: true,
- path: "trim-left"
- },
- trimRight: {
- stable: true,
- path: "trim-right"
- },
- trimStart: {
- stable: true,
- path: "trim-start"
- },
- values: {
- stable: true,
- path: "values"
- }
- }
- };
- });
- function resolveAbsoluteRuntime(moduleName, dirname) {
- try {
- return path$1.dirname(resolve$2.sync(moduleName + "/package.json", {
- basedir: dirname
- }));
- } catch (err) {
- if (err.code !== "MODULE_NOT_FOUND") throw err;
- throw Object.assign(new Error("Failed to resolve \"" + moduleName + "\" relative to \"" + dirname + "\""), {
- code: "BABEL_RUNTIME_NOT_FOUND",
- runtime: moduleName,
- dirname: dirname
- });
- }
- }
- function supportsStaticESM(caller) {
- return !!(caller && caller.supportsStaticESM);
- }
- var transformRuntime = declare(function (api, options, dirname) {
- api.assertVersion(7);
- var corejs = options.corejs,
- _options$helpers = options.helpers,
- useRuntimeHelpers = _options$helpers === void 0 ? true : _options$helpers,
- _options$regenerator = options.regenerator,
- useRuntimeRegenerator = _options$regenerator === void 0 ? true : _options$regenerator,
- _options$useESModules = options.useESModules,
- useESModules = _options$useESModules === void 0 ? false : _options$useESModules,
- _options$version = options.version,
- runtimeVersion = _options$version === void 0 ? "7.0.0-beta.0" : _options$version,
- _options$absoluteRunt = options.absoluteRuntime,
- absoluteRuntime = _options$absoluteRunt === void 0 ? false : _options$absoluteRunt;
- var proposals = false;
- var rawVersion;
- if (typeof corejs === "object" && corejs !== null) {
- rawVersion = corejs.version;
- proposals = Boolean(corejs.proposals);
- } else {
- rawVersion = corejs;
- }
- var corejsVersion = rawVersion ? Number(rawVersion) : false;
- if (![false, 2, 3].includes(corejsVersion)) {
- throw new Error("The `core-js` version must be false, 2 or 3, but got " + JSON.stringify(rawVersion) + ".");
- }
- if (proposals && (!corejsVersion || corejsVersion < 3)) {
- throw new Error("The 'proposals' option is only supported when using 'corejs: 3'");
- }
- if (typeof useRuntimeRegenerator !== "boolean") {
- throw new Error("The 'regenerator' option must be undefined, or a boolean.");
- }
- if (typeof useRuntimeHelpers !== "boolean") {
- throw new Error("The 'helpers' option must be undefined, or a boolean.");
- }
- if (typeof useESModules !== "boolean" && useESModules !== "auto") {
- throw new Error("The 'useESModules' option must be undefined, or a boolean, or 'auto'.");
- }
- if (typeof absoluteRuntime !== "boolean" && typeof absoluteRuntime !== "string") {
- throw new Error("The 'absoluteRuntime' option must be undefined, a boolean, or a string.");
- }
- if (typeof runtimeVersion !== "string") {
- throw new Error("The 'version' option must be a version string.");
- }
- function has(obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key);
- }
- function hasMapping(methods, name) {
- return has(methods, name) && (proposals || methods[name].stable);
- }
- function hasStaticMapping(object, method) {
- return has(StaticProperties, object) && hasMapping(StaticProperties[object], method);
- }
- function isNamespaced(path) {
- var binding = path.scope.getBinding(path.node.name);
- if (!binding) return false;
- return binding.path.isImportNamespaceSpecifier();
- }
- function maybeNeedsPolyfill(path, methods, name) {
- if (isNamespaced(path.get("object"))) return false;
- if (!methods[name].types) return true;
- var typeAnnotation = path.get("object").getTypeAnnotation();
- var type = typeAnnotationToString(typeAnnotation);
- if (!type) return true;
- return methods[name].types.some(function (name) {
- return name === type;
- });
- }
- function resolvePropertyName(path, computed) {
- var node = path.node;
- if (!computed) return node.name;
- if (path.isStringLiteral()) return node.value;
- var result = path.evaluate();
- return result.value;
- }
- if (has(options, "useBuiltIns")) {
- if (options.useBuiltIns) {
- throw new Error("The 'useBuiltIns' option has been removed. The @babel/runtime " + "module now uses builtins by default.");
- } else {
- throw new Error("The 'useBuiltIns' option has been removed. Use the 'corejs'" + "option to polyfill with `core-js` via @babel/runtime.");
- }
- }
- if (has(options, "polyfill")) {
- if (options.polyfill === false) {
- throw new Error("The 'polyfill' option has been removed. The @babel/runtime " + "module now skips polyfilling by default.");
- } else {
- throw new Error("The 'polyfill' option has been removed. Use the 'corejs'" + "option to polyfill with `core-js` via @babel/runtime.");
- }
- }
- if (has(options, "moduleName")) {
- throw new Error("The 'moduleName' option has been removed. @babel/transform-runtime " + "no longer supports arbitrary runtimes. If you were using this to " + "set an absolute path for Babel's standard runtimes, please use the " + "'absoluteRuntime' option.");
- }
- var esModules = useESModules === "auto" ? api.caller(supportsStaticESM) : useESModules;
- var injectCoreJS2 = corejsVersion === 2;
- var injectCoreJS3 = corejsVersion === 3;
- var injectCoreJS = corejsVersion !== false;
- var moduleName = injectCoreJS3 ? "@babel/runtime-corejs3" : injectCoreJS2 ? "@babel/runtime-corejs2" : "@babel/runtime";
- var corejsRoot = injectCoreJS3 && !proposals ? "core-js-stable" : "core-js";
- var _ref = (injectCoreJS2 ? getCoreJS2Definitions : getCoreJS3Definitions)(runtimeVersion),
- BuiltIns = _ref.BuiltIns,
- StaticProperties = _ref.StaticProperties,
- InstanceProperties = _ref.InstanceProperties;
- var HEADER_HELPERS = ["interopRequireWildcard", "interopRequireDefault"];
- var modulePath = moduleName;
- if (absoluteRuntime !== false) {
- modulePath = resolveAbsoluteRuntime(moduleName, path$1.resolve(dirname, absoluteRuntime === true ? "." : absoluteRuntime));
- }
- return {
- name: "transform-runtime",
- pre: function pre(file) {
- var _this = this;
- if (useRuntimeHelpers) {
- file.set("helperGenerator", function (name) {
- if (file.availableHelper && !file.availableHelper(name, runtimeVersion)) {
- return;
- }
- var isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1;
- var blockHoist = isInteropHelper && !isModule(file.path) ? 4 : undefined;
- var helpersDir = esModules && file.path.node.sourceType === "module" ? "helpers/esm" : "helpers";
- return _this.addDefaultImport(modulePath + "/" + helpersDir + "/" + name, name, blockHoist);
- });
- }
- var cache = new Map();
- this.addDefaultImport = function (source, nameHint, blockHoist) {
- var cacheKey = isModule(file.path);
- var key = source + ":" + nameHint + ":" + (cacheKey || "");
- var cached = cache.get(key);
- if (cached) {
- cached = cloneNode(cached);
- } else {
- cached = addDefault(file.path, source, {
- importedInterop: "uncompiled",
- nameHint: nameHint,
- blockHoist: blockHoist
- });
- cache.set(key, cached);
- }
- return cached;
- };
- },
- visitor: {
- ReferencedIdentifier: function ReferencedIdentifier(path) {
- var node = path.node,
- parent = path.parent,
- scope = path.scope;
- var name = node.name;
- if (name === "regeneratorRuntime" && useRuntimeRegenerator) {
- path.replaceWith(this.addDefaultImport(modulePath + "/regenerator", "regeneratorRuntime"));
- return;
- }
- if (!injectCoreJS) return;
- if (isMemberExpression(parent)) return;
- if (!hasMapping(BuiltIns, name)) return;
- if (scope.getBindingIdentifier(name)) return;
- path.replaceWith(this.addDefaultImport(modulePath + "/" + corejsRoot + "/" + BuiltIns[name].path, name));
- },
- CallExpression: function CallExpression$1(path) {
- if (!injectCoreJS) return;
- var node = path.node;
- var callee = node.callee;
- if (!isMemberExpression(callee)) return;
- var object = callee.object;
- var propertyName = resolvePropertyName(path.get("callee.property"), callee.computed);
- if (injectCoreJS3 && !hasStaticMapping(object.name, propertyName)) {
- if (hasMapping(InstanceProperties, propertyName) && maybeNeedsPolyfill(path.get("callee"), InstanceProperties, propertyName)) {
- var context1, context2;
- if (isIdentifier(object)) {
- context1 = object;
- context2 = cloneNode(object);
- } else {
- context1 = path.scope.generateDeclaredUidIdentifier("context");
- context2 = AssignmentExpression("=", context1, object);
- }
- node.callee = MemberExpression(CallExpression(this.addDefaultImport(moduleName + "/" + corejsRoot + "/instance/" + InstanceProperties[propertyName].path, propertyName + "InstanceProperty"), [context2]), Identifier("call"));
- node.arguments.unshift(context1);
- return;
- }
- }
- if (node.arguments.length) return;
- if (!callee.computed) return;
- if (!path.get("callee.property").matchesPattern("Symbol.iterator")) {
- return;
- }
- path.replaceWith(CallExpression(this.addDefaultImport(modulePath + "/core-js/get-iterator", "getIterator"), [object]));
- },
- BinaryExpression: function BinaryExpression(path) {
- if (!injectCoreJS) return;
- if (path.node.operator !== "in") return;
- if (!path.get("left").matchesPattern("Symbol.iterator")) return;
- path.replaceWith(CallExpression(this.addDefaultImport(modulePath + "/core-js/is-iterable", "isIterable"), [path.node.right]));
- },
- MemberExpression: {
- enter: function enter(path) {
- if (!injectCoreJS) return;
- if (!path.isReferenced()) return;
- var node = path.node;
- var object = node.object;
- if (!isReferenced(object, node)) return;
- if (!injectCoreJS2 && node.computed && path.get("property").matchesPattern("Symbol.iterator")) {
- path.replaceWith(CallExpression(this.addDefaultImport(moduleName + "/core-js/get-iterator-method", "getIteratorMethod"), [object]));
- return;
- }
- var objectName = object.name;
- var propertyName = resolvePropertyName(path.get("property"), node.computed);
- if (path.scope.getBindingIdentifier(objectName) || !hasStaticMapping(objectName, propertyName)) {
- if (injectCoreJS3 && hasMapping(InstanceProperties, propertyName) && maybeNeedsPolyfill(path, InstanceProperties, propertyName)) {
- path.replaceWith(CallExpression(this.addDefaultImport(moduleName + "/" + corejsRoot + "/instance/" + InstanceProperties[propertyName].path, propertyName + "InstanceProperty"), [object]));
- }
- return;
- }
- path.replaceWith(this.addDefaultImport(modulePath + "/" + corejsRoot + "/" + StaticProperties[objectName][propertyName].path, objectName + "$" + propertyName));
- },
- exit: function exit(path) {
- if (!injectCoreJS) return;
- if (!path.isReferenced()) return;
- if (path.node.computed) return;
- var node = path.node;
- var object = node.object;
- var name = object.name;
- if (!hasMapping(BuiltIns, name)) return;
- if (path.scope.getBindingIdentifier(name)) return;
- path.replaceWith(MemberExpression(this.addDefaultImport(modulePath + "/" + corejsRoot + "/" + BuiltIns[name].path, name), node.property));
- }
- }
- }
- };
- });
- var transformShorthandProperties = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-shorthand-properties",
- visitor: {
- ObjectMethod: function ObjectMethod(path) {
- var node = path.node;
- if (node.kind === "method") {
- var func = FunctionExpression(null, node.params, node.body, node.generator, node.async);
- func.returnType = node.returnType;
- path.replaceWith(ObjectProperty(node.key, func, node.computed));
- }
- },
- ObjectProperty: function ObjectProperty(_ref) {
- var node = _ref.node;
- if (node.shorthand) {
- node.shorthand = false;
- }
- }
- }
- };
- });
- var transformSpread = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose;
- function getSpreadLiteral(spread, scope) {
- if (loose && !isIdentifier(spread.argument, {
- name: "arguments"
- })) {
- return spread.argument;
- } else {
- return scope.toArray(spread.argument, true);
- }
- }
- function hasSpread(nodes) {
- for (var i = 0; i < nodes.length; i++) {
- if (isSpreadElement(nodes[i])) {
- return true;
- }
- }
- return false;
- }
- function push(_props, nodes) {
- if (!_props.length) return _props;
- nodes.push(ArrayExpression(_props));
- return [];
- }
- function build(props, scope) {
- var nodes = [];
- var _props = [];
- for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var prop = _ref;
- if (isSpreadElement(prop)) {
- _props = push(_props, nodes);
- nodes.push(getSpreadLiteral(prop, scope));
- } else {
- _props.push(prop);
- }
- }
- push(_props, nodes);
- return nodes;
- }
- return {
- name: "transform-spread",
- visitor: {
- ArrayExpression: function ArrayExpression$1(path) {
- var node = path.node,
- scope = path.scope;
- var elements = node.elements;
- if (!hasSpread(elements)) return;
- var nodes = build(elements, scope);
- var first = nodes[0];
- if (nodes.length === 1 && first !== elements[0].argument) {
- path.replaceWith(first);
- return;
- }
- if (!isArrayExpression(first)) {
- first = ArrayExpression([]);
- } else {
- nodes.shift();
- }
- path.replaceWith(CallExpression(MemberExpression(first, Identifier("concat")), nodes));
- },
- CallExpression: function CallExpression$1(path) {
- var node = path.node,
- scope = path.scope;
- var args = node.arguments;
- if (!hasSpread(args)) return;
- var calleePath = path.get("callee");
- if (calleePath.isSuper()) return;
- var contextLiteral = scope.buildUndefinedNode();
- node.arguments = [];
- var nodes;
- if (args.length === 1 && args[0].argument.name === "arguments") {
- nodes = [args[0].argument];
- } else {
- nodes = build(args, scope);
- }
- var first = nodes.shift();
- if (nodes.length) {
- node.arguments.push(CallExpression(MemberExpression(first, Identifier("concat")), nodes));
- } else {
- node.arguments.push(first);
- }
- var callee = node.callee;
- if (calleePath.isMemberExpression()) {
- var temp = scope.maybeGenerateMemoised(callee.object);
- if (temp) {
- callee.object = AssignmentExpression("=", temp, callee.object);
- contextLiteral = temp;
- } else {
- contextLiteral = cloneNode(callee.object);
- }
- appendToMemberExpression(callee, Identifier("apply"));
- } else {
- node.callee = MemberExpression(node.callee, Identifier("apply"));
- }
- if (isSuper(contextLiteral)) {
- contextLiteral = ThisExpression();
- }
- node.arguments.unshift(cloneNode(contextLiteral));
- },
- NewExpression: function NewExpression(path) {
- var node = path.node,
- scope = path.scope;
- var args = node.arguments;
- if (!hasSpread(args)) return;
- var nodes = build(args, scope);
- var first = nodes.shift();
- if (nodes.length) {
- args = CallExpression(MemberExpression(first, Identifier("concat")), nodes);
- } else {
- args = first;
- }
- path.replaceWith(CallExpression(path.hub.addHelper("construct"), [node.callee, args]));
- }
- }
- };
- });
- var transformStickyRegex = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-sticky-regex",
- visitor: {
- RegExpLiteral: function RegExpLiteral(path) {
- var node = path.node;
- if (!is$2(node, "y")) return;
- path.replaceWith(NewExpression(Identifier("RegExp"), [StringLiteral(node.pattern), StringLiteral(node.flags)]));
- }
- }
- };
- });
- var transformStrictMode = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-strict-mode",
- visitor: {
- Program: function Program(path) {
- var node = path.node;
- for (var _i = 0, _arr = node.directives; _i < _arr.length; _i++) {
- var directive = _arr[_i];
- if (directive.value.value === "use strict") return;
- }
- path.unshiftContainer("directives", Directive(DirectiveLiteral("use strict")));
- }
- }
- };
- });
- function _templateObject$b() {
- var data = _taggedTemplateLiteralLoose(["\n function ", "() {\n const data = ", ";\n ", " = function() { return data };\n return data;\n } \n "]);
- _templateObject$b = function _templateObject() {
- return data;
- };
- return data;
- }
- var transformTemplateLiterals = declare(function (api, options) {
- api.assertVersion(7);
- var loose = options.loose;
- var helperName = "taggedTemplateLiteral";
- if (loose) helperName += "Loose";
- function buildConcatCallExpressions(items) {
- var avail = true;
- return items.reduce(function (left, right) {
- var canBeInserted = isLiteral(right);
- if (!canBeInserted && avail) {
- canBeInserted = true;
- avail = false;
- }
- if (canBeInserted && isCallExpression(left)) {
- left.arguments.push(right);
- return left;
- }
- return CallExpression(MemberExpression(left, Identifier("concat")), [right]);
- });
- }
- return {
- name: "transform-template-literals",
- visitor: {
- TaggedTemplateExpression: function TaggedTemplateExpression(path) {
- var node = path.node;
- var quasi = node.quasi;
- var strings = [];
- var raws = [];
- var isStringsRawEqual = true;
- for (var _i = 0, _arr = quasi.quasis; _i < _arr.length; _i++) {
- var elem = _arr[_i];
- var _elem$value = elem.value,
- raw = _elem$value.raw,
- cooked = _elem$value.cooked;
- var value = cooked == null ? path.scope.buildUndefinedNode() : StringLiteral(cooked);
- strings.push(value);
- raws.push(StringLiteral(raw));
- if (raw !== cooked) {
- isStringsRawEqual = false;
- }
- }
- var scope = path.scope.getProgramParent();
- var templateObject = scope.generateUidIdentifier("templateObject");
- var helperId = this.addHelper(helperName);
- var callExpressionInput = [ArrayExpression(strings)];
- if (!isStringsRawEqual) {
- callExpressionInput.push(ArrayExpression(raws));
- }
- var lazyLoad = template.ast(_templateObject$b(), templateObject, CallExpression(helperId, callExpressionInput), templateObject);
- scope.path.unshiftContainer("body", lazyLoad);
- path.replaceWith(CallExpression(node.tag, [CallExpression(cloneNode(templateObject), [])].concat(quasi.expressions)));
- },
- TemplateLiteral: function TemplateLiteral(path) {
- var nodes = [];
- var expressions = path.get("expressions");
- var index = 0;
- for (var _i2 = 0, _arr2 = path.node.quasis; _i2 < _arr2.length; _i2++) {
- var elem = _arr2[_i2];
- if (elem.value.cooked) {
- nodes.push(StringLiteral(elem.value.cooked));
- }
- if (index < expressions.length) {
- var expr = expressions[index++];
- var node = expr.node;
- if (!isStringLiteral(node, {
- value: ""
- })) {
- nodes.push(node);
- }
- }
- }
- var considerSecondNode = !loose || !isStringLiteral(nodes[1]);
- if (!isStringLiteral(nodes[0]) && considerSecondNode) {
- nodes.unshift(StringLiteral(""));
- }
- var root = nodes[0];
- if (loose) {
- for (var i = 1; i < nodes.length; i++) {
- root = BinaryExpression("+", root, nodes[i]);
- }
- } else if (nodes.length > 1) {
- root = buildConcatCallExpressions(nodes);
- }
- path.replaceWith(root);
- }
- }
- };
- });
- var transformTypeofSymbol = declare(function (api) {
- api.assertVersion(7);
- return {
- name: "transform-typeof-symbol",
- visitor: {
- Scope: function Scope(_ref) {
- var scope = _ref.scope;
- if (!scope.getBinding("Symbol")) {
- return;
- }
- scope.rename("Symbol");
- },
- UnaryExpression: function UnaryExpression$1(path) {
- var node = path.node,
- parent = path.parent;
- if (node.operator !== "typeof") return;
- if (path.parentPath.isBinaryExpression() && EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0) {
- var opposite = path.getOpposite();
- if (opposite.isLiteral() && opposite.node.value !== "symbol" && opposite.node.value !== "object") {
- return;
- }
- }
- var helper = this.addHelper("typeof");
- var isUnderHelper = path.findParent(function (path) {
- return path.isVariableDeclarator() && path.node.id === helper || path.isFunctionDeclaration() && path.node.id && path.node.id.name === helper.name;
- });
- if (isUnderHelper) {
- return;
- }
- var call = CallExpression(helper, [node.argument]);
- var arg = path.get("argument");
- if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name, true)) {
- var unary = UnaryExpression("typeof", cloneNode(node.argument));
- path.replaceWith(ConditionalExpression(BinaryExpression("===", unary, StringLiteral("undefined")), StringLiteral("undefined"), call));
- } else {
- path.replaceWith(call);
- }
- }
- }
- };
- });
- function transpileEnum(path, t) {
- var node = path.node;
- if (node.declare) {
- path.remove();
- return;
- }
- if (node["const"]) {
- throw path.buildCodeFrameError("'const' enums are not supported.");
- }
- var name = node.id.name;
- var fill = enumFill(path, t, node.id);
- switch (path.parent.type) {
- case "BlockStatement":
- case "ExportNamedDeclaration":
- case "Program":
- {
- path.insertAfter(fill);
- if (seen(path.parentPath)) {
- path.remove();
- } else {
- var isGlobal = t.isProgram(path.parent);
- path.scope.registerDeclaration(path.replaceWith(makeVar(node.id, t, isGlobal ? "var" : "let"))[0]);
- }
- break;
- }
- default:
- throw new Error("Unexpected enum parent '" + path.parent.type);
- }
- function seen(parentPath) {
- if (parentPath.isExportDeclaration()) {
- return seen(parentPath.parentPath);
- }
- if (parentPath.getData(name)) {
- return true;
- } else {
- parentPath.setData(name, true);
- return false;
- }
- }
- }
- function makeVar(id, t, kind) {
- return t.variableDeclaration(kind, [t.variableDeclarator(id)]);
- }
- var buildEnumWrapper = template("\n (function (ID) {\n ASSIGNMENTS;\n })(ID || (ID = {}));\n");
- var buildStringAssignment = template("\n ENUM[\"NAME\"] = VALUE;\n");
- var buildNumericAssignment = template("\n ENUM[ENUM[\"NAME\"] = VALUE] = \"NAME\";\n");
- var buildEnumMember = function buildEnumMember(isString, options) {
- return (isString ? buildStringAssignment : buildNumericAssignment)(options);
- };
- function enumFill(path, t, id) {
- var x = translateEnumValues(path, t);
- var assignments = x.map(function (_ref) {
- var memberName = _ref[0],
- memberValue = _ref[1];
- return buildEnumMember(t.isStringLiteral(memberValue), {
- ENUM: t.cloneNode(id),
- NAME: memberName,
- VALUE: memberValue
- });
- });
- return buildEnumWrapper({
- ID: t.cloneNode(id),
- ASSIGNMENTS: assignments
- });
- }
- function translateEnumValues(path, t) {
- var seen = Object.create(null);
- var prev = -1;
- return path.node.members.map(function (member) {
- var name = t.isIdentifier(member.id) ? member.id.name : member.id.value;
- var initializer = member.initializer;
- var value;
- if (initializer) {
- var constValue = evaluate$1(initializer, seen);
- if (constValue !== undefined) {
- seen[name] = constValue;
- if (typeof constValue === "number") {
- value = t.numericLiteral(constValue);
- prev = constValue;
- } else {
- assert$2(typeof constValue === "string");
- value = t.stringLiteral(constValue);
- prev = undefined;
- }
- } else {
- value = initializer;
- prev = undefined;
- }
- } else {
- if (prev !== undefined) {
- prev++;
- value = t.numericLiteral(prev);
- seen[name] = prev;
- } else {
- throw path.buildCodeFrameError("Enum member must have initializer.");
- }
- }
- return [name, value];
- });
- }
- function evaluate$1(expr, seen) {
- return evalConstant(expr);
- function evalConstant(expr) {
- switch (expr.type) {
- case "StringLiteral":
- return expr.value;
- case "UnaryExpression":
- return evalUnaryExpression(expr);
- case "BinaryExpression":
- return evalBinaryExpression(expr);
- case "NumericLiteral":
- return expr.value;
- case "ParenthesizedExpression":
- return evalConstant(expr.expression);
- case "Identifier":
- return seen[expr.name];
- case "TemplateLiteral":
- if (expr.quasis.length === 1) {
- return expr.quasis[0].value.cooked;
- }
- default:
- return undefined;
- }
- }
- function evalUnaryExpression(_ref2) {
- var argument = _ref2.argument,
- operator = _ref2.operator;
- var value = evalConstant(argument);
- if (value === undefined) {
- return undefined;
- }
- switch (operator) {
- case "+":
- return value;
- case "-":
- return -value;
- case "~":
- return ~value;
- default:
- return undefined;
- }
- }
- function evalBinaryExpression(expr) {
- var left = evalConstant(expr.left);
- if (left === undefined) {
- return undefined;
- }
- var right = evalConstant(expr.right);
- if (right === undefined) {
- return undefined;
- }
- switch (expr.operator) {
- case "|":
- return left | right;
- case "&":
- return left & right;
- case ">>":
- return left >> right;
- case ">>>":
- return left >>> right;
- case "<<":
- return left << right;
- case "^":
- return left ^ right;
- case "*":
- return left * right;
- case "/":
- return left / right;
- case "+":
- return left + right;
- case "-":
- return left - right;
- case "%":
- return left % right;
- default:
- return undefined;
- }
- }
- }
- function _templateObject2$5() {
- var data = _taggedTemplateLiteralLoose(["\n (function (", ") {\n ", "\n })(", " || (", " = ", "));\n "]);
- _templateObject2$5 = function _templateObject2() {
- return data;
- };
- return data;
- }
- function _templateObject$c() {
- var data = _taggedTemplateLiteralLoose(["\n ", ".", " || (\n ", ".", " = ", "\n )\n "]);
- _templateObject$c = function _templateObject() {
- return data;
- };
- return data;
- }
- function transpileNamespace(path, t, allowNamespaces) {
- if (path.node.declare || path.node.id.type === "StringLiteral") {
- path.remove();
- return;
- }
- if (!allowNamespaces) {
- throw path.hub.file.buildCodeFrameError(path.node.id, "Namespace not marked type-only declare." + " Non-declarative namespaces are only supported experimentally in Babel." + " To enable and review caveats see:" + " https://babeljs.io/docs/en/babel-plugin-transform-typescript");
- }
- var name = path.node.id.name;
- var value = handleNested(path, t, t.cloneDeep(path.node));
- var bound = path.scope.hasOwnBinding(name);
- if (path.parent.type === "ExportNamedDeclaration") {
- if (!bound) {
- path.parentPath.insertAfter(value);
- path.replaceWith(getDeclaration(t, name));
- path.scope.registerDeclaration(path.parentPath);
- } else {
- path.parentPath.replaceWith(value);
- }
- } else if (bound) {
- path.replaceWith(value);
- } else {
- path.scope.registerDeclaration(path.replaceWithMultiple([getDeclaration(t, name), value])[0]);
- }
- }
- function getDeclaration(t, name) {
- return t.variableDeclaration("let", [t.variableDeclarator(t.identifier(name))]);
- }
- function getMemberExpression(t, name, itemName) {
- return t.memberExpression(t.identifier(name), t.identifier(itemName));
- }
- function handleNested(path, t, node, parentExport) {
- var names = new Set();
- var realName = node.id;
- var name = path.scope.generateUid(realName.name);
- var namespaceTopLevel = node.body.body;
- for (var i = 0; i < namespaceTopLevel.length; i++) {
- var subNode = namespaceTopLevel[i];
- switch (subNode.type) {
- case "TSModuleDeclaration":
- {
- var transformed = handleNested(path, t, subNode);
- var moduleName = subNode.id.name;
- if (names.has(moduleName)) {
- namespaceTopLevel[i] = transformed;
- } else {
- names.add(moduleName);
- namespaceTopLevel.splice(i++, 1, getDeclaration(t, moduleName), transformed);
- }
- continue;
- }
- case "TSEnumDeclaration":
- case "FunctionDeclaration":
- case "ClassDeclaration":
- names.add(subNode.id.name);
- continue;
- case "VariableDeclaration":
- for (var _iterator = subNode.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var variable = _ref;
- names.add(variable.id.name);
- }
- continue;
- default:
- continue;
- case "ExportNamedDeclaration":
- }
- switch (subNode.declaration.type) {
- case "TSEnumDeclaration":
- case "FunctionDeclaration":
- case "ClassDeclaration":
- {
- var itemName = subNode.declaration.id.name;
- names.add(itemName);
- namespaceTopLevel.splice(i++, 1, subNode.declaration, t.expressionStatement(t.assignmentExpression("=", getMemberExpression(t, name, itemName), t.identifier(itemName))));
- break;
- }
- case "VariableDeclaration":
- if (subNode.declaration.kind !== "const") {
- throw path.hub.file.buildCodeFrameError(subNode.declaration, "Namespaces exporting non-const are not supported by Babel." + " Change to const or see:" + " https://babeljs.io/docs/en/babel-plugin-transform-typescript");
- }
- for (var _iterator2 = subNode.declaration.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var _variable = _ref2;
- _variable.init = t.assignmentExpression("=", getMemberExpression(t, name, _variable.id.name), _variable.init);
- }
- namespaceTopLevel[i] = subNode.declaration;
- break;
- case "TSModuleDeclaration":
- {
- var _transformed = handleNested(path, t, subNode.declaration, t.identifier(name));
- var _moduleName = subNode.declaration.id.name;
- if (names.has(_moduleName)) {
- namespaceTopLevel[i] = _transformed;
- } else {
- names.add(_moduleName);
- namespaceTopLevel.splice(i++, 1, getDeclaration(t, _moduleName), _transformed);
- }
- }
- }
- }
- var fallthroughValue = t.objectExpression([]);
- if (parentExport) {
- fallthroughValue = template.expression.ast(_templateObject$c(), parentExport, realName, parentExport, realName, fallthroughValue);
- }
- return template.statement.ast(_templateObject2$5(), t.identifier(name), namespaceTopLevel, realName, realName, fallthroughValue);
- }
- function _templateObject$d() {
- var data = _taggedTemplateLiteralLoose(["this.", " = ", ""]);
- _templateObject$d = function _templateObject() {
- return data;
- };
- return data;
- }
- function isInType(path) {
- switch (path.parent.type) {
- case "TSTypeReference":
- case "TSQualifiedName":
- case "TSExpressionWithTypeArguments":
- case "TSTypeQuery":
- return true;
- default:
- return false;
- }
- }
- var PARSED_PARAMS = new WeakSet();
- var GLOBAL_TYPES = new WeakMap();
- function isGlobalType(path, name) {
- var program = path.find(function (path) {
- return path.isProgram();
- }).node;
- if (path.scope.hasOwnBinding(name)) return false;
- if (GLOBAL_TYPES.get(program).has(name)) return true;
- console.warn("The exported identifier \"" + name + "\" is not declared in Babel's scope tracker\n" + "as a JavaScript value binding, and \"@babel/plugin-transform-typescript\"\n" + "never encountered it as a TypeScript type declaration.\n" + "It will be treated as a JavaScript value.\n\n" + "This problem is likely caused by another plugin injecting\n" + ("\"" + name + "\" without registering it in the scope tracker. If you are the author\n") + " of that plugin, please use \"scope.registerDeclaration(declarationPath)\".");
- return false;
- }
- function registerGlobalType(programScope, name) {
- GLOBAL_TYPES.get(programScope.path.node).add(name);
- }
- var transformTypeScript = declare(function (api, _ref) {
- var _ref$jsxPragma = _ref.jsxPragma,
- jsxPragma = _ref$jsxPragma === void 0 ? "React" : _ref$jsxPragma,
- _ref$allowNamespaces = _ref.allowNamespaces,
- allowNamespaces = _ref$allowNamespaces === void 0 ? false : _ref$allowNamespaces,
- _ref$allowDeclareFiel = _ref.allowDeclareFields,
- allowDeclareFields = _ref$allowDeclareFiel === void 0 ? false : _ref$allowDeclareFiel;
- api.assertVersion(7);
- var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/;
- var classMemberVisitors = {
- field: function field(path) {
- var node = path.node;
- if (!allowDeclareFields && node.declare) {
- throw path.buildCodeFrameError("The 'declare' modifier is only allowed when the 'allowDeclareFields' option of " + "@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.");
- }
- if (node.definite || node.declare) {
- if (node.value) {
- throw path.buildCodeFrameError("Definietly assigned fields and fields with the 'declare' modifier cannot" + " be initialized here, but only in the constructor");
- }
- path.remove();
- } else if (!allowDeclareFields && !node.value && !node.decorators) {
- path.remove();
- }
- if (node.accessibility) node.accessibility = null;
- if (node["abstract"]) node["abstract"] = null;
- if (node.readonly) node.readonly = null;
- if (node.optional) node.optional = null;
- if (node.typeAnnotation) node.typeAnnotation = null;
- },
- method: function method(_ref2) {
- var node = _ref2.node;
- if (node.accessibility) node.accessibility = null;
- if (node["abstract"]) node["abstract"] = null;
- if (node.optional) node.optional = null;
- },
- constructor: function constructor(path, classPath) {
- if (path.node.accessibility) path.node.accessibility = null;
- var parameterProperties = [];
- for (var _iterator = path.node.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref3 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref3 = _i.value;
- }
- var param = _ref3;
- if (param.type === "TSParameterProperty" && !PARSED_PARAMS.has(param.parameter)) {
- PARSED_PARAMS.add(param.parameter);
- parameterProperties.push(param.parameter);
- }
- }
- if (parameterProperties.length) {
- var assigns = parameterProperties.map(function (p) {
- var id;
- if (isIdentifier(p)) {
- id = p;
- } else if (isAssignmentPattern(p) && isIdentifier(p.left)) {
- id = p.left;
- } else {
- throw path.buildCodeFrameError("Parameter properties can not be destructuring patterns.");
- }
- return template.statement.ast(_templateObject$d(), id, id);
- });
- injectInitialization(classPath, path, assigns);
- }
- }
- };
- return {
- name: "transform-typescript",
- inherits: syntaxTypescript,
- visitor: {
- Pattern: visitPattern,
- Identifier: visitPattern,
- RestElement: visitPattern,
- Program: function Program(path, state) {
- var file = state.file;
- var fileJsxPragma = null;
- if (!GLOBAL_TYPES.has(path.node)) {
- GLOBAL_TYPES.set(path.node, new Set());
- }
- if (file.ast.comments) {
- for (var _i2 = 0, _arr = file.ast.comments; _i2 < _arr.length; _i2++) {
- var comment = _arr[_i2];
- var jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);
- if (jsxMatches) {
- fileJsxPragma = jsxMatches[1];
- }
- }
- }
- for (var _iterator2 = path.get("body"), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray2) {
- if (_i3 >= _iterator2.length) break;
- _ref4 = _iterator2[_i3++];
- } else {
- _i3 = _iterator2.next();
- if (_i3.done) break;
- _ref4 = _i3.value;
- }
- var stmt = _ref4;
- if (isImportDeclaration(stmt)) {
- if (stmt.node.specifiers.length === 0) {
- continue;
- }
- var allElided = true;
- var importsToRemove = [];
- for (var _iterator3 = stmt.node.specifiers, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref5;
- if (_isArray3) {
- if (_i4 >= _iterator3.length) break;
- _ref5 = _iterator3[_i4++];
- } else {
- _i4 = _iterator3.next();
- if (_i4.done) break;
- _ref5 = _i4.value;
- }
- var specifier = _ref5;
- var binding = stmt.scope.getBinding(specifier.local.name);
- if (binding && isImportTypeOnly({
- binding: binding,
- programPath: path,
- jsxPragma: fileJsxPragma || jsxPragma
- })) {
- importsToRemove.push(binding.path);
- } else {
- allElided = false;
- }
- }
- if (allElided) {
- stmt.remove();
- } else {
- for (var _iterator4 = importsToRemove, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref6;
- if (_isArray4) {
- if (_i5 >= _iterator4.length) break;
- _ref6 = _iterator4[_i5++];
- } else {
- _i5 = _iterator4.next();
- if (_i5.done) break;
- _ref6 = _i5.value;
- }
- var importPath = _ref6;
- importPath.remove();
- }
- }
- continue;
- }
- if (stmt.isExportDeclaration()) {
- stmt = stmt.get("declaration");
- }
- if (stmt.isVariableDeclaration({
- declare: true
- })) {
- for (var _i6 = 0, _Object$keys = Object.keys(stmt.getBindingIdentifiers()); _i6 < _Object$keys.length; _i6++) {
- var name = _Object$keys[_i6];
- registerGlobalType(path.scope, name);
- }
- } else if (stmt.isTSTypeAliasDeclaration() || stmt.isTSDeclareFunction() || stmt.isTSInterfaceDeclaration() || stmt.isClassDeclaration({
- declare: true
- }) || stmt.isTSEnumDeclaration({
- declare: true
- }) || stmt.isTSModuleDeclaration({
- declare: true
- }) && stmt.get("id").isIdentifier()) {
- registerGlobalType(path.scope, stmt.node.id.name);
- }
- }
- },
- ExportNamedDeclaration: function ExportNamedDeclaration(path) {
- if (!path.node.source && path.node.specifiers.length > 0 && path.node.specifiers.every(function (_ref7) {
- var local = _ref7.local;
- return isGlobalType(path, local.name);
- })) {
- path.remove();
- }
- },
- ExportSpecifier: function ExportSpecifier(path) {
- if (!path.parent.source && isGlobalType(path, path.node.local.name)) {
- path.remove();
- }
- },
- ExportDefaultDeclaration: function ExportDefaultDeclaration(path) {
- if (isIdentifier(path.node.declaration) && isGlobalType(path, path.node.declaration.name)) {
- path.remove();
- }
- },
- TSDeclareFunction: function TSDeclareFunction(path) {
- path.remove();
- },
- TSDeclareMethod: function TSDeclareMethod(path) {
- path.remove();
- },
- VariableDeclaration: function VariableDeclaration(path) {
- if (path.node.declare) {
- path.remove();
- }
- },
- VariableDeclarator: function VariableDeclarator(_ref8) {
- var node = _ref8.node;
- if (node.definite) node.definite = null;
- },
- TSIndexSignature: function TSIndexSignature(path) {
- path.remove();
- },
- ClassDeclaration: function ClassDeclaration(path) {
- var node = path.node;
- if (node.declare) {
- path.remove();
- return;
- }
- },
- Class: function Class(path) {
- var node = path.node;
- if (node.typeParameters) node.typeParameters = null;
- if (node.superTypeParameters) node.superTypeParameters = null;
- if (node["implements"]) node["implements"] = null;
- if (node["abstract"]) node["abstract"] = null;
- path.get("body.body").forEach(function (child) {
- if (child.isClassMethod()) {
- if (child.node.kind === "constructor") {
- classMemberVisitors.constructor(child, path);
- } else {
- classMemberVisitors.method(child, path);
- }
- } else if (child.isClassProperty()) {
- classMemberVisitors.field(child, path);
- }
- });
- },
- Function: function Function(_ref9) {
- var node = _ref9.node;
- if (node.typeParameters) node.typeParameters = null;
- if (node.returnType) node.returnType = null;
- var p0 = node.params[0];
- if (p0 && isIdentifier(p0) && p0.name === "this") {
- node.params.shift();
- }
- node.params = node.params.map(function (p) {
- return p.type === "TSParameterProperty" ? p.parameter : p;
- });
- },
- TSModuleDeclaration: function TSModuleDeclaration(path) {
- transpileNamespace(path, t, allowNamespaces);
- },
- TSInterfaceDeclaration: function TSInterfaceDeclaration(path) {
- path.remove();
- },
- TSTypeAliasDeclaration: function TSTypeAliasDeclaration(path) {
- path.remove();
- },
- TSEnumDeclaration: function TSEnumDeclaration(path) {
- transpileEnum(path, t);
- },
- TSImportEqualsDeclaration: function TSImportEqualsDeclaration(path) {
- throw path.buildCodeFrameError("`import =` is not supported by @babel/plugin-transform-typescript\n" + "Please consider using " + "`import <moduleName> from '<moduleName>';` alongside " + "Typescript's --allowSyntheticDefaultImports option.");
- },
- TSExportAssignment: function TSExportAssignment(path) {
- throw path.buildCodeFrameError("`export =` is not supported by @babel/plugin-transform-typescript\n" + "Please consider using `export <value>;`.");
- },
- TSTypeAssertion: function TSTypeAssertion(path) {
- path.replaceWith(path.node.expression);
- },
- TSAsExpression: function TSAsExpression(path) {
- var node = path.node;
- do {
- node = node.expression;
- } while (isTSAsExpression(node));
- path.replaceWith(node);
- },
- TSNonNullExpression: function TSNonNullExpression(path) {
- path.replaceWith(path.node.expression);
- },
- CallExpression: function CallExpression(path) {
- path.node.typeParameters = null;
- },
- NewExpression: function NewExpression(path) {
- path.node.typeParameters = null;
- },
- JSXOpeningElement: function JSXOpeningElement(path) {
- path.node.typeParameters = null;
- },
- TaggedTemplateExpression: function TaggedTemplateExpression(path) {
- path.node.typeParameters = null;
- }
- }
- };
- function visitPattern(_ref10) {
- var node = _ref10.node;
- if (node.typeAnnotation) node.typeAnnotation = null;
- if (isIdentifier(node) && node.optional) node.optional = null;
- }
- function isImportTypeOnly(_ref11) {
- var binding = _ref11.binding,
- programPath = _ref11.programPath,
- jsxPragma = _ref11.jsxPragma;
- for (var _iterator5 = binding.referencePaths, _isArray5 = Array.isArray(_iterator5), _i7 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref12;
- if (_isArray5) {
- if (_i7 >= _iterator5.length) break;
- _ref12 = _iterator5[_i7++];
- } else {
- _i7 = _iterator5.next();
- if (_i7.done) break;
- _ref12 = _i7.value;
- }
- var path = _ref12;
- if (!isInType(path)) {
- return false;
- }
- }
- if (binding.identifier.name !== jsxPragma) {
- return true;
- }
- var sourceFileHasJsx = false;
- programPath.traverse({
- JSXElement: function JSXElement() {
- sourceFileHasJsx = true;
- },
- JSXFragment: function JSXFragment() {
- sourceFileHasJsx = true;
- }
- });
- return !sourceFileHasJsx;
- }
- });
- var transformUnicodeRegex = declare(function (api) {
- api.assertVersion(7);
- return createRegExpFeaturePlugin({
- name: "transform-unicode-regex",
- feature: "unicodeFlag"
- });
- });
- var all = {
- "external-helpers": externalHelpers,
- "syntax-async-generators": syntaxAsyncGenerators,
- "syntax-class-properties": syntaxClassProperties,
- "syntax-decorators": syntaxDecorators,
- "syntax-do-expressions": syntaxDoExpressions,
- "syntax-dynamic-import": syntaxDynamicImport,
- "syntax-export-default-from": syntaxExportDefaultFrom,
- "syntax-export-namespace-from": syntaxExportNamespaceFrom,
- "syntax-flow": syntaxFlow,
- "syntax-function-bind": syntaxFunctionBind,
- "syntax-function-sent": syntaxFunctionSent,
- "syntax-import-meta": syntaxImportMeta,
- "syntax-jsx": syntaxJsx,
- "syntax-object-rest-spread": syntaxObjectRestSpread,
- "syntax-optional-catch-binding": syntaxOptionalCatchBinding,
- "syntax-pipeline-operator": syntaxPipelineOperator,
- "syntax-top-level-await": syntaxTopLevelAwait,
- "syntax-typescript": syntaxTypescript,
- "proposal-async-generator-functions": proposalAsyncGeneratorFunctions,
- "proposal-class-properties": proposalClassProperties,
- "proposal-decorators": proposalDecorators,
- "proposal-do-expressions": proposalDoExpressions,
- "proposal-dynamic-import": proposalDynamicImport,
- "proposal-export-default-from": proposalExportDefaultFrom,
- "proposal-export-namespace-from": proposalExportNamespaceFrom,
- "proposal-function-bind": proposalFunctionBind,
- "proposal-function-sent": proposalFunctionSent,
- "proposal-json-strings": proposalJsonStrings,
- "proposal-logical-assignment-operators": proposalLogicalAssignmentOperators,
- "proposal-nullish-coalescing-operator": proposalNullishCoalescingOperator,
- "proposal-numeric-separator": proposalNumericSeparator,
- "proposal-object-rest-spread": proposalObjectRestSpread,
- "proposal-optional-catch-binding": proposalOptionalCatchBinding,
- "proposal-optional-chaining": proposalOptionalChaining,
- "proposal-pipeline-operator": proposalPipelineOperator,
- "proposal-private-methods": proposalPrivateMethods,
- "proposal-throw-expressions": proposalThrowExpressions,
- "proposal-unicode-property-regex": proposalUnicodePropertyRegex,
- "transform-async-to-generator": transformAsyncToGenerator,
- "transform-arrow-functions": transformArrowFunctions,
- "transform-block-scoped-functions": transformBlockScopedFunctions,
- "transform-block-scoping": transformBlockScoping,
- "transform-classes": transformClasses,
- "transform-computed-properties": transformComputedProperties,
- "transform-destructuring": transformDestructuring,
- "transform-dotall-regex": transformDotallRegex,
- "transform-duplicate-keys": transformDuplicateKeys,
- "transform-exponentiation-operator": transformExponentialOperator,
- "transform-flow-comments": transformFlowComments,
- "transform-flow-strip-types": transformFlowStripTypes,
- "transform-for-of": transformForOf,
- "transform-function-name": transformFunctionName,
- "transform-instanceof": transformInstanceof,
- "transform-jscript": transformJscript,
- "transform-literals": transformLiterals,
- "transform-member-expression-literals": transformMemberExpressionLiterals,
- "transform-modules-amd": transformModulesAmd,
- "transform-modules-commonjs": transformModulesCommonjs,
- "transform-modules-systemjs": transformModulesSystemjs,
- "transform-modules-umd": transformModulesUmd,
- "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex,
- "transform-new-target": transformNewTarget,
- "transform-object-assign": transformObjectAssign,
- "transform-object-super": transformObjectSuper,
- "transform-object-set-prototype-of-to-assign": transformObjectSetPrototypeOfToAssign,
- "transform-parameters": transformParameters,
- "transform-property-literals": transformPropertyLiterals,
- "transform-property-mutators": transformPropertyMutators,
- "transform-proto-to-assign": transformProtoToAssign,
- "transform-react-constant-elements": transformReactConstantElements,
- "transform-react-display-name": transformReactDisplayName,
- "transform-react-inline-elements": transformReactInlineElements,
- "transform-react-jsx": transformReactJSX,
- "transform-react-jsx-compat": transformReactJsxCompat,
- "transform-react-jsx-self": transformReactJSXSelf,
- "transform-react-jsx-source": transformReactJSXSource,
- "transform-regenerator": transformRegenerator,
- "transform-reserved-words": transformReservedWords,
- "transform-runtime": transformRuntime,
- "transform-shorthand-properties": transformShorthandProperties,
- "transform-spread": transformSpread,
- "transform-sticky-regex": transformStickyRegex,
- "transform-strict-mode": transformStrictMode,
- "transform-template-literals": transformTemplateLiterals,
- "transform-typeof-symbol": transformTypeofSymbol,
- "transform-typescript": transformTypeScript,
- "transform-unicode-regex": transformUnicodeRegex
- };
- var preset2015 = (function (_, opts) {
- var loose = false;
- var modules = "commonjs";
- var spec = false;
- if (opts !== undefined) {
- if (opts.loose !== undefined) loose = opts.loose;
- if (opts.modules !== undefined) modules = opts.modules;
- if (opts.spec !== undefined) spec = opts.spec;
- }
- var optsLoose = {
- loose: loose
- };
- return {
- plugins: [[transformTemplateLiterals, {
- loose: loose,
- spec: spec
- }], transformLiterals, transformFunctionName, [transformArrowFunctions, {
- spec: spec
- }], transformBlockScopedFunctions, [transformClasses, optsLoose], transformObjectSuper, transformShorthandProperties, transformDuplicateKeys, [transformComputedProperties, optsLoose], [transformForOf, optsLoose], transformStickyRegex, transformUnicodeRegex, [transformSpread, optsLoose], [transformParameters, optsLoose], [transformDestructuring, optsLoose], transformBlockScoping, transformTypeofSymbol, transformInstanceof, (modules === "commonjs" || modules === "cjs") && [transformModulesCommonjs, optsLoose], modules === "systemjs" && [transformModulesSystemjs, optsLoose], modules === "amd" && [transformModulesAmd, optsLoose], modules === "umd" && [transformModulesUmd, optsLoose], [transformRegenerator, {
- async: false,
- asyncGenerators: false
- }]].filter(Boolean)
- };
- });
- var presetStage3 = (function (_, opts) {
- var loose = false;
- if (opts !== undefined) {
- if (opts.loose !== undefined) loose = opts.loose;
- }
- return {
- plugins: [syntaxDynamicImport, syntaxImportMeta, [proposalOptionalChaining, {
- loose: loose
- }], [proposalNullishCoalescingOperator, {
- loose: loose
- }], [proposalClassProperties, {
- loose: loose
- }], proposalJsonStrings, [proposalPrivateMethods, {
- loose: loose
- }]]
- };
- });
- var presetStage2 = (function (_, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var _opts = opts,
- _opts$loose = _opts.loose,
- loose = _opts$loose === void 0 ? false : _opts$loose,
- _opts$useBuiltIns = _opts.useBuiltIns,
- useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
- _opts$decoratorsLegac = _opts.decoratorsLegacy,
- decoratorsLegacy = _opts$decoratorsLegac === void 0 ? false : _opts$decoratorsLegac,
- decoratorsBeforeExport = _opts.decoratorsBeforeExport;
- return {
- presets: [[presetStage3, {
- loose: loose,
- useBuiltIns: useBuiltIns
- }]],
- plugins: [[proposalDecorators, {
- legacy: decoratorsLegacy,
- decoratorsBeforeExport: decoratorsBeforeExport
- }], proposalFunctionSent, proposalExportNamespaceFrom, proposalNumericSeparator, proposalThrowExpressions]
- };
- });
- var presetStage1 = (function (_, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var _opts = opts,
- _opts$loose = _opts.loose,
- loose = _opts$loose === void 0 ? false : _opts$loose,
- _opts$useBuiltIns = _opts.useBuiltIns,
- useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
- _opts$decoratorsLegac = _opts.decoratorsLegacy,
- decoratorsLegacy = _opts$decoratorsLegac === void 0 ? false : _opts$decoratorsLegac,
- decoratorsBeforeExport = _opts.decoratorsBeforeExport,
- _opts$pipelineProposa = _opts.pipelineProposal,
- pipelineProposal = _opts$pipelineProposa === void 0 ? "minimal" : _opts$pipelineProposa;
- return {
- presets: [[presetStage2, {
- loose: loose,
- useBuiltIns: useBuiltIns,
- decoratorsLegacy: decoratorsLegacy,
- decoratorsBeforeExport: decoratorsBeforeExport
- }]],
- plugins: [proposalExportDefaultFrom, proposalLogicalAssignmentOperators, [proposalPipelineOperator, {
- proposal: pipelineProposal
- }], proposalDoExpressions]
- };
- });
- var presetStage0 = (function (_, opts) {
- if (opts === void 0) {
- opts = {};
- }
- var _opts = opts,
- _opts$loose = _opts.loose,
- loose = _opts$loose === void 0 ? false : _opts$loose,
- _opts$useBuiltIns = _opts.useBuiltIns,
- useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
- _opts$decoratorsLegac = _opts.decoratorsLegacy,
- decoratorsLegacy = _opts$decoratorsLegac === void 0 ? false : _opts$decoratorsLegac,
- decoratorsBeforeExport = _opts.decoratorsBeforeExport,
- _opts$pipelineProposa = _opts.pipelineProposal,
- pipelineProposal = _opts$pipelineProposa === void 0 ? "minimal" : _opts$pipelineProposa;
- return {
- presets: [[presetStage1, {
- loose: loose,
- useBuiltIns: useBuiltIns,
- decoratorsLegacy: decoratorsLegacy,
- decoratorsBeforeExport: decoratorsBeforeExport,
- pipelineProposal: pipelineProposal
- }]],
- plugins: [proposalFunctionBind]
- };
- });
- var envs = [
- {
- name: "nodejs",
- version: "0.2.0",
- date: "2011-08-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.3.0",
- date: "2011-08-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.4.0",
- date: "2011-08-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.5.0",
- date: "2011-08-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.6.0",
- date: "2011-11-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.7.0",
- date: "2012-01-17",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.8.0",
- date: "2012-06-22",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.9.0",
- date: "2012-07-20",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.10.0",
- date: "2013-03-11",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.11.0",
- date: "2013-03-28",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "0.12.0",
- date: "2015-02-06",
- lts: false,
- security: false
- },
- {
- name: "iojs",
- version: "1.0.0",
- date: "2015-01-14"
- },
- {
- name: "iojs",
- version: "1.1.0",
- date: "2015-02-03"
- },
- {
- name: "iojs",
- version: "1.2.0",
- date: "2015-02-11"
- },
- {
- name: "iojs",
- version: "1.3.0",
- date: "2015-02-20"
- },
- {
- name: "iojs",
- version: "1.5.0",
- date: "2015-03-06"
- },
- {
- name: "iojs",
- version: "1.6.0",
- date: "2015-03-20"
- },
- {
- name: "iojs",
- version: "2.0.0",
- date: "2015-05-04"
- },
- {
- name: "iojs",
- version: "2.1.0",
- date: "2015-05-24"
- },
- {
- name: "iojs",
- version: "2.2.0",
- date: "2015-06-01"
- },
- {
- name: "iojs",
- version: "2.3.0",
- date: "2015-06-13"
- },
- {
- name: "iojs",
- version: "2.4.0",
- date: "2015-07-17"
- },
- {
- name: "iojs",
- version: "2.5.0",
- date: "2015-07-28"
- },
- {
- name: "iojs",
- version: "3.0.0",
- date: "2015-08-04"
- },
- {
- name: "iojs",
- version: "3.1.0",
- date: "2015-08-19"
- },
- {
- name: "iojs",
- version: "3.2.0",
- date: "2015-08-25"
- },
- {
- name: "iojs",
- version: "3.3.0",
- date: "2015-09-02"
- },
- {
- name: "nodejs",
- version: "4.0.0",
- date: "2015-09-08",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "4.1.0",
- date: "2015-09-17",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "4.2.0",
- date: "2015-10-12",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.3.0",
- date: "2016-02-09",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.4.0",
- date: "2016-03-08",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.5.0",
- date: "2016-08-16",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.6.0",
- date: "2016-09-27",
- lts: "Argon",
- security: true
- },
- {
- name: "nodejs",
- version: "4.7.0",
- date: "2016-12-06",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.8.0",
- date: "2017-02-21",
- lts: "Argon",
- security: false
- },
- {
- name: "nodejs",
- version: "4.9.0",
- date: "2018-03-28",
- lts: "Argon",
- security: true
- },
- {
- name: "nodejs",
- version: "5.0.0",
- date: "2015-10-29",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.1.0",
- date: "2015-11-17",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.2.0",
- date: "2015-12-09",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.3.0",
- date: "2015-12-15",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.4.0",
- date: "2016-01-06",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.5.0",
- date: "2016-01-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.6.0",
- date: "2016-02-09",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.7.0",
- date: "2016-02-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.8.0",
- date: "2016-03-09",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.9.0",
- date: "2016-03-16",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.10.0",
- date: "2016-04-01",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.11.0",
- date: "2016-04-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "5.12.0",
- date: "2016-06-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.0.0",
- date: "2016-04-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.1.0",
- date: "2016-05-05",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.2.0",
- date: "2016-05-17",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.3.0",
- date: "2016-07-06",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.4.0",
- date: "2016-08-12",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.5.0",
- date: "2016-08-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.6.0",
- date: "2016-09-14",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.7.0",
- date: "2016-09-27",
- lts: false,
- security: true
- },
- {
- name: "nodejs",
- version: "6.8.0",
- date: "2016-10-12",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "6.9.0",
- date: "2016-10-18",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.10.0",
- date: "2017-02-21",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.11.0",
- date: "2017-06-06",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.12.0",
- date: "2017-11-06",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.13.0",
- date: "2018-02-10",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.14.0",
- date: "2018-03-28",
- lts: "Boron",
- security: true
- },
- {
- name: "nodejs",
- version: "6.15.0",
- date: "2018-11-27",
- lts: "Boron",
- security: true
- },
- {
- name: "nodejs",
- version: "6.16.0",
- date: "2018-12-26",
- lts: "Boron",
- security: false
- },
- {
- name: "nodejs",
- version: "6.17.0",
- date: "2019-02-28",
- lts: "Boron",
- security: true
- },
- {
- name: "nodejs",
- version: "7.0.0",
- date: "2016-10-25",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.1.0",
- date: "2016-11-08",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.2.0",
- date: "2016-11-22",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.3.0",
- date: "2016-12-20",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.4.0",
- date: "2017-01-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.5.0",
- date: "2017-01-31",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.6.0",
- date: "2017-02-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.7.0",
- date: "2017-02-28",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.8.0",
- date: "2017-03-29",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.9.0",
- date: "2017-04-11",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "7.10.0",
- date: "2017-05-02",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.0.0",
- date: "2017-05-30",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.1.0",
- date: "2017-06-08",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.2.0",
- date: "2017-07-19",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.3.0",
- date: "2017-08-08",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.4.0",
- date: "2017-08-15",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.5.0",
- date: "2017-09-12",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.6.0",
- date: "2017-09-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.7.0",
- date: "2017-10-11",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.8.0",
- date: "2017-10-24",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "8.9.0",
- date: "2017-10-31",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.10.0",
- date: "2018-03-06",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.11.0",
- date: "2018-03-28",
- lts: "Carbon",
- security: true
- },
- {
- name: "nodejs",
- version: "8.12.0",
- date: "2018-09-10",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.13.0",
- date: "2018-11-20",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.14.0",
- date: "2018-11-27",
- lts: "Carbon",
- security: true
- },
- {
- name: "nodejs",
- version: "8.15.0",
- date: "2018-12-26",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.16.0",
- date: "2019-04-16",
- lts: "Carbon",
- security: false
- },
- {
- name: "nodejs",
- version: "8.17.0",
- date: "2019-12-17",
- lts: "Carbon",
- security: true
- },
- {
- name: "nodejs",
- version: "9.0.0",
- date: "2017-10-31",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.1.0",
- date: "2017-11-07",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.2.0",
- date: "2017-11-14",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.3.0",
- date: "2017-12-12",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.4.0",
- date: "2018-01-10",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.5.0",
- date: "2018-01-31",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.6.0",
- date: "2018-02-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.7.0",
- date: "2018-03-01",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.8.0",
- date: "2018-03-07",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.9.0",
- date: "2018-03-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "9.10.0",
- date: "2018-03-28",
- lts: false,
- security: true
- },
- {
- name: "nodejs",
- version: "9.11.0",
- date: "2018-04-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.0.0",
- date: "2018-04-24",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.1.0",
- date: "2018-05-08",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.2.0",
- date: "2018-05-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.3.0",
- date: "2018-05-29",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.4.0",
- date: "2018-06-06",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.5.0",
- date: "2018-06-20",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.6.0",
- date: "2018-07-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.7.0",
- date: "2018-07-18",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.8.0",
- date: "2018-08-01",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.9.0",
- date: "2018-08-15",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.10.0",
- date: "2018-09-06",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.11.0",
- date: "2018-09-19",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.12.0",
- date: "2018-10-10",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "10.13.0",
- date: "2018-10-30",
- lts: "Dubnium",
- security: false
- },
- {
- name: "nodejs",
- version: "10.14.0",
- date: "2018-11-27",
- lts: "Dubnium",
- security: true
- },
- {
- name: "nodejs",
- version: "10.15.0",
- date: "2018-12-26",
- lts: "Dubnium",
- security: false
- },
- {
- name: "nodejs",
- version: "10.16.0",
- date: "2019-05-28",
- lts: "Dubnium",
- security: false
- },
- {
- name: "nodejs",
- version: "10.17.0",
- date: "2019-10-21",
- lts: "Dubnium",
- security: false
- },
- {
- name: "nodejs",
- version: "10.18.0",
- date: "2019-12-16",
- lts: "Dubnium",
- security: true
- },
- {
- name: "nodejs",
- version: "11.0.0",
- date: "2018-10-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.1.0",
- date: "2018-10-30",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.2.0",
- date: "2018-11-15",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.3.0",
- date: "2018-11-27",
- lts: false,
- security: true
- },
- {
- name: "nodejs",
- version: "11.4.0",
- date: "2018-12-07",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.5.0",
- date: "2018-12-18",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.6.0",
- date: "2018-12-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.7.0",
- date: "2019-01-17",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.8.0",
- date: "2019-01-24",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.9.0",
- date: "2019-01-30",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.10.0",
- date: "2019-02-14",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.11.0",
- date: "2019-03-05",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.12.0",
- date: "2019-03-14",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.13.0",
- date: "2019-03-28",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.14.0",
- date: "2019-04-10",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "11.15.0",
- date: "2019-04-30",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.0.0",
- date: "2019-04-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.1.0",
- date: "2019-04-29",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.2.0",
- date: "2019-05-07",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.3.0",
- date: "2019-05-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.4.0",
- date: "2019-06-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.5.0",
- date: "2019-06-26",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.6.0",
- date: "2019-07-03",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.7.0",
- date: "2019-07-23",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.8.0",
- date: "2019-08-06",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.9.0",
- date: "2019-08-20",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.10.0",
- date: "2019-09-04",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.11.0",
- date: "2019-09-25",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.12.0",
- date: "2019-10-11",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "12.13.0",
- date: "2019-10-21",
- lts: "Erbium",
- security: false
- },
- {
- name: "nodejs",
- version: "12.14.0",
- date: "2019-12-16",
- lts: "Erbium",
- security: true
- },
- {
- name: "nodejs",
- version: "13.0.0",
- date: "2019-10-10",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "13.1.0",
- date: "2019-11-05",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "13.2.0",
- date: "2019-11-21",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "13.3.0",
- date: "2019-12-03",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "13.4.0",
- date: "2019-12-17",
- lts: false,
- security: true
- },
- {
- name: "nodejs",
- version: "13.5.0",
- date: "2019-12-18",
- lts: false,
- security: false
- },
- {
- name: "nodejs",
- version: "13.6.0",
- date: "2020-01-07",
- lts: false,
- security: false
- }
- ];
- var envs$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': envs
- });
- var browsers = {
- A: "ie",
- B: "edge",
- C: "firefox",
- D: "chrome",
- E: "safari",
- F: "opera",
- G: "ios_saf",
- H: "op_mini",
- I: "android",
- J: "bb",
- K: "op_mob",
- L: "and_chr",
- M: "and_ff",
- N: "ie_mob",
- O: "and_uc",
- P: "samsung",
- Q: "and_qq",
- R: "baidu",
- S: "kaios"
- };
- var browsers_1 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var browsers$1 = exports.browsers = browsers;
- });
- unwrapExports(browsers_1);
- var browsers_2 = browsers_1.browsers;
- var browserVersions = {
- "0": "56",
- "1": "57",
- "2": "58",
- "3": "60",
- "4": "62",
- "5": "63",
- "6": "64",
- "7": "11.1",
- "8": "68",
- "9": "12.1",
- A: "10",
- B: "11",
- C: "12",
- D: "7",
- E: "9",
- F: "4",
- G: "8",
- H: "6",
- I: "17",
- J: "18",
- K: "13",
- L: "15",
- M: "46",
- N: "16",
- O: "5",
- P: "19",
- Q: "20",
- R: "21",
- S: "22",
- T: "23",
- U: "24",
- V: "25",
- W: "26",
- X: "27",
- Y: "28",
- Z: "29",
- a: "30",
- b: "31",
- c: "32",
- d: "33",
- e: "34",
- f: "14",
- g: "36",
- h: "37",
- i: "38",
- j: "39",
- k: "40",
- l: "41",
- m: "42",
- n: "43",
- o: "44",
- p: "45",
- q: "76",
- r: "47",
- s: "48",
- t: "49",
- u: "50",
- v: "51",
- w: "52",
- x: "53",
- y: "54",
- z: "55",
- AB: "35",
- BB: "66",
- CB: "4.2-4.3",
- DB: "65",
- EB: "59",
- FB: "67",
- GB: "11.5",
- HB: "69",
- IB: "70",
- JB: "71",
- KB: "72",
- LB: "73",
- MB: "61",
- NB: "3",
- OB: "10.1",
- PB: "3.2",
- QB: "78",
- RB: "9.0-9.2",
- SB: "77",
- TB: "80",
- UB: "81",
- VB: "3.1",
- WB: "75",
- XB: "5.1",
- YB: "6.1",
- ZB: "7.1",
- aB: "9.1",
- bB: "74",
- cB: "3.6",
- dB: "3.5",
- eB: "TP",
- fB: "9.5-9.6",
- gB: "10.0-10.1",
- hB: "10.5",
- iB: "10.6",
- jB: "2",
- kB: "11.6",
- lB: "4.0-4.1",
- mB: "5.5",
- nB: "5.0-5.1",
- oB: "6.0-6.1",
- pB: "7.0-7.1",
- qB: "8.1-8.4",
- rB: "79",
- sB: "9.3",
- tB: "10.0-10.2",
- uB: "10.3",
- vB: "11.0-11.2",
- wB: "11.3-11.4",
- xB: "12.0-12.1",
- yB: "12.2-12.4",
- zB: "13.0-13.1",
- "0B": "13.2",
- "1B": "13.3",
- "2B": "all",
- "3B": "2.1",
- "4B": "2.2",
- "5B": "2.3",
- "6B": "4.1",
- "7B": "4.4",
- "8B": "4.4.3-4.4.4",
- "9B": "12.12",
- AC: "5.0-5.4",
- BC: "6.2-6.4",
- CC: "7.2-7.4",
- DC: "8.2",
- EC: "9.2",
- FC: "1.2",
- GC: "7.12",
- HC: "2.5"
- };
- var browserVersions_1 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- var browserVersions$1 = exports.browserVersions = browserVersions;
- });
- unwrapExports(browserVersions_1);
- var browserVersions_2 = browserVersions_1.browserVersions;
- var agents = {
- A: {
- A: {
- H: 0.0092277,
- D: 0.0092277,
- G: 0.110732,
- E: 0.0415246,
- A: 0.0369108,
- B: 1.43029,
- mB: 0.009298
- },
- B: "ms",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "mB", "H", "D", "G", "E", "A", "B", "", "", ""],
- E: "IE",
- F: {
- mB: 962323200,
- H: 998870400,
- D: 1161129600,
- G: 1237420800,
- E: 1300060800,
- A: 1346716800,
- B: 1381968000
- }
- },
- B: {
- A: {
- C: 0.008806,
- K: 0.008806,
- f: 0.017612,
- L: 0.017612,
- N: 0.039627,
- I: 0.149702,
- J: 1.79642,
- q: 0
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "C", "K", "f", "L", "N", "I", "J", "q", "", ""],
- E: "Edge",
- F: {
- C: 1438128000,
- K: 1447286400,
- f: 1470096000,
- L: 1491868800,
- N: 1508198400,
- I: 1525046400,
- J: 1542067200,
- q: null
- },
- D: {
- C: "ms",
- K: "ms",
- f: "ms",
- L: "ms",
- N: "ms",
- I: "ms",
- J: "ms"
- }
- },
- C: {
- A: {
- "0": 0.026418,
- "1": 0.013209,
- "2": 0.008806,
- "3": 0.039627,
- "4": 0.008806,
- "5": 0.017612,
- "6": 0.026418,
- "8": 0.13209,
- jB: 0.004827,
- NB: 0.00487,
- F: 0.00974,
- O: 0.004879,
- H: 0.020136,
- D: 0.005725,
- G: 0.004525,
- E: 0.00533,
- A: 0.004283,
- B: 0.009042,
- C: 0.004471,
- K: 0.004486,
- f: 0.00453,
- L: 0.004465,
- N: 0.004417,
- I: 0.008922,
- J: 0.004393,
- P: 0.004443,
- Q: 0.004283,
- R: 0.008806,
- S: 0.004393,
- T: 0.004525,
- U: 0.008786,
- V: 0.004403,
- W: 0.004317,
- X: 0.004393,
- Y: 0.004418,
- Z: 0.008834,
- a: 0.004403,
- b: 0.008928,
- c: 0.004471,
- d: 0.008922,
- e: 0.004707,
- AB: 0.022015,
- g: 0.004465,
- h: 0.004783,
- i: 0.008806,
- j: 0.004783,
- k: 0.00487,
- l: 0.005029,
- m: 0.0047,
- n: 0.008806,
- o: 0.008806,
- p: 0.013209,
- M: 0.004525,
- r: 0.022015,
- s: 0.030821,
- t: 0.004403,
- u: 0.013209,
- v: 0.008806,
- w: 0.145299,
- x: 0.008806,
- y: 0.013209,
- z: 0.008806,
- EB: 0.008806,
- MB: 0.013209,
- DB: 0.052836,
- BB: 0.04403,
- FB: 0.026418,
- HB: 0.074851,
- IB: 0.761719,
- JB: 2.42605,
- KB: 0.057239,
- LB: 0,
- dB: 0.008786,
- cB: 0.00487
- },
- B: "moz",
- C: ["", "", "", "jB", "NB", "dB", "cB", "F", "O", "H", "D", "G", "E", "A", "B", "C", "K", "f", "L", "N", "I", "J", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "AB", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "M", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "EB", "3", "MB", "4", "5", "6", "DB", "BB", "FB", "8", "HB", "IB", "JB", "KB", "LB", ""],
- E: "Firefox",
- F: {
- "0": 1506556800,
- "1": 1510617600,
- "2": 1516665600,
- "3": 1525824000,
- "4": 1536105600,
- "5": 1540252800,
- "6": 1544486400,
- "8": 1562630400,
- jB: 1161648000,
- NB: 1213660800,
- dB: 1246320000,
- cB: 1264032000,
- F: 1300752000,
- O: 1308614400,
- H: 1313452800,
- D: 1317081600,
- G: 1317081600,
- E: 1320710400,
- A: 1324339200,
- B: 1327968000,
- C: 1331596800,
- K: 1335225600,
- f: 1338854400,
- L: 1342483200,
- N: 1346112000,
- I: 1349740800,
- J: 1353628800,
- P: 1357603200,
- Q: 1361232000,
- R: 1364860800,
- S: 1368489600,
- T: 1372118400,
- U: 1375747200,
- V: 1379376000,
- W: 1386633600,
- X: 1391472000,
- Y: 1395100800,
- Z: 1398729600,
- a: 1402358400,
- b: 1405987200,
- c: 1409616000,
- d: 1413244800,
- e: 1417392000,
- AB: 1421107200,
- g: 1424736000,
- h: 1428278400,
- i: 1431475200,
- j: 1435881600,
- k: 1439251200,
- l: 1442880000,
- m: 1446508800,
- n: 1450137600,
- o: 1453852800,
- p: 1457395200,
- M: 1461628800,
- r: 1465257600,
- s: 1470096000,
- t: 1474329600,
- u: 1479168000,
- v: 1485216000,
- w: 1488844800,
- x: 1492560000,
- y: 1497312000,
- z: 1502150400,
- EB: 1520985600,
- MB: 1529971200,
- DB: 1548720000,
- BB: 1552953600,
- FB: 1558396800,
- HB: 1567468800,
- IB: 1571788800,
- JB: 1575331200,
- KB: null,
- LB: null
- }
- },
- D: {
- A: {
- "0": 0.035224,
- "1": 0.066045,
- "2": 0.030821,
- "3": 0.030821,
- "4": 0.030821,
- "5": 0.277389,
- "6": 0.017612,
- "8": 0.061642,
- F: 0.004706,
- O: 0.004879,
- H: 0.004879,
- D: 0.005591,
- G: 0.005591,
- E: 0.005591,
- A: 0.004534,
- B: 0.004464,
- C: 0.010424,
- K: 0.004403,
- f: 0.004706,
- L: 0.015087,
- N: 0.004393,
- I: 0.004393,
- J: 0.008652,
- P: 0.004418,
- Q: 0.004393,
- R: 0.004317,
- S: 0.004465,
- T: 0.008786,
- U: 0.008806,
- V: 0.004461,
- W: 0.004403,
- X: 0.004326,
- Y: 0.0047,
- Z: 0.004461,
- a: 0.004403,
- b: 0.013209,
- c: 0.004465,
- d: 0.013209,
- e: 0.008806,
- AB: 0.008806,
- g: 0.008806,
- h: 0.004464,
- i: 0.022015,
- j: 0.004464,
- k: 0.013209,
- l: 0.008806,
- m: 0.004403,
- n: 0.017612,
- o: 0.004465,
- p: 0.004403,
- M: 0.004403,
- r: 0.008806,
- s: 0.035224,
- t: 0.515151,
- u: 0.008806,
- v: 0.013209,
- w: 0.004403,
- x: 0.022015,
- y: 0.026418,
- z: 0.04403,
- EB: 0.017612,
- MB: 0.035224,
- DB: 0.052836,
- BB: 0.035224,
- FB: 0.066045,
- HB: 0.184926,
- IB: 0.149702,
- JB: 0.198135,
- KB: 0.206941,
- LB: 0.184926,
- bB: 0.224553,
- WB: 0.268583,
- q: 0.281792,
- SB: 0.409479,
- QB: 13.9971,
- rB: 11.5006,
- TB: 0.039627,
- UB: 0.017612
- },
- B: "webkit",
- C: ["F", "O", "H", "D", "G", "E", "A", "B", "C", "K", "f", "L", "N", "I", "J", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "AB", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "M", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "EB", "3", "MB", "4", "5", "6", "DB", "BB", "FB", "8", "HB", "IB", "JB", "KB", "LB", "bB", "WB", "q", "SB", "QB", "rB", "TB", "UB"],
- E: "Chrome",
- F: {
- "0": 1485302400,
- "1": 1489017600,
- "2": 1492560000,
- "3": 1500940800,
- "4": 1508198400,
- "5": 1512518400,
- "6": 1516752000,
- "8": 1532390400,
- F: 1264377600,
- O: 1274745600,
- H: 1283385600,
- D: 1287619200,
- G: 1291248000,
- E: 1296777600,
- A: 1299542400,
- B: 1303862400,
- C: 1307404800,
- K: 1312243200,
- f: 1316131200,
- L: 1316131200,
- N: 1319500800,
- I: 1323734400,
- J: 1328659200,
- P: 1332892800,
- Q: 1337040000,
- R: 1340668800,
- S: 1343692800,
- T: 1348531200,
- U: 1352246400,
- V: 1357862400,
- W: 1361404800,
- X: 1364428800,
- Y: 1369094400,
- Z: 1374105600,
- a: 1376956800,
- b: 1384214400,
- c: 1389657600,
- d: 1392940800,
- e: 1397001600,
- AB: 1400544000,
- g: 1405468800,
- h: 1409011200,
- i: 1412640000,
- j: 1416268800,
- k: 1421798400,
- l: 1425513600,
- m: 1429401600,
- n: 1432080000,
- o: 1437523200,
- p: 1441152000,
- M: 1444780800,
- r: 1449014400,
- s: 1453248000,
- t: 1456963200,
- u: 1460592000,
- v: 1464134400,
- w: 1469059200,
- x: 1472601600,
- y: 1476230400,
- z: 1480550400,
- EB: 1496707200,
- MB: 1504569600,
- DB: 1520294400,
- BB: 1523923200,
- FB: 1527552000,
- HB: 1536019200,
- IB: 1539648000,
- JB: 1543968000,
- KB: 1548720000,
- LB: 1552348800,
- bB: 1555977600,
- WB: 1559606400,
- q: 1564444800,
- SB: 1568073600,
- QB: 1571702400,
- rB: null,
- TB: null,
- UB: null
- }
- },
- E: {
- A: {
- "7": 0.184926,
- "9": 0.435897,
- F: 0,
- O: 0.004403,
- H: 0.004349,
- D: 0.004465,
- G: 0.026418,
- E: 0.013209,
- A: 0.017612,
- B: 0.039627,
- C: 0.136493,
- K: 2.29396,
- VB: 0,
- PB: 0.008692,
- XB: 0.66045,
- YB: 0.00456,
- ZB: 0.004283,
- aB: 0.035224,
- OB: 0.096866,
- eB: 0
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "VB", "PB", "F", "O", "XB", "H", "YB", "D", "ZB", "G", "E", "aB", "A", "OB", "B", "7", "C", "9", "K", "eB", "", ""],
- E: "Safari",
- F: {
- "7": 1522281600,
- "9": 1553472000,
- VB: 1205798400,
- PB: 1226534400,
- F: 1244419200,
- O: 1275868800,
- XB: 1311120000,
- H: 1343174400,
- YB: 1382400000,
- D: 1382400000,
- ZB: 1410998400,
- G: 1413417600,
- E: 1443657600,
- aB: 1458518400,
- A: 1474329600,
- OB: 1490572800,
- B: 1505779200,
- C: 1537142400,
- K: 1568851200,
- eB: null
- }
- },
- F: {
- A: {
- "0": 0.008806,
- "1": 0.008806,
- "2": 0.013209,
- "3": 0.004403,
- "4": 0.004403,
- "5": 0.013209,
- "6": 0.070448,
- "7": 0.006229,
- "9": 0.008806,
- E: 0.0082,
- B: 0.016581,
- C: 0.004317,
- L: 0.00685,
- N: 0.00685,
- I: 0.00685,
- J: 0.005014,
- P: 0.006015,
- Q: 0.004879,
- R: 0.006597,
- S: 0.006597,
- T: 0.013434,
- U: 0.006702,
- V: 0.006015,
- W: 0.005595,
- X: 0.004393,
- Y: 0.008652,
- Z: 0.004879,
- a: 0.004879,
- b: 0.008806,
- c: 0.005152,
- d: 0.005014,
- e: 0.009758,
- AB: 0.004879,
- g: 0.013209,
- h: 0.004283,
- i: 0.004367,
- j: 0.004534,
- k: 0.004367,
- l: 0.004227,
- m: 0.004418,
- n: 0.009042,
- o: 0.004227,
- p: 0.004725,
- M: 0.004417,
- r: 0.008942,
- s: 0.004707,
- t: 0.004827,
- u: 0.004707,
- v: 0.004707,
- w: 0.004326,
- x: 0.008922,
- y: 0.014349,
- z: 0.004725,
- fB: 0.00685,
- gB: 0,
- hB: 0.008392,
- iB: 0.004706,
- GB: 0.004879,
- kB: 0.008786
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "E", "fB", "gB", "hB", "iB", "B", "7", "GB", "kB", "C", "9", "L", "N", "I", "J", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "AB", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "M", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "", "", ""],
- E: "Opera",
- F: {
- "0": 1537833600,
- "1": 1543363200,
- "2": 1548201600,
- "3": 1554768000,
- "4": 1561593600,
- "5": 1566259200,
- "6": 1570406400,
- "7": 1302566400,
- "9": 1352073600,
- E: 1150761600,
- fB: 1223424000,
- gB: 1251763200,
- hB: 1267488000,
- iB: 1277942400,
- B: 1292457600,
- GB: 1309219200,
- kB: 1323129600,
- C: 1323129600,
- L: 1372723200,
- N: 1377561600,
- I: 1381104000,
- J: 1386288000,
- P: 1390867200,
- Q: 1393891200,
- R: 1399334400,
- S: 1401753600,
- T: 1405987200,
- U: 1409616000,
- V: 1413331200,
- W: 1417132800,
- X: 1422316800,
- Y: 1425945600,
- Z: 1430179200,
- a: 1433808000,
- b: 1438646400,
- c: 1442448000,
- d: 1445904000,
- e: 1449100800,
- AB: 1454371200,
- g: 1457308800,
- h: 1462320000,
- i: 1465344000,
- j: 1470096000,
- k: 1474329600,
- l: 1477267200,
- m: 1481587200,
- n: 1486425600,
- o: 1490054400,
- p: 1494374400,
- M: 1498003200,
- r: 1502236800,
- s: 1506470400,
- t: 1510099200,
- u: 1515024000,
- v: 1517961600,
- w: 1521676800,
- x: 1525910400,
- y: 1530144000,
- z: 1534982400
- },
- D: {
- "7": "o",
- "9": "o",
- E: "o",
- B: "o",
- C: "o",
- fB: "o",
- gB: "o",
- hB: "o",
- iB: "o",
- GB: "o",
- kB: "o"
- }
- },
- G: {
- A: {
- G: 0.00128072,
- PB: 0.00512289,
- lB: 0.00256144,
- CB: 0,
- nB: 0.00768433,
- oB: 0.00256144,
- pB: 0.00896505,
- qB: 0.0166494,
- RB: 0.0153687,
- sB: 0.162652,
- tB: 0.0563518,
- uB: 0.181862,
- vB: 0.153687,
- wB: 0.274074,
- xB: 0.391901,
- yB: 2.77404,
- zB: 4.02787,
- "0B": 1.83399,
- "1B": 2.88931
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "PB", "lB", "CB", "nB", "oB", "pB", "G", "qB", "RB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "1B", "", ""],
- E: "iOS Safari",
- F: {
- PB: 1270252800,
- lB: 1283904000,
- CB: 1299628800,
- nB: 1331078400,
- oB: 1359331200,
- pB: 1394409600,
- G: 1410912000,
- qB: 1413763200,
- RB: 1442361600,
- sB: 1458518400,
- tB: 1473724800,
- uB: 1490572800,
- vB: 1505779200,
- wB: 1522281600,
- xB: 1537142400,
- yB: 1553472000,
- zB: 1568851200,
- "0B": 1572220800,
- "1B": null
- }
- },
- H: {
- A: {
- "2B": 1.16575
- },
- B: "o",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "2B", "", "", ""],
- E: "Opera Mini",
- F: {
- "2B": 1426464000
- }
- },
- I: {
- A: {
- NB: 0.000748894,
- F: 0.00324521,
- q: 0,
- "3B": 0,
- "4B": 0.000499263,
- "5B": 0.000499263,
- "6B": 0.00574152,
- CB: 0.125565,
- "7B": 0,
- "8B": 0.0763872
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "3B", "4B", "5B", "NB", "F", "6B", "CB", "7B", "8B", "q", "", "", ""],
- E: "Android Browser",
- F: {
- "3B": 1256515200,
- "4B": 1274313600,
- "5B": 1291593600,
- NB: 1298332800,
- F: 1318896000,
- "6B": 1341792000,
- CB: 1374624000,
- "7B": 1386547200,
- "8B": 1401667200,
- q: 1566777600
- }
- },
- J: {
- A: {
- D: 0,
- A: 0.011194
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D", "A", "", "", ""],
- E: "Blackberry Browser",
- F: {
- D: 1325376000,
- A: 1359504000
- }
- },
- K: {
- A: {
- "7": 0,
- "9": 0,
- A: 0,
- B: 0,
- C: 0,
- M: 0.0111391,
- GB: 0
- },
- B: "o",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "7", "GB", "C", "9", "M", "", "", ""],
- E: "Opera Mobile",
- F: {
- "7": 1314835200,
- "9": 1349740800,
- A: 1287100800,
- B: 1300752000,
- GB: 1318291200,
- C: 1330300800,
- M: 1474588800
- },
- D: {
- M: "webkit"
- }
- },
- L: {
- A: {
- QB: 35.1619
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "QB", "", "", ""],
- E: "Chrome for Android",
- F: {
- QB: 1571702400
- }
- },
- M: {
- A: {
- "8": 0.229477
- },
- B: "moz",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "8", "", "", ""],
- E: "Firefox for Android",
- F: {
- "8": 1567468800
- }
- },
- N: {
- A: {
- A: 0.0115934,
- B: 0.050373
- },
- B: "ms",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "", "", ""],
- E: "IE Mobile",
- F: {
- A: 1340150400,
- B: 1353456000
- }
- },
- O: {
- A: {
- "9B": 2.88246
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "9B", "", "", ""],
- E: "UC Browser for Android",
- F: {
- "9B": 1471392000
- },
- D: {
- "9B": "webkit"
- }
- },
- P: {
- A: {
- F: 0.33211,
- AC: 0.0311353,
- BC: 0.0207569,
- CC: 0.114163,
- DC: 0.0415137,
- EC: 0.321732,
- OB: 2.72953
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "F", "AC", "BC", "CC", "DC", "EC", "OB", "", "", ""],
- E: "Samsung Internet",
- F: {
- F: 1461024000,
- AC: 1481846400,
- BC: 1509408000,
- CC: 1528329600,
- DC: 1546128000,
- EC: 1554163200,
- OB: 1567900800
- }
- },
- Q: {
- A: {
- FC: 0.201492
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "FC", "", "", ""],
- E: "QQ Browser",
- F: {
- FC: 1483228800
- }
- },
- R: {
- A: {
- GC: 0
- },
- B: "webkit",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "GC", "", "", ""],
- E: "Baidu Browser",
- F: {
- GC: 1491004800
- }
- },
- S: {
- A: {
- HC: 0.195895
- },
- B: "moz",
- C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "HC", "", "", ""],
- E: "KaiOS Browser",
- F: {
- HC: 1527811200
- }
- }
- };
- var agents_1 = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.agents = undefined;
- function unpackBrowserVersions(versionsData) {
- return Object.keys(versionsData).reduce(function (usage, version) {
- usage[browserVersions_1.browserVersions[version]] = versionsData[version];
- return usage;
- }, {});
- }
- var agents$1 = exports.agents = Object.keys(agents).reduce(function (map, key) {
- var versionsData = agents[key];
- map[browsers_1.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) {
- if (entry === 'A') {
- data.usage_global = unpackBrowserVersions(versionsData[entry]);
- } else if (entry === 'C') {
- data.versions = versionsData[entry].reduce(function (list, version) {
- if (version === '') {
- list.push(null);
- } else {
- list.push(browserVersions_1.browserVersions[version]);
- }
- return list;
- }, []);
- } else if (entry === 'D') {
- data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);
- } else if (entry === 'E') {
- data.browser = versionsData[entry];
- } else if (entry === 'F') {
- data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) {
- map[browserVersions_1.browserVersions[key]] = versionsData[entry][key];
- return map;
- }, {});
- } else {
- data.prefix = versionsData[entry];
- }
- return data;
- }, {});
- return map;
- }, {});
- });
- unwrapExports(agents_1);
- var agents_2 = agents_1.agents;
- var v4 = {
- start: "2015-09-08",
- lts: "2015-10-12",
- maintenance: "2017-04-01",
- end: "2018-04-30",
- codename: "Argon"
- };
- var v5 = {
- start: "2015-10-29",
- maintenance: "2016-04-30",
- end: "2016-06-30"
- };
- var v6 = {
- start: "2016-04-26",
- lts: "2016-10-18",
- maintenance: "2018-04-30",
- end: "2019-04-30",
- codename: "Boron"
- };
- var v7 = {
- start: "2016-10-25",
- maintenance: "2017-04-30",
- end: "2017-06-30"
- };
- var v8$1 = {
- start: "2017-05-30",
- lts: "2017-10-31",
- maintenance: "2019-01-01",
- end: "2019-12-31",
- codename: "Carbon"
- };
- var v9 = {
- start: "2017-10-01",
- maintenance: "2018-04-01",
- end: "2018-06-30"
- };
- var v10 = {
- start: "2018-04-24",
- lts: "2018-10-30",
- maintenance: "2020-04-01",
- end: "2021-04-30",
- codename: "Dubnium"
- };
- var v11 = {
- start: "2018-10-23",
- maintenance: "2019-04-22",
- end: "2019-06-01"
- };
- var v12 = {
- start: "2019-04-23",
- lts: "2019-10-21",
- maintenance: "2020-10-21",
- end: "2022-04-30",
- codename: "Erbium"
- };
- var v13 = {
- start: "2019-10-22",
- maintenance: "2020-04-01",
- end: "2020-06-01"
- };
- var v14 = {
- start: "2020-04-21",
- lts: "2020-10-20",
- maintenance: "2021-10-20",
- end: "2023-04-30",
- codename: ""
- };
- var releaseSchedule = {
- "v0.10": {
- start: "2013-03-11",
- end: "2016-10-31"
- },
- "v0.12": {
- start: "2015-02-06",
- end: "2016-12-31"
- },
- v4: v4,
- v5: v5,
- v6: v6,
- v7: v7,
- v8: v8$1,
- v9: v9,
- v10: v10,
- v11: v11,
- v12: v12,
- v13: v13,
- v14: v14
- };
- var releaseSchedule$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- v4: v4,
- v5: v5,
- v6: v6,
- v7: v7,
- v8: v8$1,
- v9: v9,
- v10: v10,
- v11: v11,
- v12: v12,
- v13: v13,
- v14: v14,
- 'default': releaseSchedule
- });
- var versions$1 = {
- "8.0": "79",
- "7.1": "78",
- "7.0": "78",
- "6.1": "76",
- "6.0": "76",
- "5.0": "72",
- "4.2": "69",
- "4.1": "69",
- "4.0": "69",
- "3.1": "66",
- "3.0": "66",
- "2.1": "61",
- "2.0": "61",
- "1.8": "59",
- "1.7": "58",
- "1.6": "56",
- "1.5": "54",
- "1.4": "53",
- "1.3": "52",
- "1.2": "51",
- "1.1": "50",
- "1.0": "49",
- "0.37": "49",
- "0.36": "47",
- "0.35": "45",
- "0.34": "45",
- "0.33": "45",
- "0.32": "45",
- "0.31": "44",
- "0.30": "44",
- "0.29": "43",
- "0.28": "43",
- "0.27": "42",
- "0.26": "42",
- "0.25": "42",
- "0.24": "41",
- "0.23": "41",
- "0.22": "41",
- "0.21": "40",
- "0.20": "39"
- };
- function BrowserslistError(message) {
- this.name = 'BrowserslistError';
- this.message = message;
- this.browserslist = true;
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, BrowserslistError);
- }
- }
- BrowserslistError.prototype = Error.prototype;
- var error = BrowserslistError;
- function noop$2() {}
- var browser$6 = {
- loadQueries: function loadQueries() {
- throw new error('Sharable configs are not supported in client-side build of Browserslist');
- },
- getStat: function getStat(opts) {
- return opts.stats;
- },
- loadConfig: function loadConfig(opts) {
- if (opts.config) {
- throw new error('Browserslist config are not supported in client-side build');
- }
- },
- loadCountry: function loadCountry() {
- throw new error('Country statistics is not supported ' + 'in client-side build of Browserslist');
- },
- currentNode: function currentNode(resolve, context) {
- return resolve(['maintained node versions'], context)[0];
- },
- parseConfig: noop$2,
- readConfig: noop$2,
- findConfig: noop$2,
- clearCaches: noop$2,
- oldDataWarning: noop$2
- };
- var jsReleases = getCjsExportFromNamespace(envs$1);
- var jsEOL = getCjsExportFromNamespace(releaseSchedule$1);
- var agents$1 = agents_1.agents;
- var YEAR = 365.259641 * 24 * 60 * 60 * 1000;
- var ANDROID_EVERGREEN_FIRST = 37;
- var QUERY_OR = 1;
- var QUERY_AND = 2;
- function isVersionsMatch(versionA, versionB) {
- return (versionA + '.').indexOf(versionB + '.') === 0;
- }
- function isEolReleased(name) {
- var version = name.slice(1);
- return jsReleases.some(function (i) {
- return isVersionsMatch(i.version, version);
- });
- }
- function normalize$1(versions) {
- return versions.filter(function (version) {
- return typeof version === 'string';
- });
- }
- function normalizeElectron(version) {
- var versionToUse = version;
- if (version.split('.').length === 3) {
- versionToUse = version.split('.').slice(0, -1).join('.');
- }
- return versionToUse;
- }
- function nameMapper(name) {
- return function mapName(version) {
- return name + ' ' + version;
- };
- }
- function getMajor(version) {
- return parseInt(version.split('.')[0]);
- }
- function getMajorVersions(released, number) {
- if (released.length === 0) return [];
- var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1;
- var selected = [];
- for (var i = released.length - 1; i >= 0; i--) {
- if (minimum > getMajor(released[i])) break;
- selected.unshift(released[i]);
- }
- return selected;
- }
- function uniq$1(array) {
- var filtered = [];
- for (var i = 0; i < array.length; i++) {
- if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]);
- }
- return filtered;
- }
- function fillUsage(result, name, data) {
- for (var i in data) {
- result[name + ' ' + i] = data[i];
- }
- }
- function generateFilter(sign, version) {
- version = parseFloat(version);
- if (sign === '>') {
- return function (v) {
- return parseFloat(v) > version;
- };
- } else if (sign === '>=') {
- return function (v) {
- return parseFloat(v) >= version;
- };
- } else if (sign === '<') {
- return function (v) {
- return parseFloat(v) < version;
- };
- } else {
- return function (v) {
- return parseFloat(v) <= version;
- };
- }
- }
- function generateSemverFilter(sign, version) {
- version = version.split('.').map(parseSimpleInt);
- version[1] = version[1] || 0;
- version[2] = version[2] || 0;
- if (sign === '>') {
- return function (v) {
- v = v.split('.').map(parseSimpleInt);
- return compareSemver(v, version) > 0;
- };
- } else if (sign === '>=') {
- return function (v) {
- v = v.split('.').map(parseSimpleInt);
- return compareSemver(v, version) >= 0;
- };
- } else if (sign === '<') {
- return function (v) {
- v = v.split('.').map(parseSimpleInt);
- return compareSemver(version, v) > 0;
- };
- } else {
- return function (v) {
- v = v.split('.').map(parseSimpleInt);
- return compareSemver(version, v) >= 0;
- };
- }
- }
- function parseSimpleInt(x) {
- return parseInt(x);
- }
- function compare$1(a, b) {
- if (a < b) return -1;
- if (a > b) return +1;
- return 0;
- }
- function compareSemver(a, b) {
- return compare$1(parseInt(a[0]), parseInt(b[0])) || compare$1(parseInt(a[1] || '0'), parseInt(b[1] || '0')) || compare$1(parseInt(a[2] || '0'), parseInt(b[2] || '0'));
- }
- function resolveVersion(data, version) {
- if (data.versions.indexOf(version) !== -1) {
- return version;
- } else if (browserslist.versionAliases[data.name][version]) {
- return browserslist.versionAliases[data.name][version];
- } else {
- return false;
- }
- }
- function normalizeVersion(data, version) {
- var resolved = resolveVersion(data, version);
- if (resolved) {
- return resolved;
- } else if (data.versions.length === 1) {
- return data.versions[0];
- } else {
- return false;
- }
- }
- function filterByYear(since, context) {
- since = since / 1000;
- return Object.keys(agents$1).reduce(function (selected, name) {
- var data = byName(name, context);
- if (!data) return selected;
- var versions = Object.keys(data.releaseDate).filter(function (v) {
- return data.releaseDate[v] >= since;
- });
- return selected.concat(versions.map(nameMapper(data.name)));
- }, []);
- }
- function cloneData(data) {
- return {
- name: data.name,
- versions: data.versions,
- released: data.released,
- releaseDate: data.releaseDate
- };
- }
- function byName(name, context) {
- name = name.toLowerCase();
- name = browserslist.aliases[name] || name;
- if (context.mobileToDesktop && browserslist.desktopNames[name]) {
- var desktop = browserslist.data[browserslist.desktopNames[name]];
- if (name === 'android') {
- return normalizeAndroidData(cloneData(browserslist.data[name]), desktop);
- } else {
- var cloned = cloneData(desktop);
- cloned.name = name;
- return cloned;
- }
- }
- return browserslist.data[name];
- }
- function normalizeAndroidVersions(androidVersions, chromeVersions) {
- var firstEvergreen = ANDROID_EVERGREEN_FIRST;
- var last = chromeVersions[chromeVersions.length - 1];
- return androidVersions.filter(function (version) {
- return /^(?:[2-4]\.|[34]$)/.test(version);
- }).concat(chromeVersions.slice(firstEvergreen - last - 1));
- }
- function normalizeAndroidData(android, chrome) {
- android.released = normalizeAndroidVersions(android.released, chrome.released);
- android.versions = normalizeAndroidVersions(android.versions, chrome.versions);
- return android;
- }
- function checkName(name, context) {
- var data = byName(name, context);
- if (!data) throw new error('Unknown browser ' + name);
- return data;
- }
- function unknownQuery(query) {
- return new error('Unknown browser query `' + query + '`. ' + 'Maybe you are using old Browserslist or made typo in query.');
- }
- function filterAndroid(list, versions, context) {
- if (context.mobileToDesktop) return list;
- var released = browserslist.data.android.released;
- var last = released[released.length - 1];
- var diff = last - ANDROID_EVERGREEN_FIRST - versions;
- if (diff > 0) {
- return list.slice(-1);
- } else {
- return list.slice(diff - 1);
- }
- }
- function resolve$3(queries, context) {
- if (Array.isArray(queries)) {
- queries = flatten(queries.map(parse$6));
- } else {
- queries = parse$6(queries);
- }
- return queries.reduce(function (result, query, index) {
- var selection = query.queryString;
- var isExclude = selection.indexOf('not ') === 0;
- if (isExclude) {
- if (index === 0) {
- throw new error('Write any browsers query (for instance, `defaults`) ' + 'before `' + selection + '`');
- }
- selection = selection.slice(4);
- }
- for (var i = 0; i < QUERIES.length; i++) {
- var type = QUERIES[i];
- var match = selection.match(type.regexp);
- if (match) {
- var args = [context].concat(match.slice(1));
- var array = type.select.apply(browserslist, args).map(function (j) {
- var parts = j.split(' ');
- if (parts[1] === '0') {
- return parts[0] + ' ' + byName(parts[0], context).versions[0];
- } else {
- return j;
- }
- });
- switch (query.type) {
- case QUERY_AND:
- if (isExclude) {
- return result.filter(function (j) {
- return array.indexOf(j) === -1;
- });
- } else {
- return result.filter(function (j) {
- return array.indexOf(j) !== -1;
- });
- }
- case QUERY_OR:
- default:
- if (isExclude) {
- var filter = {};
- array.forEach(function (j) {
- filter[j] = true;
- });
- return result.filter(function (j) {
- return !filter[j];
- });
- }
- return result.concat(array);
- }
- }
- }
- throw unknownQuery(selection);
- }, []);
- }
- var cache$1 = {};
- function browserslist(queries, opts) {
- if (typeof opts === 'undefined') opts = {};
- if (typeof opts.path === 'undefined') {
- opts.path = path$2.resolve ? path$2.resolve('.') : '.';
- }
- if (typeof queries === 'undefined' || queries === null) {
- var config = browserslist.loadConfig(opts);
- if (config) {
- queries = config;
- } else {
- queries = browserslist.defaults;
- }
- }
- if (!(typeof queries === 'string' || Array.isArray(queries))) {
- throw new error('Browser queries must be an array or string. Got ' + typeof queries + '.');
- }
- var context = {
- ignoreUnknownVersions: opts.ignoreUnknownVersions,
- dangerousExtend: opts.dangerousExtend,
- mobileToDesktop: opts.mobileToDesktop
- };
- browser$6.oldDataWarning(browserslist.data);
- var stats = browser$6.getStat(opts, browserslist.data);
- if (stats) {
- context.customUsage = {};
- for (var browser in stats) {
- fillUsage(context.customUsage, browser, stats[browser]);
- }
- }
- var cacheKey = JSON.stringify([queries, context]);
- if (cache$1[cacheKey]) return cache$1[cacheKey];
- var result = uniq$1(resolve$3(queries, context)).sort(function (name1, name2) {
- name1 = name1.split(' ');
- name2 = name2.split(' ');
- if (name1[0] === name2[0]) {
- var version1 = name1[1].split('-')[0];
- var version2 = name2[1].split('-')[0];
- return compareSemver(version2.split('.'), version1.split('.'));
- } else {
- return compare$1(name1[0], name2[0]);
- }
- });
- if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
- cache$1[cacheKey] = result;
- }
- return result;
- }
- function parse$6(queries) {
- var qs = [];
- do {
- queries = doMatch(queries, qs);
- } while (queries);
- return qs;
- }
- function doMatch(string, qs) {
- var or = /^(?:,\s*|\s+or\s+)(.*)/i;
- var and = /^\s+and\s+(.*)/i;
- return find$2(string, function (parsed, n, max) {
- if (and.test(parsed)) {
- qs.unshift({
- type: QUERY_AND,
- queryString: parsed.match(and)[1]
- });
- return true;
- } else if (or.test(parsed)) {
- qs.unshift({
- type: QUERY_OR,
- queryString: parsed.match(or)[1]
- });
- return true;
- } else if (n === max) {
- qs.unshift({
- type: QUERY_OR,
- queryString: parsed.trim()
- });
- return true;
- }
- return false;
- });
- }
- function find$2(string, predicate) {
- for (var n = 1, max = string.length; n <= max; n++) {
- var parsed = string.substr(-n, n);
- if (predicate(parsed, n, max)) {
- return string.slice(0, -n);
- }
- }
- return '';
- }
- function flatten(array) {
- if (!Array.isArray(array)) return [array];
- return array.reduce(function (a, b) {
- return a.concat(flatten(b));
- }, []);
- }
- browserslist.data = {};
- browserslist.usage = {
- global: {},
- custom: null
- };
- browserslist.defaults = ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'not dead'];
- browserslist.aliases = {
- fx: 'firefox',
- ff: 'firefox',
- ios: 'ios_saf',
- explorer: 'ie',
- blackberry: 'bb',
- explorermobile: 'ie_mob',
- operamini: 'op_mini',
- operamobile: 'op_mob',
- chromeandroid: 'and_chr',
- firefoxandroid: 'and_ff',
- ucandroid: 'and_uc',
- qqandroid: 'and_qq'
- };
- browserslist.desktopNames = {
- and_chr: 'chrome',
- and_ff: 'firefox',
- ie_mob: 'ie',
- op_mob: 'opera',
- android: 'chrome'
- };
- browserslist.versionAliases = {};
- browserslist.clearCaches = browser$6.clearCaches;
- browserslist.parseConfig = browser$6.parseConfig;
- browserslist.readConfig = browser$6.readConfig;
- browserslist.findConfig = browser$6.findConfig;
- browserslist.loadConfig = browser$6.loadConfig;
- browserslist.coverage = function (browsers, stats) {
- var data;
- if (typeof stats === 'undefined') {
- data = browserslist.usage.global;
- } else if (stats === 'my stats') {
- var opts = {};
- opts.path = path$2.resolve ? path$2.resolve('.') : '.';
- var customStats = browser$6.getStat(opts);
- if (!customStats) {
- throw new error('Custom usage statistics was not provided');
- }
- data = {};
- for (var browser in customStats) {
- fillUsage(data, browser, customStats[browser]);
- }
- } else if (typeof stats === 'string') {
- if (stats.length > 2) {
- stats = stats.toLowerCase();
- } else {
- stats = stats.toUpperCase();
- }
- browser$6.loadCountry(browserslist.usage, stats);
- data = browserslist.usage[stats];
- } else {
- if ('dataByBrowser' in stats) {
- stats = stats.dataByBrowser;
- }
- data = {};
- for (var name in stats) {
- for (var version in stats[name]) {
- data[name + ' ' + version] = stats[name][version];
- }
- }
- }
- return browsers.reduce(function (all, i) {
- var usage = data[i];
- if (usage === undefined) {
- usage = data[i.replace(/ \S+$/, ' 0')];
- }
- return all + (usage || 0);
- }, 0);
- };
- var QUERIES = [{
- regexp: /^last\s+(\d+)\s+major\s+versions?$/i,
- select: function select(context, versions) {
- return Object.keys(agents$1).reduce(function (selected, name) {
- var data = byName(name, context);
- if (!data) return selected;
- var list = getMajorVersions(data.released, versions);
- list = list.map(nameMapper(data.name));
- if (data.name === 'android') {
- list = filterAndroid(list, versions, context);
- }
- return selected.concat(list);
- }, []);
- }
- }, {
- regexp: /^last\s+(\d+)\s+versions?$/i,
- select: function select(context, versions) {
- return Object.keys(agents$1).reduce(function (selected, name) {
- var data = byName(name, context);
- if (!data) return selected;
- var list = data.released.slice(-versions);
- list = list.map(nameMapper(data.name));
- if (data.name === 'android') {
- list = filterAndroid(list, versions, context);
- }
- return selected.concat(list);
- }, []);
- }
- }, {
- regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i,
- select: function select(context, versions) {
- var validVersions = getMajorVersions(Object.keys(versions$1).reverse(), versions);
- return validVersions.map(function (i) {
- return 'chrome ' + versions$1[i];
- });
- }
- }, {
- regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i,
- select: function select(context, versions, name) {
- var data = checkName(name, context);
- var validVersions = getMajorVersions(data.released, versions);
- var list = validVersions.map(nameMapper(data.name));
- if (data.name === 'android') {
- list = filterAndroid(list, versions, context);
- }
- return list;
- }
- }, {
- regexp: /^last\s+(\d+)\s+electron\s+versions?$/i,
- select: function select(context, versions) {
- return Object.keys(versions$1).reverse().slice(-versions).map(function (i) {
- return 'chrome ' + versions$1[i];
- });
- }
- }, {
- regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i,
- select: function select(context, versions, name) {
- var data = checkName(name, context);
- var list = data.released.slice(-versions).map(nameMapper(data.name));
- if (data.name === 'android') {
- list = filterAndroid(list, versions, context);
- }
- return list;
- }
- }, {
- regexp: /^unreleased\s+versions$/i,
- select: function select(context) {
- return Object.keys(agents$1).reduce(function (selected, name) {
- var data = byName(name, context);
- if (!data) return selected;
- var list = data.versions.filter(function (v) {
- return data.released.indexOf(v) === -1;
- });
- list = list.map(nameMapper(data.name));
- return selected.concat(list);
- }, []);
- }
- }, {
- regexp: /^unreleased\s+electron\s+versions?$/i,
- select: function select() {
- return [];
- }
- }, {
- regexp: /^unreleased\s+(\w+)\s+versions?$/i,
- select: function select(context, name) {
- var data = checkName(name, context);
- return data.versions.filter(function (v) {
- return data.released.indexOf(v) === -1;
- }).map(nameMapper(data.name));
- }
- }, {
- regexp: /^last\s+(\d*.?\d+)\s+years?$/i,
- select: function select(context, years) {
- return filterByYear(Date.now() - YEAR * years, context);
- }
- }, {
- regexp: /^since (\d+)(?:-(\d+))?(?:-(\d+))?$/i,
- select: function select(context, year, month, date) {
- year = parseInt(year);
- month = parseInt(month || '01') - 1;
- date = parseInt(date || '01');
- return filterByYear(Date.UTC(year, month, date, 0, 0, 0), context);
- }
- }, {
- regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%$/,
- select: function select(context, sign, popularity) {
- popularity = parseFloat(popularity);
- var usage = browserslist.usage.global;
- return Object.keys(usage).reduce(function (result, version) {
- if (sign === '>') {
- if (usage[version] > popularity) {
- result.push(version);
- }
- } else if (sign === '<') {
- if (usage[version] < popularity) {
- result.push(version);
- }
- } else if (sign === '<=') {
- if (usage[version] <= popularity) {
- result.push(version);
- }
- } else if (usage[version] >= popularity) {
- result.push(version);
- }
- return result;
- }, []);
- }
- }, {
- regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%\s+in\s+my\s+stats$/,
- select: function select(context, sign, popularity) {
- popularity = parseFloat(popularity);
- if (!context.customUsage) {
- throw new error('Custom usage statistics was not provided');
- }
- var usage = context.customUsage;
- return Object.keys(usage).reduce(function (result, version) {
- if (sign === '>') {
- if (usage[version] > popularity) {
- result.push(version);
- }
- } else if (sign === '<') {
- if (usage[version] < popularity) {
- result.push(version);
- }
- } else if (sign === '<=') {
- if (usage[version] <= popularity) {
- result.push(version);
- }
- } else if (usage[version] >= popularity) {
- result.push(version);
- }
- return result;
- }, []);
- }
- }, {
- regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%\s+in\s+(\S+)\s+stats$/,
- select: function select(context, sign, popularity, name) {
- popularity = parseFloat(popularity);
- var stats = browser$6.loadStat(context, name, browserslist.data);
- if (stats) {
- context.customUsage = {};
- for (var browser in stats) {
- fillUsage(context.customUsage, browser, stats[browser]);
- }
- }
- if (!context.customUsage) {
- throw new error('Custom usage statistics was not provided');
- }
- var usage = context.customUsage;
- return Object.keys(usage).reduce(function (result, version) {
- if (sign === '>') {
- if (usage[version] > popularity) {
- result.push(version);
- }
- } else if (sign === '<') {
- if (usage[version] < popularity) {
- result.push(version);
- }
- } else if (sign === '<=') {
- if (usage[version] <= popularity) {
- result.push(version);
- }
- } else if (usage[version] >= popularity) {
- result.push(version);
- }
- return result;
- }, []);
- }
- }, {
- regexp: /^(>=?|<=?)\s*(\d*\.?\d+)%\s+in\s+((alt-)?\w\w)$/,
- select: function select(context, sign, popularity, place) {
- popularity = parseFloat(popularity);
- if (place.length === 2) {
- place = place.toUpperCase();
- } else {
- place = place.toLowerCase();
- }
- browser$6.loadCountry(browserslist.usage, place);
- var usage = browserslist.usage[place];
- return Object.keys(usage).reduce(function (result, version) {
- if (sign === '>') {
- if (usage[version] > popularity) {
- result.push(version);
- }
- } else if (sign === '<') {
- if (usage[version] < popularity) {
- result.push(version);
- }
- } else if (sign === '<=') {
- if (usage[version] <= popularity) {
- result.push(version);
- }
- } else if (usage[version] >= popularity) {
- result.push(version);
- }
- return result;
- }, []);
- }
- }, {
- regexp: /^cover\s+(\d*\.?\d+)%(\s+in\s+(my\s+stats|(alt-)?\w\w))?$/,
- select: function select(context, coverage, statMode) {
- coverage = parseFloat(coverage);
- var usage = browserslist.usage.global;
- if (statMode) {
- if (statMode.match(/^\s+in\s+my\s+stats$/)) {
- if (!context.customUsage) {
- throw new error('Custom usage statistics was not provided');
- }
- usage = context.customUsage;
- } else {
- var match = statMode.match(/\s+in\s+((alt-)?\w\w)/);
- var place = match[1];
- if (place.length === 2) {
- place = place.toUpperCase();
- } else {
- place = place.toLowerCase();
- }
- browser$6.loadCountry(browserslist.usage, place);
- usage = browserslist.usage[place];
- }
- }
- var versions = Object.keys(usage).sort(function (a, b) {
- return usage[b] - usage[a];
- });
- var coveraged = 0;
- var result = [];
- var version;
- for (var i = 0; i <= versions.length; i++) {
- version = versions[i];
- if (usage[version] === 0) break;
- coveraged += usage[version];
- result.push(version);
- if (coveraged >= coverage) break;
- }
- return result;
- }
- }, {
- regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i,
- select: function select(context, from, to) {
- var fromToUse = normalizeElectron(from);
- var toToUse = normalizeElectron(to);
- if (!versions$1[fromToUse]) {
- throw new error('Unknown version ' + from + ' of electron');
- }
- if (!versions$1[toToUse]) {
- throw new error('Unknown version ' + to + ' of electron');
- }
- from = parseFloat(from);
- to = parseFloat(to);
- return Object.keys(versions$1).filter(function (i) {
- var parsed = parseFloat(i);
- return parsed >= from && parsed <= to;
- }).map(function (i) {
- return 'chrome ' + versions$1[i];
- });
- }
- }, {
- regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i,
- select: function select(context, name, from, to) {
- var data = checkName(name, context);
- from = parseFloat(normalizeVersion(data, from) || from);
- to = parseFloat(normalizeVersion(data, to) || to);
- function filter(v) {
- var parsed = parseFloat(v);
- return parsed >= from && parsed <= to;
- }
- return data.released.filter(filter).map(nameMapper(data.name));
- }
- }, {
- regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i,
- select: function select(context, sign, version) {
- var versionToUse = normalizeElectron(version);
- return Object.keys(versions$1).filter(generateFilter(sign, versionToUse)).map(function (i) {
- return 'chrome ' + versions$1[i];
- });
- }
- }, {
- regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i,
- select: function select(context, sign, version) {
- var nodeVersions = jsReleases.filter(function (i) {
- return i.name === 'nodejs';
- }).map(function (i) {
- return i.version;
- });
- return nodeVersions.filter(generateSemverFilter(sign, version)).map(function (v) {
- return 'node ' + v;
- });
- }
- }, {
- regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/,
- select: function select(context, name, sign, version) {
- var data = checkName(name, context);
- var alias = browserslist.versionAliases[data.name][version];
- if (alias) {
- version = alias;
- }
- return data.released.filter(generateFilter(sign, version)).map(function (v) {
- return data.name + ' ' + v;
- });
- }
- }, {
- regexp: /^(firefox|ff|fx)\s+esr$/i,
- select: function select() {
- return ['firefox 68'];
- }
- }, {
- regexp: /(operamini|op_mini)\s+all/i,
- select: function select() {
- return ['op_mini all'];
- }
- }, {
- regexp: /^electron\s+([\d.]+)$/i,
- select: function select(context, version) {
- var versionToUse = normalizeElectron(version);
- var chrome = versions$1[versionToUse];
- if (!chrome) {
- throw new error('Unknown version ' + version + ' of electron');
- }
- return ['chrome ' + chrome];
- }
- }, {
- regexp: /^node\s+(\d+(\.\d+)?(\.\d+)?)$/i,
- select: function select(context, version) {
- var nodeReleases = jsReleases.filter(function (i) {
- return i.name === 'nodejs';
- });
- var matched = nodeReleases.filter(function (i) {
- return isVersionsMatch(i.version, version);
- });
- if (matched.length === 0) {
- if (context.ignoreUnknownVersions) {
- return [];
- } else {
- throw new error('Unknown version ' + version + ' of Node.js');
- }
- }
- return ['node ' + matched[matched.length - 1].version];
- }
- }, {
- regexp: /^current\s+node$/i,
- select: function select(context) {
- return [browser$6.currentNode(resolve$3, context)];
- }
- }, {
- regexp: /^maintained\s+node\s+versions$/i,
- select: function select(context) {
- var now = Date.now();
- var queries = Object.keys(jsEOL).filter(function (key) {
- return now < Date.parse(jsEOL[key].end) && now > Date.parse(jsEOL[key].start) && isEolReleased(key);
- }).map(function (key) {
- return 'node ' + key.slice(1);
- });
- return resolve$3(queries, context);
- }
- }, {
- regexp: /^phantomjs\s+1.9$/i,
- select: function select() {
- return ['safari 5'];
- }
- }, {
- regexp: /^phantomjs\s+2.1$/i,
- select: function select() {
- return ['safari 6'];
- }
- }, {
- regexp: /^(\w+)\s+(tp|[\d.]+)$/i,
- select: function select(context, name, version) {
- if (/^tp$/i.test(version)) version = 'TP';
- var data = checkName(name, context);
- var alias = normalizeVersion(data, version);
- if (alias) {
- version = alias;
- } else {
- if (version.indexOf('.') === -1) {
- alias = version + '.0';
- } else {
- alias = version.replace(/\.0$/, '');
- }
- alias = normalizeVersion(data, alias);
- if (alias) {
- version = alias;
- } else if (context.ignoreUnknownVersions) {
- return [];
- } else {
- throw new error('Unknown version ' + version + ' of ' + name);
- }
- }
- return [data.name + ' ' + version];
- }
- }, {
- regexp: /^extends (.+)$/i,
- select: function select(context, name) {
- return resolve$3(browser$6.loadQueries(context, name), context);
- }
- }, {
- regexp: /^defaults$/i,
- select: function select(context) {
- return resolve$3(browserslist.defaults, context);
- }
- }, {
- regexp: /^dead$/i,
- select: function select(context) {
- var dead = ['ie <= 10', 'ie_mob <= 10', 'bb <= 10', 'op_mob <= 12.1', 'samsung 4'];
- return resolve$3(dead, context);
- }
- }, {
- regexp: /^(\w+)$/i,
- select: function select(context, name) {
- if (byName(name, context)) {
- throw new error('Specify versions in Browserslist query for browser ' + name);
- } else {
- throw unknownQuery(name);
- }
- }
- }];
- (function () {
- for (var name in agents$1) {
- var browser = agents$1[name];
- browserslist.data[name] = {
- name: name,
- versions: normalize$1(agents$1[name].versions),
- released: normalize$1(agents$1[name].versions.slice(0, -3)),
- releaseDate: agents$1[name].release_date
- };
- fillUsage(browserslist.usage.global, name, browser.usage_global);
- browserslist.versionAliases[name] = {};
- for (var i = 0; i < browser.versions.length; i++) {
- var full = browser.versions[i];
- if (!full) continue;
- if (full.indexOf('-') !== -1) {
- var interval = full.split('-');
- for (var j = 0; j < interval.length; j++) {
- browserslist.versionAliases[name][interval[j]] = full;
- }
- }
- }
- }
- })();
- var browserslist_1 = browserslist;
- var leven_1 = createCommonjsModule(function (module) {
- var array = [];
- var charCodeCache = [];
- var leven = function leven(left, right) {
- if (left === right) {
- return 0;
- }
- var swap = left;
- if (left.length > right.length) {
- left = right;
- right = swap;
- }
- var leftLength = left.length;
- var rightLength = right.length;
- while (leftLength > 0 && left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength)) {
- leftLength--;
- rightLength--;
- }
- var start = 0;
- while (start < leftLength && left.charCodeAt(start) === right.charCodeAt(start)) {
- start++;
- }
- leftLength -= start;
- rightLength -= start;
- if (leftLength === 0) {
- return rightLength;
- }
- var bCharCode;
- var result;
- var temp;
- var temp2;
- var i = 0;
- var j = 0;
- while (i < leftLength) {
- charCodeCache[i] = left.charCodeAt(start + i);
- array[i] = ++i;
- }
- while (j < rightLength) {
- bCharCode = right.charCodeAt(start + j);
- temp = j++;
- result = j;
- for (i = 0; i < leftLength; i++) {
- temp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;
- temp = array[i];
- result = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;
- }
- }
- return result;
- };
- module.exports = leven;
- module.exports["default"] = leven;
- });
- function levenArray(str, array) {
- var minLeven = Number.POSITIVE_INFINITY;
- var result = undefined;
- for (var _iterator = array, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var item = _ref;
- var distance = leven_1(str, item);
- if (distance < minLeven) {
- minLeven = distance;
- result = item;
- }
- }
- return result;
- }
- var invariant = function invariant(condition, format, a, b, c, d, e, f) {
- {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
- error.framesToPop = 1;
- throw error;
- }
- };
- var browser$7 = invariant;
- var nativeModules = {
- "es6.module": {
- edge: "16",
- firefox: "60",
- chrome: "61",
- safari: "10.1",
- opera: "48",
- ios_saf: "10.3",
- and_chr: "74",
- and_ff: "66"
- }
- };
- var nativeModules$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': nativeModules
- });
- var require$$0$2 = getCjsExportFromNamespace(nativeModules$1);
- var nativeModules$2 = require$$0$2;
- var unreleasedLabels = {
- safari: "tp"
- };
- var browserNameMap = {
- and_chr: "chrome",
- and_ff: "firefox",
- android: "android",
- chrome: "chrome",
- edge: "edge",
- firefox: "firefox",
- ie: "ie",
- ie_mob: "ie",
- ios_saf: "ios",
- node: "node",
- op_mob: "opera",
- opera: "opera",
- safari: "safari",
- samsung: "samsung"
- };
- var versionRegExp = /^(\d+|\d+.\d+)$/;
- function semverMin(first, second) {
- return first && semver.lt(first, second) ? first : second;
- }
- function semverify(version) {
- if (typeof version === "string" && semver.valid(version)) {
- return version;
- }
- browser$7(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), "'" + version + "' is not a valid version");
- var split = version.toString().split(".");
- while (split.length < 3) {
- split.push("0");
- }
- return split.join(".");
- }
- function isUnreleasedVersion(version, env) {
- var unreleasedLabel = unreleasedLabels[env];
- return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase();
- }
- function getLowestUnreleased(a, b, env) {
- var unreleasedLabel = unreleasedLabels[env];
- var hasUnreleased = [a, b].some(function (item) {
- return item === unreleasedLabel;
- });
- if (hasUnreleased) {
- return a === hasUnreleased ? b : a || b;
- }
- return semverMin(a, b);
- }
- function getLowestImplementedVersion(plugin, environment) {
- var result = plugin[environment];
- if (!result && environment === "android") {
- return plugin.chrome;
- }
- return result;
- }
- var TargetNames = {
- esmodules: "esmodules",
- node: "node",
- browsers: "browsers",
- chrome: "chrome",
- opera: "opera",
- edge: "edge",
- firefox: "firefox",
- safari: "safari",
- ie: "ie",
- ios: "ios",
- android: "android",
- electron: "electron",
- samsung: "samsung",
- uglify: "uglify"
- };
- function prettifyVersion(version) {
- if (typeof version !== "string") {
- return version;
- }
- var parts = [semver.major(version)];
- var minor = semver.minor(version);
- var patch = semver.patch(version);
- if (minor || patch) {
- parts.push(minor);
- }
- if (patch) {
- parts.push(patch);
- }
- return parts.join(".");
- }
- function prettifyTargets(targets) {
- return Object.keys(targets).reduce(function (results, target) {
- var value = targets[target];
- var unreleasedLabel = unreleasedLabels[target];
- if (typeof value === "string" && unreleasedLabel !== value) {
- value = prettifyVersion(value);
- }
- results[target] = value;
- return results;
- }, {});
- }
- function getInclusionReasons(item, targetVersions, list) {
- var minVersions = list[item] || {};
- return Object.keys(targetVersions).reduce(function (result, env) {
- var minVersion = getLowestImplementedVersion(minVersions, env);
- var targetVersion = targetVersions[env];
- if (!minVersion) {
- result[env] = prettifyVersion(targetVersion);
- } else {
- var minIsUnreleased = isUnreleasedVersion(minVersion, env);
- var targetIsUnreleased = isUnreleasedVersion(targetVersion, env);
- if (!targetIsUnreleased && (minIsUnreleased || semver.lt(targetVersion.toString(), semverify(minVersion)))) {
- result[env] = prettifyVersion(targetVersion);
- }
- }
- return result;
- }, {});
- }
- var plugins = {
- "transform-template-literals": {
- chrome: "41",
- edge: "13",
- firefox: "34",
- safari: "13",
- node: "4",
- ios: "13",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "transform-literals": {
- chrome: "44",
- edge: "12",
- firefox: "53",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "transform-function-name": {
- chrome: "51",
- firefox: "53",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "transform-arrow-functions": {
- chrome: "47",
- edge: "13",
- firefox: "45",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "34",
- electron: "0.36"
- },
- "transform-block-scoped-functions": {
- chrome: "41",
- edge: "12",
- firefox: "46",
- safari: "10",
- node: "4",
- ie: "11",
- ios: "10",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "transform-classes": {
- chrome: "46",
- edge: "13",
- firefox: "45",
- safari: "10",
- node: "5",
- ios: "10",
- samsung: "5",
- opera: "33",
- electron: "0.36"
- },
- "transform-object-super": {
- chrome: "46",
- edge: "13",
- firefox: "45",
- safari: "10",
- node: "5",
- ios: "10",
- samsung: "5",
- opera: "33",
- electron: "0.36"
- },
- "transform-shorthand-properties": {
- chrome: "43",
- edge: "12",
- firefox: "33",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "30",
- electron: "0.29"
- },
- "transform-duplicate-keys": {
- chrome: "42",
- edge: "12",
- firefox: "34",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "29",
- electron: "0.27"
- },
- "transform-computed-properties": {
- chrome: "44",
- edge: "12",
- firefox: "34",
- safari: "7.1",
- node: "4",
- ios: "8",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "transform-for-of": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "transform-sticky-regex": {
- chrome: "49",
- edge: "13",
- firefox: "3",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "transform-dotall-regex": {
- chrome: "62",
- safari: "11.1",
- node: "8.10",
- ios: "11.3",
- samsung: "8.2",
- opera: "49",
- electron: "3.1"
- },
- "transform-unicode-regex": {
- chrome: "50",
- edge: "13",
- firefox: "46",
- safari: "12",
- node: "6",
- ios: "12",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "transform-spread": {
- chrome: "46",
- edge: "13",
- firefox: "36",
- safari: "10",
- node: "5",
- ios: "10",
- samsung: "5",
- opera: "33",
- electron: "0.36"
- },
- "transform-parameters": {
- chrome: "49",
- edge: "18",
- firefox: "53",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "transform-destructuring": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "transform-block-scoping": {
- chrome: "49",
- edge: "14",
- firefox: "51",
- safari: "11",
- node: "6",
- ios: "11",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "transform-typeof-symbol": {
- chrome: "38",
- edge: "12",
- firefox: "36",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "transform-new-target": {
- chrome: "46",
- edge: "14",
- firefox: "41",
- safari: "10",
- node: "5",
- ios: "10",
- samsung: "5",
- opera: "33",
- electron: "0.36"
- },
- "transform-regenerator": {
- chrome: "50",
- edge: "13",
- firefox: "53",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "transform-exponentiation-operator": {
- chrome: "52",
- edge: "14",
- firefox: "52",
- safari: "10.1",
- node: "7",
- ios: "10.3",
- samsung: "6.2",
- opera: "39",
- electron: "1.3"
- },
- "transform-async-to-generator": {
- chrome: "55",
- edge: "15",
- firefox: "52",
- safari: "11",
- node: "7.6",
- ios: "11",
- samsung: "6.2",
- opera: "42",
- electron: "1.6"
- },
- "proposal-async-generator-functions": {
- chrome: "63",
- firefox: "57",
- safari: "12",
- node: "10",
- ios: "12",
- samsung: "8.2",
- opera: "50",
- electron: "3.1"
- },
- "proposal-object-rest-spread": {
- chrome: "60",
- firefox: "55",
- safari: "11.1",
- node: "8.3",
- ios: "11.3",
- samsung: "8.2",
- opera: "47",
- electron: "2.1"
- },
- "proposal-unicode-property-regex": {
- chrome: "64",
- safari: "11.1",
- node: "10",
- ios: "11.3",
- samsung: "9.2",
- opera: "51",
- electron: "3.1"
- },
- "proposal-json-strings": {
- chrome: "66",
- firefox: "62",
- safari: "12",
- node: "10",
- ios: "12",
- samsung: "9.2",
- opera: "53",
- electron: "3.1"
- },
- "proposal-optional-catch-binding": {
- chrome: "66",
- firefox: "58",
- safari: "11.1",
- node: "10",
- ios: "11.3",
- samsung: "9.2",
- opera: "53",
- electron: "3.1"
- },
- "proposal-optional-chaining": {
- chrome: "80",
- opera: "67"
- },
- "transform-named-capturing-groups-regex": {
- chrome: "64",
- safari: "11.1",
- node: "10",
- ios: "11.3",
- samsung: "9.2",
- opera: "51",
- electron: "3.1"
- },
- "transform-member-expression-literals": {
- chrome: "7",
- opera: "12",
- edge: "12",
- firefox: "2",
- safari: "5.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "5"
- },
- "transform-property-literals": {
- chrome: "7",
- opera: "12",
- edge: "12",
- firefox: "2",
- safari: "5.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "5"
- },
- "transform-reserved-words": {
- chrome: "13",
- opera: "10.50",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4.4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "0.2"
- },
- "proposal-nullish-coalescing-operator": {
- chrome: "80",
- firefox: "72",
- opera: "67"
- }
- };
- var plugins$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': plugins
- });
- var require$$0$3 = getCjsExportFromNamespace(plugins$1);
- var plugins$2 = require$$0$3;
- function targetsSupported(target, support) {
- var targetEnvironments = Object.keys(target);
- if (targetEnvironments.length === 0) {
- return false;
- }
- var unsupportedEnvironments = targetEnvironments.filter(function (environment) {
- var lowestImplementedVersion = getLowestImplementedVersion(support, environment);
- if (!lowestImplementedVersion) {
- return true;
- }
- var lowestTargetedVersion = target[environment];
- if (isUnreleasedVersion(lowestTargetedVersion, environment)) {
- return false;
- }
- if (isUnreleasedVersion(lowestImplementedVersion, environment)) {
- return true;
- }
- if (!semver.valid(lowestTargetedVersion.toString())) {
- throw new Error("Invalid version passed for target \"" + environment + "\": \"" + lowestTargetedVersion + "\". " + "Versions must be in semver format (major.minor.patch)");
- }
- return semver.gt(semverify(lowestImplementedVersion), lowestTargetedVersion.toString());
- });
- return unsupportedEnvironments.length === 0;
- }
- function isRequired(name, targets, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$compatData = _ref.compatData,
- compatData = _ref$compatData === void 0 ? plugins$2 : _ref$compatData,
- includes = _ref.includes,
- excludes = _ref.excludes;
- if (excludes && excludes.has(name)) return false;
- if (includes && includes.has(name)) return true;
- return !targetsSupported(targets, compatData[name]);
- }
- function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) {
- var result = new Set();
- var options = {
- compatData: list,
- includes: includes,
- excludes: excludes
- };
- for (var item in list) {
- if (isRequired(item, targets, options)) {
- result.add(item);
- } else if (pluginSyntaxMap) {
- var shippedProposalsSyntax = pluginSyntaxMap.get(item);
- if (shippedProposalsSyntax) {
- result.add(shippedProposalsSyntax);
- }
- }
- }
- if (defaultIncludes) {
- defaultIncludes.forEach(function (item) {
- return !excludes.has(item) && result.add(item);
- });
- }
- if (defaultExcludes) {
- defaultExcludes.forEach(function (item) {
- return !includes.has(item) && result["delete"](item);
- });
- }
- return result;
- }
- var browserslistDefaults = browserslist_1.defaults;
- var validBrowserslistTargets = [].concat(Object.keys(browserslist_1.data), Object.keys(browserslist_1.aliases));
- function objectToBrowserslist(object) {
- return Object.keys(object).reduce(function (list, targetName) {
- if (validBrowserslistTargets.indexOf(targetName) >= 0) {
- var targetVersion = object[targetName];
- return list.concat(targetName + " " + targetVersion);
- }
- return list;
- }, []);
- }
- function validateTargetNames(targets) {
- var validTargets = Object.keys(TargetNames);
- for (var target in targets) {
- if (!TargetNames[target]) {
- throw new Error("Invalid Option: '" + target + "' is not a valid target\n Maybe you meant to use '" + levenArray(target, validTargets) + "'?");
- }
- }
- }
- function isBrowsersQueryValid(browsers) {
- return typeof browsers === "string" || Array.isArray(browsers);
- }
- function validateBrowsers(browsers) {
- browser$7(typeof browsers === "undefined" || isBrowsersQueryValid(browsers), "Invalid Option: '" + browsers + "' is not a valid browserslist query");
- return browsers;
- }
- function mergeBrowsers(fromQuery, fromTarget) {
- return Object.keys(fromTarget).reduce(function (queryObj, targKey) {
- if (targKey !== TargetNames.browsers) {
- queryObj[targKey] = fromTarget[targKey];
- }
- return queryObj;
- }, fromQuery);
- }
- function getLowestVersions(browsers) {
- return browsers.reduce(function (all, browser) {
- var _browser$split = browser.split(" "),
- browserName = _browser$split[0],
- browserVersion = _browser$split[1];
- var normalizedBrowserName = browserNameMap[browserName];
- if (!normalizedBrowserName) {
- return all;
- }
- try {
- var splitVersion = browserVersion.split("-")[0].toLowerCase();
- var isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName);
- if (!all[normalizedBrowserName]) {
- all[normalizedBrowserName] = isSplitUnreleased ? splitVersion : semverify(splitVersion);
- return all;
- }
- var version = all[normalizedBrowserName];
- var isUnreleased = isUnreleasedVersion(version, browserName);
- if (isUnreleased && isSplitUnreleased) {
- all[normalizedBrowserName] = getLowestUnreleased(version, splitVersion, browserName);
- } else if (isUnreleased) {
- all[normalizedBrowserName] = semverify(splitVersion);
- } else if (!isUnreleased && !isSplitUnreleased) {
- var parsedBrowserVersion = semverify(splitVersion);
- all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion);
- }
- } catch (e) {}
- return all;
- }, {});
- }
- function outputDecimalWarning(decimalTargets) {
- if (!decimalTargets || !decimalTargets.length) {
- return;
- }
- console.log("Warning, the following targets are using a decimal version:");
- console.log("");
- decimalTargets.forEach(function (_ref) {
- var target = _ref.target,
- value = _ref.value;
- return console.log(" " + target + ": " + value);
- });
- console.log("");
- console.log("We recommend using a string for minor/patch versions to avoid numbers like 6.10");
- console.log("getting parsed as 6.1, which can lead to unexpected behavior.");
- console.log("");
- }
- function semverifyTarget(target, value) {
- try {
- return semverify(value);
- } catch (error) {
- throw new Error("Invalid Option: '" + value + "' is not a valid value for 'targets." + target + "'.");
- }
- }
- var targetParserMap = {
- __default: function __default(target, value) {
- var version = isUnreleasedVersion(value, target) ? value.toLowerCase() : semverifyTarget(target, value);
- return [target, version];
- },
- node: function node(target, value) {
- var parsed = value === true || value === "current" ? process.versions.node : semverifyTarget(target, value);
- return [target, parsed];
- }
- };
- function getTargets(targets, options) {
- if (targets === void 0) {
- targets = {};
- }
- if (options === void 0) {
- options = {};
- }
- var targetOpts = {};
- validateTargetNames(targets);
- if (targets.esmodules) {
- var supportsESModules = nativeModules$2["es6.module"];
- targets.browsers = Object.keys(supportsESModules).map(function (browser) {
- return browser + " " + supportsESModules[browser];
- }).join(", ");
- }
- var browsersquery = validateBrowsers(targets.browsers);
- var hasTargets = Object.keys(targets).length > 0;
- var shouldParseBrowsers = !!targets.browsers;
- var shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets;
- if (shouldParseBrowsers || shouldSearchForConfig) {
- if (!hasTargets) {
- browserslist_1.defaults = objectToBrowserslist(targets);
- }
- var browsers = browserslist_1(browsersquery, {
- path: options.configPath,
- mobileToDesktop: true
- });
- var queryBrowsers = getLowestVersions(browsers);
- targets = mergeBrowsers(queryBrowsers, targets);
- browserslist_1.defaults = browserslistDefaults;
- }
- var parsed = Object.keys(targets).filter(function (value) {
- return value !== TargetNames.esmodules;
- }).sort().reduce(function (results, target) {
- if (target !== TargetNames.browsers) {
- var value = targets[target];
- if (typeof value === "number" && value % 1 !== 0) {
- results.decimalWarnings.push({
- target: target,
- value: value
- });
- }
- var parser = targetParserMap[target] || targetParserMap.__default;
- var _parser = parser(target, value),
- parsedTarget = _parser[0],
- parsedValue = _parser[1];
- if (parsedValue) {
- results.targets[parsedTarget] = parsedValue;
- }
- }
- return results;
- }, {
- targets: targetOpts,
- decimalWarnings: []
- });
- outputDecimalWarning(parsed.decimalWarnings);
- return parsed.targets;
- }
- var wordEnds = function wordEnds(size) {
- return size > 1 ? "s" : "";
- };
- var logPluginOrPolyfill = function logPluginOrPolyfill(item, targetVersions, list) {
- var filteredList = getInclusionReasons(item, targetVersions, list);
- var formattedTargets = JSON.stringify(filteredList).replace(/,/g, ", ").replace(/^\{"/, '{ "').replace(/"\}$/, '" }');
- console.log(" " + item + " " + formattedTargets);
- };
- var logEntryPolyfills = function logEntryPolyfills(polyfillName, importPolyfillIncluded, polyfills, filename, polyfillTargets, allBuiltInsList) {
- if (process.env.BABEL_ENV === "test") {
- filename = filename.replace(/\\/g, "/");
- }
- if (!importPolyfillIncluded) {
- console.log("\n[" + filename + "] Import of " + polyfillName + " was not found.");
- return;
- }
- if (!polyfills.size) {
- console.log("\n[" + filename + "] Based on your targets, polyfills were not added.");
- return;
- }
- console.log("\n[" + filename + "] Replaced " + polyfillName + " entries with the following polyfill" + wordEnds(polyfills.size) + ":");
- for (var _iterator = polyfills, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var polyfill = _ref;
- logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
- }
- };
- var logUsagePolyfills = function logUsagePolyfills(polyfills, filename, polyfillTargets, allBuiltInsList) {
- if (process.env.BABEL_ENV === "test") {
- filename = filename.replace(/\\/g, "/");
- }
- if (!polyfills.size) {
- console.log("\n[" + filename + "] Based on your code and targets, core-js polyfills were not added.");
- return;
- }
- console.log("\n[" + filename + "] Added following core-js polyfill" + wordEnds(polyfills.size) + ":");
- for (var _iterator2 = polyfills, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref2 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref2 = _i2.value;
- }
- var polyfill = _ref2;
- logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);
- }
- };
- var defaultExcludesForLooseMode = ["transform-typeof-symbol"];
- function getOptionSpecificExcludesFor (_ref) {
- var loose = _ref.loose;
- return loose ? defaultExcludesForLooseMode : null;
- }
- function removeUnnecessaryItems(items, overlapping) {
- items.forEach(function (item) {
- var _overlapping$item;
- (_overlapping$item = overlapping[item]) == null ? void 0 : _overlapping$item.forEach(function (name) {
- return items["delete"](name);
- });
- });
- }
- var moduleTransformations = {
- auto: "transform-modules-commonjs",
- amd: "transform-modules-amd",
- commonjs: "transform-modules-commonjs",
- cjs: "transform-modules-commonjs",
- systemjs: "transform-modules-systemjs",
- umd: "transform-modules-umd"
- };
- var corejs3Polyfills = {
- "es.symbol": {
- chrome: "49",
- edge: "15",
- electron: "0.37",
- firefox: "51",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.description": {
- chrome: "70",
- edge: "74",
- electron: "5.0",
- firefox: "63",
- ios: "12.2",
- node: "11.0",
- opera: "57",
- opera_mobile: "49",
- safari: "12.1",
- samsung: "10.0"
- },
- "es.symbol.async-iterator": {
- chrome: "63",
- edge: "74",
- electron: "3.0",
- firefox: "55",
- ios: "12.0",
- node: "10.0",
- opera: "50",
- opera_mobile: "46",
- safari: "12.0",
- samsung: "8.0"
- },
- "es.symbol.has-instance": {
- chrome: "50",
- edge: "15",
- electron: "1.1",
- firefox: "49",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.is-concat-spreadable": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "48",
- ios: "10.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.iterator": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "36",
- ios: "9.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.symbol.match": {
- chrome: "50",
- edge: "74",
- electron: "1.1",
- firefox: "40",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.match-all": {
- chrome: "73",
- edge: "74",
- electron: "5.0",
- firefox: "67",
- ios: "13.0",
- node: "12.0",
- opera: "60",
- opera_mobile: "52",
- safari: "13",
- samsung: "11.0"
- },
- "es.symbol.replace": {
- chrome: "50",
- edge: "74",
- electron: "1.1",
- firefox: "49",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.search": {
- chrome: "50",
- edge: "74",
- electron: "1.1",
- firefox: "49",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.species": {
- chrome: "51",
- edge: "13",
- electron: "1.2",
- firefox: "41",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.split": {
- chrome: "50",
- edge: "74",
- electron: "1.1",
- firefox: "49",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.to-primitive": {
- chrome: "47",
- edge: "15",
- electron: "0.36",
- firefox: "44",
- ios: "10.0",
- node: "6.0",
- opera: "34",
- opera_mobile: "34",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.to-string-tag": {
- chrome: "49",
- edge: "15",
- electron: "0.37",
- firefox: "51",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.symbol.unscopables": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "48",
- ios: "9.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.array.concat": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "48",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.array.copy-within": {
- chrome: "45",
- edge: "12",
- electron: "0.31",
- firefox: "48",
- ios: "9.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.every": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "50",
- ios: "9.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.fill": {
- chrome: "45",
- edge: "12",
- electron: "0.31",
- firefox: "48",
- ios: "9.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.filter": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "48",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.array.find": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "48",
- ios: "9.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.find-index": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "48",
- ios: "9.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.flat": {
- chrome: "69",
- edge: "74",
- electron: "4.0",
- firefox: "62",
- ios: "12.0",
- node: "11.0",
- opera: "56",
- opera_mobile: "48",
- safari: "12.0",
- samsung: "10.0"
- },
- "es.array.flat-map": {
- chrome: "69",
- edge: "74",
- electron: "4.0",
- firefox: "62",
- ios: "12.0",
- node: "11.0",
- opera: "56",
- opera_mobile: "48",
- safari: "12.0",
- samsung: "10.0"
- },
- "es.array.for-each": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "50",
- ios: "9.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.from": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "53",
- ios: "9.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.includes": {
- chrome: "53",
- edge: "15",
- electron: "1.4",
- firefox: "48",
- ios: "10.0",
- node: "7.0",
- opera: "40",
- opera_mobile: "40",
- safari: "10.0",
- samsung: "6.0"
- },
- "es.array.index-of": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "50",
- ios: "11.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "11.0",
- samsung: "5.0"
- },
- "es.array.is-array": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "3.2",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "4.0",
- samsung: "1.0"
- },
- "es.array.iterator": {
- chrome: "66",
- edge: "15",
- electron: "3.0",
- firefox: "60",
- ios: "10.0",
- node: "10.0",
- opera: "53",
- opera_mobile: "47",
- safari: "10.0",
- samsung: "9.0"
- },
- "es.array.join": {
- android: "4.4",
- chrome: "26",
- edge: "13",
- electron: "0.20",
- firefox: "4",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.array.last-index-of": {
- chrome: "51",
- edge: "13",
- electron: "1.2",
- firefox: "50",
- ios: "11.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "11.0",
- samsung: "5.0"
- },
- "es.array.map": {
- chrome: "51",
- edge: "13",
- electron: "1.2",
- firefox: "50",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.array.of": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "25",
- ios: "9.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.reduce": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "50",
- ios: "9.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.reduce-right": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "50",
- ios: "9.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.reverse": {
- android: "3.0",
- chrome: "1",
- edge: "12",
- electron: "0.20",
- firefox: "1",
- ie: "5.5",
- ios: "12.2",
- node: "0.0.3",
- opera: "10.50",
- opera_mobile: "10.50",
- safari: "12.0.2",
- samsung: "1.0"
- },
- "es.array.slice": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "48",
- ios: "11.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "11.0",
- samsung: "5.0"
- },
- "es.array.some": {
- chrome: "48",
- edge: "15",
- electron: "0.37",
- firefox: "50",
- ios: "9.0",
- node: "6.0",
- opera: "35",
- opera_mobile: "35",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.array.sort": {
- chrome: "63",
- edge: "12",
- electron: "3.0",
- firefox: "4",
- ie: "9",
- ios: "12.0",
- node: "10.0",
- opera: "50",
- opera_mobile: "46",
- safari: "12.0",
- samsung: "8.0"
- },
- "es.array.species": {
- chrome: "51",
- edge: "13",
- electron: "1.2",
- firefox: "48",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.array.splice": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "49",
- ios: "11.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "11.0",
- samsung: "5.0"
- },
- "es.array.unscopables.flat": {
- chrome: "73",
- edge: "74",
- electron: "5.0",
- firefox: "67",
- ios: "13.0",
- node: "12.0",
- opera: "60",
- opera_mobile: "52",
- safari: "13",
- samsung: "11.0"
- },
- "es.array.unscopables.flat-map": {
- chrome: "73",
- edge: "74",
- electron: "5.0",
- firefox: "67",
- ios: "13.0",
- node: "12.0",
- opera: "60",
- opera_mobile: "52",
- safari: "13",
- samsung: "11.0"
- },
- "es.array-buffer.constructor": {
- android: "4.4",
- chrome: "26",
- edge: "14",
- electron: "0.20",
- firefox: "44",
- ios: "12.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "12.0",
- samsung: "1.5"
- },
- "es.array-buffer.is-view": {
- android: "4.4.3",
- chrome: "32",
- edge: "12",
- electron: "0.20",
- firefox: "29",
- ie: "11",
- ios: "8.0",
- node: "0.11.9",
- opera: "19",
- opera_mobile: "19",
- safari: "7.1",
- samsung: "2.0"
- },
- "es.array-buffer.slice": {
- android: "4.4.3",
- chrome: "31",
- edge: "12",
- electron: "0.20",
- firefox: "46",
- ie: "11",
- ios: "12.2",
- node: "0.11.8",
- opera: "18",
- opera_mobile: "18",
- safari: "12.1",
- samsung: "2.0"
- },
- "es.data-view": {
- android: "4.4",
- chrome: "26",
- edge: "12",
- electron: "0.20",
- firefox: "15",
- ie: "10",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.date.now": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ie: "9",
- ios: "3.2",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "4.0",
- samsung: "1.0"
- },
- "es.date.to-iso-string": {
- android: "4.4",
- chrome: "26",
- edge: "12",
- electron: "0.20",
- firefox: "7",
- ie: "9",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.date.to-json": {
- android: "4.4",
- chrome: "26",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "10.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "10.0",
- samsung: "1.5"
- },
- "es.date.to-primitive": {
- chrome: "47",
- edge: "15",
- electron: "0.36",
- firefox: "44",
- ios: "10.0",
- node: "6.0",
- opera: "34",
- opera_mobile: "34",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.date.to-string": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ie: "9",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.function.bind": {
- android: "3.0",
- chrome: "7",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "5.1",
- node: "0.1.101",
- opera: "12",
- opera_mobile: "12",
- phantom: "2.0",
- safari: "5.1",
- samsung: "1.0"
- },
- "es.function.has-instance": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "50",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.function.name": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "3.2",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "4.0",
- samsung: "1.0"
- },
- "es.global-this": {
- chrome: "71",
- edge: "74",
- electron: "5.0",
- firefox: "65",
- ios: "12.2",
- node: "12.0",
- opera: "58",
- opera_mobile: "50",
- safari: "12.1",
- samsung: "10.0"
- },
- "es.json.stringify": {
- chrome: "72",
- edge: "74",
- electron: "5.0",
- firefox: "64",
- ios: "12.2",
- node: "12.0",
- opera: "59",
- opera_mobile: "51",
- safari: "12.1",
- samsung: "11.0"
- },
- "es.json.to-string-tag": {
- chrome: "50",
- edge: "15",
- electron: "1.1",
- firefox: "51",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.map": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "53",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.math.acosh": {
- chrome: "54",
- edge: "13",
- electron: "1.4",
- firefox: "25",
- ios: "8.0",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- safari: "7.1",
- samsung: "6.0"
- },
- "es.math.asinh": {
- chrome: "38",
- edge: "13",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.atanh": {
- chrome: "38",
- edge: "13",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.cbrt": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.clz32": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "31",
- ios: "9.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "9.0",
- samsung: "3.0"
- },
- "es.math.cosh": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "7.1",
- samsung: "3.4"
- },
- "es.math.expm1": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "46",
- ios: "8.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "7.1",
- samsung: "3.4"
- },
- "es.math.fround": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "26",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.hypot": {
- chrome: "78",
- edge: "12",
- electron: "7.0",
- firefox: "27",
- ios: "8.0",
- node: "13.0",
- opera: "65",
- safari: "7.1"
- },
- "es.math.imul": {
- android: "4.4",
- chrome: "28",
- edge: "13",
- electron: "0.20",
- firefox: "20",
- ios: "9.0",
- node: "0.11.1",
- opera: "16",
- opera_mobile: "16",
- safari: "9.0",
- samsung: "1.5"
- },
- "es.math.log10": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.log1p": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.log2": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.sign": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "9.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "9.0",
- samsung: "3.0"
- },
- "es.math.sinh": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "7.1",
- samsung: "3.4"
- },
- "es.math.tanh": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.math.to-string-tag": {
- chrome: "50",
- edge: "15",
- electron: "1.1",
- firefox: "51",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.math.trunc": {
- chrome: "38",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "8.0",
- node: "0.11.15",
- opera: "25",
- opera_mobile: "25",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.number.constructor": {
- chrome: "41",
- edge: "13",
- electron: "0.21",
- firefox: "46",
- ios: "9.0",
- node: "1.0",
- opera: "28",
- opera_mobile: "28",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.number.epsilon": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "25",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.number.is-finite": {
- android: "4.1",
- chrome: "19",
- edge: "12",
- electron: "0.20",
- firefox: "16",
- ios: "9.0",
- node: "0.7.3",
- opera: "15",
- opera_mobile: "15",
- safari: "9.0",
- samsung: "1.5"
- },
- "es.number.is-integer": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "16",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.number.is-nan": {
- android: "4.1",
- chrome: "19",
- edge: "12",
- electron: "0.20",
- firefox: "15",
- ios: "9.0",
- node: "0.7.3",
- opera: "15",
- opera_mobile: "15",
- safari: "9.0",
- samsung: "1.5"
- },
- "es.number.is-safe-integer": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "32",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.number.max-safe-integer": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "31",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.number.min-safe-integer": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "31",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.number.parse-float": {
- chrome: "35",
- edge: "13",
- electron: "0.20",
- firefox: "39",
- ios: "11.0",
- node: "0.11.13",
- opera: "22",
- opera_mobile: "22",
- safari: "11.0",
- samsung: "3.0"
- },
- "es.number.parse-int": {
- chrome: "35",
- edge: "13",
- electron: "0.20",
- firefox: "39",
- ios: "9.0",
- node: "0.11.13",
- opera: "22",
- opera_mobile: "22",
- safari: "9.0",
- samsung: "3.0"
- },
- "es.number.to-fixed": {
- android: "4.4",
- chrome: "26",
- edge: "74",
- electron: "0.20",
- firefox: "4",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.number.to-precision": {
- android: "4.4",
- chrome: "26",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "8",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.object.assign": {
- chrome: "49",
- edge: "74",
- electron: "0.37",
- firefox: "36",
- ios: "9.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.object.create": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "3.2",
- node: "0.1.27",
- opera: "12",
- opera_mobile: "12",
- phantom: "1.9",
- safari: "4.0",
- samsung: "1.0"
- },
- "es.object.define-getter": {
- chrome: "62",
- edge: "16",
- electron: "3.0",
- firefox: "48",
- ios: "8.0",
- node: "8.10",
- opera: "49",
- opera_mobile: "46",
- safari: "7.1",
- samsung: "8.0"
- },
- "es.object.define-properties": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "5.1",
- node: "0.1.27",
- opera: "12",
- opera_mobile: "12",
- phantom: "2.0",
- safari: "5.1",
- samsung: "1.0"
- },
- "es.object.define-property": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "4",
- ie: "9",
- ios: "5.1",
- node: "0.1.27",
- opera: "12",
- opera_mobile: "12",
- phantom: "2.0",
- safari: "5.1",
- samsung: "1.0"
- },
- "es.object.define-setter": {
- chrome: "62",
- edge: "16",
- electron: "3.0",
- firefox: "48",
- ios: "8.0",
- node: "8.10",
- opera: "49",
- opera_mobile: "46",
- safari: "7.1",
- samsung: "8.0"
- },
- "es.object.entries": {
- chrome: "54",
- edge: "14",
- electron: "1.4",
- firefox: "47",
- ios: "10.3",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- safari: "10.1",
- samsung: "6.0"
- },
- "es.object.freeze": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.from-entries": {
- chrome: "73",
- edge: "74",
- electron: "5.0",
- firefox: "63",
- ios: "12.2",
- node: "12.0",
- opera: "60",
- opera_mobile: "52",
- safari: "12.1",
- samsung: "11.0"
- },
- "es.object.get-own-property-descriptor": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.get-own-property-descriptors": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "50",
- ios: "10.0",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- safari: "10.0",
- samsung: "6.0"
- },
- "es.object.get-own-property-names": {
- chrome: "40",
- edge: "13",
- electron: "0.21",
- firefox: "34",
- ios: "9.0",
- node: "1.0",
- opera: "27",
- opera_mobile: "27",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.object.get-prototype-of": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.is": {
- android: "4.1",
- chrome: "19",
- edge: "12",
- electron: "0.20",
- firefox: "22",
- ios: "9.0",
- node: "0.7.3",
- opera: "15",
- opera_mobile: "15",
- safari: "9.0",
- samsung: "1.5"
- },
- "es.object.is-extensible": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.is-frozen": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.is-sealed": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.keys": {
- chrome: "40",
- edge: "13",
- electron: "0.21",
- firefox: "35",
- ios: "9.0",
- node: "1.0",
- opera: "27",
- opera_mobile: "27",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.object.lookup-getter": {
- chrome: "62",
- edge: "16",
- electron: "3.0",
- firefox: "48",
- ios: "8.0",
- node: "8.10",
- opera: "49",
- opera_mobile: "46",
- safari: "7.1",
- samsung: "8.0"
- },
- "es.object.lookup-setter": {
- chrome: "62",
- edge: "16",
- electron: "3.0",
- firefox: "48",
- ios: "8.0",
- node: "8.10",
- opera: "49",
- opera_mobile: "46",
- safari: "7.1",
- samsung: "8.0"
- },
- "es.object.prevent-extensions": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.seal": {
- chrome: "44",
- edge: "13",
- electron: "0.30",
- firefox: "35",
- ios: "9.0",
- node: "3.0",
- opera: "31",
- opera_mobile: "31",
- safari: "9.0",
- samsung: "4.0"
- },
- "es.object.set-prototype-of": {
- chrome: "34",
- edge: "12",
- electron: "0.20",
- firefox: "31",
- ie: "11",
- ios: "9.0",
- node: "0.11.13",
- opera: "21",
- opera_mobile: "21",
- safari: "9.0",
- samsung: "2.0"
- },
- "es.object.to-string": {
- chrome: "49",
- edge: "15",
- electron: "0.37",
- firefox: "51",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.object.values": {
- chrome: "54",
- edge: "14",
- electron: "1.4",
- firefox: "47",
- ios: "10.3",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- safari: "10.1",
- samsung: "6.0"
- },
- "es.parse-float": {
- chrome: "35",
- edge: "12",
- electron: "0.20",
- firefox: "8",
- ie: "8",
- ios: "8.0",
- node: "0.11.13",
- opera: "22",
- opera_mobile: "22",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.parse-int": {
- chrome: "35",
- edge: "12",
- electron: "0.20",
- firefox: "21",
- ie: "9",
- ios: "8.0",
- node: "0.11.13",
- opera: "22",
- opera_mobile: "22",
- safari: "7.1",
- samsung: "3.0"
- },
- "es.promise": {
- chrome: "67",
- edge: "74",
- electron: "4.0",
- firefox: "69",
- ios: "11.0",
- node: "10.4",
- opera: "54",
- opera_mobile: "48",
- safari: "11.0",
- samsung: "9.0"
- },
- "es.promise.all-settled": {
- chrome: "76",
- edge: "76",
- electron: "6.0",
- firefox: "71",
- ios: "13.0",
- node: "12.9",
- opera: "63",
- opera_mobile: "54",
- safari: "13"
- },
- "es.promise.finally": {
- chrome: "67",
- edge: "74",
- electron: "4.0",
- firefox: "69",
- ios: "13.2.3",
- node: "10.4",
- opera: "54",
- opera_mobile: "48",
- safari: "13.0.3",
- samsung: "9.0"
- },
- "es.reflect.apply": {
- chrome: "49",
- edge: "15",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.construct": {
- chrome: "49",
- edge: "15",
- electron: "0.37",
- firefox: "44",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.define-property": {
- chrome: "49",
- edge: "13",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.delete-property": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.get": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.get-own-property-descriptor": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.get-prototype-of": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.has": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.is-extensible": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.own-keys": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.prevent-extensions": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.set": {
- chrome: "49",
- edge: "74",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.reflect.set-prototype-of": {
- chrome: "49",
- edge: "12",
- electron: "0.37",
- firefox: "42",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.regexp.constructor": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "49",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.regexp.exec": {
- android: "4.4",
- chrome: "26",
- edge: "13",
- electron: "0.20",
- firefox: "44",
- ios: "10.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "10.0",
- samsung: "1.5"
- },
- "es.regexp.flags": {
- chrome: "49",
- edge: "74",
- electron: "0.37",
- firefox: "37",
- ios: "9.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "9.0",
- samsung: "5.0"
- },
- "es.regexp.sticky": {
- chrome: "49",
- edge: "13",
- electron: "0.37",
- firefox: "3",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.regexp.test": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "46",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.regexp.to-string": {
- chrome: "50",
- edge: "74",
- electron: "1.1",
- firefox: "46",
- ios: "10.0",
- node: "6.0",
- opera: "37",
- opera_mobile: "37",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.set": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "53",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.code-point-at": {
- chrome: "41",
- edge: "13",
- electron: "0.21",
- firefox: "29",
- ios: "9.0",
- node: "1.0",
- opera: "28",
- opera_mobile: "28",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.string.ends-with": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "40",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.from-code-point": {
- chrome: "41",
- edge: "13",
- electron: "0.21",
- firefox: "29",
- ios: "9.0",
- node: "1.0",
- opera: "28",
- opera_mobile: "28",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.string.includes": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "40",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.iterator": {
- chrome: "39",
- edge: "13",
- electron: "0.20",
- firefox: "36",
- ios: "9.0",
- node: "1.0",
- opera: "26",
- opera_mobile: "26",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.string.match": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "49",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.match-all": {
- chrome: "80",
- edge: "80",
- electron: "8.0",
- firefox: "73",
- opera: "67",
- safari: "13.1"
- },
- "es.string.pad-end": {
- chrome: "57",
- edge: "15",
- electron: "1.7",
- firefox: "48",
- ios: "11.0",
- node: "8.0",
- opera: "44",
- opera_mobile: "43",
- safari: "11.0",
- samsung: "7.0"
- },
- "es.string.pad-start": {
- chrome: "57",
- edge: "15",
- electron: "1.7",
- firefox: "48",
- ios: "11.0",
- node: "8.0",
- opera: "44",
- opera_mobile: "43",
- safari: "11.0",
- samsung: "7.0"
- },
- "es.string.raw": {
- chrome: "41",
- edge: "13",
- electron: "0.21",
- firefox: "34",
- ios: "9.0",
- node: "1.0",
- opera: "28",
- opera_mobile: "28",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.string.repeat": {
- chrome: "41",
- edge: "13",
- electron: "0.21",
- firefox: "24",
- ios: "9.0",
- node: "1.0",
- opera: "28",
- opera_mobile: "28",
- safari: "9.0",
- samsung: "3.4"
- },
- "es.string.replace": {
- chrome: "64",
- edge: "74",
- electron: "3.0",
- node: "10.0",
- opera: "51",
- opera_mobile: "47",
- samsung: "9.0"
- },
- "es.string.search": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "49",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.split": {
- chrome: "54",
- edge: "74",
- electron: "1.4",
- firefox: "49",
- ios: "10.0",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- safari: "10.0",
- samsung: "6.0"
- },
- "es.string.starts-with": {
- chrome: "51",
- edge: "74",
- electron: "1.2",
- firefox: "40",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.string.trim": {
- chrome: "59",
- edge: "15",
- electron: "1.8",
- firefox: "52",
- ios: "12.2",
- node: "8.3",
- opera: "46",
- opera_mobile: "43",
- safari: "12.1",
- samsung: "7.0"
- },
- "es.string.trim-end": {
- chrome: "66",
- edge: "74",
- electron: "3.0",
- firefox: "61",
- ios: "12.2",
- node: "10.0",
- opera: "53",
- opera_mobile: "47",
- safari: "12.1",
- samsung: "9.0"
- },
- "es.string.trim-start": {
- chrome: "66",
- edge: "74",
- electron: "3.0",
- firefox: "61",
- ios: "12.0",
- node: "10.0",
- opera: "53",
- opera_mobile: "47",
- safari: "12.0",
- samsung: "9.0"
- },
- "es.string.anchor": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "17",
- ios: "6.0",
- node: "0.1.27",
- opera: "15",
- opera_mobile: "15",
- phantom: "2.0",
- safari: "6.0",
- samsung: "1.0"
- },
- "es.string.big": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.blink": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.bold": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.fixed": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.fontcolor": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "17",
- ios: "6.0",
- node: "0.1.27",
- opera: "15",
- opera_mobile: "15",
- phantom: "2.0",
- safari: "6.0",
- samsung: "1.0"
- },
- "es.string.fontsize": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "17",
- ios: "6.0",
- node: "0.1.27",
- opera: "15",
- opera_mobile: "15",
- phantom: "2.0",
- safari: "6.0",
- samsung: "1.0"
- },
- "es.string.italics": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.link": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "17",
- ios: "6.0",
- node: "0.1.27",
- opera: "15",
- opera_mobile: "15",
- phantom: "2.0",
- safari: "6.0",
- samsung: "1.0"
- },
- "es.string.small": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.strike": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.sub": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.string.sup": {
- android: "3.0",
- chrome: "5",
- edge: "12",
- electron: "0.20",
- firefox: "2",
- ios: "2.0",
- node: "0.1.27",
- opera: "10.50",
- opera_mobile: "10.50",
- phantom: "1.9",
- safari: "3.1",
- samsung: "1.0"
- },
- "es.typed-array.float32-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.float64-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.int8-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.int16-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.int32-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.uint8-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.uint8-clamped-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.uint16-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.uint32-array": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.copy-within": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "34",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.every": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.fill": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.filter": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "38",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.find": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.find-index": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.for-each": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "38",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.from": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.includes": {
- chrome: "49",
- edge: "14",
- electron: "0.37",
- firefox: "43",
- ios: "10.0",
- node: "6.0",
- opera: "36",
- opera_mobile: "36",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.index-of": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.iterator": {
- chrome: "47",
- edge: "13",
- electron: "0.36",
- firefox: "37",
- ios: "10.0",
- node: "6.0",
- opera: "34",
- opera_mobile: "34",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.join": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.last-index-of": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.map": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "38",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.of": {
- chrome: "54",
- edge: "15",
- electron: "1.4",
- firefox: "55",
- node: "7.0",
- opera: "41",
- opera_mobile: "41",
- samsung: "6.0"
- },
- "es.typed-array.reduce": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.reduce-right": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.reverse": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.set": {
- android: "4.4",
- chrome: "26",
- edge: "13",
- electron: "0.20",
- firefox: "15",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.typed-array.slice": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "38",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.some": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "37",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.sort": {
- chrome: "45",
- edge: "13",
- electron: "0.31",
- firefox: "46",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.subarray": {
- android: "4.4",
- chrome: "26",
- edge: "13",
- electron: "0.20",
- firefox: "15",
- ios: "8.0",
- node: "0.11.0",
- opera: "16",
- opera_mobile: "16",
- safari: "7.1",
- samsung: "1.5"
- },
- "es.typed-array.to-locale-string": {
- chrome: "45",
- edge: "74",
- electron: "0.31",
- firefox: "51",
- ios: "10.0",
- node: "4.0",
- opera: "32",
- opera_mobile: "32",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.typed-array.to-string": {
- chrome: "51",
- edge: "13",
- electron: "1.2",
- firefox: "51",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.weak-map": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "53",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "es.weak-set": {
- chrome: "51",
- edge: "15",
- electron: "1.2",
- firefox: "53",
- ios: "10.0",
- node: "6.5",
- opera: "38",
- opera_mobile: "38",
- safari: "10.0",
- samsung: "5.0"
- },
- "esnext.aggregate-error": {
- },
- "esnext.array.is-template-object": {
- },
- "esnext.array.last-index": {
- },
- "esnext.array.last-item": {
- },
- "esnext.async-iterator.constructor": {
- },
- "esnext.async-iterator.as-indexed-pairs": {
- },
- "esnext.async-iterator.drop": {
- },
- "esnext.async-iterator.every": {
- },
- "esnext.async-iterator.filter": {
- },
- "esnext.async-iterator.find": {
- },
- "esnext.async-iterator.flat-map": {
- },
- "esnext.async-iterator.for-each": {
- },
- "esnext.async-iterator.from": {
- },
- "esnext.async-iterator.map": {
- },
- "esnext.async-iterator.reduce": {
- },
- "esnext.async-iterator.some": {
- },
- "esnext.async-iterator.take": {
- },
- "esnext.async-iterator.to-array": {
- },
- "esnext.composite-key": {
- },
- "esnext.composite-symbol": {
- },
- "esnext.global-this": {
- chrome: "71",
- edge: "74",
- electron: "5.0",
- firefox: "65",
- ios: "12.2",
- node: "12.0",
- opera: "58",
- opera_mobile: "50",
- safari: "12.1",
- samsung: "10.0"
- },
- "esnext.iterator.constructor": {
- },
- "esnext.iterator.as-indexed-pairs": {
- },
- "esnext.iterator.drop": {
- },
- "esnext.iterator.every": {
- },
- "esnext.iterator.filter": {
- },
- "esnext.iterator.find": {
- },
- "esnext.iterator.flat-map": {
- },
- "esnext.iterator.for-each": {
- },
- "esnext.iterator.from": {
- },
- "esnext.iterator.map": {
- },
- "esnext.iterator.reduce": {
- },
- "esnext.iterator.some": {
- },
- "esnext.iterator.take": {
- },
- "esnext.iterator.to-array": {
- },
- "esnext.map.delete-all": {
- },
- "esnext.map.every": {
- },
- "esnext.map.filter": {
- },
- "esnext.map.find": {
- },
- "esnext.map.find-key": {
- },
- "esnext.map.from": {
- },
- "esnext.map.group-by": {
- },
- "esnext.map.includes": {
- },
- "esnext.map.key-by": {
- },
- "esnext.map.key-of": {
- },
- "esnext.map.map-keys": {
- },
- "esnext.map.map-values": {
- },
- "esnext.map.merge": {
- },
- "esnext.map.of": {
- },
- "esnext.map.reduce": {
- },
- "esnext.map.some": {
- },
- "esnext.map.update": {
- },
- "esnext.map.update-or-insert": {
- },
- "esnext.map.upsert": {
- },
- "esnext.math.clamp": {
- },
- "esnext.math.deg-per-rad": {
- },
- "esnext.math.degrees": {
- },
- "esnext.math.fscale": {
- },
- "esnext.math.iaddh": {
- },
- "esnext.math.imulh": {
- },
- "esnext.math.isubh": {
- },
- "esnext.math.rad-per-deg": {
- },
- "esnext.math.radians": {
- },
- "esnext.math.scale": {
- },
- "esnext.math.seeded-prng": {
- },
- "esnext.math.signbit": {
- },
- "esnext.math.umulh": {
- },
- "esnext.number.from-string": {
- },
- "esnext.object.iterate-entries": {
- },
- "esnext.object.iterate-keys": {
- },
- "esnext.object.iterate-values": {
- },
- "esnext.observable": {
- },
- "esnext.promise.all-settled": {
- chrome: "76",
- edge: "76",
- electron: "6.0",
- firefox: "71",
- ios: "13.0",
- node: "12.9",
- opera: "63",
- opera_mobile: "54",
- safari: "13"
- },
- "esnext.promise.any": {
- },
- "esnext.promise.try": {
- },
- "esnext.reflect.define-metadata": {
- },
- "esnext.reflect.delete-metadata": {
- },
- "esnext.reflect.get-metadata": {
- },
- "esnext.reflect.get-metadata-keys": {
- },
- "esnext.reflect.get-own-metadata": {
- },
- "esnext.reflect.get-own-metadata-keys": {
- },
- "esnext.reflect.has-metadata": {
- },
- "esnext.reflect.has-own-metadata": {
- },
- "esnext.reflect.metadata": {
- },
- "esnext.set.add-all": {
- },
- "esnext.set.delete-all": {
- },
- "esnext.set.difference": {
- },
- "esnext.set.every": {
- },
- "esnext.set.filter": {
- },
- "esnext.set.find": {
- },
- "esnext.set.from": {
- },
- "esnext.set.intersection": {
- },
- "esnext.set.is-disjoint-from": {
- },
- "esnext.set.is-subset-of": {
- },
- "esnext.set.is-superset-of": {
- },
- "esnext.set.join": {
- },
- "esnext.set.map": {
- },
- "esnext.set.of": {
- },
- "esnext.set.reduce": {
- },
- "esnext.set.some": {
- },
- "esnext.set.symmetric-difference": {
- },
- "esnext.set.union": {
- },
- "esnext.string.at": {
- },
- "esnext.string.code-points": {
- },
- "esnext.string.match-all": {
- chrome: "80",
- edge: "80",
- electron: "8.0",
- firefox: "73",
- opera: "67",
- safari: "13.1"
- },
- "esnext.string.replace-all": {
- },
- "esnext.symbol.async-dispose": {
- },
- "esnext.symbol.dispose": {
- },
- "esnext.symbol.observable": {
- },
- "esnext.symbol.pattern-match": {
- },
- "esnext.symbol.replace-all": {
- },
- "esnext.weak-map.delete-all": {
- },
- "esnext.weak-map.from": {
- },
- "esnext.weak-map.of": {
- },
- "esnext.weak-map.upsert": {
- },
- "esnext.weak-set.add-all": {
- },
- "esnext.weak-set.delete-all": {
- },
- "esnext.weak-set.from": {
- },
- "esnext.weak-set.of": {
- },
- "web.dom-collections.for-each": {
- chrome: "58",
- edge: "16",
- electron: "1.7",
- firefox: "50",
- ios: "10.0",
- node: "0.0.1",
- opera: "45",
- opera_mobile: "43",
- safari: "10.0",
- samsung: "7.0"
- },
- "web.dom-collections.iterator": {
- chrome: "66",
- edge: "74",
- electron: "3.0",
- firefox: "60",
- node: "0.0.1",
- opera: "53",
- opera_mobile: "47",
- safari: "13.1",
- samsung: "9.0"
- },
- "web.immediate": {
- ie: "10",
- node: "0.9.1"
- },
- "web.queue-microtask": {
- chrome: "71",
- edge: "74",
- electron: "5.0",
- firefox: "69",
- ios: "12.2",
- node: "12.0",
- opera: "58",
- opera_mobile: "50",
- safari: "12.1",
- samsung: "10.0"
- },
- "web.timers": {
- android: "1.5",
- chrome: "1",
- edge: "12",
- electron: "0.20",
- firefox: "1",
- ie: "10",
- ios: "1.0",
- node: "0.0.1",
- opera: "7",
- opera_mobile: "7",
- phantom: "1.9",
- safari: "1.0",
- samsung: "1.0"
- },
- "web.url": {
- chrome: "67",
- edge: "74",
- electron: "4.0",
- firefox: "57",
- node: "10.0",
- opera: "54",
- opera_mobile: "48",
- samsung: "9.0"
- },
- "web.url.to-json": {
- chrome: "71",
- edge: "74",
- electron: "5.0",
- firefox: "57",
- node: "10.0",
- opera: "58",
- opera_mobile: "50",
- samsung: "10.0"
- },
- "web.url-search-params": {
- chrome: "67",
- edge: "74",
- electron: "4.0",
- firefox: "57",
- node: "10.0",
- opera: "54",
- opera_mobile: "48",
- samsung: "9.0"
- }
- };
- var leven_1$1 = createCommonjsModule(function (module) {
- var array = [];
- var charCodeCache = [];
- var leven = function leven(left, right) {
- if (left === right) {
- return 0;
- }
- var swap = left;
- if (left.length > right.length) {
- left = right;
- right = swap;
- }
- var leftLength = left.length;
- var rightLength = right.length;
- while (leftLength > 0 && left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength)) {
- leftLength--;
- rightLength--;
- }
- var start = 0;
- while (start < leftLength && left.charCodeAt(start) === right.charCodeAt(start)) {
- start++;
- }
- leftLength -= start;
- rightLength -= start;
- if (leftLength === 0) {
- return rightLength;
- }
- var bCharCode;
- var result;
- var temp;
- var temp2;
- var i = 0;
- var j = 0;
- while (i < leftLength) {
- charCodeCache[i] = left.charCodeAt(start + i);
- array[i] = ++i;
- }
- while (j < rightLength) {
- bCharCode = right.charCodeAt(start + j);
- temp = j++;
- result = j;
- for (i = 0; i < leftLength; i++) {
- temp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;
- temp = array[i];
- result = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;
- }
- }
- return result;
- };
- module.exports = leven;
- module.exports["default"] = leven;
- });
- function levenArray$1(str, array) {
- var minLeven = Number.POSITIVE_INFINITY;
- var result = undefined;
- for (var _iterator = array, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var item = _ref;
- var distance = leven_1$1(str, item);
- if (distance < minLeven) {
- minLeven = distance;
- result = item;
- }
- }
- return result;
- }
- var invariant$1 = function invariant(condition, format, a, b, c, d, e, f) {
- {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
- error.framesToPop = 1;
- throw error;
- }
- };
- var browser$8 = invariant$1;
- var corejs2BuiltIns = {
- "es6.array.copy-within": {
- chrome: "45",
- edge: "12",
- firefox: "32",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "5",
- opera: "32",
- electron: "0.35"
- },
- "es6.array.every": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.fill": {
- chrome: "45",
- edge: "12",
- firefox: "31",
- safari: "7.1",
- node: "4",
- ios: "8",
- samsung: "5",
- opera: "32",
- electron: "0.35"
- },
- "es6.array.filter": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.find": {
- chrome: "45",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "4",
- ios: "8",
- samsung: "5",
- opera: "32",
- electron: "0.35"
- },
- "es6.array.find-index": {
- chrome: "45",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "4",
- ios: "8",
- samsung: "5",
- opera: "32",
- electron: "0.35"
- },
- "es7.array.flat-map": {
- chrome: "69",
- firefox: "62",
- safari: "12",
- node: "11",
- ios: "12",
- samsung: "10.2",
- opera: "56",
- electron: "4"
- },
- "es6.array.for-each": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.from": {
- chrome: "51",
- edge: "15",
- firefox: "36",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es7.array.includes": {
- chrome: "47",
- edge: "14",
- firefox: "43",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "34",
- electron: "0.36"
- },
- "es6.array.index-of": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.is-array": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "4",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.iterator": {
- chrome: "38",
- edge: "12",
- firefox: "28",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.array.last-index-of": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.map": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.of": {
- chrome: "45",
- edge: "12",
- firefox: "25",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "5",
- opera: "32",
- electron: "0.35"
- },
- "es6.array.reduce": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "3",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.reduce-right": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "3",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.some": {
- chrome: "5",
- opera: "10.10",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.array.sort": {
- chrome: "63",
- opera: "50",
- edge: "12",
- firefox: "5",
- safari: "12",
- node: "10",
- ie: "9",
- ios: "12",
- samsung: "8.2",
- electron: "3.1"
- },
- "es6.array.species": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.date.now": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "2",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.date.to-iso-string": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "3.5",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.date.to-json": {
- chrome: "5",
- opera: "12.10",
- edge: "12",
- firefox: "4",
- safari: "10",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "10",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.date.to-primitive": {
- chrome: "47",
- edge: "15",
- firefox: "44",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "34",
- electron: "0.36"
- },
- "es6.date.to-string": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "2",
- safari: "3.1",
- node: "0.10",
- ie: "10",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.function.bind": {
- chrome: "7",
- opera: "12",
- edge: "12",
- firefox: "4",
- safari: "5.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "5"
- },
- "es6.function.has-instance": {
- chrome: "51",
- edge: "15",
- firefox: "50",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.function.name": {
- chrome: "5",
- opera: "10.50",
- edge: "14",
- firefox: "2",
- safari: "4",
- node: "0.10",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.map": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.math.acosh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.asinh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.atanh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.cbrt": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.clz32": {
- chrome: "38",
- edge: "12",
- firefox: "31",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.cosh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.expm1": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.fround": {
- chrome: "38",
- edge: "12",
- firefox: "26",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.hypot": {
- chrome: "38",
- edge: "12",
- firefox: "27",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.imul": {
- chrome: "30",
- edge: "12",
- firefox: "23",
- safari: "7",
- node: "0.12",
- android: "4.4",
- ios: "7",
- samsung: "2.1",
- opera: "17",
- electron: "0.2"
- },
- "es6.math.log1p": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.log10": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.log2": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.sign": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.sinh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.tanh": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.math.trunc": {
- chrome: "38",
- edge: "12",
- firefox: "25",
- safari: "7.1",
- node: "0.12",
- ios: "8",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.number.constructor": {
- chrome: "41",
- edge: "12",
- firefox: "36",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.number.epsilon": {
- chrome: "34",
- edge: "12",
- firefox: "25",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.is-finite": {
- chrome: "19",
- edge: "12",
- firefox: "16",
- safari: "9",
- node: "0.12",
- android: "4.1",
- ios: "9",
- samsung: "2.1",
- electron: "0.2"
- },
- "es6.number.is-integer": {
- chrome: "34",
- edge: "12",
- firefox: "16",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.is-nan": {
- chrome: "19",
- edge: "12",
- firefox: "15",
- safari: "9",
- node: "0.12",
- android: "4.1",
- ios: "9",
- samsung: "2.1",
- electron: "0.2"
- },
- "es6.number.is-safe-integer": {
- chrome: "34",
- edge: "12",
- firefox: "32",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.max-safe-integer": {
- chrome: "34",
- edge: "12",
- firefox: "31",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.min-safe-integer": {
- chrome: "34",
- edge: "12",
- firefox: "31",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.parse-float": {
- chrome: "34",
- edge: "12",
- firefox: "25",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.number.parse-int": {
- chrome: "34",
- edge: "12",
- firefox: "25",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es6.object.assign": {
- chrome: "49",
- edge: "13",
- firefox: "36",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.object.create": {
- chrome: "5",
- opera: "12",
- edge: "12",
- firefox: "4",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es7.object.define-getter": {
- chrome: "62",
- edge: "16",
- firefox: "48",
- safari: "9",
- node: "8.10",
- ios: "9",
- samsung: "8.2",
- opera: "49",
- electron: "3.1"
- },
- "es7.object.define-setter": {
- chrome: "62",
- edge: "16",
- firefox: "48",
- safari: "9",
- node: "8.10",
- ios: "9",
- samsung: "8.2",
- opera: "49",
- electron: "3.1"
- },
- "es6.object.define-property": {
- chrome: "5",
- opera: "12",
- edge: "12",
- firefox: "4",
- safari: "5.1",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.object.define-properties": {
- chrome: "5",
- opera: "12",
- edge: "12",
- firefox: "4",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es7.object.entries": {
- chrome: "54",
- edge: "14",
- firefox: "47",
- safari: "10.1",
- node: "7",
- ios: "10.3",
- samsung: "6.2",
- opera: "41",
- electron: "1.5"
- },
- "es6.object.freeze": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.get-own-property-descriptor": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es7.object.get-own-property-descriptors": {
- chrome: "54",
- edge: "15",
- firefox: "50",
- safari: "10.1",
- node: "7",
- ios: "10.3",
- samsung: "6.2",
- opera: "41",
- electron: "1.5"
- },
- "es6.object.get-own-property-names": {
- chrome: "40",
- edge: "12",
- firefox: "33",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "27",
- electron: "0.21"
- },
- "es6.object.get-prototype-of": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es7.object.lookup-getter": {
- chrome: "62",
- firefox: "36",
- safari: "9",
- node: "8.10",
- ios: "9",
- samsung: "8.2",
- opera: "49",
- electron: "3.1"
- },
- "es7.object.lookup-setter": {
- chrome: "62",
- firefox: "36",
- safari: "9",
- node: "8.10",
- ios: "9",
- samsung: "8.2",
- opera: "49",
- electron: "3.1"
- },
- "es6.object.prevent-extensions": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.to-string": {
- chrome: "57",
- edge: "15",
- firefox: "51",
- safari: "10",
- node: "8",
- ios: "10",
- samsung: "7.2",
- opera: "44",
- electron: "1.7"
- },
- "es6.object.is": {
- chrome: "19",
- edge: "12",
- firefox: "22",
- safari: "9",
- node: "0.12",
- android: "4.1",
- ios: "9",
- samsung: "2.1",
- electron: "0.2"
- },
- "es6.object.is-frozen": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.is-sealed": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.is-extensible": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.keys": {
- chrome: "40",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "27",
- electron: "0.21"
- },
- "es6.object.seal": {
- chrome: "44",
- edge: "12",
- firefox: "35",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "4",
- opera: "31",
- electron: "0.31"
- },
- "es6.object.set-prototype-of": {
- chrome: "34",
- edge: "12",
- firefox: "31",
- safari: "9",
- node: "0.12",
- ie: "11",
- ios: "9",
- samsung: "2.1",
- opera: "21",
- electron: "0.2"
- },
- "es7.object.values": {
- chrome: "54",
- edge: "14",
- firefox: "47",
- safari: "10.1",
- node: "7",
- ios: "10.3",
- samsung: "6.2",
- opera: "41",
- electron: "1.5"
- },
- "es6.promise": {
- chrome: "51",
- edge: "14",
- firefox: "45",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es7.promise.finally": {
- chrome: "63",
- edge: "18",
- firefox: "58",
- safari: "11.1",
- node: "10",
- ios: "11.3",
- samsung: "8.2",
- opera: "50",
- electron: "3.1"
- },
- "es6.reflect.apply": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.construct": {
- chrome: "49",
- edge: "13",
- firefox: "49",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.define-property": {
- chrome: "49",
- edge: "13",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.delete-property": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.get": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.get-own-property-descriptor": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.get-prototype-of": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.has": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.is-extensible": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.own-keys": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.prevent-extensions": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.set": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.reflect.set-prototype-of": {
- chrome: "49",
- edge: "12",
- firefox: "42",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.regexp.constructor": {
- chrome: "50",
- firefox: "40",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.regexp.flags": {
- chrome: "49",
- firefox: "37",
- safari: "9",
- node: "6",
- ios: "9",
- samsung: "5",
- opera: "36",
- electron: "1"
- },
- "es6.regexp.match": {
- chrome: "50",
- firefox: "49",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.regexp.replace": {
- chrome: "50",
- firefox: "49",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.regexp.split": {
- chrome: "50",
- firefox: "49",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.regexp.search": {
- chrome: "50",
- firefox: "49",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.regexp.to-string": {
- chrome: "50",
- firefox: "39",
- safari: "10",
- node: "6",
- ios: "10",
- samsung: "5",
- opera: "37",
- electron: "1.1"
- },
- "es6.set": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.symbol": {
- chrome: "51",
- firefox: "51",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es7.symbol.async-iterator": {
- chrome: "63",
- firefox: "57",
- safari: "12",
- node: "10",
- ios: "12",
- samsung: "8.2",
- opera: "50",
- electron: "3.1"
- },
- "es6.string.anchor": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.big": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.blink": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.bold": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.code-point-at": {
- chrome: "41",
- edge: "12",
- firefox: "29",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.ends-with": {
- chrome: "41",
- edge: "12",
- firefox: "29",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.fixed": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.fontcolor": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.fontsize": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.from-code-point": {
- chrome: "41",
- edge: "12",
- firefox: "29",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.includes": {
- chrome: "41",
- edge: "12",
- firefox: "40",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.italics": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.iterator": {
- chrome: "38",
- edge: "12",
- firefox: "36",
- safari: "9",
- node: "0.12",
- ios: "9",
- samsung: "3",
- opera: "25",
- electron: "0.2"
- },
- "es6.string.link": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es7.string.pad-start": {
- chrome: "57",
- edge: "15",
- firefox: "48",
- safari: "10",
- node: "8",
- ios: "10",
- samsung: "7.2",
- opera: "44",
- electron: "1.7"
- },
- "es7.string.pad-end": {
- chrome: "57",
- edge: "15",
- firefox: "48",
- safari: "10",
- node: "8",
- ios: "10",
- samsung: "7.2",
- opera: "44",
- electron: "1.7"
- },
- "es6.string.raw": {
- chrome: "41",
- edge: "12",
- firefox: "34",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.repeat": {
- chrome: "41",
- edge: "12",
- firefox: "24",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.small": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.starts-with": {
- chrome: "41",
- edge: "12",
- firefox: "29",
- safari: "9",
- node: "4",
- ios: "9",
- samsung: "3.4",
- opera: "28",
- electron: "0.24"
- },
- "es6.string.strike": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.sub": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.sup": {
- chrome: "5",
- edge: "12",
- firefox: "17",
- safari: "6",
- node: "0.10",
- android: "4",
- ios: "7",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.string.trim": {
- chrome: "5",
- opera: "10.50",
- edge: "12",
- firefox: "3.5",
- safari: "4",
- node: "0.10",
- ie: "9",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es7.string.trim-left": {
- chrome: "66",
- firefox: "61",
- safari: "12",
- node: "10",
- ios: "12",
- samsung: "9.2",
- opera: "53",
- electron: "3.1"
- },
- "es7.string.trim-right": {
- chrome: "66",
- firefox: "61",
- safari: "12",
- node: "10",
- ios: "12",
- samsung: "9.2",
- opera: "53",
- electron: "3.1"
- },
- "es6.typed.array-buffer": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.data-view": {
- chrome: "5",
- opera: "12",
- edge: "12",
- firefox: "15",
- safari: "5.1",
- node: "0.10",
- ie: "10",
- android: "4",
- ios: "6",
- phantom: "2",
- samsung: "2.1",
- electron: "1.1"
- },
- "es6.typed.int8-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.uint8-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.uint8-clamped-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.int16-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.uint16-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.int32-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.uint32-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.float32-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.typed.float64-array": {
- chrome: "51",
- edge: "13",
- firefox: "48",
- safari: "10",
- node: "6.5",
- ios: "10",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.weak-map": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "9",
- node: "6.5",
- ios: "9",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- },
- "es6.weak-set": {
- chrome: "51",
- edge: "15",
- firefox: "53",
- safari: "9",
- node: "6.5",
- ios: "9",
- samsung: "5",
- opera: "38",
- electron: "1.2"
- }
- };
- var corejs2BuiltIns$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': corejs2BuiltIns
- });
- var require$$0$4 = getCjsExportFromNamespace(corejs2BuiltIns$1);
- var corejs2BuiltIns$2 = require$$0$4;
- var TopLevelOptions = {
- configPath: "configPath",
- corejs: "corejs",
- debug: "debug",
- exclude: "exclude",
- forceAllTransforms: "forceAllTransforms",
- ignoreBrowserslistConfig: "ignoreBrowserslistConfig",
- include: "include",
- loose: "loose",
- modules: "modules",
- shippedProposals: "shippedProposals",
- spec: "spec",
- targets: "targets",
- useBuiltIns: "useBuiltIns"
- };
- var ModulesOption = {
- "false": false,
- auto: "auto",
- amd: "amd",
- commonjs: "commonjs",
- cjs: "cjs",
- systemjs: "systemjs",
- umd: "umd"
- };
- var UseBuiltInsOption = {
- "false": false,
- entry: "entry",
- usage: "usage"
- };
- var defaultWebIncludes = ["web.timers", "web.immediate", "web.dom.iterable"];
- function getPlatformSpecificDefaultFor (targets) {
- var targetNames = Object.keys(targets);
- var isAnyTarget = !targetNames.length;
- var isWebTarget = targetNames.some(function (name) {
- return name !== "node";
- });
- return isAnyTarget || isWebTarget ? defaultWebIncludes : null;
- }
- var validateTopLevelOptions = function validateTopLevelOptions(options) {
- var validOptions = Object.keys(TopLevelOptions);
- for (var option in options) {
- if (!TopLevelOptions[option]) {
- throw new Error("Invalid Option: " + option + " is not a valid top-level option.\n Maybe you meant to use '" + levenArray$1(option, validOptions) + "'?");
- }
- }
- };
- var allPluginsList = Object.keys(plugins$2);
- var modulePlugins = ["proposal-dynamic-import"].concat(Object.keys(moduleTransformations).map(function (m) {
- return moduleTransformations[m];
- }));
- var getValidIncludesAndExcludes = function getValidIncludesAndExcludes(type, corejs) {
- return new Set([].concat(allPluginsList, type === "exclude" ? modulePlugins : [], corejs ? corejs == 2 ? [].concat(Object.keys(corejs2BuiltIns$2), defaultWebIncludes) : Object.keys(corejs3Polyfills) : []));
- };
- var pluginToRegExp = function pluginToRegExp(plugin) {
- if (plugin instanceof RegExp) return plugin;
- try {
- return new RegExp("^" + normalizePluginName(plugin) + "$");
- } catch (e) {
- return null;
- }
- };
- var selectPlugins = function selectPlugins(regexp, type, corejs) {
- return Array.from(getValidIncludesAndExcludes(type, corejs)).filter(function (item) {
- return regexp instanceof RegExp && regexp.test(item);
- });
- };
- var flatten$1 = function flatten(array) {
- var _ref;
- return (_ref = []).concat.apply(_ref, array);
- };
- var expandIncludesAndExcludes = function expandIncludesAndExcludes(plugins, type, corejs) {
- if (plugins === void 0) {
- plugins = [];
- }
- if (plugins.length === 0) return [];
- var selectedPlugins = plugins.map(function (plugin) {
- return selectPlugins(pluginToRegExp(plugin), type, corejs);
- });
- var invalidRegExpList = plugins.filter(function (p, i) {
- return selectedPlugins[i].length === 0;
- });
- browser$8(invalidRegExpList.length === 0, "Invalid Option: The plugins/built-ins '" + invalidRegExpList.join(", ") + "' passed to the '" + type + "' option are not\n valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env");
- return flatten$1(selectedPlugins);
- };
- var normalizePluginName = function normalizePluginName(plugin) {
- return plugin.replace(/^(@babel\/|babel-)(plugin-)?/, "");
- };
- var checkDuplicateIncludeExcludes = function checkDuplicateIncludeExcludes(include, exclude) {
- if (include === void 0) {
- include = [];
- }
- if (exclude === void 0) {
- exclude = [];
- }
- var duplicates = include.filter(function (opt) {
- return exclude.indexOf(opt) >= 0;
- });
- browser$8(duplicates.length === 0, "Invalid Option: The plugins/built-ins '" + duplicates.join(", ") + "' were found in both the \"include\" and\n \"exclude\" options.");
- };
- var normalizeTargets = function normalizeTargets(targets) {
- if (typeof targets === "string" || Array.isArray(targets)) {
- return {
- browsers: targets
- };
- }
- return Object.assign({}, targets);
- };
- var validateConfigPathOption = function validateConfigPathOption(configPath) {
- if (configPath === void 0) {
- configPath = process.cwd();
- }
- browser$8(typeof configPath === "string", "Invalid Option: The configPath option '" + configPath + "' is invalid, only strings are allowed.");
- return configPath;
- };
- var validateBoolOption = function validateBoolOption(name, value, defaultValue) {
- if (typeof value === "undefined") {
- value = defaultValue;
- }
- if (typeof value !== "boolean") {
- throw new Error("Preset env: '" + name + "' option must be a boolean.");
- }
- return value;
- };
- var validateIgnoreBrowserslistConfig = function validateIgnoreBrowserslistConfig(ignoreBrowserslistConfig) {
- return validateBoolOption(TopLevelOptions.ignoreBrowserslistConfig, ignoreBrowserslistConfig, false);
- };
- var validateModulesOption = function validateModulesOption(modulesOpt) {
- if (modulesOpt === void 0) {
- modulesOpt = ModulesOption.auto;
- }
- browser$8(ModulesOption[modulesOpt.toString()] || ModulesOption[modulesOpt.toString()] === ModulesOption["false"], "Invalid Option: The 'modules' option must be one of \n" + " - 'false' to indicate no module processing\n" + " - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'" + " - 'auto' (default) which will automatically select 'false' if the current\n" + " process is known to support ES module syntax, or \"commonjs\" otherwise\n");
- return modulesOpt;
- };
- var validateUseBuiltInsOption = function validateUseBuiltInsOption(builtInsOpt) {
- if (builtInsOpt === void 0) {
- builtInsOpt = false;
- }
- browser$8(UseBuiltInsOption[builtInsOpt.toString()] || UseBuiltInsOption[builtInsOpt.toString()] === UseBuiltInsOption["false"], "Invalid Option: The 'useBuiltIns' option must be either\n 'false' (default) to indicate no polyfill,\n '\"entry\"' to indicate replacing the entry polyfill, or\n '\"usage\"' to import only used polyfills per file");
- return builtInsOpt;
- };
- function normalizeCoreJSOption(corejs, useBuiltIns) {
- var proposals = false;
- var rawVersion;
- if (useBuiltIns && corejs === undefined) {
- rawVersion = 2;
- console.warn("\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + "core-js version. Currently, we assume version 2.x when no version " + "is passed. Since this default version will likely change in future " + "versions of Babel, we recommend explicitly setting the core-js version " + "you are using via the `corejs` option.\n" + "\nYou should also be sure that the version you pass to the `corejs` " + "option matches the version specified in your `package.json`'s " + "`dependencies` section. If it doesn't, you need to run one of the " + "following commands:\n\n" + " npm install --save core-js@2 npm install --save core-js@3\n" + " yarn add core-js@2 yarn add core-js@3\n");
- } else if (typeof corejs === "object" && corejs !== null) {
- rawVersion = corejs.version;
- proposals = Boolean(corejs.proposals);
- } else {
- rawVersion = corejs;
- }
- var version = rawVersion ? semver_42(String(rawVersion)) : false;
- if (!useBuiltIns && version) {
- console.log("\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n");
- }
- if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {
- throw new RangeError("Invalid Option: The version passed to `corejs` is invalid. Currently, " + "only core-js@2 and core-js@3 are supported.");
- }
- return {
- version: version,
- proposals: proposals
- };
- }
- function normalizeOptions$4(opts) {
- validateTopLevelOptions(opts);
- var useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);
- var corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);
- var include = expandIncludesAndExcludes(opts.include, TopLevelOptions.include, !!corejs.version && corejs.version.major);
- var exclude = expandIncludesAndExcludes(opts.exclude, TopLevelOptions.exclude, !!corejs.version && corejs.version.major);
- checkDuplicateIncludeExcludes(include, exclude);
- var shippedProposals = validateBoolOption(TopLevelOptions.shippedProposals, opts.shippedProposals, false) || corejs.proposals;
- return {
- configPath: validateConfigPathOption(opts.configPath),
- corejs: corejs,
- debug: validateBoolOption(TopLevelOptions.debug, opts.debug, false),
- include: include,
- exclude: exclude,
- forceAllTransforms: validateBoolOption(TopLevelOptions.forceAllTransforms, opts.forceAllTransforms, false),
- ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(opts.ignoreBrowserslistConfig),
- loose: validateBoolOption(TopLevelOptions.loose, opts.loose, false),
- modules: validateModulesOption(opts.modules),
- shippedProposals: shippedProposals,
- spec: validateBoolOption(TopLevelOptions.spec, opts.spec, false),
- targets: normalizeTargets(opts.targets),
- useBuiltIns: useBuiltIns
- };
- }
- var proposalPlugins = {};
- var pluginSyntaxObject = {
- "proposal-async-generator-functions": "syntax-async-generators",
- "proposal-json-strings": "syntax-json-strings",
- "proposal-nullish-coalescing-operator": "syntax-nullish-coalescing-operator",
- "proposal-object-rest-spread": "syntax-object-rest-spread",
- "proposal-optional-catch-binding": "syntax-optional-catch-binding",
- "proposal-optional-chaining": "syntax-optional-chaining",
- "proposal-unicode-property-regex": null
- };
- var pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {
- return [key, pluginSyntaxObject[key]];
- });
- var pluginSyntaxMap = new Map(pluginSyntaxEntries);
- var shippedProposals = {
- pluginSyntaxMap: pluginSyntaxMap,
- proposalPlugins: proposalPlugins
- };
- var shippedProposals_1 = shippedProposals.pluginSyntaxMap;
- var shippedProposals_2 = shippedProposals.proposalPlugins;
- var overlappingPlugins = {
- "transform-regenerator": [
- ]
- };
- var overlappingPlugins$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': overlappingPlugins
- });
- var require$$0$5 = getCjsExportFromNamespace(overlappingPlugins$1);
- var overlappingPlugins$2 = require$$0$5;
- var ArrayNatureIterators = ["es6.object.to-string", "es6.array.iterator", "web.dom.iterable"];
- var CommonIterators = ["es6.string.iterator"].concat(ArrayNatureIterators);
- var PromiseDependencies = ["es6.object.to-string", "es6.promise"];
- var BuiltIns = {
- DataView: "es6.typed.data-view",
- Float32Array: "es6.typed.float32-array",
- Float64Array: "es6.typed.float64-array",
- Int8Array: "es6.typed.int8-array",
- Int16Array: "es6.typed.int16-array",
- Int32Array: "es6.typed.int32-array",
- Map: ["es6.map"].concat(CommonIterators),
- Number: "es6.number.constructor",
- Promise: PromiseDependencies,
- RegExp: ["es6.regexp.constructor"],
- Set: ["es6.set"].concat(CommonIterators),
- Symbol: ["es6.symbol", "es7.symbol.async-iterator"],
- Uint8Array: "es6.typed.uint8-array",
- Uint8ClampedArray: "es6.typed.uint8-clamped-array",
- Uint16Array: "es6.typed.uint16-array",
- Uint32Array: "es6.typed.uint32-array",
- WeakMap: ["es6.weak-map"].concat(CommonIterators),
- WeakSet: ["es6.weak-set"].concat(CommonIterators)
- };
- var InstanceProperties = {
- __defineGetter__: ["es7.object.define-getter"],
- __defineSetter__: ["es7.object.define-setter"],
- __lookupGetter__: ["es7.object.lookup-getter"],
- __lookupSetter__: ["es7.object.lookup-setter"],
- anchor: ["es6.string.anchor"],
- big: ["es6.string.big"],
- bind: ["es6.function.bind"],
- blink: ["es6.string.blink"],
- bold: ["es6.string.bold"],
- codePointAt: ["es6.string.code-point-at"],
- copyWithin: ["es6.array.copy-within"],
- endsWith: ["es6.string.ends-with"],
- entries: ArrayNatureIterators,
- every: ["es6.array.is-array"],
- fill: ["es6.array.fill"],
- filter: ["es6.array.filter"],
- "finally": ["es7.promise.finally"].concat(PromiseDependencies),
- find: ["es6.array.find"],
- findIndex: ["es6.array.find-index"],
- fixed: ["es6.string.fixed"],
- flags: ["es6.regexp.flags"],
- flatMap: ["es7.array.flat-map"],
- fontcolor: ["es6.string.fontcolor"],
- fontsize: ["es6.string.fontsize"],
- forEach: ["es6.array.for-each"],
- includes: ["es6.string.includes", "es7.array.includes"],
- indexOf: ["es6.array.index-of"],
- italics: ["es6.string.italics"],
- keys: ArrayNatureIterators,
- lastIndexOf: ["es6.array.last-index-of"],
- link: ["es6.string.link"],
- map: ["es6.array.map"],
- match: ["es6.regexp.match"],
- name: ["es6.function.name"],
- padStart: ["es7.string.pad-start"],
- padEnd: ["es7.string.pad-end"],
- reduce: ["es6.array.reduce"],
- reduceRight: ["es6.array.reduce-right"],
- repeat: ["es6.string.repeat"],
- replace: ["es6.regexp.replace"],
- search: ["es6.regexp.search"],
- slice: ["es6.array.slice"],
- small: ["es6.string.small"],
- some: ["es6.array.some"],
- sort: ["es6.array.sort"],
- split: ["es6.regexp.split"],
- startsWith: ["es6.string.starts-with"],
- strike: ["es6.string.strike"],
- sub: ["es6.string.sub"],
- sup: ["es6.string.sup"],
- toISOString: ["es6.date.to-iso-string"],
- toJSON: ["es6.date.to-json"],
- toString: ["es6.object.to-string", "es6.date.to-string", "es6.regexp.to-string"],
- trim: ["es6.string.trim"],
- trimEnd: ["es7.string.trim-right"],
- trimLeft: ["es7.string.trim-left"],
- trimRight: ["es7.string.trim-right"],
- trimStart: ["es7.string.trim-left"],
- values: ArrayNatureIterators
- };
- var StaticProperties = {
- Array: {
- from: ["es6.array.from", "es6.string.iterator"],
- isArray: "es6.array.is-array",
- of: "es6.array.of"
- },
- Date: {
- now: "es6.date.now"
- },
- Object: {
- assign: "es6.object.assign",
- create: "es6.object.create",
- defineProperty: "es6.object.define-property",
- defineProperties: "es6.object.define-properties",
- entries: "es7.object.entries",
- freeze: "es6.object.freeze",
- getOwnPropertyDescriptors: "es7.object.get-own-property-descriptors",
- getOwnPropertySymbols: "es6.symbol",
- is: "es6.object.is",
- isExtensible: "es6.object.is-extensible",
- isFrozen: "es6.object.is-frozen",
- isSealed: "es6.object.is-sealed",
- keys: "es6.object.keys",
- preventExtensions: "es6.object.prevent-extensions",
- seal: "es6.object.seal",
- setPrototypeOf: "es6.object.set-prototype-of",
- values: "es7.object.values"
- },
- Math: {
- acosh: "es6.math.acosh",
- asinh: "es6.math.asinh",
- atanh: "es6.math.atanh",
- cbrt: "es6.math.cbrt",
- clz32: "es6.math.clz32",
- cosh: "es6.math.cosh",
- expm1: "es6.math.expm1",
- fround: "es6.math.fround",
- hypot: "es6.math.hypot",
- imul: "es6.math.imul",
- log1p: "es6.math.log1p",
- log10: "es6.math.log10",
- log2: "es6.math.log2",
- sign: "es6.math.sign",
- sinh: "es6.math.sinh",
- tanh: "es6.math.tanh",
- trunc: "es6.math.trunc"
- },
- String: {
- fromCodePoint: "es6.string.from-code-point",
- raw: "es6.string.raw"
- },
- Number: {
- EPSILON: "es6.number.epsilon",
- MIN_SAFE_INTEGER: "es6.number.min-safe-integer",
- MAX_SAFE_INTEGER: "es6.number.max-safe-integer",
- isFinite: "es6.number.is-finite",
- isInteger: "es6.number.is-integer",
- isSafeInteger: "es6.number.is-safe-integer",
- isNaN: "es6.number.is-nan",
- parseFloat: "es6.number.parse-float",
- parseInt: "es6.number.parse-int"
- },
- Promise: {
- all: CommonIterators,
- race: CommonIterators
- },
- Reflect: {
- apply: "es6.reflect.apply",
- construct: "es6.reflect.construct",
- defineProperty: "es6.reflect.define-property",
- deleteProperty: "es6.reflect.delete-property",
- get: "es6.reflect.get",
- getOwnPropertyDescriptor: "es6.reflect.get-own-property-descriptor",
- getPrototypeOf: "es6.reflect.get-prototype-of",
- has: "es6.reflect.has",
- isExtensible: "es6.reflect.is-extensible",
- ownKeys: "es6.reflect.own-keys",
- preventExtensions: "es6.reflect.prevent-extensions",
- set: "es6.reflect.set",
- setPrototypeOf: "es6.reflect.set-prototype-of"
- }
- };
- var has$6 = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);
- function getType$1(target) {
- return Object.prototype.toString.call(target).slice(8, -1).toLowerCase();
- }
- function intersection(first, second, third) {
- var result = new Set();
- for (var _iterator = first, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref = _i.value;
- }
- var el = _ref;
- if (second.has(el) && third.has(el)) result.add(el);
- }
- return result;
- }
- function filterStageFromList(list, stageList) {
- return Object.keys(list).reduce(function (result, item) {
- if (!stageList[item]) {
- result[item] = list[item];
- }
- return result;
- }, {});
- }
- function getImportSource(_ref2) {
- var node = _ref2.node;
- if (node.specifiers.length === 0) return node.source.value;
- }
- function getRequireSource(_ref3) {
- var node = _ref3.node;
- if (!isExpressionStatement(node)) return;
- var expression = node.expression;
- var isRequire = isCallExpression(expression) && isIdentifier(expression.callee) && expression.callee.name === "require" && expression.arguments.length === 1 && isStringLiteral(expression.arguments[0]);
- if (isRequire) return expression.arguments[0].value;
- }
- function isPolyfillSource(source) {
- return source === "@babel/polyfill" || source === "core-js";
- }
- var modulePathMap = {
- "regenerator-runtime": "regenerator-runtime/runtime"
- };
- function getModulePath(mod) {
- return modulePathMap[mod] || "core-js/modules/" + mod;
- }
- function createImport(path, mod) {
- return addSideEffect(path, getModulePath(mod));
- }
- function isNamespaced(path) {
- if (!path.node) return false;
- var binding = path.scope.getBinding(path.node.name);
- if (!binding) return false;
- return binding.path.isImportNamespaceSpecifier();
- }
- var NO_DIRECT_POLYFILL_IMPORT = "\n When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed.\n Please remove the `import '@babel/polyfill'` call or use `useBuiltIns: 'entry'` instead.";
- function addCoreJS2UsagePlugin (_ref, _ref2) {
- var t = _ref.types;
- var include = _ref2.include,
- exclude = _ref2.exclude,
- polyfillTargets = _ref2.polyfillTargets,
- debug = _ref2.debug;
- var polyfills = filterItems(corejs2BuiltIns$2, include, exclude, polyfillTargets, getPlatformSpecificDefaultFor(polyfillTargets));
- var addAndRemovePolyfillImports = {
- ImportDeclaration: function ImportDeclaration(path) {
- if (isPolyfillSource(getImportSource(path))) {
- console.warn(NO_DIRECT_POLYFILL_IMPORT);
- path.remove();
- }
- },
- Program: function Program(path) {
- path.get("body").forEach(function (bodyPath) {
- if (isPolyfillSource(getRequireSource(bodyPath))) {
- console.warn(NO_DIRECT_POLYFILL_IMPORT);
- bodyPath.remove();
- }
- });
- },
- ReferencedIdentifier: function ReferencedIdentifier(_ref3) {
- var name = _ref3.node.name,
- parent = _ref3.parent,
- scope = _ref3.scope;
- if (t.isMemberExpression(parent)) return;
- if (!has$6(BuiltIns, name)) return;
- if (scope.getBindingIdentifier(name)) return;
- var BuiltInDependencies = BuiltIns[name];
- this.addUnsupported(BuiltInDependencies);
- },
- CallExpression: function CallExpression(path) {
- if (path.node.arguments.length) return;
- var callee = path.node.callee;
- if (!t.isMemberExpression(callee)) return;
- if (!callee.computed) return;
- if (!path.get("callee.property").matchesPattern("Symbol.iterator")) {
- return;
- }
- this.addImport("web.dom.iterable");
- },
- BinaryExpression: function BinaryExpression(path) {
- if (path.node.operator !== "in") return;
- if (!path.get("left").matchesPattern("Symbol.iterator")) return;
- this.addImport("web.dom.iterable");
- },
- YieldExpression: function YieldExpression(path) {
- if (path.node.delegate) {
- this.addImport("web.dom.iterable");
- }
- },
- MemberExpression: {
- enter: function enter(path) {
- var node = path.node;
- var object = node.object,
- property = node.property;
- if (isNamespaced(path.get("object"))) return;
- var evaluatedPropType = object.name;
- var propertyName = "";
- var instanceType = "";
- if (node.computed) {
- if (t.isStringLiteral(property)) {
- propertyName = property.value;
- } else {
- var result = path.get("property").evaluate();
- if (result.confident && result.value) {
- propertyName = result.value;
- }
- }
- } else {
- propertyName = property.name;
- }
- if (path.scope.getBindingIdentifier(object.name)) {
- var _result = path.get("object").evaluate();
- if (_result.value) {
- instanceType = getType$1(_result.value);
- } else if (_result.deopt && _result.deopt.isIdentifier()) {
- evaluatedPropType = _result.deopt.node.name;
- }
- }
- if (has$6(StaticProperties, evaluatedPropType)) {
- var BuiltInProperties = StaticProperties[evaluatedPropType];
- if (has$6(BuiltInProperties, propertyName)) {
- var StaticPropertyDependencies = BuiltInProperties[propertyName];
- this.addUnsupported(StaticPropertyDependencies);
- }
- }
- if (has$6(InstanceProperties, propertyName)) {
- var InstancePropertyDependencies = InstanceProperties[propertyName];
- if (instanceType) {
- InstancePropertyDependencies = InstancePropertyDependencies.filter(function (module) {
- return module.includes(instanceType);
- });
- }
- this.addUnsupported(InstancePropertyDependencies);
- }
- },
- exit: function exit(path) {
- var name = path.node.object.name;
- if (!has$6(BuiltIns, name)) return;
- if (path.scope.getBindingIdentifier(name)) return;
- var BuiltInDependencies = BuiltIns[name];
- this.addUnsupported(BuiltInDependencies);
- }
- },
- VariableDeclarator: function VariableDeclarator(path) {
- var node = path.node;
- var id = node.id,
- init = node.init;
- if (!t.isObjectPattern(id)) return;
- if (init && path.scope.getBindingIdentifier(init.name)) return;
- for (var _iterator = id.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref4;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref4 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref4 = _i.value;
- }
- var _ref5 = _ref4,
- key = _ref5.key;
- if (!node.computed && t.isIdentifier(key) && has$6(InstanceProperties, key.name)) {
- var InstancePropertyDependencies = InstanceProperties[key.name];
- this.addUnsupported(InstancePropertyDependencies);
- }
- }
- }
- };
- return {
- name: "corejs2-usage",
- pre: function pre(_ref6) {
- var path = _ref6.path;
- this.polyfillsSet = new Set();
- this.addImport = function (builtIn) {
- if (!this.polyfillsSet.has(builtIn)) {
- this.polyfillsSet.add(builtIn);
- createImport(path, builtIn);
- }
- };
- this.addUnsupported = function (builtIn) {
- var modules = Array.isArray(builtIn) ? builtIn : [builtIn];
- for (var _iterator2 = modules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref7;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref7 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref7 = _i2.value;
- }
- var module = _ref7;
- if (polyfills.has(module)) {
- this.addImport(module);
- }
- }
- };
- },
- post: function post() {
- if (debug) {
- logUsagePolyfills(this.polyfillsSet, this.file.opts.filename, polyfillTargets, corejs2BuiltIns$2);
- }
- },
- visitor: addAndRemovePolyfillImports
- };
- }
- var corejs3ShippedProposalsList = ["esnext.global-this", "esnext.string.match-all"];
- var debug$2 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? function () {
- var _console;
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- return (_console = console).error.apply(_console, ['SEMVER'].concat(args));
- } : function () {};
- var debug_1 = debug$2;
- var SEMVER_SPEC_VERSION = '2.0.0';
- var MAX_LENGTH = 256;
- var MAX_SAFE_INTEGER$3 = Number.MAX_SAFE_INTEGER || 9007199254740991;
- var MAX_SAFE_COMPONENT_LENGTH = 16;
- var constants$1 = {
- SEMVER_SPEC_VERSION: SEMVER_SPEC_VERSION,
- MAX_LENGTH: MAX_LENGTH,
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$3,
- MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH
- };
- var re_1 = createCommonjsModule(function (module, exports) {
- var MAX_SAFE_COMPONENT_LENGTH = constants$1.MAX_SAFE_COMPONENT_LENGTH;
- exports = module.exports = {};
- var re = exports.re = [];
- var src = exports.src = [];
- var t = exports.t = {};
- var R = 0;
- var createToken = function createToken(name, value, isGlobal) {
- var index = R++;
- debug_1(index, value);
- t[name] = index;
- src[index] = value;
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
- };
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
- createToken('MAINVERSION', "(" + src[t.NUMERICIDENTIFIER] + ")\\." + ("(" + src[t.NUMERICIDENTIFIER] + ")\\.") + ("(" + src[t.NUMERICIDENTIFIER] + ")"));
- createToken('MAINVERSIONLOOSE', "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\." + ("(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.") + ("(" + src[t.NUMERICIDENTIFIERLOOSE] + ")"));
- createToken('PRERELEASEIDENTIFIER', "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")");
- createToken('PRERELEASEIDENTIFIERLOOSE', "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")");
- createToken('PRERELEASE', "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))");
- createToken('PRERELEASELOOSE', "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))");
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
- createToken('BUILD', "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))");
- createToken('FULLPLAIN', "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?");
- createToken('FULL', "^" + src[t.FULLPLAIN] + "$");
- createToken('LOOSEPLAIN', "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?");
- createToken('LOOSE', "^" + src[t.LOOSEPLAIN] + "$");
- createToken('GTLT', '((?:<|>)?=?)');
- createToken('XRANGEIDENTIFIERLOOSE', src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*");
- createToken('XRANGEIDENTIFIER', src[t.NUMERICIDENTIFIER] + "|x|X|\\*");
- createToken('XRANGEPLAIN', "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")" + ("(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")") + ("(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")") + ("(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?") + ")?)?");
- createToken('XRANGEPLAINLOOSE', "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")" + ("(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")") + ("(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")") + ("(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?") + ")?)?");
- createToken('XRANGE', "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$");
- createToken('XRANGELOOSE', "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$");
- createToken('COERCE', "" + ('(^|[^\\d])' + '(\\d{1,') + MAX_SAFE_COMPONENT_LENGTH + "})" + ("(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?") + ("(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?") + "(?:$|[^\\d])");
- createToken('COERCERTL', src[t.COERCE], true);
- createToken('LONETILDE', '(?:~>?)');
- createToken('TILDETRIM', "(\\s*)" + src[t.LONETILDE] + "\\s+", true);
- exports.tildeTrimReplace = '$1~';
- createToken('TILDE', "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$");
- createToken('TILDELOOSE', "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$");
- createToken('LONECARET', '(?:\\^)');
- createToken('CARETTRIM', "(\\s*)" + src[t.LONECARET] + "\\s+", true);
- exports.caretTrimReplace = '$1^';
- createToken('CARET', "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$");
- createToken('CARETLOOSE', "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$");
- createToken('COMPARATORLOOSE', "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$");
- createToken('COMPARATOR', "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$");
- createToken('COMPARATORTRIM', "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")", true);
- exports.comparatorTrimReplace = '$1$2$3';
- createToken('HYPHENRANGE', "^\\s*(" + src[t.XRANGEPLAIN] + ")" + "\\s+-\\s+" + ("(" + src[t.XRANGEPLAIN] + ")") + "\\s*$");
- createToken('HYPHENRANGELOOSE', "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")" + "\\s+-\\s+" + ("(" + src[t.XRANGEPLAINLOOSE] + ")") + "\\s*$");
- createToken('STAR', '(<|>)?=?\\s*\\*');
- });
- var re_2 = re_1.re;
- var re_3 = re_1.src;
- var re_4 = re_1.t;
- var re_5 = re_1.tildeTrimReplace;
- var re_6 = re_1.caretTrimReplace;
- var re_7 = re_1.comparatorTrimReplace;
- var numeric = /^[0-9]+$/;
- var compareIdentifiers = function compareIdentifiers(a, b) {
- var anum = numeric.test(a);
- var bnum = numeric.test(b);
- if (anum && bnum) {
- a = +a;
- b = +b;
- }
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
- };
- var rcompareIdentifiers = function rcompareIdentifiers(a, b) {
- return compareIdentifiers(b, a);
- };
- var identifiers = {
- compareIdentifiers: compareIdentifiers,
- rcompareIdentifiers: rcompareIdentifiers
- };
- var MAX_LENGTH$1 = constants$1.MAX_LENGTH,
- MAX_SAFE_INTEGER$4 = constants$1.MAX_SAFE_INTEGER;
- var re = re_1.re,
- t$1 = re_1.t;
- var compareIdentifiers$1 = identifiers.compareIdentifiers;
- var SemVer = function () {
- function SemVer(version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof SemVer) {
- if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
- return version;
- } else {
- version = version.version;
- }
- } else if (typeof version !== 'string') {
- throw new TypeError("Invalid Version: " + version);
- }
- if (version.length > MAX_LENGTH$1) {
- throw new TypeError("version is longer than " + MAX_LENGTH$1 + " characters");
- }
- debug_1('SemVer', version, options);
- this.options = options;
- this.loose = !!options.loose;
- this.includePrerelease = !!options.includePrerelease;
- var m = version.trim().match(options.loose ? re[t$1.LOOSE] : re[t$1.FULL]);
- if (!m) {
- throw new TypeError("Invalid Version: " + version);
- }
- this.raw = version;
- this.major = +m[1];
- this.minor = +m[2];
- this.patch = +m[3];
- if (this.major > MAX_SAFE_INTEGER$4 || this.major < 0) {
- throw new TypeError('Invalid major version');
- }
- if (this.minor > MAX_SAFE_INTEGER$4 || this.minor < 0) {
- throw new TypeError('Invalid minor version');
- }
- if (this.patch > MAX_SAFE_INTEGER$4 || this.patch < 0) {
- throw new TypeError('Invalid patch version');
- }
- if (!m[4]) {
- this.prerelease = [];
- } else {
- this.prerelease = m[4].split('.').map(function (id) {
- if (/^[0-9]+$/.test(id)) {
- var num = +id;
- if (num >= 0 && num < MAX_SAFE_INTEGER$4) {
- return num;
- }
- }
- return id;
- });
- }
- this.build = m[5] ? m[5].split('.') : [];
- this.format();
- }
- var _proto = SemVer.prototype;
- _proto.format = function format() {
- this.version = this.major + "." + this.minor + "." + this.patch;
- if (this.prerelease.length) {
- this.version += "-" + this.prerelease.join('.');
- }
- return this.version;
- };
- _proto.toString = function toString() {
- return this.version;
- };
- _proto.compare = function compare(other) {
- debug_1('SemVer.compare', this.version, this.options, other);
- if (!(other instanceof SemVer)) {
- if (typeof other === 'string' && other === this.version) {
- return 0;
- }
- other = new SemVer(other, this.options);
- }
- if (other.version === this.version) {
- return 0;
- }
- return this.compareMain(other) || this.comparePre(other);
- };
- _proto.compareMain = function compareMain(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- return compareIdentifiers$1(this.major, other.major) || compareIdentifiers$1(this.minor, other.minor) || compareIdentifiers$1(this.patch, other.patch);
- };
- _proto.comparePre = function comparePre(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- if (this.prerelease.length && !other.prerelease.length) {
- return -1;
- } else if (!this.prerelease.length && other.prerelease.length) {
- return 1;
- } else if (!this.prerelease.length && !other.prerelease.length) {
- return 0;
- }
- var i = 0;
- do {
- var a = this.prerelease[i];
- var b = other.prerelease[i];
- debug_1('prerelease compare', i, a, b);
- if (a === undefined && b === undefined) {
- return 0;
- } else if (b === undefined) {
- return 1;
- } else if (a === undefined) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers$1(a, b);
- }
- } while (++i);
- };
- _proto.compareBuild = function compareBuild(other) {
- if (!(other instanceof SemVer)) {
- other = new SemVer(other, this.options);
- }
- var i = 0;
- do {
- var a = this.build[i];
- var b = other.build[i];
- debug_1('prerelease compare', i, a, b);
- if (a === undefined && b === undefined) {
- return 0;
- } else if (b === undefined) {
- return 1;
- } else if (a === undefined) {
- return -1;
- } else if (a === b) {
- continue;
- } else {
- return compareIdentifiers$1(a, b);
- }
- } while (++i);
- };
- _proto.inc = function inc(release, identifier) {
- switch (release) {
- case 'premajor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor = 0;
- this.major++;
- this.inc('pre', identifier);
- break;
- case 'preminor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor++;
- this.inc('pre', identifier);
- break;
- case 'prepatch':
- this.prerelease.length = 0;
- this.inc('patch', identifier);
- this.inc('pre', identifier);
- break;
- case 'prerelease':
- if (this.prerelease.length === 0) {
- this.inc('patch', identifier);
- }
- this.inc('pre', identifier);
- break;
- case 'major':
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
- this.major++;
- }
- this.minor = 0;
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'minor':
- if (this.patch !== 0 || this.prerelease.length === 0) {
- this.minor++;
- }
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'patch':
- if (this.prerelease.length === 0) {
- this.patch++;
- }
- this.prerelease = [];
- break;
- case 'pre':
- if (this.prerelease.length === 0) {
- this.prerelease = [0];
- } else {
- var i = this.prerelease.length;
- while (--i >= 0) {
- if (typeof this.prerelease[i] === 'number') {
- this.prerelease[i]++;
- i = -2;
- }
- }
- if (i === -1) {
- this.prerelease.push(0);
- }
- }
- if (identifier) {
- if (this.prerelease[0] === identifier) {
- if (isNaN(this.prerelease[1])) {
- this.prerelease = [identifier, 0];
- }
- } else {
- this.prerelease = [identifier, 0];
- }
- }
- break;
- default:
- throw new Error("invalid increment argument: " + release);
- }
- this.format();
- this.raw = this.version;
- return this;
- };
- return SemVer;
- }();
- var semver$1 = SemVer;
- var compare$2 = function compare(a, b, loose) {
- return new semver$1(a, loose).compare(new semver$1(b, loose));
- };
- var compare_1 = compare$2;
- var eq$1 = function eq(a, b, loose) {
- return compare_1(a, b, loose) === 0;
- };
- var eq_1$1 = eq$1;
- var neq = function neq(a, b, loose) {
- return compare_1(a, b, loose) !== 0;
- };
- var neq_1 = neq;
- var gt = function gt(a, b, loose) {
- return compare_1(a, b, loose) > 0;
- };
- var gt_1 = gt;
- var gte = function gte(a, b, loose) {
- return compare_1(a, b, loose) >= 0;
- };
- var gte_1 = gte;
- var lt = function lt(a, b, loose) {
- return compare_1(a, b, loose) < 0;
- };
- var lt_1 = lt;
- var lte = function lte(a, b, loose) {
- return compare_1(a, b, loose) <= 0;
- };
- var lte_1 = lte;
- var cmp = function cmp(a, op, b, loose) {
- switch (op) {
- case '===':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- return a === b;
- case '!==':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- return a !== b;
- case '':
- case '=':
- case '==':
- return eq_1$1(a, b, loose);
- case '!=':
- return neq_1(a, b, loose);
- case '>':
- return gt_1(a, b, loose);
- case '>=':
- return gte_1(a, b, loose);
- case '<':
- return lt_1(a, b, loose);
- case '<=':
- return lte_1(a, b, loose);
- default:
- throw new TypeError("Invalid operator: " + op);
- }
- };
- var cmp_1 = cmp;
- var MAX_LENGTH$2 = constants$1.MAX_LENGTH;
- var re$1 = re_1.re,
- t$2 = re_1.t;
- var parse$7 = function parse(version, options) {
- if (!options || typeof options !== 'object') {
- options = {
- loose: !!options,
- includePrerelease: false
- };
- }
- if (version instanceof semver$1) {
- return version;
- }
- if (typeof version !== 'string') {
- return null;
- }
- if (version.length > MAX_LENGTH$2) {
- return null;
- }
- var r = options.loose ? re$1[t$2.LOOSE] : re$1[t$2.FULL];
- if (!r.test(version)) {
- return null;
- }
- try {
- return new semver$1(version, options);
- } catch (er) {
- return null;
- }
- };
- var parse_1 = parse$7;
- var re$2 = re_1.re,
- t$3 = re_1.t;
- var coerce = function coerce(version, options) {
- if (version instanceof semver$1) {
- return version;
- }
- if (typeof version === 'number') {
- version = String(version);
- }
- if (typeof version !== 'string') {
- return null;
- }
- options = options || {};
- var match = null;
- if (!options.rtl) {
- match = version.match(re$2[t$3.COERCE]);
- } else {
- var next;
- while ((next = re$2[t$3.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) {
- if (!match || next.index + next[0].length !== match.index + match[0].length) {
- match = next;
- }
- re$2[t$3.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
- }
- re$2[t$3.COERCERTL].lastIndex = -1;
- }
- if (match === null) return null;
- return parse_1(match[2] + "." + (match[3] || '0') + "." + (match[4] || '0'), options);
- };
- var coerce_1 = coerce;
- var has$7 = Function.call.bind({}.hasOwnProperty);
- function compare$3(a, operator, b) {
- return cmp_1(coerce_1(a), operator, coerce_1(b));
- }
- function intersection$1(list, order) {
- var set = list instanceof Set ? list : new Set(list);
- return order.filter(function (name) {
- return set.has(name);
- });
- }
- function sortObjectByKey(object, fn) {
- return Object.keys(object).sort(fn).reduce(function (memo, key) {
- memo[key] = object[key];
- return memo;
- }, {});
- }
- var helpers$1 = {
- compare: compare$3,
- has: has$7,
- intersection: intersection$1,
- semver: coerce_1,
- sortObjectByKey: sortObjectByKey
- };
- var modulesByVersions = {
- "3.0": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set",
- "esnext.aggregate-error",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "3.1": [
- "es.string.match-all",
- "es.symbol.match-all",
- "esnext.symbol.replace-all"
- ],
- "3.2": [
- "es.promise.all-settled",
- "esnext.array.is-template-object",
- "esnext.map.update-or-insert",
- "esnext.symbol.async-dispose"
- ],
- "3.3": [
- "es.global-this",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.upsert",
- "esnext.weak-map.upsert"
- ],
- "3.4": [
- "es.json.stringify"
- ],
- "3.5": [
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values"
- ],
- "3.6": [
- "es.regexp.sticky",
- "es.regexp.test"
- ]
- };
- var modulesByVersions$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': modulesByVersions
- });
- var modules = [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.global-this",
- "es.json.stringify",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set",
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ];
- var modules$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': modules
- });
- var modulesByVersions$2 = getCjsExportFromNamespace(modulesByVersions$1);
- var modules$2 = getCjsExportFromNamespace(modules$1);
- var compare$4 = helpers$1.compare,
- intersection$2 = helpers$1.intersection,
- semver$2 = helpers$1.semver;
- var getModulesListForTargetVersion = function (raw) {
- var corejs = semver$2(raw);
- if (corejs.major !== 3) {
- throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');
- }
- var result = [];
- for (var _i = 0, _Object$keys = Object.keys(modulesByVersions$2); _i < _Object$keys.length; _i++) {
- var version = _Object$keys[_i];
- if (compare$4(version, '<=', corejs)) {
- result.push.apply(result, modulesByVersions$2[version]);
- }
- }
- return intersection$2(result, modules$2);
- };
- var ArrayNatureIterators$1 = ["es.array.iterator", "web.dom-collections.iterator"];
- var CommonIterators$1 = ["es.string.iterator"].concat(ArrayNatureIterators$1);
- var ArrayNatureIteratorsWithTag = ["es.object.to-string"].concat(ArrayNatureIterators$1);
- var CommonIteratorsWithTag = ["es.object.to-string"].concat(CommonIterators$1);
- var TypedArrayDependencies = ["es.typed-array.copy-within", "es.typed-array.every", "es.typed-array.fill", "es.typed-array.filter", "es.typed-array.find", "es.typed-array.find-index", "es.typed-array.for-each", "es.typed-array.includes", "es.typed-array.index-of", "es.typed-array.iterator", "es.typed-array.join", "es.typed-array.last-index-of", "es.typed-array.map", "es.typed-array.reduce", "es.typed-array.reduce-right", "es.typed-array.reverse", "es.typed-array.set", "es.typed-array.slice", "es.typed-array.some", "es.typed-array.sort", "es.typed-array.subarray", "es.typed-array.to-locale-string", "es.typed-array.to-string", "es.object.to-string", "es.array.iterator", "es.array-buffer.slice"];
- var TypedArrayStaticMethods = {
- from: "es.typed-array.from",
- of: "es.typed-array.of"
- };
- var PromiseDependencies$1 = ["es.promise", "es.object.to-string"];
- var PromiseDependenciesWithIterators = [].concat(PromiseDependencies$1, CommonIterators$1);
- var SymbolDependencies = ["es.symbol", "es.symbol.description", "es.object.to-string"];
- var MapDependencies = ["es.map", "esnext.map.delete-all", "esnext.map.every", "esnext.map.filter", "esnext.map.find", "esnext.map.find-key", "esnext.map.includes", "esnext.map.key-of", "esnext.map.map-keys", "esnext.map.map-values", "esnext.map.merge", "esnext.map.reduce", "esnext.map.some", "esnext.map.update"].concat(CommonIteratorsWithTag);
- var SetDependencies = ["es.set", "esnext.set.add-all", "esnext.set.delete-all", "esnext.set.difference", "esnext.set.every", "esnext.set.filter", "esnext.set.find", "esnext.set.intersection", "esnext.set.is-disjoint-from", "esnext.set.is-subset-of", "esnext.set.is-superset-of", "esnext.set.join", "esnext.set.map", "esnext.set.reduce", "esnext.set.some", "esnext.set.symmetric-difference", "esnext.set.union"].concat(CommonIteratorsWithTag);
- var WeakMapDependencies = ["es.weak-map", "esnext.weak-map.delete-all"].concat(CommonIteratorsWithTag);
- var WeakSetDependencies = ["es.weak-set", "esnext.weak-set.add-all", "esnext.weak-set.delete-all"].concat(CommonIteratorsWithTag);
- var URLSearchParamsDependencies = ["web.url"].concat(CommonIteratorsWithTag);
- var BuiltIns$1 = {
- AggregateError: ["esnext.aggregate-error"].concat(CommonIterators$1),
- ArrayBuffer: ["es.array-buffer.constructor", "es.array-buffer.slice", "es.object.to-string"],
- DataView: ["es.data-view", "es.array-buffer.slice", "es.object.to-string"],
- Date: ["es.date.to-string"],
- Float32Array: ["es.typed-array.float32-array"].concat(TypedArrayDependencies),
- Float64Array: ["es.typed-array.float64-array"].concat(TypedArrayDependencies),
- Int8Array: ["es.typed-array.int8-array"].concat(TypedArrayDependencies),
- Int16Array: ["es.typed-array.int16-array"].concat(TypedArrayDependencies),
- Int32Array: ["es.typed-array.int32-array"].concat(TypedArrayDependencies),
- Uint8Array: ["es.typed-array.uint8-array"].concat(TypedArrayDependencies),
- Uint8ClampedArray: ["es.typed-array.uint8-clamped-array"].concat(TypedArrayDependencies),
- Uint16Array: ["es.typed-array.uint16-array"].concat(TypedArrayDependencies),
- Uint32Array: ["es.typed-array.uint32-array"].concat(TypedArrayDependencies),
- Map: MapDependencies,
- Number: ["es.number.constructor"],
- Observable: ["esnext.observable", "esnext.symbol.observable", "es.object.to-string"].concat(CommonIteratorsWithTag),
- Promise: PromiseDependencies$1,
- RegExp: ["es.regexp.constructor", "es.regexp.exec", "es.regexp.to-string"],
- Set: SetDependencies,
- Symbol: SymbolDependencies,
- URL: ["web.url"].concat(URLSearchParamsDependencies),
- URLSearchParams: URLSearchParamsDependencies,
- WeakMap: WeakMapDependencies,
- WeakSet: WeakSetDependencies,
- clearImmediate: ["web.immediate"],
- compositeKey: ["esnext.composite-key"],
- compositeSymbol: ["esnext.composite-symbol"].concat(SymbolDependencies),
- fetch: PromiseDependencies$1,
- globalThis: ["esnext.global-this"],
- parseFloat: ["es.parse-float"],
- parseInt: ["es.parse-int"],
- queueMicrotask: ["web.queue-microtask"],
- setTimeout: ["web.timers"],
- setInterval: ["web.timers"],
- setImmediate: ["web.immediate"]
- };
- var InstanceProperties$1 = {
- at: ["esnext.string.at"],
- anchor: ["es.string.anchor"],
- big: ["es.string.big"],
- bind: ["es.function.bind"],
- blink: ["es.string.blink"],
- bold: ["es.string.bold"],
- codePointAt: ["es.string.code-point-at"],
- codePoints: ["esnext.string.code-points"],
- concat: ["es.array.concat"],
- copyWithin: ["es.array.copy-within"],
- description: ["es.symbol", "es.symbol.description"],
- endsWith: ["es.string.ends-with"],
- entries: ArrayNatureIteratorsWithTag,
- every: ["es.array.every"],
- exec: ["es.regexp.exec"],
- fill: ["es.array.fill"],
- filter: ["es.array.filter"],
- "finally": ["es.promise.finally"].concat(PromiseDependencies$1),
- find: ["es.array.find"],
- findIndex: ["es.array.find-index"],
- fixed: ["es.string.fixed"],
- flags: ["es.regexp.flags"],
- flat: ["es.array.flat", "es.array.unscopables.flat"],
- flatMap: ["es.array.flat-map", "es.array.unscopables.flat-map"],
- fontcolor: ["es.string.fontcolor"],
- fontsize: ["es.string.fontsize"],
- forEach: ["es.array.for-each", "web.dom-collections.for-each"],
- includes: ["es.array.includes", "es.string.includes"],
- indexOf: ["es.array.index-of"],
- italics: ["es.string.italics"],
- join: ["es.array.join"],
- keys: ArrayNatureIteratorsWithTag,
- lastIndex: ["esnext.array.last-index"],
- lastIndexOf: ["es.array.last-index-of"],
- lastItem: ["esnext.array.last-item"],
- link: ["es.string.link"],
- match: ["es.string.match", "es.regexp.exec"],
- matchAll: ["esnext.string.match-all"],
- map: ["es.array.map"],
- name: ["es.function.name"],
- padEnd: ["es.string.pad-end"],
- padStart: ["es.string.pad-start"],
- reduce: ["es.array.reduce"],
- reduceRight: ["es.array.reduce-right"],
- repeat: ["es.string.repeat"],
- replace: ["es.string.replace", "es.regexp.exec"],
- replaceAll: ["esnext.string.replace-all"],
- reverse: ["es.array.reverse"],
- search: ["es.string.search", "es.regexp.exec"],
- slice: ["es.array.slice"],
- small: ["es.string.small"],
- some: ["es.array.some"],
- sort: ["es.array.sort"],
- splice: ["es.array.splice"],
- split: ["es.string.split", "es.regexp.exec"],
- startsWith: ["es.string.starts-with"],
- strike: ["es.string.strike"],
- sub: ["es.string.sub"],
- sup: ["es.string.sup"],
- toFixed: ["es.number.to-fixed"],
- toISOString: ["es.date.to-iso-string"],
- toJSON: ["es.date.to-json", "web.url.to-json"],
- toPrecision: ["es.number.to-precision"],
- toString: ["es.object.to-string", "es.regexp.to-string", "es.date.to-string"],
- trim: ["es.string.trim"],
- trimEnd: ["es.string.trim-end"],
- trimLeft: ["es.string.trim-start"],
- trimRight: ["es.string.trim-end"],
- trimStart: ["es.string.trim-start"],
- values: ArrayNatureIteratorsWithTag,
- __defineGetter__: ["es.object.define-getter"],
- __defineSetter__: ["es.object.define-setter"],
- __lookupGetter__: ["es.object.lookup-getter"],
- __lookupSetter__: ["es.object.lookup-setter"]
- };
- var StaticProperties$1 = {
- Array: {
- from: ["es.array.from", "es.string.iterator"],
- isArray: ["es.array.is-array"],
- of: ["es.array.of"]
- },
- Date: {
- now: "es.date.now"
- },
- Object: {
- assign: "es.object.assign",
- create: "es.object.create",
- defineProperty: "es.object.define-property",
- defineProperties: "es.object.define-properties",
- entries: "es.object.entries",
- freeze: "es.object.freeze",
- fromEntries: ["es.object.from-entries", "es.array.iterator"],
- getOwnPropertyDescriptor: "es.object.get-own-property-descriptor",
- getOwnPropertyDescriptors: "es.object.get-own-property-descriptors",
- getOwnPropertyNames: "es.object.get-own-property-names",
- getOwnPropertySymbols: "es.symbol",
- getPrototypeOf: "es.object.get-prototype-of",
- is: "es.object.is",
- isExtensible: "es.object.is-extensible",
- isFrozen: "es.object.is-frozen",
- isSealed: "es.object.is-sealed",
- keys: "es.object.keys",
- preventExtensions: "es.object.prevent-extensions",
- seal: "es.object.seal",
- setPrototypeOf: "es.object.set-prototype-of",
- values: "es.object.values"
- },
- Math: {
- DEG_PER_RAD: "esnext.math.deg-per-rad",
- RAD_PER_DEG: "esnext.math.rad-per-deg",
- acosh: "es.math.acosh",
- asinh: "es.math.asinh",
- atanh: "es.math.atanh",
- cbrt: "es.math.cbrt",
- clamp: "esnext.math.clamp",
- clz32: "es.math.clz32",
- cosh: "es.math.cosh",
- degrees: "esnext.math.degrees",
- expm1: "es.math.expm1",
- fround: "es.math.fround",
- fscale: "esnext.math.fscale",
- hypot: "es.math.hypot",
- iaddh: "esnext.math.iaddh",
- imul: "es.math.imul",
- imulh: "esnext.math.imulh",
- isubh: "esnext.math.isubh",
- log1p: "es.math.log1p",
- log10: "es.math.log10",
- log2: "es.math.log2",
- radians: "esnext.math.radians",
- scale: "esnext.math.scale",
- seededPRNG: "esnext.math.seeded-prng",
- sign: "es.math.sign",
- signbit: "esnext.math.signbit",
- sinh: "es.math.sinh",
- tanh: "es.math.tanh",
- trunc: "es.math.trunc",
- umulh: "esnext.math.umulh"
- },
- String: {
- fromCodePoint: "es.string.from-code-point",
- raw: "es.string.raw"
- },
- Number: {
- EPSILON: "es.number.epsilon",
- MIN_SAFE_INTEGER: "es.number.min-safe-integer",
- MAX_SAFE_INTEGER: "es.number.max-safe-integer",
- fromString: "esnext.number.from-string",
- isFinite: "es.number.is-finite",
- isInteger: "es.number.is-integer",
- isSafeInteger: "es.number.is-safe-integer",
- isNaN: "es.number.is-nan",
- parseFloat: "es.number.parse-float",
- parseInt: "es.number.parse-int"
- },
- Map: {
- from: ["esnext.map.from"].concat(MapDependencies),
- groupBy: ["esnext.map.group-by"].concat(MapDependencies),
- keyBy: ["esnext.map.key-by"].concat(MapDependencies),
- of: ["esnext.map.of"].concat(MapDependencies)
- },
- Set: {
- from: ["esnext.set.from"].concat(SetDependencies),
- of: ["esnext.set.of"].concat(SetDependencies)
- },
- WeakMap: {
- from: ["esnext.weak-map.from"].concat(WeakMapDependencies),
- of: ["esnext.weak-map.of"].concat(WeakMapDependencies)
- },
- WeakSet: {
- from: ["esnext.weak-set.from"].concat(WeakSetDependencies),
- of: ["esnext.weak-set.of"].concat(WeakSetDependencies)
- },
- Promise: {
- all: PromiseDependenciesWithIterators,
- allSettled: ["esnext.promise.all-settled"].concat(PromiseDependenciesWithIterators),
- any: ["esnext.promise.any", "esnext.aggregate-error"].concat(PromiseDependenciesWithIterators),
- race: PromiseDependenciesWithIterators,
- "try": ["esnext.promise.try"].concat(PromiseDependenciesWithIterators)
- },
- Reflect: {
- apply: "es.reflect.apply",
- construct: "es.reflect.construct",
- defineMetadata: "esnext.reflect.define-metadata",
- defineProperty: "es.reflect.define-property",
- deleteMetadata: "esnext.reflect.delete-metadata",
- deleteProperty: "es.reflect.delete-property",
- get: "es.reflect.get",
- getMetadata: "esnext.reflect.get-metadata",
- getMetadataKeys: "esnext.reflect.get-metadata-keys",
- getOwnMetadata: "esnext.reflect.get-own-metadata",
- getOwnMetadataKeys: "esnext.reflect.get-own-metadata-keys",
- getOwnPropertyDescriptor: "es.reflect.get-own-property-descriptor",
- getPrototypeOf: "es.reflect.get-prototype-of",
- has: "es.reflect.has",
- hasMetadata: "esnext.reflect.has-metadata",
- hasOwnMetadata: "esnext.reflect.has-own-metadata",
- isExtensible: "es.reflect.is-extensible",
- metadata: "esnext.reflect.metadata",
- ownKeys: "es.reflect.own-keys",
- preventExtensions: "es.reflect.prevent-extensions",
- set: "es.reflect.set",
- setPrototypeOf: "es.reflect.set-prototype-of"
- },
- Symbol: {
- asyncIterator: ["es.symbol.async-iterator"],
- dispose: ["esnext.symbol.dispose"],
- hasInstance: ["es.symbol.has-instance", "es.function.has-instance"],
- isConcatSpreadable: ["es.symbol.is-concat-spreadable", "es.array.concat"],
- iterator: ["es.symbol.iterator"].concat(CommonIteratorsWithTag),
- match: ["es.symbol.match", "es.string.match"],
- observable: ["esnext.symbol.observable"],
- patternMatch: ["esnext.symbol.pattern-match"],
- replace: ["es.symbol.replace", "es.string.replace"],
- search: ["es.symbol.search", "es.string.search"],
- species: ["es.symbol.species", "es.array.species"],
- split: ["es.symbol.split", "es.string.split"],
- toPrimitive: ["es.symbol.to-primitive", "es.date.to-primitive"],
- toStringTag: ["es.symbol.to-string-tag", "es.object.to-string", "es.math.to-string-tag", "es.json.to-string-tag"],
- unscopables: ["es.symbol.unscopables"]
- },
- ArrayBuffer: {
- isView: ["es.array-buffer.is-view"]
- },
- Int8Array: TypedArrayStaticMethods,
- Uint8Array: TypedArrayStaticMethods,
- Uint8ClampedArray: TypedArrayStaticMethods,
- Int16Array: TypedArrayStaticMethods,
- Uint16Array: TypedArrayStaticMethods,
- Int32Array: TypedArrayStaticMethods,
- Uint32Array: TypedArrayStaticMethods,
- Float32Array: TypedArrayStaticMethods,
- Float64Array: TypedArrayStaticMethods
- };
- var CommonInstanceDependencies = new Set(["es.object.to-string", "es.object.define-getter", "es.object.define-setter", "es.object.lookup-getter", "es.object.lookup-setter", "es.regexp.exec"]);
- var PossibleGlobalObjects = new Set(["global", "globalThis", "self", "window"]);
- var NO_DIRECT_POLYFILL_IMPORT$1 = "\n When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed.\n Please remove the direct import of `core-js` or use `useBuiltIns: 'entry'` instead.";
- var corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills).filter(function (name) {
- return !name.startsWith("esnext.");
- }).reduce(function (memo, key) {
- memo[key] = corejs3Polyfills[key];
- return memo;
- }, {});
- var corejs3PolyfillsWithShippedProposals = corejs3ShippedProposalsList.reduce(function (memo, key) {
- memo[key] = corejs3Polyfills[key];
- return memo;
- }, Object.assign({}, corejs3PolyfillsWithoutProposals));
- function addCoreJS3UsagePlugin (_, _ref) {
- var corejs = _ref.corejs,
- include = _ref.include,
- exclude = _ref.exclude,
- polyfillTargets = _ref.polyfillTargets,
- proposals = _ref.proposals,
- shippedProposals = _ref.shippedProposals,
- debug = _ref.debug;
- var polyfills = filterItems(proposals ? corejs3Polyfills : shippedProposals ? corejs3PolyfillsWithShippedProposals : corejs3PolyfillsWithoutProposals, include, exclude, polyfillTargets, null);
- var available = new Set(getModulesListForTargetVersion(corejs.version));
- function resolveKey(path, computed) {
- var node = path.node,
- parent = path.parent,
- scope = path.scope;
- if (path.isStringLiteral()) return node.value;
- var name = node.name;
- var isIdentifier = path.isIdentifier();
- if (isIdentifier && !(computed || parent.computed)) return name;
- if (!isIdentifier || scope.getBindingIdentifier(name)) {
- var _path$evaluate = path.evaluate(),
- value = _path$evaluate.value;
- if (typeof value === "string") return value;
- }
- }
- function resolveSource(path) {
- var node = path.node,
- scope = path.scope;
- var builtIn, instanceType;
- if (node) {
- builtIn = node.name;
- if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {
- var _path$evaluate2 = path.evaluate(),
- deopt = _path$evaluate2.deopt,
- value = _path$evaluate2.value;
- if (value !== undefined) {
- instanceType = getType$1(value);
- } else if (deopt && deopt.isIdentifier()) {
- builtIn = deopt.node.name;
- }
- }
- }
- return {
- builtIn: builtIn,
- instanceType: instanceType,
- isNamespaced: isNamespaced(path)
- };
- }
- var addAndRemovePolyfillImports = {
- ImportDeclaration: function ImportDeclaration(path) {
- if (isPolyfillSource(getImportSource(path))) {
- console.warn(NO_DIRECT_POLYFILL_IMPORT$1);
- path.remove();
- }
- },
- Program: {
- enter: function enter(path) {
- path.get("body").forEach(function (bodyPath) {
- if (isPolyfillSource(getRequireSource(bodyPath))) {
- console.warn(NO_DIRECT_POLYFILL_IMPORT$1);
- bodyPath.remove();
- }
- });
- },
- exit: function exit(path) {
- var _this = this;
- var filtered = intersection(polyfills, this.polyfillsSet, available);
- var reversed = Array.from(filtered).reverse();
- for (var _iterator = reversed, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var module = _ref2;
- if (!this.injectedPolyfills.has(module)) {
- createImport(path, module);
- }
- }
- filtered.forEach(function (module) {
- return _this.injectedPolyfills.add(module);
- });
- }
- },
- Import: function Import() {
- this.addUnsupported(PromiseDependencies$1);
- },
- Function: function Function(_ref3) {
- var node = _ref3.node;
- if (node.async) {
- this.addUnsupported(PromiseDependencies$1);
- }
- },
- "ForOfStatement|ArrayPattern": function ForOfStatementArrayPattern() {
- this.addUnsupported(CommonIterators$1);
- },
- SpreadElement: function SpreadElement(_ref4) {
- var parentPath = _ref4.parentPath;
- if (!parentPath.isObjectExpression()) {
- this.addUnsupported(CommonIterators$1);
- }
- },
- YieldExpression: function YieldExpression(_ref5) {
- var node = _ref5.node;
- if (node.delegate) {
- this.addUnsupported(CommonIterators$1);
- }
- },
- ReferencedIdentifier: function ReferencedIdentifier(_ref6) {
- var name = _ref6.node.name,
- scope = _ref6.scope;
- if (scope.getBindingIdentifier(name)) return;
- this.addBuiltInDependencies(name);
- },
- MemberExpression: function MemberExpression(path) {
- var source = resolveSource(path.get("object"));
- var key = resolveKey(path.get("property"));
- this.addPropertyDependencies(source, key);
- },
- ObjectPattern: function ObjectPattern(path) {
- var parentPath = path.parentPath,
- parent = path.parent,
- key = path.key;
- var source;
- if (parentPath.isVariableDeclarator()) {
- source = resolveSource(parentPath.get("init"));
- } else if (parentPath.isAssignmentExpression()) {
- source = resolveSource(parentPath.get("right"));
- } else if (parentPath.isFunctionExpression()) {
- var grand = parentPath.parentPath;
- if (grand.isCallExpression() || grand.isNewExpression()) {
- if (grand.node.callee === parent) {
- source = resolveSource(grand.get("arguments")[key]);
- }
- }
- }
- for (var _iterator2 = path.get("properties"), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref7;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref7 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref7 = _i2.value;
- }
- var property = _ref7;
- if (property.isObjectProperty()) {
- var _key = resolveKey(property.get("key"));
- this.addPropertyDependencies(source, _key);
- }
- }
- },
- BinaryExpression: function BinaryExpression(path) {
- if (path.node.operator !== "in") return;
- var source = resolveSource(path.get("right"));
- var key = resolveKey(path.get("left"), true);
- this.addPropertyDependencies(source, key);
- }
- };
- return {
- name: "corejs3-usage",
- pre: function pre() {
- this.injectedPolyfills = new Set();
- this.polyfillsSet = new Set();
- this.addUnsupported = function (builtIn) {
- var modules = Array.isArray(builtIn) ? builtIn : [builtIn];
- for (var _iterator3 = modules, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref8;
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref8 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref8 = _i3.value;
- }
- var module = _ref8;
- this.polyfillsSet.add(module);
- }
- };
- this.addBuiltInDependencies = function (builtIn) {
- if (has$6(BuiltIns$1, builtIn)) {
- var BuiltInDependencies = BuiltIns$1[builtIn];
- this.addUnsupported(BuiltInDependencies);
- }
- };
- this.addPropertyDependencies = function (source, key) {
- if (source === void 0) {
- source = {};
- }
- var _source = source,
- builtIn = _source.builtIn,
- instanceType = _source.instanceType,
- isNamespaced = _source.isNamespaced;
- if (isNamespaced) return;
- if (PossibleGlobalObjects.has(builtIn)) {
- this.addBuiltInDependencies(key);
- } else if (has$6(StaticProperties$1, builtIn)) {
- var BuiltInProperties = StaticProperties$1[builtIn];
- if (has$6(BuiltInProperties, key)) {
- var StaticPropertyDependencies = BuiltInProperties[key];
- return this.addUnsupported(StaticPropertyDependencies);
- }
- }
- if (!has$6(InstanceProperties$1, key)) return;
- var InstancePropertyDependencies = InstanceProperties$1[key];
- if (instanceType) {
- InstancePropertyDependencies = InstancePropertyDependencies.filter(function (m) {
- return m.includes(instanceType) || CommonInstanceDependencies.has(m);
- });
- }
- this.addUnsupported(InstancePropertyDependencies);
- };
- },
- post: function post() {
- if (debug) {
- logUsagePolyfills(this.injectedPolyfills, this.file.opts.filename, polyfillTargets, corejs3Polyfills);
- }
- },
- visitor: addAndRemovePolyfillImports
- };
- }
- function addRegeneratorUsagePlugin () {
- return {
- name: "regenerator-usage",
- pre: function pre() {
- this.usesRegenerator = false;
- },
- visitor: {
- Function: function Function(path) {
- var node = path.node;
- if (!this.usesRegenerator && (node.generator || node.async)) {
- this.usesRegenerator = true;
- createImport(path, "regenerator-runtime");
- }
- }
- },
- post: function post() {
- if (this.opts.debug && this.usesRegenerator) {
- var filename = this.file.opts.filename;
- if (process.env.BABEL_ENV === "test") {
- filename = filename.replace(/\\/g, "/");
- }
- console.log("\n[" + filename + "] Based on your code and targets, added regenerator-runtime.");
- }
- }
- };
- }
- function replaceCoreJS2EntryPlugin (_, _ref) {
- var include = _ref.include,
- exclude = _ref.exclude,
- polyfillTargets = _ref.polyfillTargets,
- regenerator = _ref.regenerator,
- debug = _ref.debug;
- var polyfills = filterItems(corejs2BuiltIns$2, include, exclude, polyfillTargets, getPlatformSpecificDefaultFor(polyfillTargets));
- var isPolyfillImport = {
- ImportDeclaration: function ImportDeclaration(path) {
- if (isPolyfillSource(getImportSource(path))) {
- this.replaceBySeparateModulesImport(path);
- }
- },
- Program: function Program(path) {
- var _this = this;
- path.get("body").forEach(function (bodyPath) {
- if (isPolyfillSource(getRequireSource(bodyPath))) {
- _this.replaceBySeparateModulesImport(bodyPath);
- }
- });
- }
- };
- return {
- name: "corejs2-entry",
- visitor: isPolyfillImport,
- pre: function pre() {
- this.importPolyfillIncluded = false;
- this.replaceBySeparateModulesImport = function (path) {
- this.importPolyfillIncluded = true;
- if (regenerator) {
- createImport(path, "regenerator-runtime");
- }
- var modules = Array.from(polyfills).reverse();
- for (var _iterator = modules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var module = _ref2;
- createImport(path, module);
- }
- path.remove();
- };
- },
- post: function post() {
- if (debug) {
- logEntryPolyfills("@babel/polyfill", this.importPolyfillIncluded, polyfills, this.file.opts.filename, polyfillTargets, corejs2BuiltIns$2);
- }
- }
- };
- }
- var corejsEntries = {
- "core-js": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.global-this",
- "es.json.stringify",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set",
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/es": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.global-this",
- "es.json.stringify",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set"
- ],
- "core-js/es/array": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.string.iterator"
- ],
- "core-js/es/array-buffer": [
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.object.to-string"
- ],
- "core-js/es/array-buffer/constructor": [
- "es.array-buffer.constructor",
- "es.object.to-string"
- ],
- "core-js/es/array-buffer/is-view": [
- "es.array-buffer.is-view"
- ],
- "core-js/es/array-buffer/slice": [
- "es.array-buffer.slice"
- ],
- "core-js/es/array/concat": [
- "es.array.concat"
- ],
- "core-js/es/array/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/es/array/entries": [
- "es.array.iterator"
- ],
- "core-js/es/array/every": [
- "es.array.every"
- ],
- "core-js/es/array/fill": [
- "es.array.fill"
- ],
- "core-js/es/array/filter": [
- "es.array.filter"
- ],
- "core-js/es/array/find": [
- "es.array.find"
- ],
- "core-js/es/array/find-index": [
- "es.array.find-index"
- ],
- "core-js/es/array/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/es/array/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/es/array/for-each": [
- "es.array.for-each"
- ],
- "core-js/es/array/from": [
- "es.array.from",
- "es.string.iterator"
- ],
- "core-js/es/array/includes": [
- "es.array.includes"
- ],
- "core-js/es/array/index-of": [
- "es.array.index-of"
- ],
- "core-js/es/array/is-array": [
- "es.array.is-array"
- ],
- "core-js/es/array/iterator": [
- "es.array.iterator"
- ],
- "core-js/es/array/join": [
- "es.array.join"
- ],
- "core-js/es/array/keys": [
- "es.array.iterator"
- ],
- "core-js/es/array/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/es/array/map": [
- "es.array.map"
- ],
- "core-js/es/array/of": [
- "es.array.of"
- ],
- "core-js/es/array/reduce": [
- "es.array.reduce"
- ],
- "core-js/es/array/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/es/array/reverse": [
- "es.array.reverse"
- ],
- "core-js/es/array/slice": [
- "es.array.slice"
- ],
- "core-js/es/array/some": [
- "es.array.some"
- ],
- "core-js/es/array/sort": [
- "es.array.sort"
- ],
- "core-js/es/array/splice": [
- "es.array.splice"
- ],
- "core-js/es/array/values": [
- "es.array.iterator"
- ],
- "core-js/es/array/virtual": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.includes",
- "es.array.index-of",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map"
- ],
- "core-js/es/array/virtual/concat": [
- "es.array.concat"
- ],
- "core-js/es/array/virtual/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/es/array/virtual/entries": [
- "es.array.iterator"
- ],
- "core-js/es/array/virtual/every": [
- "es.array.every"
- ],
- "core-js/es/array/virtual/fill": [
- "es.array.fill"
- ],
- "core-js/es/array/virtual/filter": [
- "es.array.filter"
- ],
- "core-js/es/array/virtual/find": [
- "es.array.find"
- ],
- "core-js/es/array/virtual/find-index": [
- "es.array.find-index"
- ],
- "core-js/es/array/virtual/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/es/array/virtual/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/es/array/virtual/for-each": [
- "es.array.for-each"
- ],
- "core-js/es/array/virtual/includes": [
- "es.array.includes"
- ],
- "core-js/es/array/virtual/index-of": [
- "es.array.index-of"
- ],
- "core-js/es/array/virtual/iterator": [
- "es.array.iterator"
- ],
- "core-js/es/array/virtual/join": [
- "es.array.join"
- ],
- "core-js/es/array/virtual/keys": [
- "es.array.iterator"
- ],
- "core-js/es/array/virtual/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/es/array/virtual/map": [
- "es.array.map"
- ],
- "core-js/es/array/virtual/reduce": [
- "es.array.reduce"
- ],
- "core-js/es/array/virtual/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/es/array/virtual/reverse": [
- "es.array.reverse"
- ],
- "core-js/es/array/virtual/slice": [
- "es.array.slice"
- ],
- "core-js/es/array/virtual/some": [
- "es.array.some"
- ],
- "core-js/es/array/virtual/sort": [
- "es.array.sort"
- ],
- "core-js/es/array/virtual/splice": [
- "es.array.splice"
- ],
- "core-js/es/array/virtual/values": [
- "es.array.iterator"
- ],
- "core-js/es/data-view": [
- "es.data-view",
- "es.object.to-string"
- ],
- "core-js/es/date": [
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string"
- ],
- "core-js/es/date/now": [
- "es.date.now"
- ],
- "core-js/es/date/to-iso-string": [
- "es.date.to-iso-string",
- "es.date.to-json"
- ],
- "core-js/es/date/to-json": [
- "es.date.to-json"
- ],
- "core-js/es/date/to-primitive": [
- "es.date.to-primitive"
- ],
- "core-js/es/date/to-string": [
- "es.date.to-string"
- ],
- "core-js/es/function": [
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name"
- ],
- "core-js/es/function/bind": [
- "es.function.bind"
- ],
- "core-js/es/function/has-instance": [
- "es.function.has-instance"
- ],
- "core-js/es/function/name": [
- "es.function.name"
- ],
- "core-js/es/function/virtual": [
- "es.function.bind"
- ],
- "core-js/es/function/virtual/bind": [
- "es.function.bind"
- ],
- "core-js/es/global-this": [
- "es.global-this"
- ],
- "core-js/es/instance/bind": [
- "es.function.bind"
- ],
- "core-js/es/instance/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/es/instance/concat": [
- "es.array.concat"
- ],
- "core-js/es/instance/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/es/instance/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/es/instance/entries": [
- "es.array.iterator"
- ],
- "core-js/es/instance/every": [
- "es.array.every"
- ],
- "core-js/es/instance/fill": [
- "es.array.fill"
- ],
- "core-js/es/instance/filter": [
- "es.array.filter"
- ],
- "core-js/es/instance/find": [
- "es.array.find"
- ],
- "core-js/es/instance/find-index": [
- "es.array.find-index"
- ],
- "core-js/es/instance/flags": [
- "es.regexp.flags"
- ],
- "core-js/es/instance/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/es/instance/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/es/instance/for-each": [
- "es.array.for-each"
- ],
- "core-js/es/instance/includes": [
- "es.array.includes",
- "es.string.includes"
- ],
- "core-js/es/instance/index-of": [
- "es.array.index-of"
- ],
- "core-js/es/instance/keys": [
- "es.array.iterator"
- ],
- "core-js/es/instance/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/es/instance/map": [
- "es.array.map"
- ],
- "core-js/es/instance/match-all": [
- "es.string.match-all"
- ],
- "core-js/es/instance/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/es/instance/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/es/instance/reduce": [
- "es.array.reduce"
- ],
- "core-js/es/instance/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/es/instance/repeat": [
- "es.string.repeat"
- ],
- "core-js/es/instance/reverse": [
- "es.array.reverse"
- ],
- "core-js/es/instance/slice": [
- "es.array.slice"
- ],
- "core-js/es/instance/some": [
- "es.array.some"
- ],
- "core-js/es/instance/sort": [
- "es.array.sort"
- ],
- "core-js/es/instance/splice": [
- "es.array.splice"
- ],
- "core-js/es/instance/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/es/instance/trim": [
- "es.string.trim"
- ],
- "core-js/es/instance/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/es/instance/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/es/instance/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/es/instance/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/es/instance/values": [
- "es.array.iterator"
- ],
- "core-js/es/json": [
- "es.json.stringify",
- "es.json.to-string-tag"
- ],
- "core-js/es/json/stringify": [
- "es.json.stringify"
- ],
- "core-js/es/json/to-string-tag": [
- "es.json.to-string-tag"
- ],
- "core-js/es/map": [
- "es.map",
- "es.object.to-string",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/es/math": [
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc"
- ],
- "core-js/es/math/acosh": [
- "es.math.acosh"
- ],
- "core-js/es/math/asinh": [
- "es.math.asinh"
- ],
- "core-js/es/math/atanh": [
- "es.math.atanh"
- ],
- "core-js/es/math/cbrt": [
- "es.math.cbrt"
- ],
- "core-js/es/math/clz32": [
- "es.math.clz32"
- ],
- "core-js/es/math/cosh": [
- "es.math.cosh"
- ],
- "core-js/es/math/expm1": [
- "es.math.expm1"
- ],
- "core-js/es/math/fround": [
- "es.math.fround"
- ],
- "core-js/es/math/hypot": [
- "es.math.hypot"
- ],
- "core-js/es/math/imul": [
- "es.math.imul"
- ],
- "core-js/es/math/log10": [
- "es.math.log10"
- ],
- "core-js/es/math/log1p": [
- "es.math.log1p"
- ],
- "core-js/es/math/log2": [
- "es.math.log2"
- ],
- "core-js/es/math/sign": [
- "es.math.sign"
- ],
- "core-js/es/math/sinh": [
- "es.math.sinh"
- ],
- "core-js/es/math/tanh": [
- "es.math.tanh"
- ],
- "core-js/es/math/to-string-tag": [
- "es.math.to-string-tag"
- ],
- "core-js/es/math/trunc": [
- "es.math.trunc"
- ],
- "core-js/es/number": [
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision"
- ],
- "core-js/es/number/constructor": [
- "es.number.constructor"
- ],
- "core-js/es/number/epsilon": [
- "es.number.epsilon"
- ],
- "core-js/es/number/is-finite": [
- "es.number.is-finite"
- ],
- "core-js/es/number/is-integer": [
- "es.number.is-integer"
- ],
- "core-js/es/number/is-nan": [
- "es.number.is-nan"
- ],
- "core-js/es/number/is-safe-integer": [
- "es.number.is-safe-integer"
- ],
- "core-js/es/number/max-safe-integer": [
- "es.number.max-safe-integer"
- ],
- "core-js/es/number/min-safe-integer": [
- "es.number.min-safe-integer"
- ],
- "core-js/es/number/parse-float": [
- "es.number.parse-float"
- ],
- "core-js/es/number/parse-int": [
- "es.number.parse-int"
- ],
- "core-js/es/number/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/es/number/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/es/number/virtual": [
- "es.number.to-fixed",
- "es.number.to-precision"
- ],
- "core-js/es/number/virtual/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/es/number/virtual/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/es/object": [
- "es.symbol",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values"
- ],
- "core-js/es/object/assign": [
- "es.object.assign"
- ],
- "core-js/es/object/create": [
- "es.object.create"
- ],
- "core-js/es/object/define-getter": [
- "es.object.define-getter"
- ],
- "core-js/es/object/define-properties": [
- "es.object.define-properties"
- ],
- "core-js/es/object/define-property": [
- "es.object.define-property"
- ],
- "core-js/es/object/define-setter": [
- "es.object.define-setter"
- ],
- "core-js/es/object/entries": [
- "es.object.entries"
- ],
- "core-js/es/object/freeze": [
- "es.object.freeze"
- ],
- "core-js/es/object/from-entries": [
- "es.array.iterator",
- "es.object.from-entries"
- ],
- "core-js/es/object/get-own-property-descriptor": [
- "es.object.get-own-property-descriptor"
- ],
- "core-js/es/object/get-own-property-descriptors": [
- "es.object.get-own-property-descriptors"
- ],
- "core-js/es/object/get-own-property-names": [
- "es.object.get-own-property-names"
- ],
- "core-js/es/object/get-own-property-symbols": [
- "es.symbol"
- ],
- "core-js/es/object/get-prototype-of": [
- "es.object.get-prototype-of"
- ],
- "core-js/es/object/is": [
- "es.object.is"
- ],
- "core-js/es/object/is-extensible": [
- "es.object.is-extensible"
- ],
- "core-js/es/object/is-frozen": [
- "es.object.is-frozen"
- ],
- "core-js/es/object/is-sealed": [
- "es.object.is-sealed"
- ],
- "core-js/es/object/keys": [
- "es.object.keys"
- ],
- "core-js/es/object/lookup-getter": [
- "es.object.lookup-setter"
- ],
- "core-js/es/object/lookup-setter": [
- "es.object.lookup-setter"
- ],
- "core-js/es/object/prevent-extensions": [
- "es.object.prevent-extensions"
- ],
- "core-js/es/object/seal": [
- "es.object.seal"
- ],
- "core-js/es/object/set-prototype-of": [
- "es.object.set-prototype-of"
- ],
- "core-js/es/object/to-string": [
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/es/object/values": [
- "es.object.values"
- ],
- "core-js/es/parse-float": [
- "es.parse-float"
- ],
- "core-js/es/parse-int": [
- "es.parse-int"
- ],
- "core-js/es/promise": [
- "es.object.to-string",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/es/promise/all-settled": [
- "es.promise",
- "es.promise.all-settled"
- ],
- "core-js/es/promise/finally": [
- "es.promise",
- "es.promise.finally"
- ],
- "core-js/es/reflect": [
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of"
- ],
- "core-js/es/reflect/apply": [
- "es.reflect.apply"
- ],
- "core-js/es/reflect/construct": [
- "es.reflect.construct"
- ],
- "core-js/es/reflect/define-property": [
- "es.reflect.define-property"
- ],
- "core-js/es/reflect/delete-property": [
- "es.reflect.delete-property"
- ],
- "core-js/es/reflect/get": [
- "es.reflect.get"
- ],
- "core-js/es/reflect/get-own-property-descriptor": [
- "es.reflect.get-own-property-descriptor"
- ],
- "core-js/es/reflect/get-prototype-of": [
- "es.reflect.get-prototype-of"
- ],
- "core-js/es/reflect/has": [
- "es.reflect.has"
- ],
- "core-js/es/reflect/is-extensible": [
- "es.reflect.is-extensible"
- ],
- "core-js/es/reflect/own-keys": [
- "es.reflect.own-keys"
- ],
- "core-js/es/reflect/prevent-extensions": [
- "es.reflect.prevent-extensions"
- ],
- "core-js/es/reflect/set": [
- "es.reflect.set"
- ],
- "core-js/es/reflect/set-prototype-of": [
- "es.reflect.set-prototype-of"
- ],
- "core-js/es/regexp": [
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.string.match",
- "es.string.replace",
- "es.string.search",
- "es.string.split"
- ],
- "core-js/es/regexp/constructor": [
- "es.regexp.constructor"
- ],
- "core-js/es/regexp/flags": [
- "es.regexp.flags"
- ],
- "core-js/es/regexp/match": [
- "es.string.match"
- ],
- "core-js/es/regexp/replace": [
- "es.string.replace"
- ],
- "core-js/es/regexp/search": [
- "es.string.search"
- ],
- "core-js/es/regexp/split": [
- "es.string.split"
- ],
- "core-js/es/regexp/sticky": [
- "es.regexp.sticky"
- ],
- "core-js/es/regexp/test": [
- "es.regexp.exec",
- "es.regexp.test"
- ],
- "core-js/es/regexp/to-string": [
- "es.regexp.to-string"
- ],
- "core-js/es/set": [
- "es.object.to-string",
- "es.set",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/es/string": [
- "es.regexp.exec",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup"
- ],
- "core-js/es/string/anchor": [
- "es.string.anchor"
- ],
- "core-js/es/string/big": [
- "es.string.big"
- ],
- "core-js/es/string/blink": [
- "es.string.blink"
- ],
- "core-js/es/string/bold": [
- "es.string.bold"
- ],
- "core-js/es/string/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/es/string/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/es/string/fixed": [
- "es.string.fixed"
- ],
- "core-js/es/string/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/es/string/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/es/string/from-code-point": [
- "es.string.from-code-point"
- ],
- "core-js/es/string/includes": [
- "es.string.includes"
- ],
- "core-js/es/string/italics": [
- "es.string.italics"
- ],
- "core-js/es/string/iterator": [
- "es.string.iterator"
- ],
- "core-js/es/string/link": [
- "es.string.link"
- ],
- "core-js/es/string/match": [
- "es.regexp.exec",
- "es.string.match"
- ],
- "core-js/es/string/match-all": [
- "es.string.match-all"
- ],
- "core-js/es/string/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/es/string/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/es/string/raw": [
- "es.string.raw"
- ],
- "core-js/es/string/repeat": [
- "es.string.repeat"
- ],
- "core-js/es/string/replace": [
- "es.regexp.exec",
- "es.string.replace"
- ],
- "core-js/es/string/search": [
- "es.regexp.exec",
- "es.string.search"
- ],
- "core-js/es/string/small": [
- "es.string.small"
- ],
- "core-js/es/string/split": [
- "es.regexp.exec",
- "es.string.split"
- ],
- "core-js/es/string/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/es/string/strike": [
- "es.string.strike"
- ],
- "core-js/es/string/sub": [
- "es.string.sub"
- ],
- "core-js/es/string/sup": [
- "es.string.sup"
- ],
- "core-js/es/string/trim": [
- "es.string.trim"
- ],
- "core-js/es/string/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/es/string/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/es/string/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/es/string/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/es/string/virtual": [
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup"
- ],
- "core-js/es/string/virtual/anchor": [
- "es.string.anchor"
- ],
- "core-js/es/string/virtual/big": [
- "es.string.big"
- ],
- "core-js/es/string/virtual/blink": [
- "es.string.blink"
- ],
- "core-js/es/string/virtual/bold": [
- "es.string.bold"
- ],
- "core-js/es/string/virtual/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/es/string/virtual/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/es/string/virtual/fixed": [
- "es.string.fixed"
- ],
- "core-js/es/string/virtual/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/es/string/virtual/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/es/string/virtual/includes": [
- "es.string.includes"
- ],
- "core-js/es/string/virtual/italics": [
- "es.string.italics"
- ],
- "core-js/es/string/virtual/iterator": [
- "es.string.iterator"
- ],
- "core-js/es/string/virtual/link": [
- "es.string.link"
- ],
- "core-js/es/string/virtual/match-all": [
- "es.string.match-all"
- ],
- "core-js/es/string/virtual/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/es/string/virtual/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/es/string/virtual/repeat": [
- "es.string.repeat"
- ],
- "core-js/es/string/virtual/small": [
- "es.string.small"
- ],
- "core-js/es/string/virtual/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/es/string/virtual/strike": [
- "es.string.strike"
- ],
- "core-js/es/string/virtual/sub": [
- "es.string.sub"
- ],
- "core-js/es/string/virtual/sup": [
- "es.string.sup"
- ],
- "core-js/es/string/virtual/trim": [
- "es.string.trim"
- ],
- "core-js/es/string/virtual/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/es/string/virtual/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/es/string/virtual/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/es/string/virtual/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/es/symbol": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/es/symbol/async-iterator": [
- "es.symbol.async-iterator"
- ],
- "core-js/es/symbol/description": [
- "es.symbol.description"
- ],
- "core-js/es/symbol/for": [
- "es.symbol"
- ],
- "core-js/es/symbol/has-instance": [
- "es.symbol.has-instance",
- "es.function.has-instance"
- ],
- "core-js/es/symbol/is-concat-spreadable": [
- "es.symbol.is-concat-spreadable",
- "es.array.concat"
- ],
- "core-js/es/symbol/iterator": [
- "es.symbol.iterator",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/es/symbol/key-for": [
- "es.symbol"
- ],
- "core-js/es/symbol/match": [
- "es.symbol.match",
- "es.string.match"
- ],
- "core-js/es/symbol/match-all": [
- "es.symbol.match-all",
- "es.string.match-all"
- ],
- "core-js/es/symbol/replace": [
- "es.symbol.replace",
- "es.string.replace"
- ],
- "core-js/es/symbol/search": [
- "es.symbol.search",
- "es.string.search"
- ],
- "core-js/es/symbol/species": [
- "es.symbol.species"
- ],
- "core-js/es/symbol/split": [
- "es.symbol.split",
- "es.string.split"
- ],
- "core-js/es/symbol/to-primitive": [
- "es.symbol.to-primitive"
- ],
- "core-js/es/symbol/to-string-tag": [
- "es.symbol.to-string-tag",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/es/symbol/unscopables": [
- "es.symbol.unscopables"
- ],
- "core-js/es/typed-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/copy-within": [
- "es.typed-array.copy-within"
- ],
- "core-js/es/typed-array/entries": [
- "es.typed-array.iterator"
- ],
- "core-js/es/typed-array/every": [
- "es.typed-array.every"
- ],
- "core-js/es/typed-array/fill": [
- "es.typed-array.fill"
- ],
- "core-js/es/typed-array/filter": [
- "es.typed-array.filter"
- ],
- "core-js/es/typed-array/find": [
- "es.typed-array.find"
- ],
- "core-js/es/typed-array/find-index": [
- "es.typed-array.find-index"
- ],
- "core-js/es/typed-array/float32-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/float64-array": [
- "es.object.to-string",
- "es.typed-array.float64-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/for-each": [
- "es.typed-array.for-each"
- ],
- "core-js/es/typed-array/from": [
- "es.typed-array.from"
- ],
- "core-js/es/typed-array/includes": [
- "es.typed-array.includes"
- ],
- "core-js/es/typed-array/index-of": [
- "es.typed-array.index-of"
- ],
- "core-js/es/typed-array/int16-array": [
- "es.object.to-string",
- "es.typed-array.int16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/int32-array": [
- "es.object.to-string",
- "es.typed-array.int32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/int8-array": [
- "es.object.to-string",
- "es.typed-array.int8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/iterator": [
- "es.typed-array.iterator"
- ],
- "core-js/es/typed-array/join": [
- "es.typed-array.join"
- ],
- "core-js/es/typed-array/keys": [
- "es.typed-array.iterator"
- ],
- "core-js/es/typed-array/last-index-of": [
- "es.typed-array.last-index-of"
- ],
- "core-js/es/typed-array/map": [
- "es.typed-array.map"
- ],
- "core-js/es/typed-array/methods": [
- "es.object.to-string",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/of": [
- "es.typed-array.of"
- ],
- "core-js/es/typed-array/reduce": [
- "es.typed-array.reduce"
- ],
- "core-js/es/typed-array/reduce-right": [
- "es.typed-array.reduce-right"
- ],
- "core-js/es/typed-array/reverse": [
- "es.typed-array.reverse"
- ],
- "core-js/es/typed-array/set": [
- "es.typed-array.set"
- ],
- "core-js/es/typed-array/slice": [
- "es.typed-array.slice"
- ],
- "core-js/es/typed-array/some": [
- "es.typed-array.some"
- ],
- "core-js/es/typed-array/sort": [
- "es.typed-array.sort"
- ],
- "core-js/es/typed-array/subarray": [
- "es.typed-array.subarray"
- ],
- "core-js/es/typed-array/to-locale-string": [
- "es.typed-array.to-locale-string"
- ],
- "core-js/es/typed-array/to-string": [
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/uint16-array": [
- "es.object.to-string",
- "es.typed-array.uint16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/uint32-array": [
- "es.object.to-string",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/uint8-array": [
- "es.object.to-string",
- "es.typed-array.uint8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/uint8-clamped-array": [
- "es.object.to-string",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/es/typed-array/values": [
- "es.typed-array.iterator"
- ],
- "core-js/es/weak-map": [
- "es.object.to-string",
- "es.weak-map",
- "web.dom-collections.iterator"
- ],
- "core-js/es/weak-set": [
- "es.object.to-string",
- "es.weak-set",
- "web.dom-collections.iterator"
- ],
- "core-js/features": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.global-this",
- "es.json.stringify",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set",
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/features/aggregate-error": [
- "es.string.iterator",
- "esnext.aggregate-error",
- "web.dom-collections.iterator"
- ],
- "core-js/features/array": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.string.iterator",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item"
- ],
- "core-js/features/array-buffer": [
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.object.to-string"
- ],
- "core-js/features/array-buffer/constructor": [
- "es.array-buffer.constructor",
- "es.object.to-string"
- ],
- "core-js/features/array-buffer/is-view": [
- "es.array-buffer.is-view"
- ],
- "core-js/features/array-buffer/slice": [
- "es.array-buffer.slice"
- ],
- "core-js/features/array/concat": [
- "es.array.concat"
- ],
- "core-js/features/array/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/features/array/entries": [
- "es.array.iterator"
- ],
- "core-js/features/array/every": [
- "es.array.every"
- ],
- "core-js/features/array/fill": [
- "es.array.fill"
- ],
- "core-js/features/array/filter": [
- "es.array.filter"
- ],
- "core-js/features/array/find": [
- "es.array.find"
- ],
- "core-js/features/array/find-index": [
- "es.array.find-index"
- ],
- "core-js/features/array/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/features/array/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/features/array/for-each": [
- "es.array.for-each"
- ],
- "core-js/features/array/from": [
- "es.array.from",
- "es.string.iterator"
- ],
- "core-js/features/array/includes": [
- "es.array.includes"
- ],
- "core-js/features/array/index-of": [
- "es.array.index-of"
- ],
- "core-js/features/array/is-array": [
- "es.array.is-array"
- ],
- "core-js/features/array/is-template-object": [
- "esnext.array.is-template-object"
- ],
- "core-js/features/array/iterator": [
- "es.array.iterator"
- ],
- "core-js/features/array/join": [
- "es.array.join"
- ],
- "core-js/features/array/keys": [
- "es.array.iterator"
- ],
- "core-js/features/array/last-index": [
- "esnext.array.last-index"
- ],
- "core-js/features/array/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/features/array/last-item": [
- "esnext.array.last-item"
- ],
- "core-js/features/array/map": [
- "es.array.map"
- ],
- "core-js/features/array/of": [
- "es.array.of"
- ],
- "core-js/features/array/reduce": [
- "es.array.reduce"
- ],
- "core-js/features/array/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/features/array/reverse": [
- "es.array.reverse"
- ],
- "core-js/features/array/slice": [
- "es.array.slice"
- ],
- "core-js/features/array/some": [
- "es.array.some"
- ],
- "core-js/features/array/sort": [
- "es.array.sort"
- ],
- "core-js/features/array/splice": [
- "es.array.splice"
- ],
- "core-js/features/array/values": [
- "es.array.iterator"
- ],
- "core-js/features/array/virtual": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.includes",
- "es.array.index-of",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map"
- ],
- "core-js/features/array/virtual/concat": [
- "es.array.concat"
- ],
- "core-js/features/array/virtual/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/features/array/virtual/entries": [
- "es.array.iterator"
- ],
- "core-js/features/array/virtual/every": [
- "es.array.every"
- ],
- "core-js/features/array/virtual/fill": [
- "es.array.fill"
- ],
- "core-js/features/array/virtual/filter": [
- "es.array.filter"
- ],
- "core-js/features/array/virtual/find": [
- "es.array.find"
- ],
- "core-js/features/array/virtual/find-index": [
- "es.array.find-index"
- ],
- "core-js/features/array/virtual/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/features/array/virtual/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/features/array/virtual/for-each": [
- "es.array.for-each"
- ],
- "core-js/features/array/virtual/includes": [
- "es.array.includes"
- ],
- "core-js/features/array/virtual/index-of": [
- "es.array.index-of"
- ],
- "core-js/features/array/virtual/iterator": [
- "es.array.iterator"
- ],
- "core-js/features/array/virtual/join": [
- "es.array.join"
- ],
- "core-js/features/array/virtual/keys": [
- "es.array.iterator"
- ],
- "core-js/features/array/virtual/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/features/array/virtual/map": [
- "es.array.map"
- ],
- "core-js/features/array/virtual/reduce": [
- "es.array.reduce"
- ],
- "core-js/features/array/virtual/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/features/array/virtual/reverse": [
- "es.array.reverse"
- ],
- "core-js/features/array/virtual/slice": [
- "es.array.slice"
- ],
- "core-js/features/array/virtual/some": [
- "es.array.some"
- ],
- "core-js/features/array/virtual/sort": [
- "es.array.sort"
- ],
- "core-js/features/array/virtual/splice": [
- "es.array.splice"
- ],
- "core-js/features/array/virtual/values": [
- "es.array.iterator"
- ],
- "core-js/features/async-iterator": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/as-indexed-pairs": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/drop": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.drop",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/every": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.every",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/filter": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.filter",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/find": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.find",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/flat-map": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.flat-map",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/for-each": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/from": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/map": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.map",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/reduce": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.reduce",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/some": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.some",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/take": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.take",
- "web.dom-collections.iterator"
- ],
- "core-js/features/async-iterator/to-array": [
- "es.object.to-string",
- "es.promise",
- "es.string.iterator",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.to-array",
- "web.dom-collections.iterator"
- ],
- "core-js/features/clear-immediate": [
- "web.immediate"
- ],
- "core-js/features/composite-key": [
- "esnext.composite-key"
- ],
- "core-js/features/composite-symbol": [
- "es.symbol",
- "esnext.composite-symbol"
- ],
- "core-js/features/data-view": [
- "es.data-view",
- "es.object.to-string"
- ],
- "core-js/features/date": [
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string"
- ],
- "core-js/features/date/now": [
- "es.date.now"
- ],
- "core-js/features/date/to-iso-string": [
- "es.date.to-iso-string",
- "es.date.to-json"
- ],
- "core-js/features/date/to-json": [
- "es.date.to-json"
- ],
- "core-js/features/date/to-primitive": [
- "es.date.to-primitive"
- ],
- "core-js/features/date/to-string": [
- "es.date.to-string"
- ],
- "core-js/features/dom-collections": [
- "es.array.iterator",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/features/dom-collections/for-each": [
- "web.dom-collections.for-each"
- ],
- "core-js/features/dom-collections/iterator": [
- "web.dom-collections.iterator"
- ],
- "core-js/features/function": [
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name"
- ],
- "core-js/features/function/bind": [
- "es.function.bind"
- ],
- "core-js/features/function/has-instance": [
- "es.function.has-instance"
- ],
- "core-js/features/function/name": [
- "es.function.name"
- ],
- "core-js/features/function/virtual": [
- "es.function.bind"
- ],
- "core-js/features/function/virtual/bind": [
- "es.function.bind"
- ],
- "core-js/features/get-iterator": [
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/get-iterator-method": [
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/global-this": [
- "es.global-this",
- "esnext.global-this"
- ],
- "core-js/features/instance/at": [
- "esnext.string.at"
- ],
- "core-js/features/instance/bind": [
- "es.function.bind"
- ],
- "core-js/features/instance/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/features/instance/code-points": [
- "esnext.string.code-points"
- ],
- "core-js/features/instance/concat": [
- "es.array.concat"
- ],
- "core-js/features/instance/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/features/instance/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/features/instance/entries": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/instance/every": [
- "es.array.every"
- ],
- "core-js/features/instance/fill": [
- "es.array.fill"
- ],
- "core-js/features/instance/filter": [
- "es.array.filter"
- ],
- "core-js/features/instance/find": [
- "es.array.find"
- ],
- "core-js/features/instance/find-index": [
- "es.array.find-index"
- ],
- "core-js/features/instance/flags": [
- "es.regexp.flags"
- ],
- "core-js/features/instance/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/features/instance/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/features/instance/for-each": [
- "es.array.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/features/instance/includes": [
- "es.array.includes",
- "es.string.includes"
- ],
- "core-js/features/instance/index-of": [
- "es.array.index-of"
- ],
- "core-js/features/instance/keys": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/instance/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/features/instance/map": [
- "es.array.map"
- ],
- "core-js/features/instance/match-all": [
- "es.string.match-all",
- "esnext.string.match-all"
- ],
- "core-js/features/instance/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/features/instance/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/features/instance/reduce": [
- "es.array.reduce"
- ],
- "core-js/features/instance/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/features/instance/repeat": [
- "es.string.repeat"
- ],
- "core-js/features/instance/replace-all": [
- "esnext.string.replace-all"
- ],
- "core-js/features/instance/reverse": [
- "es.array.reverse"
- ],
- "core-js/features/instance/slice": [
- "es.array.slice"
- ],
- "core-js/features/instance/some": [
- "es.array.some"
- ],
- "core-js/features/instance/sort": [
- "es.array.sort"
- ],
- "core-js/features/instance/splice": [
- "es.array.splice"
- ],
- "core-js/features/instance/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/features/instance/trim": [
- "es.string.trim"
- ],
- "core-js/features/instance/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/features/instance/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/features/instance/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/features/instance/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/features/instance/values": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/is-iterable": [
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/as-indexed-pairs": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/drop": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.drop",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/every": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.every",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/filter": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.filter",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/find": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.find",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/flat-map": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.flat-map",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/for-each": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/from": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/map": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.map",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/reduce": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.reduce",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/some": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.some",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/take": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.take",
- "web.dom-collections.iterator"
- ],
- "core-js/features/iterator/to-array": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.iterator.constructor",
- "esnext.iterator.to-array",
- "web.dom-collections.iterator"
- ],
- "core-js/features/json": [
- "es.json.stringify",
- "es.json.to-string-tag"
- ],
- "core-js/features/json/stringify": [
- "es.json.stringify"
- ],
- "core-js/features/json/to-string-tag": [
- "es.json.to-string-tag"
- ],
- "core-js/features/map": [
- "es.map",
- "es.object.to-string",
- "es.string.iterator",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "web.dom-collections.iterator"
- ],
- "core-js/features/map/delete-all": [
- "es.map",
- "esnext.map.delete-all"
- ],
- "core-js/features/map/every": [
- "es.map",
- "esnext.map.every"
- ],
- "core-js/features/map/filter": [
- "es.map",
- "esnext.map.filter"
- ],
- "core-js/features/map/find": [
- "es.map",
- "esnext.map.find"
- ],
- "core-js/features/map/find-key": [
- "es.map",
- "esnext.map.find-key"
- ],
- "core-js/features/map/from": [
- "es.map",
- "es.string.iterator",
- "esnext.map.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/map/group-by": [
- "es.map",
- "esnext.map.group-by"
- ],
- "core-js/features/map/includes": [
- "es.map",
- "esnext.map.includes"
- ],
- "core-js/features/map/key-by": [
- "es.map",
- "esnext.map.key-by"
- ],
- "core-js/features/map/key-of": [
- "es.map",
- "esnext.map.key-of"
- ],
- "core-js/features/map/map-keys": [
- "es.map",
- "esnext.map.map-keys"
- ],
- "core-js/features/map/map-values": [
- "es.map",
- "esnext.map.map-values"
- ],
- "core-js/features/map/merge": [
- "es.map",
- "esnext.map.merge"
- ],
- "core-js/features/map/of": [
- "es.map",
- "es.string.iterator",
- "esnext.map.of",
- "web.dom-collections.iterator"
- ],
- "core-js/features/map/reduce": [
- "es.map",
- "esnext.map.reduce"
- ],
- "core-js/features/map/some": [
- "es.map",
- "esnext.map.some"
- ],
- "core-js/features/map/update": [
- "es.map",
- "esnext.map.update"
- ],
- "core-js/features/map/update-or-insert": [
- "es.map",
- "esnext.map.update-or-insert"
- ],
- "core-js/features/map/upsert": [
- "es.map",
- "esnext.map.upsert"
- ],
- "core-js/features/math": [
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh"
- ],
- "core-js/features/math/acosh": [
- "es.math.acosh"
- ],
- "core-js/features/math/asinh": [
- "es.math.asinh"
- ],
- "core-js/features/math/atanh": [
- "es.math.atanh"
- ],
- "core-js/features/math/cbrt": [
- "es.math.cbrt"
- ],
- "core-js/features/math/clamp": [
- "esnext.math.clamp"
- ],
- "core-js/features/math/clz32": [
- "es.math.clz32"
- ],
- "core-js/features/math/cosh": [
- "es.math.cosh"
- ],
- "core-js/features/math/deg-per-rad": [
- "esnext.math.deg-per-rad"
- ],
- "core-js/features/math/degrees": [
- "esnext.math.degrees"
- ],
- "core-js/features/math/expm1": [
- "es.math.expm1"
- ],
- "core-js/features/math/fround": [
- "es.math.fround"
- ],
- "core-js/features/math/fscale": [
- "esnext.math.fscale"
- ],
- "core-js/features/math/hypot": [
- "es.math.hypot"
- ],
- "core-js/features/math/iaddh": [
- "esnext.math.iaddh"
- ],
- "core-js/features/math/imul": [
- "es.math.imul"
- ],
- "core-js/features/math/imulh": [
- "esnext.math.imulh"
- ],
- "core-js/features/math/isubh": [
- "esnext.math.isubh"
- ],
- "core-js/features/math/log10": [
- "es.math.log10"
- ],
- "core-js/features/math/log1p": [
- "es.math.log1p"
- ],
- "core-js/features/math/log2": [
- "es.math.log2"
- ],
- "core-js/features/math/rad-per-deg": [
- "esnext.math.rad-per-deg"
- ],
- "core-js/features/math/radians": [
- "esnext.math.radians"
- ],
- "core-js/features/math/scale": [
- "esnext.math.scale"
- ],
- "core-js/features/math/seeded-prng": [
- "esnext.math.seeded-prng"
- ],
- "core-js/features/math/sign": [
- "es.math.sign"
- ],
- "core-js/features/math/signbit": [
- "esnext.math.signbit"
- ],
- "core-js/features/math/sinh": [
- "es.math.sinh"
- ],
- "core-js/features/math/tanh": [
- "es.math.tanh"
- ],
- "core-js/features/math/to-string-tag": [
- "es.math.to-string-tag"
- ],
- "core-js/features/math/trunc": [
- "es.math.trunc"
- ],
- "core-js/features/math/umulh": [
- "esnext.math.umulh"
- ],
- "core-js/features/number": [
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "esnext.number.from-string"
- ],
- "core-js/features/number/constructor": [
- "es.number.constructor"
- ],
- "core-js/features/number/epsilon": [
- "es.number.epsilon"
- ],
- "core-js/features/number/from-string": [
- "esnext.number.from-string"
- ],
- "core-js/features/number/is-finite": [
- "es.number.is-finite"
- ],
- "core-js/features/number/is-integer": [
- "es.number.is-integer"
- ],
- "core-js/features/number/is-nan": [
- "es.number.is-nan"
- ],
- "core-js/features/number/is-safe-integer": [
- "es.number.is-safe-integer"
- ],
- "core-js/features/number/max-safe-integer": [
- "es.number.max-safe-integer"
- ],
- "core-js/features/number/min-safe-integer": [
- "es.number.min-safe-integer"
- ],
- "core-js/features/number/parse-float": [
- "es.number.parse-float"
- ],
- "core-js/features/number/parse-int": [
- "es.number.parse-int"
- ],
- "core-js/features/number/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/features/number/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/features/number/virtual": [
- "es.number.to-fixed",
- "es.number.to-precision"
- ],
- "core-js/features/number/virtual/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/features/number/virtual/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/features/object": [
- "es.symbol",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values"
- ],
- "core-js/features/object/assign": [
- "es.object.assign"
- ],
- "core-js/features/object/create": [
- "es.object.create"
- ],
- "core-js/features/object/define-getter": [
- "es.object.define-getter"
- ],
- "core-js/features/object/define-properties": [
- "es.object.define-properties"
- ],
- "core-js/features/object/define-property": [
- "es.object.define-property"
- ],
- "core-js/features/object/define-setter": [
- "es.object.define-setter"
- ],
- "core-js/features/object/entries": [
- "es.object.entries"
- ],
- "core-js/features/object/freeze": [
- "es.object.freeze"
- ],
- "core-js/features/object/from-entries": [
- "es.array.iterator",
- "es.object.from-entries"
- ],
- "core-js/features/object/get-own-property-descriptor": [
- "es.object.get-own-property-descriptor"
- ],
- "core-js/features/object/get-own-property-descriptors": [
- "es.object.get-own-property-descriptors"
- ],
- "core-js/features/object/get-own-property-names": [
- "es.object.get-own-property-names"
- ],
- "core-js/features/object/get-own-property-symbols": [
- "es.symbol"
- ],
- "core-js/features/object/get-prototype-of": [
- "es.object.get-prototype-of"
- ],
- "core-js/features/object/is": [
- "es.object.is"
- ],
- "core-js/features/object/is-extensible": [
- "es.object.is-extensible"
- ],
- "core-js/features/object/is-frozen": [
- "es.object.is-frozen"
- ],
- "core-js/features/object/is-sealed": [
- "es.object.is-sealed"
- ],
- "core-js/features/object/iterate-entries": [
- "esnext.object.iterate-entries"
- ],
- "core-js/features/object/iterate-keys": [
- "esnext.object.iterate-keys"
- ],
- "core-js/features/object/iterate-values": [
- "esnext.object.iterate-values"
- ],
- "core-js/features/object/keys": [
- "es.object.keys"
- ],
- "core-js/features/object/lookup-getter": [
- "es.object.lookup-setter"
- ],
- "core-js/features/object/lookup-setter": [
- "es.object.lookup-setter"
- ],
- "core-js/features/object/prevent-extensions": [
- "es.object.prevent-extensions"
- ],
- "core-js/features/object/seal": [
- "es.object.seal"
- ],
- "core-js/features/object/set-prototype-of": [
- "es.object.set-prototype-of"
- ],
- "core-js/features/object/to-string": [
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/features/object/values": [
- "es.object.values"
- ],
- "core-js/features/observable": [
- "es.object.to-string",
- "es.string.iterator",
- "esnext.observable",
- "esnext.symbol.observable",
- "web.dom-collections.iterator"
- ],
- "core-js/features/parse-float": [
- "es.parse-float"
- ],
- "core-js/features/parse-int": [
- "es.parse-int"
- ],
- "core-js/features/promise": [
- "es.object.to-string",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.string.iterator",
- "esnext.aggregate-error",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "web.dom-collections.iterator"
- ],
- "core-js/features/promise/all-settled": [
- "es.promise",
- "es.promise.all-settled",
- "esnext.promise.all-settled"
- ],
- "core-js/features/promise/any": [
- "es.promise",
- "esnext.aggregate-error",
- "esnext.promise.any"
- ],
- "core-js/features/promise/finally": [
- "es.promise",
- "es.promise.finally"
- ],
- "core-js/features/promise/try": [
- "es.promise",
- "esnext.promise.try"
- ],
- "core-js/features/queue-microtask": [
- "web.queue-microtask"
- ],
- "core-js/features/reflect": [
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata"
- ],
- "core-js/features/reflect/apply": [
- "es.reflect.apply"
- ],
- "core-js/features/reflect/construct": [
- "es.reflect.construct"
- ],
- "core-js/features/reflect/define-metadata": [
- "esnext.reflect.define-metadata"
- ],
- "core-js/features/reflect/define-property": [
- "es.reflect.define-property"
- ],
- "core-js/features/reflect/delete-metadata": [
- "esnext.reflect.delete-metadata"
- ],
- "core-js/features/reflect/delete-property": [
- "es.reflect.delete-property"
- ],
- "core-js/features/reflect/get": [
- "es.reflect.get"
- ],
- "core-js/features/reflect/get-metadata": [
- "esnext.reflect.get-metadata"
- ],
- "core-js/features/reflect/get-metadata-keys": [
- "esnext.reflect.get-metadata-keys"
- ],
- "core-js/features/reflect/get-own-metadata": [
- "esnext.reflect.get-own-metadata"
- ],
- "core-js/features/reflect/get-own-metadata-keys": [
- "esnext.reflect.get-own-metadata-keys"
- ],
- "core-js/features/reflect/get-own-property-descriptor": [
- "es.reflect.get-own-property-descriptor"
- ],
- "core-js/features/reflect/get-prototype-of": [
- "es.reflect.get-prototype-of"
- ],
- "core-js/features/reflect/has": [
- "es.reflect.has"
- ],
- "core-js/features/reflect/has-metadata": [
- "esnext.reflect.has-metadata"
- ],
- "core-js/features/reflect/has-own-metadata": [
- "esnext.reflect.has-own-metadata"
- ],
- "core-js/features/reflect/is-extensible": [
- "es.reflect.is-extensible"
- ],
- "core-js/features/reflect/metadata": [
- "esnext.reflect.metadata"
- ],
- "core-js/features/reflect/own-keys": [
- "es.reflect.own-keys"
- ],
- "core-js/features/reflect/prevent-extensions": [
- "es.reflect.prevent-extensions"
- ],
- "core-js/features/reflect/set": [
- "es.reflect.set"
- ],
- "core-js/features/reflect/set-prototype-of": [
- "es.reflect.set-prototype-of"
- ],
- "core-js/features/regexp": [
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.string.match",
- "es.string.replace",
- "es.string.search",
- "es.string.split"
- ],
- "core-js/features/regexp/constructor": [
- "es.regexp.constructor"
- ],
- "core-js/features/regexp/flags": [
- "es.regexp.flags"
- ],
- "core-js/features/regexp/match": [
- "es.string.match"
- ],
- "core-js/features/regexp/replace": [
- "es.string.replace"
- ],
- "core-js/features/regexp/search": [
- "es.string.search"
- ],
- "core-js/features/regexp/split": [
- "es.string.split"
- ],
- "core-js/features/regexp/sticky": [
- "es.regexp.sticky"
- ],
- "core-js/features/regexp/test": [
- "es.regexp.exec",
- "es.regexp.test"
- ],
- "core-js/features/regexp/to-string": [
- "es.regexp.to-string"
- ],
- "core-js/features/set": [
- "es.object.to-string",
- "es.set",
- "es.string.iterator",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set-immediate": [
- "web.immediate"
- ],
- "core-js/features/set-interval": [
- "web.timers"
- ],
- "core-js/features/set-timeout": [
- "web.timers"
- ],
- "core-js/features/set/add-all": [
- "es.set",
- "esnext.set.add-all"
- ],
- "core-js/features/set/delete-all": [
- "es.set",
- "esnext.set.delete-all"
- ],
- "core-js/features/set/difference": [
- "es.set",
- "es.string.iterator",
- "esnext.set.difference",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set/every": [
- "es.set",
- "esnext.set.every"
- ],
- "core-js/features/set/filter": [
- "es.set",
- "esnext.set.filter"
- ],
- "core-js/features/set/find": [
- "es.set",
- "esnext.set.find"
- ],
- "core-js/features/set/from": [
- "es.set",
- "es.string.iterator",
- "esnext.set.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set/intersection": [
- "es.set",
- "esnext.set.intersection"
- ],
- "core-js/features/set/is-disjoint-from": [
- "es.set",
- "esnext.set.is-disjoint-from"
- ],
- "core-js/features/set/is-subset-of": [
- "es.set",
- "es.string.iterator",
- "esnext.set.is-subset-of",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set/is-superset-of": [
- "es.set",
- "esnext.set.is-superset-of"
- ],
- "core-js/features/set/join": [
- "es.set",
- "esnext.set.join"
- ],
- "core-js/features/set/map": [
- "es.set",
- "esnext.set.map"
- ],
- "core-js/features/set/of": [
- "es.set",
- "es.string.iterator",
- "esnext.set.of",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set/reduce": [
- "es.set",
- "esnext.set.reduce"
- ],
- "core-js/features/set/some": [
- "es.set",
- "esnext.set.some"
- ],
- "core-js/features/set/symmetric-difference": [
- "es.set",
- "es.string.iterator",
- "esnext.set.symmetric-difference",
- "web.dom-collections.iterator"
- ],
- "core-js/features/set/union": [
- "es.set",
- "es.string.iterator",
- "esnext.set.union",
- "web.dom-collections.iterator"
- ],
- "core-js/features/string": [
- "es.regexp.exec",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all"
- ],
- "core-js/features/string/anchor": [
- "es.string.anchor"
- ],
- "core-js/features/string/at": [
- "esnext.string.at"
- ],
- "core-js/features/string/big": [
- "es.string.big"
- ],
- "core-js/features/string/blink": [
- "es.string.blink"
- ],
- "core-js/features/string/bold": [
- "es.string.bold"
- ],
- "core-js/features/string/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/features/string/code-points": [
- "esnext.string.code-points"
- ],
- "core-js/features/string/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/features/string/fixed": [
- "es.string.fixed"
- ],
- "core-js/features/string/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/features/string/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/features/string/from-code-point": [
- "es.string.from-code-point"
- ],
- "core-js/features/string/includes": [
- "es.string.includes"
- ],
- "core-js/features/string/italics": [
- "es.string.italics"
- ],
- "core-js/features/string/iterator": [
- "es.string.iterator"
- ],
- "core-js/features/string/link": [
- "es.string.link"
- ],
- "core-js/features/string/match": [
- "es.regexp.exec",
- "es.string.match"
- ],
- "core-js/features/string/match-all": [
- "es.string.match-all",
- "esnext.string.match-all"
- ],
- "core-js/features/string/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/features/string/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/features/string/raw": [
- "es.string.raw"
- ],
- "core-js/features/string/repeat": [
- "es.string.repeat"
- ],
- "core-js/features/string/replace": [
- "es.regexp.exec",
- "es.string.replace"
- ],
- "core-js/features/string/replace-all": [
- "esnext.string.replace-all"
- ],
- "core-js/features/string/search": [
- "es.regexp.exec",
- "es.string.search"
- ],
- "core-js/features/string/small": [
- "es.string.small"
- ],
- "core-js/features/string/split": [
- "es.regexp.exec",
- "es.string.split"
- ],
- "core-js/features/string/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/features/string/strike": [
- "es.string.strike"
- ],
- "core-js/features/string/sub": [
- "es.string.sub"
- ],
- "core-js/features/string/sup": [
- "es.string.sup"
- ],
- "core-js/features/string/trim": [
- "es.string.trim"
- ],
- "core-js/features/string/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/features/string/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/features/string/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/features/string/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/features/string/virtual": [
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all"
- ],
- "core-js/features/string/virtual/anchor": [
- "es.string.anchor"
- ],
- "core-js/features/string/virtual/at": [
- "esnext.string.at"
- ],
- "core-js/features/string/virtual/big": [
- "es.string.big"
- ],
- "core-js/features/string/virtual/blink": [
- "es.string.blink"
- ],
- "core-js/features/string/virtual/bold": [
- "es.string.bold"
- ],
- "core-js/features/string/virtual/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/features/string/virtual/code-points": [
- "esnext.string.code-points"
- ],
- "core-js/features/string/virtual/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/features/string/virtual/fixed": [
- "es.string.fixed"
- ],
- "core-js/features/string/virtual/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/features/string/virtual/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/features/string/virtual/includes": [
- "es.string.includes"
- ],
- "core-js/features/string/virtual/italics": [
- "es.string.italics"
- ],
- "core-js/features/string/virtual/iterator": [
- "es.string.iterator"
- ],
- "core-js/features/string/virtual/link": [
- "es.string.link"
- ],
- "core-js/features/string/virtual/match-all": [
- "es.string.match-all",
- "esnext.string.match-all"
- ],
- "core-js/features/string/virtual/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/features/string/virtual/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/features/string/virtual/repeat": [
- "es.string.repeat"
- ],
- "core-js/features/string/virtual/replace-all": [
- "esnext.string.replace-all"
- ],
- "core-js/features/string/virtual/small": [
- "es.string.small"
- ],
- "core-js/features/string/virtual/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/features/string/virtual/strike": [
- "es.string.strike"
- ],
- "core-js/features/string/virtual/sub": [
- "es.string.sub"
- ],
- "core-js/features/string/virtual/sup": [
- "es.string.sup"
- ],
- "core-js/features/string/virtual/trim": [
- "es.string.trim"
- ],
- "core-js/features/string/virtual/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/features/string/virtual/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/features/string/virtual/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/features/string/virtual/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/features/symbol": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all"
- ],
- "core-js/features/symbol/async-dispose": [
- "esnext.symbol.async-dispose"
- ],
- "core-js/features/symbol/async-iterator": [
- "es.symbol.async-iterator"
- ],
- "core-js/features/symbol/description": [
- "es.symbol.description"
- ],
- "core-js/features/symbol/dispose": [
- "esnext.symbol.dispose"
- ],
- "core-js/features/symbol/for": [
- "es.symbol"
- ],
- "core-js/features/symbol/has-instance": [
- "es.symbol.has-instance",
- "es.function.has-instance"
- ],
- "core-js/features/symbol/is-concat-spreadable": [
- "es.symbol.is-concat-spreadable",
- "es.array.concat"
- ],
- "core-js/features/symbol/iterator": [
- "es.symbol.iterator",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/features/symbol/key-for": [
- "es.symbol"
- ],
- "core-js/features/symbol/match": [
- "es.symbol.match",
- "es.string.match"
- ],
- "core-js/features/symbol/match-all": [
- "es.symbol.match-all",
- "es.string.match-all"
- ],
- "core-js/features/symbol/observable": [
- "esnext.symbol.observable"
- ],
- "core-js/features/symbol/pattern-match": [
- "esnext.symbol.pattern-match"
- ],
- "core-js/features/symbol/replace": [
- "es.symbol.replace",
- "es.string.replace"
- ],
- "core-js/features/symbol/replace-all": [
- "esnext.symbol.replace-all"
- ],
- "core-js/features/symbol/search": [
- "es.symbol.search",
- "es.string.search"
- ],
- "core-js/features/symbol/species": [
- "es.symbol.species"
- ],
- "core-js/features/symbol/split": [
- "es.symbol.split",
- "es.string.split"
- ],
- "core-js/features/symbol/to-primitive": [
- "es.symbol.to-primitive"
- ],
- "core-js/features/symbol/to-string-tag": [
- "es.symbol.to-string-tag",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/features/symbol/unscopables": [
- "es.symbol.unscopables"
- ],
- "core-js/features/typed-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/copy-within": [
- "es.typed-array.copy-within"
- ],
- "core-js/features/typed-array/entries": [
- "es.typed-array.iterator"
- ],
- "core-js/features/typed-array/every": [
- "es.typed-array.every"
- ],
- "core-js/features/typed-array/fill": [
- "es.typed-array.fill"
- ],
- "core-js/features/typed-array/filter": [
- "es.typed-array.filter"
- ],
- "core-js/features/typed-array/find": [
- "es.typed-array.find"
- ],
- "core-js/features/typed-array/find-index": [
- "es.typed-array.find-index"
- ],
- "core-js/features/typed-array/float32-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/float64-array": [
- "es.object.to-string",
- "es.typed-array.float64-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/for-each": [
- "es.typed-array.for-each"
- ],
- "core-js/features/typed-array/from": [
- "es.typed-array.from"
- ],
- "core-js/features/typed-array/includes": [
- "es.typed-array.includes"
- ],
- "core-js/features/typed-array/index-of": [
- "es.typed-array.index-of"
- ],
- "core-js/features/typed-array/int16-array": [
- "es.object.to-string",
- "es.typed-array.int16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/int32-array": [
- "es.object.to-string",
- "es.typed-array.int32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/int8-array": [
- "es.object.to-string",
- "es.typed-array.int8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/iterator": [
- "es.typed-array.iterator"
- ],
- "core-js/features/typed-array/join": [
- "es.typed-array.join"
- ],
- "core-js/features/typed-array/keys": [
- "es.typed-array.iterator"
- ],
- "core-js/features/typed-array/last-index-of": [
- "es.typed-array.last-index-of"
- ],
- "core-js/features/typed-array/map": [
- "es.typed-array.map"
- ],
- "core-js/features/typed-array/of": [
- "es.typed-array.of"
- ],
- "core-js/features/typed-array/reduce": [
- "es.typed-array.reduce"
- ],
- "core-js/features/typed-array/reduce-right": [
- "es.typed-array.reduce-right"
- ],
- "core-js/features/typed-array/reverse": [
- "es.typed-array.reverse"
- ],
- "core-js/features/typed-array/set": [
- "es.typed-array.set"
- ],
- "core-js/features/typed-array/slice": [
- "es.typed-array.slice"
- ],
- "core-js/features/typed-array/some": [
- "es.typed-array.some"
- ],
- "core-js/features/typed-array/sort": [
- "es.typed-array.sort"
- ],
- "core-js/features/typed-array/subarray": [
- "es.typed-array.subarray"
- ],
- "core-js/features/typed-array/to-locale-string": [
- "es.typed-array.to-locale-string"
- ],
- "core-js/features/typed-array/to-string": [
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/uint16-array": [
- "es.object.to-string",
- "es.typed-array.uint16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/uint32-array": [
- "es.object.to-string",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/uint8-array": [
- "es.object.to-string",
- "es.typed-array.uint8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/uint8-clamped-array": [
- "es.object.to-string",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/features/typed-array/values": [
- "es.typed-array.iterator"
- ],
- "core-js/features/url": [
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/features/url-search-params": [
- "web.url-search-params"
- ],
- "core-js/features/url/to-json": [
- "web.url.to-json"
- ],
- "core-js/features/weak-map": [
- "es.object.to-string",
- "es.weak-map",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "web.dom-collections.iterator"
- ],
- "core-js/features/weak-map/delete-all": [
- "es.weak-map",
- "esnext.weak-map.delete-all"
- ],
- "core-js/features/weak-map/from": [
- "es.string.iterator",
- "es.weak-map",
- "esnext.weak-map.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/weak-map/of": [
- "es.string.iterator",
- "es.weak-map",
- "esnext.weak-map.of",
- "web.dom-collections.iterator"
- ],
- "core-js/features/weak-map/upsert": [
- "es.weak-map",
- "esnext.weak-map.upsert"
- ],
- "core-js/features/weak-set": [
- "es.object.to-string",
- "es.weak-set",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.dom-collections.iterator"
- ],
- "core-js/features/weak-set/add-all": [
- "es.weak-set",
- "esnext.weak-set.add-all"
- ],
- "core-js/features/weak-set/delete-all": [
- "es.weak-set",
- "esnext.weak-set.delete-all"
- ],
- "core-js/features/weak-set/from": [
- "es.string.iterator",
- "es.weak-set",
- "esnext.weak-set.from",
- "web.dom-collections.iterator"
- ],
- "core-js/features/weak-set/of": [
- "es.string.iterator",
- "es.weak-set",
- "esnext.weak-set.of",
- "web.dom-collections.iterator"
- ],
- "core-js/modules/es.array-buffer.constructor": [
- "es.array-buffer.constructor"
- ],
- "core-js/modules/es.array-buffer.is-view": [
- "es.array-buffer.is-view"
- ],
- "core-js/modules/es.array-buffer.slice": [
- "es.array-buffer.slice"
- ],
- "core-js/modules/es.array.concat": [
- "es.array.concat"
- ],
- "core-js/modules/es.array.copy-within": [
- "es.array.copy-within"
- ],
- "core-js/modules/es.array.every": [
- "es.array.every"
- ],
- "core-js/modules/es.array.fill": [
- "es.array.fill"
- ],
- "core-js/modules/es.array.filter": [
- "es.array.filter"
- ],
- "core-js/modules/es.array.find": [
- "es.array.find"
- ],
- "core-js/modules/es.array.find-index": [
- "es.array.find-index"
- ],
- "core-js/modules/es.array.flat": [
- "es.array.flat"
- ],
- "core-js/modules/es.array.flat-map": [
- "es.array.flat-map"
- ],
- "core-js/modules/es.array.for-each": [
- "es.array.for-each"
- ],
- "core-js/modules/es.array.from": [
- "es.array.from"
- ],
- "core-js/modules/es.array.includes": [
- "es.array.includes"
- ],
- "core-js/modules/es.array.index-of": [
- "es.array.index-of"
- ],
- "core-js/modules/es.array.is-array": [
- "es.array.is-array"
- ],
- "core-js/modules/es.array.iterator": [
- "es.array.iterator"
- ],
- "core-js/modules/es.array.join": [
- "es.array.join"
- ],
- "core-js/modules/es.array.last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/modules/es.array.map": [
- "es.array.map"
- ],
- "core-js/modules/es.array.of": [
- "es.array.of"
- ],
- "core-js/modules/es.array.reduce": [
- "es.array.reduce"
- ],
- "core-js/modules/es.array.reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/modules/es.array.reverse": [
- "es.array.reverse"
- ],
- "core-js/modules/es.array.slice": [
- "es.array.slice"
- ],
- "core-js/modules/es.array.some": [
- "es.array.some"
- ],
- "core-js/modules/es.array.sort": [
- "es.array.sort"
- ],
- "core-js/modules/es.array.species": [
- "es.array.species"
- ],
- "core-js/modules/es.array.splice": [
- "es.array.splice"
- ],
- "core-js/modules/es.array.unscopables.flat": [
- "es.array.unscopables.flat"
- ],
- "core-js/modules/es.array.unscopables.flat-map": [
- "es.array.unscopables.flat-map"
- ],
- "core-js/modules/es.data-view": [
- "es.data-view"
- ],
- "core-js/modules/es.date.now": [
- "es.date.now"
- ],
- "core-js/modules/es.date.to-iso-string": [
- "es.date.to-iso-string"
- ],
- "core-js/modules/es.date.to-json": [
- "es.date.to-json"
- ],
- "core-js/modules/es.date.to-primitive": [
- "es.date.to-primitive"
- ],
- "core-js/modules/es.date.to-string": [
- "es.date.to-string"
- ],
- "core-js/modules/es.function.bind": [
- "es.function.bind"
- ],
- "core-js/modules/es.function.has-instance": [
- "es.function.has-instance"
- ],
- "core-js/modules/es.function.name": [
- "es.function.name"
- ],
- "core-js/modules/es.global-this": [
- "es.global-this"
- ],
- "core-js/modules/es.json.stringify": [
- "es.json.stringify"
- ],
- "core-js/modules/es.json.to-string-tag": [
- "es.json.to-string-tag"
- ],
- "core-js/modules/es.map": [
- "es.map"
- ],
- "core-js/modules/es.math.acosh": [
- "es.math.acosh"
- ],
- "core-js/modules/es.math.asinh": [
- "es.math.asinh"
- ],
- "core-js/modules/es.math.atanh": [
- "es.math.atanh"
- ],
- "core-js/modules/es.math.cbrt": [
- "es.math.cbrt"
- ],
- "core-js/modules/es.math.clz32": [
- "es.math.clz32"
- ],
- "core-js/modules/es.math.cosh": [
- "es.math.cosh"
- ],
- "core-js/modules/es.math.expm1": [
- "es.math.expm1"
- ],
- "core-js/modules/es.math.fround": [
- "es.math.fround"
- ],
- "core-js/modules/es.math.hypot": [
- "es.math.hypot"
- ],
- "core-js/modules/es.math.imul": [
- "es.math.imul"
- ],
- "core-js/modules/es.math.log10": [
- "es.math.log10"
- ],
- "core-js/modules/es.math.log1p": [
- "es.math.log1p"
- ],
- "core-js/modules/es.math.log2": [
- "es.math.log2"
- ],
- "core-js/modules/es.math.sign": [
- "es.math.sign"
- ],
- "core-js/modules/es.math.sinh": [
- "es.math.sinh"
- ],
- "core-js/modules/es.math.tanh": [
- "es.math.tanh"
- ],
- "core-js/modules/es.math.to-string-tag": [
- "es.math.to-string-tag"
- ],
- "core-js/modules/es.math.trunc": [
- "es.math.trunc"
- ],
- "core-js/modules/es.number.constructor": [
- "es.number.constructor"
- ],
- "core-js/modules/es.number.epsilon": [
- "es.number.epsilon"
- ],
- "core-js/modules/es.number.is-finite": [
- "es.number.is-finite"
- ],
- "core-js/modules/es.number.is-integer": [
- "es.number.is-integer"
- ],
- "core-js/modules/es.number.is-nan": [
- "es.number.is-nan"
- ],
- "core-js/modules/es.number.is-safe-integer": [
- "es.number.is-safe-integer"
- ],
- "core-js/modules/es.number.max-safe-integer": [
- "es.number.max-safe-integer"
- ],
- "core-js/modules/es.number.min-safe-integer": [
- "es.number.min-safe-integer"
- ],
- "core-js/modules/es.number.parse-float": [
- "es.number.parse-float"
- ],
- "core-js/modules/es.number.parse-int": [
- "es.number.parse-int"
- ],
- "core-js/modules/es.number.to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/modules/es.number.to-precision": [
- "es.number.to-precision"
- ],
- "core-js/modules/es.object.assign": [
- "es.object.assign"
- ],
- "core-js/modules/es.object.create": [
- "es.object.create"
- ],
- "core-js/modules/es.object.define-getter": [
- "es.object.define-getter"
- ],
- "core-js/modules/es.object.define-properties": [
- "es.object.define-properties"
- ],
- "core-js/modules/es.object.define-property": [
- "es.object.define-property"
- ],
- "core-js/modules/es.object.define-setter": [
- "es.object.define-setter"
- ],
- "core-js/modules/es.object.entries": [
- "es.object.entries"
- ],
- "core-js/modules/es.object.freeze": [
- "es.object.freeze"
- ],
- "core-js/modules/es.object.from-entries": [
- "es.object.from-entries"
- ],
- "core-js/modules/es.object.get-own-property-descriptor": [
- "es.object.get-own-property-descriptor"
- ],
- "core-js/modules/es.object.get-own-property-descriptors": [
- "es.object.get-own-property-descriptors"
- ],
- "core-js/modules/es.object.get-own-property-names": [
- "es.object.get-own-property-names"
- ],
- "core-js/modules/es.object.get-prototype-of": [
- "es.object.get-prototype-of"
- ],
- "core-js/modules/es.object.is": [
- "es.object.is"
- ],
- "core-js/modules/es.object.is-extensible": [
- "es.object.is-extensible"
- ],
- "core-js/modules/es.object.is-frozen": [
- "es.object.is-frozen"
- ],
- "core-js/modules/es.object.is-sealed": [
- "es.object.is-sealed"
- ],
- "core-js/modules/es.object.keys": [
- "es.object.keys"
- ],
- "core-js/modules/es.object.lookup-getter": [
- "es.object.lookup-getter"
- ],
- "core-js/modules/es.object.lookup-setter": [
- "es.object.lookup-setter"
- ],
- "core-js/modules/es.object.prevent-extensions": [
- "es.object.prevent-extensions"
- ],
- "core-js/modules/es.object.seal": [
- "es.object.seal"
- ],
- "core-js/modules/es.object.set-prototype-of": [
- "es.object.set-prototype-of"
- ],
- "core-js/modules/es.object.to-string": [
- "es.object.to-string"
- ],
- "core-js/modules/es.object.values": [
- "es.object.values"
- ],
- "core-js/modules/es.parse-float": [
- "es.parse-float"
- ],
- "core-js/modules/es.parse-int": [
- "es.parse-int"
- ],
- "core-js/modules/es.promise": [
- "es.promise"
- ],
- "core-js/modules/es.promise.all-settled": [
- "es.promise.all-settled"
- ],
- "core-js/modules/es.promise.finally": [
- "es.promise.finally"
- ],
- "core-js/modules/es.reflect.apply": [
- "es.reflect.apply"
- ],
- "core-js/modules/es.reflect.construct": [
- "es.reflect.construct"
- ],
- "core-js/modules/es.reflect.define-property": [
- "es.reflect.define-property"
- ],
- "core-js/modules/es.reflect.delete-property": [
- "es.reflect.delete-property"
- ],
- "core-js/modules/es.reflect.get": [
- "es.reflect.get"
- ],
- "core-js/modules/es.reflect.get-own-property-descriptor": [
- "es.reflect.get-own-property-descriptor"
- ],
- "core-js/modules/es.reflect.get-prototype-of": [
- "es.reflect.get-prototype-of"
- ],
- "core-js/modules/es.reflect.has": [
- "es.reflect.has"
- ],
- "core-js/modules/es.reflect.is-extensible": [
- "es.reflect.is-extensible"
- ],
- "core-js/modules/es.reflect.own-keys": [
- "es.reflect.own-keys"
- ],
- "core-js/modules/es.reflect.prevent-extensions": [
- "es.reflect.prevent-extensions"
- ],
- "core-js/modules/es.reflect.set": [
- "es.reflect.set"
- ],
- "core-js/modules/es.reflect.set-prototype-of": [
- "es.reflect.set-prototype-of"
- ],
- "core-js/modules/es.regexp.constructor": [
- "es.regexp.constructor"
- ],
- "core-js/modules/es.regexp.exec": [
- "es.regexp.exec"
- ],
- "core-js/modules/es.regexp.flags": [
- "es.regexp.flags"
- ],
- "core-js/modules/es.regexp.sticky": [
- "es.regexp.sticky"
- ],
- "core-js/modules/es.regexp.test": [
- "es.regexp.test"
- ],
- "core-js/modules/es.regexp.to-string": [
- "es.regexp.to-string"
- ],
- "core-js/modules/es.set": [
- "es.set"
- ],
- "core-js/modules/es.string.anchor": [
- "es.string.anchor"
- ],
- "core-js/modules/es.string.big": [
- "es.string.big"
- ],
- "core-js/modules/es.string.blink": [
- "es.string.blink"
- ],
- "core-js/modules/es.string.bold": [
- "es.string.bold"
- ],
- "core-js/modules/es.string.code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/modules/es.string.ends-with": [
- "es.string.ends-with"
- ],
- "core-js/modules/es.string.fixed": [
- "es.string.fixed"
- ],
- "core-js/modules/es.string.fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/modules/es.string.fontsize": [
- "es.string.fontsize"
- ],
- "core-js/modules/es.string.from-code-point": [
- "es.string.from-code-point"
- ],
- "core-js/modules/es.string.includes": [
- "es.string.includes"
- ],
- "core-js/modules/es.string.italics": [
- "es.string.italics"
- ],
- "core-js/modules/es.string.iterator": [
- "es.string.iterator"
- ],
- "core-js/modules/es.string.link": [
- "es.string.link"
- ],
- "core-js/modules/es.string.match": [
- "es.string.match"
- ],
- "core-js/modules/es.string.match-all": [
- "es.string.match-all"
- ],
- "core-js/modules/es.string.pad-end": [
- "es.string.pad-end"
- ],
- "core-js/modules/es.string.pad-start": [
- "es.string.pad-start"
- ],
- "core-js/modules/es.string.raw": [
- "es.string.raw"
- ],
- "core-js/modules/es.string.repeat": [
- "es.string.repeat"
- ],
- "core-js/modules/es.string.replace": [
- "es.string.replace"
- ],
- "core-js/modules/es.string.search": [
- "es.string.search"
- ],
- "core-js/modules/es.string.small": [
- "es.string.small"
- ],
- "core-js/modules/es.string.split": [
- "es.string.split"
- ],
- "core-js/modules/es.string.starts-with": [
- "es.string.starts-with"
- ],
- "core-js/modules/es.string.strike": [
- "es.string.strike"
- ],
- "core-js/modules/es.string.sub": [
- "es.string.sub"
- ],
- "core-js/modules/es.string.sup": [
- "es.string.sup"
- ],
- "core-js/modules/es.string.trim": [
- "es.string.trim"
- ],
- "core-js/modules/es.string.trim-end": [
- "es.string.trim-end"
- ],
- "core-js/modules/es.string.trim-start": [
- "es.string.trim-start"
- ],
- "core-js/modules/es.symbol": [
- "es.symbol"
- ],
- "core-js/modules/es.symbol.async-iterator": [
- "es.symbol.async-iterator"
- ],
- "core-js/modules/es.symbol.description": [
- "es.symbol.description"
- ],
- "core-js/modules/es.symbol.has-instance": [
- "es.symbol.has-instance"
- ],
- "core-js/modules/es.symbol.is-concat-spreadable": [
- "es.symbol.is-concat-spreadable"
- ],
- "core-js/modules/es.symbol.iterator": [
- "es.symbol.iterator"
- ],
- "core-js/modules/es.symbol.match": [
- "es.symbol.match"
- ],
- "core-js/modules/es.symbol.match-all": [
- "es.symbol.match-all"
- ],
- "core-js/modules/es.symbol.replace": [
- "es.symbol.replace"
- ],
- "core-js/modules/es.symbol.search": [
- "es.symbol.search"
- ],
- "core-js/modules/es.symbol.species": [
- "es.symbol.species"
- ],
- "core-js/modules/es.symbol.split": [
- "es.symbol.split"
- ],
- "core-js/modules/es.symbol.to-primitive": [
- "es.symbol.to-primitive"
- ],
- "core-js/modules/es.symbol.to-string-tag": [
- "es.symbol.to-string-tag"
- ],
- "core-js/modules/es.symbol.unscopables": [
- "es.symbol.unscopables"
- ],
- "core-js/modules/es.typed-array.copy-within": [
- "es.typed-array.copy-within"
- ],
- "core-js/modules/es.typed-array.every": [
- "es.typed-array.every"
- ],
- "core-js/modules/es.typed-array.fill": [
- "es.typed-array.fill"
- ],
- "core-js/modules/es.typed-array.filter": [
- "es.typed-array.filter"
- ],
- "core-js/modules/es.typed-array.find": [
- "es.typed-array.find"
- ],
- "core-js/modules/es.typed-array.find-index": [
- "es.typed-array.find-index"
- ],
- "core-js/modules/es.typed-array.float32-array": [
- "es.typed-array.float32-array"
- ],
- "core-js/modules/es.typed-array.float64-array": [
- "es.typed-array.float64-array"
- ],
- "core-js/modules/es.typed-array.for-each": [
- "es.typed-array.for-each"
- ],
- "core-js/modules/es.typed-array.from": [
- "es.typed-array.from"
- ],
- "core-js/modules/es.typed-array.includes": [
- "es.typed-array.includes"
- ],
- "core-js/modules/es.typed-array.index-of": [
- "es.typed-array.index-of"
- ],
- "core-js/modules/es.typed-array.int16-array": [
- "es.typed-array.int16-array"
- ],
- "core-js/modules/es.typed-array.int32-array": [
- "es.typed-array.int32-array"
- ],
- "core-js/modules/es.typed-array.int8-array": [
- "es.typed-array.int8-array"
- ],
- "core-js/modules/es.typed-array.iterator": [
- "es.typed-array.iterator"
- ],
- "core-js/modules/es.typed-array.join": [
- "es.typed-array.join"
- ],
- "core-js/modules/es.typed-array.last-index-of": [
- "es.typed-array.last-index-of"
- ],
- "core-js/modules/es.typed-array.map": [
- "es.typed-array.map"
- ],
- "core-js/modules/es.typed-array.of": [
- "es.typed-array.of"
- ],
- "core-js/modules/es.typed-array.reduce": [
- "es.typed-array.reduce"
- ],
- "core-js/modules/es.typed-array.reduce-right": [
- "es.typed-array.reduce-right"
- ],
- "core-js/modules/es.typed-array.reverse": [
- "es.typed-array.reverse"
- ],
- "core-js/modules/es.typed-array.set": [
- "es.typed-array.set"
- ],
- "core-js/modules/es.typed-array.slice": [
- "es.typed-array.slice"
- ],
- "core-js/modules/es.typed-array.some": [
- "es.typed-array.some"
- ],
- "core-js/modules/es.typed-array.sort": [
- "es.typed-array.sort"
- ],
- "core-js/modules/es.typed-array.subarray": [
- "es.typed-array.subarray"
- ],
- "core-js/modules/es.typed-array.to-locale-string": [
- "es.typed-array.to-locale-string"
- ],
- "core-js/modules/es.typed-array.to-string": [
- "es.typed-array.to-string"
- ],
- "core-js/modules/es.typed-array.uint16-array": [
- "es.typed-array.uint16-array"
- ],
- "core-js/modules/es.typed-array.uint32-array": [
- "es.typed-array.uint32-array"
- ],
- "core-js/modules/es.typed-array.uint8-array": [
- "es.typed-array.uint8-array"
- ],
- "core-js/modules/es.typed-array.uint8-clamped-array": [
- "es.typed-array.uint8-clamped-array"
- ],
- "core-js/modules/es.weak-map": [
- "es.weak-map"
- ],
- "core-js/modules/es.weak-set": [
- "es.weak-set"
- ],
- "core-js/modules/esnext.aggregate-error": [
- "esnext.aggregate-error"
- ],
- "core-js/modules/esnext.array.is-template-object": [
- "esnext.array.is-template-object"
- ],
- "core-js/modules/esnext.array.last-index": [
- "esnext.array.last-index"
- ],
- "core-js/modules/esnext.array.last-item": [
- "esnext.array.last-item"
- ],
- "core-js/modules/esnext.async-iterator.as-indexed-pairs": [
- "esnext.async-iterator.as-indexed-pairs"
- ],
- "core-js/modules/esnext.async-iterator.constructor": [
- "esnext.async-iterator.constructor"
- ],
- "core-js/modules/esnext.async-iterator.drop": [
- "esnext.async-iterator.drop"
- ],
- "core-js/modules/esnext.async-iterator.every": [
- "esnext.async-iterator.every"
- ],
- "core-js/modules/esnext.async-iterator.filter": [
- "esnext.async-iterator.filter"
- ],
- "core-js/modules/esnext.async-iterator.find": [
- "esnext.async-iterator.find"
- ],
- "core-js/modules/esnext.async-iterator.flat-map": [
- "esnext.async-iterator.flat-map"
- ],
- "core-js/modules/esnext.async-iterator.for-each": [
- "esnext.async-iterator.for-each"
- ],
- "core-js/modules/esnext.async-iterator.from": [
- "esnext.async-iterator.from"
- ],
- "core-js/modules/esnext.async-iterator.map": [
- "esnext.async-iterator.map"
- ],
- "core-js/modules/esnext.async-iterator.reduce": [
- "esnext.async-iterator.reduce"
- ],
- "core-js/modules/esnext.async-iterator.some": [
- "esnext.async-iterator.some"
- ],
- "core-js/modules/esnext.async-iterator.take": [
- "esnext.async-iterator.take"
- ],
- "core-js/modules/esnext.async-iterator.to-array": [
- "esnext.async-iterator.to-array"
- ],
- "core-js/modules/esnext.composite-key": [
- "esnext.composite-key"
- ],
- "core-js/modules/esnext.composite-symbol": [
- "esnext.composite-symbol"
- ],
- "core-js/modules/esnext.global-this": [
- "esnext.global-this"
- ],
- "core-js/modules/esnext.iterator.as-indexed-pairs": [
- "esnext.iterator.as-indexed-pairs"
- ],
- "core-js/modules/esnext.iterator.constructor": [
- "esnext.iterator.constructor"
- ],
- "core-js/modules/esnext.iterator.drop": [
- "esnext.iterator.drop"
- ],
- "core-js/modules/esnext.iterator.every": [
- "esnext.iterator.every"
- ],
- "core-js/modules/esnext.iterator.filter": [
- "esnext.iterator.filter"
- ],
- "core-js/modules/esnext.iterator.find": [
- "esnext.iterator.find"
- ],
- "core-js/modules/esnext.iterator.flat-map": [
- "esnext.iterator.flat-map"
- ],
- "core-js/modules/esnext.iterator.for-each": [
- "esnext.iterator.for-each"
- ],
- "core-js/modules/esnext.iterator.from": [
- "esnext.iterator.from"
- ],
- "core-js/modules/esnext.iterator.map": [
- "esnext.iterator.map"
- ],
- "core-js/modules/esnext.iterator.reduce": [
- "esnext.iterator.reduce"
- ],
- "core-js/modules/esnext.iterator.some": [
- "esnext.iterator.some"
- ],
- "core-js/modules/esnext.iterator.take": [
- "esnext.iterator.take"
- ],
- "core-js/modules/esnext.iterator.to-array": [
- "esnext.iterator.to-array"
- ],
- "core-js/modules/esnext.map.delete-all": [
- "esnext.map.delete-all"
- ],
- "core-js/modules/esnext.map.every": [
- "esnext.map.every"
- ],
- "core-js/modules/esnext.map.filter": [
- "esnext.map.filter"
- ],
- "core-js/modules/esnext.map.find": [
- "esnext.map.find"
- ],
- "core-js/modules/esnext.map.find-key": [
- "esnext.map.find-key"
- ],
- "core-js/modules/esnext.map.from": [
- "esnext.map.from"
- ],
- "core-js/modules/esnext.map.group-by": [
- "esnext.map.group-by"
- ],
- "core-js/modules/esnext.map.includes": [
- "esnext.map.includes"
- ],
- "core-js/modules/esnext.map.key-by": [
- "esnext.map.key-by"
- ],
- "core-js/modules/esnext.map.key-of": [
- "esnext.map.key-of"
- ],
- "core-js/modules/esnext.map.map-keys": [
- "esnext.map.map-keys"
- ],
- "core-js/modules/esnext.map.map-values": [
- "esnext.map.map-values"
- ],
- "core-js/modules/esnext.map.merge": [
- "esnext.map.merge"
- ],
- "core-js/modules/esnext.map.of": [
- "esnext.map.of"
- ],
- "core-js/modules/esnext.map.reduce": [
- "esnext.map.reduce"
- ],
- "core-js/modules/esnext.map.some": [
- "esnext.map.some"
- ],
- "core-js/modules/esnext.map.update": [
- "esnext.map.update"
- ],
- "core-js/modules/esnext.map.update-or-insert": [
- "esnext.map.update-or-insert"
- ],
- "core-js/modules/esnext.map.upsert": [
- "esnext.map.upsert"
- ],
- "core-js/modules/esnext.math.clamp": [
- "esnext.math.clamp"
- ],
- "core-js/modules/esnext.math.deg-per-rad": [
- "esnext.math.deg-per-rad"
- ],
- "core-js/modules/esnext.math.degrees": [
- "esnext.math.degrees"
- ],
- "core-js/modules/esnext.math.fscale": [
- "esnext.math.fscale"
- ],
- "core-js/modules/esnext.math.iaddh": [
- "esnext.math.iaddh"
- ],
- "core-js/modules/esnext.math.imulh": [
- "esnext.math.imulh"
- ],
- "core-js/modules/esnext.math.isubh": [
- "esnext.math.isubh"
- ],
- "core-js/modules/esnext.math.rad-per-deg": [
- "esnext.math.rad-per-deg"
- ],
- "core-js/modules/esnext.math.radians": [
- "esnext.math.radians"
- ],
- "core-js/modules/esnext.math.scale": [
- "esnext.math.scale"
- ],
- "core-js/modules/esnext.math.seeded-prng": [
- "esnext.math.seeded-prng"
- ],
- "core-js/modules/esnext.math.signbit": [
- "esnext.math.signbit"
- ],
- "core-js/modules/esnext.math.umulh": [
- "esnext.math.umulh"
- ],
- "core-js/modules/esnext.number.from-string": [
- "esnext.number.from-string"
- ],
- "core-js/modules/esnext.object.iterate-entries": [
- "esnext.object.iterate-entries"
- ],
- "core-js/modules/esnext.object.iterate-keys": [
- "esnext.object.iterate-keys"
- ],
- "core-js/modules/esnext.object.iterate-values": [
- "esnext.object.iterate-values"
- ],
- "core-js/modules/esnext.observable": [
- "esnext.observable"
- ],
- "core-js/modules/esnext.promise.all-settled": [
- "esnext.promise.all-settled"
- ],
- "core-js/modules/esnext.promise.any": [
- "esnext.promise.any"
- ],
- "core-js/modules/esnext.promise.try": [
- "esnext.promise.try"
- ],
- "core-js/modules/esnext.reflect.define-metadata": [
- "esnext.reflect.define-metadata"
- ],
- "core-js/modules/esnext.reflect.delete-metadata": [
- "esnext.reflect.delete-metadata"
- ],
- "core-js/modules/esnext.reflect.get-metadata": [
- "esnext.reflect.get-metadata"
- ],
- "core-js/modules/esnext.reflect.get-metadata-keys": [
- "esnext.reflect.get-metadata-keys"
- ],
- "core-js/modules/esnext.reflect.get-own-metadata": [
- "esnext.reflect.get-own-metadata"
- ],
- "core-js/modules/esnext.reflect.get-own-metadata-keys": [
- "esnext.reflect.get-own-metadata-keys"
- ],
- "core-js/modules/esnext.reflect.has-metadata": [
- "esnext.reflect.has-metadata"
- ],
- "core-js/modules/esnext.reflect.has-own-metadata": [
- "esnext.reflect.has-own-metadata"
- ],
- "core-js/modules/esnext.reflect.metadata": [
- "esnext.reflect.metadata"
- ],
- "core-js/modules/esnext.set.add-all": [
- "esnext.set.add-all"
- ],
- "core-js/modules/esnext.set.delete-all": [
- "esnext.set.delete-all"
- ],
- "core-js/modules/esnext.set.difference": [
- "esnext.set.difference"
- ],
- "core-js/modules/esnext.set.every": [
- "esnext.set.every"
- ],
- "core-js/modules/esnext.set.filter": [
- "esnext.set.filter"
- ],
- "core-js/modules/esnext.set.find": [
- "esnext.set.find"
- ],
- "core-js/modules/esnext.set.from": [
- "esnext.set.from"
- ],
- "core-js/modules/esnext.set.intersection": [
- "esnext.set.intersection"
- ],
- "core-js/modules/esnext.set.is-disjoint-from": [
- "esnext.set.is-disjoint-from"
- ],
- "core-js/modules/esnext.set.is-subset-of": [
- "esnext.set.is-subset-of"
- ],
- "core-js/modules/esnext.set.is-superset-of": [
- "esnext.set.is-superset-of"
- ],
- "core-js/modules/esnext.set.join": [
- "esnext.set.join"
- ],
- "core-js/modules/esnext.set.map": [
- "esnext.set.map"
- ],
- "core-js/modules/esnext.set.of": [
- "esnext.set.of"
- ],
- "core-js/modules/esnext.set.reduce": [
- "esnext.set.reduce"
- ],
- "core-js/modules/esnext.set.some": [
- "esnext.set.some"
- ],
- "core-js/modules/esnext.set.symmetric-difference": [
- "esnext.set.symmetric-difference"
- ],
- "core-js/modules/esnext.set.union": [
- "esnext.set.union"
- ],
- "core-js/modules/esnext.string.at": [
- "esnext.string.at"
- ],
- "core-js/modules/esnext.string.code-points": [
- "esnext.string.code-points"
- ],
- "core-js/modules/esnext.string.match-all": [
- "esnext.string.match-all"
- ],
- "core-js/modules/esnext.string.replace-all": [
- "esnext.string.replace-all"
- ],
- "core-js/modules/esnext.symbol.async-dispose": [
- "esnext.symbol.async-dispose"
- ],
- "core-js/modules/esnext.symbol.dispose": [
- "esnext.symbol.dispose"
- ],
- "core-js/modules/esnext.symbol.observable": [
- "esnext.symbol.observable"
- ],
- "core-js/modules/esnext.symbol.pattern-match": [
- "esnext.symbol.pattern-match"
- ],
- "core-js/modules/esnext.symbol.replace-all": [
- "esnext.symbol.replace-all"
- ],
- "core-js/modules/esnext.weak-map.delete-all": [
- "esnext.weak-map.delete-all"
- ],
- "core-js/modules/esnext.weak-map.from": [
- "esnext.weak-map.from"
- ],
- "core-js/modules/esnext.weak-map.of": [
- "esnext.weak-map.of"
- ],
- "core-js/modules/esnext.weak-map.upsert": [
- "esnext.weak-map.upsert"
- ],
- "core-js/modules/esnext.weak-set.add-all": [
- "esnext.weak-set.add-all"
- ],
- "core-js/modules/esnext.weak-set.delete-all": [
- "esnext.weak-set.delete-all"
- ],
- "core-js/modules/esnext.weak-set.from": [
- "esnext.weak-set.from"
- ],
- "core-js/modules/esnext.weak-set.of": [
- "esnext.weak-set.of"
- ],
- "core-js/modules/web.dom-collections.for-each": [
- "web.dom-collections.for-each"
- ],
- "core-js/modules/web.dom-collections.iterator": [
- "web.dom-collections.iterator"
- ],
- "core-js/modules/web.immediate": [
- "web.immediate"
- ],
- "core-js/modules/web.queue-microtask": [
- "web.queue-microtask"
- ],
- "core-js/modules/web.timers": [
- "web.timers"
- ],
- "core-js/modules/web.url": [
- "web.url"
- ],
- "core-js/modules/web.url-search-params": [
- "web.url-search-params"
- ],
- "core-js/modules/web.url.to-json": [
- "web.url.to-json"
- ],
- "core-js/proposals": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/proposals/array-is-template-object": [
- "esnext.array.is-template-object"
- ],
- "core-js/proposals/array-last": [
- "esnext.array.last-index",
- "esnext.array.last-item"
- ],
- "core-js/proposals/collection-methods": [
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.weak-map.delete-all",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all"
- ],
- "core-js/proposals/collection-of-from": [
- "esnext.map.from",
- "esnext.map.of",
- "esnext.set.from",
- "esnext.set.of",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-set.from",
- "esnext.weak-set.of"
- ],
- "core-js/proposals/efficient-64-bit-arithmetic": [
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.umulh"
- ],
- "core-js/proposals/global-this": [
- "esnext.global-this"
- ],
- "core-js/proposals/iterator-helpers": [
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array"
- ],
- "core-js/proposals/keys-composition": [
- "esnext.composite-key",
- "esnext.composite-symbol"
- ],
- "core-js/proposals/map-update-or-insert": [
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.weak-map.upsert"
- ],
- "core-js/proposals/map-upsert": [
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.weak-map.upsert"
- ],
- "core-js/proposals/math-extensions": [
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale"
- ],
- "core-js/proposals/math-signbit": [
- "esnext.math.signbit"
- ],
- "core-js/proposals/number-from-string": [
- "esnext.number.from-string"
- ],
- "core-js/proposals/object-iteration": [
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values"
- ],
- "core-js/proposals/observable": [
- "esnext.observable",
- "esnext.symbol.observable"
- ],
- "core-js/proposals/pattern-matching": [
- "esnext.symbol.pattern-match"
- ],
- "core-js/proposals/promise-all-settled": [
- "esnext.promise.all-settled"
- ],
- "core-js/proposals/promise-any": [
- "esnext.aggregate-error",
- "esnext.promise.any"
- ],
- "core-js/proposals/promise-try": [
- "esnext.promise.try"
- ],
- "core-js/proposals/reflect-metadata": [
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata"
- ],
- "core-js/proposals/seeded-random": [
- "esnext.math.seeded-prng"
- ],
- "core-js/proposals/set-methods": [
- "esnext.set.difference",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.symmetric-difference",
- "esnext.set.union"
- ],
- "core-js/proposals/string-at": [
- "esnext.string.at"
- ],
- "core-js/proposals/string-code-points": [
- "esnext.string.code-points"
- ],
- "core-js/proposals/string-match-all": [
- "esnext.string.match-all"
- ],
- "core-js/proposals/string-replace-all": [
- "esnext.string.replace-all",
- "esnext.symbol.replace-all"
- ],
- "core-js/proposals/url": [
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/proposals/using-statement": [
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose"
- ],
- "core-js/stable": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.data-view",
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string",
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name",
- "es.global-this",
- "es.json.stringify",
- "es.json.to-string-tag",
- "es.map",
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc",
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values",
- "es.parse-float",
- "es.parse-int",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of",
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.set",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string",
- "es.weak-map",
- "es.weak-set",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/stable/array": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.from",
- "es.array.includes",
- "es.array.index-of",
- "es.array.is-array",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.of",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map",
- "es.string.iterator"
- ],
- "core-js/stable/array-buffer": [
- "es.array-buffer.constructor",
- "es.array-buffer.is-view",
- "es.array-buffer.slice",
- "es.object.to-string"
- ],
- "core-js/stable/array-buffer/constructor": [
- "es.array-buffer.constructor",
- "es.object.to-string"
- ],
- "core-js/stable/array-buffer/is-view": [
- "es.array-buffer.is-view"
- ],
- "core-js/stable/array-buffer/slice": [
- "es.array-buffer.slice"
- ],
- "core-js/stable/array/concat": [
- "es.array.concat"
- ],
- "core-js/stable/array/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/stable/array/entries": [
- "es.array.iterator"
- ],
- "core-js/stable/array/every": [
- "es.array.every"
- ],
- "core-js/stable/array/fill": [
- "es.array.fill"
- ],
- "core-js/stable/array/filter": [
- "es.array.filter"
- ],
- "core-js/stable/array/find": [
- "es.array.find"
- ],
- "core-js/stable/array/find-index": [
- "es.array.find-index"
- ],
- "core-js/stable/array/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/stable/array/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/stable/array/for-each": [
- "es.array.for-each"
- ],
- "core-js/stable/array/from": [
- "es.array.from",
- "es.string.iterator"
- ],
- "core-js/stable/array/includes": [
- "es.array.includes"
- ],
- "core-js/stable/array/index-of": [
- "es.array.index-of"
- ],
- "core-js/stable/array/is-array": [
- "es.array.is-array"
- ],
- "core-js/stable/array/iterator": [
- "es.array.iterator"
- ],
- "core-js/stable/array/join": [
- "es.array.join"
- ],
- "core-js/stable/array/keys": [
- "es.array.iterator"
- ],
- "core-js/stable/array/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/stable/array/map": [
- "es.array.map"
- ],
- "core-js/stable/array/of": [
- "es.array.of"
- ],
- "core-js/stable/array/reduce": [
- "es.array.reduce"
- ],
- "core-js/stable/array/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/stable/array/reverse": [
- "es.array.reverse"
- ],
- "core-js/stable/array/slice": [
- "es.array.slice"
- ],
- "core-js/stable/array/some": [
- "es.array.some"
- ],
- "core-js/stable/array/sort": [
- "es.array.sort"
- ],
- "core-js/stable/array/splice": [
- "es.array.splice"
- ],
- "core-js/stable/array/values": [
- "es.array.iterator"
- ],
- "core-js/stable/array/virtual": [
- "es.array.concat",
- "es.array.copy-within",
- "es.array.every",
- "es.array.fill",
- "es.array.filter",
- "es.array.find",
- "es.array.find-index",
- "es.array.flat",
- "es.array.flat-map",
- "es.array.for-each",
- "es.array.includes",
- "es.array.index-of",
- "es.array.iterator",
- "es.array.join",
- "es.array.last-index-of",
- "es.array.map",
- "es.array.reduce",
- "es.array.reduce-right",
- "es.array.reverse",
- "es.array.slice",
- "es.array.some",
- "es.array.sort",
- "es.array.species",
- "es.array.splice",
- "es.array.unscopables.flat",
- "es.array.unscopables.flat-map"
- ],
- "core-js/stable/array/virtual/concat": [
- "es.array.concat"
- ],
- "core-js/stable/array/virtual/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/stable/array/virtual/entries": [
- "es.array.iterator"
- ],
- "core-js/stable/array/virtual/every": [
- "es.array.every"
- ],
- "core-js/stable/array/virtual/fill": [
- "es.array.fill"
- ],
- "core-js/stable/array/virtual/filter": [
- "es.array.filter"
- ],
- "core-js/stable/array/virtual/find": [
- "es.array.find"
- ],
- "core-js/stable/array/virtual/find-index": [
- "es.array.find-index"
- ],
- "core-js/stable/array/virtual/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/stable/array/virtual/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/stable/array/virtual/for-each": [
- "es.array.for-each"
- ],
- "core-js/stable/array/virtual/includes": [
- "es.array.includes"
- ],
- "core-js/stable/array/virtual/index-of": [
- "es.array.index-of"
- ],
- "core-js/stable/array/virtual/iterator": [
- "es.array.iterator"
- ],
- "core-js/stable/array/virtual/join": [
- "es.array.join"
- ],
- "core-js/stable/array/virtual/keys": [
- "es.array.iterator"
- ],
- "core-js/stable/array/virtual/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/stable/array/virtual/map": [
- "es.array.map"
- ],
- "core-js/stable/array/virtual/reduce": [
- "es.array.reduce"
- ],
- "core-js/stable/array/virtual/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/stable/array/virtual/reverse": [
- "es.array.reverse"
- ],
- "core-js/stable/array/virtual/slice": [
- "es.array.slice"
- ],
- "core-js/stable/array/virtual/some": [
- "es.array.some"
- ],
- "core-js/stable/array/virtual/sort": [
- "es.array.sort"
- ],
- "core-js/stable/array/virtual/splice": [
- "es.array.splice"
- ],
- "core-js/stable/array/virtual/values": [
- "es.array.iterator"
- ],
- "core-js/stable/clear-immediate": [
- "web.immediate"
- ],
- "core-js/stable/data-view": [
- "es.data-view",
- "es.object.to-string"
- ],
- "core-js/stable/date": [
- "es.date.now",
- "es.date.to-iso-string",
- "es.date.to-json",
- "es.date.to-primitive",
- "es.date.to-string"
- ],
- "core-js/stable/date/now": [
- "es.date.now"
- ],
- "core-js/stable/date/to-iso-string": [
- "es.date.to-iso-string",
- "es.date.to-json"
- ],
- "core-js/stable/date/to-json": [
- "es.date.to-json"
- ],
- "core-js/stable/date/to-primitive": [
- "es.date.to-primitive"
- ],
- "core-js/stable/date/to-string": [
- "es.date.to-string"
- ],
- "core-js/stable/dom-collections": [
- "es.array.iterator",
- "web.dom-collections.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/dom-collections/for-each": [
- "web.dom-collections.for-each"
- ],
- "core-js/stable/dom-collections/iterator": [
- "web.dom-collections.iterator"
- ],
- "core-js/stable/function": [
- "es.function.bind",
- "es.function.has-instance",
- "es.function.name"
- ],
- "core-js/stable/function/bind": [
- "es.function.bind"
- ],
- "core-js/stable/function/has-instance": [
- "es.function.has-instance"
- ],
- "core-js/stable/function/name": [
- "es.function.name"
- ],
- "core-js/stable/function/virtual": [
- "es.function.bind"
- ],
- "core-js/stable/function/virtual/bind": [
- "es.function.bind"
- ],
- "core-js/stable/global-this": [
- "es.global-this"
- ],
- "core-js/stable/instance/bind": [
- "es.function.bind"
- ],
- "core-js/stable/instance/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/stable/instance/concat": [
- "es.array.concat"
- ],
- "core-js/stable/instance/copy-within": [
- "es.array.copy-within"
- ],
- "core-js/stable/instance/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/stable/instance/entries": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/instance/every": [
- "es.array.every"
- ],
- "core-js/stable/instance/fill": [
- "es.array.fill"
- ],
- "core-js/stable/instance/filter": [
- "es.array.filter"
- ],
- "core-js/stable/instance/find": [
- "es.array.find"
- ],
- "core-js/stable/instance/find-index": [
- "es.array.find-index"
- ],
- "core-js/stable/instance/flags": [
- "es.regexp.flags"
- ],
- "core-js/stable/instance/flat": [
- "es.array.flat",
- "es.array.unscopables.flat"
- ],
- "core-js/stable/instance/flat-map": [
- "es.array.flat-map",
- "es.array.unscopables.flat-map"
- ],
- "core-js/stable/instance/for-each": [
- "es.array.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/instance/includes": [
- "es.array.includes",
- "es.string.includes"
- ],
- "core-js/stable/instance/index-of": [
- "es.array.index-of"
- ],
- "core-js/stable/instance/keys": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/instance/last-index-of": [
- "es.array.last-index-of"
- ],
- "core-js/stable/instance/map": [
- "es.array.map"
- ],
- "core-js/stable/instance/match-all": [
- "es.string.match-all"
- ],
- "core-js/stable/instance/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/stable/instance/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/stable/instance/reduce": [
- "es.array.reduce"
- ],
- "core-js/stable/instance/reduce-right": [
- "es.array.reduce-right"
- ],
- "core-js/stable/instance/repeat": [
- "es.string.repeat"
- ],
- "core-js/stable/instance/reverse": [
- "es.array.reverse"
- ],
- "core-js/stable/instance/slice": [
- "es.array.slice"
- ],
- "core-js/stable/instance/some": [
- "es.array.some"
- ],
- "core-js/stable/instance/sort": [
- "es.array.sort"
- ],
- "core-js/stable/instance/splice": [
- "es.array.splice"
- ],
- "core-js/stable/instance/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/stable/instance/trim": [
- "es.string.trim"
- ],
- "core-js/stable/instance/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/stable/instance/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/stable/instance/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/stable/instance/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/stable/instance/values": [
- "es.array.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/json": [
- "es.json.stringify",
- "es.json.to-string-tag"
- ],
- "core-js/stable/json/stringify": [
- "es.json.stringify"
- ],
- "core-js/stable/json/to-string-tag": [
- "es.json.to-string-tag"
- ],
- "core-js/stable/map": [
- "es.map",
- "es.object.to-string",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/math": [
- "es.math.acosh",
- "es.math.asinh",
- "es.math.atanh",
- "es.math.cbrt",
- "es.math.clz32",
- "es.math.cosh",
- "es.math.expm1",
- "es.math.fround",
- "es.math.hypot",
- "es.math.imul",
- "es.math.log10",
- "es.math.log1p",
- "es.math.log2",
- "es.math.sign",
- "es.math.sinh",
- "es.math.tanh",
- "es.math.to-string-tag",
- "es.math.trunc"
- ],
- "core-js/stable/math/acosh": [
- "es.math.acosh"
- ],
- "core-js/stable/math/asinh": [
- "es.math.asinh"
- ],
- "core-js/stable/math/atanh": [
- "es.math.atanh"
- ],
- "core-js/stable/math/cbrt": [
- "es.math.cbrt"
- ],
- "core-js/stable/math/clz32": [
- "es.math.clz32"
- ],
- "core-js/stable/math/cosh": [
- "es.math.cosh"
- ],
- "core-js/stable/math/expm1": [
- "es.math.expm1"
- ],
- "core-js/stable/math/fround": [
- "es.math.fround"
- ],
- "core-js/stable/math/hypot": [
- "es.math.hypot"
- ],
- "core-js/stable/math/imul": [
- "es.math.imul"
- ],
- "core-js/stable/math/log10": [
- "es.math.log10"
- ],
- "core-js/stable/math/log1p": [
- "es.math.log1p"
- ],
- "core-js/stable/math/log2": [
- "es.math.log2"
- ],
- "core-js/stable/math/sign": [
- "es.math.sign"
- ],
- "core-js/stable/math/sinh": [
- "es.math.sinh"
- ],
- "core-js/stable/math/tanh": [
- "es.math.tanh"
- ],
- "core-js/stable/math/to-string-tag": [
- "es.math.to-string-tag"
- ],
- "core-js/stable/math/trunc": [
- "es.math.trunc"
- ],
- "core-js/stable/number": [
- "es.number.constructor",
- "es.number.epsilon",
- "es.number.is-finite",
- "es.number.is-integer",
- "es.number.is-nan",
- "es.number.is-safe-integer",
- "es.number.max-safe-integer",
- "es.number.min-safe-integer",
- "es.number.parse-float",
- "es.number.parse-int",
- "es.number.to-fixed",
- "es.number.to-precision"
- ],
- "core-js/stable/number/constructor": [
- "es.number.constructor"
- ],
- "core-js/stable/number/epsilon": [
- "es.number.epsilon"
- ],
- "core-js/stable/number/is-finite": [
- "es.number.is-finite"
- ],
- "core-js/stable/number/is-integer": [
- "es.number.is-integer"
- ],
- "core-js/stable/number/is-nan": [
- "es.number.is-nan"
- ],
- "core-js/stable/number/is-safe-integer": [
- "es.number.is-safe-integer"
- ],
- "core-js/stable/number/max-safe-integer": [
- "es.number.max-safe-integer"
- ],
- "core-js/stable/number/min-safe-integer": [
- "es.number.min-safe-integer"
- ],
- "core-js/stable/number/parse-float": [
- "es.number.parse-float"
- ],
- "core-js/stable/number/parse-int": [
- "es.number.parse-int"
- ],
- "core-js/stable/number/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/stable/number/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/stable/number/virtual": [
- "es.number.to-fixed",
- "es.number.to-precision"
- ],
- "core-js/stable/number/virtual/to-fixed": [
- "es.number.to-fixed"
- ],
- "core-js/stable/number/virtual/to-precision": [
- "es.number.to-precision"
- ],
- "core-js/stable/object": [
- "es.symbol",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.assign",
- "es.object.create",
- "es.object.define-getter",
- "es.object.define-properties",
- "es.object.define-property",
- "es.object.define-setter",
- "es.object.entries",
- "es.object.freeze",
- "es.object.from-entries",
- "es.object.get-own-property-descriptor",
- "es.object.get-own-property-descriptors",
- "es.object.get-own-property-names",
- "es.object.get-prototype-of",
- "es.object.is",
- "es.object.is-extensible",
- "es.object.is-frozen",
- "es.object.is-sealed",
- "es.object.keys",
- "es.object.lookup-getter",
- "es.object.lookup-setter",
- "es.object.prevent-extensions",
- "es.object.seal",
- "es.object.set-prototype-of",
- "es.object.to-string",
- "es.object.values"
- ],
- "core-js/stable/object/assign": [
- "es.object.assign"
- ],
- "core-js/stable/object/create": [
- "es.object.create"
- ],
- "core-js/stable/object/define-getter": [
- "es.object.define-getter"
- ],
- "core-js/stable/object/define-properties": [
- "es.object.define-properties"
- ],
- "core-js/stable/object/define-property": [
- "es.object.define-property"
- ],
- "core-js/stable/object/define-setter": [
- "es.object.define-setter"
- ],
- "core-js/stable/object/entries": [
- "es.object.entries"
- ],
- "core-js/stable/object/freeze": [
- "es.object.freeze"
- ],
- "core-js/stable/object/from-entries": [
- "es.array.iterator",
- "es.object.from-entries"
- ],
- "core-js/stable/object/get-own-property-descriptor": [
- "es.object.get-own-property-descriptor"
- ],
- "core-js/stable/object/get-own-property-descriptors": [
- "es.object.get-own-property-descriptors"
- ],
- "core-js/stable/object/get-own-property-names": [
- "es.object.get-own-property-names"
- ],
- "core-js/stable/object/get-own-property-symbols": [
- "es.symbol"
- ],
- "core-js/stable/object/get-prototype-of": [
- "es.object.get-prototype-of"
- ],
- "core-js/stable/object/is": [
- "es.object.is"
- ],
- "core-js/stable/object/is-extensible": [
- "es.object.is-extensible"
- ],
- "core-js/stable/object/is-frozen": [
- "es.object.is-frozen"
- ],
- "core-js/stable/object/is-sealed": [
- "es.object.is-sealed"
- ],
- "core-js/stable/object/keys": [
- "es.object.keys"
- ],
- "core-js/stable/object/lookup-getter": [
- "es.object.lookup-setter"
- ],
- "core-js/stable/object/lookup-setter": [
- "es.object.lookup-setter"
- ],
- "core-js/stable/object/prevent-extensions": [
- "es.object.prevent-extensions"
- ],
- "core-js/stable/object/seal": [
- "es.object.seal"
- ],
- "core-js/stable/object/set-prototype-of": [
- "es.object.set-prototype-of"
- ],
- "core-js/stable/object/to-string": [
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/stable/object/values": [
- "es.object.values"
- ],
- "core-js/stable/parse-float": [
- "es.parse-float"
- ],
- "core-js/stable/parse-int": [
- "es.parse-int"
- ],
- "core-js/stable/promise": [
- "es.object.to-string",
- "es.promise",
- "es.promise.all-settled",
- "es.promise.finally",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/promise/all-settled": [
- "es.promise",
- "es.promise.all-settled"
- ],
- "core-js/stable/promise/finally": [
- "es.promise",
- "es.promise.finally"
- ],
- "core-js/stable/queue-microtask": [
- "web.queue-microtask"
- ],
- "core-js/stable/reflect": [
- "es.reflect.apply",
- "es.reflect.construct",
- "es.reflect.define-property",
- "es.reflect.delete-property",
- "es.reflect.get",
- "es.reflect.get-own-property-descriptor",
- "es.reflect.get-prototype-of",
- "es.reflect.has",
- "es.reflect.is-extensible",
- "es.reflect.own-keys",
- "es.reflect.prevent-extensions",
- "es.reflect.set",
- "es.reflect.set-prototype-of"
- ],
- "core-js/stable/reflect/apply": [
- "es.reflect.apply"
- ],
- "core-js/stable/reflect/construct": [
- "es.reflect.construct"
- ],
- "core-js/stable/reflect/define-property": [
- "es.reflect.define-property"
- ],
- "core-js/stable/reflect/delete-property": [
- "es.reflect.delete-property"
- ],
- "core-js/stable/reflect/get": [
- "es.reflect.get"
- ],
- "core-js/stable/reflect/get-own-property-descriptor": [
- "es.reflect.get-own-property-descriptor"
- ],
- "core-js/stable/reflect/get-prototype-of": [
- "es.reflect.get-prototype-of"
- ],
- "core-js/stable/reflect/has": [
- "es.reflect.has"
- ],
- "core-js/stable/reflect/is-extensible": [
- "es.reflect.is-extensible"
- ],
- "core-js/stable/reflect/own-keys": [
- "es.reflect.own-keys"
- ],
- "core-js/stable/reflect/prevent-extensions": [
- "es.reflect.prevent-extensions"
- ],
- "core-js/stable/reflect/set": [
- "es.reflect.set"
- ],
- "core-js/stable/reflect/set-prototype-of": [
- "es.reflect.set-prototype-of"
- ],
- "core-js/stable/regexp": [
- "es.regexp.constructor",
- "es.regexp.exec",
- "es.regexp.flags",
- "es.regexp.sticky",
- "es.regexp.test",
- "es.regexp.to-string",
- "es.string.match",
- "es.string.replace",
- "es.string.search",
- "es.string.split"
- ],
- "core-js/stable/regexp/constructor": [
- "es.regexp.constructor"
- ],
- "core-js/stable/regexp/flags": [
- "es.regexp.flags"
- ],
- "core-js/stable/regexp/match": [
- "es.string.match"
- ],
- "core-js/stable/regexp/replace": [
- "es.string.replace"
- ],
- "core-js/stable/regexp/search": [
- "es.string.search"
- ],
- "core-js/stable/regexp/split": [
- "es.string.split"
- ],
- "core-js/stable/regexp/sticky": [
- "es.regexp.sticky"
- ],
- "core-js/stable/regexp/test": [
- "es.regexp.exec",
- "es.regexp.test"
- ],
- "core-js/stable/regexp/to-string": [
- "es.regexp.to-string"
- ],
- "core-js/stable/set": [
- "es.object.to-string",
- "es.set",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/set-immediate": [
- "web.immediate"
- ],
- "core-js/stable/set-interval": [
- "web.timers"
- ],
- "core-js/stable/set-timeout": [
- "web.timers"
- ],
- "core-js/stable/string": [
- "es.regexp.exec",
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.from-code-point",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.raw",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup"
- ],
- "core-js/stable/string/anchor": [
- "es.string.anchor"
- ],
- "core-js/stable/string/big": [
- "es.string.big"
- ],
- "core-js/stable/string/blink": [
- "es.string.blink"
- ],
- "core-js/stable/string/bold": [
- "es.string.bold"
- ],
- "core-js/stable/string/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/stable/string/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/stable/string/fixed": [
- "es.string.fixed"
- ],
- "core-js/stable/string/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/stable/string/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/stable/string/from-code-point": [
- "es.string.from-code-point"
- ],
- "core-js/stable/string/includes": [
- "es.string.includes"
- ],
- "core-js/stable/string/italics": [
- "es.string.italics"
- ],
- "core-js/stable/string/iterator": [
- "es.string.iterator"
- ],
- "core-js/stable/string/link": [
- "es.string.link"
- ],
- "core-js/stable/string/match": [
- "es.regexp.exec",
- "es.string.match"
- ],
- "core-js/stable/string/match-all": [
- "es.string.match-all"
- ],
- "core-js/stable/string/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/stable/string/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/stable/string/raw": [
- "es.string.raw"
- ],
- "core-js/stable/string/repeat": [
- "es.string.repeat"
- ],
- "core-js/stable/string/replace": [
- "es.regexp.exec",
- "es.string.replace"
- ],
- "core-js/stable/string/search": [
- "es.regexp.exec",
- "es.string.search"
- ],
- "core-js/stable/string/small": [
- "es.string.small"
- ],
- "core-js/stable/string/split": [
- "es.regexp.exec",
- "es.string.split"
- ],
- "core-js/stable/string/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/stable/string/strike": [
- "es.string.strike"
- ],
- "core-js/stable/string/sub": [
- "es.string.sub"
- ],
- "core-js/stable/string/sup": [
- "es.string.sup"
- ],
- "core-js/stable/string/trim": [
- "es.string.trim"
- ],
- "core-js/stable/string/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/stable/string/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/stable/string/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/stable/string/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/stable/string/virtual": [
- "es.string.code-point-at",
- "es.string.ends-with",
- "es.string.includes",
- "es.string.iterator",
- "es.string.match",
- "es.string.match-all",
- "es.string.pad-end",
- "es.string.pad-start",
- "es.string.repeat",
- "es.string.replace",
- "es.string.search",
- "es.string.split",
- "es.string.starts-with",
- "es.string.trim",
- "es.string.trim-end",
- "es.string.trim-start",
- "es.string.anchor",
- "es.string.big",
- "es.string.blink",
- "es.string.bold",
- "es.string.fixed",
- "es.string.fontcolor",
- "es.string.fontsize",
- "es.string.italics",
- "es.string.link",
- "es.string.small",
- "es.string.strike",
- "es.string.sub",
- "es.string.sup"
- ],
- "core-js/stable/string/virtual/anchor": [
- "es.string.anchor"
- ],
- "core-js/stable/string/virtual/big": [
- "es.string.big"
- ],
- "core-js/stable/string/virtual/blink": [
- "es.string.blink"
- ],
- "core-js/stable/string/virtual/bold": [
- "es.string.bold"
- ],
- "core-js/stable/string/virtual/code-point-at": [
- "es.string.code-point-at"
- ],
- "core-js/stable/string/virtual/ends-with": [
- "es.string.ends-with"
- ],
- "core-js/stable/string/virtual/fixed": [
- "es.string.fixed"
- ],
- "core-js/stable/string/virtual/fontcolor": [
- "es.string.fontcolor"
- ],
- "core-js/stable/string/virtual/fontsize": [
- "es.string.fontsize"
- ],
- "core-js/stable/string/virtual/includes": [
- "es.string.includes"
- ],
- "core-js/stable/string/virtual/italics": [
- "es.string.italics"
- ],
- "core-js/stable/string/virtual/iterator": [
- "es.string.iterator"
- ],
- "core-js/stable/string/virtual/link": [
- "es.string.link"
- ],
- "core-js/stable/string/virtual/match-all": [
- "es.string.match-all"
- ],
- "core-js/stable/string/virtual/pad-end": [
- "es.string.pad-end"
- ],
- "core-js/stable/string/virtual/pad-start": [
- "es.string.pad-start"
- ],
- "core-js/stable/string/virtual/repeat": [
- "es.string.repeat"
- ],
- "core-js/stable/string/virtual/small": [
- "es.string.small"
- ],
- "core-js/stable/string/virtual/starts-with": [
- "es.string.starts-with"
- ],
- "core-js/stable/string/virtual/strike": [
- "es.string.strike"
- ],
- "core-js/stable/string/virtual/sub": [
- "es.string.sub"
- ],
- "core-js/stable/string/virtual/sup": [
- "es.string.sup"
- ],
- "core-js/stable/string/virtual/trim": [
- "es.string.trim"
- ],
- "core-js/stable/string/virtual/trim-end": [
- "es.string.trim-end"
- ],
- "core-js/stable/string/virtual/trim-left": [
- "es.string.trim-start"
- ],
- "core-js/stable/string/virtual/trim-right": [
- "es.string.trim-end"
- ],
- "core-js/stable/string/virtual/trim-start": [
- "es.string.trim-start"
- ],
- "core-js/stable/symbol": [
- "es.symbol",
- "es.symbol.description",
- "es.symbol.async-iterator",
- "es.symbol.has-instance",
- "es.symbol.is-concat-spreadable",
- "es.symbol.iterator",
- "es.symbol.match",
- "es.symbol.match-all",
- "es.symbol.replace",
- "es.symbol.search",
- "es.symbol.species",
- "es.symbol.split",
- "es.symbol.to-primitive",
- "es.symbol.to-string-tag",
- "es.symbol.unscopables",
- "es.array.concat",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/stable/symbol/async-iterator": [
- "es.symbol.async-iterator"
- ],
- "core-js/stable/symbol/description": [
- "es.symbol.description"
- ],
- "core-js/stable/symbol/for": [
- "es.symbol"
- ],
- "core-js/stable/symbol/has-instance": [
- "es.symbol.has-instance",
- "es.function.has-instance"
- ],
- "core-js/stable/symbol/is-concat-spreadable": [
- "es.symbol.is-concat-spreadable",
- "es.array.concat"
- ],
- "core-js/stable/symbol/iterator": [
- "es.symbol.iterator",
- "es.string.iterator",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/symbol/key-for": [
- "es.symbol"
- ],
- "core-js/stable/symbol/match": [
- "es.symbol.match",
- "es.string.match"
- ],
- "core-js/stable/symbol/match-all": [
- "es.symbol.match-all",
- "es.string.match-all"
- ],
- "core-js/stable/symbol/replace": [
- "es.symbol.replace",
- "es.string.replace"
- ],
- "core-js/stable/symbol/search": [
- "es.symbol.search",
- "es.string.search"
- ],
- "core-js/stable/symbol/species": [
- "es.symbol.species"
- ],
- "core-js/stable/symbol/split": [
- "es.symbol.split",
- "es.string.split"
- ],
- "core-js/stable/symbol/to-primitive": [
- "es.symbol.to-primitive"
- ],
- "core-js/stable/symbol/to-string-tag": [
- "es.symbol.to-string-tag",
- "es.json.to-string-tag",
- "es.math.to-string-tag",
- "es.object.to-string"
- ],
- "core-js/stable/symbol/unscopables": [
- "es.symbol.unscopables"
- ],
- "core-js/stable/typed-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.float64-array",
- "es.typed-array.int8-array",
- "es.typed-array.int16-array",
- "es.typed-array.int32-array",
- "es.typed-array.uint8-array",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.uint16-array",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/copy-within": [
- "es.typed-array.copy-within"
- ],
- "core-js/stable/typed-array/entries": [
- "es.typed-array.iterator"
- ],
- "core-js/stable/typed-array/every": [
- "es.typed-array.every"
- ],
- "core-js/stable/typed-array/fill": [
- "es.typed-array.fill"
- ],
- "core-js/stable/typed-array/filter": [
- "es.typed-array.filter"
- ],
- "core-js/stable/typed-array/find": [
- "es.typed-array.find"
- ],
- "core-js/stable/typed-array/find-index": [
- "es.typed-array.find-index"
- ],
- "core-js/stable/typed-array/float32-array": [
- "es.object.to-string",
- "es.typed-array.float32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/float64-array": [
- "es.object.to-string",
- "es.typed-array.float64-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/for-each": [
- "es.typed-array.for-each"
- ],
- "core-js/stable/typed-array/from": [
- "es.typed-array.from"
- ],
- "core-js/stable/typed-array/includes": [
- "es.typed-array.includes"
- ],
- "core-js/stable/typed-array/index-of": [
- "es.typed-array.index-of"
- ],
- "core-js/stable/typed-array/int16-array": [
- "es.object.to-string",
- "es.typed-array.int16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/int32-array": [
- "es.object.to-string",
- "es.typed-array.int32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/int8-array": [
- "es.object.to-string",
- "es.typed-array.int8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/iterator": [
- "es.typed-array.iterator"
- ],
- "core-js/stable/typed-array/join": [
- "es.typed-array.join"
- ],
- "core-js/stable/typed-array/keys": [
- "es.typed-array.iterator"
- ],
- "core-js/stable/typed-array/last-index-of": [
- "es.typed-array.last-index-of"
- ],
- "core-js/stable/typed-array/map": [
- "es.typed-array.map"
- ],
- "core-js/stable/typed-array/of": [
- "es.typed-array.of"
- ],
- "core-js/stable/typed-array/reduce": [
- "es.typed-array.reduce"
- ],
- "core-js/stable/typed-array/reduce-right": [
- "es.typed-array.reduce-right"
- ],
- "core-js/stable/typed-array/reverse": [
- "es.typed-array.reverse"
- ],
- "core-js/stable/typed-array/set": [
- "es.typed-array.set"
- ],
- "core-js/stable/typed-array/slice": [
- "es.typed-array.slice"
- ],
- "core-js/stable/typed-array/some": [
- "es.typed-array.some"
- ],
- "core-js/stable/typed-array/sort": [
- "es.typed-array.sort"
- ],
- "core-js/stable/typed-array/subarray": [
- "es.typed-array.subarray"
- ],
- "core-js/stable/typed-array/to-locale-string": [
- "es.typed-array.to-locale-string"
- ],
- "core-js/stable/typed-array/to-string": [
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/uint16-array": [
- "es.object.to-string",
- "es.typed-array.uint16-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/uint32-array": [
- "es.object.to-string",
- "es.typed-array.uint32-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/uint8-array": [
- "es.object.to-string",
- "es.typed-array.uint8-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/uint8-clamped-array": [
- "es.object.to-string",
- "es.typed-array.uint8-clamped-array",
- "es.typed-array.copy-within",
- "es.typed-array.every",
- "es.typed-array.fill",
- "es.typed-array.filter",
- "es.typed-array.find",
- "es.typed-array.find-index",
- "es.typed-array.for-each",
- "es.typed-array.from",
- "es.typed-array.includes",
- "es.typed-array.index-of",
- "es.typed-array.iterator",
- "es.typed-array.join",
- "es.typed-array.last-index-of",
- "es.typed-array.map",
- "es.typed-array.of",
- "es.typed-array.reduce",
- "es.typed-array.reduce-right",
- "es.typed-array.reverse",
- "es.typed-array.set",
- "es.typed-array.slice",
- "es.typed-array.some",
- "es.typed-array.sort",
- "es.typed-array.subarray",
- "es.typed-array.to-locale-string",
- "es.typed-array.to-string"
- ],
- "core-js/stable/typed-array/values": [
- "es.typed-array.iterator"
- ],
- "core-js/stable/url": [
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/stable/url-search-params": [
- "web.url-search-params"
- ],
- "core-js/stable/url/to-json": [
- "web.url.to-json"
- ],
- "core-js/stable/weak-map": [
- "es.object.to-string",
- "es.weak-map",
- "web.dom-collections.iterator"
- ],
- "core-js/stable/weak-set": [
- "es.object.to-string",
- "es.weak-set",
- "web.dom-collections.iterator"
- ],
- "core-js/stage": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/stage/0": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/stage/1": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of"
- ],
- "core-js/stage/2": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.set.difference",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.replace-all",
- "esnext.weak-map.upsert"
- ],
- "core-js/stage/3": [
- "esnext.aggregate-error",
- "esnext.global-this",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.replace-all"
- ],
- "core-js/stage/4": [
- "esnext.global-this",
- "esnext.promise.all-settled",
- "esnext.string.match-all"
- ],
- "core-js/stage/pre": [
- "esnext.aggregate-error",
- "esnext.array.is-template-object",
- "esnext.array.last-index",
- "esnext.array.last-item",
- "esnext.async-iterator.constructor",
- "esnext.async-iterator.as-indexed-pairs",
- "esnext.async-iterator.drop",
- "esnext.async-iterator.every",
- "esnext.async-iterator.filter",
- "esnext.async-iterator.find",
- "esnext.async-iterator.flat-map",
- "esnext.async-iterator.for-each",
- "esnext.async-iterator.from",
- "esnext.async-iterator.map",
- "esnext.async-iterator.reduce",
- "esnext.async-iterator.some",
- "esnext.async-iterator.take",
- "esnext.async-iterator.to-array",
- "esnext.composite-key",
- "esnext.composite-symbol",
- "esnext.global-this",
- "esnext.iterator.constructor",
- "esnext.iterator.as-indexed-pairs",
- "esnext.iterator.drop",
- "esnext.iterator.every",
- "esnext.iterator.filter",
- "esnext.iterator.find",
- "esnext.iterator.flat-map",
- "esnext.iterator.for-each",
- "esnext.iterator.from",
- "esnext.iterator.map",
- "esnext.iterator.reduce",
- "esnext.iterator.some",
- "esnext.iterator.take",
- "esnext.iterator.to-array",
- "esnext.map.delete-all",
- "esnext.map.every",
- "esnext.map.filter",
- "esnext.map.find",
- "esnext.map.find-key",
- "esnext.map.from",
- "esnext.map.group-by",
- "esnext.map.includes",
- "esnext.map.key-by",
- "esnext.map.key-of",
- "esnext.map.map-keys",
- "esnext.map.map-values",
- "esnext.map.merge",
- "esnext.map.of",
- "esnext.map.reduce",
- "esnext.map.some",
- "esnext.map.update",
- "esnext.map.update-or-insert",
- "esnext.map.upsert",
- "esnext.math.clamp",
- "esnext.math.deg-per-rad",
- "esnext.math.degrees",
- "esnext.math.fscale",
- "esnext.math.iaddh",
- "esnext.math.imulh",
- "esnext.math.isubh",
- "esnext.math.rad-per-deg",
- "esnext.math.radians",
- "esnext.math.scale",
- "esnext.math.seeded-prng",
- "esnext.math.signbit",
- "esnext.math.umulh",
- "esnext.number.from-string",
- "esnext.object.iterate-entries",
- "esnext.object.iterate-keys",
- "esnext.object.iterate-values",
- "esnext.observable",
- "esnext.promise.all-settled",
- "esnext.promise.any",
- "esnext.promise.try",
- "esnext.reflect.define-metadata",
- "esnext.reflect.delete-metadata",
- "esnext.reflect.get-metadata",
- "esnext.reflect.get-metadata-keys",
- "esnext.reflect.get-own-metadata",
- "esnext.reflect.get-own-metadata-keys",
- "esnext.reflect.has-metadata",
- "esnext.reflect.has-own-metadata",
- "esnext.reflect.metadata",
- "esnext.set.add-all",
- "esnext.set.delete-all",
- "esnext.set.difference",
- "esnext.set.every",
- "esnext.set.filter",
- "esnext.set.find",
- "esnext.set.from",
- "esnext.set.intersection",
- "esnext.set.is-disjoint-from",
- "esnext.set.is-subset-of",
- "esnext.set.is-superset-of",
- "esnext.set.join",
- "esnext.set.map",
- "esnext.set.of",
- "esnext.set.reduce",
- "esnext.set.some",
- "esnext.set.symmetric-difference",
- "esnext.set.union",
- "esnext.string.at",
- "esnext.string.code-points",
- "esnext.string.match-all",
- "esnext.string.replace-all",
- "esnext.symbol.async-dispose",
- "esnext.symbol.dispose",
- "esnext.symbol.observable",
- "esnext.symbol.pattern-match",
- "esnext.symbol.replace-all",
- "esnext.weak-map.delete-all",
- "esnext.weak-map.from",
- "esnext.weak-map.of",
- "esnext.weak-map.upsert",
- "esnext.weak-set.add-all",
- "esnext.weak-set.delete-all",
- "esnext.weak-set.from",
- "esnext.weak-set.of",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/web": [
- "web.dom-collections.for-each",
- "web.dom-collections.iterator",
- "web.immediate",
- "web.queue-microtask",
- "web.timers",
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/web/dom-collections": [
- "web.dom-collections.for-each",
- "web.dom-collections.iterator"
- ],
- "core-js/web/immediate": [
- "web.immediate"
- ],
- "core-js/web/queue-microtask": [
- "web.queue-microtask"
- ],
- "core-js/web/timers": [
- "web.timers"
- ],
- "core-js/web/url": [
- "web.url",
- "web.url.to-json",
- "web.url-search-params"
- ],
- "core-js/web/url-search-params": [
- "web.url-search-params"
- ]
- };
- function isBabelPolyfillSource(source) {
- return source === "@babel/polyfill" || source === "babel-polyfill";
- }
- function isCoreJSSource(source) {
- if (typeof source === "string") {
- source = source.replace(/\\/g, "/").replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase();
- }
- return has$6(corejsEntries, source) && corejsEntries[source];
- }
- var BABEL_POLYFILL_DEPRECATION = "\n `@babel/polyfill` is deprecated. Please, use required parts of `core-js`\n and `regenerator-runtime/runtime` separately";
- function replaceCoreJS3EntryPlugin (_, _ref) {
- var corejs = _ref.corejs,
- include = _ref.include,
- exclude = _ref.exclude,
- polyfillTargets = _ref.polyfillTargets,
- debug = _ref.debug;
- var polyfills = filterItems(corejs3Polyfills, include, exclude, polyfillTargets, null);
- var available = new Set(getModulesListForTargetVersion(corejs.version));
- function shouldReplace(source, modules) {
- if (!modules) return false;
- if (modules.length === 1 && polyfills.has(modules[0]) && available.has(modules[0]) && getModulePath(modules[0]) === source) {
- return false;
- }
- return true;
- }
- var isPolyfillImport = {
- ImportDeclaration: function ImportDeclaration(path) {
- var source = getImportSource(path);
- if (!source) return;
- if (isBabelPolyfillSource(source)) {
- console.warn(BABEL_POLYFILL_DEPRECATION);
- } else {
- var modules = isCoreJSSource(source);
- if (shouldReplace(source, modules)) {
- this.replaceBySeparateModulesImport(path, modules);
- }
- }
- },
- Program: {
- enter: function enter(path) {
- var _this = this;
- path.get("body").forEach(function (bodyPath) {
- var source = getRequireSource(bodyPath);
- if (!source) return;
- if (isBabelPolyfillSource(source)) {
- console.warn(BABEL_POLYFILL_DEPRECATION);
- } else {
- var modules = isCoreJSSource(source);
- if (shouldReplace(source, modules)) {
- _this.replaceBySeparateModulesImport(bodyPath, modules);
- }
- }
- });
- },
- exit: function exit(path) {
- var _this2 = this;
- var filtered = intersection(polyfills, this.polyfillsSet, available);
- var reversed = Array.from(filtered).reverse();
- for (var _iterator = reversed, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
- var _ref2;
- if (_isArray) {
- if (_i >= _iterator.length) break;
- _ref2 = _iterator[_i++];
- } else {
- _i = _iterator.next();
- if (_i.done) break;
- _ref2 = _i.value;
- }
- var module = _ref2;
- if (!this.injectedPolyfills.has(module)) {
- createImport(path, module);
- }
- }
- filtered.forEach(function (module) {
- return _this2.injectedPolyfills.add(module);
- });
- }
- }
- };
- return {
- name: "corejs3-entry",
- visitor: isPolyfillImport,
- pre: function pre() {
- this.injectedPolyfills = new Set();
- this.polyfillsSet = new Set();
- this.replaceBySeparateModulesImport = function (path, modules) {
- for (var _iterator2 = modules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
- var _ref3;
- if (_isArray2) {
- if (_i2 >= _iterator2.length) break;
- _ref3 = _iterator2[_i2++];
- } else {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref3 = _i2.value;
- }
- var module = _ref3;
- this.polyfillsSet.add(module);
- }
- path.remove();
- };
- },
- post: function post() {
- if (debug) {
- logEntryPolyfills("core-js", this.injectedPolyfills.size > 0, this.injectedPolyfills, this.file.opts.filename, polyfillTargets, corejs3Polyfills);
- }
- }
- };
- }
- function isRegeneratorSource(source) {
- return source === "regenerator-runtime/runtime";
- }
- function removeRegeneratorEntryPlugin () {
- var visitor = {
- ImportDeclaration: function ImportDeclaration(path) {
- if (isRegeneratorSource(getImportSource(path))) {
- this.regeneratorImportExcluded = true;
- path.remove();
- }
- },
- Program: function Program(path) {
- var _this = this;
- path.get("body").forEach(function (bodyPath) {
- if (isRegeneratorSource(getRequireSource(bodyPath))) {
- _this.regeneratorImportExcluded = true;
- bodyPath.remove();
- }
- });
- }
- };
- return {
- name: "regenerator-entry",
- visitor: visitor,
- pre: function pre() {
- this.regeneratorImportExcluded = false;
- },
- post: function post() {
- if (this.opts.debug && this.regeneratorImportExcluded) {
- var filename = this.file.opts.filename;
- if (process.env.BABEL_ENV === "test") {
- filename = filename.replace(/\\/g, "/");
- }
- console.log("\n[" + filename + "] Based on your targets, regenerator-runtime import excluded.");
- }
- }
- };
- }
- var lib$c = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-async-generators",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("asyncGenerators");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxAsyncGenerators$2 = unwrapExports(lib$c);
- var lib$d = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-dynamic-import",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("dynamicImport");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxDynamicImport$2 = unwrapExports(lib$d);
- var lib$e = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-json-strings",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("jsonStrings");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxJsonStrings$1 = unwrapExports(lib$e);
- var lib$f = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-nullish-coalescing-operator",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("nullishCoalescingOperator");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxNullishCoalescingOperator$1 = unwrapExports(lib$f);
- var lib$g = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-object-rest-spread",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("objectRestSpread");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxObjectRestSpread$2 = unwrapExports(lib$g);
- var lib$h = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-optional-catch-binding",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("optionalCatchBinding");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxOptionalCatchBinding$2 = unwrapExports(lib$h);
- var lib$i = createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports["default"] = void 0;
- var _default = (0, _helperPluginUtils.declare)(function (api) {
- api.assertVersion(7);
- return {
- name: "syntax-optional-chaining",
- manipulateOptions: function manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("optionalChaining");
- }
- };
- });
- exports["default"] = _default;
- });
- var syntaxOptionalChaining$1 = unwrapExports(lib$i);
- var availablePlugins = {
- "proposal-async-generator-functions": proposalAsyncGeneratorFunctions,
- "proposal-dynamic-import": proposalDynamicImport,
- "proposal-json-strings": proposalJsonStrings,
- "proposal-nullish-coalescing-operator": proposalNullishCoalescingOperator,
- "proposal-object-rest-spread": proposalObjectRestSpread,
- "proposal-optional-catch-binding": proposalOptionalCatchBinding,
- "proposal-optional-chaining": proposalOptionalChaining,
- "proposal-unicode-property-regex": proposalUnicodePropertyRegex,
- "syntax-async-generators": syntaxAsyncGenerators$2,
- "syntax-dynamic-import": syntaxDynamicImport$2,
- "syntax-json-strings": syntaxJsonStrings$1,
- "syntax-nullish-coalescing-operator": syntaxNullishCoalescingOperator$1,
- "syntax-object-rest-spread": syntaxObjectRestSpread$2,
- "syntax-optional-catch-binding": syntaxOptionalCatchBinding$2,
- "syntax-optional-chaining": syntaxOptionalChaining$1,
- "syntax-top-level-await": syntaxTopLevelAwait,
- "transform-arrow-functions": transformArrowFunctions,
- "transform-async-to-generator": transformAsyncToGenerator,
- "transform-block-scoped-functions": transformBlockScopedFunctions,
- "transform-block-scoping": transformBlockScoping,
- "transform-classes": transformClasses,
- "transform-computed-properties": transformComputedProperties,
- "transform-destructuring": transformDestructuring,
- "transform-dotall-regex": transformDotallRegex,
- "transform-duplicate-keys": transformDuplicateKeys,
- "transform-exponentiation-operator": transformExponentialOperator,
- "transform-for-of": transformForOf,
- "transform-function-name": transformFunctionName,
- "transform-literals": transformLiterals,
- "transform-member-expression-literals": transformMemberExpressionLiterals,
- "transform-modules-amd": transformModulesAmd,
- "transform-modules-commonjs": transformModulesCommonjs,
- "transform-modules-systemjs": transformModulesSystemjs,
- "transform-modules-umd": transformModulesUmd,
- "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex,
- "transform-new-target": transformNewTarget,
- "transform-object-super": transformObjectSuper,
- "transform-parameters": transformParameters,
- "transform-property-literals": transformPropertyLiterals,
- "transform-regenerator": transformRegenerator,
- "transform-reserved-words": transformReservedWords,
- "transform-shorthand-properties": transformShorthandProperties,
- "transform-spread": transformSpread,
- "transform-sticky-regex": transformStickyRegex,
- "transform-template-literals": transformTemplateLiterals,
- "transform-typeof-symbol": transformTypeofSymbol,
- "transform-unicode-regex": transformUnicodeRegex
- };
- var pluginListWithoutProposals = filterStageFromList(plugins$2, shippedProposals_2);
- var getPlugin = function getPlugin(pluginName) {
- var plugin = availablePlugins[pluginName];
- if (!plugin) {
- throw new Error("Could not find plugin \"" + pluginName + "\". Ensure there is an entry in ./available-plugins.js for it.");
- }
- return plugin;
- };
- var transformIncludesAndExcludes = function transformIncludesAndExcludes(opts) {
- return opts.reduce(function (result, opt) {
- var target = opt.match(/^(es|es6|es7|esnext|web)\./) ? "builtIns" : "plugins";
- result[target].add(opt);
- return result;
- }, {
- all: opts,
- plugins: new Set(),
- builtIns: new Set()
- });
- };
- var getModulesPluginNames = function getModulesPluginNames(_ref) {
- var modules = _ref.modules,
- transformations = _ref.transformations,
- shouldTransformESM = _ref.shouldTransformESM,
- shouldTransformDynamicImport = _ref.shouldTransformDynamicImport,
- shouldParseTopLevelAwait = _ref.shouldParseTopLevelAwait;
- var modulesPluginNames = [];
- if (modules !== false && transformations[modules]) {
- if (shouldTransformESM) {
- modulesPluginNames.push(transformations[modules]);
- }
- if (shouldTransformDynamicImport && shouldTransformESM && modules !== "umd") {
- modulesPluginNames.push("proposal-dynamic-import");
- } else {
- if (shouldTransformDynamicImport) {
- console.warn("Dynamic import can only be supported when transforming ES modules" + " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.");
- }
- modulesPluginNames.push("syntax-dynamic-import");
- }
- } else {
- modulesPluginNames.push("syntax-dynamic-import");
- }
- if (shouldParseTopLevelAwait) {
- modulesPluginNames.push("syntax-top-level-await");
- }
- return modulesPluginNames;
- };
- var getPolyfillPlugins = function getPolyfillPlugins(_ref2) {
- var useBuiltIns = _ref2.useBuiltIns,
- corejs = _ref2.corejs,
- polyfillTargets = _ref2.polyfillTargets,
- include = _ref2.include,
- exclude = _ref2.exclude,
- proposals = _ref2.proposals,
- shippedProposals = _ref2.shippedProposals,
- regenerator = _ref2.regenerator,
- debug = _ref2.debug;
- var polyfillPlugins = [];
- if (useBuiltIns === "usage" || useBuiltIns === "entry") {
- var pluginOptions = {
- corejs: corejs,
- polyfillTargets: polyfillTargets,
- include: include,
- exclude: exclude,
- proposals: proposals,
- shippedProposals: shippedProposals,
- regenerator: regenerator,
- debug: debug
- };
- if (corejs) {
- if (useBuiltIns === "usage") {
- if (corejs.major === 2) {
- polyfillPlugins.push([addCoreJS2UsagePlugin, pluginOptions]);
- } else {
- polyfillPlugins.push([addCoreJS3UsagePlugin, pluginOptions]);
- }
- if (regenerator) {
- polyfillPlugins.push([addRegeneratorUsagePlugin, pluginOptions]);
- }
- } else {
- if (corejs.major === 2) {
- polyfillPlugins.push([replaceCoreJS2EntryPlugin, pluginOptions]);
- } else {
- polyfillPlugins.push([replaceCoreJS3EntryPlugin, pluginOptions]);
- if (!regenerator) {
- polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);
- }
- }
- }
- }
- }
- return polyfillPlugins;
- };
- function supportsStaticESM$1(caller) {
- return !!(caller && caller.supportsStaticESM);
- }
- function supportsDynamicImport(caller) {
- return !!(caller && caller.supportsDynamicImport);
- }
- function supportsTopLevelAwait(caller) {
- return !!(caller && caller.supportsTopLevelAwait);
- }
- var presetEnv = declare(function (api, opts) {
- api.assertVersion(7);
- var _normalizeOptions = normalizeOptions$4(opts),
- configPath = _normalizeOptions.configPath,
- debug = _normalizeOptions.debug,
- optionsExclude = _normalizeOptions.exclude,
- forceAllTransforms = _normalizeOptions.forceAllTransforms,
- ignoreBrowserslistConfig = _normalizeOptions.ignoreBrowserslistConfig,
- optionsInclude = _normalizeOptions.include,
- loose = _normalizeOptions.loose,
- modules = _normalizeOptions.modules,
- shippedProposals = _normalizeOptions.shippedProposals,
- spec = _normalizeOptions.spec,
- optionsTargets = _normalizeOptions.targets,
- useBuiltIns = _normalizeOptions.useBuiltIns,
- _normalizeOptions$cor = _normalizeOptions.corejs,
- corejs = _normalizeOptions$cor.version,
- proposals = _normalizeOptions$cor.proposals;
- var hasUglifyTarget = false;
- if (optionsTargets && optionsTargets.uglify) {
- hasUglifyTarget = true;
- delete optionsTargets.uglify;
- console.log("");
- console.log("The uglify target has been deprecated. Set the top level");
- console.log("option `forceAllTransforms: true` instead.");
- console.log("");
- }
- if (optionsTargets && optionsTargets.esmodules && optionsTargets.browsers) {
- console.log("");
- console.log("@babel/preset-env: esmodules and browsers targets have been specified together.");
- console.log("`browsers` target, `" + optionsTargets.browsers + "` will be ignored.");
- console.log("");
- }
- var targets = getTargets(optionsTargets, {
- ignoreBrowserslistConfig: ignoreBrowserslistConfig,
- configPath: configPath
- });
- var include = transformIncludesAndExcludes(optionsInclude);
- var exclude = transformIncludesAndExcludes(optionsExclude);
- var transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;
- var modulesPluginNames = getModulesPluginNames({
- modules: modules,
- transformations: moduleTransformations,
- shouldTransformESM: modules !== "auto" || !api.caller || !api.caller(supportsStaticESM$1),
- shouldTransformDynamicImport: modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport),
- shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait)
- });
- var pluginNames = filterItems(shippedProposals ? plugins$2 : pluginListWithoutProposals, include.plugins, exclude.plugins, transformTargets, modulesPluginNames, getOptionSpecificExcludesFor({
- loose: loose
- }), shippedProposals_1);
- removeUnnecessaryItems(pluginNames, overlappingPlugins$2);
- var polyfillPlugins = getPolyfillPlugins({
- useBuiltIns: useBuiltIns,
- corejs: corejs,
- polyfillTargets: targets,
- include: include.builtIns,
- exclude: exclude.builtIns,
- proposals: proposals,
- shippedProposals: shippedProposals,
- regenerator: pluginNames.has("transform-regenerator"),
- debug: debug
- });
- var pluginUseBuiltIns = useBuiltIns !== false;
- var plugins = Array.from(pluginNames).map(function (pluginName) {
- return [getPlugin(pluginName), {
- spec: spec,
- loose: loose,
- useBuiltIns: pluginUseBuiltIns
- }];
- }).concat(polyfillPlugins);
- if (debug) {
- console.log("@babel/preset-env: `DEBUG` option");
- console.log("\nUsing targets:");
- console.log(JSON.stringify(prettifyTargets(targets), null, 2));
- console.log("\nUsing modules transform: " + modules.toString());
- console.log("\nUsing plugins:");
- pluginNames.forEach(function (pluginName) {
- logPluginOrPolyfill(pluginName, targets, plugins$2);
- });
- if (!useBuiltIns) {
- console.log("\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.");
- } else {
- console.log("\nUsing polyfills with `" + useBuiltIns + "` option:");
- }
- }
- return {
- plugins: plugins
- };
- });
- var presetFlow = declare(function (api, _ref) {
- var all = _ref.all;
- api.assertVersion(7);
- return {
- plugins: [[transformFlowStripTypes, {
- all: all
- }]]
- };
- });
- var presetReact = declare(function (api, opts) {
- api.assertVersion(7);
- var pragma = opts.pragma || "React.createElement";
- var pragmaFrag = opts.pragmaFrag || "React.Fragment";
- var throwIfNamespace = opts.throwIfNamespace === undefined ? true : !!opts.throwIfNamespace;
- var development = !!opts.development;
- var useBuiltIns = !!opts.useBuiltIns;
- var useSpread = opts.useSpread;
- if (typeof development !== "boolean") {
- throw new Error("@babel/preset-react 'development' option must be a boolean.");
- }
- return {
- plugins: [[transformReactJSX, {
- pragma: pragma,
- pragmaFrag: pragmaFrag,
- throwIfNamespace: throwIfNamespace,
- useBuiltIns: useBuiltIns,
- useSpread: useSpread
- }], transformReactDisplayName, development && transformReactJSXSource, development && transformReactJSXSelf].filter(Boolean)
- };
- });
- var presetTypescript = declare(function (api, _ref) {
- var jsxPragma = _ref.jsxPragma,
- _ref$allExtensions = _ref.allExtensions,
- allExtensions = _ref$allExtensions === void 0 ? false : _ref$allExtensions,
- _ref$isTSX = _ref.isTSX,
- isTSX = _ref$isTSX === void 0 ? false : _ref$isTSX,
- allowNamespaces = _ref.allowNamespaces,
- allowDeclareFields = _ref.allowDeclareFields;
- api.assertVersion(7);
- if (typeof allExtensions !== "boolean") {
- throw new Error(".allExtensions must be a boolean, or undefined");
- }
- if (typeof isTSX !== "boolean") {
- throw new Error(".isTSX must be a boolean, or undefined");
- }
- if (isTSX && !allExtensions) {
- throw new Error("isTSX:true requires allExtensions:true");
- }
- var pluginOptions = function pluginOptions(isTSX) {
- return {
- jsxPragma: jsxPragma,
- isTSX: isTSX,
- allowNamespaces: allowNamespaces,
- allowDeclareFields: allowDeclareFields
- };
- };
- return {
- overrides: allExtensions ? [{
- plugins: [[transformTypeScript, pluginOptions(isTSX)]]
- }] : [{
- test: /\.ts$/,
- plugins: [[transformTypeScript, pluginOptions(false)]]
- }, {
- test: /\.tsx$/,
- plugins: [[transformTypeScript, pluginOptions(true)]]
- }]
- };
- });
- var scriptTypes = ["text/jsx", "text/babel"];
- var headEl;
- var inlineScriptCount = 0;
- function transformCode(transformFn, script) {
- var source;
- if (script.url != null) {
- source = script.url;
- } else {
- source = "Inline Babel script";
- inlineScriptCount++;
- if (inlineScriptCount > 1) {
- source += " (" + inlineScriptCount + ")";
- }
- }
- return transformFn(script.content, Object.assign({
- filename: source
- }, buildBabelOptions(script))).code;
- }
- function buildBabelOptions(script) {
- return {
- presets: script.presets || ["react", "es2015"],
- plugins: script.plugins || ["proposal-class-properties", "proposal-object-rest-spread", "transform-flow-strip-types"],
- sourceMaps: "inline"
- };
- }
- function run$1(transformFn, script) {
- var scriptEl = document.createElement("script");
- scriptEl.text = transformCode(transformFn, script);
- headEl.appendChild(scriptEl);
- }
- function load(url, successCallback, errorCallback) {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", url, true);
- if ("overrideMimeType" in xhr) {
- xhr.overrideMimeType("text/plain");
- }
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- if (xhr.status === 0 || xhr.status === 200) {
- successCallback(xhr.responseText);
- } else {
- errorCallback();
- throw new Error("Could not load " + url);
- }
- }
- };
- return xhr.send(null);
- }
- function getPluginsOrPresetsFromScript(script, attributeName) {
- var rawValue = script.getAttribute(attributeName);
- if (rawValue === "") {
- return [];
- }
- if (!rawValue) {
- return null;
- }
- return rawValue.split(",").map(function (item) {
- return item.trim();
- });
- }
- function loadScripts(transformFn, scripts) {
- var result = [];
- var count = scripts.length;
- function check() {
- var script, i;
- for (i = 0; i < count; i++) {
- script = result[i];
- if (script.loaded && !script.executed) {
- script.executed = true;
- run$1(transformFn, script);
- } else if (!script.loaded && !script.error && !script.async) {
- break;
- }
- }
- }
- scripts.forEach(function (script, i) {
- var scriptData = {
- async: script.hasAttribute("async"),
- error: false,
- executed: false,
- plugins: getPluginsOrPresetsFromScript(script, "data-plugins"),
- presets: getPluginsOrPresetsFromScript(script, "data-presets")
- };
- if (script.src) {
- result[i] = Object.assign({}, scriptData, {
- content: null,
- loaded: false,
- url: script.src
- });
- load(script.src, function (content) {
- result[i].loaded = true;
- result[i].content = content;
- check();
- }, function () {
- result[i].error = true;
- check();
- });
- } else {
- result[i] = Object.assign({}, scriptData, {
- content: script.innerHTML,
- loaded: true,
- url: script.getAttribute("data-module") || null
- });
- }
- });
- check();
- }
- function runScripts(transformFn, scripts) {
- headEl = document.getElementsByTagName("head")[0];
- if (!scripts) {
- scripts = document.getElementsByTagName("script");
- }
- var jsxScripts = [];
- for (var i = 0; i < scripts.length; i++) {
- var script = scripts.item(i);
- var type = script.type.split(";")[0];
- if (scriptTypes.indexOf(type) !== -1) {
- jsxScripts.push(script);
- }
- }
- if (jsxScripts.length === 0) {
- return;
- }
- console.warn("You are using the in-browser Babel transformer. Be sure to precompile " + "your scripts for production - https://babeljs.io/docs/setup/");
- loadScripts(transformFn, jsxScripts);
- }
- var isArray$4 = Array.isArray || function (arg) {
- return Object.prototype.toString.call(arg) === "[object Array]";
- };
- function loadBuiltin(builtinTable, name) {
- if (isArray$4(name) && typeof name[0] === "string") {
- if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) {
- return [builtinTable[name[0]]].concat(name.slice(1));
- }
- return;
- } else if (typeof name === "string") {
- return builtinTable[name];
- }
- return name;
- }
- function processOptions(options) {
- var presets = (options.presets || []).map(function (presetName) {
- var preset = loadBuiltin(availablePresets, presetName);
- if (preset) {
- if (isArray$4(preset) && typeof preset[0] === "object" && Object.prototype.hasOwnProperty.call(preset[0], "buildPreset")) {
- preset[0] = Object.assign({}, preset[0], {
- buildPreset: preset[0].buildPreset
- });
- }
- } else {
- throw new Error("Invalid preset specified in Babel options: \"" + presetName + "\"");
- }
- return preset;
- });
- var plugins = (options.plugins || []).map(function (pluginName) {
- var plugin = loadBuiltin(availablePlugins$1, pluginName);
- if (!plugin) {
- throw new Error("Invalid plugin specified in Babel options: \"" + pluginName + "\"");
- }
- return plugin;
- });
- return Object.assign({
- babelrc: false
- }, options, {
- presets: presets,
- plugins: plugins
- });
- }
- function transform$1(code, options) {
- return transform(code, processOptions(options));
- }
- function transformFromAst$1(ast, code, options) {
- return transformFromAst(ast, code, processOptions(options));
- }
- var availablePlugins$1 = {};
- var availablePresets = {};
- var buildExternalHelpers = babelBuildExternalHelpers;
- function registerPlugin(name, plugin) {
- if (Object.prototype.hasOwnProperty.call(availablePlugins$1, name)) {
- console.warn("A plugin named \"" + name + "\" is already registered, it will be overridden");
- }
- availablePlugins$1[name] = plugin;
- }
- function registerPlugins(newPlugins) {
- Object.keys(newPlugins).forEach(function (name) {
- return registerPlugin(name, newPlugins[name]);
- });
- }
- function registerPreset(name, preset) {
- if (Object.prototype.hasOwnProperty.call(availablePresets, name)) {
- if (name === "env") {
- console.warn("@babel/preset-env is now included in @babel/standalone, please remove @babel/preset-env-standalone");
- } else {
- console.warn("A preset named \"" + name + "\" is already registered, it will be overridden");
- }
- }
- availablePresets[name] = preset;
- }
- function registerPresets(newPresets) {
- Object.keys(newPresets).forEach(function (name) {
- return registerPreset(name, newPresets[name]);
- });
- }
- registerPlugins(all);
- registerPresets({
- env: presetEnv,
- es2015: preset2015,
- es2016: function es2016() {
- return {
- plugins: [availablePlugins$1["transform-exponentiation-operator"]]
- };
- },
- es2017: function es2017() {
- return {
- plugins: [availablePlugins$1["transform-async-to-generator"]]
- };
- },
- react: presetReact,
- "stage-0": presetStage0,
- "stage-1": presetStage1,
- "stage-2": presetStage2,
- "stage-3": presetStage3,
- "es2015-loose": {
- presets: [[preset2015, {
- loose: true
- }]]
- },
- "es2015-no-commonjs": {
- presets: [[preset2015, {
- modules: false
- }]]
- },
- typescript: presetTypescript,
- flow: presetFlow
- });
- var version$7 = "7.8.3";
- function onDOMContentLoaded() {
- transformScriptTags();
- }
- if (typeof window !== "undefined" && window && window.addEventListener) {
- window.addEventListener("DOMContentLoaded", onDOMContentLoaded, false);
- }
- function transformScriptTags(scriptTags) {
- runScripts(transform$1, scriptTags);
- }
- function disableScriptTags() {
- window.removeEventListener("DOMContentLoaded", onDOMContentLoaded);
- }
- exports.availablePlugins = availablePlugins$1;
- exports.availablePresets = availablePresets;
- exports.buildExternalHelpers = buildExternalHelpers;
- exports.disableScriptTags = disableScriptTags;
- exports.registerPlugin = registerPlugin;
- exports.registerPlugins = registerPlugins;
- exports.registerPreset = registerPreset;
- exports.registerPresets = registerPresets;
- exports.transform = transform$1;
- exports.transformFromAst = transformFromAst$1;
- exports.transformScriptTags = transformScriptTags;
- exports.version = version$7;
- Object.defineProperty(exports, '__esModule', { value: true });
- })));
|